Skip to content

fix: make concurrent root reservations exclusive - #140

Merged
matt-FFFFFF merged 1 commit into
mainfrom
feat/issue-134-exclusive-root-creates-f6b110bb6a80f8cd
Dec 2, 2026
Merged

matt-FFFFFF merged 1 commit into
mainfrom
feat/issue-134-exclusive-root-creates-f6b110bb6a80f8cd

Conversation

@appvia-agentic-writer

@appvia-agentic-writer appvia-agentic-writer Bot commented Dec 2, 2026 •

Copy link
Copy Markdown
Contributor

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.
    • No unrelated refactors were made.
  • F2. Code quality Reviewed by pr-verify run 46901084273 on 2050aa8.

    • gofmt -l ., go vet ./..., golangci-lint run --fix ./..., and golangci-lint run ./... completed with no issues.
    • make test passed with the race detector across all packages.
    • make license-headers passed. 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.
    • TestCreateRootPoolAC5CompensationPreservesReplacementIncarnation and TestCreateRootPoolAC5CompensationJoinsCleanupError: compensation preserves foreign ownership and joins cleanup errors.
    • This test suite passed locally and in repeated concurrency runs; CI status is pending.
  • F4. Spec fidelity Reviewed by pr-verify run 46901084273 on 2050aa8.

    AC Proof Test, check or document CI check Status
    AC-5 test TestCreateRootPoolAC5ConcurrentOverlapsAreExclusive plus the named AC-5 fault and compensation tests test pending CI

    The 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.invalid

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "ipamtesthost.invalid"

See Network Configuration for more information.

Generated by implement-high · copilot · mai20 · ~79 AIC · ⌖ ~1 AIC · ⊞ 38.9K · ◷

Closes #134

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>
@appvia-agentic-writer
appvia-agentic-writer Bot requested a review from a team as a code owner December 2, 2026 14:14
@appvia-agentic-writer appvia-agentic-writer Bot added the origin:agent Marks issues that an agent created, for audit and metrics. label Dec 2, 2026
@appvia-agentic-writer

Copy link
Copy Markdown
Contributor Author
AC Proof Test, check or document CI check Result
AC-5 test TestCreateRootPoolAC5ConcurrentOverlapsAreExclusive, TestCreateRootPoolAC5RereadsUnknownOutcomes, TestCreateRootPoolAC5RecognisesSupersededOwnedReservation, TestCreateRootPoolAC5CompensationPreservesReplacementIncarnation, TestCreateRootPoolAC5CompensationJoinsCleanupError test (ubuntu-latest) pass

Final verification

F1. Story compliance — pass

The registry remains the sole serialization point and remains correct with withoutPoolLocks(). The production change recognizes an exact-owned pending or active reservation after an unrelated stale registry change. All files outside the Story hints are listed and justified in the PR description.

Findings: None.

F2. Code quality — pass

The 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 — pass

The 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. test (ubuntu-latest), test (macos-latest), and test (windows-latest) concluded success on the head SHA.

Findings: None.

F4. Spec fidelity — pass

AC-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"}}

Generated by pr-verify · copilot · mai20 · ~22 AIC · ⌖ ~1 AIC · ⊞ 34K · ◷

@matt-FFFFFF
matt-FFFFFF merged commit 6a20cac into main Dec 2, 2026
7 checks passed
@matt-FFFFFF
matt-FFFFFF deleted the feat/issue-134-exclusive-root-creates-f6b110bb6a80f8cd branch December 2, 2026 14:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

origin:agent Marks issues that an agent created, for audit and metrics.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Prove concurrent overlapping creates are exclusive

1 participant