fix: bind capture adoption to session lifetimes

Closed
TH
2mo ago
+3353-1643

Summary

Capture adoption now receives a binding to one session lifetime. The binding owns admission, slot identity, artifact addressing and explicit field updates. Audio, perf, app-log and screen-recording callers capture their ref before asynchronous startup.

An unpublished record-only draft publishes at the existing adoption point. Shutdown can refuse publication while retaining truthful recovery evidence when cleanup is unconfirmed. Failed adoption rechecks authority after cleanup yields, so it cannot terminalize successor evidence.

flowchart LR
  Start[Start native capture] --> Adopt[Lifetime-bound adoption]
  Adopt --> Check{Admission and slot still valid?}
  Check -->|Yes| Publish[Publish owned resource]
  Check -->|No| Cleanup[Dispose captured handle]
  Cleanup --> Evidence[Retain unconfirmed recovery evidence if still authorized]

Depends on #3135. Ref #3116. Thirty-two files, 797 gross changed lines. Capture finishing migrates in the next dependency layer.

Validation

Tested d0f7cf8121: quick checks, Fallow and exact-head affected checks pass, including 355 related files / 2,357 tests. Focused draft/resource/log tests pass.

Removing admission or lifetime checks, reusing pre-await persistence authority, and coupling draft persistence to admission each fail the regression controls; restored code passes. Independent read-only review has no findings. CI-owned coverage/provider and live device evidence remain pending.