Repository navigation
Description
Problem
In the weekly reconcile (infra/github-backup/bin/reconcile.py) — the sweep the module calls its correctness floor — a failed clone pass is invisible to every surface that could alarm on it: main() returns 0, and the dated reconcile report is written before the clone pass runs, so it never records the clone outcome at all.
clone_all.py computes a meaningful exit code (0 only when every planned repo cloned ok), and reconcile is its only scheduled caller — but reconcile drops that code on the floor. A week where every missing mirror fails to clone (bad token, disk full, network down) therefore looks exactly like a clean week to the systemd timer, and the only trace is a stdout line in the journal and the per-repo rows in clone-status.jsonl, which nothing alarms on.
Evidence (verified this run on main 7d8a3ca5)
reconcile.py:108-113— the clone pass:r = subprocess.run([... clone_all.py]); onr.returncode != 0it onlyprint("clone pass had failures; see clone-status.jsonl"). The value is never stored or returned.reconcile.py:115—return 1 if errors else 0: the exit code reflects owner-level inventory errors only (docstring :13-14 states this as the design). Clone-pass failure is not an input.reconcile.py:102-105— the dated reportreconcile-<today>.mdis written before the clone pass (:108), so the report cannot and does not record whether the clones it triggered succeeded; its mirror count is explicitly "missing on disk before clone pass" (:88).clone_all.py:106-107—return 0 if ok == len(plan) else 1: the callee's verdict exists and is discarded by its caller.manifest_mod.build(root)(:114) runs after the clone pass and will list the repos asmissingin MANIFEST.json — but per github-backup(fetch): a missing mirror can never trip the chronic alarm — 'missing' returns before any fail_days record, so the daily run exits 0 forever #3270, nothing reads MANIFEST as an alarm; the exit code is this system's stated alarm channel.
Probe (laptop, verbatim copies, sha256-matched)
Probe: ~/git/fleet/probe-2026-10-31-laneA-reconcileexit/ (laptop) — reconcile.py sha256 762a7639… identical to sandbox main 7d8a3ca5; the copied tree's config pointed at a probe backup root with one planned repo missing on disk; inventory/build_plan stubbed, the clone_all.py subprocess stubbed to a chosen return code, everything else (report write, manifest build, exit return) the real code:
laptop reconcile.py sha256: 762a763977e823247f1576fcf2d58fb83a29ff39521f7d8d16ba44635e073e25 MATCH
CASE clone_rc=1 errors=False -> main() returned 0; report mentions failure: False
CASE clone_rc=0 errors=False -> main() returned 0; report mentions failure: False
CASE clone_rc=0 errors=True -> main() returned 1; report mentions failure: False
The control proves the exit channel works — for inventory errors only. Clone success and clone failure are indistinguishable in both the exit code and the dated report.
Why it matters
Reconcile is the weekly guarantee that nothing is missed (#3215): it is the only path that creates mirrors for newly planned repos. If that creation fails, the daily fetch cannot fetch a mirror that does not exist — and per #3270 a missing mirror never trips the daily chronic alarm either — so a failed clone pass plus a missing mirror is a repo with no backup and no alarm on any cadence, discovered at disaster-recovery time. The fix is small: the verdict already exists in clone_all.py's exit code; reconcile just has to keep it.
Related, not duplicates: #3270 (daily fetch's chronic alarm cannot see a missing mirror; its body notes the clone-pass-fails scenario as background, but its acceptance is entirely in fetch_mirrors.py). #3282 (the mirror contract design) adopts #3238/#3233/#3250/#3219/#3270/#3257/#3240/#3229 in its phases — reconcile's exit code and report are not among them; this filing is the reconcile-side recorded outcome its rule 3 ("every attempt ends in a recorded outcome") currently lacks. #3240 (atomic state writes) covers torn writes, not dropped exit codes.
Acceptance criteria
- When the clone pass exits non-zero,
reconcile.pyexits non-zero (in addition to the existing inventory-error path), so the weekly timer unit surfaces the failure. - The dated reconcile report records the clone-pass outcome (attempted count / ok / fail, or at minimum pass vs fail with the failing repos named or pointed to
clone-status.jsonl) — the report is amended or written after the clone pass, not before it alone. - A run with no missing mirrors, or a fully successful clone pass, still exits 0 when inventory is clean; the inventory-error exit behaviour is unchanged.
- Regression coverage (script-level test or probe harness): clone-pass rc=1 → reconcile rc=1 and report names the failure; clone-pass rc=0 → reconcile rc=0.
Activity
dezren39 commentedon Nov 1, 2026
🤖 Agent note · filed
dezren39 commentedon Nov 1, 2026
🤖 Agent note · filed (timestamp correction to the note above)
9 remaining items
dezren39 commentedon Nov 1, 2026
Triage task 4909 completed: reproduced the dropped clone-pass result on refreshed main and queued scoped implementation task #5889. The issue is now triaged; no competing PR exists.
dezren39 commentedon Nov 2, 2026
🤖 Agent note · picked up
Merge pull request #4385 from developing-today/queue/5889-3300-reconc…
dezren39 commentedon Nov 2, 2026
🤖 Agent note · done