Skip to content

fix(OperationsCenter): print per-repo progress in custodian-sweep - #470

Merged
ProtocolWarden merged 1 commit into
mainfrom
oc-watchdog/20260714-2249-custodian-sweep-progress
Jul 15, 2026
Merged

fix(OperationsCenter): print per-repo progress in custodian-sweep#470
ProtocolWarden merged 1 commit into
mainfrom
oc-watchdog/20260714-2249-custodian-sweep-progress

Conversation

@ProtocolWarden

Copy link
Copy Markdown
Owner

Summary

  • custodian-sweep --emit genuinely takes 3-4 minutes across 19 managed repos but printed nothing until the final summary line, making a bounded probe (timeout 90/120s) indistinguishable from a hang.
  • Multiple recent watchdog cycles (see logs/local/watchdog_cycles/20260714_cycle.md, 20260715_cycle.md) independently re-investigated this same "hang" and confirmed it was always a slow-but-healthy run.
  • _run_custodian_audits now prints a flushed [custodian-sweep] N/total <repo> done progress line to stderr as each repo completes, so future bounded probes show liveness instead of silence.
  • No change to the JSON summary output or Plane emit logic.

Test plan

  • pytest tests/test_custodian_sweep.py -q — 17/18 pass (pre-existing unrelated failure test_emit_dry_run_reports_zero_finding_skip, confirmed present on main before this change — two pre-existing tests assert contradictory _emit dry-run behavior; left untouched, out of scope)
  • Added test_run_custodian_audits_prints_progress_per_repo covering the new stderr output
  • ruff check / ruff format --check clean
  • pytest tests/unit/er000_phase0_golden/ -q — 15/15 pass
  • Ran custodian-sweep --emit unbounded end-to-end (19 repos, ~3.5 min) — completed cleanly, confirms this was never a real hang

Root cause: custodian-sweep --emit legitimately takes 3-4 minutes across
19 managed repos, but printed nothing until the final summary line at the
end of main(). Every watchdog cycle for weeks re-investigated this as a
"hang" because any bounded probe (timeout 90/120s) is indistinguishable
from a genuine stuck process — see logs/local/watchdog_cycles/20260714*
and 20260715_cycle.md for repeated instances of the same investigation.

Fix: _run_custodian_audits now prints a flushed "N/total <repo> done"
line to stderr as each repo's audit completes, so a bounded probe shows
liveness instead of silence. No behavior change to the JSON summary or
Plane emit logic.
@ProtocolWarden
ProtocolWarden merged commit 75d3e46 into main Jul 15, 2026
25 checks passed
@ProtocolWarden
ProtocolWarden deleted the oc-watchdog/20260714-2249-custodian-sweep-progress branch July 15, 2026 02:56
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