Skip to content

Commit 94dbce5

Browse files
committed
pm: the sweep's favourable answer covers the raw status read only; PD14 names the arm's rows, not the catalogs
Carries PR #33975's round-5 contract-review fixes. AGENTS.md Prime Directive 14 says CODEOWNERS routes every Tier H surface but the low-risk arm's rows, which include the root ADR tree since #33975. favourableArmGitRead answers only the `diff-tree --raw` status read, so an ADR landing whose `diff-tree -p` patch read alone fails stays NOT MEASURED in the post-merge sweep instead of reading Tier H on a stand-in; one row pins it, and an ablation reds it. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ADHkmRrk1KF2ZJk57PwVU9
1 parent f81e4b6 commit 94dbce5

2 files changed

Lines changed: 17 additions & 5 deletions

File tree

‎AGENTS.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ See `ui/AGENTS.md` for the app-id / localStorage / auth gotchas.
303303
membership), so ask the maintainer at once to remove a queued PR by hand — then confirm from the remote that it is
304304
in neither the queue nor `origin/main`. **Draft is no barrier by itself — the barrier is this directive**, and a
305305
spent approval or a standing record IS the review record, ⛔ not a relaxation. Behind it: the queue guard refuses a
306-
governed diff without its tier's record; CODEOWNERS routes every Tier H surface but the low-risk catalogs to the
306+
governed diff without its tier's record; CODEOWNERS routes every Tier H surface but the low-risk arm's rows to the
307307
approvers, the relay asks per pull on drafts (no barrier); the post-merge audit (`check-governed-merges.mjs`) lists
308308
every governed-surface merge with its approver and merger — a merger the maintainer does not recognise, any agent
309309
approval, or a Tier S merge without a PASS record is a seat violation, filed and rolled back. No seat judges this.

‎scripts/pm/check-governed-merges.mjs‎

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5005,12 +5005,13 @@ const ARM_FAVOURABLE_CHANGESET = "---\n'@objectstack/skills': patch\n---\n\nClau
50055005

50065006
/**
50075007
* The answer to one of the arm's git reads that gives the arm no reason (#33765 N-a): a clean changeset for the
5008-
* guard's `show SHA:PATH`, and every path a modified regular file for its `diff-tree`; null for any other read,
5009-
* which then cannot be answered the arm's way. Pure.
5008+
* guard's `show SHA:PATH`, and every path a modified regular file for its `diff-tree --raw` status read; null for
5009+
* any other read — the ADR leg's `diff-tree -p` patch read included (#33539: a status listing is no patch, and
5010+
* no stand-in patch is favourable) — which then cannot be answered the arm's way. Pure.
50105011
*/
50115012
export function favourableArmGitRead(argv, paths) {
50125013
if (argv?.[0] === 'show' && ARM_CHANGESET_SHOW.test(String(argv[1] ?? ''))) return ARM_FAVOURABLE_CHANGESET;
5013-
if (argv?.[0] === 'diff-tree') return (Array.isArray(paths) ? paths : []).map((p) => `:100644 100644 ${'0'.repeat(40)} ${'0'.repeat(40)} M\0${p}\0`).join('');
5014+
if (argv?.[0] === 'diff-tree' && argv.includes('--raw') && !argv.includes('-p')) return (Array.isArray(paths) ? paths : []).map((p) => `:100644 100644 ${'0'.repeat(40)} ${'0'.repeat(40)} M\0${p}\0`).join('');
50145015
return null;
50155016
}
50165017

@@ -10284,7 +10285,18 @@ async function selfTest() {
1028410285
await unmeasured({ git: diffTreeThrows }, /could not read `git diff-tree/) === true &&
1028510286
await unmeasured({ git: gitWith((a) => { if (a[0] === 'diff-tree') throw new Error('fatal: bad object'); if (a[0] === 'show') throw new Error('fatal: unable to read'); if (a[0] === 'ls-tree') return `${CS}\0`; }) }, /could not read `git show.*`git diff-tree/) === true);
1028610287
assert('⛔ #33765-N-a-an-unread-read-the-arm-has-no-favourable-answer-for-stays-NOT-MEASURED', favourableArmGitRead(['rev-parse', 'x'], [SK]) === null &&
10287-
favourableArmGitRead(['show', `${LANDED}:${CS}`], [SK]) !== null && favourableArmGitRead(['diff-tree', LANDED], [SK]).includes(`M\0${SK}\0`));
10288+
favourableArmGitRead(['show', `${LANDED}:${CS}`], [SK]) !== null && favourableArmGitRead(['diff-tree', '--raw', LANDED], [SK]).includes(`M\0${SK}\0`));
10289+
// #33539 S7: the ADR leg's patch read has no favourable answer; one that fails alone leaves the landing NOT MEASURED.
10290+
const ADRP = 'docs/adr/0097-upstream-availability.md';
10291+
const adrPatchThrows = (args) => {
10292+
if (args[0] === 'diff-tree' && args.includes('-p')) throw new Error('fatal: bad object');
10293+
if (args[0] === 'diff-tree') return `:100644 100644 ${'1'.repeat(40)} ${'2'.repeat(40)} M\0${ADRP}\0`;
10294+
return runGit(args);
10295+
};
10296+
assert('⛔ #33539-S7-an-ADR-landing-whose-patch-read-alone-fails-stays-NOT-MEASURED-only-the-raw-read-has-a-favourable-answer',
10297+
await unmeasured({ paths: [ADRP], git: adrPatchThrows }, /could not read `git diff-tree/) === true &&
10298+
favourableArmGitRead(addOnlyDiffArgv(['diff-tree', '-p', '--no-commit-id', '-m', '--first-parent'], [LANDED], ADRP), [ADRP]) === null &&
10299+
favourableArmGitRead(['diff-tree', '-r', '--no-commit-id', '--no-renames', '--raw', '-z', '-m', '--first-parent', LANDED], [ADRP]) !== null);
1028810300
// #33765 N-b: an unread labels list is an unread input, though no git read failed.
1028910301
assert('⛔ #33765-N-b-an-unread-labels-list-alone-is-NOT-MEASURED-not-tier-h', await unmeasured({ pull: { labels: null } }, /could not read its labels/) === true &&
1029010302
armReadsNotMeasured([], { measured: true }, runGit, null).includes('its labels') && armReadsNotMeasured([], { measured: true }, runGit).length === 0);

0 commit comments

Comments
 (0)