Files
clean-architecture-frontend…/scripts
DongHyeonkaandClaude Opus 5.5 89e90cc990 fix(browser-files): race deliveries and vault reads on the kernel owner (Q-6.2-7)
download-delivery-adapter and browser-file-vault each carried their own
combineAbortSignals/awaitWithSignal copies. Two gaps followed:
- a presigned lease that resolved after the abort but before the delivery's
  finally was seen by neither compensateLateSource (holder not yet closed) nor
  closeHeldSource (lease never adopted), so it leaked;
- a writable from handle.createWritable() that arrived after the abort was
  never aborted (Chrome keeps a .crswap file).

Each delivery and each vault stream now owns a createAbortableOperation joined
to the caller signal; dispose() closes the live owners. Every await goes
through owner.race, and late leases/writables are compensated by the race.
The hand-rolled abort ratchet drops 21 -> 19.

Verified: two new download tests (same-turn late lease, late writable) failed
before (close 0 times, no abort) and pass now; a new vault characterization
test (caller abort / dispose during a pending read) passes before and after.
All lane gates pass.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-24 13:39:59 +09:00
..