Skip to content

census-watch: an alert is a finding, a broken run is a failure, and both leave a trace - #664

Merged
bong-water-water-bong merged 2 commits into
mainfrom
census/alert-vs-failure
Oct 30, 2026
Merged

bong-water-water-bong merged 2 commits into
mainfrom
census/alert-vs-failure

Conversation

@bong-water-water-bong

Copy link
Copy Markdown
Collaborator

The census watch has been red every day since at least 2026-10-16 and nobody read it (gh run list --workflow census-watch.yml: 15/15 failures through 2026-10-30).

What those runs actually are

Every one is the same shape — the watch step fails, the alert job reports success:

gh api repos/1bit-MONSTER/engine/actions/runs/41044556680/jobs
  New HF model classes are covered -> failure (steps: Run the new-model watcher=failure)
  File a deduped alert issue       -> success

… log-failed, 2026-10-30:
census-watch: EXIT 1 (an alert is above: uncovered class and/or unmapped FastFlowLM family)
##[error]Process completed with exit code 1.

38878641214 (10-16) is identical with EXIT 1 (an uncovered class arrived in the newest models). No rc=2 or crash anywhere in the window: the red is the alert, by accident of how the step exits.

Two defects, both in the workflow (tools/census_watch.py is fine)

  1. The watch step exited with the watcher's code, so an alert — an uncovered architecture class, the ordinary outcome of a day when HF publishes something new — turned the run red. A red run then meant nothing, and stayed red every day an unmapped class existed. While issues were closed promptly (census: new HF model class uncovered by the registry #427 10-16, census: new HF model class uncovered by the registry #447 10-18, census: new HF model class uncovered by the registry #522 10-23) that was only noise; once census: new HF model class uncovered by the registry #619 stayed open from 10-27 the alert job skipped daily (a census-watch issue is already open: skipping) while the run kept failing. "Red = the watch is broken" had stopped being true, so nobody looked.
  2. The alert job ran only on needs.watch.outputs.alert == 'true', which the step never sets when it fails before writing outputs. A checkout/setup/network failure — or the watcher's own exit 2 ("a watch did not run") — left a red run with no issue, no comment, no annotation: the one failure this workflow exists to catch was the one that left no trace.

The fix

Watch step — separate the watcher's own three outcomes (0 quiet / 1 alert / 2 did not run):

rc job run summary outputs
0 success green census-watch: quiet alert=false
1 success green ## Census alert (the watcher ran; this is a finding, not a failure) + the lines alert=true, lines
other failure red ## The census watch did not run (rc=N) + log tail failure=rc=N|<base64 log>, ::error::

Red now means one thing only: the daily watch did not run.

Alert job — always() && needs.watch.result != 'cancelled', filing either kind through the one post() helper #649 introduced (one open issue at a time, append when the content changed):

  • the coverage breach (unchanged body and fix text; marker = digest of the alert lines), or
  • census: the daily watch did not run — marker = digest of the failure text, so the same breakage does not reopen daily and a different one does, with the captured log tail inline.

Rehearsed

This repo has no workflow test harness (CI does a YAML parse and bash -n), so both steps were driven locally with a stub scripts/census-watch.sh and a stub gh:

rc=0  -> exit 0, alert=false, summary "census-watch: quiet"
rc=1  -> exit 0, alert=true,  summary "Census alert (… finding, not a failure)"
rc=2  -> exit 2, failure=rc=2|<log>, summary "did not run", ::error annotation
alert, no issue open                  -> issue created
alert, open issue already has marker  -> no-op                (the #619 case)
failure, no issue open                -> "did not run" issue created, log block rendered
failure, same failure already filed    -> no-op
failure, different failure while open  -> one comment on the open issue

yaml.safe_load parses; bash -n passes on both steps.

#649 / #654 — what they did and did not change

Both merged today (#654 13:56Z, #649 14:30Z), and neither changed the failures above, because they were unmerged for the whole 10-25..10-30 window and the scheduled runs execute main (headSha c93f9e2). What #649 did change is the first half: with an issue already open, a changed breach is now appended as a comment instead of being skipped — that is how LFM3-1.7B-NPU2 (10-28) and MiniCPM-V-4.7-35B-A3B-NPU2 (10-30) went unrecorded. It does not stop an alert from turning the run red, and it files nothing when the watch itself breaks. Both of those are this PR.

So from the next scheduled run (2026-10-31 ~10:30Z) main will append changed breaches, and with this PR a red run will mean the watch did not run — and say so in an issue.

…oth leave a trace

The daily census watch has been red every day since at least 2026-10-16 and nobody read it
(runs 38878641214 through 41044556680, `gh run list --workflow census-watch.yml`). Two
separate defects made that possible, and neither is in the watcher itself:

1. The watch step exited with the watcher's code, so an uncovered class - the *alert*, the
   normal outcome on a day when HF publishes a new architecture - turned the whole run red.
   A red run therefore meant nothing: 10-16..10-26 red runs each filed their issue
   (#427, #447, #522, ...), and once #619 stayed open from 10-27 the alert job skipped while
   the run went on being red. Red = "the watch is broken" had stopped being true.
2. The alert job ran only on `needs.watch.outputs.alert == 'true'`, an output the step never
   sets when it fails early. A checkout/setup/network failure, or the watcher's own exit 2
   ("a watch did not run"), produced a red run with no issue, no comment, no annotation -
   the one failure mode this workflow exists to prevent.

Now:

- The watch step separates the three outcomes of the watcher's own contract (0 quiet, 1 the
  alert, 2 did not run). rc=0 and rc=1 exit 0; the alert is written to
  `$GITHUB_STEP_SUMMARY` so it is on the run page, and the issue carries the record. Any
  other rc sets a `failure` output (rc + log tail), writes "the census watch did not run" to
  the summary, prints `::error::`, and exits with that rc so the run is red.
- The alert job runs on `always() && needs.watch.result != 'cancelled'` and files either
  kind: the coverage breach (as before, marker-deduped so a changed breach is one comment on
  the open issue) or a "the daily census watch did not run" issue marked by the failure text,
  so the same breakage does not reopen daily and a different one does. Both go through one
  `post()` helper - one issue at a time, append when the content changed.

Rehearsed locally with a stub `scripts/census-watch.sh` and a stub `gh`, because this repo has
no workflow test harness (YAML parse + `bash -n` on both steps is all CI would do too):

  rc=0  -> exit 0, alert=false, summary "census-watch: quiet"
  rc=1  -> exit 0, alert=true,  summary "Census alert (the watcher ran; this is a finding, not a failure)"
  rc=2  -> exit 2, alert=false, failure=rc=2|<log>, summary "did not run", ::error annotation
  alert, no issue open                 -> issue created
  alert, open issue already has marker -> no-op
  failure, no issue open               -> "did not run" issue created, log block rendered
  failure, same failure already filed  -> no-op
  failure, different failure while open-> one comment on the open issue

Stacked on #649 (and #654 on top of it): this reuses #649's marker-and-append `post()` and
keeps one issue at a time. Merge order: #649, #654, then this.

Not changed by #649/#654 as of today: both are unmerged, so the scheduled runs still execute
`main`'s workflow (headSha c93f9e2) - the daily red runs and the silent skips above are main's
behaviour, and #649 alone would only have fixed the "changed breach gets recorded" half.

(cherry picked from commit 5fe211c)

@bong-water-water-bong bong-water-water-bong left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

VERDICT: READY (posted as a comment: GitHub refuses --request-changes/--approve on a PR owned by the same account).

I re-ran the matrix rather than trusting it, and then found that you had already run the whole thing on real Actions.

The watch step, driven with a stub scripts/census-watch.sh and the extracted run block (GITHUB_OUTPUT/GITHUB_STEP_SUMMARY files, SIMULATE=false):

rc=0 -> exit=0  alert=false  lines=        summary: "census-watch: quiet"
rc=1 -> exit=0  alert=true   lines=<b64>   summary: "## Census alert (the watcher ran; this is a finding, not a failure)"
rc=2 -> exit=2  alert=false  failure=rc=2|Y2Vuc3VzLXdhdGNoOiBzdHViIHJ1biAocmM9MikK…
                summary: "## The census watch did not run (rc=2)"
                ::error::census-watch did not run (rc=2): the registry is unverified today

so a watcher alert no longer reddens the run (the whole point), and a broken watch still does, with the rc in an output and an annotation.

The alert job, six cases through a stub gh — all six match the body:

1) alert, nothing open                  -> exit 0, create=1 comment=0
2) alert, open issue already has marker -> exit 0, create=0 comment=0  ("#619 already carries this: nothing to do")
3) alert, open issue, new breach        -> exit 0, create=0 comment=1  ("appended to #619")
4) failure, nothing open                -> exit 0, create=1 comment=0
5) failure, same failure already filed  -> exit 0, create=0 comment=0
6) failure, different one, open          -> exit 0, create=0 comment=1

and the rendered "did not run" issue is right: header, the "the registry is unverified today" explanation, the captured log tail decoded out of failure=rc=N|<base64>, the run URL, and exactly one <!-- census-watch-failure: … --> marker so the same breakage does not reopen daily.

On real Actions you had already proved it. Run 41080988893 (this branch, 15:28Z) is the case that matters:

watcher log: "census-watch: EXIT 1 (an alert is above: uncovered class, unmapped FastFlowLM family, …)"
job "New HF model classes are covered": success      <- under the old step this run was red, 15 times in a row
job "File a deduped alert issue":       success
issue #619 last comment: github-actions at 2026-10-30T15:28:36Z
  "## Census coverage breach (2026-10-30) …"

Ten seconds after the watcher exited 1, the open issue got a comment with the new body, on a green run. Both halves are real, not stub-only.

Also checked: yaml.safe_load parses; workflow_dispatch.inputs.simulate_alert is declared (so ${{ inputs.simulate_alert }} resolves); the alert job's if: always() && needs.watch.result != 'cancelled' and permissions: issues: write are both there; and the motivating claim is true — gh run list --workflow census-watch.yml shows failure on every run from 2026-10-17 to 2026-10-30, then this branch's run as the first green one.

Two notes, neither blocking:

  1. The alert job has no permissions: contents: read, so it gets the default (which for this repo is read-only contents, fine) — but if a later job-level permission is ever narrowed by a workflow default, the spec issues: write alone is what carries it. Nothing to change now; worth knowing it is doing the work.
  2. In the failure branch the step always exit 0s, so the job's colour comes only from needs.watch.result. That is right, and it means a cancelled watch files nothing (the != 'cancelled' guard) — intentional, but it is the one path where a red-ish state leaves no trace.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant