Skip to content

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

Open
brettheap wants to merge 4 commits into
fix/1206-follow-ups-from-the-plan-as-it-standsfrom
fix/1314-kept-makefile-directory

Conversation

@brettheap

@brettheap brettheap commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

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-stands at 5235870f1, because #1312's case 1 changed the same words in _makefile_follow_up and collision_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), then main. 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 in shape/Makefile until the two are merged, yet GNU make 4.3 at such a root stops with make: *** 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 kept makefile/ (#1312's case 1) already get, and none says the two are merged:

  • _make_reads_first also returns Makefile/ when the root keeps that directory and neither GNUmakefile nor makefile. A kept Makefile file still gives None.
  • _makefile_follow_up (the CONTRACTS_DIR follow-up) says the shape's Makefile "is written as shape/Makefile, and not as the root's Makefile, where the source's directory Makefile/ is that path", as adopt-project.py: check and execute work the follow-ups out from the plan as it stands and plan no longer stores them, so after a hand edit of an entry's leg: neither check nor the split commit names a GNUmakefile or a collision the root no longer keeps, and a plan that still holds a follow_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". Where scripts/bootstrap.py also went aside, only the script's merge is named.
  • collision_follow_up in scripts/shape_materialize.py takes a new directory= keyword, which _predict_collisions passes and only the Makefile's line reads. That line now opens "shape/Makefile is the shape's Makefile: the source repository already has a directory Makefile/ of that name, ...", gives the stop clause, and no longer says to remove shape/Makefile after a merge.
  • What brings the targets, from the fix round for RV1314: for Makefile/, removing the directory is never enough, because the shape's copy is at shape/Makefile. So the CONTRACTS_DIR line and NEXT say the targets arrive "only once the root keeps no directory of that name and shape/Makefile is moved to Makefile". Beside a GNUmakefile/ or makefile/ 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 check reports its pin row merged-away, and apply drops the row", as the file case words it.
  • The docstrings say the same. Nothing outside the two scripts and their tests changed.

Why _root_keeps is unchanged

The issue asked whether _root_keeps should stop reading a directory as the file. It should not:

  • A Makefile/ directory really does take the name: the materializer checks whether the path exists, so the shape's copy really is written as shape/Makefile. test_adopt_root_shape_paths.py::test_a_kept_directory_holding_the_path_makes_the_copy_too already pins that.
  • A sweep of _predict_collisions over 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_keeps would drop those lines while execute still writes the copies beside the directories.
  • So only the words were wrong. After this change the sweep differs only at Makefile/, 1 of 39 entries.

_root_keeps's callers, for the record: _make_reads_first (called by _makefile_follow_up and _next_steps), _makefile_follow_up twice, and _predict_collisions twice, which cmd_plan and _follow_ups_as_it_stands call.

Proof

Measured on #1312's head 5235870f1, before the change

Real adoptions through lane openRepoShape-2's runner (plan --path-policy, check, execute --local-remote-dir, then make -n bootstrap in the pasted clone), for a source whose root keeps only a Makefile/ directory:

  • check's CONTRACTS_DIR line said "... so that block waits in shape/Makefile until the two are merged";
  • the collision line said "merge shape/Makefile into Makefile ... arrive only with that merge";
  • NEXT's NOTE said "arrive only once the follow-up merges the two";
  • the split commit's message carried both lines;
  • in the clone, make -n bootstrap exited 2 with make: *** Makefile: Is a directory. Stop., beside both Makefile/ and shape/Makefile.

RV1314 and the fix round then measured what brings the targets, in the same clone:

step in the clone make -n bootstrap update-shape.py check
as cloned exit 2, Makefile: Is a directory. exit 0, shape/Makefile unchanged
the directory renamed away exit 2, No rule to make target 'bootstrap' exit 0, unchanged
then shape/Makefile moved to Makefile exit 0 exit 1, merged-away shape/Makefile; apply drops the row, and check then says nothing to do

Rows

New file: tests/test_adopt_kept_makefile_directory.py, 37 rows.

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, no LANES_* variable, and CI's git-filter-repo 2.47.0.

Files Result
the new file 37 passed, and 37 again with LANES_LANE set
test_adopt_make_reads_first.py, test_adopt_make_bootstrap_followups.py, test_adopt_collision_make_reads.py and test_adopt_next_make_reads_first.py 137 passed
the files that pin a changed text or call a changed function: test_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.py and test_adopt_follow_ups_as_the_plan_stands.py 477 passed
test_repo_hygiene.py and test_path_guard_hygiene.py 222 passed
tests/test_shape_doctor.py and tests/test_scaffold_leg_path_collisions.py 550 passed, and 3 skipped (Windows-only rows)

Not in this PR

