Forum teuk.org

📡 MB678-IV-H — Give Partyline Network Stats Their Own Observatory Without Losing the Signal

in Mediabot · started by TeuK · 2d ago

TeuK · 2d ago

MB678 continues the progressive decomposition of Mediabot’s Partyline subsystem.

After transport, session/authentication, dispatch, plugin commands, core operator commands, scheduler/operational commands, channel/network visibility, reminder/seen commands, Karma commands, and configuration reload commands, MB678-IV-H extracts the remaining lightweight network/statistics Partyline commands.

The scope remains deliberately narrow: move .lusers and .stats together without pulling in the much larger AI command family or unrelated IRC lifecycle operations.


📡 What moved

MB678-IV-H moves the following methods from:

Mediabot/Partyline.pm

into:

Mediabot/Partyline/Commands.pm

Methods moved:

_cmd_lusers
_cmd_stats

This family covers:

  • cached IRC network statistics from LUSERS numerics;
  • optional immediate LUSERS refresh requests;
  • per-channel top speakers;
  • per-channel Karma leaderboard visibility.

The large _cmd_ai command remains intentionally in Partyline.pm for a dedicated later extraction round.


🧱 Structural result

Before MB678-IV-H:

Mediabot/Partyline.pm          : 2617 lines
Mediabot/Partyline/Commands.pm : 2552 lines

After MB678-IV-H:

Mediabot/Partyline.pm             : 2506 lines
Mediabot/Partyline/Commands.pm    : 2674 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 now stands at:

2506 lines

🧪 Focused validation

A new extraction contract was added:

t/cases/873_mb678_partyline_network_stats_commands_extraction.t

Previous extraction-boundary contracts were updated:

t/cases/870_mb678_partyline_karma_commands_extraction.t
t/cases/872_mb678_partyline_reload_commands_extraction.t

Targeted validation covered:

629
741
870
872
873

Result:

PASSED : 102/102

The historical method surface was explicitly checked for:

_cmd_lusers
_cmd_stats

Result:

2/2 resolved through Mediabot::Partyline

📡 .lusers behaviour preserved

The extracted .lusers command keeps the existing behaviour for:

  • cached network statistics;
  • users/users_max;
  • channels;
  • servers;
  • operators;
  • cache age;
  • manual refresh requests;
  • disconnected refresh reporting.

Historical MB544 source markers remain preserved.

No network-statistics semantics changed.


📊 .stats behaviour preserved

The extracted .stats command continues to provide:

  • channel selection;
  • fallback to the first joined channel;
  • top message senders;
  • Karma top entries;
  • existing no-channel usage response.

The central cached channel lookup remains:

Mediabot::Helpers::channel_id_cached($bot, $chan)

No schema access path or Karma behaviour changed.


⚡ Fast suite with progress

Validation used the MB679 progress mode:

perl t/test_commands.pl --fast --progress

The runner selected:

320 of 756 discovered test files

Result:

[====================] 100% [320/320 files | 5830 tests]

PASSED : 5830/5830  (65s)

🛡️ Security audit

The security audit remained completely green:

RC_AUDIT=0
Verdict: GO — all 11 security invariants hold.

No security invariant was weakened by the extraction.


🔌 Real runtime validation

The development service restarted successfully:

mediabot@dev : active

The Partyline listener remained available on:

0.0.0.0:23456

A real TCP smoke test produced:

Mediabot Partyline
Please enter your nickname.
Enter your password.

Result:

RC_SMOKE=0

No obvious runtime errors appeared in the journal.


🏰 Full suite with progress

The complete regression suite passed cleanly:

perl t/test_commands.pl --progress

Result:

[====================] 100% [756/756 files | 14785 tests]

PASSED : 14785/14785  (210s)

No source-contract repair round was needed after the full suite.


🧠 Why this matters

.lusers and .stats form a natural lightweight observability family inside Partyline.

Moving them together improves the architecture without dragging in unrelated lifecycle or AI code.

The Partyline subsystem now has increasingly clear responsibility boundaries for:

  • transport;
  • session/authentication;
  • dispatch;
  • plugin commands;
  • core operator/session commands;
  • scheduler/operational commands;
  • channel/network visibility commands;
  • reminders and seen-history commands;
  • Karma commands;
  • configuration reload commands;
  • network statistics commands.

No network signal was lost.

No statistics changed.

The observatory simply moved into its own tower.


📦 Commit

Version : 3.4dev-20260821_094515
Commit  : 702bcd6
Branch  : master

📡 Give Partyline Network Stats Their Own Observatory Without Losing the Signal

Commit summary:

6 files changed
200 insertions
127 deletions

New test:

t/cases/873_mb678_partyline_network_stats_commands_extraction.t

The commit was successfully pushed to GitHub.


📡 The signal never moved. We just gave the telescope its own tower.

You must be logged in to reply.