Skip to content

feat: coordinate root pool deletion lifecycle - #141

Merged
matt-FFFFFF merged 2 commits into
mainfrom
feat/root-delete-lifecycle-135-78f1218d34c3dfe6
Dec 2, 2026
Merged

matt-FFFFFF merged 2 commits into
mainfrom
feat/root-delete-lifecycle-135-78f1218d34c3dfe6

Conversation

@appvia-agentic-writer

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

Copy link
Copy Markdown
Contributor

Summary

Coordinate root pool deletion with the root registry lifecycle so active or pending reservations become deleting before owned document removal, and exact interrupted deletions retain their incarnation through retry.

The redraft makes active and pending ownership all-or-nothing: if either present pool or state document belongs to another incarnation, deletion returns an inconsistent-lifecycle conflict without writes and preserves both documents and the registry entry. Deleting retries continue to remove only their pinned incarnation.

Changed files outside Story Hints

  • root_lifecycle.go: owns exact root-registry document matching used by pool.go.
  • root_create_protocol_test.go: the requested AC-15 lifecycle tables live here because this repository has no pool_test.go.
  • client_attempt4_test.go: existing incomplete-state coverage now records the required preservation behavior for a split root incarnation.

Skills used: programming, go, ac-test-mapping.

Final verification

  • F1. Story compliance Reviewed by pr-verify run 46958310032 on 49e5ecc.

    • pool.go and root_lifecycle.go pin the registry incarnation before deletion, reject mixed ownership for active or pending entries, and never adopt a foreign reservation or pool document.
    • Active/pending and deleting lifecycle handling preserves unrelated incarnations, nonempty refusal, state-before-definition deletion, conditional own-document deletion, and child lifecycle.
  • F2. Code quality Reviewed by pr-verify run 46958310032 on 49e5ecc.

    • make test passed with the race detector across all packages.
    • make build passed.
    • go vet ./... passed.
    • make lint passed, including golangci-lint and license headers.
    • Final diff review found the inverse split-mismatch test gap; that case was added and verified.
  • F3. Test evidence Reviewed by pr-verify run 46958310032 on 49e5ecc.

    • TestDeleteRootPoolAC15CoordinatesLifecycle proves active and pending transitions, established document order, and exact cleanup.
    • TestDeleteRootPoolAC15RejectsNonemptyBeforeLifecycleTransition proves nonempty refusal performs no writes.
    • TestDeleteRootPoolAC15MismatchedActiveIncarnationPreservesDocuments proves both split directions and a fully mismatched pair preserve document bytes and perform no writes for active and pending entries. The matching-pool/foreign-reservation cases failed before the fix and pass after it.
    • TestDeleteRootPoolAC15RepeatedDeletePreservesReplacementIncarnation and TestDeleteRootPoolAC15RepeatedDeleteDoesNotAdoptNewDeletingIncarnation prove interrupted retries remain incarnation-safe.
    • TestDeleteRootPoolAC15RereadsAmbiguousOutcomes and TestDeleteRootPoolAC15RereadsAmbiguousRegistryTransition prove ambiguous outcomes retain unrelated roots and reservations.
    • TestCreatePoolIncompleteStatesRetryThenReportWithoutWrites proves the existing incomplete-state behavior, including preservation of split root incarnations.
  • F4. Spec fidelity Reviewed by pr-verify run 46958310032 on 49e5ecc.

    • AC-15 follows root-pool-overlap.md and ADR-0003: lifecycle state determines participation, all deleting transitions remain exact-incarnation, and an unusable foreign incarnation is not adopted as a usable root.
AC Proof Test, check or document CI check Status
AC-15 test TestDeleteRootPoolAC15CoordinatesLifecycle; TestDeleteRootPoolAC15MismatchedActiveIncarnationPreservesDocuments; interruption and ambiguous-outcome AC-15 tests in root_create_protocol_test.go test (ubuntu-latest) pending CI

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 · ~43 AIC · ⌖ ~2 AIC · ⊞ 37.3K · ◷

Closes #135

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 16:41
@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
@matt-FFFFFF matt-FFFFFF closed this Dec 2, 2026
@matt-FFFFFF matt-FFFFFF reopened this Dec 2, 2026
@appvia-agentic-writer

Copy link
Copy Markdown
Contributor Author
AC Proof Test, check or document CI check Result
AC-15 test TestDeleteRootPoolAC15CoordinatesLifecycle, TestDeleteRootPoolAC15RejectsNonemptyBeforeLifecycleTransition, TestDeleteRootPoolAC15RepeatedDeletePreservesReplacementIncarnation, TestDeleteRootPoolAC15RepeatedDeleteDoesNotAdoptNewDeletingIncarnation, TestDeleteRootPoolAC15MismatchedActiveIncarnationPreservesDocuments, TestDeleteRootPoolAC15RereadsAmbiguousOutcomes, TestDeleteRootPoolAC15RereadsAmbiguousRegistryTransition test (ubuntu-latest) fail — the suite does not prove preservation for a split mismatch where the pool matches the registry but the reservation is from another incarnation

Final verification

F1 — fail

  • pool.go:1293 - For an exact registry/pool incarnation with a different reservation incarnation, deletion overwrites reservationsIncarnation with the unrelated reservation's incarnation. The subsequent delete can remove that unrelated reservation, contrary to the Story constraint to preserve mismatched-incarnation documents and reservations.

