Skip to content

tests/test_adopt_plan_and_remote_paths_spelled.py: follow-up of PR #1177 (#1152) from its review: six mutants (K1, K2, K4, K5, K6, K7) that none of its 148 rows kills, and two raw routes outside #1152's list: a refused command's CommandFailed.loudly still names --local-remote-dir raw, and NEXT: prints U+200B or U+200F raw #1195

Closed

Description

@brettheap

(lane openRepoShape-4, 2026-10-23T07:49:49Z)

Found by: RV1177, the independent review of PR #1177 (for #1152) at 5208e874 (#1177 issuecomment-6356234747, #1177 (comment)). It found no MUST and no SHOULD, and graded everything below NIT. Of its five NITs, N1 and N2 are the PR's own (a sentence of the body, a docstring, and N1's row), so they go onto #1177's branch. N3 and N4 are follow-ups outside #1152's words, and N5 names five surviving mutants. This issue is N3, N4, and the surviving mutants K1, K2, K4, K5, K6 and K7 (N1 names K1; N5 names the other five). K8 is equivalent and is left out: the bare path is absolute and ends in .git, so #900's trailing-space and backtick rules can never fire there, and the mutant that spells it by isprintable() alone prints the same.

Line numbers are approximate, at 5208e874 (#1177's head), and the test file is tests/test_adopt_plan_and_remote_paths_spelled.py, which #1177 adds (148 rows). RV1177 ran every probe and mutant below on the scratch merge of #1177 with origin/main 961640c68 (9fe75b4a8), in the landing gate's environment. adopt-project.py was sha256 0990c787 before each mutant and after its restore. #1177 is a draft and not on main, so the rows go onto #1177's branch, or into the file after #1177 lands.

What is missing

Two raw routes (N3 and N4), and six mutants (K1, K2, K4, K5, K6, K7) that leave all 148 rows green. #1177's code is right on every case below: RV1177 measured each on the merge. But a later change could put any of the six back and no test would fail. The two raw routes are real output a person can see, and both are outside #1152's list.

N3: a refused command still names --local-remote-dir raw

A real execute with --local-remote-dir <D>/re<U+202E>mote and a global pre-receive hook that refuses the leg push spells the bare lines and the notice, as #1177 says. But its REFUSED block prints the raw U+202E three times:

  • CommandFailed.loudly's git push -q <D>/re<U+202E>mote/Thing-spec.git HEAD:refs/heads/main (scripts/shape_materialize.py, loudly, about :1188);
  • git's own To <D>/re<U+202E>mote/...;
  • git's own error: failed to push some refs to '...'.

CommandFailed is shape_materialize.py's and is shared by every tool, and #1152 names only the lines #1177 spells. The probe's hook was #!/bin/sh, echo "..." >&2, exit 1, set as core.hooksPath in a global git config given as GIT_CONFIG_GLOBAL, with --allow-empty-leg spec.

  • Fix. RV1177's: spell loudly's argv, its (in <cwd>) and its output, as _first_said spells gh's. One difference to settle: loudly prints the whole output and _first_said keeps one line, so each line's characters would be spelled and the line breaks between lines kept.
  • A row. The probe above as a row: exit 2, a REFUSED block, and no raw U+202E (nor ESC, nor 0xff) anywhere on stdout or stderr. Where it lives (this file or a shape_materialize file) is the writer's to say.

N4: NEXT: prints a Cf character raw

shlex.quote neutralises no character. A source under so<U+200B>urce or so<U+200F>urce passes adopt-unwritable-value: BIDI_CONTROLS is the nine embeddings, overrides and isolates, and U+200F is RIGHT-TO-LEFT MARK, a bidi mark outside them. The split line spells it, and the NEXT: clone command one line below prints it raw inside single quotes. test_the_split_line_names_the_source_as_a_path_is pins the raw U+200B in NEXT: on purpose (assert (f"-b {SPLIT_BRANCH} {shlex.quote(where)}\n" in stdout), about :500), so any change here moves that row.

The six mutants, and the row that would fail on each

Each was applied to adopt-project.py in its own scratch worktree, run against the PR's file (148 rows, and with tests/test_adopt_github_exits.py for K7: 171), and restored with git checkout and its sha256 checked (0990c787 after each one). "Old to new" is the one exact string it replaced. The rows below are suggestions: they were not run against the mutants, and their expected lines are RV1177's probes on the merge, or read from the code where it says so.

Mutant Old to new The PR's rows
K1 check's last finding(s) in line: _shown(str(plan.path)) to isprintable() alone, else _spelled (no #900 rules) 148 passed (survives)
K2 the same line: _shown(str(plan.path.absolute())) 148 passed (survives)
K4 the PLACEMENT plan's plan-wrong-kind: detail to f"{path}: kind is {data.get('kind')!r}, expected {PLAN_KIND!r}" (the plan raw) 148 passed (survives)
K5 adopt-org-too-long: named to f"{plan.path}: `org:`" (raw; adopt-bad-org keeps named) 148 passed (survives)
K6 the extracted leg line: {_shown(url)} to {_shown(url) if url.isascii() else _spelled(url)} 148 passed (survives)
K7 the split line: _shown(urls['assembly']) to _shown(str(source.path)) 171 passed (survives)
  • K1. The --plan path ends in a space, or is relative and begins and ends with a backtick: printable, so isprintable() alone passes it, and adopt-project.py: a kept or dropped name reaches the split commit and the pull request body unspelled, and _spelled, _shown and plan's report print text that reads as another name, or raw #900's rule spells it. where_the_plan_is puts each character mid-name (pl<c>an.yaml), so these two need their own paths. Run check on the uncovered-plan row's plan (the len(findings) line; the mistyped-plan row reaches another line, which RV1177's mutant K13 shows is pinned). Expected, RV1177's probe on the merge:
  • K2. A relative --plan prints as typed. check --plan plan.yaml run in <D> (run_adopt takes no cwd today), on the same plan: 1 finding(s) in plan.yaml, and ./plan.yaml prints the same, per RV1177's probe. K2 prints <D>/plan.yaml.
  • K4. A PLACEMENT plan (kind: placement-plan, PLACEMENT_PLAN_KIND) at a --plan holding U+202E or ESC, under check and execute. Expected, read from Plan.__init__'s detail (the plan-wrong-kind row pins the other branch with kind: something-else): REFUSED plan-wrong-kind: `<D>/pl\u202ean.yaml`: kind is 'placement-plan', expected 'adoption-plan', and no raw U+202E. It can be a Row of ROWS with a_refusal_naming_the_plan("plan-wrong-kind", ...).
  • K5. An org: of 40 characters (GITHUB_OWNER_MAX is 39), in GitHub mode (no --local-remote-dir: the refusal is asked only where GitHub is), at a --plan holding U+202E. Expected, read from the code and by the topic-too-long row's shape (the same _both_ends), not run: FINDING adopt-org-too-long: `<D>/pl\u202ean.yaml`: `org:` is oooooooooooo...oooooooooooo, 40 characters, ... from check and the same with REFUSED from execute. A Row("org-too-long", "plain", ...) beside org-with-two-hyphens, with an edit that sets org: to 40 o.
  • K6. A --local-remote-dir whose name holds a printable non-ASCII character (U+00E9), through test_a_remote_dir_is_named_in_the_bare_and_leg_lines_as_a_path_is. It must print unchanged and with no backticks: -> <base>/re<U+00E9>mote/Thing-code.git. where_a_leg_is wraps every non-empty typed in backticks, so this form needs its own expected line. K6 spells it.
  • K7. A GitHub-mode split line. In tests/test_adopt_github_exits.py the line is asked only as " split " in result.stdout (about :452 on origin/main). Make it a full match: split <12 hex> on adopt/three-repo-shape -> https://github.com/<org>/<name>.git, which is urls['assembly'] in GitHub mode. K7 prints the source's local path there.

