Forum teuk.org

πŸ“– MB667 β€” Open the Hogwarts Yearbook and Chronicle a Channel's Story

in Mediabot Β· started by TeuK Β· 4d ago

TeuK Β· 4d ago

Version: 3.4dev-20260819_060618
Commit: 2f42db5

Mediabot has been collecting channel history for years.

With MB667, that history finally becomes a story.

πŸͺ„ New command: yearbook

m yearbook
m yearbook YYYY

Without an argument, Mediabot selects the last completed calendar year.

A specific year can also be requested explicitly:

m yearbook 2025
m yearbook 2024

The result is a compact retrospective of the channel rather than another raw statistics dump.

πŸ“š What the Yearbook remembers

A Yearbook combines several pieces of existing channel history:

  • πŸ’¬ total messages
  • πŸ‘₯ distinct voices
  • πŸ—“ busiest month
  • πŸ”₯ busiest day
  • πŸ•˜ busiest hour
  • πŸ‘‘ top voices
  • πŸ“œ quotes added
  • πŸ“š factoids learned

A real development run on #radiocapsule produced:

πŸ“– #radiocapsule Yearbook β€” 2026 Β· year to date
πŸ’¬ 9.6k msgs Β· πŸ‘₯ 42 voices Β· πŸ—“ busiest month: Mar (2.4k)
πŸ”₯ peak day: Apr 2 (200 msgs) Β· πŸ•˜ peak hour: 08:00–09:00 (865 msgs)
πŸ‘‘ top voices: Balibalo 4.0k Β· mediacaps 3.0k Β· Te[u]K 846
πŸ“œ 7 quotes added Β· πŸ“š 0 factoids learned Β· πŸ—“ recorded Feb 24–Aug 18

The command deliberately stays compact: five IRC lines maximum.

πŸ•°οΈ History that knows when it is incomplete

A Yearbook must not pretend that partial history is complete.

MB667 therefore distinguishes between:

completed year
year to date
partial historical coverage
no usable data

For the current year, the output explicitly says:

year to date

For an incomplete historical year, Mediabot reports the actual recorded range.

And if no usable history exists, the command fails cleanly instead of generating a fake empty retrospective.

πŸ—„οΈ Archive-aware by design

This part matters.

Before implementing MB667, the real Undernet production history was inspected in read-only mode.

For #quebec, archive data reaches back to 2018.

The archive contains millions of historical rows, while newer history continues in the live CHANNEL_LOG.

The 2024 history demonstrates the boundary clearly:

archive β†’ Jan 1 to Aug 18
live    β†’ Aug 18 to Dec 31

MB667 does not invent a second historical system.

It reuses Mediabot’s existing archive-aware history layer so Yearbook can work across that boundary.

πŸ“– A real 2025 chapter

The complete 2025 history for #quebec contains:

19,177 messages
997 distinct voices

The real read-only analysis found, among other things:

Busiest month : January β€” 2,686 msgs
Busiest day   : December 26 β€” 747 msgs
Peak hour     : 16:00–17:00 β€” 1,759 msgs

Top voices included:

`^AN|M4L^` β€” 1,610
Al3NuNiX   β€” 1,501
tireg      β€” 950

That is exactly the sort of long-term community memory the Yearbook is designed to surface.

βš™οΈ Bounded, asynchronous, and deliberately boring underneath

The visible result is rich, but the implementation remains constrained.

MB667 uses:

2 bounded archive-aware history gathers
1 quote/factoid query
CommandAsync
60-second parent-side cooldown

And deliberately adds:

no database schema change
no migration
no new configuration key
no new persistence layer
no ORDER BY RAND()

The feature is built by connecting infrastructure that already exists.

πŸ”§ Full-suite findings

The complete validation pass also exposed two older assumptions outside the new Yearbook code.

MB666 awards still contained real UNION ALL SQL, which violated the archive-history regression contract. The queries were rewritten while preserving the existing bounded 7d/30d behavior.

The MB577 gather-scope regression also depended on formatting around a multiline call. That check is now whitespace-insensitive instead of treating harmless layout changes as missing scope declarations.

Focused validation after those corrections:

PASSED : 225/225
RC=0

And the complete Mediabot suite:

PASSED : 13784/13784
RC=0
Runtime: 956s

That last number is also useful engineering data: the full suite is now close to 16 minutes, so test-suite acceleration remains an explicit performance target for a later round.

πŸ—ΊοΈ From logs to memories

The recent sequence is becoming clearer:

  • MB664 β€” Memory revisits a moment from channel history.
  • MB665 β€” Community Footprint connects profiles to shared contributions.
  • MB666 β€” Awards celebrates recent roles in the community.
  • MB667 β€” Yearbook turns an entire year into a compact retrospective.

The goal is not to keep adding disconnected commands.

It is to make Mediabot increasingly capable of understanding and retelling the life of the communities it has been part of for years.

The castle kept the records.

Now Mediabot can open the Yearbook. πŸ“–βœ¨

You must be logged in to reply.