fix(coord): count a FETCH_HEAD as origin/main's clock only when it names that ref (BACKLOG #1374) - #871
Open
wshallwshall wants to merge 2 commits into
Open
fix(coord): count a FETCH_HEAD as origin/main's clock only when it names that ref (BACKLOG #1374)#871wshallwshall wants to merge 2 commits into
wshallwshall wants to merge 2 commits into
Conversation
…mes that ref (BACKLOG #1374) The stated remainder of #1374. FETCH_HEAD means "a fetch happened", not "origin/main was refreshed": `git fetch origin refs/pull/N/head`, or a fetch of another remote, bumps the mtime and leaves the ref alone, so the field could read FRESH against a stale ref -- the dangerous direction. git records WHAT it fetched, one line per ref, so `branch 'main' of <origin url>` is the evidence and nothing else qualifies. Measured in a sandbox 2026-09-04: `git fetch origin`, `git fetch origin main` and `git fetch origin refs/heads/main` all write that line, while `git fetch origin refs/pull/7/head` writes `'refs/pull/7/head' of <url>` -- no `branch` prefix, no mention of main. Two traps, both measured and both pinned. git STRIPS the `.git` suffix from the url it writes (`remote get-url` returned `.../up.git` where FETCH_HEAD said `.../up`), so a literal compare never matches. And it REWRITES the file rather than appending, so a pull-ref fetch destroyed the earlier main line six seconds later. When nothing qualifies the field goes null rather than falling back to the newest clock. The fallback is the tempting line and it would restore the exact defect. The two roads to null get DIFFERENT stops, because "no FETCH_HEAD exists anywhere" is a false sentence in a clone that just fetched a pull ref, and an instrument caught in an obvious lie stops being read at all. Renamed a second time, to originMainFetchAgeMinutes/originMainFetchClock. `lastFetchAgeMinutes` timed a real fetch but ANY fetch: with a pull-ref fetch one minute old beside a main fetch three hours old the honest value is 180, which the name contradicts. Nothing outside docs/BACKLOG.md and this script's test read either retired key -- rechecked over this repo and the vault's origin/main, with originMainSha as the positive control -- and both are now pinned absent. Five new arms, each shown to redden under a mutation of its own seam: newest-clock-wins, a literal url compare, dropping the url compare, and one sentence for both blind states. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…de was on main Both were false. PR 774 merged the first two halves at 3279141 on 2026-09-04, verified with `git merge-base --is-ancestor` against origin/main rather than inferred from the PR being closed. The scoring note still said "Not started" and the banner still said "NOT merged", so a Builder briefed off either would have rebuilt shipped work. The stated remainder is recorded as built on claude/fleet-clock-1374 and unmerged. The banner stays open on that strength; a closure banner asserts a verified landing and this half has none yet, so the flip stays the Lander's. The status cell moves to "partly shipped", the file's existing vocabulary for exactly this state. The full statement lives in the item's banner and the two summary lines point at it rather than restating it. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Closes the stated remainder of BACKLOG #1374.
Most of #1374 was ALREADY ON MAIN before this branch
Verified with
git merge-base --is-ancestor 3279141e2 origin/main, not inferred from the PR beingclosed. PR 774 at
3279141e2already shipped:FETCH_HEADmtime instead of therefs/remotes/origin/mainref file;<common>and every<common>/worktrees/*git dir;(null)sentinel in the text receipt;tests/test_coord_fleet_fetch_clock.py, nine Windows-gated arms.None of that was rebuilt. The item's banner said "NOT merged" and its scoring note said "Not
started" while the code was on
main; both were false and both are corrected here.What this branch adds: a fetch clock is not a main clock
FETCH_HEADmeans "a fetch happened", not "origin/main was refreshed".git fetch origin refs/pull/N/head, or a fetch of another remote, bumps the mtime and leaves the ref alone, so thefield could read FRESH against a stale ref -- the dangerous direction. The item said the file names
what it fetched and that closing this was possible; it was stated as a limit and not attempted.
A
FETCH_HEADnow counts only if it NAMES origin's main:branch 'main' of <origin url>.Measured in a sandbox 2026-09-04, one fetch form per run:
git fetch originbranch 'main' of <url>git fetch origin mainbranch 'main' of <url>git fetch origin refs/heads/mainbranch 'main' of <url>git fetch origin refs/pull/7/head'refs/pull/7/head' of <url>Two traps, both measured and both pinned by their own arm:
.gitsuffix from the url it writes.git remote get-url originreturned.../up.gitwhereFETCH_HEADin the same clone said.../up. A literal compare never matches,and the failure is silent -- everything goes UNMEASURABLE.
git fetch origin mainthengit fetch origin refs/pull/7/headleft a one-lineFETCH_HEADnaming only the pull ref, six seconds newer, mainline gone.
When nothing qualifies the field goes null rather than falling back to the newest clock. That
fallback is the tempting line and it would restore the exact defect. The two roads to null get
DIFFERENT stops, because "no FETCH_HEAD exists anywhere" is a false sentence in a clone that just
fetched a pull ref, and an instrument caught in an obvious lie stops being read at all.
git ls-remote origin mainstays DECLINED, for the reason the item already records: this is a purereader a stranded session runs, so a network round-trip per render adds the failure mode the
instrument exists to survive.
Renamed a second time, and why
lastFetchAgeMinutes->originMainFetchAgeMinutes,lastFetchClock->originMainFetchClock.lastFetchAgeMinutestimed a real fetch but ANY fetch. With a pull-ref fetch one minute old besidea main fetch three hours old the honest value of this field is 180, which the name contradicts -- a
name fighting its own value is how this item started. Nothing outside
docs/BACKLOG.mdand thisscript's own test read either retired key, rechecked over this repo and the vault's
origin/mainwith
originMainShaas the positive control that the search could see the files. Both retired keysare pinned absent.
Tests
Five new arms in
TestOnlyAFetchOfOriginMainCountsAsTheClock, positive control first. Every onewas shown to redden under a mutation of the seam it covers, with each mutation asserted to have
actually applied so a no-op patch could not read as a passing test:
.git)Checks run
ruff check .ruff format --check .mypy messagefoundry(strict)pytest tests/test_coord_fleet_fetch_clock.pyscripts/docs/backlog_status_check.pytests/test_coord_fleet_fetch_clock.pywas already intests/tooling_manifest.txt, so rule 5 needsno new line. Legs that only run on a hosted runner were not seen from here and need reading after
merge.
Not done, deliberately
The banner stays open. A closure banner asserts a verified landing with a sha, and this half has
none yet, so the flip stays the Lander's. The summary row moves to
partly shipped, the file'sexisting vocabulary for this state.
🤖 Generated with Claude Code