Repository navigation
status --fetch: the second layer — ask origin first, with the one write bounded to remote-tracking refs by a pinned refspec - #10
Conversation
… `park --all` / `-a` is the sweep unasked Brett Heap's RULING of 2026-09-10, verbatim: "lets change that so it parks the current repo. if not in a repo, then asks if want to park all. and park all should be park -a or park --all." It supersedes his openRepoShape #91 ruling of the same day, under which bare `park` with no estate around the cwd parked every estate unasked. - The walk-up is unchanged: inside an estate, bare `park` parks that one. - Outside every estate, at a terminal: list, then `park every estate above? [y/N]` on stderr. Only y/yes runs #91's sweep; anything else exits 2 with "nothing was parked". - Outside every estate, with no terminal on stdin: refuse, list, and name `--all`. Never hang on a question nobody can see. - `park --all` / `park -a`: the sweep from anywhere, unasked. Refused alongside <Name> or --repo, and when no estate exists at all. - `resume --all` / `-a` refuses by name and says why `resume` has no sweep, instead of the generic "put it after `--`". - The sweep itself (name order, continue past a refusal, skip roots without the overlay, one summary) is untouched; it now takes its rows from the caller that listed them. Tests 147 -> 160: the question under a real pseudo-terminal (y/Y/yes/YES, Enter/n/no/other), the no-terminal refusal, --all and -a, --all from inside an estate, the flag conflicts, and the sweep tests now driven by --all. README 178 -> 182 and AGENTS.md 95 -> 99, caps raised in dated docstring entries. Co-Authored-By: Claude Fable 5.1 <[email protected]>
Co-Authored-By: Claude Fable 5.1 <[email protected]>
…f sync across an estate, read-only, as of the last fetch Brett Heap's RULING of 2026-09-10, verbatim: "lets go with a fourth file. start with the local status layer." `status [<Name>] | --all` finds the estate exactly as `park` and `resume` do — the shared resolver block is now carried byte for byte by three files — and then only READS: for the holder or root, each member's working clone and every mounted leg, whether the tracking branch is ahead of or behind its origin, what is dirty or stashed, a root off its tracking branch or detached, feature branches never pushed or whose remote branch is gone, dirty feature worktrees, a leg checked out away from its pin or pinned behind its origin or on an unpushed leg commit, a leg on a feature branch, a leg declared and not mounted, and a member with no working clone. It fetches nothing, says "as of the last fetch" on every run, and takes no lock (`git --no-optional-locks`). Exit 0 in sync, 1 findings printed, 2 refused. Bare `status` inside an estate reads that one; outside every estate it reads them all WITHOUT asking, because nothing writes; `--fetch` refuses by name as the next layer. - `openRepoTools --install` places FOUR files; the count line says `4 of 4`. - README and AGENTS.md (new rule 4) document it; caps raised in dated entries. - CI parses the fourth file with /bin/bash -n. - `park` and `resume` change only in comments: the shared block now says three copies. An independent review of the first draft (14 synthetic estates, a full-tree snapshot proving nothing is written) found six things, all fixed here: a git that cannot run is refused rather than reported as an empty estate; the one unguarded pipeline; 0x1F rather than TAB between for-each-ref fields so an empty field cannot shift; "0 commit(s) never pushed" reworded; a missing flag value exits 2 in the command's own words, not bash's exit 1; a valueless .gitmodules key no longer invents a leg. Plus the gap it flagged: a leg on a feature branch at its pin is a finding, as AGENTS.md rule 1 already names it. Tests 160 -> 187: a new tests/test_status_command.py (22, real bare remotes and a leg submodule, one scenario each), the installer and hygiene suites taught the fourth file, and the resolver identity held three ways. Co-Authored-By: Claude Fable 5.1 <[email protected]>
Co-Authored-By: Claude Fable 5.1 <[email protected]>
…rite bounded to remote-tracking refs by a pinned refspec Brett Heap's RULING of 2026-09-11, verbatim: "next layer: --fetch". With the flag, `git fetch --quiet --prune --recurse-submodules=no origin '+refs/heads/*:refs/remotes/origin/*'` runs in every repository before it is read — holder or root, each member's working clone, every mounted leg — so the ahead/behind answers are current and a remote branch deleted under a feature reads as gone. One line under each row says what the fetch did: which ref moved and from where, nothing new, or that the tracking branch is GONE from origin. A fetch that fails is a finding on that row and the row is read as of the last fetch that worked; a repository whose gitfile points at a deleted git dir is reported as unreadable, not as "no remote". The footer names the one write. Without the flag nothing changes. THE REFSPEC IS PINNED ON THE COMMAND LINE, and that is what bounds the write. The review of this layer deleted a local branch through the configured form: a leg whose `remote.origin.fetch` maps heads onto local branches, plus `--prune`, loses a branch origin no longer has, and `fetch.pruneTags` set globally prunes local tags the same way — while the report calls the repository clean. Naming `+refs/heads/*:refs/remotes/origin/*` means the only refs that can move or go are under `refs/remotes/origin/`, whatever the config says; a test holds that with both misconfigurations set. `GIT_TERMINAL_PROMPT=0` makes an https credential prompt fail and be reported; an ssh host-key or passphrase prompt is ssh's own and still blocks, which the header, usage, README and AGENTS.md now say. The docs say exactly what a fetch writes: remote-tracking refs, the objects behind them and FETCH_HEAD — never a local branch, tag, HEAD, index or working tree. Tests 187 -> 197: behind is seen in one run and the fetch persists; local branches, HEAD, index, working tree and stash are untouched while origin/main moves; a branch deleted from another clone reads as gone after the prune; a dead URL is a finding and the leg is still fetched; the leg is fetched on its own row; no origin is a finding; `--all --fetch` fetches every estate; the pinned refspec keeps a local branch and tags under a mirror refspec and pruneTags; a renamed default branch reads as GONE; a dangling gitfile is named as such. One assertion that could never fail is now real. README 203 -> 214, AGENTS.md 111 -> 117 (rule 4: `status --fetch` is the one way it reaches the network), caps raised in dated entries. Co-Authored-By: Claude Fable 5.1 <[email protected]>
Reviewer's GuideThis PR adds Sequence diagram for status fetch-then-read across repositoriessequenceDiagram
participant User
participant Status
participant Repository
participant Origin
User->>Status: status --fetch
loop each repository
Status->>Repository: git fetch --quiet --prune --recurse-submodules=no origin pinned_refspec
Repository->>Origin: request remote refs
alt fetch succeeds
Origin-->>Repository: updated or pruned remote-tracking refs
Repository-->>Status: fetch result
else fetch fails
Origin-->>Repository: error
Repository-->>Status: fetch failure
end
Status->>Repository: read status
Repository-->>Status: findings as of last successful fetch
end
Status-->>User: per-row fetch result and status report
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Co-Authored-By: Claude Fable 5.1 <[email protected]>
There was a problem hiding this comment.
Hey - I've reviewed your changes and they look great!
Sourcery assessment
Needs a human reviewer. If the fetch behavior is wrong, it can permanently update or prune remote-tracking refs and leave fetched objects or FETCH_HEAD behind after a revert. The impact is bounded to repository metadata and is generally repairable by restoring or refetching the affected refs; local branches, tags, HEAD, the index, and working trees are not changed.
There was a problem hiding this comment.
🟡 Changes recommended
Unresolved tag-safety, dangling-gitfile handling, and fetch-boundary documentation issues remain.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Adds opt-in status --fetch support to refresh origin data across repositories and mounted legs before reporting status.
Changes:
- Fetch and report remote movements, pruning, failures, and leg state.
- Expand tests for fetch behavior and refspec safety.
- Update README and AGENTS.md guidance.
File summaries
| File | Review summary |
|---|---|
tests/test_status_command.py |
Adds fetch coverage; update the side-effect contract to include fetched objects and FETCH_HEAD, plus remote-tag coverage. |
tests/test_repo_hygiene.py |
Updates hygiene checks; its --fetch documentation should include fetched objects and FETCH_HEAD. |
status |
Implements fetching and reporting; unresolved issues remain around tag auto-following, FETCH_HEAD reporting, contradictory no-fetch wording, and dangling gitfile handling. |
README.md |
Documents status --fetch, its side effects, failures, and SSH caveats. |
AGENTS.md |
Updates operational guidance; qualify “CHANGES NOTHING” as applying only without --fetch. |
Review details
Suppressed comments (3)
status:837
- The failure path promises that the row is read as of the last successful fetch, but without
--atomicGit can update some remote-tracking refs before a later ref update or lock failure returns non-zero. Use an atomic ref update so a failed fetch cannot leave a partially refreshed state that the report labels as the previous successful fetch.
if err="$(GIT_TERMINAL_PROMPT=0 git --no-optional-locks -C "$repo" fetch --quiet \
--prune --recurse-submodules=no origin \
'+refs/heads/*:refs/remotes/origin/*' 2>&1)"; then
tests/test_repo_hygiene.py:253
- This new test docstring repeats the incomplete write boundary:
--fetchalso writes fetched objects andFETCH_HEAD, not only remote-tracking refs. Keep this rationale aligned with the command header and the public documentation.
last fetch. His RULING of 2026-09-11, verbatim: "next layer: --fetch" —
the flag asks origin first, the one write the command makes, to
remote-tracking refs and nothing else.
tests/test_status_command.py:17
- This new test-module contract says the fetch writes only remote-tracking refs, but the command also writes fetched objects and
FETCH_HEAD(as the implementation and public docs state). Update the contract so it does not describe an incomplete side-effect boundary.
ONE write this command makes, to remote-tracking refs and nothing else — and
- Files reviewed: 5/5 changed files
- Comments generated: 5
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| if err="$(GIT_TERMINAL_PROMPT=0 git --no-optional-locks -C "$repo" fetch --quiet \ | ||
| --prune --recurse-submodules=no origin \ | ||
| '+refs/heads/*:refs/remotes/origin/*' 2>&1)"; then |
| if ! g "$repo" rev-parse --git-dir >/dev/null 2>&1; then | ||
| finding "fetch: not a readable git repository (a gitfile whose gitdir is gone?), so nothing could be fetched" | ||
| return 0 |
| ;; | ||
| # THE SECOND LAYER (Brett Heap's RULING of 2026-09-11, "next layer: | ||
| # --fetch"): ask origin in every repository first. See `fetch_origin`. | ||
| --fetch) FETCH=1; CHANGED_CLAUSE="only remote-tracking refs and fetched objects were changed (--fetch)."; shift ;; |
| form outside every estate reads them all WITHOUT asking, because nothing | ||
| here writes — the question is `park`'s — and `status --all` from anywhere | ||
| says the same thing. | ||
| 4. **`status` READS AND CHANGES NOTHING, and fetches nothing unless told to**: |
| # and every mounted leg. It fetches nothing unless told to (`--fetch`), so | ||
| # every ahead/behind answer is AS OF THE LAST FETCH — the one it just made, | ||
| # or the one before — and it says which on every run. `make validate` and |
… a local branch through the pinned fetch A refspec on the command line bounds what is fetched and pruned, but git still maps every ref it fetched through the CONFIGURED refspecs as well — "opportunistic remote-tracking updates". Under a mirror-style `remote.origin.fetch` the pinned fetch alone moved a detached leg's local `main` (proved: 6fb2a82 -> 49184cc with the pinned refspec, unchanged with `--refmap`), and in a checked-out root it refused outright. `--refmap` (git 2.1) with the same refspec replaces the configured mapping for this one fetch, so nothing outside `refs/remotes/origin/` is written by either route. The test that should have caught it now asserts the leg's local `main` did not move. Co-Authored-By: Claude Fable 5.1 <[email protected]>
There was a problem hiding this comment.
🟡 Changes recommended
Outstanding fetch safety, reporting, unreadable-gitdir, and documentation issues must be resolved.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review details
Suppressed comments (3)
AGENTS.md:64
status --fetchintentionally writes remote-tracking refs, objects, andFETCH_HEAD, so this opening claim is false for the new mode even though the following lines describe that write. Qualify it as plainstatus/the no-flag mode so the top-level guidance does not tell an assistant thatstatus --fetchchanges nothing.
4. **`status` READS AND CHANGES NOTHING, and fetches nothing unless told to**:
status:1015
- The footer clause says only remote-tracking refs and fetched objects changed, but a successful fetch also rewrites
FETCH_HEAD, which the help and documentation explicitly list. This makes the run summary contradict the stated write boundary; includeFETCH_HEADin the clause and update the matching test constant.
--fetch) FETCH=1; CHANGED_CLAUSE="only remote-tracking refs and fetched objects were changed (--fetch)."; shift ;;
status:783
- When
fetch_originhas just diagnosed a dangling leg gitfile,FETCHED_OKremains 0 and this call adds a secondno origin/main here: never fetched, or no remote named originfinding. That still mislabels the unreadable repository as a missing remote; short-circuit further leg ref inspection after the unreadable-gitdir diagnosis, while retaining an equivalent unreadable finding for plain status.
no_origin_branch_finding "$branch"
- Files reviewed: 5/5 changed files
- Comments generated: 1
- Review effort level: Lite
| if err="$(GIT_TERMINAL_PROMPT=0 git --no-optional-locks -C "$repo" fetch --quiet \ | ||
| --prune --recurse-submodules=no \ | ||
| --refmap='+refs/heads/*:refs/remotes/origin/*' origin \ | ||
| '+refs/heads/*:refs/remotes/origin/*' 2>&1)"; then |
…R's diff is its own change Co-Authored-By: Claude Fable 5.1 <[email protected]>
|
…am, so this PR's diff is its own change Co-Authored-By: Claude Fable 5.1 <[email protected]>



Ruling: Brett Heap, 2026-09-11, verbatim: "next layer: --fetch" — the second of the layers named when
statuslanded (#9), after the local one.Stacked on #9 (
feat/status-local-layer), which is stacked on #8; the base is #9's branch and this carries only the--fetchchange on top.What
status --fetchdoesBefore each repository is read,
git fetch --quiet --prune --recurse-submodules=no origin '+refs/heads/*:refs/remotes/origin/*'runs in it — holder or root, each member's working clone, every mounted leg. Then the read is what it was, only current. One line under each row says what the fetch did.origin/<branch> moved <was> -> <now>,is here now,nothing new, oris GONE (was <sha>): deleted or renamed on origin— and the finding under a gone branch says origin has no such branch, not "never fetched", which the line above would contradict.--pruneis part of it, because a remote branch deleted under a feature is exactly the[gone]this report looks for; a fetch without prune keeps the stale ref that hides it.--recurse-submodules=noon the root, so git's on-demand default does not fetch it again.--all --fetchfetches every estate.The one write, bounded
The refspec is pinned on the command line. The independent review of this layer deleted a local branch through the configured form to prove the point: a leg whose
remote.origin.fetchmaps heads onto LOCAL branches (a--mirrorclone, or a hand-edited config) plus--pruneloses a local branch that origin no longer has;fetch.pruneTagsset globally prunes local tags the same way — and the report then calls the repository clean. Naming+refs/heads/*:refs/remotes/origin/*on the command line overrides the configured refspec, so the only refs that can move or go are underrefs/remotes/origin/, whatever the config says. A test sets both misconfigurations and holds that the local branch and tags survive whileorigin/mainstill moves.So the write is: remote-tracking refs, the objects behind them, and
FETCH_HEAD— never a local branch, tag, HEAD, index, working tree or stash. The header, usage, README and AGENTS.md say exactly that, and no longer say "nothing else".What it cannot do is answer a prompt.
GIT_TERMINAL_PROMPT=0makes an https credential prompt fail and be reported. An ssh host-key or passphrase prompt is ssh's own and is not stopped — it blocks exactly asgit fetchwould — so the docs say to run--fetchwhere ssh is already non-interactive (an agent, a known_hosts entry). No code-levelBatchModedefault, deliberately: that would also refuse a terminal user's passphrase prompt, which is theirs to answer.Docs
README.md 203 -> 214, AGENTS.md 111 -> 117, caps raised in dated entries. AGENTS.md rule 4 now says
status --fetchis the ONE waystatusreaches the network: when the person wants a current answer, run that, nevergit fetchby hand on its behalf; a failed fetch is a finding on its row, not a reason to retry the report. The sentence that said--fetchrefuses by name is gone, because it no longer does.Review
A focused review of this layer (report only, offline, throwaway estates) found six things, all in this PR: the
--prunescope (above); the ssh caveat undisclosed; "nothing new" printed whenorigin/<branch>had just been pruned to nothing; a dangling gitfile mislabelled as "no remote"; the "remote-tracking refs and nothing else" overclaim; and one test assertion that could never fail ((leg/".git").is_file()is always true for a submodule). It confirmed the rest: theif err="$(…)"form carries the fetch's exit status and is exempt from errexit;--quietprints nothing on success; no enumeration or manifest read depends on whether a fetch ran; the root's own fetch cannot move its HEAD or the leg's recorded gitlink;CHANGED_CLAUSEreaches all three footers.Tests
187 -> 197. New in
tests/test_status_command.py: behind is seen in one run and the fetch persists into a plain run; local branches, HEAD, porcelain and stash identical before and after whileorigin/mainmoves, and noindex.lockin the root's or the leg's real git dir; a branch deleted from ANOTHER clone reads as gone only after--fetchprunes; a dead URL is a finding and the leg is still fetched; the leg is fetched on its own row; no origin is a finding;--all --fetchfetches two roots and two legs; the pinned refspec under a mirror refspec andpruneTags; a renamed default branch reads as GONE; a dangling gitfile is named as such.bash -n statuspasses;shellcheck statusreports only SC2317 (functions called indirectly).python3 -m pytest tests -q: 197 passed locally with the submodule initialised.Not merged
Opened for review, stacked on #9 on #8. workBenches re-vendors all four after these land.
🤖 Generated with Claude Code
Summary by Sourcery
Add an explicit fetch layer to status that refreshes each repository safely and reports the resulting remote state.
New Features:
status --fetchto fetch and pruneoriginin every repository before reporting current status.--all --fetchacross every estate while continuing after individual fetch failures.Bug Fixes:
originremote and correctly describe pruned tracking branches.Enhancements:
FETCH_HEAD, leaving local branches, tags, HEAD, index, worktrees, and stashes untouched.--fetchas the explicit network-enabled status mode, including its fetch failure and SSH prompting behavior.Documentation:
status --fetchusage, fetch semantics, safety guarantees, and authentication caveats.Tests: