Repository navigation
Conversation
bot/gate_status.py prints one JSON object and always exits 0: the live state from the bot-state branch (main's snapshot only when the branch is missing, with the hazard spelled out; a branch without the state file is an error), what the latest poller run on main concluded (act/wait/error plus the first failed step, from step outcomes), red runs in the last 24 h, and the batch PR, with alerts for anything red, stale, missing or unreadable. Offline mode says it checked nothing live. It never runs decide() with the operator's own login. Tests: bot/test_gate_status.py builds run step lists from the real wikidata-poll.yml, so a renamed step fails the tests.
…ts on main's snapshot After the bootstrap_state change in the base branch, a missing branch past the one-time bootstrap fails every poller run at restore. The alert said the next run would act on the stale snapshot.
7590dd3 to
fb18eee
Compare
|
Review status: superseded by #59; closing Update 2026-10-14:
Original review (2026-10-14)Independent adversarial review of Verdict: close #61 without merging. Its useful behaviours move into #59, which keeps the single implementation in Why
Decisions for the maintainer
Merge order: don't merge. Close once #59's revision has the cancelled-run fix and the failed-read alerts; #59 stays based on main and doesn't wait for #48 or #61. Posted by the WikiLean PR swarm (lead); updated 2026-10-14. |
Status review (2026-10-14): ✅ Ready (stacked on #48); pick one of #59 and #61The code is small and read-only. Apart from the nits below, it behaved correctly on every path probed: a live run, stubbed 502, 401 and 404 responses on the bot-state and branch reads, Decide: this PR or #59. #59 implements the same poller, bot-state and batch-PR checks inside
This PR's README row says it is "meant for Nits
Order: after #48; then retarget to 🤖 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: |
… a missing bot-state branch Follow-up to #61 (closed). Its review found that the poller's long cancelled runs were hangs, not concurrency noise: 209 of its 210 cancelled runs lasted 30 minutes or more, the job's timeout. A job timeout ends the run as cancelled, and status.py skipped every cancelled run, so five hung ticks in a row left a silent "CI ?". - wikidata-poll.yml: Install pinned Claude CLI and Clone mathlib4 get a 10-minute step timeout and Poll tick (apply) 20 minutes, inside the job's 30. The runner marks a step that hits its own timeout as failed, so a hang ends the run as a failure instead of a cancellation, with time left for Commit poll state. bot/README.md lists the message, and a wiring test keeps the step timeouts below the job's. - status.py ci_gate reads 20 runs with startedAt/updatedAt. A cancelled run that lasted 25 minutes or more counts as timed out and alerts; that covers older runs and hangs in the steps without a timeout of their own. When no listed run qualifies it alerts instead of printing a silent "CI ?". - batch_pr: a failed read is an alert, not only a "gh unavailable" line. - live_section: since #48 the bot-state branch is mandatory, so its 404 is an alert that points at the one-time bootstrap_state dispatch and bot/README.md 'Restore failed'. A second read, only on a 404, tells a missing branch from a branch without bot_state.json; the latter is reported as unreadable state and the batch PR is not checked.
Problem
The status dashboard (
manage/status.py, which a SessionStart hook runs) could not have shown the three-week poller outage, and after #48 its bot line reads a frozen file:bot/state/bot_state.jsononmain(manage/status.py:29). After Make the wikidata poller fail closed #48 the live state is on thebot-statebranch, andmain's copy is a frozen snapshot.--liveuses the wrong credentials and drops failures. It runsbot/poll.py --decidewith the operator's ownghlogin and a 12 s timeout, and prints nothing on a timeout or error (manage/status.py:44-49,69-73). Even when it answers, it reports what the operator's token sees, not the CI token (MATHLIB_FORK_PAT) that had expired.Change
New
bot/gate_status.py, a read-only helper for dashboards. It always exits 0 and prints one JSON object, with a top-level guard so even an unexpected error becomes an alert. Any part it cannot read, or did not check, becomes an alert, never a silent omission. It never runsdecide().With
--live, it reads:bot_state.jsonfrom thebot-statebranch. A 404 is resolved with a second call:main's snapshot. The alert says this is expected only before the first state-branch run; after that it means the branch was deleted.wikidata-poll.ymlruns onmain, skipping runs the concurrency group cancelled, and the step outcomes of the newest one. From those it reports the run'sdecision(act,wait,errororunknown) and the firstfailed_step, without downloading logs. Act and wait are told apart by whether any act-gated step ran, so a setup failure after "act" is not mislabelled "wait".Alerts cover:
bot-statesuccess, with its decision and failed stepCONFLICTING, or themerge-conflictlabel while GitHub still saysUNKNOWN)bot/README.mdgains a "Checking the poller" section and a Files row.manage/status.pyis not changed here. The interface it can call is above.How tested
bot/test_gate_status.py(17 tests) stubsgh. Run step lists are generated from the realwikidata-poll.yml, so a renamed or reordered step fails the tests. It covers:sourcekey, which cannot relabel itreport()wait, and the batch PR flagged as conflicting and open 64 days.Risks
manage/status.pyis a separate change.DecideandCommit poll statestep names. If those are renamed, the decision readsunknownrather than a wrong answer, and the tests fail first.What Jack must do
Nothing: no secrets, settings or operator steps.