Skip to content

scripts/repo_shape.py load_yaml catches OSError and YamlError but not UnicodeDecodeError, so a plan or manifest holding a non-UTF-8 byte makes adopt-project.py check and execute exit 1 with a traceback instead of REFUSED yaml-unreadable #192

Closed

Description

@brettheap

(lane openRepoShape-2, 2026-10-09T08:57:19Z) Found by this lane's review of PR #187 (#169) at 8a542bd (its N2); pre-existing on main 21f5c33 and outside #169's region (scripts/repo_shape.py). Not claimed.

What is wrong. scripts/repo_shape.py:624-632 load_yaml catches OSError around read_text(encoding="utf-8") and YamlError around the parse, but not UnicodeDecodeError. A YAML file holding a byte that is not UTF-8 (a raw 0xff inside a leg path of an adoption plan, in the probe; any manifest, pin or plan the tools read is the same path) therefore escapes as a Python traceback:

adopt-project.py check --plan adoption-plan.yaml     # exit 1, UnicodeDecodeError traceback, no FINDING line
adopt-project.py execute --plan adoption-plan.yaml   # exit 1, same traceback, no REFUSED line

No leg repository is created, so nothing is damaged; but the contract is that an unreadable input is a REFUSED yaml-unreadable line with a remediation, exit 2, the way an unreadable file or an unparsable one already is. plan itself refuses the value on its alphabet (#169 / PR #187), so the file reaches this state only by hand-editing or a foreign writer, which is what check is for.

Fix. Catch UnicodeDecodeError with OSError in load_yaml and raise Refusal("yaml-unreadable", f"{path}: not UTF-8 at byte {exc.start}", "Remediation: ..."); one test per reader that goes through it (check, execute, the doctor, validate-manifest.py). Driver: opensoft/brett-wip handoffs/xFactory/attachments/lane-openRepoShape-2/review187-8a542bd/tools/matrix.py (row b-non-utf8).

Activity

  1. brettheap commented on Oct 9, 2026

    @brettheap
    ContributorAuthor

    CLAIMED — lane openRepoShape-2, session 3a133e77-1ea9-415a-a670-47833e18c505@Eagle, 2026-10-09T13:26:56Z, for #192

    Logged in lanes/log/openRepoShape-2.md at 5fcfa0bb2c57bc7d3346c792c76c812553a2dec3.

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

    1. existing `CLAIMED —` comments on opensoft/openRepoShape#192:
       none
    2. `gh pr list --repo opensoft/openRepoShape --state all --search "#192"`, kept where the row or its body names `#192`:
       none
    3. `git ls-remote --heads git@github.com:opensoft/openRepoShape` branches naming `192` 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