Skip to content

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

Merged
brettheap merged 4 commits into
mainfrom
fix/adopt-canonical-leg-paths
Oct 9, 2026

Conversation

@brettheap

@brettheap brettheap commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

Lane: openreposhape-1 (openRepoShape-1)
Claim: #169 (comment)

What

A leg's mount path must be one execute can mount, or adopt-project.py refuses it, in the three places that read one:

  • plan --spec-path spec/ (or --code-path ./code) is refused with adopt-bad-leg-path, exit 2, before the plan file is written.
  • check reports it as FINDING plan-bad-leg-path, exit 1, from inside _leg_findings(plan); cmd_check itself is not edited.
  • execute refuses it with plan-bad-leg-path from _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 execute would refuse on its alphabet, and a case-only collision are refused in the same helper, so plan, check and execute answer one question. The third (5ab1a21) is the merge of main 21f5c33.

Why (repro on main)

adopt-project.py plan --source <repo> --project Northwind --org <org> --spec-path spec/   # exit 0, writes `spec_path: spec/`
# ... answer the plan's review_required entries ...
adopt-project.py check --plan adoption-plan.yaml     # `plan ok`, exit 0
adopt-project.py execute --plan adoption-plan.yaml --yes \
    --local-remote-dir <remotes> --work-dir <work>   # exit 0, `adoption verified`

execute runs git submodule add ... spec/, which Git records at spec, and then git config -f .gitmodules submodule.spec/.url ..., which writes a SECOND section literally named spec/. The .gitmodules on the split branch:

[submodule "spec"]
	path = spec
	url = <work>/Northwind-spec            # the real mount, still the operator's local work directory
[submodule "spec/"]
	url = <remotes>/Northwind-spec.git     # the bogus section: the canonical URL, attached to nothing
[submodule "code"]
	path = code
	url = <remotes>/Northwind-code.git

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):

--spec-path legs/.git: plan rc 0 / check rc 0 `plan ok` / execute rc 0 `adoption verified`
  $ git ls-tree -r adopt/three-repo-shape | awk '$1=="160000"'
  160000 commit 03385c74...	code                  <- the ONLY gitlink: no spec mount at all
  [submodule "legs/.git"] path = legs/.git  url = <remotes>/Northwind-spec.git
--spec-path .GIT:       plan rc 0 / check rc 0 / execute rc 2 at `git submodule add` ("error: invalid path '.GIT'"),
  after BOTH leg repositories exist (Northwind-code.git and Northwind-spec.git are in --local-remote-dir)

