fix: bind artifact access to producing lease

Closed
TH
19h ago
+2059-446

Closed as superseded by #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.

Summary

Bind upload stages, retained downloads, provider artifacts, and materialized paths to the admitted tenant and producing lease. Tenant authentication establishes authority. Stacked on #5243.

Before / after

  • Leased HTTP transfers accept an omitted run for the owning tenant and check any supplied run. Artifact inventory, install-from-source, path release, and recording recovery check producing scope.
  • Explicit historical queries keep their producing scope. With an explicit --session and no lease or run flags, provider-session lookup uses the named cloud connection's lease and run.
  • Recording treats an empty lease as omitted. A nonempty lease requires a tenant owner. Stop active leased recordings before upgrading to protocol 4.

Validation

At c287bab53a, five CLI transport tests passed. The added assertion failed on 8bd855d69b. At 8bd855d69b, both AST parity cases and all 19 hosted checks passed. At a5c5a46b4c, five CLI transport tests passed, including two historical cases that failed at f5ba4128b3. At 5cddfe7e32, 83 CLI transport and HTTP output tests passed.

On combined tip 2c6b09defd with this layer at d7e2b68cab, iOS 26.2 verified package and local ZIP staging, install, and path release through a hookless HTTP proxy with explicit tenant and retained lease. Protocol-4 live evidence is pending for omitted-run staging, URL source install, recording stop or restart recovery, post-close inventory, producing-owner download, typed wrong-lease refusal, and authenticated historical provider lookup. Bearer-only and session-only staging still need an ownership decision.

46a98d5310 extracts the artifact scope block to address Fallow. Merge-tree clean through #5281 and #5282. CI pending.