Skip to content

Commit 348e701

Browse files
fix(pm): the arm audit settles a measured Tier H past an unread input, names an edited carry hop, and the verifier refuses hand-offs in any spelling (#33951)
<!-- claude-projects-attribution: {"github_login":"os-steve"} --> _Requested by **Steve** · [project thread](https://claude.ai/code/project/chan_01FdL1XeUyvVNxLreh3F4Qi9?thread=cmsg_01FdL1XeUyvVNxLreh3F4Qi9AD2VXSxnSHsMRpLTGUwyMF)_ Fixes #33765 Clause-②: no Metadata-protocol: none ## 维护者速读 - 改了什么:受管合并审计的低风险臂读数在“有读不到的输入、但已读到的输入本身就足以判 Tier H”时,改记 Tier H(并点名没读到什么),不再整条记为 NOT MEASURED;标签列表没读到也算“没读到”;被改过的 `Regen-provenance:` 承接行会在 BREACH 原因里点名;审稿档位校验器能识别驼峰、连字符写法和其他动词下的转交工具。 - 为什么改:#33762 评审留下的七条小尾巴(N-a…N-g),都朝“更保守/更说清楚”的方向收口,不改变今天任何一条判定的严格度。 - 风险与回滚:只动 `scripts/pm/` 下两个审计/校验脚本,不发布任何包;回滚即 revert 本 PR。 - 先看:`scripts/pm/check-governed-merges.mjs` 的 `armSettledWithoutUnread` 与 `readArmLanding` 的 N-e 段;`scripts/pm/verify-review-tier.mjs` 的 `connectorHandsOff`。 - 两分钟验证:`node scripts/pm/check-governed-merges.mjs --self-test && node scripts/pm/verify-review-tier.mjs --self-test`,预期分别 756 条断言通过、33 个用例通过。 - 需要你做的:无,席位落地。 ## What changes Every hunk, by file and line range on the head (no hunk near the register/arm regions #33539 holds, L519 and L1339): `scripts/pm/check-governed-merges.mjs` - L4466-4467 — `readArmLanding` jsdoc: one sentence naming the #33765 items. - L4509-4517 — **N-a, N-b**: when the arm reads H and some input was unread, `armSettledWithoutUnread` decides whether the measured inputs alone settle it. If they do, the entry is `tier-h` with those reasons and an `unread` list; otherwise it stays `not-measured` with the old words. - L4545-4547 — **N-c**: the N11 no-trusted-author-list branch's comment says it is defensive only (`loadRecordRecognisers` answers `available: false` instead, and a list it builds always holds the relay's login). No code change; `record-recognisers.mjs` untouched. - L4592-4602 — **N-e**: when the unedited threads would have reached the record through a carry, each other edited row is left out of the unedited threads once; if that changes what the record leg would have read, the row is named on the BREACH reason as a `Regen-provenance:` hop. - L4616-4618 — **N-g**: `reviewsAsLanded` jsdoc says a same-second dismissal is read as after the landing (pinned as is). - L4641-4724 — **N-a, N-b, N-f** helpers: `armReadsNotMeasured` keeps its export and words (new optional `labels` argument), built on `armUnreadInputs`. `ARM_CHANGESET_SHOW` is the one spelling of the guard's `show SHA:PATH` read, used by the deletion exception and by `favourableArmGitRead`. `armSettledWithoutUnread` re-runs the guard's own `decomposeGovernedWork` → `readLowRiskTier` → `landsOnLowRiskArm`, answering each unread input the way that gives the arm no reason: a clean changeset, every path a modified regular file, no fork, no labels. - L4736-4737 — `armCell`: a settled Tier H row also names what it was settled without. - L9278-9323 — self-test: 11 new pins in the #33603 battery. `scripts/pm/verify-review-tier.mjs` - L99-127 — **N-d**: `connectorToolWords` / `connectorHandsOff`. A connector tool's name is split into words (`_`, `-`, camelCase). It refuses when the first word is a hand-off verb (`send`, `message`, `start`, `fire`, `spawn`, `dispatch`, `delegate`, `interrupt`), or when it names a hand-off target (`session`, `agent`, `subagent`, `copilot`, `thread`, `trigger`, `worker`) under any first word except a read verb. - L130 — `handsWorkToAnotherAgent` ORs the new check onto the exact names and the existing regexes. Nothing that refused before now passes. - L299-307 — self-test: 3 new cases. **Direction held.** No current Tier H verdict moves to S, and no not-measured verdict moves to measured S. N-a can only turn not-measured into `tier-h`, and only when the arm still reads H with every unread input answered its way. The arm's verdict is a conjunction of conditions, so the reasons that remain come from measured inputs. A read with no favourable answer (anything other than the guard's `show` or `diff-tree`), or a read that fails again, stays NOT MEASURED. N-b only moves `tier-h` to `not-measured`, or to `tier-h` when N-a settles it. N-d only adds refusals. N-e changes a BREACH reason's words, not its state. N-c and N-g are comments plus a pin. **N-g: harmless, pinned as is.** GitHub times are whole seconds, so the order of a same-second dismissal and the landing cannot be known. The approval it restores is an authorized one, so the entry reads `cleared` (the maintainer's merge), never `pass`. Flipping it would turn a cleared row into a BREACH on a guess, so the behaviour is pinned instead. ## Tests - `node scripts/pm/check-governed-merges.mjs --self-test`: 745 → **756** assertions, exit 0 (head `7c84b661`). - `node scripts/pm/verify-review-tier.mjs --self-test`: 30 → **33** cases across 6 batteries, exit 0. - `ui/scripts/__tests__/check-governed-queue-guard.test.ts` (the one test file that spawns `check-governed-merges.mjs`), under the lock: Test Files 1/1, Tests 10/10, VERDICT command-exit 0. - No forced test edits: every existing pin passes unchanged. <details><summary>Ablations: 6 legs, each reds its pins and restores to the HEAD blob</summary> Run through `scripts/ablation-replace.mjs` on 7c84b66. In every leg the anchor hit 1 → 0, and afterwards `git diff HEAD` was 0 bytes. | Leg | Mutation | Self-test | Pins that went red | |:---|:---|:---|:---| | N-a | `if (settled)` → `if (settled && false)` | exit 1, 3 failures | N-a measured-H (diff-tree + security label), N-a changeset/fork pair, N-b labels + Clause-② Tier H | | N-b | delete the `its labels` unread push | exit 1, 1 failure | N-b unread labels alone is NOT MEASURED | | N-e | `if (would?.carriedFrom)` → `… && false` | exit 1, 2 failures | N-e edited hop named, N-e edited claim beside a carry | | N-f | `ARM_CHANGESET_SHOW` → `^refs/…` | exit 1, 4 failures | N-f spelling pin, #33729 N5 deleted-changeset control, N-a changeset pin, N-a no-favourable-answer pin | | N-g | `at < landed` → `at <= landed` | exit 1, 1 failure | N-g same-second dismissal pinned as is | | N-d | drop `\|\| connectorHandsOff(name)` | exit 1, 2 failures | N-d camelCase/hyphen verbs, N-d hand-off under other verbs | N-c is a comment only, so it has no ablation. </details> ## Acceptance notes - `SELF_TEST_BATTERIES` floors are not raised. The new pins join existing batteries, and raising a floor would be a hunk outside this card's regions. The seat can raise them when it lands. - Same class as N-b, not changed here: a timeline answer that is not an array would still read inside `tier-h` through the guard's "its timeline was not read" reason. `fetchTimeline` throws instead (that path is already NOT MEASURED), so nothing reaches it today. - N-d fails closed, as the existing shapes do. A target word under a non-read first word refuses even when the tool only reads (for example `archive_session`). The remedy is the same one the file already gives: review in an agent that calls none of these. ## Verification Local subset on head `7c84b661` (origin/main `895783a1` unmoved; nothing to merge), after the last commit: - `node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack` derived **33** families; all 33 were run, plus both scripts' own self-tests. - `dispatch-gates --ran`: `33 derived famil(ies) accounted for — 33 run, 0 NOT-MEASURED (a DERIVED zero — all 33 recorded an exit code and none of them is 3)`. - CI runs every other family on this PR; its check-runs are the record. <details><summary>Each command and its exit code (35)</summary> - `node scripts/check-closing-keyword-parity.mjs` → exit 0 - `node scripts/check-closing-keyword-parity.mjs --self-test` → exit 0 - `node scripts/check-comment-mask-corpus.mjs` → exit 0 - `node scripts/check-declaration-mirrors.mjs` → exit 0 - `node scripts/check-declaration-mirrors.mjs --self-test` → exit 0 - `node scripts/check-self-test-wired.mjs` → exit 0 - `node scripts/check-self-test-wired.mjs --self-test` → exit 0 - `node scripts/check-self-test-workflow-commands.mjs` → exit 0 - `node scripts/check-self-test-workflow-commands.mjs --self-test` → exit 0 - `node scripts/check-skills-token-ratchet.mjs` → exit 0 - `node scripts/check-skills-token-ratchet.mjs --self-test` → exit 0 - `node scripts/check-whole-set-label-write.mjs` → exit 0 - `node scripts/check-whole-set-label-write.mjs --self-test` → exit 0 - `node scripts/ci/plan-test-core-shards.mjs --self-test` → exit 0 - `node scripts/pm/bare-root-worklist.mjs --self-test` → exit 0 - `pnpm check:agent-test-spelling` → exit 0 - `pnpm check:bash32-floor` → exit 0 - `pnpm check:ci-filter-parity` → exit 0 - `pnpm check:cli-command-ids` → exit 0 - `pnpm check:cross-package-test-inputs` → exit 0 - `pnpm check:driver-memory-census` → exit 0 - `pnpm check:entry-guard` → exit 0 - `pnpm check:gitlink-declared` → exit 0 - `pnpm check:nul-bytes` → exit 0 - `pnpm check:parse-guard` → exit 0 - `pnpm check:pm-dispatch-gates` → exit 0 - `pnpm check:pm-governed-merges` → exit 0 - `pnpm check:pnpm-filter-targets` → exit 0 - `pnpm check:pnpm-flag-spellings` → exit 0 - `pnpm check:ratchet-remedy-authority` → exit 0 - `pnpm check:refd-timer-probe` → exit 0 - `pnpm check:scripts-symbol-anchors` → exit 0 - `pnpm check:watch-hint-literal` → exit 0 - `node scripts/pm/check-governed-merges.mjs --self-test` → exit 0 - `node scripts/pm/verify-review-tier.mjs --self-test` → exit 0 </details> --- _Generated by [Claude Code](https://claude.ai/code/session_01ADHkmRnBQzshoJUDvT6keE)_ Co-authored-by: Claude <noreply@anthropic.com>
1 parent 0593356 commit 348e701

2 files changed

Lines changed: 186 additions & 10 deletions

File tree

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

Lines changed: 147 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4463,6 +4463,8 @@ export async function loadArmReaders(load = (specifier) => import(specifier)) {
44634463
* the record leg would have read had it not been edited, on every BREACH reason (N9, N10); a recogniser set with no
44644464
* trusted-author list is `not-measured` (N11), and the comments the author binding dropped are counted in the
44654465
* guard's own words (`ignoredAuthorLines`, N11).
4466+
* #33765: an unread labels list is unread too (N-b), and a Tier H the measured inputs settle alone stays `tier-h`
4467+
* with its unread inputs named (N-a, `armSettledWithoutUnread`); an edited `Regen-provenance:` hop is named (N-e).
44664468
* The carry test's `baseRef` is the landed commit's first parent (N6): between it and the merge group's base lie
44674469
* only the squash commits of entries ahead in the same group, which no queued head contains, so `git merge-base`
44684470
* of either base with a head names the same commit and the carry reads the same.
@@ -4504,8 +4506,15 @@ export async function readArmLanding(entry, { paths, repo, readers, fetchers, ru
45044506
guard.readLowRiskTier(work, repo, head, { timeline: { measured: true, reason: null, events }, runGit: armGit });
45054507
if (!guard.landsOnLowRiskArm(work)) {
45064508
const reasons = work.surfaces.find((s) => s?.lowRiskVerdict)?.lowRiskVerdict?.reasons ?? [];
4507-
const unread = armReadsNotMeasured(gitFailures, pull.fork, runGit);
4508-
if (unread.length > 0) return unmeasured(`the low-risk arm could not read ${unread.join('; ')}, so its Tier H cannot say how the queue read it (arm: ${reasons.join('; ') || 'no reason recorded'})`);
4509+
// #33765 N-b: an unread labels list is an unread input too, though no git read failed.
4510+
const inputs = armUnreadInputs(gitFailures, pull.fork, runGit, pull.labels);
4511+
if (inputs.length > 0) {
4512+
const unread = inputs.map((u) => u.words);
4513+
// #33765 N-a: a reason the measured inputs give on their own settles Tier H whatever the unread ones say.
4514+
const settled = armSettledWithoutUnread({ guard, entry, paths, repo, head, events, runGit, inputs });
4515+
if (settled) return { state: 'tier-h', headSha, reasons: settled, unread };
4516+
return unmeasured(`the low-risk arm could not read ${unread.join('; ')}, so its Tier H cannot say how the queue read it (arm: ${reasons.join('; ') || 'no reason recorded'})`);
4517+
}
45094518
return { state: 'tier-h', headSha, reasons };
45104519
}
45114520
if (sizeLimbFires(entry.size)) return { state: 'tier-h', headSha, reasons: [`the landed diff crosses the ${HUMAN_MERGE_LINE_THRESHOLD}-line human-merge line`] };
@@ -4533,7 +4542,9 @@ export async function readArmLanding(entry, { paths, repo, readers, fetchers, ru
45334542
const enqueue = guard.authorizedEnqueueVerdict(guard.enqueuerFromTimeline(events.filter((e) => before(e?.created_at))));
45344543
if (enqueue.state === 'authorized') return { state: 'cleared', by: 'enqueue', who: [enqueue.login], headSha };
45354544
if (recognisers?.available !== true) return unmeasured(recognisers?.reason ?? 'the record recognisers were not loaded');
4536-
// N11: no trusted-author list is a reading that is missing, not a thread with no record in it.
4545+
// N11: no trusted-author list is a reading that is missing, not a thread with no record in it. Defensive only
4546+
// (#33765 N-c): the guard's `loadRecordRecognisers` answers `available: false` rather than a set without the
4547+
// list, and a list it builds always holds the relay's login, so only a hand-built recogniser set reaches here.
45374548
if (!Array.isArray(recognisers.trustedAuthors) || recognisers.trustedAuthors.length === 0) {
45384549
return unmeasured('the record recognisers carry no trusted-author list, so no comment can be read as a record');
45394550
}
@@ -4578,6 +4589,17 @@ export async function readArmLanding(entry, { paths, repo, readers, fetchers, ru
45784589
try {
45794590
const would = guard.recordVerdict({ pair: unedited, recognisers, cardNote });
45804591
if (would?.id != null && editedAfter.has(would.id)) edited = `; ${editedAfter.get(would.id)} was edited after the landing, so it does not count (it is the record this leg would otherwise have read)`;
4592+
// #33765 N-e: a record the unedited threads reach through a carry also rests on its `Regen-provenance:` hops.
4593+
// An edited row is named when leaving it out of the unedited threads changes what the leg would have read.
4594+
if (would?.carriedFrom) {
4595+
const same = (v) => v?.state === would.state && v?.id === would.id && v?.carriedFrom === would.carriedFrom;
4596+
for (const [id, where] of editedAfter) {
4597+
if (id === would.id) continue;
4598+
const without = { ...unedited };
4599+
for (const thread of recognisers.threads) if (Array.isArray(without[thread.rows])) without[thread.rows] = without[thread.rows].filter((r) => r?.id !== id);
4600+
if (!same(guard.recordVerdict({ pair: without, recognisers, cardNote }))) edited += `; ${where} was edited after the landing, so it does not count (it is a \`Regen-provenance:\` hop of the carry this leg would otherwise have read)`;
4601+
}
4602+
}
45814603
} catch { /* a name only; the BREACH stands without it */ }
45824604
}
45834605
const reason = (record.state === 'absent' ? `no \`## Contract review\` record on its head (${record.readSummary})`
@@ -4591,7 +4613,9 @@ export async function readArmLanding(entry, { paths, repo, readers, fetchers, ru
45914613
* The reviews as they stood when the commit landed (#33729 N8): a review GitHub now reads DISMISSED, whose
45924614
* dismissal the timeline dates at or after the landing, is put back in the state the timeline's `review_dismissed`
45934615
* event names (`dismissed_review.state`). A dismissal with no such event, no review id or no readable time stays
4594-
* DISMISSED: toward BREACH, never toward cleared. Pure.
4616+
* DISMISSED: toward BREACH, never toward cleared. A dismissal in the same second as the landing is read as after
4617+
* it and restores the approval (#33765 N-g, pinned as is): GitHub's times are whole seconds, so that order is
4618+
* unknowable, and the restored approval is the maintainer's own, so the entry reads cleared, never `pass`. Pure.
45954619
*/
45964620
export function reviewsAsLanded(reviews, events, landed) {
45974621
const restored = new Map();
@@ -4614,23 +4638,90 @@ export function reviewsAsLanded(reviews, events, landed) {
46144638
* that commit answering nothing proves the deletion, so it is a measured H; any other answer, or a throw, is unread.
46154639
* Pure but for `runGit`.
46164640
*/
4617-
export function armReadsNotMeasured(gitFailures, fork, runGit) {
4641+
export function armReadsNotMeasured(gitFailures, fork, runGit, labels = []) {
4642+
return armUnreadInputs(gitFailures, fork, runGit, labels).map((u) => u.words);
4643+
}
4644+
4645+
/**
4646+
* The guard's changeset read, `git show SHA:PATH`, as the deleted-changeset exception and the favourable answer
4647+
* both key on it (#33765 N-f). The self-test records the argv the guard really sends and holds it to this.
4648+
*/
4649+
export const ARM_CHANGESET_SHOW = /^([0-9a-f]{7,40}):(.+)$/;
4650+
4651+
/** `armReadsNotMeasured`'s inputs, each `{ words, argv }` (`argv` null for a non-git input). Pure but for `runGit`. */
4652+
function armUnreadInputs(gitFailures, fork, runGit, labels) {
46184653
const unread = [];
46194654
for (const { argv, why } of Array.isArray(gitFailures) ? gitFailures : []) {
4620-
const shown = argv?.[0] === 'show' ? /^([0-9a-f]{7,40}):(.+)$/.exec(String(argv[1] ?? '')) : null;
4655+
const shown = argv?.[0] === 'show' ? ARM_CHANGESET_SHOW.exec(String(argv[1] ?? '')) : null;
46214656
if (shown) {
46224657
let listed = null;
46234658
try {
46244659
listed = String(runGit(['ls-tree', '-z', '--name-only', shown[1], '--', shown[2]]));
46254660
} catch { /* unread */ }
46264661
if (listed === '') continue;
46274662
}
4628-
unread.push(`\`git ${(argv ?? []).slice(0, 2).join(' ')}\` (${why})`);
4663+
unread.push({ words: `\`git ${(argv ?? []).slice(0, 2).join(' ')}\` (${why})`, argv });
46294664
}
4630-
if (!fork || fork.measured !== true) unread.push('its head repository (the fork predicate)');
4665+
if (!fork || fork.measured !== true) unread.push({ words: 'its head repository (the fork predicate)', argv: null });
4666+
if (!Array.isArray(labels)) unread.push({ words: 'its labels', argv: null });
46314667
return unread;
46324668
}
46334669

4670+
/** A clean low-risk changeset: the answer to an unread `git show SHA:PATH` that gives the arm no reason. */
4671+
const ARM_FAVOURABLE_CHANGESET = "---\n'@objectstack/skills': patch\n---\n\nClause-②: no\nMetadata-protocol: none\n";
4672+
4673+
/**
4674+
* The answer to one of the arm's git reads that gives the arm no reason (#33765 N-a): a clean changeset for the
4675+
* guard's `show SHA:PATH`, and every path a modified regular file for its `diff-tree`; null for any other read,
4676+
* which then cannot be answered the arm's way. Pure.
4677+
*/
4678+
export function favourableArmGitRead(argv, paths) {
4679+
if (argv?.[0] === 'show' && ARM_CHANGESET_SHOW.test(String(argv[1] ?? ''))) return ARM_FAVOURABLE_CHANGESET;
4680+
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('');
4681+
return null;
4682+
}
4683+
4684+
/**
4685+
* Does the arm read H on its measured inputs alone (#33765 N-a)? The guard's own arm re-reads a fresh
4686+
* decomposition with every unread input answered the way that gives the arm no reason: the git read by
4687+
* `favourableArmGitRead`, the fork predicate as no fork, the labels as none. The arm's verdict is a conjunction,
4688+
* so if it still reads H, the reasons it gives come from measured inputs and settle Tier H: those reasons, or null
4689+
* (a read with no such answer, a read that fails anew, or an arm that would read S), which stays NOT MEASURED.
4690+
* Never throws.
4691+
*/
4692+
function armSettledWithoutUnread({ guard, entry, paths, repo, head, events, runGit, inputs }) {
4693+
try {
4694+
const answers = new Map();
4695+
for (const { argv } of inputs) {
4696+
if (!argv) continue;
4697+
const answer = favourableArmGitRead(argv, paths);
4698+
if (answer === null) return null;
4699+
answers.set(JSON.stringify(argv), answer);
4700+
}
4701+
const [work] = guard.decomposeGovernedWork([{ pr: entry.pr, sha: entry.sha, subject: entry.subject, paths }], repo).governed;
4702+
if (!work) return null;
4703+
const failures = [];
4704+
const git = (argv) => {
4705+
const key = JSON.stringify(argv);
4706+
if (answers.has(key)) return answers.get(key);
4707+
try {
4708+
return runGit(argv);
4709+
} catch (error) {
4710+
failures.push({ argv, why: String(error?.message ?? error).split('\n')[0] });
4711+
throw error;
4712+
}
4713+
};
4714+
const fork = head.fork?.measured === true ? head.fork : { measured: true, isFork: false };
4715+
const labels = Array.isArray(head.labels) ? head.labels : [];
4716+
guard.readLowRiskTier(work, repo, { ...head, fork, labels }, { timeline: { measured: true, reason: null, events }, runGit: git });
4717+
if (guard.landsOnLowRiskArm(work) || armUnreadInputs(failures, fork, runGit, labels).length > 0) return null;
4718+
const reasons = work.surfaces.find((s) => s?.lowRiskVerdict)?.lowRiskVerdict?.reasons ?? [];
4719+
return reasons.length > 0 ? reasons : null;
4720+
} catch {
4721+
return null;
4722+
}
4723+
}
4724+
46344725
/** The arm cell under a sweep row, or ''. Pure. */
46354726
export function armCell(entry) {
46364727
const a = entry?.arm;
@@ -4642,7 +4733,8 @@ export function armCell(entry) {
46424733
if (a.state === 'cleared') return `\n low-risk arm: Tier S${head}, cleared by an authorized ${a.by === 'review' ? 'approval' : 'enqueue'} (${(a.who ?? []).join(', ')}) before the record leg — the maintainer's merge`;
46434734
if (a.state === 'not-measured') return `\n ⚠️ low-risk arm NOT MEASURED${head} — ${a.reason}; listed here, unjudged`;
46444735
const reasons = a.reasons ?? [];
4645-
return `\n low-risk arm: Tier H${head} — ${reasons.slice(0, 2).join('; ') || 'no reason recorded'}${reasons.length > 2 ? ` (+${reasons.length - 2} more)` : ''}`;
4736+
const unread = (a.unread ?? []).length > 0 ? `; settled without the unread ${a.unread.join('; ')}` : '';
4737+
return `\n low-risk arm: Tier H${head} — ${reasons.slice(0, 2).join('; ') || 'no reason recorded'}${reasons.length > 2 ? ` (+${reasons.length - 2} more)` : ''}${unread}`;
46464738
}
46474739

46484740
/**
@@ -9183,6 +9275,52 @@ async function selfTest() {
91839275
return v?.state === 'breach' && v.ignored?.length === 1 && cell.includes('some-commenter') && cell.includes('#33541') ? true : JSON.stringify(v);
91849276
})() === true);
91859277

9278+
// #33765 N-a: a git read that failed, beside a reason the measured inputs give alone, is a measured Tier H.
9279+
const diffTreeThrows = gitWith((a) => { if (a[0] === 'diff-tree') throw new Error('fatal: bad object'); });
9280+
assert('⭐ #33765-N-a-an-unread-diff-tree-beside-a-security-label-is-a-measured-Tier-H-naming-what-it-did-not-read', await (async () => {
9281+
const v = await run({ git: diffTreeThrows, pull: { labels: ['security'] } });
9282+
return v?.state === 'tier-h' && v.reasons.some((r) => /`security` label/.test(r)) && !v.reasons.some((r) => /status and mode/.test(r)) &&
9283+
v.unread?.some((u) => /git diff-tree/.test(u)) && armCell({ arm: v }).includes('settled without the unread `git diff-tree') ? true : JSON.stringify(v);
9284+
})() === true);
9285+
assert('⭐ #33765-N-a-an-unread-changeset-beside-a-Clause-2-yes-body-and-an-unread-fork-beside-a-fork-free-reason-are-Tier-H',
9286+
await tierH({ git: gitWith((a) => { if (a[0] === 'show') throw new Error('fatal: unable to read'); if (a[0] === 'ls-tree') return `${CS}\0`; }), pull: { body: 'Fixes #69\n\nClause-②: yes\nMetadata-protocol: none\n' } }, /Clause-②/) === true &&
9287+
await tierH({ pull: { fork: { measured: false, isFork: false }, labels: ['security'] } }, /`security` label/) === true);
9288+
assert('⛔ #33765-N-a-control-an-unread-read-that-alone-keeps-the-arm-H-stays-NOT-MEASURED-never-measured-S',
9289+
await unmeasured({ git: diffTreeThrows }, /could not read `git diff-tree/) === true &&
9290+
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);
9291+
assert('⛔ #33765-N-a-an-unread-read-the-arm-has-no-favourable-answer-for-stays-NOT-MEASURED', favourableArmGitRead(['rev-parse', 'x'], [SK]) === null &&
9292+
favourableArmGitRead(['show', `${LANDED}:${CS}`], [SK]) !== null && favourableArmGitRead(['diff-tree', LANDED], [SK]).includes(`M\0${SK}\0`));
9293+
// #33765 N-b: an unread labels list is an unread input, though no git read failed.
9294+
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 &&
9295+
armReadsNotMeasured([], { measured: true }, runGit, null).includes('its labels') && armReadsNotMeasured([], { measured: true }, runGit).length === 0);
9296+
assert('#33765-N-b-an-unread-labels-list-beside-a-Clause-2-yes-body-is-a-measured-Tier-H', await tierH({ pull: { labels: null, body: 'Fixes #69\n\nClause-②: yes\nMetadata-protocol: none\n' } }, /Clause-②/) === true);
9297+
// #33765 N-f: the argv the guard really sends for a changeset is the spelling the deletion exception and the
9298+
// favourable answer key on; a renamed read reds here instead of folding the exception into NOT MEASURED.
9299+
assert('⛔ #33765-N-f-the-guards-changeset-and-status-reads-are-the-spellings-the-arm-keys-on', await (async () => {
9300+
const sent = [];
9301+
await run({ git: (a) => { sent.push(a); return runGit(a); } });
9302+
const shows = sent.filter((a) => a[0] === 'show');
9303+
const trees = sent.filter((a) => a[0] === 'diff-tree');
9304+
return shows.length > 0 && trees.length > 0 && shows.every((a) => a.length === 2 && ARM_CHANGESET_SHOW.test(a[1]) && a[1] === `${LANDED}:${CS}`) &&
9305+
[...shows, ...trees].every((a) => favourableArmGitRead(a, [SK, CS]) !== null) ? true : JSON.stringify(sent);
9306+
})() === true);
9307+
// #33765 N-e: an edited `Regen-provenance:` hop that breaks the carry is named on the BREACH reason.
9308+
const OLD = 'd'.repeat(40);
9309+
const HOP = (over = {}) => ({ id: 905, created_at: '2026-11-15T04:10:00Z', user: { login: RELAY }, body: `Regen-provenance: 900 · \`${OLD}\` → \`${HEAD}\` · \`git diff --name-only\` → (empty)`, ...over });
9310+
const carryGit = gitWith((a) => {
9311+
if (a[0] === 'diff') return '';
9312+
if (a[0] === 'rev-parse' && String(a[1]).endsWith('^{commit}')) return `${String(a[1]).slice(0, -'^{commit}'.length)}\n`;
9313+
});
9314+
assert('#33765-N-e-control-a-record-carried-over-an-unedited-hop-is-PASS', (await run({ prRows: [record({ head: OLD, at: '2026-11-15T03:00:00Z' }), HOP()], git: carryGit }))?.state === 'pass');
9315+
assert('⛔ #33765-N-e-a-Regen-provenance-hop-edited-after-the-landing-is-named-on-the-BREACH', await breach({ prRows: [record({ head: OLD, at: '2026-11-15T03:00:00Z' }), HOP({ updated_at: '2026-11-15T06:00:00Z' })], git: carryGit },
9316+
/no `## Contract review` record on its head .*PR comment 905 was edited after the landing.*`Regen-provenance:` hop/) === true);
9317+
assert('#33765-N-e-an-edited-claim-beside-a-carry-is-still-not-named', await (async () => {
9318+
const v = await run({ prRows: [record({ head: OLD, at: '2026-11-15T03:00:00Z' }), HOP({ updated_at: '2026-11-15T06:00:00Z' }), { id: 950, created_at: '2026-11-15T04:00:00Z', updated_at: '2026-11-15T06:00:00Z', user: { login: RELAY }, body: 'Claim: PM loop' }], git: carryGit });
9319+
return v?.state === 'breach' && v.reason.includes('PR comment 905') && !v.reason.includes('950') ? true : JSON.stringify(v);
9320+
})() === true);
9321+
// #33765 N-g, pinned as is: a dismissal in the landing's own second is read as after it and restores the approval.
9322+
assert('#33765-N-g-a-dismissal-in-the-same-second-as-the-landing-restores-the-approval-pinned-as-is', await cleared({ prRows: [], reviews: [dismissedReview], events: DISMISSED(MERGED_AT) }, 'review') === true);
9323+
91869324
const at = (e, arm) => ({ ...e, attribution: { mergedBy: 'os-zhuang', mergedAt: MERGED_AT, title: 't', size: null }, attributionChannel: 'env-token', arm });
91879325
const human = at(classifyCommit({ sha: 'e'.repeat(40), date: MERGED_AT, subject: 'docs(adr): x (#71)' }, ['docs/adr/0001-x.md'], OS), undefined);
91889326
const report = renderReport({ window: dateWindowFor('2026-11-14T00:00:00Z'), repos: allAudited, scanned: 3, lookups: 3,

0 commit comments

Comments
 (0)