Repository navigation
adopt-project.py: a leg's mount path must be canonical or it is refused, so plan --spec-path spec/ no longer checks ok and executes into a .gitmodules that registers the mount twice and still says adoption verified (#169) - #187
Conversation
…ed, so `plan --spec-path spec/` no longer checks ok and executes into a `.gitmodules` that registers the mount twice and still says `adoption verified` (#169) `plan --spec-path spec/` (or `--code-path ./code`) was accepted, written into the plan, and passed by `check`. `execute` then ran `git submodule add ... spec/`, which Git records at `spec`, and `git config -f .gitmodules submodule.spec/.url`, which wrote a SECOND section literally named `spec/` that no mount owns. The registration the real mount carried still pointed at the operator's local work directory, and on `main` the run ended `adoption verified`: a broken assembly passed as a good one. One helper now answers "is this a canonical leg path" in the three places that read one, and nothing rewrites a value on the way, because a plan is edited by a person and a value quietly changed is a value nobody chose. Canonical is a relative POSIX path of one or more segments, each non-empty and neither `.` nor `..`: no leading `/`, drive letter or `./`, no trailing `/`, no `//`, no backslash. The two legs also take different paths, neither inside the other (`legs` and `legs/spec`), because Git records one gitlink at the outer path. Where a canonical spelling exists the message names it (`spec/` -> `spec`, `./code` -> `code`); an absolute path and a `..` name another place and get none. - `plan` refuses the flag with `adopt-bad-leg-path` (exit 2) before anything is written. - `check` reports `plan-bad-leg-path` from inside `_leg_findings`, so `cmd_check` is not edited (exit 1). - `execute` refuses with `plan-bad-leg-path` from `_checked_plan_values`, before a leg repository exists. An explicit empty `spec_path: ""` used to be read quietly as the default and is now refused; a key the plan does not carry is still the default. The defaults `spec` and `code` and canonical nested paths such as `legs/spec` and `impl/code` behave as before: `plan` and `check` output for them is byte-identical to `main`, and a nested adoption still ends `adoption verified` with exactly the two registrations. tests/test_adopt_leg_paths.py covers each non-canonical form at `plan`, in a plan file at `check`, and at `_checked_plan_values`; equal and nested paths; the defaults and nested canonical paths; and, where `git filter-repo` is on PATH, `execute` on `spec_path: spec/` refused with no leg repository created. Lane: openreposhape-1 (openRepoShape-1) Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…mount a leg at it (`legs/.git`, `.GIT`, `git~1`, `CON`, `spec.`), when `execute` would refuse its alphabet, or when it meets the other leg's path only in case, so `plan` and `check` stop passing a path that `execute` verifies with no spec mount or dies on after both leg repositories exist (#169) The adversarial review of the #169 canonical-path fix found two gaps that were already on `main` and that the issue's spelling rule did not reach. Both are taken here, in the one helper the three places already ask. SHOULD-FIX 2, a path Git reserves. `plan --spec-path legs/.git` planned, checked and executed to `adoption verified`, yet the split branch had NO spec gitlink: `git submodule add` exits 0 at `legs/.git` and records only `.gitmodules`. `.GIT` died at `git submodule add` ("invalid path") AFTER both leg repositories existed. A segment that is `.git`, `git~1` (the Windows 8.3 short name of `.git`) or `.gitmodules`, in any case, is now refused, and so is a segment Windows cannot check out as written: one that ends in a dot or a space, or is a device name (`CON`, `PRN`, `AUX`, `NUL`, `COM1`-`COM9`, `LPT1`-`LPT9`, with or without an extension). No spelling is offered for any of them: they name no place Git can record, and a spelling whose own canonical form is refused is no longer offered either (`./.git` is not answered `.git`). SHOULD-FIX 1, `check` said `plan ok` for a path `execute` refuses. Whitespace, non-ASCII text, a leading `-`, `C:spec` and shell metacharacters passed `check` and were refused by `execute` as `unsafe-value`. The helper now asks `checked_value` (so the alphabet is `SAFE_ARG_RE`, not a second copy of it), and `plan`, `check` and `execute` refuse the same values, under the helper's own codes, with `checked_value`'s own words. Two paths that differ only in case (`Spec` and `spec`, `Legs/spec` and `legs`) are one path on a macOS or Windows disk and are now equal or nested for the pair check; the second mount would have collided after both leg repositories existed. The messages are made true where the review found them loose. An inner `..` (`legs/../spec`) is no longer said to "climb out of the assembly root" when it names `spec`; `.` and `./` are said to name the assembly root itself, which is why Git dies on them, and not "two different paths"; a drive letter is called absolute on Windows only; the backslash suggestion no longer claims to say the same path on POSIX. A non-text value in a plan (`spec_path: 007`) is not echoed as the reader parsed it (`7`), because the YAML reader keeps no raw text: the sentence names the kind it read (a number, true or false, a list, a mapping). `check` no longer prints `mount the legs at None/ and None/` for a plan without the keys: both it and `execute` now read the two paths through one helper, `_plan_leg_paths`, which is also the one place that names `legs.spec_path` and `legs.code_path`. The canonical paths `main` accepted are still accepted unchanged, and a 255-character name still passes. tests/test_adopt_leg_paths.py grows from 134 to 346 cases. Every change has a test that fails with that change alone reverted; the table is in the pull request. Lane: openreposhape-1 (openRepoShape-1) Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…paths, so the leg-path fix is tested on the `main` it will land on One conflict, the import list of `adopt-project.py`: this branch adds `SAFE_ARG_RE` (so the helper reads the alphabet from `repo_shape` and does not copy it) and `main` adds `YamlError` and `parse_yaml` (#167). Both are kept. Nothing else conflicted. Lane: openreposhape-1 (openRepoShape-1) Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
|
(lane openRepoShape-1, 2026-10-09T08:08:16Z) |
|
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 11 hours and 55 minutes by commenting |
Reviewer's GuideThis PR prevents malformed or unmountable leg paths from producing broken adoption assemblies by centralizing path validation and enforcing it consistently during planning, checking, and execution, with extensive regression and end-to-end tests. Sequence diagram for consistent leg path enforcementsequenceDiagram
participant Operator
participant Plan as plan
participant Check as check
participant Execute as execute
participant Validator as leg_path_problems
participant Git
Operator->>Plan: provide --spec-path and --code-path
Plan->>Validator: _refuse_bad_leg_paths(adopt-bad-leg-path)
Validator-->>Plan: accept or Refusal
Plan-->>Operator: write plan or refuse before writing
Operator->>Check: validate adoption plan
Check->>Validator: _leg_findings(_plan_leg_paths(plan))
Validator-->>Check: findings or no findings
Check-->>Operator: FINDING plan-bad-leg-path or plan ok
Operator->>Execute: run adoption
Execute->>Validator: _refuse_bad_leg_paths(plan-bad-leg-path)
Validator-->>Execute: accept or Refusal
Execute->>Git: mount legs only after validation
State diagram for a leg path through adoptionstateDiagram-v2
[*] --> ReadPath
ReadPath --> SpellingValidation
SpellingValidation --> UnmountableValidation: canonical spelling
SpellingValidation --> Refused: non-canonical
UnmountableValidation --> AlphabetValidation: mountable name
UnmountableValidation --> Refused: Git or Windows reserved name
AlphabetValidation --> PairValidation: checked_value accepts
AlphabetValidation --> Refused: checked_value refuses
PairValidation --> Accepted: paths distinct and not nested
PairValidation --> Refused: equal or nested paths
Accepted --> [*]
Refused --> [*]
Flow diagram for centralized leg path validationflowchart TD
A[Plan or adoption plan] --> B[_plan_leg_paths]
B --> C[leg_path_problems]
C --> D[leg_path_problem]
D --> E[_spelling_reason]
D --> F[_unmountable_reason]
D --> G[checked_value]
C --> H{Both paths valid and non-overlapping?}
H -- No --> I[Refuse or report plan-bad-leg-path]
H -- Yes --> J[Proceed with canonical paths]
File-Level Changes
Assessment against linked issues
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5ab1a21c1a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| value = plan.legs.get(f"{role}_path") | ||
| return role if value is None else value |
There was a problem hiding this comment.
Preserve literal YAML-like mount path names
When plan receives a valid literal path such as --spec-path null, y() writes spec_path: null unquoted, so the plan reader turns it into None; this fallback then silently substitutes spec. Consequently check reports the plan as valid and execute mounts the leg at spec/, not the path the operator selected, violating the new no-rewrite guarantee. Quote YAML-reserved string values when rendering the plan and distinguish an absent key from an explicitly parsed null.
Useful? React with 👍 / 👎.
…mapping, so the doctor's placement plan, whose `legs:` is a list, is judged on its entries alone instead of dying in `_plan_leg_path` with `'list' object has no attribute 'get'` on all three CI operating systems (#169) `shape-doctor.py --placement-plan` writes `legs:` as a LIST of the legs it audited, and `tests/test_shape_doctor.py::test_the_placement_plans_entries_are_adoption_plan_entries` hands that plan to `Plan` and `_leg_findings` to prove its entries are adoption-plan entries. The new leg-path check called `plan.legs.get(...)` on it. `_plan_leg_path` now reads a key only out of a mapping and returns the role's own name for anything else, and `_leg_findings` skips the leg-path check for a `legs:` that is not a mapping, so a placement plan gets no finding about mount paths it never had and still gets `plan-unresolved` for its unanswered entries. No new finding is added. `execute` is unchanged for a real adoption plan: `cmd_execute` calls `plan.names()` before `_checked_plan_values`, and `names()` still reads `legs.get(role)` out of the mapping, so a non-mapping `legs:` fails there exactly as it did on `main`. A plan with a mapping `legs:` reads the same values as before. tests/test_adopt_leg_paths.py gains `test_a_plan_whose_legs_is_not_a_mapping_gets_no_leg_path_finding` (a list of records, a list of strings, a scalar); all three cases fail with `AttributeError` with the `adopt-project.py` change reverted and pass with it. Lane: openreposhape-1 (openRepoShape-1) Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
|
|
(lane openRepoShape-2, 2026-10-09T08:58:04Z) RE-VERIFICATION of this PR at 8a542bd (and at 5ab1a21, where the pass started; lane 1 pushed 8a542bd mid-pass and the pass was extended to it), read-only in this lane's own detached worktrees; nothing authored, no claim held. Full report, drivers and logs: Verdict for 8a542bd: MERGEABLE WITH NITS. At 5ab1a21 alone it would have been CHANGES NEEDED: that head fails Prior pass (2c1f926) status. FIXED: P2-1 ( N1 (P3, pre-existing on main). Names Git's fsck rejects for a gitlink pass all three checks
N2 (P3, pre-existing, outside this PR's region; filed as #192)
D1 (nit, 8a542bd). The
|
The one conflict is the module docstring's `check` paragraph, where #169 and #166 each added a clause: both are kept, in one sentence. Lane: openreposhape-1 (openRepoShape-1) Co-Authored-By: Claude Opus 5.5 <[email protected]>
…te` would write into `project.yaml` or a leg pin that the project's own loader reads back as something else, so `--spec-path null`, `--id true` and `--tracking-branch true` no longer end `adoption verified` before a bootstrap that fails or puts the legs on another branch (#181) 76a6153 made the PLAN say what was typed: `y()` quotes any string the plan's loader would misread. But `execute` writes the same values into the assembly root's templates as they stand, and `project.yaml` and `contracts/{spec,code}-pin.yaml` carry most of them bare (`id: {{PROJECT_ID}}`, `path: {{SPEC_PATH}}`, `tracking_branch: {{TRACKING_BRANCH}}`). So once the plan kept `null` as text, `--spec-path null` ended `adoption verified` and the first bootstrap failed on `path is None`; `--id true` and `--project True` on `id is True`; `--pin null` on `neutral-pin-entry-malformed`; and `--tracking-branch true` pushed the legs on `true` while bootstrap put them on a local `True` with no upstream (lane 2's review of 76a6153, P2-1). `2026`, `1.5` and `~` did the same on main already (#187's review). THE LOADER DECIDES. `loader_reading(line)` is the one question, asked by `y()`'s round trip (`_reads_back_as_text`, rewritten onto it; old and new bodies agree on 260,880 strings) and by the new gate `manifest_misreads`. The gate puts each value into every line of a templated YAML file (`shape_materialize.TEMPLATED`, the `.yaml` ones) that carries its placeholder, exactly as `execute` would, and asks the loader to read the line back; a pin is asked as the ` - <pin>` item `_template_values` writes. There is no list of words and no list of which placeholders are quoted: `elected_by: "{{ELECTED_BY}}"` is asked as the quoted line it is, so `Null` passes there and `CORP\tom` does not (the loader makes `\t` a tab). The values asked about: the id (named as derived when `plan` lowercased `--project`, or when the plan has no `id:`), the tracking branch, visibility, the elector, the election date, the reference, both leg paths and every pin. - `plan`: `REFUSED adopt-manifest-misread`, exit 2, before the plan is written; each sentence names the flag (and where `plan` took a value it filled in itself), the value, the line `execute` would write, what the loader reads it as, and "choose another value". - `check`: `FINDING plan-manifest-misread`, exit 1, with the remediation once after. - `execute`: refused through `_entry_findings` and #168's `_refuse_what_check_finds`, before any leg repository exists. Quoting the template placeholders instead was considered and not done: the same templates render every scaffolded project, and quoting is not enough on its own (`elected_by:` is quoted today and still misreads `CORP\tom`). THE REVIEWER'S QUESTION, TAKEN. A plan carrying an explicit null leg path (`spec_path: null`, `~`, or the key with nothing after it, which is what a plan written by main's `plan --spec-path null` says) was read as the default and mounted at `spec` while its own follow-ups said `null/contracts`. `_plan_leg_path` now hands back the None it holds, as #169 already does for an explicit empty value, and `check` and `execute` report `plan-bad-leg-path: legs.spec_path is not text: its value was read as no value at all`. `check`'s mount line leaves out a path that is not text instead of printing `None/`. The not-text sentence no longer says "so quote it": quoted, every such spelling is text the gate now refuses. P3-2: the test module's docstring said main refused a name ending in a line break as unparsable; on main 20e13f0 that plan reads the entry back as `trail` and `check` reports `plan-uncovered` and `plan-empty-entry`. Corrected. Tests: tests/test_adopt_plan_yaml_quoting.py replaces the old end-to-end block. Each refused value is refused at `plan` (18 flag values, plus an id `plan` derived from `--project` and an elector it took from `git config`), at `check` (20 plan values, plus an id derived from `legs.assembly`) and at `execute` before any leg exists (the same 20, needs_filter_repo). What is still accepted (`--spec-path legs/null`, `--tracking-branch 2026-q4`, `--id yes`, `--elected-by Null`) goes through `execute`, the recursive clone and `bootstrap.py`, and each leg is on `2026-q4` with `origin/2026-q4` as its upstream. The gate follows the loader when the loader learns a keyword, reads the template line for its quoting, and agrees with the three files rendered whole by `render` on every candidate. An explicit null leg path is a finding for `null`, `~` and nothing. tests/test_adopt_leg_paths.py: the not-text sentence has no "quote" and covers None. Lane: openreposhape-1 (openRepoShape-1) Co-Authored-By: Claude Opus 5.5 <[email protected]>



Lane: openreposhape-1 (openRepoShape-1)
Claim: #169 (comment)
What
A leg's mount path must be one
executecan mount, oradopt-project.pyrefuses it, in the three places that read one:plan --spec-path spec/(or--code-path ./code) is refused withadopt-bad-leg-path, exit 2, before the plan file is written.checkreports it asFINDING plan-bad-leg-path, exit 1, from inside_leg_findings(plan);cmd_checkitself is not edited.executerefuses it withplan-bad-leg-pathfrom_checked_plan_values, before any leg repository exists.Where a canonical spelling exists the message names it (
spec/->spec,./code->code). Nothing rewrites a value: a plan is a file a person edits on purpose, and a value quietly changed is a value nobody chose.The first commit (2c1f926) is the spelling rule. The second (f54f66f) takes the adversarial review: a path Git cannot mount a leg at, a value
executewould refuse on its alphabet, and a case-only collision are refused in the same helper, soplan,checkandexecuteanswer one question. The third (5ab1a21) is the merge ofmain21f5c33.Why (repro on
main)executerunsgit submodule add ... spec/, which Git records atspec, and thengit config -f .gitmodules submodule.spec/.url ..., which writes a SECOND section literally namedspec/. The.gitmoduleson the split branch:The real registration is wrong, no mount owns the canonical URL, and the run still ends
adoption verified: a broken assembly passes as a good one.The review of the first commit found the same symptom from a path that is already canonical (both reproduced on 2c1f926, all local):
git submodule addexits 0 atlegs/.gitand records only.gitmodules; at.GIT,git~1and.gitmodulesit refuses.The rule
CANONICAL = a relative POSIX path of one or more segments, each non-empty and neither
.nor..: no leading/(or drive letter) or./, no trailing/, no//, no backslash. The two legs also take DIFFERENT paths, neither inside the other (legsandlegs/spec), because Git records one gitlink at the outer path and cannot record a mount inside it. Two paths that differ only in case are ONE path on a macOS or Windows disk, soSpecandspec, orLegs/specandlegs, are equal or nested too.A canonical path is still refused, with no spelling offered, when:
.git,git~1(its Windows 8.3 short name) or.gitmodules, in any case;CON,PRN,AUX,NUL,COM1-COM9,LPT1-LPT9, any case, with or without an extension);checked_valuerefuses (whitespace, non-ASCII, a leading-,C:spec, a shell metacharacter). The helper askschecked_valueitself, so the alphabet isSAFE_ARG_REand there is no second copy of it.One helper,
leg_path_problem(what, value)plus the pair checkleg_path_problems, answers it for all three callers, so the wording and the rule cannot drift._plan_leg_paths(plan)is the one place that reads the two paths out of a plan, socheckandexecutecannot name them two ways.On the edited tree, a plan file with
spec_path: "legs/.git"or".GIT"getsFINDING plan-bad-leg-pathfromcheck(exit 1) andREFUSED plan-bad-leg-pathfromexecute(exit 2) with--local-remote-dirnever created.The review, taken
SHOULD-FIX 1 and 2, the case-insensitive pair rule and the nits are all taken (the review's own list; its three follow-up issues stay follow-ups, see the end).
checksaidplan okfor a pathexecuterefuses asunsafe-value):leg_path_problemaskschecked_valueafter the spelling and the names, so the three places agree on every value and say it under the helper's code (adopt-bad-leg-pathatplan,plan-bad-leg-pathatcheckandexecute).plan,checkandexecutenow, with no leg repository created.casefold()in the pair check, with its own sentence (differ only in case;once case is ignored)...is no longer said to "climb out of the assembly root" (legs/../specisspec); the sentence says it names a different place than it spells and can climb out..,./and.//.are said to name the assembly root itself, which is why Git dies on them.C:/specis called absolute "on Windows" and/spec"on every platform"; the backslash suggestion no longer claims to say the same path on POSIX (it is the one spelling a person who typed it can mean, offered for retyping).007is read as7,trueasTrue,1.50as1.5), so an echo would show what the file never said. The sentence names the kind the reader made of it (was read as a number,true or false,a list,a mapping) and says to quote it. No wording of the old{value!r}form remains.checkprintedmount the legs at None/ and None/for a plan without the keys; it now printsspec/ and code/, asexecutemounts them. The two literalslegs.spec_pathandlegs.code_pathoccur once, in_plan_leg_paths, not three times.A suggested spelling is still offered only where it names the SAME path and is itself acceptable:
./.gitis not answered.git, nor-x/-x.Judgment calls, so a reviewer can overrule them:
..name another place, so they get a refusal and no suggestion; neither does a reserved name.spec_path: ""in a plan used to be read quietly as the default; it is now refused. A key the plan does not carry is still the default.spec_path: 5) is refused, not stringified.spec.andCON; this was not reproduced on a Windows host.--helptext is unchanged, sodocs/cli.mdis unchanged;README.mdandAGENTS.mdare untouched.The defaults
spec/codeand canonical nested paths (legs/spec,impl/code) behave as before. They were compared byte for byte againstmainin the first round (plan file, stdout, stderr and exit code on one fixed source repository), and the new tests pin lookalikes of the reserved names as ACCEPTED (.gitignore,git~2,my.git,gitmodules,spec.d,COM0,COM10,LPT0,console,auxiliary,nullable) and a 255-character name, the longestchecked_valueallows. A nested adoption still endsadoption verifiedwith exactly two registrations,legs/specandimpl/code.Tests
tests/test_adopt_leg_paths.pyis 346 cases (134 in the first commit): each non-canonical form, reserved name and alphabet value atplan(refused, nothing written), in a plan file atcheck(finding, exit 1) and at_checked_plan_valuesthrough importlib (Refusal code); equal, nested and case-only pairs at all three; the defaults, absent keys and nested canonical paths pass; and, under a localneeds_filter_reposkip,executeonspec_path: spec/, onlegs/.gitand on.GITrefused with no leg repository in--local-remote-dir, plus a nested-canonical adoption that still verifies.On the merged head 5ab1a21 (main 21f5c33):
The same five files on f54f66f, before the merge: 470 passed, 1 skipped (on PATH) and 447 passed, 24 skipped (off PATH). On Windows (
tests-windows, no filter-repo) exactly the fourexecuteend-to-end cases oftests/test_adopt_leg_paths.pyskip and its other 342 run: the helper is pure string work on/, with noos.path,Pathorsep, so it answers the same on every platform.After the merge, CI failed on all three operating systems in exactly one test,
tests/test_shape_doctor.py::test_the_placement_plans_entries_are_adoption_plan_entries(AttributeError: 'list' object has no attribute 'get'at_plan_leg_path): the doctor's placement plan writeslegs:as a list and the test hands it toPlanand_leg_findings. Fixed in 8a542bd: the leg-path check readslegs:only when it is a mapping and reports nothing about leg paths otherwise (no new finding), andtest_a_plan_whose_legs_is_not_a_mapping_gets_no_leg_path_finding(3 cases,tests/test_adopt_leg_paths.pyis now 349) fails withAttributeErrorwithout it;test_shape_doctor.py,test_adopt_leg_paths.py,test_adopt_plan.py,test_adopt_e2e.py,test_windows_paths.pyandtest_cli_reference.pytogether: 637 passed, 1 skipped (SHAPE_MEDXEHR_CLONE), filter-repo on PATH.Each new test fails with the change it guards reverted, except the
..._still_...tests, which pin what must NOT change and pass onmaintoo by design. Failures per test function, measured on the merged head by mutating a plain copy of the tree (adopt-project.pyonly) and runningtests/test_adopt_leg_paths.py(346 cases, filter-repo on PATH). First, where the rule is asked: the whole fix reverted (7f84ca4'sadopt-project.py: 337 failed, 9 passed) and each site on its own:test_a_canonical_path_has_no_problemtest_a_non_canonical_path_is_named_with_its_canonical_spellingtest_a_value_that_is_not_text_is_a_problem_that_does_not_echo_ittest_a_name_git_or_windows_keeps_is_refused_with_no_spelling_offeredtest_a_spelling_that_would_name_a_reserved_path_is_not_offeredtest_a_value_execute_would_refuse_is_a_problem_here_tootest_a_dotdot_is_said_to_name_another_place_not_always_to_climb_outtest_dot_and_dot_slash_are_said_to_name_the_assembly_root_itselftest_a_drive_letter_is_called_absolute_only_where_that_is_truetest_equal_and_nested_paths_are_problemstest_two_distinct_unnested_paths_are_no_problemtest_the_pair_is_compared_only_when_each_path_is_canonicaltest_plan_refuses_a_non_canonical_path_and_writes_nothingtest_plan_refuses_equal_and_nested_legstest_plan_refuses_a_name_git_or_windows_keeps_and_writes_nothingtest_plan_refuses_a_value_execute_would_refuse_under_the_same_codetest_the_remediation_names_every_rule_a_person_could_triptest_plan_names_every_bad_path_and_not_only_the_firsttest_plan_still_records_a_canonical_path_exactly_as_giventest_check_reports_a_non_canonical_path_as_a_findingtest_check_reports_a_name_git_or_windows_keeps_as_a_findingtest_check_reports_a_value_execute_would_refuse_as_a_findingtest_check_reports_a_non_text_value_without_echoing_what_the_reader_made_of_ittest_check_reports_equal_and_nested_legs_as_a_findingtest_check_still_passes_a_canonical_or_defaulted_pathtest_check_names_the_default_mount_paths_when_the_plan_has_no_keystest_checked_plan_values_refuses_a_non_canonical_pathtest_checked_plan_values_refuses_a_name_git_or_windows_keepstest_checked_plan_values_refuses_a_value_checked_value_refuses_under_one_codetest_checked_plan_values_refuses_a_value_that_is_not_texttest_checked_plan_values_refuses_equal_and_nested_legstest_checked_plan_values_still_returns_a_canonical_path_untouchedtest_execute_refuses_a_slash_terminated_path_before_any_leg_existstest_execute_refuses_a_name_git_keeps_before_any_leg_existstest_execute_still_adopts_at_nested_canonical_pathsPlan site only: the
_refuse_bad_leg_paths("adopt-bad-leg-path", ...)call dropped (58 failed). Check site only:path_problems = []in_leg_findings(64 failed). Execute site only: the_refuse_bad_leg_paths("plan-bad-leg-path", ...)call dropped (109 failed). Pair rule only:return []right after the per-path problems (24 failed).With the execute site dropped, the three
executeend-to-end cases still pass on this head: #168's_refuse_what_check_findsrefuses the same first finding under the same code,plan-bad-leg-path. The 109_checked_plan_valuescases still pin the site. On the pre-merge head they failed too (112 failed).Then each change of this round on its own, in the same harness:
leg_path_problemstops askingchecked_valuetest_a_value_execute_would_refuse_is_a_problem_here_too12,test_plan_refuses_a_value_execute_would_refuse_under_the_same_code10,test_check_reports_a_value_execute_would_refuse_as_a_finding10,test_checked_plan_values_refuses_a_value_checked_value_refuses_under_one_code24.git,git~1,.gitmodulesare no longer refusedtest_a_name_git_or_windows_keeps_is_refused_with_no_spelling_offered10,test_a_spelling_that_would_name_a_reserved_path_is_not_offered2,test_plan_refuses_a_name_git_or_windows_keeps_and_writes_nothing8,test_the_remediation_names_every_rule_a_person_could_trip1,test_check_reports_a_name_git_or_windows_keeps_as_a_finding8,test_checked_plan_values_refuses_a_name_git_or_windows_keeps20,test_execute_refuses_a_name_git_keeps_before_any_leg_exists2test_a_name_git_or_windows_keeps_is_refused_with_no_spelling_offered3,test_plan_refuses_a_name_git_or_windows_keeps_and_writes_nothing2,test_check_reports_a_name_git_or_windows_keeps_as_a_finding2,test_checked_plan_values_refuses_a_name_git_or_windows_keeps6CON,PRN,AUX,NUL,COMn,LPTnare no longer refusedtest_a_name_git_or_windows_keeps_is_refused_with_no_spelling_offered10,test_a_spelling_that_would_name_a_reserved_path_is_not_offered1,test_plan_refuses_a_name_git_or_windows_keeps_and_writes_nothing2,test_check_reports_a_name_git_or_windows_keeps_as_a_finding2,test_checked_plan_values_refuses_a_name_git_or_windows_keeps20./.git->.git)test_a_spelling_that_would_name_a_reserved_path_is_not_offered3Specandspecare no longer equaltest_equal_and_nested_paths_are_problems1,test_plan_refuses_equal_and_nested_legs1,test_check_reports_equal_and_nested_legs_as_a_finding1,test_checked_plan_values_refuses_equal_and_nested_legs1Legs/specandlegsare no longer nestedtest_equal_and_nested_paths_are_problems2,test_plan_refuses_equal_and_nested_legs2,test_check_reports_equal_and_nested_legs_as_a_finding2,test_checked_plan_values_refuses_equal_and_nested_legs2..sentence says every..climbs out of the root againtest_a_dotdot_is_said_to_name_another_place_not_always_to_climb_out4.and./get the "two different paths" sentence againtest_dot_and_dot_slash_are_said_to_name_the_assembly_root_itself3C:/specis said to be absolute everywhere againtest_a_drive_letter_is_called_absolute_only_where_that_is_true1007as7)test_a_value_that_is_not_text_is_a_problem_that_does_not_echo_it5,test_check_reports_a_non_text_value_without_echoing_what_the_reader_made_of_it8,test_checked_plan_values_refuses_a_value_that_is_not_text5checkreadsplan.legs.getraw and printsNone/againtest_check_names_the_default_mount_paths_when_the_plan_has_no_keys1test_the_remediation_names_every_rule_a_person_could_trip1The only change here with no test is the
_canonical_spellingdocstring (the backslash NIT) and the module docstring and comments.Relation to #165, #166, #168
_verifyskips every root gitlink and compares a kept root.gitmodulesbyte for byte, so any plan that keeps a source submodule or its.gitmodulesin the root ends with exit 1 andadopt-lost#165 branch (headd780495), where the same plan fails verification loudly withadopt-unexpected-gitlinkandadopt-mount-missing. With this change the plan is refused before any leg exists, so that failure is no longer reachable by a bad path. The review's heads-up for adopt-project.py_verifyskips every root gitlink and compares a kept root.gitmodulesbyte for byte, so any plan that keeps a source submodule or its.gitmodulesin the root ends with exit 1 andadopt-lost#165 (itsadopt-mount-missingsentence "nothing in the plan does this" was false forlegs/.git) is answered by this round: that value is refused before a leg exists.executerefuses onlyplan-unresolvedandplan-stale, so a plancheckrejects as uncovered or with a bad leg creates and pushes both legs before it fails verification #168 (b18cca9) and adopt-project.py_commit_the_splitstages withgit add -A -- ., so a source.gitignoreof.*silently drops.gitattributesandvalidate.ymlfrom the split,executestill saysadoption verified, and the assembly fails its first bootstrap #167 (21f5c33) are onmain. adopt-project.pyexecuterefuses onlyplan-unresolvedandplan-stale, so a plancheckrejects as uncovered or with a bad leg creates and pushes both legs before it fails verification #168's_refuse_what_check_findsreads_leg_findings, soexecutealso refuses a bad path from that route; this branch refuses it from_checked_plan_valuesfirst, so neither depends on the other.main21f5c33: one trivial conflict, the import list ofadopt-project.py(this branch addsSAFE_ARG_RE,mainaddsYamlErrorandparse_yamlfrom adopt-project.py_commit_the_splitstages withgit add -A -- ., so a source.gitignoreof.*silently drops.gitattributesandvalidate.ymlfrom the split,executestill saysadoption verified, and the assembly fails its first bootstrap #167). Both are kept, and the five files above pass on the merged head..gitmodulesto one leg and a submodule it registers to another passescheckandexecute, saysadoption verified, and the assembly's recursive clone then fails:planshould ask,checkshould find,executeshould refuse #166 (fix/adopt-split-submodule-plan, ca5fb3d) editscmd_checkand the module docstring'scheckbullet; this branch edits the same bullet, so whichever lands second has one docstring conflict. It is resolved by keeping both clauses:Checked with
git merge-treeagainst ca5fb3d: that bullet is the only conflict. With it resolved as above, in a plain copy,tests/test_adopt_leg_paths.py,test_adopt_plan.py,test_adopt_submodules.pyandtest_adopt_execute_refusals.pygive 533 passed, 1 skipped (filter-repo on PATH). #165 (05fa0e0) and #171 (f416e13) merge cleanly (text only).cmd_execute,_refuse_an_unrunnable_plan,cmd_checkand_verifyare untouched. The edits are_checked_plan_inputs(a comment),_leg_findings,_print_what_will_happen,_checked_plan_values, one block of helpers before_checked_plan_inputs, the one import, and one bullet in the module docstring.Not in this PR (the review's follow-ups 1 and 2):
scaffold-project.py --spec-path spec/builds the same broken mount through its own_build_assembly_rootand takes the two flags throughchecked_valueonly, so it is not touched here (movingleg_path_problemintoscripts/repo_shape.pywould let the scaffold andvalidate-manifest.pyask the same question); andy()writes reserved YAML words unquoted, soplan --spec-path nullwritesspec_path: null, which every reader takes as the default.Closes #169
🤖 Generated with Claude Code