Skip to content

feat: persist versioned root pool registry - #138

Merged
matt-FFFFFF merged 3 commits into
mainfrom
feat/root-pool-registry-1e6dbaf94902717d
Dec 2, 2026
Merged

matt-FFFFFF merged 3 commits into
mainfrom
feat/root-pool-registry-1e6dbaf94902717d

Conversation

@appvia-agentic-writer

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

Copy link
Copy Markdown
Contributor

Summary

  • Add the strict v1 root_pool_registry wire document below the existing pools/ capability.
  • Validate registry schema, duplicate membership, pool IDs, incarnations, address families, canonical CIDRs and lifecycle state while preserving invalid stored bytes.
  • Use deterministic address-ordered CIDR encoding and reusable CreateIfAbsent/PutIfMatch transitions with stale-version retry and explicit ambiguous-outcome rereads.
  • Prove landed and non-landed ambiguous conditional writes preserve incarnation and pending, active and deleting ownership.

Skills used: programming, go, ac-test-mapping, spec-kit

Final verification

  • F1. Story compliance Reviewed by pr-verify run 46878361610 on 1a9ecb7.

The registry retains pending, active and deleting ownership and uses only Get, List, CreateIfAbsent and PutIfMatch. Invalid state remains explicit and is never repaired or overwritten. Changed files outside the Story's Hints: root_registry.go exposes the internal transition seam; root_registry_document.go owns the in-package domain model, validation and deterministic conversion; root_registry_test.go, root_registry_test_helpers_test.go and root_registry_transition_test.go provide codec, transition and ambiguous-outcome evidence. The CIDR comparator in internal/document/root_registry.go fixes the shared encoder/decoder ordering mismatch rather than special-casing a caller. No refactor changes pool or allocation-state wire schemas or backend operations.

  • F2. Code quality Reviewed by pr-verify run 46878361610 on 1a9ecb7.

Passed gofmt -l ., go vet ./..., golangci-lint run --fix ./..., golangci-lint run ./..., scripts/license-headers.sh --check, make test (go test ./... -count=1 -race -timeout 20m), and git diff --check. Serena diagnostics reported no errors in root_registry_transition_test.go.

  • F3. Test evidence Reviewed by pr-verify run 46878361610 on 1a9ecb7.

TestRootRegistryCodecAC10RejectsInvalidStateWithoutWriting covers unsupported and malformed schema, duplicate IDs, invalid identity, family, CIDR, state and ordering, with byte preservation. TestRootRegistryCodecAC15RoundTripsLifecycleOwnership round-trips incarnation and pending, active and deleting states, including CIDRs whose lexical and address orders differ. TestRootRegistryTransitionAC10RetriesStaleVersions proves stale CAS retry. TestRootRegistryTransitionAC10RereadsUnknownConditionalWrite covers landed and non-landed ambiguous creation. TestRootRegistryTransitionAC15RereadsUnknownCASOwnership now transitions an entry from active to deleting in the same ambiguous CAS that preserves an active entry, adds a pending entry and verifies every incarnation and lifecycle state after the reread; both landed and non-landed cases passed locally in the full race suite.

  • F4. Spec fidelity Reviewed by pr-verify run 46878361610 on 1a9ecb7.
AC Proof Test, check or document CI check Status
AC-10 test TestRootRegistryCodecAC10RejectsInvalidStateWithoutWriting; TestRootRegistryTransitionAC10RetriesStaleVersions; TestRootRegistryTransitionAC10RereadsUnknownConditionalWrite test (ubuntu-latest) pending CI
AC-15 test TestRootRegistryCodecAC15RoundTripsLifecycleOwnership; TestRootRegistryTransitionAC15RereadsUnknownCASOwnership test (ubuntu-latest) pending CI

The v1 shape, canonical ordering, lifecycle ownership and conditional transition handling follow specs/REQ-000017-prevent-overlapping-top-level-pools/data-model.md, contracts/root-pool-overlap.md and decisions/ADR-0002-root-registry.md. Unknown schema, malformed state and ambiguous ownership remain explicit, with no automatic repair or normalization.

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 · ~17 AIC · ⌖ ~1 AIC · ⊞ 38.9K · ◷

Closes #132

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 10:51
@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-10 test TestRootRegistryCodecAC10RejectsInvalidStateWithoutWriting; TestRootRegistryTransitionAC10RetriesStaleVersions; TestRootRegistryTransitionAC10RereadsUnknownConditionalWrite test (ubuntu-latest) pass
AC-15 test TestRootRegistryCodecAC15RoundTripsLifecycleOwnership; TestRootRegistryTransitionAC15RereadsUnknownCASOwnership test (ubuntu-latest) fail

