Skip to content

openRepoShape: --version and two fetch refusals print $OPENREPOSHAPE_REPO and $OPENREPOSHAPE_REF with no check, so an escape or a bidi override in either reaches the terminal as typed, and a scaffold run sends its fetch with them #866

Closed

Description

@brettheap

Goal: the openRepoShape launcher checks $OPENREPOSHAPE_REPO and $OPENREPOSHAPE_REF once, before --version answers and before any fetch. Then no line it prints holds either value with a control character or a character a terminal draws as another, and no request is sent with one.

Filed by lane openRepoShape-2 on Brett Heap's word ("file it", 2026-10-18T01:07:11Z).

Lands after: lane 2's #837 (PR #841, fix/837-bin-dir-format-chars, head f2483cf1).

Lines

  • --version prints both values as typed and exits 0.
    • The line is openRepoShape:877 [:1003]: --version) refuse_bad_record; say "openRepoShape ($REPO @ $REF)"; exit 0 ;;.
    • Measured at both commits (bash 5.2.21, env -i, LANG=C.UTF-8):
      • with OPENREPOSHAPE_REPO set to acme/r, U+202E, x;
      • and OPENREPOSHAPE_REF set to v1, ESC, [31mX.
    • The output is openRepoShape (acme/r, the bytes E2 80 AE, x @ v1, the byte 1B, [31mX), and the exit is 0.
    • In a terminal, U+202E reverses how the text after it is drawn, and the escape turns the rest of the line red. This was not run in a terminal emulator here.
  • A scaffold run sends its fetch with both values, and its refusal names them as typed.
    • fetch_or_die (:234 [:234]) puts $REPO and $REF into the gh api path and into the raw.githubusercontent.com URL. Its refusal prints each value three times.
    • Nothing checks either value before the fetch at :1078 [:1204].
    • Measured with a stub gh and a stub curl first on PATH, both failing:
      • openRepoShape Atlas --org acme printed REFUSED: could not fetch setup.sh from acme/r, E2 80 AE, x at v1, 1B, [31mX. Both ways failed:;
      • then both command lines, with the same bytes;
      • then it exited 2.
  • --install's refusal for a failed fetch names both values as typed.
    • The refusal is in collect_commands (:280; the refusal at :301 [same]).
    • --install checks $REF first only when it records it ([ "$recording" -eq 0 ] || checked_ref "$REF", :528 [:633]). It never checks $REPO.
    • Measured with the same stubs: --install printed REFUSED: could not fetch openRepoShape from acme/r, E2 80 AE, x at v1, 1B, [31mX, so NOTHING was installed, and exited 2.

What is checked today

Direction

  • Check both values once, right after the arguments are read, beside refuse_bad_record (:986 [:1112]).
    • Use shape_checkout's rule and words for $OPENREPOSHAPE_REPO, and checked_ref's for $OPENREPOSHAPE_REF, misdrawn_characters included.
    • Every later place then prints only a checked value. shape_checkout's own check can stay as a second guard, or go.
  • Decide whether --version refuses with exit 2, as the other two places already do, or answers with a spelling that cannot be misdrawn. Say why.
  • --help names the variables and never their values, so it can keep answering first.
  • docs/cli.md:168 says "--version prints the ref in force". That stays true for every value the check passes.

Verify

Overlaps

Parent: #461.

Milestone: v1.1.1. Each line needs a value that the person set in their own environment. It is not a regression, and --doctor's clone already refuses the same values.

🤖 Generated with Claude Code

Activity

  1. added this to the v1.1.1 milestone on Oct 18, 2026
  2. brettheap commented on Oct 18, 2026

    @brettheap
    ContributorAuthor

    CLAIMED — lane openRepoShape-2, session 81650e29-c906-4fe8-96c9-55580bfe0c44@Eagle, 2026-10-18T01:14:00Z, for #866

    Logged in lanes/log/openRepoShape-2.md at 3497fd9679df903f01b787c3b181892aecc8b255.

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

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

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions