Skip to content

openreposhape package: ref_fault keeps the old ref rule, so it takes a.lock/b, a/.b, a//b, a/b/ and a., clones the standard in full and fails at git checkout, where the launcher, setup.sh and install.sh refuse them first (#874) #941

Closed

Description

@brettheap

Goal: the package's ref_fault holds the rule that the launcher, setup.sh and install.sh hold since #874, in the same words. Then a ref git refuses part by part (a.lock/b, a/.b, a//b, a/b/, a.) is refused before any git call, not after a full clone of the standard, and a test holds the package's copy to git and to the launcher's words as it holds theirs.

Filed by lane openRepoShape-2 on Brett Heap's word ("file all", 2026-10-18T14:45:31Z).

path:line is at the v1.1.1 release commit 50178305, which holds #874 (33c5128b, PR #875) and #857 (1ef1a018, PR #873).

  • How it was measured: bash 5.2.21, Python 3.12.3 and git 2.43.0, each run with an explicit minimal environment, a stub gh and curl first on PATH, GH_TOKEN=bogus, an empty GH_CONFIG_DIR, GIT_SSH_COMMAND=false and GIT_CONFIG_GLOBAL=/dev/null.
  • No request left the machine: OPENREPOSHAPE_REPO was a local bare clone of this repository.
  • "The package" is a copy of src/openreposhape/ laid out as the wheel lays it, with no checkout beside it, as installed_copy in tests/test_openreposhape_package.py makes one.

