Repository navigation
feat(corrections): validate corrections.jsonl; blocker-to-guard rule; fleet acceptance note - #189
Merged
Merged
Conversation
…rd rule; fleet acceptance note Plan T801 task t7 (Gap 4).
…d git; reject duplicate keys; fileURLToPath Cross-review findings on #189.
bketelsen
approved these changes
Nov 4, 2026
This was referenced Nov 4, 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.
Summary
Plan T801, task t7 (section "Gap 4: corrections in the repository", decision T801c).
scripts/check-corrections.mjs(new,npm run check:corrections, now inmake verify): validates every line of.memory/corrections.jsonl— valid JSON, a plain object, exactly the 5 ADR-0018 fields, all strings,datea realYYYY-MM-DDcalendar date, non-emptyscope,correctionandevidence. Blank lines and duplicate member names (also escaped ones) fail. A missing file passes (no file).With
--base <ref>it also checks append-only: each base line must be unchanged at the same position, except an emptypromoted_tothat is filled. A removed line, a changed line, or a removed file fails. Every git failure other than "the base has no such path" fails closed (bad ref, unreadable object, output limit).--rootand--filelet an owner run it on another checkout;--filemust stay inside--root, and the same root-relative path is read from disk and from git.docs/design/quality-loop.md, Learn station: the blocker-to-guard rule (a blocking review point gets a test that fails without the fix, else anAGENTS.mdrule, plus 1 corrections line in the same PR) and the "lessons live in the repository" rule of T801c.docs/specs/pr-review-rubric.md: new row "Blocker has a guard".docs/specs/pr-acceptance-metric.md: subsection "Fleet variant: decided acceptance" — the daily audit's Q1 number beside core's own, with the differences (scope, window, denominator)..memory/README.md: names the validator and the rule.Not changed:
policies/agent-governance.json. The new script is not in thequality-gatesboundary paths (its tests are, throughtest/**). Adding it is a policy change and needs its own ADR/design change.Risk tier
Risk tier: high —
test/**is in thequality-gatesprotected boundary ofpolicies/agent-governance.json(minimum_risk_tier: high), and the PR adds a new gate tomake verify. No workflow, authority, skill or template change.Docs housekeeping
Verification
make ci: docs gate 1.000/1.000/1.000 (89 docs, 895 links, 10 symlinks),bash_syntax: 6/6,ok corrections: 3 lines, tests 97/97.node scripts/check-corrections.mjs --base origin/main→ok corrections: 3 lines, append-only vs origin/main(core's 2 existing lines unchanged, 1 appended).9b0b1539ae547e45ad32bfb4f581444e9bc0734c):node scripts/check-corrections.mjs --root ~/projects/frostyard/snosi→ok corrections: 43 lines;with
--base HEAD→ok corrections: 43 lines, append-only vs HEAD.test/check-corrections.test.mjs: 23 tests, including a 6th field fails, 3 bad dates fail (2026-8-11,2026-13-01,2026-02-30), a removed line fails against--base, a changed line fails, a filledpromoted_topasses, a re-filledpromoted_tofails, a removed file fails against--base, a duplicate key fails, an absolute in-root--fileis compared, an unreadable base object fails, a path with spaces works.Revert test
Scratch worktree at the PR head (
git worktree add ../core-revert-t7 HEAD),scripts/check-corrections.mjsreplaced by a stub that printsok corrections: 0 linesand exits 0 (no validation), tests unchanged:Second revert test, for the cross-review fixes (head
ea7cc6d):scripts/check-corrections.mjsrestored to the first commitcfd7b4f, tests of the head kept → pass 17, fail 6:a duplicate key fails, also when one copy is escaped,base: an absolute --file inside the root is compared, not skipped,a --file outside the root exits 2,base: an unreadable base object fails instead of passing,base: a missing file with a bad ref fails,the default root works from a path with spaces.Failing on assertions, for example:
a sixth field fails and names it(Missing expected rejection),2026-13-01 fails as an invalid date,base removal of line 1 or last line fails,base: a removed file fails,base promotion from empty promoted_to passes(stdout has noappend-only vs HEAD). The scratch worktree was restored and removed.Coder:
github-copilot/mai-code-2-flash(script, tests, package.json); docs, the removed-file fix and the cross-review fixes by Lucilla (Claude). Cross-review:openai/gpt-6.1-sol..memory/corrections.jsonlgets 1 line for the cross-review findings that this PR fixed (the PR follows its own blocker-to-guard rule;promoted_tois the test file).Cross-review
Reviewer
openai/gpt-6.1-sol; codersgithub-copilot/mai-code-2-flashand Claude (Lucilla). Initial review atcfd7b4f: 2 blocking (base read errors skipped the comparison;--filepath mismatch between disk and git), 2 low (duplicate JSON keys; percent-encoded default root). All 4 fixed with targeted tests inea7cc6d. Re-review 1: 1 blocking (no corrections line for these fixes), fixed ina279863. Re-review 2 ata279863: Ready, Blocking: none.