Repository navigation
adopt-project.py, shape_materialize.py and tests: a named bad link left out of the copy and pin findings takes no other path's finding with it, and the docstrings and the materializer's refusal name the #979 exception and what helps it (#1089) - #1118
Conversation
…ings docstring (N3), shape_materialize.py's two mentions of a bad link at the copy (N4) and their test; N1 left, mutants and gate not yet run Work as it stands at a coordinator checkpoint, not a finished change. Built: three cases in tests/test_adopt_symlink_target_bytes.py (the case twin of the README copy, a file at the shape's own pin after a declared pin's link, a file at the Makefile copy after the README copy's link), each asserting the second finding is still made; they pass on head and on base 2a119f2. The _root_symlink_findings docstring names the #979 exception. scripts/shape_materialize.py (not pinned or copied: in no copy list, no byte check) says in copy_in_the_way's docstring and in materialize-copy-blocked's remediation that a link plan-empty-symlink or plan-bad-symlink-target names is that finding's alone; a test in tests/test_adopt_root_shape_paths.py pins both. Not run yet: M12-M14 against this head, the gate. N1 is left (see the PR body when it is written). Lane: openreposhape-1 (openRepoShape-1) Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…er takes any other path's finding with it, a case twin of the copy, a later pin file or a later copy, and the `_root_symlink_findings` docstring and shape_materialize.py name the #979 exception (#1089) On top of the checkpoint 702ce0f: the Makefile-copy case answers the link's own entry (shape/README.md) root, as plan proposes spec for it by its .md extension, so the link is kept in the root and the copy skip that M14 breaks is reached; M14 is killed now. A lost second finding fails with the findings listed, not an unpack error. Part of #1089: SHOULD-2, N3 and N4. N1 (a location tail on the link's own finding) is left. Lane: openreposhape-1 (openRepoShape-1) Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Reviewer's GuideImplementationClarify that named empty or bad-target symlinks are excluded from copy and pin findings and reported by their own finding, while links merely counted past the naming limit remain covered by the copy or pin finding.
Document the named-symlink exception in
UIUpdate the materializer’s refusal guidance to identify the finding that owns a named bad link and explain that the source must be fixed or the link removed and committed before re-planning, after which the plan answer can resolve a kept link.
TestsAdd regression cases proving that skipping a named link’s copy or pin finding does not suppress a later finding for a separate path kept in the root.
Pin the materializer’s named-link refusal guidance and docstring for both clone representations of a late-NUL symlink target, while checking that the refusal leaves the on-disk entry unchanged.
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
(lane openRepoShape-1, 2026-10-21T15:39:50Z) r1118, lane 1's independent reviewer (not the writer), reviewed #1118 at r1118 review of PR #1118, head
|
| Mutant | Result | Failing case |
|---|---|---|
| M12 | 1 failed, 132 passed | [a-case-twin-of-the-readme-copy] |
| M13 | 1 failed, 132 passed | [a-file-at-the-shape-pin-after-a-declared-pins-link] |
| M14 | 1 failed, 132 passed | [a-file-at-the-makefile-copy-after-the-readme-copys-link] |
r1070's log shows each of these lived at 130 passed. They pin behaviour a user depends on: all findings in one check round, and none deferred to the next.
The body says case 3's link must be answered root, and it is right:
- answered
spec, M14 still gives 2 findings, so it survives; - answered
root, M14 gives 1 finding, so it is killed.
N1's rationale: true, and leaving N1 is sound
assert "where the shape writes" not in findingis attests/test_adopt_symlink_target_bytes.py:672. A tail like_at_the_manifest's ("where the shape writes its manifest") would break it.- The guarded read the body names is real: the manifest-only
_links_at_the_manifestcall atadopt-project.py:9106-9110, and theat_the_manifestparameters of both finding functions. - Decision 1's own premise is measured: once the target is fixed, the next
checknamesplan-root-blocks-shape-copy(P3), and itsdrophelps (P3b). - "Would break the assertion" restates "would reverse decision 1". The real reason is decision 1, and it holds.
Mutants: 12 of 14 killed
- r1070's M12, M13, M14: 3 of 3 killed.
- Mine, 9 of 11 killed:
- B2 (the pin skip gives
return []): killed, only by case 2. - B3 (the copy skip asks the copy's path): 6 failed, case 1 among them.
- B4 (the pin skip asks
rel): 4 failed. - R1 to R6 (the remediation and docstring prose): each killed by the N4 test.
- B2 (the pin skip gives
- Survivors:
- B1 (the copy skip asks
any(...)over rows): equivalent._kept_theregives an "at" group exactly one row. - R7 (the N3 docstring paragraph removed): a docstring, and no test reads it (280 passed).
- B1 (the copy skip asks
- Restored: sha256 of
x/adopt-project.pyis60dd927b...and ofx/scripts/shape_materialize.pyiscb1767aa..., both equal toc60066cb's.git statusinxis clean.
Base vs head
| Tree | The four new rows | Whole test_adopt_symlink_target_bytes.py |
|---|---|---|
Base 6da757cb, with head's two test files |
1 failed (the N4 test), 3 passed | not run |
Head c60066cb |
4 passed | 133 passed |
Merge with main 823624d9: PARTIAL
The scratch merge commit is 539da545, tree bc1c501c. It is clean, and main changed none of the 4 PR files since 6da757cb. The PR's change lines are identical before and after its own merge.
| Call | Result |
|---|---|
test_adopt_symlink_target_bytes.py |
133 passed |
test_adopt_root_shape_paths.py |
121 passed |
test_shape_doctor.py shard 00 |
112 passed |
Unfinished, stopped by PID at the checkpoint:
test_shape_doctor.pyshards 01, 02 and 03;test_scaffold_leg_path_collisions.py;- readers_a:
test_update_shape_add,test_family_makefile_siblings,test_neutral_pin_entry_one_spelling; - readers_b:
test_update_shape_unreadable,test_adopt_leg_path_collisions; test_repo_hygiene,test_agents_md_codes,test_cli_reference;- extras I added:
test_adopt_root_symlinks,test_adopt_printed_sentences,test_family_init_values,test_git_output_decoding.
Body claims
| Claim | Result |
|---|---|
| No closing keyword; "Part of #1089" | True. The scan found none, and closingIssuesReferences is [] |
| M12-M14 lived at 130 passed | True (r1070's log) |
| On main 3 pass, 1 fails; head 4 passed | True (on 6da757cb) |
| Mutants each killed by their own case | True |
Case 3 answered spec: M14 survived |
True |
| Gate total 1765 passed, 22 skipped | The arithmetic is right. Re-measured so far: 133, 121 and 112 |
| 4 doctor shards of 112 | True: 448 ids |
shape_materialize.py is in no copy list |
True |
Main changed adopt-project.py (#1090) and shape_materialize.py (#1090, #1087), and neither test file |
True |
| N1's assertion would break | True |
Only a caller that skips check reaches the N4 text |
True (execute refuses first) |
| The ruling time of 2026-10-21 10:32:04Z | Not verified |
| Docs say nothing now untrue | True. Nothing in README.md, AGENTS.md, docs/ or templates/ mentions materialize-copy-blocked |
Nothing was written to GitHub, and nothing was committed or pushed. The worktree /workspace/projects/openRepoShape-worktrees/l1-r1118 was not touched. All logs and probe scripts are under /workspace/projects/openRepoShape-worktrees/_lane1-scratch/r1118/ (logs/, probe*.py, mutants.py, gate.sh).
Lane: openreposhape-1 (openRepoShape-1)
…kip-tests Main at 4ed7c7b (#1091, #1101, #1102). tests/test_adopt_root_shape_paths.py conflicted where both sides added a test after test_the_materializer_never_writes_a_copy_over_what_is_there: main's test_the_materializer_stops_at_a_link_at_the_copy (#904) and this branch's test_the_materializer_names_a_bad_link_at_the_copy_by_its_own_finding (#1089, N4). Both are kept whole, main's first. adopt-project.py merged by itself. On the merge, tests/test_adopt_root_shape_paths.py gave 122 passed and tests/test_adopt_symlink_target_bytes.py 133 passed. Part of #1089 Lane: openreposhape-1 (openRepoShape-1) Co-Authored-By: Claude Opus 5.5 <[email protected]>
… a bad link at the copy is given a target of its own, or removed, and committed BEFORE `plan` is re-run, and that, kept there with a target of its own, it is then `plan-root-blocks-shape-copy`'s, whose answer is the one that helps; it and `copy_in_the_way` say "names one by one"; the N4 test holds a link (#1089) SHOULD-1 of r1118: the remediation read as if a new target were enough, and left out "commit". Measured: a link at `shape/README.md` with a target of its own is still refused by the materializer; once committed and re-planned with `shape/` kept in the root, `check` names it as `plan-root-blocks-shape-copy`; with `shape/` dropped, sent to a leg, or left to `plan`'s own `spec`, `plan ok`. A fix in the index, not committed, is still `plan-bad-symlink-target`; a fix committed against the old plan is `plan-stale`. NIT-1: "names one by one", as N3 says, in the remediation and in `copy_in_the_way`'s docstring: a 21st empty link at the copy, only counted, is still `plan-root-blocks-shape-copy`'s. NIT-2: the N4 test now sets up the link at `shape/README.md` in both forms a clone holds a late-NUL target `spec\0.md` in: a link to `spec` where git makes links (under `needs_disk_symlinks`), and a file of the blob's 8 bytes where `core.symlinks` is false. It asserts the refusal, that the link or file is as it was, and nothing written where it leads, and pins the remediation from "reports a plan" to "Then run `execute` again" as one run of words. Part of #1089 Lane: openreposhape-1 (openRepoShape-1) Co-Authored-By: Claude Opus 5.5 <[email protected]>
…t is one (#1089) NIT-3 of r1118, in tests/test_adopt_symlink_target_bytes.py: "each case is a mutant of them" becomes "each case kills a mutant of them". The paragraph is reflowed; no other word changed. Part of #1089 Lane: openreposhape-1 (openRepoShape-1) Co-Authored-By: Claude Opus 5.5 <[email protected]>
_root_symlink_findings docstring and the materializer name the #979 exception (#1089)|
(lane openRepoShape-1, 2026-10-21T21:24:32Z) r1118b, lane 1's independent re-check of the fix round at
The full re-checkVerdict: READYI found no MUST, SHOULD or NIT. Every check below passed, and the merge with main I wrote nothing to GitHub, committed and pushed nothing, and ran no Checks1. Merge with main
I also ran the rest of the body's table, on a second checkout of the same merge:
2. The conflict resolution: PASS.
3. SHOULD-1: PASS.
4. NIT-1, NIT-2, NIT-3: PASS.
5. Mutants: PASS, 19 of 19 killed on the merged tree. I ran f1118's
6. The body: PASS.
Findings
Files
Lane: openreposhape-1 (openRepoShape-1) |
… case 1's twin before it (#1138) `a-case-twin-after-the-readme-copys-link` keeps `shape/readme.md` beside a named link at `shape/README.md`. At #1118's head 2307036 it fails "the second finding is lost": `_KeptTree` kept the first row at a place, the link, so the twin was never asked. At dfacd5d it passes. Lane: openreposhape-1 (openRepoShape-1) Co-Authored-By: Claude Opus 5.5 <[email protected]>
…link git makes at the copy, above the copy, at the manifest and at a pin's file (#1138) One row per caller of `_KeptTree`'s first row (lane 1's scope ruling): the copy's twin beside a link git makes, before and after it; a link twin at the copy, named once by the copy's finding; a file after a named link, or a second file, above the copy and above `scripts/`; a file after a submodule at the copy; the manifest's twins, a named link after a file twin keeping its tail; a file after a named link at a pin's file, two file twins there, and a file after a submodule there, whose copy under `shape/` is not asked again. At #1118's head 2307036, 16 of the 20 rows of these tests fail, each for the twin it does not name; the 4 that pass are #1118's three cases and the lone link twin. At dfacd5d all 20 pass. Lane: openreposhape-1 (openRepoShape-1) Co-Authored-By: Claude Opus 5.5 <[email protected]>
…s message spells a path byte that is not UTF-8 as `_shown` does, an escape, and no longer says it names it with a `?` in its place, which #900 replaced (#1018) (#1104) `env_commit`'s docstring in `scripts/shape_materialize.py` says what the split commit's message does with a `root` or `drop` path that holds a byte that is not UTF-8, as the code does since #900. It said the message names such a path "with a `?` in place of that byte, a path that does not exist". That was true before #900, and it is not true now. A reader of the docstring is told about a `caf?.md` the tool no longer writes. Found by lane 1's writer on #900 and filed as #1018. Lane 5 took it outside v1.2.0, under Brett Heap's ruling of 2026-10-21T10:32:04Z. Measured on main `2a119f281` and again on `16f9a0e81` (main after #1087), with a small script that calls: `adopt-project.py`'s own `_split_message` and `_shown`, then `env_commit` and a real `git commit`, read back with `cat -A`. - The issue's claim held: the docstring (about line 2103 when filed, line 2268 on `2a119f281`, line 2349 on this branch) still said the message names the byte with a `?`. - The code does not. `_shown("caf\udce9.md")` is `` `caf\udce9.md` ``, and the split message for a `root` and a `drop` entry named that holds no lone surrogate. Through `env_commit` and `git cat-file commit HEAD`, `cat -A`: ``` DROPPED (in no leg and no longer here):$ `caf\udce9.md`$ STAYS IN THE ASSEMBLY ROOT:$ README.md$ `caf\udce9.md`$ ``` - What stays true of `env_commit` itself: a message that holds the lone surrogate, handed to it directly, is still written as `?`. `cat -A` reads `Name: caf?.md$`. So the `errors="replace"` paragraph is kept, and what changes is who it describes. - #1087 (main `16f9a0e81`) changed `scripts/shape_materialize.py` by 128 lines, none of them in `env_commit`, `COMMIT_COMMAND` or the message, and changed nothing in `adopt-project.py` (0 diff lines). The rebase onto it was clean and the docstring needed no other change. One file, `env_commit`'s docstring, in two paragraphs: the `errors="replace"` paragraph (round 1, 11 lines added and 7 removed) and the sentence above it (round 2, below; 3 added and 2 removed). Together 14 added and 9 removed against main `6da757cb`. The `errors="replace"` paragraph now says: - encoding, a character UTF-8 cannot carry is written as `?`, and nothing raises after both legs are pushed, as before; - `adopt-project.py` refuses a lone surrogate in a path it extracts (`entry_path_problem`), and a `root` or `drop` entry that holds one is listed in the split message but never raw: the message names each path as `plan`'s report does (`_shown`, #900), so the byte 0xE9 reads as an escape with no surrogate in it, `` `caf\\udce9.md` ``, the path the source holds; - written raw it would be a `?`, `caf?.md`, a path that does not exist, which is what `env_commit` still writes for a lone surrogate it is handed. The backslash is doubled in the source, as the neighbouring docstrings write `\\udcc3`. A single `\u` in a non-raw docstring would be an escape that makes a lone surrogate. Measured: the docstring holds no character from U+D800 to U+DFFF and holds the six characters `\udce9`. The longest docstring line is 78 characters. **The code is unchanged.** A script compares the AST of `scripts/shape_materialize.py` with every docstring blanked: the branch's file is identical to `origin/main`'s after the rebase onto `16f9a0e81` (round 1), and the merge of this head into `origin/main` `6da757cb` is identical to `6da757cb`'s file (round 2). **No pin moves.** `scripts/shape_materialize.py` is not a pinned copy. `COPIED_VERBATIM`, `COPIED_FROM_SHAPE`, `FAMILY_COPIED_VERBATIM` and `FAMILY_COPIED_FROM_SHAPE` do not list it, and `templates/assembly-root/scripts/validate-pins.py` says of it "which no project carries". So no `upstream-changed` row, no digest, no assembly copy and no `tests/test_pinned_copy_text.py` entry changes. **No other text pins these words.** Searched in `tests/`, `README.md`, `docs/`, `docs/handbook.html`, `AGENTS.md` and `templates/`: no test reads `env_commit`'s docstring (`__doc__`, `getdoc`), and none of them holds "in place of that byte" or "a path that does not exist" for this. The other places that name the `?` are about this function's behaviour or about history, and are still true: `_split_message`'s docstring says `caf\\udce9.md` "was `caf?.md`" (before #900), `_refused_by_policy` already says the message "lists it as `_shown` does (#900)", and `tests/test_adopt_spelled_names.py` quotes the message as it was on `c7a3ff16`. The `?` in `argv_text`, `trailer_line` and the commit-trailer text is about a `--trailer`, not the split message. No rows and no mutants: the change is a docstring, the code is the same AST, and no test pins the docstring. So there is no row to fail on main and nothing to mutate. All with `$Q/v110/run9.sh`, `[email protected]`, `GIT_SSH_COMMAND=false`, `GIT_CONFIG_GLOBAL=/dev/null`, the stub `gh`, a fake token, git 2.43.0 (`/usr/bin/git`). Two shards, run before the rebase, at the `2a119f281` base with this one-file change in the tree. Together they are every `tests/*.py` that names `shape_materialize` or `env_commit` (86 files, including `tests/test_adopt_spelled_names.py` and `tests/test_adopt_entry_paths.py`, which run `env_commit` and the #900 message) and `tests/test_agents_md_codes.py`: | run | files | result | |---|---|---| | shard A | 43 | 2873 passed, 4 skipped in 1707.51s, rc=0 | | shard B | 44 | 4611 passed, 31 skipped in 2462.01s, rc=0 | After the rebase onto `16f9a0e81`, on the committed head `e32b2703d733f6c60c1b2cba2d62d164d93d7b9a` (`dirty=0`): the trio, `tests/test_repo_hygiene.py`, `tests/test_agents_md_codes.py` and `tests/test_cli_reference.py`, **170 passed in 55.67s**, rc=0. The docstring-only change needed no new shards: the shards' counts are runs at the `2a119f281` base, and #1087 did not touch `env_commit`. Round 2, on the committed head `de89aa81b1533e32f1007f991aeae05cd915b36d` (`dirty=0`): the same trio, **170 passed in 61.77s**, rc=0. The round 2 commit is one docstring sentence, so it needed no new shards either. git 2.47.1: no run. The change adds no test file of its own, so there is none to run on it. `git merge-tree --write-tree HEAD <other>` with HEAD at `de89aa81b1533e32f1007f991aeae05cd915b36d`, after a re-fetch of `origin main` with `-c gc.auto=0 -c maintenance.auto=false` (round 2, about 14:03Z on 2026-10-21): | against | result | |---|---| | `origin/main` `6da757cbe9a4eb66d60c34f38dcc2b332d175e8b` | clean, rc 0, tree `15c11b6c959fc4c7540105d5d62e3f961c8e27fd` | | #1105 `fix/1048-makefile-follow-up-gnu-read-order` `5a4de7f763b5a3c32adce9614a3a539508416eb4`, an open PR that touches `scripts/shape_materialize.py` | clean, rc 0, tree `db05aead67052643942e35a9689d9dd4a0873fda` | | #1118 `fix/1089-named-link-skip-tests` `c60066cbeec18b8b6c926e254ed4bee6b9a486c2`, the other open PR that touches `scripts/shape_materialize.py` | clean, rc 0, tree `a40df3b63c32c2a3d8f4c40587b094940c8d6567` | Read with `gh pr list --state open --json number,headRefName,headRefOid,files`: 16 open PRs, three of them (this one, #1105 and #1118) touch `scripts/shape_materialize.py`, the only file this change touches. The other 13 (#1120, #1119, #1117, #1111, #1109, #1107, #1106, #1102, #1101, #1098, #1097, #1091, #1088) touch no file this change touches. The same command with HEAD at the reviewed head `e32b2703` gives rv1104's trees: `de31d857` against `6da757cb` and `195ffe19` against #1105. The round 1 merge against #1090 is moot: #1090 has landed in `6da757cb`. Held as a draft until the v1.2.0 tag; it is now on the v1.2.1 milestone. - **NIT 1, `scripts/shape_materialize.py` lines 2340-2343, a line round 1 did not change.** The paragraph above the reworded one said the adoption's split message "names each entry path as the source spells it". Since #900 that is true of a printable path alone: `_split_message` lists any other through `_shown`, as the escape the next paragraph describes. It now says "as the source spells it (a printable one; see below)". One new commit on top of `e32b2703`, `de89aa81b1533e32f1007f991aeae05cd915b36d`, 3 lines added and 2 removed, docstring only, pushed as a fast-forward (no rebase, the PR is open). - Measured: the AST with docstrings blanked is identical to `e32b2703`'s and, merged into `6da757cb`, to `6da757cb`'s. The docstring holds no lone surrogate, still holds the six characters `\udce9`, and its longest line is 78 characters. - Searched `tests/`, `README.md`, `docs/`, the handbook mirror, `AGENTS.md`, `templates/` and the scripts for "names each entry path", "as the source spells" and the new words: only `tests/test_adopt_entry_paths.py` line 233 matches, a test's docstring about `execute` handing each path on as the source spells it, which is another sentence and pins nothing here. - **NIT 2, this body.** It named main as `16f9a0e81` and #1090 as the one open PR that touches the file. #1090 has landed. Main is `6da757cb`, and the merge-trees above are redone against it, against #1105 and against #1118, a draft that opened since and also touches the file. Review: rv1104-1107, lane 5's independent opus reviewer, which wrote none of #1104: READY at `de89aa81`, H0 of this landing (issuecomment-6318111413), with no finding; NIT 1 and NIT 2 of the round before are fixed. CI (Brett Heap's ruling 27 and his fast-refresh ruling of 2026-10-15T22:48:35Z): H0 de89aa8 passed tests, tests-git-bash and SonarCloud; the head 92285d4 is a clean update-branch merge of main b66d8f0, with tests-git-bash and SonarCloud green; and the local gate passed on its predicted squash tree 6bd2128 over main b66d8f0: the repo_hygiene, agents_md_codes, cli_reference sets, 171 passed. Landed on Brett Heap's word of 2026-10-23T13:10:26Z, relayed to every lane by lane 3 (#473 issuecomment-6365697123): "merge v1.2.1 PRs once reviewed and green". Closes #1018 Lane: openreposhape-5 (openRepoShape-5) Co-Authored-By: Claude Opus 5.5 <[email protected]>
…eeps a `GNUmakefile` or a `makefile`, which GNU make reads first, the Makefile collision follow-up no longer says the shape's make targets arrive with the merge, and the pinned file says `make` reads the first of the three and the block reaches it only once that file holds it or includes a Makefile that does (#1048) (#1105) Two sentences said a kept `Makefile` is what holds the shape's block back. GNU make reads the first of `GNUmakefile`, `makefile` and `Makefile` it finds, and only that one, so where the root also keeps `GNUmakefile` or `makefile`, `make` reads that file, and reaches the merged `Makefile` only where that file includes it. **Measured** (a real `execute`, then `make -n` in the clone, for each kept name; r1046's NIT-B, repeated; the include rows are RV1105's SHOULD-1): | the source keeps | file `make` reads | after `cat shape/Makefile >> Makefile`, `make -n bootstrap` | |---|---|---| | `Makefile` | `Makefile` | exit 0 | | `Makefile` + `makefile` | `makefile` | exit 2, "No rule to make target 'bootstrap'" | | `Makefile` + `GNUmakefile` | `GNUmakefile` | exit 2, same | | all three | `GNUmakefile` | exit 2, same | | `Makefile` + a `makefile` or `GNUmakefile` that ends in `include Makefile` | that file | exit 0, runs `python3 scripts/bootstrap.py` (exit 2 before the merge) | | `makefile` or `GNUmakefile` alone | that file | no merge to make: the shape's `Makefile` is the root's, and `make contracts-dir` has no rule until that file holds the block or includes `Makefile` | **What changed** - `scripts/shape_materialize.py`, `collision_follow_up`: takes `reads_first`, the file GNU make reads before the shape's `Makefile`. Where it is set, the Makefile's follow-up says GNU make reads that file, the first of the three it finds, and that the shape's make targets reach `make` there only once that file has them, or includes a Makefile that does; until then `python3 scripts/bootstrap.py` is what the shape's `make bootstrap` runs. Where `scripts/bootstrap.py` went aside too, it says neither command runs the shape's bootstrap until the script is merged, and then `python3 scripts/bootstrap.py` runs it. Where the root keeps only the source's `Makefile`, the sentence is what it was, byte for byte. `GNU_MAKE_READS` joins `SHAPE_MAKE_TARGETS`. - `adopt-project.py`, `_predict_collisions`: reads the file from the plan's root paths as `_makefile_follow_up` does, so the `CONTRACTS_DIR` line and the collision line of one plan name the same file. - `templates/assembly-root/AGENTS-shape.md`: says `make contracts-dir` prints the block wherever `make` reads the shape's Makefile, names the three files in the order the code reads them, and says that where a `GNUmakefile` or `makefile` is kept, beside a `Makefile` or instead of one, `make` reads it, and not the shape's Makefile unless that file includes it. It is one verbatim copy: the digest in every project's `contracts/shape-pin.yaml` is rendered from its bytes at adopt and scaffold time, and no digest or `tree_sha256` of it is stored in this repository, so there is no pin to move here; each project re-pins through `update-shape.py` as for any template change. - `tests/test_pinned_copy_text.py`: `ADOPTED_SENTENCES` holds the new text. - `tests/test_adopt_collision_make_reads.py` (new, 31 rows): the follow-up per kept set, the two lines of one plan naming one file, no collision line where no `Makefile` is kept, the two name tuples equal, the pinned file naming every file the code reads first, the script-aside tail where `make` reads another file, and, in a real adoption's clone, `make -n` held to both sentences for each kept name and for a kept `GNUmakefile` or `makefile` that ends in `include Makefile`. **Fix round 1** (RV1105's review, `b28f40de0` on top of `5a4de7f76`) - **SHOULD-1:** the follow-up said the targets reach `make` "only once `X` holds them, or includes a Makefile that does, and not with that merge alone". The last clause is untrue where `X` already ends in `include Makefile`: the merge alone brings them. The clause is gone, and the docstring paragraph, the `SHAPE_MAKE_TARGETS` comment and the `ADOPTED_SENTENCES` comment now say the merge alone brings the targets only where that file includes `Makefile`. - **NIT-1 (and RV1121's NIT-3):** the follow-up now uses the words of #1121's NOTE: "has them", and "is what the shape's `make bootstrap` runs". `_next_steps` is not touched. - **NIT-2:** the script-aside tail, where `reads_first` is set, said "neither `make bootstrap` nor `python3 scripts/bootstrap.py` runs the shape's bootstrap before both merges are made", which reads as if `make bootstrap` runs it after them. It now says neither runs it until the script is merged, and then `python3 scripts/bootstrap.py` runs it. I did not keep "before both merges": where `X` is given the targets itself, as the sentence before invites, `make bootstrap` runs the shape's bootstrap once the script is merged, with no `Makefile` merge at all. - **NIT-3:** the template's "and never the shape's Makefile" is now ", and not the shape's Makefile unless that file includes it". `ADOPTED_SENTENCES` changes with it. No other copy or regex in `tests/` pins that sentence (`git grep` for "never the shape" and "reads the first of them"). - **NIT-4:** the `collision_follow_up` docstring no longer says `execute` reports through it. It says `plan` predicts the follow-ups and stores them in `follow_ups:`, the split commit carries those, `execute` names its collisions by path only (its `beside` lines and the "WRITTEN BESIDE" list), and `Materialized.follow_ups()` has no caller. The method stays. - NITs 5 to 8 are left to the lane. **Rows of this round:** `tests/test_adopt_collision_make_reads.py` and `tests/test_pinned_copy_text.py`, 118 rows. With this round's test files on `5a4de7f76`'s code, 17 fail and 101 pass; on `b28f40de0` all 118 pass. The 17 fail for the right reason: | rows | why they fail on `5a4de7f76` | |---|---| | 4 collision rows (`Makefile+makefile`, `Makefile+GNUmakefile`, all three, `Makefile+GNUmakefile+scripts`) | the line holds "not with that merge alone" | | 2 new script-tail rows (`GNUmakefile`, `makefile`) | the line holds "before both merges are made" | | 2 new include rows in a real clone (`GNUmakefile`, `makefile`) | `make -n bootstrap` exits 2 before the merge and 0 after it alone (both asserted first, and passing), then the split message holds "not with that merge alone" | | 7 clone rows, the pinned-file row and `test_a_scaffolded_root_is_told_its_makefile_exports_none` | the pinned file still says "and never the shape's Makefile" | **Mutants of this round**, each run against the 118 rows on `b28f40de0`, each file restored and its sha256 checked: | id | mutant | rows failing | result | |---|---|---|---| | MA | ", and not with that merge alone" put back | 6 | killed | | MB | the script-aside tail put back ("before both merges are made") | 3 | killed | | MC | the template's "and never the shape's Makefile" put back | 9 | killed | | MD1 | include rows: `not in message` inverted to `in message` | 2 | killed | | MD2 | include rows: after the merge, `returncode == 0` inverted | 2 | killed | | ME | "holds them" put back | 6 | killed | | MF | "the shape's `bootstrap` target runs" put back | 5 | killed | **Gate** on `b28f40de0`: | files | passed | failed | skipped | |---|---|---|---| | `test_adopt_collision_make_reads`, `test_pinned_copy_text`, `test_adopt_make_reads_first`, `test_adopt_contracts_dir`, `test_adopt_printed_sentences`, `test_adopt_e2e`, `test_repo_hygiene`, `test_scaffold_leg_path_collisions` | 470 | 0 | 0 | | `test_shape_doctor`, 8 shards (62 + 56 + 54 + 56 + 60 + 57 + 58 + 45 collected) | 445 | 0 | 3 (PowerShell rows, Windows host only) | | **total** | **915** | **0** | **3** | **Merge-tree:** `b28f40de0` against main `4ed7c7bf5` is clean, and so is it against each open PR that touches these files: #1104, #1106, #1118, #1119, #1120, #1121 (`1c5173758`), #1122, #1123 and #1125. **Round 0** (`5a4de7f76`, main `6da757cbe` merged in): on main's code (plus the constant alone), 12 of the then 27 rows failed and 15 passed; the 30 test files that run the changed code or read the template gave 2109 passed, 0 failed and 4 skipped (3 PowerShell rows in `test_shape_doctor.py`, 1 MedxEHR row in `test_adopt_plan.py` that needs a clone `SHAPE_MEDXEHR_CLONE` names); nine mutants each failed 1 to 11 of the then 114 rows. **Not here** - The third box of #1048, the `_next_steps` NOTE in `adopt-project.py`, is covered by the change #1047 makes to it: see #1047 and #1121. - `templates/assembly-root/AGENTS-shape.md` line 19 and the five-commands table say `make bootstrap` without this caveat. They say nothing about a kept file, so they are outside #1048's two sentences. Closes #1048 Lane: openreposhape-4 (openRepoShape-4) Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
|
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 6 days and 3 hours by commenting |
S = 9ec0dc7, #1118's squash on main. The branch's side was taken for #1118's own files (git diff --name-only S^ S): adopt-project.py, scripts/shape_materialize.py, tests/test_adopt_root_shape_paths.py and tests/test_adopt_symlink_target_bytes.py. The merged tree is 9ce681b, the same as the first merge's, since S's tree equals #1118's final head f4eef87's tree (9737190). Lane: openreposhape-1 (openRepoShape-1) Co-Authored-By: Claude Opus 5.5 <[email protected]>
…`makefile-directory` row in `tests/test_adopt_make_reads_first.py` expects the line that says GNU make stops at a kept `makefile/`, and still guards `twins` Lane 1's #1123 (#1061) landed after this branch merged main 46fe6ac, and the merge with it is clean by text. By meaning it is not: #1123 adds a row, `test_a_name_only_a_disk_that_ignores_case_takes_for_makefile[makefile-directory]`, that expects the `CONTRACTS_DIR` line a kept `makefile` FILE gets for a kept `makefile/` DIRECTORY ("only once `makefile` does"). #1123's own message says that line is not true for a directory, since GNU make 4.3 stops there with `makefile: Is a directory.`, and that the row works as a crash guard for `twins` in `_makefile_follow_up`. This branch changes exactly that line (#1132, RV1121's NIT-1): a kept directory is one GNU make stops at. On the predicted merge the row was the one failure in 254 rows. The row now expects `SHAPES + written_as("makefile")`, as #1123 wrote it, which is what guards `twins`, followed by this branch's directory clause, through a new `stops_at` helper beside `reads`. The comment above `ANSWERED` and the row's docstring say so. Nothing else changes, and #1118's merge (9ec0dc7, also in this main) is clean by text and by its rows. Lane: openreposhape-5 (openRepoShape-5) Co-Authored-By: Claude Opus 5.5 <[email protected]>
…says a full name that is no pattern takes the one ref git completes it to, which may be a branch, where it said any other source names no branch (#1238) (#1244) #1238 is a wording NIT that the review of #1235 (#1230) found in the code: NIT 4 of rv1235's first review, and NIT 2 of its re-check. The docstring of `gives_a_branch_another_name` in `scripts/shape_materialize.py` ended "ANY OTHER SOURCE NAMES NO BRANCH", but git completes a source that is a full name and no pattern, and completes `refs/h` to the branch `refs/heads/refs/h` where the remote has one. The sentence now says what git does with such a source, as an open list ("such as"), and where the clash is. A reader of the docstring is no longer told that a source outside `refs/heads/` is never a branch. Wording only, in one docstring of one file: 9 lines added, 3 removed. No code, no row, no other file. The file's syntax tree with every docstring dropped is the same as main's. The sentence is at `scripts/shape_materialize.py:1720-1723`, the end of the docstring of `gives_a_branch_another_name` (line 1671): ``` 1720: BRANCH REACHES). A shorter start, such as `refs/*` or `*`, can name a 1721: tag, and that clause has left it out first. ANY OTHER SOURCE NAMES NO 1722: BRANCH, though a refspec from one can still put a ref on a branch's 1723: name: `origin_fetch_refspecs` says where (WHAT CAN STILL CLASH). ``` It is true of a source in another namespace such as `refs/pull/7/head`. It is not true of every other source. A source that is a full name and no pattern takes the one ref git completes the name to on the remote: for `refs/h`, `refs/h` itself, the branch `refs/heads/refs/h`, the tag `refs/tags/refs/h`, `refs/refs/h` or `refs/remotes/refs/h`, and where several exist git takes the exact ref over a tag over a branch. Where the remote has the branch, the source is a branch. The code is right: `gives_a_branch_another_name("refs/h", ...)` is False, because the source has no `*` and does not start with `refs/heads/`, so the refspec is carried. What fails afterwards is the clash the docstring's own next clause names. Only the words were untrue. Measured on this branch's base, with git 2.43.0 (`/usr/bin/git`) and git 2.47.1, which gave the same answers on every row. Local bare remotes, `GIT_CONFIG_GLOBAL=/dev/null`, `GIT_CONFIG_NOSYSTEM=1`, `GIT_SSH_COMMAND=false`. rv1235's probe scripts were run again here (copied unchanged, new output folders), and their logs are identical to rv1235's. The fetch was `+refs/heads/*:refs/remotes/origin/*` plus the refspec of the row, and the remote had `main` and `hy`: ``` the remote has refspec result branch refs/heads/refs/h +refs/h:refs/remotes/origin/hy 128 Cannot fetch both refs/heads/hy and refs/heads/refs/h to refs/remotes/origin/hy tag refs/tags/refs/h +refs/h:refs/remotes/origin/hy 128 Cannot fetch both refs/heads/hy and refs/tags/refs/h to refs/remotes/origin/hy exact ref refs/h (update-ref) +refs/h:refs/remotes/origin/hy 128 Cannot fetch both refs/heads/hy and refs/h to refs/remotes/origin/hy refs/refs/h or refs/remotes/refs/h +refs/h:refs/remotes/origin/hy 128, the same message naming that ref each of those five refs, alone onto origin/not-a-branch 0, holds that ref's commit branch refs/heads/refs/h onto origin/refs/h 0 (the branch's own name: no clash) refs/pull/7/head onto origin/main 128 Cannot fetch both refs/heads/main and refs/pull/7/head to refs/remotes/origin/main branch refs/heads/main onto origin/main 0 ``` So a name with no `*` can be a branch that its spelling does not show, and the clash is a ref that is not that branch put on a branch's name, which is what the second half of the sentence has to say. "ANY OTHER" was wrong in a second way: a carried refspec from a source that IS the branch does not clash onto that branch's own name. The docstring's last sentence, now lines 1721-1729: ``` tag, and that clause has left it out first. ANY OTHER SOURCE TAKES NO BRANCH BY A PATTERN, and a full name that is no pattern, such as `refs/h`, takes the one ref git completes it to on the remote: that ref itself, or one such as the branch `refs/heads/refs/h` or the tag `refs/tags/refs/h` (measured, git 2.43 and 2.47.1). Such a name can stand for a branch its spelling does not show, so it is not left out here. A refspec from any such source can still put a ref on a branch's name, if the ref is not that branch itself: `origin_fetch_refspecs` says where (WHAT CAN STILL CLASH). ``` - **"Takes no branch by a pattern"** holds for every source this sentence covers. Git matches a pattern against each ref's whole name, and a ref under `refs/heads/` starts with the part before the `*` only where that part is a start of `refs/heads/` or is under it, the two cases the function reads before this sentence. - **The list is open** ("one such as"): it names the exact ref, the branch and the tag, and the rows above show two more completions (`refs/refs/h`, `refs/remotes/refs/h`), so no reader takes the three as all. - **"So it is not left out here"** is what the code does: `gives_a_branch_another_name` is False for `refs/h` onto `origin/hy`, onto `origin/refs/h`, for `refs/pull/7/head` onto `origin/main`, and for the pattern `refs/pull/*/head`, and `origin_fetch_refspecs(["+refs/h:refs/remotes/origin/hy"])` returns it carried. It is True for `refs/heads/main` onto `origin/hy`, as before. - **"If the ref is not that branch itself"** is the condition the rows show: the clash is two different refs on one name, a branch's. The checks the issue's Verify lists: - **The diff is only that docstring.** The diff has one hunk, inside the docstring, which spans lines 1672-1724 on main and 1672-1730 here. The file's tree with every docstring dropped (module, class and function: 168 each side) is equal on main (`50869f384`) and at this head under `python3 -I`, `ast.dump`: 380120 characters of dump on both sides. A control that renames `gives_a_branch_another_name` on the head side gives 380121 and DIFFERENT, and the same trees with the docstrings kept differ (520956 against 521366), so the check can fail. Python 3.12.3. The check compares two dumps made by one interpreter and asserts no text that depends on the version. - **`git grep -n 'ANY OTHER SOURCE NAMES NO$' -- scripts/`** finds nothing at this head. On main it finds `shape_materialize.py:1721`. With any case and no line end, `git grep -n -i 'other source names no'` also finds nothing here, and nothing but that line on main. - **No added line is over 79 columns or holds a non-ASCII character.** 9 lines are added, the longest is 75 columns, and none has a tab or trailing space. The file's own width is unchanged: 20 lines over 79 columns (longest 118) and 90 lines with a non-ASCII character, as on main, none of them mine. - **No test, `README.md`, `docs/` page or `AGENTS.md` line pins the sentence.** The issue's grep holds at this head. The issue asks whether `shape_materialize.py:1874` (now 1880, in the docstring of `origin_fetch_refspecs`) and `bump-leg.py:1165` (in `_leg_fetch_refspecs`) want the same change. Both paragraphs were read, and both are left as they are: ``` shape_materialize.py:1880: WHAT CAN STILL CLASH is a refspec carried whose source names no branch, bump-leg.py:1165: whose source names no branch, onto a name a branch of the remote has ``` 1. **They define a shape by its examples and say nothing about what git completes a name to.** Each goes on at once to the pull requests (`origin/pr/` where a branch `pr/7` is, and `+refs/pull/7/head:refs/remotes/origin/main` beside a branch `main`), and neither names `refs/h`. They were not the sentence that told a reader a source is never a branch. 2. **"Names no branch" is spelling there, as it is in the sentence the function's docstring opens with.** "A SOURCE UNDER `refs/heads/` NAMES BRANCHES" is true by spelling too: `can_name_a_tag`'s docstring measures that `+refs/heads/zz` took the tag `refs/tags/refs/heads/zz` where the remote had no branch `zz`. The sentence changed here now says outright that the spelling of a name with no `*` does not show what it stands for, so the docstring that defines the class carries the caveat the two borrowers need. 3. **The mechanism they state is the one that fails `refs/h`:** "wherever a name it writes is a branch's". The `origin_fetch_refspecs` paragraph ends with why such a refspec is carried at all: "Which names the remote's branches have is not known from its refspecs, and left out, what such a refspec keeps would be pruned on every run". That holds for `refs/h` word for word. 4. **The cost of leaving them is one reading:** a reader who takes "names no branch" in git's sense meets the single case `refs/h` beside a remote branch `refs/heads/refs/h`. If the review wants a word there, it is a few words in each place, and no open PR touches either paragraph (merge-trees below), so it can be a fix round. None of either. No row is added or changed and no behaviour moved: the syntax tree outside the docstring is main's, so there is nothing for main to fail and nothing to mutate. `gives_a_branch_another_name` returns what it returned for every case in the table above (called in process at this head; the syntax tree outside the docstrings is main's). All through the lane's runner `run9.sh` (stub `gh` first on PATH, `GIT_SSH_COMMAND=false`, `GIT_CONFIG_GLOBAL=/dev/null`), on the committed head `36ec589a6` with the tree clean (`dirty=0`), as one run of seven files at a time: `tests/test_pinned_copy_text.py`, `tests/test_path_guard_hygiene.py`, `tests/test_repo_hygiene.py`, `tests/test_agents_md_codes.py`, `tests/test_cli_reference.py` (the hygiene five), `tests/test_family_bump_fetch_refspecs.py` and `tests/test_bump_leg_fetch_refspecs.py`. - **The seven files, git 2.43.0** (`/usr/bin/git`): 504 passed in 469.44s (47 `test_agents_md_codes.py`, 68 `test_bump_leg_fetch_refspecs.py`, 23 `test_cli_reference.py`, 57 `test_family_bump_fetch_refspecs.py`, 121 `test_path_guard_hygiene.py`, 87 `test_pinned_copy_text.py`, 101 `test_repo_hygiene.py`; the counts are from `--collect-only -q` on the same head and add up to 504). Log `v131/n1238/gate-g243.log`. - **The seven files, git 2.47.1** (first on PATH, `git --version` printed into the log): 504 passed in 714.00s. Log `v131/n1238/gate-g247.log`. - **`-k carried-refs-h-not-a-pattern`** over `tests/test_family_bump_fetch_refspecs.py` and `tests/test_bump_leg_fetch_refspecs.py`: 2 passed, 123 deselected, on 2.43.0 and on 2.47.1 (`run-k-g243.log`, `run-k-g247.log`). - Both runs start with `dirty=0`. Python 3.12.3 (CI runs 3.14); nothing asserts text that depends on the version. The measured git behaviour above comes from the probe scripts, not the test files. `-k carried-refs-h-not-a-pattern` over the two fetch-refspec files is part of those runs. `git merge-tree --write-tree origin/main HEAD` exits 0, with tree `9d874bcf2caf`, equal to this head's tree, against main `50869f384` (the merge base). Against the head of each open PR that touches `scripts/shape_materialize.py` or `scripts/bump-leg.py` (read from `gh pr list --state open --limit 100 --json number,headRefName,headRefOid,files`, 52 open PRs at the last read, 7 of them touch one of the two files), `git merge-tree --write-tree HEAD <head>` exits 0 and the merged tree still holds the new sentence and not the old one: ``` #1223 f50b472 exit 0 #1207 6fa1edd exit 0 #1160 0068f5a exit 0 #1131 55c30f2 exit 0 #1118 2307036 exit 0 #1105 b28f40d exit 0 #1104 de89aa8 exit 0 ``` Main moved once while this was gated, to `4829418f0` (`adopt-project.py`, `docs/cli.md` and a new test file: none of the files this change or its runs touch), and `git merge-tree --write-tree origin/main HEAD` against it also exits 0. None of their hunks is within 100 lines of the sentence changed here. Review: rv1244 and rv1244b, lane 5's independent sonnet reviewers, which wrote none of #1244: READY at `36ec589a6`, H0 of this landing (issuecomment-6723280477), with no MUST or SHOULD; its four NITs are optional (two wordings, a body note and a follow-up). CI (Brett Heap's ruling 27): H0 is the head 473959f itself, which passed tests, tests-git-bash and SonarCloud; main has touched none of its files since its base 9729315; and the local gate passed on its predicted squash tree fb798f3 over main 9252ef2: the repo_hygiene, agents_md_codes, cli_reference sets, 171 passed. Landed on Brett Heap's word of 2026-10-23T13:10:26Z, relayed to every lane by lane 3 (#473 issuecomment-6365697123): "merge v1.2.1 PRs once reviewed and green". Closes #1238 Lane: openreposhape-5 (openRepoShape-5) Co-Authored-By: Claude Opus 5.5 <[email protected]>
…bove it and at the manifest, before a link there or after it, and at a pin's file whose exact spelling holds nothing, as `_KeptTree` keeps every row, not the first (#1138) (#1170) On a disk that ignores case, `shape/README.md` and `shape/readme.md` are one place, and which of them a clone holds is git's checkout, not the plan's. The plan keeps both, so both are in the way. `adopt-project.py check` read only the first row at a place (`_KeptTree._at`), so a case twin that sorted after a link at a shape copy was never named while the link stayed (r1118's NIT-5). The same held for a twin above the copy or above `scripts/`, at the manifest and at a pin's file. - `_KeptTree` holds a list of rows per key. `every(path)` answers all of them in tree order. `at(path)` answers the first, as it always did, for the two readers of one row: the root's `.gitattributes`, whose bytes are one file's, and `_links_at_a_pin`. A disk that keeps case has one row at a path at most, so it answers as before. `file_above` is now `files_above`, a list. - `_kept_there` answers a list of `(group, rows)`, with each row's own path as its group. A twin is named by its own finding, and the skip for a named link hides the link's group and no twin's. `_shape_blocks` gives a block for each row above the shape's directory, above `scripts/`, at the copy and at the manifest. `_kept_pin_finding` names each row at a pin's file that is not a named link. `_links_at_a_copy`, `_links_at_the_manifest` and `_holds_a_pin` read the groups and rows the same way. - `tests/test_adopt_symlink_target_bytes.py` goes from 133 tests to 150. Docstrings are reworded to say it, and `_kept_pin_finding`'s says when the disk that ignores case is asked. - Measured, `check` over 30 sources and kept-in-root sets (29 ran, since `plan` refuses `dir-twin-after-good-link` at both), base `2307036a` (#1118's head) against head, with each run's own path and each hash masked: - Every stdout is the same but for the source commit hash. 14 cases add exactly one finding and none loses a line: `shape/readme.md` after a bad or a good link at `shape/README.md` (the issue) adds `plan-root-blocks-shape-copy`, and most of the others add that code too, with `plan-root-blocks-shape` for a twin above `scripts/`, `plan-root-blocks-manifest` at the manifest and `plan-root-holds-pin` at a pin's file. 1 case extends a line: the named link `Project.yaml` after the file `PROJECT.yaml` gains the manifest tail on its `plan-bad-symlink-target` line, and the finding count stays at 2. 14 are unchanged. - Of the 20 rows (17 new, and 3 of #1118's beside them), 16 fail on base and 4 pass: #1118's three, and the control `a-link-twin-alone`. All 20 pass at head, and the whole file gives 150 passed. - Mutants: M1 to M11 and M7b are all killed. r1070's M13p and M14 are killed. M12, the copy skip marking its group seen, now survives as an equivalent mutant, since each twin's group is its own. r1170 ran 14 mutants of its own and killed 13, with M12 the survivor. - Known limits: - Directory twins are one group: `shape/readme.md/y` beside `shape/README.md/x` is one finding. A directory twin beside a row at the place is not named while the row is, in `_kept_there` and at a pin's file alike. - `.gitattributes` twins are read through `at()`, the first row. `ga-twins` is unchanged. - A pin's file with any row at its exact spelling leaves the twins at other spellings unasked. `_kept_pin_findings` asks the disk that keeps case first and the one that ignores it only where that found nothing (#524). A file, a link or the rows of a directory at the exact spelling end the question, as before, and so the twin is not named. A submodule at the exact spelling does not end it. Measured at base and at head alike. - #1089's N1, the location tail on the link's own finding, is left, as decided in #1118. Review: lane 1's independent reviewers reviewed each round. r1170 reviewed `4df784ac`, stopped at the shared window's LAST STEP, and found it NOT READY for three SHOULDs and no MUST (#1170 issuecomment-6351590221). Two were gate rulings in the body that were wrong, and the third was a known limit narrower than the code. It re-derived the matrix, and 13 of its 14 mutants were killed, with M12 shown equivalent. r1170b found `24ee133a` READY, with no MUST or SHOULD and four NITs, all optional (issuecomment-6360348610). The one commit after `4df784ac` changes `_kept_pin_finding`'s docstring alone, and `adopt-project.py`'s AST before and after it, with every docstring emptied, is equal. Of the NITs, the title (NIT-1), the stale CI sentence (NIT-3) and the pin's file in limit 1 (NIT-4) are applied. NIT-2, two loose phrases in that docstring, is not applied at this head. After #1118 landed as `9ec0dc79`, the branch was restacked onto main by three merges, with no rebase, and its changed lines equal the reviewed delta (sha256 `1b3dfac3`). Lane 1's delta check carries READY to `05fa55e0` (issuecomment-6725110130). Tests, under a stub `gh` with a bogus token: at `24ee133a`, the gate gave 150 passed for `tests/test_adopt_symlink_target_bytes.py`, 322 passed for `tests/test_adopt_root_shape_paths.py`, `tests/test_adopt_leg_path_collisions.py` and `tests/test_scaffold_leg_path_collisions.py`, and 170 passed for the doc trio. It gave 49 passed for `tests/test_path_guard_hygiene.py` over the merge into main, and `tests/test_shape_doctor.py` in 4 shards (111, 112, 111 and 111 passed, with 1 skipped in three of them). Its three calls over 14 more files gave the same counts as at `4df784ac`: 205 passed with 3 skipped (the reftable rows need git 2.45), 260 passed, and 385 passed. CI's full `tests` job passed on CPython 3.14 at `24ee133a` (run 39859853515: 19672 passed, 385 skipped, read by r1170b). At the restacked head `05fa55e0`, `tests/test_adopt_symlink_target_bytes.py` with `tests/test_adopt_root_shape_paths.py` gave 273 passed, `tests/test_adopt_check_throwaway_repos.py` 151 passed and 1 skipped, the two scans with `tests/test_scaffold_leg_path_collisions.py` 283 passed and 2 skipped, the doc trio 171 passed, and `tests/test_shape_doctor.py` in 4 shards 446 passed and 3 skipped. It lands by fast refresh (Brett Heap, 2026-10-15T22:48:35Z). Its H0 `05fa55e0` is green on Linux and SonarCloud. The branch was never rebased. After H0, the only commit is update-branch's clean merge of main, giving 6da8731, which is green on SonarCloud and Git Bash. Lane 1's gate passed on its tree: 8 pytest calls over `tests/test_adopt_symlink_target_bytes.py`, `tests/test_adopt_root_shape_paths.py`, `tests/test_adopt_check_throwaway_repos.py`, `tests/test_scaffold_leg_path_collisions.py`, `tests/test_path_guard_hygiene.py`, `tests/test_no_auto_maintenance.py`, `tests/test_agents_md_codes.py`, `tests/test_cli_reference.py`, `tests/test_repo_hygiene.py` and `tests/test_shape_doctor.py` in 4 shards: 1,324 passed, 6 skipped. Closes #1138 Lane: openreposhape-1 (openRepoShape-1) Co-Authored-By: Claude Opus 5.5 <[email protected]>
… offered its url only where GitHub can hold the name, so `testorg/<300 a's>` beside an unsearchable `./testorg` is offered no url, and `testorg/Thing` through a link too long keeps `https://github.com/testorg/Thing` (#1003) (#1122) Lane 4's W1003 for #1003 (v1.2.0, #970's follow-up), with W1003b's fix round 1 for RV1122's review. Lane 3 places the issue; this is a draft, and a reviewer follows. #1003 names two defects. Part (a) is already on main, so this PR changes only part (b). - **(a) A `--source` or recorded clone directory this user cannot enter.** This landed in #1072 (see #918). Its `_refused_at`, `_top_level(..., refused)` and `_not_a_whole_clone` refuse it as `source-unreadable`, and `tests/test_adopt_unenterable_source_and_locale.py` holds every case #1003 measured. W1003 measured it again (first table below), and this PR does not touch it. - **(b) A `--source` too long to name is offered a url that cannot clone.** This PR puts it right. ## What `adopt-project.py`, `_source_there`: when the `stat` of a spelling that is also an `org/repo` is refused, the refusal names both readings and offers the url only where GitHub can hold the name. An owner over `GITHUB_OWNER_MAX` (39) or a repository over `GITHUB_NAME_MAX` (100) is refused as a path is, whatever reason the operating system gave. The file already imports both limits from `shape_materialize`. ```python owner, _, repo = (name or "").partition("/") if (name is None or len(owner) > GITHUB_OWNER_MAX or len(repo) > GITHUB_NAME_MAX): ``` - **Before:** `plan --source <300 a's>/Thing` was refused `source-unreadable`, "cannot be read (File name too long)" (#970). It also said "whether it names the path `./<300 a's>/Thing` here, or only the GitHub repository `<300 a's>/Thing`, cannot be told", and offered `https://github.com/<300 a's>/Thing`. - **Why that was wrong:** a part longer than a file name may be is longer than GitHub lets an owner or a repository be named, so the url can never clone. - **Now:** "so whether a repository is there cannot be told", which is #970's own words for a path that cannot be read. The cure follows the operating system's reason: `chmod u+rx` for a permission, "put right what it names" for anything else. No url is offered. - **The name decides, never the reason (fix round 1, RV1122's SHOULD-1).** The first head (`e75587e7`) refused only an `ENAMETOOLONG` this way, and that went wrong both ways: - `testorg/<300 a's>` beside a `./testorg` at mode 000 stops at `Permission denied` before the long part. It was still offered `https://github.com/testorg/<300 a's>`. Now it is offered no url. - `testorg/Thing`, with `./testorg` a symlink to a name too long, is `File name too long` because of the link's destination. It lost `https://github.com/testorg/Thing`, a repository GitHub can hold, which main offered. Now it is offered again. - **The same holds for** the `github.com/` and `www.github.com/` spellings. - **Unchanged:** a name GitHub can hold, with its `stat` refused (a permission, an I/O error, a link too long), still names both readings and offers the url. - No refusal code is new or changed. `--source`'s help and `docs/cli.md` already say `source-unreadable` covers this, so neither changes. ## Before and after **Part (a), and the first head.** W1003 probed as a non-root user (uid 1000), with Python 3.12.3 and with the same Python under a `sitecustomize` that answers `Path.exists`/`is_file`/`is_dir` as 3.14 does (proved to bite). The shim's output matched 3.12's on every tree. A stub `gh` recorded and refused each call; `GH_TOKEN=bogus`, an empty `GH_CONFIG_DIR`, `GIT_SSH_COMMAND=false`, `GIT_CONFIG_GLOBAL=/dev/null`. | case | before #1072 (`06cbd478`) | main | this PR | |---|---|---|---| | H: `plan --source <repo dir at 000>` | `PermissionError` traceback, exit 1 | `source-unreadable`, exit 2, 0 `gh` calls | same as main | | C7: `check`, recorded `local_path` at 000, `cloned: false` | traceback, exit 1 | `source-unreadable`, exit 2 | same as main | | C6: the same, `cloned: true` | "no longer whole (git finds no repository there)", `cloning testorg/Thing`, 1 `gh` call | `source-unreadable`, 0 `gh` calls, nothing made | same as main | | C6e: `execute --yes`, the same | as C6, 1 `gh` call | `source-unreadable`, 0 `gh` calls | same as main | | G1: `plan --source <300 a's>/Thing` | two readings, url offered | two readings, url offered | "whether a repository is there", no url; exit 2, 0 `gh` calls | | G2b/G5b: `[www.]github.com/<300 a's>/Thing` beside `./[www.]github.com` | not measured | two readings, url offered | no url; no plan, no work directory | | G3b: `testorg/<300 a's>` beside `./testorg` | not measured | two readings, url offered | no url; no plan, no work directory | | G4: `./<300 a's>/Thing` (a path) | no url | no url | unchanged | That probe ran on main `2a119f28` and on the first head's diff as first committed there (`5a8f09d8`). At this head, the tests' rows below give the same answers for G1 to G3b. **Fix round 1.** `_source_spec` in-process, with a real `stat`, as uid 1000 on Python 3.12.3. No process is started. | case | `stat` | main `823624d9` | first head `e75587e7` | this head | |---|---|---|---|---| | A: `<300 a's>/Thing` | File name too long | two readings, url | path wording, no url | path wording, no url | | B: `testorg/<300 a's>` beside `./testorg` | File name too long | two readings, url | path wording, no url | path wording, no url | | E: `testorg/Thing`, `./testorg` a symlink to `<300 a's>` | File name too long | two readings, `https://github.com/testorg/Thing` | path wording, **no url** | two readings, `https://github.com/testorg/Thing` | | C: `testorg/<300 a's>` beside `./testorg` at 000 | Permission denied | two readings, url | two readings, **url** | path wording, no url | | D: `<50 b's>/Thing` beside `./<50 b's>` at 000 | Permission denied | two readings, url | two readings, url | path wording, no url | | K39: `<39 c's>/Thing` beside `./<39 c's>` at 000 | Permission denied | two readings, url | two readings, url | two readings, url | | K: `testorg/Thing` beside `./testorg` at 000 | Permission denied | two readings, url | two readings, url | two readings, url | ## Tests Every run used `/usr/bin/python3 -m pytest -p no:cacheprovider`, with the landing gate's environment: - a stub `gh` first on PATH, `GH_TOKEN=bogus` and an empty `GH_CONFIG_DIR`; - `GIT_CONFIG_GLOBAL` set to an empty file, and `GIT_CONFIG_NOSYSTEM=1`; - the test author and committer variables, and `EMAIL`; - `GIT_SSH_COMMAND` and `GIT_ALLOW_PROTOCOL` unset. **The rows for #1003**, in `tests/test_adopt_unsearchable_source.py`, #970's file. Each was run with this head's test file against three versions of `adopt-project.py`: main's, the first head's and this head's. | Row | What it asserts | main `823624d9` | first head `e75587e7` | this head | |---|---|---|---|---| | `test_a_spelling_too_long_for_the_disk_is_offered_no_url`: `[owner]`, `[repository]`, `[bare-github-url]`, `[www-github-url]` (changed) | real `stat`, `File name too long`: path wording, no url. Its control now refuses, with an I/O error, a name GitHub can hold (an owner of 39, a repository of 100), and expects that name's url | 4 fail at `detail` (two readings) | 4 pass | 4 pass | | `test_a_name_github_cannot_hold_is_offered_no_url_whatever_the_reason`: an owner of 40 or 300, a repository of 101 or 300, and `github.com/<40>/Thing`, each refused with EIO and with EACCES (new, 10 rows) | in-process: path wording, the cure for the reason, no url. The control is the same part at GitHub's limit, refused alike, which keeps both readings and its url | 10 fail at `detail` | 10 fail at `detail` (two readings, url) | 10 pass | | `test_a_name_github_can_hold_keeps_its_url_through_a_link_too_long` (new) | row E: real `stat`, `File name too long` through the link; two readings and `https://github.com/testorg/Thing` | passes | fails at `detail` (path wording, no url) | passes | | `test_plan_of_a_name_github_cannot_hold_in_an_unsearchable_place` (new) | row C: a child `plan`, `./testorg` at 000, with the `stat` asserted to be `Permission denied`. Exit 2, the refusal line, the `chmod` cure, no "GitHub repository" and no `https://`; no plan, no work directory, `gh` never asked | fails at the refusal line | fails at the refusal line (url offered) | passes | | `test_plan_of_a_spelling_too_long_for_the_disk_offers_no_url` (unchanged) | a child `plan` of `<300 a's>/Thing` | fails | passes | passes | Totals for the 17 rows: main 16 failed and 1 passed, the first head 12 failed and 5 passed, and this head 17 passed. Each new row fails on the first head; each changed row fails on main, where the first head already passed it. Skips follow the file's own: - the rows that need a real `File name too long` skip on Windows (`needs_a_name_too_long`), and the symlink row needs a symlink too (`needs_a_symlink`); - the real mode-000 row skips on Windows and as root (`needs_a_mode`); - the in-process EIO and EACCES rows refuse `Path.stat` themselves (`refused_for`), so they run on every platform and as root, as `refused_stat`'s rows do. **Mutants**, each applied to this head's `adopt-project.py` (sha256 `b8bdbdbe...`) by exact substitution and run against `test_adopt_unsearchable_source.py` and `test_adopt_unenterable_source_and_locale.py` (57 tests). After each one, the file was restored from its saved bytes and its sha256 checked. All seven were killed, and the file unmutated passes all 57. | Mutant | Killed by | |---|---| | N1: the first head's guard, `name is None or exc.errno == errno.ENAMETOOLONG` | 12: the 10 in-process rows, row E, row C | | N2: the owner's limit only | 6: `[repository]`, the 4 `repository-*` rows, row C | | N3: the repository's limit only | 10: `[owner]`, `[bare-github-url]`, `[www-github-url]`, the 6 `owner-*` and `bare-github-url-*` rows, and the child `plan` of `<300 a's>/Thing` | | N4a: the owner's limit off by one (`>=`) | 9: the 3 owner controls at 39, and the 6 `owner-*` and `bare-github-url-*` controls at 39 | | N4b: the repository's limit off by one (`>=`) | 5: the `[repository]` control at 100, and the 4 `repository-*` controls at 100 | | N5: the url withheld for every error | 20: 5 of #970's rows, the 4 changed rows, the 10 in-process rows, row E | | N6: the errno, or GitHub's limits | 1: row E | **Gate**, at this head `c01c4d73`, each file alone: | File | Result | |---|---| | `tests/test_adopt_unsearchable_source.py` | 44 passed (32 before, and 12 new) | | `tests/test_adopt_unenterable_source_and_locale.py` | 13 passed | | `tests/test_adopt_source_clone_record.py` | 100 passed | | `tests/test_adopt_project_is_the_source.py` | 23 passed | | `tests/test_adopt_temp_work_roots.py` (the test file imports from it) | 9 passed | | `tests/test_repo_hygiene.py` | 100 passed | | `tests/test_scaffold_leg_path_collisions.py` | 104 passed | | `tests/test_cli_reference.py` | 23 passed | | `tests/test_agents_md_codes.py` | 47 passed | | `tests/test_shape_doctor.py`, in 8 shards of 56 | 445 passed, 3 skipped (`:10510`, the PowerShell rows, Windows only) | Total: 908 passed and 3 skipped, in 10 files, with no failures. Only the two `source-unreadable` files reach the changed branch: `git grep` over `tests/` finds `_source_spec`, `_source_there` and adopt's `source-unreadable` in no other file. pyflakes on both changed files: no warning. ## Merges `git merge-tree --write-tree`, at this head `c01c4d73`: | Merged with | Result | |---|---| | main `823624d9` | clean, tree `aaed1f57`; its diff from main is byte-identical to the PR's own diff (`6da757cb..HEAD`), in the same 2 files | | #1125 `2a53a8e6` | clean | | #1123 `5c3908f8` | clean | | #1121 `c04bb710` | clean | | #1120 `c55e55e3` | clean | | #1119 `bdcf9952` | clean | | #1118 `c60066cb` | clean | | #1106 `504a1dd6` | clean | | #1105 `5a4de7f7` | clean | | #1091 `551452be` | clean | ## Out of scope - X1: a recorded clone whose directory can be entered, but whose `.git` is at mode 000, reads as emptied ("git finds no repository there"). With `cloned: true` it is cloned again (1 `gh` call). It is the same on main and here; lane 4 filed it as #1099 (see #1099). - RV1122's NIT-1: an owner of 40 to 255 characters, or a repository of 101 to 255, with nothing on disk, is still handed to `gh`, which is asked for a name it cannot hold. It is the same on main and here; see #1129. Closes #1003 Lane: openreposhape-4 (openRepoShape-4) Co-Authored-By: Claude Opus 5.5 <[email protected]>
… right after its three repository names, so a bad one beside an unanswered entry, a moved source, a refused name or another repository is that one refusal in both, and a `pins:` entry that is no pin is said as `_read_as` says it (#1020) (#1125) #901 made `check` and `execute` name the same first problem among a plan's options. Outside them, the two still named different problems first (#1020, found by lane 1's writer on #901). 1. **One rule, the refusal before what `check` lists.** `check` refuses a bad `org:` or `id:` outright, exit 2, and lists none of its findings. `execute` refuses at the first of them, but it asked the two only after it had refused four things that `check` lists as findings: a plan for another repository (`plan-not-the-source`), a name the naming policy refuses (`naming-unclassified`), an unanswered entry (`plan-unresolved`) and a source that has moved on (`plan-stale`). And `check` asked the two only where the policy took the plan's names (`_manifest_values`), so an unsafe `org:` beside a refused name was a finding about the name, or about another repository. Both commands now ask the two first of the plan's values, right after the three repository names (`plan.names()`, then `_checked_org_and_id`): `execute` in `cmd_execute`, ahead of `_refuse_a_plan_for_another_repository`, and `check` at its head, after the triad advisory. Review round 1, below, moves both to right after the plan's keys, before `_work_root`. `_checked_plan_values` no longer asks them, since `cmd_execute` has. 2. **#716's L4-48, decided.** An `org:` that `checked_value` refuses, held to a repository, was `unsafe-value` to `check` and `plan-not-the-source` to `execute`. Such an `org:` names no repository, on GitHub or in the manifest, so it is not compared with the source's. It is `unsafe-value` in both commands now, held to a repository or not. Once it is mended, a plan for another repository is still `plan-not-the-source` in both. This reverses three tests in `tests/test_adopt_check_plan_name.py`, which pinned the old answers on purpose: - `test_an_unsafe_org_is_unsafe_in_check_and_compared_by_execute_if_held` expected `plan-not-the-source` from `execute` in its six held rows. As `test_an_unsafe_org_is_unsafe_in_check_and_in_execute_held_or_not`, all twelve expect `unsafe-value` from both, in the same words. - `test_check_compares_an_unsafe_org_where_no_manifest_is_built` expected `check` to compare `org: acme labs` beside the refused name `bad_name`: `plan-not-the-source` and `naming-unclassified`, exit 1. As `test_an_unsafe_org_is_asked_before_the_plans_refused_names`, it expects `unsafe-value`, exit 2, from `check` and from `execute`. - `test_check_asks_an_unsafe_org_first_where_a_kept_submodule_url_is_relative` expected `plan-not-the-source` from `execute`. It now expects `unsafe-value`, in `check`'s words. 3. **A `pins:` entry that is no pin** was spelled with `repr` (`` `pins:` entry 1 is 7 ``, `True`, `None`). #901 made `pins:` itself read as `_read_as` reads it, and an entry reads the same way now: "the number 7", "the boolean true", "null", "a list of 2 item(s)". Docstrings and comments now say this: `_checked_org_and_id`, `_checked_plan_values`, `_manifest_values`, `_held_findings`, `_not_the_source`, `_refuse_a_plan_for_another_repository`, `_read_pins` and the #499 block comment. No finding is added or removed: only which problem is named first changes, and the spelling of an entry. Measured on main at `6da757cb` and on this branch, with a stub `gh`, a bogus token, an empty `GH_CONFIG_DIR`, `GIT_SSH_COMMAND=false` and `--local-remote-dir`. No run made a leg. | The plan has | `check` on main | `execute` on main | both, here | |---|---|---|---| | a bad id beside an unanswered entry | `plan-bad-id` | `plan-unresolved` | `plan-bad-id` | | a bad id beside a source that has moved on | `plan-bad-id` | `plan-stale` | `plan-bad-id` | | a bad id beside a name the policy refuses | `plan-bad-id` | `naming-unclassified` | `plan-bad-id` | | a bad id beside another organisation, held to a repository | `plan-bad-id` | `plan-not-the-source` | `plan-bad-id` | | no `id:`, and `legs.assembly: north_wind` (a derived id the policy refuses too) | `plan-bad-id` | `naming-unclassified` | `plan-bad-id` | | an unsafe `org:` held to a repository (L4-48) | `unsafe-value` | `plan-not-the-source` | `unsafe-value` | | an unsafe `org:` beside an unanswered entry | `unsafe-value` | `plan-unresolved` | `unsafe-value` | | an unsafe `org:` beside a source that has moved on | `unsafe-value` | `plan-stale` | `unsafe-value` | | an unsafe `org:` beside a refused name | finding `naming-unclassified`, exit 1 | `naming-unclassified` | `unsafe-value` | | the same, held to a repository | finding `plan-not-the-source`, exit 1 | `plan-not-the-source` | `unsafe-value` | Each "here" row is exit 2 from both, word for word. The last two rows agreed on main. They change because `check` now asks the two where the policy refuses the names, as `execute` now does: without that, moving `execute` alone would have made them disagree. Plans with only one of these problems (an unanswered entry, a moved source, a refused name, another repository) are named as on main by both. **Tests.** - `tests/test_adopt_plan_value_order.py` gains 16 rows: - the 10 above, through both commands, comparing the first line; - four `pins:` entries that are no pin: number, boolean, null and list; - two guard rows, `id` and `org`: a leg name `checked_value` refuses (`legs.spec: "-spec"`) beside a bad `id:` or `org:` is that name's `unsafe-value` in both, so the three names are still asked first. - The 14 non-guard rows all fail against `6da757cb`'s `adopt-project.py` and pass here. The two guard rows pass on both, by design. - Existing rows changed for the new behaviour: - `test_adopt_check_plan_name.py`: the three tests above, and its docstring's L4-48 line. - `test_adopt_pins.py`: `a-number`. - `test_adopt_execute_refusals.py`: the three entry rows of `PIN_ENTRIES`. **Mutants**, each applied to `adopt-project.py`, run against the 16 new rows and the L4-48 tests (30 tests), and restored with its sha256 checked (`9178964d`, the same after each one): | Mutant | Killed by | |---|---| | M1: `cmd_execute` does not ask `_checked_org_and_id` early | 18: the 10 new rows, the 6 held L4-48 rows, and the two other reversed tests | | M2: `cmd_execute` asks it after `_refuse_a_plan_for_another_repository` | 11: the 3 new held rows, the 6 held L4-48 rows, and the two other reversed tests | | M3: `cmd_check` asks `plan.names()` but not `_checked_org_and_id` at its head | 3: `org-and-refused-name`, `org-held-and-refused-name`, `test_an_unsafe_org_is_asked_before_the_plans_refused_names` | | M4: `cmd_check` asks `_checked_org_and_id` but not `plan.names()` at its head | 2: both guard rows | | M5: a `pins:` entry that is no pin spelled with `repr` again | 4: the four new entry rows | **Gate**, on this branch's tree `66845bb3`, under a stub `gh`, `GH_TOKEN=bogus`, an empty `GH_CONFIG_DIR`, `GIT_CONFIG_GLOBAL` an empty file, `GIT_CONFIG_NOSYSTEM=1`, `GIT_ALLOW_PROTOCOL` and `GIT_SSH_COMMAND` unset, and `EMAIL` set. 125 files in six shards. The branch is based on `main` at `6da757cb`. `main` has since moved to `823624d9` (#1101, #1102), and its diff against `6da757cb` is empty in the five files this branch changes. - every `tests/test_adopt_*.py` (68 files, 34 in each of s1 and s2): - s1: 2013 passed, 2 skipped (local run on this head). - s2: 2560 passed, 1 skipped (local run on this head). - the 55 other files that name `ADOPT`, `adopt-project.py` or `adopter`, among them `test_repo_hygiene.py` and `test_agents_md_codes.py` (28 files in s3, 27 in s4): - s3: 1992 passed, 8 skipped (local run on this head). - s4: 1860 passed, 1 skipped (local run on this head). - `tests/test_shape_doctor.py`, s5: 445 passed, 3 skipped (local run on this head). - `tests/test_scaffold_leg_path_collisions.py`, s6: 104 passed (local run on this head). **Merge-trees**, `git merge-tree --write-tree`, run on 2026-10-21 against `main` at `823624d9` and against each open PR's head that touches `adopt-project.py`. Every one exits 0 and is clean: - `main` at `823624d9`: tree `728fb9e4`. At review round 1's head `9549006f`, against `main` at `038dafba` (it took #1091): clean, tree `2cf183ed`. - #1123 (`5c3908f8`), #1122 (`e75587e7`), #1121 (`c04bb710`), #1120 (`c55e55e3`), #1119 (`bdcf9952`), #1118 (`c60066cb`), #1106 (`504a1dd6`), #1105 (`5a4de7f7`) and #1091 (`160de118`). The merged trees were not run through the tests: the merges are clean as text only. **Review round 1** (RV1125's review of `2a53a8e6`: one SHOULD and two NITs), head `9549006f`, one commit on top of `2a53a8e6`: - **SHOULD-1.** A bad `id:` or `org:` beside a `--work-dir` this user cannot write in was `plan-bad-id` (or `unsafe-value`) to `check` and `adopt-work-dir-unwritable` to `execute`: `check` lists the directory as a finding (#524), and `execute` refuses it before it opens the source, ahead of the two asks. Both commands now ask `plan.names()` and `_checked_org_and_id(plan)` right after the mistyped-plan question, before `_work_root`, as RV1125 sketched. They read only the plan. The comments in `cmd_execute`, `cmd_check`, `_checked_org_and_id` and `_checked_plan_values` say so, and the "A REFUSAL OF `check`'S IS ASKED BEFORE WHAT IT LISTS" paragraph names the work directory among what is asked after. A `--work-dir` that is a file or cannot be made agrees as well: both ask `_work_root` after the two now. - **Two side effects, said here.** (1) `check` printed the Triad advisory, on stdout, once it had opened the source and before it refused a bad `org:` or `id:`; the refusal now comes before the source is opened, so it prints nothing on stdout. (2) `execute` asks the two before `_require_filter_repo()`, so a bad `id:` is the refusal even where `git filter-repo` is missing; `check` asks no such question. - **Two more reorders, said here (RV1125b's NIT-B).** Besides the `--work-dir` that is a file, a bad `id:` or `org:` is now asked, in `check` and in `execute`, before `_work_root` refuses a `--work-dir` every user can write in, without the sticky bit (`adopt-work-dir-shared`), and before a source that has moved on is refused (`plan-source-gone`). On main at `6da757cb` both commands said `adopt-work-dir-shared` or `plan-source-gone` of such a plan; here both say `plan-bad-id` or `unsafe-value`, so only which refusal comes first changes: the two commands agreed before and agree now. The same plan with no bad `id:` or `org:` is refused as before, in both. Measured at `6da757cb` and at `9549006f`, for a bad `id:` and for a bad `org:` beside each. No row pins either yet: see #1179. - **Rows** in `tests/test_adopt_plan_value_order.py`: `both_on` takes a `--work-dir` for both commands; `test_the_org_or_the_id_is_named_before_an_unwritable_work_dir` has a row for a bad `id:` and one for a bad `org:`, each beside a `--work-dir` that is `chmod 500`, asserting exit 2 from both, the same first problem, and no `adopt-work-dir-unwritable`. It skips where `chmod` cannot keep this user from writing (root, Windows), by `test_adopt_root_symlinks.unwritable_work`. - **NIT-1.** The docstring of `test_check_asks_an_unsafe_org_first_where_a_kept_submodule_url_is_relative` says it is a regression row: since #1020 `check` asks `org:` at its head, so the relative url decides nothing. - **NIT-2.** `check` prints its findings only at its end, so no finding tells a late ask from one at its head. Its stdout does: the Triad advisory comes after `_work_root` and the source are opened. `test_check_asks_the_org_and_the_id_before_it_says_anything_else` (a row for a bad `id:` and one for a bad `org:`) asserts that `check` prints nothing on stdout and refuses first on stderr, and its control, the unedited plan, says the advisory first. - **Rows against `2a53a8e6`'s `adopt-project.py`:** the 4 new rows fail (the work-dir rows: `execute` says `adopt-work-dir-unwritable` where `check` says the id or the org; the NIT-2 rows: stdout holds the advisory), and the 2 guard rows pass. - **Mutants** of this round, each applied to the new `adopt-project.py`, run against `test_adopt_plan_value_order.py` and `test_adopt_check_plan_name.py` (85 tests), restored with sha256 checked (`412edbda`, the same after each one): | Mutant | Killed by | |---|---| | N1: `check` asks the two after the advisory (this PR's place before the round) | 2: both NIT-2 rows | | N2: `check` asks them only before `_print_what_will_happen` (RV1125's K3) | 2: both NIT-2 rows | | N3: `check` asks them only before `_not_the_source` (K9) | 2: both NIT-2 rows | | N4: `execute` asks them after the work-dir refusal, before the source is opened | 2: both work-dir rows | | N5: `execute` asks them where it did before the round, after `_require_filter_repo()` | 2: both work-dir rows | - **Gate** on a scratch merge commit `8bd1e05f` of `main` at `038dafba` and `9549006f` (tree `2cf183ed`, clean, not pushed), in the landing gate's environment, six shards: the PR's four test files, 416 passed; `test_adopt_work_dir_refusal.py` and `test_adopt_shape_pin_and_work_dir.py`, 73 passed; `test_cli_reference.py`, `test_agents_md_codes.py`, `test_repo_hygiene.py`, `test_path_guard_hygiene.py` and `test_scaffold_leg_path_collisions.py`, 323 passed; `test_shape_doctor.py` in three shards of 150, 150 and 148 ids (448 in all): 150 passed, 150 passed, 145 passed and 3 skipped. 0 failures. `test_path_guard_hygiene.py` passes on the merge: its three guards from #1091 are on `main` now, and the test is green there. - Not done: RV1125's list of other open PRs was not re-run through the merge; a PR whose tests assume `check` printed the advisory before a refusal would fail, and none was found in this repository's tests. **Left for follow-up issues, not taken here (see #1113 and #1114):** - #1113: `check` and `execute` still name different first problems for four pairs that have no bad id or `org:`: - a source that has moved on beside an unanswered entry; - a plan for another repository beside an unanswered entry; - a plan for another repository beside a moved source; - a refused name beside an unanswered entry. Each is `check`'s finding order against `execute`'s refusal order, and is the same on `main` and here. - #1114: `_pin_row_problem` spells a pin field that is not text with Python's `repr` (`` `commit: 7` ``, `True`). Closes #1020 Lane: openreposhape-4 (openRepoShape-4) Co-Authored-By: Claude Opus 5.5 <[email protected]>
…d is refused `source-unreadable`, naming that `.git`, so `check` and `execute` no longer call a clone `plan` made with its `.git` at mode 000 no longer whole and clone it again (#1099) (#1141) A recorded source whose `.git` this user cannot read is now refused as `source-unreadable`, naming that `.git`. `check` and `execute` no longer call a clone `plan` made with its `.git` at mode 000 "no longer whole", and no longer clone it again from GitHub. This uses the code and wording #1072 gave a recorded directory this user cannot enter (#918). No refusal code is new. ## Reproduced on main `4ed7c7bf5` Measured as uid 1000, with git 2.43.0 and Python 3.12.3. The run had a stub `gh` first on PATH that records and refuses every call, `GH_TOKEN=bogus`, an empty `GH_CONFIG_DIR`, `GIT_SSH_COMMAND=false` and an empty global git config. Remotes were local, under `--local-remote-dir`. The source was a clone with `origin` at `https://github.com/testorg/Thing.git`, so `plan` recorded `source.repository: testorg/Thing`. `plan --source <it>` wrote the plan, and `cloned:` was set by hand where the row needs it. Then `chmod 000 <it>/.git`. | Row | `check` on main | `execute --yes` on main | |---|---|---| | `.git` a directory at 000, `cloned: true` | exit 2: NOTE "... is a clone `plan` made that is no longer whole (git finds no repository there), so its `source.repository`, testorg/Thing, is cloned again from GitHub", then `cloning testorg/Thing`, then `source-unclonable`; **1 `gh repo clone`** | the same, 1 `gh` call | | `.git` a directory at 000, `cloned: false` | exit 2: `REFUSED git-failed: git rev-parse --is-inside-git-dir in <it> exited 128: fatal: not a git repository (or any of the parent directories): .git`; 0 `gh` | the same | | `.git` a file (`gitdir:`) at 000, `cloned: true` | as the directory row: NOTE, cloning, **1 `gh` call** | the same | | `.git` a file at 000, `cloned: false` | exit 2: `git-failed`, `fatal: error opening '<it>/.git': Permission denied`; 0 `gh` | the same | | readable `.git`, `cloned: true` and `false` | exit 0, `plan ok`; 0 `gh` | exit 0, `adoption verified`; 0 `gh` | ## On this branch Each of the four unreadable rows now exits 2 before anything is cloned or made, and `gh` is never asked: ```text REFUSED source-unreadable: the `.git` in the plan's `source.local_path`, `<it>/.git`: cannot be read (Permission denied), so whether `plan`'s clone is still whole, to be read, or no longer whole, to be cloned again, cannot be told Remediation: a path this user cannot reach is never read as one that is not there, and nothing was cloned. Make it readable by this user: `chmod u+rx` on the directory and on every directory above it, or fix who owns them. Then run the same command again; or pass the source again with --source, which is held to the plan's `commit:`. ``` - With `cloned: false`, what cannot be told is "whether a repository is there". - A `.git` that is a file is given `chmod u+r` on the file and `chmod u+rx` on every directory above it. - The readable rows are unchanged: `plan ok`, `adoption verified`, 0 `gh` calls. ## What changed All in `adopt-project.py`, plus the regenerated `docs/cli.md` and one new test file. - **`_git_refused(path)`** (new, after `_not_a_whole_clone`) asks the `.git` before git runs, through `_is_a` and `_is_there` (#430): - A directory is asked whether its `HEAD` is there. That `stat` needs only the directory searched, and nothing of `HEAD` itself. - A regular file is opened, as git reads it. - Git's own answer cannot be used: it says "not a git repository" of a `.git` it cannot read, as it does of an emptied clone. With a directory `.git`, it also climbs to the parent, which may be another repository. - It returns `(the OSError, whether the .git is a file)`, or None. None is returned where nothing is there, where the `.git` holds no `HEAD` (git's "no repository", as before), or where the `.git` is neither a directory nor a file. - None is also returned where the `.git`'s own `stat` is refused. Then the directory itself cannot be searched, and #918's `cwd=` guards name it, as before. - **`Plan._recorded_source`** asks `_git_refused` right after asking whether the path is there, before it branches on `source.cloned`. That covers `cloned: true` and `false` alike. The new `Plan._git_unreadable` words the refusal. The insertion sits clear of #1106's change to the `there` line. - **`_source_unreadable`** takes the cure for a `PermissionError` as a keyword, `permission=`. It defaults to the directory's `SOURCE_UNREADABLE_PERMISSION`, so every other caller is unchanged. A `.git` file is given the new `SOURCE_UNREADABLE_FILE_PERMISSION`. - **`SOURCE_OVERRIDE_HELP`** (the `--source` help of `check` and `execute`) now says "one this user cannot reach, or one whose `.git` this user cannot read, a clone `plan` made included, as `source-unreadable`, never cloned again". - It is worded so that argparse does not wrap inside `source-unreadable`. - `docs/cli.md` was regenerated with `scripts/render-cli-reference.py`. - No README, handbook, `AGENTS.md` or template sentence names this case. `AGENTS.md`'s codes table is untouched, since no code is added. - **`--source` itself is unchanged.** The issue names the recorded clone (see Out of scope). ## Rows: `tests/test_adopt_unreadable_clone_git.py` (new, 18) | Row | main `4ed7c7bf5` | this head | |---|---|---| | `test_a_recorded_git_this_user_cannot_read_is_refused_by_name[check,execute x given,cloned x directory,file]` (8, real mode 000, `needs_a_mode`) | 8 failed: the refusal line is missing (`git-failed`, or `source-unclonable` after `gh` was asked) | 8 passed | | `test_a_recorded_clone_whose_git_is_refused_is_not_cloned_again` (in-process, the `stat` of `.git/HEAD` refused, so it runs as root and on Windows too) | failed: `check` read the clone, exit 0 | passed | | `test_a_git_that_can_be_read_or_is_not_there_is_gits_question[5]` (the helper) | 5 failed: no `_git_refused` on main | 5 passed | | `test_a_recorded_git_this_user_can_read_is_read_as_before[given,cloned x directory,file]` (4 controls) | 4 passed | 4 passed | In total: **14 failed and 4 passed on main; 18 passed on this head.** The permission rows skip as root and on Windows, as the repository's other permission rows do. The rows' `at_mode_000` asserts that the mode bites (`os.access(R_OK)` is False), and gives the mode back in a `finally`. ## Mutants Each was applied alone to the committed `adopt-project.py` (sha256 `b2b41532c3a5...`) and its rows run. The file was then restored, and its sha256 checked equal to the commit's every time. `git status` was clean after all of them. **All 8 were killed.** | Mutant | Killed by | |---|---| | M1 the new guard removed (`refused = None`) | 9 failed / 18: the 8 refused-by-name rows and the in-process row | | M2 the guard applied to a readable `.git` (a `PermissionError` returned where the `.git` reads) | 9 failed / 18: the 4 read-as-before rows and the 5 helper rows | | M3 `gh` asked anyway (`Source.clone` of the record asked, then the same refusal raised) | 9 failed / 18: the 8 refused-by-name rows (the `gh` log is not empty) and the in-process row (2 `gh` calls) | | M4 a `.git` whose own `stat` is refused taken as the `.git`'s | 3 failed / 31: #1072's `test_a_recorded_source_this_user_cannot_enter_is_refused_by_name[check-False]`, `[check-True]` and `[execute-True]` (the directory must still be named by itself) | | M5 a `.git` file given the directory's cure | 4 failed / 18: the 4 file rows | | M6 a `.git` file never opened | 4 failed / 18: the 4 file rows | | M7 a `.git` with no `HEAD` refused | 1 failed / 18: `..._is_gits_question[a-git-directory-with-no-head]` | | M8 what cannot be told swapped between `cloned` and `given` | 9 failed / 18 | ## Gate Run at this head `7a2711d0`, 16:35:44Z to 16:46:37Z, with `/usr/bin/python3 -m pytest -p no:cacheprovider -o tmp_path_retention_policy=failed`. The environment had `EMAIL` set; `GIT_ALLOW_PROTOCOL`, `GIT_SSH_COMMAND` and the `LANES_*` variables unset; an empty `GIT_CONFIG_GLOBAL` and `GIT_CONFIG_NOSYSTEM=1`; test author and committer identities; and a stub `gh` first on PATH, with `GH_TOKEN=bogus` and an empty `GH_CONFIG_DIR`. | Set | Result | |---|---| | `test_adopt_unreadable_clone_git.py`, `test_adopt_source_clone_record.py`, `test_adopt_unenterable_source_and_locale.py`, `test_adopt_unsearchable_source.py`, #1091's `test_adopt_root_shape_paths.py` and `test_adopt_root_symlinks.py`, `test_pin_source_unreadable.py`, `test_cli_reference.py`, `test_agents_md_codes.py`, `test_repo_hygiene.py`, `test_scaffold_leg_path_collisions.py` | 839 passed, 3 skipped, rc=0 | | `test_shape_doctor.py`, 8 shards (62, 56, 54, 56, 60, 57, 58, 45 of 448) | 62, 56, 54, 56, 60, 57, 55 + 3 skipped, 45 passed; every shard rc=0 | `test_pin_source_unreadable.py` was added from a grep of `tests/` for `source-unreadable`, `_source_unreadable`, `SOURCE_UNREADABLE_`, `_recorded_source` and `SOURCE_OVERRIDE_HELP`. pyflakes on `adopt-project.py` and the new test file reports nothing. ## #1111's path-guard hygiene test (lane 1's rule, #473 16:26Z) The guard asks the `.git` and its `HEAD` through `adopt-project.py`'s own `_is_a` and `_is_there`. It adds no bare `is_file`, `is_dir`, `exists`, `is_symlink` or `os.path` test. `tests/test_path_guard_hygiene.py` from #1111's head `b4484647` was run on a scratch merge of main `4ed7c7bf5`, #1111 and this head: - **main + #1111 + this head:** 1 failed, 48 passed. The one failure is `test_no_bare_guard_outside_a_stat_helper_or_the_allowlist[adopt-project.py]`, for three sites: - `_PlannedRoot._no_directory`: `self._git().is_dir(here)` - `_PlannedRoot._into_git`: `self._git().is_dir(here.rpartition("/")[0])` - `_clone_ref_store`: `(probe / CLONE_GIT_DIR / "reftable").is_dir()` - **main + #1111 alone, without this head:** the same three sites, the same 1 failed and 48 passed. They come from #1091 (`4ed7c7bf5`, #904), which landed after #1111's head was cut. #1111 needs them allowlisted or fixed before it lands. This PR does not touch them. - **main + #1111 + this head, with only those three sites allowlisted in a scratch copy of the test:** 49 passed. This head adds no site. ## Merge-trees Each was run as `git merge-tree --write-tree` of this head against: | Against | Head | Result | |---|---|---| | `origin/main` | `4ed7c7bf5` | clean, tree `5e784b0f` | | #1125 `fix/1020-bad-id-first-problem` | `2a53a8e6` | clean, tree `76af7e33` | | #1123 `fix/1061-makefile-follow-ups` | `5c3908f8` | clean, tree `12859bc5` | | #1122 `fix/1003-adopt-unenterable-source` (`_source_there`) | `c01c4d73` | clean, tree `6222542f` | | #1121 `fix/1047-next-make-bootstrap` | `1c517375` | clean, tree `e294504f` | | #1120 `fix/1035-source-branch-shown` | `c55e55e3` | clean, tree `46bcc762` | | #1119 `fix/1083-check-asks-the-split-clone` | `9b998936` | clean, tree `dcc12164` | | #1118 `fix/1089-named-link-skip-tests` | `c60066cb` | conflict in `tests/test_adopt_root_shape_paths.py` only, which this head does not touch; #1118 conflicts there with `origin/main` alone too | | #1106 `l3-1078-one-byte-locale` (`_recorded_source`'s `there` line) | `504a1dd6` | clean, tree `e59c5cf4` | | #1105 `fix/1048-makefile-follow-up-gnu-read-order` | `b28f40de` | clean, tree `67d4fec4` | These are every open pull request that changes `adopt-project.py`, `docs/cli.md` or the new test file, as listed at 16:33Z. ## Out of scope Each was measured on this head, and none is changed here: - **`plan --source <a repository whose .git is at 000>`**, and so `check --source` and `execute --source`: `REFUSED git-failed: ... fatal: not a git repository`, exit 2. No `gh` is asked and nothing is cloned, but the refusal does not name the `.git`. The issue names the recorded clone only. A follow-up could give `_top_level` the same guard. - **A readable `.git` directory whose `HEAD` is at 000** (`cloned: true`): still "no longer whole (git finds no repository there)", cloned again, 1 `gh` call. - **A readable `.git` file whose git directory is at 000** (`cloned: true`): the same, 1 `gh` call. - Both of those are other files git reads, not the `.git` the issue measured. Naming every file git might be refused is a wider question, left for a ruling. - **#1111 against main:** see above (#1091's three bare guards). - **#1118 against main:** `git merge-tree` of #1118's head `c60066cb` with main alone conflicts in `tests/test_adopt_root_shape_paths.py`. This head does not touch that file. Closes #1099 Lane: openreposhape-4 (openRepoShape-4) Co-Authored-By: Claude Opus 5.5 <[email protected]>
…nly) into` name the caller's `--out` and `--work-dir` with `_shown`, as the other lines of the report name a path, so a bidi control, a line feed or a tab in either no longer reaches the terminal as it was typed (#1115) (#1154) ## What changes `adopt-project.py` named two caller-typed paths in its output as they were typed. A path holding U+202E or U+2066 turned the line round, a line feed split it and a tab padded it. Both now go through the existing `_shown`, the helper the `source` line, the table and the follow-ups already use (#199, #900): - `cmd_plan` printed `plan written to {out}` with the `--out` path raw. This is the line #1115 names. - `Source.clone` printed `cloning {repository} (read only) into {path}` with the `--work-dir` path raw, for an `org/repo` source only (`plan`, `check` and `execute` all say it). RV1120's review of #1120 found this one (its N4, see #1120), and the comment on #1115 asked for it to be fixed with `--out`. A path whose every character is printable prints exactly as before, unless `_shown` spells it by #900's rule: a path that ends in a space, or one that begins and ends with a backtick. The diff in `adopt-project.py` is 13 lines. ## Behaviour change A path that is not UTF-8 now prints as `\udcff` between backticks on the `plan written to` line, as `_shown` spells it in every other line, where it was written back as the raw 0xff byte before. `tests/test_stdout_encoding.py` pinned the raw byte for that one line, so its two `surrogateescape` rows now hold the spelled form, and one test is renamed to `test_a_name_that_is_not_utf8_is_spelled_and_the_report_still_comes_out`. `tests/test_non_utf8_name_callers.py` calls that test by name and is changed to match. ## Rows `tests/test_adopt_plan_paths_spelled.py` is new: 18 rows, ASCII only (every non-ASCII character is an escape in the source), POSIX only. It runs `plan` as a child with U+202E, U+2066, a line feed, a tab and all four together in `--out` (5 rows) and in `--work-dir` (5 rows), a raw-bidi-control check for each flag (2 rows each), a plain path for each flag that must print unchanged (1 row each), a `./` dot-segment `--out` that must print as it always did, and one run that clones and writes its plan with both flags at once. The `--work-dir` rows use a `gh` that refuses, because the line is said before `gh` runs. - On main's code (038dafb, with only this file added): 15 of the 18 rows fail. The 2 plain-path controls and the `./` row pass there, as they must. - On this head: 18 of 18 pass. ## Mutants 7 of 7 are killed, each restored with its sha256 checked: the `--out` path raw again (M1), the `--work-dir` path raw again (M2), either path spelled with `_spelled` so a plain path gets backticks (M3, M4), `--out` spelled with `_line_shown`, the wrong helper (M5), the spelling put on the repository with the path left raw (M6), and `--out` spelled from `args.out` where the printed value is `out` (M7). ## Gate - Gate run AB, in the landing gate's own environment (stub `gh`, empty global git config): 2098 passed, 4 skipped. - On a scratch merge of this head and main `038dafba9`, which has #1111's `tests/test_path_guard_hygiene.py`: - `test_path_guard_hygiene.py`, the new file, `test_stdout_encoding.py` and `test_non_utf8_name_callers.py`: 150 passed, 1 skipped. - `test_shape_doctor.py`, 448 rows in 8 shards of 56: all 8 shards pass, 445 passed and 3 skipped (the PowerShell rows, which need a Windows host). - `git merge-tree --write-tree` against `origin/main` exits 0, and the merged tree differs from main in exactly the four files of this diff. Against every open PR that changes `adopt-project.py` (#1143, #1141, #1125, #1123, #1122, #1121, #1120, #1119, #1118, #1106, #1105) it exits 0 each time. ## Not in this PR The `--plan` path and `--local-remote-dir` are still printed raw. That is the follow-up #1152. Closes #1115 Lane: openreposhape-4 (openRepoShape-4) Co-Authored-By: Claude Opus 5.5 <[email protected]>
… `--local-remote-dir` path in `execute`'s `bare`, leg and `split` lines, are named with `_shown`, as #1154 names `--out` and `--work-dir`, so a bidi control, an escape, a line feed or a byte that is not UTF-8 in either no longer reaches the terminal as it was typed (#1152) (#1177) ## What #1154 (#1115) names `--out` and `--work-dir` in `plan`'s and `check`'s report with `_shown`. #1152 lists the two groups of paths it leaves raw: the `--plan` path in `check` and `execute`, and the `--local-remote-dir` path in `execute`. A bidi control (U+202E), an ESC or a line break in either reached the terminal as it was typed, where the other plan lines name a path with `_shown`. This change spells each of the 21 sites with `_shown(str(...))`, in `adopt-project.py` only. A path with a character that is not printable is named as `_spelled` names it, between backticks. Every other path prints byte for byte as it did, and no refusal code is new. The `--plan` path, 16 sites: - the five `N finding(s) in <plan>` lines: `_refuse_a_mistyped_plan`, `_refuse_what_check_finds`, the `plan-split-branch-taken` refusal, and `cmd_check`'s two branches; - the `<plan>: ...` refusals: `plan-wrong-kind`, `plan-unsupported-mode`, `plan-unreadable`, `plan-no-source`, the three `plan-bad-id` ones, `plan-not-the-source`, `adopt-topic-too-long`, and the `legs.assembly` and `org:` ones. The `--local-remote-dir` path, 5 sites: - the `<bare> already exists` refusal; - the ` bare <bare>` line; - the two leg lines, in `_extract_leg` and `_seed_leg`, which end `-> <url>`; - the `split <commit> on <branch> -> <url>` line. It names the source's directory under `--local-remote-dir`. The `NEXT:` clone command is not touched. It already quotes the url with `shlex.quote`, and a row pins that it still does. ## Behaviour change A path that is not UTF-8 now prints `\udcff` between backticks, as #1154's paths do, where it printed raw before. A plain path prints as it did. ## Names #1152 calls the wrong-kind refusal `plan-bad-kind`. The code's name for it is `plan-wrong-kind`, and that is the code this change spells. No refusal was renamed. ## Not in this PR `repo_shape.load_yaml`'s own refusals, `yaml-unreadable`, still print a path raw. They live in `scripts/repo_shape.py`, and they are a separate follow-up: see #1168. ## Proof `tests/test_adopt_plan_and_remote_paths_spelled.py` is new, ASCII only and POSIX only, with every non-ASCII character written as an escape. - **Rows: 148.** - 135 plan rows: 14 refusal families (27 family and command pairs) by 5 path forms (U+202E, ESC, a line feed, the byte `\xff` through `surrogateescape`, and a plain control). - 5 `--local-remote-dir` rows for the `bare` and leg lines (the code leg is extracted, the spec leg seeded). - 3 `split` rows. `execute` refuses a source path that holds U+202E, ESC, a line feed or `\xff` as `adopt-unwritable-value` before any leg exists, so these rows use U+200B in the parent directory and a name that ends in a space, and a plain control. - 5 in-process rows for `{bare} already exists`, which call `_create_leg_remote`. - **On main's `adopt-project.py`: 118 failed, 30 passed.** Each failure is the raw path where the spelled one was expected. The 30 that pass are exactly the 30 plain controls. - **On this head: 148 passed.** - **Mutants: 23, all killed.** 21 put one spelling back to raw, one at a time, and 2 swap `_shown` for `_spelled` at one site. Each was restored with its sha256 checked. - **Gate:** a scratch merge of this head with main `961640c68` (tree `61063bb76`, which is the tree of this PR merged into that main). Targeted files only: the new file, `test_stdout_encoding.py`, `test_non_utf8_name_callers.py`, `test_adopt_plan_escapes.py`, `test_path_guard_hygiene.py`, `test_repo_hygiene.py`, `test_scaffold_leg_path_collisions.py`, and every test file that greps for `finding(s) in` or `already exists` (47 files), in 6 shards, and `test_shape_doctor.py` (448 ids) in 8 shards. Every shard exited 0, with 0 failed. | Shard | Result | | --- | --- | | g0 | 617 passed | | g1 | 344 passed | | g2 | 439 passed | | g3 | 605 passed | | g4 | 902 passed | | g5 | 764 passed, 1 skipped | | d0 | 56 passed | | d1 | 56 passed | | d2 | 56 passed | | d3 | 55 passed, 1 skipped | | d4 | 55 passed, 1 skipped | | d5 | 55 passed, 1 skipped | | d6 | 56 passed | | d7 | 56 passed | That is 3671 passed and 1 skipped in the file shards, and 445 passed and 3 skipped in the doctor shards. The skips are Windows-only rows. - **Merge-trees** (`git merge-tree --write-tree`, this head against each), all clean: - `origin/main` `961640c68`; - #1154's head `8a782733`: clean, so this PR is based on main and not stacked on it; - the other 15 open PRs that touch `adopt-project.py`, at their heads: #1171 `159815d75`, #1170 `4df784ac4`, #1169 `b8e63bcf0`, #1153 `ff33ba12a`, #1143 `7af5fabc3`, #1141 `7a2711d03`, #1125 `9549006fe`, #1123 `5c3908f8d`, #1122 `c01c4d73d`, #1121 `1c5173758`, #1120 `c55e55e33`, #1119 `bba168bdd`, #1118 `2307036ab`, #1106 `504a1dd65`, #1105 `b28f40de0`. The other open PRs do not touch `adopt-project.py`. None of the 16 that do adds a line that names `plan.path`, `{bare}`, `finding(s) in` or `already exists`, apart from a tuple in #1121 that is not printed. Closes #1152 Lane: openreposhape-4 (openRepoShape-4) Co-Authored-By: Claude Opus 5.5 <[email protected]>
…: a kept `GNUmakefile/` is a directory GNU make stops at, `python3 scripts/bootstrap.py` names `python` on Windows, and the template says what to run where `make` reads another file (#1207) **#1132, the parts that hold on main: the assembly-root template says what to run where GNU make reads a kept `GNUmakefile` or `makefile` first; a kept DIRECTORY of either name is named as one GNU make stops at, in the `CONTRACTS_DIR` line and in `execute`'s NEXT; every sentence that names `python3 scripts/bootstrap.py` for a person to run names `python` on Windows too; and two follow-up texts no longer say more than is true (RV1105b's NIT-2 and NIT-3a).** This PR was built on main `961640c6`. Lane 4's #1121 (#1047) landed as `0ed3e57f8` at 21:37Z, and this round merged it in (`6fa1edd56`): NEXT now words a kept file (#1121's) and a kept directory (this PR's) through one lookup and one clause. #1105 landed as `12122952b` on 2026-11-08, and this PR merges it in (see "Main merge after #1105"). The items that live only in #1105's code, and the parts of #1121's that this merge does not do, are in their own issue, #1240 (see "Left"). Item 5 is #1206. Lane 4's #1105 (#1048) landed as `12122952b` at 16:45Z. This round merges main into the branch with `git merge origin/main`, never a rebase, and does it twice: - main `46fe6ac19` as merge `7b0192bde`; - then NIT-A in its own commit, `e5e077940`; - then main `9729315f1` as merge `01e93b6d1`, the head. Lane 1's #1123 had landed meanwhile, and one of its rows meets this PR's directory line (see "The second merge, after #1123"). The first merge conflicted in `scripts/shape_materialize.py` only: 3 hunks, all in `collision_follow_up`, as "Landing order" said. `adopt-project.py` and `templates/assembly-root/AGENTS-shape.md` merged with no conflict. Both sides' behaviour stays: #1105's second `GNU_MAKE_READS`, its `_predict_collisions` lookup and its collision line, and this PR's `_make_reads_first`, `_make_reads_first_clause` and NEXT. None of #1240's unification is done here (one tuple, one lookup). ### The three hunks | hunk | this PR (`6fa1edd56`) | main (`46fe6ac19`, #1105) | resolution | |---|---|---|---| | 1. The docstring's NIT-4 sentence | "This said "both callers say it", and `execute` calls it nowhere" | "`Materialized.follow_ups()` would say this of them, and nothing calls it" | **Main's.** Both sides rewrote the same sentence for the same finding. Main's also names `Materialized.follow_ups()`, which #1240's item G changes. So this PR no longer touches that sentence, and the last `scripts/shape_materialize.py` bullet under "What changed" is #1105's text now. | | 2. The docstring's Makefile paragraphs | the `BOOTSTRAP_COMMAND` sentence and NIT-2's tail | the heading "WHERE `make` READS THE MERGED FILE", and the "BUT GNU MAKE READS" paragraph | **Both.** Main's heading and both paragraphs. This PR's sentences on `BOOTSTRAP_COMMAND` and on NIT-2's tail go in the first paragraph, and one new sentence goes in the second: "Both name that command as `BOOTSTRAP_COMMAND` does, `python` on Windows as well (#1132)." | | 3. The returns | two `return`s, each one sentence | `arrive`, `joint`, `meanwhile` and `until` set per branch, then one pair of `return`s | **#1105's structure, with a per-branch `then` in place of `until`.** With no `reads_first`, the line is this PR's, byte for byte. With one, it is #1105's, byte for byte, except that the command a person runs is `BOOTSTRAP_COMMAND`, both in `meanwhile` and in "and then ... runs it". | - **Hunks 1 and 2 carry no code.** In the merged file they sit at lines 1022-1023 and 1032-1070, inside `collision_follow_up`'s docstring (lines 1014-1084). - **The rendered lines.** I loaded the function from `6fa1edd56`, from main, and from the merge, and rendered each `reads_first` (none, `GNUmakefile`, `makefile`) with and without `scripts/bootstrap.py` aside. - With no `reads_first`, the merge equals `6fa1edd56` (2 of 2). - With one, it equals main with " (`python` on Windows)" after `python3 scripts/bootstrap.py` in those two places (4 of 4). For a root that keeps `Makefile` and `GNUmakefile`, the line now ends "...; until then `python3 scripts/bootstrap.py` (`python` on Windows) is what the shape's `make bootstrap` runs". - **NIT-2's tail where `make` reads another file** stays #1105's own: "neither `make bootstrap` nor `python3 scripts/bootstrap.py` runs the shape's bootstrap until then, and then `python3 scripts/bootstrap.py` (`python` on Windows) runs it". #1105's review fixed that branch for the same finding, so it needs nothing more. - **Of #1240's list,** this round does item C for #1105's collision line, as #1240 asks a resolution to say. So the "with `python3`" part of "Left"'s second bullet is done. Item B, the kept directory, stays: #1105's lookup asks `_root_keeps`, so a root that keeps `Makefile` and `GNUmakefile/` is told GNU make "reads the source's `GNUmakefile`". Mutant U3 below shows that no row pins this line for a directory. ### #1105's test pins `tests/test_adopt_collision_make_reads.py` is #1105's file, and it pins the texts this PR changes, as "Landing order" expected. - **Four pins move.** `MERGE_IS_ENOUGH` and `BOTH_MERGES` (no `reads_first`) move to this PR's words. `MEANWHILE` and `SCRIPT_MERGED` (with one) move to `python` on Windows. All four go through a new `COMMAND`. - **One comment changes.** The comment on the `Makefile+scripts` row now says what NIT-2's tail says. - **Measured:** before the move, the six adopt and pin files gave 11 failed and 242 passed, and the 11 are exactly the rows that use those four pins. After the move, 253 passed. - **On main's code:** main `46fe6ac19`'s four production files (`adopt-project.py`, `scripts/shape_materialize.py`, `templates/assembly-root/AGENTS-shape.md` and `README.md`) were swapped into the mutant worktree at `e5e077940`. 64 of the three files' 106 rows fail: - in this file, exactly those 11 rows, and the other 20 pass; - in the new file, 34 of 35, as before (NIT-4's row passes); - in `tests/test_adopt_next_make_reads_first.py`, 19 of 40, as before. The four files were then restored, each matched the head by sha256 (4 of 4), and the tree was clean. ### NIT-A `tests/test_adopt_next_make_reads_first.py:64` called #480's NOTE "unchanged", but the merge of #1121 moved that pin to `python` on Windows. The comment now says the NOTE "names `python` on Windows too since #1132". The change is a comment only, in its own commit. ### The second merge, after #1123 Lane 1's #1118 and #1123 landed while the first merge was being gated: `9ec0dc79c` at 17:30Z and `9729315f1` at 17:47Z. Both merge with `e5e077940` with no conflict in the text. The predicted merge with `9ec0dc79c` passed (gate P below). The predicted merge with `9729315f1` failed 1 row of 254 (gate P2): - **The row:** #1123 adds `test_a_name_only_a_disk_that_ignores_case_takes_for_makefile[makefile-directory]` to `tests/test_adopt_make_reads_first.py`. For a kept DIRECTORY `makefile/`, it expects the `CONTRACTS_DIR` line a kept `makefile` FILE gets ("only once `makefile` does"). #1123's own message says that line is not true for a directory, and that the row works as a crash guard for `twins` in `_makefile_follow_up`. This PR changes exactly that line: a kept directory is one GNU make stops at. - **The fix, in the merge `01e93b6d1`:** the row now expects `SHAPES + written_as("makefile")`, as #1123 wrote it, which is the part that guards `twins`. This PR's directory clause follows, through a new `stops_at` helper beside `reads`. The comment above `ANSWERED` and the row's docstring now say so. Nothing else changes in the merge. - **Mutants on the row.** Each ran alone in the mutant worktree at `01e93b6d1` against `tests/test_adopt_make_reads_first.py` (34 rows). Each was restored with `git checkout` and matched by sha256 (`adopt-project.py` `3c2cb5f5bea5`), and the tree was clean after each. | id | mutant | rows failing | result | |---|---|---|---| | D1 | `_make_reads_first` drops a directory's `/`, so the line is the one #1123's row pinned | 1 of 34, the row | killed | | D2 | #1123's R10: `twins` reads the entry with its slash | 1 of 34, the row, with `IndexError` | killed | ### Mutants on the resolution H3a-H3g and U1-U3b are the first merge's. All ran in the mutant worktree at `e5e077940`. - **Method:** each mutant was applied alone, then restored with `git checkout`. Each restore matched by sha256 (`shape_materialize.py` `b18f09d7c396`, `adopt-project.py` `2055a81acdc6`), and the tree was clean after each. - **Rows:** H3a-H3g, U3 and U3b ran against 93 rows: `tests/test_adopt_collision_make_reads.py` (31), the new file (35) and `tests/test_adopt_e2e.py` (27). U1 ran against the new file, `tests/test_adopt_make_reads_first.py` (33) and `tests/test_adopt_collision_make_reads.py`, 99 rows. U2 ran against the new file and `tests/test_adopt_next_make_reads_first.py` (40), 75 rows. - **Unmutated,** every row passes (gate A below). | id | mutant | rows failing | result | |---|---|---|---| | H3a | hunk 3, no `reads_first`: `meanwhile` back to main's plain `python3` | 4 of 93 | killed | | H3b | hunk 3, no `reads_first`: the script tail back to main's "before both merges are made" | 4 of 93 | killed | | H3c | hunk 3, with `reads_first`: `meanwhile` without `BOOTSTRAP_COMMAND` (main's) | 5 of 93 | killed | | H3d | hunk 3, with `reads_first`: "and then ... runs it" without `BOOTSTRAP_COMMAND` (main's) | 3 of 93 | killed | | H3e | hunk 3, with `reads_first`: this PR's tail in place of #1105's | 3 of 93 | killed | | H3f | hunk 3: `reads_first` ignored, so the resolution is this PR's side whole | 15 of 93 | killed | | H3g | hunk 3, with `reads_first`: #1105's `joint` ("; and") lost | 3 of 93 | killed | | U1 | `_makefile_follow_up` drops `_make_reads_first` (`first = None`) | 31 of 99 | killed | | U2 | `_next_steps` drops `_make_reads_first` (`first = None`) | 35 of 75 | killed | | U3 | `_predict_collisions` asks `_make_reads_first` in place of #1105's lookup | 0 of 93 | **survived** | | U3b | `_predict_collisions` passes no `reads_first`, so #1105's lookup is lost in the merge | 15 of 93 | killed | - **H3c and H3d** are killed only by rows that use the moved `MEANWHILE` and `SCRIPT_MERGED`. Those pins are what hold `BOOTSTRAP_COMMAND` in #1105's branch. - **U3 survives,** and that is #1240's item B. For a kept file, both lookups give the same name. They differ only for a kept directory, where `_make_reads_first` adds the `/`, and no row runs `_predict_collisions` on a root that keeps `Makefile` and `GNUmakefile/`. A row now would pin the line #1240 is to correct, so this round adds none. ### Runs Each run went through the lane's runner, with git-filter-repo 2.47.0 (CI's pin) on PATH, on a commit with a clean tree. | run | git | files | passed | failed | skipped | |---|---|---|---|---|---| | gate A2 | 2.43.0 | `01e93b6d1`, the head: the 12 files below | 1096 | 0 | 3: the PowerShell rows (`test_shape_doctor.py:10516`), which run only on a Windows host | | gate B2 | 2.47.1 | `01e93b6d1`: the same 12 files | 1096 | 0 | 3: the same | | gate A | 2.43.0 | `e5e077940`, after the first merge: the 12 files below | 1095 | 0 | 3: the same | | gate B | 2.47.1 | `e5e077940`: the same 12 files | 1095 | 0 | 3: the same | | gate P | 2.43.0 | the predicted merge of `e5e077940` with main `9ec0dc79c` (#1118; tree `ba3f3c1f3`, a local commit object, not pushed): the six adopt and pin files, plus #1118's `tests/test_adopt_root_shape_paths.py` and `tests/test_adopt_symlink_target_bytes.py` | 509 | 0 | 0 | | gate P2 | 2.43.0 | the predicted merge of `e5e077940` with main `9729315f1` (#1123; tree `0eb290ae2`, a local commit object): the six adopt and pin files | 253 | 1: #1123's `makefile-directory` row, which the second merge moves | 0 | | gate P4 | 2.43.0 | the predicted merge of `01e93b6d1` with main `801a7d6d0` (#1106; tree `25bc27d39`, a local commit object): the six adopt and pin files, plus #1106's `tests/test_adopt_one_byte_locale.py` and `tests/test_adopt_unenterable_source_and_locale.py` | 277 | 0 | 0 | The files are the six adopt and pin files (`tests/test_adopt_collision_make_reads.py`, `tests/test_pinned_copy_text.py`, the new file, `tests/test_adopt_next_make_reads_first.py`, `tests/test_adopt_e2e.py` and `tests/test_adopt_make_reads_first.py`, 253 rows), plus `tests/test_shape_doctor.py` and `tests/test_scaffold_leg_path_collisions.py`, which adopt changes need, plus the hygiene five (`test_path_guard_hygiene.py`, `test_repo_hygiene.py`, `test_agents_md_codes.py`, `test_cli_reference.py` and `test_pinned_copy_text.py`). That is 1098 rows in one run at `e5e077940`, and 1099 at `01e93b6d1`, where #1123 adds one row. All of this was measured on main `961640c68` with GNU make 4.3, offline. | item | on main | |---|---| | 1, the template | `AGENTS-shape.md` (the "Work from here" paragraph and the five-commands table) and `README.md` (Get started, and the parking steps) give `make bootstrap` with no caveat. With the template's own `Makefile` beside a plain `GNUmakefile` or `makefile`, `make -n bootstrap` exits 2, `No rule to make target 'bootstrap'`. | | 2, a kept directory | With `GNUmakefile/` or `makefile/` beside `Makefile`, `make bootstrap` exits 2 with `make: *** GNUmakefile: Is a directory. Stop.`, or the same with `makefile`. It does this for every target, and for each directory alone too. Main's `CONTRACTS_DIR` line says "`make` there exports `CONTRACTS_DIR` only once `GNUmakefile` does". NEXT prints `make bootstrap` for a root that keeps only `GNUmakefile/`. Beside a kept `Makefile`, it prints #480's NOTE that the targets "arrive only once the follow-up merges the two". Rendered by the lane's `probe_texts.py` on main. | | 3, `python3` | The template's `scripts/bootstrap.py` says `python3 scripts/bootstrap.py (python on Windows)`. #480's NOTE and the Makefile collision follow-up's "until then" name `python3` alone. | | NIT-2 | The no-`reads_first` script-aside tail says "neither `make bootstrap` nor `python3 scripts/bootstrap.py` runs the shape's bootstrap before both merges are made". In a root that keeps its own `Makefile` and `scripts/bootstrap.py`, merging the script alone makes `python3 scripts/bootstrap.py` print the shape's `SHAPE-BOOT`, while `make bootstrap` still exits 2. Measured again by a row below. | | NIT-3a | `_predict_collisions` says the wording comes from "the same function `execute` reports its actual collisions through", and `collision_follow_up` says "Both callers say it". `execute` never calls `collision_follow_up`: it carries the plan's stored `follow_ups:` into the split message. | `adopt-project.py`: - **`_make_reads_first(surviving)`** gives the first of `GNUmakefile` and `makefile` the root keeps. It reads `GNU_MAKE_READS`' order, asks the way `_root_keeps` asks, and adds a `/` for a DIRECTORY. **`_make_reads_first_clause`** words the clause. For a file, the words are main's, byte for byte. For a directory, it says: "GNU make at the root stops at the source's directory `GNUmakefile/`, the first of `GNUmakefile`, `makefile` and `Makefile` it finds (`GNUmakefile: Is a directory.`), so ... only once the root keeps no directory of that name". - **`_makefile_follow_up`** (the `CONTRACTS_DIR` line) asks both. A kept file's line is unchanged: `tests/test_adopt_make_reads_first.py` passes as it is. - **`_next_steps`** takes `surviving=`, the plan's root paths, which `cmd_execute` passes as `paths_for["root"]`, as #1121 does. - Where a kept DIRECTORY stops make, the command is `python3 scripts/bootstrap.py`. The NOTE says GNU make stops there. Beside a kept `Makefile`, it also says the targets run there once the follow-up merges the two, and only once the directory is gone. Where the script went aside too, alone or with the `Makefile`, the NOTE names that command after the merges. - Since the merge of #1121, a kept FILE goes through the same lookup and the same clause. For a file the clause gives #1121's words byte for byte, and its NOTEs end in `BOOTSTRAP_COMMAND` too. - **`BOOTSTRAP_COMMAND`** is in every NOTE: #480's, #1121's and the directory's. Each command line a person pastes stays `python3 scripts/bootstrap.py`. - **`_predict_collisions`' docstring** says what the plan stores and what `execute` carries (NIT-3a). `scripts/shape_materialize.py`: - **`BOOTSTRAP_COMMAND`** = "`python3 scripts/bootstrap.py` (`python` on Windows)", as the template's script names it. - **The Makefile collision follow-up** says "until then `python3 scripts/bootstrap.py` (`python` on Windows) is what `make bootstrap` runs". - **Where the script went aside too,** the follow-up says "so `python3 scripts/bootstrap.py` (`python` on Windows) runs the shape's bootstrap once the script is merged, and `make bootstrap` once both merges are made" (NIT-2). - **The docstring's "Both callers say it"** paragraph says what is true (NIT-3a's twin, #1105's review NIT-4). #1105 made the same fix, and the merge keeps main's text (see "Main merge after #1105"). `templates/assembly-root/`: - **`AGENTS-shape.md`:** the "Work from here" paragraph adds "; where the root keeps a `GNUmakefile` or a `makefile`, which GNU make reads before `Makefile`, run `python3 scripts/bootstrap.py` (`python` on Windows), which is what the shape's `make bootstrap` runs." A sentence after the five-commands table says they are the shape's Makefile's targets, which `make` at the root reaches only where the file it reads first holds them, or includes a Makefile that does. - **`README.md`:** one sentence after Get started covers `make bootstrap` "here and below". A second says `make park` and `make resume` below work there only where that file holds them, or includes a Makefile that does. - **This is a template byte change, so every project re-pins.** No digest of either file is stored in this repository. `tests/` was grepped for every changed line, and only this PR's own rows pin them (see "Template pins"). Tests: - **`tests/test_adopt_e2e.py`:** two pins move to the new words, at :312 (the "until then" sentence) and at :447-450 (NIT-2's tail). - **`tests/test_adopt_next_make_reads_first.py`** (#1121's): the merge moves three pins, `OWN_MAKEFILE_NOTE`, `RUNS` and `script_aside`, to `python` on Windows. #480's NOTE merged with no textual conflict, so without them its rows fail. - **The new file `tests/test_adopt_make_bootstrap_followups.py`** has 35 rows: - the template's sentences, held to its `Makefile` (`PYTHON ?= python3`, `bootstrap:` runs `$(PYTHON) scripts/bootstrap.py`) and to `scripts/bootstrap.py`'s own words; - `make -n bootstrap` against the template's `Makefile` beside each kept name, each row asserting the `AGENTS-shape.md` caveat that measurement backs; - `_make_reads_first` (10 roots); - the `CONTRACTS_DIR` line for 4 directory roots; - NEXT for a directory, beside a kept `Makefile` (both names), after both merges, and after the script's merge alone; - #480's NOTE, called both as main's signature allows and with `surviving=`; - the collision follow-up's two sentences; - NIT-2 measured with the template's `Makefile` and stand-in scripts, and tied to the follow-up's new tail; - three real adoptions of a source holding `GNUmakefile/rules.mk`. One is kept by a `--path-policy` rule, so `plan` writes the line, `check` prints it and the split message carries it. One is answered `root`. In both, NEXT is asserted, `make -n bootstrap` in the pasted clone exits 2 with `GNUmakefile: Is a directory.`, and the printed command exits 0. In the third, the question is answered `code`: NEXT names `make bootstrap`, and that command runs in the pasted clone. ### This round (#1207's review, issuecomment-6374516382) | finding | what changed | |---|---| | SHOULD-1 | A row pins NEXT where only `scripts/bootstrap.py` went aside beside a kept `GNUmakefile/` (`test_next_after_the_script_merge_names_python3_where_make_stops`). It fails under the review's mutant X1. | | SHOULD-2 | The "Left" list is one issue, #1240. | | SHOULD-3 | "Landing order", below. #1121 landed while this round ran, and is merged and resolved here. | | NIT-1 | `AGENTS-shape.md`'s sentence after the table loses "(above)": nothing above names a Makefile that includes another. | | NIT-2 | `README.md` names `make park` and `make resume`. | | NIT-3 | Beside a kept `Makefile`, the directory NOTE names the merge as well as the directory. Its row is parametrized over `GNUmakefile/` and `makefile/`. | | NIT-4 | An adoption sends `GNUmakefile/` to the code leg, and NEXT names `make bootstrap`. It fails under the review's mutant X6. | | NIT-5 | The notes for the squash message at landing, below. | Measured at the merge head `6fa1edd56`, in a scratch worktree: - main `0ed3e57f8`'s bytes of the four production files (`adopt-project.py`, `scripts/shape_materialize.py`, `templates/assembly-root/AGENTS-shape.md`, `templates/assembly-root/README.md`) were checked out over the head; - the new file (35 rows) and `tests/test_adopt_next_make_reads_first.py` (40 rows) ran through the lane's runner; - the four files were restored with `git checkout`, and each matched the head by sha256 (`c94bd19b`, `12555f39`, `8660bafb`, `b3f9409b`). | file | fail on main | pass on main | |---|---|---| | the new file | 34 | 1: `test_an_adoption_sending_a_gnumakefile_directory_to_a_leg` | | `tests/test_adopt_next_make_reads_first.py` | 19 | 21 | Main now has #1121, so its `_next_steps` takes `surviving=`. The NEXT rows for a kept directory therefore fail on their words, not on a `TypeError`. Main reads `GNUmakefile/` as a file: "then run `python3 scripts/bootstrap.py`; GNU make at the root reads the source's `GNUmakefile`, ...". This is the case for the SHOULD-1 row, the after-the-merges row, both directory rows, and NIT-3's `makefile/` row. The new file's other rows fail on main for these reasons: - the template rows: main's `AGENTS-shape.md` and `README.md` lack the sentences; - `_make_reads_first`: main has no such helper; - the `CONTRACTS_DIR` line: "only once `GNUmakefile` does"; - the NOTE and collision rows: plain `python3`, and NIT-2's old tail; - the two adoptions that keep the directory. The one new row that passes on main is NIT-4's. It sends `GNUmakefile/` to the code leg, and there main's NEXT is already `make bootstrap`. It guards what main has: under the review's mutant X6, which hands NEXT every leg's paths, it is the row that fails. The 19 rows of #1121's file that fail on main are exactly the rows that use the three pins this merge moved (`OWN_MAKEFILE_NOTE`, `RUNS`, `script_aside`). The 21 that pass use none of them. Earlier heads, on main `961640c68` and with the same method: `1c7ca5c6d` failed 29 of 35 rows, and `8b499842f` failed 34 of 35 (the new file plus the three `tests/test_adopt_e2e.py` rows the mutants use). **This round**, at `75c90b6db`, in a scratch worktree. Each mutant was applied alone and restored, and each file's sha256 was checked against the commit (4/4 every time). Each ran against 95 rows: the new file (35), `tests/test_adopt_e2e.py` (27) and `tests/test_adopt_make_reads_first.py` (33). Unmutated, all 95 pass. | id | mutant | rows failing (of 95) | result | |---|---|---|---| | X1 | the review's: the script-only NOTE names `make bootstrap` after the merge (`if stops and makefile`) | 1 | killed | | X6 | the review's: `cmd_execute` passes every leg's paths | 1 | killed | | N1 | NIT-3 undone: beside a kept `Makefile`, no merge named | 2 | killed | | N2 | the merge named where the script went aside too | 1 | killed | | N3 | the merge named where no `Makefile` was kept | 4 | killed | | T1 | NIT-1 undone: "(above)" back | 1 | killed | | T2 | NIT-2 undone: README's `make park` / `make resume` sentence removed | 1 | killed | The merge with #1121 rewrote the clause code that N1-N3 mutate (`stopped` became `reads`, and the merge condition gained `stops`). The mutants were not run again at `6fa1edd56`. **Earlier,** 18 mutants at `1c7ca5c6d` against 43 rows, each applied alone in a scratch worktree and restored with its sha256 checked: | id | mutant | rows failing (of 43) | result | |---|---|---|---| | M1 | `_make_reads_first` drops the `/` of a directory | 14 | killed | | M2 | the clause's directory branch never taken | 10 | killed | | M3 | NEXT ignores a kept directory (`stops = None`) | 6 | killed | | M4 | NEXT's command stays `make bootstrap` for a directory | 4 | killed | | M5 | `cmd_execute` passes `surviving=()` | 2 (the two adoptions) | killed | | M6 | `BOOTSTRAP_COMMAND` without `(python on Windows)` | 12 | killed | | M7 | NIT-2's tail back to "neither ... before both merges are made" | 2 | killed | | M8 | `AGENTS-shape.md`'s "Work from here" caveat removed | 1 | killed | | M9 | the sentence after the five-commands table removed | 1 | killed | | M10 | `README.md`'s sentence removed | 1 | killed | | M11 | #480's NOTE back to plain `python3` | 1 | killed | | M12 | the collision follow-up's "until then" back to plain `python3` | 2 | killed | | M13 | after the merges, NEXT says `make bootstrap` where a directory stops make | 1 | killed | | M14 | the lookup takes the LAST kept name (`reversed`) | 4 | killed | | M15 | the directory NOTE's lead ignores a kept `Makefile` | 1 | killed | | M16 | the lookup folds case (`fold=True`) | 4 | killed | | M17 | the clause drops GNU make's own words (`GNUmakefile: Is a directory.`) | 10 | killed | | M18 | the file clause says `does` whatever `has` is | 0 | **survived** | M18 was equivalent before the merge: the file clause's only caller was the `CONTRACTS_DIR` line. Since the merge, #1121's NOTE calls it with `has them`, and `tests/test_adopt_next_make_reads_first.py` pins that wording. M18 was not run again. Each run went through the lane's runner: `gh` stubbed first on PATH with a bogus token, `GIT_SSH_COMMAND=false`, `GIT_CONFIG_GLOBAL=/dev/null`, `EMAIL` set, `-p no:cacheprovider`, and `tmp_path_retention_policy=failed`. Each run is on a commit, with a clean tree. | run | commit | git | files | passed | failed | |---|---|---|---|---|---| | gate M | `6fa1edd56`, the merge | 2.43.0 | the new file, `test_adopt_next_make_reads_first.py`, `test_adopt_e2e.py`, `test_adopt_make_reads_first.py`, `test_path_guard_hygiene.py`, `test_repo_hygiene.py`, `test_agents_md_codes.py`, `test_cli_reference.py`, `test_pinned_copy_text.py`, `test_scaffold_leg_path_collisions.py` | 618 | 0 | | gate N | `6fa1edd56` | 2.47.1 | the new file and `test_adopt_next_make_reads_first.py` (75), then `test_adopt_e2e.py` (27), run one after the other | 102 | 0 | | gate H | `6fa1edd56` | 2.47.1 | the hygiene five | 379 | 0 | | gate A2 | `75c90b6db` | 2.43.0 | the new file, `test_adopt_e2e.py`, the hygiene five (`test_path_guard_hygiene.py`, `test_repo_hygiene.py`, `test_agents_md_codes.py`, `test_cli_reference.py`, `test_pinned_copy_text.py`), `test_adopt_make_reads_first.py`, `test_adopt_contracts_dir.py`, `test_adopt_printed_sentences.py`, and the template's readers: `test_scaffold_e2e.py`, `test_scaffold_free_text_values.py`, `test_free_plan_hint.py`, `test_template_quoted_values.py`, `test_template_values_single_pass.py`, `test_template_text_placeholders.py`, `test_bootstrap_placement_texts.py`, `test_park_resume_targets.py`, `test_update_shape_hardlink.py` | 1128 | 0 | | gate A | `1c7ca5c6d` | 2.43.0 | 17 files (the new file, `test_adopt_e2e.py`, the hygiene five, `test_scaffold_leg_path_collisions.py`, `test_adopt_make_reads_first.py`, `test_adopt_contracts_dir.py`, `test_adopt_printed_sentences.py`, `test_adopt_attributes_eol_block.py`, `test_adopt_leg_path_collisions.py`, `test_scaffold_e2e.py`, `test_bootstrap_placement_texts.py`, `test_park_resume_targets.py`, `test_template_text_placeholders.py`) | 966 | 0 | | gate B | `1c7ca5c6d` | 2.47.1 | the new file, `test_adopt_e2e.py`, `test_path_guard_hygiene.py`, `test_repo_hygiene.py` | 209 | 0 | | doctor | `1c7ca5c6d` | 2.43.0 | `test_shape_doctor.py`, `test_scaffold_leg_path_collisions.py` | 549 (3 skipped: the PowerShell rows, which run only on a Windows host) | 0 | `tests/` was grepped for every line this PR changes in `templates/assembly-root/` ("They are the shape", "reads first holds", "includes a Makefile that", "(above)", "here and below", "Where this root keeps", "it is what the shape", "before `Makefile`", "`python` on Windows"). Only `tests/test_adopt_make_bootstrap_followups.py` pins them. Four other files read the README as a whole, and each passes in gate A2: - `test_scaffold_free_text_values.py` counts its lines against the template; - `test_free_plan_hint.py` looks for "Free plan" and `--repo`; - `test_template_quoted_values.py` and `test_template_values_single_pass.py` render it. `git merge-tree --write-tree` of the head `01e93b6d1`, on git 2.43.0, at 18:11Z. - **Main** `9729315f1`, fetched again at 18:11Z, is the main this round merged last. The merge-tree is clean, and its tree is the head's own, `f6488542f`. - **Main moved to `801a7d6d0`** at 18:14Z, when lane 3's #1106 landed (`adopt-project.py` and two locale test files). The merge with it is clean, tree `25bc27d39`, and gate P4 passed on it. It was not merged in: it touches none of the code this round resolves, and landing refreshes the branch anyway. - **The open PRs:** one `gh pr list --state open --limit 100 --json number,headRefName,headRefOid,files` read at 18:11Z returned 51 open PRs. 26 of them touch one of this PR's paths. That includes `tests/test_adopt_collision_make_reads.py` and `tests/test_adopt_make_reads_first.py`, which this PR now changes. 25 merge cleanly: #1106, #1120, #1122, #1125, #1141, #1143, #1153, #1154, #1170, #1171, #1177, #1178, #1186, #1189, #1194, #1198, #1210, #1225, #1244, #1249, #1251, #1252, #1253, #1265 and #1268. #1106 has landed since (above). - **Lane 1's #1189** (`472944b5d`, read fresh at 18:11Z) edits three test files that this round changes too: `tests/test_adopt_next_make_reads_first.py`, `tests/test_adopt_collision_make_reads.py` and `tests/test_adopt_make_reads_first.py`. The merge is clean, tree `7fd030b29`. #1189's hunks are in the imports, in the clone rows' parameter lists and docstrings, and in a new refusal row, away from the moved pins, the `makefile-directory` row and NIT-A's comment. On that predicted merge, a local commit object, the three shared files pass on git 2.43.0: `tests/test_adopt_make_reads_first.py` and `tests/test_adopt_collision_make_reads.py` give 62 passed, and `tests/test_adopt_next_make_reads_first.py` gives 38 passed. There are fewer rows than at this head because #1189 leaves out the clone rows that keep case twins. - **#1237** (`b557859fd`) conflicts in `tests/test_adopt_check_throwaway_repos.py`, a file this PR does not change. Main conflicts with #1237 in that file too, while `6fa1edd56` did not, so the conflict is main's, carried in by the merge. - **Main moved again after the round** (rv1207e, at 19:25Z): lane 1's #1143 landed as `81eaf757c` (`adopt-project.py`) and lane 4's #1117 as `9252ef208` (README, the handbook and `scripts/family.py`). The head merges clean with both (trees `e40373967` and `279f8c6ce`), and rv1207e's gate P passed on the predicted merge with `9252ef208` (359 passed). At 19:22Z, 48 PRs were open, 24 touch this PR's files, and 23 merge clean; #1237's conflict is main's, as above. - **No longer on the list:** #1105, #1121, #1118 and #1123 are on main. Since `6fa1edd56`, #1104, #1160, #1169, #1180, #1190 and #1223 landed too. The conflicts are the same in every order, measured offline both ways round and with predicted squashes: - **#1121:** 4 hunks, 84 lines, in `adopt-project.py`'s `_next_steps` and `cmd_execute`'s comment. - **#1105:** 3 hunks, 65 lines, in `scripts/shape_materialize.py`'s `collision_follow_up`: its docstring's NIT-4 sentence, its paragraph on the Makefile's merge, and its two `return`s. - #1121 and #1105 merge with each other cleanly, and so do #1104 and this PR. So the order decides only who resolves them. **Both have landed**, and lane 5 resolved both on this branch: - **#1121** (merge `6fa1edd56`). The resolution is one lookup and one clause, `BOOTSTRAP_COMMAND` in #1121's NOTEs, and #1121's three test pins moved. - **#1105** (merge `7b0192bde`, see "Main merge after #1105"). The resolution keeps #1105's `reads_first` branch and runs `BOOTSTRAP_COMMAND` through it. NIT-2's tail is this PR's where `make` reads the merged `Makefile`, and #1105's where `make` reads another file. Four of #1105's test pins moved: `MERGE_IS_ENOUGH`, `BOTH_MERGES`, `MEANWHILE` and `SCRIPT_MERGED`. Main was merged in once more after lane 1's #1123 (merge `01e93b6d1`): one of #1123's rows pinned the line this PR changes for a kept `makefile/` directory, and it moved (see "The second merge, after #1123"). No other PR has to land first now. `6fa1edd56` was re-checked READY (rv1207b, rv1207c and rv1207d, issuecomment-6722602375). The head, `01e93b6d1`, needs a check of its delta since then: the two merges' resolutions, the four moved pins in #1105's file, #1123's moved row, and NIT-A. #1240 tracks what this PR leaves: - #1132's item 4 (one `GNU_MAKE_READS`, one lookup); - #1105's collision line, for a kept directory (its `python3` part is done here: see "Main merge after #1105"); - #1121's file NOTE beside a kept `Makefile`, which does not name the merge (as this PR's directory NOTE now does); - #1105's second review's NIT-1, NIT-3b, NIT-3c, NIT-4 and NIT-5; - `_make_reads_first_clause`'s `has` argument, now live; - rv1207e's NIT-1: the docstring sentence "With none, the Makefile's follow-up is what it was, byte for byte" (`scripts/shape_materialize.py` about :1067), kept from #1105, is no longer true, since this PR changes the line with no `reads_first`. It sits beside #1240's items F and G, which reword the same docstring. The local branch `fix/1132-template-bootstrap-stacked` (`9eb5cce0b`, never pushed and never tested) is a model of the end state on #1105 + #1121 + main. - **Item 5,** follow-ups that go stale after a hand edit of the plan, is its own issue, filed as #1206. It also holds the three related cases this work found: - a kept `makefile/` directory gets "until the two are merged"; - a directory kept only through deeper entries is not seen by `_root_keeps`; - a kept `Makefile/` directory is treated as a Makefile. - **This PR's `answered-root` row meets item 5 too.** `plan` asks about `GNUmakefile/`, and its stored `CONTRACTS_DIR` line, written before the answer, names no directory. The row asserts what NEXT and `make` do there, and not that line. - **Not measured:** a disk that ignores case, and GNU make other than 4.3. Review: rv1207b and rv1207c, lane 5's independent opus reviewers, and rv1207d, lane 5's independent sonnet reviewer, none of which wrote #1207: READY at `6fa1edd5` (issuecomment-6722602375). Then rv1207e, lane 5's independent opus reviewer, which wrote none of it: READY at `01e93b6d`, H0 of this landing, after the main merges past #1105 and #1123 (issuecomment-6726033282), with no MUST or SHOULD; its three NITs are answered in the body. CI (Brett Heap's ruling 27 and his fast-refresh ruling of 2026-10-15T22:48:35Z): H0 01e93b6 passed tests, tests-git-bash and SonarCloud; the head c9be952 is a clean update-branch merge of main 9cb156a, with tests-git-bash and SonarCloud green; and the local gate passed on its predicted squash tree 0a01d35 over main 9cb156a: the adopt_collision_make_reads, adopt_e2e, adopt_make_bootstrap_followups, adopt_make_reads_first, adopt_next_make_reads_first, repo_hygiene, agents_md_codes, cli_reference sets, 333 passed. Landed on Brett Heap's word of 2026-10-23T13:10:26Z, relayed to every lane by lane 3 (#473 issuecomment-6365697123): "merge v1.2.1 PRs once reviewed and green". Closes #1132 Lane: openreposhape-5 (openRepoShape-5) Co-Authored-By: Claude Opus 5.5 <[email protected]>
…not text as `_read_as` says what the plan's reader read, "records `commit:` as the number 7", where it spelled it as Python does, `commit: 7` and `True`, so `check` and `execute` name it in the words the plan's other refusals use under the same `plan-pin-malformed` (#1114) (#1198) This PR lands only after the v1.2.0 tag, on Brett's word. ## What `_pin_row_problem` holds each of a pin's five fields (`product`, `repository`, `commit`, `tree_sha256`, `digest_source`) to text. A value that is not text it spelled with Python's `repr`: a number as `commit: 7`, a boolean as `True`, a list as `['a', 'b']` and a mapping as `{'k': 'v'}`. Every other refusal of a plan's value says what the reader read, with `_read_as`: "the number 7", "the boolean true", "a list of 2 item(s)", "a mapping of 1 key(s)". W1020 found the gap while working on #1020. It says it that way now, field by field, in `adopt-project.py`'s `_pin_row_problem`, in the `not_text` branch only: - one field: ``records `commit:` as the number 7, which is not text`` - two or more: ``records `commit:` as the number 7, `tree_sha256:` as the boolean true, which are not text`` What stays as it was: - the code, `plan-pin-malformed`, the remedy, and the sentence's ending, `which is not text`; - every text value's spelling, byte for byte (`commit: '7'`, which is not 40 hex); - a null or a blank: it is "records no `commit:`" under the code it has always had, and no value is spelled there. Every field takes the one site (`PIN_FIELDS`). The docstring and a comment say so. The change is 13 lines added and 4 removed in `adopt-project.py`. ## Behaviour change A pin field that is a number, a boolean, a list or a mapping is named by what it was read as, where it was named as Python spells it. A text value, a null and a blank print as they did. ## Rows `tests/test_adopt_pin_row_values.py` is new, ASCII only, with 45 rows. Each runs `check` and then `execute --yes`, with a stub `gh` first on PATH and `--local-remote-dir`, and asserts one finding, `execute` refusing with that same finding, an empty `gh` log, no remotes directory made and no Traceback. | Group | Rows | On main's code | On this head | | --- | --- | --- | --- | | The matrix: 5 fields by number, boolean, list, mapping | 20 | 20 failed | 20 passed | | The whole sentence: `commit: 7`, and a boolean `digest_source` | 2 | 2 failed | 2 passed | | Edge forms: 0, false, 7.5, -3, 007, `[]`, `{}`, `[a]` | 8 | 8 failed | 8 passed | | Two fields at once, a non-text commit beside bad text, entry 2 | 3 | 3 failed | 3 passed | | Null and blank controls | 6 | 6 passed | 6 passed | | Text controls (`commit: "7"` and `"true"`, another product, no owner, short digest, source by hand) | 6 | 6 passed | 6 passed | | **All** | **45** | **33 failed, 12 passed** | **45 passed** | Every one of the 33 failures is the finding text holding the repr spelling (``records `commit: 7` ``, `True`, `['a', 'b']`, `{'k': 'v'}`, `{}`, `[]`). There is no crash or other cause. The 12 that pass on main are the controls, which pin what must not change. Two existing rows pinned the old spelling, and no others did. Each now expects the new one, and both pass on this head (2 passed): - `tests/test_adopt_pins.py`, the `a-number-commit` row: `` `commit:` as the number 1234567 ``; - `tests/test_adopt_plan_value_order.py`, the `not-text` row: `` `digest_source:` as the number 7 ``. ## Mutants 19 mutants of this head's `adopt-project.py`, all killed. Each was run against the new file (first failure with `-x`, or a whole run where the table says so), and each run was restored with its sha256 checked. | Mutant | Result | | --- | --- | | M1: main's repr form put back | killed, 33 failed and 12 passed | | M2: `!r` inside the new "as" form | killed, 33 failed and 12 passed | | M3: `str()` in place of `_read_as` | killed | | F-repr-product, F-repr-repository, F-repr-commit, F-repr-tree_sha256, F-repr-digest_source: repr put back for one field only | 5 of 5 killed, each by that field's own rows | | M4: "is" in place of "as" | killed | | M5: singular and plural swapped | killed | | M6: only the first field named | killed | | M7: `missing` takes any falsy value (an existing guard; the zero, false and empty rows pin it) | killed | | M8: only a list and a mapping counted as not text | killed | | M9: the ending without "how it was read" | killed | | M10: the code `plan-pin-unrecorded` | killed | | T1 to T4: the text branches unquoted (commit, product and repository, digest, source) | 4 of 4 killed | ## Gate A scratch merge of this head `d38e4e36d` with main `961640c68`: commit `1ef3f0783`, tree `b12197610`, which is this head's own tree. Targeted files only, in the landing gate's environment (a stub `gh` first on PATH, `GH_TOKEN=bogus`, an empty `GH_CONFIG_DIR`, an empty global git config). The set is 47 test files: every one that names `plan-pin-malformed`, `plan-pin-unrecorded`, `_pin_row_problem`, `_read_pins` or `pins:`, the new file, and `test_path_guard_hygiene.py`, `test_repo_hygiene.py` and `test_scaffold_leg_path_collisions.py`; and `test_shape_doctor.py` (448 ids, each in exactly one shard, run from a script that reads each list into an array because 25 ids hold spaces). Every chunk exited 0, with 0 failed. | Chunk | Files | Result | | --- | --- | --- | | f01 | `test_adopt_pins.py` | 150 passed | | f02 | `test_adopt_plan_yaml_quoting.py`, `test_adopt_plan.py` | 606 passed, 1 skipped | | f03 | `test_adopt_execute_refusals.py`, `test_adopt_pin_row_values.py`, `test_adopt_plan_escapes.py`, `test_adopt_plan_value_order.py`, `test_adopt_reencoded_files.py`, `test_adopt_root_symlinks.py`, `test_adopt_shape_pin_and_work_dir.py`, `test_adopt_template_values.py` | 661 passed, 3 skipped | | f04 | `test_bump_remedies_family_root.py`, `test_chain_link_fold.py`, `test_chain_pin_sources.py`, `test_chain_remedy_callers.py`, `test_doctor_gitlink_repairs.py`, `test_doctor_recorded_answers.py`, `test_family_add_member_id.py`, `test_family_makefile_siblings.py` | 255 passed | | f05 | `test_family_tracking_branch.py`, `test_legs_not_a_list.py`, `test_link_source_chain_defaults.py`, `test_manifest_validator.py`, `test_naming_policy.py`, `test_neutral_pin_entry_one_spelling.py`, `test_neutral_pin_validator.py`, `test_non_list_project_fields.py` | 757 passed | | f06 | `test_path_guard_hygiene.py`, `test_pin_annotated_tag.py`, `test_pin_source_env_collisions.py`, `test_pinned_copy_text.py`, `test_reader_refusals_named.py`, `test_repo_hygiene.py`, `test_scaffold_e2e.py`, `test_scaffold_leg_path_collisions.py` | 599 passed | | f07 | `test_scaffold_pin_and_reuse.py`, `test_scaffold_pin_collisions.py`, `test_scaffold_referent_chain_links.py`, `test_setup_project_py.py`, `test_template_text_placeholders.py`, `test_update_shape_add_ignored.py`, `test_update_shape_landing.py`, `test_validate_pins_named_and_spelled.py` | 1078 passed | | f08 | `test_yaml_flow_brackets.py`, `test_yaml_flow_quotes.py`, `test_yaml_indicator_openers.py`, `test_yaml_reader_spaces.py` | 813 passed | | d01 | `test_shape_doctor.py`, 56 ids | 56 passed | | d02 | the same, 56 ids | 56 passed | | d03 | the same, 56 ids | 56 passed | | d04 | the same, 56 ids | 56 passed | | d05 | the same, 56 ids | 56 passed | | d06 | the same, 56 ids | 56 passed | | d07 | the same, 56 ids | 56 passed | | d08 | the same, 56 ids | 53 passed, 3 skipped | The file chunks hold 4919 passed and 4 skipped (f02: `SHAPE_MEDXEHR_CLONE` is unset; f03: the reftable backend needs git 2.45). The doctor shards hold 445 passed and 3 skipped (d08: the PowerShell line is printed only on a Windows host). In all, **5364 passed, 7 skipped, 0 failed.** **Run on the merge with #1125's head.** A scratch merge of this head with #1125's head `9549006fe`: commit `8a291d8b2`, tree `88530bb7`. The new file (45), `test_adopt_pins.py` (150), `test_adopt_plan_value_order.py` (40), `test_adopt_execute_refusals.py` (181) and `test_adopt_check_plan_name.py` (45): **461 passed.** ## Merge-trees `git merge-tree --write-tree`, this head against each, all clean (exit 0), at the heads of 2026-10-23T08:20Z: - `origin/main` `961640c68`; - the 23 open PRs that touch `adopt-project.py`: #1194 `900f77af9`, #1190 `00f959c61`, #1189 `4d40ce9fd`, #1186 `07486a498`, #1180 `b316f4157`, #1178 `c4beba193`, #1177 `5208e874e`, #1171 `8162b874e`, #1170 `24ee133aa`, #1169 `258051022`, #1154 `8a7828332`, #1153 `ff33ba12a`, #1143 `7af5fabc3`, #1141 `7a2711d03`, #1125 `9549006fe`, #1123 `5c3908f8d`, #1122 `c01c4d73d`, #1121 `1c5173758`, #1120 `c55e55e33`, #1119 `bba168bdd`, #1118 `2307036ab`, #1106 `504a1dd65`, #1105 `b28f40de0`; - #1126 `4c1f80cf4`, which touches `tests/test_adopt_pins.py`. ## This PR needs no #1125 #1125 (for #1020) makes `_read_pins` say an entry that is not a pin as `_read_as` says it. Its `adopt-project.py` hunks are at the `_read_pins` docstring and at the non-dict entry's `{row!r}` (about line 625 on main), and they do not touch `_pin_row_problem`. Its test hunks do not overlap the lines this change edits. The two are textually independent: this PR is based on main, not stacked, the merge-tree with #1125's head is clean, and the run above on the merge with its head passed. An entry that is neither a name nor a mapping stays #1020's, in #1125. ## Not in this PR The other `repr` in the pin rows are on a value that is text by then: the later branches of `_pin_row_problem` (spelled as before), a text product in an entry's name, and an entry that is a name. They are not gaps. `docs/release-notes/v1.2.0.md` is left alone. Its lines 297 to 299 mention #901's pins wording, and the release owner may want a line there. ## Out of scope Four other places in `adopt-project.py` put a plan value of any type into a refusal with `!r`, as the pin rows did: `plan-wrong-kind`, `plan-unsupported-mode`, `plan-bad-leg` and `plan-bad-id`. They are not pin rows, so this change leaves them. They were found by reading the code, not by running it. They are filed as #1199, with each site's line and what it would print. Closes #1114 Lane: openreposhape-4 (openRepoShape-4) Co-Authored-By: Claude Opus 5.5 <[email protected]>
…blems against its source, in the order a person mends them (another repository, a refused name, a moved source, an unanswered entry), so `check`'s first finding is `execute`'s refusal for each pair (#1113) (#1210) **Stacked on #1125.** This PR's base is `fix/1020-bad-id-first-problem` (#1125's branch, head `9549006f`). It lands after #1125 and stays a draft until then. #1125 makes `check`'s first finding `execute`'s first refusal for a bad `id:` or `org:`. This PR extends that rule to the four pairs #1113 measured, which have neither. **Fix round.** The first gate failed six rows of `tests/test_adopt_relative_submodule_url.py` that pinned `check`'s old order on a plan hand-edited into another organisation, the relative url before `plan-not-the-source`, a plan `execute` already refused `plan-not-the-source` first on #1125's head; they now expect `plan-not-the-source` first, and a new row asserts that both commands name it first. ## The rule and the order One generator, `_against_its_source`, asks a plan's four problems against its source in one order, and both commands read it. `execute` refuses its first problem. `check` lists each one, in that order and in its own words, before the split branch and the entries. The order is the one a person mends them in: 1. a plan for another repository (`plan-not-the-source`); 2. a name the naming policy refuses (`naming-unclassified`, or `naming-role-mismatch`); 3. a source that has moved on since `plan` (`plan-stale`); 4. an unanswered entry (`plan-unresolved`). Why this order: - **An unanswered entry last.** Each of the first three is mended by running `plan` again, as its remediation says, and a fresh plan takes back every answer given before. An answer given first would be lost. - **Another repository first.** Nothing in such a plan is this source's own: it is mended by `plan` under the source's own name, or from the source it is about. And `execute` must ask the naming policy nothing about the plan's names, and no remote anything, before it refuses it (#499). `_against_its_source` is a generator, so `execute` asks nothing after the first problem, and that still holds. - **A refused name before a moved source.** The name is mended by `plan` given another `--project`, or after the source is renamed on GitHub. That run reads the source as it is now, so it mends the moved source too. `plan` run again as it was, for the moved source, would leave the name to mend. - **The least change to each command.** The order keeps `execute`'s order for the plan's names (#499, #716) and `check`'s order of a moved source before its entries. Only the pairs that disagreed change. ## Before and after Measured on #1125's head `9549006f` and on this head, with a stub `gh` (exit 97), `GH_TOKEN=bogus`, an empty `GH_CONFIG_DIR`, `GIT_SSH_COMMAND=false`, a proxy that goes nowhere, an empty global git config and `--local-remote-dir`. No run made a leg. `check` exits 1 and `execute` exits 2 in every row. | The plan holds | `check` before | `execute` before | both, here | |---|---|---|---| | a moved source and an unanswered entry (#1113) | `plan-stale` | `plan-unresolved` | `plan-stale` | | another repository and an unanswered entry (#1113) | `plan-unresolved` | `plan-not-the-source` | `plan-not-the-source` | | another repository and a moved source (#1113) | `plan-stale` | `plan-not-the-source` | `plan-not-the-source` | | a refused name and an unanswered entry (#1113) | `plan-unresolved` | `naming-unclassified` | `naming-unclassified` | | a refused name and a moved source (not in #1113's table) | `plan-stale` | `naming-unclassified` | `naming-unclassified` | | all four | `plan-stale` | `plan-not-the-source` | `plan-not-the-source` | | another repository and a refused name | `plan-not-the-source` | `plan-not-the-source` | `plan-not-the-source` (unchanged) | The fifth row is not in #1113's table, but the two commands disagreed there too, and the same rule decides it. The same probe, comparing each command's output before and after, with paths and hashes masked: - A plan with one of the four problems: both commands print the same stderr and stdout before and after. - Both commands' stdout is the same before and after in every row. - `check`'s stderr in each pair row holds the same lines as before, reordered: the same findings and the same remediation lines. - `execute`'s stderr changes in one row only, a moved source beside an unanswered entry: `REFUSED plan-stale`, in its own words, where it said `REFUSED plan-unresolved`. No refusal's code or wording changes, and no code is added. Re-run on this head after the fix round, the probe gives the same: the 24 plans (these 11, and the 13 of the next section) each get one first problem from both commands, no run makes a leg, and the comparison with #1125's head is the one above, line for line. ## #1113's suspected case: a `--work-dir` that cannot be written Measured on #1125's head and on this head, the two commands agree in every row, and nothing here changes it: - **A bad `id:` or `org:` beside a `--work-dir` this user cannot write in** (`chmod 500`): `plan-bad-id` or `unsafe-value` to both. #1125's review round 1 (RV1125's SHOULD-1) made both commands ask the two before `_work_root`, which settled this case. - **Each of the 11 plans above beside the same `--work-dir`:** `adopt-work-dir-unwritable` first to both. ## What changed, in `adopt-project.py` - **`_against_its_source` and `_Unmended` (new).** `_against_its_source` is the rule. It asks: - `_refuse_a_plan_for_another_repository`; - `_check_names`, given the source only where the plan names no other repository, as `check` gave it (#716); - `_refuse_an_unrunnable_plan`. It yields each problem as an `_Unmended`: the `Refusal` `execute` refuses it with, and `check`'s FINDING lines and remediation for it, in `check`'s words as they were. `check` lists an unanswered entry with the entries, each by its path (`_leg_findings`), after the rule's problems. - **`cmd_execute`.** It refuses the first problem, `next(_against_its_source(...))`. Before, it called `_refuse_a_plan_for_another_repository`, `_check_names` and `_refuse_an_unrunnable_plan` in turn. - **`cmd_check`.** It lists the rule's findings right after the Triad advisory, where it listed a moved source. Another repository and the names are no longer listed after the entries. Three things are still asked where they were, and only where no name was refused: - the names' classification lines on stdout; - the findings about what the disk or GitHub will not hold (#863); - the leg question (#798). The remediation lines it prints after its findings follow the findings' order, so the rule's come first. - **`_refuse_an_unrunnable_plan`.** It asks a moved source before an unanswered entry. Its docstring says why. - **`_refuse_a_plan_for_another_repository`.** Unchanged. The rule calls it. ## Tests `tests/test_adopt_plan_against_its_source.py` (new, ASCII only), 11 rows. Each runs `check` and then `execute --yes` on one hand-edited plan, both with the same `--local-remote-dir`, and asserts that no leg is made. - **7 pair rows** (the six pairs and all four). Each asserts: - `check` exits 1 and `execute` exits 2; - both name first the same code, the rule's first; - `check` lists every problem the plan holds, in the rule's order. - **4 controls**, one per code: the plan holds that problem alone, and both commands name it. - **Against #1125's head `9549006f`:** - the 6 pair rows that disagreed fail, each because the two commands named different codes, for example `('plan-stale', 'plan-unresolved') != ('plan-stale', 'plan-stale')`; - the `another-and-name` guard row and the 4 controls pass. - **Here:** 11 passed. `tests/test_adopt_relative_submodule_url.py`, 6 rows changed and 1 new (the fix round): - **The 6 rows** are `test_check_keeps_a_relative_url_its_github_leg_resolves_alike` for `[https]`, `[scp]`, `[scp-other-case]`, `[ssh-port]` and `[ssh-github-443]`, and `test_a_credential_in_the_source_remote_is_never_printed`. - Each hand-edits the plan's `org:` to `otherorg`, so the plan names `otherorg/Thing` and the source is `testorg/Thing`: a plan for another repository. - Each expected `check` to list the relative url first and `plan-not-the-source` after it, `check`'s old order. They now expect `plan-not-the-source` first. Their other assertions are unchanged; the credential is still printed nowhere. - **The new row,** `test_check_names_another_repository_first_as_execute_refuses_it`, runs one such plan. It asserts that `check`, with and without `--local-remote-dir`, lists `plan-not-the-source` and then the url, that `execute` refuses `plan-not-the-source`, and that no leg is made. - **Measured on #1125's head** for the six source remotes: `execute` already refused each such plan `plan-not-the-source`, and its output is the same on both heads. Only `check`'s order changed. No spelling of the source's `origin` reads as another repository: with `org:` left as the source's, `check` passes on both heads, as the rows assert. Both files together, 46 rows: - **Against #1125's head:** 13 failed, 33 passed. The 13 are the 6 pair rows above and the 7 relative-url rows, each on the order: `plan-not-the-source` where the url was expected first, or the url first in the new row. - **Here:** 46 passed. ## Mutants Each was applied to `adopt-project.py`, run against both files (46 rows), and restored, with its sha256 checked (`4c8c1c9e`, the same after each one). Unmutated, the 46 pass. M1-M6 are the first round's; M7 and M8 are the fix round's. | Mutant | Killed by | |---|---| | M1, `execute`: `_refuse_an_unrunnable_plan` asks an unanswered entry before a moved source (pair 1) | 2: `moved-and-unanswered`, `all-four` | | M2, `check`: lists another repository after the entries (pair 2) | 11: `another-and-unanswered`, `another-and-moved`, `another-and-name`, `all-four`, and the 7 relative-url rows | | M3, `check`: lists a moved source before another repository (pair 3) | 3: `another-and-moved`, `name-and-moved`, `all-four` | | M4, `check`: lists a refused name after the entries (pair 4) | 3: `name-and-unanswered`, `name-and-moved`, `all-four` | | M5, `check`: lists a moved source before a refused name (pair 5) | 2: `name-and-moved`, `all-four` | | M6, the rule: asks a refused name before another repository (both commands) | 2: `another-and-name`, `all-four` | | M7, `execute`: asks `_refuse_what_check_finds` before the rule | 8: the pair rows but `another-and-name`, the `plan-stale` control, and the new relative-url row | | M8, `check`: lists all the rule's problems after the entries | 14: the pair rows but `another-and-name`, the `plan-stale` control, and the 7 relative-url rows | ## Gate Run on the scratch merge `743ebe176`: `origin/main` `961640c68` plus this head `90eca4144` (tree `d71d6f00a`, never pushed). It ran in the landing gate's own environment (a stub `gh`, `GH_TOKEN=bogus`, an empty global git config, `EMAIL` set, the `LANES_*` and `GIT_SSH_COMMAND` variables unset), one shard at a time, each started with at least 19G free. The ids were collected from that tree, 4405 + 448 = 4853, and each is in exactly one shard. The file list is the 46 test files W1113's gate named and four more, added in the fix round (50 in all): `test_adopt_c_locale_bytes.py` and `test_adopt_submodule_url_answers.py` (they import helpers and the module-scoped `adopter` fixture from the changed test file, so they sit in its shard, r03), `test_reader_refusals_named.py` (it hand-edits a plan's `org:` and checks `check`'s exact findings) and `test_github_name_limits.py`. Every shard exited 0. | Shard | Result | |---|---| | r01 | 600 passed | | r02 | 613 passed | | r03 | 464 passed, 1 skipped (`test_adopt_plan.py::test_plan_on_medxehr_matches_the_rulings`) | | r04 | 547 passed | | r05 | 599 passed, 19 skipped (all in `test_family_init_values.py`) | | r06 | 542 passed | | r07 | 489 passed | | r08 | 531 passed | | d01 to d07 | 56 passed each (`test_shape_doctor.py`) | | d08 | 53 passed, 3 skipped (`test_shape_doctor.py`) | - **r01 to r08:** 4385 passed, 20 skipped (4405 ids). - **d01 to d08:** 445 passed, 3 skipped (448 ids). - **Total:** 4830 passed, 23 skipped, none failed, none errored. Main has moved since this gate: `origin/main` is `ac5f28d2a` (#1188, #1130 and #1098 landed). They change `scaffold-project.py`, `scripts/family.py` and four test files. None of them is a file this PR changes, a module `adopt-project.py` imports, or one of the 50 gated test files, so the gate was not run again on that tip. The merge-trees below were. ## Merge-trees `git merge-tree --write-tree`, run again on 2026-10-23 at 15:31Z against the current `origin/main`, every one clean: - **`origin/main` `ac5f28d2a`:** clean, tree `1a65ab9bd`. - **#1125 `9549006fe`:** clean. This branch is on it. - **#1177 `5208e874e`** (`fix/1152-plan-and-remote-paths-spelled`, which edits a line of `_refuse_a_plan_for_another_repository`): clean, with this head and three-way on the scratch merge. - **Every open PR that touches `adopt-project.py` or either test file, 25 of them, #1125 and #1177 among them:** clean, both with this head and three-way on the scratch merge of `ac5f28d2a` and this head, `98afb128a` (`git merge-tree --write-tree <that merge> <its head>`). Since the first run, #1207 is new, and #1119, #1189 and #1190 have moved; all four are clean. No open PR touches either test file. The list is in a code block, so that it does not mention each PR: ``` PR head with this head on the scratch merge #1105 b28f40d clean (tree 32fce74c6) clean (tree 490f555f9) #1106 504a1dd clean (tree 3abfa1b6a) clean (tree db57682e9) #1118 2307036 clean (tree 79a3888bf) clean (tree 629f167ca) #1119 195d993 clean (tree a2926127e) clean (tree 6aec4c863) #1120 c55e55e clean (tree 6171a52f8) clean (tree 0cb310664) #1121 1c51737 clean (tree 3acb80467) clean (tree 2771fbfd0) #1122 c01c4d7 clean (tree af9a4c414) clean (tree ef00f52f7) #1123 5c3908f clean (tree eb7cb34b3) clean (tree 4c311748b) #1125 9549006 clean (tree 239df6d) clean (tree 1a65ab9bd) #1141 7a2711d clean (tree e1c8f7169) clean (tree 3afeda790) #1143 7af5fab clean (tree 35cd165de) clean (tree aae00cfc7) #1153 ff33ba1 clean (tree 57da668e8) clean (tree f91ce3d8d) #1154 8a78283 clean (tree 28699ba0c) clean (tree 3e6b1ae98) #1169 1e958ca clean (tree e3ef802be) clean (tree f4566b2c4) #1170 24ee133 clean (tree 94b9291c8) clean (tree 848bb0ed0) #1171 8162b87 clean (tree 65ca8196d) clean (tree f15571ef3) #1177 5208e87 clean (tree 08e3d6a62) clean (tree 111f3c238) #1178 c4beba1 clean (tree 646f02266) clean (tree eae3b5996) #1180 b316f41 clean (tree 25b3d4b6f) clean (tree 85a559171) #1186 07486a4 clean (tree d0fe77836) clean (tree 849f0ef41) #1189 a131fc2 clean (tree 5b1ab0620) clean (tree 9851d22b7) #1190 91a937e clean (tree aa83fae05) clean (tree 18101f50b) #1194 900f77a clean (tree 9d74efa35) clean (tree 46317beae) #1198 d38e4e3 clean (tree 87ca21b8c) clean (tree 7fc45a875) #1207 1c7ca5c clean (tree 1dbab659d) clean (tree 1e44c98f0) ``` ## Left for a follow-up (outside #1113) - **An unanswered entry beside an uncovered path still gives two first problems,** filed as #1197. `check` lists `plan-uncovered` first and `execute` refuses `plan-unresolved` first. Measured the same on #1125's head and on this head. `execute` refuses an unanswered entry before `_refuse_what_check_finds`, while `check` lists it in `_leg_findings`, after the paths and the coverage. Other entry findings ahead of it in `_entry_findings` are likely the same (`plan-unsafe-path` among them), and so is the taken split branch, but those were not measured. Closes #1113 Lane: openreposhape-4 (openRepoShape-4) Co-Authored-By: Claude Opus 5.5 <[email protected]>
…cter a terminal acts on in the command, its directory and what it printed, as `_first_said` spells gh's, so `--local-remote-dir` no longer reaches the terminal raw there; a NOTE before `NEXT:` says when the source's path in its clone command holds a character a terminal does not show as itself; and rows pin six sites #1177's 148 left to chance (#1195) (#1225) This PR was stacked on #1177, which landed as `8bcdb2c`. RS1225 then restacked it onto `main` with three merges (#1177's final head, its squash, then `main`), which carry exactly the reviewed change (#1225 issuecomment-6752574422). ## What #1195 follows RV1177's review of #1177 (for #1152). It names two raw routes, N3 and N4, and six mutants, K1, K2, K4, K5, K6 and K7, that all 148 rows of #1177's `tests/test_adopt_plan_and_remote_paths_spelled.py` let through. Three files change: `adopt-project.py`, that test file, and `tests/test_adopt_github_exits.py`. ### N3: a refused command no longer names `--local-remote-dir` raw `CommandFailed.loudly` belongs to `scripts/shape_materialize.py`, and every tool shares it. It printed the command, its `(in <cwd>)` line and its output as they were. So when a `pre-receive` hook refused a leg push under `--local-remote-dir <D>/re<U+202E>mote`, the raw U+202E was printed three times: in the command, and in git's own `To` and `error:` lines. The change is in `adopt-project.py` only. `shape_materialize.py` is unchanged. - `_unacted(text, kept="")` writes each character that `str.isprintable` refuses, other than those in `kept`, as `_spelled_character` spells it, with no backticks. That is what `_first_said` does to the line gh said. - `_loudly(exc, step)` builds the same REFUSED block from the command's arguments, its directory and its output, each passed through `_unacted`. - The output keeps its line breaks (`kept="\n"`), so it still reads one line per line. - This settles the point the issue left open: `loudly` prints the whole output, while `_first_said` keeps one line. - The leg push (`_push_the_leg`), `_failed_loudly` and `main`'s catch-all now print a refused command through `_loudly`, not `exc.loudly`. - A printable character prints as it is, so a command with plain paths prints the same block as before. I measured it with a real `execute --allow-empty-leg spec` and a global `pre-receive` hook that refuses every push: - **U+202E.** On `5208e874e`, U+202E in `--local-remote-dir` reaches stderr raw 3 times. On this head it reaches stderr 0 times. The command, the `(in ...)` line and git's `To` line each name it as `\u202e`, six ASCII characters. - **ESC.** ESC behaves the same way. git itself writes ESC as `?` in its `error:` line. - **Byte 0xff.** It was already printed as `\udcff` before this change, because stderr is `backslashreplace`. git's own lines hold U+FFFD for it, the character `run` decodes that byte to. ### N4: a NOTE says when `NEXT:`'s clone command holds a character a terminal does not show #1195 asks for a ruling: refuse such a source, as the README's clone line does, or add a note under `NEXT:`. The code settles it in favour of the note: - **Such a source is writable.** `_refuse_an_unwritable_clone_url` asks `unwritable_reason`. Since #255, that lets through a `Cf` character other than the nine bidi controls. Its docstring in `scripts/shape_materialize.py` says such a character "is invisible, not unwritable", and that a Persian name joins its parts with U+200C. - **The tests pin it.** `tests/test_adopt_template_values.py` lists `Ali<U+200C>Reza`, `a<U+200E>b`, `a<U+200F>b` and `a<U+061C>b` as `WRITABLE`. Refusing the source would reverse #255. - **Spelling breaks pasting.** Spelling the command instead would break `_branch_deletion`'s rule that a printed command pastes as it is. `sh` reads a quoted path, not a spelled one. I measured the old behaviour on `5208e874e`, with a full `execute --local-remote-dir` of a source under `<D>/so<c>urce/Thing`. U+200B, U+200F, U+200C and U+00A0 each pass, and the `split` line spells them. `NEXT:` prints each one raw, once, inside `shlex.quote`'s single quotes. On this head, the clone command is unchanged. When the url is not `str.isprintable`, this line prints just before the `NEXT:` block: ``` NOTE the path in the clone command below holds a character a terminal does not show as itself, so it can read as another path: it is `<D>/so\u200burce/Thing`, as the `split` line names it. ``` A url whose every character is printable gets no NOTE. A source name that ends in a space shows between the quotes, so it gets none either. **Where the NOTE goes differs from the issue's wording; please weigh it.** - The issue says a note *under* `NEXT:`. - #1121 and #1207 each add lines right after the `print` of the `NEXT:` block. With the NOTE printed under the block, this branch conflicted with #1121 (`git merge-tree` exit 1). - Printed just before the block, the NOTE merges cleanly with both. It is also read before the command a person would paste. - Mutant M14 (the NOTE after the block) fails 2 rows, so the placement is pinned. - Moving it under the block means moving one `print` and flipping the row's order check. It would then need a rebase over whichever of #1121 and #1207 lands first. ### The new rows The new file goes from 148 to 188 rows, 40 of them new. `tests/test_adopt_github_exits.py` keeps its 23 rows, with one assertion tightened. - **K1, K2.** `test_a_printable_plan_is_named_as_typed_unless_900_spells_it` runs `check` on the uncovered plan, in the plan's own directory, four ways. `run_adopt` now takes `cwd=` and `over=`. | `--plan` given | Named as | |---|---| | absolute, ending in a space | `` `<D>/plan.yaml ` `` | | `` `plan.yaml` ``, relative, between backticks | `` `\x60plan.yaml\x60` `` | | `plan.yaml`, relative | `plan.yaml` | | `./plan.yaml` | `plan.yaml` | - **K4, K5.** Two new `ROWS` entries. Each runs under `check` and `execute`, with the plan at each of the five path forms. - `plan-wrong-kind-a-placement-plan` expects `kind is 'placement-plan', expected 'adoption-plan'`. - `org-too-long`, with an `org:` of 40 `o`, expects `` `org:` is oooooooooooo...oooooooooooo, 40 characters ``. - The issue read both expected lines from the code. Both rows pass on `5208e874e`, which confirms them. - **K6.** `printable-U+00E9` is added to the remote-dir test. `re<U+00E9>mote` prints as typed, with no backticks. - **K7.** In `tests/test_adopt_github_exits.py`, the GitHub-mode `split` line must now match in full: ` split <12 hex> on adopt/three-repo-shape -> https://github.com/testorg/Northwind.git`. - **N4.** `SPLIT_SOURCES` gains `right-to-left-mark` (U+200F). Every split row checks either that the NOTE comes before `NEXT:`, or that there is no NOTE. - **N3.** Three tests: - `test_a_refused_command_names_the_remote_and_work_dirs_spelled` is the probe above as a test. The character goes in both `--local-remote-dir` and `--work-dir`, for U+202E, ESC, byte 0xff and a plain control. The line feed is left out, because git's own output names the path and the output's line breaks are kept. - `test_a_late_refused_command_is_said_spelled` checks `_failed_loudly`, in process, for all five `CHARACTERS`. - `test_a_refused_command_no_step_said_is_said_spelled` checks `main`'s own block, in process, with `cmd_check` replaced, for all five. ## Proof ### Before and after | Code | The new file (188 rows) and `tests/test_adopt_github_exits.py` (23 rows) | |---|---| | #1177's head `5208e874e` | 12 failed, 199 passed | | This head `73c9f57e8` | 211 passed | - **What fails on `5208e874e`.** The 12 failures are all N3 and N4 rows: - 2 split rows (U+200B and U+200F); - 2 refused-push rows (U+202E and ESC); - 4 `_failed_loudly` rows; - 4 `main` rows. - **The K rows** pass on `5208e874e`, because its code is right there. Each one fails on its mutant (below). - **Two N3 controls** pass on both heads: byte 0xff, because stderr already wrote `\udcff`, and the plain control. ### Mutants All 20 were killed. Each was applied to `adopt-project.py` on this head and restored with `git checkout`. After every restore, the file's sha256 was `163c692aff5b076410bde27740439070f2b9a4c62b4a7dc9510199cb0a7f890a`. - For K1 to K6, the whole new file was run (188 rows). For K7, `tests/test_adopt_github_exits.py` was run too (211 rows). - Under every K mutant, only new rows failed, so the old 148 stayed green. - M1 to M14 ran the N3 or N4 rows. | Mutant | What it does | Rows failed | |---|---|---| | K1 | `check`'s last count line names `--plan` by `isprintable()` alone | 2 of 188 | | K2 | that line names `plan.path.absolute()` | 3 of 188 | | K4 | the PLACEMENT plan's `plan-wrong-kind` names the plan raw | 8 of 188 | | K5 | `adopt-org-too-long` names the plan raw | 8 of 188 | | K6 | the extracted leg line spells every url outside ASCII | 1 of 188 | | K7 | the `split` line names the source's own path | 2 of 211 | | M1 | `_loudly` leaves the arguments raw | 10 of 14 | | M2 | `_loudly` leaves the working directory raw | 10 of 14 | | M3 | `_loudly` leaves the output raw | 8 of 14 | | M4 | the output's line breaks are spelled too | 14 of 14 | | M5 | the arguments are wrapped in backticks | 14 of 14 | | M6 | the leg push goes back to `exc.loudly` | 2 of 14 | | M7 | `_failed_loudly` goes back to `exc.loudly` | 4 of 14 | | M8 | `main` goes back to `exc.loudly` | 4 of 14 | | M9 | `_unacted` keeps every whitespace character | 2 of 14 | | M10 | no NOTE | 2 of 4 | | M11 | a NOTE wherever the `split` line spells the path | 1 of 4 | | M12 | the NOTE names the path raw | 2 of 4 | | M13 | the clone command is spelled, not quoted | 4 of 4 | | M14 | the NOTE prints after the block, not before it | 2 of 4 | ### Gate The gate ran on the scratch merge `37c65a609` of `origin/main` `961640c68` and this head `73c9f57e8`, in the landing gate's environment: | Shards | Tests | Result | |---|---|---| | g0 to g5: the 52 files listed below | 3,250 | 3,246 passed, 4 skipped | | d0 to d7: `tests/test_shape_doctor.py` | 448 | 445 passed, 3 skipped | - The shard lists hold each collected id exactly once. Every shard exited 0. - **The 7 skips are environment skips.** Three `tests/test_adopt_root_symlinks.py` rows need git 2.45 for the reftable backend. One `tests/test_stdout_encoding.py` row and the three doctor rows run only on Windows. - **g1 ran twice.** A host reboot killed its first run part way. It was re-run whole: 542 passed. <details><summary>The 52 files in g0 to g5</summary> `tests/test_adopt_attributes_eol_block.py`, `tests/test_adopt_c_locale_bytes.py`, `tests/test_adopt_clone_template.py`, `tests/test_adopt_contracts_dir.py`, `tests/test_adopt_e2e.py`, `tests/test_adopt_entry_paths.py`, `tests/test_adopt_execute_refusals.py`, `tests/test_adopt_filter_repo_failure.py`, `tests/test_adopt_git_reads.py`, `tests/test_adopt_git_rm_bytes.py`, `tests/test_adopt_github_exits.py`, `tests/test_adopt_late_failure.py`, `tests/test_adopt_leg_keys.py`, `tests/test_adopt_mount_ignored.py`, `tests/test_adopt_pins.py`, `tests/test_adopt_plan_and_remote_paths_spelled.py`, `tests/test_adopt_plan_escapes.py`, `tests/test_adopt_reencoded_files.py`, `tests/test_adopt_relative_submodule_url.py`, `tests/test_adopt_root_manifest.py`, `tests/test_adopt_root_shape_paths.py`, `tests/test_adopt_root_symlinks.py`, `tests/test_adopt_spec_only.py`, `tests/test_adopt_spelled_names.py`, `tests/test_adopt_split_branch.py`, `tests/test_adopt_submodule_url_answers.py`, `tests/test_adopt_submodules.py`, `tests/test_adopt_temp_work_roots.py`, `tests/test_adopt_template_values.py`, `tests/test_adopt_tracking_branch.py`, `tests/test_adopt_unsearchable_source.py`, `tests/test_adopt_values_as_typed.py`, `tests/test_adopt_verify.py`, `tests/test_doctor_next_is_a_command.py`, `tests/test_dry_run_asks_remotes.py`, `tests/test_family_add_refusals.py`, `tests/test_git_output_decoding.py`, `tests/test_github_limits_init_check_org.py`, `tests/test_github_name_limits.py`, `tests/test_non_utf8_name_callers.py`, `tests/test_path_guard_hygiene.py`, `tests/test_refusal_default_remediation.py`, `tests/test_repo_hygiene.py`, `tests/test_ruleset_hint_tracking_branch.py`, `tests/test_scaffold_leg_path_collisions.py`, `tests/test_scaffold_manifest_values.py`, `tests/test_scaffold_reuse_seeded_legs.py`, `tests/test_stdout_encoding.py`, `tests/test_template_values_single_pass.py`, `tests/test_update_shape.py`, `tests/test_update_shape_add.py`, `tests/test_update_shape_merged_away.py` </details> **`main` has moved since the gate's base, and it touched `adopt-project.py`.** - `origin/main` is now `50ce8ab15`. Of the 15 commits since `961640c68`, one touches `adopt-project.py`: `b7edd8816` (#1119, for #1083), with 279 lines added and 78 removed. None touches either test file. - `git merge-tree` of this head with `50ce8ab15` is clean. In the merged `adopt-project.py`: - the file parses; - `_unacted` and `_loudly` are each defined once; - `.loudly(` is called only inside `_loudly`, so #1119 adds no new `exc.loudly(` call. - The gate above did not run on `50ce8ab15`. The landing gate re-tests this head on its own merge. ### Merge-trees (2026-10-23T20:14Z) `git merge-tree --write-tree <X> 73c9f57` exits 0 (clean) for every `<X>` below: - `origin/main` at `50ce8ab15`; - #1177's head, `5208e874e`; - each of the 24 open PRs that touch `adopt-project.py`: #1210, #1207, #1198, #1194, #1190, #1189, #1186, #1180, #1178, #1171, #1170, #1169, #1154, #1153, #1143, #1141, #1125, #1123, #1122, #1121, #1120, #1118, #1106 and #1105. No other open PR touches either test file. #1121, which adds lines after `NEXT:`, has not landed, and it merges cleanly. Each of the 24 was also merged against a scratch merge of `origin/main` and this head: - 21 merge cleanly. - #1169, #1180 and #1190 conflict in `tests/test_adopt_check_throwaway_repos.py`, and #1169 also conflicts in `adopt-project.py`. - Those three conflict with `origin/main` alone, in the same hunks byte for byte: 6 in `adopt-project.py` for #1169, and 13, 8 and 8 in the test file. So this head adds no conflict. ## Not in this PR These are outside #1195, which covers `adopt-project.py`'s `--local-remote-dir`: - `scaffold-project.py`, `update-shape.py`, `scripts/family.py` and `scripts/bump-leg.py` still print `CommandFailed.loudly` as it is. - `_init_refused` prints `git init`'s argument list raw, and those arguments hold the `--work-dir` path. - The `adopt-remote-unreadable` and `source-unclonable` refusals print git's or gh's output raw. - `_unacted` and the NOTE test `str.isprintable`, as `_first_said` does. So the default-ignorable characters that #1171 (#1128) adds to `_shown` get no NOTE, and are not spelled in a REFUSED block. They belong with `_first_said` under #1165. Closes #1195 Lane: openreposhape-4 (openRepoShape-4) Co-Authored-By: Claude Opus 5.5 <[email protected]>
… repository over 100, so `plan --source <50 b's>/Thing` never asks `gh` for a name GitHub cannot hold, no remedy offers `--org <50 b's>`, and `check` and `execute` never clone such a record again (#1129) (#1194) Lane 4's W1129 for #1129, RV1122's NIT-1 on #1122 (#1122 issuecomment-6319493639). RV1194 reviewed it READY at `900f77af` (#1194 issuecomment-6365280794). **It was stacked on #1122,** which landed as `ebb8716`. RS1194 then restacked it onto `main` with three merges (#1122's final head, its squash, then `main`), which carry exactly the reviewed change (#1194 issuecomment-6751617746). "Why stacked" below says why it was stacked. **A fix round followed #1268.** Since #1268, `Source.clone` hands `gh repo clone` `-- --quiet --origin origin`. So FX1194 merged `main` (`106f92ff`) and changed only the rows' helper `cloned_by_gh` to expect that line (+4 -2, #1194 issuecomment-6769522297). RVD1194b reviewed the round READY at `ddc21fb5`: the reviewed change's lines are byte-equal, and the 14 rows fail before the fix and pass after it (#1194 issuecomment-6772772773). ## What `adopt-project.py`, `_github_name`: an owner of more than `GITHUB_OWNER_MAX` (39) characters, or a repository of more than `GITHUB_NAME_MAX` (100), counted once the trailing `.git` is dropped, names no `owner/repo`. The file already imports both limits from `shape_materialize`. ```python if len(owner) > GITHUB_OWNER_MAX or len(repo) > GITHUB_NAME_MAX: return None ``` Every reader of `_github_name` now gives the same answer for such a spelling: | Reader | Used by | Before | Now | |---|---|---|---| | `_source_spec` | `plan`, `check` and `execute` `--source` | taken as GitHub's name: `gh repo clone` asked, or `source-ambiguous` beside a directory of that spelling | a path: read in place where it is one, `source-unresolvable` ("neither a path that exists nor an `org/repo` name") where it is not | | `_repository_in_url` | a url `--source`, `github.com/...` too | `gh repo clone` asked | `source-unresolvable`, "names no `owner/repo` on github.com", before any `stat` | | `_recorded_repository` | `check` and `execute`, a plan's clone gone (`cloned: true`) | "is cloned again from GitHub", `gh repo clone` asked | `source-unresolvable`, "the plan's `source.repository`, ..., names no `owner/repo` on github.com" | | `_held_repository` | `check` and `execute`, a source with no `origin` | held to the record: `plan-not-the-source`, remedy `--org <40 c's>` | holds the plan to nothing, as a record that names no `owner/repo` does | | `_source_there` | beside a directory this user cannot search | #1122: no url | unchanged: no url (the name is None now) | `_refuse_another_repository`'s remedy (`adopt-not-the-source`) is reached only after `_source_spec`, so it never offers `--org <a name GitHub cannot hold>` for an `org/repo` `--source` now. **#1122's guard in `_source_there` is redundant, and is folded in.** `_source_there` is called only by `_source_spec` and `_repository_in_url`, and both take `name` from `_github_name`. So a name past the limits now arrives as None, and the `name is None` branch gives the same refusal #1122's guard gave. The guard is gone, `if name is None:` is back, and the docstring says the limits are asked in `_github_name`. The merge with `main` and with #1122 is clean (see "Merges"). **Why stacked.** The textual merge with #1122 is clean, but the two do not hold together as they stand. A `github.com/` spelling past the limits is now refused by `_repository_in_url` before any `stat`, so four of #1122's rows, which expected `source-unreadable` from `_source_there`, fail on the combination: - `[bare-github-url]`; - `[www-github-url]`; - `[bare-github-url-owner-one-over-EIO]`; - `[bare-github-url-owner-one-over-EACCES]`. This PR moves those three params out of #1122's `_source_there` tests, with a comment pointing to the new file. There they assert the new answer (`source-unresolvable`, no url), with the control at the limit kept: two readings and the url. No refusal code is new or changed, and no help text or `docs/cli.md` sentence changes: `--source`'s help already says `source-unresolvable` refuses "one that is neither a path that exists nor an `org/repo`". ## Behaviour that changes besides the refusal - **A directory here spelled `<40 c's>/Thing`** (or `testorg/<101 r's>`) is read in place, and the plan is written, recording that directory and no repository. Before, it was `source-ambiguous`, which named a GitHub repository that cannot exist. At the limit, it is still `source-ambiguous`. - **A plan whose source has no `origin`, and whose `source.repository` records `<40 c's>/Thing`,** is held to nothing. `check` says `plan ok`, and `execute` goes on. Before, it was held to that record, and the remedy said `--org <40 c's>`, which `execute` then refuses as `adopt-org-too-long`. A record at the limit still holds the plan. - **`github.com/<300 a's>/Thing` beside a `./github.com`** is `source-unresolvable`, "names no `owner/repo` on github.com". #1122 made it `source-unreadable`, "whether a repository is there cannot be told". Both offer no url. ## Before and after Probed with a `gh` first on PATH that logs each call and refuses it (exit 4), and with: - `GH_TOKEN=bogus`, an empty `GH_CONFIG_DIR`; - `GIT_SSH_COMMAND=false`, `GIT_CONFIG_GLOBAL` an empty file, `GIT_CONFIG_NOSYSTEM=1`; - uid 1000, Python 3.12.3, run in an empty directory. Each row is `plan --source <it> --project <repo> --org <owner>`, except where `--org` is said. `main` `961640c6` gave the same answers as #1122's head on every row. | `--source` | #1122 head `c01c4d73` | this head | |---|---|---| | `<50 b's>/Thing`, `--org <50 b's>` (the issue's) | `gh repo clone <50 b's>/Thing` (1 call), `source-unclonable` | `source-unresolvable`, 0 calls | | `<50 b's>/Thing`, `--org testorg` (the issue's) | `adopt-not-the-source`, remedy `--project Thing --org <50 b's>`, 0 calls | `source-unresolvable`, no `--org` offered, 0 calls | | `<40 c's>/Thing` | 1 call | `source-unresolvable`, 0 calls | | `testorg/<101 r's>`, and with `.git` | 1 call each | `source-unresolvable`, 0 calls | | `<40 c's>/<101 r's>` | 1 call | `source-unresolvable`, 0 calls | | `https://github.com/<40 c's>/Thing`, `github.com/<40 c's>/Thing` | 1 call each | `source-unresolvable` ("names no `owner/repo` on github.com"), 0 calls | | `<39 c's>/Thing`, `testorg/<100 r's>`, `testorg/<100 r's>.git` (controls) | 1 call each (`.git` dropped) | the same | | `<39 c's>/Thing`, `--org testorg` (control) | `adopt-not-the-source`, remedy `--org <39 c's>` | the same | ## Tests The landing gate's environment throughout: - `/usr/bin/python3 -m pytest -p no:cacheprovider`, Python 3.12.3; - a stub `gh` first on PATH, `GH_TOKEN=bogus`, an empty `GH_CONFIG_DIR`; - `GIT_CONFIG_GLOBAL` set to an empty file, `GIT_CONFIG_NOSYSTEM=1`; - the test author and committer variables, and `EMAIL`; - `GIT_SSH_COMMAND`, `GIT_ALLOW_PROTOCOL` and the `LANES_*` variables unset. **New file `tests/test_adopt_source_github_limits.py`, 48 rows,** ASCII only. It skips on Windows: the logging `gh` is a `/bin/sh` script, and the moved rows need a POSIX `File name too long`. Each child puts the logging `gh` ahead of the suite's guard, and every `execute` gets `--local-remote-dir`. | Test | Rows | What it asserts | #1122 head | main | this head | |---|---|---|---|---|---| | `test_plan_asks_gh_for_a_name_github_can_hold` (control) | 6 | owner 39, repository 100, 100 + `.git`, both at, a url and a bare url: `gh` logged exactly `repo clone <name> <work>/source-readonly/<repo> -- --quiet --origin origin`, once | 6 pass | 6 pass | 6 pass | | `test_plan_never_asks_gh_for_a_name_github_cannot_hold` | 9 | owner 40 and 50, repository 101 and 101 + `.git`, both over, and four url spellings: the `gh` log empty, exit 2, the `source-unresolvable` line, no plan, no work directory | 9 fail at the `gh` log (`cloning ...`) | 9 fail, the same | 9 pass | | `test_a_github_url_past_the_limits_is_refused_before_any_stat` (moved from #1122) | 4 | `[www.]github.com/<300 a's>/Thing` with a real `File name too long`; `github.com/<40 a's>/Thing` with `stat` refused (EIO, EACCES): `source-unresolvable`, no url; control at 39, both readings and the url | 4 fail at the code (`source-unreadable`, "cannot be told") | 4 fail, the same | 4 pass | | `test_no_remedy_offers_an_org_github_cannot_hold` | 3 | `--org testorg` with owner 40, 50, both over: no `--org <owner>`, no `adopt-not-the-source`; control at 39 offers `--org <39 c's>` | 3 fail at `--org <owner>` offered | 3 fail, the same | 3 pass | | `test_a_directory_github_cannot_name_is_read_in_place` | 2 | `./<40 c's>/Thing`, `./testorg/<101 r's>` repositories here: exit 0, recorded in place, no repository, 0 `gh` calls; control at the limit is `source-ambiguous` | 2 fail at the exit (`source-ambiguous`) | 2 fail, the same | 2 pass | | `test_a_recorded_name_github_can_hold_is_cloned_again` (control) | 4 | `check`, `execute`: the NOTE and 1 `gh` call | 4 pass | 4 pass | 4 pass | | `test_a_recorded_name_github_cannot_hold_is_never_cloned_again` | 6 | `check`, `execute`; owner 40, repository 101, both: the `gh` log empty, the `source-unresolvable` line, no "cloned again" | 6 fail at the `gh` log (the NOTE, "cloned again") | 6 fail, the same | 6 pass | | `test_check_and_execute_read_a_source_name_as_plan_reads_it` | 10 | `check`, `execute` with `--source`: 4 controls at the limits (1 `gh` call), 6 past them (0 calls, `source-unresolvable`) | 6 fail at the `gh` log; 4 pass | the same | 10 pass | | `test_a_record_github_cannot_hold_offers_no_org` | 4 | `check`, `execute` (no `--yes`); a source with no `origin`, record owner 40 and 50: no `--org <owner>`, no `plan-not-the-source`; `plan ok` / `adopt-unconfirmed`; control at 39 keeps `plan-not-the-source` and `--org <39 c's>` | 4 fail at `--org <owner>` offered | 4 fail, the same | 4 pass | Totals for the 48 rows: - **#1122's head:** 34 failed, 14 passed; - **main:** 34 failed, 14 passed; - **this head:** 48 passed. Every row that is not a control fails on both bases, at the assertion that names the defect, not at a setup step. The 14 controls pass on all three. **#1122's file** `tests/test_adopt_unsearchable_source.py`: 40 rows at this head, from 44. Three params moved out: the two url rows, and the url row's EIO and EACCES variants. Before the move, those four rows failed at this head (`source-unresolvable` against `source-unreadable`), and the other 40 passed. ## Mutants Each was applied to this head's `adopt-project.py` (sha256 `d494ba0e...`) by exact substitution of the new guard line, and run against this file, `test_adopt_unsearchable_source.py` and `test_adopt_unenterable_source_and_locale.py` (101 tests). After each one the file was restored from its saved bytes and its sha256 checked. Unmutated, all 101 pass. All 8 were killed. | Mutant | Killed by | |---|---| | M1: owner limit one lower (`> GITHUB_OWNER_MAX - 1`) | 24: the owner-39 controls (plan, `--source`, the recorded clone, the remedy, the directory, the held record, the moved rows' controls), and #1122's 5 owner controls at 39 | | M2: owner limit one higher (`+ 1`) | 15: every owner-40 row (plan, url, `--source`, the recorded clone, the remedy, the directory, the held record, the 2 moved EIO/EACCES rows), and #1122's 2 `owner-one-over` rows | | M3: repository limit one lower (`- 1`) | 15: the repository-100 controls, and #1122's 5 repository controls at 100 | | M4: repository limit one higher (`+ 1`) | 11: every repository-101 row, and #1122's 2 `repository-one-over` rows | | M5: owner limit removed | 25 | | M6: repository limit removed | 15 | | M7: both limits removed (no guard anywhere, since #1122's is folded in) | 46: every refused row here, and 12 of #1122's | | M8: the repository counted with its `.git` (`len(segments[1])`) | 1: `test_plan_asks_gh_for_a_name_github_can_hold[repository-100-dot-git]` | ## Gate Run on the scratch merge `w1129-gate` at `ca06ad25a`: a merge of `main` `961640c6` and this head `900f77af`. Its tree, `90fbea0e`, is the one `git merge-tree --write-tree origin/main HEAD` gives, and `main` has not moved since. The environment is the one under "Tests"; targeted files only, never the full suite. Every run ended with rc=0. **Test files, 23:** | File | Passed | Skipped | |---|---|---| | `test_adopt_source_github_limits` (new) | 48 | 0 | | `test_adopt_unsearchable_source` | 40 | 0 | | `test_adopt_unenterable_source_and_locale` | 13 | 0 | | `test_adopt_check_plan_name` | 45 | 0 | | `test_adopt_source_clone_record` | 100 | 0 | | `test_adopt_template_values` | 78 | 0 | | `test_adopt_work_dir_refusal` | 53 | 0 | | `test_windows_paths` | 46 | 0 | | `test_adopt_clone_claimed` | 42 | 0 | | `test_adopt_late_failure` | 88 | 0 | | `test_adopt_plan_flag_refusals_first` | 89 | 0 | | `test_adopt_temp_work_roots` | 9 | 0 | | `test_adopt_origin_repository` | 30 | 0 | | `test_adopt_plan` | 66 | 1 | | `test_adopt_project_is_the_source` | 23 | 0 | | `test_adopt_relative_submodule_url` | 34 | 0 | | `test_adopt_split_branch` | 47 | 0 | | `test_adopt_values_as_typed` | 40 | 0 | | `test_adopt_plan_escapes` | 59 | 0 | | `test_path_guard_hygiene` | 49 | 0 | | `test_repo_hygiene` | 101 | 0 | | `test_scaffold_leg_path_collisions` | 104 | 0 | | `test_github_name_limits` | 64 | 0 | | **Total** | **1268** | **1** | **`tests/test_shape_doctor.py`, all 448 collected ids, in 8 shards of 56** (the shard lists together hold every collected id exactly once; every `adopt-project.py` change is gated with it): | Shard | Ids | Passed | Skipped | |---|---|---|---| | d01 | 56 | 56 | 0 | | d02 | 56 | 56 | 0 | | d03 | 56 | 55 | 1 | | d04 | 56 | 55 | 1 | | d05 | 56 | 55 | 1 | | d06 | 56 | 56 | 0 | | d07 | 56 | 56 | 0 | | d08 | 56 | 56 | 0 | | **Total** | **448** | **445** | **3** | **Totals: 1713 passed, 4 skipped, 0 failed, 0 errors.** The skips are the host's: three `test_shape_doctor.py` rows that print the PowerShell line and need `powershell.exe` on a Windows host, and one `test_adopt_plan.py` row that needs `SHAPE_MEDXEHR_CLONE`, a read-only clone of MedxSoft/MedxEHR. The gate paused after d02 for disk space and ran d03 to d08 later, on the same scratch merge, whose head did not change. ## Merges `git merge-tree --write-tree`, this head `900f77af` against each of these; all are clean (rc=0, no conflict): | Against | Head | Tree | |---|---|---| | `main` | `961640c6` | `90fbea0e` | | #1122, the base | `c01c4d73` | `e2cea9b3` (this head's own tree) | | #1186 | `07486a49` | `78702414` | | #1180 | `6cd96b8b` | `eff9e4db` | | #1178 | `c4beba19` | `b79abc31` | | #1177 | `5208e874` | `91156ae6` | | #1171 | `8162b874` | `87e2ce31` | | #1170 | `24ee133a` | `f001382d` | | #1169 | `25805102` | `b58ed451` | | #1154 | `8a782833` | `2e67c977` | | #1153 | `ff33ba12` | `070c39b2` | | #1143 | `7af5fabc` | `7237b405` | | #1141 | `7a2711d0` | `c0bcaf88` | | #1125 | `9549006f` | `c16ff99a` | | #1123 | `5c3908f8` | `aba16ad4` | | #1121 | `1c517375` | `6e1f5cb9` | | #1120 | `c55e55e3` | `845f0ab5` | | #1119 | `bba168bd` | `ab6af7c8` | | #1118 | `2307036a` | `1d53a9d9` | | #1106 | `504a1dd6` | `60cd4c67` | | #1105 | `b28f40de` | `b5f065ec` | | #1189 | `8684af86` | `352b9e86` | | #1190 | `00f959c6` | `6335ed44` | These are the open PRs that touch `adopt-project.py`, and #1122 also touches `tests/test_adopt_unsearchable_source.py`. #1189 and #1190 opened, and #1169 and #1171 moved, after the first run of these; the four were merged again at the heads shown, just before the push, and the other heads were read again and had not moved. The merge with #1122 is clean as text, and see "Why stacked" for what it does not settle. ## Out of scope - **The origin url has its own reader.** A local source whose `origin` is `https://github.com/<40 c's>/Thing` is read by `url_repository` in `scripts/repo_shape.py`, a pinned script that shares the reading with `shape-doctor.py`, and not by `_github_name`. It still records that name, and `--org testorg` would be told `--org <40 c's>`. I read this in the code and did not measure it. - **Owner characters.** `_github_name` takes owner characters GitHub gives no owner: `.`, a trailing `-`, and `--`. `_` is let by on purpose, for GitHub Enterprise Managed Users (#863's `GITHUB_OWNER_CHARACTERS`). The brief limited this change to the two lengths. - **The refusal's wording.** `source-unresolvable` for a spelling past the limits says "neither a path that exists nor an `org/repo` name", which is true now, but does not say which limit it broke. Closes #1129 Lane: openreposhape-4 (openRepoShape-4) Co-Authored-By: Claude Opus 5.5 <[email protected]>
…able character, which a terminal draws as nothing, is spelled by its code point in `plan`'s lines and in the `unsafe-value` refusal, so a branch `ma<U+034F>in` no longer prints as `main` (#1128) (#1171) **It was stacked on #1120,** which landed as `6740776`. RS1171 then restacked it onto `main`: it merged #1120's final head, then its squash, then `main` as `main` moved, and the result carries exactly the reviewed change (#1171 issuecomment-6752897940). ## What was wrong `_shown` printed a name as it is wherever `str.isprintable()` passed it, and `_spelled_character` wrote such a character as it is. `str.isprintable()` passes 267 of Unicode's Default_Ignorable_Code_Point characters, which a terminal draws as nothing: 263 combining marks, among them U+034F and the variation selectors, and the four Hangul fillers, among them U+3164. Git takes each in a branch or a path, so a source on `ma<U+034F>in` printed in `plan`'s `source` line (#1120's) as `(main)`. `checked_value`'s `unsafe-value` refusal names the value with `repr`, which printed U+3164 raw on stderr the same way. RV1120 found both (#1120 issuecomment-6319321596). ## What changed - `scripts/repo_shape.py`: - `DEFAULT_IGNORABLE_RANGES`: the property's 27 lines of `DerivedCoreProperties.txt`, joined into 17 ranges, 4174 code points. The table is the same in Unicode 14.0.0, 16.0.0 and 17.0.0, and is written into the code with a citation, not asked of `unicodedata`. CI runs Python 3.14 and the bench 3.12, and their `unicodedata` differ. - `DEFAULT_IGNORABLE`, one character of the table as a pattern. - `code_point_escaped`, taken out of `_escaped`, which writes exactly what it wrote before. - `visible_repr`: `repr` with each default-ignorable character written as its code-point escape. - `checked_value`'s `unsafe-value` refusal names the value with `visible_repr`: `'ma\u3164in'`, where it said `'ma<U+3164>in'`. - `adopt-project.py`: - `_shown` spells a name that holds a default-ignorable character, whatever `str.isprintable()` says of it: `` `ma\u034fin` ``. - `_spelled_character` writes one as its code-point escape, which the plan's reader reads back as the character. - `_shown`'s signature, and its output for every other character, are unchanged, so #1120's and #1154's rows still pass. `scripts/repo_shape.py` is a shape copy that every root digest-pins, so this change shows every project an `upstream-changed` row, as every change to it does. The new names are used inside the file itself: `checked_value` calls `visible_repr`. No pinned copy calls `checked_value` (`validate-family.py` only names it in a comment); the change is in `scripts/repo_shape.py` because `checked_value` lives there, so its refusal cannot change without the `upstream-changed` row. No pinned script imports a new name, so the skew rule in `test_pinned_copy_text.py` holds, and its list of names a kept `repo_shape.py` may lack, `NEWER_THAN_A_KEPT_LIBRARY`, now holds the four, so it refuses a pinned script that imports one. No sentence in README.md, AGENTS.md or the handbook describes these helpers. ## Tests `tests/test_adopt_shown_default_ignorables.py` (new, 48 rows, ASCII only; every character outside ASCII is written as an escape): - The table against `DerivedCoreProperties.txt`, listed again line by line in the test, so no row depends on the Python's Unicode data. - The compiled `DEFAULT_IGNORABLE` against the table, over all 0x110000 code points: not one more, not one fewer (RV1171's N1). - All 4174 code points through `_shown`, `_spelled_character` and `checked_value`'s refusal. - A value that holds three, `m` U+034F `a` U+3164 `in` U+FE0F, through `checked_value`'s refusal and `_shown`: each is written as its escape and none is raw (RV1171's S1). - The issue's characters (U+034F, U+3164, U+FE0F, and the controls U+200B, U+2060 and U+180E, which were spelled already) through `_shown`, through a read back of the plan, and end to end through `plan`. In `plan`, they appear in the `source` line, the tracking-branch NOTE, a path in the table, and the `unsafe-value` refusal on stderr. - The rows RV1120 asked for on #1120's `source` line (#1128 items 2 and 3): - `feat/caf\u00e9` prints as it is; - a branch named `` `main` ``, backticks included, is spelled `` `\x60main\x60` ``; - the branch that is not UTF-8 is spelled `` `caf\udce9` `` under a `utf-8:surrogateescape` stdout, where main wrote the byte 0xE9 itself. `tests/test_adopt_spelled_unambiguous.py`: its two sweeps of every character take the default-ignorables apart and hold each to its escape. `tests/test_pinned_copy_text.py`: `NEWER_THAN_A_KEPT_LIBRARY` holds the four new names, so the skew rule refuses a pinned script that imports one (RV1171's N3). Counts for the new file: | Code | Result | |---|---| | main `961640c68` | 28 failed, 20 passed | | #1120 alone `c55e55e3` (the 10 `source`-line and item 2-3 rows) | 3 failed, 7 passed | | this head | 48 passed | - On main, every failure is for the right reason: - the table is missing; - 267 characters come back raw from `_shown`, `_spelled_character` and the refusal, and the three in one value are raw in both; - the compiled pattern is missing too; - the raw bytes are in the `source` line, the NOTE, the table and stderr; - `` (`main`) `` is printed as it is; - `caf\xe9` is on stdout. - The 20 rows that pass on main are the controls: the three format characters, the printable names and `feat/caf\u00e9`. - On #1120 alone, the 3 failures are U+034F, U+3164 and U+FE0F in the `source` line. **Items 2 and 3's three rows pass on #1120 alone: they pin #1120's code**, which is right in each case. They kill RV1120's mutants E (`_spelled` for every branch outside ASCII) and N (`str.isprintable()` alone, with no backtick rule). ## Sweep Run with `/usr/bin/python3` 3.12.3 (Unicode 15.0.0), against #1120's head `c55e55e3`, whose helpers are main's: - Of the 4174 default-ignorable code points, 267 pass `str.isprintable()` (263 Mn, 4 Lo). Raw on the base: 267. Raw on this head: 0. - Of the 148731 printable code points that are not default-ignorable, none is spelled on this head. - For every code point that is not default-ignorable, `_shown`, `_spelled_character` and `visible_repr` give the same output as the base's `_shown`, `_spelled_character` and `repr`: 0 differ. ## Mutants Each ran against the new file, `test_adopt_spelled_unambiguous.py` and #1120's `test_adopt_plan_source_branch_shown.py` (212 rows). Each file was restored afterwards and its sha256 checked. | Mutant | Result | |---|---| | The table empty | killed: the pattern no longer compiles, so every row errors | | The table's pattern matches nothing | killed, 20 rows fail | | The range U+115F-U+1160 dropped | killed, 3 rows fail | | The range U+1D173-U+1D17A dropped | killed, 1 row fails (the table row) | | The escape removed from `_spelled_character` | killed, 18 rows fail | | `checked_value` back on `repr` | killed, 4 rows fail | | The compiled pattern runs one past each range, the table unchanged | killed, 1 row fails (the compiled-pattern row) | | `visible_repr` escapes only the first match (`count=1`) | killed, 1 row fails (the three-in-one row) | | A pinned script (`validate-family.py`) imports `visible_repr` | killed, 1 row fails (the skew rule's `validate-family` row); passes on the old list | ## Gate On a scratch merge commit of `origin/main` `038dafba9`, #1120's `c55e55e3` and this head (`39cb15180`), in the landing gate's environment with a stub `gh`: - 94 test files, 9806 ids, in 6 shards: every test file that mentions `_shown`, `_spelled` or `unsafe-value`, with `test_tracking_branch_ref.py`, `test_pinned_copy_text.py`, `test_adopt_plan_escapes.py`, `test_stdout_encoding.py`, `test_non_utf8_name_callers.py`, `test_path_guard_hygiene.py`, `test_repo_hygiene.py` and `test_scaffold_leg_path_collisions.py`. 9777 passed, 29 skipped, 0 failed. - `test_shape_doctor.py`, 448 ids in 8 shards from `mapfile` lists: 445 passed, 3 skipped, 0 failed. - On a merge of main, #1120, this head and #1154, the rows of #1154, of #1120 and of this PR: 166 passed, 1 skipped. - Fix round 1 (RV1171's S1, N1 and N3), test-only, so no doctor shards: on a scratch merge `331dc93c7` of `origin/main` `961640c68` and `8162b874e`, `test_adopt_shown_default_ignorables.py`, `test_adopt_spelled_unambiguous.py`, `test_pinned_copy_text.py`, `test_adopt_plan_source_branch_shown.py`, `test_stdout_encoding.py`, `test_path_guard_hygiene.py` and `test_repo_hygiene.py`: 496 passed, 1 skipped, 0 failed. ## Merge-trees `git merge-tree` of this head with `origin/main` is clean. So is each of the 13 other open PRs that touch `adopt-project.py` or `scripts/repo_shape.py`, against both this head and the scratch merge: #1154, #1153, #1143, #1141, #1126, #1125, #1123, #1122, #1121, #1119, #1118, #1106 and #1105. Fix round 1: `git merge-tree` of `8162b874e` with `origin/main` and with #1105 (the one other open PR that touches `tests/test_pinned_copy_text.py`) is clean, and so is the scratch merge with #1105. ## Out of scope: filed separately by the lane The other helpers that test only `str.isprintable()`, or use `repr`, let the same characters through. They are: - the `repr`-based `_shown` copies in `validate-repository-naming.py`, `validate-manifest.py` and `validate-pins.py`, and `repo_shape.shown_path`; - `shape_materialize.py`'s `-`-leading `unsafe-value` refusal; - `repo_shape.double_quoted`, which writes them raw into the plan file; - `adopt-project.py`'s `_worded`, `_line_shown`, `unwritable_values` and `_refuse_an_unwritable_clone_url`. They are filed separately by the lane as #1165 (see #1165), and are untouched here. Closes #1128 Lane: openreposhape-4 (openRepoShape-4) Co-Authored-By: Claude Opus 5.5 <[email protected]>



Part of #1089: SHOULD-2, N3 and N4 of r1070's review of #1070 (Part of #979), and the fix round for r1118's review of this PR (SHOULD-1, NIT-1, NIT-2 and NIT-3). N1 is left. This PR is a draft with no milestone: Brett Heap ruled on 2026-10-21 at 10:32:04Z to leave the follow-ups out of v1.2.0, so it lands after the v1.2.0 tag.
What
#1070 left a link that
plan-empty-symlinkorplan-bad-symlink-targetnames out ofplan-root-blocks-shape-copyandplan-root-holds-pin. r1070's mutants M12, M13 and M14 each lose a finding that head makes for ANOTHER path, and each passed the whole oftests/test_adopt_symlink_target_bytes.py(130 passed). A loss lasts one round only: the link's own finding keepscheckfailing. These are the three tests, and two wording changes.SHOULD-2:
test_a_named_link_leaves_out_its_own_finding_and_no_other, three cases. Each plan holds a named link (a late NUL,plan-bad-symlink-target) AND a second path the shape also writes, kept in the root. Each asserts two findings, the link's own first, then the second's, and the remediation once.shape/README.mdplan-root-blocks-shape-copy: "the fileShape/README.mdonce case is ignored"contracts/openglass-pin.yaml,openGlassdeclaredplan-root-holds-pinforcontracts/shape-pin.yamlshape/README.md, withshape/Makefile,MakefileandREADME.mdkeptplan-root-blocks-shape-copyforMakefile, written toshape/MakefileThe link's own entry is answered
rootin the third case:planproposesspecforshape/README.mdby its.mdextension, and a link sent to a leg is not kept in the root, so the copy skip M14 breaks is never reached for it. The first version of the case left it atspecand M14 survived; a lost second finding now fails with the findings listed, not an unpack error.N3: the
_root_symlink_findingsdocstring. It said a link AT a copy or AT a pin is adopt-project.pycheckpasses a plan that keeps the source's ownshape/in the root, andplace()then writes the shape's collision copy onto it after both legs are pushed: a realshape/README.mdis overwritten whileexecuteprints "nothing was overwritten" and endsadopt-lost, and ashape/Makefile/directory or a file namedshapeis a traceback #262's or adopt-project.py--pin <name>is accepted byplan,checkandexecute("adoption verified"), but writes only the name intoneutral_product_pins:and nocontracts/<name>-pin.yaml, so the adopted root's ownvalidate-pins.py(and itsvalidate.yml) refuses withneutral-pin-missingfrom the first run #273's to say, with no exception. It now says a linkplan-empty-symlinkorplan-bad-symlink-targetnames one by one is the exception (adopt-project.py:checkpasses a symlink target of 1024 to 4095 bytes that macOS and XFS cannot make, and a bad link atshape/README.mdorcontracts/shape-pin.yamlis also named byplan-root-blocks-shape-copyorplan-root-holds-pinwith a remedy that cannot help it (follow-ups of #908) #979):_root_shape_findingsand_kept_pin_findingsleave it out, it is named once by its own finding, and a link only counted, past the twenty each names, is still adopt-project.pycheckpasses a plan that keeps the source's ownshape/in the root, andplace()then writes the shape's collision copy onto it after both legs are pushed: a realshape/README.mdis overwritten whileexecuteprints "nothing was overwritten" and endsadopt-lost, and ashape/Makefile/directory or a file namedshapeis a traceback #262's or adopt-project.py--pin <name>is accepted byplan,checkandexecute("adoption verified"), but writes only the name intoneutral_product_pins:and nocontracts/<name>-pin.yaml, so the adopted root's ownvalidate-pins.py(and itsvalidate.yml) refuses withneutral-pin-missingfrom the first run #273's.N4:
scripts/shape_materialize.py, two places.copy_in_the_way's docstring and thematerialize-copy-blockedremediation namedplan-root-blocks-shape-copyfor a path kept at the copy. Both now say a symlink there whose targetplan-empty-symlinkorplan-bad-symlink-targetnames one by one is that finding's alone. The remediation then says what helps such a link, and in what order:plan, since no answer in the plan changes a target (dropdoes not help);plan-root-blocks-shape-copy's, and sending that path to a leg or dropping it is the answer that helps.Only a caller that skips
checkreaches this text.test_the_materializer_names_a_bad_link_at_the_copy_by_its_own_finding, intests/test_adopt_root_shape_paths.py, pins both places. It sets the link up in both forms a clone holds a late-NUL targetspec\0.mdin: a link tospecwhere git makes links (underneeds_disk_symlinks), and a plain file of the blob's 8 bytes wherecore.symlinksis false. Each is refused and left as it was, and the remediation is pinned from "reports a plan" to "Then runexecuteagain" as one run of words.The file is not pinned.
scripts/shape_materialize.pyis in none ofCOPIED_VERBATIM,COPIED_FROM_SHAPE,FAMILY_COPIED_VERBATIM,FAMILY_COPIED_FROM_SHAPEor the twoEXECUTABLElists, a project carriesrepo_shape.pyand not this file, and no test checks its bytes or a digest of it: the tests that read it as text strip copy-list entries from a copy of it, which the new prose does not touch.r1118's review, answered
r1118 found no MUST, and was READY on the condition of SHOULD-1.
plan, and that the plan answer is what helps once the link has a target of its own. Each clause was measured by probe (probe_should1.py, modelled on r1118's P1-P11 andprobe_mat.py); the table follows this list.copy_in_the_way's docstring. Probe Q1c below, as r1118's P10 and P10b showed: a link only counted past the twenty is stillplan-root-blocks-shape-copy's.core.symlinks=truegives a link tospec, andcore.symlinks=falsegives a file holdings p e c \0 . m d. The link case runs underneeds_disk_symlinks, so the prose stays pinned on every host.tests/test_adopt_symlink_target_bytes.py. The paragraph is reflowed, and no other word changed._KeptTree._at's first-row-wins) is older than adopt-project.py:checkpasses a symlink target of 1024 to 4095 bytes that macOS and XFS cannot make, and a bad link atshape/README.mdorcontracts/shape-pin.yamlis also named byplan-root-blocks-shape-copyorplan-root-holds-pinwith a remedy that cannot help it (follow-ups of #908) #979 and is a follow-up candidate, not part of this PR.checkgivesshape/README.md,shape/kept in the rootshape/README.md, only countedplan-empty-symlink, and 1plan-root-blocks-shape-copynaming the symlinkshape/answereddrop, orspecplan-bad-symlink-targeteachplanre-run,shape/kept or droppedplan-bad-symlink-targeteachplanre-runplan-bad-symlink-target, thenplan okplan"plan-stale, andplan-root-blocks-shape-copyplan"planre-run,shape/kept in the rootplan-root-blocks-shape-copy: "That path is the symlinkshape/README.md"plan-root-blocks-shape-copy's"shape/left atplan's ownspec, dropped, or sent tocodeplan okeachshape/README.md,shape/kept, dropped, or sent tospecplan-root-blocks-shape-copy, thenplan ok,plan okdropit in the plan"spec, a file ofspec\0.md, a link to../README.md, a plain filematerialize-copy-blockedeach, the same remediation, and each left as it wasDecisions
_at_the_manifest's, is not a simple mirror: it needs three tail texts (a copy, the shape's own pin, a declared pin) with a case-twin aside for each, a plan-dependent read in_source_path_findingsthat_links_at_the_manifestguards by name, and a change to the signatures of_empty_symlink_findingsand_bad_symlink_target_findings. It would also breakassert "where the shape writes" not in findingintest_a_named_link_at_a_copy_or_a_pin_is_one_finding, which pins adopt-project.py: a bad link thatplan-empty-symlinkorplan-bad-symlink-targetnames is no longer named again byplan-root-blocks-shape-copyorplan-root-holds-pin, so it gets one finding, and the #908 comments say Linux's bound (#979) #1070's decision 1 ("no location tail"). That decision stands, so the PR says "Part of adopt-project.py and tests/test_adopt_symlink_target_bytes.py: follow-ups of PR #1070 (#979) from its review: three behaviours of the named-link skips that no test holds (mutants M12-M14), and three wording gaps #1089" and not more.Tests
This round's runs used a stub
ghfirst on PATH,GH_TOKEN=bogus-f1118, an emptyGH_CONFIG_DIR,GIT_CONFIG_GLOBAL=/dev/null,GIT_SSH_COMMAND=falseandEMAIL, underenv -u LANES_LANE, with one reused basetemp.Base against head, on the changed rows. Each tree was given head's two test files:
test_the_materializer_names_a_bad_link_at_the_copy_by_its_own_finding, 2 casestest_a_named_link_leaves_out_its_own_finding_and_no_other, 3 cases4ed7c7bfc60066cb, this PR before the fix round2307036aMutants, each written into a scratch clone at head, run, then restored and proved by sha256:
T01-T16, of the reworded remediation and docstring, each run against the pinning test alone: 16 of 16 killed, each by both of its cases. They drop "one by one" (from the remediation, and from the docstring), "first", "commit", "or remove it there", the "since" clause, the "A link kept there" sentence, "or
dropit", "plan-empty-symlinkor", and "adopt-project.py:checkpasses a symlink target of 1024 to 4095 bytes that macOS and XFS cannot make, and a bad link atshape/README.mdorcontracts/shape-pin.yamlis also named byplan-root-blocks-shape-copyorplan-root-holds-pinwith a remedy that cannot help it (follow-ups of #908) #979". Others swapplan-bad-symlink-targetforplan-root-blocks-shape-copy, "is no help" for "is the one that helps", "twice" for "once", "too" for "alone", and "any target" for "a target of its own", or restore the old "; for such a symlink" clause.r1070's M12, M13 and M14, on the merge with main
4ed7c7bf, against the whole oftests/test_adopt_symlink_target_bytes.py, without-x: 3 of 3 killed, each by its own case alone (1 failed, 132 passed).[a-case-twin-of-the-readme-copy][a-file-at-the-shape-pin-after-a-declared-pins-link]break[a-file-at-the-makefile-copy-after-the-readme-copys-link]M13's old text no longer occurs: adopt-project.py:
checknames what the clone's.githolds as git keeps refs, and asks a pin's file through the links the root keeps, so a link into.gitor onto a pin's file is refused before any leg or adopted with the copy beside it (#904) #1091 moved the pin skip into_kept_pin_finding, which answers[]for a named link, and its caller then moves on to the next pin file. The same mutant was ported there: the caller returns on that answer.The gate ran on head
2307036a(this branch merged with main4ed7c7bf), with one basetemp. It ran in 13 pytest calls, and no call ran longer than 9 minutes: 1870 passed and 25 skipped, 0 failed. The first 10 calls ran in the fix round; lane 1 ran the last 3 after its checkpoint, in the same probe environment and basetemp.tests/test_adopt_symlink_target_bytes.pytests/test_adopt_root_shape_paths.pytests/test_shape_doctor.py, 4 shards of 112 idstests/test_scaffold_leg_path_collisions.pytest_update_shape_add.py,test_family_makefile_siblings.py,test_neutral_pin_entry_one_spelling.py(the tests that readscripts/shape_materialize.pyas text), one calltest_update_shape_unreadable.py,test_adopt_leg_path_collisions.py,test_family_init_values.py,test_git_output_decoding.py(the same), one calltests/test_repo_hygiene.py,tests/test_agents_md_codes.py,tests/test_cli_reference.py, one calltests/test_adopt_root_symlinks.pytests/test_adopt_printed_sentences.pytests/test_adopt_pins.pyThe skips:
test_shape_doctor.py:10510: they print a PowerShell line and needpowershell.exe, so they run on a Windows host only.test_family_init_values.py:229(that template quotes the placeholder) and 3 are at:301(that template quotesid:).tests/test_adopt_root_shape_paths.pyhas 123 rows: the 121 it had before, main'stest_the_materializer_stops_at_a_link_at_the_copy, and the N4 test's second case. Onc60066cb, before this round, the whole gate of 12 calls gave 1765 passed and 22 skipped.Merge with main
The branch merged main twice, both plain merges:
c60066cbmerged main6da757cb, clean.959712c5merged main4ed7c7bf(adopt-project.py:checknames what the clone's.githolds as git keeps refs, and asks a pin's file through the links the root keeps, so a link into.gitor onto a pin's file is refused before any leg or adopted with the copy beside it (#904) #1091, scaffold-project.py: the--reuse-empty-repohelp, its docs and each remedy that sends a person into that re-run say ssh, a credential helper or askpass can still make it wait, and how to keep it from waiting (#915) #1101 and templates/assembly-root/project.yaml and templates/family-root/family.yaml: the comment abovevisibility:says it is the visibility the run asked for, and that a repository the run reuses keeps its own, where it said "this is all three repositories' visibility" (#913) #1102). It conflicted intests/test_adopt_root_shape_paths.py, where both sides added a test aftertest_the_materializer_never_writes_a_copy_over_what_is_there: main'stest_the_materializer_stops_at_a_link_at_the_copy(adopt-project.pycheck: a root-kept symlink into the clone's.git, or through a kept link to a declared pin's file, passes, or is refused for a reason that is not true #904) and this branch's N4 test. Both are kept whole, main's first.adopt-project.pymerged by itself.Against main, the merge's diff is exactly this branch's change lines, and against
c60066cbexactly main's: the sorted change lines were compared by digest. On the merge, before it was committed,tests/test_adopt_root_shape_paths.pygave 122 passed andtests/test_adopt_symlink_target_bytes.py133 passed. The landing refresh merges main again.Part of #1089
Lane: openreposhape-1 (openRepoShape-1)
🤖 Generated with Claude Code
Summary by Sourcery
Preserve independent findings after named invalid symlinks and clarify the remediation for blocked symlinks during materialization.
Bug Fixes:
Enhancements:
checkpasses a symlink target of 1024 to 4095 bytes that macOS and XFS cannot make, and a bad link atshape/README.mdorcontracts/shape-pin.yamlis also named byplan-root-blocks-shape-copyorplan-root-holds-pinwith a remedy that cannot help it (follow-ups of #908) #979 exception so named bad or empty symlinks are reported only by their own finding.Tests: