fix(daemon): consolidate admitted output and transfer ownership

Draft
TH
19h ago
+4002-1437

Closed as superseded by #5343 and #5344 on the 0.22 remediation line. Continue review and implementation there. Historical validation below remains attributed to its original commits; closure does not claim the replacements are merge-ready.

Integrated review prototype. Active successors are #5343 for ingress and #5344 for admitted output ownership. CI findings at this prototype head are being corrected in those independently mergeable roots. This prototype is not merge-ready.

Summary

Integrated replacement candidate for #5243, #5278, #5281 and #5282, based solely on 0.22 at a23c53254c. Canonical admission supplies explicit output scope; producers commit IDs before replies. Uploads share bounded staging capacity and existing lease/lifetime fences. RPC preauthorization owns finite slots and buffered bytes. Replay admission and the remote-browser refusal remain enforced.

The initial independent source review found four blockers. Corrections are published and delta review is pending. This integrated draft still needs extraction into mergeable roots. Recording #5335 and client #5338 remain separate; the only recording-handler edit removes the obsolete response ownership marker.

Before / after

  • A leased-session upload without its credential is refused before file transfer, including legacy fallback.
  • Trace, perf, scripts and suite/fallback outputs commit at their producers; finalization cannot register reply paths or infer ownership.
  • Stalled preauthorization returns typed 408/503 without dispatch. Request IDs register after authentication.

Value

Whole production change footprints: old combined stack +1,359 net lines; candidate +933 versus 0.22. Different bases prevent a whole-tree shrink claim. Finalization removes 137 lines and the obsolete ownership module removes 66 lines; the legitimate screenshot presentation map remains.

Validation

Checkpoint: 2581250813e80c5ff080d31fb74e14366c405442. Development focused groups passed: 118 RPC/protocol tests and 95 producer/CLI tests. Temporary combination of this checkpoint with #5338 a04974751c passed all 45 tests in its four existing HTTP/client fixture files; temporary changes were removed. Chunked-budget regression was red before the byte-admission hook and green afterward.

Hosted CI/Size are unavailable during the reported GitHub Actions outage. Broad gates, native/live verification and package-byte measurements remain pending. No merges or releases.

Review corrections

Head e6079b08814d8160648de5ab676d7f502e1697c6 includes canonical validation of every supplied nonempty backend alias, removal of invalid HTTP route arguments, forwarding of the original lease credential, and preservation of upstream-origin redaction. RPC errors are projected once before envelope serialization.

At this head, 61 proxy tests across two files and 17 HTTP RPC validation tests passed. The three lease-forwarding cases and existing origin-redaction case failed before the corrections. No local broad gates, build, coverage or device checks ran. CI and Size remain unverified. Independent delta review is pending.


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