Final verification

F1 — fail

  • internal/document/root_registry.go:36 - Blocking: the wire codec lexicographically sorts CIDR strings after domain canonicalisation, but the domain canonicalisation uses address ordering. For valid disjoint multi-CIDR entries where those orders differ, the encoder produces a document that the decoder rejects, so deterministic ordering does not deliver a usable round trip.
  • root_registry_document.go:110 - Blocking: the decoder compares the encoded CIDR order with the differently canonicalized domain order and rejects output produced by its own encoder as non-canonical.

F2 — fail

  • internal/document/root_registry.go:36 - Blocking: the round-trip edge case above is unhandled code-quality correctness behavior.
  • root_registry_test_helpers_test.go:115 - Blocking: the unknown CreateIfAbsent fixture always applies the write before returning ErrUnknownOutcome, so the test cannot prove that an unknown outcome where the write did not land is retried rather than assumed successful.
  • root_registry_test_helpers_test.go:157 - Blocking: the unknown PutIfMatch fixture has the same landed-only limitation.

F3 — fail

  • root_registry_test.go:29 - Blocking: the AC-15 round-trip fixture uses only CIDRs whose lexical and address order agree, so it misses the valid ordering case that turns the encoded document into a decode error.
  • root_registry_transition_test.go:69 - Blocking: the unknown create-outcome test covers only a landed write, not the failure path where an ambiguous request did not land and must be retried.
  • root_registry_transition_test.go:99 - Blocking: the unknown CAS test likewise omits the non-landed failure path required to show ambiguous ownership is not normalized or assumed successful.

F4 — fail

  • internal/document/root_registry.go:36 - Blocking: AC-15 is not completely proven because valid lifecycle entries can fail to round-trip when their CIDRs exercise different deterministic ordering rules.
  • root_registry_document.go:110 - Blocking: the codec drifts from the requested strict, deterministic CIDR round trip and from the Story's state-preservation requirement.

agentic-pr-verify: {"run":"46866064757","sha":"87a13d313d98a708e8721072284f5bbab0bb9a00","verdict":"fail","acs":2,"mapped":[{"ac":"AC-10","proof":"test","test":"TestRootRegistryCodecAC10RejectsInvalidStateWithoutWriting; TestRootRegistryTransitionAC10RetriesStaleVersions; TestRootRegistryTransitionAC10RereadsUnknownConditionalWrite","check":"test (ubuntu-latest)"}],"finals":{"F1":"fail","F2":"fail","F3":"fail","F4":"fail"}}

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

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@appvia-agentic-writer

Copy link
Copy Markdown
Contributor Author

Commit pushed: fa232a8

Generated by implement-high · copilot · mai20 · ~27 AIC · ⌖ ~2 AIC · ⊞ 37.7K

@appvia-agentic-writer

Copy link
Copy Markdown
Contributor Author
AC Proof Test, check or document CI check Result
AC-10 test TestRootRegistryCodecAC10RejectsInvalidStateWithoutWriting; TestRootRegistryTransitionAC10RetriesStaleVersions; TestRootRegistryTransitionAC10RereadsUnknownConditionalWrite test (ubuntu-latest) pass
AC-15 test TestRootRegistryCodecAC15RoundTripsLifecycleOwnership; TestRootRegistryTransitionAC15RereadsUnknownCASOwnership test (ubuntu-latest) pass

Final verification

F1 — pass

No blocking findings. The diff delivers the strict v1 registry, deterministic encoding, validation and CAS transitions within the Story's constraints. Every changed file outside the hinted areas is listed and justified in the PR description; no pool or allocation-state schema or backend operation changes were introduced.

F2 — pass

No blocking findings. The whole diff is consistent with the repository's Go conventions and error handling, the prior CIDR-ordering defect is fixed, and ambiguous writes are reread for landed and non-landed outcomes. All non-agentic CI checks on the head SHA succeeded: integration (emulators), lint, test (macos-latest), test (ubuntu-latest), and test (windows-latest); Serena reported no diagnostics in the changed files.

F3 — fail

  • root_registry_transition_test.go:115 - Blocking: the AC-15 transition test exercises an existing active entry and a proposed pending entry, but never drives an entry through the deleting state. The codec test covers all three serialized states, but the Story specifically requires codec and transition coverage for incarnation and pending, active, and deleting state, including ambiguous ownership; the transition evidence therefore remains incomplete.

