Skip to content

validate-manifest.py accepts a display name holding a lone surrogate (name: "a\ud83db") and then raises UnicodeEncodeError printing it, so make validate and shape-doctor.py fail on a traceback instead of a finding while bump-leg.py and update-shape.py apply pass the same project once #254 lands #280

Closed

Description

@brettheap

Lane: openreposhape-5 (openRepoShape-5)

Found by this lane's adversarial review of #254's fix (fix/validator-child-encoding at 5757e29) as S1. It was scoped out of that PR because the defect is in the project's own validator, not in the two callers that PR changes. It is pre-existing: the run below is on main 60588d5. #254's change does not touch shape-doctor.py or the validators.

What is wrong. The double-quoted YAML reader turns the escape "a\ud83db" into a string holding a lone surrogate (U+D83D). The project's own scripts/validate-manifest.py accepts that string as the display name. It then raises at its own print(f"manifest ok: {manifest.get('name')} "... (templates/assembly-root/scripts/validate-manifest.py:707), because no UTF-8 stream can hold a lone surrogate under strict or surrogateescape. As a result:

So three launchers disagree about one project, and none of them names the problem.

cd <an assembly root that passes `make validate`, e.g. one scaffold-project.py made with --local-remote-dir>
python3 - <<'EOF'
import pathlib, re
p = pathlib.Path("project.yaml")
t = p.read_text(encoding="utf-8")
p.write_text(re.sub(r'(?m)^name: .*$', r'name: "a\\ud83db"', t, count=1), encoding="utf-8")
EOF
python3 scripts/validate-manifest.py > out.txt; echo "rc=$?"; tail -1 out.txt
git -c user.name=T -c user.email=t@example.invalid commit -qam rename
python3 <openRepoShape checkout>/shape-doctor.py --root .

Observed on main 60588d5, Python 3.12.3, Linux:

rc=1
UnicodeEncodeError: 'utf-8' codec can't encode character '\ud83d' in position 14: surrogates not allowed

  FINDING  manifest         the project's own scripts/validate-manifest.py reports a finding (exit 1): UnicodeEncodeError: 'utf-8' codec can't encode character '\ud83d' in position 14: surrogates not allowed
INVALID (manifest)   (exit 1)

The same project named Atlas prints manifest ok: Atlas (atlas), 3 legs, and the doctor reports no manifest finding.

Expected. Decide whether a display name may hold a lone surrogate.

Either way, add a test that runs name: "a\ud83db" through make validate, shape-doctor.py, a real bump-leg.py and update-shape.py apply.

Found by. handoffs/openRepoShape/attachments/lane-openRepoShape-5/reviewE-report.md (S1) in opensoft/brett-wip. The run above is new for this issue.

Not claimed.

🤖 Generated with Claude Code

Activity

  1. brettheap commented on Oct 12, 2026

    @brettheap
    ContributorAuthor

    CLAIMED — lane openRepoShape-5, session e62c2fd7-176d-429d-89fb-0653dd08ad5f@Eagle, 2026-10-12T11:02:04Z, for #280

    Logged in lanes/log/openRepoShape-5.md at ded12a774cd37ae5f226d6d67b26f4d679460eb1.

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

    1. existing `CLAIMED —` comments on opensoft/openRepoShape#280:
       none
    2. `gh pr list --repo opensoft/openRepoShape --state all --search "#280"`, kept where the row or its body names `#280`:
    281	bump-leg.py and update-shape.py hand the project's own validators an explicit PYTHONIOENCODING, so a real bump or `apply` on a project named `日本` is no longer refused as `bump-leg-validators-red` or `update-validators-red` under a cp1252 stdout (#254)	fix/validator-child-encoding	MERGED
    3. `git ls-remote --heads git@github.com:opensoft/openRepoShape` branches naming `280` as a whole token:
       none
    
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