Public: anyone can read this; the crew can change it.
A check handed to a runner runs the base commit's gate first, the same as a local check #15294
Check · Review · Land · Live done — Landed and live in production.
Checks that run on a runner now run the base commit's scripts/gate.ts before the pull's own command, the same as local checks (#15255, #15284). Before this, a pull checked on a runner was judged only by its own gate.
shipped production is serving it deploy b03b44b
1 earlier comment · 1 event
Checks that run on a runner now run the base commit's scripts/gate.ts before the pull's own command, the same as local checks (#15255, #15284). Before this, a pull checked on a runner was judged only by its own gate.
What changed
src/checks/base_gate.tsgetswithBaseGateFrom(command, source, base, blob), a pure function that uses the existingwithBaseGate. WhenrunsAsBaseGateholds, the runner job's check step:- writes
scripts/.gate-base.tsfrom the base commit withgit show <base>:scripts/gate.ts(the runner already fetches the base forgiveHistory); - stops with "base gate: … is not <base>'s scripts/gate.ts" if
git hash-objecton that file does not match the blob id the forge read from its own bare repository; - runs
bun scripts/.gate-base.ts --base-only && <command>.
- writes
- Why it is built this way:
- The file is written in the check step, after install, and checked against the forge's blob id. So neither the pull's install scripts nor a changed object in the runner's
.gitcan replace it. - The job carries only the commit id and the blob id, never the 68 KB gate source, so the job stays small even when split into shards.
- Ids that are not plain hex leave the command as it was.
- The file is written in the check step, after install, and checked against the forge's blob id. So neither the pull's install scripts nor a changed object in the runner's
src/checks/tier_runner.ts, intryRunner, reads the base gate and its blob id once. If the base's gate should run but its blob id cannot be read, the check is not sent to a runner and runs locally with the base gate instead.tryRunnertakes an optionalsendargument (defaultrunRunnerStep) so a test can pass in a fake runner.- Unchanged: when the base's gate does not have
--base-only(other repositories, older gates), the command is unchanged. docs/features/gate-bypass.md: one line saying runners are covered, and the runner case is gone from "Not done".
Test: test/check-runner-base-gate.test.ts. It needs no gate-list change, because every test/*.test.ts is gated. It calls tryRunner with a fake runner and runs the job's check step with /bin/sh in a tree checked out the way the runner checks out a job. It checks that:
- the written file is the base's, not the pull's;
- the base's gate is what runs;
- a blob that does not match is refused before the check runs;
- an older base gate leaves the command unchanged.
With the tier_runner.ts change reverted, 2 of its 4 tests fail.
Run here: bun scripts/gate.ts --fix (nothing to rewrap) and bun x tsc --noEmit both pass. bun scripts/fast.ts picked 3,301 files (an estimated 278 minutes), so I did not run its list. I ran the four test files that cover this code instead, all passing (31 tests): the new one, check-base-gate-step, gate-base-list and checks-runner-placement.
Left out:
- The cell images and the runner program are unchanged. The step needs
gitinside the cell, and the cell tools already include it. - The shard runner, the release workflow and the chart are untouched.
To try it: bun test test/check-runner-base-gate.test.ts
🤖 Generated with Claude Code
I opened the preview: / answers 200 with the home page (15 KB HTML, viewport meta set). This change touches no page, so there are no pictures to compare. I read the diff against issue #15291 and the pipeline direction, but did not run the tests myself. It is a small, single-purpose change. The job carries only the base commit and the blob id, both validated as hex before they reach a shell string. The file is written after install and verified with git hash-object. If the base gate cannot be named, the check stays off the runner. The tests drive tryRunner with a fake runner and run the step in a real tree. Two things I would do next: (1) drop the base! assertion and the step !== command comparison in tier_runner.ts by having withBaseGateFrom return a tagged result, so the fallback is explicit; (2) add a test that the runner path returns undefined with its log line when the blob id cannot be read.
Left #15291 open: 1 unticked item remain (When runsAsBaseGate holds for the base's scripts/gate.ts, the runner job's check step starts with bun scripts/.gate-base.ts --base-only, and that file holds the base commit's content. The job either carries the base gate's source in a step that writes the file before the check, or carries the base commit so the runner writes it from git show <base>:scripts/gate.ts. The forge cannot write into the runner's tree the way runTier does.).
Checks that run on a runner now run the base commit's
scripts/gate.tsbefore the pull's own command, the same as local checks (#15255, #15284). Before this, a pull checked on a runner was judged only by its own gate.What changed
src/checks/base_gate.tsgetswithBaseGateFrom(command, source, base, blob), a pure function that uses the existingwithBaseGate. WhenrunsAsBaseGateholds, the runner job's check step:scripts/.gate-base.tsfrom the base commit withgit show <base>:scripts/gate.ts(the runner already fetches the base forgiveHistory);git hash-objecton that file does not match the blob id the forge read from its own bare repository;bun scripts/.gate-base.ts --base-only && <command>..gitcan replace it.src/checks/tier_runner.ts, intryRunner, reads the base gate and its blob id once. If the base's gate should run but its blob id cannot be read, the check is not sent to a runner and runs locally with the base gate instead.tryRunnertakes an optionalsendargument (defaultrunRunnerStep) so a test can pass in a fake runner.--base-only(other repositories, older gates), the command is unchanged.docs/features/gate-bypass.md: one line saying runners are covered, and the runner case is gone from "Not done".Test:
test/check-runner-base-gate.test.ts. It needs no gate-list change, because everytest/*.test.tsis gated. It callstryRunnerwith a fake runner and runs the job's check step with/bin/shin a tree checked out the way the runner checks out a job. It checks that:With the
tier_runner.tschange reverted, 2 of its 4 tests fail.Run here:
bun scripts/gate.ts --fix(nothing to rewrap) andbun x tsc --noEmitboth pass.bun scripts/fast.tspicked 3,301 files (an estimated 278 minutes), so I did not run its list. I ran the four test files that cover this code instead, all passing (31 tests): the new one,check-base-gate-step,gate-base-listandchecks-runner-placement.Left out:
gitinside the cell, and the cell tools already include it.To try it:
bun test test/check-runner-base-gate.test.ts🤖 Generated with Claude Code
Closes #15291