Skip to content

tests/conftest.py and tests/test_adopt_plan_paths_spelled.py: under a one-byte locale such as Latin-1 the 0xff --work-dir row skips and the two U+00E9 rows read the child's UTF-8, so none of the three fails on a tool that is right, and the bytes helper starts its child as run_script does (#1196) - #1209

Draft
brettheap wants to merge 13 commits into
mainfrom
fix/1196-paths-spelled-locale-and-env

Conversation

@brettheap

@brettheap brettheap commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Closes #1196

This PR lands after #1185. It is stacked on #1185's branch (fix/1167-plan-paths-spelled-rows, head d193617c7), which is itself stacked on #1154's. It is retargeted to main once #1185 has landed, by the lane's stacked-PR procedure. Tests only: no change to adopt-project.py (sha256 efe97bf7...b3d2, #1154's, byte for byte), and the tool is right in every case below.

From RV1185's review of #1185 (#1185 issuecomment-6356497748): its N1 and N2.

N1: three rows failed under a one-byte locale

Latin-1 built with localedef -c, as #1153's test_adopt_one_byte_locale.py builds it (LOCPATH, LC_ALL=en_US.ISO-8859-1, PYTHONUTF8=0).

  • The 0xff --work-dir row. skip_where_a_name_cannot_be_not_utf_8 (tests/conftest.py) also skips, before the disk is touched, where os.fsdecode(b"\xff") is not U+DCFF. Latin-1 reads the byte as U+00FF, which is printable, so _shown rightly prints it as typed. The disk and os.fsencode take the byte in every locale, so only os.fsdecode can say.
  • The two U+00E9 rows. run_script takes encoding (None unless named, so no other caller changes), and the four run_script calls of the spelled file name "utf-8": every child there is told PYTHONIOENCODING=utf-8.
  • The helper's own tests. test_non_utf8_name_callers.py's fixture a_system_that_carries_the_byte (which test_non_utf8_git_failures.py and test_non_utf8_oserror_sites.py use) and three rows of test_non_utf8_name_helpers.py guard the rows that let the probe through to the disk. They skip where the helper skips on the new question, as they do for the first. Without it, 28 of them failed under Latin-1 where they passed.

N2: the bytes helper's environment

plan_of_a_repository_on_github_as_bytes builds its child's environment with blank_unnamed_pin_sources and the git identity defaults, as run_script and test_stdout_encoding.py's run_tool_bytes do. Read from the helper with a pin-source override and a lane set, and no identity, in this process: before, SHAPE_PIN_SOURCE_OPENXDOX was '/somewhere/else' and the four GIT_* names were absent; now it is '' and they are the suite's IDENTITY_NAME and IDENTITY_EMAIL. The run ends at the clone refusal, so nothing it says changes, and no row can see it.

Rows added

Five, and no other row changes: three in test_non_utf8_name_helpers.py (the new question asked of an emulated Latin-1 os.fsdecode, before the disk; UTF-8 and ASCII controls) and two in the new tests/test_run_script_encoding.py (stdout and stderr read in the encoding named).

Counts

