Repository navigation
family.py: bump --to asks add's duplicate-id question, peels an annotated tag's own id as add --at does, and says to push first a commit the member does not hold after its fetch (#541) - #568
Conversation
…n annotated tag's own id as `add --at` does, and refuses a commit the member does not hold after its fetch as `member-to-unknown`, saying to push it first, so a bump no longer commits a holder its own validator refuses as `member-duplicate-id`, or fails in git's words `reference is not a tree` (#541) What changed, in `scripts/family.py`: - The duplicate id. `_checked_bumped_id` asks the question `add` asks since #330, of the row `bump` writes: does another row already record the id the member's `project.yaml` records at `--to`? The member's own row is left out (`_row_recording`'s `besides`), and every other row is asked as the holder's `validate-family.py` asks it. The dry run and the real run both ask it before the checkout, of the id `_member_id_at` reads from the member's objects; the real run asks it again of the id its checkout reads, so a linked `project.yaml` is refused there and put back by the `PinRollback` (#365). `add`'s `_checked_member_id` now finds the row through the same `_row_recording`, with its words unchanged. - The unpushed commit. `_checked_to_names_a_commit` used to return when `git cat-file -t` failed, leaving the id to the dry run's resolve and the real run's checkout, which failed in git's words. It now refuses `member-to-unknown`, naming the commit, saying no branch of the member's remote reaches it, and saying to push it first. When the member's fetch failed, the refusal says that instead and does not claim the remote lacks it. - The tag. As ruled by Brett Heap on 2026-10-14, `bump --to` peels an annotated tag's own id, as `add --at` does. `_checked_to_names_a_commit` returns the commit the tag names (through a tag of a tag too), `cmd_bump` goes on with that commit in both runs and prints one line saying so, so the gitlink, the row's `commit:`, the digest and the commit message all carry the commit. A tree, a blob or a tag of either is still refused `member-to-not-a-commit`, now in `add --at`'s words through one shared `_names_no_commit` ("names a tree", not "is an annotated tag of a tree"). The docstrings that said `bump` refuses a tag "as `bump-leg.py` refuses the same `--to`", and that an id the member does not hold is "left to the checkout", are rewritten; they compare with `family.py add --at` only. Tests: `tests/test_family_bump_to_checks.py` is new (the duplicate id, read from the objects and through a linked manifest; the unpushed commit, then pushed; the failed fetch). `tests/test_family_bump_to_a_tag.py` now holds the peel, in both runs and after the fetch, and the shared tree wording. `tests/test_family_dry_run.py`'s test of a commit the member lacks expects `member-to-unknown` from both runs. Lane: openreposhape-5 (openRepoShape-5) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
(lane openRepoShape-5, 2026-10-14T23:07Z) @codex review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Reviewer's GuideUpdates Sequence diagram for family bump target validationsequenceDiagram
participant User
participant Family as family.py
participant Member as Member repository
participant Holder as Family holder
User->>Family: cmd_bump(--to)
Family->>Member: fetch target objects
alt fetch failed
Family-->>User: REFUSED member-to-unknown
else target unavailable after fetch
Family-->>User: REFUSED member-to-unknown, push it first
else annotated tag names a commit
Family->>Family: _checked_to_names_a_commit()
Family-->>User: print peeled commit
Family->>Family: _checked_bumped_id()
Family->>Member: checkout peeled commit
Family->>Holder: write pin and family rows
else target is tree, blob, or tag of either
Family-->>User: REFUSED member-to-not-a-commit
end
Flow diagram for duplicate-ID checks in family bumpflowchart TD
A[Read project.yaml at --to] --> B[_checked_bumped_id]
B --> C{Another row records the ID?}
C -->|No| D[Continue bump]
C -->|Yes| E[REFUSED member-duplicate-id]
E --> F[Holder remains unchanged]
D --> G{Dry run or real run?}
G -->|Dry run| H[Print proposed rows]
G -->|Real run before checkout| I[Checkout target]
I --> J[Read project.yaml through checkout]
J --> K[_checked_bumped_id again]
K --> L{Duplicate ID discovered?}
L -->|Yes| M[PinRollback restores holder]
L -->|No| N[Write pin and family rows]
File-Level Changes
Assessment against linked issues
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: eeadc65c4b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if commit != typed: | ||
| print(f"--to {typed[:12]} is an annotated tag in " | ||
| f"{row.get('repository')}; the commit it names, " | ||
| f"{commit[:12]}, is what is pinned", flush=True) |
There was a problem hiding this comment.
Avoid announcing a pin before later validation succeeds
When --to is an annotated-tag object ID, this prints that the peeled commit “is what is pinned” before _checked_bump_target runs. If the tagged commit is subsequently rejected—for example, because its project.yaml is missing or records another member's ID—the command exits 2 without pinning anything but leaves this success-like line on stdout; the equivalent direct-commit refusal emits no stdout. Delay the announcement until validation and the real write succeed, or word it as a prospective peel rather than a completed pin.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
(lane openRepoShape-5, 2026-10-15T11:04Z) Fixed in 8024f9c, the second way you suggest. The line now reads "..., is what would be pinned" (scripts/family.py:4422). A later refusal still follows it, in both runs.
test_a_duplicate_id_behind_a_tag_is_refused_after_the_peel_line (tests/test_family_bump_to_checks.py) covers the case you describe. It peels a tag of a commit whose project.yaml records the neighbour's id, and checks that the line says "would be pinned" above a member-duplicate-id refusal, with exit 2 and nothing pinned. With "is what is pinned" restored, 2 tests fail (review rv541's m12 probe).
…LD be pinned, and `add --at` and `bump --to` say in `--help` that an annotated tag's own id is peeled, so the line is no longer false in a dry run or above a refusal, and docs/cli.md names the peel (#541) The review of eeadc65 (rv541: 0 blockers, 1 should, 5 nits) is answered: - S1. The line both runs print when `--to` is an annotated tag ended "is what is pinned". The dry run prints it, and so does a run refused by a question asked after the peel (`member-duplicate-id` through a tag), and neither pins anything. It now ends "is what would be pinned". A new test holds a duplicate id behind a tag: both runs print the line, refuse in the same two lines, exit 2, and leave the holder as it was. - N1. A new test holds the branch hint on the holder's tracking branch with a tag's id: the dry run's hint and the real run's refusal both name `family/bump-<id>-<the typed id's first twelve>`, not a branch made from the commit the tag names. - N2. `_checked_to_names_a_commit`'s docstring names the one input where `add --at` and `bump --to` still differ: a tag whose commit is on no branch, which `bump`'s fetch does not bring and refuses `member-to-unknown`. The behaviour is left as it is. - N3. `add --at`'s and `bump --to`'s `--help` say that an annotated tag's own 40-hex id is peeled to the commit it names; `docs/cli.md` is regenerated by `scripts/render-cli-reference.py`. - N4 and N5 are the pull request body's, and are answered there. Lane: openreposhape-5 (openRepoShape-5) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Sorry @brettheap, you've used your own review budget of 250,000 diff characters for the last 7 days. You can request another review in 1 day and 9 hours by commenting |
|
…y-hand test and #581 among them) into #569, so the PR's CI runs on current main Merges origin/main fb786c1, read from the shared store without a fetch. Main moved from 7d9bec9 (#569's last merge) by #556, #557, #558, #559, #560, #562, #567, #568, #579, #580 and #581. #579 (#550) landed tests/test_setup_by_hand_commands.py, which this PR's `--no-next-steps` makes red; the next commit answers it. The merge itself is clean, and its tree is the pm569 prediction's #581 step (53b6d0f7)'s, so the resolution prepared against the predicted main carries over. Lane: openreposhape-2 (openRepoShape-2) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… fix/540-pin-source-unread This merges origin/main 2bf8fd4 as the shared store held it at 2026-10-15T16:50Z, thirteen landings past the 7d9bec9 this branch last merged: #555 (shape-doctor's manifest kinds), #565 (scaffold's `scaffold-remote-exists`), #581 (adopt's `check` of a kept pin path and an unwritable work directory), #568, #559, #557, #560, #580, #556, #558, #567, #579 and #562. It is done so that the PR's CI merge ref and this round's rewording run on current main. The merge was clean, with no conflict hunk. `adopt-project.py`, `scaffold-project.py`, `scripts/shape_materialize.py`, `docs/cli.md` and `tests/test_adopt_root_symlinks.py` took main's changes beside this PR's by the textual merge, and `scripts/render-cli-reference.py --check` passes on the result. Main: 2bf8fd4. Lane: openreposhape-2 (openRepoShape-2) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…es not have as the index has it (missing, unstaged, untracked, or behind assume-unchanged or a sparse checkout), so neither commits a change to it nobody staged (#407) (#571) `family.py remove` commits `.gitmodules` as `git rm` leaves it in the work tree, and `git rm` edits only a `.gitmodules` the work tree has. With the work-tree copy deleted and the deletion not committed, `git rm` edited nothing. `_commit_one` then staged the deletion, and the commit took `.gitmodules` out of HEAD, with every other member's section in it. `remove` exited 0, and the holder it ran in passed its own gate. Once the commit was pushed, a recursive clone left every remaining member empty. The issue's reproduction, run on bfed143 (I added one `git switch -c`, because #487 landed after the issue was filed): ``` registration keys before: Atlas 2, Nova 2 dry run: exit 0 gitmodules none: git reads no section of .gitmodules in the work tree as giving members/Nova, so none is removed remove: exit 0 committed 766cfa532913: .gitmodules, members/Nova, family.yaml .gitmodules | 6 ------ HEAD holds .gitmodules: no registration keys after: Atlas 2, Nova 0 family ok: Fam (fam), 1 member(s) recursive clone: exit 0 the clone's members/Atlas holds 0 entries REFUSED member-uninitialized: members/Atlas is not an initialized submodule checkout, ... fatal: No url found for submodule path 'members/Atlas' in .gitmodules ``` One check, `_checked_gitmodules_as_staged`, runs before any git command that writes. The dry run makes it too, in the same words. It reads the index's records for `.gitmodules` (stage, blob and git's `-v` flag letter) in one `git ls-files -s -v -z`, which writes nothing. - **`gitmodules-missing`** (`remove`): the work tree has no `.gitmodules`, while the index (at any stage) or HEAD has one. The remediation names the restore git takes in that state: - `git checkout -- .gitmodules` (the index's copy); - `git checkout HEAD -- .gitmodules`, where the deletion is staged; - for an unmerged file, by the stages the index holds: `git checkout --merge -- .gitmodules` where it has both sides' copies; `git checkout --ours` where only this side's is left (the other side deleted it); `git checkout --theirs` where only the other side's is; `git checkout-index -f --stage=1` where both sides deleted it. Each is followed by `git add .gitmodules`. - **`gitmodules-unstaged`** (`remove` and `add`): the work tree's copy is not the index's. That means one of: - git lists it as modified (`git ls-files -m`). Where `git add` would still stage the index's own blob from it (`git hash-object --path=.gitmodules` says so, and it is a regular file), the refusal adds that the difference may be its line endings alone; - it is unmerged; - its deletion is staged while the file is still on disk; - the index marks it assume-unchanged, which `ls-files -m` does not look past, and its content is not the index's blob; - it is untracked: neither the index nor HEAD holds one. This includes the first member's `add` in a new holder. The remediation offers both ways out: stage the work tree's copy, or put back the index's (or HEAD's) copy. Behind assume-unchanged, staging first takes the mark off (`git update-index --no-assume-unchanged -- .gitmodules`), because `git add` stages nothing while it is on. An untracked file is staged with `git add -f .gitmodules`, since an operator's global excludes may match it (and, if wanted, committed on its own first), or moved out of the holder. - **`gitmodules-sparse`**: the index marks `.gitmodules` skip-worktree, as a sparse checkout that leaves it out does. git neither compares nor stages that file, and `git checkout -- .gitmodules` matches nothing. The remediation is `git sparse-checkout disable`. - `add` refuses it whatever the file's state, since `git submodule add` cannot stage it. - `remove` refuses it where the file is missing or is not the index's copy, and commits a clean copy on disk rightly, as it did on bfed143. Every refusal ends with "No git command that writes was run and nothing was written.", and every remediation ends with "run the same command again". Typed as printed, each one leads to the right commit (the tests do exactly that). `remove` asks this first, before #360's `member-path-registered-twice`. `add` asks it after its mount-path refusals (#242, #300), which already name what they find in the same file. Two of those, `member-name-taken` and `gitmodules-unreadable`, have the person mend the file by hand and run `add` again. They now say "then `git add .gitmodules`", as #300's and #360's remediations already did. Without that step, the run again was this PR's own `gitmodules-unstaged`. The holder's `validate-family.py` keeps its words: it reads the work tree's copy, so re-running it needs no stage. | Point | What changed | |---|---| | S1 | `member-name-taken` and `GITMODULES_UNREADABLE` say "then `git add .gitmodules`". New test: each one's state, mended by hand, the printed stage typed, and `add` then mounts the member. The text tests are updated (`test_family_add_excludes.py`'s `member-name-taken` test, and `test_refusal_default_remediation.py`, which now holds `add`'s remedy equal to the gate's but for the one step). `test_family_add_refusals.py::test_a_gitmodules_git_cannot_read_is_a_refusal_not_a_pass` pins the validator's text, which is unchanged, so it is untouched, and so is the `:518` test, which asserts only the REFUSED line. | | N1 | The line-endings clause, only where `hash-object` gives the index's blob from a regular file. Tested with a CRLF copy (clause) and a link to the very same bytes (no clause: `hash-object` reads through the link, but git would stage the link). | | N2, sparse | `gitmodules-sparse`, with `git sparse-checkout disable`. Tested by a real `git sparse-checkout set --no-cone '/*' '!/.gitmodules'`, for both verbs, typed as printed. | | N2, modify/delete | The per-stage restores above. Tested for stages 1+2 (`--ours`), 1+3 (`--theirs`) and 1 alone (`checkout-index`), each typed as printed. | | N3 | `test_a_holder_whose_head_has_no_gitmodules_is_not_asked` asserts only that no `gitmodules-` refusal is made. Its docstring says the real run fails there, a known case from before #407 that goes to #459. | | N4 | The base split below is corrected. | | N5 | `unmerged()` and `typed_as_printed()` run git through `raw(root, env, ...)`, under the module's isolated environment. `raw()` gained a `stdin` argument for `update-index --index-info`. | | N6 | `held()` and `assert_held()` are gone. Refusals are read with `test_family_dry_run.state()` and `assert_as_it_was()`; `state()` now reads a missing `.gitmodules` as None (three lines). | | Codex, `:4476` | The untracked `.gitmodules` is `gitmodules-unstaged`, for both verbs, dry run alike. Tested: the first `add` in a holder with no member, and `remove` in the holder #407 leaves behind with the old bytes put back untracked. Staged as printed, each commits. | | Codex, `:4519` | assume-unchanged: compared by content (`hash-object` against the stage-0 blob) and refused. skip-worktree: `gitmodules-sparse`, as for N2. Tested for both verbs: the assume-unchanged edit kept through the printed `update-index` and `add`, and the skip-worktree edit through `git sparse-checkout disable`, then the restore the next refusal prints. | | Nit | What changed | |---|---| | 1 | `remove` again commits a clean `.gitmodules` the index marks skip-worktree, as bfed143 and b1120c3 did: `gitmodules-sparse` is asked for `add` whatever the file's state, and for `remove` only where the file is missing or is not the index's copy. `add`, an edited file and a missing one stay refused. The function's and the module's docstrings say which verb refuses what. New test: `remove` with the mark on and the file clean commits exactly `.gitmodules`, `family.yaml` and the gitlink. | | 2 | Two cases the round-2 tests left open. X1: `add` over a file marked both skip-worktree and assume-unchanged (two `update-index` calls, `ls-files -v` tag `s`) is `gitmodules-sparse`. X2: a clean assume-unchanged file passes, and both verbs commit the right tree. Each set-up asserts the `ls-files -v` letter it expects. | | 3 | The untracked branch prints `git add -f .gitmodules`. The untracked `add` test also runs under an operator's `core.excludesFile` holding `*` (set as #242's tests set it), asserts that the file is ignored there, types the remedy, and `add` commits. | | 4 | Decision 5's wording. Round 2's commit subject said "no printed command leads into another refusal", which is inexact: for an edit hidden by skip-worktree, `git sparse-checkout disable` leads, by design, into `gitmodules-unstaged`, and `test_an_edit_skip_worktree_hides_is_refused_then_named_as_modified` pins that chain. This round's commit subject says only what it does. | 1. **Refuse, not rebuild (the issue's first option).** The holder is left byte for byte as it was, and the person picks the copy they mean. Building this member's section out of the index's blob would commit a `.gitmodules` the work tree does not have. The holder would then show `.gitmodules` as deleted, and the person's next `git commit -a` would delete it after all. For a modified copy it would also have to guess which copy the person means. 2. **A staged change still goes in.** The remediations of #360 and #300 tell the person to edit `.gitmodules`, `git add` it, and run the same command again. So the rule is "the work tree's copy must be the index's", not "must be HEAD's". 3. **"Modified" is git's own answer.** It comes from `git ls-files -m`, the comparison `git status` uses and the one `git rm` refuses an unstaged change with. On bfed143, an unstaged edit, a CRLF-only copy and a symlink were each refused by `git rm` only after `git submodule deinit -f` had emptied the member (then rolled back), and each dry run exited 0. The CRLF case is still refused (as `git rm` refuses it), and now says why it may look like no change: its `hash-object` is the index's blob (probe: both `26f54704`). 4. **Assume-unchanged is compared by content; skip-worktree is refused outright.** Probes against round 1's check (`states-wip.log`): - assume-unchanged, clean: both verbs commit correctly, so it is not refused. Edited: `ls-files -m` is empty and both verbs committed the edit. `git add .gitmodules` with the mark on exits 0 and stages nothing (the hash stays `a2d4d491` against the index's `26f54704`), so the keep-remedy takes the mark off first. `git checkout -- .gitmodules` restores it with the mark on. - skip-worktree, file on disk: `remove` committed a hidden edit; `add` failed at its mount even for a clean file (`git add` refuses a path outside the sparse-checkout definition, then rollback). `git add` and `git checkout --` both fail while the mark is on. So `add` refuses any skip-worktree `.gitmodules`, on disk or not. `remove` refuses one that is missing or is not the index's copy, and commits a clean one on disk rightly, as it did on bfed143 and b1120c3 (round 3; round 2 refused that one too). 5. **`git sparse-checkout disable` is the one command that works as typed both in a sparse checkout and where only the mark is left.** `git sparse-checkout add /.gitmodules` is narrower in a real non-cone sparse checkout, but fails for a mark set by hand (`fatal: no sparse-checkout to add to`). With sparse checkout on, `git checkout --ignore-skip-worktree-bits -- .gitmodules` and `git update-index --no-skip-worktree` + `git checkout --` both put the file back, but `remove` then failed at its commit's `git add` ("outside of your sparse-checkout definition"). `disable` worked with sparse checkout on and with only the mark left, and keeps a copy already on disk as it is. The refusal names the state in its own words. It is a dozen lines, not a sparse-definition reader. 6. **An untracked file is staged, not committed by the printed command, and staged with `-f`.** `add`'s branch check (#487) comes after this refusal, so a printed `git commit` could land on the tracking branch. Staged, the file goes into the verb's commit; the remediation says to commit it on its own first if that is not wanted. An operator's global excludes may match the untracked file (#242's `*`), and a plain `git add` then refuses it, so this branch prints `git add -f .gitmodules`. The tracked branches keep the plain `git add`, which stages a tracked file under the same excludes. 7. **The dry run (N9).** In the issue's state, `remove --dry-run` prints the same refusal, exit 2. Past the refusal, the work tree's file is the index's copy, or no copy exists anywhere. So `deinit` reads the same name the dry run reads. 8. **`bump` is not affected.** Its commit is `[path, MANIFEST]` and never stages `.gitmodules`. Probe: `bump` with the work-tree `.gitmodules` deleted committed `family.yaml` and `members/Atlas` only. `tests/test_family_remove_gitmodules.py`, 35 tests: - `remove` over each state the work tree lacks (6): deleted (the issue), deletion staged, and unmerged with the file deleted at stages 1+2+3, 1+2, 1+3 and 1. Both runs refuse alike, exit 2, nothing on stdout, and the holder unchanged: `test_family_dry_run.state()`, which is HEAD, `ls-files -s -z`, `status --porcelain=v1 -z`, `family.yaml`, `.gitmodules`, `.git/config`, the member's HEAD, every work-tree byte and the holder's objects. The remedy is typed as printed; `remove` then exits 0, HEAD's `.gitmodules` gives only the other member's path, and the gate passes; - the issue's clone: after the restore and `remove`, a push and a fresh `clone --recurse-submodules` populate the other member, and the clone's gate exits 0; - each work-tree copy that is not the index's, for both verbs (12): edited, CRLF only, a link to the same bytes (skipped on Windows), assume-unchanged and edited, unmerged, deletion staged with the file kept. One printed remedy is typed, and the verb then commits; - sparse (4): a real sparse checkout for both verbs, and `add` over a clean file marked skip-worktree by hand and over one marked both ways (`ls-files -v` tag `s`); skip-worktree with an edit (2), both verbs; - a clean file behind a mark, committed with exactly `.gitmodules`, `family.yaml` and the member's gitlink (3): skip-worktree (`remove`), assume-unchanged (`remove` and `add`); - untracked (3): `add` in a new holder, with no excludes and under an operator's `*`; `remove` in a holder #407 already damaged; - `add` over a missing file is still git's own refusal, with its dry run's note; - a holder whose HEAD lost `.gitmodules`: no `gitmodules-` refusal (N3); - S1 (2): `member-name-taken` and `gitmodules-unreadable`, mended by hand, the stage typed as printed, `add` then mounts. Round 2's 29 tests on round 1's head b1120c3: `15 failed, 14 passed in 80.15s`. The 15 are exactly round 2's cases: CRLF's clause (2), sparse (2), skip-worktree (2), untracked (2), S1 (2), the `--ours`, `--theirs` and `checkout-index` restores (3), and assume-unchanged (2). On bfed143 with them: `27 failed, 2 passed in 59.67s`; the 2 that pass pin behaviour the fix keeps (`add` leaves a missing file to git, and N3's holder is not asked). Round 1's base proof, corrected (the review's N4): on bfed143 with round 1's 14 tests, `12 failed, 2 passed`. Of the 12, 8 failed on "HEAD changed" (the verb committed; the clone test is among them), 3 on ".git/config changed" (`lacks[deletion staged]`, `[edited-remove]` and `[crlf-remove]`: the run failed after `deinit` and the rollback re-wrote the registration) and 1 on "status changed" (`[unmerged-remove]`). In `lacks[deletion staged]` it was not `git rm` that failed after `deinit` but `_commit_one`'s `git --literal-pathspecs add -f -- .gitmodules family.yaml` (`pathspec '.gitmodules' did not match any files`). On this head (ebe6b51), Linux, `/usr/bin/python3 -m pytest`, the files round 3 touches and the importers of the changed helpers: `tests/test_family_remove_gitmodules.py tests/test_refusal_default_remediation.py tests/test_family_add_excludes.py tests/test_family_dry_run.py tests/test_family_member_path.py`: `182 passed in 224.37s (0:03:44)`. The new file alone: `35 passed in 46.50s`. Round 2's targeted runs, on cb159b1 (round 3 changes `family.py`'s skip-worktree condition and one remedy, and the new test file): - `tests/test_family_remove_gitmodules.py tests/test_family_bump_remove_rollback.py tests/test_family_dry_run.py tests/test_family.py tests/test_cli_reference.py tests/test_repo_hygiene.py tests/test_family_member_path.py tests/test_family_tracking_branch.py tests/test_family_printed_quoting.py tests/test_family_member_name.py tests/test_family_bump_to_a_tag.py tests/test_family_init_landing.py tests/test_family_init_values.py tests/test_template_text_placeholders.py`: `706 passed, 19 skipped in 1013.94s (0:16:53)` (the skips are `test_family_init_values.py`'s template-quoting cases, as on main); - `tests/test_family_add_refusals.py tests/test_validate_family_duplicates.py tests/test_validate_family_member_path_glob.py tests/test_validate_family_unnamed_mounts.py tests/test_validate_family_without_git.py tests/test_family_add_excludes.py tests/test_family_add_member_id.py tests/test_refusal_default_remediation.py tests/test_agents_md_codes.py tests/test_shape_doctor.py`: `632 passed, 3 skipped in 1482.84s (0:24:42)` (the skips are the Windows-only PowerShell line). Windows: every file the tests write is written with `write_bytes`, git's stdin gets bytes, and nothing compares against a file a helper wrote with `write_text`. The holder's attributes keep `.gitmodules` LF in the work tree (`i/lf w/lf attr/text=auto eol=lf`). The symlink case skips on Windows, where git checks a link out as a plain file. macOS: no case variants are involved. The issue's script, with local bare remotes, a `gh` that exits 97, no global or system git configuration, and the registrations read from `.git/config` by `grep`: - on round 2's head (cb159b1): `dry run: exit 2` and `remove: exit 2`, both `REFUSED gitmodules-missing: ...` with the same stderr, and a full snapshot of the holder (every file, `.git` included) identical after each. The registration sections stay 1 and 1. After a push of the unchanged holder, the recursive clone exits 0, `members/Atlas` holds 15 entries, and the clone's gate prints `family ok`. - round 1 typed the remedy as printed (`git checkout -- .gitmodules`): `remove: exit 0`, a commit with `.gitmodules | 3 ---` (Nova's section only), the holder's gate exits 0, and after a push the recursive clone populates Atlas and its gate exits 0. The lacks and clone tests repeat that on this head. - round 2's states, on cb159b1: for `remove` and `add`, a real sparse checkout, a skip-worktree edit, an assume-unchanged edit (kept, and dropped), CRLF and a link; for `remove`, an assume-unchanged deletion, the unmerged file deleted at stages 1+2, 1+3, 1 and 2+3, and the untracked file in a damaged holder; for `add`, the untracked file in a new holder. Each is refused alike by both runs (identical stderr), each printed command exits 0 as typed, and the run again commits what the remedy chose. Round 3 changes two of these paths (a clean skip-worktree file for `remove`, and the untracked remedy's `-f`), and its tests on ebe6b51 hold both. Nothing here needs real GitHub or a cloud tool. Round 2's code hunks, each reverted alone in a throwaway worktree at cb159b1, with the new file run against it: | hunk reverted | result | new tests that fail | |---|---|---| | M1 S1, `GITMODULES_UNREADABLE`'s stage | 1 failed, 28 passed | S1 `[gitmodules-unreadable]` | | M2 S1, `member-name-taken`'s stage | 1 failed, 28 passed | S1 `[member-name-taken]` | | M3 the untracked refusal (Codex, `:4476`) | 2 failed, 27 passed | both untracked tests | | M4 `gitmodules-sparse` | 4 failed, 25 passed | sparse `[remove]`, `[add]`; skip-worktree `[remove]`, `[add]` | | M5 the per-stage restores (always `--merge`) | 3 failed, 26 passed | `lacks[our side only, deleted]`, `[their side only, deleted]`, `[neither side, deleted]` | | M6 the line-endings clause (N1) | 2 failed, 27 passed | `[crlf-remove]`, `[crlf-add]` | | M7 `_stages_as`'s regular-file guard | 2 failed, 27 passed | `[a link to the same bytes-remove]`, `[...-add]` | | M8 the assume-unchanged branch (Codex, `:4519`) | 2 failed, 27 passed | `[assume-unchanged, edited-remove]`, `[...-add]` | | M9 the flags read as `H` (`_gitmodules_in_index`) | 6 failed, 23 passed | the 2 assume-unchanged, 2 sparse and 2 skip-worktree cases | | M10 the return where nothing holds a `.gitmodules` | 29 errors | every test, at the family fixture's first `add` into a holder with no `.gitmodules` anywhere, which is then refused as untracked | Round 1's hunks are still held by the same tests (round 1's probes M1 to M8). The other hunks are docstrings and comments. Round 3's hunks, each reverted alone at ebe6b51, with the new file run against it: | hunk reverted | result | new tests that fail | |---|---|---| | R1 the narrowing (always refuse skip-worktree) | 1 failed, 34 passed | `[skip-worktree-remove]` of the clean-behind-a-mark test | | R2 its `verb == "add"` arm | 2 failed, 33 passed | sparse `[marked by hand, clean-add]`, `[marked both ways, clean-add]` | | R3 X1, `tag == "S"` without `.upper()` | 1 failed, 34 passed | sparse `[marked both ways, clean-add]` | | R4 X2, every assume-unchanged copy refused | 3 failed, 32 passed | `[assume-unchanged-remove]`, `[assume-unchanged-add]`, sparse `[marked both ways, clean-add]` | | R5 plain `git add` in the untracked remedy | 3 failed, 32 passed | the three untracked tests (the pinned text) | | R5b plain `git add` in the remedy AND the test's expected text | 1 failed, 2 passed (`-k untracked`) | `[*]`: typing `git add .gitmodules` fails, "The following paths are ignored by one of your .gitignore files ... Use -f" | `git merge-tree --write-tree` of this head (ebe6b51) with each of these is clean: - origin/main dd3f23a. Since bfed143, main took #551, #552, #554, #553, #561, #562, #579, #567, #558, #556 and #580; none touches `scripts/family.py` or a test file this branch changes. This branch does not merge main; - `fix/family-bump-to-checks` 8024f9c (#568), `fix/family-members-case-variants` 8a95345 (#574), `fix/link-source-chain-defaults` a707d4b (#576), `fix/family-siblings-tracking-branch` 2156a01 (#578); - lane 2's `fix/537-dry-run-asks-remotes` 69c58aa (#573), and #575's head 0680799 (lane 2, which changes `validate-family.py`; its unreadable-file remedy still ends "then run this again.", which `test_refusal_default_remediation.py` expects). - **(a) `family.yaml` hand edits are committed by `add`, `bump` and `remove`.** Each commits `family.yaml` as the work tree has it, so an unstaged hand edit outside `members:` (a comment line) goes into the commit: the review reproduced `+# a hand note nobody staged` in a commit of each verb. It is #407's rule for a different file, and a staged-only rule there would chain into every remedy that says "edit `family.yaml`, then re-run", as S1 did here. It needs its own issue. - **(b) A HEAD that already lost `.gitmodules` fails after the first write.** With no `.gitmodules` anywhere, this check asks nothing. `remove --dry-run` exits 0 and says no section is removed; the real `remove` runs `deinit` and `git rm`, then dies at `git --literal-pathspecs add -f -- .gitmodules family.yaml` (`pathspec '.gitmodules' did not match any files`) and puts back only part of the unmount (`members/Nova` is left empty). Same on bfed143. Once the old file is put back in the work tree, this PR now refuses it as untracked, and staged as printed `remove` commits it back into HEAD; but nothing tells the person to do that. - **(c) The gate passes a row with no `.gitmodules` section (#459, the issue's decision 3).** `validate-family.py` should find a `members:` row whose path no section of HEAD's `.gitmodules` gives. A holder already carrying a #407 commit passes its own gate, and only a fresh recursive clone shows it. - **(d) A sparse checkout whose rules leave `.gitmodules` out, with the file put back on disk by hand.** git then clears the skip-worktree mark, so this check passes, and `remove`'s commit fails at `git add` ("outside of your sparse-checkout definition") and is rolled back. Nothing wrong is committed; it is a late failure, and reading the sparse rules is not this PR's. - **(e) A verb run during a merge, cherry-pick or rebase fails after its first writes.** Any `family.py` verb run while one is in progress fails at its commit, `git commit -- <paths>` ("fatal: cannot do a partial commit during a merge."), and is rolled back. It is the same on bfed143. It touches this PR because its `--ours` and `--theirs` restores name modify/delete conflicts, whose commonest source is `git merge`: typed as printed the restore works, then `remove` fails late. The tests build those stages with `update-index --index-info` and no `MERGE_HEAD`, the state a conflicted `git stash pop` leaves. The candidate: refuse an in-progress merge, cherry-pick or rebase before the first write, beside the existing up-front refusals. Review: rv407 found 1 should and 6 nits on b1120c3; fix round 2 (cb159b1) fixed them and answered Codex's `:4476` and `:4519` threads; re-review rv407b found 4 nits, fixed in round 3 (ebe6b51). CI (Brett Heap's ruling 27): H0 ebe6b51 passed tests, tests-macos, tests-windows and SonarCloud; the head 52c7c88 is a clean update-branch merge of main 2989b4c, with tests and SonarCloud green. Landed on Brett Heap's word of 2026-10-15T13:32:47Z, "All five, once green". Closes #407 Lane: openreposhape-5 (openRepoShape-5) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e `--link-source` is the first chain link's tree alone, and a source that names no path is refused (#441, #442) (#576) **README change.** This PR edits one README paragraph. #551 is on main and this branch has merged it, so the handbook step follows #551's rule: the three page parts that read the README section "The three legs" record its new hash. No page text changes. ### #441: one bare tree answered for two links `link_pins_from_trees` passed its `default_source` to every link of a recorded chain. That value is the naming gate's bare `--link-source PATH`, and the scaffold's `--pin-source`. In the chain `openXdox → openYdox → openInk`, with one bare tree that is `openXdox`'s, `openYdox` was read from the same `project.yaml`. That file declares `openYdox`, not `openInk`, so the gate said "openYdox declares openYdox, not openInk". For `codexInk`, which holds no direct pin on its referent, that was a FINDING, exit 1, for a chain that holds. The scaffold refused the same chain as `chain-not-declared`. Now: - **Which links read a bare value (for #540 and anyone else relying on it):** only the FIRST link of each chain, `links[0]`, the pin the project holds. That is true for a chain of any length, one link included: a chain of one link has only its first link, and that link reads the bare tree as before. A later link is never offered the bare value. It is read from its own `LINK=PATH`, its `SHAPE_PIN_SOURCE_<LINK>` or a checkout beside the project; otherwise it is declared-unverified (a warning, exit 0). For the first link the order is unchanged: keyed, variable, checkout beside the project, then the bare value. - `link_pins_from_trees` and `resolve_link_source` keep their signatures and return shapes. The only code change in `repo_shape.py` is `None if index else default_source` in the loop. - The two-link case (`openXdox → openDox` with a bare path) reads exactly as before and prints the same lines. The one difference is inside the returned mapping, and only for a chain of two or more links: the chain's END link no longer gets an entry read from the bare tree. Nothing reads that entry; only holders' declarations are read. In a chain of one link the only link is both the first and the end, and it still reads the bare tree, as before. - In the naming gate, `LinkSources` finds the first link of every chain a name will READ before any chain is read. `_first_links_read` uses the same `reads_link_declarations` test the lookup uses, and counts a chain only if it has two or more links: a chain of one link has no holder, reads no declaration, and so has no first link to count. The bare value is offered only while there is at most one first link: with a lone one-link chain there are none, and the bare tree is still returned for that chain's link to read, as before (nothing reads what it finds, so the output is unchanged). If a run reads two chains that begin at different links (a name on the command line plus `--project`, or one project with two legs), the bare value is read for neither. Before, one tree answered both, and `used` counted it once. - A bare value no link took is a NOTE saying why. In a two-link run the sentence is the one it always was. In a longer chain it reads "a bare PATH is the tree of a chain's first link alone, openXdox, which had a more specific source (...)". With two first links it reads "the chains read here begin at openXdox, openYdox: name the link it is, as --link-source <link>=PATH". ### #442: an empty path was the current directory `--link-source openXdox=` and `--pin-source openXdox=` became `Path("")`, which is `.`. From a project root, the naming gate read the project's own manifest as `openXdox`'s and called the chain broken. `validate-pins.py` asked the project root for the pinned commit, and its finding blamed `.`. Now both tools refuse, exit 2, naming the key: ``` REFUSED link-source-no-path: `--link-source openXdox=` names no path for openXdox. An empty path would be read as the directory this runs in. Give the tree's path (`--link-source <link>=<path>`), or `.` to mean this directory. REFUSED pin-source-no-path: `--pin-source openXdox=` names no path for openXdox. An empty path would be read as the directory this runs in. Remediation: give the checkout's path (`--pin-source <product>=<path>`), or `.` to mean this directory. ``` - An empty bare value (`--link-source ''`, `--pin-source ''`) is refused the same way. - A typed `.` still means the current directory. - A value whose key is NOT a chain link or a declared pin (`openZdox=`) is still the bare PATH `openZdox=`, as #338 and #295 decided. It is not empty, so it is not refused. - **Behaviour change: an empty value is refused even when a later value replaces it.** `--link-source openXdox= --link-source openXdox=<tree>` was a NOTE ("the later `--link-source ...` replaced it"), exit 0. It is now `REFUSED link-source-no-path`, exit 2. `validate-pins.py` changes the same way: `--pin-source openXdox= --pin-source openXdox=<clone>` was `pins ok`, exit 0, and is now `REFUSED pin-source-no-path`, exit 2. A typo is a typo, and the refusal names it when it is typed; a script that passed an empty value first and the real one after must drop the empty one. - The naming gate refuses in `main`, right after the values are read and before stdin is read or any name is classified, like its own `REFUSED naming-no-target`. - `validate-pins.py` raises a `Refusal` from `PinSources`. It reaches `main`'s existing handler with its own remedy, not the lockstep one. **It is raised late:** `PinSources` is built inside `_check_neutral_product_pins`, which `_run_all_checks` calls after `_check_leg` and `_check_shape_pin`. So an earlier refusal wins: a damaged `contracts/spec-pin.yaml` plus `--pin-source openXdox=` prints `REFUSED pin-tag-only`, and the empty path is named on the run after that is fixed. The hunk stays inside `PinSources` on purpose, to stay clear of the lines #539 edits in `_run_all_checks`. The refusal also has to wait for the declared pins, because they decide whether `openXdox=` is keyed or a bare PATH. Nothing is printed before the refusal, and the exit is 2 as in every other refusal of that tool. ### Docs - `--help` for `--link-source`, the naming validator's module docstring (exit code 2 included), `resolve_link_source`'s rule 4, `link_pins_from_trees`'s docstring and the scaffold's `_declaration` docstring say what a bare value means in a longer chain. - The `--link-source` help also says that a bare PATH is read for neither link when the chains read begin at two different links, and that a later link is read from its own `PRODUCT=PATH`, its `SHAPE_PIN_SOURCE_<PRODUCT>` or a checkout beside the project (it said "needs its own `PRODUCT=PATH`"). - `docs/cli.md` is regenerated. - README's lookup-order sentence now reads "then a bare `--link-source <path>`, for the first link's tree only: the order `validate-pins.py` uses below for the same checkout." The paragraph keeps its 12 lines, and README keeps its line count. - The handbook names no `--link-source`. The three parts that read "The three legs" (the masthead, "Reading private legs in CI", "The three legs, and naming") move to that section's new hash, 6ebed796 → 39ec2c23. No other README section changed. - `validate-pins.py`'s `--help` and EXIT CODES docstring do not name `pin-source-no-path`. Nothing in them is false: the exit-2 list gives examples. I left them, because the module docstring sits near lines #539 edits. The review of 04c9d77 (APPROVE WITH NITS) found five nits. Each, and what this commit does: 1. **A chain of one link counted as a first link.** `--referent-chain openInk` beside a project whose leg records `openXdox → openQuill`, with a bare `openXdox` tree, gave two first links, so the bare tree went to neither. `codexQuill`, verified through it on bfed143, was declared-unverified, with a NOTE naming `openInk` as a first link. Both places now count `chain[0]` only when the chain has more than one link: `_first_links_read`, and the `firsts` update in `LinkSources.link_pins`. The run is verified again, with no WARNING and no NOTE, as on bfed143. New test `test_a_chain_of_one_link_is_no_first_link_read`. 2. **A test gap: the project half of `_first_links_read`.** Reverting `if data is not None:` to `if False:` (mutation M14) left all 20 tests passing, yet it changes the output for one project whose two legs begin at different links: the first classification pass counted the bare value used, and the NOTE went missing. New test `test_a_project_whose_legs_begin_at_two_links_reads_a_bare_tree_for_neither`: `openXdox → openInk` and `openYdox → openQuill` in one project, a bare `openXdox` tree, two WARNINGs and the two-first-links NOTE. M14 now fails it (see the mutation probes). 3. **`pin-source-no-path` is raised late in `validate-pins.py`.** No code change. The behaviour and the reason are written above, under #442. 4. **The `--link-source` help.** It now says a bare PATH is read for neither link when the chains read begin at two different links, and "needs its own `PRODUCT=PATH`" now names the variable and the checkout beside the project too. `docs/cli.md` is regenerated, and `render-cli-reference.py --check` is ok. 5. **This body.** It now says: #539 is on origin and merges clean (see the merge checks); an empty value is refused even when a later one replaces it; the END-link sentence holds for chains of two or more links; and the checklist candidate below. The commit changes `scripts/validate-repository-naming.py`, `docs/cli.md` and `tests/test_link_source_chain_defaults.py` only. The re-review of 31a6f21 (APPROVE WITH NITS) found that all five nits are fixed, and two new ones. This commit changes `tests/test_link_source_chain_defaults.py` only. - **A test gap at the two-link boundary of `link_pins`.** Changing `if len(target.chain) > 1:` there to `> 2` passed the whole new file and `tests/test_naming_policy.py` (264 passed), yet it changes the output for a name read from stdin whose chain has two links: the first-link list is empty, and the NOTE for an unused bare value reads "a bare PATH is the tree of a chain's first link alone, , which had a more specific source". New test `test_a_two_link_chain_read_from_stdin_counts_its_first_link`: stdin `codexInk`, `--referent-chain openXdox,openInk`, `openXdox=<tree>` keyed and a second tree bare, asserting the whole stderr, the one NOTE "each link whose own declaration is read had a more specific source (...)". The `> 2` mutant fails it (see the mutation probes). The existing three-link stdin test and the new one share a helper, `stdin_naming`. - **This body.** "exactly one first link" now reads "at most one", and the merge paragraph names the current main. - **First link only, not a refusal.** The coordinator recommended this rule. Nothing documented or tested depended on a bare value answering a later link: no test passes `default_source` to `link_pins_from_trees`, and every scaffold test with a three-link chain sets `SHAPE_PIN_SOURCE_<LINK>` for each link. A refusal "when more than one link would take it" would depend on what is on the disk (checkouts beside the project, variables). #338 ruled that the reading is decided by the chains, never by the disk. - **Refuse #442, not note it.** A note would still have to stop the value reading `.`. A refusal names the typo when it is typed, and both tools already exit 2 for a question they cannot ask. - **The scaffold is fixed too.** It reads its `--pin-source` through the same function, so its three-link refusal goes away (see the reproduction). Its `--pin-source` is the pinned product's checkout, which is the first link's tree. New file `tests/test_link_source_chain_defaults.py`: 23 tests (22 until round 3). On bfed143, 17 fail and 5 pass (the controls: the one-link rows and the rows that already worked). On 04c9d77, the one-link test fails and the other 21 pass. Targeted runs (each `run9.sh`: `gh` stub, bogus token, empty `GH_CONFIG_DIR`, git-filter-repo 2.47.0), on the head 31a6f21 unless a row says otherwise. Round 3 (head a707d4b) changes the new test file only, and its own run is the last row: | set | result | |---|---| | new file, naming policy, referent-chain links, pin-source env collisions, pin-source unreadable, CLI reference, repo hygiene, README sections, AGENTS.md codes, validate-pins without git, unreadable workflow | `774 passed in 117.48s` | | manifest validator, scaffold pin and reuse, YAML flow quotes, neutral pin validator | `205 passed in 91.75s` | | CLI reference alone | `22 passed in 26.08s` | | template text placeholders, adopt plan leg-path help | `187 passed in 87.54s` | | predicted merge with origin/main 7d9bec9 (tree 908b3214): repo hygiene, README sections, CLI reference, new file, naming policy | `415 passed in 53.10s` | | round 3, head a707d4b: new file, naming policy, CLI reference | `287 passed in 95.29s` | Round 1 (head 73c4c255, before the merge of #551 and this commit; `docs/handbook.html`, `README.md` and the validators are unchanged by this commit apart from `validate-repository-naming.py`): | set | result | |---|---| | doctor, doctor validator rows, scaffold e2e, setup-project.py, setup.sh, adopt e2e, adopt pins, adopt spec-only, adopt submodules, adopt ignored shape files, adopt plan YAML quoting, adopt root symlinks, scaffold leg-path collisions, update-shape landing | `27 failed, 1796 passed, 3 skipped in 1433.51s`; every failure the same `UnicodeDecodeError` from a bytecode file my own `py_compile` probe had left in `templates/assembly-root/scripts/__pycache__`. With it removed, the two files that held all 27 (`test_adopt_root_symlinks.py`, `test_scaffold_leg_path_collisions.py`) gave `253 passed in 140.50s` | The three skips are `test_shape_doctor.py:9119`, which runs only on a Windows host. None of those files passes `--link-source`, and the one-link change and the help text cannot change a run that gives no bare value. **The 27 failures.** `template_values()` and its twin in `test_scaffold_leg_path_collisions.py` read every file under `templates/assembly-root` as UTF-8. A `validate-pins.cpython-312.pyc` had appeared there the second I ran `python3 -m py_compile` over the changed files. Its first byte is `0xcb`, the 3.12 bytecode magic, which is the byte every failure names. CI never runs `py_compile`. | row | bfed143 | this head | |---|---|---| | #441: one bare `--link-source <openXdox tree>`, chain `openXdox → openYdox → openInk`, `codexInk` | `FINDING ... is broken (openYdox declares openYdox, not openInk)`, exit 1 | `domain-descendant/assembly`, one `declared-unverified` WARNING for openYdox naming `--link-source openYdox=<path>`, exit 0 | | #441: each link keyed | exit 0 | exit 0, unchanged | | #441: no `--link-source` | two WARNINGs, exit 0 | unchanged | | #441, scaffold `--dry-run`, same chain, `--pin-source <openXdox clone>` | `REFUSED chain-not-declared`, exit 2 | WARNING declared-unverified for openYdox, plan printed, exit 0 | | #441, one link: `--referent-chain openInk` beside a leg `openXdox → openQuill`, bare openXdox tree | no warnings, exit 0 | the same: no warnings, exit 0 (04c9d77 printed a WARNING and a NOTE) | | #441, one project, legs `openXdox → openInk` and `openYdox → openQuill`, bare openXdox tree | `FINDING codexQuill: the declared chain openYdox → openQuill is broken (openYdox declares openInk, not openQuill)`, exit 1: the bare tree answered both first links | two WARNINGs and the two-first-links NOTE, exit 0 | | #442: `--link-source openXdox=` from the project root | `FINDING ... (openXdox declares openXdox, not openInk)`, exit 1 | `REFUSED link-source-no-path`, exit 2 | | #442: the same from another directory | WARNING about `.`, exit 0 | `REFUSED link-source-no-path`, exit 2 | | #442: `--link-source ''` from the project root | FINDING, exit 1 | `REFUSED link-source-no-path`, exit 2 | | #442: `--link-source openXdox= --link-source openXdox=<tree>` | NOTE "the later ... replaced it", exit 0 | `REFUSED link-source-no-path`, exit 2 (the behaviour change above) | | #442: `--link-source openXdox=.` from the project root | FINDING (reads the project's own manifest, as typed) | unchanged: a typed `.` is read | | #442: `--pin-source openXdox=` (scaffolded `codexDox`) | `FINDING neutral-pin-source-unreadable: ... . (--pin-source openXdox=...)`, exit 1 | `REFUSED pin-source-no-path`, exit 2 | | #442: `--pin-source ''` | the same FINDING, exit 1 | `REFUSED pin-source-no-path`, exit 2 | | #442: `--pin-source openXdox= --pin-source openXdox=<clone>` | `pins ok`, exit 0 | `REFUSED pin-source-no-path`, exit 2 | | control: `--pin-source openXdox=<clone>` | `pins ok`, exit 0 | unchanged | No row needs real GitHub. Round 1 ran every row except the two new ones and the two "a later value replaces it" rows. The one-link and two-legs rows are the new tests: on bfed143 the one-link test passes and the two-legs test fails; on 04c9d77 the one-link test fails and the two-legs test passes. The two "a later value replaces it" rows are the review's reproductions of bfed143 against 04c9d77; this commit does not change them. Each hunk was reverted alone in a throwaway worktree, and the new file run against it. Round 1 (20 tests), every hunk fails at least one test: | hunk reverted | tests that fail | |---|---| | `repo_shape.py`: offer `default_source` to every link again | 6: the long-chain row, the later-link NOTE, the stdin NOTE, the lookup `[two]` and `[three]`, the scaffold | | `LinkSources._bare_path`: drop the two-first-links gate | 1: two chains beginning at two links | | `_not_asked_why`: drop the two-first-links sentence | 1: the same test | | `_not_asked_why`: always the old two-link sentence | 2: the later-link NOTE and the stdin NOTE | | `main`: drop the `link-source-no-path` refusal | 6: every `--link-source` no-path row | | `PinSources`: drop the `pin-source-no-path` refusal | 3: every `--pin-source` no-path row | | `link_pins`: drop `firsts.setdefault` (stdin names) | 1: the stdin NOTE | | `_first_links_read`: return nothing | 1: two chains beginning at two links | | naming `no_path`: keyed values only | 2: the two empty bare rows | | pins `no_path`: keyed values only | 1: the empty bare row | Round 2 (22 tests, head 31a6f21): | hunk reverted | tests that fail | |---|---| | `_first_links_read`: `if data is not None:` → `if False:` (the project's legs; the review's M14, which survived 04c9d77) | 1: `test_a_project_whose_legs_begin_at_two_links_reads_a_bare_tree_for_neither`; stderr has the two WARNINGs and no NOTE | | `LinkSources.link_pins`: count a one-link chain's first link again | 1: `test_a_chain_of_one_link_is_no_first_link_read` | | `_first_links_read`: count a one-link chain again | 1: `test_a_chain_of_one_link_is_no_first_link_read` | Round 3 (23 tests, head a707d4b): | hunk changed | tests that fail | |---|---| | `LinkSources.link_pins`: `if len(target.chain) > 1:` → `> 2` (the re-review's boundary mutant, which survived 31a6f21) | 1: `test_a_two_link_chain_read_from_stdin_counts_its_first_link` (`1 failed, 22 passed in 10.59s`); stderr has "first link alone, , which had" where the test expects "each link whose own declaration is read had" | The existing `test_a_link_source_no_link_used_is_a_note_and_changes_no_exit` in `tests/test_naming_policy.py` holds the two-link NOTE sentence byte for byte, and it passes. - origin/main 9f80939 (it holds the README, handbook and `tests/readme-cap.d/550.txt` of f6eaab7): clean. The re-review found it clean at 31a6f21 (tree 71ea0d30), and `test_repo_hygiene.py`, `test_readme_sections.py` and `test_cli_reference.py` gave `151 passed in 58.81s` on that merged tree, with `render-cli-reference.py --check` ok. The README cap there is 1427 = 1422 + 5 from main's `tests/readme-cap.d/550.txt`, and this PR adds 0 README lines; its three handbook markers for "The three legs" are 39ec2c23 on the merged tree. a707d4b changes the test file only: merge-tree of it with 9f80939 is clean (tree dfc650f). Earlier mains were clean too: 7d9bec9 (after #552, #553, #554, #561 and #562; `415 passed` on the merged tree) and bbcfd34 (tree 10acc9c). The two `docs/cli.md` regenerations (this PR's `--link-source` help, #561's `bump-leg.py`) touch different tools' sections. - Lane 2's `fix/539-validators-lockstep-remedies` (#575, 93b68f6), now on origin: clean. The reviewer ran the lockstep-lines test, the new file, `test_validate_pins_without_git.py` and `test_validate_pins_unreadable_workflow.py` on the merge with 04c9d77: `103 passed in 48.45s`. This commit does not touch `validate-pins.py` or any of those tests. The `validate-pins.py` hunk stays inside `PinSources`, away from #539's regions (`:99-544` and `:1109-1143`). - Lane 2's `fix/540-pin-source-unread` (#570, 79dfd33): clean. On a merge with 04c9d77, the new file, `test_pin_source_unreadable.py`, `test_scaffold_referent_chain_links.py`, `test_scaffold_leg_path_collisions.py`, `test_cli_reference.py` and `test_adopt_pins.py` gave `371 passed`. #540 counts any `--referent-chain` as a reader of `--pin-source`; that stays true, because every chain's first link reads it. One sentence of #540 needs a word once both are in: `pin-source-unused` says the clone is read for "each --referent-chain link's declaration" (`scripts/shape_materialize.py:2706-2707` and the docstring at `:2681-2683`, and `tests/test_pin_source_unreadable.py:445`, the `UNUSED` text at `:455-457` and `:498`). After this PR it is the FIRST link's alone. Whichever lands second should change "each" to "the first". - The other PR heads #556 to #582 that git still serves (23 heads; #561 is on main): all clean, except #577 (`install.sh`, d0cdbf4). #577 conflicts with main itself, in `docs/handbook.html` and `tests/test_repo_hygiene.py`; against this head the same two files conflict. This PR is not the cause. Both edit `README.md` and the handbook's hash markers, so they land one at a time. Only #575 touches a file this PR changes (`validate-pins.py`, clean). - Lane 5's other branches: #568 `fix/family-bump-to-checks` 8024f9c, #571 `fix/family-remove-gitmodules-missing` b1120c3, #574 `fix/family-members-case-variants` 40eda84 and #578 `fix/family-siblings-tracking-branch` 43d32eb: clean. - The scaffold's and `adopt-project.py`'s own `--pin-source ''` (see the checklist candidates). - `validate-pins.py`'s `--help` and module docstring: nothing in them became false, and the module docstring sits near lines #539 edits. - Making `validate-pins.py` refuse the empty path before its leg and shape-pin checks: it would put the hunk in `_run_all_checks`, where #539 edits. - The v1.0.0 release notes keep #441 and #442 as known limits of 1.0.0, which they are. - **`scaffold-project.py` and `adopt-project.py`: `--pin-source ''` is `Path("")`, so the current directory is read as the pinned product's clone.** Both take `--pin-source` as `type=Path`, and `shape_materialize.declared_pin_values` computes the digest from it. The scaffold also hands it to `link_pins_from_trees` as the first link's tree. Run from the product's own clone, `scaffold-project.py --pin openXdox@<sha> --pin-source '' --referent-chain openXdox,openDox --dry-run` plans with `local-clone (.)`, exit 0; run from anywhere else it reads whatever directory it stands in. This is #442's shape in the two tools that create a project, and neither was in #442. (The review confirmed it for the scaffold on the head; `adopt-project.py` was not re-run.) - **The scaffold's `declared-unverified` warning names remedies the scaffold does not have.** It says "(a sibling checkout, SHAPE_PIN_SOURCE_<LINK>, or --link-source <link>=<path> would let it be read)". `scaffold-project.py` has no `--link-source` (none in its `--help`) and reads no sibling checkout: `link_pins_from_trees(chain, None, ...)` at `scaffold-project.py:799` passes no root. The text is `_chain_link_findings`' (`scripts/repo_shape.py:1419`). It was already printed on bfed143 for a two-link scaffold with no manifest. Since this PR, every chain of three or more links scaffolded with `--pin-source` alone prints it for the second link, where only `SHAPE_PIN_SOURCE_<LINK>` helps. The wording should name only the remedies the caller has. - **`tests/test_cli_reference.py` alone writes `templates/family-root/scripts/__pycache__/bootstrap.cpython-312.pyc`** (proved on 04c9d77 and on two merged trees: `22 passed`, then the file is there). A `.pyc` under `templates/` breaks `template_values()` and its twin in `test_scaffold_leg_path_collisions.py` in any later adoption run in the same tree: round 1's 27 failures were the same kind of break, from a `.pyc` under `templates/assembly-root`. #554's `load_without_bytecode` does not cover it. It is outside #441 and #442, and is named here only. Review: rv441 found 5 nits on 04c9d77 (APPROVE WITH NITS), fixed in 31a6f21; re-review rv441b found all five fixed or answered and 2 new nits (a test gap at the two-link boundary of `link_pins`, and this body), fixed in a707d4b. CI (Brett Heap's ruling 27): H0 a707d4b passed tests, tests-macos, tests-windows and SonarCloud; the head 8971ad5 is a clean update-branch merge of main bcfa364, with tests and SonarCloud green, and the local gate passed on its predicted squash: the scaffold, pins, naming, link-source, setup-by-hand and hygiene sets, 1174 passed, over bcfa364; then the hygiene, AGENTS.md-code, README-section, CLI-reference, link-source and naming sets, 468 passed, over 526cd2c; and 334 passed over b9f65be. Landed on Brett Heap's word of 2026-10-15T13:32:47Z, "All five, once green". Closes #441 Closes #442 Lane: openreposhape-5 (openRepoShape-5) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…, any path under another spelling of `members/`, in its index, in HEAD or on disk, and names a remedy per entry that never moves the members' checkouts (#362, #363, #364) (#574) Brett Heap ruled on 2026-10-14, "Refuse on every disk": refuse before reading the member, name the entries and a committed `git mv` as the remedy, use one rule for the index, HEAD and the disk, and give the same answer on Linux, macOS and Windows, as #318's any-case rule for the mount path does. The cost he accepted: a Linux holder with its own `Members/` folder renames it first. What went wrong before, all reproduced on bfed143: - **#362, the index.** With `core.ignorecase` set, an index entry `Members/README` made git stage every new gitlink as `Members/<P>`. The commit, whose pathspec is `members/<P>`, matched nothing, and the remedy the refusal printed failed the same way every time. With `core.ignorecase` unset, the add committed and left `Members/` beside the member, ready to break the next clone on macOS or Windows. - **#363, HEAD.** HEAD held `Members/README.md`, and an uncommitted `git rm -r Members` had taken it out of the index. `add` then committed the gitlink as `Members/<P>` with exit 0, while `.gitmodules` and `family.yaml` said `members/<P>`. A fresh clone left the member empty and failed `member-gitlink-absent`. - **#364, the disk.** `_checked_mount_path` checked the disk with an exact `os.path.lexists`. An untracked `Members/<P>` was refused on macOS and Windows, and on Linux the member was mounted beside it. What `add` asks now, in `_checked_mount_path`, before it clones, fetches or mounts anything, and before it prints anything about the member: 1. **Which directory is `members/` on this disk (`_members_dir_on_disk`).** The holder's root is listed for every spelling of `members`, with ASCII case folded. `members` is `members/` where it is listed. Where it is not, a directory under another spelling is `members/` itself only when the disk says so: `os.path.isdir(root/'members')` is true and `os.path.samefile(root/'members', root/<spelling>)` names the same directory. That happens on macOS and Windows, never on Linux, and never for a link. 2. **The mount path in that directory, by listing.** An exact `<P>` there gets the same `already exists` refusal as before, word for word. Under another spelling that is `members/` itself, the exception is a `<P>` the index holds under another spelling; the next two questions name that. 3. **#318's any-case index check of the mount path.** Its text and `git rm -r --cached` remedy are unchanged where every variant it holds has nothing on disk. A variant that is on disk goes to the next question instead, which renames it. 4. **`_members_spellings`.** It looks in three places, and gives each path the remedy that acts on it: - every index entry under a spelling of `members/` other than `members/` itself, and every case variant of the mount path; - every file and gitlink HEAD holds there that the index no longer holds (`git ls-tree` of HEAD's root tree, then of each matching entry's object, with no pathspec; an unborn HEAD holds nothing); - what the disk holds there and no index entry covers. 5. **`lexists` of the mount path**, still asked, last, for a directory no listing could read. The refusal (`_spellings_refusal`): - It names each path in its own spelling and says where it was found: `in the index`, `in HEAD and no longer in the index`, or `on disk and untracked`. Each place names at most five paths, then a count. - **Every remedy acts on one entry, never on another spelling's directory.** On macOS and Windows `Members/` and `members/` are one directory, holding the members' checkouts, so a rename of `Members` would move them all. The entry is the one directly under the other spelling (`Members/README`, `Members/docs`, `Members/<P>`), or the spelling itself where it is a file or a link. Where that entry's name folds to one `members/` itself tracks (`Members/irrs` beside `members/IRRS`), it is the full entry instead. - The remedies run in this order: 1. what HEAD holds and the index no longer does: commit the pending change first (`git commit`); 2. what the index holds: - on disk in its own spelling: `git mv -- <entry> <new name>`; - kept off disk by a sparse checkout: `git mv --sparse -- <entry> <new name>`; - nothing on disk: `git rm -r --cached -- <entry>...`, which touches no file; - then a commit, where there is something to commit; 3. what is on disk and untracked: `mv -- <entry> <new name>`; 4. a `members/` renamed by hand on Linux: `mv -- Members members`. - Every path in a command is quoted for a POSIX shell (`shell_quoted(..., 'posix')`, #532). - The holder stays byte-identical. The tests compare the snapshot of `tests/test_family_add_refusals.py` and the whole index, byte for byte. Example: #364's state on Linux, an untracked `Members/Atlas` in a holder that has `members/Nova`: ``` REFUSED member-path-taken: the family root holds a case variant of members/Atlas, the same path on a case-insensitive disk, though no `members:` row names it — on disk and untracked: `Members/Atlas` (a directory) Remediation: every member is mounted under members/, and a holder keeps that directory in one spelling on every disk. Move what is on disk and untracked out of the way (`mv -- Members/Atlas <new name>`); then re-run. ``` On macOS and Windows the same `mkdir -p Members/Atlas` lands inside `members/`, which is then the mount path itself. The refusal there is the one it always was, with the same code: ``` REFUSED member-path-taken: members/Atlas already exists in the family root but no `members:` row names it Remediation: this is a half-finished add or a hand-made directory. Remove it (`git rm -r` if it is tracked), then re-run. ``` Example: #362 on a real disk, a committed `Members/README` beside `members/Nova`. In a fresh clone this text is the same on all three systems. A macOS or Windows holder that PULLED the commit keeps the directory spelled `members`, and gets `git rm -r --cached` instead (a checklist candidate below): ``` REFUSED family-members-dir-variant: the family root holds a path at or under another spelling of members/, which a case-insensitive disk takes for members/ itself — in the index: `Members/README` (a file) Remediation: every member is mounted under members/, and a holder keeps that directory in one spelling on every disk. Rename what the index holds with `git mv`, entry by entry (`git mv -- Members/README <new name>`), and commit the rename; then re-run. ``` Head `8a95345b` is one new commit on `40eda849`. The review graded one blocker, three should and five nits; Codex added a P2. - **B1 (blocker): the printed `git mv -- Members` / `mv -- Members` moved every member's checkout on macOS and Windows.** Every remedy now acts on one entry under the other spelling, never on that directory (`_spelled_target`). `_members_dir_on_disk` asks the disk which directory is `members/` (`isdir` + `samefile`). Where it is spelled `Members`, it is treated as `members/` itself: an exact `<P>` in it is `already exists`, a case variant `<p>` is targeted as `Members/<p>`, and an index entry that IS that directory is never renamed. Scenarios `macsingle-mac` and `r318mac-mac` type the new remedy and show `Members/Nova/.git` still in place; `test_the_printed_git_mv_leaves_the_members_where_they_are` does the same in the suite. - **S1, with Codex's P2 at `scripts/family.py:2099`: rule (b) hid a real Linux variant.** Rule (b) is gone; only the alias that `isdir` + `samefile` confirm is `members/`. On Linux, Codex's state (`members/` renamed `Members`, nothing staged) is refused, and its remedy moves the directory back (`mv -- Members members`). The sign is a member's checkout in it (`Members/<name>/.git`, with the gitlink `members/<name>` in the index) and no `members/` on disk. A human's own `Members/` holding a directory named like a member (`ruleb`) is named entry by entry. `tests/test_family_members_case_variants.py:359-371`, which pinned Codex's case as "not named", is replaced. The layout table asks the same states of an emulated folding disk and an emulated Linux disk on every OS, and `test_a_members_directory_renamed_by_hand_is_moved_back` asserts the answer of the disk the test runs on. - **S2: `git mv` failed for an index entry with nothing on disk (`bad source`), and for a sparse one (`not under version control`).** Such an entry is now taken out of the index (`git rm -r --cached -- <entry>`, touching no file). The commit after it is printed only where HEAD holds the entry, or will once the pending change is committed. An entry the sparse checkout keeps off disk gets `git mv --sparse -- <entry> <new name>`, which keeps its content. Scenarios `idxonly` and `sparsemv` type each. - **S3: #318's tracked `Members/<P>/...` took three refusals.** #318's index check now keeps its text only where every variant of the mount path it holds has nothing on disk; its pinned test is unchanged. A variant that is on disk goes to the new refusal: one committed `git mv -- Members/<P> <new name>`, one round (scenario `r318`; `test_a_tracked_path_on_disk_takes_one_committed_git_mv[Members/IRQS/README]`). - **N1: two remedies collided (`mv: cannot stat 'Members'`).** A disk path the index holds, holds anything above, or (for a move out of the way) holds anything under, is not named on disk. Per-entry targets cannot collide: `git mv -- Members/README` and `mv -- Members/Atlas` now run in order (scenario `overlap`). - **N2: U2, U3 and U4 survived.** `test_a_spelling_that_is_a_link_is_named_and_not_entered` kills U2 (a link entered, probe P19) and U3 (no `a symlink`, P20). `test_a_name_head_holds_that_is_not_utf8_is_shown_replaced` kills U4 (P14). - **N3: the "#364's state on any OS" example and the docstring at `:278-280`.** The example above now says Linux, and shows the macOS/Windows text beside it. The test that docstring belonged to is replaced by two: one for the states every disk answers alike, and one that asserts per disk (`test_an_untracked_members_directory_is_moved_entry_by_entry_on_linux`). - **N4: "hold as one directory with it" for a FILE named `Members`.** The sentence is now "a path at or under another spelling of members/, which a case-insensitive disk takes for members/ itself", true of a file too. - **N5: `folding_lexists` walked from `/`.** It is replaced by `disk_as`, which resolves names below the holder root only and passes every other path through unchanged. Head `e5aac93f` adds one commit on `8a95345b`. It changes only `tests/test_family_members_case_variants.py` (+102); no product code changes. The re-review (rvcase2) said APPROVE WITH NITS: every point above is fixed, every scenario ends clean as typed, and five nits remain. - **NIT-1: ten conditions no test caught.** rvcase2's probes Q1-Q7 and Q9-Q11 each left all 57 tests passing. Four new rows in the layout table, each asked of both disks, and one new unit test now guard them: - a link `Members` to a directory outside the holder, `members/` gone (Q1, the alias may be a link). A folding disk resolves `members` through the link, and it must still be named as a link. This is now caught on every OS by the emulated folding disk, not by macOS CI alone. The row skips on Windows, before the link is made. - three committed entries under `Members/` (Q2-Q5): a gitlink `X` with its directory on disk (`git mv`); a file `README` where the disk holds a directory (`git rm -r --cached`); and `docs/a`, kept off disk by `skip-worktree` (`git mv --sparse` of the entry itself). HEAD holds the removed entry, so the text says "and commit both". - a file at `Members/IRQS`, in the index and on disk (Q11): #318's index-only text must not take it. - a gitlink `Members` over a human's `Members/notes.txt` (Q10): on Linux, the file under that entry is the index's to name. - the move back of a renamed `members/` (Q6, Q7, Q9). This needs two spellings side by side, which only a disk that does not fold case can hold, and no test makes them. So `_disk_spellings` is asked of a listing handed in, with nothing read from a disk: the move back happens once only, never where `members/` is on disk, and never for a `.git` that no gitlink names. - **rvcase2's twelve probes (`rvcase2/mut2.py`), re-run against these tests** with `-x`, the new file plus #318's three tests. Every probe now fails a test: | probe | result | the first test that fails | |---|---|---| | Q1 alias may be a link | `1 failed, 46 passed` | layout `a link Members, no members/-folding` | | Q2 on-disk kind ignored | `1 failed, 47 passed` | layout `and every remedy the index takes-linux` | | Q3 gitlink not asked for a directory | `1 failed, 47 passed` | the same row | | Q4 sparse entry keeps its group target | `1 failed, 47 passed` | the same row | | Q5 "commit both" wording | `1 failed, 47 passed` | the same row | | Q6 move back more than once | `1 failed, 53 passed` | `test_only_a_spelling_that_is_members_renamed_is_moved_back[once, though two spellings hold checkouts]` | | Q7 move back where `members/` is on disk | `1 failed, 54 passed` | `...[never where members/ is on disk]` | | Q8 move back without a `.git` | `1 failed, 39 passed` | layout `a human's own Members/, no members/-linux` | | Q9 move back without the gitlink | `1 failed, 55 passed` | `...[never for a .git no gitlink names]` | | Q10 a path under an index entry named | `1 failed, 51 passed` | layout `a gitlink Members over a human's Members/-linux` | | Q11 every mount variant taken as a directory | `1 failed, 49 passed` | layout `and a file Members/IRQS in the index and on disk-linux` | | Q12 no case for a bare `Members` | `1 failed, 4 passed` | `test_an_index_entry_with_nothing_on_disk_is_taken_out_of_the_index[Members-Members-true]` | - **Tests at `e5aac93f`:** the new file (60 tests) and `tests/test_family_add_refusals.py` (65): `125 passed in 105.50s`. - **NIT-5, this body:** P4's row now reads "7 of the 9 folding rows"; the #362 example says its text holds in a fresh clone; and the merge checks are refreshed. - **NIT-2, NIT-3 and NIT-4** are checklist candidates below. - **The new code is `family-members-dir-variant`**, used where every path found is under a spelling of `members/` alone. Codes about the holder as a whole start with `family-` (`family-index-locked`, `family-on-tracking-branch`, `family-members-unrecognised`). `members-dir` is `family.yaml`'s own name for that directory (`members_dir`). `variant` is the word #318's refusal and the validator use. `member-path-taken` stays wherever any path is a case variant of the mount path `members/<P>`, as #318 and #364 have it. - **The alias is asked, never guessed.** `isdir` and `samefile` are what the disk says. On Linux `members` is simply not there when only `Members` is (Codex's state), and with two directories `samefile` is false. A Linux `members` symlink is listed as `members`, so it is never the alias. A Linux `casefold` directory answers as macOS does, which is right. - **Per entry, not per file.** The remedy names the entry directly under the other spelling, so `Members/docs/` with 300 files is one `git mv`. A `git mv` of a directory is one `rename(2)`, so its untracked contents go with it, and a mount variant `Members/<P>` is cleared in one step on every disk. The full entry is used only where the name folds to something `members/` itself tracks. - **"On disk" means in its own spelling (`_on_disk_as_named`).** It reads listings component by component, exactly. On macOS `lexists("Members")` is true because `members/` exists, and `git mv -- Members X` there would move `members/`. With exact listings an index file `Members` beside `members/` is taken out of the index instead, on every disk. - **An empty directory under another spelling is not named.** `git mv` and `rm` of its last entry leave one behind on Linux; it holds nothing a clone or a disk could meet. A directory nobody may list is named and moved whole, since nobody can tell it is empty. - **A `members/` renamed by hand is moved back (Linux).** The sign is a member's checkout in it: `<spelling>/<name>/.git`, with the gitlink `members/<name>` in the index, and no `members/` on disk. A human's own `Members/` holding a directory named like a member, with no checkout in it, is named entry by entry instead. - **The commit after `git rm --cached` is printed only where there is one to make:** where HEAD holds the entry, or will once the pending change is committed. A staged-only entry, #362's own planted state, leaves nothing to commit, and a printed `git commit` would fail with `nothing to commit`. - **`git mv --sparse` needs git 2.34 or later**, the release that made `git mv` and `git rm` refuse paths outside the sparse checkout. Its test skips on an older git. - **#318's unit test** (`test_the_index_is_asked_at_the_mount_path_in_any_case_and_literally`) pinned "a variant of `members/` alone: not refused, by design". Its docstring cites Brett Heap's ruling of 2026-10-14 ("Refuse on every disk"). It asserts that `_members_spellings` names each entry with its target and remedy. - **#318's end-to-end test of the unwind's closing sentence** runs in process with `_members_spellings` switched off, so the unwind's guard behind the refusal stays tested. - **`add --dry-run` refuses alike**, because the check runs before the dry run branches off. All runs used `run9.sh`: a `gh` stub first on PATH, `GH_TOKEN=bogus`, an empty `GH_CONFIG_DIR`, `/usr/bin/python3 -m pytest`, and `PYTHONDONTWRITEBYTECODE=1`. - `tests/test_family_members_case_variants.py` held 49 tests at `8a95345b` (60 at `e5aac93f`; see Round 3). Run against `40eda849`'s `family.py`, with #318's unit test beside them: `40 failed, 10 passed in 60.95s`. The 10 that pass are behaviour round 1 already had right: the controls (2); HEAD's mount variant (2); `members/irqs` untracked (1 end-to-end, 2 in the layout table); the unlistable `members/` backstop; and the folding-disk answers for Codex's state and a human's own `Members/`, which round 1's rule (b) hid on every disk. - At head `8a95345b`, the new file, `test_family_add_refusals.py`, `test_repo_hygiene.py` and `test_cli_reference.py`: `189 passed in 180.78s`. - On the merge of `8a95345b` with origin/main `64fc9a86` (main has rewritten `test_family*.py`'s clone sites since this branch's base), the new file, `test_family_add_refusals.py`, `test_family_member_path.py`, `test_family.py`, `test_repo_hygiene.py` and `test_cli_reference.py`: `338 passed in 353.46s`. - Round 1's two batches, on the bytes of `8a95345b` before a two-line docstring correction: - batch A plus `test_family_add_refusals.py`, 14 files (test_family_members_case_variants, test_family_add_refusals, test_family_member_path, test_family_add_excludes, test_family_member_name, test_family_add_member_id, test_family_dry_run, test_family_tracking_branch, test_family_printed_quoting, test_family_bump_remove_rollback, test_family_bump_to_a_tag, test_family_init_landing, test_refusal_default_remediation, test_template_text_placeholders): `561 passed in 862.50s`; - batch B, 9 files (test_family, test_validate_family_member_path_glob, test_validate_family_unnamed_mounts, test_validate_family_duplicates, test_validate_family_without_git, test_update_shape_pr_base, test_cli_reference, test_repo_hygiene, test_shape_doctor): `671 passed, 3 skipped in 1228.01s`. The 3 skips are the Windows-host PowerShell lines in test_shape_doctor. What the tests cover, and how each stays portable across all three systems: - **Every printed remedy is typed as printed** (`type_remedy`), and the same `add` then pins the member under `members/` alone, with a clean `git status`. - **Index and HEAD states** are planted with `update-index --cacheinfo`, under `core.ignorecase` true and false. A non-UTF-8 name goes in through `--index-info` with bytes on stdin, and is committed by `write-tree` and `commit-tree`, which never look for it on disk. - **Disk states** use a holder with no member yet, or the holder's own `members/` renamed in place. No test makes two directories whose names differ only in case. - **Where the disk decides the answer**, the test either asks the disk it runs on (`disk_folds`, one probe directory) and asserts that disk's answer, or runs in process under `disk_as`, which emulates a folding disk and a Linux disk below the holder root. Both answers are then asserted on every OS. - **Skips** come before any call that could fail: links on Windows; an unlistable directory on Windows, as root, or on a folding disk; `git mv --sparse` on git older than 2.34. - **Windows text mode:** files are written with `write_bytes`, and git's stdin is fed bytes. The review's states (`$Q/v110/rvcase/scen.sh`), rebuilt on a fresh kit (local bare remotes, a `gh` that exits 97, called 0 times). After each refusal, every printed command was typed as printed. Only `<new name>` was filled in: `renamed-N` for a `git mv` (committed, so it stays in the holder) and a path outside the holder for a `mv`. "Linux" is this host. "macOS/Windows" is the same layout judged in process with `isdir`, `samefile` and `lexists` folding case below the holder root. | scenario | `40eda849` | `8a95345b` | |---|---|---| | `macsingle` (Linux) | `git mv -- Members renamed-1` moves Nova: ` D members/Nova`, `member-uninitialized` | `git mv -- Members/README`, commit, `mv -- Members members`: add exit 0, status clean, `family ok` | | `macsingle` (macOS/Windows) | `git mv -- Members ...` (moves Nova there) | only `git mv -- Members/README <new name>`: Nova's checkout stays in `Members/` with its `.git`; the check then passes | | `macleft` (Linux) | `mv -- Members ...` moves Nova: ` D members/Nova` | `mv -- Members/Atlas ...`, then `mv -- Members members`: exit 0, clean, `family ok` | | `macleft` (macOS/Windows) | `mv -- Members ...` | `members/Atlas already exists`, as `linuxleft`; removing it passes the check | | `linuxleft` | `already exists` | unchanged; removed as it says: exit 0, clean, `family ok` | | `codex` | add exit 0, holder split (` D members/Nova`, `?? Members/`) | refused; `mv -- Members members`: exit 0, clean, `family ok` | | `ruleb` | add exit 0, `?? Members/` left | refused; `mv -- Members/Nova ...` and `mv -- Members/README.md ...`: exit 0. ` D members/Nova` stays, because the scenario deleted Nova's checkout; `git submodule update --init` (the validator's own remedy) gives clean and `family ok` | | `ruleb2` | `mv -- Members ...` | `mv -- Members/README.md ...`: exit 0; Nova as in `ruleb` | | `idxonly` | `git mv` fails `bad source` | `git rm -r --cached -- Members/README` (nothing to commit): exit 0, clean, `family ok` | | `sparsemv` | `git mv` fails `not under version control` | `git mv --sparse -- Members/README ...`, commit: exit 0, clean, `family ok` | | `overlap` | second command fails `mv: cannot stat 'Members'` | `git mv -- Members/README`, commit, `mv -- Members/Atlas`: exit 0, clean, `family ok` | | `r318` | 3 rounds; leaves `?? Members/Atlas/` | 1 round, `git mv -- Members/Atlas`, commit: exit 0, clean, `family ok`, HEAD holds `renamed-1/README` | | `r318mac` (Linux) | ends moving Nova | `git mv -- Members/Atlas`, commit, `mv -- Members members`: exit 0, clean, `family ok` | | `r318mac` (macOS/Windows) | `git rm --cached`, then `mv -- Members` | `git mv -- Members/Atlas`: Nova stays; the check passes | | `linux362` | `git mv -- Members`: exit 0 | `git mv -- Members/README`, commit: exit 0, clean, `family ok` | | `twodirs` | `mv -- Members ...` | `mv -- Members/Nova ...`: exit 0, clean, `family ok` | | `mac-ok` (the control) | exit 0 | exit 0, clean, `family ok` | | #363 (`i363`) | `git commit`, then exit 0 | `git commit`, the text now naming `Members/README.md` rather than `Members`: exit 0, clean, `family ok` | | #364 (`i364`) | `mv -- Members ...` | `mv -- Members/Atlas ...`: exit 0, clean, `family ok` | Every refused first `add` printed nothing on stdout. Not reproduced: a real macOS or Windows disk. The folding disk is emulated (`core.ignorecase`, and `isdir`, `samefile` and `lexists` resolved case-insensitively below the holder), and CI's macOS and Windows jobs run the tests on real disks. Each probe changed one hunk of this round in a throwaway worktree, then ran the new file (49 tests) and #318's three tests in `test_family_add_refusals.py` (8 cases), 57 in all. At least one test failed every time: | probe | what it undoes | result | a test that fails | |---|---|---|---| | P1 | per-entry targets (back to the spelling's directory) | 19 failed | `test_the_printed_git_mv_leaves_the_members_where_they_are` | | P2 | the full entry under a name `members/` tracks | 2 failed | `test_an_index_entry_with_nothing_on_disk_is_taken_out_of_the_index[Members/irrs/a-...]` | | P3 | an unlistable directory read as empty | 1 failed | `test_another_spelling_nobody_may_list_is_named_and_moved_whole` | | P4 | the alias (`isdir` + `samefile`) | 8 failed | 7 of the 9 folding rows then in the layout table, and `test_the_printed_git_mv_leaves_the_members_where_they_are` | | P5 | "on disk" by exact listings (back to `lexists`) | 1 failed | layout `a file Members in the index, beside members/-folding` | | P6 | `git mv --sparse` for a skip-worktree entry | 1 failed | `test_an_entry_a_sparse_checkout_keeps_off_disk_takes_git_mv_sparse` | | P7 | another spelling's directory named entry by entry | 13 failed | `test_a_tracked_path_on_disk_takes_one_committed_git_mv[Members/README]` | | P8 | an empty directory not named | 6 failed | `test_a_tracked_file_deleted_from_disk_is_taken_out_and_committed` | | P9 | the move back of a renamed `members/` | 6 failed | `test_a_members_directory_renamed_by_hand_is_moved_back` | | P10 | the alias's own entries judged as `members/`'s | 6 failed | layout `members/ renamed Members (Codex's P2)-folding` | | P11 | never renaming the alias itself | 1 failed | layout `and a gitlink named Members in the index-folding` | | P12 | the move back kept when the index holds things under it | 2 failed | layout `and Members/README in the index (#362, B1)-linux` | | P13 | a disk path dropped when the index holds things under it | 3 failed | `test_a_tracked_path_on_disk_takes_one_committed_git_mv[Members/docs/notes]` | | P14 | U4: a HEAD-only name shown with U+FFFD | 1 failed | `test_a_name_head_holds_that_is_not_utf8_is_shown_replaced` | | P15 | no commit printed after removing a staged-only entry | 12 failed | `test_an_index_entry_with_nothing_on_disk_is_taken_out_of_the_index[...]` | | P16 | the commit after a removal once the pending change is committed | 1 failed | `test_every_place_is_named_and_the_pending_change_is_committed_first` | | P17 | `already exists` in the alias only where the index holds no variant | 1 failed | layout `and Members/IRQS/README in the index (#318)-folding` | | P18 | #318's text only for variants with nothing on disk (S3) | 3 failed | `test_a_tracked_path_on_disk_takes_one_committed_git_mv[Members/IRQS/README]` | | P19 | U2: a link not entered | 1 failed | `test_a_spelling_that_is_a_link_is_named_and_not_entered` | | P20 | U3: `a symlink` named | 1 failed | `test_a_spelling_that_is_a_link_is_named_and_not_entered` | | P21 | N4's wording | 29 failed | every refusal naming `family-members-dir-variant` | The other hunks are docstrings, which change no behaviour. `git merge-tree --write-tree 8a95345 <ref>`, after a fetch at round 3. Every result is clean. Round 3's commit changes only `tests/test_family_members_case_variants.py`, which no ref below touches. - origin/main `f5fc7056166d` (round 2 checked 64fc9a8 and 7d9bec9, both clean): clean. Since 64fc9a8, main has not changed `tests/test_family.py`, `tests/conftest.py`, `tests/test_family_add_refusals.py` or any script these tests load, so round 2's run on the merge with 64fc9a8 still holds for them. #561 has landed, so it is no longer checked as a PR head. - #568 `fix/family-bump-to-checks` `8024f9c914fd`: clean. - #571 `fix/family-remove-gitmodules-missing` `ebe6b512db02`: clean. - #576 `fix/link-source-chain-defaults` `a707d4ba3f54`: clean. - #578 `fix/family-siblings-tracking-branch` `0112dcb63391`: clean. - Lane 2's `fix/537-dry-run-asks-remotes` `69c58aae2a04` and `fix/539-validators-lockstep-remedies` `0680799c7b21`: clean. The tests on the merge with origin/main are in the Tests section. - **#363 option 2, a check of the commit after the fact** (`git ls-tree HEAD` must hold the gitlink at exactly `members/<P>`, else undo). The ruling refuses before the mount, so nothing here needs it. It would still catch a cause nobody has foreseen. - **#363 item 3, the validator option:** `validate-family.py` would say that a gitlink in HEAD at a case variant of a row's path is why the gitlink is absent. That is a pinned template file, and lane 2's #539 is editing its remedies. - **Docs.** `git grep` of AGENTS.md, README.md, `docs/handbook.html` and `templates/family-root/` (README, AGENTS.md, AGENTS-shape.md) found no sentence about `add`'s refusals or about `members/` versus `Members/`, so none became false. AGENTS.md is at its 490-line cap. `templates/family-root/AGENTS-shape.md` is digest-pinned into every holder. - **`docs/release-notes/v1.0.0.md`** lists #362, #363 and #364 as v1.0.0's known limits. That is still true of v1.0.0, so the file is untouched. - **Contrived states, not handled:** a gitlink named `Members` in a Linux holder whose `members/` was also renamed `Members`; Windows' trailing-dot and 8.3 aliases of `members`; NFD names. The case-folding is ASCII, as git's `icase` is, and project names are ASCII. - **`family.py add`: check the commit after the fact (#363 option 2).** After `_commit_one`, read `git ls-tree HEAD` for a gitlink at exactly `members/<P>`. If it is anywhere else, undo this command's commit and the mount, and refuse with the spelling git chose. This catches any cause of a misplaced gitlink, not only the case variants refused here. - **`validate-family.py`: say a HEAD gitlink is at a case variant of the row's path (#363 item 3).** A holder already pushed in #363's state is told `member-gitlink-absent` in a fresh clone, with nothing about the `Members/<P>` that HEAD holds. Reading HEAD's gitlinks folded for case would name the cause. - **`validate-family.py`: the `member-gitlink-unnamed` remedy for a hand mount under `Members/`.** The remedy says `git rm` the gitlink, then `family.py add` it. Under a spelling of `members/` other than `members/`, `add` now refuses until that `git rm` is committed, and says so. The validator's sentence could say "commit the removal" before the `add`. Lane 2's #539 is editing these remedies. - **Docs: name the one-spelling rule for `members/`.** AGENTS.md's family section, the README's family section and the holder's `AGENTS-shape.md` could say that a holder keeps `members/` in one spelling, and that `add` refuses `family-members-dir-variant` until a human renames their `Members/`. AGENTS.md is at its line cap. - **`family.py add`: a file named `members`, or a sparse checkout that leaves `members/` out, is refused late** (rvcase's `mfile` and `sparse`). Both pass the checks, the member is read and mounted, and `git submodule add` then fails; the unwind restores the holder. Both could be refused up front, the second naming `git sparse-checkout add members`. - **`family.py add`: a member's own gitlink renamed with `git mv members Members` (NIT-2).** Staged or committed, the gitlink sits at `Members/<M>`, and the refusal names it with the generic `git mv -- Members/<M> <new name>`. Typed with any name, the add then passes and the validator says `member-gitlink-absent`. The right name (`members/<M>`) fails as typed until `mkdir members` (`$Q/v110/rvcase2/scen-gitmv.log`, `stagedmv`, `committedmv`). The holder's own validator already refuses that state before the add. A refusal that named a gitlink `<spelling>/<M>` whose `members/<M>` is a `members:` row could print `mkdir members` and the move back. - **`family.py add`: a macOS or Windows holder that PULLED a commit adding `Members/README` (NIT-3).** There the directory stays spelled `members` and the file lands at `members/README`. Since exact listings do not find `Members/README`, the remedy is `git rm -r --cached`, not the ruling's committed `git mv`, and the file is left untracked at `members/README` (`$Q/v110/rvcase2/scen-head.log`, `macpulled-mac`, emulated). It is benign: committing that file afterwards still gives `family ok`. Folding the lookup for targets below the spelling, keeping the exact rule only for a bare `Members`, would print the `git mv` there too. - **`git mv --sparse` needs git 2.34 or later (NIT-4).** The estate states no minimum git (`README.md:215`, `README.md:365`, `docs/handbook.html:617`), and `scripts/shape_materialize.py` keeps a fallback for git older than 2.32. On such a git the sparse remedy fails with an unknown option; nothing is damaged (`$Q/v110/rvcase2-report.md`, NIT-4). The text could say "git 2.34 or later", or fall back to `git rm -r --cached` there. Review: rvcase found 1 blocker, 3 should and 5 nits on 40eda84, and Codex a P2; fix round 8a95345 fixed them all; re-review rvcase2 found 5 nits, fixed in round 3 (e5aac93, tests only), and Codex's `:2099` thread is answered. CI (Brett Heap's ruling 27): H0 e5aac93 passed tests, tests-macos, tests-windows and SonarCloud; the head 4c21ce2 is a clean update-branch merge of main 40b476d, with tests and SonarCloud green, and the local gate passed on its predicted squash (the family, validate-family and hygiene sets: 1050 passed, 19 skipped, over 66267f0). Landed on Brett Heap's word of 2026-10-15T13:32:47Z, "All five, once green". Closes #362 Closes #363 Closes #364 Lane: openreposhape-5 (openRepoShape-5) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>



Lane: openreposhape-5 (openRepoShape-5)
Claim: #541 (comment)
family.py bump --toskipped two checksaddmakes, and failed in git's own words on a commit nobody had pushed. This PR fixes the three lines of #541 inscripts/family.py. Both runs, the dry run and the real one, now give the same answer for each line.The head is 8024f9c. It has two commits on bfed143: eeadc65 is the fix, and 8024f9c answers review rv541 (see "Second commit" below).
The lines of #541
bump --tonever askedadd's duplicate-id question. If the member'sproject.yamlat--torecorded another row'sid,bumpcommitted it with exit 0. The holder's ownvalidate-family.pythen refused that commit asmember-duplicate-id. Nowbumprefuses withmember-duplicate-idbefore anything changes, and the holder stays byte-identical.bump --toan unpushed commit failed as git'sreference is not a tree. Now both runs refuse withmember-to-unknown. The refusal names the commit, says no branch of the member's remote reaches it, and says to push it first. Once the commit is pushed, the same command pins it.add --at <tag id>peels it,bump --torefused the same id, and the two worded a tag of a tree differently. Brett Heap ruled on 2026-10-14 thatbump --topeels an annotated tag's own id, asadd --atdoes.bumpnow pins the commit the tag names, in both runs, and prints one line saying so.add's words, "names a tree", through one shared function.--helpsay that an annotated tag's own id is peeled.What changed, and why
_checked_bumped_id(new) asksadd's question (family.pyadddoes not ask whether the member'sproject.yamlidis one the family already pins, so adding a repository renamed at the forge (sameid, new name) commits a holder thatvalidate-family.pythen refuses asmember-duplicate-id#330) of the rowbumpwrites. The member's own row is left out. Every other row is asked the way the validator asks it, sobumprefuses what the gate would refuse and nothing it would pass. It is asked in three places:_checked_bump_target), so the refusal comes before the first write;_bump_and_pin), of the id that checkout read. This catches aproject.yamlthat is a symbolic link, which only a checkout reads through. That refusal is put back byPinRollback(family.pybumpandremovehave no rollback: when a git step afterwrite_membersfails (a holderpre-commithook that exits 1, a heldindex.lock), they exit 2 withREFUSED a git or gh command failedand leavefamily.yamlrewritten, the member checked out at--to(or deinitialised and removed), and the change staged or half-staged, without a word about any of it, whereaddputs the holder back and names what it put back #365), like any refusal after the first write._row_recording(new) finds the row that records an id.add's_checked_member_idnow uses it too.add's words do not change._checked_to_names_a_commitnow returns the commit to pin:^{});member-to-not-a-commit, inadd --at's words (_names_no_commit, shared with_probe_commit);member-to-unknown. If the fetch failed, the refusal says so and does not claim the remote lacks the commit.cmd_bumpgoes on with the returned commit in both runs. When a tag was peeled, both runs print this as their first line:--to <tag12> is an annotated tag in <repo>; the commit it names, <commit12>, is what would be pinned. The words "would be" are deliberate: the dry run prints the line, and so does a run refused by a question asked after the peel, and neither pins anything.--help.add --atnow reads "pin this 40-hex commit instead of the member's current tip (an annotated tag's own 40-hex id is peeled to the commit it names)".bump --toends "(an annotated tag's own 40-hex id is peeled to the commit it names, asadd --atpeels one)".docs/cli.mdis regenerated byscripts/render-cli-reference.py.bumprefuses a tag "asbump-leg.pyrefuses the same--to" is gone (lane 4's note on family.pybump --to: make the checksaddmakes (a duplicate id, an annotated tag's own id), and say to push first for an unpushed commit #541), and so is "left to the checkout" for an id the member does not hold. Both files now compare only withfamily.py add --at, so they stay true whichever of bump-leg.py:--dry-rungives the real run's answer, so--toan annotated tag's own id is peeled to the commit it names in both runs, and a pin layout the rewrite refuses is refused by the dry run too (#534, #438) #561 and this PR lands first._checked_to_names_a_commitnow names the tag whose commit is on no branch.Second commit (8024f9c): review rv541, 0 blockers, 1 should, 5 nits
member-duplicate-idin the same two lines, exit 2, and pin nothing.family/bump-irrs-<the typed id's first twelve>. The reviewer's mutant, in which the dry run takes its hint from the peeled commit, fails that test.--helplines above, withdocs/cli.mdregenerated.Decisions and their evidence
bumpnow usesadd --at's words: "names a tree" and "names a blob", withadd's remediation sentence. Both verbs build the refusal from one function,_names_no_commit, and each keeps its own code (member-at-unknownandmember-to-not-a-commit). I followed the brief's "exactly asadd --atdoes".--dry-rungives the real run's answer, so--toan annotated tag's own id is peeled to the commit it names in both runs, and a pin layout the rewrite refuses is refused by the dry run too (#534, #438) #561 keeps "is an annotated tag of a tree" forbump-leg.py, under its own code and in its own frame.addto that wording would changeadd's tested output, so it is not done here.add's tests pass unchanged (test_family_add_refusals.py, inside the 670 below).member-to-unknown. It mirrorsadd'smember-at-unknownfor the same input. The fetch's outcome selects one of two wordings, so a member that could not be fetched is never called unpushed.add --atpeels a tag without saying so.bumpprints one line in both runs, because theold -> newline the person reads then shows an id they did not type. The line says "would be pinned", the same words bump-leg.py:--dry-rungives the real run's answer, so--toan annotated tag's own id is peeled to the commit it names in both runs, and a pin layout the rewrite refuses is refused by the dry run too (#534, #438) #561 uses forbump-leg.py.--dry-rungives the real run's answer, so--toan annotated tag's own id is peeled to the commit it names in both runs, and a pin layout the rewrite refuses is refused by the dry run too (#534, #438) #561 does the same withasked.project.yamlis still left to the real run by the dry run, asadd --dry-runleaves one (family.pybump(andadd,remove) take no--dry-run, though the file's exit-code paragraph says a dry run prints and exits 0 andbump-leg.pyhas one, so the only way to see what a bump would pin is to run it: fetch, check the member out at--toand rewritefamily.yaml#326). The real run refuses the duplicate id after its checkout and puts the holder back. A test holds that.Tests
New:
tests/test_family_bump_to_checks.py, with 6 tests:project.yaml(POSIX only), refused and put back;Changed:
tests/test_family_bump_to_a_tag.pynow holds the ruling: the peel in both runs, the peel after the fetch, and the tree, blob and tag-of-one wording. Itsboth_runshelper also takes the stdout a run prints before its refusal. Its clone lines are untouched, so it merges cleanly with main, where tests: every test that clones a just-pushed local remote by its plain path now clones it withclone_just_pushed, so the macOSfailed to copy filerace of #440 cannot reach it;load_without_bytecodekeeps the doctor's and the Windows-path tests' loads of the family root's scripts from writing.pycinto the templates; the not-a-list doctor cases hold INVALID, exit 1; andGOOD_KEYSholds th #554 has landed.tests/test_family_dry_run.py: its test of a commit the member lacks now expectsmember-to-unknownfrom both runs.Results at 8024f9c, through the lane's runner (
ghstubbed, a bogus token, an emptyGH_CONFIG_DIR):test_family_bump_to_checks.py,test_family_bump_to_a_tag.py,test_family_dry_run.py,test_family_bump_remove_rollback.py,test_family_add_member_id.py,test_cli_reference.py: 139 passed in 149.62stest_family.py,test_family_tracking_branch.py,test_family_add_refusals.py,test_family_add_excludes.py,test_family_member_path.py,test_family_printed_quoting.py,test_cli_reference.py,test_repo_hygiene.py,test_refusal_default_remediation.py,test_commit_trailers.py,test_agents_md_codes.py,test_stdout_encoding.py: 670 passed, 1 skipped in 300.71s. The skip istest_stdout_encoding.py:286, which runs on Windows only.scripts/render-cli-reference.py --check:[ok] docs/cli.md is what the generator produces.The new and changed tests at bfed143, with the test files copied in:
Reproductions (local bare remotes and the
ghstub only)The script scaffolds Atlas, Borg and Cello into bare remotes, makes a holder with Atlas and Borg, then runs each line. At bfed143, then at eeadc65; 8024f9c changes only the peel line's last words:
project.yamlis changed to recordid: "borg", pushed, and Atlas is bumped to it.id: borg, and the real run commits (exit 0).validate-family.pythen saysFINDING member-duplicate-id: Borg and Atlas both record id 'borg', exit 1.REFUSED member-duplicate-id: testorg/Atlas at <sha12> is already a member of Sonata under another name: ..., exit 2. The holder's state hash is the same before and after, and the validator saysfamily ok.work/Atlasand not pushed.REFUSED resolving ... fatal: Needed a single revision. The real run saysREFUSED checking members/Atlas out ... fatal: reference is not a tree. Both exit 2.REFUSED member-to-unknown: --to <sha> is not a commit any branch of testorg/Atlas reaches: ...andRemediation: push it first, .... Aftergit push, the same command exits 0 andfamily ok.v2, both pushed.member-to-not-a-commit ... is an annotated tag.commit <old> -> <commit12>. The real run pins the commit inpin.commitand in the gitlink alike, and the validator saysfamily ok.add --at <Cello's tag id> --dry-runpins the tagged commit at both shas.bumpsays "is an annotated tag of a tree" andaddsays "names a tree".No line needs real GitHub.
Mutation probes
Each behavioural hunk was reverted or broken on its own in a throwaway worktree (M1 to M10 and R1 at eeadc65, M11 to M13 at 8024f9c), and the tests were run:
test_bump_to_a_commit_recording_another_rows_id_is_refused_alikefailstest_a_duplicate_id_read_through_a_linked_manifest_is_put_backfailsmember-to-unknowntests failpins_the_commit_it_tagscases and the release-tag test fail (3)refused_by_namecases failtest_bump_dry_run_prints_the_move_and_a_real_bump_writes_exactly_thatadd's refusal written inline again (a refactor, no change in output)add's tag, tree and blob tests pass: 7 passedtest_both_runs_name_the_branch_for_the_tag_id_as_typedfails; 1 failed, 29 passedbump --to's help without the peeltest_cli_reference.pytests fail,test_the_committed_reference_is_what_the_generator_producesamong themMerge checks (8024f9c,
git merge-tree --write-tree, 2026-10-15T11:02Z)The merge is clean (rc=0) against each of these:
clone_just_pushed, so the macOSfailed to copy filerace of #440 cannot reach it;load_without_bytecodekeeps the doctor's and the Windows-path tests' loads of the family root's scripts from writing.pycinto the templates; the not-a-list doctor cases hold INVALID, exit 1; andGOOD_KEYSholds th #554 (2247dbf) and lane 4's bump-leg.py:--dry-rungives the real run's answer, so--toan annotated tag's own id is peeled to the commit it names in both runs, and a pin layout the rewrite refuses is refused by the dry run too (#534, #438) #561 (7d9bec9) have both landed since this branch was cut;fix/family-siblings-tracking-branchat 43d32eb;fix/family-members-case-variantsat 40eda84;fix/family-remove-gitmodules-missingat b1120c3;fix/link-source-chain-defaultsat 04c9d77;--dry-runasks the real run's own question about existing remotes, sofamily-remote-existsandscaffold-remote-existscome at the plan, and a missingghisgh-not-found, not a traceback (#537) #573 (fix/537-dry-run-asks-remotes) at 0c81423.On the tree merged with main 7d9bec9,
scripts/family.pyandscripts/bump-leg.pyparse, andrender-cli-reference.py --checksays[ok] docs/cli.md is what the generator produces. The review checked the same on the merges withfix/link-source-chain-defaultsand lane 2's #573.#561 landed first, so this PR fixes the cross-reference (lane 4's note on #541, issuecomment-6175160194). On main, #561 made two sentences false:
scripts/family.py:3991, "REFUSED, NOT PEELED, asbump-leg.pyrefuses the same--to", and the module docstring attests/test_family_bump_to_a_tag.py:17. This PR rewrites both to compare withfamily.py add --atonly. The comparisons withbump-leg.pythat remain still hold on main 7d9bec9: a tag whose commit is on no branch is stillbump-leg-commit-not-on-remotethere, in both runs, and thenothing to dosentence and thetrailerslines are unchanged.Main was not merged into this branch.
Left out, and why
members/<P>and never pushed. The object is present, sobumpproceeds.bump --to: make the checksaddmakes (a duplicate id, an annotated tag's own id), and say to push first for an unpushed commit #541 is about the commit that fails.bump-leg.pyrefuses this input asbump-leg-commit-local-only. Refusing it here needs a ruling on offline bumps, because today a bump whose fetch failed goes on from the objects the member already has.commit_in_mount. The twelfth is this PR's own peel-line test.add --atpins its id, butbump --torefuses the tag and its commit asmember-to-unknown.bump's fetch brings every branch and, by git's own rule, only the tags that point into the history those branches bring.add's bare clone brings every tag. Agit push origin v2without the branch makes one, and the refusal's push to a branch is what letsbumppin it.bump-leg.pyrefuses its twin the same way, asbump-leg-commit-not-on-remote. Fetching every tag would write refs the person's member did not have._checked_to_names_a_commit's docstring. It is the second checklist candidate.docs/release-notes/v1.0.0.mddescribes v1.0.0's behaviour (its lines 259-260, 461-462 and 487) and stays true of v1.0.0. The v1.1.0 notes should say what changed.Checklist candidates
family.py bump --toa commit only the member's mount holds pins it, wherebump-leg.pyrefusesbump-leg-commit-local-only.members/<P>and never pushed passesbump's object check, because the object is in the mount's store. It is pinned with exit 0, and the holder then cannot be bootstrapped anywhere else.bump-leg.pyasksfor-each-ref --containsagainstrefs/remotes/origin/and refuses the same input.c1.logandc2.log) and this PR's own peel-line test. Only 6 of the 12 make their commit throughcommit_in_mount.family.py bump --torefuses a tag whose commit is on no branch (member-to-unknown), whereadd --atpins the same id.git ls-remote --tagscheck, or a fetch of that one tag) is a change of its own, and so is any rule that brings it in line withadd.Closes #541
🤖 Generated with Claude Code
Summary by Sourcery
Make
family.py bump --tovalidate targets and member IDs consistently withadd --at, peel annotated tags to commits, and provide actionable errors for unavailable commits.New Features:
bump --toand pin the commit they reference, consistently across dry-run and real execution.member-to-unknownhandling that directs users to push commits unavailable from the member’s remote.bump --todetect duplicate member IDs before modifying the family, including IDs read through checked-out linked manifests.Bug Fixes:
bump --tofrom committing duplicate IDs or producing invalid gitlink and pin combinations.add --atandbump --to.Enhancements:
Documentation:
Tests: