Repository navigation
validate-manifest.py and validate-family.py: a line feed, or a character that does not print, in a value no pattern reads is refused by that key's code where it was manifest ok or family ok, and the five keys a person types keep #255's rule (#1205) - #1282
Conversation
…ter that does not print, in a value no pattern reads is refused by that key's code where it was `manifest ok` or `family ok`, and the five keys a person types keep #255's rule (#1205) A double-quoted `"...\n"` in `name`, `reference`, `elected_by`, a spec or code leg's `path`, `shape.repository` or `shape.digest_algorithm` of `project.yaml`, and in `name`, `org`, `repository`, `created_by`, `tracking_branch`, `shape.repository`, `shape.digest_algorithm` or a member pin's `digest_algorithm` of `family.yaml`, passed both gates, exit 0. Lane 3's ruling on #1205 (issuecomment-6742051321): the keys a person types (`name`, `elected_by`, `reference`; `name`, `created_by`) are held to #255's `unwritable_reason`, copied into each pinned validator, so the joiner and the no-break space the tools write stay valid; the others to `str.isprintable`. The adoption records' `path` and `resolution` are not asked, a key whose own check refuses such a value is not asked twice, and each key keeps its code. Six keys without one get one: `manifest-shape-digest-algorithm`, `family-repository`, `family-tracking-branch`, `family-shape-repository`, `family-shape-digest-algorithm`, `member-pin-digest-algorithm`. In `validate-family.py` the rule is in `_check_envelope`, which is what `family.py init` asks. Rows in tests/test_manifest_validator.py and tests/test_family.py, with a sweep of every scalar line of a scaffolded `project.yaml` and of a holder's `family.yaml` as the guard a new key meets. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Reviewer's GuideImplementationDefine the character-classification rule and diagnostics in both validators, including the distinct handling for typed text, line breaks, and non-printing characters.
Apply the rule at each affected manifest and family key, preserving existing finding codes and avoiding duplicate checks or findings.
TestsAdd shared scalar-line sweep support and tests for rejected characters, preserved typed text and adoption-record exemptions, finding behavior, and equivalence with the original rule.
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
…r that is not a line break says `Write it without that character.`, and each validator's copy of #255's rule is data a row holds to the original (#1205) PR #1282's fix round, after RV1282's review and SonarCloud's quality gate. - The way through is said by kind (RV1282's NIT 1). A line break's finding ends `Write it on one line.` and any other character's ends `Write it without that character.`, where every finding said `Write it on one line, without that character.`, which fits only a line break. - #255's rule, copied into each pinned validator, is data: `UNWRITABLE` (each kind's words with the categories or code points it is), `LINE_BREAK` and `UNPRINTABLE`, read by three short functions, `_held_kind`, `_first_held` and `_held_character`. Each copy is still its own (#610). Their code is identical; their docstrings and comments differ, each naming the other copy. SonarCloud counted the two copies' 27 lines as duplicated; the longest identical run of tokens is now 91, under its floor of 100. - A line break is named first in any value, wherever it is, as #255 names it. A value held to `str.isprintable` named its first character that does not print, even one before a line break. - Over all 0x110000 code points in RV1282's five contexts (5570560 values a copy), each copy answers as `unwritable_reason` and `str.isprintable` do: 0 mismatches of verdict or kind. - `test_each_copy_of_the_rule_answers_as_255_does` (RV1282's SHOULD) loads each validator with `load_without_bytecode` and holds its copy to `unwritable_reason` over every Unicode category boundary, the nine bidi controls, the C0 and C1 controls with the line breaks among them, and lone surrogates: 24240 values, under half a second a copy. - The two guards' sweep is one helper, `scalar_lines_not_refused` in tests/conftest.py, with `SCALAR_LINE`: SonarCloud counted the loop's 11 lines as duplicated. - The four composite assertions SonarCloud's S9073 named in tests/test_manifest_validator.py are split, and the refuse-rows in both modules check the way through. Lane: openreposhape-3 (openRepoShape-3) Co-Authored-By: Claude Opus 5.5 <[email protected]>
… so this PR merges with #1278, which changes the `conftest` import, without a conflict (#1205) The fix round's commit added `scalar_lines_not_refused` to the `from conftest import (...)` statement, which PR #1278 rewrites too: `git merge-tree` of the two heads stopped in conflict there. The name is imported on its own line after the `test_update_shape` import, clear of #1278's lines and of #1201's (`from repo_shape import`). Lane: openreposhape-3 (openRepoShape-3) Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
(lane openRepoShape-3, 2026-11-09T17:24:09Z) Lane 3's independent review of #1282 (for #1205, v1.2.1) after its fix round, by RV1282 and RV1282c (opus), neither of whom wrote #1282 or its round, at head This finishes RV1282's partial review of Heads, main and CI
RV1282's items on
|
| Mutant | What changes | Result | Killed by |
|---|---|---|---|
| M6 (RV1282's) | member-pin loop if False: |
6 failed | member-pin-digest-algorithm x LF, LF --no-members, CR, NBSP, ESC; the holder guard |
| M7 (RV1282's) | family name typed=False |
2 failed | [name-tab], [name-bidi-override] (as FX1282 says) |
| M8 (RV1282's), validate-manifest | bidi set without U+2066-U+2069 | 1 failed | new row [validate-manifest], "8 answers differ" |
| M8f, validate-family | the same | 1 failed | new row [validate-family] |
| M11 (mine), validate-manifest | {"Cs"} emptied in UNWRITABLE |
1 failed | new row only, "8 answers differ" (\ud800) |
| M12 (mine), validate-family | UNWRITABLE order: lone surrogate before not-UTF-8 |
1 failed | new row only, "4 answers differ" (\udc80) |
| M13 (mine), validate-family | a typed line break is not asked first (UNWRITABLE calls it a control character) |
7 failed | new row, and the 6 name/created_by line-break rows |
| M14 (mine), validate-manifest | with no line break, the last character held is named | 1 failed | new row only, "15 answers differ" |
M8, M8f, M11, M12 and M14 are each killed by the new row alone, so it is what holds each copy's data to #255.
6. The rows (106 = the first round's 97, the 2 new, and 7 older rows the -k also picks up; counted from --collect-only):
- Head:
106 passed, 210 deselected in 68.84s. - Main's validators swapped in:
84 failed, 22 passed, 210 deselected in 61.45s. The 84 are the 80 refuse-rows, the 2 guards and the 2 new rows. f71c2897's validators swapped in:82 failed, 24 passed, 210 deselected in 57.05s. The 82 are the 80 refuse-rows and the 2 new rows (AttributeError).- Both match the body. Each swap was restored,
cmpok, tree clean.
7. Gates on the head as checked out (clean, at the commit), one pytest at a time, through a stub gh, GH_TOKEN=bogus, GIT_SSH_COMMAND=false and GIT_CONFIG_GLOBAL=/dev/null:
- Gate 1 (
tests/test_manifest_validator.py tests/test_family.py):316 passed in 200.18s. No other module uses the new helper (git grep). - Gate 2 (the 12 guards and neighbours):
889 passed, 3 skipped in 278.88s. The skips aretest_stdout_encoding.py:289(Windows' own default) andtest_no_auto_maintenance.py:222x2 (session started withGIT_CONFIG_GLOBALset). - Gate 3 (write-path modules):
315 passed, 19 skipped in 188.02s. The skips aretest_family_init_values.py:229x16 and:301x3, both "this template quotes...". - Before the gates I moved two stray
templates/*/scripts/__pycache__folders, left by RV1282's 14:46 equiv run, into my scratch. A.pycundertemplates/breaks modules that read the templates as text. I usedmv, notrm; they are ignored files, not tracked ones.
8. Duplication. The two copies differ only in comments and docstrings (diff of the blocks, and the AST check). That is #610's rule working as intended: each pinned copy carries its own. Behaviour drift in either copy is caught:
- the typed rule and "a line break first" by the new row;
- the remedy by the refuse-rows in both modules.
The kind words' tails are not caught: see NIT 2. In the tests the duplicated loop is now one helper. SonarCloud's 0.0% (read by lane 3) is the measurement; I did not re-run cpd.py.
9. Merges. git merge-tree --write-tree of e91c57e96 is clean with everything below, and each tree equals the body's except current main, which the body predates.
| Merged with | Tree |
|---|---|
main ebb87168a (current) |
5cb730e1cc94046f8732ee6ccb3b0e108feb927d |
main 6740776 |
7973917da65d49ace0667ea9ae8c68bcb3a71838 |
#1201 24b6a0a |
45e33b5d557f84503271c526f0ce4d47dd2d3656 |
#1209 13a2c58 |
0e574daa9ee42825ca698a78fd375de46f2ca5d4 |
#1227 2d56c19 |
3bf652884076bae1d1a3073219e90e27818b0f70 |
#1246 0deac3a |
a0d3a667732b4dc40d6d155ef2fc1d1cc6996127 |
#1263 9ef8f0a |
8e6799f2dc1f6b0e16f94730986f3ab81188fd94 |
#1273 0657e39 |
cc8d530cb66bc334fc6cd168e23b198ab268a9c4 |
#1278 31f9427 |
b244928c15c7b001a23b5b37268726d6f9540908 |
gh pr list --json filesfinds no other open PR touching the five files.6235a0dcealone conflicts with tests: under a Latin-1 locale 12 of the 13 rows of #1259 skip on their 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 intests/test_family.py, which confirms whye91c57e96exists. The tree merged with tests: under a Latin-1 locale 12 of the 13 rows of #1259 skip on their 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 has the import lines of both PRs.- The helper names appear once in the conftest merged with tests/conftest.py and tests/test_adopt_plan_paths_spelled.py: under a one-byte locale such as Latin-1 the 0xff
--work-dirrow 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 asrun_scriptdoes (#1196) #1209.
10. The body.
- The Fix round section is true wherever I re-measured it: 106 rows, 84/22, 82/24, 24240 and 4007/6060, about 0.3 s, the equivalence result, M7, M8 and M8f, all eight trees, the tests: under a Latin-1 locale 12 of the 13 rows of #1259 skip on their 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 conflict, and
316 passed,889 passed, 3 skipped,315 passed, 19 skipped(my durations differ). - Both lines FX1282 corrected are now true. The example finding matches the head's output byte for byte, ending
Write it on one line.. Line 13 namesUNWRITABLE, read by_held_kind. - The Out of scope line for the member-row keys is there.
Closes #1205is the only closing keyword, andclosingIssuesReferencesis [1205].- The body is ASCII except the robot line (line 155, U+1F916). Sourcery's block is ASCII too.
- It is a draft with no milestone.
Findings
MUST: none.
SHOULD: none.
NIT 1: four line numbers in the body are f71c2897's. The round's import lines shift tests/test_manifest_validator.py by 2, so on the head:
:800(thevendor/nb\xa0sprow) is now:802;:420(thenamesurrogate's "1 finding(s)") is now:422;:46and:57(under Out of scope) are now:48and:59.
The SonarCloud and S9073 numbers in the Fix round are labelled as f71c289's and are right.
NIT 2, optional: the kind words' tails are pinned by no row and not compared between the copies. The words what prints it is split in two there, cannot tell what it holds, which does not print and console can hold appear in no row of the two touched modules. The rows match only each kind's opening words, and the new row only the part before the first comma. A reword in one copy would split the two validators' findings without failing anything. Verdict, kind, the character named and the remedy are all pinned (M8 to M14).
NIT 3: the merges list names main 6740776. Main is now ebb87168a (#1122). It touches none of the PR's files, and the merge is clean, tree 5cb730e1cc94046f8732ee6ccb3b0e108feb927d. One line would bring the list up to date.
Not measured, and paths
- Not measured:
- the equivalence sweep under CI's Python 3.14 (Unicode 16); the new row runs there inside
tests, which was still pending; - a Latin-1 locale (none on this host; RV1282 noted the same);
- FX1282's M9 and M10 (M13 and M14 cover the same functions);
- SonarCloud's duplication, which lane 3 read rather than me re-running
cpd.py.
- the equivalence sweep under CI's Python 3.14 (Unicode 16); the new row runs there inside
- Adopt is now covered on the head by Gate 2 (
test_adopt_template_values.py) and Gate 3 (test_adopt_manifest_values.py). - Clone:
/workspace/projects/openRepoShape-worktrees/_lane3-scratch/RV1282, detached ate91c57e96, clean, both validators checked withcmp. - Scratch:
/workspace/projects/openRepoShape-worktrees/_lane3-scratch/RV1282-scratchCHECKPOINT.md, updated: nothing in flight;- my scripts and logs in
c/:equiv-c.py,delta.py,e2e.py,row-on-prev.py,mutate-c.py,mutants-c.sh,swap-c.sh,chain-c.sh,equiv-new.log,delta.log,e2e.log,mutant-*.log,swap-*.log,each-copy.log,gate-*.log,chain.log; - the moved
__pycache__folders inc/pycache-aside/.
I pushed, commented, approved and set nothing, and I wrote nothing outside my clone and scratch.
|
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 5 days and 19 hours by commenting |
…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]>
|
…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]>



What changed
A v1.2.1 fix for #1205, found by lane 5's independent review of #1166 (finding 8, issuecomment-6352173084). It lands under Brett Heap's v1.2.1 merge word (2026-10-23T13:10:26Z) once reviewed and green.
A double-quoted
"...\n"in a key no pattern reads wasmanifest okorfamily ok, exit 0.namesplit the ok line in two. A leg'spathso read passed this step and failedmake validatetwo steps later, atvalidate-pins.py'spin-gitlink-absent. Each such key now gives one finding, under its own code, naming the key, the value and the character:The rule is lane 3's ruling on the issue (W1205's option B, #1205 (comment)), not
isprintable()in every key. The issue's filer raised no objection on the issue after the ruling.name,elected_byandreferenceinproject.yaml, andnameandcreated_byinfamily.yaml, refuse what adopt-project.py: since #247 a byte that is not UTF-8 in--elected-by,--referenceor the--sourcedirectory passesplanandcheck, andexecutepushes both legs before it dies withUnicodeEncodeErrorinwrite_lf#255'sunwritable_reasonrefuses (scripts/shape_materialize.py:2891): a line break (CR, U+0085 and U+2028 among them), a lone surrogate, a byte that is not UTF-8, a bidi control or another control character. Both pinned validators get a copy of that rule (UNWRITABLE, read by_held_kind; see "Fix round" below). It uses the standard library only, and a comment names adopt-project.py: since #247 a byte that is not UTF-8 in--elected-by,--referenceor the--sourcedirectory passesplanandcheck, andexecutepushes both legs before it dies withUnicodeEncodeErrorinwrite_lf#255 and where the original lives.str.isprintable()refuses. Inproject.yamlthat is a spec or code leg'spath,shape.repositoryandshape.digest_algorithm. Infamily.yamlit isorg, the holder's ownrepository,tracking_branch,shape.repository,shape.digest_algorithmand each member pin'sdigest_algorithm.pathandresolution.adopt-project.pywrites them with control characters and no-break spaces on purpose;tests/test_manifest_validator.py:802keepsvendor/nb\xa0spvalid, and a new row keepsvendor/Icon\rand a tab inresolutionvalid.id, the dates, therepositorypatterns,tracking_branchand a leg'sbranchinproject.yaml, anamesurrogate (tests/test_manifest_validator.py:422still says "1 finding(s)"),neutral_product_pinsandreferent_chain. A spec or code leg'spathfinding is said alone, and so is a familynamefinding, which is not then classified as well (naming-unclassified).manifest-name,manifest-reference,manifest-elected-by,manifest-leg-path,manifest-shape-repository,family-name,family-organdfamily-created-by. So the scaffold's, adoption's andfamily.py init's refusals still name the flag (scripts/shape_materialize.py:5661,scripts/family.py:3538). Six keys had no code and get one:manifest-shape-digest-algorithm,family-repository,family-tracking-branch,family-shape-repository,family-shape-digest-algorithmandmember-pin-digest-algorithm. AGENTS.md names none of the codes beside them, so it does not change, andtests/test_agents_md_codes.pypasses.validate-family.pythe rule is in_check_envelope(a new_check_characters, plus thename,organdcreated_bychecks), which is allfamily.py initasks (scripts/family.py:3603). So--no-membersasks it too, and--pins(the lockstep alone) does not.The issue's U+00A0 rows are dropped for the five free-text keys, on purpose.
scaffold-project.pywritesname: "Atlas\xa0One"andelected_by: "Ali\u200cReza", andfamily.py initwritescreated_by: "Ali\u200cReza". Each is valid today, andisprintable()is false for each. #255 keeps them: a Persian name joins its parts with U+200C. That rule is pinned bytests/test_adopt_template_values.py:658and:715andtests/test_bootstrap_spelling.py:311-331. The issue's own rule would refuse manifests the tools write, and a project already scaffolded with such a name would fail validation afterupdate-shape.pybrings in the new validator. A line feed is refused in every key, which is the defect the issue names. Refusing U+00A0 there too would overturn #255 and needs Brett Heap's ruling.Measured, before and after
W1205's probe (
probe1205.py: a scaffold and afamily.py init, offline, through a stubgh) rewrites each line as a double-quoted value with a trailing\n. It ran on main2fde6c3(a detached worktree) and on this head's validators:project.yamlkeynamemanifest ok: Atlas, then(atlas), 3 legsmanifest-name, 1 findingreferencemanifest-referenceelected_bymanifest-elected-bypath, code legpathmanifest-leg-pathshape.repositorymanifest-shape-repositoryshape.digest_algorithmmanifest-shape-digest-algorithmfamily.yamlkeynameok InkRouter, then: family (declared by family.yaml)family-name, 1 findingorgfamily-orgrepositoryfamily-repositorycreated_byfamily-created-bytracking_branchfamily-tracking-branchshape.repositoryfamily-shape-repositoryshape.digest_algorithmfamily-shape-digest-algorithmOn both sides, the untouched manifests are exit 0, and so are the values the tools write:
name: "Atlas\xa0One",elected_by: "Ali\u200cReza"(manifest ok: Atlas\xa0One (atlas), 3 legs) andcreated_by: "Ali\u200cReza"(family ok: InkRouter (inkrouter), 0 member(s)).digest_algorithm: bananastaysmanifest ok(part 3, out of scope below).Rows
97 new rows. 82 fail on main
2fde6c3, measured with main's two validators swapped in and then restored, each checked withcmp. The other 15 are keep-rows that pass on both sides by design.tests/test_manifest_validator.py(54):test_a_value_ending_in_a_line_break_is_one_finding_of_its_key: 7 keys x LF and CR, each one finding of the key's code, naming the code point.test_a_value_that_must_print_refuses_what_does_not: 4 keys x U+00A0, TAB and U+202E.test_a_typed_value_refuses_what_255_refuses: 3 keys x TAB, ESC, U+202E and U+2028. Plustest_a_typed_value_holding_a_byte_that_is_not_utf8_is_a_findingforreferenceandelected_by(\udce9).test_a_typed_value_keeps_what_255_keeps, 3 keys x U+00A0, U+200C, U+3000 and U+00AD; andtest_a_record_keeps_the_characters_the_source_held.test_every_scalar_line_ending_in_a_line_feed_is_refused. It rewrites every scalar line of a scaffoldedproject.yaml(32), one at a time, as"<value>\n". Each must be refused by name, a finding or a refusal, never exit 0 and never a traceback. A key added to the template that no check refuses fails it by its line.tests/test_family.py(43):test_a_holder_value_ending_in_a_line_break_is_one_finding_of_its_key: 8 keys x (LF with members checked, LF under--no-members, CR).test_a_holder_value_that_must_print_refuses_what_does_not: 6 keys x U+00A0 and ESC.test_a_typed_holder_value_refuses_what_255_refuses:nameandcreated_byx TAB and U+202E, each one finding.test_a_created_by_keeps_what_255_keeps, U+00A0 and U+200C.test_every_holder_scalar_line_ending_in_a_line_feed_is_refused, over every scalar line of a holder'sfamily.yaml, both member rows included. A member pin'scommitwith a line feed is refusedmember-pin-commit, exit 2 (repo_shape.py and bootstrap.py:COMMIT_RE,SHA256_REandCOMMIT_40end in\Z, not$, so a pin'scommit:ortree_sha256:that ends in a line break is refused as not 40 or 64 hex by every validator andadopt-project.py(#1017) #1126's rule), which counts as refused.Mutants
Each was applied, run and restored, and every restore was checked with
cmp. All four are killed.validate-manifest.py: the free-text keys askedisprintable()(the issue's rule). 21 failed: everykeeps_what_255_keepsrow, and the refuse-rows whose words differ.validate-manifest.py: the leg-path rule removed. 11 failed: the spec and code path rows and the sweep.validate-family.py:_check_charactersnot called from_check_envelope. 25 of 25 selected failed.validate-family.py: the familynamefinding not said alone (the classifier asked as well). Killed bytest_a_typed_holder_value_refuses_what_255_refuses[name-bidi-override]("1 finding(s)").Gates
One pytest at a time, on the commit
f71c289(Python 3.12.3, a stubghfirst on PATH,GH_TOKEN=bogus,GIT_SSH_COMMAND=false,GIT_CONFIG_GLOBAL=/dev/null):tests/test_manifest_validator.py tests/test_family.py. Result:314 passed in 160.66s.test_family.pyimports only plain helpers fromtest_commit_trailersandtest_update_shape, no fixtures. A first run on the dirty tree failed the threeupdate-shaperows oftest_family.pywithupdate-conflict: they compare a holder's copy ofvalidate-family.pywith the committed template. On the commit they pass.tests/test_repo_hygiene.py tests/test_agents_md_codes.py tests/test_git_output_decoding.py tests/test_stdout_encoding.py tests/test_cli_reference.py tests/test_no_auto_maintenance.py tests/test_update_add_codes_documented.py tests/test_bootstrap_spelling.py tests/test_adopt_template_values.py tests/test_pinned_copy_text.py tests/test_link_source_chain_defaults.py tests/test_template_text_placeholders.py.test_pinned_copy_text.pyimports the module-scopedpinnedfixture, so its owner ran beside it. Result:889 passed, 3 skipped in 254.78s. The skips: Windows' own default (test_stdout_encoding.py:289), and a session started withGIT_CONFIG_GLOBALset (test_no_auto_maintenance.py:222, 2).tests/test_family_init_values.py tests/test_family_init_yaml_words.py tests/test_scaffold_manifest_values.py tests/test_adopt_manifest_values.py. Result:315 passed, 19 skipped in 185.41s. Every skip is that module's own premise: this template quotes the placeholder.Merges
git merge-tree --write-treeof this headf71c2897885c59f4216c8cce6802ca6ba3f10ad9:2fde6c3, its parent: clean, tree467960a284cde754274ac42b90efc6ffefe2a4f2;6740776, which landed since and touches onlyadopt-project.pyand its own new test: clean, treeac9fb139bccb74c7791e9310dd8d40ab18b2f7f8;31f9427: treeabd44382d81eaada22ba373f49aaeb6bebf4afc7;id:that is no project id ismember-id-malformedin every mode, and so is a mounted member's ownproject.yamlid:, with thebumpthat writes the row from that file (#1204) #12730657e39: treee4dbd870f7011956593b3a98fed9dd4f83188ed4;HEADthis user cannot open, under.git/modules/<path>or in a.gitdirectory, is refusedmember-unreadableby name, where it endedmember-commit-unresolvablewith a fetch (#1256) #12639ef8f0a: treedea2998182d54212907221116d118c33ed135a33;.gitfile this user cannot open, or whose git directory (its own.git, or the one its gitfile names) this user cannot search, is refusedmember-unreadablenaming that part, and no longermember-commit-unresolvable, which said the pinned commit was missing and prescribed a fetch (#1221) #12460deac3a: tree781887ce3ab2334e3492120f8d613f842d97c205;.gitmodulesbeside the work tree's and its stage remedies endgit add -- .gitmodules, an index file git cannot parse is refused, and an unmerged one is read as none (#1150) #12272d56c19: tree0b821d183a377e2c6e0889455f2cc3c2c34fd930;add,bumpandremovelines its remedies name begin with the interpreter and the script's path, quote the row's name, fill in the family's org, say the branch they run on, andmember-already-presentprints itsremove(#1127) #120124b6a0a: treed0939ecd3bab176dd34b757e617846e190bac7c7.Fix round
After RV1282's review and SonarCloud's quality gate: two commits on
f71c289, pushed as a fast-forward.6235a0dis the round.e91c57emoves one import so this PR still merges with #1278 without a conflict.validate-family.py:714-740=validate-manifest.py:861-887(the copied rule) andtests/test_family.py:1032-1042=tests/test_manifest_validator.py:1005-1015(the guard's loop).CONTRACTS_DIRsentence is false for every scaffolded root, and the chain WARNING offers remedies the scaffold lacks (one shape bump before the v1.1.0 tag) #610), now as data:UNWRITABLE(each kind's words, with the categories or code points it is),LINE_BREAKandUNPRINTABLE, read by three short functions,_held_kind,_first_heldand_held_character. The two copies' code is identical; their docstrings and comments differ, each naming the other copy.scalar_lines_not_refusedintests/conftest.py, withSCALAR_LINE.f71c289it gives SonarCloud's own 76 lines and 4 blocks, line for line. Across the repository, it counts at 101, 103 and 107 tokens the runs SonarCloud reports on main, and at 90, 93 and 97 tokens runs it does not. The longest identical run left is the copied data, 91 tokens over 15 lines; the longest in the tests is 32 tokens.tests/test_manifest_validator.py:905,:924,:942and:955(f71c289's lines): each is split.test_each_copy_of_the_rule_answers_as_255_doesloads each validator withload_without_bytecode, astests/test_assembly_root_unreadable_paths.py:261does. It asks each copy 24240 values: every code point where the Unicode category changes and the one before it (4007 changes, 6060 code points with the rest), the nine bidi controls, the C0 and C1 controls with the line breaks among them, and lone surrogates. Each is asked alone, between two letters, after an ESC and before a line feed. A typed value must be refused whereunwritable_reasonrefuses it, as the same kind; any other value wherestr.isprintableis false; and a line break must be the character named. It takes about 0.3 s a copy.Write it on one line.; any other character's endsWrite it without that character.The refuse-rows in both modules now check it.--elected-by,--referenceor the--sourcedirectory passesplanandcheck, andexecutepushes both legs before it dies withUnicodeEncodeErrorinwrite_lf#255 names it. A value held tostr.isprintablenamed its first character that does not print, even one before a line break.The equivalence sweep. RV1282's
equiv.py, with only the names changed, compares each copy withunwritable_reasonandstr.isprintable. It covers all 0x110000 code points in five contexts, 5570560 values per copy. Result for each validator: 0 accept/refuse mismatches, 0 kind mismatches, 0isprintablemismatches. The copies' code is identical, and the bidi set equals #255'sBIDI_CONTROLS.Rows. Two new:
test_each_copy_of_the_rule_answers_as_255_does[validate-manifest]and[validate-family]. The 80 refuse-rows, 40 in each module, now also check the way through. The-kselection is the first round's 97 rows, these 2, and 7 older rows it also picks up: 106 in all.6740776's two validators swapped in:84 failed, 22 passed. The failures are the first round's 82 and the 2 new rows; the 22 are the 15 keep-rows and the 7 older rows.f71c289's validators swapped in:82 failed, 24 passed. The failures are all 80 refuse-rows, since the old way through fits none of their checks now, and the 2 new rows.cmp.Mutants, on
6235a0d, whose validatorse91c57edoes not change. Each was applied, run over the 106-row selection and restored, and every restore was checked withcmp. All five are killed.validate-family.py: the familynameis held toisprintableinstead of adopt-project.py: since #247 a byte that is not UTF-8 in--elected-by,--referenceor the--sourcedirectory passesplanandcheck, andexecutepushes both legs before it dies withUnicodeEncodeErrorinwrite_lf#255's rule. 2 failed:test_a_typed_holder_value_refuses_what_255_refuses[name-tab]and[name-bidi-override], whose finding then says "a character that does not print".validate-manifest.py: the bidi set without U+2066 to U+2069. 1 failed, the new row[validate-manifest]: "8 answers differ", U+2066 to U+2069 alone and between letters. No other row uses an isolate.validate-family.py: 1 failed, the new row[validate-family].validate-manifest.py: no line break named first (_first_heldreturns the first character held). 1 failed, the new row.validate-family.py: the old remedy for every kind. 40 failed: every family refuse-row.Gates, on the commit
e91c57e, one pytest at a time, in the same environment as above:tests/test_manifest_validator.py tests/test_family.py. These are the only two that use the newtests/conftest.pyhelper. Result:316 passed in 266.34s.889 passed, 3 skipped in 367.49s, the same three environmental skips.tests/test_family_init_values.py tests/test_family_init_yaml_words.py tests/test_scaffold_manifest_values.py tests/test_adopt_manifest_values.py. Result:315 passed, 19 skipped in 286.16s, the same template-quoting skips.f71c289's validators swapped in, as under Rows.Merges.
git merge-tree --write-treeofe91c57e96e7fa4987e1f8be7a8a7930296ca4678is clean with each of these:6740776: tree7973917da65d49ace0667ea9ae8c68bcb3a71838;ebb87168a(adopt-project.py: anorg/repo--sourcetoo long for the disk is refused as a path is, naming no GitHub repository and offering no url, so--source <300 a's>/Thingis no longer offeredhttps://github.com/<300 a's>/Thing, which can never clone (#1003) #1122) andf5bb4b449(adopt-project.py:checkandexecuteask a plan'sorg:andid:right after its three repository names, so a bad one beside an unanswered entry, a moved source, a refused name or another repository is that one refusal in both, and apins:entry that is no pin is said as_read_assays it (#1020) #1125), which landed since and touch none of this PR's files: trees5cb730e1cc94046f8732ee6ccb3b0e108feb927dand6e9f01798085be2b8708d4ee0753c0436116a58d;add,bumpandremovelines its remedies name begin with the interpreter and the script's path, quote the row's name, fill in the family's org, say the branch they run on, andmember-already-presentprints itsremove(#1127) #120124b6a0a: tree45e33b5d557f84503271c526f0ce4d47dd2d3656;--work-dirrow 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 asrun_scriptdoes (#1196) #120913a2c58, which touchestests/conftest.py: tree0e574daa9ee42825ca698a78fd375de46f2ca5d4;.gitmodulesbeside the work tree's and its stage remedies endgit add -- .gitmodules, an index file git cannot parse is refused, and an unmerged one is read as none (#1150) #12272d56c19: tree3bf652884076bae1d1a3073219e90e27818b0f70;.gitfile this user cannot open, or whose git directory (its own.git, or the one its gitfile names) this user cannot search, is refusedmember-unreadablenaming that part, and no longermember-commit-unresolvable, which said the pinned commit was missing and prescribed a fetch (#1221) #12460deac3a: treea0d3a667732b4dc40d6d155ef2fc1d1cc6996127;HEADthis user cannot open, under.git/modules/<path>or in a.gitdirectory, is refusedmember-unreadableby name, where it endedmember-commit-unresolvablewith a fetch (#1256) #12639ef8f0a: tree8e6799f2dc1f6b0e16f94730986f3ab81188fd94;id:that is no project id ismember-id-malformedin every mode, and so is a mounted member's ownproject.yamlid:, with thebumpthat writes the row from that file (#1204) #12730657e39: treecc8d530cb66bc334fc6cd168e23b198ab268a9c4;31f9427: treeb244928c15c7b001a23b5b37268726d6f9540908.6235a0dalone conflicted with #1278 intests/test_family.py, where both edit theconftestimport.e91c57eimports the new name on its own line.Out of scope
digest_algorithm == sha256, the issue's optional part 3.bananais still valid; no tool reads the value.path,orgor the holder'srepository, and the project's white-space rule for the family'stracking_branch.id:: validate-family.py: no pattern is asked of a member row'sid:, so an id that ends in a line feed or holds a space isfamily okunder--no-members, and a row that main'sfamily.py addwrote staysfamily ok(#1166 follow-up) #1204, PR validate-family.py: a member row'sid:that is no project id ismember-id-malformedin every mode, and so is a mounted member's ownproject.yamlid:, with thebumpthat writes the row from that file (#1204) #1273, which merges clean with this.--no-members(RV1282's NIT 2): itsproject,repository,revision_kind,commit,digest_definitionandtree_sha256holding a line feed stayfamily ok, on main and here.--no-membersreadsfamily.yaml's envelope alone, by design, so of a member row it asks only the pin'sdigest_algorithm(_check_characters). Itsidis validate-family.py: no pattern is asked of a member row'sid:, so an id that ends in a line feed or holds a space isfamily okunder--no-members, and a row that main'sfamily.py addwrote staysfamily ok(#1166 follow-up) #1204's (PR validate-family.py: a member row'sid:that is no project id ismember-id-malformedin every mode, and so is a mounted member's ownproject.yamlid:, with thebumpthat writes the row from that file (#1204) #1273).id, the dates and therepository:patterns: validate-manifest.py, validate-family.py, family.py and update-shape.py: anid:, a date or arepository:ending in a line feed is refused by name, and a pin'ssource_repository:that is no path orowner/reponame is named as the pin's (#1139) #1166 (validate-manifest.py and validate-family.py:PROJECT_ID_RE,DATE_REandQUALIFIED_REend in$, so anid:, a date or arepository:that ends in a line break passes as well formed (#1126 follow-up) #1139).shape.commitandtree_sha256: repo_shape.py and bootstrap.py:COMMIT_RE,SHA256_REandCOMMIT_40end in\Z, not$, so a pin'scommit:ortree_sha256:that ends in a line break is refused as not 40 or 64 hex by every validator andadopt-project.py(#1017) #1126 (tests/test_manifest_validator.py:48and:59).family.py'sFINDING_PLACEHOLDER(scripts/family.py:3538) has no row for the six new codes. A finding under one is refused in the validator's words, without a flag to point at, as that table's comment says.Closes #1205
Lane: openreposhape-3 (openRepoShape-3)
🤖 Generated with Claude Code
Summary by Sourcery
Validate previously unchecked manifest and family text values so line breaks and other prohibited characters are reported under the appropriate key-specific finding.
Bug Fixes:
Enhancements:
--elected-by,--referenceor the--sourcedirectory passesplanandcheck, andexecutepushes both legs before it dies withUnicodeEncodeErrorinwrite_lf#255’s unwritable-character rules to human-entered names and attribution fields while requiring printable characters for other applicable metadata and paths.Tests: