refactor: bind action recording to session lifetimes

Closed
TH
2mo ago
+675-284

Summary

Action recording now takes the admitted SessionRef, reads its latest record, and appends to that reference's exact journal address. A retired reference cannot record against a replacement session. This removes the identity scan and public-name fallback.

Selector, wait, touch, recording, tracing, performance, and app handlers use the same operation. App-event and deployment metadata use named patches, removing the final production session upserts.

Forty-six files changed. Part of #3116, stacked on #3148; addresses the remaining action-recording findings on #3141.

Validation

Validated 9902936e96: focused owner and route controls pass, including 71 restored mutation controls and 29 resource controls. Seven planted regressions fail for captured records, public journal addressing, address-only authority, late lookups, and both metadata upserts.

pnpm check:affected --base fix/capture-lifetime-review --run passes selected runnable gates and 2,152 related tests across 320 files. Quick, layering, and Fallow checks pass; Fallow excludes the inherited unused clearRuntimeHints finding. Independent review found no actionable findings.

CI and requested live-provider evidence remain pending. Fixture upserts and the ownership-gate migration follow in separate layers.