From e32b2703d733f6c60c1b2cba2d62d164d93d7b9a Mon Sep 17 00:00:00 2001 From: Brett Heap Date: Wed, 21 Oct 2026 12:29:28 +0000 Subject: [PATCH 1/2] shape_materialize.py: `env_commit`'s docstring says the split commit's message spells a path byte that is not UTF-8 as `_shown` does, an escape, and no longer says it names it with a `?` in its place, which #900 replaced (#1018) `env_commit`'s docstring said a `root` or `drop` entry holding a byte that is not UTF-8 is listed in the split commit's message "with a `?` in place of that byte, a path that does not exist". That was the behaviour before #900 (`caf?.md`). Since #900, `adopt-project.py`'s `_split_message` lists each path as `plan`'s report names it (`_shown`), so the byte 0xE9 reads `caf\udce9.md` between two backticks, with no surrogate in the message and no `?` in it. The docstring now says that, and keeps what stays true of `env_commit`: it writes a lone surrogate it is handed as `?` and raises nothing after both legs are pushed. Measured on main 2a119f281 with `cat -A` through `env_commit` and a real commit: the split message for `caf\udce9.md` reads ` `caf\udce9.md`$`, and a message holding the surrogate itself reads `Name: caf?.md$`. The docstring is the only change: the module's code is the same AST with its docstrings blanked. `scripts/shape_materialize.py` is no pinned copy (no project carries it, `FAMILY_COPIED_VERBATIM` and the assembly copies do not list it), so no pin or digest moves. Closes #1018 Lane: openreposhape-5 (openRepoShape-5) Co-Authored-By: Claude Sonnet 5.5 --- scripts/shape_materialize.py | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/scripts/shape_materialize.py b/scripts/shape_materialize.py index 81fd2ad6..284f3fa7 100644 --- a/scripts/shape_materialize.py +++ b/scripts/shape_materialize.py @@ -2346,13 +2346,17 @@ def env_commit(work: Path, message: str) -> None: commit `git_init_commit` makes (a scaffolded leg, a seeded one). `errors="replace"` works BOTH WAYS. Decoding, git's own output cannot - raise. Encoding, a character UTF-8 cannot carry is written as `?`: the - one such character a message can hold is a lone surrogate, the byte of a - name that is not UTF-8 as `Source.tree` keeps it. `adopt-project.py` - refuses one in a path it extracts (`entry_path_problem`), but a `root` - or `drop` entry holding one is listed in the split message, so there the - message names it with a `?` in place of that byte, a path that does not - exist, rather than raising after both legs are pushed. + raise. Encoding, a character UTF-8 cannot carry is written as `?`, and + nothing raises after both legs are pushed: the one such character a + message can hold is a lone surrogate, the byte of a name that is not + UTF-8 as `Source.tree` keeps it. `adopt-project.py` refuses one in a + path it extracts (`entry_path_problem`), and a `root` or `drop` entry + holding one is listed in the split message, but never raw: the message + names each path as `plan`'s report does (`_shown`, #900), so the byte + 0xE9 reads as an escape with no surrogate in it, `` `caf\\udce9.md` ``, + the path the source holds. Written raw it would be a `?`, `caf?.md`, a + path that does not exist, which is what this function still writes for + a lone surrogate it is handed. """ env = dict(os.environ) for key, fallback in (("GIT_AUTHOR_NAME", "openRepoShape scaffold"), From de89aa81b1533e32f1007f991aeae05cd915b36d Mon Sep 17 00:00:00 2001 From: Brett Heap Date: Wed, 21 Oct 2026 14:00:08 +0000 Subject: [PATCH 2/2] shape_materialize.py: `env_commit`'s docstring says the split message names an entry path as the source spells it only where the path is printable, since #900 spells any other as an escape, which the next paragraph says (#1018) rv1104's NIT 1. The paragraph above the one the first commit reworded still said the adoption's split message "names each entry path as the source spells it". Since #900 that is true of a printable path alone: `_split_message` lists any other path through `_shown`, as the escape the next paragraph describes. The sentence now says "(a printable one; see below)". Docstring only: the module's AST with its docstrings blanked is the same as the previous commit's. No test, README, doc, handbook or AGENTS.md text holds these words. Part of #1018 Lane: openreposhape-5 (openRepoShape-5) Co-Authored-By: Claude Sonnet 5.5 --- scripts/shape_materialize.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/shape_materialize.py b/scripts/shape_materialize.py index 284f3fa7..f1afb80d 100644 --- a/scripts/shape_materialize.py +++ b/scripts/shape_materialize.py @@ -2339,8 +2339,9 @@ def env_commit(work: Path, message: str) -> None: locale with that mode off -- and git keeps the bytes it is given. An adoption's split message already carried an em dash, which reached git there as a cp1252 byte, and it names each entry path as the source spells - it: `Übersicht.md` would land as another byte that is not UTF-8, and - `文書.md` would raise `UnicodeEncodeError` after both legs are pushed. + it (a printable one; see below): `Übersicht.md` would land as another byte + that is not UTF-8, and `文書.md` would raise `UnicodeEncodeError` after + both legs are pushed. Every caller's message goes the same way: `scaffold-project.py`'s assembly commit, `scripts/family.py`'s holder commit, and each first commit `git_init_commit` makes (a scaffolded leg, a seeded one).