Repository navigation
feat(corrections-report): --ref reads each file at a ref, once per clone (T879a) - #198
Merged
Merged
Conversation
bketelsen
approved these changes
Nov 5, 2026
This was referenced Nov 5, 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
ACMM scorecard (T879a, 2026-11-04), missing instrument 2: the baseline (B6) could not use
scripts/corrections-report.mjs, because it reads working trees. A line on an unmerged branch or an uncommitted edit in any worktree counts as if it were on main.scripts/corrections-report.mjs: new--ref REF(for example--ref origin/main). For each checkout it reads.memory/corrections.jsonlat that ref withgit rev-parse,git ls-treeandgit cat-file(no checkout change, no fetch). The worktrees of 1 clone share their git folder (--git-common-dir), so the file is read once per clone; the other worktrees are listed as paths only. A committed symbolic link is not followed (as in working-tree mode). A checkout that has the file in its working tree but not the ref is listed as unreadable (ref not found: REF), so a repository is never left out without a trace; one with neither is skipped. The ref must look like a ref or revision (^[A-Za-z0-9][A-Za-z0-9._/@{}~^-]*$, no..), so git never reads it as an option, and rev-parse runs with--end-of-options. The report gets areffield (nullwithout--ref) and the text header says(at REF)or(working trees). Without--ref, behaviour is unchanged.GIT_NO_LAZY_FETCH=1, so a partial clone never fetches a missing blob (it is listed ascannot read file at REF); the ref is resolved per worktree (HEAD differs per worktree) and the file is read once per clone and commit; a clone's identity is the first remote any of its worktrees names; a worktree without the ref is listed when it has the file, and when its.memorycannot be read (only ENOENT/ENOTDIR mean absent)..memory/corrections.jsonl: 2 lines (blocker to guard).test/corrections-report.test.mjs: 8 new tests; and theafterhook restores denied folders before it removes fixtures (it threw ENOENT once a fixture was made after the denied-folder test).docs/design/quality-loop.md(weekly promotion) and.memory/README.md: run it with--ref origin/mainafter agit fetch.Risk tier
Risk tier: 1 — a read-only local report, its tests and docs. No workflow, authority, policy or risk path; the report is not in
verify/check.Verification
node --test test/corrections-report.test.mjs: 23/23 pass.make ci: 284 tests pass, docs gate green (head8cb94c2).--ref reads only the file at the ref, once per clone(a clone with origin/main holding 1 line, a feature worktree with a branch-only line, an uncommitted line in the main worktree: working trees give 3 lines,--ref origin/maingives 1, with both worktrees as paths);--ref lists a checkout with the file but without the ref, and skips one without both;--ref does not follow a committed symbolic link and reports bad lines at the ref;--ref refuses a value that git could read as an option.--ref checks each worktree for a file when the clone has no such ref;--ref names a clone by the remote of any of its worktrees(extensions.worktreeConfig);--ref never fetches a blob that a partial clone does not hold(a--filter=blob:noneclone of a localfile://source; the blob is still missing after the run);--ref lists a checkout without the ref whose .memory folder is denied.scripts/corrections-report.mjsfrom the base408ec56and the tests kept, 3 tests fail on assertions (--ref reads only the file at the ref, once per clone,--ref lists a checkout with the file but without the ref, …,--ref does not follow a committed symbolic link …). With the script fromecfa1a5(before the review fixes), the 3 tests for findings 1-3 fail; with the script fromcdfde7c, the denied-folder test fails.openai/gpt-6.1-sol, codergithub-copilot/claude-opus-5.5, base408ec56): initial review atecfa1a5: Not ready, 3 blocking (lazy fetch in a partial clone; a missing-ref result of 1 worktree hid another worktree's file; the first worktree fixed the clone's identity), all accepted and fixed incdfde7c. Re-review 1 atcdfde7c: Not ready, 1 blocking (a denied folder without the ref was skipped), accepted and fixed in8cb94c2. Re-review 2 at8cb94c2: Ready, Blocking: none. Budget used: 1 review + 2 re-reviews.node scripts/corrections-report.mjs --root ~/projects --ref origin/main --json: 70 checkouts, 15 repositories, 118 lines, plus 1 unreadable line (chairlift line 15,promoted_tonot a string) = 119, the same as baseline B6 (15 repositories, 119 lines, snosi 47). Working-tree mode on the same root gives 13 repositories and 114 lines.Docs housekeeping
.memory/README.mdupdated; no new doc.