GeezerVison is showing github.com — 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 · Issue #3270 · developing-today/code
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 #3270DescriptionProblem
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_repo returns "missing" when valid_mirror(path) is false, before the state.setdefault(repo, {}) at line 28 and before any fail_days recording (lines 34-37, failure path only).
fetch_mirrors.py:72-75 — the run's only non-zero exit path is chronic = [repos with len(fail_days) >= 3]; a missing repo never accumulates fail_days, so chronic can never contain it. The docstring (lines 5-7) states the exit code exists "so systemd shows the failure" — the oneshot github-backup-fetch.service has 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
missing but 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
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. Activityadded task/triageQueue packet kind: verify, reproduce, and route this item kind/bugSomething isn't working (prefixed form of the classic bug label) effort/sSmall: expected under 2 hours of work on Nov 1, 2026dezren39 commented on Nov 1, 2026 dezren39 commented on 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 on ok; the chronic alarm is a streak of 3 consecutive unavailable days (fail, timeout and missing all count); generated state is written atomically only through ghb_common helpers; 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. dezren39 commented on Nov 5, 2026 🤖 Agent note · handed off
- Agent: fleet monitor
- Session / ID: task 6813 (repo-fleet-monitor run 2026-11-05T15:39:47Z)
- Found via: monitor reconciliation (Duty 1 claim/label divergence repair)
- Task: Claim evaporated: task 6813 is queued and unclaimed in repo-health-code-pilot, but this issue still carried claimed labels. Labels reset to the truth (queue/queued + status/needs-triage). Checkpoint stage at evaporation: handed_off.
- Expectation: The next lane claim picks task 6813 up from the queued state and posts a fresh pickup note.
dezren39 commented on Nov 8, 2026 🤖 Agent note · handed off
dezren39 commented on Nov 8, 2026 🤖 Agent note · handed off
dezren39 commented on Nov 9, 2026 agent-note:v1 task 6813 lane code-u: handed off to opencode claimant (execution lane row 1632, checkpoint handed_off). dezren39 commented on Nov 9, 2026 🤖 Agent note · done (already_done)
- Agent: repo queue worker, lane code-j (repo-worker-code)
- Session / ID: cron repo-queue-worker-shift-j run 2026-11-09 04:30 CST; task 6813 at 2026-11-09T10:36:32Z
- Found via: queue claim · task 6813
- Task: task 6813 (small_fix for issue 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). Fresh check: issue 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 is CLOSED (stateReason COMPLETED, closed 2026-11-08T15:04:07Z). PR github-backup: mirror contract remainder (#3238, #3270, #3240, #3283) #7723 "github-backup: mirror contract remainder (github-backup(valid_mirror): a bare skeleton with zero refs passes as a verified mirror — clone_all records it ok and MANIFEST.json reports it 'mirrored' #3238, 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, github-backup(state): plan.json, state.json and MANIFEST.json are written non-atomically and loaded with bare json.load — one torn write wedges the daily fetch, the drainer and manifest regeneration #3240, Phase 3 (audit) of #3282 — closing state-access inventory + contract statement for infra/github-backup #3283)" is MERGED at 2026-11-08T15:04:05Z, merge commit 752357c — the closing reference for issue 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. The work is already done; no new branch or PR from this lane.
- Expectation: task 6813 completed as already_done with this evidence. Dependent gates named in the packet (tasks 4844, 5683) move with issue 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's closure.
- Links: task 6813 · issue 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 · PR github-backup: mirror contract remainder (#3238, #3270, #3240, #3283) #7723
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|