git submodule add exits 0 at legs/.git and records only .gitmodules; at .GIT, git~1 and .gitmodules it 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 (legs and legs/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, so Spec and spec, or Legs/spec and legs, are equal or nested too.

A canonical path is still refused, with no spelling offered, when:

  • a segment is .git, git~1 (its Windows 8.3 short name) or .gitmodules, in any case;
  • a segment ends in a dot or a space (Windows strips it), or is a Windows device name (CON, PRN, AUX, NUL, COM1-COM9, LPT1-LPT9, any case, with or without an extension);
  • the value is one checked_value refuses (whitespace, non-ASCII, a leading -, C:spec, a shell metacharacter). The helper asks checked_value itself, so the alphabet is SAFE_ARG_RE and there is no second copy of it.

One helper, leg_path_problem(what, value) plus the pair check leg_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, so check and execute cannot name them two ways.

$ adopt-project.py plan ... --spec-path legs/.git
REFUSED adopt-bad-leg-path: --spec-path is 'legs/.git', which a leg cannot be mounted at: `.git` is one of Git's own names (`.git`, its Windows short name `git~1`, `.gitmodules`, in any case), and Git either refuses to mount a leg at it or records no mount there.
$ adopt-project.py plan ... --spec-path Spec --code-path spec
REFUSED adopt-bad-leg-path: --spec-path 'Spec' and --code-path 'spec' differ only in case, which a macOS or Windows disk keeps as ONE path, so two legs cannot be mounted at them.

On the edited tree, a plan file with spec_path: "legs/.git" or ".GIT" gets FINDING plan-bad-leg-path from check (exit 1) and REFUSED plan-bad-leg-path from execute (exit 2) with --local-remote-dir never 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).

  • SHOULD-FIX 1 (check said plan ok for a path execute refuses as unsafe-value): leg_path_problem asks checked_value after the spelling and the names, so the three places agree on every value and say it under the helper's code (adopt-bad-leg-path at plan, plan-bad-leg-path at check and execute).
  • SHOULD-FIX 2 (a path Git reserves passed all three places): the rule above, reproduced on 2c1f926 first (both values, above) and refused at plan, check and execute now, with no leg repository created.
  • Case-insensitive equal and nested: casefold() in the pair check, with its own sentence (differ only in case; once case is ignored).
  • NIT 1: an inner .. is no longer said to "climb out of the assembly root" (legs/../spec is spec); the sentence says it names a different place than it spells and can climb out.
  • NIT 2: ., ./ and .//. are said to name the assembly root itself, which is why Git dies on them.
  • NIT 3: C:/spec is 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).
  • NIT 4: a non-text value in a plan is not echoed: this YAML reader keeps no raw text (007 is read as 7, true as True, 1.50 as 1.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.
  • NIT 5: check printed mount the legs at None/ and None/ for a plan without the keys; it now prints spec/ and code/, as execute mounts them. The two literals legs.spec_path and legs.code_path occur 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: ./.git is not answered .git, nor -x/ -x.

Judgment calls, so a reviewer can overrule them:

  • A canonical spelling is offered only where it says the SAME path: an absolute path and a .. name another place, so they get a refusal and no suggestion; neither does a reserved name.
  • An explicit empty 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.
  • A non-text value (spec_path: 5) is refused, not stringified.
  • The pair is compared only when each path is acceptable on its own.
  • The Windows rules (trailing dot or space, device names) are applied on every platform, because a plan is portable and the assembly is cloned on Windows. Git 2.43 on Linux accepts spec. and CON; this was not reproduced on a Windows host.
  • --help text is unchanged, so docs/cli.md is unchanged; README.md and AGENTS.md are untouched.

The defaults spec/code and canonical nested paths (legs/spec, impl/code) behave as before. They were compared byte for byte against main in 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 longest checked_value allows. A nested adoption still ends adoption verified with exactly two registrations, legs/spec and impl/code.

Tests

tests/test_adopt_leg_paths.py is 346 cases (134 in the first commit): each non-canonical form, reserved name and alphabet value at plan (refused, nothing written), in a plan file at check (finding, exit 1) and at _checked_plan_values through importlib (Refusal code); equal, nested and case-only pairs at all three; the defaults, absent keys and nested canonical paths pass; and, under a local needs_filter_repo skip, execute on spec_path: spec/, on legs/.git and on .GIT refused with no leg repository in --local-remote-dir, plus a nested-canonical adoption that still verifies.

On the merged head 5ab1a21 (main 21f5c33):

python3 -m pytest tests/test_adopt_leg_paths.py tests/test_adopt_plan.py tests/test_adopt_e2e.py tests/test_windows_paths.py tests/test_cli_reference.py -q
  git-filter-repo on PATH:     470 passed, 1 skipped in 62.69s    (the skip: SHAPE_MEDXEHR_CLONE, test_adopt_plan.py)
  git-filter-repo NOT on PATH: 447 passed, 24 skipped in 48.19s   (the 4 execute end-to-end cases here, 19 in test_adopt_e2e.py, 1 in test_adopt_plan.py)
python3 -m pytest tests/test_adopt_execute_refusals.py tests/test_adopt_submodules.py tests/test_adopt_ignored_shape_files.py -q   # filter-repo on PATH
  67 passed
python3 -m pytest tests/test_adopt_spec_only.py -q
  13 passed

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 four execute end-to-end cases of tests/test_adopt_leg_paths.py skip and its other 342 run: the helper is pure string work on /, with no os.path, Path or sep, 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 writes legs: as a list and the test hands it to Plan and _leg_findings. Fixed in 8a542bd: the leg-path check reads legs: only when it is a mapping and reports nothing about leg paths otherwise (no new finding), and test_a_plan_whose_legs_is_not_a_mapping_gets_no_leg_path_finding (3 cases, tests/test_adopt_leg_paths.py is now 349) fails with AttributeError without it; test_shape_doctor.py, test_adopt_leg_paths.py, test_adopt_plan.py, test_adopt_e2e.py, test_windows_paths.py and test_cli_reference.py together: 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 on main too by design. Failures per test function, measured on the merged head by mutating a plain copy of the tree (adopt-project.py only) and running tests/test_adopt_leg_paths.py (346 cases, filter-repo on PATH). First, where the rule is asked: the whole fix reverted (7f84ca4's adopt-project.py: 337 failed, 9 passed) and each site on its own:

test function full revert (7f84ca4's adopt-project.py) plan site only check site only execute site only pair rule only
test_a_canonical_path_has_no_problem 21/21 fail 0/21 fail 0/21 fail 0/21 fail 0/21 fail
test_a_non_canonical_path_is_named_with_its_canonical_spelling 14/14 fail 0/14 fail 0/14 fail 0/14 fail 0/14 fail
test_a_value_that_is_not_text_is_a_problem_that_does_not_echo_it 5/5 fail 0/5 fail 0/5 fail 0/5 fail 0/5 fail
test_a_name_git_or_windows_keeps_is_refused_with_no_spelling_offered 23/23 fail 0/23 fail 0/23 fail 0/23 fail 0/23 fail
test_a_spelling_that_would_name_a_reserved_path_is_not_offered 3/3 fail 0/3 fail 0/3 fail 0/3 fail 0/3 fail
test_a_value_execute_would_refuse_is_a_problem_here_too 12/12 fail 0/12 fail 0/12 fail 0/12 fail 0/12 fail
test_a_dotdot_is_said_to_name_another_place_not_always_to_climb_out 4/4 fail 0/4 fail 0/4 fail 0/4 fail 0/4 fail
test_dot_and_dot_slash_are_said_to_name_the_assembly_root_itself 3/3 fail 0/3 fail 0/3 fail 0/3 fail 0/3 fail
test_a_drive_letter_is_called_absolute_only_where_that_is_true 1/1 fail 0/1 fail 0/1 fail 0/1 fail 0/1 fail
test_equal_and_nested_paths_are_problems 6/6 fail 0/6 fail 0/6 fail 0/6 fail 6/6 fail
test_two_distinct_unnested_paths_are_no_problem 9/9 fail 0/9 fail 0/9 fail 0/9 fail 0/9 fail
test_the_pair_is_compared_only_when_each_path_is_canonical 1/1 fail 0/1 fail 0/1 fail 0/1 fail 0/1 fail
test_plan_refuses_a_non_canonical_path_and_writes_nothing 28/28 fail 28/28 fail 0/28 fail 0/28 fail 0/28 fail
test_plan_refuses_equal_and_nested_legs 6/6 fail 6/6 fail 0/6 fail 0/6 fail 6/6 fail
test_plan_refuses_a_name_git_or_windows_keeps_and_writes_nothing 12/12 fail 12/12 fail 0/12 fail 0/12 fail 0/12 fail
test_plan_refuses_a_value_execute_would_refuse_under_the_same_code 10/10 fail 10/10 fail 0/10 fail 0/10 fail 0/10 fail
test_the_remediation_names_every_rule_a_person_could_trip 1/1 fail 1/1 fail 0/1 fail 0/1 fail 0/1 fail
test_plan_names_every_bad_path_and_not_only_the_first 1/1 fail 1/1 fail 0/1 fail 0/1 fail 0/1 fail
test_plan_still_records_a_canonical_path_exactly_as_given 0/2 fail 0/2 fail 0/2 fail 0/2 fail 0/2 fail
test_check_reports_a_non_canonical_path_as_a_finding 28/28 fail 0/28 fail 28/28 fail 0/28 fail 0/28 fail
test_check_reports_a_name_git_or_windows_keeps_as_a_finding 12/12 fail 0/12 fail 12/12 fail 0/12 fail 0/12 fail
test_check_reports_a_value_execute_would_refuse_as_a_finding 10/10 fail 0/10 fail 10/10 fail 0/10 fail 0/10 fail
test_check_reports_a_non_text_value_without_echoing_what_the_reader_made_of_it 8/8 fail 0/8 fail 8/8 fail 0/8 fail 0/8 fail
test_check_reports_equal_and_nested_legs_as_a_finding 6/6 fail 0/6 fail 6/6 fail 0/6 fail 6/6 fail
test_check_still_passes_a_canonical_or_defaulted_path 0/3 fail 0/3 fail 0/3 fail 0/3 fail 0/3 fail
test_check_names_the_default_mount_paths_when_the_plan_has_no_keys 1/1 fail 0/1 fail 0/1 fail 0/1 fail 0/1 fail
test_checked_plan_values_refuses_a_non_canonical_path 28/28 fail 0/28 fail 0/28 fail 28/28 fail 0/28 fail
test_checked_plan_values_refuses_a_name_git_or_windows_keeps 46/46 fail 0/46 fail 0/46 fail 46/46 fail 0/46 fail
test_checked_plan_values_refuses_a_value_checked_value_refuses_under_one_code 24/24 fail 0/24 fail 0/24 fail 24/24 fail 0/24 fail
test_checked_plan_values_refuses_a_value_that_is_not_text 5/5 fail 0/5 fail 0/5 fail 5/5 fail 0/5 fail
test_checked_plan_values_refuses_equal_and_nested_legs 6/6 fail 0/6 fail 0/6 fail 6/6 fail 6/6 fail
test_checked_plan_values_still_returns_a_canonical_path_untouched 0/3 fail 0/3 fail 0/3 fail 0/3 fail 0/3 fail
test_execute_refuses_a_slash_terminated_path_before_any_leg_exists 1/1 fail 0/1 fail 0/1 fail 0/1 fail 0/1 fail
test_execute_refuses_a_name_git_keeps_before_any_leg_exists 2/2 fail 0/2 fail 0/2 fail 0/2 fail 0/2 fail
test_execute_still_adopts_at_nested_canonical_paths 0/1 fail 0/1 fail 0/1 fail 0/1 fail 0/1 fail

Plan 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 execute end-to-end cases still pass on this head: #168's _refuse_what_check_finds refuses the same first finding under the same code, plan-bad-leg-path. The 109 _checked_plan_values cases 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:

this round's change, reverted alone failing cases which test functions
SHOULD-FIX 1: leg_path_problem stops asking checked_value 56 test_a_value_execute_would_refuse_is_a_problem_here_too 12, test_plan_refuses_a_value_execute_would_refuse_under_the_same_code 10, test_check_reports_a_value_execute_would_refuse_as_a_finding 10, test_checked_plan_values_refuses_a_value_checked_value_refuses_under_one_code 24
SHOULD-FIX 2: .git, git~1, .gitmodules are no longer refused 51 test_a_name_git_or_windows_keeps_is_refused_with_no_spelling_offered 10, test_a_spelling_that_would_name_a_reserved_path_is_not_offered 2, test_plan_refuses_a_name_git_or_windows_keeps_and_writes_nothing 8, test_the_remediation_names_every_rule_a_person_could_trip 1, test_check_reports_a_name_git_or_windows_keeps_as_a_finding 8, test_checked_plan_values_refuses_a_name_git_or_windows_keeps 20, test_execute_refuses_a_name_git_keeps_before_any_leg_exists 2
SHOULD-FIX 2: a segment ending in a dot or a space is no longer refused 13 test_a_name_git_or_windows_keeps_is_refused_with_no_spelling_offered 3, test_plan_refuses_a_name_git_or_windows_keeps_and_writes_nothing 2, test_check_reports_a_name_git_or_windows_keeps_as_a_finding 2, test_checked_plan_values_refuses_a_name_git_or_windows_keeps 6
SHOULD-FIX 2: CON, PRN, AUX, NUL, COMn, LPTn are no longer refused 35 test_a_name_git_or_windows_keeps_is_refused_with_no_spelling_offered 10, test_a_spelling_that_would_name_a_reserved_path_is_not_offered 1, test_plan_refuses_a_name_git_or_windows_keeps_and_writes_nothing 2, test_check_reports_a_name_git_or_windows_keeps_as_a_finding 2, test_checked_plan_values_refuses_a_name_git_or_windows_keeps 20
a spelling whose canonical form is itself refused is offered again (./.git -> .git) 3 test_a_spelling_that_would_name_a_reserved_path_is_not_offered 3
Spec and spec are no longer equal 4 test_equal_and_nested_paths_are_problems 1, test_plan_refuses_equal_and_nested_legs 1, test_check_reports_equal_and_nested_legs_as_a_finding 1, test_checked_plan_values_refuses_equal_and_nested_legs 1
Legs/spec and legs are no longer nested 8 test_equal_and_nested_paths_are_problems 2, test_plan_refuses_equal_and_nested_legs 2, test_check_reports_equal_and_nested_legs_as_a_finding 2, test_checked_plan_values_refuses_equal_and_nested_legs 2
NIT 1: the .. sentence says every .. climbs out of the root again 4 test_a_dotdot_is_said_to_name_another_place_not_always_to_climb_out 4
NIT 2: . and ./ get the "two different paths" sentence again 3 test_dot_and_dot_slash_are_said_to_name_the_assembly_root_itself 3
NIT 3: C:/spec is said to be absolute everywhere again 1 test_a_drive_letter_is_called_absolute_only_where_that_is_true 1
NIT 4: a non-text value is echoed as the reader parsed it (007 as 7) 18 test_a_value_that_is_not_text_is_a_problem_that_does_not_echo_it 5, test_check_reports_a_non_text_value_without_echoing_what_the_reader_made_of_it 8, test_checked_plan_values_refuses_a_value_that_is_not_text 5
NIT 5: check reads plan.legs.get raw and prints None/ again 1 test_check_names_the_default_mount_paths_when_the_plan_has_no_keys 1
the refusal's trailer no longer names Git's names, Windows's, the alphabet or case 1 test_the_remediation_names_every_rule_a_person_could_trip 1

The only change here with no test is the _canonical_spelling docstring (the backslash NIT) and the module docstring and comments.

Relation to #165, #166, #168

  check    validates a plan against the source: every path covered exactly
           once, no unresolved legs, leg names conforming to the naming
           policy, each leg's mount path one `execute` can mount (`spec`,
           `legs/spec`; never `spec/` or `./spec`, a name Git or Windows keeps
           for itself such as `.git` or `CON`, or a value `execute` would
           refuse; the two never equal or nested, in any case), and the
           source's own submodules kept on one leg with their `.gitmodules`,
           registered there and never in the root. It prints what will
           happen and changes nothing.

Checked with git merge-tree against 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.py and test_adopt_execute_refusals.py give 533 passed, 1 skipped (filter-repo on PATH). #165 (05fa0e0) and #171 (f416e13) merge cleanly (text only).

  • cmd_execute, _refuse_an_unrunnable_plan, cmd_check and _verify are 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_root and takes the two flags through checked_value only, so it is not touched here (moving leg_path_problem into scripts/repo_shape.py would let the scaffold and validate-manifest.py ask the same question); and y() writes reserved YAML words unquoted, so plan --spec-path null writes spec_path: null, which every reader takes as the default.

Closes #169

🤖 Generated with Claude Code

brettheap and others added 3 commits October 9, 2026 02:19
…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]>
@brettheap

Copy link
Copy Markdown
Contributor Author

(lane openRepoShape-1, 2026-10-09T08:08:16Z)
@codex review

@sourcery-ai

sourcery-ai Bot commented Oct 9, 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 11 hours and 55 minutes by commenting @sourcery-ai review. Upgrade to get a review now.

@sourcery-ai

sourcery-ai Bot commented Oct 9, 2026

Copy link
Copy Markdown

Reviewer's Guide

This 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 enforcement

sequenceDiagram
    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
Loading

State diagram for a leg path through adoption

stateDiagram-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 --> [*]
Loading

Flow diagram for centralized leg path validation

flowchart 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]
Loading

