Skip to content

tests/test_bootstrap_non_utf8_branch.py and tests/test_bootstrap_branch_bytes.py: under Latin-1 four rows that expect the byte 0xFF spelled a\udcffb run what judges there and skip on their premise, as each failed on a tool that is right (#1301) - #1302

Open
brettheap wants to merge 2 commits into
mainfrom
fix/1301-latin1-bootstrap-branch-rows

Conversation

@brettheap

@brettheap brettheap commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

Closes #1301

Milestone v1.2.2: v1.2.1 is frozen, and lane 3 places this PR by its READY time.

Base: 34eb466e (34eb466), which was origin/main when this was written, 09:33Z. Head: 371264be (371264b), two commits on 34eb466e: 7837d499 (7837d49), and 371264be, which is review round 1's NIT 1 (see Review round 1). origin/main has moved since: it is 5f06c3eb (5f06c3e), #1278's squash at 09:48:41Z. r1302a measured the merge of 7837d499 with it, in a scratch commit that was never pushed: the same outcomes by test id under Latin-1, UTF-8 and ASCII as 7837d499 alone. Round 1 found git merge-tree --write-tree 371264be origin/main clean as well (exit 0), and did not run the tests on that merge. Main then moved again, to b607223b (b607223), one commit on 5f06c3eb. The delta review r1302b measured the merge of 371264be with it: clean (tree 3083ed6626f78516f9d3a9d84fb6881848dc00f2), and the same outcomes by test id under Latin-1, UTF-8 and ASCII. Lane 1 refreshes the branch when it lands. The PR changes two test files and nothing else: tests/test_bootstrap_non_utf8_branch.py (blob ab427554 to 7fffdb2a) and tests/test_bootstrap_branch_bytes.py (blob a2892e45 to 0b14df90), +51 -15 against 34eb466e. No tool, no template and no tests/conftest.py changes. This body is ASCII, apart from the footer's emoji: <ff> stands for the one byte 0xFF, which a Latin-1 terminal shows as U+00FF.

What

Under a Latin-1 locale (LOCPATH, LC_ALL=en_US.ISO-8859-1, PYTHONUTF8=0, built as #1153's latin1 fixture builds it) four rows failed on main. Each now runs the asserts that judge there, then skips on its premise with skip_where_the_locale_does_not_spell_it_as_utf_8("a\udcffb", A_BYTE_READ_AS_A_SURROGATE), asked just before the first line that spells the name:

# Test id (file) Before After, under Latin-1
1 test_a_branch_past_the_pin_is_moved_back_whatever_its_upstream_is_named[the-byte-0xff] (test_bootstrap_non_utf8_branch.py) failed at :232, the moved back line skipped after 5 asserts
2 test_a_leg_on_a_branch_whose_name_is_not_utf8_is_placed_on_every_run[make-bootstrap] (same file) failed at :297, the the leg was on a\udcffb line skipped after both runs, HEAD's bytes and the leg's commit
3 test_a_leg_on_a_branch_whose_name_is_not_utf8_is_placed_on_every_run[--branch-a<ff>b] (same file) failed at :296, the on a\udcffb line skipped after both runs, HEAD's bytes and the leg's commit
4 test_a_name_that_is_not_utf8_is_still_carried_and_the_branch_made (test_bootstrap_branch_bytes.py) failed at :381, the branch a\udcffb created line skipped after 7 asserts (5 at 7837d499)

The guard's reason, as pytest prints it for each: this locale's encoding (iso8859-1) reads b'a\xffb' as 'a\xffb', not as 'a\udcffb': the row needs a byte that is not UTF-8, which Python reads in as a surrogate (U+DC80 to U+DCFF) where the locale is UTF-8 or ASCII; here it is a character, and the tool takes it as one.

Under Latin-1 the two files go from 4 failed, 83 passed, 5 skipped to 83 passed, 9 skipped. Under UTF-8 (92 passed) and ASCII (86 passed, 6 skipped) no row changes its outcome, by test id (see Measured).

Why

The tool is right; the rows asked UTF-8's question. Re-measured on main 34eb466e, with pytest itself in each locale. Under Latin-1 the byte 0xFF is the character U+00FF, so scripts/bootstrap.py prints the branch as that character where UTF-8 and ASCII print the surrogate U+DCFF as \udcff. Each failed row's later asserts are the ones the tool answers rightly, and under the guard they now run and pass in a Latin-1 pytest: the run exits 0 with no traceback, bootstrap ok ends it (rows 2 and 3), the branch is at the pin (row 1), HEAD's bytes are refs/heads/a<ff>b or refs/heads/main (rows 1 to 4), and the leg's commit is the pin (row 1, and rows 2 to 4 since review round 1). Only the spelling of the name differs. These are #1214's kind a, as #1258 put it: "the tool runs and answers rightly for the bytes Latin-1 gives, and the row expects UTF-8's reading or spelling". None is a tool defect, and none is #1259's, #1285's or #1283's row.

The decision: guard each row on its premise, as #1258 did for this kind. skip_where_the_locale_does_not_spell_it_as_utf_8(text, premise) is asked only of the text the row's premise is about, and just before the first line that needs it. The text is the name as the row spells it, "a\udcffb" (row 1 asks raw, and only where byte is true: its other parameter, an upstream ending in U+00A0, is not about the byte and already skips under a one-byte locale through NEEDS_A_UTF8_PROCESS).

Rejected:

Measured

Python 3.12.3, pytest 9.1.1, git 2.43.0, in the probe environment (a stub gh first on PATH, GH_TOKEN=bogus-w1301a, an empty GH_CONFIG_DIR, GIT_CONFIG_GLOBAL=/dev/null, GIT_SSH_COMMAND=false, EMAIL set, LANES_LANE unset). A Python started in each locale reports iso8859-1, utf-8 and ascii for sys.getfilesystemencoding() (UTF-8 is LC_ALL=C.UTF-8; ASCII is LC_ALL=C PYTHONUTF8=0 PYTHONCOERCECLOCALE=0). The first commit's runs used GH_TOKEN=bogus-w1301a; review round 1's runs, by a second writer, used GH_TOKEN=bogus-w1302n and the same Latin-1 build.

The two files, -v -rfs, on main 34eb466e, on the first commit 7837d499 and on head 371264be. The main column is from before round 1. The other two ran in round 1, on a host with other lanes' tests running, so their times are not comparable with the main column:

Locale main 7837d499 head 371264be
Latin-1 4 failed, 83 passed, 5 skipped in 17.31s 83 passed, 9 skipped in 25.15s 83 passed, 9 skipped in 27.82s
UTF-8 92 passed in 19.20s 92 passed in 27.01s 92 passed in 29.88s
ASCII 86 passed, 6 skipped in 18.73s 86 passed, 6 skipped in 24.91s 86 passed, 6 skipped in 24.94s

By test id, the 92 ids of the two files, main against the first commit 7837d499 (PASSED, FAILED, SKIPPED). Round 1's commit changes no id: head 371264be against 7837d499 is 92 ids with 0 differing in outcome under each of Latin-1, UTF-8 and ASCII (a script over the saved -v output of the six runs above), so the table holds at head:

Test id Latin-1 UTF-8 ASCII
row 1, [the-byte-0xff] FAILED -> SKIPPED PASSED -> PASSED PASSED -> PASSED
row 2, [make-bootstrap] FAILED -> SKIPPED PASSED -> PASSED PASSED -> PASSED
row 3, [--branch-a<ff>b] FAILED -> SKIPPED PASSED -> PASSED PASSED -> PASSED
row 4, ..._still_carried_and_the_branch_made FAILED -> SKIPPED PASSED -> PASSED PASSED -> PASSED
the other 88 ids 83 PASSED and 5 SKIPPED, the same ids on both 88 PASSED, the same 82 PASSED and 6 SKIPPED, the same ids on both

Compared id by id with a script over the saved -v output: 4 ids change under Latin-1, none under UTF-8, none under ASCII. Under Latin-1 the 5 skips main already had are unchanged: the 4 NEEDS_A_UTF8_PROCESS rows and tests/test_bootstrap_branch_bytes.py:438 at the head (:436 at 7837d499; UNWRITABLE). The 4 new skips are the guard's, at tests/conftest.py:1334.

The asserts that still run under Latin-1

The rows were traced under Latin-1 with a sys.settrace plugin (kept in the scratch folder, not in the PR) that records the lines each test's own frame ran. Line numbers are head's (371264be), and round 1 traced the five ids again at it (5 skipped in 7.14s). The asserts round 1 added are in bold.

Row Ran before the skip (all passed) Not reached under Latin-1
1 needs_the_byte, the run, :233 exit 0, :234 no Traceback, :235 rev(leg, refs/heads/a<ff>b) == pin (the branch at the pin), :236 rev(leg) == pin (HEAD at the pin), :237 HEAD's bytes equal refs/heads/a<ff>b. The guard is :238-240. the moved back ... origin/a\udcffb ... printf line
2 Both runs: :309 exit 0, :310 no Traceback, :311 bootstrap ok, :313 the line on main at <pin> (branch tip == pin). Then :315 HEAD's bytes equal refs/heads/main, and :317 rev(leg) == pin (the leg's commit is the pin). The guard is :318-319. the leg was on a\udcffb ..., asked of each run
3 Both runs: :309, :310, :311. Then :315 HEAD's bytes equal refs/heads/a<ff>b, and :317 rev(leg) == pin. The guard is :318-319. on a\udcffb at <pin> and the the leg was on line, asked of each run
4 skip_where_a_name_cannot_be_not_utf_8 (first, as on main), :387 exit 0 and no Traceback, then for spec and code: :389 no could not create branch, :393 HEAD's bytes equal refs/heads/a<ff>b, and :394-395 the leg's rev-parse HEAD, first 12 characters, equals pin12. The guard is :396-397. the branch a\udcffb created at <pin12> ... at the pin line of each leg

What I moved, and why the meaning stays. I moved the asserts that spell the name down, past the guard, and left every other assert where it judges. Read the other way:

  • Row 1: the three asserts rev(leg, f"refs/heads/{raw}") == pin, rev(leg) == pin and head_bytes(leg) == ... moved up, above the line that spells the name. Each reads git, never stdout, so the order changes nothing.
  • Rows 2 and 3: the loop kept the exit, Traceback and bootstrap ok asserts, and row 2's on main assert (it spells no byte). It now appends each run's stdout to printed. The guard comes after the loop, HEAD's bytes and (round 1) the leg's commit. Then one loop over printed asks what spells the name: row 3's placed assert, and the (placed + left in stdout) is (not given and run == 1) assert of both rows, word for word. Each assert is asked once per run, as before.
  • Row 4: the created assert, which spelled the name, moved from the loop over spec and code to a second loop after the guard. could not create branch, HEAD's bytes and (round 1) the leg's commit stay in the first loop.

Under UTF-8 and ASCII every assert main asked is still asked, the same number of times (r1302a counted them by trace), so a regression that fails one fails it there, in another order for rows 2 to 4 (a failure of run 1's name line is now reported after run 2 has run). Round 1 adds two assert lines to that set: assert rev(leg) == pin in rows 2 and 3, and the leg's commit in row 4's first loop (run once for each leg). They pass wherever the tool is right: the two files pass under all three locales above.

The branch's commit, judged under Latin-1 since round 1 (r1302a's NIT 1). In the first commit, rows 3 and 4 judged the branch at the pin only through a line that spells the name, which Latin-1 never reaches, and row 4 judged it in no locale. HEAD's bytes are already asserted to be the branch, so the leg's commit is the branch's commit, and 371264be asks for it before each guard. To show that it judges, a tool fault was run (r1302a's TF4, rewritten as the smallest patch that does it, fault.py in the scratch folder). In a scratch clone it patches templates/assembly-root/scripts/bootstrap.py so that after main() returns, in each leg that has the branch a<ff>b, it makes a commit on HEAD's tree with HEAD as its parent and points HEAD at it: the checked-out branch stands one commit past the pin. The five ids of the four rows (row 1 has a second parameter, the upstream ending in U+00A0) ran under Latin-1 and UTF-8, -v -rfs, with the fault, once at 7837d499 and once at 371264be. After each pair of runs the file was written back from git cat-file blob HEAD:<path>: git hash-object printed 41c2eb42b56390a5b958940a0abc84e7a3c98db8, the blob at HEAD, for both trees, and git status --porcelain was empty. The worktree of this PR was never mutated.

