Repository navigation
adopt-project.py and scripts/shape_materialize.py: a kept Makefile/ DIRECTORY is no Makefile of the source's own, so the CONTRACTS_DIR line, the Makefile's collision line and NEXT say GNU make stops at it, in the words a kept GNUmakefile/ (#1207) and makefile/ (#1312) get, and none says the shape's Makefile waits to be merged with it (#1314) - #1321
brettheap wants to merge 4 commits into
Conversation
… DIRECTORY is no Makefile of the source's own, so the `CONTRACTS_DIR` line, the Makefile's collision line and NEXT say GNU make stops at it, in the words a kept `GNUmakefile/` (#1207) and `makefile/` (#1312) get, and none says the shape's Makefile waits to be merged with it (#1314) `_root_keeps({"Makefile/"}, "Makefile")` is True, and stays so: `place` asks `Path.exists()`, which is True of a directory, so the shape's `Makefile` goes beside a kept `Makefile/` as `shape/Makefile`, and `_predict_collisions` must name that copy. Changing `_root_keeps` would drop the collision line for every shape path kept as a directory of its name (8 top-level paths, measured), while `execute` still writes beside each. The words are what read the directory as a Makefile, so they now tell the two apart: - `_make_reads_first` gives `Makefile/` where the root keeps that directory and neither `GNUmakefile` nor `makefile`; a kept `Makefile` FILE still gives None. - `_makefile_follow_up`: "it is written as `shape/Makefile`, and not as the root's `Makefile`, where the source's directory `Makefile/` is that path; and GNU make at the root stops at the source's directory `Makefile/`, ... (`Makefile: Is a directory.`), so `make` there exports `CONTRACTS_DIR` only once the root keeps no directory of that name". - `_next_steps`: no NOTE names a merge of the Makefile beside the directory; the lead is "the shape's Makefile is shape/Makefile, and", and where the script went aside too only the script's merge comes first. - `collision_follow_up` takes `directory=`, which `_predict_collisions` passes and only the Makefile's follow-up reads: "shape/Makefile is the shape's Makefile: the source repository already has a directory `Makefile/` of that name, so the shape's copy was written beside it and NOTHING was overwritten. GNU make at the root stops at ..." with no merge and no removal of the copy. - #1312's two comments that left `MakeFile/` and `MAKEFILE/` to #1314: they need no clause, as the docstring says why. Measured with GNU make 4.3: a root holding `Makefile/` (and `shape/Makefile`) exits 2 with `make: *** Makefile: Is a directory. Stop.`; beside a `GNUmakefile` that includes `shape/Makefile`, `make` reads that file and runs the shape's recipe. A sweep of `_predict_collisions` over every shape path kept as a file, a directory of its name and its first segment's directory differs only at `Makefile/`. Co-Authored-By: Claude Opus 5.5 <[email protected]> Lane: openreposhape-2 (openRepoShape-2)
…a `Makefile/` directory, `check`'s `CONTRACTS_DIR` line and collision line, `execute`'s NEXT and the split commit's message each say GNU make stops at the directory and none says the two are merged; the words match a kept `makefile/` and `GNUmakefile/`; a kept `Makefile` FILE reads as before (#1314) 25 rows: one real adoption (`plan --path-policy`, `check`, `execute --local-remote-dir`, `make -n bootstrap` in the pasted clone) with a row per surface; one row that the stop clause a `Makefile/` gets in the `CONTRACTS_DIR` line and NEXT equals the one `makefile/` and `GNUmakefile/` get, and the collision line's with its own reach; `_make_reads_first` for 8 roots; 5 roots that keep `Makefile/` beside other names; the script-aside and `GNUmakefile` texts in full; the file against the directory; `MAKEFILE/` and `MakeFile/`; and the GNU make measurement the words rest on. Co-Authored-By: Claude Opus 5.5 <[email protected]> Lane: openreposhape-2 (openRepoShape-2)
Reviewer's GuideImplementationUpdate adoption guidance and collision reporting so a kept
TestsAdd coverage for the adoption and collision messages, NEXT instructions, GNU make behavior, and the required move of the shape Makefile, while checking unaffected cases.
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
(lane openRepoShape-2, 2026-11-10T19:39:18Z) RV1314, the independent review of this PR at Next: lane 2's fix round runs now, on this branch, for SHOULD-1 and NIT-1, NIT-2, NIT-3 and NIT-5. A delta review follows. The out-of-scope candidates C1 and C2 go to Brett Heap through lane 3's list, and no issue is filed for them. RV1314: independent review of PR #1321 (for #1314) at 7392e85Reviewer rv1314, lane openRepoShape-2, 2026-11-10. I wrote none of this PR. The diff reviewed is Verdict: READY AFTER FIXESThere is no MUST. #1314's Verify section is met on every surface: I measured that with real adoptions, before and after the change. There is one SHOULD: for a kept FindingsSHOULD-1: for
|
| step in the clone | make -n bootstrap |
|---|---|
| as cloned | rc 2, make: *** Makefile: Is a directory. Stop. |
Makefile/ renamed away, so the root keeps no directory of that name |
rc 2, make: *** No rule to make target 'bootstrap'. Stop. |
then shape/Makefile moved to Makefile |
rc 0, prints python3 scripts/bootstrap.py; make -n contracts-dir rc 0 |
The same holds for Makefile/ beside a GNUmakefile/ directory. NEXT and the CONTRACTS_DIR line name only GNUmakefile/'s condition. Measured in a scratch folder (both directories plus shape/Makefile):
- make stops at
GNUmakefile; - with that directory gone, it stops at
Makefile; - with both gone:
No rule to make target 'bootstrap'; - rc 0 only after
shape/Makefileis moved toMakefile.
So the body's "The CONTRACTS_DIR line and NEXT are right for that root" is too strong.
The change I would make: wherever the directory is Makefile/ (directory_aside, or directory in collision_follow_up), say what brings the targets. For example: "only once the root keeps no directory of that name and shape/Makefile is moved to Makefile", and give its pin row's fate as the file case does ("update-shape.py check reports its pin row ..."). I did not measure what update-shape.py check says after such a move. If lane 3 rules this out of adopt-project.py and scripts/shape_materialize.py: a kept Makefile/ DIRECTORY is read as a Makefile of the source's own, so the CONTRACTS_DIR follow-up, NEXT and the collision line say the shape's Makefile waits to be merged with it, where GNU make stops at the directory #1314's scope, it is a follow-up candidate.
NIT-1: no row pins "only the Makefile's follow-up reads directory"
- Where:
scripts/shape_materialize.py,directory = directory and intended == "Makefile". - Mutant M5 (
directory = bool(directory)) survives the new file (25 passed). It also survivestest_adopt_root_shape_paths.py,test_adopt_leg_path_collisions.py,test_pinned_copy_text.pyandtest_adopt_collision_make_reads.py(333 passed). - The body's sweep is the evidence for this claim, but it is not a row.
- Change: add a row that, for each top-level shape path other than
Makefile,_predict_collisionsof<path>/equals that of<path>.
NIT-2: a row pins #1240 item B's defect, which #1207 declined to do
- Where:
tests/test_adopt_kept_makefile_directory.py:338,assert (stopped in collision) is (stop == "Makefile"). - For
beside-GNUmakefile-dirandbeside-makefile-dir, this asserts that the collision line does NOT say GNU make stops at that directory. That is the wrong reading adopt-project.py, shape_materialize.py and the assembly-root template: after #1121 and #1105, oneGNU_MAKE_READSand one lookup, their NEXT NOTE and collision line as true as #1207's, and the NITs 1, 3b, 3c, 4 and 5 of #1105's second review #1240 item B is to correct, and adopt-project.py, shape_materialize.py and the assembly-root template: a keptGNUmakefile/is a directory GNU make stops at,python3 scripts/bootstrap.pynamespythonon Windows, and the template says what to run wheremakereads another file #1207's body says it added no such row for that reason. - Change:
if stop == "Makefile": assert stopped in collision.
NIT-3: the _make_reads_first docstring's first sentence is no longer true
- Where:
adopt-project.py:4420-4424. - It still says "the first of
GNUmakefileandmakefilethe root keeps ... None where it keeps neither". For a root that keepsMakefile/, the function now returnsMakefile/. The added paragraph says so, but the summary contradicts it.
NIT-4: one test is written three ways
- Where:
adopt-project.py:4531,adopt-project.py:18314-18315,adopt-project.py:7381-7382. - The test is "the root keeps the directory
Makefile/and not the file", and each place spells it differently. One small helper would keep the three surfaces from drifting apart. Optional.
NIT-5: two Makefile/ + makefile rows describe a root check refuses
- Where:
tests/test_adopt_kept_makefile_directory.py:293and:314. - Measured: a source with
Makefile/rules.mkand amakefilefile getscheckrc 1,FINDING plan-case-twins(Makefile/rules.mkandmakefile).executerefuses before any leg exists, so NEXT and the split message never appear for such a root. check's two lines for it do read right. A word in the rows' docstrings would say why only the unit surfaces are pinned there.
Measured (M), against read only (R)
-
M: the four Verify surfaces for a kept
Makefile/, from real adoptions (check'sCONTRACTS_DIRline, the collision line, NEXT, and the split commit's message). Each says GNU make stops atMakefile/, and none says the two are merged. -
M: with the code diff reverse-applied, the "before" texts are exactly as the body quotes them, and
make -n bootstrapgives rc 2 withMakefile: Is a directory.. -
M: on the base code, the new file gives 15 failed and 10 passed (the body's figure).
-
M: the words match. The stop clause for
Makefile/is the one adopt-project.py, shape_materialize.py and the assembly-root template: a keptGNUmakefile/is a directory GNU make stops at,python3 scripts/bootstrap.pynamespythonon Windows, and the template says what to run wheremakereads another file #1207 givesGNUmakefile/. The placement clause uses adopt-project.py:checkandexecutework the follow-ups out from the plan as it stands andplanno longer stores them, so after a hand edit of an entry'sleg:neitherchecknor the split commit names aGNUmakefileor a collision the root no longer keeps, and a plan that still holds afollow_ups:list is refused by name (#1206) #1312's words formakefile/("where the source's directory ... is that path"). -
M: a kept
MakefileFILE is unchanged. No existing test file changed, and they all pass. For file+script and script-only adoptions,check, NEXT and the split message are byte-identical between head and base, apart from commit shas. -
M: subset sweep. I took 2048 subsets of {
Makefile,Makefile/,makefile,makefile/,GNUmakefile,GNUmakefile/,MAKEFILE/,MakeFile,Makefile/rules.mk,scripts/,README.md}:- nothing raises, at head or at base;
_make_reads_firstdiffers in 32 subsets, and the follow-ups and NEXT in 512;- every one of those subsets keeps
Makefile/withoutMakefile. So no caller takes a new branch for any other root (check 3).
-
M: the
_root_keepssweep has 18 shape paths: 18 as a file, 18 as a directory of their own name, and 3 distinct first folders, 39 entries in all.- Head and base differ only at
Makefile/, 1 of 39. - On the base code, all 8 top-level own-name directories give the file's line.
placeusesPath.exists()(scripts/shape_materialize.py:5037), which is true of a directory. So the body's reasoning for leaving_root_keepsalone holds.
- Head and base differ only at
-
M:
Makefile/beside other names.- Beside a
GNUmakefilefile, all surfaces read right. - Beside a
makefilefile,checkrefuses withplan-case-twins. - Beside a
GNUmakefile/directory, the collision line says it "reads the source'sGNUmakefile". That is adopt-project.py, shape_materialize.py and the assembly-root template: after #1121 and #1105, oneGNU_MAKE_READSand one lookup, their NEXT NOTE and collision line as true as #1207's, and the NITs 1, 3b, 3c, 4 and 5 of #1105's second review #1240 B, a known limit the body names.
- Beside a
-
M: a plan whose entries name both
MakefileandMakefile/getscheckrc 1,plan-empty-entry: Makefile/ covers nothing(git cannot track both anyway). The unit surfaces read it as the file, as base does. -
M:
scripts/bootstrap.pyaside.- Alone, and beside a
Makefilefile: unchanged. - With
Makefile/: NEXT names only the script's merge and then the stop clause, and the collision line takes its "neither ... until then" form.
- Alone, and beside a
-
M: mutants. Each was restored with
git checkout --, and both sha256 sums were checked after each restore.id mutant rows killed M1 _make_reads_first's old condition10 M2 directory=False11 M3 NEXT's merge clause ignores the directory 5 M4 the script NOTE keeps the Makefile 2 M5 directoryread for every path0 (survives, see NIT-1) M6 _makefile_follow_up'sdirectory_aside=False9 M7 the stop clause used even with reads_first1 M8 _make_reads_firstreturnsMakefilefor the file2 M9 "Then remove shape/Makefile" kept for the directory 9 M10 NEXT's lead ignores the directory 6 -
M: the added lines have no non-ASCII character and none longer than 79 characters. Both commits are by
Brett Heap <[email protected]>. -
M:
git merge-treeoforigin/mainas last fetched (2af1d6644) with7392e85aais clean (tree9ff3e72e1). I did not gate it. -
R:
collision_follow_up's other callers all omitdirectory, and withdirectory=Falsethe function is byte-identical to before. They areMaterialized.follow_ups()(scripts/shape_materialize.py:3512, which nothing calls) and the test calls intest_adopt_attributes_eol_block.py,test_adopt_leg_path_collisions.pyandtest_adopt_make_bootstrap_followups.py. -
R: dependence of the rows on anything CI lacks.
- Nothing in them depends on the Python version or on git's version.
- GNU make's wording is pinned by 2 rows (
Is a directory., and themake -nstdout). Both are@needs_makeand have adopt-project.py, shape_materialize.py and the assembly-root template: a keptGNUmakefile/is a directory GNU make stops at,python3 scripts/bootstrap.pynamespythonon Windows, and the template says what to run wheremakereads another file #1207 precedent (test_adopt_make_bootstrap_followups.py:182). - CI's
testsjob isubuntu-24.04, which ships GNU make. I read no CI log.
Runs (all through run-l2.sh, at 7392e85 unless marked)
| run | files | result |
|---|---|---|
| 1 | tests/test_adopt_kept_makefile_directory.py |
25 passed (19:14:40Z) |
1, with LANES_LANE set (L2_KEEP_LANE=1) |
the same file | 25 passed (19:30:22Z) |
| 2 | test_adopt_make_reads_first.py, test_adopt_make_bootstrap_followups.py, test_adopt_collision_make_reads.py, test_adopt_next_make_reads_first.py |
137 passed |
| 3 | test_adopt_root_shape_paths.py, test_pinned_copy_text.py |
210 passed |
| extra | the new file, test_adopt_attributes_eol_block.py, test_adopt_printed_sentences.py, test_adopt_contracts_dir.py, test_adopt_follow_ups_as_the_plan_stands.py |
170 passed |
| extra | test_repo_hygiene.py, test_path_guard_hygiene.py |
222 passed (the body's 247 is these plus the new file's 25) |
| base code (reverse-applied) | the new file | 15 failed, 10 passed |
Out-of-scope candidates (no issue filed)
- C1: a nested shape path kept as a directory of its own name gets no collision line at all. An example is an entry
scripts/bootstrap.py/.- In the sweep, all 10 nested own-name entries give
[]._root_keepsasks only for the path and its first segment's directory, whileplace'sPath.exists()still writes the copy beside it. - This is in adopt-project.py:
planwrites its follow-ups once, so after a hand edit of the plancheckand the split commit name aGNUmakefilethe root no longer keeps, or say nothing of one it now keeps #1206 case 2's family. I did not measure whetherplanever writes such an entry.
- In the sweep, all 10 nested own-name entries give
- C2: adopt-project.py:
checkandexecutework the follow-ups out from the plan as it stands andplanno longer stores them, so after a hand edit of an entry'sleg:neitherchecknor the split commit names aGNUmakefileor a collision the root no longer keeps, and a plan that still holds afollow_ups:list is refused by name (#1206) #1312's keptmakefile/, on a disk that ignores case, has SHOULD-1's gap too. There the shape's copy isshape/Makefile, so removing the directory is not enough. Read only; I had no such disk to measure on.
Checks not done
- The doctor pair was skipped, as the brief says (the writer reports 550 passed and 3 skipped).
- I did not run
test_adopt_e2e.pyortest_adopt_leg_path_collisions.pyat the head. The second passed only under mutant M5. - I did not measure a disk that ignores case, or
update-shape.py checkafter movingshape/Makefile. - I read no CI log, and I did not gate the predicted merge with main.
All checks 1 to 8 of the brief are done. The worktree is clean at 7392e85, and both sha256 sums match the brief.
Lane: openreposhape-2 (openRepoShape-2)
…efile/` DIRECTORY the `CONTRACTS_DIR` line, the Makefile's collision line and NEXT say the shape's make targets arrive only once the root keeps no directory of that name AND `shape/Makefile` is moved to `Makefile`, and the collision line says the moved copy's pin row is `merged-away` (RV1314's SHOULD-1, #1314) #1321 reused #1207's clause "only once the root keeps no directory of that name". For a kept `Makefile/` the shape's copy is `shape/Makefile`, so removing the directory never brings the targets by itself. Measured in the clone NEXT pastes (GNU make 4.3): as cloned `make -n bootstrap` says `Makefile: Is a directory.`; with the directory renamed away, `No rule to make target 'bootstrap'`; and only after `shape/Makefile` is moved to `Makefile` does it exit 0 and print `python3 scripts/bootstrap.py`, with `make -n contracts-dir` answering too. - `_make_reads_first_clause` takes `moved`, which `_makefile_follow_up` and `_next_steps` pass where the root keeps `Makefile/` and no `Makefile` file: a directory `first` then ends "only once the root keeps no directory of that name and `shape/Makefile` is moved to `Makefile`", and where `first` is `GNUmakefile/` or `makefile/`, which GNU make stops at before `Makefile/` and stops at next once it is gone, "... no directory of that name or `Makefile/`, and `shape/Makefile` is moved to `Makefile`" (scratch folder: both gone leaves `No rule`; rc 0 only after the move). A file `first` and every other root are byte for byte as before. - `collision_follow_up` says the same for a `directory` with no `reads_first`, then "Once shape/Makefile is moved to Makefile, `update-shape.py check` reports its pin row `merged-away`, and `apply` drops the row": measured with `update-shape.py` in that clone, the row stays `unchanged` while the copy is at `shape/Makefile`, becomes `merged-away` once it is at `Makefile` (`merged_into` asks only that the copy is gone and the root holds a file at its name), and `apply` drops it, as for a merged file. With a `reads_first` file nothing is added: that file can include `shape/Makefile` where it is. - `_make_reads_first`'s first sentence no longer says it is the first of `GNUmakefile` and `makefile` only: it returns `Makefile/` too (NIT-3). Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Lane: openreposhape-2 (openRepoShape-2)
…`Makefile/` says the targets arrive only once the directory is gone AND `shape/Makefile` is moved to `Makefile`, a real clone is taken through RV1314's three steps, and only the Makefile's follow-up is pinned to read `directory` (RV1314's SHOULD-1, NIT-1, NIT-2, NIT-5, #1314) 37 rows (25 before): - the exact `CONTRACTS_DIR` line, collision line, NEXT NOTE, split message and script-aside texts carry the move, and the collision line the pin row's fate; - one real adoption's clone, through RV1314's steps: `make -n bootstrap` stops at `Makefile/`; with the directory renamed away it says `No rule to make target 'bootstrap'` while `update-shape.py check` calls the copy's row `unchanged`; with `shape/Makefile` moved to `Makefile` it prints `python3 scripts/bootstrap.py`, `make -n contracts-dir` answers, `check` calls the row `merged-away`, and the NEXT line `apply` drops it and leaves nothing to do; - beside `GNUmakefile/` and `makefile/` the `CONTRACTS_DIR` line and NEXT name both directories and the move, and a scratch folder pins the measurement (each directory gone in turn, then the move); - for each of the 7 other top-level shape paths, `_predict_collisions` of `<path>/` equals that of `<path>`, which kills mutant M5 (`directory = bool(directory)`) (NIT-1); - the beside-directory row no longer asserts that the collision line does not name another directory: that is #1240's item B (NIT-2); - the two `Makefile/` plus `makefile/` rows say `check` refuses such a root as `plan-case-twins`, so only the unit surfaces are pinned (NIT-5). Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Lane: openreposhape-2 (openRepoShape-2)
|
|
(lane openRepoShape-2, 2026-11-10T20:25:22Z) RV1314b, the delta review of the fix round (
RV1314b's review follows as the reviewer wrote it. The reviewer is an Opus agent that wrote none of this PR. RV1314b: delta review of PR #1321's fix round (for #1314), 7392e85..4f50eaeReviewer rv1314b, lane openRepoShape-2, 2026-11-10. I wrote none of this PR. The delta reviewed is Verdict: READY AFTER FIXES (the one fix is to the PR body; the code and rows need no further round)There is no MUST, and no SHOULD on the code. RV1314's SHOULD-1, NIT-1, NIT-2, NIT-3 and NIT-5 are each done as asked, and I measured each one. The one SHOULD is that the PR body still describes round one. It becomes the squash message, so it must be updated before landing. That is main's edit. There are also two optional NITs on the new collision-line sentence. FindingsSHOULD-B1: the PR body is round one's, and it would land as the squash message
NIT-B1: the new collision-line sentence spells the two paths two ways in one line
NIT-B2: "Once shape/Makefile is moved to Makefile" holds only once the directory is gone
Each item of the round
New risks (check 3): none found
The rows (check 4)
Mutants (check 5): each restored with
|
| id | mutant | result |
|---|---|---|
| MB1 | _next_steps passes moved=bool(makefile) |
killed, 3 rows; the new file alone does NOT kill it. Three older rows in test_adopt_make_bootstrap_followups.py do (test_next_beside_a_kept_makefile_says_the_merge_is_not_enough[GNUmakefile], [makefile], and test_next_after_the_merges_names_python3_where_a_directory_stops_make) |
| MB2 | the beside-directory form drops "or Makefile/," |
killed, 5 rows |
| MB3 | the pin-row sentence said with a reads_first file too |
killed, 1 row (test_a_gnumakefile_beside_it_is_what_make_reads) |
| MB4 | the script-aside form drops the pin-row sentence | killed, 1 row |
| MB5 | _makefile_follow_up passes moved=False |
killed, 10 rows |
| MB6 | the collision line drops its move clause (pin row kept) | killed, 4 rows |
| M5 | RV1314's directory = bool(directory) |
killed, 4 rows (above) |
Measured (M), against read only (R)
- M: runs 1 and 2, the three-step clone and the wrong-order clone.
- M: the make chains (
makefile/+Makefile/and all three directories), and the twin roots throughcheck/execute. - M: the 4096-subset and 46-entry sweeps, head against base, and the base-code run of the new file.
- M: the seven mutants.
- M: the added lines: 289, no non-ASCII character, none over 80 characters.
- M: both commits are by
Brett Heap <[email protected]>.- For main: both end
Co-Authored-By: Claude Sonnet 5.5, where rules.md says Opus 5.5. The writer says it names the model that wrote it. - In a squash, the body's lines decide the trailers anyway.
- For main: both end
- M, an observation with no change asked: "only once" names a route that is enough, but not the only one. Beside a kept
Makefile/, aGNUmakefileFILE holdinginclude shape/Makefilealso givesmake -n bootstraprc 0 (scratch folder, template Makefile). - R: the code delta line by line, the callers, the docstrings, the CI workflow and the PR body.
Runs (all through run-l2.sh, at 4f50eae, clean tree unless marked)
| run | files | result |
|---|---|---|
1 (rv1314b-new) |
tests/test_adopt_kept_makefile_directory.py |
37 passed in 8.58s (20:13:28Z-20:13:38Z) |
2 (rv1314b-make) |
test_adopt_make_reads_first.py, test_adopt_make_bootstrap_followups.py, test_adopt_collision_make_reads.py, test_adopt_next_make_reads_first.py |
137 passed in 118.73s (20:13:45Z-20:15:44Z) |
probes (rv1314b-probe, file + appended probes) |
the new file -k rvb_probe |
4 passed (20:15:57Z) |
| base code (7392e85 over head) | the new file, -rf |
14 failed, 23 passed (20:16:33Z) |
mutants (rv1314b-mut) |
the new file, plus two make files for MB1 | as in the table |
twins (rv1314b-twins) |
appended twin probe | 2 passed (20:22:07Z) |
1 with LANES_LANE set (L2_KEEP_LANE=1, rv1314b-lane) |
tests/test_adopt_kept_makefile_directory.py |
37 passed in 10.17s (20:23:46Z-20:23:57Z) |
Out-of-scope candidates (no issue filed)
- None new.
- These stay as RV1314 left them: adopt-project.py, shape_materialize.py and the assembly-root template: after #1121 and #1105, one
GNU_MAKE_READSand one lookup, their NEXT NOTE and collision line as true as #1207's, and the NITs 1, 3b, 3c, 4 and 5 of #1105's second review #1240 item B (now also: besideGNUmakefile/, the collision line names neither the move nor the pin row), NIT-4, C1 and C2. C2 also applies to the move: on a disk that ignores case, a keptmakefile/has its copy atshape/Makefiletoo (read only).
Checks not done
- The doctor pair was skipped, as the brief says (the writer reports 550 passed and 3 skipped at this head).
- I did not run
test_adopt_root_shape_paths.py,test_pinned_copy_text.py,test_adopt_e2e.py,test_adopt_leg_path_collisions.pyor the hygiene pair at this head (the writer reports 477 and 222 passed). - I measured no disk that ignores case, read no CI log, and did not gate a merge with main.
All brief checks 1 to 6 are done. The worktree is clean at 4f50eae, and both sha256 sums match the brief.
Lane: openreposhape-2 (openRepoShape-2)
|
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 4 days and 17 hours by commenting |



Closes #1314
Stacked on #1312 (lane openRepoShape-2's PR for #1206, 11th in v1.2.2): its base is
fix/1206-follow-ups-from-the-plan-as-it-standsat5235870f1, because #1312's case 1 changed the same words in_makefile_follow_upandcollision_follow_up. When #1312 lands, lane openRepoShape-2 restacks this PR with three merges: #1312's final head, then its squash (this branch's side only for #1312's own files), thenmain. Lane 3 ruled that #1314 is #1206's own case 3, not a follow-up candidate, and that its PR takes a v1.2.2 place by its READY time and lands after #1312 (#473 issuecomment-6775965238).What
A root that keeps a
Makefile/DIRECTORY was read as one that keeps a Makefile of its own. So three surfaces said the shape's Makefile waits inshape/Makefileuntil the two are merged, yet GNU make 4.3 at such a root stops withmake: *** Makefile: Is a directory. Stop.. A directory cannot be merged with a Makefile.Now each surface says that GNU make stops at the directory, in the words a kept
GNUmakefile/(#1207) and a keptmakefile/(#1312's case 1) already get, and none says the two are merged:_make_reads_firstalso returnsMakefile/when the root keeps that directory and neitherGNUmakefilenormakefile. A keptMakefilefile still gives None._makefile_follow_up(theCONTRACTS_DIRfollow-up) says the shape's Makefile "is written asshape/Makefile, and not as the root'sMakefile, where the source's directoryMakefile/is that path", as adopt-project.py:checkandexecutework the follow-ups out from the plan as it stands andplanno longer stores them, so after a hand edit of an entry'sleg:neitherchecknor the split commit names aGNUmakefileor a collision the root no longer keeps, and a plan that still holds afollow_ups:list is refused by name (#1206) #1312 words it, then the shared clause that GNU make stops at the directory._next_steps(NEXT): beside the directory, no NOTE names a merge of the Makefile, and the lead is "the shape's Makefile is shape/Makefile, and". Wherescripts/bootstrap.pyalso went aside, only the script's merge is named.collision_follow_upinscripts/shape_materialize.pytakes a newdirectory=keyword, which_predict_collisionspasses and only the Makefile's line reads. That line now opens "shape/Makefile is the shape's Makefile: the source repository already has a directoryMakefile/of that name, ...", gives the stop clause, and no longer says to removeshape/Makefileafter a merge.Makefile/, removing the directory is never enough, because the shape's copy is atshape/Makefile. So theCONTRACTS_DIRline and NEXT say the targets arrive "only once the root keeps no directory of that name andshape/Makefileis moved toMakefile". Beside aGNUmakefile/ormakefile/directory they name both directories and the move. The collision line says the same and ends: "Once shape/Makefile is moved to Makefile,update-shape.py checkreports its pin rowmerged-away, andapplydrops the row", as the file case words it.Why
_root_keepsis unchangedThe issue asked whether
_root_keepsshould stop reading a directory as the file. It should not:Makefile/directory really does take the name: the materializer checks whether the path exists, so the shape's copy really is written asshape/Makefile.test_adopt_root_shape_paths.py::test_a_kept_directory_holding_the_path_makes_the_copy_tooalready pins that._predict_collisionsover every shape path, kept as a file, as a directory of its own name, and inside its first folder, shows each of the 8 top-level directories of a shape path's own name gives the same collision line a file gives. Taking them out of_root_keepswould drop those lines whileexecutestill writes the copies beside the directories.Makefile/, 1 of 39 entries._root_keeps's callers, for the record:_make_reads_first(called by_makefile_follow_upand_next_steps),_makefile_follow_uptwice, and_predict_collisionstwice, whichcmd_planand_follow_ups_as_it_standscall.Proof
Measured on #1312's head
5235870f1, before the changeReal adoptions through lane openRepoShape-2's runner (
plan --path-policy,check,execute --local-remote-dir, thenmake -n bootstrapin the pasted clone), for a source whose root keeps only aMakefile/directory:check'sCONTRACTS_DIRline said "... so that block waits inshape/Makefileuntil the two are merged";make -n bootstrapexited 2 withmake: *** Makefile: Is a directory. Stop., beside bothMakefile/andshape/Makefile.RV1314 and the fix round then measured what brings the targets, in the same clone:
make -n bootstrapupdate-shape.py checkMakefile: Is a directory.shape/MakefileunchangedNo rule to make target 'bootstrap'shape/Makefilemoved toMakefilemerged-away shape/Makefile;applydrops the row, andcheckthen saysnothing to doRows
New file:
tests/test_adopt_kept_makefile_directory.py, 37 rows.check'sCONTRACTS_DIRline and collision line, NEXT, and the split commit's message. None says the two are merged, and each says GNU make stops at the directory.makefile/and a keptGNUmakefile/get._make_reads_first, for no surface readingMakefile/as a Makefile, forscripts/bootstrap.pyaside, and for aGNUmakefilefile beside the directory.MakefileFILE reads as before, andMAKEFILE/andMakeFile/get no clause, since a disk that keeps case gives GNU make neither name.checkandexecutework the follow-ups out from the plan as it stands andplanno longer stores them, so after a hand edit of an entry'sleg:neitherchecknor the split commit names aGNUmakefileor a collision the root no longer keeps, and a plan that still holds afollow_ups:list is refused by name (#1206) #1312's code, restored withgit checkout --and checked by sha256, 15 of the first 25 rows fail and the 10 guards pass.apply; rows forMakefile/besideGNUmakefile/and besidemakefile/pin both conditions; and seven rows check that_predict_collisionsof<path>/equals that of<path>for each other top-level shape path. On the first round's code, 14 of these fail. RV1314's mutant M5 (directoryread for every path) fails 4 of them.Runs at this head
Every run went through lane openRepoShape-2's runner: a stub
gh, a blank git identity and global config, no ssh, noLANES_*variable, and CI's git-filter-repo 2.47.0.LANES_LANEsettest_adopt_make_reads_first.py,test_adopt_make_bootstrap_followups.py,test_adopt_collision_make_reads.pyandtest_adopt_next_make_reads_first.pytest_adopt_root_shape_paths.py,test_pinned_copy_text.py,test_adopt_printed_sentences.py,test_adopt_e2e.py,test_adopt_attributes_eol_block.py,test_adopt_leg_path_collisions.py,test_adopt_contracts_dir.pyandtest_adopt_follow_ups_as_the_plan_stands.pytest_repo_hygiene.pyandtest_path_guard_hygiene.pytests/test_shape_doctor.pyandtests/test_scaffold_leg_path_collisions.pyNot in this PR
Known limits, each outside #1314:
Makefile/beside aGNUmakefile/directory: the collision line still says GNU make "reads the source'sGNUmakefile". That is adopt-project.py, shape_materialize.py and the assembly-root template: after #1121 and #1105, oneGNU_MAKE_READSand one lookup, their NEXT NOTE and collision line as true as #1207's, and the NITs 1, 3b, 3c, 4 and 5 of #1105's second review #1240's item B, which already applies to a keptMakefilefile besideGNUmakefile/. TheCONTRACTS_DIRline and NEXT name both directories and the move for that root, while besideGNUmakefile/the collision line names neither the move nor the pin row (RV1314b).GNUmakefile/,makefile/andMakefile/): the clause names the first andMakefile/, as adopt-project.py, shape_materialize.py and the assembly-root template: a keptGNUmakefile/is a directory GNU make stops at,python3 scripts/bootstrap.pynamespythonon Windows, and the template says what to run wheremakereads another file #1207's clause already names one of two.scripts/bootstrap.py/) gets no collision line at all (C1), and adopt-project.py:checkandexecutework the follow-ups out from the plan as it stands andplanno longer stores them, so after a hand edit of an entry'sleg:neitherchecknor the split commit names aGNUmakefileor a collision the root no longer keeps, and a plan that still holds afollow_ups:list is refused by name (#1206) #1312'smakefile/on a disk that ignores case may need the move too (C2).README.md/,.gitignore/and so on) are still told "merge shape/X into X".Makefile/kept only through deeper entries, such as a hand-splitMakefile/rules.mk, is not seen at all, the same known limit as adopt-project.py:planwrites its follow-ups once, so after a hand edit of the plancheckand the split commit name aGNUmakefilethe root no longer keeps, or say nothing of one it now keeps #1206's case 2.makefile/orMAKEFILE/directory may still say "merges the two". It could not be measured here.These go to Brett Heap as candidates, as the lanes' practice says, and no issue is filed for them here.
Review
7392e85aaby an agent that wrote none of this: READY AFTER FIXES (issuecomment-6777367883), with one SHOULD and five NITs.88ad53b70and4f50eae21): SHOULD-1, NIT-1, NIT-2, NIT-3 and NIT-5. NIT-4, an optional shared helper, is left out.Lane 3 places this PR in v1.2.2's order by its READY time, after #1312.
Lane: openreposhape-2 (openRepoShape-2)
🤖 Generated with Claude Code
Summary by Sourcery
Handle kept
Makefile/directories as GNU make collisions and clearly describe the steps required to restore the shape's Makefile targets.Bug Fixes:
Makefile/directory so generated guidance reflects GNU make's directory error instead of describing an invalid file merge.Enhancements:
shape/Makefilemust be moved toMakefileafter the conflicting directory is removed.Tests: