Repository navigation
feat(team): the CI runner is a brain setting, rendered into the workflows - #102
Merged
Merged
Conversation
…rkflow
GitHub passes no repository variables to a fork's pull_request run unless it also
passes the secrets, so ci's runs-on: ${{ vars.KM_RUNNER || 'ubuntu-latest' }} sent a
fork's ci, the main contribution path, to GitHub's runners. The runner is now
runner: <label> in schema.local.yaml (default ubuntu-latest), read by a line reader
that km validate, km upgrade and km doctor cross-check against YAML where PyYAML is
at hand: km init --team (--runner) and km upgrade write it as a literal into every
runs-on line. bump-mounted-pins keeps MOUNTED_PINS_RUNNER first: it never runs on a
pull request. The tools step runs on self-hosted runners (runner.environment), never
in automerge's App-token job.
A shipped copy with any runner written into it is still km's (SHIPPED is checked
with the runner put back). ci.yml is km's on the brain's runner only: without the
setting a label set by hand makes it the brain's own, so no approve-fork-ci or
automerge is added or widened beside it. km upgrade rewrites km 1.22's KM_RUNNER line
in ci.yml and staleness.yml, says first that the jobs moved to ubuntu-latest with the
variable's value where gh reads it, re-renders a changed label, and leaves a
staleness.yml with a job of the brain's own.
…o longer reads A setting km cannot use fails; a workflow still reading KM_RUNNER, or on another runner than the setting, gets a note to run km upgrade; a KM_RUNNER variable gh can read gets a note to move it into the setting and delete it; a runner other than ubuntu-latest gets the note that a fork's pull request runs ci there.
pasrom
force-pushed
the
feat/runner-setting
branch
from
November 18, 2026 13:06
01f92e2 to
e5ffaf1
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
km 1.22 runs every team job on
${{ vars.KM_RUNNER || 'ubuntu-latest' }}. GitHub passes no repository or organisation variables to a fork'spull_requestrun unless "Send secrets and variables to workflows from fork pull requests" is on, and that also sends the secrets (observed on 2026-11-18: a fork's pull request ci run in a private repository with that option off ran onubuntu-latestalthough the repository hadKM_RUNNERset). So a fork's ci, the main contribution path, falls back toubuntu-latestwhatever the brain set. A literal label inci.ymlreaches that run.What
runner: <label>inschema.local.yaml(defaultubuntu-latest). km reads it with a small line reader inkm.runner, without PyYAML, sokm doctorcan use it too. Where PyYAML is at hand (validate, upgrade, init, and doctor if installed), the file as YAML reads it must agree with the line, so a quoted key,runner : x, a BOM, a flow map, a block value orrunner:xis refused. A value YAML would read as no string (true,on,123,2026-01-01,0b101,1.5e-3, ...) is refused too.km validatefails on it, andkm upgradestops before writing.km init --team [--runner LABEL]andkm upgradewrite the label into theruns-online of every job in ci, staleness, main-guard, approve-fork-ci, review-request-guide, automerge and bump-mounted-pins.MOUNTED_PINS_RUNNERfirst (${{ vars.MOUNTED_PINS_RUNNER || '<label>' }}). It runs only on a schedule or by hand, never on a pull request, so the variable always reaches it. It stays useful for a runner without docker.SHIPPEDkeeps its earlier hashes, and a copy also counts once the runner km wrote is put back to the placeholder.ci.ymlis km's only on the brain's runner, onubuntu-latest, or on 1.22's line. Without the setting, a label set by hand makes it the brain's own, so approve-fork-ci and automerge are not added or widened beside it, as on main. With the setting, km'sci.ymlon another label is moved to the setting's label. An expression km did not write stays the brain's own, with a note to replace it by hand.staleness.yml(it pins km) is km's when its only job isdemote. It never runs on a fork's pull request, so its own steps, such as another cron, do not matter. A staleness with an extra job keeps everyruns-on, with a note naming the jobs.runner.environment != 'github-hosted', so it runs on self-hosted runners only. The automerge act job keeps&& needs.decide.outputs.app != '1', so the App-token job never downloads a tool. Thepull_request_targetjobs still never check out the pull request.Migration (km upgrade on a 1.22.x brain)
ci.ymlandstaleness.ymlwith thevars.KM_RUNNERline (withtimeout-minutes: 15) are rewritten to the brain's runner. So are older ones that haveubuntu-latest. The shipped copies are updated as usual.KM_RUNNERand says they now run onubuntu-latest. Where gh can read the variable (the repository's, else the organisation's), it gives the value and the exactrunner:line to add, and never suggests a value the setting would refuse. If the setting is already there, or the variable isubuntu-latest, a plain note says to delete the variable.schema.local.yamlnames no runner, a label set by hand in ci or staleness is left alone, with a note to move it into the setting.km doctorreports:KM_RUNNER;ci.yml, with or without the setting;KM_RUNNERvariable, telling you to move it, or to delete it once it is moved and upgraded;Tests
tests/runner_smoke.sh, now run in CI. Fixturestests/fixtures/team-1.22/hold the 1.22.0/1.22.1 templates, which are identical. It covers:--runner;runs-onforms (an expression km never wrote, a comment);team_smoke.sh:runs-onis the label, and noruns-onthat a pull request can start readsvars.;runner.environment, and the App-token job never downloads;runner_smoke.shalso covers:ubuntu-latest;doctor_smoke.sh: the new notes, and thatTEAM_WORKFLOWSmatcheskm.init.TEAM.Plugin evals
skills/km/reference/setup.mdchanged. I ran the cases for its dispatch-table rows:doctor(doctor, init, upgrade) andsync. Command:claude plugin eval . --scaffold --no-publish --ablation none --allow-tools Bash Write Edit --case <case> --runs 3, on 01f92e2. The later review fixes changed nothing underskills/, so the runs still apply. No grader changed, so I ran no baseline.Not done here