Repository navigation
Commit a1ef710
ci: label-gated lane runs the three dogfood shards on a breaking PR's head (#38705)
<!-- claude-projects-attribution: {"github_login":"os-steve"} -->
_Requested by **Steve** · [project
thread](https://claude.ai/code/project/chan_01FdL1XeUyvVNxLreh3F4Qi9?thread=cmsg_01FdL1XeUyvVNxLreh3F4Qi98ZAtPQK4A8ABvN79TALFDE)_
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 **9e8e9b20**:
<details><summary>dispatch-gates --commands: 36 derived, 36 run, 36 exit
0</summary>
`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.
</details>
<details><summary>Roster and tier readings</summary>
- `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.
</details>
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.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 80ddfb5 commit a1ef710
1 file changed
Lines changed: 274 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
0 commit comments