Run Before (d193617c7) After
spelled file, UTF-8 (LC_ALL=C.UTF-8) 31 passed 31 passed
spelled file, ASCII (LC_ALL=C PYTHONUTF8=0 PYTHONCOERCECLOCALE=0) 16 passed, 15 skipped 16 passed, 15 skipped
spelled file, Latin-1 3 failed, 15 passed, 13 skipped 0 failed, 17 passed, 14 skipped
spelled file + the 2 non-UTF-8 --out rows of test_stdout_encoding.py, Latin-1 (RV1185's run) 5 failed, 15 passed, 13 skipped 0 failed, 17 passed, 16 skipped
the 22 test files that use the helper and test_repo_hygiene.py (23 files; 24 after, with the new one), UTF-8, on the head 1085 passed, 1 skipped 1090 passed, 1 skipped
the same 24 files on a scratch merge of origin/main 961640c68 and the head 1091 passed, 1 skipped

Under UTF-8 every one of the 1086 tests that ran before has the outcome it had (compared by test id from the junit files): no new skip. The one skip is the Windows default-stdout row. Under Latin-1, over the same files: 0 tests went from passed to failed, 25 from failed to passed or skipped, 80 from passed to skipped (they ask for a name that is not UTF-8, which Latin-1 has none of), and 50 fail there before and after (not these files' defect: a one-byte locale is not a configuration they run under).

Mutants

Each restored, sha256 checked. "UTF-8" and "Latin-1" name the locale the run was made in.

Mutant Killed by
locale skip removed UTF-8: the new ..._skips_before_the_disk row; Latin-1: it, the 0xff row and the 2 test_stdout_encoding.py rows
locale asked after the disk UTF-8: ..._skips_before_the_disk
comparison inverted UTF-8: 8 rows of test_non_utf8_name_helpers.py; Latin-1: 4
callers fixture without the locale half Latin-1: 23 rows
helpers guard without the locale half Latin-1: 5 rows
run_script drops encoding UTF-8: the latin-1 row of test_run_script_encoding.py; Latin-1: both its rows and both U+00E9 rows
plan_of_a_local_source / plan_of_a_repository_on_github drops encoding Latin-1: the --out / --work-dir U+00E9 row
RV1185's O1, O2, O3 on adopt-project.py UTF-8 and ASCII: the 0xff row, at its line assert
bytes helper without blank_unnamed_pin_sources, or without the identity defaults survive, as #1196 says no row can see them
the question asked as os.fsdecode(os.fsencode(probe)) equivalent: the same answer

Merge-trees

git merge-tree --write-tree of the head against origin/main, #1185's head, #1154's head and each of the 55 open PRs' heads: clean, except #1117 and #1201, which conflict at docs/handbook.html against origin/main itself, with or without this branch. No open PR but #1154 and #1185 touches any of the five files.

Left

Outside this issue: 50 tests of these 24 files fail under Latin-1 before and after, as do #1154's own test_stdout_encoding.py rows that name U+65E5 U+672C (now skipped by this change where they ask the helper).

🤖 Generated with Claude Code
Lane: openreposhape-4 (openRepoShape-4)

Summary by Sourcery

Make subprocess and filename tests accurately handle locale-dependent encoding behavior without changing the production tool.

Bug Fixes:

  • Prevent tests from falsely failing under single-byte locales by skipping non-UTF-8 filename cases when the locale decodes 0xFF as a printable character.
  • Ensure child output configured as UTF-8 is decoded consistently as UTF-8 by the test helpers.

Enhancements:

  • Extend non-UTF-8 filename coverage to distinguish filesystem and locale behavior, including pre-filesystem skip checks.
  • Align byte-oriented test subprocess environments with the standard runner's pin-source and Git identity defaults.

Tests:

  • Add coverage verifying caller-selected decoding for subprocess stdout and stderr.
  • Add tests for UTF-8, ASCII, and Latin-1 filename-decoding behavior and their skip conditions.

Brett Heap and others added 4 commits October 21, 2026 16:28
…nly) into` name the caller's `--out` and `--work-dir` with `_shown`, as the other lines of the report name a path, so a bidi control, a line feed or a tab in either no longer reaches the terminal as it was typed (#1115)

`cmd_plan` printed `plan written to {out}` and `Source.clone` printed
`cloning {repository} (read only) into {path}` with the typed path as it was.
A path holding U+202E or U+2066 turned the line round, a line feed split it
and a tab padded it, where the `source` line, the table and the follow-ups
spell such a path with `_shown` (#199, #900). #1115 named the `--out` line;
RV1120's review of #1120 (its N4) found the `--work-dir` line, which is said
for an `org/repo` source by `plan`, `check` and `execute` alike.

A path whose every character is printable prints exactly as before.

The `--out` line also spells a byte that is not UTF-8 now, `\udcff` between
backticks where it was written back as 0xff, as `_shown` spells it in every
other line; `test_stdout_encoding.py` pinned the raw byte for that one line,
and its row now holds the spelled one.

tests/test_adopt_plan_paths_spelled.py runs `plan` as a child with U+202E,
U+2066, a line feed, a tab and all four in `--out` and in `--work-dir`, and
with a plain path that must print unchanged. The `--work-dir` rows use a `gh`
that refuses: the line is said before `gh` runs.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…itten to` and `cloning ... into` lines that no row killed now fail one, so a printable non-ASCII path prints as typed, ESC, CR and a non-UTF-8 `--work-dir` are spelled, a relative `--out` is not made absolute, an `--out` that ends in a space or is wrapped in backticks is spelled, and `execute` spells the clone line as `plan` does (#1167)

Follows #1154 (for #1115), from RV1115's review of it (#1154
issuecomment-6344547992): its mutants R1, R2, R3, R4, R6, R7 and R12 left
the 18 rows of the file green, and the code of #1154 is right on each case.
No change to adopt-project.py.

13 rows are added, and the first 18 are unchanged:

- ESC and CR join `CHARACTERS`, which feeds the `--out` rows and the
  `--work-dir` rows alike (R6, R7; 4 rows);
- a `--work-dir` that is not UTF-8, under a `surrogateescape` stdout, is
  spelled `\udcff` between backticks and no raw byte is written (R7; 1 row);
- a printable non-ASCII `--out` and `--work-dir` (U+00E9) print as typed, with
  no backticks (R2, R3; 2 rows);
- a relative `--out`, `plan.yaml` and `./plan.yaml`, prints as `plan.yaml`
  (R4; 2 rows);
- an `--out` that ends in a space, and a relative one that begins and ends with
  a backtick, are printable and still spelled, as `_shown` has it since #900
  (R1; 2 rows);
- `check` and `execute` over a plan from a local source, handed `--source
  testorg/Thing` and a `--work-dir` holding U+202E, refuse as
  `source-unclonable` after the spelled `cloning` line (R12; 2 rows). Only the
  `execute` row kills R12: `plan` and `check` hand `Source.clone` a list of the
  clones they made, `execute` none.

Each new row passes on 8a782733 and fails on its mutant, and each mutant
leaves the first 18 rows green.

Lane: openreposhape-4 (openRepoShape-4)
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…issing traceback are two asserts, so a failure names the one that broke (#1167)

The 0xff `--work-dir` row asserted `code == 2 and b"Traceback" not in
stderr` as one composite assert, which SonarCloud flags as python:S9073
on #1185 (RV1185's S1). It is now `assert code == 2` and
`assert b"Traceback" not in stderr`, each with the same message, the
child's stdout and stderr. The row asserts what it asserted before.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
… one-byte locale such as Latin-1 the 0xff `--work-dir` row skips and the two U+00E9 rows read the child's UTF-8, so none of the three fails on a tool that is right, and the bytes helper starts its child as `run_script` does (#1196)

Follows #1185 (for #1167), from RV1185's review of it (#1185
issuecomment-6356497748): its N1 and N2. No change to adopt-project.py,
and the tool is right in every case below. Under a Latin-1 locale built as
#1153's test_adopt_one_byte_locale.py builds one, the new file and the two
non-UTF-8 `--out` rows of test_stdout_encoding.py gave 5 failed, 15
passed, 13 skipped; they give 0 failed, 17 passed, 16 skipped now.

N1, the three rows that failed under a one-byte locale:

- `skip_where_a_name_cannot_be_not_utf_8` (tests/conftest.py) also skips
  where `os.fsdecode(b"\xff")` is not U+DCFF, before the disk is touched.
  Latin-1 reads the byte as U+00FF, a printable character, so `_shown`
  prints `wd<U+00FF>k` as typed, and the 0xff row's premise, that Python
  reads it in as U+DCFF, does not hold. The disk and `os.fsencode` take
  the byte in every locale, so neither could say. UTF-8 and ASCII give
  U+DCFF and skip no more than before: the 1086 tests of the 22 files
  that ask the helper, and of test_repo_hygiene.py, have under UTF-8 the
  outcome they had. The two non-UTF-8 `--out` rows of
  test_stdout_encoding.py ask it too, and skip under Latin-1 where they
  failed.
- `run_script` takes `encoding`, None unless named, and the four runs of
  tests/test_adopt_plan_paths_spelled.py name "utf-8": each child is told
  `PYTHONIOENCODING=utf-8`, and a parent in Latin-1 read the two bytes of
  U+00E9 as two characters (`..._non_ascii_out_path_...` and
  `..._non_ascii_work_dir_...`). Both rows pass there now.
- The rows of test_non_utf8_name_callers.py (its fixture, which
  test_non_utf8_git_failures.py and test_non_utf8_oserror_sites.py use)
  and test_non_utf8_name_helpers.py that let the probe through to the
  disk skip where the helper skips on the new question, as they skip
  where it skips on the first: 28 of them failed under Latin-1 without it.

N2: `plan_of_a_repository_on_github_as_bytes` builds its child's
environment with `blank_unnamed_pin_sources` and the git identity
defaults, as `run_script` and test_stdout_encoding.py's `run_tool_bytes`
do. It had neither; the run ends at the clone refusal, so nothing it says
changes, and no row sees it.

Five rows are added and no other row changes: three in
test_non_utf8_name_helpers.py (the new question asked of an emulated
Latin-1 `os.fsdecode`, before the disk, and the UTF-8 and ASCII controls)
and two in the new tests/test_run_script_encoding.py (the keyword reads
stdout and stderr in the encoding named). The 31 rows of the spelled file
are unchanged: 31 pass under UTF-8, and under ASCII 16 pass and 15 skip.

Lane: openreposhape-4 (openRepoShape-4)
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@sourcery-ai

sourcery-ai Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

Reviewer's Guide

Tests

Make the non-UTF-8 filename skip depend on how the filesystem encoding decodes byte 0xFF, and update the helper tests and callers to account for that locale check.

  • tests/conftest.py L1165-1179, L1185-1190
  • tests/test_non_utf8_name_callers.py L131-136
  • tests/test_non_utf8_name_helpers.py L18-25, L58-79, L203-236 (+2 small edits)

Allow run_script callers to select the output decoding encoding and cover both UTF-8 and Latin-1 decoding of child stdout and stderr.

  • tests/conftest.py L735-736, L757-762, L803-804
  • tests/test_run_script_encoding.py L1-46

Use UTF-8 decoding for the spelled-path subprocess cases, skip the byte-path case when the locale reads 0xFF as a printable character, and align the raw-bytes child's environment with the standard test setup.

  • tests/test_adopt_plan_paths_spelled.py L32-42, L305-323 (+7 small edits)

Tips and commands

Interacting with Sourcery

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

Customizing Your Experience

Access your dashboard to:

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

Getting Help

@brettheap

Copy link
Copy Markdown
Contributor Author

RV1209: independent review of #1209 at 13a2c58c: READY

Independent adversarial review for lane 4. No MUST and no SHOULD; five NITs for follow-ups. The PR does what #1196 asks. Under UTF-8 no test of the 25 files that reach the changed helpers changes its outcome; only the five new rows are added. Under a real Latin-1 locale the three rows of the spelled file no longer fail. run_script's new keyword changes nothing for a caller that does not name it. The bytes helper's child now gets the pin-source blanking and the git identity. Every mutant of the new guard that is not equivalent fails a row on Linux, except one: a mutant that asks the locale before the system's question (N3).

What I measured against

1. UTF-8: nothing that ran before skips now

LC_ALL=C.UTF-8, the 25 files, d193617c7 against 13a2c58cb, by test id.

Before After
total 1112 passed, 1 skipped 1117 passed, 1 skipped
test_non_utf8_name_helpers.py 19 passed 22 passed
test_run_script_encoding.py (absent) 2 passed
each of the other 23 files same counts same counts
  • Transitions. The only ones are 5 from absent to passed: the three new helper rows and the two new run_script rows. No test changed outcome.
  • The one skip. It is test_stdout_encoding.py's Windows default-stdout row, on both heads.
  • ASCII. The spelled file under LC_ALL=C PYTHONUTF8=0 PYTHONCOERCECLOCALE=0 gives 16 passed and 15 skipped, before and after.

2. Latin-1

Latin-1, d193617c7 -> 13a2c58cb Before After
spelled file 3 failed, 15 passed, 13 skipped 0 failed, 17 passed, 14 skipped
test_non_utf8_name_helpers.py 19 passed 17 passed, 5 skipped
test_non_utf8_name_callers.py 36 passed 18 passed, 18 skipped
test_run_script_encoding.py (absent) 2 passed
all 25 files 988 passed, 87 failed, 38 skipped 915 passed, 52 failed, 151 skipped
  • The three rows. The two U+00E9 rows go from failed to passed. The 0xff row goes from failed to skipped, on the new reason: "this system's file name encoding (iso8859-1) reads the byte 0xFF as '\xff', not as '\udcff'".
  • All 25 files, by id. 0 rows went from passed to failed, 2 from failed to passed, 33 from failed to skipped and 80 from passed to skipped. These match the body's figures once test_local_remote_dir_urls.py's 10 failed-to-skipped rows are added.
  • The skip does not hide a wrong tool. I read the failure text of each of the 33 failed-to-skipped rows. Each fails on its own UTF-8 premise, not on a defect it was written to catch:
    • a name holding 0xE9 or 0xFF is Latin-1 text there, so the tool prints it (branch a<U+00FF>b created) or goes on with it;
    • a U+FFFD is escaped by a Latin-1 stdout;
    • or the test's own make_source_repo cannot spell U+65E5 U+672C (the two test_stdout_encoding.py rows).
  • But the skip also falls where the tool can be judged. See N1.

3. run_script(encoding=None)

  • Before, subprocess.run got text=True and no encoding or errors. After, it gets text=True, encoding=None, and still no errors. I read this from both heads with a probe that captures the keywords (two calls, one with input=). The only difference is the explicit encoding: None.
  • Why that is the same. inspect.signature(subprocess.Popen.__init__) gives encoding=None and errors=None as the defaults. On 3.12, Popen reads encoding is None the same way whether it was passed or not.
  • No caller could have passed it before. encoding comes after *args, so it is keyword-only, and no caller named it before (that would have been a TypeError). The two callers that spread keywords into run_script never name it: test_adopt_pins.py's check_plan and check_on_github (**named), and test_chain_pin_sources.py's functools.partial(run_script, env=env).
  • The 25-file comparison in section 1 shows no outcome change. The PR's CI tests job, the full suite, passed on the head.

4. N2: the bytes helper's child environment

A probe called plan_of_a_repository_on_github_as_bytes with subprocess.run captured. It ran with SHAPE_PIN_SOURCE_OPENXDOX=/somewhere/else, Shape_Pin_Source_Mixed=/x and LANES_LANE=openRepoShape-9 set, and no GIT_* identity. I compared what it got with test_stdout_encoding.child_environ(tmp, "utf-8:surrogateescape"), which is what run_tool_bytes uses.

Name d193617c7 13a2c58cb child_environ
SHAPE_PIN_SOURCE_OPENXDOX /somewhere/else '' ''
Shape_Pin_Source_Mixed /x '' ''
LANES_LANE '' '' ''
the four GIT_* identity names absent the suite's IDENTITY_NAME and IDENTITY_EMAIL the same
PYTHONIOENCODING utf-8:surrogateescape the same the same
AGENT_PROTOCOL_ROOT absent absent <tmp>/agent-protocol

At the head, apart from the stand-in gh (PATH, GH_STUB_LOG), the only key child_environ has and the helper lacks is AGENT_PROTOCOL_ROOT. See N5.

5. Mutants

I wrote these myself, and applied each in a separate worktree at the head. The UTF-8 and Latin-1 runs used the helpers file, test_run_script_encoding.py, the spelled file and test_stdout_encoding.py's two non-UTF-8 --out rows (57 tests), unless the table says otherwise.

Mutant UTF-8 Latin-1
none (control) 57 passed 54 passed, 39 skipped (with the callers file)
G1: locale question removed killed, 1: ..._skips_before_the_disk killed, 4: it, the 0xff row and both --out rows (callers file included)
G2: comparison inverted killed, 8 helper rows (not run)
G3: locale asked after the disk probe killed, 1: ..._skips_before_the_disk killed, 1: the same row
G4: locale asked BEFORE the system's os.fsencode question survives, 57 passed (not run). See N3
G5: narrower, skip only where sys.getfilesystemencoding() is Latin-1 killed, 1: ..._skips_before_the_disk killed, 2: both ..._is_not_skipped controls
G6: os.fsdecode(os.fsencode(NOT_UTF_8_PROBE)) survives survives. Equivalent, as the body says
F1: callers fixture without the locale half (not run) killed, 23 rows of the callers, oserror-sites and git-failures files
F2: helpers guard without the locale half (not run) killed, 5 helper rows
E1: run_script drops encoding killed, 1: the latin-1-reads-two row killed, 3: the utf-8 row and both U+00E9 rows
E3: plan_of_a_local_source drops encoding (not run) killed, 1: the --out U+00E9 row
E4: plan_of_a_repository_on_github drops encoding (not run) killed, 1: the --work-dir U+00E9 row

After each run I restored the tree with git checkout -- tests/ and checked the sha256 of the four files the mutants touch against the head's. All 18 restores matched, and the worktree is clean. The encoding="utf-8" added to test_each_of_the_two_paths_is_spelled_in_one_run and a_command_on_github is equivalent in every locale those rows run in: they type U+202E, which Latin-1 and ASCII skip. It is harmless consistency.

6. Gate

7. Merge-trees

Scope: the three files past the issue's text

Each change is needed once the shared helper asks the locale, and each is right:

  • The callers fixture. Without it, 23 rows fail under Latin-1 (F1).
  • The helpers guard. Without it, 5 rows fail (F2).
  • test_run_script_encoding.py. It is the only row that holds run_script's keyword under UTF-8, the locale CI runs (E1).

Whether the shared helper should ask the locale at all is N1.

Findings

  • N1 (NIT): under a one-byte locale the shared helper's new question also skips rows that can judge the tool.
    • What. 80 rows passed under Latin-1 before and skip there now:
      • 35 on the helper's own new reason. Most are branch rows (on_a_branch_that_is_not_utf_8 and the test_adopt_git_reads.py default-branch rows), for example test_plan_refuses_a_default_branch_that_is_not_utf8[head], test_family_tracking_branch.py's ..._is_refused_by_name[add] and test_family_head_by_hand_bytes.py's 8 test_the_printed_line_puts_the_member_back_on_a_branch_that_is_not_utf8 rows. Their names come from git's bytes, which are not UTF-8 in any locale. Each passed there, so the tool was judged and was right.
      • 45 on the two guards, the callers fixture and the helpers guard. Their subject is how a caller or the helper treats the disk's EILSEQ, EACCES, ENOSPC and EEXIST, emulated. That has nothing to do with the locale.
    • The docstring overstates it. "so no file name here is one that is not UTF-8" is not true of a git branch. The disk and git still hold the byte 0xFF in every locale; only Python's reading of it changes.
    • Why only a NIT. No row the skip catches was failing on a wrong tool (section 2). Neither CI nor the bench runs a one-byte locale, and 52 rows of these files still fail there after. tests/test_adopt_plan_paths_spelled.py: follow-up of PR #1185 (#1167) from its review: three of its rows fail under a one-byte locale where the tool is right (the 0xff --work-dir and the two U+00E9 paths), and its new helper builds the child's environment without blank_unnamed_pin_sources or the git identity defaults #1196 asked for exactly this change to the shared helper.
    • Follow-up.
      • Put the locale question in its own helper, for example skip_where_the_locale_reads_the_byte_as_text() in tests/conftest.py.
      • Call it from the rows whose premise is that Python reads 0xFF in as U+DCFF: the 0xff --work-dir row and test_stdout_encoding.py's two non-UTF-8 --out rows.
      • Leave skip_where_a_name_cannot_be_not_utf_8 with its two questions, so the callers-fixture and helpers-guard halves are not needed.
      • Or keep this design, and say in the helper's docstring that under a one-byte locale it also skips the git-branch rows.
  • N2 (NIT): the new Latin-1 helper row fails on a real Windows.
    • What. test_a_locale_that_reads_the_byte_as_a_character_skips_before_the_disk is not LINUX_ONLY, and it patches only os.fsdecode. On Windows the helper's first question skips first. I emulated it with os.fsencode = windows_fsencode and the row's Latin-1 fsdecode. The reason is then "this system's os.fsencode makes no byte of a surrogate...", which holds no 0xFF, so assert "0xFF" in reason fails.
    • Why only a NIT. CI is Linux only (ci: run the test suite on Linux only #597), but this file is written to hold the Windows answers too.
    • Fix. In that row, also patch os.fsencode with a POSIX one, lambda name: name if isinstance(name := os.fspath(name), bytes) else name.encode("utf-8", "surrogateescape"). Or skip it where len(os.fsencode(NOT_UTF_8_PROBE)) != 1.
  • N3 (NIT): no row holds that the locale is asked after the system's question.
    • What. G4 (the two swapped) survives on Linux. But Windows' os.fsdecode is UTF-8 with surrogatepass, and b"\xff".decode("utf-8", "surrogatepass") raises UnicodeDecodeError. With Windows' os.fsencode and os.fsdecode both emulated, the head's helper skips on the os.fsencode reason, and G4's helper raises UnicodeDecodeError. The conftest comment at NOT_UTF_8_BRANCH already says os.fsdecode "raises on Windows".
    • Fix. In test_where_fsencode_makes_three_bytes_the_disk_is_not_asked, also patch os.fsdecode with Windows' (lambda name: name if isinstance(name := os.fspath(name), str) else name.decode("utf-8", "surrogatepass")). G4 then fails there.
  • N4 (NIT): the two-question predicate is written three times.
    • What. The same test, len(os.fsencode(NOT_UTF_8_PROBE)) != 1 or os.fsdecode(b"\xff") != NOT_UTF_8_PROBE, is in the callers fixture a_system_that_carries_the_byte and in the helpers file's skip_where_an_earlier_question_skips. Its two halves are also the helper's own first two steps. A third question added to the helper later would have to be added in all three, or those rows fail again, as 28 did here.
    • Fix. Define one predicate in tests/conftest.py, for example an_earlier_question_skips() -> bool, beside the helper, and use it from both test files.
  • N5 (NIT): the new helper's docstring claims more parity than it has.
    • What. the_environment_of_a_child_read_as_bytes says the child is started "as test_stdout_encoding.py's run_tool_bytes starts its own". run_tool_bytes (through child_environ) also sets an empty AGENT_PROTOCOL_ROOT, and this helper does not (section 4). It has no effect here: shape_advisory.workspace_paths is read only after a clone, and the run ends at the clone refusal.
    • Fix. Say "as run_script starts every other child", which is exact. Or add "AGENT_PROTOCOL_ROOT": str(tmp_path / "agent-protocol"), with the directory made, and keep the sentence.

Notes, not findings

Lane: openreposhape-4 (openRepoShape-4)

brettheap added a commit that referenced this pull request Nov 9, 2026
…encode, so it passes under Latin-1 where it ended in a traceback, and 45 rows in 11 test files that cannot judge under a one-byte locale skip there on their own premise (#1214) (#1258)

## Goal

#1214 counts 50 tests in 12 files that fail under a Latin-1 locale before and after #1209, and asks of each whether it is a test that cannot judge under a one-byte locale, or a tool that misbehaves there. All 50 are settled here:

- **3 are a tool defect, fixed:** a family holder's `scripts/validate-family.py` ended in a `UnicodeEncodeError` traceback, exit 1, on any stdout that cannot hold U+2026, when the holder passed.
- **45 cannot judge under Latin-1,** and now skip there on their own premise, which the skip reason states. 18 fail in the test process itself, before the tool runs. In the other 27 the tool answers rightly for the bytes Latin-1 gives, and the row expects UTF-8's.
- **2 judge under Latin-1 as they are written, and carry no guard:** `test_a_utf8_source_directory_still_adopts_with_local_remotes` (it passes with the pip-installed git-filter-repo, and fails with a `python -E` one on #1247's tool defect; see "Left") and `test_surrogateescape_reads_the_issues_branch_as_caf_and_u_dce9` (its `if` asks the one thing its assertion needs). Both came out of RV1258's review of the first commit.

Under Latin-1 with the pip-installed git-filter-repo, none of the 50 fails on this head. Under UTF-8 every row keeps its outcome, and the rows added pass.

The classification is W1214's: lane 4's first writer of #1214, who read each test's code and stopped at a checkpoint with half the guards written and nothing run. This branch finishes the guards, runs every gate below, and measures each row. RV1258 reviewed the first commit; the second answers it (next section).

## The second commit

RV1258 reviewed the first commit, `c8641c691` (NOT READY: two SHOULDs, three NITs, no MUST; #1258 (comment)). The second commit, `cd9f3cfd1`, answers it on top of the first, with no rebase. It changes four test files and no tool:

- **S1, a premise guard on a row that passes:** the guard on `test_a_utf8_source_directory_still_adopts_with_local_remotes` is gone, and so is the `A_NAME_HELD_AS_UTF_8` import it alone used in `tests/test_adopt_template_values.py`.
  - The guard skipped a row that passes: on main under Latin-1, with CI's pip-installed git-filter-repo, the row passes. Its skip reason (the tool "names it as" a name that is not UTF-8) was false for it, because `execute` adopts the source.
  - The row now runs under Latin-1 and passes with the pip launcher. With a launcher started as `python -E` it fails on #1247's tool defect (git-filter-repo's `UnicodeEncodeError` on U+FFFD) until #1251 lands. That is a failure of the tool, and #1214's rule sends such a row to an issue of its own, not to a skip.
  - **#1258 and #1251 are now independent of each other.** This PR carries no guard for #1251 to drop, so the earlier plan, that whichever of the two lands second drops this PR's guard, is void. Neither waits for the other.
- **S2, nothing CI runs held the helper's answers:** `tests/test_non_utf8_name_helpers.py` gets 20 rows, written as that file writes its Windows rows: `os.fsencode`, `os.fsdecode` and `sys.getfilesystemencoding` are replaced for one test by UTF-8, Latin-1 and ASCII as POSIX has them.
  - 15 rows (five texts, three locales) hold which question skips the text (none, "cannot spell", "writes" or "reads"), and that the reason names the encoding, ends with the row's premise, and is ASCII.
  - 5 rows hold the emulation to this run's real locale: the helper answers the same with the real `os` as with the emulation of its file system encoding.
  - RV1258's mutant A5 (UTF-8 bytes built with `surrogatepass` instead of `surrogateescape`) now fails 3 rows under CI's UTF-8 locale; before, it made 11 rows skip silently. The mutants that survived, A1, A2 and A4, now fail 5, 1 and 6 rows (see the mutants below).
- **N1:** the first-statement row of `tests/test_bootstrap_spelling.py` also reads `templates/family-root/scripts/validate-family.py`, so RV1258's mutant D3 (the `escape_unencodable_stdout()` call moved after `parse_args`) fails it.
- **N3:** `test_surrogateescape_reads_the_issues_branch_as_caf_and_u_dce9` no longer asks the helper. Its `if` also asks `os.fsdecode(b"\xe9") == chr(0xDCE9)`, so under Latin-1 the row runs its first assertion and passes where it skipped, and under UTF-8 and ASCII it asserts as before.
- **N2, known and left:** under emulated Windows codecs the helper skips the U+DCE9 rows that carry no Windows mark, with a premise that is false on Windows. That is reasoned and emulated, not run on Windows, and CI runs Linux only (#597).

## The 50, by file

Kinds:
- **a1:** the test process itself cannot make or pass the name under Latin-1, so it raises `UnicodeEncodeError` before the tool runs. Guard: the existing `skip_where_the_environment_cannot_carry`.
- **a2:** the tool runs and answers rightly for the bytes Latin-1 gives, and the row expects UTF-8's reading or spelling. Guard: the new `skip_where_the_locale_does_not_spell_it_as_utf_8(text, premise)`, asked only of the text the row's premise is about.
- **b:** a tool defect.
- **c:** the row judges under Latin-1 as it is written, and runs there with no guard.

`test_stdout_encoding.py` comes first, as #1214 asks. 18 a1 + 27 a2 + 3 b + 2 c = 50.

| File | Rows | Kind | Why it fails under Latin-1 | Guard |
|---|---|---|---|---|
| `tests/test_stdout_encoding.py` | 10: `test_plan_reports_every_name_whatever_its_stdout_can_encode` (3), `test_plan_on_the_posix_default_stdout`, `test_every_tool_exits_alike_whatever_its_stdout_can_encode` (6) | a1 | The test makes a file or directory named U+65E5 U+672C, or passes that name on a command line, and Latin-1 cannot encode it. | `skip_where_the_environment_cannot_carry`, in `plan_arguments` and in each of the six builders. (`bump-leg-dry-run` writes the name as bytes and passes, so it has none.) |
| `tests/test_adopt_pins.py` | 5 `[zwj]` rows | a1 | U+200D cannot go on the command line, or through `copytree`. | `skip_where_the_environment_cannot_carry(name)` |
| `tests/test_adopt_pins.py` | 4 `[not-utf-8...]` rows | a2 | The byte 0xFF is read as U+00FF, printable text the tool takes, so `plan` goes on where UTF-8 gives U+DCFF and a refusal. | `A_BYTE_READ_AS_A_SURROGATE`, where the name holds U+DCFF |
| `tests/test_adopt_pins.py` | 5 rows that compare a `pin` or `write` line | a2 | A Latin-1 stdout has no U+2026, so the tool prints the digest's ellipsis as `\u2026`, as #214 designed. | `PRINTED_AS_ITSELF`, just before the line is compared |
| `tests/test_pin_source_unreadable.py` | 3 `[not-ascii-*]` | a1 | The path U+65E5 U+672C `-missing` cannot go on the command line. | `skip_where_the_environment_cannot_carry` |
| `tests/test_pin_source_unreadable.py` | 3 `[not-utf-8-*]` | a2 | `miss<0xFF>ing` reaches the tool as text, and is printed as itself, not as `\udcff`. | `A_BYTE_READ_AS_A_SURROGATE` |
| `tests/test_family_tracking_branch.py` | `test_each_act_refuses_the_tracking_branch_then_lands_on_a_branch` `[add]`, `[bump]`, `[remove]` | **b** | Each act passes until `validate(holder)`. The holder's `validate-family.py` prints `members/X: tree digest recomputes (<12 hex>...)`, ending in U+2026, and never escaped its stdout, so it ended in a traceback, exit 1. | none: the tool is changed |
| `tests/test_family_tracking_branch.py` | `test_a_branch_ending_in_a_no_break_space_is_pushed_as_itself` | a2 | `git switch -c feat<U+00A0>` writes the single byte 0xA0, so the branch is not UTF-8, and the tool rightly refuses it (#765). | `A_NAME_HELD_AS_UTF_8` |
| `tests/test_adopt_template_values.py` | the `--elected-by` and `--reference` rows of `test_plan_refuses_a_flag_no_file_can_hold` whose value holds U+DCE9, and `test_plan_and_check_say_the_same_sentence` | a2 | 0xE9 is read as U+00E9, text `plan` takes. | `A_BYTE_READ_AS_A_SURROGATE` (in the flag test, only where the value holds U+DCE9) |
| `tests/test_adopt_template_values.py` | `test_a_utf8_source_directory_still_adopts_with_local_remotes` | **c** | With the pip launcher it does not fail under Latin-1 on this head or on main: its `caf<U+00E9>` directory is the single byte 0xE9, and `execute` adopts the source all the same. It fails only where git-filter-repo is started as `python -E`, on #1247's tool defect (see "Left"), which is an issue of its own and not a premise to skip on. | none (a guard was here in the first commit, and RV1258's S1 took it out) |
| `tests/test_clone_url_bytes.py` | the 4 `[bidi-override-*]` rows | a2 | The directory is made from U+202E's UTF-8 bytes E2 80 AE. Latin-1 reads them as three characters, one of them the C1 control U+0080, so the tool rightly says "a control character". | `A_NAME_READ_AS_UTF_8`, in `skip_where_this_system_cannot_name` |
| `tests/test_bump_leg_branch_and_push_line.py` | 2 | a2 | The branches `feat<U+00A0>` and `main<U+00A0>` hold the single byte 0xA0. | `A_NAME_HELD_AS_UTF_8` |
| `tests/test_bootstrap_leg_moves.py` | 2 | a2 | `bootstrap.py` prints U+2014 escaped on a Latin-1 stdout. | `PRINTED_AS_ITSELF`, just before the assert |
| `tests/test_update_shape_apply_lines_and_headers.py` | 1 | a2 | The branch `feat<U+00A0>`. | `A_NAME_HELD_AS_UTF_8` |
| `tests/test_adopt_spelled_names.py` | 1 | a2 | The test writes `caf<U+00E9>.md` as 0xE9, so git holds a name that is not UTF-8, and the C-locale child prints `caf\udce9.md`, not `caf\xe9.md`. | `A_NAME_HELD_AS_UTF_8`, after its C-locale probe |
| `tests/test_family_member_branch_not_utf8.py` | `[trailing-no-break-space]` | a2 | `_member_head` reads the byte 0xA0 as U+DCA0, which is the branch git wrote. | `A_NAME_HELD_AS_UTF_8`, only where the branch is not `NOT_UTF_8_BRANCH`: `[not-utf8]` passes under Latin-1 and still runs there |
| `tests/test_family_head_by_hand_bytes.py` | 1 | **c** | Its `if`, `os.fsencode(chr(0xDCE9)) == b"\xe9"`, holds under Latin-1 too, and its assertion, `os.fsdecode(LATIN_1) == branch`, holds only where the locale reads 0xE9 as U+DCE9 (UTF-8, ASCII). Its first assertion holds in every locale. | none (RV1258's N3): the `if` also asks `os.fsdecode(b"\xe9") == chr(0xDCE9)`, so under Latin-1 the row runs its first assertion and passes |

## What changed, file by file

18 files: one tool, `tests/conftest.py`, and 16 test files.

- **`templates/family-root/scripts/validate-family.py`** (the tool):
  - `main`'s first statement is now `escape_unencodable_stdout()`, imported from `repo_shape`, as in `siblings.py` and both roots' `bootstrap.py` (#391, #454).
  - That call adds no version-skew risk. The function shipped in the same commit as `spelled` (ec4a7a0), which the file already imports, and it is not in `test_pinned_copy_text.py`'s `NEWER_THAN_A_KEPT_LIBRARY`.
  - The holder's shape-pin digests are written by `init`, so there is no static digest to move.
- **`tests/test_family.py`:** one new row, `test_the_gate_passes_on_a_stdout_that_cannot_hold_its_notes`. It runs the holder's gate with `PYTHONIOENCODING=latin-1` and expects exit 0, no traceback, and the two notes ending in `\u2026)`.
- **`tests/conftest.py`:**
  - The new helper, `skip_where_the_locale_does_not_spell_it_as_utf_8(text, premise)`, asks three questions, each through `os` at call time: whether `os.fsencode` can spell the text, whether it gives UTF-8's bytes, and whether `os.fsdecode` reads those bytes back as the text.
  - Four premise sentences go with it: `A_BYTE_READ_AS_A_SURROGATE`, `A_NAME_HELD_AS_UTF_8`, `PRINTED_AS_ITSELF` and `A_NAME_READ_AS_UTF_8`. Every skip reason is ASCII.
  - It is never asked inside `skip_where_a_name_cannot_be_not_utf_8`. A branch whose bytes are not UTF-8 is one in every locale, so those rows still judge under Latin-1, and this takes none of #1224's N1 over-skip.
- **The 11 files with guards** are the files of the table above that name a guard. Each guard sits just before the first line that needs its premise. `tests/test_family_head_by_hand_bytes.py` has none: its `if` is narrowed (N3).
- **`tests/test_non_utf8_name_helpers.py`** (the second commit): 20 rows hold `skip_where_the_locale_does_not_spell_it_as_utf_8` under emulated UTF-8, Latin-1 and ASCII (S2, above).
- **`tests/test_bootstrap_spelling.py`** (the second commit): the first-statement row takes `validate-family.py` as a third file (N1).
- **`tests/test_non_utf8_name_callers.py`:** `windows_names_it` now emulates Windows' `os.fsdecode` too (UTF-8 with `surrogatepass`, `windows_fsdecode`).
  - Without it, the bidi guard in `skip_where_this_system_cannot_name` asked this run's real Latin-1 `os.fsdecode` under an emulated Windows.
  - Measured: `test_where_windows_holds_a_bidi_override_the_name_check_does_not_skip` then failed under Latin-1 (1 failed, 35 passed), where it passes on main. With the emulation, the file gives 36 passed in both locales.
  - Real Windows reads UTF-8 in every locale, which is what that row's own reasoning ("NTFS holds U+202E, so the `bidi-override` row ... runs on Windows as it does here") assumes.

## Runs

**Environment.** One runner for every run: `/usr/bin/python3 -m pytest -p no:cacheprovider` (Python 3.12.3).
- A stub `gh` first on PATH, a bogus `GH_TOKEN` and an empty `GH_CONFIG_DIR`.
- `GIT_CONFIG_GLOBAL` an empty file, `GIT_CONFIG_NOSYSTEM=1`, the test identity, and `EMAIL` set.
- `GIT_ALLOW_PROTOCOL`, `GIT_SSH_COMMAND` and the `LANES_*` variables unset.
- **Every run counted here had git-filter-repo 2.47.0 on PATH** (`git filter-repo --version`: `a40bce548d2c`, CI's pin, pip-installed in a venv). An earlier pair of head runs without it skipped 58 adoption rows, and is not counted.
- That git-filter-repo's launcher is the pip one, with no `python -E`, so a test's own `PYTHONIOENCODING` reaches it. The `-E` comparison is the last paragraph of this section.

**Locales.**
- UTF-8: `LC_ALL=C.UTF-8`.
- Latin-1: built with `localedef -c`, as #1153's `test_adopt_one_byte_locale.py` builds one; then `LOCPATH`, `LC_ALL=en_US.ISO-8859-1`, `PYTHONUTF8=0`. Python reports `iso8859-1` and reads 0xFF as U+00FF.
- ASCII: `LC_ALL=C PYTHONUTF8=0 PYTHONCOERCECLOCALE=0`.

**Round one's gate** (the first commit, `c8641c691`, on main `bd3e9c148`, 27 files, F1214's runs): UTF-8 1520 passed and 1 skipped on main, 1521 and 1 on the head; Latin-1 123 failed, 1373 passed, 25 skipped on main, and 44 failed, 1404 passed, 74 skipped on the head. RV1258 re-ran it on 35 files (main `5926ccca`, merge `103ada82`) and got the same transitions. The gate below replaces it.

**The gate: 29 files, on a scratch merge.** The merge is this head (`cd9f3cfd1`) into `origin/main` `46fe6ac19` (local, never pushed, clean); the baseline is `46fe6ac19` itself. Both with the pip launcher.
- The 27 files of round one: the 23 files on main that use `skip_where_a_name_cannot_be_not_utf_8` or `on_a_branch_that_is_not_utf_8`, with `test_repo_hygiene.py` (W1196's 24, less the two files #1209 adds, plus `test_family_leg_path_by_hand_bytes.py`), and four more that run the changed code: `test_family.py`, `test_pinned_copy_text.py`, `test_update_shape_kept_helper.py` and `test_local_remote_dir_urls.py`. They include `test_non_utf8_name_helpers.py`.
- Two more for the second commit: `test_path_guard_hygiene.py` (the second hygiene file) and `test_bootstrap_spelling.py`.

| Run | main `46fe6ac19` | scratch merge with this head |
|---|---|---|
| 29 files, UTF-8 | 1873 passed, 1 skipped | 1895 passed, 1 skipped |
| 29 files, Latin-1 | 128 failed, 1721 passed, 25 skipped | 49 failed, 1775 passed, 72 skipped |
| the 50, UTF-8 | 50 passed | 50 passed |
| the 50, Latin-1 | 49 failed, 1 passed | **0 failed**, 5 passed, 45 skipped |
| the 50, Latin-1, `-E` launcher | 50 failed (on `bd3e9c148`, round one) | 1 failed, 4 passed, 45 skipped |

The 5 that pass under Latin-1 are the 3 tracking-branch rows (the tool fix), `test_a_utf8_source_directory_still_adopts_with_local_remotes` and `test_surrogateescape_reads_the_issues_branch_as_caf_and_u_dce9`.

Main moved twice while this was gated, none of its commits touching a file of the gate or of this PR. The merge was run again on each: on `9729315f1` the same 29 files, with identical outcomes by test id in both locales (1895 passed, 1 skipped; 49 failed, 1775 passed, 72 skipped); on `801a7d6d0` the 50 and the four files the second commit changes (`test_non_utf8_name_helpers.py`, `test_bootstrap_spelling.py`, `test_family_head_by_hand_bytes.py`, `test_adopt_template_values.py`). The 50 give the same as above in all three modes (UTF-8 50 passed; Latin-1 pip 0 failed, 5 passed, 45 skipped; Latin-1 `-E` 1 failed, 4 passed, 45 skipped), the four files give 385 passed under UTF-8, and 6 failed, 371 passed, 8 skipped under Latin-1: the 5 `test_bootstrap_spelling.py` rows and `test_execute_refuses_a_local_source_directory_that_is_not_utf8`, all of which fail on main too.

**By test id, from main to the scratch merge:**
- **UTF-8:** 22 new rows, all passed: the 20 of `test_non_utf8_name_helpers.py`, the `[validate-family]` row of the first-statement test, and the first commit's `test_the_gate_passes_on_a_stdout_that_cannot_hold_its_notes`. Nothing else changes: no new skip, no row from passed to failed. The one skip is `test_stdout_encoding.py`'s Windows default-stdout row, on both.
- **Latin-1:**
  - 0 rows from passed to failed.
  - 0 from passed to skipped. (The first commit had one, the S1 row; it passes now.)
  - 32 from failed to passed: the 3 tracking-branch rows and `test_surrogateescape_reads_the_issues_branch_as_caf_and_u_dce9` of the 50, and 28 other rows of `test_family.py` whose holder's gate ended in the same traceback.
  - 47 from failed to skipped: 45 of the 50, and the 2 bidi rows of `test_local_remote_dir_urls.py`, which share `BAD_DIRECTORIES`.
  - 22 new rows, passed.
  - Each of the 49 failures fails on main too: the rows #1209 settles, the rows under "Left", and 5 rows of `test_bootstrap_spelling.py` (see "Left").

**On a scratch merge with #1209** (main `46fe6ac19`, #1209 at `13a2c58cb`, then this head; local, never pushed, both merges clean). #1209 shares four files with this PR: `tests/conftest.py`, `tests/test_non_utf8_name_callers.py`, `tests/test_non_utf8_name_helpers.py` and `tests/test_stdout_encoding.py`. Run on 8 files: the three test files among those four, #1209's `test_adopt_plan_paths_spelled.py` and `test_run_script_encoding.py`, and `test_adopt_template_values.py`, `test_family_head_by_hand_bytes.py` and `test_bootstrap_spelling.py`. Against main plus #1209 alone:
- UTF-8: 483 passed and 1 skipped, then 504 passed and 1 skipped: the 21 new rows (the 20, and the `[validate-family]` row), nothing else.
- Latin-1: 19 failed, 411 passed, 54 skipped, then 5 failed, 433 passed, 67 skipped: 21 new rows passed, 1 failed to passed, 13 failed to skipped. The 5 failures are the `test_bootstrap_spelling.py` rows, which fail on both. Of the 50, the 15 in these files give 13 skipped and 2 passed, none failed.

**The other 59 test files that name `validate-family`** (round one, on the first commit, UTF-8): 3374 passed, 28 skipped, 0 failed. The second commit changes no tool.

**The same launcher started as `python -E`** (W1247's copy of it with `-E` added, used read-only), Latin-1, the 50: on main `bd3e9c148`, **50 failed**, the 50 exactly as #1214 lists them. On the first commit, 0 failed. On this head, **1 failed**, 4 passed, 45 skipped: the S1 row, `test_a_utf8_source_directory_still_adopts_with_local_remotes`, on #1247's traceback (`UnicodeEncodeError` on U+FFFD in `git_filter_repo.py`'s `_migrate_origin_to_heads`, then `REFUSED extracting the spec leg`). It stays red with that launcher until #1251 lands, and the other 49 rows are as with the pip launcher.

## The new rows, and mutants

Each mutant was made in a scratch worktree at the head and restored afterwards, with each file's sha256 checked. "UTF-8" and "Latin-1" name the locale of the run.

**The second commit's rows.** The helper's own rows run in CI's UTF-8 locale, with the three locales emulated.

| Mutant | Run | Result |
|---|---|---|
| none (the head), `test_non_utf8_name_helpers.py` | UTF-8 | 39 passed (19 before, 20 new) |
| the new rows against main's `tests/conftest.py`, which has no helper | UTF-8 | the file does not import: `cannot import name 'skip_where_the_locale_does_not_spell_it_as_utf_8'` |
| A5: the helper's UTF-8 bytes built with `surrogatepass` | UTF-8 | **3 failed**: the `byte-e9` row in each of the three locales. Before, the same mutant made 11 rows skip silently under UTF-8 and failed none (RV1258). |
| A1: the first question's skip taken as UTF-8's bytes | UTF-8 | **5 failed**: `iso8859-1` and `ascii` for `bidi-override` and `ellipsis`, and `ascii-e-acute` |
| A2: the second question dropped | UTF-8 | **1 failed**: `iso8859-1-e-acute` (it reads the bytes back and says "reads", not "writes") |
| A4: only the third question | UTF-8 | **6 failed**: the rows A1 and A2 fail, together |
| A3: the third question dropped | UTF-8 | **1 failed**: `iso8859-1-byte-e9` |
| A6: the third question inverted | UTF-8 | **9 failed** |
| the encoding in the reason named `utf-8` always | UTF-8 | **7 failed** |
| the row's premise left out of the first question's reason | UTF-8 | **5 failed** |
| the UTF-8 bytes built with `strict` | UTF-8 | **4 failed**: the three `byte-e9` rows, and the row that holds the emulation to the real locale |
| the second and third questions swapped | UTF-8 | **1 failed** |
| the first question catching any exception | UTF-8 | survives, and is equivalent: `os.fsencode` of a str raises only `UnicodeEncodeError` |
| D3: `validate-family.py`'s `escape_unencodable_stdout()` moved after `parse_args` | UTF-8 | **1 failed**: the `[validate-family]` row |
| main's `validate-family.py` under the head's tests | UTF-8 | **2 failed**: the `[validate-family]` row and `test_the_gate_passes_on_a_stdout_that_cannot_hold_its_notes` |
| N3's narrowed `if` taken out (main's `if`, with no helper call) | Latin-1 | **1 failed**: `test_surrogateescape_reads_the_issues_branch_as_caf_and_u_dce9` (it passes under UTF-8) |

On the 50 under Latin-1 the helper's mutants are as in round one, re-measured on this head: A3 gives **10 failed** (it was 11; the N3 row no longer asks the helper), the first question unguarded gives **11 failed**, and A1, A2 and A4 survive (5 passed, 45 skipped), because on Linux the third question alone decides there, as RV1258 found. Only the new rows tell them apart.

**The first commit's rows** (mutants made on `c8641c691`, which the second commit does not change):

| Mutant | Run | Result |
|---|---|---|
| none (the head), the new row of `test_family.py` | UTF-8 | 1 passed |
| main's `validate-family.py` under the head's tests (the new row on main) | UTF-8 | **1 failed**: the new row |
| `validate-family.py`'s `main` without the `escape_unencodable_stdout()` call (import kept) | Latin-1 | **4 failed**: the new row, and the `[add]`, `[bump]`, `[remove]` rows of `test_each_act_refuses_the_tracking_branch_then_lands_on_a_branch` |
| the bidi guard taken out of `skip_where_this_system_cannot_name` | Latin-1 | **6 failed**: the 4 bidi rows of `test_clone_url_bytes.py` and the 2 of `test_local_remote_dir_urls.py`, the same `BAD_DIRECTORIES` |
| `windows_names_it` without the `os.fsdecode` emulation | Latin-1 | **1 failed**: `test_where_windows_holds_a_bidi_override_the_name_check_does_not_skip` |
| the guard of `test_the_member_head_is_the_branch_git_wrote` asked of every branch (its `branch != NOT_UTF_8_BRANCH` dropped) | Latin-1 | `[not-utf8]` goes from passed (the head) to skipped; no row fails. A skip fails no run, so only a comparison of outcomes sees this one. |

## Merge-trees

`git merge-tree --write-tree` of the head (`cd9f3cfd1`):
- against `origin/main` `46fe6ac19`: clean;
- against #1209 `13a2c58cb`, #1185 `d193617c7`, #1154 `8a7828332`, #1251 `abeac66de` and #1198 `d38e4e36d`: each clean;
- against the other open PRs that touch any of these 18 files, at their heads: #1263 `9ef8f0ab5`, #1246 `0deac3a65`, #1231 `aca00dfd9`, #1227 `2d56c1906`, #1178 `c4beba193`, #1172 `2eabec8e0` and #1125 `9549006fe` are clean. #1201 `eac177af9` conflicts at `docs/handbook.html`, which this branch does not touch, and conflicts there against `origin/main` alone too.

#1209 changes `skip_where_a_name_cannot_be_not_utf_8` and the callers fixture `a_system_that_carries_the_byte`. The new helper sits more than 100 lines from the first, and `windows_names_it` 65 lines from the second. #1209 also edits `tests/test_non_utf8_name_helpers.py`, where the second commit adds its rows at the end of the file; the two merge without a conflict, and the merged file's rows pass (see "Runs").

## Left, and outside this issue

- **W1214's filter-repo defect is filed separately, as #1247**, and #1251 (a draft for it) is independent of this PR.
  - What W1214 found: `adopt-project.py execute` fails for a Latin-1 user whose source path holds U+00E9. The leg clone's `remote.origin.url` holds the byte 0xE9, git-filter-repo decodes it with `errors='replace'` and prints U+FFFD to a Latin-1 stdout, and `execute` stops at `REFUSED extracting the spec leg`.
  - **Which launcher runs git-filter-repo decides it.** One started as `python -E` ignores the `PYTHONIOENCODING` the tool gives its children; a pip-installed one, as CI installs it, is not started that way. Measured here (see "Runs"): `test_a_utf8_source_directory_still_adopts_with_local_remotes` passes on main under Latin-1 with the pip launcher, and fails there with a `-E` copy of the same launcher. W1196's list of 50 has this row failing, which this bench gives only with the `-E` launcher.
  - **Independent of #1251.** This PR no longer guards that row (RV1258's S1), so it carries nothing for #1251 to drop, and the earlier plan, that whichever of the two PRs lands second drops this PR's guard, is void. #1251 changes `_extract_leg` in `adopt-project.py` and adds `tests/test_adopt_filter_repo_origin_url.py`, and touches none of these 18 files (`git merge-tree` against its head `abeac66de` is clean). The row passes under Latin-1 with the pip launcher whichever lands first. With a `-E` launcher it fails on #1247's traceback until #1251 lands, which is the tool's failure showing, not a premise this PR can judge.
- **N2 (RV1258), known and left:** under emulated Windows codecs, the helper skips the U+DCE9 rows that carry no Windows mark, with a premise that is false on Windows. It is reasoned and emulated, not run on Windows; CI runs Linux only (#597).
- **5 rows of `tests/test_bootstrap_spelling.py` fail under Latin-1** on main, on this head and on the merge with #1209 alike. It is a file #1214 does not list, read from the failure messages only: four rows end in a `UnicodeEncodeError` on U+2028, which Latin-1 cannot encode, and `test_a_branch_name_is_spelled_in_every_line_that_names_it` fails its assertion. They are left for an issue of their own.
- **8 rows in two files #1214 does not list fail under Latin-1** on main, on this head and on the merge with #1209 alike:
  - 6 rows of `test_pinned_copy_text.py`: the tool prints U+2014 or U+2026 escaped on a Latin-1 stdout, and the row compares the character.
  - `test_family.py`'s `test_init_writes_the_holders_agent_files`: it reads the UTF-8 file it checks in the locale's encoding.
  - `test_family.py`'s `test_commit_one_refuses_a_trailer_that_is_no_text_before_it_stages`: `DID NOT RAISE Refusal`, a byte Latin-1 reads as text.
  - These are read from their failure messages only, not classified per test. They are left for an issue of their own.
- **The fourth row of `tests/test_adopt_template_values.py` that fails under Latin-1 on main** is `test_execute_refuses_a_local_source_directory_that_is_not_utf8`. It is not one of the 50, and this PR leaves it alone.
  - It asks `skip_where_a_name_cannot_be_not_utf_8`, and #1209 gives that helper the locale question. So it skips at #1209's head, where the 50 were counted, and it skips on the scratch merge with #1209.
  - It fails on main and on this head alike, so it is #1196's (#1209's) row, not #1214's.
  - The other three rows of that file that fail on main are among the 50: the two U+DCE9 flag rows and `test_plan_and_check_say_the_same_sentence`. Each skips here.
- **#1224 is untouched.** This helper takes none of N1's over-skip; N2 to N5 stay #1224's.

Closes #1214

Lane: openreposhape-4 (openRepoShape-4)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
brettheap and others added 3 commits November 9, 2026 14:05
The one conflict, tests/test_adopt_plan_paths_spelled.py (add/add), is taken from this branch (--ours); #1154's own files are the same in its final head and its squash, so this merge changes no file.
brettheap added a commit that referenced this pull request Nov 10, 2026
…`family-holder-already-here` say the branch their lines run on, and that `add` line is `_cited`, so each runs as printed from the tracking branch (#1228) (#1264)

**#1228: every `add`, `bump` and `remove` line that a `family.py` remedy prints says the branch it runs on, whichever route reached the refusal. The dry runs of `add` and `bump` that end in `member-duplicate-id`, and the `family-holder-already-here` that `init` ends in, now say it as #1201 makes `member-unknown` and `member-already-present` say it, and that `add` line is `_cited`. rv1201's one surviving mutant of #1201's rows, R5, is killed.**

**Built on #1201 at `eac177af` (itself on #1117 at `219e57c2`). Both have landed, and this PR is restacked on `main`** (#1117 as `9252ef208`, #1201 as `8cf6477fe`; see "Restacked after #1201 landed"). Its change is two commits: `b54520cea` (5 files, 442 insertions and 57 deletions) and the review round's `43d2e8b26`, 5 files, 503 insertions and 64 deletions in all (`git diff --stat eac177a 43d2e8b`). Against main `370a23cd2`, the restacked head `54b9cb20a` gives the same 5 files, the same lines and the same patch-id. It answers lane 5's review of #1201 (issuecomment-6372152028): SHOULD-1's optional code fix, and NIT-1 to NIT-3.

At `eac177af9`, as rv1201 measured it (probes p6, p7, p9) and as this PR's rows show failing there (below), three printed lines were reached with no branch read, named none, and were refused `family-on-tracking-branch` when typed where a fresh clone stands:

- **(a) `add --dry-run`'s `member-duplicate-id`.** Under `--dry-run`, `cmd_add` skips `_checked_branch` and still asks `_checked_member_id`. Its remedy printed a `remove` line and a `bump` line and no branch.
- **(b) `bump --dry-run`'s `member-duplicate-id`.** `_bump_dry_run` asks `_checked_bumped_id` before anything reads the branch. Its remedy printed a `remove` line and no branch.
- **(c) `init`'s `family-holder-already-here`.** Its remedy printed `_add_command`'s line between plain backticks: no branch clause, and not through `_cited`, so under a folder named with a backtick the first span ended at the path's backtick (RV1117's N6 shape).

- **`scripts/family.py`, (a) and (b).** `_checked_member_id` and `_checked_bumped_id` take a keyword-only `dry_run`, false by default. `cmd_add` passes `args.dry_run`, and `_bump_dry_run` passes true. The real runs' calls (`_mount_and_pin`, and `cmd_bump`'s) are unchanged, and so are their words. Set, the remedy puts `_off_the_tracking_branch` before its line or lines and ends with `BRANCH_LEFT`, as `member-already-present` does. The clause names "`bump` and `remove` refuse" for (a), whose remedy names both lines, and "`remove` refuses" for (b). Its `switch -c` names `family/remove-<id>`, the branch the `remove` line's own refusal names, so the clause and the refusal after it agree.
- **`scripts/family.py`, (c).** The remedy now says the clause with `init`'s own `git -C <holder> switch -c family/add-<Project>`, then the `add` through `_cited`, then `BRANCH_LEFT`. The issue left the branch word to the owner. This PR takes `family/add-<Project>`, bare, as the NEXT STEPS block prints it: quoted, it would read as a value.
  - Two helpers carry it. `_add_branch_switch` spells that `switch -c` line, and NEXT STEPS now calls it too, with the same bytes as before. `_branch_clause` holds the clause's words around a `switch -c` line already spelled, and `_off_the_tracking_branch` now calls it.
  - The code comments at the two `member-duplicate-id` asks and `_off_the_tracking_branch`'s docstring now say that a dry run states the refusal before the branch is read, and a real run after it.
- **`tests/test_readme_windows_quoting_sentence.py`.** `NAMED` moves one host-quoter call from `_print_next_steps` to `_add_branch_switch`, and `FAMILY_LINES` moves the `switch -c` kind with it. README's sentence already lists `switch -c`, so README.md and `docs/handbook.html` are unchanged. The changed remedies' words appear in no doc. The release notes name `member-duplicate-id` as a code (v1.0.0) and the `family/add-<Project>` spelling (v1.1.0). AGENTS.md and `templates/family-root/` show `git -C <path> switch -c family/add-<Project>` as NEXT STEPS print it. None of that changes.
- **`tests/test_family_remedy_lines.py`.** The new rows type each line as printed from the tracking branch. Typed alone, each line is refused `family-on-tracking-branch`. Typed after the clause's `switch -c`, it exits 0, and the holder is clean and its gate green:
  - (a): `test_add_dry_runs_duplicate_id_lines_run_from_the_tracking_branch`, `[remove]` and `[bump]`;
  - (b): `test_bump_dry_runs_duplicate_id_remove_runs_from_the_tracking_branch`;
  - (c): `test_init_holder_already_heres_add_runs_as_printed_after_its_switch`, `[plain]` and ``[a`b]``.
  - **NIT-1:** `test_a_rows_name_with_a_space_is_one_word_in_both_lines` now asserts the `switch -c` line, `family/bump-irrs`, which is built from the row's `id:`. That kills R5, which builds it from the name and gets `family/bump-member`.
  - **NIT-2:** `typed()`'s docstring says that it asserts the interpreter's name and does not look it up on PATH.
- **`tests/test_family_bump_to_checks.py`.** Its two `member-duplicate-id` rows used to assert that both runs print the same words. They now pin the real run's words as at `eac177af9` and the dry run's with the clause (`both_refused`, `duplicate_id_refusal(dry_run=True)`).
- **`tests/test_family_dry_run.py`.** `duplicate-id` leaves the parametrized "same under `--dry-run`" row and gets a row of its own, `test_add_dry_runs_duplicate_id_names_the_branch_the_real_run_has_read`. It pins the same code, detail, stdout and exit for both runs, and the dry run's remedy as the real one with the clause added and `BRANCH_LEFT` at the end.
- **NIT-3 is left.** `member-already-present` still suggests `family/bump-<id>` for both of its lines. (a)'s clause likewise names one branch, `family/remove-<id>`, for both its `remove` and its `bump`. Either branch works for both verbs, since anything but the tracking branch does.

rv1264 (opus) found this PR READY at `b54520cea` with two NITs (issuecomment-6724775227). The round's commit, `43d2e8b26`, is the PR's second: 2 files, 67 insertions and 13 deletions (`git diff --stat b54520c 43d2e8b`), `scripts/family.py` and `tests/test_family_remedy_lines.py`. With both commits the change is 5 files, 503 insertions and 64 deletions (`git diff --stat eac177a 43d2e8b`). The Goal, `What held on #1201's head`, `What changed` and `Rows that fail on #1201's head` describe `b54520cea`, the first commit. Mutants, Runs, Merge-trees and one bullet of Limits are read again at `43d2e8b26`.

- **NIT-1: the fourth bare `"Remediation: "`.** SonarCloud reported it on this PR as python:S1192 (key `AaG7-FM2kL7yTWvgodeV`): the (c) hunk's `"Remediation: "` at `scripts/family.py:2530` was a fourth copy of that literal after #1201's three (`:1713`, `:6577`, `:9497`). `_landing` now builds the clause first, ``clause = _branch_clause(_add_branch_switch(into / family), "`add` refuses")``, and the third argument of the `Refusal` starts `f"Remediation: {clause}"`. #1201's three are untouched, and `grep -n '"Remediation: "' scripts/family.py` lists exactly those three. SonarCloud's analysis of `43d2e8b26` is not read here.
  - **The refusal's words are byte for byte what they were.** A probe (`probe/remedy.sh`) ran `init` over a family folder that already holds its holder, once with `b54520cea`'s `family.py` and once with this commit's, swapped into the same detached tree, from the same working directory and by the same script path, for a plain folder and for one named ``a`b``. The two refusal lines (the `REFUSED` line and the remediation) are identical under `cmp`: plain 1156 bytes, ``a`b`` 1148 bytes, each with exit 2 and an empty stdout. The swapped run printed one `WARNING ... DIRTY` line before them, which the swap itself caused (it dirtied that tree); the file was restored with its sha256 checked (`88ad8766f4e2...`) and `git status` clean.
  - **The rows that pin the text pass.** `test_init_holder_already_heres_add_runs_as_printed_after_its_switch[plain]` and ``[a`b]`` compare the remediation with the expected words and pass at `43d2e8b26` (gate A, below), on git 2.43.0 and 2.47.1.
- **NIT-2: M10a and M10b are killed.** They survived because every fixture row's `id:` is its name lowercased, so a branch built from the name is the same word. Two rows in `tests/test_family_remedy_lines.py`, after (a) and (b)'s dry-run rows, rename a row by hand to a valid name that is not its id, and assert the clause's `switch -c` line as printed:
  - `test_add_dry_runs_clause_branch_is_made_from_the_rows_id`: `IRRS` renamed `Orrs`. `add --dry-run` of `IRRS2` is refused `member-duplicate-id`, and the clause names `family/remove-irrs`, not `family/remove-orrs`.
  - `test_bump_dry_runs_clause_branch_is_made_from_the_other_rows_id`: `IRSS` renamed `Osss`. `bump --dry-run` of `IRRS` to the commit whose `project.yaml` records `irss` is refused the same way, and the clause names `family/remove-irss`, not `family/remove-osss`.
  - The hand edit of the row's `project:` line is a helper, `renamed_by_hand(holder, project, name)`, which the ``IR RS`` row (RV1201's NIT-1) now calls too, so it is written once. That row's asserts are unchanged.
  - **Each row fails on its mutant and passes at the head.** M10a alone fails the first row and only that row (`family/remove-orrs` against `family/remove-irrs`), and M10b alone fails the second row and only that row (`family/remove-osss` against `family/remove-irss`): 1 failed, 18 passed in each run of the file's 19 ids. `scripts/family.py` came back to sha256 `b7f0d8c5f2db...` after each, with `git status` clean.
  - **Both rows fail on #1201's production code.** With `eac177af9`'s `family.py` (sha256 `b8199379c23f...`) swapped in under this commit's tests, in the same detached tree: 2 failed, each on `[] == [the switch line]`, since #1201's dry runs print no clause. Restored (sha256 `b7f0d8c5f2db...`), `git status` clean.

#1201 landed as the squash `8cf6477fe`. Its final head was `d1ecf815`, a fast refresh of `24b6a0af`. #1117 had landed before it, as `9252ef208`, and #1201's head already carried #1117's final head, its squash and main (`85909e973`, `24b6a0af6`, `d1ecf8159`), so the first step of the restack plan this body named on 2026-11-08 was #1201's own. Once #1201's branch was deleted, GitHub retargeted this PR to `main`, where it was CONFLICTING. The restack is three merges on top of `43d2e8b26`, with no rebase, amend or force:

| step | merged | commit | result |
|---|---|---|---|
| 1 | #1201's final head `d1ecf815` | `5b5e652a9` | clean; tree `913e2e4b5`, as `git merge-tree` predicted |
| 2 | #1201's squash `8cf6477fe` | `db82ce1d4` | 21 blocks in 4 files, all #1201's own, each resolved to this branch's side; the tree stays `913e2e4b5` |
| 3 | main `370a23cd2` (#1164) | `54b9cb20a` | clean, no block to resolve; tree `245b4d057`, as `git merge-tree` predicted on git 2.43.0 and 2.47.1 |

- **Step 2's resolutions.** The 21 blocks are 7 in `scripts/family.py`, 2 in `tests/test_family_bump_to_checks.py`, 10 in `tests/test_family_remedy_lines.py` (add/add) and 2 in `tests/test_readme_windows_quoting_sentence.py`. All four are files of #1201's squash. Each block takes this branch's side, because that side already holds all of #1201: step 1 merged `d1ecf815`, and the squash's tree is `d1ecf815`'s tree (`4daf6ffbc` both). So the merge changed no file (`git diff 5b5e652 db82ce1` is empty). The blocks arise only because the squash has another history, so git meets #1201's lines from both parents.
- **Step 3.** Main was still the squash itself when steps 1 and 2 were made, so step 3 was first a no-op. #1164 (for #1110, lane 1's) landed after, as `370a23cd2`. It changes `scripts/family.py` (121 insertions, 19 deletions), `templates/family-root/scripts/siblings.py`, `tests/test_family_gitmodules_unreadable.py` (new) and `tests/test_path_guard_hygiene.py`. Git merged `scripts/family.py` by itself, and no block needed a resolution:
  - #1164's hunks are the `.gitmodules` readers (`_gitmodules_on_disk`, `_gitmodules_names`, `_sections_giving`, `_stages_as`), `PinRollback`, and two new constants. None is one of this PR's functions.
  - #1164 gives `_stages_as` a third argument, and nothing in this PR calls it.
  - `gitmodules-unreadable`'s remedy names no `add`, `bump` or `remove` line, so #1228's rule does not reach it.
  - Main's side arrives whole: `git diff db82ce1 54b9cb2` has #1164's own patch-id (`6e4840bd5eb9` stable, `f7efc1a3949e` verbatim, as `git diff 8cf6477 370a23c` has).
- **The diff is the reviewed one.** The PR's diff against main is rv1264b's reviewed change, `eac177af9..43d2e8b`, line for line:

| diff | files | lines | `git patch-id --stable` | `--verbatim` |
|---|---|---|---|---|
| reviewed, `git diff eac177a 43d2e8b` | 5 | +503/-64 | `1b6607fb4fb6` | `cd18d2c2923a` |
| restacked, `git diff 370a23c 54b9cb2` | 5 | +503/-64 | `1b6607fb4fb6` | `cd18d2c2923a` |

  - Per file, both ids match for each of the five: `scripts/family.py` `c7ba1df7d359`/`5493f2e74dc9`, `tests/test_family_bump_to_checks.py` `aae56e7a6cc6`/`1f54d542931a`, `tests/test_family_dry_run.py` `b616211c203d`/`9e7124f21c75`, `tests/test_family_remedy_lines.py` `1820a6895cf4`/`9f3e05c13738`, `tests/test_readme_windows_quoting_sentence.py` `dc8eb3e39264`/`1d81e0e45ca9`. The same ids come out of git 2.43.0 and 2.47.1.
  - The four test files have the same blobs on both sides of both diffs.
  - `scripts/family.py`'s pre-image is main's, so its hunks start later by the lines main added above them: 6 lines (#1166's `105b5daf9`, for #1139) up to `cmd_add`, and 89 from `_checked_bumped_id` on (46 more from #1098's `ac5f28d2a`, for #1086, 37 from #1164). With the `index` lines and the hunk line numbers masked, the two diffs are byte-identical (888 lines); unmasked, they differ in 34 lines, all `index` and `@@` lines.
  - No hunk differs, so no file's patch-id changed, and no resolution in the three merges touched this PR's lines.
- **The PR lists 12 commits now.** A squash does not carry its branch's commits by ancestry, so GitHub also lists #1117's and #1201's own commits (`10dc011c9`, `eac177af9`, `219e57c28`, `8cb9c729a`, `85909e973`, `24b6a0af6`, `d1ecf8159`) beside this PR's two and its three merges. Its diff is the 5 files above.

The commit's new and changed rows (73 ids: the 5 new `test_family_remedy_lines.py` ids and the NIT-1 row, the 2 `test_family_bump_to_checks.py` rows, `test_family_dry_run.py`'s new row and the 18 ids of its parametrized row, and the 46 ids of `test_readme_windows_quoting_sentence.py`) were run with `eac177af9`'s `scripts/family.py` (sha256 `b8199379c23f...`) swapped in under this commit's tests, in a second worktree. The file was restored after the run and its sha256 checked: `88ad8766f4e2...`, matching, with `git status` clean. Result: **9 failed, 64 passed**, every failure an `AssertionError` on the remedy text:

| row | on `eac177af9`'s `family.py` |
|---|---|
| (a) `[remove]`, `[bump]` | fail: the remedy ends "...not in the family." with no clause and no `BRANCH_LEFT` |
| (b) | fail, the same way |
| (c) `[plain]`, ``[a`b]`` | fail: the remedy ends "There is no --force." with no clause |
| `test_family_dry_run.py`'s new row | fail, as (a) |
| the 2 `test_family_bump_to_checks.py` rows | fail on the dry run's assert; the real run's assert just before it passes, so the real run's words are unchanged |
| `NAMED[scripts/family.py]` | fail: there is no `_add_branch_switch` |
| the NIT-1 row, the 18 parametrized ids, the other 45 sentence ids | pass, as they should: #1201 already builds the branch from the `id:` (the assert kills R5, below), and the rest pin unchanged behaviour |

Each was applied alone in the second worktree at `b54520cea` (clean), run through lane 5's runner, and restored, with the sha256 of every touched file checked and `git status` clean after each. The #1228 mutants ran against all 73 ids above (84 with the rest of `test_family_remedy_lines.py`); M8 also ran against `tests/test_git_bash_dialect.py` and `tests/test_family_switch_branch_exists.py`, which read NEXT STEPS.

| id | mutation | result |
|---|---|---|
| M1 | (a)'s clause dropped | killed, 3: (a) `[remove]`, `[bump]`, `test_family_dry_run.py`'s new row |
| M2 | (b)'s clause dropped | killed, 3: (b), the 2 `test_family_bump_to_checks.py` rows |
| M3 | (c)'s clause dropped | killed, 2: (c) `[plain]`, ``[a`b]`` |
| M4a | `dry_run` ignored in `add` (always false) | killed, 3, as M1 |
| M4b | `dry_run` ignored in `bump` (always false) | killed, 3, as M2 |
| M5 | (c) without `_cited`: the `add` between plain backticks | killed, 1: (c) ``[a`b]`` |
| M6 | (a)'s branch is `bump`'s, not `remove`'s | killed, 3, as M1 |
| M7 | (a) without `BRANCH_LEFT` | killed, 3, as M1 |
| M8 | (c)'s placeholder branch quoted for the shell | killed, 2: (c) both; the two NEXT STEPS files pass (the shell reads the quoted word the same) |
| M9 | (c) without `BRANCH_LEFT` | killed, 2: (c) both |
| M10a | (a)'s branch from the row's name, not its `id:` | **killed**, 1: `test_add_dry_runs_clause_branch_is_made_from_the_rows_id` (it survived at `b54520cea`, 84 passed) |
| M10b | (b)'s branch from the row's name, not its `id:` | **killed**, 1: `test_bump_dry_runs_clause_branch_is_made_from_the_other_rows_id` (it survived at `b54520cea`, 84 passed) |
| M11 | (a)'s `dry_run` inverted: the real run gets the clause | killed, 3, as M1 |
| M12 | (c)'s `switch -c` names `--into`, not the holder | killed, 2: (c) both |
| M14 | (a)'s clause names one verb, "`remove` refuses" | killed, 3, as M1 |
| M15 | `_branch_clause` prints its `switch -c` bare | killed, 11, across every clause row |
| M3b | NIT-1's `f"Remediation: {clause}"` without its clause | killed, 2: (c) `[plain]`, ``[a`b]`` |
| R1 | rv1201's: `_cited` always prints the command bare | killed, 15 of the file's 17 |
| R2 | rv1201's: the typed owner is the first path segment | killed, 6 |
| R3 | rv1201's: `_family_line` quotes for `sh` on every host | killed, `NAMED[scripts/family.py]` |
| R4 | rv1201's: `member-already-present` loses its clause | killed, 4 |
| R5 | rv1201's: `member-already-present`'s branch from the name | **killed** by NIT-1's assert, `test_a_rows_name_with_a_space_is_one_word_in_both_lines` (it survived at `eac177af9`) |
| R6 | rv1201's: `member-already-present` names the typed project | killed, 4 (3 in `test_family.py`) |
| R7 | rv1201's: README and the handbook drop `cd` from the sentence | killed, `test_the_kinds_of_family_lines_are_the_ones_the_sentence_lists` |

M1 to M9 are n1228's, and they cover the issue's list: the clause dropped from each of (a), (b) and (c), `dry_run` ignored, and `_cited` dropped from (c). M10a to M15 are the first commit's own, and M3b the second's. R1 to R7 are rv1201's again: R1 to R6 against `test_family_remedy_lines.py`, with R6 also against `test_family.py`'s spelling row, and R3 and R7 against the sentence file. `scripts/family.py` came back to sha256 `88ad8766f4e2...` after each run, README.md to `71d9fecafbd6...` and `docs/handbook.html` to `1d01f0823e60...` after R7, and `git status` was clean after the last one. At `43d2e8b26`, M10a, M10b and M3b each ran alone in the same detached tree, clean at that commit, over `tests/test_family_remedy_lines.py`'s 19 ids (1 failed and 18 passed, 1 failed and 18 passed, 2 failed and 17 passed), with `scripts/family.py` back to sha256 `b7f0d8c5f2db...` after each and `git status` clean after the last. The other rows' results are those of `b54520cea`, which rv1264 re-ran and matched.

### At the restacked head `54b9cb20a` (after #1201 landed)

All through lane 5's `run10.sh`, in the environment the next section names. Every `START` line reads `head=54b9cb20ac18be672fedad4f69e648f97a85e4e8` and `dirty=0`, on Python 3.12.3, with git-filter-repo 2.47.0 (CI's pin) on PATH. Each run held at most 100 ids, taken from a fresh collect at the head. The 2.47.1 runs put lane 5's git 2.47.1 first on PATH, and each log's first line reads `git version 2.47.1`.

- **The gate** (32 files, 1712 ids, 18 runs on each git):
  - this PR's four test files;
  - every file that names `family.py`'s remedy lines or the codes and functions this PR changes, and `test_windows_paths.py` for the family landing: `test_bump_remedies_family_root.py`, `test_remove_add_remedies_family_root.py`, `test_family.py`, `test_family_add_member_id.py`, `test_family_printed_quoting.py`, `test_family_init_landing.py`, `test_family_init_values.py`, `test_family_members_not_a_list.py`, `test_family_bump_to_a_tag.py`, `test_family_switch_branch_exists.py`, `test_family_tracking_branch.py`, `test_git_bash_dialect.py`, `test_branch_left_bump_leg_setup.py`, `test_bump_leg_paste_lines.py`, `test_dry_run_parity.py`, `test_windows_paths.py`, and the `test_validate_family_*` five (`branch_step`, `duplicates`, `remedies_typed`, `typed_states`, `unnamed_mounts`);
  - the hygiene five (`test_repo_hygiene.py`, `test_agents_md_codes.py`, `test_cli_reference.py`, `test_pinned_copy_text.py`, `test_path_guard_hygiene.py`) and `tests/test_no_auto_maintenance.py`;
  - and #1164's new `tests/test_family_gitmodules_unreadable.py`.
- **#1164's `family.py` files** (2 files, 106 ids, 2 runs on each git): `tests/test_family_py_unreadable.py` and `tests/test_family_bump_remove_rollback.py`. #1164's own gate ran them for the `family.py` code it changes, so main's side is shown to hold on the merged tree.

| run | git | result | logs |
|---|---|---|---|
| the gate, 1712 ids in 18 runs | 2.43.0 | **1691 passed, 21 skipped**, none failed (1056.2s in all) | `work/n1228g/logs/g243-gate-part-00.log` to `-17.log` |
| the gate, 1712 ids in 18 runs | 2.47.1 | **1691 passed, 21 skipped**, none failed (1047.2s in all) | `work/n1228g/logs/g2471-gate-part-00.log` to `-17.log` |
| #1164's two `family.py` files, 106 ids in 2 runs | 2.43.0 | **106 passed** (99.6s) | `work/n1228g/logs/g243-extra-part-00.log`, `-01.log` |
| #1164's two `family.py` files, 106 ids in 2 runs | 2.47.1 | **106 passed** (98.1s) | `work/n1228g/logs/g2471-extra-part-00.log`, `-01.log` |

- **The 21 skips are the same on both gits:**
  - 16 at `tests/test_family_init_values.py:229`: "this template quotes the placeholder: the run is fine, and test_a_quoted_value_is_held_as_typed runs it";
  - 3 at `tests/test_family_init_values.py:301`: "this template quotes `id:`: the derived id reads back";
  - 2 at `tests/test_no_auto_maintenance.py:222`: "the session began with GIT_CONFIG_GLOBAL set, and its file includes that one" (the runner sets `GIT_CONFIG_GLOBAL=/dev/null`).
- **No run failed, and none was run again.** `tests/test_family_dry_run.py::test_bump_dry_run_of_a_repair_to_the_pinned_commit_is_a_move[digest]`, which failed once before the restack (see Limits), passed on both gits. The full suite was not run.

### Before the restack (`b54520cea` and `43d2e8b26`)

All through lane 5's `run10.sh`: a `gh` stub first on PATH, `GH_TOKEN` bogus, an empty `GH_CONFIG_DIR`, a blank git identity, `GIT_SSH_COMMAND=false`, `GIT_CONFIG_GLOBAL=/dev/null`, `EMAIL` exported, and git-filter-repo 2.47.0 (CI's pin) on PATH. Every `START` line reads `head=b54520cea716b44df1a95139a46901a478d616fd` and `dirty=0`, with three exceptions. The swapped run and each mutant read `dirty=1`, the one file changed, except R7, which changes two and reads `dirty=2`. The predicted merge's run names its own head. Python 3.12. The second commit's runs, marked in the table, read `head=43d2e8b26...` and `dirty=0`, except the mutants' and the swapped runs, which read `dirty=1`, and the pre-commit run of the new rows, which read `head=b54520cea...` and `dirty=2`.

- **Gate A** (13 files): the issue's eight (`test_family_remedy_lines.py`, `test_readme_windows_quoting_sentence.py`, `test_remove_add_remedies_family_root.py`, `test_bump_remedies_family_root.py`, `test_family.py`, `test_family_add_member_id.py`, `test_family_bump_to_checks.py`, `test_family_printed_quoting.py`), `test_family_dry_run.py`, which this commit changes, and four of the hygiene five (`test_repo_hygiene.py`, `test_agents_md_codes.py`, `test_cli_reference.py`, `test_pinned_copy_text.py`). The fifth, `test_path_guard_hygiene.py`, is not at this head. #1201 sits on #1117's older head `10dc011c9`, whose base `6da757cbe` predates #1111. #1117's current head, `219e57c28`, has it from its merge of main. It runs on the predicted merge instead.
- **Gate B** (9 files), which name the changed functions and codes: `test_family_init_landing.py`, `test_git_bash_dialect.py`, `test_family_switch_branch_exists.py`, `test_family_tracking_branch.py`, `test_validate_family_branch_step.py`, `test_validate_family_remedies_typed.py`, `test_validate_family_duplicates.py`, `test_family_members_not_a_list.py`, `test_family_bump_to_a_tag.py`.

| run | git | result | log |
|---|---|---|---|
| the commit's new and changed rows (73 ids) | 2.43.0 | **73 passed** in 69.23s | `logs/rows.log` |
| the same 73 ids, `eac177af9`'s `family.py` swapped in | 2.43.0 | **9 failed, 64 passed** (above) | `logs/baserows.log` |
| gate A | 2.43.0 | 1 failed, 662 passed in 413.56s (the one failure is in Limits) | `logs/gateA243.log` |
| gate A again | 2.43.0 | **663 passed** in 509.19s | `logs/gateA243b.log` |
| gate A | 2.47.1 | **663 passed** in 421.81s | `logs/gateA247.log` |
| gate B | 2.43.0 | **389 passed** in 261.02s | `logs/gateB243.log` |
| gate B | 2.47.1 | **389 passed** in 340.68s | `logs/gateB247.log` |
| gate A, gate B and `test_path_guard_hygiene.py` (23 files) on the predicted merge, scratch commit `e22074def` (below), `head=e22074def...` | 2.43.0 | **1174 passed** in 790.16s | `logs/merged243.log` |
| the row that failed once, alone, 10 runs of its 2 ids | 2.43.0 | **20 of 20 passed** | `logs/rep-head243-*.log` |
| *The review round, `43d2e8b26`:* the two new rows and the ``IR RS`` row, before the commit (tree dirty) | 2.43.0 | **3 passed**, 16 deselected in 7.50s | `work/n1228e/logs/newrows-head.log` |
| the two new rows, `eac177af9`'s `family.py` swapped in | 2.43.0 | **2 failed**, 17 deselected | `work/n1228e/logs/newrows-on-eac177af9.log` |
| M10a, M10b, M3b, each alone, over `tests/test_family_remedy_lines.py` | 2.43.0 | 1 failed 18 passed; 1 failed 18 passed; 2 failed 17 passed | `work/n1228e/logs/mut-*.log` |
| gate A (13 files), the head | 2.43.0 | **665 passed in 379.55s** | `work/n1228e/logs/gateA243.log` |
| gate A (13 files), the head | 2.47.1 | **665 passed in 372.06s** | `work/n1228e/logs/gateA247.log` |
| gate A and `tests/test_path_guard_hygiene.py` (14 files) on the predicted restack, scratch commit `f168938c4`, `head=f168938c4...` | 2.43.0 | **787 passed in 401.58s** | `work/n1228e/logs/restack243.log` |
| `tests/test_family_init_landing.py`, the file of `family-holder-already-here`'s detail | 2.43.0 | **19 passed in 8.34s** | `work/n1228e/logs/init-landing243.log` |

The 2.47.1 runs put lane 5's git 2.47.1 first on PATH, and each log's first line reads `git version 2.47.1`. No run had a skip. The full suite was not run. Gate A of the second commit is 665 ids, the first commit's 663 and the two new rows; git-filter-repo 2.47.0 (CI's pin) was on PATH in every run. `tests/test_path_guard_hygiene.py` is still not at this head (see Gate A above), so gate B (the first commit's 9 files) was not run on the second commit, which the brief did not ask for. It changes `_landing`'s remedy and one test file only.

Read on 2026-11-09 at 23:00:17Z, after fetching main at `370a23cd2`, with every open PR's head read from `gh pr list` (38 open). Of them, one other touches this PR's five files: #1274 (`scripts/family.py`). The results are the same on git 2.43.0 and 2.47.1.

| `git merge-tree --write-tree <other> 54b9cb2` | exit | result |
|---|---|---|
| main, `370a23cd2` | 0 | clean, tree `245b4d057fef`: the restacked head's own tree, since main is its parent |
| #1274, `136b38d12` | 0 | clean, tree `907bfe588d05` (with main: clean, `cdbdd63151f0`) |

- **The other 36 open PRs merge with this head as they merge with main.** Each head was merged with `54b9cb20a` and with `370a23cd2`. 34 are clean both ways. #1209 conflicts both ways in `tests/test_adopt_plan_paths_spelled.py`, and #1237 in `adopt-project.py` and `tests/test_adopt_check_throwaway_repos.py`. Neither is one of this PR's files, so neither conflict is this PR's.
- **The restack plan this body named on 2026-11-08 is done.** #1117 landed as `9252ef208` and #1201 as `8cf6477fe`, and #1201's head had taken #1117's three merges. This branch took #1201's three ("Restacked after #1201 landed"). Read from `gh pr view` after the push, at 23:21:05Z: the base is `main`, GitHub gives the PR as MERGEABLE with 5 files and 12 commits, and `closingIssuesReferences` lists #1228 only.
- **Before the restack,** on 2026-11-08 at about 17:55Z, `43d2e8b26` merged cleanly with #1201's and #1117's heads, and conflicted with main and with #1164's head only in `docs/handbook.html`, the stack's conflict, which #1117's head mended (`work/n1228e/logs/merge-trees-2.log`). The predicted restack on main `9729315f1` (scratch commit `f168938c4`) was clean, and its gate passed (787 passed, in Runs).

- **The clause's branch is built from the row's `id:`, and two rows now tell it from the name** (mutants M10a and M10b, killed since `43d2e8b26`; see the review round). Every other fixture row's id is its project lowercased, so only a row renamed by hand tells them apart. The old gap was harmless in effect, as rv1201 found for R5: the clause's `switch -c` need only leave the tracking branch.
- **NIT-3 is left** (above). It is the same question as (a)'s one branch for two verbs.
- **The interpreter is asserted, not looked up** (NIT-2). The docstring says so. rv1201 typed the lines through bash, dash and zsh with `python3` from PATH, 12 of 12.
- **The clause says "a branch other than the tracking branch".** It is worded to be true on any branch, as #1201's is, since a dry run says the refusal before the branch is read. A person already off the tracking branch reads a clause that does not apply to them.
- **`init`'s `<Project>` stays a placeholder** in the clause's `switch -c`, as NEXT STEPS print it. `add`'s own refusal names the branch lowercased; any spelling works.
- **One row failed once, in code this commit does not touch.** In the first gate A on 2.43, `tests/test_family_dry_run.py::test_bump_dry_run_of_a_repair_to_the_pinned_commit_is_a_move[digest]` failed:
  - **What it saw.** The dry run said it would commit the repair. The real run then said `nothing to do: InkRouter/IRRS is already pinned at ab0fea7e32a2 and every fact agrees.` and exited 1.
  - **Where that is decided.** The real run's answer comes from `_nothing_to_record`, a `git diff --quiet HEAD` made after `write_lf` rewrites `family.yaml` in place. The row's hand edit keeps the file's size.
  - **The commit leaves that path alone.** It changes no code of `_nothing_to_record`, `_rewrite_members`, `force_stage` or `tree_digest`. Its only `tree_digest` lines are one sentence of `_bump_dry_run`'s docstring, rewrapped. The row has no duplicate id, so the `dry_run` flag in `_checked_bumped_id` never shows.
  - **Every other run passed it:** the second gate A on 2.43, gate A on 2.47.1, the predicted merge's run, and 20 of 20 runs alone.
  - **The cause is not found.** A probe of the plain race (a same-size, in-place rewrite right after `git add` and `git commit`, then `git diff --quiet HEAD`) missed none of 200 rewrites on 2.43.0 and none of 200 on 2.47.1. The failure's log is `logs/gateA243.log`, and the probe is `probe/racy.py`.
- **`tests/test_path_guard_hygiene.py` runs at the head now.** Before the restack it was not at the PR's head and ran on the predicted merges only (see Runs). This PR adds no file-system guard: its `family.py` hunks add no `is_file`, `is_dir`, `exists`, `is_symlink` or `os.path` call.
- **The runs are on the bench's Python 3.12; CI runs 3.14.** No test line this commit adds uses `ast.dump`, `repr(`, `sys.version` or `!r`. The 442 added lines are ASCII and at most 79 columns. None of the commit's new asserts joins conditions with `and` or `or`. The one such assert in `test_family_dry_run.py` (line 1431) is `eac177af9`'s line 1394, moved down.
- **Not run:** the full suite, a real Windows host, and macOS.
- **#1117 and #1201 have landed,** and the restack plan this body named is done ("Restacked after #1201 landed").

Review: rv1264, lane 5's independent opus reviewer, which wrote none of #1264: READY at `b54520ce` (issuecomment-6724775227), with no MUST or SHOULD and two NITs; the review round `43d2e8b2` fixes both. Then rv1264b, lane 5's independent sonnet reviewer, which wrote none of it: READY at `43d2e8b2` (issuecomment-6725329517); its NIT-A (the Goal paragraph) is corrected in the body. Then rv1264c, lane 5's independent sonnet reviewer, which wrote none of it: READY at `54b9cb20`, the restack onto main, with no MUST or SHOULD (issuecomment-6754554921); the PR's diff is the reviewed change by patch-id. `tests` at `54b9cb20` failed only on the 13 rows of tests/test_adopt_symlink_target_bytes.py that #1189 broke on main and #1293 fixed, so the head was refreshed onto the fixed main as `2c72492e` (a merge only), H0 of this landing once its own checks pass. CI (Brett Heap's ruling 27): H0 is the head 2c72492 itself, which passed tests, tests-git-bash and SonarCloud; main has touched none of its files since its base a20d4bd; and the local gate passed on its predicted squash tree 597f402 over main f981468: the family_bump_to_checks, family_dry_run, family_remedy_lines, readme_windows_quoting_sentence, validate_family_unreadable, path_guard_hygiene, pinned_copy_text, no_auto_maintenance, repo_hygiene, agents_md_codes, cli_reference sets, 653 passed, 2 skipped. Landed on Brett Heap's word of 2026-10-23T13:10:26Z, relayed to every lane by lane 3 (#473 issuecomment-6365697123): "merge v1.2.1 PRs once reviewed and green".

Closes #1228

Lane: openreposhape-5 (openRepoShape-5)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
brettheap added a commit that referenced this pull request Nov 10, 2026
…r own premise or read their UTF-8 file as UTF-8, and the 13th, the assembly root bootstrap.py saying it could not create a branch it made, is left failing for its own issue (#1259) (#1278)

 This PR settles 12 of its 13 rows. The 13th row is a tool defect (kind c below), left failing on purpose, and it is now #1283, the issue of its own that #1259's first "Done when" box asks for, so nothing in #1259 is left open.

## Goal

#1259 counts 8 rows of `tests/test_pinned_copy_text.py` and `tests/test_family.py`, and its comment 5 rows of `tests/test_bootstrap_spelling.py`, that fail under a Latin-1 locale and pass under UTF-8. None had a kind. Each is measured here, by test id, into #1214's kinds:

- **a, cannot judge under a one-byte locale (11 rows):** each skips there on its own premise, which the skip reason states.
- **b, the test reads wrongly (1 row):** corrected; it now runs and passes under Latin-1.
- **c, a tool defect a Latin-1 user would meet (1 row):** not fixed, and the row is untouched. The evidence is under "The tool defect".

Main is `42308f26b`, which holds #1258 (the helper `skip_where_the_locale_does_not_spell_it_as_utf_8` and its premise sentences). This branch is one commit on it. It changes three test files and no tool.

## The 13 rows

| # | Test id | Kind | Measured under Latin-1 | Change |
|---|---|---|---|---|
| 1 | `test_pinned_copy_text.py::test_the_variable_the_warning_offers_reads_the_later_link` | a | Exit 0 and no WARNING, as the row asserts. Stdout reads `openXdox \u2192 openYdox \u2192 openInk`: `scaffold-project.py` calls `escape_what_stdout_cannot_encode()` (#214) at the start of `main`, so the arrow is printed escaped by design. | `skip_where_the_locale_does_not_spell_it_as_utf_8("\u2192", PRINTED_AS_ITSELF)`, after the exit and WARNING asserts |
| 2, 3 | `test_pinned_copy_text.py::test_an_unused_pin_source_is_named_spelled[esc]`, `[forged-line]` | a | Exit 0 and no ESC, as asserted. The note reads `not used \u2014 each declared pin ...`. The root's `validate-pins.py` makes a `strict` or `surrogateescape` stdout `backslashreplace` in `_emit_report` (#295), the reconfigure `escape_unencodable_stdout` does, written there because that file imports nothing but `repo_shape`. | the same guard on `"\u2014"`, after the ESC assert |
| 4 | `test_pinned_copy_text.py::test_a_replaced_pin_source_and_its_replacement_are_spelled` | a | The same: both notes read `not used \u2014 the later ...`. | the same |
| 5 | `test_pinned_copy_text.py::test_a_key_read_as_a_path_is_spelled` | a | The same. | the same |
| 6 | `test_pinned_copy_text.py::test_a_printable_pin_source_is_named_as_typed` | a | The same. | the same, after the exit assert |
| 7 | `test_family.py::test_init_writes_the_holders_agent_files` | **b** | `init` writes the holder's `AGENTS.md` as UTF-8 under Latin-1 too: its first line holds `e2 80 94` for U+2014. The row read it with `read_text()`, in the locale's codec, so U+2014 came back as three characters. | its four `read_text()` calls take `encoding="utf-8"` |
| 8 | `test_family.py::test_commit_one_refuses_a_trailer_that_is_no_text_before_it_stages` | a | `os.fsdecode(b"Co-Authored-By: Jos\xe9")` is `...Jos\xe9` (U+00E9), and `_commit_one` commits the trailer as `Co-Authored-By: Jos\xc3\xa9`, the text a Latin-1 terminal typed. Under UTF-8 the same bytes read as `...Jos\udce9`, and `_commit_one` refuses `trailer-not-utf8` with `a.txt` still untracked. The tool is right in both. | `skip_where_the_locale_does_not_spell_it_as_utf_8("Co-Authored-By: Jos\udce9", A_BYTE_READ_AS_A_SURROGATE)`, before the `pytest.raises` |
| 9 | `test_bootstrap_spelling.py::test_a_register_and_its_path_are_spelled_when_it_cannot_be_read` | a | The TEST raises `UnicodeEncodeError` on U+2028 in `os.mkdir`, before any tool runs. | `skip_where_the_environment_cannot_carry("sp\u2028ec")` |
| 10 | `test_bootstrap_spelling.py::test_a_roots_own_directory_name_is_spelled` | a | The test raises in `os.rename` (`shutil.move`). | `skip_where_the_environment_cannot_carry(renamed.name)` |
| 11 | `test_bootstrap_spelling.py::test_a_family_roots_own_directory_name_is_spelled` | a | The same. | the same |
| 12 | `test_bootstrap_spelling.py::test_a_members_row_and_the_make_target_are_spelled` | a | The test raises in `open` (`write_bytes`) of `ta\u2028rget.py`. | `skip_where_the_environment_cannot_carry(target)` |
| 13 | `test_bootstrap_spelling.py::test_a_branch_name_is_spelled_in_every_line_that_names_it` | **c** | The assembly root's `bootstrap.py` makes the branch and then says it could not. See "The tool defect". | none |

**Why rows 9 to 12 take `skip_where_the_environment_cannot_carry`.** The four `UnicodeEncodeError`s that #1259's comment reads are the test's own: `os.mkdir`, `os.rename` and `open` of a name holding U+2028, which Latin-1 cannot encode. The docstring of #1258's helper gives such a row to that guard ("A name the TEST cannot make or pass at all is `skip_where_the_environment_cannot_carry`'s"), as #1258 did for its 18 "a1" rows. Its reason names the encoding and the name, for example `this system's file name encoding (iso8859-1) cannot spell 'At\u2028las'`.

**No tool traceback hides behind them.** I ran both roots' `bootstrap.py` under Latin-1, with the row's `PYTHONIOENCODING=utf-8:strict`, on the manifests those rows had written before they raised: the leg path `"sp\u2028ec"`, the member path `"members/Ir\u2028s"` and the project `"Bo\u2028x"`. Neither printed a traceback. The assembly root printed `[spec] sp\u2028ec: NOT INITIALIZED ...` and `bootstrap ok`, exit 0. The family root spelled both members and ended at its own `family bootstrap FAILED` for the two members whose `make` the probe ran, exit 1.

**The guards ask only of the text their premise is about,** just before the first line that needs it, as #1258's do. The asserts before each guard still judge under Latin-1 (exit code, no ESC, no WARNING). Under UTF-8 no guard skips. Every skip reason states its premise, for example `this locale's encoding (iso8859-1) cannot spell '\u2014': the row reads this character as itself in what the tool prints, and a stdout in this encoding writes it as an escape (#214)`.

## The tool defect (row 13, kind c): not fixed here

**This defect is #1283.** Lane 4 filed it from the evidence below, as #1259's first "Done when" box asks. This PR changes no tool, and row 13 stays failing and untouched until #1283 is mended.

**What a Latin-1 user meets.** Take a project whose `project.yaml` says `tracking_branch: "tb\udcffx"`, the spelling `bootstrap.py` takes for a branch holding the byte 0xFF (#715). Under Latin-1, `make bootstrap` makes that branch in each leg, with HEAD on it at the pin, then prints:

```
  [spec] spec: could not create branch 'tb\udcffx' at the pin f6d8ff445a2d; leaving detached
          `git checkout -b` exited 0, and HEAD is not on the branch at the pin
          nothing else is tried; the recorded pin is authoritative. Deal with what git said and run bootstrap again.
```

Every later run prints `branch tb\udcffx is at the pin f6d8ff445a2d, and git refused to check it out:` with the same two lines, and exits 0. Both claims are false.

**Measured** in the tree the failed Latin-1 run kept, before and after a second run:
- `git symbolic-ref HEAD` in `spec` and in `code` gives `refs/heads/tb\377x`;
- `git rev-parse HEAD` gives the pin, `f6d8ff44...` and `ce229835...`, which equal `git rev-parse HEAD:spec HEAD:code` in the root.

Under UTF-8 and ASCII the same manifest gives `branch tb\udcffx created at <pin>` and, on the next run, `on tb\udcffx at <pin> (branch tip == pin)`. The row passes in both.

**The code at fault** (`templates/assembly-root/scripts/bootstrap.py`, at main `42308f26b`; on `2fde6c3d0` the same lines are :841, :857, :922, :1505 and :1755):
- `_head_of` (:782) returns HEAD's ref as `os.fsdecode(ref.rstrip(b"\r\n"))` (:798). Its docstring says such a name "reads back as the `refs/heads/<branch>` built from the same name". That holds only where `os.fsdecode(os.fsencode(name)) == name`.
- Under Latin-1, `os.fsencode("tb\udcffx")` is `b"tb\xffx"` (surrogateescape), which is what git is handed. `os.fsdecode(b"tb\xffx")` is `"tb\xffx"` (U+00FF), not `"tb\udcffx"`.
- So the text comparisons of `(pin, f"refs/heads/{branch}")` with `_head_of(sub)` fail with HEAD on the branch:
  - the creation step, `if _head_of(sub) != (pin, f"refs/heads/{branch}")` (:1696), which prints `could not create branch` (:1698);
  - `_check_out`, `if _head_of(sub) == (pin, f"refs/heads/{branch}")` (:863), which returns "`git checkout` exited 0, and HEAD is not on the branch at the pin" (:866), and its caller prints "git refused to check it out" (:1446).

## Runs

The commands, the environment and the logs are W1259's. Pytest is `/usr/bin/python3 -m pytest -p no:cacheprovider` on Python 3.12.3. The environment for every run:
- a stub `gh` first on PATH, `GH_TOKEN=bogus`, an empty `GH_CONFIG_DIR`;
- `GIT_CONFIG_GLOBAL` an empty file, `GIT_CONFIG_NOSYSTEM=1`, the test identity, `EMAIL` set;
- `GIT_ALLOW_PROTOCOL`, `GIT_SSH_COMMAND` and `LANES_*` unset;
- git-filter-repo 2.47.0 (`a40bce548d2c`, pip launcher) first on PATH.

The locales:
- UTF-8 is `LC_ALL=C.UTF-8`.
- Latin-1 is built with `localedef -c` as #1153's `test_adopt_one_byte_locale.py` builds one, then `LOCPATH`, `LC_ALL=en_US.ISO-8859-1`, `PYTHONUTF8=0`. Python reports `iso8859-1`.
- ASCII is `LC_ALL=C PYTHONUTF8=0 PYTHONCOERCECLOCALE=0`.

**The gate: 22 test files, on main `42308f26b` and on this head.** They are:
- the three files of the 13 rows;
- the other 14 test files #1258 changed;
- `tests/test_adopt_one_byte_locale.py`;
- the 4 more test files that use a name this PR calls (`skip_where_the_locale_does_not_spell_it_as_utf_8`, `PRINTED_AS_ITSELF`, `A_BYTE_READ_AS_A_SURROGATE`, `skip_where_the_environment_cannot_carry`): `test_adopt_git_reads.py`, `test_non_utf8_git_failures.py`, `test_non_utf8_git_reads.py`, `test_non_utf8_oserror_sites.py`.

The 71 other test files that import from one of the three changed files were collected in each locale, on main and on the head. Each run collects 3782 tests with no error, and the per-file counts are identical.

| Run | main `42308f26b` | this head |
|---|---|---|
| 22 files, Latin-1 | 35 failed, 1144 passed, 87 skipped | 23 failed, 1145 passed, 98 skipped |
| 22 files, UTF-8 | 1265 passed, 1 skipped | 1265 passed, 1 skipped |
| 22 files, ASCII | 52 failed, 1120 passed, 94 skipped | 41 failed, 1121 passed, 104 skipped |
| the three files, Latin-1 | 13 failed, 394 passed | 1 failed (row 13), 395 passed, 11 skipped |
| the three files, UTF-8 | 407 passed | 407 passed |
| the three files, ASCII | 27 failed, 380 passed | 16 failed, 381 passed, 10 skipped |

**By test id, from main to the head:**
- **Latin-1:** 12 rows change, and nothing else: rows 1 to 6 and 8 to 12 go from failed to skipped, and row 7 from failed to passed. No row goes from passed to failed or to skipped. Each of the head's 23 failures fails on main too: row 13, and 22 rows in other files of the gate, which are not among #1259's 13 (see "Left").
- **UTF-8:** nothing changes. The one skip is `test_stdout_encoding.py`'s Windows default-stdout row, on both.
- **ASCII:** 11 rows change, and nothing else: 10 go from failed to skipped and row 7 from failed to passed. Rows 8 and 13 pass under ASCII on main and still do. No row goes from passed to failed or to skipped.

**#1259's "Done when", on a scratch merge.** The merges are main `42308f26b` with #1209's head `13a2c58cb` (`bad3de928`), then with this head (`20fcb11e1`). Both are local, never pushed, and both merged clean.

| Run | main + #1209 | main + #1209 + this head |
|---|---|---|
| `test_pinned_copy_text.py` and `test_family.py`, Latin-1 | 8 failed, 192 passed | **0 failed**, 193 passed, 7 skipped |
| the same two, UTF-8 | 200 passed | 200 passed |
| the same two, ASCII | 23 failed, 177 passed | 16 failed, 178 passed, 6 skipped |
| with `test_bootstrap_spelling.py`, Latin-1 | 13 failed, 394 passed | 1 failed (row 13), 395 passed, 11 skipped |
| with `test_bootstrap_spelling.py`, UTF-8 | 407 passed | 407 passed |
| with `test_bootstrap_spelling.py`, ASCII | 27 failed, 380 passed | 16 failed, 381 passed, 10 skipped |

By test id on the merges: UTF-8 changes nothing; Latin-1 and ASCII change exactly the rows above. The 16 ASCII failures are not among the 13, and fail on main + #1209 as well (see "Left").

**Main moved after these runs**, to `2fde6c3d0`. That commit makes both roots' `bootstrap.py`, `validate-family.py` and `siblings.py` refuse `git-repo-unreadable` where the root's `.git` cannot be read, and changes `tests/test_validate_family_unreadable.py` (one of the 71 files collected above) and adds `tests/test_pinned_root_git_unreadable.py`. It touches none of this PR's three files, and `git merge-tree` of this head with it is clean. The runs above were not repeated on it. Main then moved again, to `674077657` (#1120, `adopt-project.py`). RV1278 re-ran a 20-file gate (the three files, #1258's other 14 test files, `test_adopt_one_byte_locale.py` and #1172's two test files) on a scratch merge of this head with `674077657`: Latin-1 20 failed, 1142 passed, 84 skipped (main: 32 failed, 1141 passed, 73 skipped); UTF-8 1245 passed, 1 skipped on both; ASCII 41 failed, 1124 passed, 81 skipped (main: 52 failed, 1123 passed, 71 skipped). By test id only the rows above change, and every remaining failure fails on main too.

## Mutants

Each mutant was applied in a scratch worktree at the head, inside the one test function named. Its row ran under Latin-1 and ASCII. The file was then restored from HEAD and its sha256 checked equal; all 14 were.

| Mutant | Row | Latin-1 | ASCII |
|---|---|---|---|
| M1: the `PRINTED_AS_ITSELF` guard dropped | 1 | **1 failed** | 1 failed |
| M2: the same | 2, 3 | **2 failed** | 2 failed |
| M3: the same | 4 | **1 failed** | 1 failed |
| M4: the same | 5 | **1 failed** | 1 failed |
| M5: the same | 6 | **1 failed** | 1 failed |
| M6: the `A_BYTE_READ_AS_A_SURROGATE` guard dropped | 8 | **1 failed** | 1 passed: ASCII reads 0xE9 as U+DCE9, so the guard does not skip there and the row judges |
| M7: `AGENTS.md` read in the locale's codec again | 7 | **1 failed** | 1 failed |
| M8: the first read of `AGENTS-shape.md` in the locale's codec | 7 | 1 passed | **1 failed** (`UnicodeDecodeError`) |
| M9: the second read of `AGENTS-shape.md` the same | 7 | 1 passed | **1 failed** |
| M10: the read of `CLAUDE.md` the same | 7 | 1 passed | 1 passed |
| M11: the `skip_where_the_environment_cannot_carry` guard dropped | 9 | **1 failed** | 1 failed |
| M12: the same | 10 | **1 failed** | 1 failed |
| M13: the same | 11 | **1 failed** | 1 failed |
| M14: the same | 12 | **1 failed** | 1 failed |

- **M8 and M9 survive under Latin-1, as expected.** Latin-1 decodes every byte, and the text those two reads are checked for is ASCII. They are killed under ASCII, where #1259 asks the run to be looked at, and where the row now passes.
- **M10 is equivalent in every locale.** `CLAUDE.md` is the 16 ASCII bytes `Read AGENTS.md.\n`, which every codec reads alike. It is changed with the other three, so the row reads every file `init` wrote in one way.

## Merge-trees

`git merge-tree --write-tree` of this head is clean against:
- `origin/main` `42308f26b`;
- #1209 `13a2c58cb`;
- #1282 `f71c28978` (checked by RV1278 on 2026-11-09);
- the two open PRs that touch these files: #1201 `24b6a0af6` (`tests/test_family.py`) and #1171 `8162b874e` (`tests/test_pinned_copy_text.py`).

Neither of those two changes a row this PR touches. #1201's hunks are at an import and `test_add_refuses_a_spelling_of_a_member_the_family_already_pins`; #1171's are at `PINNED_IMPORTERS`.

## Left, and outside this issue

- **Row 13's tool defect**, above. It is #1283, the issue of its own that lane 4 filed for it. Once #1283 is mended, the row passes under Latin-1 as it is written.
- **Under ASCII, 16 rows of the two files still fail,** on main and here alike. #1259 asked that this run be looked at. None of these rows is among the 13, and each passes under Latin-1 and UTF-8. Read from their failure messages only:
  - 15 rows of `tests/test_family.py` read a UTF-8 file the tool wrote (`family.yaml` and others) with `read_text()` and no encoding, and end in `UnicodeDecodeError`: row 7's kind b. They are `test_init_copies_the_siblings_utility_and_the_makefile_target`, `test_the_holder_says_what_its_bytes_are`, the five `test_validate_finds_*` and `test_validate_accepts_*` rows, three `test_bump_*` rows, three `test_update_shape_*` rows, `test_no_members_still_finds_an_edited_copy` and `test_siblings_skips_a_clone_whose_project_id_is_not_the_rows`.
  - `tests/test_pinned_copy_text.py::test_a_printable_pin_source_that_is_not_a_repository_is_named_as_typed[caf\xe9]`: the test itself cannot make `caf\u00e9` under ASCII (`os.mkdir` raises `UnicodeEncodeError`), rows 9 to 12's kind.
- **22 other Latin-1 failures in the gate's other files** fail on main and here alike, and are not #1259's. They are 12 rows of `test_clone_url_bytes.py`, 2 each of `test_family_member_branch_not_utf8.py`, `test_non_utf8_git_reads.py` and `test_stdout_encoding.py`, and one each of `test_adopt_git_reads.py`, `test_adopt_pins.py` (`[not-utf-8]`), `test_adopt_template_values.py` and `test_bootstrap_leg_moves.py`. They were not run on the merge with #1209.

Closes #1259

Lane: openreposhape-4 (openRepoShape-4)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
brettheap added a commit that referenced this pull request Nov 10, 2026
…git` this user cannot read is pinned `source-unreadable` in `check` and `execute`, never `source-partial-clone`, with no `gh` call and no `upload-pack` run (#1262) (#1289)

Pin, in `tests/test_adopt_partial_clone_source.py`, that a partial clone whose recorded `.git` this user cannot read is refused `source-unreadable`, naming that `.git`, and never `source-partial-clone`, in `check` and `execute` alike, with no `gh` call, no `upload-pack` run and no remotes directory made. RD1141's NIT-1 on #1141 (for #1099) asked for it, and #1262 is that follow-up.

**This is a test gap only, and the behaviour is right.** The PR changes one file, `tests/test_adopt_partial_clone_source.py` (+117 -15). No production file, refusal code, remediation or doc changes. Milestone v1.2.1, as #1262.

`Plan._recorded_source` (reached through `open_source`) asks `_git_refused(path)` ahead of everything that reads the clone (`adopt-project.py:7064` at `4552efa6a`), in `check` and `execute` alike, and `_refuse_a_partial_clone_short` runs after the source is opened. #1141's 9 refused-by-name rows (`tests/test_adopt_unreadable_clone_git.py`) build a plain clone, and this file's rows build partial clones with a readable `.git`: no row built a partial clone whose `.git` is at mode 000. RD1141's probe (not in the repository) measured 16 such rows at `0b8fb320`, all `REFUSED source-unreadable` naming `<it>/.git`, none `source-partial-clone`, with 0 `gh` calls and 0 `upload-pack` runs. RD1141 measured why a reorder cannot flip that answer: through a `.git` at mode 000 `_promisor_remotes` is `[]` and `_objects_lacking` is `None`, where they are `['origin']` and 28 while it is readable, so the partial-clone rule's own questions see nothing there. What no row pinned is a change that left such a clone to that rule.

In `tests/test_adopt_partial_clone_source.py`, reusing `Source`, `made` and `planned_once`, and `needs_a_mode`, `recording_gh`, `at_mode_000`, `the_refusal` and `CURES` from the files that own them (functions only, no fixture is imported):

- `test_a_partial_clone_whose_recorded_git_is_unreadable_is_source_unreadable`: **16 rows**, `[nocheckout|checkout]-[check|execute]-[given|cloned]-[directory|file]`. Each makes a `--filter=blob:none` clone (with a checkout, and with `--no-checkout`; `source.lacking() > 0` is asserted), records it as the plan's `source.local_path` (`cloned` false, or `source.cloned: true` with a `source.repository`), makes its `.git` a directory or a `gitdir:` file (`git clone --separate-git-dir`), and puts that `.git` at mode 000 for the `with` (`at_mode_000`: the mode is asserted to bite and is given back in a `finally`). It skips as root and on Windows (`needs_a_mode`). It asserts:
  - exit 2 and `the_refusal(...)` in stderr: `REFUSED source-unreadable: the .git in the plan's source.local_path, <path>/.git: cannot be read (Permission denied), so ... cannot be told`, with the cure for a directory or for a file (`CURES[kind]`);
  - `source-partial-clone` in neither stream, and no `plan ok`;
  - the `gh` log from `recording_gh` empty (no `gh` call);
  - no remotes directory;
  - `source.untouched()`: no `upload-pack` ran, and `objects/` hashes as it did before.
- `test_the_same_partial_clones_with_a_readable_git_are_source_partial_clone`: **8 control rows**, `[nocheckout|checkout]-[given|cloned]-[directory|file]`, `check` only. The same clones with a readable `.git` are refused `source-partial-clone` with its cure, never `source-unreadable`, with no `gh` call and nothing fetched. They show the 16 rows read the `.git`'s mode and not a clone the rule would let by. They run as root and on Windows too.

The helpers, none of which changes an existing row: `Source` takes `apart` (the git directory beside a `.git` file); `objects_dir(path)` finds `objects/` through that file (a function of the path alone, because `tests/test_adopt_plan_partial_clone.py` calls `Source.store(SimpleNamespace(path=...))`); `check` and `execute` take an `env`; `recorded_as_a_clone` is the `cloned` edit `at_the_side_commit` made inline, made alone and called from there. `tests/test_adopt_plan_partial_clone.py` reuses `Source`, `made` and `planned_once`, and keeps its outcomes (run G below). No assert joins conditions with `and` or `or`.

The detached tree `n1262-mut` at main `4552efa6a`, this branch's test file, `adopt-project.py` and `docs/cli.md` (#1141's two production files) taken from `26cc80bd2^`, then restored and compared by sha256 (`adopt-project.py` `eb5f181b...` at the base, `a8f76e66...` before #1141). `-k "unreadable or readable_git"`, git 2.43.0: **16 failed, 8 passed.**

| rows | before #1141 | at the head |
|---|---|---|
| the 8 `given` rows (2 clones x 2 verbs x 2 kinds) | 8 fail: `REFUSED git-failed` (`git rev-parse --is-inside-git-dir` says not a git repository), no `gh` call | pass |
| the 8 `cloned` rows (the same 8) | 8 fail: `gh repo clone testorg/Elsewhere` asked, `REFUSED source-unclonable` | pass |
| the 8 control rows (readable `.git`) | pass | pass |

This is what RD1141 measured for the same 16 rows on main `b66d8f0cc`.

Each applied alone to `adopt-project.py` in `n1262-mut` at `4552efa6a`, the 24 rows run, and the file restored and compared by sha256 each time (script `mutate.py`; the control rows pass in every run).

| mutant | the change | rows failed |
|---|---|---|
| RD1141's MR4 | `refused = _git_refused(path) if there else None` becomes `refused = None` | **16 of 16** |
| the guard asked after the `cloned: false` branch has read the clone | the three guard lines moved below that branch, before `_not_a_whole_clone` | **8**: the 8 `given` rows (`git-failed` from `_top_level`); the `cloned` rows still reach the guard |
| extra: a `.git` file left unguarded | `a_file = False` in `_git_refused` | 8: every `file` row |
| extra: a recorded clone left unguarded | the guard asked only where `source.cloned` is not `true` | 8: every `cloned` row |

No survivor. The two named in #1262 are killed, and each axis of the 16 rows (directory or file, given or cloned) carries a mutant of its own.

Head `2e0d2d237`, Python 3.12.3, git-filter-repo 2.47.0 (`tools/venv247`), through `run10.sh` (a stub `gh` first on PATH that refuses and logs every call, `GH_TOKEN=bogus-l5`, an empty `GH_CONFIG_DIR`, `GIT_SSH_COMMAND=false`, `GIT_CONFIG_GLOBAL=/dev/null`), at most 100 tests a run, `-rs` alone. Each ran on git 2.43.0 and on git 2.47.1 (`tools/git247/bin/git`, `git --version` printed first in each log):

| run | files | rows | 2.43.0 | 2.47.1 |
|---|---|---|---|---|
| A | `test_adopt_partial_clone_source.py`, `test_adopt_unreadable_clone_git.py`, `test_adopt_unenterable_source_and_locale.py` | 93 | 93 passed | 93 passed |
| G | `test_adopt_partial_clone_source.py` and `test_adopt_plan_partial_clone.py` in one pytest (the second imports the first's fixtures) | 77 | 77 passed | 77 passed |
| B | `test_agents_md_codes.py`, `test_cli_reference.py` | 70 | 70 passed | 70 passed |
| C | `test_pinned_copy_text.py` | 87 | 87 passed | 87 passed |
| D | `test_no_auto_maintenance.py` | 60 | 58 passed, 2 skipped | 58 passed, 2 skipped |
| E1, E2 | `test_path_guard_hygiene.py` in two halves | 61 + 60 | all passed | all passed |
| F1, F2 | `test_repo_hygiene.py` in two halves | 51 + 50 | all passed | all passed |

The only skips, named: `tests/test_no_auto_maintenance.py:222` x2 on each git, "the session began with GIT_CONFIG_GLOBAL set, and its file includes that one". Run G first failed 10 rows on an earlier head `cd8b4f3fe` (a `git_dir` attribute `Source.store(SimpleNamespace(path=...))` does not have); `objects_dir` replaced it and every run above was repeated at `2e0d2d237`.

Pre-test of the merge: the predicted merge of the head into main `9cb156a98` (`85f8744b4`, a local commit never pushed), git 2.43.0: G 77 passed, and `test_adopt_unreadable_clone_git.py` with `test_adopt_unenterable_source_and_locale.py` 31 passed.

**Refreshed on 2026-11-10 at 12:19Z as `305021ef3`**: one merge of main `3add78e1c` into the reviewed head `2e0d2d237`, made by `gh pr update-branch`. The old head's `tests` run had failed only on #1189's 13 rows in `tests/test_adopt_symlink_target_bytes.py`, which #1293 fixed on main. A re-run would have tested the stale merge again. CI's `tests` runs on the refreshed head, and lane 5's pilot gates the predicted squash again at this PR's turn.

`git merge-tree --write-tree` at the refreshed head `305021ef3`, heads read fresh at 12:23Z (27 open PRs). No other open PR touches `tests/test_adopt_partial_clone_source.py` or `tests/test_adopt_plan_partial_clone.py`. Against the PR's base the head changes one file, `tests/test_adopt_partial_clone_source.py` (+117/-15).

| against | result |
|---|---|
| main `3add78e1c` | clean, tree `8327064c7`, the head's own tree (the head holds main) |
| #1210 (`791106c2b`, 16th) | clean, tree `00f6a02ac` |
| #1194 (`fix/1129-github-name-limits`, `906172b41`, 17th) | clean, tree `b0eac8e04` |
| #1209 (`fix/1196-paths-spelled-locale-and-env`, `13a2c58cb`) | add/add conflict in `tests/test_adopt_plan_paths_spelled.py`, a file this PR does not touch; the same conflict arises between #1209 and main alone |

The earlier rows (main `3ee5bb4d9` and `9cb156a98`, and #1282, which has landed as `b607223b4`) are superseded by this table (rv1289's NIT 1).

Review: rv1289, lane 5's independent opus reviewer, which wrote none of #1289: READY at `2e0d2d23`, with no MUST or SHOULD (issuecomment-6752563658); its NIT 1 (stale merge lines in the body) was taken by the coordinator at 12:24Z, and NIT 2 is optional. Refreshed on 2026-11-10 at 12:19Z as `305021ef` (one merge of main `3add78e1` into H0 `2e0d2d23`), because H0's `tests` failed only on #1189's 13 rows that #1293 fixed; `305021ef` is H0 of this landing once its checks pass. CI (Brett Heap's ruling 27): H0 is the head 305021e itself, which passed tests, tests-git-bash and SonarCloud; main has touched none of its files since its base 3add78e; and the local gate passed on its predicted squash tree 54e3742 over main 3ffe75b: the adopt_partial_clone_source, path_guard_hygiene, pinned_copy_text, no_auto_maintenance, repo_hygiene, agents_md_codes, cli_reference sets, 499 passed, 2 skipped. Landed on Brett Heap's word of 2026-10-23T13:10:26Z, relayed to every lane by lane 3 (#473 issuecomment-6365697123): "merge v1.2.1 PRs once reviewed and green".

Closes #1262

Lane: openreposhape-5 (openRepoShape-5)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Brett Heap and others added 3 commits November 10, 2026 20:11
…nd-env

#1185's final head is an update-branch merge of main. The merge is clean and
carries no change of #1209's own.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
The one conflict is tests/test_adopt_plan_paths_spelled.py, which #1185's final
head and its squash hold byte-equal (git diff of the two is empty); kept ours.
The tree is unchanged.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…ed-locale-and-env

main moved by one commit after #1185's squash: #1237's, which changes
adopt-project.py and tests/test_adopt_check_throwaway_repos.py, neither of
them a file of #1209. The merge is clean.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@sonarqubecloud

Copy link
Copy Markdown

@brettheap

Copy link
Copy Markdown
Contributor Author

RS1209: #1209 restacked onto main after #1185's squash. New head 01ee69763e6fac50a5f85ced8b80851598e4a30f. Please review the restack only.

#1185 squash-landed at 19:29Z, GitHub moved this PR's base to main, and it read DIRTY. RV1209 graded the old head 13a2c58cb READY (issuecomment-6372008636). This is that head plus three merge commits, never a rebase, no force push. Tree 181f5eba960c4bd67243c61502ffd2b6ae0cfa85, on origin/main f7f34fb09.

The three merges

The delta is the reviewed one

  • The changed lines of git diff d193617c7 13a2c58cb (the reviewed commit on its old base) and of git diff origin/main HEAD (the restack on main), taken as grep -E '^[+-]' | grep -vE '^(\+\+\+|---) ': 201 lines each, and cmp says equal. Both sha256 6789959350fe4be750b9d8139cc934bd129af4746313b87cd860bd65268784d9.
  • git diff --name-only origin/main HEAD lists exactly the five files: tests/conftest.py, tests/test_adopt_plan_paths_spelled.py, tests/test_non_utf8_name_callers.py, tests/test_non_utf8_name_helpers.py, tests/test_run_script_encoding.py. --stat is 5 files, +180 -21, as before.

Gate on tree 181f5eba9

Landing-gate environment: a stub gh, GH_TOKEN=bogus, an empty GH_CONFIG_DIR, an empty global git config, GIT_CONFIG_NOSYSTEM=1, git filter-repo on PATH, /usr/bin/python3 -m pytest -p no:cacheprovider, two shards at a time. The 31 files are the five files, every test file that reaches skip_where_a_name_cannot_be_not_utf_8, a_system_that_carries_the_byte or the new helpers (an AST walk to a fixpoint: 29 files, three of them the PR's own), and tests/test_repo_hygiene.py.

Merge-trees

What a delta review needs

Check that the three merges bring in only #1185's and #1237's content and nothing of mine, and that the delta above is the reviewed one. The rows themselves were reviewed at 13a2c58cb and are unchanged. I have not edited the PR body; the base is main again, so its link to #1196 is live now: closingIssuesReferences reads [1196], the PR is a draft on main, MERGEABLE, milestone v1.2.1.

Lane: openreposhape-4 (openRepoShape-4)

@brettheap

Copy link
Copy Markdown
Contributor Author

RVD1209: delta review of #1209's restack at 01ee6976: READY

Delta review for lane 4. No MUST, no SHOULD, no NIT against the restack. The three merges carry #1209's reviewed change onto main byte for byte and nothing else. RV1209's grade at 13a2c58c (issuecomment-6372008636) stands for the code. The head is 01ee69763e6fac50a5f85ced8b80851598e4a30f, tree 181f5eba960c4bd67243c61502ffd2b6ae0cfa85, on origin/main f7f34fb09 (#1237's squash), which had not moved when I finished at 20:23Z. PR read back: base main, draft, MERGEABLE, milestone v1.2.1, closingIssuesReferences is [1196].

I made no mutants: this is a delta review, the changed lines are equal (check 3), and RV1209's mutant table was taken against the same lines.

Checks

  1. Ancestry: PASS. git log --first-parent --format='%H %P %an' 13a2c58cb..H lists three commits, all merges (two parents each), author and committer Brett Heap with the estate address:
  2. Each merge: PASS.
  3. The reviewed change is carried unchanged: PASS. The changed lines of git diff d193617c7 13a2c58cb and of git diff origin/main H (grep -E '^[+-]' | grep -vE '^(\+\+\+|---) ') are 201 lines each, cmp says equal, and both sha256 are 6789959350fe4be750b9d8139cc934bd129af4746313b87cd860bd65268784d9. (The lane's brief said 211 lines. The prefix 6789959350fe4be7 matches, and the count is 201.) git diff --name-only origin/main H names exactly tests/conftest.py, tests/test_adopt_plan_paths_spelled.py, tests/test_non_utf8_name_callers.py, tests/test_non_utf8_name_helpers.py and tests/test_run_script_encoding.py. --stat is 5 files, +180 -21, as at 13a2c58cb.
  4. Today's main: PASS. git merge-tree --write-tree origin/main H exits 0 with tree 181f5eba9, the head's own; the tree differs from main in the five files only. Main changed adopt-project.py and tests/test_adopt_check_throwaway_repos.py since Q, and tests/conftest.py and tests/test_adopt_plan_paths_spelled.py: under a one-byte locale such as Latin-1 the 0xff --work-dir row skips and the two U+00E9 rows read the child's UTF-8, so none of the three fails on a tool that is right, and the bytes helper starts its child as run_script does (#1196) #1209 changes neither, so no file overlaps.
  5. Tests at H: PASS. I ran them in a worktree at H itself (tree 181f5eba9), in the landing gate's environment: a stub gh first on PATH, GH_TOKEN=bogus, an empty GH_CONFIG_DIR, an empty global git config, GIT_CONFIG_NOSYSTEM=1, git filter-repo on PATH, /usr/bin/python3 -m pytest -p no:cacheprovider, at most two runs at a time.
  6. SonarCloud and CI at H: PASS. The newest sonarqubecloud[bot] comment (6778124227, 20:12:57Z) says Quality Gate passed: 0 new issues, 0 accepted, 0 security hotspots, 0.0% duplication on new code. The SonarCloud API gives the same: project_pull_requests/list shows PR 1209 analysed at commit 01ee69763 (20:12:27Z), gate OK, 0 bugs, 0 vulnerabilities, 0 code smells; issues/search for the PR is total 0; hotspots total 0. gh pr checks 1209: SonarCloud Code Analysis pass, package pass, tests-git-bash pass, tests pending (run 42892951951, still going at 20:23Z). Pending does not fail this check.
  7. RS1209's comment (6778135387, 20:13:29Z): PASS, with two stale details. Every fact I could test holds:

Findings

None.

Not done

I did not re-run the full 31-file gate or the 6 case-disk rows of test_adopt_check_throwaway_repos.py (they skip on this disk and are #1237's, not this PR's). I ran 13 files in all (4 + hygiene + 8; the Latin-1 run is the same four), and collected the rest.

Lane: openreposhape-4 (openRepoShape-4)

This branch has not been deployed

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

Labels

None yet

Projects

None yet

1 participant