Id, with the fault 7837d499, Latin-1 7837d499, UTF-8 371264be, Latin-1 371264be, UTF-8
row 1, [the-byte-0xff] FAILED at :235 FAILED at :235 FAILED at :235 FAILED at :235
row 2, [make-bootstrap] FAILED at :313 FAILED at :313 FAILED at :313 FAILED at :313
row 3, [--branch-a<ff>b] SKIPPED FAILED at :321 FAILED at :317 FAILED at :317
row 4, ..._still_carried_and_the_branch_made SKIPPED PASSED FAILED at :394 FAILED at :394
[an-upstream-ending-in-U+00A0] SKIPPED PASSED SKIPPED PASSED
summary 2 failed, 3 skipped in 6.94s 3 failed, 2 passed in 7.31s 4 failed, 1 skipped in 7.90s 4 failed, 1 passed in 8.13s

Rows 3 and 4 now fail under both locales, at the new asserts (:317 and :394), where at 7837d499 row 3 skipped under Latin-1 and row 4 skipped under Latin-1 and passed under UTF-8 (row 3 under UTF-8 failed at :321, in 7837d499's numbering, only through the line that spells the name). Row 1 fails at :235 at both. Row 2's leg ends on main, but the test makes the branch a<ff>b in it, so the fault fires there too: run 2 then reports PIN ... != branch main tip ... where :313 expects branch tip == pin, and the row fails at :313 before the new :317 is reached, at both. The U+00A0 parameter is not about the byte and the fault does not reach it.

Row 4 and #1209

#1209 (lane 4's draft, head 13a2c58cb79d640ed6392edef77cf5d27ed9d2b3) changes skip_where_a_name_cannot_be_not_utf_8, which row 4 calls first. #1209 does not touch either test file of this PR.

$ git merge-tree --write-tree 7837d499 refs/l1/pr/1209
8db01c843302c2e220feb1431b37d4288a3cc401
exit 1
$ git merge-tree --write-tree origin/main refs/l1/pr/1209
827fa7904123b65b14a652f2b5aff60f2597c629
exit 1
$ git merge-tree --write-tree 371264be refs/l1/pr/1209
c5628863c53f832631dbc55652cf7c1651a9c06d
exit 1

Each prints one conflict, CONFLICT (add/add): Merge conflict in tests/test_adopt_plan_paths_spelled.py, which this PR does not touch. The second command is main against #1209 alone, so the conflict is #1209's against main and not this PR's. The trees differ because a conflicted tree holds the arguments as typed in its conflict markers (<<<<<<< 7837d499, <<<<<<< origin/main, each against >>>>>>> refs/l1/pr/1209): one commit spelled two ways gives two trees. The first version of this body printed 8e4ba1ab, which is the tree of HEAD refs/l1/pr/1209, beside the command with 7837d499 (r1302a's NIT 2); the commands above are the ones run. To measure row 4 anyway, at 7837d499, I took the merge tree of the two heads (it differs between the spellings only in that one file's markers), resolved the one file to the side of this head (blob 7b15d2aa, which is stage 2 in the output) in a scratch index, and made a commit-tree of it with both parents (a46fb0807, never pushed). #1209's tests/conftest.py merged without a conflict. A detached scratch worktree of it gave the table below, measured at 7837d499 and not re-run at 371264be:

Run at a46fb0807 (head + #1209) Latin-1 UTF-8
the two files 83 passed, 9 skipped in 20.17s 92 passed in 21.72s
row 4 alone, traced skipped by #1209's helper, tests/conftest.py:1187, with no assert run: this system's file name encoding (iso8859-1) reads the byte 0xFF as '\xff', not as '\udcff', so no file name here is one that is not UTF-8; the new guard is not reached passed; the guard asked and did not skip
rows 1 to 3 skipped by the new guards (tests/conftest.py:1353), as at head passed

The ids of the two files under Latin-1 are the same at 7837d499 and at 7837d499 + #1209. So with #1209 row 4 neither fails nor skips twice: the first skip ends the test, and it is #1209's helper that ends it. It skips on a reason that is the same premise as the new guard's (the byte reads as a character). What changes is how much runs first: at 7837d499, 5 asserts judge under Latin-1 before the skip (7 at 371264be), and with #1209 none does, because #1209 asks the locale before the run. Round 1 added asserts only above row 4's guard and touched no helper, so with #1209 row 4 still ends at #1209's helper before any assert; that is a reading of the diff, not a run at 371264be. #1258 kept the locale question out of that helper so a row about a branch that is not UTF-8 judges in every locale (#1224's N1). Whether #1209 should keep it out too is lane 4's and lane 1's call, and this PR changes neither the helper nor tests/conftest.py. If #1209 lands first the new guards stay correct: under Latin-1 row 4's guard is then never reached, and under UTF-8 and ASCII it passes through.

git merge-tree --write-tree 371264be origin/main is clean (exit 0, tree b0a4b55d344333ef36c48ba72db518f498d78382; origin/main is 5f06c3eb in that clone). While main had not moved, 7837d499 origin/main gave c7c0368e1ae16cb84f778b08e0cb75eda834f296, head's own tree. No open PR changes either test file: lane 1 checked the open PRs' files at 09:16Z, and r1302a checked 25 open PRs again (#1209, #1282 and #1300 touch only the neighbouring files).

Mutants

Four mutants, each applied alone in a detached scratch worktree of head (7837d499) and run over the two files under Latin-1 and UTF-8. After each, both files were written back from git cat-file blob HEAD:<path> and proved equal to HEAD's blobs by git hash-object (00af26c940cd055ebcfcc23afd25136ff1ea1459 and 561f4c320583fff346fc06e9ae0b8def9ca4f679, EQUAL four times). The worktree of this PR was never mutated. They ran at 7837d499, before round 1, and were not re-run at 371264be: the guards and asserts they change are the same lines, one or two lines further down. r1302a re-ran M1 to M4 at 7837d499 and got these counts exactly.

id mutant Latin-1 UTF-8 Killed
M1 drop row 1's guard 1 failed, 83 passed, 8 skipped in 18.63s: row 1 [the-byte-0xff] alone, at the moved back line 92 passed in 20.08s yes
M2 drop the guard of rows 2 and 3 2 failed, 83 passed, 7 skipped in 17.29s: [make-bootstrap] and [--branch-a<ff>b] 92 passed in 18.76s yes, both
M3 drop row 4's guard 1 failed, 83 passed, 8 skipped in 17.23s: row 4, at the created line 92 passed in 18.53s yes
M4 ask each of the three guards of the name "ab", which is all ASCII 4 failed, 83 passed, 5 skipped in 18.51s: all four rows 92 passed in 19.93s yes, all four

4 of 4 killed, no survivor. Each mutant that fails under Latin-1 fails the ids that failed on main, at the assert that spells the name: M1 at the moved back assert, M2 at row 3's placed assert and row 2's left assert, M3 and M4 at row 4's created assert, and M4 also at those of rows 1 to 3. No id changes under UTF-8. M4 shows the guard skips because of the name: asked of ASCII it does not skip, and the four rows fail again.

Tests

In the probe environment, at most 2 calls at once, one basetemp per slot, df -h /workspace and df -i / checked first (51G free and 35% of inodes in use for calls 1 to 16; 48G free and 36% for calls 17 to 25). Calls 1 to 16 were run for the first commit, at 7837d499 unless a row says otherwise. Calls 17 to 25 are review round 1's, at head 371264be unless a row says otherwise. Python 3.12.3.

call result
1. the two files, Latin-1, main 34eb466e 4 failed, 83 passed, 5 skipped in 17.31s
2. the two files, UTF-8, main 92 passed in 19.20s
3. the two files, ASCII, main 86 passed, 6 skipped in 18.73s
4. the two files, Latin-1, head 83 passed, 9 skipped in 22.91s
5. the two files, UTF-8, head 92 passed in 24.63s
6. the two files, ASCII, head 86 passed, 6 skipped in 20.23s
7. the four rows traced, Latin-1, head 5 skipped, 87 deselected in 5.37s (the fifth is the U+00A0 parameter, skipped as on main)
8. the four rows traced, UTF-8, head 5 passed, 87 deselected in 5.64s
9. the two files, Latin-1, head + #1209 (a46fb0807) 83 passed, 9 skipped in 20.17s
10. the two files, UTF-8, head + #1209 92 passed in 21.72s
11. row 4 alone, Latin-1, head + #1209 1 skipped in 1.41s
12. row 4 alone, UTF-8, head + #1209 1 passed in 1.56s
13. M1 to M4, Latin-1, over the two files 1 failed, 83 passed, 8 skipped; 2 failed, 83 passed, 7 skipped; 1 failed, 83 passed, 8 skipped; 4 failed, 83 passed, 5 skipped
14. M1 to M4, UTF-8, over the two files 92 passed each (in 20.08 s, 18.76 s, 18.53 s, 19.93 s)
15. every tests/test_bootstrap_*.py (13 files, listed to a file and passed with xargs -d '\n' -a), UTF-8 643 passed, 3 skipped in 196.87s
16. tests/test_path_guard_hygiene.py, tests/test_no_auto_maintenance.py, tests/test_repo_hygiene.py, UTF-8 280 passed, 2 skipped in 25.09s
17. the two files, Latin-1, head 83 passed, 9 skipped in 27.82s
18. the two files, UTF-8, head 92 passed in 29.88s
19. the two files, ASCII, head 86 passed, 6 skipped in 24.94s
20. the two files, Latin-1, 7837d499, run again 83 passed, 9 skipped in 25.15s
21. the two files, UTF-8, 7837d499, run again 92 passed in 27.01s
22. the two files, ASCII, 7837d499, run again 86 passed, 6 skipped in 24.91s
23. the five ids traced, Latin-1, head 5 skipped in 7.14s
24. the five ids with the fault, 7837d499, Latin-1 then UTF-8 2 failed, 3 skipped in 6.94s; 3 failed, 2 passed in 7.31s
25. the five ids with the fault, head, Latin-1 then UTF-8 4 failed, 1 skipped in 7.90s; 4 failed, 1 passed in 8.13s

Review round 1 (r1302a)

r1302a (an Opus reviewer) reviewed 7837d499 and posted its review on this PR as issuecomment-6764610007. Verdict: READY, with no MUST, no SHOULD and three NITs. It confirmed that the four rows go from FAILED to SKIPPED under Latin-1 and that no other id changes outcome in any locale, and that every assert main asked under UTF-8 and ASCII is still asked, the same number of times and with the same text. Nine of its ten mutants were killed and the tenth (R2) is equivalent. This round applied all three NITs:

NIT What r1302a found What this round did
1 Rows 3 and 4 never check the branch's commit under Latin-1, and row 4 checks it in no locale. A tool that leaves the checked-out branch one commit past the pin is missed by row 4 in every locale (skipped under Latin-1, passed under UTF-8) and by row 3 under Latin-1 (skipped). Commit 371264be adds assert rev(leg) == pin after HEAD's bytes in rows 2 and 3 (:317), and the leg's rev-parse HEAD against pin12 in row 4's first loop (:394-395), each before its guard: 3 lines in two files, nothing else changed. With the fault, rows 3 and 4 now fail under Latin-1 and UTF-8 (table in The asserts that still run). The two files give the same outcomes by id as 7837d499 under all three locales.
2 In Row 4 and #1209 the tree printed beside git merge-tree --write-tree 7837d499 refs/l1/pr/1209 was the tree of HEAD refs/l1/pr/1209. The commands were run again in a scratch clone, each printed as run with its tree and exit code (7837d499 refs/l1/pr/1209 gives 8db01c84, exit 1; origin/main refs/l1/pr/1209 gives 827fa790, exit 1). The conflict is the same file, and the same against main. The cause is in the section.
3 Main had moved to 5f06c3eb (#1278) since the body was written, so "main had not moved" and "one commit above main" were stale. The Base line now says the head is two commits on 34eb466e, that main is 5f06c3eb, and that r1302a measured the merge with it: the same outcomes by test id under Latin-1, UTF-8 and ASCII. git merge-tree --write-tree 371264be origin/main is clean (exit 0).

Known limits

Not in this PR

Lane: openreposhape-1 (openRepoShape-1)

🤖 Generated with Claude Code

…ch_bytes.py: under a Latin-1 locale four rows that expect the byte 0xFF spelled `a\udcffb` run what judges there, then skip on their premise, where each failed on a tool that is right and printed U+00FF (#1301)

Under Latin-1 the byte 0xFF is the character U+00FF, so
scripts/bootstrap.py prints the branch as that character, exits 0, ends
`bootstrap ok`, and moves or makes the same branches. Each row asserted a
line spelling the name as UTF-8 and ASCII read it, `a\udcffb`, and failed
on a tool that was right (#1214's kind a).

Each row now asks
skip_where_the_locale_does_not_spell_it_as_utf_8("a\udcffb",
A_BYTE_READ_AS_A_SURROGATE) just before the first line that spells the
name, after the asserts that judge in every locale: the exit, no traceback,
`bootstrap ok`, the line `on main`, the branch at the pin and HEAD's bytes.
No tool file, no conftest and no other row changes.

Lane: openreposhape-1 (openRepoShape-1)
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@brettheap brettheap added this to the v1.2.2 milestone Nov 10, 2026
@sourcery-ai

sourcery-ai Bot commented Nov 10, 2026 •

Copy link
Copy Markdown

Reviewer's Guide

Tests

For the non-UTF-8 branch movement cases, preserve locale-independent checks before conditionally skipping only the UTF-8-specific output spelling assertion.

  • tests/test_bootstrap_non_utf8_branch.py L219-225, L235-240, L312-323 (+4 small edits)

For the branch-creation case, check branch and HEAD state before skipping only the UTF-8-specific printed-name assertion.

  • tests/test_bootstrap_branch_bytes.py L48-52, L376-382, L394-401 (+1 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

Review of #1302 (#1301) for lane openRepoShape-1, by r1302a (opus), at 7837d49: READY

I found no MUST and no SHOULD, only three NITs. All four rows of #1301 move from FAILED to SKIPPED under Latin-1, and no other test id changes outcome in any locale. Every assert that main asked under UTF-8 and ASCII is still asked, the same number of times and with the same text. Under Latin-1 the asserts placed before each guard really judge: a tool fault planted after the run fails all four rows before their guards. The neighbours #1209 and #1300, and the main that moved since the body was written, change nothing.

Setup:

Findings

NIT 1: rows 3 and 4 never check the branch's commit under Latin-1, and row 4 checks it in no locale.

  • Where: tests/test_bootstrap_non_utf8_branch.py:315-316 (rows 2 and 3, before the guard at :317) and tests/test_bootstrap_branch_bytes.py:393 (row 4, in the first loop, before the guard at :394).
  • The PR does not cause this, and the body says so in "Known limits" and "Not in this PR". tests: under a Latin-1 locale 4 rows of test_bootstrap_non_utf8_branch.py and test_bootstrap_branch_bytes.py fail on main, expecting the byte 0xFF spelled a\udcffb as UTF-8 reads it where bootstrap.py rightly prints U+00FF, and no issue names them #1301's done-when asks only that the asserts already there keep running, and rows 3 and 4 had no such assert. So I would not hold the PR for it.
  • Evidence: TF4 is a tool fault in templates/assembly-root/scripts/bootstrap.py. After the run it moves the checked-out branch one commit past the pin, in each leg that has a<ff>b. S1 is the two asserts suggested below. Each was run over the five ids of the four rows, in the clone at 7837d49 (/usr/bin/python3 -I .../r1302a/tools/mut.py .../r1302a/ids4.txt latin1,utf8 base+TF4 S1+TF4 S1):
    base+TF4  latin1: 2 failed, 3 skipped   (rows 1, 2 FAILED; row 3 [--branch-a<ff>b] SKIPPED; row 4 SKIPPED)
              utf8:   3 failed, 2 passed    (row 4 PASSED: it misses the fault in every locale)
    S1+TF4    latin1: 4 failed, 1 skipped   utf8: 4 failed, 1 passed   (rows 3 and 4 now FAILED in both)
    S1        latin1: 5 skipped             utf8: 5 passed              (no false failure)
    
  • Fix, optional or as a follow-up issue: ask for the commit before each guard. HEAD's bytes are already asserted to be the branch, so rev(leg) is the branch's commit.
    # test_bootstrap_non_utf8_branch.py, after :316
        assert rev(leg) == pin
    # test_bootstrap_branch_bytes.py, after :393, inside the first loop
            assert git("rev-parse", "HEAD", cwd=project / leg
                       ).stdout.strip()[:12] == pin12(project, leg)

NIT 2: in the body's "Row 4 and #1209" section, the tree sha does not match the command printed next to it.

  • Evidence, run in clone-r1302a with refs/l1/pr/1209 set to 13a2c58c (script .../r1302a/tools/mt2.sh and mt3.sh):
    merge-tree --write-tree 7837d499 refs/l1/pr/1209  -> 8db01c843302c2e220feb1431b37d4288a3cc401, exit 1
    merge-tree --write-tree HEAD refs/l1/pr/1209      -> 8e4ba1aba876c0610fc40b76f33b8ea5ad39cf24, exit 1
    merge-tree --write-tree origin/main refs/l1/pr/1209 -> 1095f4667f27c7e54f2d31e00b338b1fd8517c05, exit 1  (matches the body)
    
  • A conflicted tree holds the conflict-marker labels, which are the argument names. That is why the two spellings give two shas. The conflict itself is as the body says: CONFLICT (add/add): Merge conflict in tests/test_adopt_plan_paths_spelled.py, against main too.
  • Fix: print the command as it was run (HEAD refs/l1/pr/1209), or give 8db01c84... beside the printed command.

NIT 3: main has moved since the body was written.

The brief's checks

  1. Reproduced on main 34eb466e. Under Latin-1, the 4 failures of the issue's table: :232, :297 ([make-bootstrap]), :296 ([--branch-a<ff>b]) and branch_bytes.py:381. Under UTF-8 and ASCII the files pass (92 passed; 86 passed, 6 skipped).
  2. Each guard.
    • Each sits just before the first assert that spells the name: row 1 at :238-240, rows 2 and 3 at :317-318, row 4 at :394-395. Each is asked only of "a\udcffb" (in row 1, raw, which is the same text).
    • The trace shows that each guard is asked under UTF-8 and ASCII and does not skip (exc=None).
    • Row 1 is right to ask only where byte is true. Its other parameter (a\u00e9, with an upstream ending in U+00A0) is NEEDS_A_UTF8_PROCESS, and it skips at :199 under Latin-1 and ASCII. Under UTF-8 the guard passes a\u00e9 through. Its premise is also not A_BYTE_READ_AS_A_SURROGATE: in a one-byte locale fsencode("a\u00e9") is b"a\xe9", so the guard would skip with a false reason if that mark were ever lifted. Mutant R2 below is equivalent.
    • The reason pytest prints is byte for byte the body's quote (checked by script: True).
  3. The moved asserts. I used a sys.settrace plugin that counts the statements each test's frame ran (.../r1302a/plugin/r1302a_trace.py, compared with tools/cmpasserts.py).
    • Under UTF-8 and ASCII, main and head ask the same multiset of asserts with the same counts: row 1 6=6, rows 2 and 3 11=11 each, row 4 7=7, the U+00A0 parameter 6=6 (UTF-8 only).
    • The only change in text is result.stdout becoming stdout in the second loop of rows 2 and 3.
    • enumerate(printed, 1) keeps run numbers 1 and 2. placed does not depend on the loop, so moving it up is neutral. With the if not given / if given split, placed is asked twice in each row, as before.
    • No assert is lost, duplicated or weakened. Only the order changed: under UTF-8, a failure of run 1's name line is now reported after run 2 has run. The verdict is the same.
  4. By test id, main against head.
    • Under Latin-1 exactly the 4 ids go FAILED to SKIPPED. Under UTF-8 and ASCII no id changes (92 ids, same set; tools/cmp.py).

    • The new skips are [4] tests/conftest.py:1334. The 5 skips main already had are unchanged.

    • What runs before each skip under Latin-1:

      Row Runs before the skip Guard
      1 :233 exit 0, :234 no Traceback, :235 branch at the pin, :236 HEAD at the pin, :237 HEAD's bytes, each once skips at :239
      2 :309, :310, :311 twice each, :313 on main twice, :315 HEAD's bytes once skips at :317
      3 :309, :310, :311 twice each, :315 once skips at :317
      4 :383 skip_where_a_name_cannot_be_not_utf_8 (does not skip), :387 once, :389 and :393 twice each skips at :394

      This matches the body's table.

  5. The branch at the pin in rows 3 and 4. Weighed in NIT 1: a real gap, but nothing worse than on main, and the body discloses it. Row 4 misses the fault even under UTF-8, on main as at head, because their UTF-8 assert multisets are equal.
  6. Mutants. See the table below: 9 of my 10 killed, 1 equivalent. I re-ran the writer's M1 to M4 and got its counts exactly.
  7. Row 4 with 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.
  8. With assembly-root bootstrap.py: step (a) asks whether HEAD is on the tracking branch by the bytes git was handed, so under a Latin-1 locale tb\udcffx is said created, then on, where it said could not create branch and git refused (#1283) #1300.
    • At 066e4468: merge-tree is clean (tree 2466543c...), scratch commit 0fc5443ad.
    • At its current head dfd69ff7: also clean, scratch commit 8623190f5.
    • Both give the same 4 skips ([4] tests/conftest.py:1334), and every other id keeps its outcome under Latin-1 and UTF-8.
  9. Runs: all listed below. The list of tests/test_bootstrap_*.py files had 13 entries, checked non-empty and passed with xargs -d '\n' -a.
  10. The body.

Mutants

All ran in clone-r1302a at 7837d49. After each one, every touched file was written back from git cat-file blob HEAD:<path> and hash-object printed EQUAL every time. status --porcelain was empty at the end.

The writer's four ran over the two files, Latin-1 then UTF-8:

Mutant Latin-1 UTF-8
M1 1 failed, 83 passed, 8 skipped in 22.17s 92 passed in 23.63s
M2 2 failed, 83 passed, 7 skipped in 23.32s 92 passed in 25.18s
M3 1 failed, 83 passed, 8 skipped in 20.75s 92 passed in 22.03s
M4 4 failed, 83 passed, 5 skipped in 19.84s 92 passed in 21.79s

All 4 are killed.

My ten ran over the five ids of the four rows; on the correct tool those give 5 skipped under Latin-1 and 5 passed under UTF-8. A mutant that only moves or drops an assert cannot fail while the tool is right. So I paired each such mutant with a tool fault (TF) in bootstrap.py and compared it with the head running against the same fault.

The tool faults:

  • TF detaches the leg after the run. On head: 4 failed, 1 skipped / 4 failed, 1 passed. All four rows fail at HEAD's bytes, before their guards, which shows the asserts above each guard judge under Latin-1.
  • TF2 misprints row 3's on a\udcffb line. On head: UTF-8 1 failed, 4 passed.
  • TF3 leaves HEAD on another branch. On head: 4 failed, 1 skipped / 4 failed, 1 passed.
Id Mutant Correct tool With a fault Result
R1 row 1's guard moved to the top, before the run same as head TF, Latin-1: row 1 FAILED→SKIPPED killed
R2 row 1's guard asked for both parameters (no if byte:) same as head none can tell equivalent
R3 row 1's moved head_bytes assert dropped same as head TF: Latin-1 FAILED→SKIPPED, UTF-8 FAILED→PASSED killed
R4 guard of rows 2 and 3 moved to the top same as head TF, Latin-1: both FAILED→SKIPPED killed
R5 enumerate(printed, 1) → enumerate(printed) UTF-8 1 failed, 4 passed (row 2) n/a killed
R6 if given: → if not given: in the second loop same as head TF2, UTF-8: row 3 FAILED→PASSED killed
R7 guard of rows 2 and 3 asked of on Latin-1 2 failed, 3 skipped n/a killed
R8 row 4's guard moved to the top same as head TF, Latin-1: FAILED→SKIPPED killed
R9 row 4's head == assert dropped same as head TF3: Latin-1 FAILED→SKIPPED, UTF-8 FAILED→PASSED killed
R10 row 1's guard under if not byte: Latin-1 1 failed, 4 skipped n/a killed

Killed: 9 of 10. R5, R7 and R10 fail on the correct tool; the other six only with a paired fault. R2 survives as an equivalent mutant, for the reasons in check 2.

pytest summary lines

Main 34eb466e, the two files:

  • Latin-1: 4 failed, 83 passed, 5 skipped in 22.00s
  • UTF-8: 92 passed in 24.31s
  • ASCII: 86 passed, 6 skipped in 23.29s

Head 7837d499, the two files:

  • Latin-1: 83 passed, 9 skipped in 24.20s
  • UTF-8: 92 passed in 30.05s
  • ASCII: 86 passed, 6 skipped in 27.47s

Head 7837d499, wider runs:

  • Every tests/test_bootstrap_*.py (13 files), UTF-8: 643 passed, 3 skipped in 181.77s (0:03:01). The skips are test_bootstrap_ref_store.py:102, because this git makes no reftable repository.
  • test_path_guard_hygiene.py, test_no_auto_maintenance.py and test_repo_hygiene.py, UTF-8: 280 passed, 2 skipped in 28.75s. The skips are test_no_auto_maintenance.py:222.

Traced runs of the four rows (five ids):

Locale Head Main
Latin-1 5 skipped in 6.33s 4 failed, 1 skipped in 4.95s
UTF-8 5 passed in 6.66s 5 passed in 5.98s
ASCII 4 passed, 1 skipped in 5.63s 4 passed, 1 skipped in 5.62s

Head merged with #1209 (2212d959a):

  • Latin-1: 83 passed, 9 skipped in 19.82s
  • UTF-8: 92 passed in 21.30s
  • Row 4 alone, traced, Latin-1: 1 skipped in 1.48s

Head merged with #1300:

  • At 066e4468 (0fc5443ad): Latin-1 83 passed, 9 skipped in 20.07s; UTF-8 92 passed in 21.50s
  • At dfd69ff7 (8623190f5): Latin-1 83 passed, 9 skipped in 20.28s; UTF-8 92 passed in 21.46s

Head merged with main 5f06c3eb (a6df9dfc7):

  • Latin-1: 83 passed, 9 skipped in 21.50s
  • UTF-8: 92 passed in 23.16s
  • ASCII: 86 passed, 6 skipped in 19.55s

The mutant summary lines are in the tables above. None of these scratch commits was pushed.

CI at 7837d49 (gh pr checks, read-only): SonarCloud, package and tests-git-bash pass. tests was still pending when I read it.

What I did not cover

… a branch moved off the pin fails under Latin-1 too (r1302a NIT 1)

Review r1302a (issuecomment-6764610007) found #1302 READY and named this as
NIT 1. Rows 2 and 3 of tests/test_bootstrap_non_utf8_branch.py and row 4 of
tests/test_bootstrap_branch_bytes.py judged HEAD's bytes before the Latin-1
guard but never the commit HEAD names, so a tool that left the checked-out
branch one commit past the pin passed row 4 in every locale and skipped
rows 3 and 4 under Latin-1.

Each now asks for the leg's commit right after HEAD's bytes, before the
guard: `assert rev(leg) == pin` in rows 2 and 3, and the leg's `rev-parse
HEAD` against `pin12` in each leg of row 4. HEAD's bytes are already
asserted to be the branch, so the commit is the branch's commit. Nothing
else in either file changes.

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

Copy link
Copy Markdown

@brettheap

Copy link
Copy Markdown
Contributor Author

Delta review of #1302 (#1301) for lane openRepoShape-1, by r1302b (sonnet), 7837d49..371264b: READY

I found no MUST and no SHOULD, only three NITs. The delta is exactly r1302a's NIT 1 and nothing more, and no test id changes outcome in any locale. The new asserts catch the tool fault where 7837d499 skipped or passed. The neighbors and the merges with main (both 5f06c3eb and the newer b607223b) give the same outcomes. The live PR body matches the saved pr-body-only.md byte for byte, and Closes #1301 is the only closing form.

Setup:

  • Review worktree: /workspace/projects/openRepoShape-worktrees/_lane1-scratch/r1302b/wt-r1302b, detached at 371264be0be452b0a903375809c8173a43e7b6bf, clean.
  • Environment: the probe environment (stub gh first on PATH, GH_TOKEN=bogus-r1302b, empty GH_CONFIG_DIR, GIT_CONFIG_GLOBAL=/dev/null, GIT_SSH_COMMAND=false, EMAIL set, env -u LANES_LANE). One pytest call at a time, and df checked before each call.
  • Versions: Python 3.12.3, pytest 9.1.1, git 2.43.0.
  • Locale: the writers' Latin-1 build, read-only. A child Python reports iso8859-1, utf-8 and ascii for the three locales.
  • Logs: /workspace/projects/openRepoShape-worktrees/_lane1-scratch/r1302b/logs/.

1. The delta is the NIT and nothing more

$ git diff --stat 7837d499 371264be
 tests/test_bootstrap_branch_bytes.py    | 2 ++
 tests/test_bootstrap_non_utf8_branch.py | 1 +
 2 files changed, 3 insertions(+)
$ git diff --name-status 7837d499 371264be      -> M and M, the two files only
$ git log --format='%H %P' 7837d499..371264be   -> 371264be0be4... 7837d4997cc0...   (one commit, parent 7837d499)

The three added lines sit before each guard:

  • tests/test_bootstrap_non_utf8_branch.py:317: assert rev(leg) == pin. It follows HEAD's bytes at :315-316, and the guard is at :318-319. Rows 2 and 3 share this test.
  • tests/test_bootstrap_branch_bytes.py:394-395: assert git("rev-parse", "HEAD", cwd=project / leg).stdout.strip()[:12] == pin12(project, leg). It is inside the first loop, after HEAD's bytes at :393, and the guard is at :396-397.

These are the lines r1302a's NIT 1 gave, with the same text and indentation.

  • Blobs: 34eb466e to 371264be is ab427554 to 7fffdb2a and a2892e45 to 0b14df90, as the body says.
  • Counts: git diff --numstat 34eb466e 371264be gives 33/10 and 18/5, which is +51 -15 as the body says. git diff --check exits 0. Over-79-character added lines: 0. Non-ASCII lines: 0.
  • Commit: its trailers are Lane: openreposhape-1 (openRepoShape-1) and Co-Authored-By: Claude Sonnet 5.5.

2. No false failure

The two files, -v -rfs, one pytest call each:

Locale head 371264be 7837d499
Latin-1 83 passed, 9 skipped in 21.11s 83 passed, 9 skipped in 29.43s
UTF-8 92 passed in 24.80s 92 passed in 24.99s
ASCII 86 passed, 6 skipped in 19.24s 86 passed, 6 skipped in 20.85s

My script over the six saved -v logs, /usr/bin/python3 -I cmpids.py base head:

latin1: base 92 ids, head 92 ids, ids differing in outcome: 0, head counts {'SKIPPED': 9, 'PASSED': 83}
utf8:   base 92 ids, head 92 ids, ids differing in outcome: 0, head counts {'PASSED': 92}
ascii:  base 92 ids, head 92 ids, ids differing in outcome: 0, head counts {'PASSED': 86, 'SKIPPED': 6}
EQUAL

The 4 new Latin-1 skips are SKIPPED [4] tests/conftest.py:1334 in both runs.

3. The asserts have teeth

I ran four faults and compared head against 7837d499:

  • TF4: the writer's fault.py, read first, copied byte for byte.
  • TFB: my own, in fault-tfb.py. After main(), the branch moves to an unrelated root commit on the same tree.
  • TFC: my own, in fault-tfc.py. TF4, but it fires only after the second run of bootstrap.py, so it reaches rows 2 and 3 only. It checks that row 2's new assert (:317) can fail, since TF4 makes row 2 fail at :313 first.
  • TFB-first attempt: the branch moved to HEAD~1. It was a no-op, because the legs have one root commit. The result at head was 5 skipped under Latin-1 and 5 passed under UTF-8, so it says nothing. I replaced it with the unrelated-root version.

Results, by id ([R1] is [the-byte-0xff], [R2] is [make-bootstrap], [R3] is [--branch-a<ff>b], [R4] is the row 4 test), with the failing line from grep -n ':[0-9]*: AssertionError' on each log. TF4 and TFB gave identical per-id results and line numbers:

Fault Head Latin-1 UTF-8
TF4 and TFB 7837d499 2 failed, 3 skipped: R1 FAILED :235, R2 FAILED :313, R3 SKIPPED, R4 SKIPPED 3 failed, 2 passed: R1 :235, R2 :313, R3 FAILED :321, R4 PASSED
TF4 and TFB 371264be 4 failed, 1 skipped: R1 :235, R2 :313, R3 FAILED :317, R4 FAILED :394 4 failed, 1 passed: the same four lines
TFC 7837d499 2 skipped 2 passed
TFC 371264be 2 failed, both at :317 2 failed, both at :317

The U+00A0 parameter of row 1 skips under Latin-1 and passes under UTF-8 in every run, as the body says.

Messages at head under TF4, Latin-1:

row 3 :317  assert rev(leg) == pin      E  '32f41c687410efa28115d3ed156e0f68bdc5781e' (pin) vs 'cd4ce0435c9f5ca7becdca0c50588a7367d7c020'
row 4 :394  assert git("rev-parse","HEAD"...)[:12] == pin12   E  assert '2305122dda27' == '58f7f5d40ffa'
row 2 :313  placed in stdout            E  [spec] spec: PIN 32f41c687410 != branch main tip 5215b0e22366

Row 2 under TF4 fails at :313 before :317, as the body says. TFC shows :317 judges row 2 as well: it fails there at head, and 7837d499 skips or passes.

Restores. After every apply and restore pair, and again after all runs:

wt-fault-head HEAD=371264be blob@HEAD=41c2eb42b563 file=41c2eb42b563 status=''
wt-fault-base HEAD=7837d499 blob@HEAD=41c2eb42b563 file=41c2eb42b563 status=''
wt-r1302b     HEAD=371264be blob@HEAD=41c2eb42b563 file=41c2eb42b563 status=''
wt-base-r1302b HEAD=7837d499 blob@HEAD=41c2eb42b563 file=41c2eb42b563 status=''

The first four are the full blob 41c2eb42b56390a5b958940a0abc84e7a3c98db8, which is the body's. In wt-r1302b and wt-fault-head the two test files' blobs equal HEAD's (7fffdb2a, 0b14df90). I mutated only the two wt-fault-* worktrees, never the review worktree.

4. The neighbors

5. The body

I read the live body with a read-only gh pr view, and it equals pr-body-only.md (28956 bytes each, empty diff).

Matches what I measured:

Row 4's docstring, left unchanged: tests/test_bootstrap_branch_bytes.py:380-382 says "The run, could not create branch and HEAD's bytes judge there". It does not name the new commit assert. It does not matter for behavior or the verdict: the sentence is still true, only now one clause short, and the body's Known limits discloses it. See NIT 2.

Findings

NIT 1: the body's Base line is stale again. It says origin/main is 5f06c3eb.

  • Evidence:
    $ git ls-remote origin refs/heads/main      -> b607223b4a1c48ba6bdae9b02c16e7435592bd05
    $ git log -1 --format=%cd b607223b          -> 2026-11-10T06:22:30-04:00  (10:22:30Z)
    
    It is one commit (the validators) on 5f06c3eb. I measured it above: the merge is clean, and 0 ids differ in all three locales.
  • Fix: no edit is needed before landing. Lane 1's refresh makes it moot. If the body is edited anyway, name b607223b and give "clean, same outcomes by id under Latin-1, UTF-8 and ASCII".

NIT 2: rows 2 and 3's docstring has the same omission, and the body names only row 4's.

  • Where: tests/test_bootstrap_non_utf8_branch.py:293-294 says "Both runs, the line on main and HEAD's bytes judge there". tests/test_bootstrap_branch_bytes.py:380-382 is row 4's. Known limits names row 4's only.
  • Evidence: sed -n '293,294p' and sed -n '380,382p' show neither names the commit assert.
  • Fix: optional. Add "and the leg's commit" to both, and have Known limits say "rows 2 to 4's docstrings" instead of "row 4's". It is prose only.

NIT 3: a stale line number in the body's Measured section. The sentence says "the 5 skips main already had are unchanged: ... tests/test_bootstrap_branch_bytes.py:436 (UNWRITABLE)".

  • Evidence: the skip is reported at the @pytest.mark.parametrize of that row. It is :425 on 34eb466e, :436 at 7837d499 and :438 at head. Head's Latin-1 -rfs prints SKIPPED [1] tests/test_bootstrap_branch_bytes.py:438, and 7837d499's prints :436.
  • Fix: write :438 for head, or drop the number. No test depends on it.

Not covered

  • Python 3.14, which CI runs. The bench has 3.12.3. The delta adds no is_file, is_dir, exists or os.path check, so I did not build the pathlib shim. The path-guard hygiene test passes.
  • Locales and systems: only the writers' Latin-1 build. Windows and macOS were not run.
  • Mutants M1 to M4 were not re-run at head. They ran at 7837d499 and r1302a reproduced them. The three new lines add no guard, and the guard-dropping effect is covered by the base-versus-head fault runs above.
  • Main 34eb466e was not re-run under Latin-1. The 4 failed to 4 skipped claim rests on the body and r1302a.
  • Not run: tests/test_no_auto_maintenance.py (the delta sets no git config), tests/test_shape_doctor.py and tests/test_scaffold_leg_path_collisions.py (no adopt-project.py change), the rest of the doc trio, the full suite, and assembly-root bootstrap.py: step (a) asks whether HEAD is on the tracking branch by the bytes git was handed, so under a Latin-1 locale tb\udcffx is said created, then on, where it said could not create branch and git refused (#1283) #1300's merge (its head is now cb9ed806).
  • CI state of the head was not read.
  • Leftover worktrees: wt-r1302b, wt-base-r1302b, wt-fault-head, wt-fault-base, wt-merge-5f06 and wt-merge-b607 are registered in the shared repo. wt-merge-1209 is registered in the scratch bare repo mt.git. All are under /workspace/projects/openRepoShape-worktrees/_lane1-scratch/r1302b/ and clean. The scratch merge commits and the objects merge-tree wrote are unreferenced and unpushed. I changed no tracked file, committed nothing and pushed nothing. The shared checkout still shows only ?? handoffs.

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

sourcery-ai Bot commented Nov 10, 2026

Copy link
Copy Markdown

Sorry @brettheap, you've used your own review budget of 250,000 diff characters for the last 7 days.

You can request another review in 4 days and 8 hours by commenting @sourcery-ai review. Upgrade to get a review now.

This branch has not been deployed

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

Labels

None yet

Projects

None yet

1 participant