Expand description
The stderr line protocol agentmux-srv uses to talk to whichever process
supervises it — the launcher in packaged builds and task dev
(crates/launcher/src/srv_spawner.rs), or the CEF host in
task dev:standalone (crates/cef/src/sidecar.rs).
srv formats these lines; both supervisors parse them. Putting the
vocabulary here means one definition instead of three string literals that
have to stay byte-identical by convention (the “keep in sync” pattern
docs/reports/REPORT_DRY_AND_MODULARITY_AUDIT_2026_09_06.md §2 counts 334
instances of).
Every line is single-line and prefix-tagged. In startup order:
AGENTMUXSRV-MIGRATING migrations:<n>— in-process migrations are about to run; supervisors extend their ESTART deadline. (Still emitted and parsed with inline literals at the three sites above — not migrated to this module yet; only the new line below lives here.)AGENTMUXSRV-MIGRATION-BEGIN id:<id> description:<text>/AGENTMUXSRV-MIGRATION-END id:<id> duration_ms:<n>— one pending migration is starting / has finished, inside theAGENTMUXSRV-MIGRATINGwindow above. Before these existed, a slow migration was invisible past the initial count — the splash showed a bare, silently-running “Backend startup” clock with no indication anything unusual (a multi-minute migration) was happening inside it. Seedocs/reports/REPORT_SPLASH_SCREEN_ARCHITECTURE_RETHINK_2026_09_14.md§2.1. Only the launcher supervisor turns these into splash sub-rows (against the already-openbackendstage — a migration is not a separate top-level stage, it happens entirely inside that one); the CEF-host sidecar has no splash to report to and simply logs them like any other stderr line, same as it already did for the unparsed line before this existed.AGENTMUXSRV-MIGRATION-FAILED error:<text>— a migration failed and srv is about to exit 1 without emitting ESTART. Added by Phase 1 ofdocs/specs/SPEC_MIGRATION_SYSTEM_HARDENING_2026_08_03.md; before it, a failed migration was awarn!and srv booted anyway against a store in an unknown state.AGENTMUXSRV-ESTART ...— ready. Parsed separately by each supervisor; unchanged.
Structs§
- Migration
Begin - A parsed
MIGRATION_BEGIN_PREFIXline. - Migration
End - A parsed
MIGRATION_END_PREFIXline.
Constants§
- MIGRATION_
BEGIN_ PREFIX - Prefix of the line srv writes to stderr just before applying one pending migration.
- MIGRATION_
END_ PREFIX - Prefix of the line srv writes to stderr just after one migration applies
successfully. (No
-ENDline is written on failure —up()returningErrgoes straight toAGENTMUXSRV-MIGRATION-FAILEDand srv exits.) - MIGRATION_
FAILED_ PREFIX - Prefix of the line srv writes to stderr immediately before exiting 1
because
run_pending_migrationsfailed. Supervisors match on this to fail fast with the real reason instead of waiting out the ESTART timeout.
Functions§
- migration_
begin_ line - Migration ids (
m.id(), e.g."0020_agent_color_backfill") are a fixed, engineer-chosen identifier format with no spaces — never free text — so splittingid:<id> description:<text>on the first space is safe and exact, unlikedescriptionitself which is flattened viaone_line. - migration_
end_ line - migration_
failed_ line - Format the failure line srv emits. The error text is flattened to a single line (the protocol is line-delimited; a multi-line SQLite error would otherwise split into one tagged line and several untagged ones).
- parse_
migration_ begin_ line - Parse a
MIGRATION_BEGIN_PREFIXline.Nonefor any other line, or a begin line missing theid:field it cannot be meaningfully split without. - parse_
migration_ end_ line - Parse a
MIGRATION_END_PREFIXline.Nonefor any other line, a malformed one, or a non-numeric/missingduration_ms:field. - parse_
migration_ failed_ line - Parse a stderr line. Returns the error message if this is a
MIGRATION_FAILED_PREFIXline,Nonefor any other line. Tolerates a missingerror:field and never returns an empty message, so callers can put the result straight into a user-facing dialog.