Skip to content

update-shape.py: a shape pin's source_repository: that names a path is refused as --upstream, and with --upstream passed one that ends in a line feed is never asked and reaches the commit subject and the pull request title (#1166 follow-up) #1203

Closed

Description

@brettheap

(lane openRepoShape-5, 2026-10-23)

Goal: update-shape.py asks the shape pin's source_repository: once, whichever way the run reaches the upstream, and refuses a value that is no owner/repo in the pin's name, never in the name of a flag nobody passed.

Problem

update-shape.py's prepare reads the pin's source_repository: as declared (update-shape.py:2400 at main, :2421 at #1166's head). Two things follow from where it is used.

  1. No --upstream: the pin's value is open_upstream's spec, and the first of its refusals still names the flag. validate-manifest.py, validate-family.py, family.py and update-shape.py: an id:, a date or a repository: ending in a line feed is refused by name, and a pin's source_repository: that is no path or owner/repo name is named as the pin's (#1139) #1166 (validate-manifest.py and validate-family.py: PROJECT_ID_RE, DATE_RE and QUALIFIED_RE end in $, so an id:, a date or a repository: that ends in a line break passes as well formed (#1126 follow-up) #1139) gives open_upstream a pin_path, so that update-upstream-unresolvable and the checked_value refusal name the pin and its field. The branch above them, update-upstream-not-a-repo (:675 at main, :686 at validate-manifest.py, validate-family.py, family.py and update-shape.py: an id:, a date or a repository: ending in a line feed is refused by name, and a pin's source_repository: that is no path or owner/repo name is named as the pin's (#1139) #1166's head), is as it was: its message reads --upstream <value> exists but is not a git repository, for a value from the pin. It is reached when the pin's value is a path that exists where the command runs (the lookup is Path(spec).expanduser(), relative to the working directory, not to --root; read, not measured). Found by lane 5's independent review of validate-manifest.py, validate-family.py, family.py and update-shape.py: an id:, a date or a repository: ending in a line feed is refused by name, and a pin's source_repository: that is no path or owner/repo name is named as the pin's (#1139) #1166, finding 3 (validate-manifest.py, validate-family.py, family.py and update-shape.py: an id:, a date or a repository: ending in a line feed is refused by name, and a pin's source_repository: that is no path or owner/repo name is named as the pin's (#1139) #1166 issuecomment-6352173084). The body of validate-manifest.py, validate-family.py, family.py and update-shape.py: an id:, a date or a repository: ending in a line feed is refused by name, and a pin's source_repository: that is no path or owner/repo name is named as the pin's (#1139) #1166 discloses it.
  2. --upstream passed: the pin's value is never asked. upstream.repository = declared (:2402 at main) keeps whatever the pin says. It reaches ReadmeShapeLine(root, upstream.repository, target) (:2503, :4998), the commit subject of apply (:2995), pull_request_words(upstream.repository, ...) (:5099, :5849) and the lines check and apply print (:5153, :5737). validate-manifest.py, validate-family.py, family.py and update-shape.py: an id:, a date or a repository: ending in a line feed is refused by name, and a pin's source_repository: that is no path or owner/repo name is named as the pin's (#1139) #1166 does not change this, and its body names it under "Not changed, seen while measuring" (finding 9 of the review). A value that ends in a line feed is kept as it is.

Nothing in the repository writes a path into the shape pin: both pin templates hold source_repository: {{SHAPE_REPOSITORY}} (templates/assembly-root/contracts/shape-pin.yaml:27, templates/family-root/contracts/shape-pin.yaml:29), and tests/test_scaffold_e2e.py:733 reads opensoft/openRepoShape back. So a value that is no owner/repo is a hand edit.

Measured

Main 961640c6 and #1166's head 2593952c, in scratch clones of the shared repository (Python 3.12.3, git 2.43.0, a stub gh, no network). Every run with no --upstream is refused before a clone could start.

Case 1, no --upstream, run from the root (update-shape.py check --root <root>), the pin's source_repository: written as:

Value main #1166's head
"contracts" REFUSED update-upstream-not-a-repo: --upstream contracts exists but is not a git repository, exit 2 the same
"scripts/repo_shape.py" REFUSED update-upstream-not-a-repo: --upstream scripts/repo_shape.py exists but is not a git repository, exit 2 the same
"contracts/shape-pin.yaml" ... --upstream contracts/shape-pin.yaml exists but is not a git repository, exit 2 the same
"opensoft/openRepoShape\n" REFUSED unsafe-value: --upstream is 'opensoft/openRepoShape\n', exit 2 REFUSED update-upstream-unresolvable: <root>/contracts/shape-pin.yaml: source_repository: is 'opensoft/openRepoShape\n', which is neither a path on this machine nor an owner/repo name, exit 2
"opensoft/openRepoShape " and "has space/x" REFUSED update-upstream-unresolvable: --upstream '...' is neither a path ... the pin-named refusal, as above

Case 2, --upstream <a local clone> passed, the pin's source_repository: written "opensoft/openRepoShape\n":

Suggested fix

Verify

  • Rows for each value above, in both routes (no --upstream, and --upstream <local clone>): refused, exit 2, naming the pin file and source_repository: and not --upstream. The case-2 rows fail on main (exit 0 and a commit), and the path rows of case 1 fail on main (--upstream contracts exists ...).
  • apply over a refused pin writes nothing and makes no commit; the pin's commit: is unchanged.
  • A pin as scaffolded, with and without --upstream: every answer unchanged. The existing tests/test_update_shape*.py pass on git 2.43 and 2.47.1.
  • Mutants: the new question removed from each route, and fullmatch put back to match, are each killed.
  • tests/test_agents_md_codes.py, tests/test_cli_reference.py and tests/test_path_guard_hygiene.py pass. A path guard added to update-shape.py uses _is_a.

Found by lane 5's independent review of #1166 (#1139), findings 3 and 9 (#1166 issuecomment-6352173084), and re-measured at main 961640c6.

Milestone: none; it lands after the v1.2.0 tag (Brett Heap's 10:32:04Z ruling of 2026-10-21).

Lane: openreposhape-5 (openRepoShape-5)

Activity

  1. added this to the v1.2.1 milestone on Oct 23, 2026
  2. brettheap commented on Nov 8, 2026

    @brettheap
    ContributorAuthor

    CLAIMED — lane openRepoShape-5, session 50cede29-ab82-4ca3-9f67-d98e1a58c8d2@Eagle, 2026-11-08T16:06:47Z, for #1203

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

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

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