Repository navigation
chore(corrections): store each correction in a file of its own - #227
Merged
Merged
Conversation
Every PR that fixes a blocking review point appended 1 line to the end of .memory/corrections.jsonl, so parallel PRs conflicted on each merge, and GitHub's server merge ignores merge=union. core ADR-0081 moves the inbox to 1 file per record in .memory/corrections/. core's scripts/migrate-corrections.mjs (core c8962829) wrote the 65 lines as <date>-legacy-NNNN.json records. internal/workflowcheck now reads the folder by the v2 rules: name, content, name date and canonical form, and it fails while the old file exists.
2 tasks done
The Go port refused a canonical record with an escaped lone UTF-16 surrogate, which JSON.parse keeps and JSON.stringify writes back as a lowercase escape; it accepted the years 0000 to 0099, which core's Date.UTC reads as 19YY; and it trimmed fields with Go's white space, which differs from JavaScript's on U+0085 and U+FEFF. The port now reads each string literal 1 escape at a time and follows core on dates and white space. New test cases cover each rule, and 2 records note it.
This was referenced Nov 13, 2026
bketelsen
approved these changes
Nov 13, 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
Every PR that fixes a blocking review point appends 1 line to the end of
.memory/corrections.jsonl, so parallel PRs conflict on each merge. GitHub's server merge ignoresmerge=union. core ADR-0081 moves the inbox to 1 file per record in.memory/corrections/. 2 PRs that add 2 different files do not conflict..memory/corrections.jsonl(65 lines) moved to 65 files.memory/corrections/<date>-legacy-NNNN.json, with core'sscripts/migrate-corrections.mjsatCORE_SHA=c8962829f1f34d900e0632e63f690f81630702f1(core#240):internal/workflowcheck(row B2) reads the folder by core's v2 rules, without a base: each file's name (<date>-<slug>.json, slug at most 60 characters), the 5 fields and their content rules (unchangedcorrectionProblems), the name date equal todate, and the canonical form (JSON.stringify(record, null, 2)and a newline). It refuses a missing or empty folder, a subfolder, a symbolic link, a non-empty.gitkeep, and the old file. New filecorrections_test.go; the oldTestCorrectionsInboxleavesbaseline_test.go. It reads only the working tree, so it does not refuse a removed, renamed or changed record (as before, where append-only had no test).AGENTS.md(B2 bullet),docs/org-adrs.md(inbox line and a new ADR-0081 line),.github/pull_request_template.md.Open PRs that change the old file: none when this PR opened. Since then: #231 (adds 1 line). PRs that move their records after this PR: #231. If this PR merges first, #231 merges
mainand runs core'smigrate-corrections.mjs --root . --pr 231; if #231 merges first, this PR mergesmainand runs the migration again on main's old file.Risk tier
Risk tier: 3 —
risk:high: the PR touchesinternal/workflowcheck/(globinternal/{workflowcheck,repocheck}/**, L2, governance: the baseline tests). Why it is safe: the change is test code only; it replaces the B2 test of the old file with a test of the folder, and keeps the content rules unchanged. No product code, workflow or gate command changes.Verification
make checkgreen (host).node "$T/check-corrections.mjs" --root . --base origin/main(core's validator v2 atCORE_SHA):ok corrections: 65 records, append-only vs origin/mainatdcf773b, andok corrections: 67 records, append-only vs origin/mainatd5fbdea(the 65legacy-records and the 2 records of the review fixes). This proves that every old line is itslegacy-record.check-corrections.mjsrefused 7047 of them;recordFileProblemsgave the same verdict on all 87130.canonicalRecordgave the same text as Node'sJSON.stringify(record, null, 2) + "\n"for 5779 records (every code point from U+0000 to U+02FF, U+2028, U+2029, U+FEFF, astral characters, and 5000 random strings); a throwaway cross-check, not committed..memory/corrections/removed and.memory/corrections.jsonlrestored fromorigin/main,go test -run TestCorrectionsInbox ./internal/workflowcheck/fails:.memory/corrections.jsonl: is retired in this repositoryand.memory/corrections: missing.git grep -n 'corrections\.jsonl' -- . ':!docs/adr' ':!docs/plans' ':!CHANGELOG*' ':!.memory/README.md' ':!scripts/check-corrections.mjs' ':!scripts/check-template.mjs' ':!test' ':!tests' ':!*.test.*' ':!*_test.go' ':!.github/scripts/test_baseline.py': no output.Cross-review
openai/gpt-6.1-sol; codersanthropic/claude-opus-5-5(the port in chore(corrections): store each correction in a file of its own frostmail#318, the review fixes) andanthropic/claude-haiku-5-5(the copies to the other repositories of the same migration). 1 review in 2 batches covered the 6 migration PRs (chore(corrections): store each correction in a file of its own frostmail#318, chore(corrections): store each correction in a file of its own #227, chore(corrections): store each correction in a file of its own frostread#85, chore(corrections): store each correction in a file of its own lodge#76, chore(corrections): store each correction in a file of its own porter#44, chore(corrections): store each correction in a file of its own bketelsen/trimlights#76). Base851670ab3a3b89a6ded3ee276ffdb59c6b2c4e59.dcf773b00797ae479d535c082dda1f8fd13606e0: 2 blocking findings, both parity gaps between the Go port and core'scheck-corrections.mjs: (1) a canonical record with an escaped lone UTF-16 surrogate (such as\ud800) was refused, because a Go JSON decoder refuses or replaces it, and core keeps it; (2) the years 0000 to 0099 passed, and core refuses them (itsDate.UTCreads them as 19YY).d5fbdea8d3cee462e7fdb780b944f511f9ab87fd:corrections_test.goreads each string literal 1 escape at a time and compares the canonical text from the literals;correctionProblemsrefuses years below 0100 and trims fields with JavaScript's white space (U+0085 is not white space, U+FEFF is; the reviewer named this as a known difference).TestRecordFileProblemsandTestCorrectionProblems, and the records.memory/corrections/2026-11-13-pr-227-surrogate-escapes.jsonand2026-11-13-pr-227-js-date-and-trim.json.go test -run 'TestCorrectionProblems|TestRecordFileProblems' ./internal/workflowcheck/fails on: 2 high surrogates, high surrogate before a letter, lone high surrogate, lone low surrogate, lone surrogate in uppercase, scope of U+0085 only, scope of U+FEFF only, year 0000, year 0099.d5fbdea8d3cee462e7fdb780b944f511f9ab87fd: Ready, Blocking: none.