Version: 3.4dev-20260819_131425
Commit: c0eda2d
Mediabotβs social and history features have grown steadily over the last several releases.
That was good for the bot.
It was becoming much less good for one file:
Mediabot/UserCommands.pm
Before MB670, that module had reached:
13,746 lines
MB670 starts fixing that architectural pressure without changing the public command surface.
The goal was not to redesign the commands.
The goal was to give them a proper home.
MB670 introduces:
Mediabot/SocialHistory.pm
The following command families now live there:
profil
dashboard
mood
leaderboard
chronos
recap
onthisday
memory
milestone
awards
yearbook
After the extraction:
Mediabot/UserCommands.pm : 11,065 lines
Mediabot/SocialHistory.pm: 2,831 lines
So UserCommands.pm immediately loses almost 2,700 lines of social/history implementation.
This refactor deliberately keeps the historical API surface intact.
Existing symbols such as:
Mediabot::UserCommands::mbProfil_ctx
Mediabot::UserCommands::mbMemory_ctx
Mediabot::UserCommands::mbAwards_ctx
Mediabot::UserCommands::mbYearbook_ctx
remain available.
The public dispatch also stays unchanged.
That means existing command routing, help, callers and compatibility assumptions do not suddenly have to learn a new namespace.
The implementation moves.
The public contract does not.
MB670 was intentionally split into two internal passes.
The first moved:
memory
awards
yearbook
That reduced UserCommands.pm from:
13,746
to:
13,091 lines
The second pass moved the rest of the targeted block:
profil
dashboard
mood
leaderboard
chronos
recap
onthisday
milestone
Final result:
UserCommands : 11,065 lines
SocialHistory: 2,831 lines
This avoided a single blind multi-thousand-line move.
The first extraction passed:
PASSED : 772/772
RC=0
The complete MB670 focused regression then passed:
PASSED : 1566/1566
RC=0
Runtime: 15s
Coverage included dispatch integrity, archive/history helpers, profile, recap, mood, OnThisDay, milestone, Community Footprint, Memory, Awards, Yearbook and module structure.
A refactor like this exposed an important class of old tests.
Several tests were not checking behavior.
They were checking things like:
"this exact implementation must physically exist in UserCommands.pm"
That assumption stopped being true after MB670.
The application was still correct.
The tests were looking in the wrong file.
Examples included tests for:
public/action filters
factoid/channel predicates
OnThisDay sargable date ranges
leaderboard layout
dashboard formatting
achievement presentation APIs
profile hidden-achievement counts
Community Footprint identity resolution
Those structural tests were updated to follow the real owner of the implementation:
Mediabot/SocialHistory.pm
instead of assuming everything belongs in UserCommands.pm.
The second extraction initially reported seven failures.
They came from three stale test assumptions:
567 : public/action filters counted only in UserCommands.pm
694 : test source switched entirely to SocialHistory.pm,
even though factoid handlers still live in UserCommands.pm
852 : Perl delete() was mistaken for a DELETE SQL statement
No application code needed changing.
After correcting those test guards:
PASSED : 113/113
and then:
PASSED : 1566/1566
The first fast run exposed one more stale structural assertion:
811_mb628_precommit_runtime_test_coherence.t
The test still expected the OnThisDay sargable range to exist inside UserCommands.pm.
It now lives in SocialHistory.pm.
Again:
application code changed: NO
Targeted correction:
PASSED : 9/9
Then the full fast lane:
PASSED : 5194/5194
RC=0
Runtime: 171s
The refactor was also validated on the development bot with real IRC commands.
The following commands all responded correctly:
m profile
m profil
m memory
m awards 7d
m yearbook 2026
m recap
Examples included:
π #radiocapsule Awards β last 7 days
and:
π #radiocapsule Yearbook β 2026 Β· year to date
as well as the enriched profile and channel-memory paths.
That confirmed the new module was not merely compiling β the real command dispatch still worked after restart.
During the m memory smoke test, an old message appeared as:
mΓΒͺme
The MB670 extraction was checked against the pre-refactor snapshot.
The relevant _memory_lines implementation was unchanged character-for-character.
So the mojibake was not introduced by this refactor.
It remains separate technical debt rather than being mixed into MB670.
Because MB670 moves thousands of lines and touches many structural tests, a complete test suite was run before commit.
The first full run reported:
FAILED : 35/13953
Those 35 failures were concentrated in only seven test files:
650 : 1
793 : 2
810 : 10
812 : 18
826 : 2
840 : 1
851 : 1
Every one of them had the same architectural cause:
the test still inspected UserCommands.pm
after the implementation had moved to SocialHistory.pm
No application-code correction was required.
The seven affected tests were updated to follow the new implementation ownership.
The exact failing set was then replayed:
PASSED : 204/204
RC=0
The correction explicitly left:
Mediabot/UserCommands.pm
Mediabot/SocialHistory.pm
unchanged.
So the failed full suite led to test-maintenance fixes, not emergency runtime changes.
The complete Mediabot suite was then run again.
Final result:
PASSED : 13953/13953
RC=0
Runtime: 769s
That is the certification result for MB670.
The README now makes the ownership explicit.
New work for:
profil
dashboard
mood
leaderboard
chronos
recap
onthisday
memory
milestone
awards
yearbook
belongs in:
Mediabot::SocialHistory
and should not make UserCommands.pm grow again.
The old namespace remains available for compatibility.
MB670 introduces:
no database schema change
no migration
no configuration change
no service change
no systemd change
This is an architectural refactor only.
The final commit contains:
42 files changed
3192 insertions
2904 deletions
including the new files:
Mediabot/SocialHistory.pm
t/cases/852_mb670_social_history_extraction.t
and the automatically updated VERSION.
c0eda2d
π° Move the Social Chronicles Into Their Own Hogwarts Wing
Version:
3.4dev-20260819_131425
This round adds almost no visible feature to Mediabot.
That is precisely why it matters.
Before MB670:
new social feature
β
more code in UserCommands.pm
β
harder review
β
higher regression risk
After MB670:
social/history work
β
Mediabot::SocialHistory
β
smaller ownership boundary
β
faster review and safer evolution
The castle did not gain another spell today.
It gained a new wing so the next spells have somewhere sane to live. π°β¨
You must be logged in to reply.