Forum teuk.org

πŸš‚ MB678-I β€” Partyline Transport Gets Its Own Platform

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

TeuK Β· 3d ago

Mediabot v3 continues the gradual modularization of the historical Partyline subsystem.

For MB678-I, the TCP/DCC transport layer has been extracted from:

Mediabot/Partyline.pm

into a dedicated module:

Mediabot/Partyline/Transport.pm

This first Partyline round was intentionally narrow.

Session lifecycle, authentication and Partyline commands remain in Mediabot/Partyline.pm for now. The goal was to establish one clean architectural boundary at a time instead of mixing several risky refactors into a single change.

πŸ—οΈ What moved

The new transport module now owns the TCP/DCC-facing responsibilities, including:

  • active DCC chat handling;
  • passive DCC chat handling;
  • listener startup;
  • DCC offer tracking;
  • offer timeout cleanup;
  • peer IP handling;
  • IPv4 / IPv6 transport handling;
  • input extraction and size guards;
  • safe line dispatch;
  • transport error reporting;
  • DCC session initialization;
  • public IP / listen port resolution;
  • DCC token hint masking support.

A total of 19 transport methods were moved.

The historical Mediabot::Partyline method surface remains available through imports, so existing callers do not need to know that the implementation moved.

πŸ“ Structural result

Before MB678-I:

Mediabot/Partyline.pm : 6976 lines

After MB678-I:

Mediabot/Partyline.pm            : 6041 lines
Mediabot/Partyline/Transport.pm  : 1012 lines

This removes roughly 935 lines of transport implementation from the Partyline monolith while keeping session, authentication and commands untouched.

A dedicated extraction contract was added:

t/cases/862_mb678_partyline_transport_extraction.t

πŸ§ͺ Validation

The extraction went through targeted transport/DCC validation first.

Focused transport tests

PASSED : 573/573

The exported-symbol contract was also validated independently:

PASSED : 368/368

DCC sample configuration contract

The existing DCC configuration test initially still inspected only Partyline.pm.

After the transport extraction, the contract was updated to inspect the complete Partyline transport surface:

Partyline.pm
+
Partyline/Transport.pm

Validation:

PASSED : 13/13

No runtime behaviour was changed by this adjustment.

πŸ›‘οΈ Security audit

The security audit also contained a historical source-location assumption for the DCC token masking helper.

The invariant itself was preserved unchanged: _dcc_token_hint must still exist and be used.

The audit now evaluates the complete Partyline layer instead of assuming that all transport code must live inside a single file.

Final result:

Verdict: GO β€” all 11 security invariants hold.

And the dedicated audit regression test passed:

PASSED : 19/19

The security contract remains fail-closed.

🌐 Real runtime validation

The development instance was restarted with the extracted transport module.

The Partyline listener was verified on the real service:

0.0.0.0:23456 LISTEN

A real TCP smoke test connected to the Partyline listener without sending credentials and received the expected banner:

Mediabot Partyline

Please enter your nickname.

Result:

RC_SMOKE=0

This validates the actual path through the listener, socket/session initialization and first transport writes.

Runtime logs were also checked:

OK: no obvious runtime error

⚑ Fast suite

After the contract updates:

PASSED : 5550/5550  (64s)

πŸ§™ Full suite

Final full validation:

PASSED : 14462/14462  (207s)

No test was removed, hidden or weakened to make the extraction pass.

🧹 Why this matters

Mediabot/Partyline.pm still contains several distinct responsibilities:

transport
session lifecycle
authentication
Partyline commands

MB678-I separates the first of those responsibilities without attempting a dangerous all-at-once rewrite.

The transport layer now has a dedicated home, while the historical Partyline API and runtime protocol remain unchanged.

That gives future Partyline work a much cleaner starting point and makes each following extraction easier to validate and bisect independently.

The train is still running the same route.

The transport machinery simply has its own platform now. πŸš‚

πŸ“¦ Commit

Version : 3.4dev-20260820_151203
Commit  : 25949c5

πŸš‚ Move Partyline Transport Onto Its Own Platform Without Changing the Route

You must be logged in to reply.