Repository navigation
chore(corrections): store each correction in a file of its own - #44
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 3 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.
origin/main added line 4 to .memory/corrections.jsonl (porter#45). The conflict (modify/delete) is resolved by running core's migrate-corrections.mjs (c8962829) on main's version of the old file: line 4 becomes .memory/corrections/2026-11-13-legacy-0004.json, and lines 1 to 3 stay as they were.
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(3 lines at the first head, 4 lines after porter#45 merged intomain) moved to 4 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 oldcorrectionsLinesandTestCorrectionsLinesgo too: they read lines of the old file. 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,packagecheck}/**, 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) on the second run. The first run failed 1 test outside this change,cmd/porterdTestAThreadOverTheSession(it fails about 10 times in 100 withgo test -count=100; this PR does not touchcmd/porterd).node "$T/check-corrections.mjs" --root . --base origin/main(core's validator v2 atCORE_SHA):ok corrections: 3 records, append-only vs origin/mainat9295183, andok corrections: 5 records, append-only vs origin/mainatdfcc9f7(the 3legacy-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 frostnotes#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 #44, chore(corrections): store each correction in a file of its own bketelsen/trimlights#76). Base8b1fe6df1e06f7add076868adf7eaf74a15511cd.929518374c71bcdc38d9e3eea1dec1c79a9c4a5b: 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).dfcc9f71300806b671933c8c966be3ea43fad921: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-44-surrogate-escapes.jsonand2026-11-13-pr-44-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.dfcc9f71300806b671933c8c966be3ea43fad921: Ready, Blocking: none.Merge of main (unchanged update)
mainand added line 4 to.memory/corrections.jsonl, so this PR had a modify/delete conflict on that file. Reviewed headdfcc9f71300806b671933c8c966be3ea43fad921, old base8b1fe6df1e06f7add076868adf7eaf74a15511cd, new base09fd0fd7fe995f84f7997201ac6875ddcbd92af5, new head372535a64aca9de2ef3726684ac1c914417b3470(merge commit).migrate-corrections.mjs --root .atc8962829:migrated 4 records (1 new files, 3 unchanged, 0 promoted); it wrote.memory/corrections/2026-11-13-legacy-0004.jsonand deleted the old file.node "$T/check-corrections.mjs" --root . --base origin/main:ok corrections: 6 records, append-only vs origin/main(4legacy-records and the 2 review records).make verifypasses.diff <(git diff 8b1fe6d dfcc9f7 -- . ':!.memory/corrections.jsonl') <(git diff 09fd0fd 372535a -- . ':!.memory/corrections.jsonl' ':!.memory/corrections/2026-11-13-legacy-0004.json')shows only theindexline ofAGENTS.md(main changed other parts ofAGENTS.md). The PR's own changes are unchanged.openai/gpt-6.1-sol, the same reviewer): Compatible. main changed neitherinternal/workflowcheck/nor the B2 text;legacy-0004keeps all 5 fields of line 4; the merge resolves only that conflict.