feat(goal): prove the journals this module ships, and repair the one it rejected - #58
Merged
Merged
Conversation
…it rejected agent-runtime distributed a Goal journal its own CLI refuses to load. Twenty-two of the twenty-four receipt keys in first-v0-release.json were invented recovery-cycle labels rather than phases, so goal status failed with invalid_goal. The file is tracked, so it travelled inside the published v0.1.3 source archive and was listed in its SPDX inventory. Tightening the schema so receipt keys must be phases is what made an existing file invalid, and nothing compared the two — because the Goal contract was the only contract here without an executable checker over its tracked artifacts. CI, governance, release, provenance, fuzz and cold compile all had one; the product itself did not. cmd/check-goal-journals closes that. It holds every tracked journal to the Go contract and to the published schema, because the two are one vocabulary stated twice: Go alone would let the schema drift, the schema alone would skip the durable invariants the type enforces. It refuses an empty directory, since a gate that succeeds by finding nothing to inspect cannot be told from one that inspected everything, and it requires the file to be the canonical encoding of what it decodes to, so a journal cannot drift each time the runtime rewrites it. It is registered in the CI contract as well as in ci.yml, so it cannot be dropped from the workflow while the contract stays green. The journal itself was migrated by replaying its history through goal.New and Advance, so the result is legitimate by construction rather than by hand. Every recovery cycle's summary and evidence survives, folded into the phase receipt each cycle already named in its own phase field: seven receipts carrying all twenty-four evidence records. One record used a source type that was never in the contracted vocabulary and is recorded as a link. The pre-migration form is in this repository's Git history. It now also says what happened. It had stood at state active with all seven acceptance criteria pending since 13 August, claiming the first release had never occurred, while v0.1.2 and v0.1.3 were published and issue #9 was closed. Its closure records both the outcome and the migration, and keeps as declared debt that v0.1.0 and v0.1.1 remain tagged and unpublished.
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.
agent-runtimedistributed a Goal journal its own CLI refuses to load.22 of its 24 receipt keys were invented recovery-cycle labels rather than phases. The file is tracked, so it travelled inside the published v0.1.3 source archive and was listed in its SPDX inventory.
Why nothing caught it
Tightening the schema so receipt keys must be phases made an existing tracked file invalid, and nothing compared the two — because the Goal contract was the only contract here without an executable checker over its tracked artifacts. CI, governance, release, provenance, fuzz and cold compile all had one. The product itself did not.
That is the same failure class as the P1: a control that cannot fail for the reason it claims. Here there was no control at all.
cmd/check-goal-journalsHolds every tracked journal to both the Go contract and the published schema — they are one vocabulary stated twice, and Go alone would let the schema drift while the schema alone would skip the durable invariants the type enforces.
ci.yml, so it cannot be dropped from the workflow while the contract stays green.gds/repository.yamlalongside the other verification commandsFive damaged shapes are refused in tests, including the exact one that shipped.
The repair
Migrated by replaying the history through
goal.NewandAdvance— the product's own API — so the result is legitimate by construction rather than by hand.Lossless in substance: all 24 evidence records survive on the phase receipts (1, 6, 5, 2, 2, 3, 5), and every cycle summary is retained and labelled. Each recovery receipt already named its real phase in its own
phasefield, so the fold is that mapping and nothing more. One record used asourcetype that was never in the contracted vocabulary and is recorded as alink. The pre-migration form is in Git history.It also now says what happened
It had stood at
state: activewith all seven acceptance criteriapendingsince 13 August — claiming the first release never happened — whilev0.1.2andv0.1.3were published and issue #9 was closed. Its closure records both the outcome and the migration, and keeps as declared debt thatv0.1.0andv0.1.1remain tagged and unpublished.Verification
And the consequence that mattered — a source archive built from this commit, every journal extracted and fed back to the CLI: all accepted. Built from the previous commit,
first-v0-release.jsonis still rejected.gofmt,go vet,staticcheck v0.7.0, full suite underumask 002, all seven contract checkers. All green.