Repository navigation
fix: make concurrent root reservations exclusive - #140
Conversation
Recognise exact-owned reservations after stale registry rereads and cover CAS fault windows with deterministic lock-disabled schedules. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Final verificationF1. Story compliance — passThe registry remains the sole serialization point and remains correct with Findings: None. F2. Code quality — passThe production and test diffs preserve incarnation-safe ownership, unknown-outcome rereads, bounded retries, and joined compensation errors. The deterministic barrier creates a real same-snapshot CAS race in both legacy and migrated modes, and the head-SHA lint and test checks are green. Findings: None. F3. Test evidence — passThe concurrency test runs 1,000 lock-disabled trials per applicable mode and asserts exactly one success, exactly one usable proposal, one active reservation, and an overlap/contention loser. Fault tests cover before-land and after-land outcomes at registry creation/update, pool-state publication, pool-definition publication, and activation, plus stale-version recognition and compensation boundaries. Findings: None. F4. Spec fidelity — passAC-5 maps to repository-code tests that prove the required behavior, and the diff stays within the Story's serialization, deterministic scheduling, unknown-outcome, and compensation constraints. Findings: None. agentic-pr-verify: {"run":"46901084273","sha":"2050aa86bdc6b05ecc6047c4cd1b45100321427c","verdict":"pass","acs":1,"mapped":[{"ac":"AC-5","proof":"test","test":"TestCreateRootPoolAC5ConcurrentOverlapsAreExclusive; TestCreateRootPoolAC5RereadsUnknownOutcomes; TestCreateRootPoolAC5RecognisesSupersededOwnedReservation; TestCreateRootPoolAC5CompensationPreservesReplacementIncarnation; TestCreateRootPoolAC5CompensationJoinsCleanupError","check":"test (ubuntu-latest)"}],"finals":{"F1":"pass","F2":"pass","F3":"pass","F4":"pass"}}
|
Summary
Recognise an exact-owned root reservation after an unknown-outcome registry write is followed by an unrelated stale-version update. This preserves the original claim while retaining incarnation-safe rejection and compensation behavior.
Add deterministic, lock-disabled overlap pairs for legacy and migrated allocation-state modes, plus unknown-outcome fault coverage at registry creation/update, pool-state publication, pool-definition publication, activation, and compensation boundaries.
Skills used:
programming,go,ac-test-mapping,spec-kit.Final verification
F1. Story compliance Reviewed by pr-verify run 46901084273 on 2050aa8.
root_reservation.go(outside the Story Hints): fixes the reservation retry path so a landed exact-incarnation claim remains owned after unrelated registry changes instead of becoming permanently contentious.root_create_concurrency_test.go(outside the Story Hints): proves AC-5 with 1,000 deterministic pairs per allocation-state mode and the required fault outcomes.root_create_fault_store_test.go(outside the Story Hints): supplies deterministic CAS barriers and unknown-outcome recording stores without production hooks.F2. Code quality Reviewed by pr-verify run 46901084273 on 2050aa8.
gofmt -l .,go vet ./...,golangci-lint run --fix ./..., andgolangci-lint run ./...completed with no issues.make testpassed with the race detector across all packages.make license-headerspassed. Staged-diff review found no significant issues.F3. Test evidence Reviewed by pr-verify run 46901084273 on 2050aa8.
TestCreateRootPoolAC5ConcurrentOverlapsAreExclusive: 1,000 lock-disabled overlapping pairs passed for each legacy and migrated mode, with exactly one success, one active reservation, and one usable proposed root.TestCreateRootPoolAC5RereadsUnknownOutcomes: before-land and after-land faults passed at registry create, registry update, pool-state publication, pool-definition publication, and activation.TestCreateRootPoolAC5RecognisesSupersededOwnedReservation: the landed owned claim survives an unrelated registry update.TestCreateRootPoolAC5CompensationPreservesReplacementIncarnationandTestCreateRootPoolAC5CompensationJoinsCleanupError: compensation preserves foreign ownership and joins cleanup errors.F4. Spec fidelity Reviewed by pr-verify run 46901084273 on 2050aa8.
TestCreateRootPoolAC5ConcurrentOverlapsAreExclusiveplus the named AC-5 fault and compensation teststestThe implementation follows the linked design's single-registry CAS protocol and keeps overlap serialization independent of in-process pool locks.
Warning
Firewall blocked 1 domain
The following domain was blocked by the firewall during workflow execution:
ipamtesthost.invalidTo allow these domains, add them to the
network.allowedlist in your workflow frontmatter:See Network Configuration for more information.
Closes #134