Skip to content

adopt-project.py: since #247 a byte that is not UTF-8 in --elected-by, --reference or the --source directory passes plan and check, and execute pushes both legs before it dies with UnicodeEncodeError in write_lf #255

Closed

Description

@brettheap

(lane openRepoShape-2, 2026-10-11T21:41:23Z) Found by this lane's review of PR #247 at a02240a, the second review lane openRepoShape-5 invited, and reproduced on main 4835fb4, where #247 landed at 21:25Z. It is a regression against main before #247 (54aa69a). Not claimed.

What is wrong. plan records --elected-by and --reference unchecked (adopt-project.py:1256-1257), and since #247 the plan writer writes a lone surrogate (a byte that is not UTF-8, as Python decodes argv and paths) faithfully, as "Jos\udce9". check passes it. execute creates and pushes both leg remotes (_create_leg_remotes, :2814) before it builds _template_values (:2821), which substitutes REFERENCE, ELECTED_BY, ELECTED_ON and CLONE_URL raw into templates/assembly-root/project.yaml:42,46 and README.md. materialize_assembly_root then raises in write_lf (scripts/shape_materialize.py:83), exit 1, a traceback, both legs left pushed. Before #247, plan raised on the same input and nothing was created.

Reproduction (local remotes; one case per row; driver argv_probe.py in the report directory below):

input main 54aa69a main 4835fb4
plan --elected-by b'Jos\xe9' plan 1 (traceback), check and execute 2 plan-unreadable, no leg plan 0, check 0 plan ok, execute 1 UnicodeEncodeError after Northwind-code.git and Northwind-spec.git are pushed
plan --reference b'ref-\xe9' the same the same
plan --source under a directory caf\xe9 (local remotes, so CLONE_URL carries it) the same the same

A hand-edited \ud800 in elected_by, elected_on or reference ends the same way.

Fix. Ask one_printable_line (scripts/shape_materialize.py:686) of every value execute substitutes into a template: in plan, before the plan is written, and in execute, before any leg exists. Add one test per input above.

Also, lower (P3), same family: a hand-edited \x00 or surrogate in local_path makes check and execute end in a traceback (adopt-project.py:407, shape_materialize.py:498) where main refused; nothing is created.

Report: opensoft/brett-wip handoffs/xFactory/attachments/lane-openRepoShape-2/review247-a02240a/final-report.md.

Activity

  1. brettheap commented on Oct 11, 2026

    @brettheap
    ContributorAuthor

    CLAIMED — lane openRepoShape-2, session 224cb7ce-54c8-4501-bfa8-7a7e398984a0@Eagle, 2026-10-11T21:58:33Z, for #255

    Logged in lanes/log/openRepoShape-2.md at a6a3d5789a99c7f89df229b9ba17f72340dbeb5f.

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

    1. existing `CLAIMED —` comments on opensoft/openRepoShape#255:
       none
    2. `gh pr list --repo opensoft/openRepoShape --state all --search "#255"`, kept where the row or its body names `#255`:
       none
    3. `git ls-remote --heads git@github.com:opensoft/openRepoShape` branches naming `255` as a whole token:
       none
    
  2. added 6 commits that reference this issue on Oct 12, 2026
  3. 6 remaining items

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions