Repository navigation
feat: name a required workflow that has no file - #189
Merged
Merged
Conversation
config/repos.yaml declares required_workflows per group and ci_status.rollup()
scores a repo over exactly those. A required workflow with no runs is not scored
as a failure — it just never satisfies all_green, so the repo sits at
{"conclusion": "", "status": "in_progress"} forever: able to go red, never able
to go green, and never CI-clean to the readiness gate. On the dashboard that is
indistinguishable from a run in flight, which is why the state survives
unnoticed until a human spots the asymmetry.
heart/checks/required_workflow_drift.py makes it nameable. The runs payload
ci_status already fetches cannot separate the two causes of "no runs" — no
workflow file, versus a file that has never run on main. Only the workflow list
can, so that is the one call added: GET /repos/{owner}/{repo}/actions/workflows,
one per repo in a group that gates (17 today), in parallel, the same cheap
metadata read ci_status.sh already makes twice per repo.
Matching is on each workflow's `name` field, never its filename: `name` is what
ci_status matches runs against, so a filename-based check could pass while the
roll-up still starves.
Classified YELLOW and as a configuration finding rather than red CI — the repo's
code is fine, its gate is not wired up, and red would misattribute the fault.
Mirrors manifest_drift's shape (own sidecar, readiness caution, available:false
when it cannot run). Degradation is honest: no gh (the web/mobile session) skips
the check, and a per-repo fetch error becomes a stale "unverified" reason rather
than an implied pass — otherwise a missing gate could hide behind a 403.
Names no instance fact, so it needs no tenant-firewall allowlist entry; verified
with repos_sync.py --only "tenant firewall (organ code)", including a canary that
confirms the gate does scan the new files.
15 new tests; full suite 656 passed.
Refs PyAutoMind draft/feature/pyautoheart/required_workflow_file_drift.md
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KmWbYJw4cJJnt4eK6NoZjL
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.
Closes #188.
The defect
config/repos.yamldeclaresrequired_workflowsper group andci_status.rollup()scores a repo over exactly those. A required workflow with no runs at all is not scored as a failure — it simply never satisfiesall_green, so the repo sits at{"conclusion": "", "status": "in_progress"}forever: able to go red, never able to go green, and never CI-clean to the readiness gate.On the dashboard that is indistinguishable from a run is in flight, which is why the state survives unnoticed. One workspace repo sat in it from whenever it joined its group until 2026-08-24, when a human noticed the asymmetry. A survey of all 15 repos across the four gating groups found it was the only instance and it has since been fixed — so this is a guard against the hole reopening, not a bug hunt. It reopens on every edit to
config/repos.yaml: adding a repo to a group, or a workflow to a group's required list, silently makes repos un-greenable and produces no red anything.What this adds
heart/checks/required_workflow_drift.py— for every repo in a group that declaresrequired_workflows, assert a workflow exists whosenamematches each required entry.Two things it gets right on purpose:
ci_statusalready fetches cannot separate the two causes of "no runs" — no workflow file, versus a file that has never run onmain. OnlyGET /repos/{owner}/{repo}/actions/workflowscan, and the second case is genuinely pending and must stay pending.name, never the filename.nameis whatci_statusmatches runs against, so a filename-based check could pass while the roll-up still starves. A test pins this.Wiring:
state.pyaggregates the sidecar,tick.shruns it,readiness.pyraises YELLOW per missing workflow — a configuration finding, not red CI, because the repo's code is fine and its gate is not wired up; red would misattribute the fault. Mirrorsmanifest_drift's shape throughout.Cost — one extra call, not a new tier
The original proposal assumed a periodic Actions-API sweep or a check that runs where sibling checkouts exist.
ci_status.shsays otherwise: it already loops every polled repo in parallel making two cheapgh apimetadata calls each. A third is the same shape and cost, and only repos in a group that gates need it — 17 today; advisory groups are skipped without a call.Failing safe
gh(the web/mobile session) →available: false, the check skips. Never a hollow green.missingstays empty and readiness gains a stalerequired workflows unverifiedreason naming it. Without that leg a missing gate could hide behind a 403.Verification
tests/test_required_workflow_drift.py, four cases intests/test_readiness.py). Full suite 656 passed.heart-tests.yml.repos_sync.py --only "tenant firewall (organ code)") passes: the new files name no instance fact, so noFIREWALL_ALLOWLISTentry was added. Verified with a canary token that the gate does scan them, then verified clean again with it removed.actions/workflowsreturnsname: "Navigator Check"withpath: ".github/workflows/navigator_check.yml"— the exactname≠ filename case the matching rule exists for.Deliberately out of scope
ci_status's sidecar orrollup()'s return.rollup()is the release gate; reshaping it to carry a configuration finding would ripple through readiness, dashboard and publish for no gain.unobservedlist, whose sentence is specifically about dev-box-local evidence. This check is not dev-box-local.Generated by Claude Code