fix(recording): publish outputs only from the committing stop

Merged
TH
2h ago
+234-8

Summary

Only the stop that commits a recording's durable fence publishes the recording's outputs. A replayed stop or close never publishes a committed record for the first time, and recovery never publishes. A test --record-video suite publishes during cleanup only when its stop committed; the per-daemon SessionStore records those commits. A remote leased caller controls when it sends stop and close, so a replay could follow a commit whose own publication never ran.

Before / after

  • Live record stop replaying a committed record: 0.22 published it. Now no publication; the existing RESOURCE_EXPIRED refusal.
  • Close or suite cleanup replaying a committed record: 0.22 published it. Now nothing is published.
  • Later stop after recovery settled the record: unchanged LEASE_OUTPUT_MISMATCH. Tenant, lease, reservation and completedAt + TTL expiry checks are unchanged.

Validation

Head 9a8ae0eaf5. Production vs origin/0.22: about +44/-7.

  • pnpm exec vitest run --project unit-core on recording-outputs, record-runtime-orphan-recovery, record-runtime-stop-recovery session-test-suite-command-video and capture-kit transitions tests: pass. tsc -b packages/daemon clean.
  • Revert proofs: restoring the stop-live gate, the teardown gate, or an unconditional suite commit each fails its new test.
  • Hosted CI owns lint, Coverage and integration. No device runs.