You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
CI shepherd: wait/merge/re-merge/rerun deterministically, failure digest + local repro, bounded fixer hook (was: merge watcher upgrades) #4790
Scope expanded (owner, 2026-10-09): a CI shepherd. Ushering PRs through CI currently takes hours: an LLM does the waiting and polling, reads raw logs, treats every red result as a code problem, and re-pushes to test a fix. Move all waiting and sorting into a deterministic script, and call an LLM only with a pre-digested real failure.
State machine per PR (replaces handoffs/tools/merge_watch.sh + merge_train.sh; runs every ~10 min, then as a scheduled routine/workflow):
State
Action (no LLM)
pending
wait
green
pr_check.py N --merge; then cics_census.py history append --pr N
The shepherd keeps a dependency map for stacked PRs (as merge_train.sh does) and a merge order for PRs that touch the same generated files.
Digest: pr_check.py N --digest. Per failed check:
the last ~60 lines of the failed step (gh run view --log-failed, trimmed) plus the error/FAILED/assert lines;
the local repro command, from a committed table (tests/tools/ci_repro.toml): e.g. ruff-audit → python tests/ruff_audit.py --ci; mypy-audit → python tests/mypy_audit.py --ci; det → proof_sweep.py --det-only --cases <failed cases>; full-suite → pytest <failed node ids>; golden → golden-lock.sh python tests/tools/crucible_check.py.
The digest goes to a file and to the job summary.
Fixer hook. One bounded task: "here is the digest and the repro; make the repro pass; commit". The fixer never waits for CI and never pushes; the shepherd pushes. The backend is chosen per call: agy via ~/.local/bin/agy-worker, which now flags soft-denials with exit 3, or a Claude worker.
Also (original scope): post a note when a PR goes dirty or stale; append census history after each merge; commit the scripts to tests/tools/box/ with a README; optionally run as a scheduled routine.
changed the title [-]merge watcher: detect dirty / stale-evidence PRs, append census history after merges, run as a scheduled routine[/-][+]CI shepherd: wait/merge/re-merge/rerun deterministically, failure digest + local repro, bounded fixer hook (was: merge watcher upgrades)[/+]on Oct 9, 2026
Not done: the bounded fixer hook (needs an LLM API; owner parked it) and auto re-merge of generated-only conflicts (mostly moot since generated pages moved to the generated branch, #4827). Both are tracked in #4847.
Activity
squid-protocol commentedon Oct 9, 2026
Scope expanded (owner, 2026-10-09): a CI shepherd. Ushering PRs through CI currently takes hours: an LLM does the waiting and polling, reads raw logs, treats every red result as a code problem, and re-pushes to test a fix. Move all waiting and sorting into a deterministic script, and call an LLM only with a pre-digested real failure.
State machine per PR (replaces
handoffs/tools/merge_watch.sh+merge_train.sh; runs every ~10 min, then as a scheduled routine/workflow):pr_check.py N --merge; thencics_census.py history append --pr Ndet_coverage_ledger.py split --base/update,register.py render, …), push; post one PR notegh run rerun --failed, onceThe shepherd keeps a dependency map for stacked PRs (as
merge_train.shdoes) and a merge order for PRs that touch the same generated files.Digest:
pr_check.py N --digest. Per failed check:gh run view --log-failed, trimmed) plus the error/FAILED/assert lines;tests/tools/ci_repro.toml): e.g. ruff-audit →python tests/ruff_audit.py --ci; mypy-audit →python tests/mypy_audit.py --ci; det →proof_sweep.py --det-only --cases <failed cases>; full-suite →pytest <failed node ids>; golden →golden-lock.sh python tests/tools/crucible_check.py.The digest goes to a file and to the job summary.
Fixer hook. One bounded task: "here is the digest and the repro; make the repro pass; commit". The fixer never waits for CI and never pushes; the shepherd pushes. The backend is chosen per call: agy via
~/.local/bin/agy-worker, which now flags soft-denials with exit 3, or a Claude worker.Also (original scope): post a note when a PR goes dirty or stale; append census history after each merge; commit the scripts to
tests/tools/box/with a README; optionally run as a scheduled routine.Build order:
--digest+ repro table.Related: #4814 (shorter CI, fewer full sweeps), #4813, #4811 (fewer generated-file conflicts).
🤖 Generated with Claude Code
[-]merge watcher: detect dirty / stale-evidence PRs, append census history after merges, run as a scheduled routine[/-][+]CI shepherd: wait/merge/re-merge/rerun deterministically, failure digest + local repro, bounded fixer hook (was: merge watcher upgrades)[/+]ci_shepherd: one queue, one process -- merge when green, rerun infra/…
CI shepherd: ci_digest (triage + error lines + local repro) and ci_sh…
squid-protocol commentedon Oct 10, 2026
Progress (2026-10-10):
ci_digest.py/pr_check.py --digest: triage (dirty / infra / flake / real), error lines + log tail, local repro (CI shepherd: ci_digest (triage + error lines + local repro) and ci_shepherd (merge / rerun / one note per head) (Part of #4790) #4819); job logs with ANSI escapes and registry rate limits handled (ci_digest: read job logs that hold ANSI escapes (--allow-escape-sequences) #4823).tests/tools/box/ci_shepherd.py: one queue, flock run lock, merges green PRs, infra reruns ×3 15 min apart, one note per head (CI shepherd: ci_digest (triage + error lines + local repro) and ci_shepherd (merge / rerun / one note per head) (Part of #4790) #4819, ci_digest: read job logs that hold ANSI escapes (--allow-escape-sequences) #4823). In use since 2026-10-09.🤖 Generated with Claude Code
ci shepherd: main's own failures labelled main; non-required infra fa…
ci shepherd: update a green PR's branch when it is behind main (#4790) (
ci shepherd: log every queued PR every pass; rerun a cancelled non-re…
squid-protocol commentedon Oct 10, 2026
Done; closing. Delivered 2026-10-09/10:
shepherd:merge→ approval bound to the labelled commit → GitHub auto-merge; plushold/matrix/fullandDepends on #N. The local runner stays as a fallback.gh pr update-branchfor PRs that are behind and green (ci shepherd: update a green PR's branch when it is behind main (#4790) #4842); the label survives the bot's own update.ci_digest.py/pr_check --digest(ci_digest: read job logs that hold ANSI escapes (--allow-escape-sequences) #4823, ci shepherd: main's own failures labelled main; non-required infra failures stop blocking after 3 reruns; keep watching an empty queue (#4790) #4830), posted once per head on a real failure.docs/ci.md.Not done: the bounded fixer hook (needs an LLM API; owner parked it) and auto re-merge of generated-only conflicts (mostly moot since generated pages moved to the
generatedbranch, #4827). Both are tracked in #4847.🤖 Generated with Claude Code