Repository navigation
chore(corrections): store each correction in a file of its own - #76
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 5 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.
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(5 lines) moved to 5 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. The copy usesencoding/json(this repository's JSON package); the duplicate-member case expects the text of the existingduplicateMemberscheck. 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 (
gh pr list --state openwith the old path filter, at the time of this PR).Risk tier
Risk tier: 3 —
risk:high: the PR touchesinternal/workflowcheck/(globinternal/{workflowcheck,doccheck}/**, 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 verifygreen (host).node "$T/check-corrections.mjs" --root . --base origin/main(core's validator v2 atCORE_SHA):ok corrections: 5 records, append-only vs origin/mainat752d796, andok corrections: 7 records, append-only vs origin/mainat813c833(the 5legacy-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 frostyard/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 frostyard/frostmail#318, chore(corrections): store each correction in a file of its own frostyard/frostnotes#227, chore(corrections): store each correction in a file of its own frostyard/frostread#85, chore(corrections): store each correction in a file of its own frostyard/lodge#76, chore(corrections): store each correction in a file of its own frostyard/porter#44, chore(corrections): store each correction in a file of its own #76). Base6b1ff84cc2d41c665e24a6b46d99fb8fc48d4423.752d79641aa9cc1df3b7f1a6f84876c4420cd7de: 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).813c833f897995721ab0a8ed7b91f1cd33aa751d: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-76-surrogate-escapes.jsonand2026-11-13-pr-76-js-date-and-trim.json.go test -run 'TestCorrectionProblems|TestRecordFileProblems' ./internal/workflowcheck/fails on: scope of U+0085 only, scope of U+FEFF only, year 0000, year 0099; and with the canonical comparison set back to decode-then-quote (encoding/jsonhere replaces a lone surrogate with U+FFFD),TestRecordFileProblemsfails on: 2 high surrogates, high surrogate before a letter, lone high surrogate, lone low surrogate.813c833f897995721ab0a8ed7b91f1cd33aa751d: Ready, Blocking: none.