You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 991520c
Browse filesBrowse the repository at this point in the historyBrowse 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>
"tests": "commands run + pass/fail evidence (real output excerpts); ablation only where a tested behaviour changed: rebuild + on-disk mutation proof",
320
320
"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",
322
321
"mcp_calls": "<n> — MCP GitHub calls with tool names; a write tool in the list = this report is refused",
323
322
"api_writes": "<n> — REST proxy writes, each endpoint listed",
'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',
130
136
'adjacent in-place fixes (the four conditions), one-shot codegen in the diff, move/split growth past a pure move',
131
137
'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',
133
139
'assertions and benefit (the envelope `code`/`status`, sweep direction and build order), premise, stop conditions and deletions',
134
140
"`mergeable_state`, the queue and reviews — read with `pr-state.mjs` (its line is printed above)",
135
141
]);
@@ -344,7 +350,20 @@ export function readFace({ repo, number, get = ghApi, lsRemote = gitLsRemote, sl
344
350
{
345
351
constm=landDogfoodMarkers({title: pr.title, body });
elseif(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
+
elseif(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.
if(!files)item('dogfood',NOT_MEASURED,`${owed}: ${filesGap}, so whether this PR changes \`${DOGFOOD_LANE_WORKFLOW}\` is unread`);
361
+
elseif(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
+
elseif(!checks)item('dogfood',NOT_MEASURED,`${owed}: the head's check-runs did not read`);
363
+
elseif(lane.success)item('dogfood',OK,`${owed}: \`${DOGFOOD_LANE_CHECK}\` concluded success at ${short(head)} (check run ${lane.success.id??'id not read'})`);
364
+
elseif(waiting)item('dogfood',NOT_MEASURED,`${owed}: \`${DOGFOOD_LANE_CHECK}\` is still running at ${short(head)}`);
365
+
elseitem('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
+
}
348
367
elseitem('dogfood',OK,'not owed (no `!` before the title\'s colon, no `(narrowing)` arm)');
constskip=read(fixture(runs(run('Lint & Repo Gates'),run('TypeScript Type Check'),run('Build Docs','skipped'),run('Lint UI','skipped'))));
727
747
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]);
728
748
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
+
constBANG={title: 'feat(pm)!: x'};
750
+
constNARROWING={body: bodyOf('Part of #500','Clause-②: yes (narrowing)','Metadata-protocol: narrowed','Skills-docs: none — internal')};
751
+
constFLOOR=[run('Lint & Repo Gates'),run('TypeScript Type Check')];
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);
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);
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]);
0 commit comments