Skip to content

release: v3.10.10 — a commit missing from this clone is no longer taken as gone - #294

Merged
AltDoug merged 1 commit into
mainfrom
fix/commit-stale-consumer-clone
Oct 30, 2026
Merged

AltDoug merged 1 commit into
mainfrom
fix/commit-stale-consumer-clone

Conversation

@AltDoug

@AltDoug AltDoug commented Oct 29, 2026

Copy link
Copy Markdown
Owner

What broke

On a pull-only agent-config clone (the Windows box), SessionStart sync rewrote 4 entries from (commit: a46fa6b|e672651|d7e9245) to (commit-stale: …) because those objects were missing locally. The author's clone still held them, so it left them alone: one ledger, two verdicts depending on what each object store happened to contain. The uncommitted edit then made git pull --ff-only abort ("local changes would be overwritten"), after every sync. agent-config ledger docs/found-issues.md:1.

Measured: the three SHAs exist on GitHub (gh api repos/AltDoug/agent-config/commits/<sha> → 200). No remote branch contains them (squash-merged feature-branch commits; e672651 is PR #594).

Fix (lib/sync.sh)

A SHA missing locally is demoted only when the absence is evidence:

  • the repo has no remote, so local history is the whole history (unchanged behavior), or
  • GitHub answers HTTP 422 "No commit found for SHA" (one memoized gh api call per SHA per run).

A 404 (a repo the signed-in account can't see), any other failure, or a non-GitHub remote leaves (commit:) alone, the same way shallow clones and ambiguous SHAs already did.

Evidence

  • New tests in tests/cli-sync-commit-stale.bats: a real --single-branch clone missing a side-branch commit (red before, green after); GitHub-exists → untouched; GitHub-422 → still demotes; lookup failure → untouched. 7/7 ok.
  • Full suite: 1..2048, 2047 ok, 1 fail = README test-count stat (2044 → 2048, updated; docs-consistency re-run 0 failures).
  • E2E on a fresh main-only clone of AltDoug/agent-config with real gh: installed 3.10.9 demoted all 4 refs; this branch left all 4 alone. A genuinely missing SHA (deadbee) still demotes: Synced. Demoted: 1 (0 PR-closed + 1 commit-stale).

Not in this PR

Sync's auto-archive (and merged-PR closures) still write the ledger on a pull-only clone, so a pull can still abort once upstream commits the same archive. Logged as lib/sync.sh:770 with a decide tag (read-only sync mode vs deploy-side workaround).

🤖 Generated with Claude Code

https://claude.ai/code/session_01MVx3HWniZnrXYfPiCo5Lrs

…en as gone

sync demoted (commit: <sha>) to (commit-stale: <sha>) whenever the SHA did
not resolve locally. A pull-only clone that never fetched a commit demoted
refs the author's clone still resolved, and the uncommitted ledger edit then
blocked its own git pull --ff-only, after every SessionStart sync.

A SHA missing locally is now demoted only when the repo has no remote, or
GitHub answers HTTP 422 "No commit found" for it. A 404, a failed lookup or a
non-GitHub remote leaves the annotation alone.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MVx3HWniZnrXYfPiCo5Lrs
@AltDoug
AltDoug enabled auto-merge (squash) October 29, 2026 23:44
@AltDoug
AltDoug merged commit e509213 into main Oct 30, 2026
7 checks passed
@AltDoug
AltDoug deleted the fix/commit-stale-consumer-clone branch October 30, 2026 00:27
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