File-Level Changes

Change Details Files
Centralize validation of leg mount paths and apply it consistently at plan creation, plan checking, and execution.
  • Define canonical relative POSIX path rules, Git/Windows reserved-name rules, and checked_value alphabet validation.
  • Reject invalid paths without rewriting them, while suggesting only safe canonical spellings of the same path.
  • Validate equal, nested, and case-insensitive-colliding spec/code mount paths.
  • Read plan paths and defaults through shared helpers so all callers use identical names and values.
adopt-project.py
Prevent invalid plans from being accepted or partially executed.
  • Refuse bad CLI paths before writing a plan with adopt-bad-leg-path.
  • Report plan-file path violations from _leg_findings as plan-bad-leg-path findings.
  • Refuse invalid plan paths before leg repositories, branches, or mounts are created during execution.
  • Correct displayed default mount paths from None/ to spec/ and code/.
adopt-project.py
Add comprehensive regression coverage for path validation and execution safety.
  • Test canonical, non-canonical, reserved, unsafe, non-text, equal, nested, and case-only-colliding paths across all validation sites.
  • Verify rejected plans are not written and rejected executions create no repositories or split branch.
  • Verify canonical nested paths still execute successfully with exactly two expected submodule registrations.
  • Cover default handling, remediation wording, and platform-portable Windows path rules.
