fix(daemon): enforce tenant and ingress security boundaries
Summary
Enforce tenant ownership for cloud and local artifacts, cap active uploads and unauthenticated RPC bodies, and stop waiting on stalled HTTP auth hooks after disconnect across RPC, upload, artifact, and diagnostics routes. Bound raw replay sources at daemon admission. Remote tenant web commands now refuse access until browser network requests can be confined to public destinations; close still cleans up sessions. These changes address the daemon and proxy findings in Daybreak scan wfr_62518a30795e3d4866f99342f762ecbde8dd57570bf78ea1c80892aea2c7f6d8.
Before / after
- A tenant could request another tenant's cloud artifact by lease ID; the daemon now requires an active lease owned by that tenant.
- Unlimited upload preflights and concurrent RPC bodies could consume shared resources; new requests now fail with capacity reasons at the configured limits.
- Remote web commands could reach daemon-host private services; they now fail with
remote_web_public_network_unenforced.
Validation
Head: c4f9376b8f. CI is pending. Focused changed test files passed before the first push (daemon 15, remote/replay 35, proxy 64 tests). After the final audit fix, pnpm exec vitest run --project unit-core packages/daemon/src/server/http/http-authorization.test.ts passed (4 tests). pnpm typecheck, pnpm lint, and git diff --check passed before the first push. No live remote-web or device run was performed.