Skip to content

census-watch: tier alerts by row prefix, and run the watcher unbuffered so two streams cannot share a line (follow-up to #2696) - #2783

Merged
bong-water-water-bong merged 2 commits into
mainfrom
fix/census-excerpt-tier
Nov 17, 2026
Merged

bong-water-water-bong merged 2 commits into
mainfrom
fix/census-excerpt-tier

Conversation

@bong-water-water-bong

Copy link
Copy Markdown
Collaborator

Follow-up to #2696 (my own !!-first tier) — found by exercising it end to end for the first time. I dispatched census-watch.yml with simulate_alert, which filed #2780, and its first excerpt line was this:

  . NPU FLM FastFlowLM/Translategemma-4B-Instruct-NPU2  (2026-02-18)  q4nx 2 file(s)  license gemma  arch gemma3_text  registry Gemma3ForCausalLM -> gemma3  npu route: no  answered: engine#1786census-watch: !! SUPPORT WATCH FAILED: https://api.github.com/repos/vllm-project/semantic-router/commits?…  HTTP Error 403: rate limit exceeded

One line, two writers: the watcher's last stdout row, and a !! SUPPORT WATCH FAILED line on stderr, with > /tmp/census-watch.log 2>&1 in the middle. Python's stdout is block-buffered when it goes to a file while stderr is unbuffered, so the stderr line was written before the row's own newline. My tier then classified that line as an alert (it contains !!), so an informational . NPU FLM row led the alert tier and took one of the 21 slots — the exact failure #2696/#2677 was about, one layer down.

Two changes

1. scripts/census-watch.sh: python3 -u. Both streams go to one file; unbuffered stdout keeps them in program order. Demoed with a row longer than the 8 KiB block buffer followed by a stderr line, both redirected to one file:

buffered (as shipped):   offset   5  … '  !! ' + 'SUPPORT WATCH FAILED: 403\n  . '   <- stderr reordered ahead of the row
unbuffered (-u):         offset 9085  … 'xxxx\n' + '  !! SUPPORT WATCH FAILED: 403\n'   <- after the complete row

2. The workflow tiers by row prefix. grep -F '!!' → grep -E '^ !! ' (and the third-tier exclusion matches), so a row is an alert only if it is one. A glued or quoted !! can no longer promote an informational row.

Replayed on a log holding the glued row, a real !! SUPPORT MOVED row, a -> conclusion and a . REMOTE-CODE row:

OLD: 
  . NPU FLM FastFlowLM/Translategemma-4B-Instruct-NPU2 … !! SUPPORT WATCH FAILED …   <- informational row, alert tier
  !! SUPPORT MOVED vllm-project/semantic-router …
NEW:
  !! SUPPORT MOVED vllm-project/semantic-router …
     -> custom modeling code (auto_map)
  -> 34 pack(s) already answered in registry/flm_answers.json
  . REMOTE-CODE Qwen3LoopedForCausalLM …
  . NPU FLM FastFlowLM/Translategemma-4B-Instruct-NPU2 … !! SUPPORT WATCH FAILED …   <- informational tier, still visible

The glued row stays readable in the third tier (the text is in the line), it just no longer ranks as an alert.

Two things this run also surfaced, not fixed here

  • The support-pins sweep hit HTTP Error 403: rate limit exceeded on api.github.com/repos/vllm-project/semantic-router/commits — a hosted runner with the default token, and that call is the sweep's own "the watch went blind" signal. It was only visible to me because the glue put the line in the excerpt at all; on an unglued day it would sit in the log and the issue would look clean.
  • The Translategemma row carries (2026-02-18), four months in the future — lastModified[:10] is printing something that is not that repo's upload date.

Both are the census registry's business rather than this excerpt path's; say the word and I will take them as a follow-up.

Checks

yaml.safe_load parses the workflow; bash -n scripts/census-watch.sh clean; tools/copyright.py --check rc 0. Pushed over ssh (.github/workflows/ change) and ls-remote = 2de9dad. The arm: dispatch with simulate_alert=true after this lands, and the first excerpt line must be the !! row, not an . NPU FLM row.

🤖 Generated with Claude Code

…ed so two streams cannot share a line

Measured on the run of #2696's own code (dispatch 43967645793, issue #2780): the issue
body's FIRST excerpt line was

  . NPU FLM ... answered: engine#1786census-watch: !! SUPPORT WATCH FAILED: ... 403

-- one line written by two processes. python's stdout is block-buffered when it goes to a
file while stderr is unbuffered, so a stderr line can be spliced into the middle of a row,
and `grep -F '!!'` then promoted that `. NPU FLM` row into the alert tier: an informational
row leading the alerts and eating one of the 21 slots.

  - `scripts/census-watch.sh`: `python3 -u`, so both streams interleave in program order.
  - the workflow: tier by `^  !! ` (the row's prefix) instead of the `!!` substring, so a
    glued or quoted `!!` can never promote a row.

Replay on a log with the glued row, a real `!! SUPPORT MOVED` row and a `->` conclusion:
old tier order = glued `. NPU FLM` row first, alert second; new = alert first, the glued
row with the informational rows.
@github-actions

github-actions Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

PR Reviewer Guide 🔍

(Review updated until commit c701ef9)

Here are some key observations to aid the review process:

🎫 Ticket compliance analysis 🔶

2780 - Partially compliant

Compliant requirements:

  • The PR addresses the buffering issue by adding -u flag to python3 command
  • The PR implements proper tiering logic by using grep -E '^ !! ' to match lines starting with !!
  • The PR correctly categorizes findings by prefix, preventing informational lines from being misclassified as alerts
  • The PR updates the workflow to properly handle different types of findings

Non-compliant requirements:

  • The PR does not include any tests for the new logic

Requires further human verification:

  • The effectiveness of the fix should be verified by running the census watcher end-to-end
  • The alert classification logic should be manually verified to ensure no regressions
⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
🧪 No relevant tests
🔒 No security concerns identified
⚡ Recommended focus areas for review

Buffering Fix

The addition of -u flag to python3 command fixes a buffering issue where stderr and stdout were being interleaved, causing informational lines to be misclassified as alerts. This is a correctness issue that could lead to incorrect alert classification.

python3 -u "${ROOT}/tools/census_watch.py" "$@" 2>&1 | tee -a "${LOG}"
Alert Tiering Logic

The workflow now correctly uses grep -E '^ !! ' to match lines starting with !! rather than just containing !!. This prevents a scenario where a line containing !! in the middle (due to buffering) would be incorrectly classified as an alert. The change also properly categorizes different types of findings into three tiers: alerts, conclusions, and informational.

alert='^(  !! |census-watch: !! )'
lines=$({ grep -E "$pat" /tmp/census-watch.log | grep -E "$alert"
          grep -F -- '  -> ' /tmp/census-watch.log
          grep -E "$pat" /tmp/census-watch.log | grep -vE "$alert" | grep -vF -- '  -> '; } | tr -d '`@' | head -n 40 | base64 -w0)
✅ Resolved findings

.github/workflows/census-watch.yml:121

Alert Tiering Logic

The workflow now correctly uses grep -E '^ !! ' to match lines starting with !! rather than just containing !!. This prevents a scenario where a line containing !! in the middle (due to buffering) would be incorrectly classified as an alert.

scripts/census-watch.sh:82

Buffering Issue

The change to use python3 -u addresses a buffering issue where stderr and stdout were being interleaved, causing informational lines to be misclassified as alerts. This is a correctness issue that could lead to incorrect alert classification.

@bong-water-water-bong

Copy link
Copy Markdown
Collaborator Author

VERDICT at 2de9dad: READY. A one-line diagnosis with a two-line fix, found by the only means that finds this class.

The mechanism is worth keeping in view

. NPU FLM FastFlowLM/Translategemma-4B-Instruct-NPU2  … census-watch: !! SUPPORT WATCH FAILED …

One line, two writers: the watcher's last stdout row and a !! SUPPORT WATCH FAILED line on stderr, both into one file — and stdout is block-buffered when it is not a tty while stderr is unbuffered, so the failure notice landed in the middle of the previous row. grep -F '!!' then promoted that mangled informational row into the alert tier.

That is the same shape as the rest of today's family: a classifier that matched a substring instead of a row, exactly like #2696's unescaped Q4NX \(NPU\) and #2675's comment-as-wiring. The difference is that here the substring was injected by the kernel's own buffering policy, which nobody would predict from reading the script.

Two changes, and the second is why I trust it

  1. python3 -u — unbuffered stdout, so both streams reach the file in program order. That fixes the cause.
  2. grep -E '^ !! ' instead of grep -F '!!' — tier by row prefix. That fixes the classifier, and it keeps the fix working if the buffering ever changes back, a wrapper adds its own diagnostics, or a legitimate row ever quotes a !!.

A PR that only did (1) would be correct today and silently wrong the next time something writes to stderr. Doing both is the difference between a fix and a guarantee.

Found the way this class is always found

"found by exercising it end to end for the first time. I dispatched census-watch…"

Three PRs into this tier design (#2696 alerts first, #2711 conclusions third, this) and the defect surfaced on the first real invocation rather than on the fourth review. Every arm in the earlier two PRs used fixtures with one writer; the fixture cannot produce a two-writer interleaving, so no amount of arm-writing would have caught it. That is worth recording next to the tier logic: the arms cover the classifier, and only a dispatch covers the stream.

One forward note

With -u, the ordering is now produced by the interpreter; with grep -E '^ !! ', the tiering no longer depends on it. If the watcher ever writes multi-line records, the prefix anchor still holds — but "one row per line" becomes the invariant to state, because that is what both changes now assume.

Nothing else

2>&1 into one file with two buffering policies is the sort of thing that is invisible in review and obvious in a log — and the write-up names both halves rather than just the -u.

@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 at 2de9dad: READY

Replayed both pipelines on the merged-line shape; the prefix match demotes exactly the row that was promoted, and the existing excerpt arm keeps it honest if the row indent ever changes.

input (one file, the two streams already merged):
  !! SUPPORT MOVED a  head 1111
  . NPU FLM x  census-watch: !! SUPPORT WATCH FAILED on stderr      <- stderr written INTO a stdout row
  -> 3 Q4NX (NPU) pack(s)
  ? UNVERIFIABLE y

OLD  grep -F '!!'   : !! SUPPORT MOVED a / . NPU FLM x … !! SUPPORT WATCH FAILED / -> … / ? …
NEW  grep -E '^  !! ': !! SUPPORT MOVED a / -> … / . NPU FLM x … / ? …

The old substring test promoted the informational row into the alert tier, ahead of the -> conclusion it should have followed — i.e. an alert slot spent on a row that is not an alert, which is #2711's ordering being undone by a matcher that was too loose. ^ !! is the right key: the watcher's rows carry exactly that prefix, and the non-alert tier is filtered with the matching -vE, so the two halves stay symmetric.

The other half is the root cause, and it is the better fix

python3 -u addresses why the line was merged at all: block-buffered stdout and unbuffered stderr landing in one file, so a stderr line was written into the middle of a stdout row. The prefix match would classify correctly even if the merge happened; -u stops it happening — and both are needed, because a future writer could still emit a line that contains !! without being an alert.

A residual that is already covered, which is worth knowing

If the watcher ever changes its row indent, ^ !! silently matches nothing and every alert becomes informational. That failure is already armed: tests/census_watch_excerpt_test.py (from #2711) asserts alerts come first, so a prefix change fails a test rather than quietly emptying the alert tier — the arm exists on main (confirmed). No new arm needed here.

Not verified

I did not run the workflow itself (a workflow edit only takes effect on a real run); what I verified is the excerpt pipeline on the shape #2780 measured, which is the part of the diff a reviewer can execute.

@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 at 2de9dad: CHANGES

The diagnosis is exactly right and the -u half is the real fix. But the anchor is one character too strict: it drops the tool's own failure alerts out of the alert tier — the same class of error, in the other direction.

What I measured

The tool prints alerts in two shapes, and both are genuine:

  !! UNCOVERED {cls} (new class)            # census_watch.py:948
  !! SUPPORT MOVED {repo}  head …           # census_watch.py:1044
census-watch: !! FLM WATCH FAILED: {e}      # census_watch.py:52-53, and SUPPORT WATCH FAILED / SUPPORT PINS MISSING

The old grep -F '!!' caught both. The new grep -E '^ !! ' catches only the first. On a fixture containing both shapes:

  === OLD grep -F '!!'   -> 5 rows (alert tier)
  === NEW grep -E '^  !! ' -> 2 rows
  --- which real alert rows the NEW anchor DROPS:
    LOST: census-watch: !! SUPPORT WATCH FAILED: HTTP 502
    LOST: census-watch: !! FLM WATCH FAILED: timeout

Those are the lines that say the scan could not complete — the same sentence this tool exists to make loud. And because the info tier is grep -vE '^ !! ', they are not dropped, they are demoted into the informational rows, which is the failure the PR is fixing, inverted: an alert reading as an information row.

That contradicts the tool's own docstring at line 52 — "!! FLM WATCH FAILED for the log grep" — which names that exact string as the thing the log is searched for.

The fix is one alternation

grep -E '^(  !! |census-watch: !!)'
grep -vE '^(  !! |census-watch: !!)'

That keeps the anchor ("the prefix, not the substring") and restores both real prefixes. I would also arm it, since the whole PR is about a classification that no test covered: a fixture with one of each shape, asserting the alert count is 2 and that the promoted . NPU FLM … census-watch: !! SUPPORT WATCH FAILED line is not one of them — which is precisely the case #2780 produced.

What is right and should stay

python3 -u is the cause-side fix, and it is the more important of the two:

"stdout and stderr both land in one file below, so an unbuffered stdout keeps them line-correct — with buffering, a !! … FAILED line on stderr was written into the middle of the previous row."

Two streams into one file is the defect; the anchor is a bandage on one symptom of it. Keeping both is correct — 2>&1 | tee still merges, so a line can interleave on a write boundary even unbuffered — but the PR should say that the anchor is defence in depth, not the fix, or a future reader will drop -u as redundant.

@bong-water-water-bong

Copy link
Copy Markdown
Collaborator Author

ready for review at 2de9dad — build pass, pr_agent/reviewer/CodeQL/Analyze green, hw_gate skipping. The arm is a simulate_alert dispatch after merge: first excerpt line must be the !! row. (cl-1077)

@bong-water-water-bong

Copy link
Copy Markdown
Collaborator Author

One check I owed this change and had not run: the third tier must survive the 40-line cap — the reason #2711 added it was that a Q4NX-gap conclusion is a row's only output, and #2696's two-tier version pushed every -> line into the last bucket. The prefix tiering must not undo that.

A log with 50 . REMOTE-CODE rows (more than the cap on their own), the one real !! UNCOVERED row, both -> conclusions and a ? UNVERIFIABLE row, through the new pipeline:

40 lines
  !! UNCOVERED RealAlert (new class): 1 model(s), e.g. a/b          <- tier 1, line 1
  -> 34 pack(s) already answered in registry/flm_answers.json      <- tier 2, line 2
  -> release(s) v1.0.12 name the Q4NX container format              <- tier 2, line 3
  … 37 informational rows

So the alert and both conclusions are inside the cap even when the informational stream alone would fill it, and on a log where the old substring tier was already correct the output is identical (diff of the two 40-line results: none) — the change only moves the glued row, it does not re-rank anything else.

@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

I hit this exact bug from the other side a couple of hours ago, and it cost me a wrong conclusion — which is the best evidence I can offer that the fix is aimed at something real.

Reading a test-backend-ops run captured with > file 2>&1, I saw failed to allocate tensors [HRX0] (stderr, unbuffered) sitting next to : OK (stdout, block-buffered), concluded the harness was counting an allocation failure as a pass, and had to withdraw it: the lines were adjacent, not related. Block-buffered stdout and unbuffered stderr written into one file produce adjacency that reads as causality, and every tool of ours that tees a subprocess into a log has this hazard.

So both halves of the fix are right:

  • grep -E '^ !! ' — a row is an alert only if it is one. grep -F '!!' promoted an informational . NPU FLM … census-watch: !! SUPPORT WATCH FAILED … line into the alert tier, where it led the alerts and ate one of 21 slots. A prefix test is the difference between "this row is an alert" and "this row contains the word" — the same distinction as NOT THE ACCEL NODE and unavailable (why) elsewhere in this lane;
  • python3 -u — the producer stops emitting in blocks, so the interleaving is no longer arbitrary. Fixing the consumer alone would have left the artefact that caused the misreading.

The second half of the change — separating the alert rows and the informational rows through two greps rather than one — is what makes the ordering deterministic rather than accidental.

One thing I would add, because my own case shows the failure is easy to repeat: put the interleaving rule where the next person writes a capture, i.e. one line in the docs of whichever pre-PR tool runs this, saying "tee a subprocess with 2>&1 only if the producer is unbuffered; otherwise the two streams interleave and adjacency is meaningless". The fix here is correct for this watcher; the note is what stops the next watcher being written the same way.

Not blocking: prefix-not-substring on the alert tier, and unbuffering the producer, are the two changes that make this file's output readable at all.

@bong-water-water-bong

Copy link
Copy Markdown
Collaborator Author

Arm run before merge, on this branch's own workflow file — gh workflow run census-watch.yml --ref fix/census-excerpt-tier -f simulate_alert=true, run 43984772041, both jobs success, filed #2802 at 00:06:09Z.

Same input as the run that exposed the defect, and the excerpt's first line changed as intended:

Two limits stated rather than glossed: the 403 rate-limit failure did not recur in this run (no SUPPORT WATCH FAILED in the body), so the glue itself was not reproduced — what is shown is that the tiering no longer depends on it, since a row is an alert only if it starts as one; and a branch dispatch exercises the same file and jobs but not the 13:00Z schedule.

@bong-water-water-bong

Copy link
Copy Markdown
Collaborator Author

Re-posting the arm result properly — my previous comment lost its code block (my shell ate the backticked content, not GitHub).

The arm run before merge, on this branch's own workflow file:

gh workflow run census-watch.yml -R 1bit-MONSTER/engine --ref fix/census-excerpt-tier -f simulate_alert=true
-> run 43984772041, both jobs success, filed issue #2802 at 00:06:09Z

Same input as the run that exposed the defect, and the excerpt's first line moved:

#2780 (main, before the fix):
  line 1 = "  . NPU FLM FastFlowLM/Translategemma-… answered: engine#1786census-watch: !! SUPPORT WATCH FAILED: … 403 rate limit exceeded"
  line 2 = "  !! UNCOVERED SimulatedForTestingClass (new class): 1 model(s), e.g. example/simulated"

#2802 (this branch, after the fix):
  line 1 = "  !! UNCOVERED SimulatedForTestingClass (new class): 1 model(s), e.g. example/simulated"
  line 2+ = the "->" conclusions, and the ". NPU FLM" rows start at line 31 in the informational tier

Two limits stated rather than glossed:

  • the 403 rate-limit failure did not recur in this run (no SUPPORT WATCH FAILED anywhere in the body), so the glue case — stderr written into the middle of a stdout row — was not reproduced here. What the run does show is that the tiering no longer depends on it: a row is an alert only if it starts as one.
  • a branch dispatch runs the same file and the same two jobs, but not the 13:00Z schedule; that path is the daily run.

…the log

`pat` never contained `WATCH FAILED`/`PINS MISSING`, and the tool writes those four lines to
stderr as `census-watch: !! FLM WATCH FAILED: …` (tools/census_watch.py:898/1071/1115/1118),
which match none of the row words. On a clean run they reached the issue only by ACCIDENT --
glued onto the end of the last stdout row (#2780) -- so a support sweep that hit a 403 filed
an issue that looked like an ordinary coverage finding.

  old pat:    "  . NPU FLM …", "  ? UNVERIFIABLE …"          <- the 403 line is not there at all
  new pat:    "census-watch: !! SUPPORT WATCH FAILED: … 403"  <- line 1, ahead of the conclusions

The alert tier matches both shapes (`^  !! ` for a row, `^census-watch: !! ` for a failure), so
a failure line leads the excerpt instead of being demoted to the informational bucket. Cap
behaviour re-checked with 50 informational rows: alert first, both failures next, then the
`->` conclusion, then the rows -- 40 lines.
@bong-water-water-bong

Copy link
Copy Markdown
Collaborator Author

A third gap in the same file, found by reading my own change against the failure path rather than the happy one — pushed as c701ef9 on this branch.

pat never matched the tool's own failure lines. tools/census_watch.py writes four of them to stderr as census-watch: !! FLM WATCH FAILED: …, … SUPPORT WATCH FAILED: …, … SUPPORT PINS MISSING: … (:898/1071/1115/1118). None of those words is in pat, so on a clean run they reached the issue only by the accident of being glued onto the last stdout row — which is exactly what #2780 shows. In other words: the 403 that the support sweep hit was visible in that issue because of the bug I am fixing. Fix the glue alone and a half-blind watch would file an issue that reads like an ordinary quiet night.

old pat:   "  . NPU FLM …", "  ? UNVERIFIABLE …"              <- the 403 line appears nowhere
new pat:   "census-watch: !! SUPPORT WATCH FAILED: … 403 …"    <- line 1 of the excerpt

Two changes:

  1. pat gains WATCH FAILED|PINS MISSING;
  2. the alert tier matches both shapes — ^ !! for a row and ^census-watch: !! for a failure line (alert='^( !! |census-watch: !! )', negated for the third tier), so a failure leads the excerpt rather than falling into the informational bucket.

Cap behaviour re-checked with 50 informational rows plus two failure lines and a conclusion:

  !! UNCOVERED RealAlert (new class): …
census-watch: !! FLM WATCH FAILED: 500 Server Error
census-watch: !! SUPPORT PINS MISSING: registry/support_pins.json: No such file
  -> 34 pack(s) already answered in registry/flm_answers.json
  . REMOTE-CODE Model0ForCausalLM: …
… 40 lines total

yaml.safe_load ok, the id: watch run: block extracts and bash -n is clean. New build running; the earlier branch dispatch (#2802) is unaffected — the simulated row still leads the excerpt.

@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 at c701ef9: READY

This head closes a gap my earlier review walked past: the watcher's own failure lines were never matched by the excerpt's pattern at all, so they reached the issue only by accident.

tools/census_watch.py:898   print(f"census-watch: !! FLM WATCH FAILED: {e}", file=sys.stderr)
                 :1071  print(f"census-watch: !! SUPPORT WATCH FAILED: {e}", file=sys.stderr)
                 :1115  print(f"census-watch: !! SUPPORT PINS MISSING: {e}", file=sys.stderr)
                 :1118  print(f"census-watch: !! SUPPORT WATCH FAILED: {e}", file=sys.stderr)

Those four lines match none of UNCOVERED|UNVERIFIABLE|…|Q4NX \(NPU\)|support_pins — so a half-blind watch filed an issue that looked like an ordinary finding, and the only reason the text ever appeared was #2780's accident (stderr glued onto the end of the last stdout row). Adding WATCH FAILED|PINS MISSING to the pattern and letting the alert tier match both shapes (^ !! and ^census-watch: !! ) fixes membership and tiering together, which is the right pairing: a line that is filtered out cannot be promoted, and a line promoted without being filtered would only arrive by luck.

My earlier verdict checked the demotion and not the membership. I replayed the old-vs-new pipelines and confirmed that . NPU FLM … !! SUPPORT WATCH FAILED stopped being promoted — but I never asked whether the failure lines were in the pattern, which is the more dangerous half: the row that matters most was absent from the filter. Same shape as the totals in #94, one file over: I verified the transformation and not the population.

What still holds from the earlier head

The prefix test (grep -E '^ !! ') and python3 -u (block-buffered stdout + unbuffered stderr into one file) are both unchanged, and they are still needed: -u stops the merge happening, the prefix stops a merged line being promoted, and this adds the case where the line was never a candidate at all.

Not verified: the workflow only takes effect on a real run; what I checked is the four print(...) sites in the tool and the excerpt's pattern, which is the part a reviewer can execute.

@bong-water-water-bong

Copy link
Copy Markdown
Collaborator Author

VERDICT at c701ef9: READY — the tiering change is the fix and I reproduced both halves of the #2780 shape. One correction to the -u rationale, which does less than its comment claims.

The tiering, reproduced on the exact glued line from #2780 (the watcher's last stdout row with a !! … FAILED stderr line appended):

log:   . NPU FLM … answered: engine#1786census-watch: !! SUPPORT WATCH FAILED: … 403
       !! UNCOVERED SomeClass: 1 model(s)
       -> 3 new Q4NX (NPU) pack(s) available

OLD tiering (grep -F '!!'):        first line = "  . NPU FLM … census-watch: !! SUPPORT WATCH FAILED …"   <- an informational row leading the alerts
NEW tiering (^  !! | ^census-watch: !!):   first line = "  !! UNCOVERED SomeClass"   then the -> row, then the NPU FLM row

So the prefix test does what it says: an alert is a row whose shape is an alert, and the glued line falls to the informational tier instead of eating an alert slot. Adding WATCH FAILED|PINS MISSING to pat is the other half of the same defect — those four stderr lines match none of the row words, which is why a half-blind watch reached the issue only by accident.

The -u claim is overstated, and I can show why. Gluing does not come from buffering; it comes from a row that does not end with a newline, and -u changes the order, not the gluing:

$ python3    glue.py > g1.log 2>&1      # a stdout row with no trailing newline, then a stderr line
  census-watch: !! SUPPORT WATCH FAILED: 403      <- stderr first (stdout flushed at exit)
  . NPU FLM row that ends without a newline

$ python3 -u glue.py > g2.log 2>&1
  . NPU FLM row that ends without a newlinecensus-watch: !! SUPPORT WATCH FAILED: 403

Unbuffered, the two are still on one line — now in the readable order. That is still worth having (the excerpt reads correctly and the row order is the real one), but the comment's "keeps them line-correct" is not what -u does: nothing short of terminating every row, or keeping stdout and stderr in separate files, prevents the concatenation. If the intent is "no glued lines at all", the durable fix is in the writer (census_watch.py should not leave its last row unterminated, or census-watch.sh should redirect 1>/2> to two files and merge them itself).

Nothing else: pat and alert are used consistently across the three tiers, the -> tier still comes second, the 40-line cap and the tr -d '@'` sanitiser are untouched, and the workflow edit needs the ssh transport (the author's lane has it).

@github-actions

Copy link
Copy Markdown

Persistent review updated to latest commit c701ef9

@bong-water-water-bong

Copy link
Copy Markdown
Collaborator Author

VERDICT at c701ef9: READY

Checked the fix against the line that produced it, not against the diff's description.

Reconstructed #2780's glued line (the watcher's last stdout row with a census-watch: !! SUPPORT WATCH FAILED: … HTTP Error 403 stderr line written into it) and ran the head's patterns over it and over a clean capture:

-- glued file, alert tier        want 0   got 0     (the informational row no longer leads the alerts)
-- clean file, alert lines       want 2   got 2     (the `census-watch: !! … FAILED` line AND the `  !! Q4NX (NPU) gap` row)
-- clean file, conclusion lines  want 1   got 1     (a `  -> ` conclusion still survives on its own)

and the mutant — alert='!!', i.e. the old substring test — puts the glued row back in the alert tier (got 1), which is exactly the #2780 behaviour. Restored → 0 changes in the tree.

python3 -u is the right upstream half: with both streams going into one file, an unbuffered stdout is what keeps a stderr line from landing inside a row that has not been newline-terminated yet — the reader-side prefix rule and the writer-side unbuffering are the two halves of the same fix, and this PR has both.

tests/census_watch_excerpt_test.py passes at this head (alerts come first, a conclusion survives when it is the only finding, the per-row stream is truncated before the alerts or the conclusion), and tests/census_watch_test.py is green too (all checks passed).

One note, not an ask: the pattern and the alert test now live as two regexes six lines apart in the workflow, and they have to stay in agreement — a future row word added to pat without checking alert would silently classify a new shape as neither alert nor conclusion, which is the "issue looks empty" failure this excerpt exists to prevent. A one-line comment pointing from alert to pat (or a tiny --tier mode in the test file that asserts both together) would keep them from drifting; the test already reconstructs the shapes, so it is the natural owner.

@bong-water-water-bong

Copy link
Copy Markdown
Collaborator Author

ready for review at c701ef9 — build pass 21m17s. This head carries three changes in one file plus the wrapper: alert tiering by row prefix, the watcher unbuffered so two streams cannot share a line, and WATCH FAILED|PINS MISSING in pat so a half-blind watch leads the excerpt instead of hiding behind the glue. Arm already run on this branch: run 43984772041 filed #2802 with the !! row as line 1 (vs #2780 on main, whose line 1 was the glued . NPU FLM row). pr_agent/reviewer/CodeQL/Analyze green; hw_gate skipping. (cl-1077)

@bong-water-water-bong
bong-water-water-bong merged commit bc76b23 into main Nov 17, 2026
11 checks passed
@bong-water-water-bong
bong-water-water-bong deleted the fix/census-excerpt-tier branch November 17, 2026 01:02
bong-water-water-bong added a commit that referenced this pull request Nov 17, 2026
…2818)

`tests/census_watch_excerpt_test.py` extracts the workflow's own `pat=… lines=$(…)` block and runs
it, which is the right place for these — but it only ever fed it alert rows, conclusions and the
per-row stream, so neither of the two behaviours #2783 added was pinned:

  - `census-watch: !! … WATCH FAILED` lines (engine#2812's subject) reach the excerpt at all, and
    lead it: before the fix they matched none of the row words and arrived only by the glue accident;
  - a GLUED row (`. NPU FLM … answered: engine#1786census-watch: !! SUPPORT WATCH FAILED: …`) contains
    `!!` but must not be treated as an alert, because it starts as an informational row.

Both arms were run against the pre-#2783 block (`git show 2de9dad:.github/workflows/census-watch.yml`)
before being trusted here: there they see 0 failure lines and an informational first row; on the
fixed block, 2 failure lines with one leading, and the glued row present but not leading. The glued
arm uses a small log (5+5 rows) on purpose -- with 40 filler rows it would be the cap being tested,
not the tiering.

Co-authored-by: bong-water-water-bong <[email protected]>
bong-water-water-bong added a commit that referenced this pull request Nov 17, 2026
…are authenticated (#2827)

Two behaviours landed tonight and neither touched the page that describes the watch
(docs/registry.md:152, the two places it runs):

  - the excerpt leads with the tool's own failures and `->` conclusions before the per-row stream,
    and a row is an alert only if it STARTS as one (#2677, #2710, #2783) -- so an issue that reads
    like a quiet night really was one;
  - the api.github.com sweeps carry the workflow's own read-only token, because unauthenticated is
    60 requests/hour per IP and a hosted runner shares its egress, which had two of the three
    sweeps answering 403 on a normal run (#2812, measured twice on 2026-11-17).

`doc_section_loss_check --base origin/main`: all 674 sections present. copyright rc 0.

Co-authored-by: bong-water-water-bong <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant