Skip to content

setup-project.py: a refused project name gets one sentence that explains only a leading -, a trailing space passes where a leading one is refused and hides in step (4)'s report, and a name of 101 to 255 characters passes the prompt, to end at step (5) or at GitHub #777

Closed

Description

@brettheap

Goal: a project name the prompt or --project refuses is refused in words that name the check it failed, a name no repository can carry is refused before step (4) explains three names it will not use, and a stray trailing space is either taken off or shown.

Filed by lane openRepoShape-5, from the writer's and the reviewer's checklist candidates on #729's PR (#756, head b3c77cc2: w729's "Left out" and rv729's candidates). #729 itself (setup-project.py checks the typed name as --project is) is not reopened; these are what it left. Lines marked "measured" were run here against the validator the tool runs at step (4); the others are read from source, or were measured by the writer or reviewer named.

Lands after: lane 5's #729 (PR #756, fix/729-typed-project-name). It adds ask_for_the_project_name (setup-project.py:1475-1492 at b3c77cc2) and tests/test_setup_project_typed_name.py. Line numbers are at main e3137010 for code #756 does not touch, and at b3c77cc2 for its own.

Lines

  • refuse_value gives every refusal the same sentence, and the sentence explains only a leading -. setup-project.py:352-364: "<what> is <ascii(value)>, which is not a value this tool will put on a git or gh command line. git reads its own arguments: a value that starts with - is an option to git, not a name to us; the rest must be spellable as a name, a ref or a path." checked_value (:367-388) refuses four things: an empty value, a leading -, a control character and a value outside NAME_RE, REF_RE or PATH_RE; all four call refuse_value. So ../x, a/b and .. (the first character must be a letter or a digit, then letters, digits, space and ._'()&,+@-, at most 255; NAME_RE, :332), and Atlas, Atlas/ and a name with an accented letter, are told about a leading - that none of them has, and are not told what a name holds (w729's first candidate, rv729's second). The sentence is shared by --project, the positional (:531), the prompt (:1492), --org, --elected-by, the refs and the paths (:399, :407, :420, :654). The sibling copy in scripts/repo_shape.py:2243-2249 (checked_value, used by scaffold-project.py and adopt-project.py) prints the pattern: "the rest must match <pattern>". Direction: refuse_value takes the reason, and says it: empty; starts with -, which keeps its "git reads its own arguments" sentence; holds a control character; or is outside the pattern, saying the pattern as the sibling does and, for a name, in words (a letter or a digit first, then letters, digits, spaces and ._'()&,+@-, at most 255). Keep ascii(). Decide whether repo_shape.checked_value changes with it: tests/test_setup_project_py.py:787 says scaffold-project.py "refuses the same shape in the same words", and repo_shape.py is pinned in every project, so a change there is a re-pin.
  • A name of 101 to 255 characters passes the prompt, and nothing refuses it before step (5) or GitHub. NAME_RE allows 255 ({0,254} after the first character, :332); w729 measured a 101-character name reaching the confirmation in local mode. Step (5) refuses a name whose <Project>-spec is more than 255 bytes as scaffold-name-too-long (scripts/shape_materialize.py:4826-4857, NAME_MAX; the bare repository's .git is added under --local-remote-dir), so from 247 characters under --local-remote-dir and from 251 otherwise: that is a disk's limit. GitHub's own limit on a repository name is 100 characters, so with -spec and -code added a project name over 95 cannot be created. That limit is from GitHub's documentation, not measured here: no lane 5 run creates a real repository, and a probe against a real organisation is lane 1's. Nothing in the estate states a 100 (git grep of README.md, AGENTS.md, the handbook, scaffold-project.py, setup-project.py and contracts/ finds none). rv729 reproduced a 255-character name ending at step (5) "after printing the family wall three times"; measured here with scripts/validate-repository-naming.py --explain on 255 x, then 255 A, and the two -spec and -code names: exit 0, 21 lines, no NO FAMILY: it is --explain's ordinary answer for three names it accepts, the full name repeated in each, which step (4) prints before step (5) refuses all three. Direction: a bound for a name whose repositories GitHub will hold, asked before step (4): at the prompt and for --project (NAME_RE is shared with the organisation, the id and the display name, so a project-only bound is its own pattern in checked_value, or a check in the scaffold's plan beside scaffold-name-too-long), and only where a GitHub repository will be made, not under --local-remote-dir. First confirm the number against a real gh (lane 1).
  • A trailing space passes the check where a leading one is refused, and step (4) hides it. rv729's candidate, measured here: NAME_RE matches Atlas and not Atlas (a space is allowed after the first character on purpose, so a b goes to step (4)). Step (4) then gets Atlas , Atlas -spec and Atlas -code: validate-repository-naming.py --explain exits 1 with FINDING naming-unclassified: Atlas , Atlas -spec, Atlas -code, three NO FAMILY blocks, 27 lines, and the trailing space is nowhere visible. The run ends at die(...) (setup-project.py:2134-2137 at main, exit 1), while Atlas is refused at once, exit 2. Direction: rv729 and w729 call it a design choice. Either ask_for_the_project_name strips what the person typed (typed.strip(), prompt only: an argv value is deliberate, and a prompt answer is where stray spaces come from; it changes setup-project.py: a project name typed at the prompt is checked as --project is and an empty line says no name was typed, so ../x, a/b, .. and --help are refused by name, not by an --id hint, a help page or a probe write (#729) #756's three-spaces test, which expects a refusal), or the finding quotes each name with ascii() so the space shows. Pick one and say why.

Not here: a mistyped name ends the run, with no second ask (rv729; unchanged by #756). No prompt of this tool re-asks (ask has three call sites: the offers' yes, the confirmation, and this one), and a re-ask would change the exit codes #756 pins, so it is not a defect and is not a line.

Verify: tests/test_setup_project_typed_name.py (new in #756; its refusal assertion is project name is <ascii(value)>, which is not a value, :108), tests/test_setup_project_py.py (:803 asserts "git reads its own arguments" for --org -evil, which keeps its sentence), tests/test_setup_sh.py, tests/test_scaffold_pin_and_reuse.py (:502, :517: the sibling's words) and tests/test_repo_hygiene.py pass on Linux. One new case per refusal reason through the pseudo-terminal, as #756's file does: the sentence names the empty value, the leading -, the control character and the pattern, and the pattern case for each of ../x, a/b, Atlas, Atlas/ and a name with an accented letter does not say "starts with -". For the bound: names of N and N+1 characters either side of the number, at the prompt and through --project, local and not, asserting exit 2 before (4) naming policy prints. For the space: Atlas typed at the prompt gives the decision above. No real gh run here; the bound's number needs one.

Overlaps. fix/729-typed-project-name (#756) edits setup-project.py and adds the test file; fix/696-setup-family-folder (4054ffde, #696) edits setup-project.py in family_folder_here, far from :332-388 and :1475; fix/692-raw-folder-paths (#731) and fix/693-local-remote-dir edit scaffold-project.py, which a plan-time bound would also edit. Nothing on origin edits tests/test_setup_project_py.py or tests/test_setup_sh.py. setup-project.py is not a pinned copy; scripts/repo_shape.py is, if the sibling wording changes with it.

Parent: #459.

Milestone: v1.1.1. None is a regression and none blocks v1.1.0: each is a name the person typed, and each ends in a refusal before anything is created, only in the wrong words, at the wrong step, or late.

🤖 Generated with Claude Code

Activity

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

    @brettheap
    ContributorAuthor

    CLAIMED — lane openRepoShape-5, session 50cede29-ab82-4ca3-9f67-d98e1a58c8d2@Eagle, 2026-10-17T10:30:03Z, for #777

    Logged in lanes/log/openRepoShape-5.md at 0d613a36fd5332bfef78bfd6d0638b398ac00b64.

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

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