fix(delete): apply must rebuild the retirement evidence the approver signed - #125
Merged
Merged
Conversation
…signed `gds repository delete --apply` could not succeed for any repository. The precondition observer is built twice — once when the plan is stored, once when it is applied — and the apply site set neither `retirement` nor `preserve`. Unread remote collections classify as unknown, which blocks; an empty preserved set turns every accepted loss back into a blocker. `Retirable` was false on every apply, and the failed observation surfaced as GDS_STALE_PLAN with an empty mismatch list. The accepted losses now travel on the transition, so they are inside the plan parameters and the plan digest the approval signs, and one constructor serves both paths so they cannot drift again. Claude-Session: https://claude.ai/code/session_01CKXKXND4zAgWisTtatyTHX
rldyourmnd
force-pushed
the
fix/delete-apply-preserves-approved-retirement
branch
from
September 10, 2026 18:52
d4ee5f5 to
23c330e
Compare
rldyourmnd
deleted the
fix/delete-apply-preserves-approved-retirement
branch
September 10, 2026 19:10
This was referenced Sep 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
gds repository delete --applycould not succeed for any repository.The precondition observer is constructed twice — once when the plan is stored, once when it is applied — and the two sites had drifted. The apply site set neither
retirementnorpreserve. Without the retirement reader every remote collection stays unread, andgatherRetirementEvidenceclassifies unread asunknown, which blocks by design. Without the preserved set every identity the operator explicitly accepted losing reads as blocking again.Retirablewas therefore false on every apply, the observation returned an error, and the engine reported it asGDS_STALE_PLAN— "observed repository state no longer matches the plan" — with an empty mismatch list in the journal. The state had not changed; the observation had failed. Nothing in the tree tested this path.Passing
--preserveagain at apply could not have fixed it either: the declaration belongs to the plan the approver signed, and it was not stored anywhere.ProviderTransition.PreservedIdentitiesnow carries the accepted losses, so they live in the plan parameters and inside the plan digest the approval binds.StepTransitionrejects a non-string entry rather than silently dropping it.newRepositoryDeleteObserverbecomes the single construction site for both paths, so they cannot drift again. Bothpreserveandretirementderive from the stored transition.--preservejoins--inventory-rootand--confirm-*as a planning input refused on apply, which is what it always was in substance.Tests: the parameter round trip now covers the preserved set and its rejection of a non-string entry, and a new
core/apptest asserts the shared observer carries the approved declaration and analysis root.Because the Go sources are part of this repository's own compiled policy inputs,
.gds/bundle.lock.yamland.github/workflows/gds-ci.ymlare regenerated throughgds generate repository --plan/--applywith a binary built from this branch; without that,GDS_CONTEXT_POLICY_SOURCE_DIGEST_MISMATCHfailscore/assurance,core/cliandcore/context.Verification:
scripts/validate_go_core.sh --quickexits 0 — 66 packages ok, no failures.https://claude.ai/code/session_01CKXKXND4zAgWisTtatyTHX