Skip to content

ci: label-gated lane runs the three dogfood shards on a breaking PR's head - #38705

Merged
os-zhuang merged 2 commits into
mainfrom
claude/issue-38694-dogfood-optin-lane
Nov 30, 2026
Merged

os-zhuang merged 2 commits into
mainfrom
claude/issue-38694-dogfood-optin-lane

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Requested by Steve · project thread
Fixes #38694
Clause-②: no
Metadata-protocol: none

维护者速读

  • 用户无感;只改破坏性改动的合并前流程:有人给这类改动打上专用标签后,云端对它的最新提交跑一遍完整真实应用回归(三段并行,约二十分钟),没打标签的改动什么都不跑。
  • 兑现你在「破坏性改动的完整回归在哪儿跑」上选的「云端流水线代跑」,替开发代理解决本地跑不完的问题。
  • 它不进必过检查、不会按路径或标题自动打标签,出错最多是多花一些云端用量或拿不到结果、合并门照旧拦下;删掉这一个流水线文件即可撤回;每次打标签后的推送约花六十分钟云端机时,总量约比现在多百分之八。
  • 这是工作流改动,合并前需要你批准。

What changes

One new file, .github/workflows/dogfood-optin.yml (the name follows the two precedents, pack-smoke-optin.yml and upgrade-harness-optin.yml). Nothing else is touched: not ci.yml, not .github/labeler.yml, not scripts/pm/**.

What the landing door reads (the other half of #38688) Value
Label needs:dogfood-battery (does not exist yet; it follows the needs:pack-smoke / needs:upgrade-harness family; creating it is the seat's)
Check run to read, by head SHA Dogfood battery (opt-in)
Pass a check run of that name with conclusion success on the head SHA. Anything else (failure, cancelled, skipped, absent) is not a proof
Shard check runs (evidence only) Dogfood battery shard (1/3, opt-in), (2/3, opt-in), (3/3, opt-in)
  • Trigger. pull_request (never pull_request_target) on main, types: [opened, synchronize, reopened, labeled], the precedents' shape. Every job carries the two-limb label guard: the PR carries needs:dogfood-battery now, and on a labeled event the label just added is ours. An unlabelled PR's jobs skip, so it runs no battery and bills nothing.
  • Battery. A 3-way matrix copying ci.yml's dogfood job: the closure build (turbo run build --filter=@objectstack/dogfood), the test run with the slice in OS_TEST_SHARD=k/3 (no -- passthrough), the vitest worker cap, the stall guard on both steps, the completeness guard, the stall-report upload, and a restore-only turbo cache from the queue's main seeds. fail-fast: false: nobody waits behind this run, so every red shard is named in one run. timeout-minutes: 30, the queue's own budget.
  • Verdict. Each shard ends with check-shard-attestation.mjs --emit plus an upload with no if:, so a credential exists only when every step before it passed. The battery job passes only when the matrix result is success and all three credentials of this run are present. It does not treat a cancelled or skipped matrix as a pass, unlike Dogfood Regression Gate: that gate has to publish a context on every PR, while this one is a proof.
  • Not required, never auto-labelled. No merge_group: trigger, no paths: filter, no labeler entry. The new names are not in REQUIRED_CONTEXTS (scripts/check-required-contexts.mjs), and neither name is or starts with Dogfood Regression Gate. The header lists what it must never grow (the 2026-09-01 opt-in ruling as quoted in pack-smoke-optin.yml, restated by ruling D).
  • Secrets / forks. It reads no secret and uses no github.token beyond the default read-only contents: read. ci.yml's turbo remote-cache lines are left out on purpose, because a pull_request run gets no remote credentials there either. A fork PR runs it the same way an internal one does, with nothing to hold back.
  • Merge preview. The checkout has no ref:, so it builds the merge preview like both precedents (the tree main will hold, the nearest thing to what the queue builds). The check suite of a pull_request run sits on pull_request.head.sha, so the verdict is still readable by head SHA.

Runner-minute estimate

Measured on the 30 most recent green merge-queue runs of ci.yml (2026-11-29T16:58Z to 2026-11-30T04:16Z, 90 Dogfood Regression Gate (k/3) jobs):

  • one shard job: 18.8 min median, 25.8 max (test step 14.3 median / 18.2 max, closure build 4.3 median / 7.2 max);
  • one labelled push ≈ 59 runner-minutes (61 billed with per-job rounding; 75 at the slowest), plus under a minute for the aggregate;
  • the ruling's figure, about 8 %: 12.5 breaking PRs a day against 164 queue builds a day, each queue build running the same three shards, gives 12.5 / 164 = 7.6 % more dogfood shard jobs, at one labelled push per PR. Each further push to a labelled PR is another ≈59 minutes. A re-read of the queue count gives 99 merge-group runs in the 24 h before 2026-11-30T04:16Z and 1,428 in the 7 days before it (≈204 a day; 12.5 / 204 = 6.1 %).
  • PR-side closure builds without the remote cache measured 4.8 min median / 6.2 max on the 27 green upgrade-harness-optin.yml runs (same closure, same restore-only seed), in line with the queue's build step, so the 30-minute budget keeps the queue's headroom.

Drift risk: two copies of one battery

ci.yml has no callable unit for this (no workflow_call, and no composite action for the dogfood steps), and ci.yml is outside this card's fence, so the shard steps are a copy. Nothing holds the two copies equal. If someone edits the queue's dogfood steps (a new env var, a different slice carrier, a new guard) and does not repeat the edit here, this lane goes on proving a different battery from the one the queue runs, and it stays green while it does. The header says so. A pin test, or a workflow_call extraction, is a follow-up the seat can choose (listed in the report, not built here).

Tests

A workflow has no unit test of its own. Every repo gate that reads it was run on the final head 9e8e9b2:

dispatch-gates --commands: 36 derived, 36 run, 36 exit 0

node scripts/pm/dispatch-gates.mjs --repo objectstack-ai/objectstack --ran FILE gave ✓ dispatch-gates --ran: 36 derived famil(ies) accounted for — 36 run, 0 NOT-MEASURED. Among them: check:required-contexts, check:pm-expected-skips, check:shard-attestation, check:stall-guard-budget, check:stall-guard-headroom, check:workflow-status-functions (also runs the context-availability check), check:workflow-step-name-quoting, check:aggregator-roster, check:pm-governed-merges, check:nul-bytes, check:pm-dispatch-gates (fast tier, 2686 cases, 409 s).

The first head (ff2fb61) went red on check:stall-guard-headroom: its self-test needs every guarded step name in the tree to be unique, and the copied step names matched ci.yml's. The second commit renamed the two guarded steps, and the gate is green.

Roster and tier readings
  • node scripts/pm/check-expected-skips.mjs --roster derives both new names, with nothing refused: Dogfood battery shard (${{ matrix.shard }}/3, opt-in) and Dogfood battery (opt-in), both gate: job-gate label opt-in needs:dogfood-battery; derived. So the skipped check runs on unlabelled PRs read as expected skips.
  • node scripts/pm/check-governed-merges.mjs --branch claude/issue-38694-dogfood-optin-lane: ⚖️ landing tier: H(人合), workflow split Tier H by content — a new workflow file: every trigger, job and permission in it is new; size +274 / −0.

No workflow linter (actionlint or similar) is installed in this repository. The YAML parses, and the workflow gates above are the repo's own lint for workflows.

Acceptance notes

  • dogfood-verify (Dogfood Verify CLI) is not included. The card names the three shards, and the queue does not run that leg either (it runs only in the full battery).
  • One head can carry several Dogfood battery (opt-in) check runs: every pull_request event starts a run, and one whose guard says no (an unrelated label added later) publishes it as skipped. The door must ask whether there is a success of that name on the head, and must not just read the newest one. The header says this.
  • A new workflow on a pull_request runs from the PR's own merge commit, so this PR is already running the lane, unlabelled (its jobs should read skipped). Labelling this PR once, after the label exists, would exercise a real run before landing. That is the seat's call. This PR does not add the label anywhere.
  • Re-running only the failed jobs of a run keeps the green shards' credentials (artifacts belong to the run), so a re-run can prove the same head.

Verification

Files to read first, by risk:

  1. .github/workflows/dogfood-optin.yml, the battery job's verify step: the only place a pass is decided.
  2. The same file, the two if: guards and the three concurrency groups (workflow, shard, battery): they decide what runs, and what a newer run cancels.
  3. The same file, the shard steps against ci.yml's dogfood job (around line 2966): the copy.

Two-minute check: open this PR's Checks tab. Dogfood battery shard (${{ matrix.shard }}/3, opt-in) and Dogfood battery (opt-in) should show as skipped, because the PR carries no needs:dogfood-battery label.

🤖 Generated with Claude Code

https://claude.ai/code/session_01ADHkmRJUY9Ncce14hVHd25

… head

A new opt-in workflow, gated on the `needs:dogfood-battery` label, runs
ci.yml's three dogfood shards on a pull request's merge preview and
publishes one aggregate check, `Dogfood battery (opt-in)`, on the head SHA.
It is not a required context, reads no secret, and has no paths filter and
no labeler entry.

Claude-Session: https://claude.ai/code/session_01ADHkmRJUY9Ncce14hVHd25
Co-authored-by: Claude <noreply@anthropic.com>
The stall-guard headroom tool keys a guarded site on its step name,
and its self-test holds those names unique across every workflow.

Claude-Session: https://claude.ai/code/session_01ADHkmRJUY9Ncce14hVHd25
Co-authored-by: Claude <noreply@anthropic.com>
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-steve · session_01ADHkmRJUY9Ncce14hVHd25

Final green head for review: 9e8e9b20e85651ea4f87826937caf393df98dc41 (read 2026-11-30T06:17Z: 30 check-runs success, 22 skipped, 0 failed or pending; mergeable clean). Card #38694, claim 7269534293, dev report 7270220596 on the card. check-governed-merges: Tier H (a new .github/workflows/** file), +274/−0 ≤ 3000. The two new check names publish skipped on this unlabelled head. Owed: L1 (L1-a); then the seat's labelled live run of needs:dogfood-battery (reads Dogfood battery (opt-in) = success on this head), Steve's OK on the workflow change, and os-zhuang's approval. The PR stays draft and lands through the owner seat.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-steve · session_01ADHkmQm8PTU4AkVU5kdwEv
L1-a, the seat's L1 thread · 2026-11-30T06:19Z · first review

席位核对

ACCEPT @ 9e8e9b2 (card #38694, ruling D on #38688; one new file, .github/workflows/dogfood-optin.yml, +274/−0; Tier H)

What I read against ci.yml's dogfood job (ci.yml:2966-3220), step by step

  • The closure build and the test step are the queue's: the same turbo run build --filter=@objectstack/dogfood --concurrency=4, and the slice in OS_TEST_SHARD=k/3 with no -- passthrough. Both carry the same VITEST_MAX_WORKERS cap and the same stall guard (--stall-minutes 10, with NODE_OPTIONS stall forensics). The completeness guard is the same too.
  • Dropped on purpose, each one fine for a PR-side proof: OS_SEED_ONLY, the TURBO_* remote lines, --summarize, the prune and save steps (main only), and the test-leftovers report (report-only).
  • The cache restore keys ${runner.os}-turbo-dogfood-${shard}-main- and so hits the queue's main seeds exactly: ci.yml saves ${runner.os}-turbo-${github.job}-${shard}-${github.ref_name}-${sha}, with github.job = dogfood and ref_name = main.
  • Credentials. --emit --job dogfood-optin --shard k --total 3 writes dogfood-optin-k-of-3.json (check-shard-attestation.mjs:288, :1651), which is exactly the file name the verify step counts. The emit and upload steps carry no if:, so a credential exists only when every step before it passed.
  • The verdict. battery passes only on needs.shard.result == 'success' with all three files present. A cancelled run (a newer push) or a skipped one is not a pass; that is right for a proof, as the header says.
  • Guards and concurrency. Both jobs carry the two-limb label guard. The workflow-level group gives an unrelated label's run a group of its own (run_id), so it never cancels a real run. The shard group carries the shard number, so the three legs do not cancel one another.
  • Not required, not auto-labelled. There is no merge_group: and no paths:. Neither name is or starts with Dogfood Regression Gate, and the roster derives both as label opt-in expected skips. At this head the unlabelled run published Dogfood battery (opt-in) and the shard row as skipped, as designed.
  • Security. pull_request, never pull_request_target; contents: read; no secret is read. A fork's code runs with the read-only token.
  • Action versions match ci.yml: checkout@v7, cache/restore@v6, upload-artifact@v7, download-artifact@v8.
  • Clause-②: no with skip-changeset is correct: the change publishes nothing.

Non-blocking

  • Drift. The body states the risk honestly: nothing holds the two copies equal. I recommend that the seat file the pin, a check that dogfood-optin.yml's shard steps equal ci.yml's dogfood steps less the listed omissions, or a workflow_call extraction. File it as a finding card now rather than after the first silent divergence.
  • A real run before landing. The seat's plan (create the label, label this PR once) exercises the success path. Everything I could check here is the skip path.

Checks at this head (read before writing): 30 success, 22 skipped, 0 failure, 0 pending; mergeable clean.
Dogfood: not owed (not a narrowing). L2: not owed (no Clause-②: yes, no packages/spec/src, no governed rule text). Landing: Tier H, by the maintainer's own review and merge (a new workflow).

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-steve · session_01ADHkmSAjFEZHRpRq3WCj6z

One verification run of the new opt-in lane before landing: needs:dogfood-battery added on head 9e8e9b20 (L1 ACCEPT 7270529850). The seat reads Dogfood battery (opt-in) and its three shard receipts on this head, then removes the label; the result goes into the PR body's Acceptance notes. The label's colour (006b75) and description go into scripts/pm/ensure-pm-labels.sh with #38688's landing-door change.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-steve · session_01ADHkmSAjFEZHRpRq3WCj6z

Contract-review-claim: session_01ADHkmSAjFEZHRpRq3WCj6z · head 9e8e9b2 · 2026-11-30T06:21Z

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-steve · session_01ADHkmSAjFEZHRpRq3WCj6z

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 9e8e9b20e85651ea4f87826937caf393df98dc41
Local-runs: none
Scope: .github/workflows/dogfood-optin.yml + none
Security-touching: yes
Rule-change-verified: none

Face: rules (.github/workflows/**). The diff is one new file, +274/−0; there is no remainder for the lane seat. Read against card #38694 (body, claim 7269534293, os-dev report 7270220596), ruling D (#38688 comment 7269391948), the dogfood job of .github/workflows/ci.yml on main (line 2966), the two precedents on main (pack-smoke-optin.yml, upgrade-harness-optin.yml), scripts/check-shard-attestation.mjs, and the check-runs on this head.

① Derived judgments

  • Accept-set: which PR events run the battery. Right. pull_request on main, types: [opened, synchronize, reopened, labeled], and both jobs carry the two-limb guard (label present now; on labeled, the label added is needs:dogfood-battery). Measured on this head: the opened run and the labeled skip-changeset run each published both names as skipped (runs 46363224724, 46363226769); the labeled needs:dogfood-battery event at 06:20:06Z started exactly one run (46365583981).
  • Accept-set: what success of Dogfood battery (opt-in) admits. Right. The verify step passes only on needs.shard.result == 'success' AND the three files dogfood-optin-{1,2,3}-of-3.json; the names agree with what --emit --job dogfood-optin --shard k --total 3 writes (attestationId in scripts/check-shard-attestation.mjs). A failed, cancelled or skipped matrix reaches exit 1 or leaves the job skipped; a cancelled run fails !cancelled(). I found no path to success with a shard missing: either limb alone already refuses it.
  • Public surface: two new check-run names and one label literal. Right. Neither name is, or is a prefix-equal of, Dogfood Regression Gate; REQUIRED_CONTEXTS on main does not hold them; git grep on main finds no other reader or writer of needs:dogfood-battery, and .github/labeler.yml is not in the diff.
  • Published packages. None. Nothing under packages/**.
  • Gate verdicts on the head. All concluded check-runs are success or an expected skipped, including Governed Surface Queue Guard, Lint · CI, release & engine gates, Lint · PM dispatch-gates, Lint & Repo Gates, Check Changeset, PR-body guards. No red, none pending at 06:38Z.
  • Verification run 46365583981 (event pull_request, attempt 1, this head): Dogfood battery shard (1/3, opt-in) success (06:20:12Z–06:35:30Z), (2/3, opt-in) success (–06:37:30Z), (3/3, opt-in) success (–06:35:03Z), Dogfood battery (opt-in) success (06:37:36Z, check run 141677001098, app github-actions). Three artifacts shard-attest-dogfood-optin-{1,2,3}-of-3 exist on the run. About 47.5 runner-minutes for the three shards, inside the PR's 59-minute estimate.

② Semver level

Nothing is published: one workflow file, no changeset, label skip-changeset, Check Changeset success on the head. Clause-②: no on the PR body is correct; no capability is narrowed and no spec file is touched.

③ Boundary flags

  • open_questions 1 (create the label). Answered by the seat: the label exists and was applied to this PR at 06:20:06Z. The ensure-pm-labels.sh line the dev names stays owed as a separate change (outside this card's fence); it is the seat's to carry.
  • open_questions 2 (one labelled run before landing). Answered, option A, and it is green on this head (① above). The seat decides whether the label stays on this PR; while it stays, every further push is another full run.
  • open_questions 3 (maintainer approval). Escalated, unchanged: Tier H by path and by content (a new workflow). This record does not replace the maintainer's approval.
  • Out-of-scope 1 (drift between the two copies). Real, and stated in the header. It has no card. It needs one: the lane's value to os-dev full-dogfood definition of done has no route once a gate past the foreground limit may not run in the background #38688's door depends on the copy staying equal, and nothing enforces that. Carrier: the devx seat.
  • Out-of-scope 2 (the door reads "a success of this name", not the newest). Confirmed on this head: three check runs named Dogfood battery (opt-in) exist, two skipped and one success. Carrier: os-dev full-dogfood definition of done has no route once a gate past the foreground limit may not run in the background #38688. See N1 for the second condition that reader needs.
  • Out-of-scope 3 (zero-job failure runs of the precedents on changeset-release/main). Not judged; outside the inputs. It does not affect a labelled PR's verdict, because an absent or failed check is never a proof.
  • Rule-change line. None is owed: no path of the diff is under .claude/**, so the queue guard does not read Rule-change-verified here. The value is none on the substance too. Merging this file changes nothing an agent may do without the maintainer, no dispatch or grading order, and nothing that must go to him: the landing door still reads the typed dogfood_battery field until os-dev full-dogfood definition of done has no route once a gate past the foreground limit may not run in the background #38688's change, and the header's "the seat hangs the label by hand" describes ruling D without enforcing anything.
  • Security-touching: yes is meant. The file sets the token scope of a new CI surface that executes PR code (permissions: contents: read, pull_request and never pull_request_target, no secret read), and it defines a check that a landing door will trust. I found no defect in that wiring (④). The PR is Tier H regardless of this line.
  • SQL push-down. Not applicable: no data access in the diff.

④ Design judgment

.github/workflows/dogfood-optin.yml, against the card's Done-when list:

  1. A labelled head gets one run of the three shards and a conclusion readable by head SHA; an unlabelled PR gets none. Holds, and is measured on this head (①). The check runs sit on pull_request.head.sha as the header says.
  2. Not in the required checks; nothing adds the label automatically. Holds. No merge_group:, no paths:, no labeler entry, no step that writes a label; the names are outside REQUIRED_CONTEXTS.
  3. The PR names the runner-minute estimate and the label. Holds: 59 runner-minutes per labelled push, 12.5 / 164 = 7.6 % against the ruling's "about 8 %", label needs:dogfood-battery.

Against ci.yml's dogfood job on main, step by step:

  • Same: runs-on, timeout-minutes: 30, matrix [1, 2, 3], checkout action, setup-workspace, the closure build command and --concurrency=4, NODE_OPTIONS on both guarded steps, --stall-minutes 10, the worker cap, OS_TEST_SHARD=k/3 in the environment with no -- passthrough, the completeness guard (same outcome on both branches), the stall-report upload, the emit and upload pair last with no if:.
  • The restore key resolves to the queue's seeds: turbo-dogfood-k-main- is ci.yml's turbo-${{ github.job }}-k-${{ github.ref_name }}- for the push runs that save.
  • Different, each declared in the header and each without effect on what is tested: no --summarize (it feeds only the prune step), no remote-cache env (a pull_request run of ci.yml gets an empty token too), no seed-only path, no cache save or prune, no leftovers report, fail-fast: false, artifact retention 7 days.
  • Different in substance, declared: the tree is the merge preview of the head at event time, where the queue builds the merge-group commit. The card says "on the PR head"; the precedents read the same phrase the same way, and the queue re-runs the shards on the tree that lands. Accepted.

Attempts to break it:

  • Fork or untrusted head. pull_request, token contents: read, no secrets.*, no vars.*. Every ${{ }} inside a run: block is matrix.shard (a literal) or runner.temp; the head SHA reaches the shell through env. The label name appears only in if: expressions. No injection path and nothing to exfiltrate. The cache is restore-only, so a fork run cannot write main's seeds.
  • Unrelated label on the same head. Both jobs skip. The workflow-level group gets github.run_id, so it cancels nothing. The shard job-level group names matrix.shard, which a job skipped before matrix expansion never evaluates. The battery job-level group is the precedents' shape (pack-smoke-optin.yml:109, upgrade-harness-optin.yml:78, whose header records "a skipped run never cancels a real one"); this head gives no measurement of it, and the exposure is the few seconds the battery job is running. The result is an extra skipped check of the same name, which the header tells the reader to expect.
  • The head moves while a run is in flight. The workflow-level group cancels the old run; its battery job fails !cancelled() and publishes no success on the old head. The new head gets its own run.
  • Success with a shard missing. Not reachable (①). Re-running failed jobs keeps earlier credentials, but needs.shard.result is success only when every leg of the latest attempt succeeded.
  • Check name forged from another PR. See N1.

No must-fix, no should-fix.

Nits (no effect on this file's correctness; a fix here moves the head, so they are left as accepted deviations or carried):

  • N1 (nit) — "What the door reads" says a success of the name on the head is the proof. A pull_request run takes its workflow from the PR's own merge commit, so a PR that edits dogfood-optin.yml (or adds any job of that name) can publish that success without running a shard. Such a PR is Tier H by path and the queue still runs the real shards, so the damage is bounded to one queue ejection. The door needs a second condition: the PR's file list does not touch this workflow. Carrier: os-dev full-dogfood definition of done has no route once a gate past the foreground limit may not run in the background #38688's door change, beside out-of-scope 2.
  • N2 (nit) — the header's cost line reads "18.8 min median, 25.8 max, so … about 59 runner-minutes (… 75 at the slowest)". Three times 18.8 is 56.4 and three times 25.8 is 77.4, so 59 and 75 are per-run sums, not products of the per-shard figures; the "so" does not follow. The figures themselves are consistent with the live run (47.5 minutes). Accepted deviation.
  • N3 (nit) — the battery job counts files with a shell loop instead of check-shard-attestation.mjs --verify, so the attempt stamp in the credential is not read. The needs.shard.result == 'success' limb closes every stale-credential case I could construct. Accepted deviation.

Implemented-by: claude/issue-38694-dogfood-optin-lane
Reviewed-by: session_01ADHkmSAjFEZHRpRq3WCj6z

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-steve · session_01ADHkmSAjFEZHRpRq3WCj6z

Verification run done: run 46365583981 on head 9e8e9b20 (label added 06:20Z) concluded success at 06:37Z — Dogfood battery shard (1/3, opt-in), (2/3), (3/3) and Dogfood battery (opt-in) all success, three shard-attest-dogfood-optin-*-of-3 artifacts present, about 47.5 runner-minutes for the three shards. needs:dogfood-battery removed so further pushes do not re-run the lane.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-steve · session_01ADHkmSAjFEZHRpRq3WCj6z

维护者速读

Seat opinion: land as is. One new file, the shape of the two opt-in precedents; the verification run 46365583981 on this head passed all three shards and the verdict job.

席位核对

ACCEPT at head 9e8e9b20e85651ea4f87826937caf393df98dc41 · Tier H (.github/workflows/**) · Fixes #38694

  1. Shape: one new file, .github/workflows/dogfood-optin.yml (+274/−0); ci.yml, .github/labeler.yml and scripts/pm/** untouched.
  2. Premise measured: ruling D on os-dev full-dogfood definition of done has no route once a gate past the foreground limit may not run in the background #38688 (7269391948); the battery copies ci.yml's dogfood job on main; an unlabelled PR's jobs skip (runs 46363224724, 46363226769), the labelled event ran once (46365583981, all success, about 47.5 runner-minutes).
  3. Gates: check-runs on this head 34 success, 30 expected skip, 0 failed; skip-changeset (nothing published).
  4. Accepted deviations: none.
  5. Out of scope and where it went: the landing door's read of Dogfood battery (opt-in) by head SHA rides os-dev full-dogfood definition of done has no route once a gate past the foreground limit may not run in the background #38688 (PR fix(pm): the landing door reads the opt-in dogfood lane's check run on a breaking PR's head #38727); the drift pin between ci.yml's dogfood job and this file is owed by the seat as a card.
  6. Landing: L1 ACCEPT 7270529850 and L2 contract review PASS 7270873623 on this head; maintainer's OK for the workflow change on the seat's decision card, 2026-11-30T08:14Z. Lands after os-zhuang approves.

ACCEPT → PR #38705 comment 7270529850 · Contract review → comment 7270873623

@objectstack-fleet objectstack-fleet Bot removed the pm:awaiting-merge PR only: landing waits on the maintainer's own review and merge (SKILL.md 复核 ②); never on an issue label Nov 30, 2026
Nenzyz pushed a commit to Nenzyz/objectstack that referenced this pull request Dec 1, 2026
…n a breaking PR's head (objectstack-ai#38727)

<!-- claude-projects-attribution: {"github_login":"os-steve"} -->
_Requested by **Steve** · [project
thread](https://claude.ai/code/project/chan_01FdL1XeUyvVNxLreh3F4Qi9?thread=cmsg_01FdL1XeUyvVNxLreh3F4Qi98ZAtPQK4A8ABvN79TALFDE)_
Fixes objectstack-ai#38688
Clause-②: no
Metadata-protocol: none
Rule-change: yes

## 维护者速读

-
用户无感;只改内部合并流程:破坏性改动要排队合并时,合并门不再看开发代理自己填写的「回归已跑」一栏,改看云端流水线在这个改动最新提交上的真实结果;开发代理也不再在本机跑完整的真实应用回归。
- 兑现你在「破坏性改动的完整回归,今后在哪儿跑」上选的「云端流水线代跑」里合并门这一半,替开发代理解决本机跑不完、结果只能靠自报的问题。
-
出错只会往「拦多了」的方向错:没打专用标签、或云端没跑出通过结果的破坏性改动,一律被合并门拦下并提示去打标签、等结果;撤回这一个改动即可恢复原样。它必须排在云端流水线那个改动之后合并,否则所有破坏性改动都会被拦在门外。
- 要你做什么:这改了开发代理的工作规则,合并前需要你批准。

Lands after: objectstack-ai#38694 (PR objectstack-ai#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 objectstack-ai#38705
(card objectstack-ai#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 objectstack-ai#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 objectstack-ai#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 → objectstack-ai#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 objectstack-ai#38705 (the lane). PR objectstack-ai#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 objectstack-ai#38735; `os-dev.md`
line 90 is PR objectstack-ai#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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci/cd size/m skip-changeset PR has no user-facing published change; bypasses the changeset gate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ci: a label-gated lane runs the three dogfood shards on a breaking PR's head, outside the required set (ruling D on #38688)

3 participants