Skip to content

validate-pins.py: --pin-source still ends a key at the first =, as --link-source did before #980, so a pin whose name holds = is never a key, and a docstring says the two tools read one way #1053

Closed

Description

@brettheap

Goal: validate-pins.py reads a --pin-source key as the naming gate has read a --link-source key since #980 (the longest declared pin before an = that leaves a path after it), so a pin whose name holds = can be a key, and the sentence saying the two copied tools read [PRODUCT=]PATH one way is true.

State

templates/assembly-root/scripts/validate-pins.py (PinSources, :1466) cuts every --pin-source value at its FIRST =: key, sep, path = typed.partition("=") at :1522, then names.get(pin_product_key(key)) at :1523. Two more places cut at the first = on their own: the no-path refusal at :1538 (typed.partition("=")[2]) and read_as_path at :1557 (typed.partition("=")[0]).

Since #1044 (#980, 82fc86752) the naming gate reads a --link-source key as the longest chain link before an = that leaves a path after it, read whole, and a value that ends at a link names no path (LinkSources._read_source, scripts/validate-repository-naming.py:401-444). #1044 left validate-pins.py as its own change, and rv980 ruled that fine.

The words that say the first-= rule are all in the pinned copy:

  • the class docstring, :1470-1482 ("the text before the first = is a PRODUCT only when ...");
  • :1496-1501, whose sentence at :1498-1499 says "the two copied tools read [PRODUCT=]PATH one way over ASCII alone";
  • the --pin-source help, :2105-2116, and docs/cli.md:1205, which is that help as generated.

What happens

For a declared pin whose name holds =, --pin-source open=y=<tree> is a bare PATH here, where the gate reads it as open=y's tree. PinSources(["open=y=/p"], ["open=y"]).reading is {'open=y=/p': None}. Run through _check_neutral_product_pins with a pin open=y and its pin file contracts/open=y-pin.yaml (drafting probe, hand-written fixture):

  • open=y=<tree> gives FINDING neutral-pin-source-unreadable: contracts/open=y-pin.yaml: open=y=<tree> (--pin-source) could not answer for opensoft/open=y @ <commit>: no such directory, then "It was read as a PATH: open is not a declared neutral-product pin (declared: open=y)";
  • the same tree typed bare recomputes the digest: open=y: pin commit <12 hex> digest recomputes (--pin-source).

With open and open=y both declared, the first = gives open=y=<path> to open, with the path y=<path>.

So the sentence at :1498-1499 is no longer true for a name holding =: since #980 the two tools read [PRODUCT=]PATH one way only for a name with no =.

This is consistency, not a live failure.

Direction

  1. Read the key in PinSources.__init__ as _read_source does for links: the LAST = whose text before it names a declared pin by pin_product_key, with a non-empty path after it, ends the key. The key is read whole (never stripped, never cut at a /), and the pin is spelled as the manifest spells it. Where two declared pins both begin the value, the longer wins: open=y=<path> is open=y's and open=<path> is open's. A value that ends at a declared pin, open=y=, names no path and is refused pin-source-no-path (exit 2), as openGlass= is (scripts/validate-repository-naming.py _link_sources_from_args (:406) and templates/assembly-root/scripts/validate-pins.py PinSources (:409): a key with an empty path (--link-source openXdox=, --pin-source openXdox=) is Path(""), which is the current directory, so run from a project root the naming gate reads the project's OWN project.yaml as the link's declaration and reports a chain that holds as broken, a FINDING (exit 1) for a name with no direct pin #442). Any other value is a bare PATH, whole.

  2. Make :1538 and :1557 use what __init__ read, so the three do not each cut at the first =.

  3. Reword the four places under State. :1496-1501 can say the two read [PRODUCT=]PATH one way, with no exception left. docs/cli.md is regenerated from the help (tests/test_cli_reference.py).

  4. It is a pinned copy: COPIED_VERBATIM (scripts/shape_materialize.py:445-446) carries scripts/validate-pins.py, so the change takes one upgrade row in every existing root (update-shape.py check lists upstream-changed for scripts/validate-pins.py); item 5 adds a second.

  5. The gate's LinkSources docstring (scripts/validate-repository-naming.py:266-282) describes this file's reading and is wrong in two ways. Fix both in the same change.

    That file is a pinned copy too (COPIED_FROM_SHAPE, scripts/shape_materialize.py:439-443), so correcting it adds a second upgrade row, scripts/validate-repository-naming.py, applied by the same update-shape.py apply. Leaving "still ends a key at the first =" about a file that no longer does would be the pattern of rv980's NIT-2 on validate-repository-naming.py: a --link-source key is the longest chain link before an = that leaves a path after it, so the offer the gate prints for a link holding = verifies that link when typed as printed (#980) #1044 again. rv980's checklist line: when a pinned copy's reader changes, grep the other pinned copies for sentences saying the two tools "read one way".

Tests go beside the #295 rows in tests/test_neutral_pin_validator.py (:201-307) and the #442 rows in tests/test_link_source_chain_defaults.py (:367-417). A pin holding = cannot be scaffolded, so a row hand-writes the neutral_product_pins: entry and its pin file (= is legal in a file name on all three platforms, as standin_at's docstring says).

Verify

Found by lane 5's independent review of #1044 (#980), rv980 (#1044 issuecomment-6288391970).

Milestone: v1.2.0 (placement is lane 3's call).

Not claimed.

Lane: openreposhape-5 (openRepoShape-5)

Activity

  1. brettheap commented on Oct 20, 2026

    @brettheap
    ContributorAuthor

    CLAIMED — lane openRepoShape-5, session 50cede29-ab82-4ca3-9f67-d98e1a58c8d2@Eagle, 2026-10-20T10:50:19Z, for #1053

    Logged in lanes/log/openRepoShape-5.md at 6f7c947a82b337fefc0c3774d7519d7c3a150b98.

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

    1. existing `CLAIMED —` comments on opensoft/openRepoShape#1053:
       none
    2. `gh pr list --repo opensoft/openRepoShape --state all --search "#1053"`, kept where the row or its body names `#1053`:
       none
    3. `git ls-remote --heads [email protected]:opensoft/openRepoShape` branches naming `1053` as a whole token:
       none
    
  2. added this to the v1.2.0 milestone on Oct 20, 2026
  3. added a commit that references this issue on Oct 20, 2026
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