Skip to content

feat(goal): prove the journals this module ships, and repair the one it rejected - #58

Merged
rldyourmnd merged 1 commit into
mainfrom
feat/self-verified-journals
Aug 15, 2026
Merged

feat(goal): prove the journals this module ships, and repair the one it rejected#58
rldyourmnd merged 1 commit into
mainfrom
feat/self-verified-journals

Conversation

@rldyourmnd

Copy link
Copy Markdown
Contributor

agent-runtime distributed a Goal journal its own CLI refuses to load.

$ agent-runtime goal status --journal .agent-runtime/goals/first-v0-release.json
{"error":"invalid_goal","message":"invalid receipt for phase recovery_cycle_verification_orient"}

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-journals

Holds 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.

  • refuses an empty directory: a gate that succeeds by finding nothing to inspect cannot be told from one that inspected everything
  • requires the file to be the canonical encoding of what it decodes to, so a journal cannot drift each time the runtime rewrites it
  • registered in the CI contract as well as ci.yml, so it cannot be dropped from the workflow while the contract stays green
  • recorded in .gds/repository.yaml alongside the other verification commands

Five damaged shapes are refused in tests, including the exact one that shipped.

The repair

Migrated by replaying the history through goal.New and Advance — 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 phase field, so the fold is that mapping and nothing more. 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 Git history.

It also now says what happened

It had stood at state: active with all seven acceptance criteria pending since 13 August — claiming the first release never happened — 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.

Verification

$ go run ./cmd/check-goal-journals
goal journals valid: 9 tracked under .agent-runtime/goals, accepted by the Goal contract and the published schema

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.json is still rejected.

gofmt, go vet, staticcheck v0.7.0, full suite under umask 002, all seven contract checkers. All green.

…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.
@rldyourmnd
rldyourmnd enabled auto-merge August 15, 2026 00:03
@rldyourmnd
rldyourmnd merged commit 7c04022 into main Aug 15, 2026
4 checks passed
@rldyourmnd
rldyourmnd deleted the feat/self-verified-journals branch August 15, 2026 00:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant