Skip to content

Commit 543b3d1

Browse files
fix(pm): drop the cross-account review rule — the queue guard accepts a same-account Tier S record again, and contract-review.md stops requiring Reviewed-by-account (#25585)
<!-- claude-projects-attribution: {"github_login":"os-elon-musk"} --> _Requested by **Elon** · [project thread](https://claude.ai/code/project/chan_01WedDzV26nniwxv7jC88B9D?thread=cmsg_01WedDzV26nniwxv7jC88B9DBL6AwZ2QMFJXP8AgTHhhKF)_ Fixes #25568 Clause-②: no Metadata-protocol: none ## 维护者速读(草稿) - **改了什么**:按您 2026-10-24 01:16 的话「守卫在合并队列里只认「另一账户复审」,这个没必要,去掉这条规则」「立skills卡」,把「项目线程 Tier S 的复审记录须来自 PR 作者以外的账户」这条规则整条去掉,执行与文本一起。① 队列守卫 `scripts/pm/check-governed-queue-guard.mjs` 回退 #25436 加的账户支路:`accountIndependence`、`not-independent` 拒绝(exit 3)、拒绝与放行文案里的账户行、attribution 接线、头部段落与该自测电池(floor 28 → 27);另加一条回归用例,钉住「同账户记录放行,不比对也不打印账户」。② `scripts/pm/record-recognisers.mjs` 回退 `readReviewedByAccount`、`readAttributionLogin`、`REVIEWED_BY_ACCOUNT_LINE` 与定位器的 `account` 字段(floor 13 → 12),全仓无其它调用方。③ 规则文 `contract-review.md` 删六行:「须属 PR 作者外的账户」「`Reviewed-by-account:` 行」「散文面同欠另一账户一条 `TIER_DEFAULT` 记录」「① 在项目席另加…队列守卫同判」与「过渡」两行(55 → 49 行)。会话独立性(`Implemented-by:` ≠ `Reviewed-by:`)不属于这条规则,保留。 - **为什么改**:您的原话(卡 #25568 正文、PR #25552 评论 6378076465)。每个项目一个账户,项目线程的复审记录必然同账户;#25436 于 2026-10-24 00:25Z 合入后,三条车道的项目线程 Tier S PR 全部过不了合并队列,首例 #25552 于 00:44Z 被踢出(run 40046346946),退回 draft。 - **风险与代价(含回滚)**:守卫回到 #25436 之前的判定:Tier S 记录只看档位(`Served-tier: CONTRACT_REVIEW_TIER`、当前 head、`Reviewed-by:`)与 CI 全绿。两脚本的改动是 #25436 的干净反向补丁(对 #25436 前一提交 `git diff` 为零)加一条用例;规则文净减 6 行,棘轮上限 60 不动(headroom 11,席位可另行下调)。回滚 = revert 本 PR。Tier H 人批、3000 行人工合并线与复审记录的其它要求都不动。「散文面同欠 `TIER_DEFAULT` 记录」一行随规则一起删:它在 #25422 里只为「另一账户」服务,删后散文面回到 #25422 之前的读法(派发席 ACCEPT 逐句核)。 - **席位意见**:(席位填) - **你要做的(一个动作)**:无。本 PR 为 Tier S(仅 `.claude/**` 一处命中),席位复核 PASS、CI 全绿后按您 2026-10-23 14:14Z 在席位线程的长期授权落地;merge_group 检出的是合并组提交,由本 PR 自带的新守卫判定。若仍被踢出,席位会来请您从批准账户 Approve 一次。合入后 #25552 由席位重新 ready、入队。 ## What changed | File | Change | |:--|:--| | `scripts/pm/check-governed-queue-guard.mjs` | The #25436 account leg is reverted hunk for hunk: `accountIndependence`, the `not-independent` record state and its exit-3 refusal, `independenceRefusalLines`, the `accounts compared` clear line, the `attributionLogin` recogniser wiring, the header paragraph, and the account-independence self-test battery (10 cases; `SELF_TEST_BATTERY_FLOOR` 28 → 27). `recordVerdict` takes no `attribution` again. One assertion is added to the existing Tier S battery: a project-thread PR (body carries the attribution login) whose record was written from the SAME account — the record even still carries a `Reviewed-by-account:` line naming that login — CLEARS, `record.state === 'stands'`, and the rendering prints no account comparison. Self-test: 335 cases pass (344 before, minus the 10 removed, plus this one). | | `scripts/pm/record-recognisers.mjs` | `readReviewedByAccount`, `readAttributionLogin`, `REVIEWED_BY_ACCOUNT_LINE`, the locator's `account` field and the #25415 battery are removed (7 cases; floor 13 → 12). `git grep` over the whole tree finds no other caller of any of them. Self-test: 201 cases pass (208 before). `--template` never printed an account line, so the copyable record is unchanged. | | `.claude/skills/pm-dispatch/references/contract-review.md` | Six lines deleted (55 → 49; ceiling 60): the Tier S other-account requirement, the `Reviewed-by-account:` line, the prose-face `TIER_DEFAULT`-from-another-account record, the 「① 在项目席另加 … 队列守卫同判」 condition, and the two-line 「过渡」 substitute (moot once ① owes no second account). The session-independence line (`Implemented-by:` ≠ `Reviewed-by:`) stays, as do 「轮次报告设复审清单专节」 and 「落地前检两条」. | After the edit, `git grep -n 'Reviewed-by-account\|另一账户\|25415' -- .claude scripts` names nothing; a whole-tree grep for the same words and for the removed symbol names names nothing either. The prose-face `TIER_DEFAULT` line goes with the rule: #25422 added it only as the vehicle for the other account's review, and without the account requirement the prose face falls back to the reading the file already states (the dispatching seat's ACCEPT, sentence by sentence against the diff). Not in scope, unchanged: the Tier H landing leg (authorized approval), the human-merge size line, the record shape otherwise, and every Tier H file. ## Acceptance (card #25568) - `node scripts/pm/check-governed-queue-guard.mjs --self-test`: exit 0, 335 cases. `node scripts/pm/record-recognisers.mjs --self-test`: exit 0, 201 cases. - `pnpm check:pm-skill-ratchet`, `pnpm check:pm-skill-id-lint`, `pnpm check:skill-frame-sync`, `pnpm check:skill-frame-freshness`: all exit 0. Ratchet row for `contract-review.md`: 49 lines, ceiling 60, headroom 11. - Same-account Tier S record on a project-thread PR reads CLEAR, two readings: (a) the new self-test assertion above, on the tier harness; (b) a one-off replay (not committed) of PR #25552 itself — its nine paths, head `c9dae4256c4ed54964695bf0ec8ce9354a1a8f83`, the body attribution `os-elon-musk`, and the key lines of record 6377468190 verbatim including `Reviewed-by-account: os-elon-musk` — driven through `runGuard` on `merge_group`: `exitCode = 0`, `record.state = stands`, no `independence` field. On `main` the same record was refused (run 40046346946: 「written from the SAME account that built the pull request」). - Ablation (one-off, restored byte-identical afterwards): re-applying the #25436 hunks on top of this branch reds the new assertion (`state: not-independent`, `independence.state: same-account`; 1 of 345 cases failed), so the assertion measures the leg and not itself. ## Gates `node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack --paths` (the three paths) derived 42 families (23 pnpm, 19 direct node; 32 matched by path, 2 by change kind, 8 whole-tree). Every command was run with the capture idiom and its exit code recorded beside it; `--ran` reconciles **42 derived, 42 run, 0 NOT-MEASURED, 0 UNRUN**. One family, `pnpm --filter @objectstack/lint run check:doc-formula-expressions`, exited 3 (prerequisite not met: `@objectstack/formula` and `@objectstack/lint` unbuilt in a fresh install) on the first pass and 0 after `pnpm exec turbo run build --filter=@objectstack/formula --filter=@objectstack/lint`. Not measurable locally and left to CI, as the tool prints them: `check-closing-target-claim`, `check-shard-attestation`, `check-test-completeness` (values from the workflow), the Test Core shard job, and the 16 changeset-scoped families (no changeset: `skip-changeset`). `node scripts/pm/check-governed-merges.mjs --test` on the three paths: GOVERNED, Tier S — `.claude/**` ×1 (`contract-review.md`); the two scripts are off the register. Size 24 additions / 264 deletions, far under the 3000-line human-merge line. `skip-changeset` declared on the `pr_create` stroke: `.claude/**` and `scripts/pm/**` ship in no published package. --- _Generated by [Claude Code](https://claude.ai/code/session_018UunQYGRd5yu6puARCJBk9)_ Co-authored-by: Claude <noreply@anthropic.com>
1 parent ea6fe00 commit 543b3d1

3 files changed

Lines changed: 24 additions & 264 deletions

File tree

‎.claude/skills/pm-dispatch/references/contract-review.md‎

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,8 @@
3333
只读条款与输入集内建,⛔ 不删 ⛔ 行。
3434
- 隔离复核子代理暂存全写按所审 PR 命名的 `<scratchpad>/pr-<n>/`,⛔ 不读非本轮自写的暂存。
3535
- 独立性对:`Implemented-by:`/`Reviewed-by:` 取值同见 `--template`;子代理记采纳它的席位。
36-
- 项目席落地的 Tier S:`Reviewed-by:` 须属 PR 作者外的账户;同账户子代理只算复核。
37-
- 作者账户 = PR 正文 attribution 的 `github_login`;记录另带 `Reviewed-by-account:` 行写复核账户。
38-
- 只动散文面、不欠契约复核的 PR 同欠另一账户一条 `TIER_DEFAULT` 记录;⛔ 散文面无豁免。
3936
- 轮次报告设复审清单专节,与呈裁清单同为强制审计。
4037
- 落地前检两条,过则 Tier S 入队、Tier H 等人批:① 达档条款②复核 PASS 在案(同形记录)。
41-
- ① 在项目席另加:`Reviewed-by-account:` 的登录须异于 PR attribution 的登录,队列守卫同判。
42-
- 过渡:无另一账户在席时,① 的替代 = 维护者本人在执行线程的话:逐个点名 PR 编号,
43-
或对该席位的 Tier S 长期授权(一句可撤)。
4438
- 例外:纯重生成或只动上列散文面的 head 后移原记录继续管;判据机读已提交树;
4539
PR 落 `Regen-provenance:` 行。
4640
- ② PR check 全绿,⛔ 非 required 子集;例外:merge-base 同签名的红不计、按设计而红见 SKILL.md。

‎scripts/pm/check-governed-queue-guard.mjs‎

Lines changed: 23 additions & 178 deletions
Original file line numberDiff line numberDiff line change
@@ -266,15 +266,6 @@
266266
* record IS one (#18060). Every governed path outside Tier S is Tier H, the
267267
* rules layer, and keeps the predicate above byte-for-byte.
268268
*
269-
* ⚖️ AND, ON A PULL REQUEST BUILT IN A PROJECT THREAD, FROM ANOTHER ACCOUNT
270-
* (#25415, maintainer 2026-10-23). The relay authors every PR and comment as
271-
* `objectstack-fleet[bot]`, so the only place a project-thread PR names its
272-
* account is its body's `claude-projects-attribution` line. When that line is
273-
* there, the record must also carry `Reviewed-by-account:` naming a DIFFERENT
274-
* login (`accountIndependence`); same, missing or unreadable refuses, and the
275-
* refusal and the clear both print the two logins compared. A body without the
276-
* line (a Routine seat, a human) owes nothing here — today's reading unchanged.
277-
*
278269
* ⭐ THE TWO CARRIERS ARE ONE DELIVERY, and the location is the governed text's
279270
* to decide rather than this file's — quoted, untranslated, because it IS the
280271
* criterion: 「复核记录 = 一条评论落 PR 或卡」
@@ -569,7 +560,6 @@ const SELF_TEST_BATTERIES = Object.freeze({
569560
'the per-row repository scope (ruling B2, 2026-10-13)': 14,
570561
'⭐ B′ with C: the record stands at the tier its FACE maps to, read off the committed paths': 8,
571562
'the CODEOWNERS mirror: every Tier H register row routes to every GOVERNED_APPROVERS account, nothing else is routed, and the file says so': 12,
572-
'⭐ #25415: an attributed pull request lands on a review of record from ANOTHER account': 10,
573563
});
574564

575565
// DELETING an entry silences that battery's floor exactly as effectively as
@@ -579,8 +569,7 @@ const SELF_TEST_BATTERIES = Object.freeze({
579569
// Raised 23 → 24 with the queued pull-back battery: one battery, one row.
580570
// Raised 25 → 26 with the B′-with-C face battery (ruling record 6159870311): one battery, one row.
581571
// Raised 26 → 27 with the CODEOWNERS mirror battery: one battery, one row.
582-
// Raised 27 → 28 with the #25415 account-independence battery: one battery, one row.
583-
const SELF_TEST_BATTERY_FLOOR = 28;
572+
const SELF_TEST_BATTERY_FLOOR = 27;
584573

585574
// The key an assertion is filed under when no battery is open. It is not a
586575
// declared battery, so it reds by the same set difference rather than silently
@@ -826,12 +815,11 @@ export async function loadRecordRecognisers(load = (specifier) => import(specifi
826815
servedTierStands: tier?.servedTierStands,
827816
isModelIdentifierToken: tier?.isModelIdentifierToken,
828817
reviewFace: tier?.reviewFace,
829-
attributionLogin: tier?.readAttributionLogin,
830818
threads: tier?.REVIEW_OF_RECORD_THREADS,
831819
location: tier?.REVIEW_OF_RECORD_LOCATION,
832820
};
833821
const missing = [
834-
...['locate', 'deliveredCard', 'servedTierStands', 'isModelIdentifierToken', 'reviewFace', 'attributionLogin'].filter((key) => typeof found[key] !== 'function'),
822+
...['locate', 'deliveredCard', 'servedTierStands', 'isModelIdentifierToken', 'reviewFace'].filter((key) => typeof found[key] !== 'function'),
835823
...(Array.isArray(found.threads) && found.threads.length > 0 ? [] : ['threads']),
836824
...(typeof found.location === 'string' && found.location.length > 0 ? [] : ['location']),
837825
];
@@ -896,7 +884,7 @@ export async function loadRecordRecognisers(load = (specifier) => import(specifi
896884
* and the rule cannot drift. ⛔ A pair that carries no path list cannot say
897885
* which face it is on: UNREADABLE, never the cheaper tier.
898886
*/
899-
export function recordVerdict({ pair, recognisers, cardNote = null, attribution = { state: 'absent' } }) {
887+
export function recordVerdict({ pair, recognisers, cardNote = null }) {
900888
if (recognisers?.available !== true) {
901889
return { state: 'unreadable', reason: recognisers?.reason ?? 'the contract-review recognisers were not loaded', cardNote };
902890
}
@@ -956,41 +944,7 @@ export function recordVerdict({ pair, recognisers, cardNote = null, attribution
956944
};
957945
if (located.state === 'unsigned') return { state: 'unsigned', ...found };
958946
if (!recognisers.servedTierStands(located.served, face.tierName)) return { state: 'below-tier', ...found };
959-
if (attribution?.state === 'unreadable' && attribution.reason) {
960-
return { state: 'unreadable', cardNote, reason: attribution.reason };
961-
}
962-
const independence = accountIndependence(attribution, located.account);
963-
if (independence.state !== 'holds' && independence.state !== 'not-owed') return { state: 'not-independent', ...found, independence };
964-
return { state: 'stands', ...found, independence };
965-
}
966-
967-
/**
968-
* Was the review of record written from a DIFFERENT ACCOUNT than the one the
969-
* pull request was built under? (#25415, maintainer 2026-10-23.)
970-
*
971-
* A pull request landed from a Claude project thread carries its authoring
972-
* account in the body's attribution line and nowhere else — the relay authors
973-
* every PR and comment as `objectstack-fleet[bot]`, so neither `Reviewed-by:`
974-
* (a session) nor the comment author can tell two accounts apart. So when the
975-
* body names an account, the record must name its reviewer's account on a
976-
* `Reviewed-by-account:` line, and the two must differ; a same-account
977-
* subagent's review is a review, not an independent one.
978-
*
979-
* ⭐ A pull request with NO attribution line (a Routine seat, a human) owes
980-
* nothing here: `not-owed`, today's behaviour byte for byte. ⛔ Everything else
981-
* that is not a readable, different login is a refusal — an unreadable
982-
* attribution, a missing or unreadable account line, or the same login (GitHub
983-
* logins compare case-insensitively).
984-
*/
985-
export function accountIndependence(attribution, account) {
986-
if (!attribution || attribution.state === 'absent') return { state: 'not-owed' };
987-
if (attribution.state !== 'read') return { state: 'attribution-unreadable', line: attribution.line ?? null };
988-
const author = attribution.login;
989-
if (account?.state === 'unreadable') return { state: 'account-unreadable', author, line: account.line };
990-
if (account?.state !== 'read') return { state: 'account-missing', author };
991-
const reviewer = account.login;
992-
if (author.toLowerCase() === reviewer.toLowerCase()) return { state: 'same-account', author, reviewer };
993-
return { state: 'holds', author, reviewer };
947+
return { state: 'stands', ...found };
994948
}
995949

996950
/**
@@ -1309,41 +1263,6 @@ export function guardVerdict({ event, repo, governed = [], unattributed = [], ap
13091263
return { ...base, conclusion: 'cleared', exitCode: EXIT_CLEAR, refusalKind: null };
13101264
}
13111265

1312-
/**
1313-
* The refusal for a record that stands on tier but not on account (#25415):
1314-
* it names both logins it compared (or the one it could read) and the rule.
1315-
*/
1316-
function independenceRefusalLines(record) {
1317-
const ind = record.independence ?? {};
1318-
const at = `comment ${record.id ?? '(no readable id)'}, ${record.at ?? 'undated'}`;
1319-
const rule = [
1320-
' Rule (#25415, maintainer 2026-10-23): a pull request landed from a project thread lands on a review of record',
1321-
' from ANOTHER account — add `Reviewed-by-account: LOGIN` to the record, LOGIN being the reviewing session\'s',
1322-
' account and different from the PR body\'s `claude-projects-attribution` github_login.',
1323-
];
1324-
if (ind.state === 'same-account') {
1325-
return [
1326-
` ⛔ the review of record on this head (${at}) was written from the SAME account that built the pull request:`,
1327-
` attribution \`${ind.author}\` = Reviewed-by-account \`${ind.reviewer}\`. A same-account review is a review, not an independent one.`,
1328-
...rule,
1329-
];
1330-
}
1331-
if (ind.state === 'account-missing' || ind.state === 'account-unreadable') {
1332-
return [
1333-
` ⛔ the review of record on this head (${at}) names no reviewer ACCOUNT the guard can compare against the attribution \`${ind.author}\`:`,
1334-
ind.state === 'account-missing'
1335-
? ' it carries NO `Reviewed-by-account:` line.'
1336-
: ` its \`Reviewed-by-account:\` line carries no single GitHub login (${ind.line}).`,
1337-
...rule,
1338-
];
1339-
}
1340-
return [
1341-
` ⛔ the pull request body carries a \`claude-projects-attribution\` line whose github_login cannot be read (${ind.line ?? 'no line quoted'}),`,
1342-
' so the account the record must differ from is unknown.',
1343-
...rule,
1344-
];
1345-
}
1346-
13471266
/**
13481267
* The words a reader gets. Requirement (e) of the card lives here: every
13491268
* rendering names the exact paths that matched and states what would satisfy
@@ -1476,12 +1395,6 @@ export function renderGuardVerdict(verdict) {
14761395
(entry.record.served?.stamps
14771396
? ` on a stamp control of ${entry.record.served.stamps.atTier}/${entry.record.served.stamps.total}.`
14781397
: ' (no stamp control declared, which the rule permits).'),
1479-
...(entry.record.independence?.state === 'holds'
1480-
? [
1481-
` ⭐ accounts compared (#25415): built under \`${entry.record.independence.author}\` (the PR body's attribution line), ` +
1482-
`reviewed under \`${entry.record.independence.reviewer}\` (\`Reviewed-by-account:\`) — different accounts, so it is independent.`,
1483-
]
1484-
: []),
14851398
...(entry.record.carriedFrom
14861399
? [
14871400
` ⭐ that record names head \`${String(entry.record.carriedFrom).slice(0, 12)}\`, carried forward over ` +
@@ -1521,8 +1434,6 @@ export function renderGuardVerdict(verdict) {
15211434
]
15221435
: entry.record.state === 'unreadable'
15231436
? [` ⛔ the review of record could NOT be read — ${entry.record.reason}`]
1524-
: entry.record.state === 'not-independent'
1525-
? independenceRefusalLines(entry.record)
15261437
: entry.record.state === 'unsigned'
15271438
? [
15281439
` ⛔ a \`## Contract review\` comment names this head (comment ${entry.record.id ?? '(no readable id)'}, ` +
@@ -1854,12 +1765,7 @@ export async function runGuard({ event, repo, rows, fetchReviews, fetchPull, fet
18541765
records.set(entry.pr, { state: 'unreadable', reason: unreadable, cardNote });
18551766
continue;
18561767
}
1857-
// ⭐ The authoring account, off the body this guard already read (#25415).
1858-
// A row that could not be read cannot say whether one is owed: unreadable.
1859-
const attribution = pull
1860-
? recognisers.attributionLogin(pull.body)
1861-
: { state: 'unreadable', reason: `PR #${entry.pr}'s body could not be read, so whether its record owes a second account is unknown` };
1862-
records.set(entry.pr, recordVerdict({ pair, recognisers, cardNote, attribution }));
1768+
records.set(entry.pr, recordVerdict({ pair, recognisers, cardNote }));
18631769
}
18641770
}
18651771
return guardVerdict({ event, repo, governed, unattributed, approvals, records, apiCalls, headNotes, lifted });
@@ -4245,6 +4151,24 @@ export async function selfTest() {
42454151
tierPass.exitCode === EXIT_CLEAR && tierPass.conclusion === 'cleared' && tierPass.entries[0].record.state === 'stands',
42464152
JSON.stringify(tierPass.entries[0].record),
42474153
);
4154+
// ⭐ Maintainer 2026-10-24 (「守卫在合并队列里只认「另一账户复审」,这个没必要,去掉这条规则」):
4155+
// the record stands on TIER ALONE. A project-thread pull request (its body
4156+
// carries the `claude-projects-attribution` login) whose record was written
4157+
// from the SAME account — even one still carrying a `Reviewed-by-account:`
4158+
// line naming that login — clears, and no account is compared or printed.
4159+
// This case is what keeps the retired account leg retired.
4160+
const sameAccountRecord = recordComment();
4161+
sameAccountRecord.body = sameAccountRecord.body.replace('Reviewed-by: `session_01SEAT`', 'Reviewed-by: `session_01SEAT`\nReviewed-by-account: `lane-account-a`');
4162+
const sameAccount = await tierRun({
4163+
prBody: `<!-- claude-projects-attribution: {"github_login":"lane-account-a"} -->\n_Requested by **Elon**_\n\nFixes #${REF_CARD}`,
4164+
comments: [sameAccountRecord],
4165+
});
4166+
assert(
4167+
'a-project-thread-PR-whose-record-was-written-from-the-SAME-account-PASSES-the-record-stands-on-tier-alone',
4168+
sameAccount.exitCode === EXIT_CLEAR && sameAccount.conclusion === 'cleared' && sameAccount.entries[0].record.state === 'stands' &&
4169+
!/Reviewed-by-account|accounts compared|SAME account/.test(renderGuardVerdict(sameAccount)),
4170+
JSON.stringify(sameAccount.entries[0].record),
4171+
);
42484172
// ⭐ #19133, end to end: the generalised tier. An agents + settings diff lands
42494173
// on the same record — and its lit control, the same diff with NO record, is
42504174
// refused (the card's own acceptance line).
@@ -4328,85 +4252,6 @@ export async function selfTest() {
43284252
// live leg is pinned at the contract-review tier; `recordVerdict` is pure, so
43294253
// the declaration face — which no governed entry can be on — is driven on it
43304254
// directly, with the real recognisers.
4331-
battery('⭐ #25415: an attributed pull request lands on a review of record from ANOTHER account');
4332-
{
4333-
const ATTRIBUTED = (login) => `<!-- claude-projects-attribution: {"github_login":"${login}"} -->\n_Requested by **Elon**_\n\nFixes #${REF_CARD}`;
4334-
const withAccount = (login) => {
4335-
const c = recordComment();
4336-
return { ...c, body: `${c.body.replace('Reviewed-by: `session_01SEAT`', `Reviewed-by: \`session_01SEAT\`\nReviewed-by-account: \`${login}\``)}` };
4337-
};
4338-
const plain = await tierRun({ comments: [recordComment()] });
4339-
assert(
4340-
'an-UNATTRIBUTED-PR-keeps-todays-behaviour-the-record-stands-and-no-account-is-owed',
4341-
plain.exitCode === EXIT_CLEAR && plain.entries[0].record.state === 'stands' && plain.entries[0].record.independence.state === 'not-owed' &&
4342-
!/accounts compared/.test(renderGuardVerdict(plain)),
4343-
JSON.stringify(plain.entries[0].record.independence),
4344-
);
4345-
const differ = await tierRun({ prBody: ATTRIBUTED('lane-account-a'), comments: [withAccount('lane-account-b')] });
4346-
const differText = renderGuardVerdict(differ);
4347-
assert(
4348-
'an-attributed-PR-whose-record-names-a-DIFFERENT-account-PASSES-and-the-clear-prints-both-logins',
4349-
differ.exitCode === EXIT_CLEAR && differ.entries[0].record.state === 'stands' && differ.entries[0].record.independence.state === 'holds' &&
4350-
/accounts compared/.test(differText) && differText.includes('`lane-account-a`') && differText.includes('`lane-account-b`'),
4351-
JSON.stringify(differ.entries[0].record.independence),
4352-
);
4353-
const same = await tierRun({ prBody: ATTRIBUTED('lane-account-a'), comments: [withAccount('@Lane-Account-A')] });
4354-
const sameText = renderGuardVerdict(same);
4355-
assert(
4356-
'⛔ the-SAME-account-is-REFUSED-logins-compare-case-insensitively-and-the-refusal-names-both-and-the-rule',
4357-
same.exitCode === EXIT_REFUSED_UNAPPROVED && same.entries[0].record.state === 'not-independent' &&
4358-
same.entries[0].record.independence.state === 'same-account' &&
4359-
sameText.includes('`lane-account-a`') && sameText.includes('`Lane-Account-A`') && /Reviewed-by-account: LOGIN/.test(sameText),
4360-
JSON.stringify(same.entries[0].record.independence),
4361-
);
4362-
const missing = await tierRun({ prBody: ATTRIBUTED('lane-account-a'), comments: [recordComment()] });
4363-
assert(
4364-
'⛔ an-attributed-PR-whose-record-carries-NO-Reviewed-by-account-line-is-REFUSED',
4365-
missing.exitCode === EXIT_REFUSED_UNAPPROVED && missing.entries[0].record.independence.state === 'account-missing' &&
4366-
/carries NO `Reviewed-by-account:` line/.test(renderGuardVerdict(missing)),
4367-
JSON.stringify(missing.entries[0].record.independence),
4368-
);
4369-
const prose = await tierRun({ prBody: ATTRIBUTED('lane-account-a'), comments: [withAccount('the other account')] });
4370-
assert(
4371-
'⛔ a-Reviewed-by-account-line-that-is-not-ONE-login-is-REFUSED',
4372-
prose.exitCode === EXIT_REFUSED_UNAPPROVED && prose.entries[0].record.independence.state === 'account-unreadable',
4373-
JSON.stringify(prose.entries[0].record.independence),
4374-
);
4375-
const botAccount = await tierRun({ prBody: ATTRIBUTED('lane-account-a'), comments: [withAccount('objectstack-fleet[bot]')] });
4376-
assert(
4377-
'⛔ the-relay-BOT-is-no-reviewer-account-REFUSED',
4378-
botAccount.exitCode === EXIT_REFUSED_UNAPPROVED && botAccount.entries[0].record.independence.state === 'account-unreadable',
4379-
);
4380-
const badAttr = await tierRun({ prBody: `<!-- claude-projects-attribution: {"github_login":""} -->\n\nFixes #${REF_CARD}`, comments: [withAccount('lane-account-b')] });
4381-
assert(
4382-
'⛔ an-attribution-line-naming-NO-readable-login-is-REFUSED-never-read-as-unattributed',
4383-
badAttr.exitCode === EXIT_REFUSED_UNAPPROVED && badAttr.entries[0].record.independence.state === 'attribution-unreadable',
4384-
JSON.stringify(badAttr.entries[0].record.independence),
4385-
);
4386-
const lower = await tierRun({ prBody: `Fixes #${REF_CARD}\n\n${ATTRIBUTED('lane-account-a')}`, comments: [withAccount('lane-account-a')] });
4387-
assert(
4388-
'⛔ the-attribution-line-is-read-on-ANY-line-an-edit-above-it-does-not-switch-the-check-off',
4389-
lower.exitCode === EXIT_REFUSED_UNAPPROVED && lower.entries[0].record.independence.state === 'same-account',
4390-
);
4391-
const approvedSame = await tierRun({
4392-
prBody: ATTRIBUTED('lane-account-a'),
4393-
reviews: [{ state: 'APPROVED', user: { login: GOVERNED_APPROVERS[0] }, commit_id: REF_HEAD }],
4394-
comments: [withAccount('lane-account-a')],
4395-
});
4396-
assert(
4397-
'MONOTONE: an-authorized-approval-still-clears-an-attributed-PR-the-account-leg-is-never-consulted',
4398-
approvedSame.exitCode === EXIT_CLEAR && approvedSame.entries[0].approval.state === 'approved' && tierThreadsRead.length === 0,
4399-
JSON.stringify({ code: approvedSame.exitCode, threads: tierThreadsRead }),
4400-
);
4401-
assert(
4402-
'the-pure-reading-attribution-absent-is-not-owed-and-nothing-else-is',
4403-
accountIndependence({ state: 'absent' }, { state: 'missing' }).state === 'not-owed' &&
4404-
accountIndependence(undefined, { state: 'missing' }).state === 'not-owed' &&
4405-
accountIndependence({ state: 'read', login: 'a' }, { state: 'read', login: 'b' }).state === 'holds' &&
4406-
accountIndependence({ state: 'read', login: 'a' }, { state: 'read', login: 'A' }).state === 'same-account',
4407-
);
4408-
}
4409-
44104255
battery('⭐ B′ with C: the record stands at the tier its FACE maps to, read off the committed paths');
44114256
const { TIER_DEFAULT_NAME: DEFAULT_TOKEN, TIER_DEFAULT: DEFAULT_VALUE } = await import('./dispatch-gates.mjs');
44124257
const tierDefaultOnS = await tierRun({ comments: [recordComment({ tierLine: `Served-tier: 75/75 \`${DEFAULT_TOKEN}\`` })] });

0 commit comments

Comments
 (0)