Known limits, each outside #1314:

These go to Brett Heap as candidates, as the lanes' practice says, and no issue is filed for them here.

Review

  • RV1314, an independent Opus review at 7392e85aa by an agent that wrote none of this: READY AFTER FIXES (issuecomment-6777367883), with one SHOULD and five NITs.
  • The fix round (88ad53b70 and 4f50eae21): SHOULD-1, NIT-1, NIT-2, NIT-3 and NIT-5. NIT-4, an optional shared helper, is left out.
  • RV1314b, the delta review of the fix round: READY AFTER FIXES on the body alone (issuecomment-6778391854): the code and the rows need no further round, and its one SHOULD, that this body still described round one, is answered by this update. Its two NITs are optional and 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:

  • Correct handling of roots that keep a Makefile/ directory so generated guidance reflects GNU make's directory error instead of describing an invalid file merge.

Enhancements:

  • Update Makefile follow-ups, collision messages, NEXT steps, and documentation to explain that the shape's shape/Makefile must be moved to Makefile after the conflicting directory is removed.
  • Preserve distinct behavior for kept Makefile files, other makefile directories, and unrelated shape-path directories.

Tests:

  • Add comprehensive unit and end-to-end coverage for Makefile directory collisions, GNU make behavior, follow-up text, NEXT instructions, pin-row cleanup, and regression behavior for other paths.

Brett Heap and others added 2 commits November 10, 2026 18:57
… 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)
@sourcery-ai

sourcery-ai Bot commented Nov 10, 2026 •

Copy link
Copy Markdown

Reviewer's Guide

Implementation

Update adoption guidance and collision reporting so a kept Makefile/ is treated as a directory GNU make stops at, while explaining that the shape’s targets require moving shape/Makefile to Makefile.

  • adopt-project.py L4463-4472, L4532-4553, L18316-18326 (+13 small edits)
  • scripts/shape_materialize.py L1072-1103, L1143-1164, L1174-1191 (+2 small edits)

Tests

Add coverage for the adoption and collision messages, NEXT instructions, GNU make behavior, and the required move of the shape Makefile, while checking unaffected cases.

  • tests/test_adopt_kept_makefile_directory.py L1-665

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@brettheap

Copy link
Copy Markdown
Contributor Author

(lane openRepoShape-2, 2026-11-10T19:39:18Z) RV1314, the independent review of this PR at 7392e85aa: READY AFTER FIXES. It found no MUST, one SHOULD and five NITs, and it measured #1314's Verify section as met on every surface. The reviewer is an Opus agent that wrote none of this PR. Its review follows as it wrote it.

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 7392e85

Reviewer rv1314, lane openRepoShape-2, 2026-11-10. I wrote none of this PR. The diff reviewed is git diff 5235870f1 7392e85aa (#1312's head, then this PR's two commits 08661efaa and 7392e85). Bench: GNU Make 4.3, git 2.43.0, Python 3.12.3. Every pytest run went through run-l2.sh.

Verdict: READY AFTER FIXES

There 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 Makefile/, the new words name a condition that never brings the shape's make targets by itself. There are also five NITs.

Findings

SHOULD-1: for Makefile/, "only once the root keeps no directory of that name" is never enough, and no surface says what is

  • Where: adopt-project.py:4465-4468 (_make_reads_first_clause, used by the CONTRACTS_DIR line and NEXT) and scripts/shape_materialize.py:1161-1166 (the collision line).

  • The PR reuses adopt-project.py, shape_materialize.py and the assembly-root template: 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's clause. For GNUmakefile/, and for makefile/ on a disk that keeps case, the shape's Makefile is the root's Makefile, so removing the directory is enough. For Makefile/, the shape's copy is at shape/Makefile, so removing the directory is never enough.

  • The collision line no longer names any action at all. It sits under "FOLLOW-UPS, which this commit does NOT do", and it says "until then python3 scripts/bootstrap.py ... is what the shape's make bootstrap runs". A reader takes "then" to be the moment the directory is gone.

  • Measured in the clone NEXT pastes, after a real plan --path-policy/check/execute --local-remote-dir of a source holding Makefile/rules.mk. I got the same result with the Makefile/ question answered root by a hand edit, and again with scripts/ kept too.

    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/Makefile is moved to Makefile.

    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 survives test_adopt_root_shape_paths.py, test_adopt_leg_path_collisions.py, test_pinned_copy_text.py and test_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_collisions of <path>/ equals that of <path>.

NIT-2: a row pins #1240 item B's defect, which #1207 declined to do

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 GNUmakefile and makefile the root keeps ... None where it keeps neither". For a root that keeps Makefile/, the function now returns Makefile/. 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:293 and :314.
  • Measured: a source with Makefile/rules.mk and a makefile file gets check rc 1, FINDING plan-case-twins (Makefile/rules.mk and makefile). execute refuses 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)

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)

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.py or test_adopt_leg_path_collisions.py at the head. The second passed only under mutant M5.
  • I did not measure a disk that ignores case, or update-shape.py check after moving shape/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)
@sonarqubecloud

Copy link
Copy Markdown

@brettheap

Copy link
Copy Markdown
Contributor Author

(lane openRepoShape-2, 2026-11-10T20:25:22Z) RV1314b, the delta review of the fix round (88ad53b70 and 4f50eae21), reads READY AFTER FIXES on the body alone.

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..4f50eae

Reviewer rv1314b, lane openRepoShape-2, 2026-11-10. I wrote none of this PR. The delta reviewed is git diff 7392e85aa 4f50eae21: commits 88ad53b (adopt-project.py +37/-12, scripts/shape_materialize.py +26/-6) and 4f50eae (tests/test_adopt_kept_makefile_directory.py +226/-11). Bench: GNU Make 4.3, git 2.43.0, Python 3.12.3. Every pytest run went through run-l2.sh, one at a time.

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.

Findings

SHOULD-B1: the PR body is round one's, and it would land as the squash message

  • Where: the PR description (W/v12/rv1314/pr-1321-body.md is the copy I read): ## What and ### Rows (line 38), the Proof table (lines 51 and 55), and ## Not in this PR (first bullet).
  • What I read:
    • ## What never says that a kept Makefile/ needs shape/Makefile moved to Makefile.
    • It never names the collision line's new pin-row sentence.
    • It still gives "25 rows", "25 passed" and "247 passed". The file now has 37 rows, and I measured 37 passed.
    • The #1240 item B bullet says the collision line beside GNUmakefile/ "reads the source's GNUmakefile". At this head that line also names neither the move nor the pin row, while the CONTRACTS_DIR line in the same check output now names both. I measured both lines (see M5 below).
  • Change: add the round to ## What, update the counts, and add to that bullet that the collision line there names neither the move nor the pin row. The writer's commit 88ad53b message already has the words.

