#!/usr/bin/env bash # Did a push touch code, or only documents? The `changes` job of .github/workflows/ci.yml feeds the changed paths on # stdin; the answer is one line, `code=true` or `code=false`. A docs-only push (every path under docs/ or site/, or a # *.md anywhere) skips the two compile-or-compute jobs (igneum-pow tests, the simulators), which read none of those # paths, so the box's one runner queue carries only runs that can change their result (7 October 2026, 13:03Z to # 14:15Z: 31 runs queued on igneum-build-1, most of them status-document pushes, and no lane could read a conclusion). # The tree gate (site build, link check, identity grep, the unit tests) runs on ubuntu-latest for every push as before. # # An empty list (the compare API answered nothing, a new branch, a force push) answers code=true: when in doubt, run. # # printf 'docs/a.md\nsite/x.html\n' | tools/ci/docs-only-check.sh # code=false # printf 'docs/a.md\nigneum-pow/src/lib.rs\n' | tools/ci/docs-only-check.sh # code=true # tools/ci/docs-only-check.sh --self-test set -euo pipefail classify() { # stdin: paths, one per line; prints code=true|false local p any=0 code=0 while IFS= read -r p; do [ -n "$p" ] || continue any=1 case "$p" in docs/*|site/*|*.md) ;; *) code=1 ;; esac done if [ "$any" = 0 ] || [ "$code" = 1 ]; then echo code=true; else echo code=false; fi } if [ "${1:-}" = "--self-test" ]; then fails=0 t() { local want="$1" got; shift; got="$(printf '%b' "$1" | classify)"; [ "$got" = "$want" ] || { echo "self-test failed: paths [$1] gave $got, expected $want"; fails=1; }; } t code=false 'docs/plans/x.md\nsite/index.html\nREADME.md\ndocs/plans/counter-asic-3-gate/a.json\n' t code=true 'docs/plans/x.md\nigneum-pow/src/lib.rs\n' t code=true 'tools/ci/pre-push.sh\n' t code=true 'site/build.mjs\n.github/workflows/ci.yml\n' t code=true 'sim/finality_v2.py\n' t code=true '' t code=true 'docs.rs/x.md\nproto-cuda/host.cu\n' t code=false 'CLAUDE.md\n' [ "$fails" = 0 ] && echo "self-test passed: docs/, site/ and *.md alone answer code=false; any other path, or no path at all, answers code=true" exit $fails fi classify