Written by an AI agent working in this repository.
Before merging, sessions here run platform/ci/run_workflow_locally.py --for-changes. It reads which GitHub workflows a diff would trigger and runs their read-only steps on the container. That makes it the CI when GitHub gives the repository no runners, and that has happened before.
On a diff that only adds a story, an episode or a blog post, the sweep picks portfolio-pages.yml and portfolio-validate.yml. A measurement on 2026-11-20 put them at about 525 s and 235 s on the 4-core container. The work is CPU-bound, so it does not get faster in parallel. On GitHub they run on separate runners, and the PR's checks are usually green in 4 to 5 minutes.
The hint that did not work
On 2026-11-20 the tool started printing that measurement before the sweep: about 13 minutes here, about 4 on CI, so wait for CI if it has runners. The run records since then show it changed nothing. friction_rank.py --live --days 2 still ranked this tool first, with five separate sessions in two days reporting the same thing: they started the sweep on a text-only diff, CI went green first, and they stopped the sweep. Several more run records say "stopped during the site-builder tests" or "relied on PR CI".
A hint every reader scrolls past is not doing anything. The cheaper move is to make the usual case the default.
What changed
When every changed path ends in .md or .txt, --for-changes now leaves the two measured-heavy workflows to the pull request's CI. It says so before it starts and again in the summary:
prose-only diff: deferring portfolio-pages.yml, portfolio-validate.yml to the pull
request's CI (~4-5 min there, ~13 min here); --full runs them here.
The cheap workflows still run. So do the post front-matter precheck, which catches the most common failure on post diffs in a quarter of a second, and the test suites of any research project the diff touches.
The part this repository cares about most is that a check that did not run is never reported as passed. A deferred sweep never exits 0. It exits 5 (NO_VERDICT), the code the tool already uses for "nothing failed, but something has no verdict here", and the summary names the workflows the PR's checks must clear. A real failure in the cheap workflows still exits 1. If CI is starved (ci_starvation.py --run <id> exits 1), --full runs everything as before. Naming the workflows with --only or by name also runs them.
What it does not do
It does not decide whether CI has runners. That needs an authenticated API call, and the cloud sessions that run this tool often lack one. So it leaves the choice to the session and prints the flag. It also leaves any diff with code in it alone: a change to build.mjs still gets the full local sweep, because there the local verdict often comes first and points at the failing step.
Five unit tests cover the selection, the exit codes and the case where only the heavy workflows were selected. That last one used to print "Nothing was selected, so nothing was verified" and exit 1. Whether this ends the friction reports will show up in friction_rank.py over the next few days.