fix(daemon): enforce provider session artifact ownership - #2109
Conversation
Size Report
npm unpacked components
Startup median (7 runs, lower is better):
Top changed chunks:
Top changed packed files
|
|
P1 — expiry retention is measured from lazy cleanup, not from lease expiry. consumeExpiredLeases discovers an expired lease only when a later registry operation runs; unbindLease then calls markLeaseReleased, which sets retainedUntil = now + retentionMs. A first artifact request hours after lease.expiresAt therefore creates a fresh five-minute authorization window. The test masks this by resolving at expiresAt + 1, which starts the window immediately. Carry the actual transition time into ownership retention (explicit release uses current time; expiry uses lease.expiresAt), and plant a regression that jumps directly past expiresAt + retention before the first resolve and verifies refusal with no provider call. Also rerun/base-compare the currently red Android native-alert timeout before readiness. |
|
Fixed in df3b681. Expiry cleanup now anchors provider-session retention at lease.expiresAt, and the regression jumps directly past expiresAt plus retention before the first resolve. Focused tests are 39/39 and pnpm check:affected --run passed all runnable checks. The Android native-alert rerun remains queued. |
|
Re-reviewed |
|
Fixed in 1e41afe. recordProviderSession now preserves lease.expiresAt when a late allocation or release response arrives after expiry; manual release still uses current time. Added planted-red coverage for both delayed paths with no provider dispatch. Focused tests are 41/41 and pnpm check:affected --run passes 203 files and 1,292 tests. The Android rerun passed on the prior head; current checks are running for this follow-up. |
|
Re-reviewed |
|
Fixed in 6040534. recordProviderSession now derives the expiry terminal time after cleanup, so a clock crossing expiresAt between calls cannot reopen the retention window. Added a sequenced-clock red/green regression proving no provider dispatch after expiry plus retention. Focused 41/41 and pnpm check:affected --run (203 files, 1,292 tests) pass; exact-head CI is running after this push. |
|
Code review is clean at |
|
Merge-ready at |
|
The reviewed head is unchanged, but the newly advanced |
6040534 to
15227f0
Compare
|
Reviewed exact head |
15227f0 to
6381863
Compare
|
Rebased again onto #2104's new tip ( |
|
Summary
artifacts --provider-sessionlookups with bounded retention across active, released, and expired leases.Validation
pnpm check:affected --run: 203 files and 1,292 tests passed; all runnable checks passed, including wire compatibility.e4d9a2fe5a) after that PR's stack advanced; exact-head CI is green (12 substantive checks, including Android/iOS/Linux/macOS smoke), with only the expected matrix skip.