pool: the steady-state cycle — bind, return, and never infer a free slot #39
No reviewers
Labels
No labels
Compat/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Meta/Campaign
Meta/Epic
Meta/Session
Priority/Critical
Priority/High
Priority/Low
Priority/Medium
Reviewed/Confirmed
Reviewed/Curated
Reviewed/Duplicate
Reviewed/Invalid
Reviewed/Won't Fix
Scope/Campaign
Status/Abandoned
Status/Blocked
Status/Conflicted
Status/In Progress
Status/In Review
Status/Need Grooming
Status/Need More Info
Status/Ready
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
Ting/Vedanta!39
Loading…
Reference in a new issue
No description provided.
Delete branch "pool/31-checkout-return"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Session #31's three Deliverables, under OpenSpec 30 v0.1.1.
Stacked on #38 (bring-up), which it needs for
Slot,Grant,RealizedandGate. Review that one first; this targets its branch rather than fastlane so the diff is onlysrc/checkout.rs.What it does
#35 — bind under a new grant, stamp the occupancy. Checkout takes an available slot, issues a new immutable grant inheriting nothing, and writes the occupancy onto the slot's entity alias.
Two traps are written into the types because both cost real time to find:
custom_metadata, not a claim, and structurally cannot be one. A kanidm claim map isvaluesByGroup, so a claim carries only what the directory asserts about an account — and occupancy changes per allocation with no group to hang it on. Aliasmetadatais rewritten from claim mappings on every login;custom_metadatais written out of band and a login does not touch it.assignment_id. That names the queen's tenure assignment, one value shared by every drone under a queen, so it cannot separate two occupants of one slot. A path built on it looks isolated and is not.A failed stamp does not hand out the slot. A drone whose alias still carries its predecessor's assignment would read the predecessor's workspace — precisely what the segment exists to prevent — so the checkout fails instead of proceeding.
#36 — return preserves the worker. Revoke, rotate, advance the generation, return the UUID.
Revoke first, release last. A slot returned before its capability is revoked can be allocated while its predecessor still holds authority, so the order is load-bearing. A failure partway leaves the slot held and the completion retryable — never half-returned.
The principal surviving is proven by the port, not asserted in prose:
Occupancyhas no delete, suppress, or tombstone method, so destroying a principal is unreachable from this module. A test cannot prove "did not delete" against a port that could.#37 — only an explicit release frees a slot. Per Ting/Ting#2 Q2, the liveness mechanism stays undefined until incidents show what evidence exists. Rather than carry that as a gap, nothing infers liveness at all — the type reads no clock, which is what the elapsed-time test asserts.
The chosen failure is exhaustion: loud, bounded, recoverable by a release, and it produces exactly the incident record the eventual mechanism gets designed against. A wrong automatic release would instead fail silently into two live drones sharing one identity.
Verification
nix developgate green: fmt stable,clippy --workspace --all-targets -D warningsclean,cargo test --workspacepassing — 96 lib tests, up from 85.AvailableHeld; retry succeedsExhaustedNot here
Occupancyhas no OpenBao or Kanidm implementation yet; both wait onsa-vedanta, which is flake-ops#98's owner act.Cycle::newstarts every slot available, which is correct for a fresh pool and not for a restart with live holders. Flagged in the doc comment — recovering held slots from durable state is not in this Session's scope and must land before this runs against a real pool.held()exposes what an alert would be built on; raising it belongs to #11's mandate and flake-ops#470's plane.Closes #35
Closes #36
Closes #37
Refs #31
larandar referenced this pull request2026-09-05 21:22:48 +00:00