Repository navigation
Description
Problem
In the daily fetch (infra/github-backup/bin/fetch_mirrors.py), a planned mirror that is missing on disk can never trip the chronic-failure alarm: every daily run reports it, writes a fetch.log line, and exits 0 — forever. A repo whose git fetch fails exits 1 on its third failure day; a repo with no mirror at all is structurally invisible to that mechanism, even though it is the worse state (there is no backup to be stale).
Evidence (verified this run on main e08fceb4)
fetch_mirrors.py:22-23—fetch_reporeturns"missing"whenvalid_mirror(path)is false, before thestate.setdefault(repo, {})at line 28 and before anyfail_daysrecording (lines 34-37, failure path only).fetch_mirrors.py:72-75— the run's only non-zero exit path ischronic = [repos with len(fail_days) >= 3]; a missing repo never accumulatesfail_days, sochroniccan never contain it. The docstring (lines 5-7) states the exit code exists "so systemd shows the failure" — the oneshotgithub-backup-fetch.servicehas no other failure signal.- The weekly reconcile does re-clone missing mirrors, but if the mirror disappears again (or the clone pass fails), the daily fetch — the only daily signal — stays green indefinitely; MANIFEST.json says
missingbut nothing reads it as an alarm.
Probe (laptop, verbatim copies, sha256-matched)
Probe: ~/git/fleet/probe-2026-10-31-laneA-fetchmissing/ (laptop) — fetch_mirrors.py / ghb_common.py / manifest.py sha256-identical to sandbox main e08fceb4; fake HOME with a two-repo plan.json:
RUN 1 (missing repo + control repo whose remote is a nonexistent local path, seeded with 2 prior fail_days):
{"results": {"ok": 0, "fail": 1, "skip": 0, "missing": 1}, "chronic_failures": ["owner/failing-one"]} exit=1
MANIFEST: {'owner/failing-one': 'mirrored', 'owner/missing-one': 'missing'}
RUNS 2-4 (missing repo alone, three more daily passes):
{"results": {"ok": 0, "fail": 0, "skip": 0, "missing": 1}, "chronic_failures": []} exit=0 (x3)
state.json after all runs: no entry for owner/missing-one at all — fail_days is never created for it.
The control proves the chronic mechanism works for fetch failures; the missing path bypasses it entirely.
Why it matters
The mirror set is the disaster-recovery source for the whole estate (see infra/github-backup/README.md). A mirror deleted, corrupted past valid_mirror, or never cloned after a plan change is exactly the loss the daily fetch exists to surface — and it is the one outcome its alarm cannot express. The failure is silent in the only channel systemd watches (the exit code).
Acceptance criteria
- A repo reported
missingby the daily pass is recorded in state (e.g. its own missing-days list, orfail_days) so repeated daily misses eventually make the run exit non-zero, on the same 3-day scale as fetch failures — or a single missing mirror exits non-zero immediately, with the choice recorded in triage. - A transient/one-day missing state that the weekly reconcile repairs does not latch the alarm after the mirror returns (state for the repo clears on the next
ok, asfail_daysdoes at line 31). - Regression coverage (script-level test or probe script checked in): missing-on-3-days run exits 1; control fetch-failure behaviour unchanged; a repo that returns to
okclears its record. - Distinct from github-backup(drain): webhook events are acked even when the fetch failed or the mirror is missing — freshness signal silently dropped #3219 (drainer acking webhook events for missing mirrors) and github-backup(fetch): fail_days counts every failure day since the last success, not 3 days in a row — intermittent failures weeks apart trip the chronic alarm and latch exit 1 #3257 (fail_days counting non-consecutive days): this issue is only the daily fetch pass's missing path never reaching the exit code.
Dedup
Checked open + recently closed github-backup issues this run: #3215 (umbrella), #3219 (drain ack on failed/missing fetch), #3229 (null owner), #3233 (partial clone), #3238 (bare-skeleton valid_mirror), #3240 (non-atomic state writes), #3250 (fetch timeout), #3257 (fail_days consecutiveness). None covers the daily pass's missing-mirror exit code.
Activity
dezren39 commentedon Nov 1, 2026
🤖 Agent note · filed
dezren39 commentedon Nov 1, 2026
🤖 Design-architect pass 29 (2026-10-31) — agent note: this issue is ADOPTED as a phase of design #3282 ("a mirror is what it can prove — one validity, outcome and alarm contract for the github-backup estate mirror", design doc: files/designs/code-github-backup-mirror-contract.md in the keep-the-four-repos-healthy goal workspace), linked as a sub-issue of #3282 and labelled source/design-architect. Triage: do NOT re-file, re-scope or split this issue — record the phase structure instead. Phase mapping: Phase 1 (validity & destinations) = #3238 + #3233; Phase 2 (recorded outcomes & the alarm) = #3250 + #3219 + #3270 + #3257; Phase 3 (durable state & plan retention) = #3240 + #3229 + closing audit #3283 (gated on Phases 1–2). The design records the pins that span the phases: validity = bare + HEAD resolves, with no emptiness exception inside the plan (build_plan excludes zero-commit repos); destinations are absent / valid / skeleton (remove + clone) / debris (quarantine to
.partial-<timestamp>+ clone); every fetch attempt ends in one recorded outcome shared by the daily loop and the drainer, and the drainer acks only onok; the chronic alarm is a streak of 3 consecutive unavailable days (fail, timeout and missing all count); generated state is written atomically only throughghb_commonhelpers; reconcile retains a failed owner's previously planned entries. Where an origin's acceptance left a choice open (the streak-vs-window rule, missing-counts-vs-immediate, report-vs-retain, skeleton handling), the design doc records the decision — triage follows the design's pin, not the open alternative. Each origin keeps its own acceptance criteria and its already-queued triage packet — no new packet was created for it this pass.58 remaining items
dezren39 commentedon Nov 5, 2026
🤖 Agent note · handed off
dezren39 commentedon Nov 8, 2026
🤖 Agent note · handed off
dezren39 commentedon Nov 8, 2026
🤖 Agent note · handed off
Merge pull request #7723 from developing-today/queue/12622-3282-mirro…
dezren39 commentedon Nov 9, 2026
agent-note:v1 task 6813 lane code-u: handed off to opencode claimant (execution lane row 1632, checkpoint handed_off).
dezren39 commentedon Nov 9, 2026
🤖 Agent note · done (already_done)