F4 — pass

No blocking findings. Both ACs map to named automated tests run by the successful test (ubuntu-latest) check on the head SHA, and the implementation remains within the issue and referenced design documents.

agentic-pr-verify: {"run":"46872765515","sha":"fa232a85098c7919cd59965c966d389eb888568c","verdict":"pass","acs":2,"mapped":[{"ac":"AC-10","proof":"test","test":"TestRootRegistryCodecAC10RejectsInvalidStateWithoutWriting; TestRootRegistryTransitionAC10RetriesStaleVersions; TestRootRegistryTransitionAC10RereadsUnknownConditionalWrite","check":"test (ubuntu-latest)"},{"ac":"AC-15","proof":"test","test":"TestRootRegistryCodecAC15RoundTripsLifecycleOwnership; TestRootRegistryTransitionAC15RereadsUnknownCASOwnership","check":"test (ubuntu-latest)"}],"finals":{"F1":"pass","F2":"pass","F3":"fail","F4":"pass"}}

Generated by pr-verify · copilot · mai20 · ~15 AIC · ⌖ ~1 AIC · ⊞ 33.6K · ◷

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@appvia-agentic-writer

Copy link
Copy Markdown
Contributor Author

Commit pushed: 1a9ecb7

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

@appvia-agentic-writer

Copy link
Copy Markdown
Contributor Author
AC Proof Test, check or document CI check Result
AC-10 test TestRootRegistryCodecAC10RejectsInvalidStateWithoutWriting; TestRootRegistryTransitionAC10RetriesStaleVersions; TestRootRegistryTransitionAC10RereadsUnknownConditionalWrite test (ubuntu-latest) pass
AC-15 test TestRootRegistryCodecAC15RoundTripsLifecycleOwnership; TestRootRegistryTransitionAC15RereadsUnknownCASOwnership test (ubuntu-latest) pass

Final verification

F1 — pass

No blocking findings. The diff delivers the strict v1 registry document, deterministic canonical ordering, state invariants, and reusable conditional-write transitions within the Story's constraints. Every changed file outside the Story's hints is listed and justified in the PR description; pool and allocation-state wire schemas and backend operations remain unchanged.

F2 — pass

No blocking findings. The full diff follows the repository's Go conventions, handles malformed state and CAS failures explicitly, and contains no prose-only or self-exercising tests. All applicable CI checks on the head SHA succeeded: integration (emulators), lint, test (macos-latest), test (ubuntu-latest), and test (windows-latest).

F3 — pass

No blocking findings. AC-10 covers unsupported and malformed schema, duplicate IDs, invalid identity, family, CIDR, ordering and lifecycle state while preserving stored bytes; it also covers stale-version retry and landed/non-landed ambiguous creation. AC-15 covers codec round trips and transition ownership for pending, active and deleting incarnations, including landed/non-landed ambiguous CAS outcomes.

F4 — pass

No blocking findings. Both ACs map to named automated tests executed successfully by test (ubuntu-latest), and the implementation conforms to the issue, data model, overlap contract and root-registry ADR without spec drift.

agentic-pr-verify: {"run":"46878361610","sha":"1a9ecb7e0b3fb272c2ef0c8112881983995d0aa5","verdict":"pass","acs":2,"mapped":[{"ac":"AC-10","proof":"test","test":"TestRootRegistryCodecAC10RejectsInvalidStateWithoutWriting; TestRootRegistryTransitionAC10RetriesStaleVersions; TestRootRegistryTransitionAC10RereadsUnknownConditionalWrite","check":"test (ubuntu-latest)"},{"ac":"AC-15","proof":"test","test":"TestRootRegistryCodecAC15RoundTripsLifecycleOwnership; TestRootRegistryTransitionAC15RereadsUnknownCASOwnership","check":"test (ubuntu-latest)"}],"finals":{"F1":"pass","F2":"pass","F3":"pass","F4":"pass"}}

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 pr-verify · copilot · mai20 · ~40 AIC · ⌖ ~1 AIC · ⊞ 35.2K · ◷

@matt-FFFFFF
matt-FFFFFF merged commit 3679fa3 into main Dec 2, 2026
7 checks passed
@matt-FFFFFF
matt-FFFFFF deleted the feat/root-pool-registry-1e6dbaf94902717d branch December 2, 2026 12:35
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.

Persist the versioned root registry

1 participant