diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 04925b3b3e3..492c07c1e4a 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -10,9 +10,11 @@ # # The owner list on EVERY row mirrors `GOVERNED_APPROVERS` in # scripts/pm/check-governed-queue-guard.mjs — the one list of accounts whose -# APPROVED review lands a Tier H surface (「os-zhuang hotlong 批准算数」). The -# rows mirror the Tier H rows of `GOVERNED_SURFACES` in -# scripts/pm/check-governed-merges.mjs. This file is static and can import +# APPROVED review lands a Tier H surface. Since 2026-11-17 that is `os-zhuang` +# alone (maintainer, triage session, verbatim: 「hotlong 从批准账户中去掉,只保留 +# os-zhuang」), superseding the membership of 2026-08-27 (「os-zhuang hotlong +# 批准算数」), which this line carried until then. The rows mirror the Tier H +# rows of `GOVERNED_SURFACES` in scripts/pm/check-governed-merges.mjs. This file is static and can import # neither, so the two stay in step the only way a static file can: # `node scripts/pm/check-governed-queue-guard.mjs --self-test` reads this file # (`codeownersMirrorVerdict`) and reds when a Tier H row has no line here, when @@ -36,10 +38,12 @@ # code owner without write access is ignored by GitHub without a word: # `GET /repos/{owner}/{repo}/codeowners/errors` reads this file's own verdict. # -# Both logins are verified, not assumed: `hotlong` authors the bulk of main's -# history as 50353452+hotlong@users.noreply.github.com (GitHub's {id}+{login} -# noreply form ties the login to the account); `os-zhuang` is named by the -# ruling above and has readied and reviewed this repository's pulls. +# The login is verified, not assumed: `os-zhuang` is named by both rulings +# above and has readied and reviewed this repository's pulls. Until 2026-11-17 +# every row also named `@hotlong` (verified then as the account authoring the +# bulk of main's history, 50353452+hotlong@users.noreply.github.com); the +# 2026-11-17 ruling removed it, because `hotlong` runs seats and an approver +# account never does. # # The enforcement chain is routed the same way, deliberately: a PR that edits # the audit script, the approver constant or this file is a governance change — @@ -48,21 +52,21 @@ # Tier H governed surfaces — the register's rows with tier H, less the # low-risk arm's `/docs/adr/` and `/skills/` rows (see the header) -/AGENTS.md @os-zhuang @hotlong -/CLAUDE.md @os-zhuang @hotlong -/docs/NORTH-STAR.md @os-zhuang @hotlong -/.github/workflows/ @os-zhuang @hotlong +/AGENTS.md @os-zhuang +/CLAUDE.md @os-zhuang +/docs/NORTH-STAR.md @os-zhuang +/.github/workflows/ @os-zhuang # Tier H governed surfaces of the nested `ui/` workspace (#25712) — the same # register rows, under `ui/`; `ui/.claude/` is Tier H, unlike the root tree; # `/ui/skills/` carries the low-risk arm too and has no line -/ui/docs/adr/ @os-zhuang @hotlong -/ui/.claude/ @os-zhuang @hotlong -/ui/AGENTS.md @os-zhuang @hotlong -/ui/CLAUDE.md @os-zhuang @hotlong -/ui/.github/workflows/ @os-zhuang @hotlong +/ui/docs/adr/ @os-zhuang +/ui/.claude/ @os-zhuang +/ui/AGENTS.md @os-zhuang +/ui/CLAUDE.md @os-zhuang +/ui/.github/workflows/ @os-zhuang # The enforcement chain -/.github/CODEOWNERS @os-zhuang @hotlong -/scripts/pm/check-governed-merges.mjs @os-zhuang @hotlong -/scripts/pm/check-governed-queue-guard.mjs @os-zhuang @hotlong +/.github/CODEOWNERS @os-zhuang +/scripts/pm/check-governed-merges.mjs @os-zhuang +/scripts/pm/check-governed-queue-guard.mjs @os-zhuang diff --git a/scripts/pm/check-governed-merges.mjs b/scripts/pm/check-governed-merges.mjs index e5b35497e06..3dc5b0e9621 100644 --- a/scripts/pm/check-governed-merges.mjs +++ b/scripts/pm/check-governed-merges.mjs @@ -9675,13 +9675,13 @@ async function selfTest() { sizeLimbFires(sizeVerdict(overSize, enqueued('undetermined', null))) === true && sizeLiftFrom({ state: 'unapproved', approvals: [], enqueue: { state: 'authorized', login: '' } }) === null); assert('an-authorized-APPROVAL-is-the-lift-read-first-even-with-an-authorized-enqueue-beside-it', - sizeLiftFrom(authorizedVerdict([{ login: 'hotlong', commitId: LIFT_SHA }], { enqueue: { state: 'authorized', login: 'os-zhuang' } })).ruling === SIZE_LIFT_RULING); + sizeLiftFrom(authorizedVerdict([{ login: 'os-zhuang', commitId: LIFT_SHA }], { enqueue: { state: 'authorized', login: 'os-zhuang' } })).ruling === SIZE_LIFT_RULING); assert('an-approval-under-the-line-lifts-nothing-because-there-is-nothing-to-lift', - sizeVerdict({ additions: 10, deletions: 2 }, authorizedVerdict([{ login: 'hotlong', commitId: LIFT_SHA }])).lifted === null && sizeVerdict(null, authorizedVerdict([{ login: 'hotlong', commitId: LIFT_SHA }])).lifted === null); - const liftedGoverned = testVerdict(['AGENTS.md'], { repo: REPO, size: overSize, approval: authorizedVerdict([{ login: 'hotlong', commitId: LIFT_SHA }]) }); + sizeVerdict({ additions: 10, deletions: 2 }, authorizedVerdict([{ login: 'os-zhuang', commitId: LIFT_SHA }])).lifted === null && sizeVerdict(null, authorizedVerdict([{ login: 'os-zhuang', commitId: LIFT_SHA }])).lifted === null); + const liftedGoverned = testVerdict(['AGENTS.md'], { repo: REPO, size: overSize, approval: authorizedVerdict([{ login: 'os-zhuang', commitId: LIFT_SHA }]) }); assert('⭐ the-lift-moves-the-SIZE-limb-only-a-governed-PATH-still-lands-per-its-tier-and-a-FORK-head-is-untouched', liftedGoverned.governed === true && landsByHumanMerge(liftedGoverned) === true && liftedGoverned.size.lifted !== null && - landsByHumanMerge(testVerdict(['x.ts'], { repo: REPO, size: overSize, approval: authorizedVerdict([{ login: 'hotlong', commitId: LIFT_SHA }]), fork: forkVerdict({ base: { repo: { full_name: 'o/r' } }, head: { repo: { full_name: 'f/r' } } }) })) === true); + landsByHumanMerge(testVerdict(['x.ts'], { repo: REPO, size: overSize, approval: authorizedVerdict([{ login: 'os-zhuang', commitId: LIFT_SHA }]), fork: forkVerdict({ base: { repo: { full_name: 'o/r' } }, head: { repo: { full_name: 'f/r' } } }) })) === true); assert('⭐ the-post-merge-sweep-hands-in-NO-approval-so-an-oversized-landing-is-STILL-listed', classifyCommit({ sha: 'b'.repeat(40), date: '2026-09-27T02:02:33Z', subject: 'feat!: retire the saved-report stack (#20125)' }, ['packages/x.ts'], GOVERNED_REPOS[0], { additions: 10764, deletions: 999 }) !== null); assert('and-the-not-lifted-words-name-BOTH-landings-the-authorized-approval-and-the-maintainers-merge', @@ -11043,7 +11043,12 @@ async function selfTest() { // N10: a close is a ruling only by an authorized approver's hand. const now = Date.parse('2026-11-15T23:40:00Z'); const closedCard = (number, close, more = {}) => ({ number, body: card(['- PR #50 — ruled row']), state_reason: 'completed', closed_at: '2026-11-12T00:00:00Z', close, ...more }); - const approvers = ['os-zhuang', 'hotlong']; + // The approver list is the queue guard's own `GOVERNED_APPROVERS`, loaded exactly as the job loads it: no second + // literal list here to drift from the constant (2026-11-17 removed `hotlong` from it — 「hotlong 从批准账户中去掉,只保留 + // os-zhuang」 — and that account's hand close is pinned below as ruling nothing). + const rulingAccounts = await loadAuditRulingAccounts(); + const approvers = rulingAccounts.accounts; + assert('N10-the-approver-list-is-the-queue-guards-GOVERNED_APPROVERS-not-a-copy', rulingAccounts.available && approvers.join() === 'os-zhuang', JSON.stringify(rulingAccounts)); const byHand = ruledAuditRows([closedCard(910, { actor: 'os-zhuang', commitId: null, app: null })], { now, approvers }); assert('⭐ N10-an-approvers-hand-close-rules-its-rows', byHand.ruled.get('PR #50') === 910 && byHand.unruled.length === 0, JSON.stringify([...byHand.ruled])); for (const [name, c, more] of [ @@ -11052,22 +11057,23 @@ async function selfTest() { ['the-stale-bot', { actor: 'github-actions[bot]', commitId: null, app: null }, { state_reason: 'not_planned' }], ['an-unreadable-close-event', null, {}], ['a-duplicate-close', { actor: 'os-zhuang', commitId: null, app: null }, { state_reason: 'duplicate' }], + ['a-hand-close-by-the-account-removed-from-the-approvers-2026-11-17', { actor: 'hotlong', commitId: null, app: null }, {}], ]) { const r = ruledAuditRows([closedCard(911, c, more)], { now, approvers }); assert(`⭐ N10-${name}-rules-nothing`, r.ruled.size === 0 && r.unruled[0]?.number === 911, JSON.stringify(r.unruled)); } // Review S1: the app field is read by PRESENCE. An object (named or not) rules nothing, an absent key is an // unreadable event, and null (what the platform serves on every close today) leaves the login test to decide. - const viaApp = ruledAuditRows([closedCard(913, { actor: 'hotlong', commitId: null, app: { slug: 'claude' } }), closedCard(916, { actor: 'hotlong', commitId: null, app: {} })], { now, approvers }); - assert('⭐ S1-a-close-with-an-app-object-named-or-not-rules-nothing', viaApp.ruled.size === 0 && viaApp.unruled.length === 2 && viaApp.unruled.every((u) => /closed through a GitHub App on hotlong/.test(u.why)), JSON.stringify(viaApp.unruled)); - const noKey = ruledAuditRows([closedCard(917, { actor: 'hotlong', commitId: null })], { now, approvers }); + const viaApp = ruledAuditRows([closedCard(913, { actor: 'os-zhuang', commitId: null, app: { slug: 'claude' } }), closedCard(916, { actor: 'os-zhuang', commitId: null, app: {} })], { now, approvers }); + assert('⭐ S1-a-close-with-an-app-object-named-or-not-rules-nothing', viaApp.ruled.size === 0 && viaApp.unruled.length === 2 && viaApp.unruled.every((u) => /closed through a GitHub App on os-zhuang/.test(u.why)), JSON.stringify(viaApp.unruled)); + const noKey = ruledAuditRows([closedCard(917, { actor: 'os-zhuang', commitId: null })], { now, approvers }); assert('⭐ S1-a-close-event-without-the-app-key-is-unreadable-and-rules-nothing', noKey.ruled.size === 0 && /does not carry `performed_via_github_app`/.test(noKey.unruled[0]?.why ?? ''), JSON.stringify(noKey.unruled)); - assert('S1-control-the-same-account-closing-with-a-null-app-rules', ruledAuditRows([closedCard(914, { actor: 'hotlong', commitId: null, app: null })], { now, approvers }).ruled.size === 1); + assert('S1-control-the-same-account-closing-with-a-null-app-rules', ruledAuditRows([closedCard(914, { actor: 'os-zhuang', commitId: null, app: null })], { now, approvers }).ruled.size === 1); assert('S1-the-job-passes-the-app-field-through-by-presence-not-by-name', /'performed_via_github_app' in last/.test(cardStep) && !/performed_via_github_app\?\.(slug|name)/.test(cardStep), cardStep.slice(0, 200)); assert('N10-no-approver-list-rules-nothing', ruledAuditRows([closedCard(912, { actor: 'os-zhuang', commitId: null, app: null })], { now, approvers: [] }).ruled.size === 0); // N12: every ruled card counts, not only the newest. - const newerUnreadOnly = { number: 920, body: [`${AUDIT_CARD.unreadHeading} — 1`, '', '- PR #60 low-risk arm NOT MEASURED: x', '', `${AUDIT_CARD.footer} x`].join('\n'), state_reason: 'completed', closed_at: '2026-11-14T00:00:00Z', close: { actor: 'hotlong', commitId: null, app: null } }; + const newerUnreadOnly = { number: 920, body: [`${AUDIT_CARD.unreadHeading} — 1`, '', '- PR #60 low-risk arm NOT MEASURED: x', '', `${AUDIT_CARD.footer} x`].join('\n'), state_reason: 'completed', closed_at: '2026-11-14T00:00:00Z', close: { actor: 'os-zhuang', commitId: null, app: null } }; const older = closedCard(915, { actor: 'os-zhuang', commitId: null, app: null }); const both = ruledAuditRows([newerUnreadOnly, older], { now, approvers }); assert('⭐ N12-an-older-ruling-behind-a-newer-NOT-MEASURED-only-close-still-rules', both.ruled.get('PR #50') === 915 && !both.ruled.has('PR #60'), JSON.stringify([...both.ruled])); diff --git a/scripts/pm/check-governed-queue-guard.mjs b/scripts/pm/check-governed-queue-guard.mjs index 4c5465ba4ae..63033c32c0b 100644 --- a/scripts/pm/check-governed-queue-guard.mjs +++ b/scripts/pm/check-governed-queue-guard.mjs @@ -67,7 +67,7 @@ * * ## What satisfies it — an AUTHORIZED approval, on ANY commit * - * The predicate has three dated layers; the LATEST one is the one enforced, + * The predicate has four dated layers; the LATEST one is the one enforced, * and each earlier layer still contributes the half that was not superseded. * * #8161 ruled the original predicate — 「门禁改成只要求「APPROVED review 存在」」/ @@ -79,7 +79,8 @@ * * 2026-08-27 NARROWED it. The maintainer asked, verbatim: 「需要我人工审查的,如果 * 我真的审查了,并且点了批准,也不能合并吗?还是要等我 bypass吗」 — and ruled the - * authorized set, verbatim: 「os-zhuang hotlong 批准算数」. ⭐ THAT HALF STANDS, + * authorized set, verbatim: 「os-zhuang hotlong 批准算数」. ⭐ THAT HALF STANDS + * as a mechanism — its MEMBERSHIP is 2026-11-17's (below), not this one's — * and it is this predicate's whole identity control: only an account in * `GOVERNED_APPROVERS` (the single source — protocol text references the * constant, never copies the names) can satisfy this leg. What that ruling ALSO @@ -96,8 +97,8 @@ * holds a latest-decisive review that is APPROVED — on ANY commit, with * `commit_id` unread by the decision. This ruling supersedes the sha-pin half * of the 2026-08-27 predicate and NOTHING else: the approver set of that ruling - * (「os-zhuang hotlong 批准算数」) stands, DISMISSED and superseded approvals - * still never count, an unauthorized APPROVED still never counts, and an empty + * (「os-zhuang hotlong 批准算数」) stands — its membership since narrowed by + * 2026-11-17 — DISMISSED and superseded approvals still never count, an unauthorized APPROVED still never counts, and an empty * or unreadable review list still fails closed. review → Approve → done: the * queue merges, and the direct merge stays the fallback path. * @@ -117,6 +118,19 @@ * nothing may not block a landing), and ⛔ nothing may re-derive a refusal from * that printed reading without a new ruling. * + * 2026-11-17 NARROWED THE SET. The maintainer, in the triage session (card + * #34626), verbatim and untranslated: + * + * > hotlong 从批准账户中去掉,只保留 os-zhuang + * + * So `GOVERNED_APPROVERS` is `os-zhuang` alone. This supersedes the MEMBERSHIP + * of the 2026-08-27 set (「os-zhuang hotlong 批准算数」, kept above as history) + * and nothing else: the mechanism, the any-commit reading of 2026-09-04 and the + * 2026-10-26 enqueue leg all stand, now read against the one account. An + * APPROVED review by `hotlong` alone no longer satisfies either leg. The reason + * is the account rule that an approver account never runs a seat: `hotlong` + * runs seats, so it leaves the set. + * * #11704's retraction still bounds the design: attribution from the GitHub * actor field is not a reading, so this guard stays keyed on the DIFF'S PATHS * and on the review record — the one artifact that IS a deliberate, timestamped @@ -150,8 +164,10 @@ * > 也就是说推送到我的手机上,以前都是需要我点一下核准,然后再点合并,以后我可以直接点合并是吗 * > 大部分我还是希望入队,但是我想省掉 Approve * - * and the logins behind that click: 「os-zhuang 或 hotlong」 — both already in - * `GOVERNED_APPROVERS`, which stays the single source and does not grow. So the + * and the logins behind that click: 「os-zhuang 或 hotlong」 — both then in + * `GOVERNED_APPROVERS`, which stays the single source and does not grow; since + * 2026-11-17 (「hotlong 从批准账户中去掉,只保留 os-zhuang」) only `os-zhuang`'s + * click counts, `hotlong`'s half of that quotation being history. So the * `merge_group` leg passes a governed pull request iff EITHER an authorized * account holds a latest-decisive APPROVED review (the 2026-09-04 predicate * above, unchanged and read FIRST) OR the account that put this entry in the @@ -772,14 +788,16 @@ export const EVENT_MERGE_GROUP = 'merge_group'; export const EVENT_PULL_REQUEST = 'pull_request'; /** - * The ONLY accounts whose APPROVED review satisfies the `merge_group` leg - * (2026-08-27, verbatim: 「os-zhuang hotlong 批准算数」). ⭐ Single source, the + * The ONLY accounts whose APPROVED review satisfies the `merge_group` leg: + * 2026-11-17, verbatim: 「hotlong 从批准账户中去掉,只保留 os-zhuang」 (triage + * session, card #34626). It supersedes the membership of 2026-08-27 + * (「os-zhuang hotlong 批准算数」), kept here as history. ⭐ Single source, the * `CONTRACT_REVIEW_TIER` pattern: protocol text references this constant and * never copies the names; changing the set is a one-line maintainer decision * here, nowhere else. The self-test pins the membership to the ruling, and the * refusal/cleared renderings derive their named accounts from this array. */ -export const GOVERNED_APPROVERS = Object.freeze(['os-zhuang', 'hotlong']); +export const GOVERNED_APPROVERS = Object.freeze(['os-zhuang']); // ── the CODEOWNERS mirror — the platform half of "both approvers are asked" ─ @@ -1953,7 +1971,7 @@ export function renderGuardVerdict(verdict) { ' ✅ CLEARED — every governed pull request in this merge group carries an APPROVED review by an', ` authorized approver (GOVERNED_APPROVERS: ${GOVERNED_APPROVERS.join(', ')}), on ANY commit — the`, ' 2026-09-04 ruled predicate (「只需要有人工批准记录就行,不需要卡最新的提交。」), which supersedes', - " the sha pin of 2026-08-27 while that ruling's approver set (「os-zhuang hotlong 批准算数」) stands.", + " the sha pin of 2026-08-27; the approver set is 2026-11-17's (「hotlong 从批准账户中去掉,只保留 os-zhuang」).", ' A dismissed, superseded or unauthorized approval still never counts. ⚖️ Accepted cost, stated where', ' it is paid: a push made after an approval was NOT re-reviewed here. ⛔ An agent seat never submits', ' an approving review on a governed-surface PR, under any account. The post-merge audit', @@ -2002,8 +2020,8 @@ export function renderGuardVerdict(verdict) { ' 2026-09-13, verbatim 「C. approve 后不管后续改动都由席位落地:」), 「席位落地 = 过落地前', ' 检、清标、ready、auto-merge,踢出/变基同法。」 The approval does NOT have to sit on the current', ' head sha, and a later push does not expire it (2026-09-04: 「只需要有人工批准记录就行,不需', - ' 要卡最新的提交。」); the authorized set is still the 2026-08-27 one (「os-zhuang hotlong 批准', - ' 算数」). ⛔ An agent seat never submits that approval, under any account — the post-merge audit', + ' 要卡最新的提交。」); the authorized set is the 2026-11-17 one (「hotlong 从批准账户中去掉,只保', + ' 留 os-zhuang」). ⛔ An agent seat never submits that approval, under any account — the post-merge audit', ' reads the approver too. Or the maintainer\'s own "Merge when ready" from an account in', ' GOVERNED_APPROVERS: that enqueue IS the review (2026-10-26, 「大部分我还是希望入队,但是我想省掉', ' Approve」), and the entry it makes clears here with no APPROVED review — ⛔ no seat enqueues or', @@ -3831,7 +3849,7 @@ export async function selfTest() { // ── the approval predicate ──────────────────────────────────────────────── battery('the approval predicate'); - assert('an-approval-is-an-approval', approvalVerdict(approved('hotlong')).state === 'approved'); + assert('an-approval-is-an-approval', approvalVerdict(approved('os-zhuang')).state === 'approved'); assert('no-reviews-at-all-is-unapproved', approvalVerdict([]).state === 'unapproved'); assert('a-COMMENTED-review-is-not-an-approval', approvalVerdict([{ state: 'COMMENTED', user: { login: 'a' } }]).state === 'unapproved'); // ⭐ The fail-open direction a naive `.some(r => r.state === 'APPROVED')` @@ -3865,12 +3883,25 @@ export async function selfTest() { // // 「只需要有人工批准记录就行,不需要卡最新的提交。」 — an authorized // latest-decisive APPROVED review satisfies this leg on ANY commit. The - // approver set is still 2026-08-27's (「os-zhuang hotlong 批准算数」) and the - // constant IS the single source, so the membership pin iterates it and the - // membership assertion pins it to the ruling: a silent edit to the set fails - // here, and nothing else in the repo restates the names as data. + // approver set is 2026-11-17's (「hotlong 从批准账户中去掉,只保留 os-zhuang」), + // which superseded the membership of 2026-08-27 (「os-zhuang hotlong 批准算数」), + // and the constant IS the single source, so the membership pin iterates it and + // the membership assertion pins it to the ruling: a silent edit to the set + // fails here, and nothing else in the repo restates the names as data. The + // one login spelled below is the account that ruling REMOVED, pinned as the + // negative case: an approval or an enqueue by it alone no longer counts. + const RETIRED_APPROVER = 'hotlong'; battery('the 2026-09-04 unpinned predicate (the queue leg\'s)'); - assert('the-authorized-set-is-exactly-the-ruled-two-accounts', GOVERNED_APPROVERS.join() === 'os-zhuang,hotlong'); + assert('the-authorized-set-is-exactly-the-ruled-one-account-2026-11-17', GOVERNED_APPROVERS.join() === 'os-zhuang'); + assert('⛔ the-account-removed-2026-11-17-is-not-in-the-authorized-set', !GOVERNED_APPROVERS.includes(RETIRED_APPROVER)); + { + const retired = authorizedApprovalVerdict([approvedAt(RETIRED_APPROVER, HEAD)], HEAD); + assert( + '⛔ a-head-approved-ONLY-by-the-removed-account-reads-UNAPPROVED-2026-11-17', + retired.state === 'unapproved' && retired.approvers.length === 0 && retired.unauthorizedApprovers.join() === RETIRED_APPROVER, + JSON.stringify(retired), + ); + } for (const login of GOVERNED_APPROVERS) { assert(`an-authorized-approval-on-the-current-head-passes: ${login}`, authorizedApprovalVerdict([approvedAt(login, HEAD)], HEAD).state === 'approved'); } @@ -3894,13 +3925,13 @@ export async function selfTest() { ); assert( 'a-DISMISSED-authorized-approval-never-counts', - authorizedApprovalVerdict([approvedAt(GOVERNED_APPROVERS[1], HEAD), { state: 'DISMISSED', user: { login: GOVERNED_APPROVERS[1] }, commit_id: HEAD }], HEAD) + authorizedApprovalVerdict([approvedAt(GOVERNED_APPROVERS[0], HEAD), { state: 'DISMISSED', user: { login: GOVERNED_APPROVERS[0] }, commit_id: HEAD }], HEAD) .state === 'unapproved', ); assert('no-reviews-at-all-is-unapproved-under-this-predicate-too', authorizedApprovalVerdict([], HEAD).state === 'unapproved'); assert( 'an-unauthorized-approval-does-not-mask-an-authorized-one-on-an-older-commit', - authorizedApprovalVerdict([approvedAt('not-authorized', HEAD), approvedAt(GOVERNED_APPROVERS[1], OLD)], HEAD).approvers.join() === GOVERNED_APPROVERS[1], + authorizedApprovalVerdict([approvedAt('not-authorized', HEAD), approvedAt(GOVERNED_APPROVERS[0], OLD)], HEAD).approvers.join() === GOVERNED_APPROVERS[0], ); assert( 'a-COMMENTED-review-by-an-authorized-account-is-not-an-approval', @@ -5018,7 +5049,7 @@ export async function selfTest() { ); const noApproval = await liftRun([]); const unauthorized = await liftRun([approvedAt('not-authorized', PR20125_SHA)]); - const dismissed = await liftRun([approvedAt('hotlong', PR20125_SHA), { state: 'DISMISSED', user: { login: 'hotlong' }, commit_id: PR20125_SHA }]); + const dismissed = await liftRun([approvedAt('os-zhuang', PR20125_SHA), { state: 'DISMISSED', user: { login: 'os-zhuang' }, commit_id: PR20125_SHA }]); const superseded = await liftRun([approvedAt('os-zhuang', OLD), { state: 'CHANGES_REQUESTED', user: { login: 'os-zhuang' }, commit_id: PR20125_SHA }]); assert( '⛔ no-approval-an-UNAUTHORIZED-one-a-DISMISSED-one-and-a-SUPERSEDED-one-each-still-REFUSE-on-exit-8-as-today', @@ -5071,10 +5102,10 @@ export async function selfTest() { ); assert( '⭐ sizeReading-has-FOUR-states-and-lifted-is-over-the-line-never-within', - sizeReading(1, sizePair(LINE, 1), REPO, authorizedApprovalVerdict([approvedAt('hotlong', HEAD)], HEAD)).state === 'lifted' && - sizeReading(1, sizePair(LINE, 0), REPO, authorizedApprovalVerdict([approvedAt('hotlong', HEAD)], HEAD)).state === 'within' && + sizeReading(1, sizePair(LINE, 1), REPO, authorizedApprovalVerdict([approvedAt('os-zhuang', HEAD)], HEAD)).state === 'lifted' && + sizeReading(1, sizePair(LINE, 0), REPO, authorizedApprovalVerdict([approvedAt('os-zhuang', HEAD)], HEAD)).state === 'within' && sizeReading(1, sizePair(LINE, 1), REPO, authorizedApprovalVerdict([], HEAD)).state === 'oversized' && - sizeReading(1, null, REPO, authorizedApprovalVerdict([approvedAt('hotlong', HEAD)], HEAD)).state === 'unreadable', + sizeReading(1, null, REPO, authorizedApprovalVerdict([approvedAt('os-zhuang', HEAD)], HEAD)).state === 'unreadable', ); assert( '⭐ the-authorized-verdict-carries-approvals-login-and-commit-the-generic-one-does-NOT-so-only-the-verdict-that-asked-WHO-can-lift', @@ -5835,7 +5866,7 @@ export async function selfTest() { repo: REPO, event: EVENT_MERGE_GROUP, rows: [row(71, [REF_A])], - fetchReviews: async () => [approvedAt(GOVERNED_APPROVERS[1], REF_HEAD)], + fetchReviews: async () => [approvedAt(GOVERNED_APPROVERS[0], REF_HEAD)], fetchPull: async () => REF_HEAD, fetchComments: async () => { throw new Error('the thread must not be read when an approval already satisfies the entry'); }, loadRecognisers: async () => { throw new Error('the recognisers must not be loaded when an approval already satisfies the entry'); }, @@ -6138,7 +6169,8 @@ export async function selfTest() { for (const login of GOVERNED_APPROVERS) { assert(`an-enqueue-by-an-authorized-account-is-AUTHORIZED: ${login}`, authorizedEnqueueVerdict(enqueuerFromTimeline([added(login)])).state === 'authorized'); } - assert('the-NEWEST-add-is-the-one-read', enqueuerFromTimeline([added(SEAT), removed(), added(GOVERNED_APPROVERS[1], '2026-10-26T16:00:00Z')]).login === GOVERNED_APPROVERS[1]); + assert('the-NEWEST-add-is-the-one-read', enqueuerFromTimeline([added(SEAT), removed(), added(GOVERNED_APPROVERS[0], '2026-10-26T16:00:00Z')]).login === GOVERNED_APPROVERS[0]); + assert('⛔ an-enqueue-by-the-account-removed-2026-11-17-is-UNAUTHORIZED', authorizedEnqueueVerdict(enqueuerFromTimeline([added(RETIRED_APPROVER)])).state === 'unauthorized'); const staleAdd = authorizedEnqueueVerdict(enqueuerFromTimeline([added(GOVERNED_APPROVERS[0]), removed()])); assert('⛔ a-newest-queue-event-that-is-a-REMOVAL-is-UNDETERMINED-an-earlier-authorized-add-is-never-carried-onto-a-re-entry', staleAdd.state === 'undetermined' && /not recorded there yet/.test(staleAdd.reason), JSON.stringify(staleAdd)); assert('⛔ no-add-event-a-non-list-and-an-actorless-add-are-all-UNDETERMINED', @@ -6167,10 +6199,10 @@ export async function selfTest() { bySeat.exitCode === EXIT_REFUSED_UNAPPROVED && bySeatText.includes('NO authorized APPROVED review on this pull request') && bySeatText.includes(`enqueued by ${SEAT}, outside GOVERNED_APPROVERS`), bySeatText); // Card fixture 3: a seat enqueue with an authorized APPROVED review — today's leg, and the timeline is never read. - const seatApproved = await enqueueRun(async () => [approvedAt(GOVERNED_APPROVERS[1], OLD)], noTimeline); + const seatApproved = await enqueueRun(async () => [approvedAt(GOVERNED_APPROVERS[0], OLD)], noTimeline); assert('FIXTURE-3 a-seat-enqueue-with-an-authorized-approval-PASSES-on-the-REVIEW-leg-and-never-reads-the-timeline', seatApproved.exitCode === EXIT_CLEAR && satisfiedBy(seatApproved.entries[0]) === 'review' && seatApproved.entries[0].enqueue === undefined && seatApproved.apiCalls === 2 && - renderGuardVerdict(seatApproved).includes(`authorized APPROVED review, by: ${GOVERNED_APPROVERS[1]}`), renderGuardVerdict(seatApproved)); + renderGuardVerdict(seatApproved).includes(`authorized APPROVED review, by: ${GOVERNED_APPROVERS[0]}`), renderGuardVerdict(seatApproved)); // Card fixture 4: the enqueuer cannot be read and there is no review. const unreadEnqueuer = await enqueueRun(async () => [], async () => { throw new Error('HTTP 502'); }); const unreadEnqueuerText = renderGuardVerdict(unreadEnqueuer); @@ -6186,7 +6218,7 @@ export async function selfTest() { const enqueuePrLeg = await enqueueRun(async () => [], noTimeline, AGENTS_ROW, EVENT_PULL_REQUEST); assert('the-pull_request-leg-reads-NO-timeline-and-carries-NO-enqueue-key', enqueuePrLeg.exitCode === EXIT_CLEAR && enqueuePrLeg.entries[0].enqueue === undefined && !/enqueuer|ENQUEUE leg/.test(renderGuardVerdict(enqueuePrLeg))); assert('a-CLEAR-diff-reads-no-timeline-either', (await enqueueRun(noTimeline, noTimeline, [row(1, ['packages/core/src/x.ts'])])).apiCalls === 0); - const tierSEnqueued = await enqueueRun(async () => [], timelineOf([added(GOVERNED_APPROVERS[1])]), [row(7, ['.claude/agents/os-dev.md'])], EVENT_MERGE_GROUP, { + const tierSEnqueued = await enqueueRun(async () => [], timelineOf([added(GOVERNED_APPROVERS[0])]), [row(7, ['.claude/agents/os-dev.md'])], EVENT_MERGE_GROUP, { fetchComments: async () => { throw new Error('no record thread is read once the maintainer\'s enqueue satisfied the entry'); }, loadRecognisers: async () => { throw new Error('the recognisers must not be loaded once the maintainer\'s enqueue satisfied the entry'); }, }); @@ -6205,7 +6237,7 @@ export async function selfTest() { assert('⛔ an-oversized-PR-a-SEAT-enqueued-is-still-REFUSED-on-8-and-says-why', bigSeat.exitCode === EXIT_REFUSED_OVERSIZED && renderSizeVerdict(bigSeat).includes(`enqueued by ${SEAT}, outside GOVERNED_APPROVERS`), renderSizeVerdict(bigSeat)); // main()'s own wiring, reproduced: the governed leg's enqueue reading rides into the size leg and is NOT read twice. let timelineReads = 0; - const countedTimeline = async () => { timelineReads += 1; return [added(GOVERNED_APPROVERS[1])]; }; + const countedTimeline = async () => { timelineReads += 1; return [added(GOVERNED_APPROVERS[0])]; }; const bigGovernedRows = [row(26066, ['AGENTS.md'])]; const bigGoverned = await runGuard({ repo: REPO, event: EVENT_MERGE_GROUP, rows: bigGovernedRows, fetchReviews: async () => [], fetchPull: async () => pull(HEAD, { size: BIG }), fetchTimeline: countedTimeline }); const bigGovernedSize = await runSizeGuard({ @@ -6254,7 +6286,7 @@ export async function selfTest() { const full = (extra = '') => `# mirrors GOVERNED_APPROVERS\n${live.tierHPatterns.map((p) => `${p} ${owners}`).join('\n')}\n${extra}`; assert('a-fixture-carrying-exactly-the-Tier-H-rows-with-every-owner-passes', codeownersMirrorVerdict({ text: full() }).ok); // The root ADR row carries the low-risk arm since #33539 and has no line; the ui/ ADR row is the Tier H ADR row here. - const one = codeownersMirrorVerdict({ text: full().replace(`/ui/docs/adr/ ${owners}`, `/ui/docs/adr/ @${GOVERNED_APPROVERS[1]}`) }); + const one = codeownersMirrorVerdict({ text: full().replace(`/ui/docs/adr/ ${owners}`, `/ui/docs/adr/ @${RETIRED_APPROVER}`) }); assert('⛔ one-approver-on-the-adr-row-is-a-problem-naming-the-row-and-the-missing-account', !one.ok && one.problems.length === 1 && one.problems[0].includes('`/ui/docs/adr/`') && one.problems[0].includes(`@${GOVERNED_APPROVERS[0]}`), one.problems.join(' | ')); const missing = codeownersMirrorVerdict({ text: full().split('\n').filter((l) => !l.startsWith('/AGENTS.md')).join('\n') }); assert('⛔ a-Tier-H-row-with-no-arm-and-no-line-is-a-problem-naming-the-row', !missing.ok && missing.problems.length === 1 && missing.problems[0].includes('`agents-md`'), missing.problems.join(' | ')); @@ -6265,8 +6297,8 @@ export async function selfTest() { assert('⛔ the-arm-is-per-repository-a-sibling-copy-it-does-not-reach-still-owes-the-skills-line', sibling.tierHPatterns.includes('/skills/') && sibling.armPatterns.length === 0 && !sibling.ok && sibling.problems.some((p) => p.includes('`skills-catalog`')), sibling.problems.join(' | ')); const tierS = codeownersMirrorVerdict({ text: full(`/.claude/ ${owners}\n`) }); assert('⛔ routing-the-Tier-S-row-is-a-problem-a-seat-record-landing-summons-nobody', !tierS.ok && tierS.problems.length === 1 && tierS.problems[0].includes('`claude-tree`'), tierS.problems.join(' | ')); - const enforcer = codeownersMirrorVerdict({ text: full(`/.github/CODEOWNERS @${GOVERNED_APPROVERS[1]}\n`) }); - assert('⛔ an-enforcement-chain-row-routed-to-a-subset-is-a-problem', !enforcer.ok && enforcer.problems.length === 1 && enforcer.problems[0].includes('enforcement-chain'), enforcer.problems.join(' | ')); + const enforcer = codeownersMirrorVerdict({ text: full(`/.github/CODEOWNERS @${RETIRED_APPROVER}\n`) }); + assert('⛔ an-enforcement-chain-row-routed-to-another-owner-set-is-a-problem', !enforcer.ok && enforcer.problems.length === 1 && enforcer.problems[0].includes('enforcement-chain'), enforcer.problems.join(' | ')); const silent = codeownersMirrorVerdict({ text: full().replace('# mirrors GOVERNED_APPROVERS\n', '') }); assert('⛔ a-file-that-never-names-the-constant-is-a-problem', !silent.ok && silent.problems.length === 1 && silent.problems[0].includes('GOVERNED_APPROVERS'), silent.problems.join(' | ')); const other = codeownersMirrorVerdict({ text: onDisk, approvers: ['someone-else'] }); diff --git a/scripts/pm/check-half-states.mjs b/scripts/pm/check-half-states.mjs index c519d37d857..e3a714add2e 100644 --- a/scripts/pm/check-half-states.mjs +++ b/scripts/pm/check-half-states.mjs @@ -9957,12 +9957,12 @@ export function renderDanglingReferences(report, { markdown = false } = {}) { // // ## Why ONE requested account is worse than it looks, which is the whole row // -// `hotlong` is also the login the maintainer's own sessions run as, AND the -// author of some governed PRs. A request addressed only to it either lands in -// the account that made it, or cannot be made at all — GitHub answers a review -// request naming the PR's own author with 422. Meanwhile the account the -// maintainer actually reads is never asked. So "requested one of the two" is -// not half a channel; on an approver-authored PR it is frequently zero. +// (History: written while `GOVERNED_APPROVERS` held two accounts; since 2026-11-17 it is `os-zhuang` alone.) +// `hotlong` was also the login seat sessions run as, AND the author of some +// governed PRs. A request addressed only to it either landed in the account that +// made it, or could not be made at all — GitHub answers a review request naming +// the PR's own author with 422. The union below stays correct for any set size, +// and the author-identity 422 still applies to a PR authored by an approver. // // ⇒ Coverage here is a UNION over three fields, and each term is load-bearing: // @@ -16427,7 +16427,7 @@ export function h76OpenPrWithoutAssignee(pr, mailboxLabel) { // // ## Boundaries, pinned rather than described // -// An authorized REVIEW (os-zhuang / hotlong) and the maintainer's own prose are +// An authorized REVIEW (an account in `GOVERNED_APPROVERS`) and the maintainer's own prose are // out of this population TWICE: a review is a `/pulls/{n}/reviews` object this // row never reads, and neither carries a seat signature, so the structural gate // excludes them before anything else is consulted. ⛔ That is by construction @@ -33171,7 +33171,7 @@ async function selfTest() { requested_reviewers: (extra.requested ?? []).map((login) => ({ login })), assignees: (extra.assigned ?? []).map((login) => ({ login })), }); - const APP43 = ['os-zhuang', 'hotlong']; + const APP43 = ['os-zhuang', 'hotlong']; // an injected two-account set exercising the union, not the live roster const GOV43 = [{ id: 'adr', glob: 'docs/adr/**', what: 'architecture decision records', files: ['docs/adr/0121-x.md'] }]; // The hand-off timing (the maintainer's 「审核通过才会推送给我审核」): every // legacy case below that expects a FINDING is driven with the hand-off DUE — @@ -33274,7 +33274,7 @@ async function selfTest() { // an install that copied this sweeper WITHOUT the governed pair answers with // its own NOT MEASURED reason instead, which is the correct signal for it. const register43 = GOVERNED_REGISTER.available - ? `${GOVERNED_REGISTER.matcher(['docs/adr/0121-x.md']).length > 0}/${GOVERNED_REGISTER.matcher(['packages/core/src/x.ts']).length > 0}/${GOVERNED_REGISTER.approvers.length >= 2}` + ? `${GOVERNED_REGISTER.matcher(['docs/adr/0121-x.md']).length > 0}/${GOVERNED_REGISTER.matcher(['packages/core/src/x.ts']).length > 0}/${GOVERNED_REGISTER.approvers.length > 0}` : `NOT MEASURED — ${GOVERNED_REGISTER.reason}`; t43('H43 register: the imported matcher answers governed and clear, and the approver set is non-empty', register43, 'true/false/true'); t43('H43 register: the load is three-state — resolved, or a NAMED reason, never silently absent', GOVERNED_REGISTER.available || typeof GOVERNED_REGISTER.reason === 'string', true); diff --git a/scripts/pm/fleet-write/execute.mjs b/scripts/pm/fleet-write/execute.mjs index 1baf8139d08..79bb0cfb1ec 100644 --- a/scripts/pm/fleet-write/execute.mjs +++ b/scripts/pm/fleet-write/execute.mjs @@ -2207,7 +2207,7 @@ async function readPullFiles(repo, pull, api, t) { * — one row per verdict and per write pushed onto `rows`. Returns `{ ok: true }` or `{ fail: why }`, the sentence * the caller records as the action's failure. Never throws on a status. */ -async function requestGovernedReview({ index, op, pull, payload, api, t, log, rows, git = null }) { +async function requestGovernedReview({ index, op, pull, payload, api, t, log, rows, git = null, approvers = GOVERNED_APPROVERS }) { const repo = payload.repo; const token = t.token ?? ''; const FILES = `GET /repos/${repo}/pulls/${pull}/files`; @@ -2219,10 +2219,10 @@ async function requestGovernedReview({ index, op, pull, payload, api, t, log, ro const read = await readPullFiles(repo, pull, api, t); if (read.fail) return failed(FILES, read.fail.status, read.fail.why); const { paths, renames } = pullPathsFrom(read.files); - let plan = governedReviewPlan({ paths, repo }); + let plan = governedReviewPlan({ approvers, paths, repo }); const renamed = renames.length ? ` (${renames.length} rename(s): the old path counts too)` : ''; if (plan.tier !== GOVERNED_TIER_H) { - const text = governedReviewText(plan, { repo, files: read.files.length }); + const text = governedReviewText(plan, { approvers, repo, files: read.files.length }); rows.push({ action: index, op, call: FILES, status: 200, result: text }); log(` · action ${index} ${op}: ${text}${renamed}`); return { ok: true }; @@ -2239,9 +2239,9 @@ async function requestGovernedReview({ index, op, pull, payload, api, t, log, ro if (readable.read) { reading = await workflowReadingFor({ repo, paths, pr: pr.json, api, t, git }); readingWords = scrub(workflowReadingText(reading), [token]); - plan = governedReviewPlan({ paths, repo, workflowDiff: reading }); + plan = governedReviewPlan({ approvers, paths, repo, workflowDiff: reading }); if (plan.tier !== GOVERNED_TIER_H) { - const text = `${governedReviewText(plan, { repo, files: read.files.length })}${readingWords}`; + const text = `${governedReviewText(plan, { approvers, repo, files: read.files.length })}${readingWords}`; rows.push({ action: index, op, call: FILES, status: 200, result: text }); log(` · action ${index} ${op}: ${text}${renamed}`); return { ok: true }; @@ -2255,10 +2255,10 @@ async function requestGovernedReview({ index, op, pull, payload, api, t, log, ro if (armReadable.why) readingWords += ` · low-risk skills arm not read: ${armReadable.why}`; if (armReadable.read) { lowRisk = await lowRiskReadingFor({ repo, pull, paths, files: read.files, pr: pr.json, api, t, git }); - plan = governedReviewPlan({ paths, repo, workflowDiff: reading, lowRisk }); + plan = governedReviewPlan({ approvers, paths, repo, workflowDiff: reading, lowRisk }); readingWords += scrub(lowRiskReadingText(plan), [token]); if (plan.tier !== GOVERNED_TIER_H) { - const text = `${governedReviewText(plan, { repo, files: read.files.length })}${readingWords}`; + const text = `${governedReviewText(plan, { approvers, repo, files: read.files.length })}${readingWords}`; rows.push({ action: index, op, call: FILES, status: 200, result: text }); log(` · action ${index} ${op}: ${text}${renamed}`); return { ok: true }; @@ -2268,8 +2268,8 @@ async function requestGovernedReview({ index, op, pull, payload, api, t, log, ro if (reviews.status !== 200 || !Array.isArray(reviews.json)) { return failed(`GET /repos/${repo}/pulls/${pull}/reviews`, reviews.status, `${reviews.call} -> HTTP ${reviews.status}${reviews.detail ? ` (${reviews.detail})` : ''}: the pull's reviews could not be read, so who has already reviewed is unknown and no review was requested — its diff hits a Tier H surface; read it on the board and request by hand`); } - plan = governedReviewPlan({ paths, repo, author: pr.json.user?.login ?? null, requested: reviewerLogins(pr.json), assigned: assigneeLogins(pr.json), reviewed: reviewedLogins(reviews.json), workflowDiff: reading, lowRisk }); - const verdict = `${governedReviewText(plan, { repo, files: read.files.length })}${readingWords}`; + plan = governedReviewPlan({ approvers, paths, repo, author: pr.json.user?.login ?? null, requested: reviewerLogins(pr.json), assigned: assigneeLogins(pr.json), reviewed: reviewedLogins(reviews.json), workflowDiff: reading, lowRisk }); + const verdict = `${governedReviewText(plan, { approvers, repo, files: read.files.length })}${readingWords}`; rows.push({ action: index, op, call: FILES, status: 200, result: verdict }); log(` · action ${index} ${op}: ${verdict}${renamed}`); for (const req of governedReviewRequests(repo, pull, { reviewers: plan.toRequest, assignees: plan.toAssign })) { @@ -2288,8 +2288,11 @@ async function requestGovernedReview({ index, op, pull, payload, api, t, log, ro * the notes this run emitted, in order; never throws on a status. * * @param {{ payload: unknown, sender: string, token: string, api?: string }} input - * @param {{ fetch?: Function, pace?: object, log?: Function, git?: Function }} [deps] — `git` the checkout seam the - * governed-review follow-up reads the `workflows` split through (`checkoutGit`; absent = no checkout, fail closed) + * @param {{ fetch?: Function, pace?: object, log?: Function, git?: Function, approvers?: readonly string[] }} [deps] — `git` + * the checkout seam the governed-review follow-up reads the `workflows` split through (`checkoutGit`; absent = no + * checkout, fail closed); `approvers` the account list that follow-up plans against, `GOVERNED_APPROVERS` when + * absent — a self-test seam only, so the two-account union and the author-identity branch stay exercised while the + * live set holds one account (2026-11-17: 「hotlong 从批准账户中去掉,只保留 os-zhuang」) */ export async function executeFleetWrite({ payload: raw, sender, token, api = DEFAULT_API } = {}, deps = {}) { const lines = []; @@ -2555,7 +2558,7 @@ export async function executeFleetWrite({ payload: raw, sender, token, api = DEF rows.push({ action: i + 1, op: action.op, call: 'GET …/pulls/{number}/files', status: 'not sent', result: `FAILED: ${scrub(why, [token])}` }); followed = { fail: why }; } else { - followed = await requestGovernedReview({ index: i + 1, op: action.op, pull, payload, api, t, log, rows, git: deps.git ?? null }); + followed = await requestGovernedReview({ index: i + 1, op: action.op, pull, payload, api, t, log, rows, git: deps.git ?? null, approvers: deps.approvers ?? GOVERNED_APPROVERS }); } if (followed.fail) { stoppedAt = { action: i + 1, op: action.op, why: scrub(followed.fail, [token]) }; @@ -2953,7 +2956,15 @@ export async function selfTest() { const ASSIGN = `POST /repos/${REPO}/issues/${N}/assignees`; const GRAPHQL = 'POST /graphql'; // The approvers are READ from the constant, never restated: a change there moves every expectation here with it. - const [A1, A2] = GOVERNED_APPROVERS; + // The union over two accounts and the author-identity branch need two approvers to be exercised at all, and + // since 2026-11-17 the live set holds one (「hotlong 从批准账户中去掉,只保留 os-zhuang」). So this battery + // plans against an INJECTED pair — the first member is the live constant's own first account — through the + // pure functions' `approvers` argument and the run's `approvers` seam; the live wiring is pinned once below. + const APPROVER_PAIR = Object.freeze([GOVERNED_APPROVERS[0], 'second-approver']); + const [A1, A2] = APPROVER_PAIR; + const planPair = (o) => governedReviewPlan({ approvers: APPROVER_PAIR, ...o }); + const textPair = (plan, o) => governedReviewText(plan, { approvers: APPROVER_PAIR, ...o }); + const runPair = (payload, answers, o = {}) => run(payload, answers, { approvers: APPROVER_PAIR, ...o }); const URL = `https://github.test/${REPO}/pull/${N}`; const opened = { status: 201, json: { number: N, html_url: URL } }; const files = (...names) => ({ status: 200, json: names.map((f) => (typeof f === 'string' ? { filename: f } : f)) }); @@ -2974,59 +2985,62 @@ export async function selfTest() { t("⭐ the table half: GOVERNED_REVIEW_OPS is exactly pr_ready — derived from the rows, never listed — pr_create is OFF it (the draft open summons nobody; the hand-off is the seat's pr_request_reviewers), and the row spends issues (the assignee fallback) as alsoSpends", [GOVERNED_REVIEW_OPS, OPS.pr_create.governedReview ?? null, GOVERNED_REVIEW_OPS.every((op) => (OPS[op].alsoSpends ?? []).includes('issues'))], [['pr_ready'], null, true]); t('…governedReviewRequests spells ONE requested_reviewers POST carrying the logins as requested and ONE issue-assignees POST carrying them as assigned; an empty list spells nothing', [governedReviewRequests(REPO, N, { reviewers: [A1, A2], assignees: [A2] }).map((r) => [r.verb, r.path, r.body, r.requested ?? null, r.assigned ?? null]), governedReviewRequests(REPO, N), governedReviewRequests(REPO, N, { reviewers: [], assignees: [] })], [[['POST', `/repos/${REPO}/pulls/${N}/requested_reviewers`, { reviewers: [A1, A2] }, [A1, A2], null], ['POST', `/repos/${REPO}/issues/${N}/assignees`, { assignees: [A2] }, null, [A2]]], [], []]); // The plan — pure, over the real register. - t('the plan: a Tier H path with nobody covered requests every GOVERNED_APPROVERS account, in its order, and assigns nobody', pick(governedReviewPlan({ paths: ['docs/adr/0140-x.md', 'README.md'], repo: REPO })), [GOVERNED_TIER_H, [A1, A2], [], []]); - t("…the pull's own author, when it is an uncovered approver, is ASSIGNED and never requested — the other approver is requested as before", pick(governedReviewPlan({ paths: ['AGENTS.md'], repo: REPO, author: A2 })), [GOVERNED_TIER_H, [A1], [A2], []]); - t('…an approver already requested, assigned or holding a submitted review is covered — the H43 union — and matched case-insensitively', pick(governedReviewPlan({ paths: ['skills/x/SKILL.md'], repo: REPO, author: A2, requested: [A1.toUpperCase()], assigned: [A2] })), [GOVERNED_TIER_H, [], [], [A1, A2]]); - t("…a submitted review covers its author's slot; a pending (unsubmitted) one does not", [reviewedLogins([{ state: 'COMMENTED', user: { login: 'x' } }, { state: 'PENDING', user: { login: 'y' } }]), governedReviewPlan({ paths: ['CLAUDE.md'], repo: REPO, reviewed: [A1] }).toRequest], [['x'], [A2]]); - t('…a Tier S diff (the .claude/** row alone) is tier S and sends nothing; an ungoverned diff is tier null; a mixed S+H diff is H', [governedReviewPlan({ paths: ['.claude/skills/pm-dispatch/SKILL.md'], repo: REPO }), governedReviewPlan({ paths: ['packages/core/src/a.ts'], repo: REPO }), governedReviewPlan({ paths: ['.claude/agents/os-dev.md', 'docs/NORTH-STAR.md'], repo: REPO })].map((p) => [p.tier, p.toRequest.length + p.toAssign.length]), [[GOVERNED_TIER_S, 0], [null, 0], [GOVERNED_TIER_H, 2]]); - t('…a target outside GOVERNED_REPOS has no governing row: repoId null, tier null, nothing to send', (({ repoId, tier, toRequest }) => [repoId, tier, toRequest])(governedReviewPlan({ paths: ['docs/adr/0001-x.md'], repo: 'objectstack-ai/elsewhere' })), [null, null, []]); - t('…the register is scoped per repository: a workflow path is Tier H on objectui and ungoverned on objectos', [governedReviewPlan({ paths: ['.github/workflows/ci.yml'], repo: 'objectstack-ai/objectui' }).tier, governedReviewPlan({ paths: ['.github/workflows/ci.yml'], repo: 'objectstack-ai/objectos' }).tier], [GOVERNED_TIER_H, null]); - t('…a rename OUT of a governed path counts by its old name (pullPathsFrom reads previous_filename)', governedReviewPlan({ paths: pullPathsFrom([{ filename: 'docs/agents.md', previous_filename: 'AGENTS.md' }]).paths, repo: REPO }).tier, GOVERNED_TIER_H); - t('…the approver list is INJECTED from GOVERNED_APPROVERS, never baked in: another list is requested in its place', governedReviewPlan({ paths: ['AGENTS.md'], repo: REPO, approvers: ['someone-else'] }).toRequest, ['someone-else']); - t('…the verdict words name the tier, the rows hit, who is covered and what is sent', [governedReviewText(governedReviewPlan({ paths: ['docs/adr/0140-x.md'], repo: REPO, requested: [A1] }), { repo: REPO, files: 1 }), governedReviewText(governedReviewPlan({ paths: ['x.ts'], repo: REPO }), { repo: REPO, files: 1 })], [`governed review: Tier H (\`docs/adr/**\`×1) — \`${A1}\` already covered; requesting \`${A2}\``, 'governed review: no governed row hit across 1 file(s) — no review requested']); + t('the plan: a Tier H path with nobody covered requests every GOVERNED_APPROVERS account, in its order, and assigns nobody', pick(planPair({ paths: ['docs/adr/0140-x.md', 'README.md'], repo: REPO })), [GOVERNED_TIER_H, [A1, A2], [], []]); + t("…the pull's own author, when it is an uncovered approver, is ASSIGNED and never requested — the other approver is requested as before", pick(planPair({ paths: ['AGENTS.md'], repo: REPO, author: A2 })), [GOVERNED_TIER_H, [A1], [A2], []]); + t('…an approver already requested, assigned or holding a submitted review is covered — the H43 union — and matched case-insensitively', pick(planPair({ paths: ['skills/x/SKILL.md'], repo: REPO, author: A2, requested: [A1.toUpperCase()], assigned: [A2] })), [GOVERNED_TIER_H, [], [], [A1, A2]]); + t("…a submitted review covers its author's slot; a pending (unsubmitted) one does not", [reviewedLogins([{ state: 'COMMENTED', user: { login: 'x' } }, { state: 'PENDING', user: { login: 'y' } }]), planPair({ paths: ['CLAUDE.md'], repo: REPO, reviewed: [A1] }).toRequest], [['x'], [A2]]); + t('…a Tier S diff (the .claude/** row alone) is tier S and sends nothing; an ungoverned diff is tier null; a mixed S+H diff is H', [planPair({ paths: ['.claude/skills/pm-dispatch/SKILL.md'], repo: REPO }), planPair({ paths: ['packages/core/src/a.ts'], repo: REPO }), planPair({ paths: ['.claude/agents/os-dev.md', 'docs/NORTH-STAR.md'], repo: REPO })].map((p) => [p.tier, p.toRequest.length + p.toAssign.length]), [[GOVERNED_TIER_S, 0], [null, 0], [GOVERNED_TIER_H, 2]]); + t('…a target outside GOVERNED_REPOS has no governing row: repoId null, tier null, nothing to send', (({ repoId, tier, toRequest }) => [repoId, tier, toRequest])(planPair({ paths: ['docs/adr/0001-x.md'], repo: 'objectstack-ai/elsewhere' })), [null, null, []]); + t('…the register is scoped per repository: a workflow path is Tier H on objectui and ungoverned on objectos', [planPair({ paths: ['.github/workflows/ci.yml'], repo: 'objectstack-ai/objectui' }).tier, planPair({ paths: ['.github/workflows/ci.yml'], repo: 'objectstack-ai/objectos' }).tier], [GOVERNED_TIER_H, null]); + t('…a rename OUT of a governed path counts by its old name (pullPathsFrom reads previous_filename)', planPair({ paths: pullPathsFrom([{ filename: 'docs/agents.md', previous_filename: 'AGENTS.md' }]).paths, repo: REPO }).tier, GOVERNED_TIER_H); + t('…the approver list is INJECTED from GOVERNED_APPROVERS, never baked in: another list is requested in its place', planPair({ paths: ['AGENTS.md'], repo: REPO, approvers: ['someone-else'] }).toRequest, ['someone-else']); + t('⭐ the LIVE wiring, with no injected list: a Tier H plan requests exactly GOVERNED_APPROVERS — `os-zhuang` alone since 2026-11-17 — and never the removed `hotlong`', [governedReviewPlan({ paths: ['AGENTS.md'], repo: REPO }).toRequest, governedReviewPlan({ paths: ['AGENTS.md'], repo: REPO }).toRequest.includes('hotlong')], [['os-zhuang'], false]); + t('…the verdict words name the tier, the rows hit, who is covered and what is sent', [textPair(planPair({ paths: ['docs/adr/0140-x.md'], repo: REPO, requested: [A1] }), { repo: REPO, files: 1 }), textPair(planPair({ paths: ['x.ts'], repo: REPO }), { repo: REPO, files: 1 })], [`governed review: Tier H (\`docs/adr/**\`×1) — \`${A1}\` already covered; requesting \`${A2}\``, 'governed review: no governed row hit across 1 file(s) — no review requested']); // The run — pr_create: NOTHING. The draft open summons nobody; the fake platform is primed with every answer the old follow-up would have asked for, and none is asked. - const draft = await run(create([{ op: 'comment', issue: 1, body: 'after' }]), { ...allowed, [PULLS]: opened, [FILES]: tierHFiles, [PULL]: pullOf(), [REVIEWS]: reviewsBy(), [REQUEST]: requestedAnswer([A1, A2]), [`POST /repos/${REPO}/issues/1/comments`]: { status: 201, json: { id: 1 } } }); + const draft = await runPair(create([{ op: 'comment', issue: 1, body: 'after' }]), { ...allowed, [PULLS]: opened, [FILES]: tierHFiles, [PULL]: pullOf(), [REVIEWS]: reviewsBy(), [REQUEST]: requestedAnswer([A1, A2]), [`POST /repos/${REPO}/issues/1/comments`]: { status: 201, json: { id: 1 } } }); t('⭐ pr_create on a Tier H diff: the create and NOTHING else — no file list, pull or review read, no request, no assignee — and the later action runs, exit 0', [draft.exit, draft.seen.map((s) => s.call), writes(draft.seen).map((s) => s.call), draft.rows.length, draft.rows[0]], [EXIT_OK, [PERM, PULLS, `POST /repos/${REPO}/issues/1/comments`], [PULLS, `POST /repos/${REPO}/issues/1/comments`], 2, { action: 1, op: 'pr_create', call: PULLS, status: 201, result: `#${N} ${URL}` }], draft.logs.join(' | ')); - const draftAuthored = await run(create(), { ...allowed, [PULLS]: opened, [FILES]: tierHFiles, [PULL]: pullOf({ author: A2 }), [REVIEWS]: reviewsBy(), [ASSIGN]: assignedAnswer([A2]) }); + const draftAuthored = await runPair(create(), { ...allowed, [PULLS]: opened, [FILES]: tierHFiles, [PULL]: pullOf({ author: A2 }), [REVIEWS]: reviewsBy(), [ASSIGN]: assignedAnswer([A2]) }); t("…an approver-authored pull is not assigned at the open either: the author-is-approver fallback is the seat's hand-off stroke (`assign`), never the create's", [draftAuthored.exit, writes(draftAuthored.seen).map((s) => s.call), draftAuthored.seen.some((s) => [ASSIGN, REQUEST, FILES, REVIEWS].includes(s.call))], [EXIT_OK, [PULLS], false]); - const numberless = await run(create([{ op: 'comment', issue: 1, body: 'after' }]), { ...allowed, [PULLS]: { status: 201, json: { html_url: 'https://github.test/x' } }, [`POST /repos/${REPO}/issues/1/comments`]: { status: 201, json: { id: 1 } } }); + const numberless = await runPair(create([{ op: 'comment', issue: 1, body: 'after' }]), { ...allowed, [PULLS]: { status: 201, json: { html_url: 'https://github.test/x' } }, [`POST /repos/${REPO}/issues/1/comments`]: { status: 201, json: { id: 1 } } }); t('a create whose answer carries no number owes no follow-up, so nothing fails on its account: the create row stands, no file list is read, the later action runs', [numberless.exit, numberless.rows.length, numberless.seen.some((s) => s.call.includes('/files'))], [EXIT_OK, 2, false], numberless.logs.join(' | ')); // The run — pr_ready, the one follow-up left. - const both = await run(ready(), { ...allowed, ...tierH, [REQUEST]: requestedAnswer([A1, A2]) }); + const live = await run(ready(), { ...allowed, ...tierH, [REQUEST]: requestedAnswer(['os-zhuang']) }); + t('⭐ the LIVE wiring end to end, with no injected list: pr_ready on a Tier H pull requests `os-zhuang` alone (2026-11-17) — exit 0', [live.exit, writes(live.seen).map((s) => s.call), writes(live.seen)[1]?.body], [EXIT_OK, [GRAPHQL, REQUEST], { reviewers: ['os-zhuang'] }], live.logs.join(' | ')); + const both = await runPair(ready(), { ...allowed, ...tierH, [REQUEST]: requestedAnswer([A1, A2]) }); t('⭐ pr_ready on a Tier H pull: the node id, the mutation, then ONE requested_reviewers POST naming BOTH approvers at the pull the action names, under the App token — exit 0', [both.exit, writes(both.seen).map((s) => [s.call, s.auth === `Bearer ${TOKEN}`]), writes(both.seen)[1]?.body], [EXIT_OK, [[GRAPHQL, true], [REQUEST, true]], { reviewers: [A1, A2] }], both.logs.join(' | ')); t('…the file list, the pull and its reviews were read first, in that order, and the rows say the verdict and the landing', [both.seen.map((s) => s.call), both.rows.slice(1).map((r) => [r.action, r.op, r.call, r.status, r.result])], [[PERM, PULL, GRAPHQL, FILES, PULL, REVIEWS, REQUEST], [[1, 'pr_ready', FILES, 200, `governed review: Tier H (\`docs/NORTH-STAR.md\`×1) — requesting \`${A1}\`, \`${A2}\``], [1, 'pr_ready', REQUEST, 201, `#${N} ${URL} · review requested from ${A1}, ${A2}`]]]); - const none = await run(ready([{ op: 'comment', issue: 1, body: 'after' }]), { ...allowed, [PULL]: pullOf(), ...readied, [FILES]: files('packages/core/src/a.ts', 'README.md'), [`POST /repos/${REPO}/issues/1/comments`]: { status: 201, json: { id: 1 } } }); + const none = await runPair(ready([{ op: 'comment', issue: 1, body: 'after' }]), { ...allowed, [PULL]: pullOf(), ...readied, [FILES]: files('packages/core/src/a.ts', 'README.md'), [`POST /repos/${REPO}/issues/1/comments`]: { status: 201, json: { id: 1 } } }); t('a non-governed diff: the file list is read, NOTHING is requested, the row says so, and the later action runs', [none.exit, writes(none.seen).map((s) => s.call), none.rows[1]?.result, none.seen.filter((s) => s.call === PULL).length], [EXIT_OK, [GRAPHQL, `POST /repos/${REPO}/issues/1/comments`], 'governed review: no governed row hit across 2 file(s) — no review requested', 1]); - const tierS = await run(ready(), { ...allowed, [PULL]: pullOf(), ...readied, [FILES]: files('.claude/skills/pm-dispatch/SKILL.md') }); + const tierS = await runPair(ready(), { ...allowed, [PULL]: pullOf(), ...readied, [FILES]: files('.claude/skills/pm-dispatch/SKILL.md') }); t("a Tier S diff (.claude/** alone) requests nobody — it lands on a seat's review of record", [tierS.exit, writes(tierS.seen).map((s) => s.call), tierS.rows[1]?.result], [EXIT_OK, [GRAPHQL], "governed review: Tier S (`.claude/**`×1) lands on a seat's review of record — no review requested"]); - const authored = await run(ready(), { ...allowed, ...tierH, [PULL]: pullOf({ author: A2 }), [REQUEST]: requestedAnswer([A1]), [ASSIGN]: assignedAnswer([A2]) }); + const authored = await runPair(ready(), { ...allowed, ...tierH, [PULL]: pullOf({ author: A2 }), [REQUEST]: requestedAnswer([A1]), [ASSIGN]: assignedAnswer([A2]) }); t('⭐ the author-identity branch: a pull authored by an approver requests the OTHER approver and ASSIGNS the author — never a request naming the author', [authored.exit, writes(authored.seen).slice(1).map((s) => [s.call, s.body]), authored.rows.map((r) => r.result).slice(1)], [EXIT_OK, [[REQUEST, { reviewers: [A1] }], [ASSIGN, { assignees: [A2] }]], [`governed review: Tier H (\`docs/NORTH-STAR.md\`×1) — requesting \`${A1}\` and assigning the author \`${A2}\` (a request naming the author is a 422)`, `#${N} ${URL} · review requested from ${A1}`, `#${N} ${URL} · assignees ${A2}`]]); - const covered = await run(ready(), { ...allowed, ...tierH, [PULL]: pullOf({ requested: [A1] }), [REVIEWS]: reviewsBy(A2) }); + const covered = await runPair(ready(), { ...allowed, ...tierH, [PULL]: pullOf({ requested: [A1] }), [REVIEWS]: reviewsBy(A2) }); t("⭐ idempotent — the seat's hand-off already made: one approver requested and the other already reviewed — ZERO writes beyond the mutation, the row says nothing to send, exit 0", [covered.exit, writes(covered.seen).map((s) => s.call), covered.rows[1]?.result], [EXIT_OK, [GRAPHQL], `governed review: Tier H (\`docs/NORTH-STAR.md\`×1) — \`${A1}\`, \`${A2}\` already requested, assigned or reviewed; nothing to send`]); // ⚖️ The ADR leg (#33539): a `docs/adr/**` path now carries the low-risk arm, so the relay READS it (the timeline is // asked for) — and a diff beside published source still plans Tier H and requests both approvers. - const adrArm = await run(ready(), { ...allowed, [PULL]: pullOf(), ...readied, [FILES]: files('docs/adr/0140-x.md', 'packages/core/src/a.ts'), [REVIEWS]: reviewsBy(), [REQUEST]: requestedAnswer([A1, A2]) }); + const adrArm = await runPair(ready(), { ...allowed, [PULL]: pullOf(), ...readied, [FILES]: files('docs/adr/0140-x.md', 'packages/core/src/a.ts'), [REVIEWS]: reviewsBy(), [REQUEST]: requestedAnswer([A1, A2]) }); t('⚖️ a docs/adr path beside packages/core: the relay reads the arm (timeline GET), still plans Tier H and requests BOTH approvers', [adrArm.exit, adrArm.seen.map((s) => s.call), writes(adrArm.seen)[1]?.body, /^governed review: Tier H \(`docs\/adr\/\*\*`×1\) — requesting .* · low-risk skills arm read: Tier H, fail closed — a path outside skills wording and prose: packages\/core\/src\/a\.ts/.test(adrArm.rows[1]?.result ?? '')], [EXIT_OK, [PERM, PULL, GRAPHQL, FILES, PULL, `GET /repos/${REPO}/issues/${N}/timeline`, REVIEWS, REQUEST], { reviewers: [A1, A2] }, true], adrArm.rows.map((r) => r.result).join(' | ')); - const partial = await run(ready(), { ...allowed, ...tierH, [PULL]: pullOf({ assignees: [A2] }), [REQUEST]: requestedAnswer([A1]) }); + const partial = await runPair(ready(), { ...allowed, ...tierH, [PULL]: pullOf({ assignees: [A2] }), [REQUEST]: requestedAnswer([A1]) }); t('…an assigned approver counts as covered, and only the missing one is requested', [partial.exit, writes(partial.seen).map((s) => [s.call, s.body]).slice(1)], [EXIT_OK, [[REQUEST, { reviewers: [A1] }]]]); - const readyFailed = await run(ready(), { ...allowed, [PULL]: pullOf(), [GRAPHQL]: { status: 200, json: { data: { markPullRequestReadyForReview: { pullRequest: { number: N, isDraft: true } } } } }, [FILES]: files('docs/adr/0140-x.md') }); + const readyFailed = await runPair(ready(), { ...allowed, [PULL]: pullOf(), [GRAPHQL]: { status: 200, json: { data: { markPullRequestReadyForReview: { pullRequest: { number: N, isDraft: true } } } } }, [FILES]: files('docs/adr/0140-x.md') }); t('a pr_ready that did not land runs no follow-up: no file list read, no request', [readyFailed.exit, readyFailed.seen.some((s) => s.call === FILES)], [EXIT_ACTION_FAILED, false]); // The refusals. - const unread = await run(ready([{ op: 'comment', issue: 1, body: 'after' }]), { ...allowed, [PULL]: pullOf(), ...readied, [FILES]: { status: 503, json: { message: 'down' } }, [`POST /repos/${REPO}/issues/1/comments`]: { status: 201, json: { id: 1 } } }); + const unread = await runPair(ready([{ op: 'comment', issue: 1, body: 'after' }]), { ...allowed, [PULL]: pullOf(), ...readied, [FILES]: { status: 503, json: { message: 'down' } }, [`POST /repos/${REPO}/issues/1/comments`]: { status: 201, json: { id: 1 } } }); t('⛔ an unreadable file list is a FAILED action — the pull is ready (its row landed), the follow-up row names the read, exit 5, the later action never attempted — never a quiet "not governed"', [unread.exit, unread.rows.map((r) => [r.status, r.result.startsWith('FAILED') ? r.result.includes('file list could not be read') : 'landed']), writes(unread.seen).map((s) => s.call), unread.summary.includes('1 later action(s) NOT attempted')], [EXIT_ACTION_FAILED, [[200, 'landed'], [503, true]], [GRAPHQL], true], unread.rows[1]?.result); const page = (n) => files(...Array.from({ length: n }, (_, i) => `packages/core/src/f${i}.ts`)); - const twoPages = await run(ready(), { ...allowed, [PULL]: pullOf(), ...readied, [FILES]: [page(100), files('docs/NORTH-STAR.md')], [REVIEWS]: reviewsBy(), [REQUEST]: requestedAnswer([A1, A2]) }); + const twoPages = await runPair(ready(), { ...allowed, [PULL]: pullOf(), ...readied, [FILES]: [page(100), files('docs/NORTH-STAR.md')], [REVIEWS]: reviewsBy(), [REQUEST]: requestedAnswer([A1, A2]) }); t('the walk reads EVERY page: a governed path on the second page is found, and the pages were asked in order', [twoPages.exit, twoPages.seen.filter((s) => s.call === FILES).length, writes(twoPages.seen).map((s) => s.call)], [EXIT_OK, 2, [GRAPHQL, REQUEST]]); - const truncated = await run(ready(), { ...allowed, [PULL]: pullOf(), ...readied, [FILES]: Array.from({ length: GOVERNED_REVIEW_FILES_PAGE_CAP }, () => page(100)) }); + const truncated = await runPair(ready(), { ...allowed, [PULL]: pullOf(), ...readied, [FILES]: Array.from({ length: GOVERNED_REVIEW_FILES_PAGE_CAP }, () => page(100)) }); t('⛔ a walk that would need more than the page cap is a FAILED action naming the cap — a truncated list is a subset, never "nothing governed"', [truncated.exit, truncated.seen.filter((s) => s.call === FILES).length, truncated.rows[1]?.result.includes(`${GOVERNED_REVIEW_FILES_PAGE_CAP}-page cap`)], [EXIT_ACTION_FAILED, GOVERNED_REVIEW_FILES_PAGE_CAP, true], truncated.rows[1]?.result); - const short = await run(ready(), { ...allowed, ...tierH, [REQUEST]: requestedAnswer([A1]) }); + const short = await runPair(ready(), { ...allowed, ...tierH, [REQUEST]: requestedAnswer([A1]) }); t('⛔ a 201 whose answer lists fewer reviewers than sent is a FAILED action naming the one not requested — never a quiet partial', [short.exit, short.rows[2]?.result.includes(`${A2} not requested`), short.rows[2]?.result.includes(`lists ${A1}`)], [EXIT_ACTION_FAILED, true, true], short.rows[2]?.result); - const refused = await run(ready(), { ...allowed, ...tierH, [REQUEST]: { status: 422, json: { message: 'Reviews may only be requested from collaborators.' } } }); + const refused = await runPair(ready(), { ...allowed, ...tierH, [REQUEST]: { status: 422, json: { message: 'Reviews may only be requested from collaborators.' } } }); t("a refused request is a FAILED action with the platform's sentence, the pull already ready", [refused.exit, refused.rows.map((r) => r.status), refused.rows[2]?.result.includes('Reviews may only be requested from collaborators')], [EXIT_ACTION_FAILED, [200, 200, 422], true]); - const noPull = await run(ready(), { ...allowed, ...tierH, [PULL]: [pullOf(), { status: 503, json: { message: 'down' } }] }); - const noReviews = await run(ready(), { ...allowed, ...tierH, [REVIEWS]: { status: 503, json: { message: 'down' } } }); + const noPull = await runPair(ready(), { ...allowed, ...tierH, [PULL]: [pullOf(), { status: 503, json: { message: 'down' } }] }); + const noReviews = await runPair(ready(), { ...allowed, ...tierH, [REVIEWS]: { status: 503, json: { message: 'down' } } }); t('an unreadable pull or review list on a Tier H hit is FAILED naming the read — never a request sent blind, never a quiet skip', [noPull.exit, noPull.rows[1]?.result.includes('could not be re-read'), noReviews.exit, noReviews.rows[1]?.result.includes('reviews could not be read'), [...noPull.seen, ...noReviews.seen].some((s) => s.call === REQUEST)], [EXIT_ACTION_FAILED, true, EXIT_ACTION_FAILED, true, false]); // The `workflows` split (#31538's ruling C on the relay): the queue guard's own reading, merge base → head, through an injected git seam. const WF = '.github/workflows/ci.yml'; @@ -3068,28 +3082,28 @@ export async function selfTest() { }; }; const sRead = { measured: true, reason: null, base: MB, head: HEAD_S, files: [{ path: WF, tier: GOVERNED_TIER_S, reasons: [] }] }; - t('the plan with a reading: a MEASURED S reading moves the workflows row to S; no reading, or an unmeasured one, keeps the path-only H', [governedReviewPlan({ paths: [WF], repo: REPO, workflowDiff: sRead }).tier, governedReviewPlan({ paths: [WF], repo: REPO }).tier, governedReviewPlan({ paths: [WF], repo: REPO, workflowDiff: { measured: false, reason: 'x', files: [] } }).tier], [GOVERNED_TIER_S, GOVERNED_TIER_H, GOVERNED_TIER_H]); + t('the plan with a reading: a MEASURED S reading moves the workflows row to S; no reading, or an unmeasured one, keeps the path-only H', [planPair({ paths: [WF], repo: REPO, workflowDiff: sRead }).tier, planPair({ paths: [WF], repo: REPO }).tier, planPair({ paths: [WF], repo: REPO, workflowDiff: { measured: false, reason: 'x', files: [] } }).tier], [GOVERNED_TIER_S, GOVERNED_TIER_H, GOVERNED_TIER_H]); const sCalls = []; - const wfS = await run(ready(), wfAnswers(HEAD_S), { git: fakeGit(sCalls, { present: [TIP] }) }); + const wfS = await runPair(ready(), wfAnswers(HEAD_S), { git: fakeGit(sCalls, { present: [TIP] }) }); t('⭐ tier-s-workflow-pull-requests-no-one: a workflow-only pull whose reading (merge base → head) says S — the compare read, the two missing commits fetched by sha at depth 1, NO reviews read, NO request, exit 0, the row naming the reading', [wfS.exit, writes(wfS.seen).map((s) => s.call), wfS.seen.some((s) => s.call === REVIEWS), wfS.seen.filter((s) => s.call === COMPARE(HEAD_S)).length, sCalls.filter((c) => c.startsWith('fetch')), wfS.rows[1]?.result], [EXIT_OK, [GRAPHQL], false, 1, [`fetch --no-tags --depth=1 origin ${MB} ${HEAD_S}`], `governed review: Tier S (\`.github/workflows/**\`×1) lands on a seat's review of record — no review requested · workflow split read (merge base ${MB.slice(0, 12)} → head ${HEAD_S.slice(0, 12)}): \`${WF}\` S`], wfS.logs.join(' | ')); - const wfH = await run(ready(), wfAnswers(HEAD_H), { git: fakeGit([], { present: [MB, HEAD_H] }) }); + const wfH = await runPair(ready(), wfAnswers(HEAD_H), { git: fakeGit([], { present: [MB, HEAD_H] }) }); t('⭐ h-reading-workflow-pull-requests: a reading that says H (a permissions block added) requests both approvers, and the row names the reason', [wfH.exit, writes(wfH.seen).slice(1).map((s) => [s.call, s.body]), wfH.rows[1]?.result.includes(`\`${WF}\` H (a \`permissions:\` block added, changed or removed)`)], [EXIT_OK, [[REQUEST, { reviewers: [A1, A2] }]], true], wfH.rows[1]?.result); const unreadable = { - 'no checkout': await run(ready(), wfAnswers(HEAD_S)), - 'a commit the fetch cannot bring': await run(ready(), wfAnswers(HEAD_S), { git: fakeGit([], { fetchable: [MB] }) }), - 'git throwing': await run(ready(), wfAnswers(HEAD_S), { git: fakeGit([], { throwOn: 'remote' }) }), - 'a fetch that throws': await run(ready(), wfAnswers(HEAD_S), { git: fakeGit([], { throwOn: 'fetch' }) }), - 'a checkout of another repository': await run(ready(), wfAnswers(HEAD_S), { git: fakeGit([], { remote: 'https://github.com/objectstack-ai/objectui.git' }) }), - 'a refused compare': await run(ready(), wfAnswers(HEAD_S, { [COMPARE(HEAD_S)]: { status: 404, json: { message: 'Not Found' } } }), { git: fakeGit([], { present: [MB, HEAD_S] }) }), + 'no checkout': await runPair(ready(), wfAnswers(HEAD_S)), + 'a commit the fetch cannot bring': await runPair(ready(), wfAnswers(HEAD_S), { git: fakeGit([], { fetchable: [MB] }) }), + 'git throwing': await runPair(ready(), wfAnswers(HEAD_S), { git: fakeGit([], { throwOn: 'remote' }) }), + 'a fetch that throws': await runPair(ready(), wfAnswers(HEAD_S), { git: fakeGit([], { throwOn: 'fetch' }) }), + 'a checkout of another repository': await runPair(ready(), wfAnswers(HEAD_S), { git: fakeGit([], { remote: 'https://github.com/objectstack-ai/objectui.git' }) }), + 'a refused compare': await runPair(ready(), wfAnswers(HEAD_S, { [COMPARE(HEAD_S)]: { status: 404, json: { message: 'Not Found' } } }), { git: fakeGit([], { present: [MB, HEAD_S] }) }), }; t('⛔ unreadable-workflow-pull-requests: no checkout, a commit missing after the fetch, git throwing, a fetch that throws, a checkout of another repository or a refused compare — each requests BOTH approvers exactly as today, and its row says UNREAD with the fail-closed words', Object.entries(unreadable).map(([k, r]) => [k, r.exit, writes(r.seen).map((s) => s.call), r.rows[1]?.result.includes('workflow split UNREAD') && r.rows[1]?.result.includes('fail closed, the path-only tier H stands')]), Object.keys(unreadable).map((k) => [k, EXIT_OK, [GRAPHQL, REQUEST], true]), Object.values(unreadable).map((r) => r.rows[1]?.result).join(' | ')); const mixedCalls = []; - const mixed = await run(ready(), wfAnswers(HEAD_S, { [FILES]: files(WF, '.claude/agents/os-dev.md') }), { git: fakeGit(mixedCalls, { present: [MB, HEAD_S] }) }); + const mixed = await runPair(ready(), wfAnswers(HEAD_S, { [FILES]: files(WF, '.claude/agents/os-dev.md') }), { git: fakeGit(mixedCalls, { present: [MB, HEAD_S] }) }); t('⛔ mixed-workflow-pull-requests: a workflow edit beside another governed row (.claude/**) is never split — no compare, no git, both requested, the row naming the other row', [mixed.exit, mixed.seen.some((s) => s.call.includes('/compare/')), mixedCalls.length, writes(mixed.seen).map((s) => s.call), mixed.rows[1]?.result.endsWith('· workflow split not read: another governed row is hit too (`.claude/**`), so the path-only tier stands')], [EXIT_OK, false, 0, [GRAPHQL, REQUEST], true], mixed.rows[1]?.result); const UI = 'objectstack-ai/objectui'; const uiN = (p) => p.replace(REPO, UI); const uiCalls = []; - const ui = await run({ ...ready(), repo: UI }, { [uiN(PERM)]: allowed[PERM], ...readied, [uiN(PULL)]: wfPull(HEAD_S), [uiN(FILES)]: files(WF), [uiN(REVIEWS)]: reviewsBy(), [uiN(REQUEST)]: requestedAnswer([A1, A2]) }, { git: fakeGit(uiCalls, { present: [MB, HEAD_S] }) }); + const ui = await runPair({ ...ready(), repo: UI }, { [uiN(PERM)]: allowed[PERM], ...readied, [uiN(PULL)]: wfPull(HEAD_S), [uiN(FILES)]: files(WF), [uiN(REVIEWS)]: reviewsBy(), [uiN(REQUEST)]: requestedAnswer([A1, A2]) }, { git: fakeGit(uiCalls, { present: [MB, HEAD_S] }) }); t('⛔ objectui-workflow-pull-requests: a workflow pull on a repository outside split.repos (objectui; cloud alike) is not read — no compare, no git, both requested, the row naming split.repos', [ui.exit, ui.seen.some((s) => s.call.includes('/compare/')), uiCalls.length, writes(ui.seen).map((s) => s.call), ui.rows[1]?.result.endsWith('· workflow split not read: objectui is not in the row\'s split.repos (objectstack), so the path-only tier stands')], [EXIT_OK, false, 0, [GRAPHQL, uiN(REQUEST)], true], ui.rows[1]?.result); const UI_REPO = 'objectstack-ai/objectui'; const uiRepo = (p) => p.replace(REPO, UI_REPO); @@ -3113,7 +3127,7 @@ export async function selfTest() { record: over.record === undefined ? stageRecord() : over.record, cardLabels: over.cardLabels === undefined ? stageCard() : over.cardLabels, }); - const armPlan = (paths, reading) => governedReviewPlan({ paths, repo: REPO, lowRisk: reading }); + const armPlan = (paths, reading) => planPair({ paths, repo: REPO, lowRisk: reading }); t('⭐ the plan with the arm: a low-risk skills-wording pull read by the arm is Tier S and plans NO approver; no reading, or one not measured, keeps the path-only H and plans both', [armPlan([SK, CS], lowRead([SK, CS])), armPlan([SK, CS], null), armPlan([SK, CS], { measured: false, reason: 'x' }), armPlan([SK, CS], pullLowRiskReading(armPullJson(), [SK, CS]))].map((p) => [p.tier, p.toRequest]), [[GOVERNED_TIER_S, []], [GOVERNED_TIER_H, [A1, A2]], [GOVERNED_TIER_H, [A1, A2]], [GOVERNED_TIER_H, [A1, A2]]]); const SEC = 'skills/objectstack-security/SKILL.md'; const variants = { @@ -3138,8 +3152,8 @@ export async function selfTest() { 'the record stage not read at all': [armPlan([SK, CS], lowRead([SK, CS], { record: null, cardLabels: null })), 'its contract-review record and the labels of its card were not read'], }; t('⛔ the plan with the arm\'s record stage: a record that lacks the line, reads yes, doubles it, is absent or unread, a card carrying `security` or stripped of it, a card nobody could name, or a stage not read at all plans BOTH approvers, and the words name the reason', Object.entries(stageVariants).map(([k, [plan, why]]) => [k, plan.tier, plan.toRequest, lowRiskReadingText(plan).includes(why)]), Object.keys(stageVariants).map((k) => [k, GOVERNED_TIER_H, [A1, A2], true]), Object.values(stageVariants).map(([plan]) => lowRiskReadingText(plan)).join(' | ')); - t('the arm words: Tier S names the ruling; Tier H lists every reason; no arm row adds nothing', [lowRiskReadingText(armPlan([SK, CS], lowRead([SK, CS]))), lowRiskReadingText(variants['a security label']).includes('the PR carries the `security` label'), lowRiskReadingText(governedReviewPlan({ paths: ['AGENTS.md'], repo: REPO }))], [` · low-risk skills arm read: Tier S (${LOW_RISK_ARM_RULING})`, true, '']); - t('lowRiskArmReadable: catalog rows alone in objectstack are read; another row beside them, or a repository outside lowRisk.repos, is not — with the words why; a non-arm plan says nothing', [lowRiskArmReadable(governedReviewPlan({ paths: [SK, 'ui/skills/x/SKILL.md'], repo: REPO })), lowRiskArmReadable(governedReviewPlan({ paths: [SK, 'AGENTS.md'], repo: REPO })).read, lowRiskArmReadable(governedReviewPlan({ paths: [SK], repo: 'objectstack-ai/objectui' })).why, lowRiskArmReadable(governedReviewPlan({ paths: ['AGENTS.md'], repo: REPO }))], [{ read: true, why: null }, false, "objectui is not in the row's lowRisk.repos (objectstack), so the path-only tier stands", { read: false, why: null }]); + t('the arm words: Tier S names the ruling; Tier H lists every reason; no arm row adds nothing', [lowRiskReadingText(armPlan([SK, CS], lowRead([SK, CS]))), lowRiskReadingText(variants['a security label']).includes('the PR carries the `security` label'), lowRiskReadingText(planPair({ paths: ['AGENTS.md'], repo: REPO }))], [` · low-risk skills arm read: Tier S (${LOW_RISK_ARM_RULING})`, true, '']); + t('lowRiskArmReadable: catalog rows alone in objectstack are read; another row beside them, or a repository outside lowRisk.repos, is not — with the words why; a non-arm plan says nothing', [lowRiskArmReadable(planPair({ paths: [SK, 'ui/skills/x/SKILL.md'], repo: REPO })), lowRiskArmReadable(planPair({ paths: [SK, 'AGENTS.md'], repo: REPO })).read, lowRiskArmReadable(planPair({ paths: [SK], repo: 'objectstack-ai/objectui' })).why, lowRiskArmReadable(planPair({ paths: ['AGENTS.md'], repo: REPO }))], [{ read: true, why: null }, false, "objectui is not in the row's lowRisk.repos (objectstack), so the path-only tier stands", { read: false, why: null }]); // The run: pr_ready on the pull through a fake platform and a fake checkout. const ARM_COMPARE = `GET /repos/${REPO}/compare/${ARM_TIP}...${ARM_HEAD}`; @@ -3192,11 +3206,11 @@ export async function selfTest() { }; }; const lowCalls = []; - const low = await run(ready(), armAnswers(), { git: armGit(lowCalls) }); + const low = await runPair(ready(), armAnswers(), { git: armGit(lowCalls) }); t('⭐ low-risk-skills-pull-requests-no-one: a skills-wording pull the arm reads as Tier S — the timeline and the compare read, the head fetched by sha at depth ahead_by + 1, then the record stage read once (the pull\'s thread, the card\'s thread, its labels and its timeline, on the relay token), NO reviews read, NO request, exit 0, the row naming the arm and its ruling', [low.exit, writes(low.seen).map((s) => s.call), low.seen.some((s) => s.call === REVIEWS), low.seen.filter((s) => s.call === TIMELINE).length, low.seen.map((s) => s.call).filter((c) => STAGE_READS.includes(c)), low.seen.filter((s) => STAGE_READS.includes(s.call)).every((s) => s.auth === `Bearer ${TOKEN}`), lowCalls.filter((c) => c.startsWith('fetch')), low.rows[1]?.result], [EXIT_OK, [GRAPHQL], false, 1, STAGE_READS, true, [`fetch --no-tags --depth=3 origin ${ARM_HEAD}`], `governed review: Tier S (\`skills/**\`×1) lands on a seat's review of record — no review requested · low-risk skills arm read: Tier S (${LOW_RISK_ARM_RULING})`], low.logs.join(' | ')); // ⛔ The record stage on the relay: an arm pull whose record lacks the line reads Tier H, and so does each other // way the stage can fail — both approvers requested, as the path-only plan, the row naming the reason. - const stageRun = (stage, extra = {}) => run(ready(), armAnswers({ ...stageAnswers(stage), ...extra }), { git: armGit([]) }); + const stageRun = (stage, extra = {}) => runPair(ready(), armAnswers({ ...stageAnswers(stage), ...extra }), { git: armGit([]) }); const stageH = { 'a record that LACKS the line': [await stageRun({ rows: [reviewOfRecord(null)] }), 'its contract-review record (PR comment 900) carries no `Security-touching:` line'], 'a record reading yes': [await stageRun({ rows: [reviewOfRecord('Security-touching: yes')] }), '(PR comment 900) reads `Security-touching: yes`'], @@ -3236,27 +3250,27 @@ export async function selfTest() { const [stageLoaded, stageThrew, stageUnavailable] = [await stageFor(), await stageFor(async () => { throw new Error('ERR_MODULE_NOT_FOUND'); }), await stageFor(async () => ({ available: false, reason: 'the recognisers would not load' }))]; t('⛔ lowRiskReadingFor: recognisers that load give the stage its two readings; a load that throws or answers unavailable is NOT MEASURED on both halves, never a pass', [[stageLoaded.record?.located, stageLoaded.record?.securityTouching, stageLoaded.cardLabels?.card, armPlan([SK, CS], stageLoaded).tier], [stageThrew.record, stageThrew.cardLabels?.measured, armPlan([SK, CS], stageThrew).tier], [stageUnavailable.record, armPlan([SK, CS], stageUnavailable).tier]], [['found', { state: 'read', value: 'no' }, 1, GOVERNED_TIER_S], [{ measured: false, reason: 'the recogniser load threw: ERR_MODULE_NOT_FOUND' }, false, GOVERNED_TIER_H], [{ measured: false, reason: 'the recognisers would not load' }, GOVERNED_TIER_H]]); - const secLabel = await run(ready(), armAnswers({ [PULL]: { status: 200, json: armPullJson({ labels: [{ name: 'security' }] }) } }), { git: armGit([]) }); - const added = await run(ready(), armAnswers({ [FILES]: armFiles({ filename: SK, status: 'added' }, CS) }), { git: armGit([]) }); - const symlinked = await run(ready(), armAnswers(), { git: armGit([], { modes: { [SK]: '120000' } }) }); + const secLabel = await runPair(ready(), armAnswers({ [PULL]: { status: 200, json: armPullJson({ labels: [{ name: 'security' }] }) } }), { git: armGit([]) }); + const added = await runPair(ready(), armAnswers({ [FILES]: armFiles({ filename: SK, status: 'added' }, CS) }), { git: armGit([]) }); + const symlinked = await runPair(ready(), armAnswers(), { git: armGit([], { modes: { [SK]: '120000' } }) }); t('the record stage is read only when every pull-read condition holds: a pull the arm reads H on its own label, an added file or a symlink reads no thread and no card label', [secLabel, added, symlinked].map((r) => r.seen.filter((s) => STAGE_READS.includes(s.call)).length), [0, 0, 0]); t('⭐ h-reading-skills-pull-requests: the same pull with a security label, an added catalog file, or a catalog path turned symlink requests BOTH approvers, and its row names the reason', [[secLabel, 'the `security` label'], [added, 'added, deleted or renamed'], [symlinked, 'not a regular file at both ends']].map(([r, why]) => [r.exit, writes(r.seen).map((s) => s.call), r.rows[1]?.result.includes('low-risk skills arm read: Tier H, fail closed') && r.rows[1]?.result.includes(why)]), [0, 1, 2].map(() => [EXIT_OK, [GRAPHQL, REQUEST], true]), [secLabel, added, symlinked].map((r) => r.rows[1]?.result).join(' | ')); const armUnread = { - 'no checkout': [await run(ready(), armAnswers()), 'no checkout was handed to this run'], - 'an unread timeline': [await run(ready(), armAnswers({ [TIMELINE]: { status: 502, json: { message: 'bad gateway' } } }), { git: armGit([]) }), 'its timeline was not read'], - 'a refused compare': [await run(ready(), armAnswers({ [ARM_COMPARE]: { status: 404, json: { message: 'Not Found' } } }), { git: armGit([]) }), 'the merge base and the head'], - 'a head past the fetch cap': [await run(ready(), armAnswers({ [ARM_COMPARE]: { status: 200, json: { merge_base_commit: { sha: ARM_TIP }, ahead_by: LOW_RISK_FETCH_DEPTH_CAP } } }), { git: armGit([]) }), `beyond the relay's ${LOW_RISK_FETCH_DEPTH_CAP}-commit fetch`], - 'a checkout of another repository': [await run(ready(), armAnswers(), { git: armGit([], { remote: 'https://github.com/objectstack-ai/objectui.git' }) }), 'not objectstack-ai/objectstack'], - 'a fetch that throws': [await run(ready(), armAnswers(), { git: armGit([], { throwOn: 'fetch' }) }), 'git could not read'], - 'a head the fetch cannot bring': [await run(ready(), armAnswers(), { git: armGit([], { fetchable: false }) }), 'not in this checkout'], - 'a pull answer with no head sha': [await run(ready(), armAnswers({ [PULL]: { status: 200, json: armPullJson({ head: { ...sameRepo } }) } }), { git: armGit([]) }), "head or base sha could not be read"], + 'no checkout': [await runPair(ready(), armAnswers()), 'no checkout was handed to this run'], + 'an unread timeline': [await runPair(ready(), armAnswers({ [TIMELINE]: { status: 502, json: { message: 'bad gateway' } } }), { git: armGit([]) }), 'its timeline was not read'], + 'a refused compare': [await runPair(ready(), armAnswers({ [ARM_COMPARE]: { status: 404, json: { message: 'Not Found' } } }), { git: armGit([]) }), 'the merge base and the head'], + 'a head past the fetch cap': [await runPair(ready(), armAnswers({ [ARM_COMPARE]: { status: 200, json: { merge_base_commit: { sha: ARM_TIP }, ahead_by: LOW_RISK_FETCH_DEPTH_CAP } } }), { git: armGit([]) }), `beyond the relay's ${LOW_RISK_FETCH_DEPTH_CAP}-commit fetch`], + 'a checkout of another repository': [await runPair(ready(), armAnswers(), { git: armGit([], { remote: 'https://github.com/objectstack-ai/objectui.git' }) }), 'not objectstack-ai/objectstack'], + 'a fetch that throws': [await runPair(ready(), armAnswers(), { git: armGit([], { throwOn: 'fetch' }) }), 'git could not read'], + 'a head the fetch cannot bring': [await runPair(ready(), armAnswers(), { git: armGit([], { fetchable: false }) }), 'not in this checkout'], + 'a pull answer with no head sha': [await runPair(ready(), armAnswers({ [PULL]: { status: 200, json: armPullJson({ head: { ...sameRepo } }) } }), { git: armGit([]) }), "head or base sha could not be read"], }; t('⛔ unreadable-skills-pull-requests: no checkout, an unread timeline, a refused compare, a head past the fetch cap, a checkout of another repository, a fetch that throws, a head the fetch cannot bring, or no head sha — each requests BOTH approvers exactly as today, and its row says Tier H, fail closed, with the reason', Object.entries(armUnread).map(([k, [r, why]]) => [k, r.exit, writes(r.seen).map((s) => s.call), r.rows[1]?.result.includes('low-risk skills arm read: Tier H, fail closed') && r.rows[1]?.result.includes(why)]), Object.keys(armUnread).map((k) => [k, EXIT_OK, [GRAPHQL, REQUEST], true]), Object.values(armUnread).map(([r]) => r.rows[1]?.result).join(' | ')); const armMixedCalls = []; - const armMixed = await run(ready(), armAnswers({ [FILES]: armFiles(SK, CS, '.claude/agents/os-dev.md') }), { git: armGit(armMixedCalls) }); + const armMixed = await runPair(ready(), armAnswers({ [FILES]: armFiles(SK, CS, '.claude/agents/os-dev.md') }), { git: armGit(armMixedCalls) }); t('⛔ mixed-skills-pull-requests: a skills edit beside another governed row (.claude/**) is not read — no timeline, no compare, no git, both requested, the row naming the other row', [armMixed.exit, armMixed.seen.some((s) => s.call === TIMELINE || s.call === ARM_COMPARE), armMixedCalls.length, writes(armMixed.seen).map((s) => s.call), armMixed.rows[1]?.result.endsWith('· low-risk skills arm not read: another governed row is hit too (`.claude/**`), so the path-only tier stands')], [EXIT_OK, false, 0, [GRAPHQL, REQUEST], true], armMixed.rows[1]?.result); const armUiCalls = []; - const armUi = await run({ ...ready(), repo: UI_REPO }, { [uiRepo(PERM)]: allowed[PERM], ...readied, [uiRepo(PULL)]: { status: 200, json: armPullJson() }, [uiRepo(FILES)]: armFiles(SK, CS), [uiRepo(REVIEWS)]: reviewsBy(), [uiRepo(REQUEST)]: requestedAnswer([A1, A2]) }, { git: armGit(armUiCalls) }); + const armUi = await runPair({ ...ready(), repo: UI_REPO }, { [uiRepo(PERM)]: allowed[PERM], ...readied, [uiRepo(PULL)]: { status: 200, json: armPullJson() }, [uiRepo(FILES)]: armFiles(SK, CS), [uiRepo(REVIEWS)]: reviewsBy(), [uiRepo(REQUEST)]: requestedAnswer([A1, A2]) }, { git: armGit(armUiCalls) }); t('⛔ objectui-skills-pull-requests: a skills pull on a repository outside lowRisk.repos is not read — no timeline, no compare, no git, both requested, the row naming lowRisk.repos', [armUi.exit, armUi.seen.some((s) => s.call.includes('/timeline') || s.call.includes('/compare/')), armUiCalls.length, writes(armUi.seen).map((s) => s.call), armUi.rows[1]?.result.endsWith("· low-risk skills arm not read: objectui is not in the row's lowRisk.repos (objectstack), so the path-only tier stands")], [EXIT_OK, false, 0, [GRAPHQL, uiRepo(REQUEST)], true], armUi.rows[1]?.result); t('no annotation is emitted for the follow-up — pr_ready is not an annotated op', [both.annotations, authored.logs.some((l) => l.startsWith('::notice'))], [[], false]); } diff --git a/ui/scripts/check-governed-queue-guard.mjs b/ui/scripts/check-governed-queue-guard.mjs index 473225f48f5..285fc06b5f1 100644 --- a/ui/scripts/check-governed-queue-guard.mjs +++ b/ui/scripts/check-governed-queue-guard.mjs @@ -334,7 +334,7 @@ export const GOVERNED_SURFACES = Object.freeze([ * a one-line maintainer decision here and nowhere else. * * ⚠️ Provenance, stated because it is INHERITED rather than ruled for this - * repository: these are the two accounts the sibling repository's maintainer + * repository: these were the two accounts the sibling repository's maintainer * ruled authoritative for its own governed surface on 2026-08-27 (verbatim: * 「os-zhuang hotlong 批准算数」). objectui's own card rules the MECHANISM, not * the roster. The roster is carried across because it is the same maintainer @@ -345,8 +345,14 @@ export const GOVERNED_SURFACES = Object.freeze([ * these accounts is what hands a governed pull request to the claiming seat to * land. So a wrong roster fails in the safe direction: governed pull requests * stay parked as drafts, and none lands unreviewed. + * + * 2026-11-17 the maintainer narrowed that roster to one account, in the + * triage session (card objectstack#34626), verbatim: 「hotlong 从批准账户中去掉, + * 只保留 os-zhuang」. It supersedes the 2026-08-27 membership above, which stays + * here as history, and this copy moves with the root guard's constant in the + * same change; the self-test pins the one account and refuses the removed one. */ -export const GOVERNED_APPROVERS = Object.freeze(['os-zhuang', 'hotlong']); +export const GOVERNED_APPROVERS = Object.freeze(['os-zhuang']); /** * The clause-② enqueue gate's label (objectui#9018). @@ -1442,7 +1448,7 @@ export async function selfTest() { assert('an-unsupported-event-CANNOT-RUN-and-names-both-events-it-does-read', !unsupported.ok && /merge_group/.test(unsupported.reason) && /pull_request/.test(unsupported.reason), unsupported.reason); // -- the any-approver predicate (the early-warning leg's) ------------------- - assert('an-approval-is-an-approval', approvalVerdict(approved('hotlong')).state === 'approved'); + assert('an-approval-is-an-approval', approvalVerdict(approved('os-zhuang')).state === 'approved'); assert('no-reviews-at-all-is-unapproved', approvalVerdict([]).state === 'unapproved'); assert('a-COMMENTED-review-is-not-an-approval', approvalVerdict([{ state: 'COMMENTED', user: { login: 'a' } }]).state === 'unapproved'); // ⭐ The fail-open direction a naive `.some(r => r.state === 'APPROVED')` gets @@ -1477,7 +1483,13 @@ export async function selfTest() { // approval counts on whichever commit it was left, and every way an approval // never counted still never counts. The first three cases are the ones that // used to assert the opposite; they are flips, not additions. - assert('the-authorized-set-is-the-two-carried-accounts', GOVERNED_APPROVERS.join() === 'os-zhuang,hotlong'); + assert('the-authorized-set-is-the-one-account-of-2026-11-17', GOVERNED_APPROVERS.join() === 'os-zhuang'); + { + // The account 2026-11-17 removed (「hotlong 从批准账户中去掉,只保留 os-zhuang」): its approval alone no longer counts. + const retired = authorizedApprovalVerdict([approvedAt('hotlong', HEAD)]); + assert('⛔ a-head-approved-ONLY-by-the-account-removed-2026-11-17-is-UNAPPROVED', + !GOVERNED_APPROVERS.includes('hotlong') && retired.state === 'unapproved' && retired.unauthorizedApprovers.join() === 'hotlong', JSON.stringify(retired)); + } for (const login of GOVERNED_APPROVERS) { assert(`an-authorized-approval-counts: ${login}`, authorizedApprovalVerdict([approvedAt(login, HEAD)]).state === 'approved'); } @@ -1499,12 +1511,12 @@ export async function selfTest() { ); assert( 'a-DISMISSED-authorized-approval-never-counts', - authorizedApprovalVerdict([approvedAt(GOVERNED_APPROVERS[1], HEAD), { state: 'DISMISSED', user: { login: GOVERNED_APPROVERS[1] }, commit_id: HEAD }]).state === 'unapproved', + authorizedApprovalVerdict([approvedAt(GOVERNED_APPROVERS[0], HEAD), { state: 'DISMISSED', user: { login: GOVERNED_APPROVERS[0] }, commit_id: HEAD }]).state === 'unapproved', ); assert('no-reviews-at-all-is-unapproved-under-the-authorized-predicate-too', authorizedApprovalVerdict([]).state === 'unapproved'); assert( 'an-unauthorized-approval-does-not-mask-an-authorized-one', - authorizedApprovalVerdict([approvedAt('not-authorized', HEAD), approvedAt(GOVERNED_APPROVERS[1], HEAD)]).approvers.join() === GOVERNED_APPROVERS[1], + authorizedApprovalVerdict([approvedAt('not-authorized', HEAD), approvedAt(GOVERNED_APPROVERS[0], HEAD)]).approvers.join() === GOVERNED_APPROVERS[0], ); assert( 'an-authorized-approval-on-an-UNPARSABLE-commit_id-counts-too-nothing-reads-a-sha-any-more', @@ -1514,7 +1526,7 @@ export async function selfTest() { 'only-DECISIVE-states-carry-a-decision-COMMENTED-and-PENDING-are-not-approvals', authorizedApprovalVerdict([ { state: 'COMMENTED', user: { login: GOVERNED_APPROVERS[0] } }, - { state: 'PENDING', user: { login: GOVERNED_APPROVERS[1] } }, + { state: 'PENDING', user: { login: GOVERNED_APPROVERS[0] } }, ]).state === 'unapproved', );