fix: preflight reads CLAUDE.md from origin, not the stale clone working tree #227

Merged
joshtronic merged 1 commit from fix/preflight-claude-md-on-origin into master 2026-06-24 19:41:14 +00:00
Collaborator

What this PR does

  • fix: preflight reads CLAUDE.md from origin/$PR_BASE (the ref the worktree is carved from), not the clone's stale working tree

Bug: the local clone is a fetch-only anchor -- ensure_repo_local (and the clone-if-needed step) only git fetch, never re-check-out -- so a repo cloned before its CLAUDE.md landed keeps a frozen working tree forever. The preflight [ ! -f "$REPO_PATH/CLAUDE.md" ] read that frozen tree and falsely blocked repos that have CLAUDE.md on their default branch (and pass API validation, which checks the remote).

Impact: two repos were walled off from all issue work:

  • joshtronic/porksicle.com -- clone frozen on its 2026-06-19 initial commit, 125 commits behind; CLAUDE.md landed 2026-06-20. (This is porksicle.com#43, blocked with "CLAUDE.md is missing at the repo root" despite clearly having it.)
  • joshtronic/devopsafterdark.com -- same shape.

(joshtronic/igor's own clone is 148 commits behind too -- it just dodged the bug because its initial commit already had CLAUDE.md.)

Fix: fetch, then git cat-file -e "origin/${PR_BASE}:CLAUDE.md" -- aligning preflight with the rest of the harness ("read origin/<ref>, never the clone's tree"). Also drops the now-redundant fetch in the worktree block.

Test plan

  • bash -n bin/tick.sh clean
  • bin/check-sync.sh passes
  • Old-vs-new preflight against the real clones: porksicle.com + devopsafterdark.com flip BLOCK -> PASS; flipflopfrenzy.com (genuinely no CLAUDE.md) correctly stays BLOCK -> BLOCK
  • After merge + self-deploy: remove Status/Blocked from the falsely-blocked issues (porksicle.com#43 and any siblings) so the harness re-claims them

Directly authored (not via the issue grind) because the bug blocks the grind itself on the affected repos.

## What this PR does - [x] fix: preflight reads `CLAUDE.md` from `origin/$PR_BASE` (the ref the worktree is carved from), not the clone's stale working tree **Bug:** the local clone is a fetch-only anchor -- `ensure_repo_local` (and the clone-if-needed step) only `git fetch`, never re-check-out -- so a repo cloned *before* its `CLAUDE.md` landed keeps a frozen working tree forever. The preflight `[ ! -f "$REPO_PATH/CLAUDE.md" ]` read that frozen tree and **falsely blocked** repos that have `CLAUDE.md` on their default branch (and pass API validation, which checks the remote). **Impact:** two repos were walled off from *all* issue work: - `joshtronic/porksicle.com` -- clone frozen on its 2026-06-19 initial commit, 125 commits behind; `CLAUDE.md` landed 2026-06-20. (This is `porksicle.com#43`, blocked with "CLAUDE.md is missing at the repo root" despite clearly having it.) - `joshtronic/devopsafterdark.com` -- same shape. (`joshtronic/igor`'s own clone is 148 commits behind too -- it just dodged the bug because its *initial* commit already had `CLAUDE.md`.) **Fix:** fetch, then `git cat-file -e "origin/${PR_BASE}:CLAUDE.md"` -- aligning preflight with the rest of the harness ("read `origin/<ref>`, never the clone's tree"). Also drops the now-redundant fetch in the worktree block. ## Test plan - [x] `bash -n bin/tick.sh` clean - [x] `bin/check-sync.sh` passes - [x] Old-vs-new preflight against the real clones: `porksicle.com` + `devopsafterdark.com` flip BLOCK -> PASS; `flipflopfrenzy.com` (genuinely no CLAUDE.md) correctly stays BLOCK -> BLOCK - [x] After merge + self-deploy: remove `Status/Blocked` from the falsely-blocked issues (`porksicle.com#43` and any siblings) so the harness re-claims them Directly authored (not via the issue grind) because the bug blocks the grind itself on the affected repos.
fix: preflight reads CLAUDE.md from origin, not the stale clone working tree
All checks were successful
Lint / check-sync (push) Successful in 4s
Lint / check-sync (pull_request) Successful in 5s
37e5464ed4
The clone is a fetch-only anchor -- nothing re-checks-it-out -- so a repo
cloned before its CLAUDE.md landed keeps a stale working tree forever. The
preflight read that tree and falsely blocked repos that DO have CLAUDE.md
on their default branch (and pass API validation). Walled off
joshtronic/porksicle.com (clone frozen 125 commits back) and
joshtronic/devopsafterdark.com from all issue work. Now fetch + check
origin/$PR_BASE:CLAUDE.md, the ref the worktree is carved from.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011KXPafSYJPY6XkWHHk1Lfs
joshtronic deleted branch fix/preflight-claude-md-on-origin 2026-06-24 19:41:14 +00:00
joshtronic approved these changes 2026-06-25 16:59:45 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
joshtronic/igor!227
No description provided.