refactor: bind daemon captures to session lifetimes

Closed
TH
2mo ago
+5161-2432

Summary

Snapshots, selectors and interaction captures now retain the session lifetime they were admitted for. A rebuild remains writable; retirement or daemon shutdown refuses late publication. Settle ref issuance resolves that same lifetime before activating the frame, so returned refs belong to the current snapshot.

The runtime projection owns the reference and refreshes records within its lifetime. Snapshot transitions stay in their owning module. Removes redundant store resets and the interaction capture's reverse name lookup. 43 files; 925 gross lines. Part of #3116, stacked on #3140.

flowchart LR
  C[Capture a session ref] --> R[Resolve its lifetime]
  R -->|current| U[Update observation and refs]
  R -->|retired| E[Refuse publication]
  D[Sessionless capture] --> A[Check admission and vacancy]
  A --> P[Publish a new lifetime]

Validation

Head 1c3da4c2c6: pnpm check:affected --base refactor/session-journal-lifetimes --run passed, including 1,613 related tests; parent-scoped Fallow passed. Seven planted regressions failed their intended assertions and the restored implementation passed.

Controls cover a held real touch-settle continuation, scoped address reuse, intervening rebuilds, and late capture completion after actual request cancellation and bounded daemon-session teardown.

Independent read-only review found no remaining actionable findings. CI and live device validation remain pending on this head.