Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ See `ui/AGENTS.md` for the app-id / localStorage / auth gotchas.
membership), so ask the maintainer at once to remove a queued PR by hand — then confirm from the remote that it is
in neither the queue nor `origin/main`. **Draft is no barrier by itself — the barrier is this directive**, and a
spent approval or a standing record IS the review record, ⛔ not a relaxation. Behind it: the queue guard refuses a
governed diff without its tier's record; CODEOWNERS routes every Tier H surface but the low-risk catalogs to the
governed diff without its tier's record; CODEOWNERS routes every Tier H surface but the low-risk arm's rows to the
approvers, the relay asks per pull on drafts (no barrier); the post-merge audit (`check-governed-merges.mjs`) lists
every governed-surface merge with its approver and merger — a merger the maintainer does not recognise, any agent
approval, or a Tier S merge without a PASS record is a seat violation, filed and rolled back. No seat judges this.
Expand Down
20 changes: 16 additions & 4 deletions scripts/pm/check-governed-merges.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -5005,12 +5005,13 @@ const ARM_FAVOURABLE_CHANGESET = "---\n'@objectstack/skills': patch\n---\n\nClau

/**
* The answer to one of the arm's git reads that gives the arm no reason (#33765 N-a): a clean changeset for the
* guard's `show SHA:PATH`, and every path a modified regular file for its `diff-tree`; null for any other read,
* which then cannot be answered the arm's way. Pure.
* guard's `show SHA:PATH`, and every path a modified regular file for its `diff-tree --raw` status read; null for
* any other read — the ADR leg's `diff-tree -p` patch read included (#33539: a status listing is no patch, and
* no stand-in patch is favourable) — which then cannot be answered the arm's way. Pure.
*/
export function favourableArmGitRead(argv, paths) {
if (argv?.[0] === 'show' && ARM_CHANGESET_SHOW.test(String(argv[1] ?? ''))) return ARM_FAVOURABLE_CHANGESET;
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('');
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('');
return null;
}

Expand Down Expand Up @@ -10284,7 +10285,18 @@ async function selfTest() {
await unmeasured({ git: diffTreeThrows }, /could not read `git diff-tree/) === true &&
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);
assert('⛔ #33765-N-a-an-unread-read-the-arm-has-no-favourable-answer-for-stays-NOT-MEASURED', favourableArmGitRead(['rev-parse', 'x'], [SK]) === null &&
favourableArmGitRead(['show', `${LANDED}:${CS}`], [SK]) !== null && favourableArmGitRead(['diff-tree', LANDED], [SK]).includes(`M\0${SK}\0`));
favourableArmGitRead(['show', `${LANDED}:${CS}`], [SK]) !== null && favourableArmGitRead(['diff-tree', '--raw', LANDED], [SK]).includes(`M\0${SK}\0`));
// #33539 S7: the ADR leg's patch read has no favourable answer; one that fails alone leaves the landing NOT MEASURED.
const ADRP = 'docs/adr/0097-upstream-availability.md';
const adrPatchThrows = (args) => {
if (args[0] === 'diff-tree' && args.includes('-p')) throw new Error('fatal: bad object');
if (args[0] === 'diff-tree') return `:100644 100644 ${'1'.repeat(40)} ${'2'.repeat(40)} M\0${ADRP}\0`;
return runGit(args);
};
assert('⛔ #33539-S7-an-ADR-landing-whose-patch-read-alone-fails-stays-NOT-MEASURED-only-the-raw-read-has-a-favourable-answer',
await unmeasured({ paths: [ADRP], git: adrPatchThrows }, /could not read `git diff-tree/) === true &&
favourableArmGitRead(addOnlyDiffArgv(['diff-tree', '-p', '--no-commit-id', '-m', '--first-parent'], [LANDED], ADRP), [ADRP]) === null &&
favourableArmGitRead(['diff-tree', '-r', '--no-commit-id', '--no-renames', '--raw', '-z', '-m', '--first-parent', LANDED], [ADRP]) !== null);
// #33765 N-b: an unread labels list is an unread input, though no git read failed.
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 &&
armReadsNotMeasured([], { measured: true }, runGit, null).includes('its labels') && armReadsNotMeasured([], { measured: true }, runGit).length === 0);
Expand Down
Loading