Skip to content

feat(cua): subject provisioning phase events - kill the silent boot#268

Merged
danielgwilson merged 1 commit into
mainfrom
feat/subject-phase-events
Jul 8, 2026
Merged

feat(cua): subject provisioning phase events - kill the silent boot#268
danielgwilson merged 1 commit into
mainfrom
feat/subject-phase-events

Conversation

@danielgwilson

Copy link
Copy Markdown
Owner

Closes #263.

A single-lane provisioned run printed nothing between invocation and exit for up to 25+ minutes (clone 5m + install 10m + build 10m + ready 3m budgets; zero output in the provisioning pipeline). Operators could not tell priming from hung. Todays real-app local-tree validation ledger hit exactly this: every failed iteration was slower to diagnose because installs were silent.

What

  • SubjectPhaseEvent + injectable onPhase hook threaded through the shared provisioning pipeline and both provisioning routes: started/completed at subject.clone / subject.upload / subject.extract / subject.install / subject.build / subject.serve.started / subject.ready / subject.state.<when> boundaries. One event per boundary, never per poll tick.
  • Default sink: one stderr line per event (lane-prefixed when fan-out width > 1), overridable via CuaActorLabHooks.onPhase and SharedWorldLabHooks.onPhase. stdout JSON purity untouched.
  • Completed-phase trail persists into bundle.events (existing RunEvent shape, cua-lab.subject.* types, durationMs in the message, level warn on failure). No schema change.

Review

Implemented + hostile-reviewed + fixed in-branch: the review's two medium findings (missing shared-world DI seam with untested unconditional stderr; zero fan-out coverage) are fixed with a seam + 2-lane attribution test proving no cross-lane leakage. Two lows accepted and noted: direct stderr (matches the existing emitPreflightPlan precedent; CliIo threading is tracked under #262 territory), and the rerun-subset lane-prefix cosmetic.

Proof

  • pnpm check: 873 passed / 10 skipped, build OK.
  • pnpm public-surface:scan: ok (428 files).
  • New tests: ordered clone-route sequence, local-tree upload/extract sequence, failing extract emits ok:false, persisted bundle trail, 2-lane fan-out attribution, shared-world + concurrent captured sequences; shared-world test suites now run with zero phase-chatter on real stderr.

🤖 Generated with Claude Code

…263)

Emits started/completed events at every provisioning phase boundary
(clone / upload / extract / install / build / serve start / readiness /
seed-step groups) through an injectable onPhase hook, with a default
stderr sink (lane-prefixed under fan-out), and persists the completed
trail into bundle.events using the existing RunEvent shape. Shared-world
routes gain the same seam via SharedWorldLabHooks.onPhase.

A single-lane provisioned run previously printed nothing between command
start and exit for up to 25+ minutes of clone/install/build budgets.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@danielgwilson danielgwilson merged commit 2918574 into main Jul 8, 2026
3 checks passed
@danielgwilson danielgwilson deleted the feat/subject-phase-events branch July 8, 2026 20:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[agent] Lifecycle phase events: single-lane provisioned runs are silent for the entire boot

1 participant