NIT-B1: the new collision-line sentence spells the two paths two ways in one line

  • Where: scripts/shape_materialize.py:1180-1185.
  • The arrive clause says "shape/Makefile is moved to Makefile", in backticks. The pin-row sentence that ends the same line says "Once shape/Makefile is moved to Makefile", bare.
  • Both styles already exist in that line (its head is bare, as the file case's "Then remove shape/Makefile:" is). Optional: put both new mentions in one style.

NIT-B2: "Once shape/Makefile is moved to Makefile" holds only once the directory is gone

  • Where: scripts/shape_materialize.py:1183-1185.
  • Measured in a second clone of the real adoption. Moving the copy while Makefile/ is still there puts it at Makefile/Makefile (git mv rc 0). After that, make -n bootstrap is still rc 2 (Makefile: Is a directory.), and update-shape.py check says copy-missing shape/Makefile, not merged-away.
  • The arrive clause before it already gives the order ("only once the root keeps no directory of that name and shape/Makefile is moved"), so a careful reader is not misled. Optional: "Once the directory is gone and shape/Makefile is moved to Makefile, ...".

Each item of the round

  • SHOULD-1: done, and the words match what I measured.
    • In the clone NEXT pastes, from a real plan --path-policy/check/execute --local-remote-dir (my own probe, separate from the writer's row):

      step make -n bootstrap update-shape.py check validate-pins.py
      as cloned rc 2 Makefile: Is a directory. Stop. rc 0, unchanged shape/Makefile not run
      git mv Makefile source-make-rules rc 2 No rule to make target 'bootstrap'. Stop. rc 0, unchanged shape/Makefile not run
      git mv shape/Makefile Makefile rc 0 python3 scripts/bootstrap.py rc 1, merged-away shape/Makefile (merged into Makefile and removed; ...) not run
      committed rc 0 rc 1, the same rc 1 FINDING shape-copy-missing: ... shape/Makefile is pinned but absent
      the NEXT line's apply not run apply rc 0 dropped shape/Makefile ...; check rc 0 rc 0 pins ok
    • So the collision line's new sentence ("update-shape.py check reports its pin row merged-away, and apply drops the row") is what happens.

    • Beside a GNUmakefile/ or makefile/ directory, each condition named is right. Measured in scratch folders with the template Makefile at shape/Makefile:

      • GNUmakefile/ + Makefile/ stops at GNUmakefile, then at Makefile, then gives No rule, and is rc 0 only after the move. The writer's new row pins this too.
      • makefile/ + Makefile/ behaves the same way, stopping at makefile first.
    • makefile/ beside Makefile/ is a root check refuses. Measured with a real plan/check/execute: check rc 1 and execute rc 2, with "no leg repository was created" and the case-twins remediation. So only the unit surfaces carry that text.

    • With all three directories, the clause names only GNUmakefile/ and Makefile/, but make stops at makefile/ second (measured). The writer notes this. No surface ever prints it: that root also holds makefile/ and Makefile/, and I measured check rc 1 and execute rc 2 for it.

  • NIT-1: done, and the new rows kill M5. M5 (directory = bool(directory)) gives 4 failed and 33 passed: test_only_the_makefiles_follow_up_reads_a_directory[.gitignore|AGENTS-shape.md|README.md|project.yaml].
    • The other 3 of the 7 paths (.gitattributes, AGENTS.md, CLAUDE.md) return before directory is read, so they cannot kill it, though they are true rows.
    • The listing row keeps the sweep from being empty.
  • NIT-2: done exactly as RV1314 asked: if stop == "Makefile": assert stopped in collision (tests/test_adopt_kept_makefile_directory.py:459-464).
  • NIT-3: done. The first sentence of _make_reads_first's docstring now names the directory Makefile/ (adopt-project.py:4420-4425).
  • NIT-5: done. Three docstrings say that check refuses Makefile/ beside makefile/ as plan-case-twins. I measured this: check rc 1 and execute rc 2. These rows hold makefile/ DIRECTORIES, as the writer says. RV1314 had described them as a makefile file.

New risks (check 3): none found

  • Measured, the subset sweep: 4096 subsets of {Makefile, Makefile/, makefile, makefile/, GNUmakefile, GNUmakefile/, MAKEFILE/, Makefile/rules.mk, scripts/, scripts/bootstrap.py, README.md/, .gitignore/}, comparing the head against the code at 7392e85.
    • Nothing raises at either commit.
    • _make_reads_first is identical at both.
    • _makefile_follow_up, follow_ups_for (collision lines included) and _next_steps differ in 384 subsets. Every one keeps Makefile/ without Makefile, with a DIRECTORY first (GNUmakefile/, makefile/ or Makefile/).
    • The other 640 subsets that keep Makefile/ without Makefile have a FILE first, and they are byte-identical. So a kept Makefile FILE, GNUmakefile/ and makefile/ alone, a GNUmakefile or makefile file beside Makefile/, and every other root are unchanged on every surface.
  • Measured, the shape-path sweep: 46 entries (each shape path as a file, as a directory of its own name, and as its first folder). Only Makefile | own-dir differs.
  • Read: _make_reads_first_clause's new moved is keyword-only with default False, and its two callers are the only ones (git grep). pinned was hoisted with the same expression. pin_row is set only where reads_first is None and directory.

The rows (check 4)

  • Measured: with the code at 7392e85 written over the head (the head's test file kept), the new file gives 14 failed and 23 passed. The 14 are every row that pins the new words:

    • the three-step clone row;
    • both-conditions rows x2;
    • the scratch make chain;
    • the exact lines on each surface.

    The 23 that pass on the old code are the 7 M5 rows, the listing row and older rows on unchanged behaviour. That matches the writer's figure.

  • Read: there is no dependence on the Python version.

    • Nothing asserts a repr, an ast dump, exception text or a dict or set order.
    • shlex.split of the NEXT line is stable.
  • Read: GNU make's wording pinned is No rule to make target 'bootstrap', Is a directory. and the make -n stdout. adopt-project.py, shape_materialize.py and the assembly-root template: 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's rows already pin these (test_adopt_make_bootstrap_followups.py, test_adopt_next_make_reads_first.py, test_adopt_e2e.py), and every such row is @needs_make.

  • Read: on git and CI.

    • git mv and commit in the clone go through conftest's git() (IDENTITY_CONFIG), and update-shape.py apply has its own identity fallback (update-shape.py:3148).
    • CI's tests job is ubuntu-24.04 with fetch-depth: 0. The Windows job runs only the launcher and installer suites.
    • The update-shape.py check --upstream REPO row needs the pin to equal REPO's HEAD, which holds in CI's checkout too. I read no CI log.

Mutants (check 5): each restored with git checkout --, both sums checked after each

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 through check/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.
  • M, an observation with no change asked: "only once" names a route that is enough, but not the only one. Beside a kept Makefile/, a GNUmakefile FILE holding include shape/Makefile also gives make -n bootstrap rc 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)

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.py or 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)

@brettheap
brettheap marked this pull request as ready for review November 10, 2026 20:25
@sourcery-ai

sourcery-ai Bot commented Nov 10, 2026

Copy link
Copy Markdown

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 @sourcery-ai review. Upgrade to get a review now.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant