refactor(maestro): shape the replay backend as a create(host) plugin
Ā
TH
1h ago+607+607+012345678901234567890123456789-314-314-012345678901234567890123456789
Summary
Second half of the #3377 replay-backend prep. Stacks on #3622 (base is its branch; retarget to main once it merges). Behavior, wire shapes, help text and error wording are unchanged; the backend still resolves once per process (ADR 0015).
- The Maestro adapter moved from replay-port into
packages/maestro/src/replay-backend/and ships asReplayBackendPlugin = { declaration, create(host) }(@agent-device/maestro/replay-backend), with an engine-free declaration (.../replay-backend-declaration). ReplayBackendHost(built inreplay-backend-host.ts) is the only way the adapter reaches process state or daemon policy: trace append, builtin vars, script-source read, target-device resolution, request signal, and the divergence-failure builder from #3622.- The registry loads the plugin through a function-scoped import and calls
create(host)once.replay-backend-declarations.tsholds the declaration table, so the registry's eager closure does not grow. help maestroreads its topic from the declaration, socli-helpno longer imports the engine.- Failure tests now drive the plugin through
getReplayBackend('maestro'); two warnings checks became unit tests. - Dropped the unused
./daemon-runtime-portexport. - Only the two replay-port files above name
@agent-device/maestroin production (scripts/fuzzstill does).
32 files touched. Sign-off needed: the APPROVED_OVER_CEILING row for replay-maestro-backend.ts names thymikee as owner, so it needs his approval.
Refs #3377.
Validation
Tested SHA: a12c6ab513.
pnpm check:affected --base <layer-1 branch> --run: all runnable checks passed.pnpm check:quickand focused vitest (replay-port, maestro, daemon sessions, CLI help/MCP, startup closure, closure budgets) passed.- Diff against the layer-1 branch: +607/ā314. A
-M90%stat shows more because several moved files are 80ā91% similar after the host rewrite. - Coverage, provider integration and
maestro-differentialare CI-authoritative.
š¤ Generated with Claude Code