0%

Reclaim, leases, and retire-and-remove (D3)

Goal

A concurrent linker holding a resolved generation path is never reclaimed underneath it, and a crashed build never permanently pins a generation.

Implementation Sketch

Derived from compiler_repo/docs/ori_lang/proposals/approved/binary-generation-lifecycle-proposal.md. Depends on the cache root, budget, collection pass, and D3a in-flight-reference primitive delivered by plans/cache-lifecycle/ (approved cache-lifecycle-proposal.md). Implement the work items in order.

Spec References

  • Approved proposal: compiler_repo/docs/ori_lang/proposals/approved/binary-generation-lifecycle-proposal.md
  • Depends on: compiler_repo/docs/ori_lang/proposals/approved/cache-lifecycle-proposal.md (D3a primitive, composed bound)
  • Umbrella invariant T4: compiler_repo/docs/ori_lang/proposals/approved/toolchain-philosophy-proposal.md

Work Items

  • Extend cache-lifecycle D3a: acquire the lease before resolution, re-read the current pointer, verify it still names the leased generation, release-and-retry on mismatch
  • Retire-and-remove for any still-pointed-to generation (DEAD/COLD/RECENT): clear the current-pointer record and remove storage in one critical section, leaving the identity resolving to no current generation
  • Per-generation leases with crash recovery requiring owner-gone AND expiry-passed (PID plus start time); superseded generations need no pointer action