Lines

  • ref_fault's shape check is the old line.
  • A ref the package takes and git refuses reaches git: one git ls-remote, one full git clone, one git checkout, and then the refusal.
    • prepare (standard.py:621) asks target (:635), which takes the ref, then remote_commit (:644), which asks git ls-remote and finds nothing for a name git refuses, so the commit is unknown. clone_into (:482) then runs git clone --quiet --no-checkout (:507), with no --depth, because the doctor's currency row needs the history (standard.py:14 to :16). git checkout (:519 to :521) fails.

    • Measured with --doctor ., an unstamped copy, OPENREPOSHAPE_REPO a local bare clone, and GIT_TRACE written to a file, because the package captures git's stderr:

      OPENREPOSHAPE_REF git ls-remote git clone git checkout exit
      a.lock/b 1 1 1 2
      a/.b 1 1 1 2
      a//b 1 1 1 2
      a/b/ 1 1 1 2
      a. 1 1 1 2
      topic.lock 0 0 0 2
    • Each of the five ends REFUSED: cloned <repo> but could not check out 'a.lock/b': fatal: invalid reference: a.lock/b. Set $OPENREPOSHAPE_REF to a ref that repository carries, or $OPENREPOSHAPE_REPO to one that carries this one. For a. git's words end in a period, so the line reads invalid reference: a...

    • topic.lock, which the old line refuses, is refused before any git call, with the old sentence.

    • A scaffold run (Atlas --org acme --shape-ref a.lock/b, and OPENREPOSHAPE_REF set to a/.b) and shape-doctor --help with OPENREPOSHAPE_REF set to a/.b each made the same 1, 1, 1.

  • The sentence (standard.py:216 to :219) states the old rule, and says "letters" where the others say "ASCII letters".
    • Measured for topic.lock: REFUSED: $OPENREPOSHAPE_REF is 'topic.lock', which is not a branch, tag or commit this tool will pass to `git checkout`: a ref starts with a letter or digit, uses only letters, digits, '.', '_', '/', '-', has no '..' and does not end in '.lock'.
    • The launcher's, setup.sh's and install.sh's refusals end in one sentence, byte for byte the same in the three: a ref starts with an ASCII letter or digit, uses only ASCII letters, digits, '.', '_', '/', '-', has no '..' (git reads it as a revision range), no empty part between slashes ('//', or a '/' at the end), no part that starts with '.' or ends in '.lock' (the name git gives the lock file it writes beside a ref), and does not end in '.'. It is REF_RULE_WORDS (tests/conftest.py:2473).
  • The docstring (standard.py:199 to :203) says ref_fault is "the launcher's ref_fault, in its order and its words". It is not, in the words and the rule (here) and in the order (the drawn-as-another check install.sh and openRepoShape: a $OPENREPOSHAPE_BIN_DIR holding a bidi override, U+200B, U+2028 or U+FEFF passes #804's control-character check and is echoed as typed, so the PATH note can show a directory as another #837 put between the length and the control character, which is openreposhape package: openRepoShape --version prints a repository holding U+202E or U+200B as typed and exits 0, and a ref holding either is refused with the value as typed, where the launcher refuses both before it prints (#866) #939). The comment at :70 states the order too.
  • No test holds the package's rule to git's.
    • REF_PARTS (tests/conftest.py:2438, 36 rows), git_takes_ref (:2481, which asks git), REF_RULE_WORDS (:2473), assert_a_copy_answers_as_git_does (:2491) and assert_the_refusal_states_the_ref_rule (:2506) have three readers: tests/test_setup_sh.py:925, tests/test_install_sh.py:432 and tests/test_openreposhape_command.py:2536.
    • test_a_ref_is_checked_before_anything_is_cloned (tests/test_openreposhape_package.py:482) has six refs: -x, --upload-pack=touch /tmp/pwned, 256 characters, refs/heads/.., x.lock and a two-line value. None is a part-by-part case.

Which runs use the rule

Direction

  • Port setup.sh, install.sh and the openRepoShape command: each keeps its own copy of the old ref rule (*..* | *.lock), so a ref git refuses part by part (a.lock/b, a/.b, a//b) clones the standard before it fails #874's rule and sentence to standard.py.
    • The rule is the nine patterns, as REF_RE.fullmatch, ".." in ref, "" in ref.split("/") (//, or a / at the end), a part that starts with ., a part that ends in .lock (the last part too), and a name that ends in .. setup-project.py's why_not_a_ref (:580) is the same rule in Python, and asks .., an empty part, a part that starts with ., .lock at the end, a part that ends in .lock, and . at the end, in that order.
    • The sentence is the launcher's, word for word (REF_RULE_WORDS), after the opening $OPENREPOSHAPE_REF is '<ref>', which is not a branch, tag or commit this tool will pass to `git checkout`: that ref_fault has already. --shape-ref takes the same sentence, with its own opening.
    • Measured with a prototype of exactly this (scratch only): over the 3,110 names the package disagrees with git on 0 and with the launcher's line on 0; the five refs above, a scaffold run's --shape-ref a.lock/b and shape-doctor with OPENREPOSHAPE_REF set to a/.b each make 0 git ls-remote, 0 git clone and 0 git checkout, and end REFUSED: ... a ref starts with an ASCII letter or digit, ...; --version with a.lock/b exits 2; the 58 existing package tests still pass, so none states the old rule or sentence.
    • The package's order is already right: target (:635) comes before remote_commit (:644) and the clone. Only the rule is old.
  • Copy it, with a parity test, not a shared table.
    • The package ships alone and may not read the launcher, setup.sh or install.sh at run time. setup.sh, install.sh and the openRepoShape command: each keeps its own copy of the old ref rule (*..* | *.lock), so a ref git refuses part by part (a.lock/b, a/.b, a//b) clones the standard before it fails #874 wrote the list out in each file for the same reason, and tied the three with tests.
    • setup-project.py is carried in the wheel (standard.py:394), but it is a script, with a hyphen in its name and an argument parser at its entry, so standard.py cannot import why_not_a_ref from it.
    • Asking git at run time (git check-ref-format --branch, as scripts/shape_materialize.py:1275 does) does not fit here. --version and target run before the package knows git is installed (prepare looks for it at :639, after target), and --branch refuses HEAD, which every copy takes.
    • The package's test is the fourth reader of REF_PARTS: package_module("standard", monkeypatch).ref_fault(name, "$OPENREPOSHAPE_REF") for each row, in process, offline, with assert_a_copy_answers_as_git_does("standard.py", ...) and assert_the_refusal_states_the_ref_rule. Git is asked each time and nothing is copied from its answer.
  • Fix the docstring (standard.py:199) and the comment at :70: say what ref_fault holds, in the order and words it has once both issues have landed, and which test holds it to the launcher's.
  • No doc changes. No doc, --help text or release note states the rule: git grep for the old sentence finds only standard.py:219.

Verify

  • tests/test_openreposhape_package.py passes on Linux (58 passed at 50178305). tests/test_setup_sh.py, tests/test_install_sh.py and tests/test_openreposhape_command.py, the other three readers, pass unchanged.
  • New cases:
  • The disagreeing refs are refused before any clone: the five of the table above, with GIT_TRACE or a stub git first on PATH, make no git call.
  • Mutants, each killed (measured on the prototype, with the cases above):
    • The old shape line back, with the new sentence: 18 fail, the 13 names it takes and the 5 refs of the run.
    • No empty-part check: 4 fail (a//b, a/b/, and those two in the run).
    • No check for a part that starts with .: 5 fail (a/.b, a/.b/c, a/b/.c/d, x/.y/z/w, and a/.b in the run).
    • .lock asked of the end of the name only: 4 fail (a.lock/b, x/y.lock/z, release.lock/v1, and a.lock/b in the run).
    • No check for a name that ends in .: 3 fail (a., a/b., and a. in the run).
    • A part that ends in . refused (over-refusal): 1 fails, a./b.
    • The first character lower case only (over-refusal): 1 fails, Feature/ABC-123.
    • A part that starts with _ or - refused (over-refusal): 2 fail, fix/_tmp and fix/-wip.
    • The sentence without its empty-part clause: 19 fail, every refused row.

Overlaps

Parent: #459. It tracks setup and scaffold, and the launcher's own items went there. #874's rule is setup's and the launcher's, and this is its fourth copy.

Milestone: v1.2.0. v1.1.1 is released. Each line needs a ref that a person typed and git refuses, and the run ends in a refusal either way, one full clone later. It is not a regression: the package has had this rule since #563, and #874's launcher copies were not a regression either.

🤖 Generated with Claude Code

Activity

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

    @brettheap
    ContributorAuthor

    CLAIMED — lane openRepoShape-3, session b30e8b49-f249-4668-adb1-1dbfa93c09e1@Eagle, 2026-10-18T16:12:57Z, for #941

    Logged in lanes/log/openRepoShape-3.md at 6d93d8f74e962c3eb5f68508f622ee5e2419ffa9.

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

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