F2 — fail

  • pool.go:1293 - Registry-owned deletion adopts an incarnation-mismatched state document rather than retaining the registry incarnation. This is an ownership/correctness defect in the new path, despite all product CI checks being green.

F3 — fail

  • root_create_protocol_test.go:220 - The mismatched-incarnation test replaces both the pool and reservation together. It does not cover the realistic split case where the pool matches the registry entry but the reservation does not, so the Story's expected failure-path evidence is incomplete.

F4 — fail

  • pool.go:1293 - AC-15 is not completely implemented or proven: the code and tests do not establish that every unrelated incarnation's documents and reservations remain intact.

agentic-pr-verify: {"run":"46949809066","sha":"36cbd03f6a1e48a79e95884b054208d9dbfbef63","verdict":"fail","acs":1,"mapped":[],"finals":{"F1":"fail","F2":"fail","F3":"fail","F4":"fail"}}

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

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

Copy link
Copy Markdown
Contributor Author

Commit pushed: 49e5ecc

Generated by implement-high · copilot · mai20 · ~43 AIC · ⌖ ~2 AIC · ⊞ 37.3K

@appvia-agentic-writer

Copy link
Copy Markdown
Contributor Author
AC Proof Test, check or document CI check Result
AC-15 test TestDeleteRootPoolAC15CoordinatesLifecycle; TestDeleteRootPoolAC15RejectsNonemptyBeforeLifecycleTransition; TestDeleteRootPoolAC15RepeatedDeletePreservesReplacementIncarnation; TestDeleteRootPoolAC15RepeatedDeleteDoesNotAdoptNewDeletingIncarnation; TestDeleteRootPoolAC15MismatchedActiveIncarnationPreservesDocuments; TestDeleteRootPoolAC15RereadsAmbiguousOutcomes; TestDeleteRootPoolAC15RereadsAmbiguousRegistryTransition; TestCreatePoolIncompleteStatesRetryThenReportWithoutWrites test (ubuntu-latest) pass — check completed success on the head SHA

Final verification

F1 — pass

  • pool.go:1331 and root_lifecycle.go:93 enforce all-or-nothing registry/incarnation ownership before root deletion, preserve unrelated incarnations, and keep the registry reservation through deletion completion.
  • root_lifecycle.go:134 and root_lifecycle.go:198 implement exact-incarnation active|pending -> deleting transition and cleanup; the changed files outside the Story Hints are directly justified by that lifecycle ownership seam, its protocol tests, and the existing incomplete-state regression table.
  • No additional behavior outside the Story was found.

F2 — pass

  • root_create_protocol_test.go:133 through root_create_protocol_test.go:335 exercise repository behavior with realistic storage outcomes rather than prose or a reference implementation.
  • No blocking correctness, retry, swallowed-error, duplication, or convention finding was found in the full diff.
  • All applicable head-SHA checks succeeded: test (ubuntu-latest), test (macos-latest), test (windows-latest), integration (emulators), and lint.

F3 — pass

  • root_create_protocol_test.go:133 supplies the active/pending happy paths, including state-before-definition deletion and exact registry cleanup.
  • root_create_protocol_test.go:161, root_create_protocol_test.go:178, root_create_protocol_test.go:193, and root_create_protocol_test.go:224 supply nonempty, interrupted, replacement-incarnation, and both split-mismatch failure paths.
  • root_create_protocol_test.go:297 and root_create_protocol_test.go:335 cover ambiguous document and registry outcomes; client_attempt4_test.go:554 proves an unusable split root is not adopted during creation or deletion.
  • The named suite ran successfully in test (ubuntu-latest) on the head SHA.

F4 — pass

  • AC-15 maps to the required behavioral test proof, and the mapping is backed by a successful exact-name CI check on the head SHA.
  • pool.go:1210 and the exact-incarnation lifecycle helpers follow specs/REQ-000017-prevent-overlapping-top-level-pools/contracts/root-pool-overlap.md and ADR-0003 without spec drift.

agentic-pr-verify: {"run":"46958310032","sha":"49e5eccf8a29ca46485db102dce801e7368c2b74","verdict":"pass","acs":1,"mapped":[{"ac":"AC-15","proof":"test","test":"TestDeleteRootPoolAC15CoordinatesLifecycle; TestDeleteRootPoolAC15RejectsNonemptyBeforeLifecycleTransition; TestDeleteRootPoolAC15RepeatedDeletePreservesReplacementIncarnation; TestDeleteRootPoolAC15RepeatedDeleteDoesNotAdoptNewDeletingIncarnation; TestDeleteRootPoolAC15MismatchedActiveIncarnationPreservesDocuments; TestDeleteRootPoolAC15RereadsAmbiguousOutcomes; TestDeleteRootPoolAC15RereadsAmbiguousRegistryTransition; TestCreatePoolIncompleteStatesRetryThenReportWithoutWrites","check":"test (ubuntu-latest)"}],"finals":{"F1":"pass","F2":"pass","F3":"pass","F4":"pass"}}

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

@matt-FFFFFF
matt-FFFFFF merged commit 946144f into main Dec 2, 2026
7 checks passed
@matt-FFFFFF
matt-FFFFFF deleted the feat/root-delete-lifecycle-135-78f1218d34c3dfe6 branch December 2, 2026 20:21
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.

Coordinate root deletion and interrupted lifecycle state

1 participant