Commit 1297178
fix(agents,gates): the merge queue blocks on seven contexts, and a set-stating surface is now a census (#18244)
Fixes #17798
`AGENTS.md`'s merge-queue paragraph named SIX required contexts and
called everything else "advisory and rides through". The live ruleset
has SEVEN — `Governed Surface Queue Guard`, enrolled 2026-08-27 (#12427)
and pinned in `REQUIRED_CONTEXTS` by #15233. The sentence a review seat
acts on therefore classified the one gate that refuses a zero-review
governed PR as advisory, which is verbatim the incident shape that guard
exists to prevent.
Nothing reddened on it, and that is the half worth fixing. `mustName` is
a FLOOR: it reds when a listed literal goes stale and is blind to one
going MISSING. So the registry grew, every surface's list stayed legal,
every gate stayed green, and the sentence stayed behind. The same
misclassification has now landed twice — 2 to 6 by the #9677 ruling, 6
to 7 here.
## 维护者速读(草稿)
**改了什么。** 两处。一、`AGENTS.md` 的合并队列段落从「六个必需上下文」改成七个,把第七个 `Governed Surface
Queue Guard` 写进名单(等行数改写,1075
行没动)。二、`scripts/check-required-contexts.mjs` 的 `INSTRUCTION_SURFACES`
增加一个 `statesTheSet`
声明:声明了它的文件,其名单必须与注册表**逐个且等长**地对上。注册表本身(`REQUIRED_CONTEXTS`)一行未动,那是
#15233 的面。
**为什么改。** 这句话不是描述,是审核席翻 ready / 挂 auto-merge / 入队前照着做的操作指令。它把治理面守卫说成
advisory,而那个守卫的职责恰恰是拒掉零审查的治理 PR —— #12427 的事故形态。更关键的是:上一次入列(#15233
加第七行)时,全部门禁是绿的,没有任何东西提示这句话已经过期。同一个漏洞已经发生两次,所以这次不只是手跟一遍数字,而是把「谁陈述了整个集合」变成机器可查的:下一次(第八个)入列时,加注册行的那个
PR 自己会变红。
**风险与代价(含回滚)。** 风险低。新规则只对**显式声明** `statesTheSet: true`
的条目生效,今天是两个文件(`AGENTS.md` 与 pm-dispatch 的
`platform-readings.md`);`review-checklist.md`
被明确归类为**不陈述集合**(它点名的是审核席亲手确认的两个
job,不是集合),保留它原有的两名下限,集合变大不会误伤它。声明也不能被悄悄摘掉换取豁免:名单已覆盖整个集合却没声明的条目同样变红。代价:每次入列多一处必须同
PR 跟进的数组。回滚 = `git revert`,两个文件都是纯文本,没有生成物、没有发布面、没有数据迁移。
**席位意见。**
**你要做的。** 确认一件事:第七个上下文 `Governed Surface Queue Guard` 今天确实在 Settings
的必需集合里(卡面 2026-09-12 的实测读数是七个,本 PR 不改 Settings)。其余不需要你操作。本 PR 触及受管面
`AGENTS.md`,按 Prime Directive #14 走人工合并或已批准的队列路径。
## What changed
**1. `AGENTS.md` :505-:510 — six to seven.** The seventh name inserted,
"six" to "seven" in all three places, equal-line at the 1075 ceiling
(before 1075 / after 1075 / ceiling 1075). Each context literal is kept
whole on one line: the scan matches them contiguously, and a wrap that
split `TypeScript Type Check` across a line break made the surface red.
That is a real trap for the next hand-follow, so it is recorded here
rather than only avoided.
**2. `INSTRUCTION_SURFACES` gains `statesTheSet`.** An entry that
declares it must name the registry EXACTLY — membership *and* count:
- omitting a member reds, naming the omitted literal and the count it is
short by;
- padding past the registry length reds on the count, so a duplicate
cannot mask a member lost to a typo;
- a full list with the declaration dropped reds ("a list that covers the
whole set IS a statement of it"), so the exemption cannot be taken
silently;
- ablating every declaration reds rather than ticking (#4690).
`review-checklist.md` is classified the other way and keeps its two-name
floor: it names the two required jobs a seat confirms by hand — its own
next line sends the seat to `true-green.md` for the rest — so it never
claimed to enumerate the set, and the set growing must not red it.
**3. Ten self-test cases, battery floor 31 to 41.** The 6-of-7 omission
and its restore-leg ablation; the eighth-row enrolment end to end, plus
the hand-off where following the ARRAYS clears the census red and leaves
the naming floor demanding the PROSE; the padded duplicate; the
undeclared full list; the no-declaration floor; and the two
classification pins (which surfaces state the set, by NAME never by
count; and the checklist's partial list staying legal).
## Evidence
Baseline first, on `origin/main` `b3b43b6` in a clean worktree, BEFORE
any edit — the known pit from hold note 5651882793 (PR #17803 reported
`--self-test` red on a pre-existing `branches: [main]` filter on
`governed-surface-guard.yml`):
```
node scripts/check-required-contexts.mjs --self-test exit 0 159 assertions
node scripts/check-required-contexts.mjs exit 0 7 required context name(s) pinned across 3 workflow(s)
```
**The known pit is NOT red on `main` today.** The residual named in the
hold note is gone; the work below is measured against a green baseline,
not against a standing red.
After (`78959ab`): `--self-test` exit 0, 169 assertions; the pin exit 0.
**Reverse verification, both legs from the committed implementation,
each with its on-disk mutation proved and each restored byte-identical
(`git hash-object` vs the HEAD blob, `git diff HEAD` empty):**
| leg | mutation (proved on disk) | result |
|---|---|---|
| A — the registry array rots back | drop `'Governed Surface Queue
Guard'` from the `AGENTS.md` entry's `mustName` (grep 2 to 1; `git diff
--numstat` 0/1) | **RED**, exit 1: "declares statesTheSet: true, so its
mustName must be the required set EXACTLY — it lists 6 name(s) against a
registry of 7, missing 'Governed Surface Queue Guard'". Self-test exit 1
too. |
| B — the numeral alone rots back | `seven contexts block` to `six
contexts block` in `AGENTS.md`, all seven literals still listed (numstat
1/1) | **GREEN, exit 0** — reported as measured, not as expected. The
scan pins literals, never the word introducing them. Recorded as a
residual in the script header rather than implied covered. |
| B2 — the prose drops the literal | delete `` and `Governed Surface
Queue Guard` `` from the paragraph (grep 1 to 0; numstat 1/1) | **RED**,
exit 1: "AGENTS.md no longer names the required context 'Governed
Surface Queue Guard'" |
| floor control | battery floor 41 to 42 | **RED**, exit 1, naming the
exact count: "registered 41 case(s), below its pinned floor of 42" — so
the floor binds at headroom 0 and 41 is the measured count, not a number
below it |
Leg B is the honest finding of this PR: the census forces every enrolled
literal INTO the prose, so a stale numeral now sits next to a complete
list rather than a short one. Bounded, not covered; pinning the numeral
needs the arbitrary-literal recognition the script header already
measured as out of reach.
**Derived gate union**, run after the final commit, on `78959ab` (`git
rev-parse --short HEAD`), each exit captured by redirect before any
pipe:
```
node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack
-> 37 command(s) from a 2-path change set (AGENTS.md, scripts/check-required-contexts.mjs)
```
36 of 37 exit 0. The one not measured: `pnpm check:pm-dispatch-gates`
(`scripts/pm/check-dispatch-gates.mjs`) runs past this session's
foreground ceiling — it was still printing passing cases at 560s. NOT
MEASURED, reason: runtime exceeds the foreground cap; CI owns it. Its
subject matter — the `ROOT_FILE_WATCH_HINTS` declaration this file
carries — is separately green under `pnpm check:watch-hint-literal`
(exit 0) and under this script's own `the dispatch-gates declaration
(#9979)` battery (6 assertions).
`--ran` reconciliation is reported in the dev report; the
beyond-derivation families this card owes because it edits a gate script
— `check:required-contexts` and its `--self-test` — are the two green
readings above. `git grep` finds no `*.test.*` naming
`check-required-contexts.mjs`, so that script has no separate test suite
to owe.
**Lint, narrowed with the three readings that make a narrowing a
measurement:**
1. covered population read from eslint's own config, not guessed: `npx
eslint --print-config scripts/check-required-contexts.mjs` reports
exactly **2 rules enabled** for this path (`no-restricted-imports`,
`comment-swallow/no-code-inside-block-comment`); `eslint.config.mjs`
declares no markdown population at all, so `AGENTS.md` is outside the
lint verdict in either direction;
2. file count read from `--format json`: 1 file, 0 errors, 0 warnings;
3. invariance for untouched files: this repo runs one
`eslint.config.mjs` which **never enables type-aware linting for any
file** (no `parserOptions.project`, no typed rules — `eslint.config.mjs`
:326-:329, with its own positive-control measurement recorded there), so
this diff cannot move any untouched file's verdict.
The repo-wide `pnpm lint` scan is CI's run.
**`skip-changeset`, measured rather than asserted:** both paths lie
outside every package directory, and of the 70 published packages none
has a `files[]` entry escaping its own directory (0 entries starting
with `../` or `/`). Nothing published moves.
## Acceptance notes
Out of scope, noted, not filed:
- **`.claude/skills/pm-dispatch/references/platform-readings.md`
:385-:386 becomes FALSE when this lands.** It reads 「⭐ 本表的 `mustName`
不要求排他 ⇒ 第七个加注册行不会让本表变红」 and 「⇒ ⛔ 门绿不是本行已对的读数:计数行只能手跟改」. After this PR
that entry declares `statesTheSet: true` and the registry growing DOES
red it, so a seat reading those two lines would keep hand-following a
line the gate now holds. Not fixed here: the file is outside this card's
declared REGION claim (`AGENTS.md` :505-:510 plus this script), and the
script's own header records `.claude/skills/pm-dispatch/**` as a surface
a dev seat may not edit — the reason the checklist half of #9325 was its
own card. **Successor: the `domain:skills` seat, in its own lane.**
Dedupe words: `platform-readings`, `mustName 不要求排他`, `计数行只能手跟改`,
`statesTheSet`, `required contexts 的名单`.
- The count WORD in a set-stating surface stays hand-followed (leg B
above). Recorded as a residual in the script header, in the paragraph
that already records the paraphrase-drift and shortening-rename
residuals. No card: it is bounded by the census and closing it needs
recognition the header measured as out of reach.
- The triage grading comment 5651027386, which this card's acceptance is
quoted from, answers **HTTP 404** — it is not on #17798 (the card
carries exactly 3 comments) and the direct comment endpoint does not
find it. Its content survives verbatim inside hold note 5651882793 and
in this dispatch's own text, which is what acceptance items 1, 2 and 4
were read from here. Recorded as NOT MEASURED against the primary
source, not as "no flags".
Nothing else was touched. `REQUIRED_CONTEXTS` is byte-identical to
`origin/main`.
---
_Generated by [Claude
Code](https://claude.ai/code/session_01HZfg2AwVX191qCizp88gQr)_
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent 1a02ef1 commit 1297178
2 files changed
Lines changed: 201 additions & 25 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
502 | 502 | | |
503 | 503 | | |
504 | 504 | | |
505 | | - | |
506 | | - | |
507 | | - | |
508 | | - | |
509 | | - | |
510 | | - | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
511 | 511 | | |
512 | 512 | | |
513 | 513 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
226 | 226 | | |
227 | 227 | | |
228 | 228 | | |
229 | | - | |
| 229 | + | |
230 | 230 | | |
231 | 231 | | |
232 | 232 | | |
| |||
505 | 505 | | |
506 | 506 | | |
507 | 507 | | |
508 | | - | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
509 | 516 | | |
510 | 517 | | |
511 | 518 | | |
512 | 519 | | |
513 | | - | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
514 | 528 | | |
515 | 529 | | |
516 | 530 | | |
| |||
531 | 545 | | |
532 | 546 | | |
533 | 547 | | |
534 | | - | |
535 | | - | |
536 | | - | |
537 | | - | |
538 | | - | |
539 | | - | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
540 | 556 | | |
| 557 | + | |
541 | 558 | | |
542 | 559 | | |
543 | 560 | | |
544 | 561 | | |
545 | 562 | | |
546 | 563 | | |
547 | 564 | | |
| 565 | + | |
548 | 566 | | |
549 | 567 | | |
550 | 568 | | |
551 | 569 | | |
552 | | - | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
553 | 576 | | |
554 | 577 | | |
555 | 578 | | |
556 | 579 | | |
557 | 580 | | |
558 | | - | |
| 581 | + | |
559 | 582 | | |
| 583 | + | |
560 | 584 | | |
561 | 585 | | |
562 | 586 | | |
| |||
566 | 590 | | |
567 | 591 | | |
568 | 592 | | |
569 | | - | |
570 | | - | |
| 593 | + | |
| 594 | + | |
571 | 595 | | |
572 | 596 | | |
573 | 597 | | |
| |||
590 | 614 | | |
591 | 615 | | |
592 | 616 | | |
593 | | - | |
594 | | - | |
| 617 | + | |
| 618 | + | |
595 | 619 | | |
596 | 620 | | |
597 | 621 | | |
| |||
1148 | 1172 | | |
1149 | 1173 | | |
1150 | 1174 | | |
1151 | | - | |
| 1175 | + | |
1152 | 1176 | | |
1153 | 1177 | | |
1154 | 1178 | | |
| |||
1170 | 1194 | | |
1171 | 1195 | | |
1172 | 1196 | | |
| 1197 | + | |
1173 | 1198 | | |
1174 | 1199 | | |
1175 | 1200 | | |
1176 | 1201 | | |
1177 | 1202 | | |
1178 | | - | |
| 1203 | + | |
| 1204 | + | |
1179 | 1205 | | |
1180 | 1206 | | |
1181 | 1207 | | |
| |||
1184 | 1210 | | |
1185 | 1211 | | |
1186 | 1212 | | |
| 1213 | + | |
| 1214 | + | |
| 1215 | + | |
| 1216 | + | |
| 1217 | + | |
| 1218 | + | |
| 1219 | + | |
| 1220 | + | |
| 1221 | + | |
| 1222 | + | |
| 1223 | + | |
| 1224 | + | |
| 1225 | + | |
| 1226 | + | |
| 1227 | + | |
| 1228 | + | |
| 1229 | + | |
| 1230 | + | |
| 1231 | + | |
| 1232 | + | |
| 1233 | + | |
| 1234 | + | |
| 1235 | + | |
| 1236 | + | |
| 1237 | + | |
| 1238 | + | |
| 1239 | + | |
| 1240 | + | |
| 1241 | + | |
| 1242 | + | |
| 1243 | + | |
| 1244 | + | |
| 1245 | + | |
| 1246 | + | |
| 1247 | + | |
| 1248 | + | |
1187 | 1249 | | |
1188 | 1250 | | |
1189 | 1251 | | |
| |||
2359 | 2421 | | |
2360 | 2422 | | |
2361 | 2423 | | |
| 2424 | + | |
| 2425 | + | |
| 2426 | + | |
| 2427 | + | |
| 2428 | + | |
| 2429 | + | |
| 2430 | + | |
| 2431 | + | |
| 2432 | + | |
| 2433 | + | |
| 2434 | + | |
| 2435 | + | |
| 2436 | + | |
| 2437 | + | |
| 2438 | + | |
| 2439 | + | |
| 2440 | + | |
| 2441 | + | |
| 2442 | + | |
| 2443 | + | |
| 2444 | + | |
| 2445 | + | |
| 2446 | + | |
| 2447 | + | |
| 2448 | + | |
| 2449 | + | |
| 2450 | + | |
| 2451 | + | |
| 2452 | + | |
| 2453 | + | |
| 2454 | + | |
| 2455 | + | |
| 2456 | + | |
| 2457 | + | |
| 2458 | + | |
| 2459 | + | |
| 2460 | + | |
| 2461 | + | |
| 2462 | + | |
| 2463 | + | |
| 2464 | + | |
| 2465 | + | |
| 2466 | + | |
| 2467 | + | |
| 2468 | + | |
| 2469 | + | |
| 2470 | + | |
| 2471 | + | |
| 2472 | + | |
| 2473 | + | |
| 2474 | + | |
| 2475 | + | |
| 2476 | + | |
| 2477 | + | |
| 2478 | + | |
| 2479 | + | |
| 2480 | + | |
| 2481 | + | |
| 2482 | + | |
| 2483 | + | |
| 2484 | + | |
| 2485 | + | |
| 2486 | + | |
| 2487 | + | |
| 2488 | + | |
| 2489 | + | |
| 2490 | + | |
| 2491 | + | |
| 2492 | + | |
| 2493 | + | |
| 2494 | + | |
| 2495 | + | |
| 2496 | + | |
| 2497 | + | |
| 2498 | + | |
| 2499 | + | |
| 2500 | + | |
| 2501 | + | |
| 2502 | + | |
| 2503 | + | |
| 2504 | + | |
| 2505 | + | |
| 2506 | + | |
| 2507 | + | |
| 2508 | + | |
| 2509 | + | |
| 2510 | + | |
| 2511 | + | |
| 2512 | + | |
| 2513 | + | |
| 2514 | + | |
| 2515 | + | |
| 2516 | + | |
| 2517 | + | |
| 2518 | + | |
| 2519 | + | |
| 2520 | + | |
| 2521 | + | |
| 2522 | + | |
| 2523 | + | |
| 2524 | + | |
| 2525 | + | |
| 2526 | + | |
| 2527 | + | |
| 2528 | + | |
| 2529 | + | |
| 2530 | + | |
| 2531 | + | |
| 2532 | + | |
| 2533 | + | |
| 2534 | + | |
| 2535 | + | |
| 2536 | + | |
| 2537 | + | |
2362 | 2538 | | |
2363 | 2539 | | |
2364 | 2540 | | |
2365 | 2541 | | |
2366 | 2542 | | |
2367 | | - | |
2368 | | - | |
| 2543 | + | |
| 2544 | + | |
2369 | 2545 | | |
2370 | 2546 | | |
2371 | 2547 | | |
| |||
0 commit comments