MB678 continues the progressive decomposition of Mediabot’s Partyline subsystem.
This round extracts the compact IRC control and lifecycle command family from the historical Mediabot::Partyline parent while deliberately leaving unrelated operator commands and the much larger AI family untouched.
The goal remains the same: reduce the monolith without changing protocol, permissions, command behaviour, or the historical Mediabot::Partyline::* method surface.
MB678-IV-I moves six methods from:
Mediabot/Partyline.pm
into:
Mediabot/Partyline/Commands.pm
Methods moved:
_cmd_join
_cmd_part
_cmd_nick
_cmd_raw
_cmd_rehash
_cmd_restart
Together they form a coherent IRC control/lifecycle family:
The following remain intentionally in Partyline.pm for later rounds:
_cmd_say
_cmd_who
_cmd_eval
_cmd_ai
Before MB678-IV-I:
Mediabot/Partyline.pm : 2506 lines
Mediabot/Partyline/Commands.pm : 2674 lines
After MB678-IV-I:
Mediabot/Partyline.pm : 2354 lines
Mediabot/Partyline/Commands.pm : 2844 lines
Mediabot/Partyline/Dispatcher.pm : 407 lines
Mediabot/Partyline/SessionAuth.pm : 676 lines
Mediabot/Partyline/Transport.pm : 1012 lines
The original pre-MB678 Partyline.pm contained:
6976 lines
It is now down to:
2354 lines
The reduction is increasingly significant, but each round remains intentionally narrow and independently validated.
The extraction keeps the existing behaviour and privilege boundaries.
.joinPreserved:
joinChannel($chan, $key) path;The source-contract test:
t/cases/346_join_channel_key_redacted.t
was adapted so it can locate _cmd_join after modularization.
The key itself is still passed to IRC while logs continue to display only:
key: [redacted]
.partPreserved:
"Partyline requested part" reason;.nickPreserved:
change_nick() path..rawPreserved:
.rehashPreserved:
.restartPreserved:
No command syntax or permission model changed.
A new structural/behaviour contract was added:
t/cases/874_mb678_partyline_irc_control_commands_extraction.t
It verifies that all six implementations moved exactly once into Commands.pm, while their historical methods remain reachable through Mediabot::Partyline.
It also protects key behavioural invariants for:
.join
.part
.nick
.raw
.rehash
.restart
and explicitly confirms that IV-I does not broaden into:
_cmd_ai
_cmd_say
_cmd_who
Focused validation:
346
873
874
Result:
PASSED : 75/75
Historical surface validation:
_cmd_join
_cmd_part
_cmd_nick
_cmd_raw
_cmd_rehash
_cmd_restart
Result:
6/6 available through Mediabot::Partyline
The MB679 progress mode was used directly:
perl t/test_commands.pl --fast --progress
Selection:
321 of 757 discovered test files
Result:
[====================] 100% [321/321 files | 5875 tests]
PASSED : 5875/5875 (65s)
The development instance restarted successfully:
mediabot@dev : active
The Partyline listener remained available on:
0.0.0.0:23456
A real TCP smoke test returned:
Mediabot Partyline
Please enter your nickname.
Enter your password.
Result:
RC_SMOKE=0
The journal showed no obvious runtime errors after restart.
The security audit remained completely green:
RC_AUDIT=0
Verdict: GO — all 11 security invariants hold.
In particular, the extraction did not weaken authentication, command authorization, or existing transport protections.
The complete suite was executed with progress enabled:
perl t/test_commands.pl --progress
Result:
[====================] 100% [757/757 files | 14830 tests]
PASSED : 14830/14830 (210s)
No follow-up source-contract repair was required.
The six commands extracted here all operate directly on the IRC connection or its lifecycle.
Keeping them together gives Commands.pm a clearer responsibility boundary while reducing the amount of operational logic still embedded in the Partyline parent.
The subsystem now has distinct areas for:
Most importantly, the refactoring keeps following the same rule:
Move responsibility.
Preserve behaviour.
Validate every boundary.
Version : 3.4dev-20260821_100903
Commit : fad3dd3
Branch : master
🧭 Give Partyline IRC Control Its Own Command Deck Without Changing the Course
Commit summary:
5 files changed
276 insertions
161 deletions
New test:
t/cases/874_mb678_partyline_irc_control_commands_extraction.t
The commit was successfully pushed to GitHub.
🧭 The helm moved to its own deck. The ship kept exactly the same course.
You must be logged in to reply.