Done when

Each new row passes on 5208e874 and fails on its mutant (K1, K2, K4, K5, K6 and K7 are defined in the table above and in RV1177's comment), with each mutant run restored and its sha256 checked. N3 and N4 each end in a decision of their own: N3 a fix to loudly and its row, N4 a ruling between refusing the source and a note under NEXT:.

See #1152, #1177, #1128 and #1165.

Lane: openreposhape-4 (openRepoShape-4)

Activity

  1. brettheap commented on Oct 23, 2026

    @brettheap
    ContributorAuthor

    CLAIMED — lane openRepoShape-4, session 11c6c0ef-495a-4a05-94cf-811b7b0a1012@Eagle, 2026-10-23T12:01:49Z, for #1195

    Logged in lanes/log/openRepoShape-4.md at 6c7149df9c63a44dbe54380267d56266413d9ee9.

    The three reads (lane-collision-protocol Rule 1):

    1. existing `CLAIMED —` comments on opensoft/openRepoShape#1195:
       none
    2. `gh pr list --repo opensoft/openRepoShape --state all --search "#1195"`, kept where the row or its body names `#1195`:
       none
    3. `git ls-remote --heads [email protected]:opensoft/openRepoShape` branches naming `1195` as a whole token:
       none
    
  2. added this to the v1.2.1 milestone on Oct 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions