Repository navigation
status.py health alerts - #59
Conversation
… PR and Brain status.py --live could not see the failures that mattered: the nightly review has errored on every article with 0 tokens since 2026-09-18, the bot gate line vanished whenever the local decide timed out (and a local decide uses the operator's gh login, so it cannot see the CI token failing), and nothing reported the batch PR's conflict or age. --live now compares the /stats review totals with the previous reading (site/cache/.status_live.json) and alerts when errors equal articles or tokens stay flat; prints 'gate: local <act|wait|timeout/error> · CI <decision>' from the latest completed wikidata-poll run's Decide step and alerts when CI says wait where local says act; alerts when the batch PR conflicts (mergeable or the merge-conflict label) or has been open 30+ days; prints the live Brain release_id and audited_at. Live checks also run when no digest exists. The concept-graph staleness check now allows 300 s of slack, so one bulk copy (4 s apart on 2026-08-19) no longer raises it; status.py recomputes it from the digest's mtimes so old digests stop alerting.
- Review health reads GET /api/runs per run when deployed (failing streak, notes, no run in 36h), else compares /stats totals with a validated, atomically written state; alerts when review stops running and when the /stats table can't be parsed. - The gate no longer alerts on local-vs-CI disagreement (local state can lag CI's); it alerts on CI-side signals: POLL_ERROR, a failed run, or no finished run in 12h. Cancelled runs are skipped. - The batch PR reads current_pr from the bot-state branch when it exists; the conflict alert is OPEN-only and defers to the poller's rebuild; a CLOSED-unmerged PR alerts; MERGED doesn't. - Live checks run in full without a digest; the offline path makes only the git status call (tested). - refresh.py finds status.py under python -I.
|
Review status: merged in Update 2026-10-14 (re-checked at
Original review (2026-10-14)Independent adversarial review of Verdict: keep the review-health check, Brain release line and 300 s graph slack; replace the poller and batch-PR code with one Required before merge
Decisions for the maintainer
Merge order: after #56, since the alerts point at Fixes are in progress; this comment will be updated. Posted by the WikiLean PR swarm (lead); updated 2026-10-14. |
Status review (2026-10-14): 🔧 Needs changesThe code is read-only, release-neutral and well tested, and it works against live data. In the combined build, Fix before merge
Nits
Overlap with #61. #61's Order: after #56, whose 🤖 Automated status pass by Claude Code over all 18 open PRs (#46–#63), posted for the repo owner. An independent verifier re-checked each finding. All 18 heads were also merged and tested together in a scratch tree; the only test failure that comes from combining them is #47 × #55 (three other pairs had mechanical text conflicts). Reviewed head: |
…t as merged - The gate line shows CI's decision only. The local poll.py --decide call is gone: it reads this checkout's copy of the bot state, which the poller stops updating once state lives on the bot-state branch. - Poller runs are listed with --branch main. - A failed gh run list, or a failed read of the run's log, raises an alert instead of a bare "CI ?". - A bot-state read that fails for any reason other than HTTP 404 raises an alert and skips the batch PR check rather than falling back to the local snapshot; a 404 is labelled "no bot-state branch". - The POLL_ERROR alert names the run, not decide (any poll.py step can print it), and keeps the run's decision when one was printed. - The conflict alert no longer promises a rebuild on the next act tick: the poller rebuilds a batch off master only once it is settled. - batch_pr reads the title and treats a CLOSED PR titled "[Merged by Bors] - " as merged (shown as MERGED (Bors), no alert). - Tests for each case. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Fixes pushed (2026-10-14)This addresses the findings in both earlier reviews: the "Status review (2026-10-14)" comment (Bors false alert, gate note, all three nits) and the PR swarm's review (its three alert defects, the local decide, the What changed (
Verification
Not changed / still open
Merge notes: merge after #56 ( 🤖 Posted by Claude Code for the repo owner. Each fix was checked by an independent verifier before it was pushed. Head: |
Problem
manage/status.py --liveis the dashboardHANDOFF.mdcalls live ground truth. It could not see any of the failures that matter now:/statsread review at 117 runs / 1,761 articles / 843 errors on 2026-10-12 and 118 / 1,776 / 858 on 2026-10-13, tokens 26,345,645 both times.status.pyhas no pipeline-health check (manage/status.py:88-104on main).--liverunsbot/poll.py --decidewith a 12 s timeout and drops the line silently when it times out (manage/status.py:44-49, 69-73). It took about 17 s on a loaded machine. Even when it finishes, it uses the operator's own gh login, so it can't see the CI poller's token failing: CI run 38435564796 (2026-10-13) loggedPOLL_DECISION=wait.merge-conflict(gh pr view 42608 --repo leanprover-community/mathlib4).manage/refresh.py:78, strict<).Change
All under
--live, read-only (GETs andghreads):GET /api/runs?kind=reviewwhen that endpoint is deployed (it ships in a separate Worker PR). Alerts on a streak of runs where errors equal articles or tokens are 0, prints the newest run'snotes(the runner's error sample), and alerts when no run has finished in 36 h./statsPipeline-runs totals, compared with the previous reading in gitignoredsite/cache/.status_live.json. That state file is validated and written atomically. The fallback alerts when errors equal articles, when tokens are unchanged across new runs, when no new run appears for 36 h, and when the table can't be parsed.gate CI <decision> (run <id>, <age>), read from the latest finishedwikidata-pollrun onmain(cancelled runs skipped).bot-statebranch, so it says nothing about the live poller.POLL_ERROR:line from any poll step, a failed run, or no finished run in 12 h.ghcan't list the runs or read the newest run's log, instead of showing onlyCI ?.current_prfrom the poller'sbot-statebranch.local snapshot; no bot-state branch. Any other read failure alerts and skips the batch PR check rather than fall back to the local snapshot.mergeableor mathlib'smerge-conflictlabel) and when it has been open over 30 days. The conflict alert notes that the poller rebuilds a batch off master only once it is settled.[Merged by Bors] -title), which is how mathlib merges.release_idandaudited_at.status.pyrecomputes it from the digest's raw mtimes, so existing digests stop alerting.refresh.pyshares the helper and finds it underpython -I.git statuscall and writes nothing; a test asserts both.manage/test_status.py(23 tests, every network call stubbed), registered inscripts/ci-python.sh.How tested
python manage/test_status.py: 23 passed under Python 3.12 and under macOS system Python 3.9.6. The SessionStart hook may run either.ghchecks were exercised against the real repos, read-only:ci_gate()→waitfrom the latestmainrun (38518943971), no alert;ci_bot_state()→ HTTP 404, reported as nobot-statebranch (none exists yet), no alert;batch_pr(42608)→ OPEN, conflict (via the label while GitHub reported UNKNOWN), open 65 days;batch_pron a recent Bors-merged mathlib PR →MERGED (Bors), no alert./statspage and a realgh run view --log.site/ops/brain_release_authority.pyblocking_changeson this branch's diff reports release-neutral.Risks
wait, so the gate alert can't see it. It will once the poller fails closed withPOLL_ERROR; that change is in a separate PR./statsfallback can't see a failing night between two healthy ones, and its first reading only saves a baseline. The per-run path has neither limit.--livemakes about seven network calls in sequence. The worst case is a few minutes when GitHub is slow.docs/OPERATIONS.md, which arrives with PR Operations runbook and review-outage diagnosis #56.What Jack must do
Nothing to configure.
ghmust be logged in for the gate and batch-PR lines.