GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — github-backup: mirror contract remainder (#3238, #3270, #3240, #3283) by developing-today[bot] · Pull Request #7723 · developing-today/code

Conversation

@developing-today

@developing-today developing-today Bot commented Nov 8, 2026 •
edited by blacksmith-sh Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Closes #3238, closes #3270, closes #3240, closes #3283 — the four open children of design #3282 ("a mirror is what it can prove"), driven by queue task 12622. The other phase children (#3233, #3250, #3219, #3257, #3229) are already closed, so this PR completes the design's acceptance: no surface of the system can report coverage, success, or health the underlying mirrors, records, or inventory do not support.

#3238 — validity is resolvability (design rule 1–2)

  • ghb_common.valid_mirror now requires bareness AND a resolvable HEAD (rev-parse --verify -q HEAD). No emptiness exception: planned repos are never legitimately empty (build_plan excludes zero-commit repos), documented in the docstring.
  • New ghb_common.is_skeleton_mirror (bare + unresolvable HEAD + zero refs); clone_all.dest_is_confirmed_partial treats a skeleton as a confirmed partial, so a killed clone's skeleton is cleared and re-cloned instead of being preserved forever by the github-backup(clone_all): a clone killed mid-flight leaves a partial destination every rerun rejects — the 'resumable' driver never resumes that repo #3233 policy guard. A bare repo WITH refs is still preserved.

#3270 — a missing mirror reaches the alarm (design rule 5)

  • fetch_mirrors.fetch_repo records a missing mirror as an unavailable day through the same fail_days streak as failures (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 semantics): 3 consecutive missing days now make the daily run exit 1. Success clears the record via the existing reset. The drainer shares the recorder, and same-day repeats count once.

#3240 — state written atomically, loaded tolerantly, only through ghb_common (design rule 6)

  • New helpers in ghb_common: atomic_write_text (temp file in the same directory + fsync + os.replace + last-good copy), save_json, load_json_tolerant (torn file → last-good copy, else empty, always with a loud named problem), and state_lock (shared flock).
  • load_plan / load_state route through the tolerant loader — a torn plan.json/state.json no longer wedges fetch, drainer, clone pass, manifest, or reconcile at startup.
  • All generated-state writers migrated: fetch + drain state.json saves, reconcile plan.json, manifest MANIFEST.json, FAMILIES.md, and the dated reconcile report. Both state.json writers hold state_lock across their whole load→modify→save cycle, closing the lost-update window.

#3283 — closing audit

  • The grep inventory of remaining bare json.load / open("w") / file json.dump in infra/github-backup/bin/ is posted on Phase 3 (audit) of #3282 — closing state-access inventory + contract statement for infra/github-backup #3283 with a disposition for every hit: after this PR the only file-IO hits are the ghb_common helpers themselves, load_config (repo source file, not generated state), subprocess/API payload parsing, and append-only logs (out of the torn-write class by the audit's own scope).
  • Named dispositions: (a) FAMILIES.md + reconcile report — migrated to the atomic helper in this PR; (b) drainer plan load — already a single pre-loop load, now through the tolerant loader; (c) Worker (worker/src/index.js) — out of scope, KV is its store (recorded on Phase 3 (audit) of #3282 — closing state-access inventory + contract statement for infra/github-backup #3283).
  • Contract statement: the seven rules in operator language are now in infra/github-backup/README.md, cross-referenced from the DR section of docs/RUNBOOK.md. Completion evidence is posted on umbrella github-backup: estate mirror system (laptop mirrors + dedicated App + Worker webhooks + weekly sweep) #3215.

Tests

  • New tests/test_mirror_contract.py: skeleton invalid + complete mirror valid (real git repos), skeleton confirmed-partial vs complete preserved, manifest reports a skeleton missing, missing-day streak accumulation + chronic exit 1 through main() + clear-on-ok, atomic roundtrip/last-good fallback/torn-without-backup/intact-on-failed-replace, state lock.
  • One existing expectation updated: test_plan_state_shape.py::test_main_survives_state_top_level_list — the saved state now also carries the 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 missing-day record for the (patched-invalid) repo; the github-backup(fetch): a valid-JSON but wrong-shape plan/state entry crashes the whole daily fetch — one poison entry in plan.json or state.json wedges every repo, every day #6637 wrong-shape contract it guards is unchanged.
  • Three existing fixture helpers updated (test_clone_all_partial.py, test_reconcile_clone_pass.py, test_reconcile_retention.py): their "valid mirror" fixtures were git init --bare skeletons — the exact shape 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 makes invalid — so they now seed one real commit. The behaviours those suites guard (github-backup(clone_all): a clone killed mid-flight leaves a partial destination every rerun rejects — the 'resumable' driver never resumes that repo #3233 partial clearance, github-backup(reconcile): a failed clone pass exits 0 and is absent from the dated report — clone_all's verdict is dropped by its only scheduled caller #3300 clone-pass propagation, github-backup(inventory): a null repositoryOwner is silently read as 'this owner has no repos' — reconcile drops the owner's mirrors from plan.json and MANIFEST.json and exits 0 #3229 retention) are unchanged.
  • Full github-backup suite run on the laptop before merge; all suites pass.

🤖 Queue worker lane code-g, task 12622.


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
repo-worker-code-k
github-backup: mirror contract remainder — validity is resolvability (#…
fc1c796
…3238), missing-mirror alarm (#3270), atomic state (#3240), closing audit (#3283)
@developing-today
developing-today Bot requested review from a team and dezren39 as code owners November 8, 2026 14:12
@coderabbitai

coderabbitai Bot commented Nov 8, 2026

Copy link
Copy Markdown

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 490508f8-48c1-4ae0-8b7a-8a21ebca83a4

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

  • X
  • Mastodon
  • Reddit
  • LinkedIn
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@developing-today developing-today Bot mentioned this pull request Nov 8, 2026
Design: a mirror is what it can prove — one validity, outcome and alarm contract for the github-backup estate mirror #3282
Closed
4 tasks
@dezren39
dezren39 merged commit 752357c into main Nov 8, 2026
3 of 5 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@dezren39
dezren39 deleted the queue/12622-3282-mirror-contract branch November 8, 2026 15:04
@dezren39 dezren39 mentioned this pull request Nov 9, 2026
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
Closed
4 tasks
@dezren39 dezren39 mentioned this pull request Nov 21, 2026
Closure audit: every closed issue/PR verified; unmerged branches + unpushed worktrees inventoried #7079
Open
@dezren39 dezren39 added the audit:complete PR fully implemented spawning issue label Nov 25, 2026
This was referenced Nov 25, 2026
AUDIT-7 Lane 4 — MERGED-PR-AUDIT: merged PRs since 2026-10-23 vs their spawning issues #13879
Open
docs: AUDIT-7 batch 3 partial ledger (226 PRs, 4 invalid IDs) #14847
Merged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@dezren39 dezren39 Awaiting requested review from dezren39

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

audit:complete PR fully implemented spawning issue

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Phase 3 (audit) of #3282 — closing state-access inventory + contract statement for infra/github-backup 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 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 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'

Uh oh!

There was an error while loading. Please reload this page.

1 participant

@dezren39
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.