From 0f2341bf092aab36999d12e84e69bb019dec9733 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 15 Nov 2026 16:43:48 +0000 Subject: [PATCH 1/3] fix(pm): the carry reads a hop's paths with --no-renames, so a rename lists its source unexplainedPathsBetween listed a hop's changed paths, and the PR's own delta at each head, with `git diff -z --name-only` and rename detection on, so a rename was listed by its destination alone. A hop moving a reviewed file onto a prose face (skills/a/rules/security.md -> content/docs/security.md) listed only the prose path and carried the record. Both reads now go through one argv, CARRY_DIFF_ARGV, with --no-renames: a rename reads as a delete plus an add. The self-test's fake git answers only that exact argv; one argument pin and one real-git row (temp repo, GIT_* stripped, no global or system config) are added. Claude-Session: https://claude.ai/code/session_01ADHkmQk5t2iVNRP4bBd2qx Co-authored-by: Claude --- scripts/pm/record-recognisers.mjs | 61 +++++++++++++++++++++++++++---- 1 file changed, 54 insertions(+), 7 deletions(-) diff --git a/scripts/pm/record-recognisers.mjs b/scripts/pm/record-recognisers.mjs index 0498405b3ee..7a3b00d3d2c 100644 --- a/scripts/pm/record-recognisers.mjs +++ b/scripts/pm/record-recognisers.mjs @@ -30,6 +30,7 @@ * isModelIdentifierToken the token a refusal must never quote back * REVIEW_OF_RECORD_THREADS the ONE thread set, and REVIEW_OF_RECORD_LOCATION its words * unexplainedPathsBetween the pure-regeneration test a carried record re-runs, prose arm included + * CARRY_DIFF_ARGV the one argv that test lists a hop's paths with (`--no-renames`: both sides of a rename) * isOutsideReviewSurface the prose faces a head may move on and keep its record * contractReviewTemplateLines / contractReviewRecordLines what `--template` prints * contractReviewBriefLines what `--brief-template` prints — the brief a seat hands its reviewer @@ -77,9 +78,12 @@ // dispatch-gates: self-test-reads .claude/skills/pm-dispatch/references/project-forms.md .claude/skills/pm-dispatch/references/contract-review.md -- the mailbox doorbell battery pins the key table both ways against project-forms.md's 〈信箱 PR〉 section (every key named there, no other key named there), the claim-line battery pins the `Contract-review-claim:` template and its lapse hours in contract-review.md, and the hold-line battery pins the `Contract-review-hold:` template and its listing hours there, so a change to any of those spellings is judged here import process from 'node:process'; -import { spawnSync } from 'node:child_process'; -import { readFileSync } from 'node:fs'; +import { execFileSync, spawnSync } from 'node:child_process'; +import { mkdirSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from 'node:fs'; +import { tmpdir } from 'node:os'; +import { join } from 'node:path'; import { fileURLToPath } from 'node:url'; +import { gitFreeEnv } from '../git-env.mjs'; import { isEntrypoint } from '../invoked-as.mjs'; import { CONTRACT_REVIEW_HEADING_MARKER, @@ -462,9 +466,18 @@ export function regenChainToHead(pair) { * hand-resolved merge leaves its resolution in the delta at the NEW head, and a * slipped-in edit in whichever delta carries it. `-z` throughout: a path may * hold a space, a quote or a colon and the parse must not be the weak link. + * + * ⛔ `--no-renames` on every read, owned by the ONE helper both reads go + * through: with rename detection on (git's default) a rename is listed by its + * DESTINATION alone, so a hop that moves a reviewed file onto a prose face + * (`skills/a/rules/security.md` → `content/docs/security.md`) would list only + * the prose path and carry the record past a file that left its face. Read as + * a delete plus an add, the SOURCE path is listed and judged like any other. */ +export const CARRY_DIFF_ARGV = Object.freeze(['diff', '-z', '--name-only', '--no-renames']); + export function unexplainedPathsBetween(runGit, { from, to, base }) { - const names = (a, b) => String(runGit(['diff', '-z', '--name-only', a, b])).split('\0').filter((p) => p !== ''); + const names = (a, b) => String(runGit([...CARRY_DIFF_ARGV, a, b])).split('\0').filter((p) => p !== ''); const moved = names(from, to).filter((p) => !isOutsideReviewSurface(p)); if (moved.length === 0) return []; const f = String(runGit(['check-attr', '--source', to, '-z', 'merge', '--stdin'], moved.join('\0'))).split('\0'); @@ -2434,7 +2447,7 @@ const SELF_TEST_BATTERIES = Object.freeze({ 'the locator: the newest `## Contract review` on this head, on EITHER thread (#17302)': 19, '#18141 · #27979: the head sha sits in a span of ITS OWN on the `Head-sha:` line — the key-in-span spelling and a span in the prose name no head': 14, 'the `Served-tier:` reading — the tier that SERVED the record (#17915 · #18060 · #18174)': 27, - '⭐ the 2026-09-20 ruling: a pure-regeneration head move KEEPS the record, decided on the COMMITTED trees': 22, + '⭐ the 2026-09-20 ruling: a pure-regeneration head move KEEPS the record, decided on the COMMITTED trees': 24, '#18042: the copyable record TEMPLATE — the one machine-read artefact with nothing to copy': 30, // Raised 17 → 19 by #33541: the template record's one `VERDICT:` line read PASS by the guard, and the same record // posted by an untrusted author not read — two pins, two cases. @@ -2815,7 +2828,9 @@ export async function selfTest() { if (args[0] === 'merge-base') return `mb-${args[2]}\n`; if (args[0] === 'check-attr') return spec.attrs; if (args[0] === 'rev-parse') return `${HEAD_9AF9}00\n`; - const [, , , a, b] = args; // diff -z --name-only A B + // ⛔ Exact argv or nothing: a diff spelled any other way answers no paths, so a dropped flag cannot ride through. + if (args.length !== CARRY_DIFF_ARGV.length + 2 || CARRY_DIFF_ARGV.some((w, i) => args[i] !== w)) return ''; + const [a, b] = args.slice(CARRY_DIFF_ARGV.length); // diff -z --name-only --no-renames A B return a === HEAD_9AF9 && b === NEW_HEAD ? spec.moved : (spec.own?.[b] ?? ''); }; const REGEN_ONLY = { moved: 'packages/spec/api-surface/data.txt\0', attrs: 'packages/spec/api-surface/data.txt\0merge\0os-regen\0' }; @@ -2842,7 +2857,7 @@ export async function selfTest() { t('⛔ a thread with no line carries none, so the ordinary rule is untouched where nobody claims the exception', regenChainToHead(moved([RECORD_ON_9AF9])) === null && regenCarry(moved([RECORD_ON_9AF9])).state === 'none' && locateReviewOfRecord(moved([RECORD_ON_9AF9], GIT_EMPTY)).state === 'absent'); // the tree test — and it reads COMMITTED trees, never the working one t('⭐ an EMPTY non-`merge=os-regen` diff CARRIES the record', regenCarry(CARRIED()).state === 'carried'); - t('…and a generated path DID move: the test named two COMMITS and read `.gitattributes` out of the new one', GIT_SEEN.includes(`diff -z --name-only ${HEAD_9AF9} ${NEW_HEAD}`) && GIT_SEEN.includes(`check-attr --source ${NEW_HEAD} -z merge --stdin`), GIT_SEEN.join(' | ')); + t('…and a generated path DID move: the test named two COMMITS and read `.gitattributes` out of the new one', GIT_SEEN.includes(`diff -z --name-only --no-renames ${HEAD_9AF9} ${NEW_HEAD}`) && GIT_SEEN.includes(`check-attr --source ${NEW_HEAD} -z merge --stdin`), GIT_SEEN.join(' | ')); t('…so the record is FOUND on the new head, naming the head it actually judged and the hop count', (() => { const r = locateReviewOfRecord(CARRIED()); return r.state === 'found' && r.carriedFrom.startsWith(HEAD_9AF9) && r.carriedHops === 1; })()); t('⛔ a HAND-WRITTEN path in the same range certifies nothing — refused, and the reason says which path', (() => { const r = regenCarry(moved([RECORD_ON_9AF9, PROV()], GIT_HAND)); return r.state === 'refused' && says(r.reason, 'scripts/pm/x.mjs'); })() && locateReviewOfRecord(moved([RECORD_ON_9AF9, PROV()], GIT_HAND)).state === 'absent'); t('⛔ a chain whose hops name DIFFERENT records certifies nothing', regenCarry(moved([RECORD_ON_9AF9, PROV(HEAD_9AF9, 'bbbbbbbb', 3301), PROV('bbbbbbbb', NEW_HEAD, 9999)], GIT_EMPTY)).state === 'refused'); @@ -2858,8 +2873,40 @@ export async function selfTest() { t('⭐ (i) a MERGE-FORWARD carrying ANOTHER PR\'s hand-written path beside the regeneration is CARRIED', regenCarry(withGit(GIT(CARRY_OVER))).state === 'carried' && locateReviewOfRecord(withGit(GIT(CARRY_OVER))).state === 'found'); t('⛔ (iii) the SAME path, hand-resolved so the new head no longer holds what main brought, is REFUSED', (() => { const r = regenCarry(withGit(GIT(HAND_RESOLVED))); return r.state === 'refused' && says(r.reason, 'AGENTS.md'); })()); t('⇒ the DELTA decides, ⛔ never the path name: one path, two specimens, two verdicts', unexplainedPathsBetween(GIT(CARRY_OVER), { from: HEAD_9AF9, to: NEW_HEAD, base: BASE }).length === 0 && unexplainedPathsBetween(GIT(HAND_RESOLVED), { from: HEAD_9AF9, to: NEW_HEAD, base: BASE }).join() === 'AGENTS.md'); - t('…and the delta is read ONCE PER HEAD against `merge-base BASE head`, ⛔ never once per path', GIT_SEEN.includes(`merge-base ${BASE} ${HEAD_9AF9}`) && GIT_SEEN.includes(`diff -z --name-only mb-${NEW_HEAD} ${NEW_HEAD}`), GIT_SEEN.slice(-4).join(' | ')); + t('…and the delta is read ONCE PER HEAD against `merge-base BASE head`, ⛔ never once per path', GIT_SEEN.includes(`merge-base ${BASE} ${HEAD_9AF9}`) && GIT_SEEN.includes(`diff -z --name-only --no-renames mb-${NEW_HEAD} ${NEW_HEAD}`), GIT_SEEN.slice(-4).join(' | ')); t('⛔ (iv) a run naming NO base ref cannot tell main\'s carry-over from a hand edit — UNREADABLE, ⛔ never clean', (() => { const r = regenCarry(withGit(GIT(CARRY_OVER), { baseRef: null })); return r.state === 'unreadable' && r.gaps.some((g) => g.includes('base ref')); })()); + // ⛔ A rename is read as a delete plus an add (`--no-renames`), so a hop that moves a reviewed file onto + // a prose face lists the SOURCE path and is judged by it: the fake git above answers nothing to any + // other spelling, and every diff it was sent is the one argv the reader owns. + t('⛔ every name list the carry reads is sent as `diff -z --name-only --no-renames A B`, ⛔ never with rename detection on', (() => { const diffs = GIT_SEEN.filter((c) => c.startsWith('diff ')); return diffs.length > 0 && diffs.every((c) => /^diff -z --name-only --no-renames \S+ \S+$/.test(c)); })(), GIT_SEEN.filter((c) => c.startsWith('diff ')).join(' | ')); + const RENAMED_OUT = (() => { + const dir = mkdtempSync(join(tmpdir(), 'carry-rename-')); + try { + // GIT_* stripped (GIT_ENV_ISOLATION_RULE) and no global or system config read: identity, signing and + // rename detection are all set here, so the row reads the same on every machine. + const env = { ...gitFreeEnv(), GIT_CONFIG_NOSYSTEM: '1', GIT_CONFIG_GLOBAL: '/dev/null' }; + const realGit = (args, input) => execFileSync('git', ['-c', 'user.email=t@t.invalid', '-c', 'user.name=t', '-c', 'init.defaultBranch=main', '-c', 'commit.gpgsign=false', '-c', 'diff.renames=true', ...args], { cwd: dir, encoding: 'utf8', env, input, stdio: [input === undefined ? 'ignore' : 'pipe', 'pipe', 'pipe'] }); + realGit(['init', '-q']); + mkdirSync(join(dir, 'skills/a/rules'), { recursive: true }); + writeFileSync(join(dir, 'skills/a/rules/security.md'), 'Never echo a token back.\n'.repeat(20)); + realGit(['add', '-A']); + realGit(['commit', '-q', '-m', 'base']); + const from = realGit(['rev-parse', 'HEAD']).trim(); + realGit(['checkout', '-q', '-b', 'pr']); + mkdirSync(join(dir, 'content/docs'), { recursive: true }); + realGit(['mv', 'skills/a/rules/security.md', 'content/docs/security.md']); + realGit(['commit', '-q', '-m', 'move']); + const to = realGit(['rev-parse', 'HEAD']).trim(); + const destinationOnly = realGit(['diff', '-z', '--name-only', from, to]).split('\0').filter(Boolean); + const unexplained = unexplainedPathsBetween(realGit, { from, to, base: 'main' }); + return destinationOnly.join() === 'content/docs/security.md' && unexplained.join() === 'skills/a/rules/security.md' ? true : JSON.stringify({ destinationOnly, unexplained }); + } catch (error) { + return String(error?.message ?? error); + } finally { + rmSync(dir, { recursive: true, force: true }); + } + })(); + t('⛔ on REAL git, a reviewed file RENAMED onto a prose face is unexplained by its SOURCE path — the destination alone would carry the record', RENAMED_OUT === true, RENAMED_OUT); // ⭐ the PROSE arm (B′ with C, ruling record 6159870311): a head that moves only on faces outside the // review surface keeps the record — decided on the same committed trees, by the same line. From a5ed454810ad31e15d15d655a79ac6a226bce189 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 15 Nov 2026 16:46:01 +0000 Subject: [PATCH 2/3] test(pm): the queue guard's regen fake reads its revs from the tail; older governed-merges git fixtures run GIT_*-free The queue guard's regen battery fake git parsed `diff -z --name-only A B` positionally, so the carry's `--no-renames` argv read as rev A. It now takes the two revs from the tail of argv. The older real-git fixtures in check-governed-merges' self-test spawned git with the inherited environment; under a hook's GIT_INDEX_FILE or GIT_DIR they acted on the real checkout. Each now passes env: gitFreeEnv() (GIT_*_DATE added on top for the backdated commits), per GIT_ENV_ISOLATION_RULE. Claude-Session: https://claude.ai/code/session_01ADHkmQk5t2iVNRP4bBd2qx Co-authored-by: Claude --- scripts/pm/check-governed-merges.mjs | 20 +++++++++++--------- scripts/pm/check-governed-queue-guard.mjs | 2 +- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/scripts/pm/check-governed-merges.mjs b/scripts/pm/check-governed-merges.mjs index 10dbc0650de..ebfa4896cee 100644 --- a/scripts/pm/check-governed-merges.mjs +++ b/scripts/pm/check-governed-merges.mjs @@ -6911,6 +6911,7 @@ async function selfTest() { execFileSync('git', ['-c', 'user.email=t@t.invalid', '-c', 'user.name=t', '-c', 'init.defaultBranch=main', '-c', 'commit.gpgsign=false', ...rest], { cwd, encoding: 'utf8', + env: gitFreeEnv(), stdio: ['ignore', 'pipe', 'pipe'], }); const seed = join(fxRoot, 'seed'); @@ -6923,7 +6924,7 @@ async function selfTest() { execFileSync( 'git', ['-c', 'user.email=t@t.invalid', '-c', 'user.name=t', '-c', 'commit.gpgsign=false', 'commit', '-q', '--allow-empty', '-m', msg], - { cwd: seed, encoding: 'utf8', stdio: ['ignore', 'pipe', 'pipe'], env: { ...process.env, GIT_COMMITTER_DATE: when, GIT_AUTHOR_DATE: when } }, + { cwd: seed, encoding: 'utf8', stdio: ['ignore', 'pipe', 'pipe'], env: { ...gitFreeEnv(), GIT_COMMITTER_DATE: when, GIT_AUTHOR_DATE: when } }, ); backdated('chore: forty days ago', new Date(Date.now() - 40 * 86_400_000).toISOString()); backdated('chore: thirty-five days ago', new Date(Date.now() - 35 * 86_400_000).toISOString()); @@ -8193,7 +8194,7 @@ async function selfTest() { try { const g2 = (cwd, ...rest) => execFileSync('git', ['-c', 'user.email=t@t.invalid', '-c', 'user.name=t', '-c', 'init.defaultBranch=main', '-c', 'commit.gpgsign=false', ...rest], - { cwd, encoding: 'utf8', stdio: ['ignore', 'pipe', 'pipe'] }); + { cwd, encoding: 'utf8', env: gitFreeEnv(), stdio: ['ignore', 'pipe', 'pipe'] }); const repo = join(derFx, 'repo'); g2(derFx, 'init', '-q', repo); // The fixture is a checkout OF a governed repository: `--branch` / `--test` @@ -8467,7 +8468,7 @@ async function selfTest() { try { const g3 = (cwd, ...rest) => execFileSync('git', ['-c', 'user.email=t@t.invalid', '-c', 'user.name=t', '-c', 'init.defaultBranch=main', '-c', 'commit.gpgsign=false', ...rest], - { cwd, encoding: 'utf8', stdio: ['ignore', 'pipe', 'pipe'] }); + { cwd, encoding: 'utf8', env: gitFreeEnv(), stdio: ['ignore', 'pipe', 'pipe'] }); const repo = join(sizeFx, 'repo'); g3(sizeFx, 'init', '-q', repo); g3(repo, 'remote', 'add', 'origin', 'https://github.com/objectstack-ai/objectstack.git'); // the checkout's repository (ruling B2) @@ -8648,14 +8649,14 @@ async function selfTest() { try { const og = (cwd, ...rest) => execFileSync('git', ['-c', 'user.email=t@t.invalid', '-c', 'user.name=t', '-c', 'init.defaultBranch=main', '-c', 'commit.gpgsign=false', ...rest], - { cwd, encoding: 'utf8', stdio: ['ignore', 'pipe', 'pipe'] }); + { cwd, encoding: 'utf8', env: gitFreeEnv(), stdio: ['ignore', 'pipe', 'pipe'] }); const seed = join(overFx, 'seed'); og(overFx, 'init', '-q', seed); for (const [msg, ago] of [['chore: forty days ago', 40], ['chore: thirty-five days ago', 35]]) { const when = new Date(Date.now() - ago * 86_400_000).toISOString(); execFileSync('git', ['-c', 'user.email=t@t.invalid', '-c', 'user.name=t', '-c', 'commit.gpgsign=false', 'commit', '-q', '--allow-empty', '-m', msg], { cwd: seed, encoding: 'utf8', stdio: ['ignore', 'pipe', 'pipe'], - env: { ...process.env, GIT_COMMITTER_DATE: when, GIT_AUTHOR_DATE: when }, + env: { ...gitFreeEnv(), GIT_COMMITTER_DATE: when, GIT_AUTHOR_DATE: when }, }); } const lines = (n) => `${Array.from({ length: n }, (_, i) => `line ${i}`).join('\n')}\n`; @@ -8738,7 +8739,7 @@ async function selfTest() { try { const rg = (cwd, ...rest) => execFileSync('git', ['-c', 'user.email=t@t.invalid', '-c', 'user.name=t', '-c', 'init.defaultBranch=main', '-c', 'commit.gpgsign=false', ...rest], - { cwd, encoding: 'utf8', stdio: ['ignore', 'pipe', 'pipe'] }); + { cwd, encoding: 'utf8', env: gitFreeEnv(), stdio: ['ignore', 'pipe', 'pipe'] }); const repo = join(renFx, 'repo'); rg(renFx, 'init', '-q', repo); rg(repo, 'config', 'diff.renames', 'false'); // a config that turns rename detection off must not reach the size read @@ -8915,6 +8916,7 @@ async function selfTest() { execFileSync('git', ['-c', 'user.email=t@t.invalid', '-c', 'user.name=t', '-c', 'init.defaultBranch=main', '-c', 'commit.gpgsign=false', ...rest], { cwd, encoding: 'utf8', + env: gitFreeEnv(), stdio: ['ignore', 'pipe', 'pipe'], }); const bannerSeed = join(bannerFx, 'seed'); @@ -8926,7 +8928,7 @@ async function selfTest() { const when = new Date(Date.now() - ago * 86_400_000).toISOString(); execFileSync('git', ['-c', 'user.email=t@t.invalid', '-c', 'user.name=t', '-c', 'commit.gpgsign=false', 'commit', '-q', '--allow-empty', '-m', msg], { cwd: bannerSeed, encoding: 'utf8', stdio: ['ignore', 'pipe', 'pipe'], - env: { ...process.env, GIT_COMMITTER_DATE: when, GIT_AUTHOR_DATE: when }, + env: { ...gitFreeEnv(), GIT_COMMITTER_DATE: when, GIT_AUTHOR_DATE: when }, }); } mkdirSync(join(bannerSeed, 'docs', 'adr'), { recursive: true }); @@ -9076,8 +9078,8 @@ async function selfTest() { // A checkout whose origin IS objectstack, so the bare number's repository is // fixed by the fixture rather than by whatever clone runs this. const argvRoot = join(argvFx, 'objectstack'); - execFileSync('git', ['init', '-q', argvRoot], { stdio: 'ignore' }); - execFileSync('git', ['remote', 'add', 'origin', 'https://github.com/objectstack-ai/objectstack.git'], { cwd: argvRoot, stdio: 'ignore' }); + execFileSync('git', ['init', '-q', argvRoot], { env: gitFreeEnv(), stdio: 'ignore' }); + execFileSync('git', ['remote', 'add', 'origin', 'https://github.com/objectstack-ai/objectstack.git'], { cwd: argvRoot, env: gitFreeEnv(), stdio: 'ignore' }); const runArgv = (argv, env = {}) => new Promise((done) => { apiReads.length = 0; const child = spawn(process.execPath, [scriptPath, ...argv, '--root', argvRoot], { diff --git a/scripts/pm/check-governed-queue-guard.mjs b/scripts/pm/check-governed-queue-guard.mjs index 15cc1be86f6..2a33f1fdcc8 100644 --- a/scripts/pm/check-governed-queue-guard.mjs +++ b/scripts/pm/check-governed-queue-guard.mjs @@ -5759,7 +5759,7 @@ export async function selfTest() { if (args[0] === 'merge-base') return `mb-${args[2]}\n`; if (args[0] === 'check-attr') return spec.attrs; if (args[0] === 'rev-parse') return `${REF_OLD}\n`; - const [, , , a, b] = args; // diff -z --name-only A B + const [a, b] = args.slice(-2); // diff -z --name-only --no-renames A B: the two revs are the TAIL return a === REF_OLD && b === REF_HEAD ? spec.moved : (spec.own?.[b] ?? ''); }; const qRegen = { moved: 'packages/spec/api-surface/ui.txt\0', attrs: 'packages/spec/api-surface/ui.txt\0merge\0os-regen\0' }; From 80fb531781760a7c3d3891deeccbbafa14e67a4f Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 15 Nov 2026 17:03:33 +0000 Subject: [PATCH 3/3] fix(pm): keep the carry argv module-private, so the census marker line holds CARRY_DIFF_ARGV is read only inside record-recognisers (the helper and its self-test fake), so it is not exported and the header export list is unchanged; the `self-test-reads` marker stays on the line the dispatch-gates census pins. Claude-Session: https://claude.ai/code/session_01ADHkmQk5t2iVNRP4bBd2qx Co-authored-by: Claude --- scripts/pm/record-recognisers.mjs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/scripts/pm/record-recognisers.mjs b/scripts/pm/record-recognisers.mjs index 7a3b00d3d2c..d15231d06d0 100644 --- a/scripts/pm/record-recognisers.mjs +++ b/scripts/pm/record-recognisers.mjs @@ -30,7 +30,6 @@ * isModelIdentifierToken the token a refusal must never quote back * REVIEW_OF_RECORD_THREADS the ONE thread set, and REVIEW_OF_RECORD_LOCATION its words * unexplainedPathsBetween the pure-regeneration test a carried record re-runs, prose arm included - * CARRY_DIFF_ARGV the one argv that test lists a hop's paths with (`--no-renames`: both sides of a rename) * isOutsideReviewSurface the prose faces a head may move on and keep its record * contractReviewTemplateLines / contractReviewRecordLines what `--template` prints * contractReviewBriefLines what `--brief-template` prints — the brief a seat hands its reviewer @@ -442,6 +441,10 @@ export function regenChainToHead(pair) { return chain.length === 0 ? null : chain; } +// The one argv the carry lists a hop's paths with — `--no-renames`, so a rename names BOTH sides +// (why: `unexplainedPathsBetween` below). +const CARRY_DIFF_ARGV = Object.freeze(['diff', '-z', '--name-only', '--no-renames']); + /** * The ruled test on COMMITTED trees: which moved paths are explained by NONE of * the arms of 「every touched path is a generated artefact OR THE MERGE COMMIT'S @@ -474,8 +477,6 @@ export function regenChainToHead(pair) { * the prose path and carry the record past a file that left its face. Read as * a delete plus an add, the SOURCE path is listed and judged like any other. */ -export const CARRY_DIFF_ARGV = Object.freeze(['diff', '-z', '--name-only', '--no-renames']); - export function unexplainedPathsBetween(runGit, { from, to, base }) { const names = (a, b) => String(runGit([...CARRY_DIFF_ARGV, a, b])).split('\0').filter((p) => p !== ''); const moved = names(from, to).filter((p) => !isOutsideReviewSurface(p));