Skip to content

Commit 991520c

Browse files
fix(pm): the landing door reads the opt-in dogfood lane's check run on a breaking PR's head (#38727)
<!-- claude-projects-attribution: {"github_login":"os-steve"} --> _Requested by **Steve** · [project thread](https://claude.ai/code/project/chan_01FdL1XeUyvVNxLreh3F4Qi9?thread=cmsg_01FdL1XeUyvVNxLreh3F4Qi98ZAtPQK4A8ABvN79TALFDE)_ Fixes #38688 Clause-②: no Metadata-protocol: none Rule-change: yes ## 维护者速读 - 用户无感;只改内部合并流程:破坏性改动要排队合并时,合并门不再看开发代理自己填写的「回归已跑」一栏,改看云端流水线在这个改动最新提交上的真实结果;开发代理也不再在本机跑完整的真实应用回归。 - 兑现你在「破坏性改动的完整回归,今后在哪儿跑」上选的「云端流水线代跑」里合并门这一半,替开发代理解决本机跑不完、结果只能靠自报的问题。 - 出错只会往「拦多了」的方向错:没打专用标签、或云端没跑出通过结果的破坏性改动,一律被合并门拦下并提示去打标签、等结果;撤回这一个改动即可恢复原样。它必须排在云端流水线那个改动之后合并,否则所有破坏性改动都会被拦在门外。 - 要你做什么:这改了开发代理的工作规则,合并前需要你批准。 Lands after: #38694 (PR #38705) ## What changes Maintainer ruling 7269391948 on the card (letter D, 「云端流水线代跑」): "the landing door reads that lane's conclusion on the head and stops reading the typed `dogfood_battery` field", and `os-dev.md` 216–218, its report template, `l1-review-checklist.md:53` and `landing-operations.md:61` point at the lane. This PR is that half. The lane itself is PR #38705 (card #38694), not touched here. **The door (`scripts/pm/label-write.mjs --land`).** For a pull whose title carries `!` before its colon or whose `Clause-②:` line carries a `(narrowing)` arm, `landDogfoodGate` now asks two questions of the platform and nothing of any report: | Question | Read | Pass | Refusal says | |:--|:--|:--|:--| | Does the pull edit the lane? | every page of `GET /pulls/{n}/files`, by `filename` and `previous_filename`, the count checked against the pull's `changed_files` | no row is `.github/workflows/dogfood-optin.yml` | names the file and its status; "a pull may not certify itself with a lane it edits"; land the lane change on its own | | Is the battery proven on this head? | `GET /commits/{head}/check-runs?check_name=Dogfood battery (opt-in)&filter=all`, paged | ANY completed run of that name by `github-actions` with conclusion `success` on the head sha | add the label `needs:dogfood-battery`, wait for the check run to conclude `success` on the head, land again | - Seat order 1: the reader asks "is there a success of this name on this head", never "what does the newest run say". Unrelated label events publish `skipped` runs of the same name on the same head (three runs, two skipped and one success, measured on PR #38705's head `9e8e9b20`). A success on an older sha is not read at all: only the head's check runs are requested. - Seat order 2: the file-list question is asked first, so a pull that edits the lane is refused before its own run is even looked at. It applies to MARKED pulls only. An unmarked pull that edits the lane is not judged (zero gate reads), which is the "lands on its own" pull; otherwise the lane could never be changed through this door. - Seat order 3: `scripts/pm/ensure-pm-labels.sh` creates `needs:dogfood-battery` (colour `006b75`, the description as ordered), beside its two siblings. - Fail closed, as before: an unreadable marker, a pull with no full head sha or no `changed_files`, a file list not read whole, a truncated check-run listing and every non-success conclusion are exit 2 with zero writes; a read the platform did not answer is exit 3. An unmarked pull and a pull in a repository with no battery are not judged, with zero extra reads. - Deleted with the typed field: the report readers (`reportedDogfoodBattery`, `reportedPayloadString`, `reportNamesPull`, `readBatterySha`), the sibling-pull rule, the fold tie over several cards and the first-parent walk over merges of the base (`LAND_COMMENT_PAGE_CAP`, `LAND_MERGE_HOP_CAP`). The lane proves a head, so a push (a merge of `main` included) owes a new run; with the label on, the push starts it. **New module: `scripts/pm/land-dogfood-lane.mjs`** (157 lines). `label-write.mjs` is over 1,000 lines, so the new concern (the lane's contract and its two reads) is a sibling module and the door only calls it: the three literals (`needs:dogfood-battery`, `Dogfood battery (opt-in)`, `.github/workflows/dogfood-optin.yml`), two pure verdicts and `readDogfoodLane`. `label-write.mjs` goes from 4,535 to 4,340 lines. **The L1 face (`scripts/pm/l1-face.mjs`).** The `dogfood` item used to flag every marked PR "owed, not judged". It now judges a marked PR with the door's own two verdicts, from readings it already makes (the head's check runs, the file list): `ok` on a lane success at the head, `flag` on none (naming the label), `flag` on a PR that edits the lane, `not measured` while the lane run is in progress. **Rule text.** - `.claude/agents/os-dev.md` 216–218: a dev no longer runs the full dogfood locally; the owning seat labels a marked PR, CI runs the three shards on its head, the door reads the check, and a marked PR does not edit the lane's workflow. - The report template's `dogfood_battery` field is REMOVED, not turned into a pointer: a field an agent types is the thing the ruling retires, and no reader is left (`label-write.mjs`, `l1-face.mjs` and the checklist all read the check run). - `l1-review-checklist.md:53` and `landing-operations.md:61` name the lane's check and label. **Rule-change: yes**, by my own reading of the whole diff. Every `.claude/**` hunk is one the ruling names, but two choices in them are mine or the seat's and are not the maintainer's words: the report field is removed (the ruling says the template "points at the lane"), and `os-dev.md` says the owning seat hangs the label and a dev does not (the lane's own header says so; the ruling does not say who). The seat may read it as `ruled`; I did not. ### Byte arithmetic (the three governed files; `wc -c`, ceilings from `scripts/pm/check-skill-line-ratchet.mjs`) | File | Before | After | Delta | Ceiling | |:--|--:|--:|--:|--:| | `.claude/agents/os-dev.md` | 33,475 | 33,407 | −68 | 33,491 | | `.claude/skills/pm-dispatch/references/l1-review-checklist.md` | 6,871 | 6,870 | −1 | 6,875 | | `.claude/skills/pm-dispatch/references/landing-operations.md` | 10,705 | 10,699 | −6 | 10,705 | No ceiling row is moved: the ratchet file is outside this card's file surface, so the three rows keep their values and each file sits at or under its own. ## Tests Every reading below is at head `4d864db1`. <details><summary>label-write.mjs --self-test: 401 cases across 19 batteries, exit 0; the gate's battery re-pinned 70 to 64</summary> The `--land` dogfood battery was rewritten with the gate. Its floor moves 70 to 64, with the reason beside the pin: the report, sibling-pull, tie and commit-walk cases left with the code they drove. Cases whose verdict flipped carry the flip in their name: - "FLIPPED by ruling D (was PASSES: a `!` title whose newest report ran on the head)": the same head-pinned typed report with no lane check now REFUSES. - "FLIPPED by ruling D (was REFUSED: a `!` title whose newest report says `n/a`)": the same `n/a` report over a lane success on the head now PASSES. - "FLIPPED by ruling D (was: from the pull and the card thread alone)": the gate reads the pull, its file list and the head's check runs; no card thread, no commit. - "FLIPPED by ruling D (was FAIL CLOSED: NO CARD …)": a marked pull naming no card lands on the lane's success. - "FLIPPED by ruling D (was: a fold's tie read on every tied card)": a fold is judged on its one head. - "FLIPPED by ruling D (was PASSES: … one merge of main below the head)": a success one merge below the head now REFUSES. - "FLIPPED by ruling D (was: the report template carries the typed key the door reads)": `os-dev.md` carries the typed key nowhere, and no local dogfood command. Added, by seat order: - Order 1: the pure verdict over skipped, skipped, success in every position; "PASSES: skipped, skipped, then success on ONE sha"; "REFUSED: a success only on an OLDER sha"; "REFUSED: only `skipped` runs on the head"; a failed, a cancelled, an in-progress run and a failure beside a skip each refuse; a failed attempt beside a success passes; a success on another sha, under a shard's name, under the required gate's name or by another app is not counted; a success on the second page of the listing passes, a truncated listing refuses. - Order 2: "REFUSED: a marked pull whose file list changes the lane's workflow, EVEN WITH a success on its head"; refused before the check runs are read; renamed away, added and removed are changes too; the workflow on the second page of a long file list is still seen; another workflow is not self-certifying; "NOT JUDGED: an UNMARKED pull that edits the lane". - Order 3: the label a refusal names is one `ensure-pm-labels.sh` creates. - Fail closed: fourteen boards, each carrying a success on its head, each refusing for its own reason (exit 2 judged, exit 3 for a read the platform did not answer). - Kept: the title marker, the markers, the battery repositories, the cloud not-judged cases, the long-title quote cap, the gate before `judgeBody`. The fake board gained `GET /pulls/{n}/files` and `GET /commits/{sha}/check-runs` (paged, filtered by `check_name`) and lost `GET /compare`, which nothing reads now. </details> <details><summary>l1-face.mjs --self-test: 57 cases across 7 batteries, exit 0; the gate-evidence battery pinned 7 to 13</summary> - Flipped, named: "FLIPPED by ruling D (was: `!` before the title's colon owes the dogfood battery — flagged, not judged)". - Added: a marked PR with the lane's success beside two skipped runs reads `ok`; only skipped runs, or a failure, flag with their tally; a run in progress is `not measured`; a success under a shard's name flags; a marked PR that edits the lane flags even with a success; an unmarked PR is not owed whatever it edits. - Extended: "unreadable check-runs leave both check items not measured, and a marked PR's dogfood item with them". - The two rule-text phrases the face is built from were updated with the checklist line they pin. </details> <details><summary>Ablation: three mutations of land-dogfood-lane.mjs, each landed on disk, each red, each restored byte-identical</summary> Through `scripts/ablation-replace.mjs` (anchor hit once, blob `f3a15b5127fa` before and after each restore), running `node scripts/pm/label-write.mjs --self-test`: 1. "any success" replaced by "the first row only" (newest-only): exit 1, 4 cases red, among them the skipped-then-success pair and the second-page success. 2. The self-certification refusal disabled: exit 1, 4 cases red (the refusal, its order before the check-run read, the three statuses, the second page of files). 3. The head-sha match removed from the check verdict: exit 1, 1 case red (a success on another sha is not the head's). </details> <details><summary>Derived gates: 74 derived, 72 run with exit 0, 2 read as NOT-MEASURED from a first exit 3 that passed on re-run</summary> `node scripts/pm/dispatch-gates.mjs --repo objectstack-ai/objectstack --ran FILE` printed: `✓ dispatch-gates --ran: 74 derived famil(ies) accounted for — 72 run, 2 NOT-MEASURED (2 DERIVED from a recorded exit 3).` The two are `pnpm --filter @objectstack/lint run check:doc-formula-expressions` and `pnpm check:i18n-coverage`. Each first exited 3, stating its own unmet prerequisite (a workspace package not built in this worktree; this diff touches no package). After the builds the gates named, each re-ran exit 0 on the same head. The record keeps every line, and the tool reads a command recorded with two codes as the first one; I did not edit the record. Among the 72: `check:pm-label-write`, `check:pm-dispatch-gates` (423 s), `check:pm-skill-ratchet`, `check:pm-skill-id-lint`, `check:pm-label-desc-cap`, `check:pm-governed-prose`, `check:pm-governed-merges`, `check:doc-authoring`, `check:nul-bytes`, `check:required-contexts`, `check:pm-expected-skips`. Also on this head: `eslint --no-inline-config` over the three scripts, exit 0; `node scripts/check-platform-checklist.mjs --changed-from origin/main`, "0 anchored files in the change set — nothing judged" (two exported constants are deleted, neither is a checklist anchor); `node scripts/pm/overlap-check.mjs --branch=HEAD`, "VERDICT clean exit 0" against `origin/main` and PR #38684. </details> ## Seat rulings 2026-11-30T08:17Z Seat `repo:objectstack#3` on the dev's four open questions (report 7272639732), each as the dev recommended: 1. `Rule-change: yes`, not `ruled`. Removing the `dogfood_battery` field and having the owning seat put the label on are the seat's reading of ruling D, not the maintainer's words. 2. Only a `Dogfood battery (opt-in)` check run from app `github-actions` counts. 3. The door refuses an edit of `.github/workflows/dogfood-optin.yml` only on a marked pull (`!` or `(narrowing)`), since the door judges only those. 4. Head SHA only: after a merge of `main`, the lane runs again on the new head. Out of scope, carried by the seat: the `AGENTS.md` §10 sentence → #38735 (lands after this PR; replacement proposed in the report), and a pin of this module's three literals to the workflow, joined to the `ci.yml` vs `dogfood-optin.yml` drift card. ## Acceptance notes - **Order of landing.** After PR #38705 (the lane). PR #38684 (no background runs) was planned to land after this one, but the maintainer merged it first (2026-11-30T08:03Z, `e586cfd3`); until this PR lands, a breaking PR has no route through the door. Landed before the lane exists on `main`, this door refuses every breaking PR in objectstack, because no head can carry the check. - **Not in this PR, by the card's file surface:** the `AGENTS.md` sentence "dogfood once, on the final head" (Multi-agent discipline, item 10) still describes a local run, and moves under #38735; `os-dev.md` line 90 is PR #38684's, now merged; it no longer names the full dogfood. - **One seam nothing pins.** The three literals in `land-dogfood-lane.mjs` are copied from the lane's header. The workflow file is not on `main` yet, so no self-test here can read it; a rename of the job in the workflow would make every breaking PR refuse, loudly, until the constant follows. - **The app filter is mine.** The door counts only check runs whose `app.slug` is `github-actions` (measured on the lane's first labelled run). The seat's order says "a check run named …"; the filter narrows what passes and never widens it. - **`filter=latest` against `filter=all`.** `l1-face.mjs` judges from `pr-state.mjs`' check-run reading, which asks `filter=latest`; the door asks `filter=all`. A success that a later red re-run of the same workflow run superseded reads `flag` on the face and passes the door. The face's header says so. - **A `(narrowing)` or `!` PR that must edit the lane** has no route through the door by design: it splits, and the lane change lands first. - Reports written before this change still carry a `dogfood_battery` key; nothing reads it, and nothing refuses it. ## Verification Files to read first, by risk: 1. `scripts/pm/land-dogfood-lane.mjs`, `dogfoodLaneCheckVerdict` and `readDogfoodLane`: the only place a pass is decided (which rows count, and when the listing stops). 2. `scripts/pm/label-write.mjs`, `landDogfoodGate` and `landDogfoodRefusal` (about line 1,770): what is still read before the lane, and the unread-versus-refused split. 3. `.claude/agents/os-dev.md` 216–218 and the report template: the rule a dev follows from now on. Two-minute check: `node scripts/pm/label-write.mjs --self-test`, expecting `401 cases pass across 19 batteries`; the cases named "Seat order" above are in the battery that opens with "the --land dogfood gate". 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01ADHkmRJUY9Ncce14hVHd25 <!-- signed: repo:objectstack#3 · os-steve · session_01ADHkmRJUY9Ncce14hVHd25 --> Co-authored-by: Claude <noreply@anthropic.com>
1 parent 0d68ce2 commit 991520c

7 files changed

Lines changed: 434 additions & 426 deletions

File tree

‎.claude/agents/os-dev.md‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -213,9 +213,9 @@ model: opus
213213
- 范围按本地验证范围节圈定;`packages/cli` 的卡本地只欠 `unit` 层,`integration` 层声明给 CI。
214214
- `packages/cli` 卡与 driver/kernel 启动路径的分层跑法住 pm-dispatch `references/dev-traps.md`,碰到才读。
215215
- Draft PR 指向 `main`,正文首行 `Fixes #<n>`;合并不应关卡时用 `Part of #<n>`,并说明留下哪一半。
216-
- 全量 dogfood 只在终 head 跑一次,仅当标题带 `!` 或 `Clause-②:` 带 `(narrowing)` 臂(yes/no 皆算)。
217-
- 命令同 CI:按 ① 建闭包,锁下 `pnpm --filter @objectstack/dogfood test`;⛔ 无 `OS_TEST_SHARD`、无路径。
218-
- 红 = 本改动的后果(陈旧 fixture)同 PR 修,余照报;⛔ 永不跳过或收窄;计数记 `dogfood_battery`。
216+
- 全量 dogfood ⛔ 不在本地跑:标题带 `!` 或 `Clause-②:` 带 `(narrowing)` 臂(yes/no 皆算)⇒ 席位给 PR 挂 `needs:dogfood-battery`,CI 在其 head 跑三段。
217+
- 落地门只读该 head 上 `Dogfood battery (opt-in)` 的 success,⛔ 不读报告;每次 push 换 head 即欠新一轮,dev 不自挂该标签。
218+
- 红 = 本改动的后果(陈旧 fixture)同 PR 修,余照报;⛔ 该类 PR 不改 `.github/workflows/dogfood-optin.yml`:不能自证。
219219
- 认领的 `Clause-②:`、`Metadata-protocol:` 两行照抄进 PR 正文行首;无则零写,⛔ 不自造。
220220
- 两行同抄进 changeset 正文行首;`Check Changeset` 读 PR 正文:kind 即 `minor`,`none` 即 `patch`。
221221
- 种类非 `none` 或带 `(narrowing)` ⇒ 按 diff 加写 `Skills-docs:` 行;拼法与分工住认领模板。
@@ -318,7 +318,6 @@ model: opus
318318
"summary": "what was implemented, 2-4 sentences",
319319
"tests": "commands run + pass/fail evidence (real output excerpts); ablation only where a tested behaviour changed: rebuild + on-disk mutation proof",
320320
"gates": "local subset: each command + exit code captured before any pipe + --ran reconciliation; every family CI runs: the PR's check-runs (name + conclusion) cited, not re-run locally",
321-
"dogfood_battery": "n/a — no `!` in the PR title and no (narrowing) arm | <head sha> · the lock's VERDICT line · Test Files N/N · Tests M/M · every failure named",
322321
"mcp_calls": "<n> — MCP GitHub calls with tool names; a write tool in the list = this report is refused",
323322
"api_writes": "<n> — REST proxy writes, each endpoint listed",
324323
"classifier_refusals": [

‎.claude/skills/pm-dispatch/references/l1-review-checklist.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
- 门禁读数钉当前 head:run `head_sha` 或 dev 所抄短 sha 不符 `head.sha`、或没抄 ⇒ 双向不入账。
5151
- ⛔ 非当前 head 上的 `cancelled` 零动作、永不重跑:新推送自带全套 run。
5252
- 席位核对门禁证据 = check-runs(名+结论);本地并集只证本地子集,⛔ 不替缺席者。
53-
- `!` 或 `(narrowing)`:入队前核 `dogfood_battery` 钉 head、全量、红已修/已报;缺或收窄 ⇒ REWORK。
53+
- `!` 或 `(narrowing)`:入队前核 head 上 `Dogfood battery (opt-in)` success;缺则挂 `needs:dogfood-battery`。
5454
- 把发送或写挪到应答之后的 PR:dogfood 门禁不跑于 PR、跑于队列,全绿 PR 照样被队列弹出。
5555
- ⇒ 入队前 grep `packages/qa/dogfood/test` 里应答后紧读该副作用的用例,同一 PR 改为有界等待。
5656

‎.claude/skills/pm-dispatch/references/landing-operations.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
- 车道 PM 的权责三件:验收(L1 清单)、首次入队、确认 MERGED;落地执行在案判决,非自批。
5959
- 首次入队:ACCEPT 后挂 6–9 分钟 flip 定点,到点核门禁 job 结论。
6060
- 绿即落地评论与 `pr_ready`+`automerge_enable` 一笔中继:`label-write --land`;未绿按阶梯重挂定点。
61-
`--land` 拒 `!`/`(narrowing)` PR,除非卡上最新受信 os-dev-report 的 dogfood 钉 head(`os-dev.md`)。
61+
`--land` 拒 `!`/`(narrowing)` PR,除非 head 上 dogfood 泳道(`needs:dogfood-battery`)为 success。
6262
- 写节流拒(exit 10) ⇒ 待 `node scripts/pm/write-pace.mjs --status` 现空槽再重试。
6363
- CI success webhook 不可靠:⛔ 不坐等,也 ⛔ 不忙轮询;定点文本照定时器写法纪律。
6464
- undraft 429 ⇒ 卡记 `resets at`,到点一次重试裸 op(`rest-channel.md`),⛔ 不重发评论、不报阻塞。

‎scripts/pm/ensure-pm-labels.sh‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -381,6 +381,19 @@ gh label create needs:pack-smoke -R objectstack-ai/objectstack -c 006b75 -d "Opt
381381
# belongs to: an opt-in pre-merge check.
382382
gh label create needs:upgrade-harness -R objectstack-ai/objectstack -c 006b75 -d "Opt-in pre-merge 18.x upgrade harness: an 18.0 database boots on this PR's merge preview (#24522)" 2>/dev/null || true
383383

384+
# needs:dogfood-battery — the opt-in pre-merge dogfood battery (#38688, maintainer
385+
# ruling 7269391948, letter D, 「云端流水线代跑」). Its first consumer is the job
386+
# guard in `.github/workflows/dogfood-optin.yml`, which runs the three queue
387+
# shards on the PR's merge preview only while this label is on the PR. Unlike
388+
# its two siblings above it has a second consumer in scripts/pm/: the landing
389+
# door (`label-write.mjs --land`, through `land-dogfood-lane.mjs`) refuses a
390+
# breaking or narrowing PR until that lane's `Dogfood battery (opt-in)` check
391+
# run concludes `success` on the PR's head, and its refusal tells the seat to
392+
# add this label. The owning seat hangs it by hand on the head it means to
393+
# land; nothing auto-applies it, and every later push to a labelled PR is
394+
# another full run. Same colour as its family: an opt-in pre-merge check.
395+
gh label create needs:dogfood-battery -R objectstack-ai/objectstack -c 006b75 -d "Opt-in pre-merge dogfood battery: the three queue shards on a breaking PR head (ruling D, #38688)" 2>/dev/null || true
396+
384397
# needs:contract-review — a MARKER, never a gate; rules in
385398
# .claude/skills/pm-dispatch/references/contract-review.md 〈等 L2 标记〉. The
386399
# dispatching seat hangs it on the PR at ACCEPT when either clause-② limb hits

‎scripts/pm/l1-face.mjs‎

Lines changed: 44 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* The L1 checklist asks every seat to re-read the same mechanical facts by hand on every dev report: the PR's shape,
1515
* the card relation its first line declares, whether a closing keyword sits next to another OPEN card, the release
1616
* path, a changeset per published package, the declaration lines, the two floor checks at the head, every other check,
17-
* whether the dogfood battery is owed, and the `+0/-0` NUL suspects. This file is that reading, one line per item with
17+
* whether the dogfood battery is proven on the head, and the `+0/-0` NUL suspects. This file is that reading, one line per item with
1818
* its verdict — `ok`, `flag` or `not measured` — and the evidence. ⛔ It writes nothing, and it is a READER, not a
1919
* gate: no exit code here is a merge condition.
2020
*
@@ -31,8 +31,13 @@
3131
* with `check-changeset-no-major.mjs`' `entriesIn` (⛔ no fifth copy of the entry regex);
3232
* 5. `/git/blobs/SHA` for every `+0/-0` file: NUL bytes and lines, the blob's own answer.
3333
*
34-
* The `Clause-②:` and `Metadata-protocol:` lines are read by `clause2-line.mjs`, and the dogfood markers by
35-
* `label-write.mjs`' `landDogfoodMarkers` — the readers the gates use.
34+
* The `Clause-②:` and `Metadata-protocol:` lines are read by `clause2-line.mjs`, the dogfood markers by
35+
* `label-write.mjs`' `landDogfoodMarkers`, and the lane's check run and the lane's workflow in the file list by
36+
* `land-dogfood-lane.mjs`' two verdicts — the readers the gates use. A marked PR is JUDGED on what the landing door
37+
* will read: the opt-in lane's `success` on this head (reading 1's check-runs) and a file list that leaves the lane
38+
* alone (reading 2). ⛔ Nothing typed in a report is read. One difference from the door is named, not hidden: reading
39+
* 1 asks `filter=latest`, the door `filter=all`, so a success a later red re-run of the SAME workflow run superseded
40+
* reads `flag` here and passes there.
3641
*
3742
* ## What it does NOT read — named in the footer of every run
3843
*
@@ -66,6 +71,7 @@ import { closingKeywordTargets, DECISION_INBOX_LABEL, DEFAULT_SWEEP_REPO, h7Part
6671
import { readClause2Line, readMetadataProtocolLine } from './clause2-line.mjs';
6772
import { ghApi, readAllPages } from './gh-pages.mjs';
6873
import { landDogfoodMarkers } from './label-write.mjs';
74+
import { DOGFOOD_LANE_CHECK, DOGFOOD_LANE_LABEL, DOGFOOD_LANE_WORKFLOW, dogfoodLaneCheckVerdict, dogfoodLaneFilesVerdict } from './land-dogfood-lane.mjs';
6975
import { fixtureReaders, gitLsRemote, readPrState } from './pr-state.mjs';
7076

7177
const REPO_ROOT = fileURLToPath(new URL('../../', import.meta.url));
@@ -107,7 +113,7 @@ export const RULE_FILES = Object.freeze({
107113
'亲核 Lint & Repo Gates 与 TypeScript Type Check 皆 `success`',
108114
'入队另要求全 check 绿',
109115
'门禁读数钉当前 head',
110-
'`!` 或 `(narrowing)`:入队前核 `dogfood_battery`',
116+
'`!` 或 `(narrowing)`:入队前核 head 上 `Dogfood battery (opt-in)` success',
111117
'`+0/-0` 先疑 NUL,以 blob 定论',
112118
'要求源侧写转义序列',
113119
'`l1-face.mjs --pr N`',
@@ -129,7 +135,7 @@ export const UNREAD_ITEMS = Object.freeze([
129135
'a PR that moves a send or a write after the response: grep `packages/qa/dogfood/test` for a case that reads the side effect right after the response, made a bounded wait in the same PR',
130136
'adjacent in-place fixes (the four conditions), one-shot codegen in the diff, move/split growth past a pure move',
131137
'test evidence: real commands and output, positive controls, `.d.ts` byte-identity readings, git-answerable API reads',
132-
"gate readings in the report pinned to this head, and the report's `dogfood_battery` against it",
138+
'gate readings in the report pinned to this head',
133139
'assertions and benefit (the envelope `code`/`status`, sweep direction and build order), premise, stop conditions and deletions',
134140
"`mergeable_state`, the queue and reviews — read with `pr-state.mjs` (its line is printed above)",
135141
]);
@@ -344,7 +350,20 @@ export function readFace({ repo, number, get = ghApi, lsRemote = gitLsRemote, sl
344350
{
345351
const m = landDogfoodMarkers({ title: pr.title, body });
346352
if (m.unreadable) item('dogfood', NOT_MEASURED, m.unreadable);
347-
else if (m.markers.length) item('dogfood', FLAG, `owed — ${m.markers.join(' and ')}: the full battery on ${short(head)}, recorded under \`dogfood_battery\` (flagged, not judged)`);
353+
else if (m.markers.length) {
354+
// What the landing door will read (`label-write.mjs --land`): the lane's success ON THIS HEAD, and a file list
355+
// that leaves the lane alone. Judged with the door's own two verdicts, never a second spelling of either.
356+
const owed = `owed — ${m.markers.join(' and ')}`;
357+
const lane = dogfoodLaneCheckVerdict(tap.runs, head);
358+
const edits = files ? dogfoodLaneFilesVerdict(files) : null;
359+
const waiting = tap.runs.some((r) => r?.name === DOGFOOD_LANE_CHECK && r.status !== 'completed');
360+
if (!files) item('dogfood', NOT_MEASURED, `${owed}: ${filesGap}, so whether this PR changes \`${DOGFOOD_LANE_WORKFLOW}\` is unread`);
361+
else if (edits.touched) item('dogfood', FLAG, `${owed}: this PR changes \`${DOGFOOD_LANE_WORKFLOW}\`, so it may not certify itself with that lane — the lane change lands on its own`);
362+
else if (!checks) item('dogfood', NOT_MEASURED, `${owed}: the head's check-runs did not read`);
363+
else if (lane.success) item('dogfood', OK, `${owed}: \`${DOGFOOD_LANE_CHECK}\` concluded success at ${short(head)} (check run ${lane.success.id ?? 'id not read'})`);
364+
else if (waiting) item('dogfood', NOT_MEASURED, `${owed}: \`${DOGFOOD_LANE_CHECK}\` is still running at ${short(head)}`);
365+
else item('dogfood', FLAG, `${owed}: no success of \`${DOGFOOD_LANE_CHECK}\` at ${short(head)} (${lane.seen === 0 ? 'no run of that name' : lane.tally}) — add \`${DOGFOOD_LANE_LABEL}\` and wait for the run`);
366+
}
348367
else item('dogfood', OK, 'not owed (no `!` before the title\'s colon, no `(narrowing)` arm)');
349368
}
350369

@@ -588,7 +607,8 @@ const SELF_TEST_BATTERIES = Object.freeze({
588607
'PR shape and the card relation: the first line, the shared parser, other open cards': 12,
589608
'scope and changeset: the release path, published packages, empty changesets': 10,
590609
'declarations: Clause-②, Metadata-protocol and the Skills-docs line they owe': 6,
591-
'gate evidence at the head: the floor checks, every other check via pr-state, dogfood owed': 7,
610+
// Raised 7 → 13 with the lane: a marked PR is judged on the lane's check run at the head and on its own file list.
611+
'gate evidence at the head: the floor checks, every other check via pr-state, dogfood owed': 13,
592612
'+0/-0: the blob decides': 5,
593613
'the face and the CLI: the unread footer, exits and usage': 8,
594614
});
@@ -631,7 +651,7 @@ export function selfTest() {
631651
const REQ = '_Requested by **Sales** · [project thread](https://claude.ai/code/project/x?thread=y)_';
632652
const bodyOf = (...lines) => [ATTR, REQ, ...lines].join('\n');
633653
const BODY = bodyOf('Part of #500', 'Clause-②: no', 'Metadata-protocol: none', '', 'What changes.');
634-
const run = (name, conclusion = 'success', status = 'completed') => ({ name, status, conclusion: status === 'completed' ? conclusion : null, check_suite: { id: 1 } });
654+
const run = (name, conclusion = 'success', status = 'completed') => ({ name, status, conclusion: status === 'completed' ? conclusion : null, check_suite: { id: 1 }, head_sha: HEAD, app: { slug: 'github-actions' } });
635655
const file = (filename, over = {}) => ({ filename, status: 'modified', additions: 3, deletions: 1, sha: sha('b'), ...over });
636656
const row = (over = {}) => ({ number: 7, state: 'open', draft: true, merged_at: null, mergeable_state: 'clean', head: { sha: HEAD }, base: { ref: 'main' }, auto_merge: null, title: 'feat(pm): x', body: BODY, labels: [{ name: SKIP_CHANGESET_LABEL }], changed_files: 2, ...over });
637657
const fixture = (over = {}) => ({
@@ -726,8 +746,22 @@ export function selfTest() {
726746
const skip = read(fixture(runs(run('Lint & Repo Gates'), run('TypeScript Type Check'), run('Build Docs', 'skipped'), run('Lint UI', 'skipped'))));
727747
t('⭐ every other check is pr-state\'s judgement: an expected skip passes, an unexpected one flags', [v(skip, 'all-checks'), at(skip, 'all-checks').evidence.includes('1 unexpected skip (Lint UI)')], [FLAG, true]);
728748
t('a pending check leaves all-checks not measured', v(read(fixture(runs(run('Lint & Repo Gates'), run('TypeScript Type Check'), run('Test Core', null, 'queued')))), 'all-checks'), NOT_MEASURED);
729-
t('⭐ `!` before the title\'s colon owes the dogfood battery — flagged, not judged', [v(read(fixture({ row: { title: 'feat(pm)!: x' } })), 'dogfood'), v(read(fixture({ row: { body: bodyOf('Part of #500', 'Clause-②: yes (narrowing)', 'Metadata-protocol: narrowed', 'Skills-docs: none — internal') } })), 'dogfood')], [FLAG, FLAG]);
730-
t('unreadable check-runs leave both check items not measured', [v(read(fixture({ check_runs: { [HEAD]: null } })), 'floor-checks'), v(read(fixture({ check_runs: { [HEAD]: null } })), 'all-checks')], [NOT_MEASURED, NOT_MEASURED]);
749+
const BANG = { title: 'feat(pm)!: x' };
750+
const NARROWING = { body: bodyOf('Part of #500', 'Clause-②: yes (narrowing)', 'Metadata-protocol: narrowed', 'Skills-docs: none — internal') };
751+
const FLOOR = [run('Lint & Repo Gates'), run('TypeScript Type Check')];
752+
const LANE = (conclusion = 'success', status = 'completed') => run(DOGFOOD_LANE_CHECK, conclusion, status);
753+
const marked = (laneRuns, over = {}) => read(fixture({ row: BANG, check_runs: { [HEAD]: [...FLOOR, ...laneRuns] }, ...over }));
754+
const noLane = read(fixture({ row: BANG }));
755+
t('⭐ FLIPPED by ruling D (was: "`!` before the title\'s colon owes the dogfood battery — flagged, not judged"): a marked PR is now JUDGED on the lane — a `!` title or a `(narrowing)` arm with no lane run at the head flags, naming the label to add', [v(noLane, 'dogfood'), v(read(fixture({ row: NARROWING })), 'dogfood'), at(noLane, 'dogfood').evidence.includes(`no run of that name) — add \`${DOGFOOD_LANE_LABEL}\` and wait for the run`)], [FLAG, FLAG, true], at(noLane, 'dogfood').evidence);
756+
const proven = marked([LANE('skipped'), LANE('skipped'), LANE()]);
757+
t('⭐ a marked PR whose head carries the lane\'s success reads ok — beside two `skipped` runs of the same name: any success on the head, never the newest', [v(proven, 'dogfood'), at(proven, 'dogfood').evidence.includes(`\`${DOGFOOD_LANE_CHECK}\` concluded success at`)], [OK, true], at(proven, 'dogfood').evidence);
758+
t('⭐ only `skipped` runs, or a failure, flag — with their tally', [v(marked([LANE('skipped'), LANE('skipped')]), 'dogfood'), at(marked([LANE('skipped'), LANE('skipped')]), 'dogfood').evidence.includes('(skipped ×2)'), v(marked([LANE('failure')]), 'dogfood')], [FLAG, true, FLAG]);
759+
t('a lane run still in progress is not measured, never ok and never a flag', v(marked([LANE(null, 'in_progress')]), 'dogfood'), NOT_MEASURED);
760+
t('⛔ a success under a SHARD\'s name is not the lane\'s aggregate: flags', v(marked([run('Dogfood battery shard (1/3, opt-in)')]), 'dogfood'), FLAG);
761+
const selfCert = marked([LANE()], { files: { 7: [file(DOGFOOD_LANE_WORKFLOW), file('.claude/skills/a.md')] } });
762+
t('⭐ a marked PR whose file list changes the lane\'s workflow flags EVEN WITH a success on its head: it may not certify itself', [v(selfCert, 'dogfood'), at(selfCert, 'dogfood').evidence.includes('the lane change lands on its own')], [FLAG, true], at(selfCert, 'dogfood').evidence);
763+
t('…and an UNMARKED PR is not owed, whatever it edits and with no lane run', [v(read(fixture()), 'dogfood'), v(read(fixture({ files: { 7: [file(DOGFOOD_LANE_WORKFLOW), file('.claude/skills/a.md')] } })), 'dogfood')], [OK, OK]);
764+
t('unreadable check-runs leave both check items not measured, and a marked PR\'s dogfood item with them', [v(read(fixture({ check_runs: { [HEAD]: null } })), 'floor-checks'), v(read(fixture({ check_runs: { [HEAD]: null } })), 'all-checks'), v(read(fixture({ row: BANG, check_runs: { [HEAD]: null } })), 'dogfood')], [NOT_MEASURED, NOT_MEASURED, NOT_MEASURED]);
731765
}
732766

733767
battery('+0/-0: the blob decides');

0 commit comments

Comments
 (0)