fix(daemon): share session visibility across daemon surfaces

Merged
TH
7d ago
+715-321

Summary

Use one session visibility rule for listing, doctor, wait progress, and contention. Name a leased claim only with proof for its exact live owner. Keep local recovery for claims with stored unleased-local ownership evidence. Keep holder fields out of downloadable claim diagnostics, and resolve doctor visibility before session-derived preflight. Amend ADR 0007 and link the user-facing references.

Before / after

  • A shared proxy without tenant isolation could list unleased local sessions. It now lists only scope-matched sessions whose lease ID the caller sends.
  • Doctor could confirm a hidden leased session in preflight. It now runs detached checks.
  • Local recovery could name a foreign claim with no ownership proof, and proxy diagnostic records could name the holder. Both now use public contention details if the holder is hidden.

Validation

Five HTTP review regressions failed on 71101d1 and pass on 07e47a5. Build, typecheck, lint, formatting, layering, Fallow, focused tests, wire declarations, full coverage, and integration ran locally. Raw session-store reads fell from 187 to 186.

Closes #4967


Prove it works
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.