tests/test_adopt_leg_paths.py

Assessment against linked issues

Issue Objective Addressed Explanation
#169 Reject non-canonical leg mount paths such as trailing slashes, leading './', doubled separators, absolute paths, parent-directory segments, and backslashes instead of silently accepting or rewriting them. ✅
#169 Ensure plan, check, and execute apply the same leg-path validation, with plan refusing to write invalid plans, check reporting a finding, and execute refusing invalid paths before creating leg repositories or modifying the adoption. ✅
#169 Prevent mount-registration conflicts by rejecting Git/Windows-reserved paths and equal or nested leg paths, while preserving default paths and valid canonical nested paths. ✅

Possibly linked issues


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

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-09T08:14:38.510119Z 5ab1a21 Manual request
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread adopt-project.py Outdated
Comment on lines +824 to +825
value = plan.legs.get(f"{role}_path")
return role if value is None else value

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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]>
@sonarqubecloud

sonarqubecloud Bot commented Oct 9, 2026

Copy link
Copy Markdown

@brettheap

Copy link
Copy Markdown
Contributor Author

(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: opensoft/brett-wip handoffs/xFactory/attachments/lane-openRepoShape-2/review187-8a542bd/report.md. Lines are at 5ab1a21 unless marked; at 8a542bd add 9 after :820 and 14 after :1235. Linux only: git 2.43.0, git-filter-repo from the venv.

Verdict for 8a542bd: MERGEABLE WITH NITS. At 5ab1a21 alone it would have been CHANGES NEEDED: that head fails tests/test_shape_doctor.py::test_the_placement_plans_entries_are_adoption_plan_entries ('list' object has no attribute 'get' at :824, red on all three CI operating systems, 1 failed, 1644 passed, 1 skipped); 8a542bd fixes it (164 passed; removing the check at 8a542bd :833 kills the 3 new tests). The PR fixes #169 and takes the prior pass's .git hole: in every one of 104 refused matrix rows, at both heads, plan exits 2 and writes no file, check exits 1 with FINDING plan-bad-leg-path, and execute exits 2 with no --local-remote-dir directory afterwards; the positive rows (legs/spec, the defaults, legs/spec + impl/code) still verify, clone recursively and bootstrap, with plan/check output byte-identical to main. cmd_execute, _refuse_an_unrunnable_plan, cmd_check, _verify are byte-identical to main. Tests: the four files you name give 440 passed, 1 skipped at 8a542bd (437/1 at 5ab1a21, matching the PR body), 536/1 with ca5fb3d (#166) merged under the union resolution and the doctor test passing there; test_adopt_leg_paths.py alone 346, 342/4 skipped without git-filter-repo; the new tests against main's adopt-project.py: 337 failed, 9 passed. Mutations each kill tests and the counts match your per-change table (device names 35, alphabet 56, case 12, Git names 51, trailing dot/space 13, except Refusal 15, spelling re-check 3, .gitmodules 13). render-cli-reference.py --check ok on every tree.

Prior pass (2c1f926) status. FIXED: P2-1 (legs/.git, .git, .GIT, .git/x, git~1, .git., ./.git all refused, :642/:699/:735), P3-3 (check now refuses every value execute refuses, :770), P3-4 (case-only and NTFS-equivalent pairs, :794/:800/:704; Spec/specs still verifies), P3-6b (with #173 merged, legs/.git and spec/ are refused before any leg exists), P3-6c (except Refusal exercised). PARTIAL: P3-5a (_print_what_will_happen :1282 no longer prints None/; still prints spec// and / and code/ for "", and a newline in a value splits the line; it never rewrites the plan, sha256 unchanged in 6 of 6). NOT TAKEN, tracked elsewhere: P2-2 (scaffold twin, #179/#180), P3-1 (#172), P3-2a (#181: agree.py tried all 333,361 strings of length 1-3 over the alphabet plus the keywords; the only plan/check disagreements are #181's 6 boolean words, which plan accepts and check refuses, and 3 null words, silently mounted at spec). NOT TAKEN and not tracked: P3-2b 2026, 1.5, ~ still verify and then bootstrap fails (FINDING manifest-leg-path), because templates/assembly-root/project.yaml:159 and contracts/spec-pin.yaml:22 substitute {{SPEC_PATH}} unquoted; one fold-in that also closes #181's symptom for leg paths: leg_path_problem refuses a value when repo_shape._scalar(v) != v. P3-5b legs: 5, a list or a string: check exits 1 with no FINDING line and execute dies with AttributeError; 8a542bd moves the list-form crash from :824 to Plan.names() (8a542bd :1132), still before any leg exists, so it cannot bypass the refusal (plan --spec-path spec/ with a list legs: is still refused); caveat: if names() ever accepts a list, _checked_plan_values would silently take the default paths. P3-5c (a bare spec_path: still means the default although the docstring at :816-825 says an explicit empty value is refused), P3-6d (no test for a plan-written null, true, 2026), P3-6e (deliberate).

N1 (P3, pre-existing on main). Names Git's fsck rejects for a gitlink pass all three checks

:642 GIT_OWN_NAMES = {".git", "git~1", ".gitmodules"}. Git's fsck_tree treats .gitmodules AND .gitattributes, and their NTFS short names, as special whatever the entry's mode, so a gitlink at such a name is gitmodulesMissing / gitattributesMissing. Probe (tools/fsckname.sh, a bare receiver with receive.fsckObjects=true): rejected by the receiver yet accepted by the PR: .gitattributes, legs/.gitattributes, gitmod~1, GITMOD~4, gi7eba~1, legs/gitmod~1, gitatt~1, gi7d29~1; rejected and refused (correctly): .gitmodules, legs/.gitmodules. End to end (tools/e2efsck.py, fsck on the source repository the split branch is pushed back to): .gitattributes, gitmod~1, legs/.gitattributes get plan ok and then execute exits 2 at REFUSED pushing the split branch ... gitattributesMissing with both leg repositories already created; main is the same. Also the reason text at :702 ("Git refuses to mount a leg at it or records no mount there") is false for legs/.gitmodules: main mounts it and the recursive clone and bootstrap succeed; the real reason is fsck. Unverified: whether github.com enforces these two checks on push. Fix: add .gitattributes; match gitmod~[1-4], gitatt~[1-4], gi7eba~N, gi7d29~N case-insensitively the way Git's is_ntfs_dotgitmodules / is_ntfs_dotgitattributes do; reword :702.

N2 (P3, pre-existing, outside this PR's region; filed as #192)

scripts/repo_shape.py:624-628 load_yaml catches OSError only, so a plan holding a non-UTF-8 byte makes check and execute exit 1 with a UnicodeDecodeError traceback and no FINDING or REFUSED line (no leg is created; main is the same; plan refuses the value first on the alphabet).

D1 (nit, 8a542bd). The isinstance(plan.legs, dict) check at 8a542bd :1252 in _leg_findings is redundant

Removing it changes nothing and kills no test, because :833 already returns the defaults for a non-mapping.

Merges (merge-tree --write-tree, 8a542bd): origin/main rc 0, merged tree equal to 8a542bd's own; ca5fb3d (#166) rc 1, one conflict at docstring :27-37 (lane 1's unpushed 5bef216 shows the same single hunk); 51998db (#174), 05fa0e0 (#173), f416e13 (#184), d4ead9f (#185), 2ead645 (#186) all rc 0. Sequencing note: this PR's plan refusal of equal and nested leg paths is what closes the P1 this lane found on the #174 branch (same path for both legs ends adoption verified under --force; see the #174 review), so #187 should land before #174, or #174 pins its own refusal.

Claims: TRUE: the three refusal claims; "untouched"; the merges; every test count; defaults byte-identical. PARTIAL: "_checked_plan_inputs (a comment)" also gains the refusal call at :854-856; "one question" except #181's nine keywords; "nothing rewrites a value" except null (#181); the refused-name list is incomplete against fsck (N1).

Not verified: Windows/macOS behaviour (including whether COM0/LPT0 are reserved); github.com's fsck policy; the GitHub-mode execute path (all remotes local); your five-file run without git-filter-repo; test runs on the merged trees with #184/#174/#185/#186 (merge-tree only); the full suite.

brettheap added a commit that referenced this pull request Oct 9, 2026
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]>
brettheap added a commit that referenced this pull request Oct 11, 2026
…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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant