Skip to content

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

Closed

Description

@brettheap

Lane: openreposhape-5 (openRepoShape-5)

(lane openRepoShape-5, 2026-10-12T17:59:35Z)

What is wrong. _link_sources_from_args splits a --link-source value at its first = and stores Path(path) for the key (scripts/validate-repository-naming.py:406). When nothing follows the =, path is the empty string and Path("") is .. Nothing refuses it, and resolve_link_source (scripts/repo_shape.py:2380) asks link_manifest_path (:2351) about ., which is a directory that holds a project.yaml: the one in the directory the validator was run from. Run from a project root, where the project's own gates run, the project's own manifest is read as the declaration of the link. The project declares openXdox (its own pin), not openDox, so the chain is "broken", and the message says "openXdox declares openXdox, not openDox" about a tree nobody pointed at. Run from any other directory the empty path finds no manifest and the link is quietly declared-unverified, so the same typo gives two different answers depending on where it was typed.

The same shape is in #312's PinSources: templates/assembly-root/scripts/validate-pins.py:409 stores Path(path) for a key, so --pin-source openXdox= names ., the project root itself, as the stand-in clone of the neutral product. There it is not a silent misread: a project root rarely holds the pinned commit, and the digest question fails as a neutral-pin-source-unreadable FINDING that names . (observed below). It is the same unexamined empty value, and the fix belongs in both.

Found by lane 5's review of fix/link-source-values at 40762ca (the fix for #338), as its F3. Pre-existing: the verdicts below are the same on origin/main 1f90a0f and on that branch (run on both, 2026-10-12T16:18Z), because that branch changes how a value is split and what is said of a source that cannot answer, and leaves Path(path) alone. Not claimed.

# $U: a checkout of openRepoShape. Nothing here touches a network or `gh`.
D=$(mktemp -d)
mkdir -p "$D/work/codexInk" "$D/trees/openXdox"
printf 'neutral_product_pins:\n  - openInk\n' > "$D/trees/openXdox/project.yaml"     # openXdox pins openInk
cat > "$D/work/codexInk/project.yaml" <<'YML'
neutral_product_pins:
  - openXdox
legs:
  - repository: testorg/codexInk
    path: "."
    role: assembly
    naming:
      referent_chain: [openXdox, openInk]
YML
cd "$D/work/codexInk"
python3 "$U/scripts/validate-repository-naming.py" --project project.yaml --link-source "openXdox=$D/trees/openXdox"; echo "control: exit $?"
python3 "$U/scripts/validate-repository-naming.py" --project project.yaml --link-source openXdox=;                      echo "empty path: exit $?"
(cd "$D" && python3 "$U/scripts/validate-repository-naming.py" --project work/codexInk/project.yaml --link-source openXdox=; echo "empty path, from $D: exit $?")

Observed on origin/main 1f90a0f and on 40762ca, Python 3.12.3:

the run result
--link-source openXdox=<the real tree> (control) codexInk classified domain-descendant/assembly, nothing else, exit 0
--link-source openXdox=, run from the project root FINDING codexInk: the declared chain openXdox → openInk is broken (openXdox declares openXdox, not openInk), the name classified project-leg/assembly, exit 1
the same, run from another directory WARNING codexInk: declared-unverified: openXdox declaring a pin on openInk ..., exit 0; 40762ca adds WARNING link-source-unreadable: . (--link-source openXdox=...) could not answer for openXdox: it holds no project.yaml, which at least names .

With codexDox in place of codexInk the first failing row is the same text as a WARNING, exit 0, because a pin on openXdox is also a direct pin on codexDox's referent openxDox (the x-stem spelling).

The validate-pins.py half, on a scaffolded codexDox project (scaffolded with local remotes from origin/main 1f90a0f: scaffold-project.py --org codexSoft --project codexDox --pin openXdox@<sha> --pin-source <a local clone> --referent-chain openXdox,openDox --local-remote-dir ... --work-dir ..., then cloned recursively, with a clone of the pinned product beside it):

$ python3 scripts/validate-pins.py --pin-source openXdox=
FINDING neutral-pin-source-unreadable: contracts/openxdox-pin.yaml: . (--pin-source openXdox=...) could not answer for opensoft/openXdox @ df3761f...: `git ls-tree -r -z df3761f...` in . exited 128: fatal: not a tree object
exit 1
$ python3 scripts/validate-pins.py --pin-source openXdox=../openXdox.away      # control: the real clone
  ok  openXdox: pin commit df3761f3e839 digest recomputes (--pin-source openXdox=...)
pins ok
exit 0

What it should do. An empty path after a key is not a path. In both tools, LINK= or PRODUCT= with nothing after the = is refused as an argument error or, at least, noted ("--link-source openXdox= names no path") and never turned into .; a bare value that is the empty string gets the same treatment. The author chooses refuse versus note; a note must keep the link unverified rather than read the current directory. Whether --link-source . (an explicit .) stays a valid way to name the current directory is not in question: it does, and says so by being typed.

How to test. In tests/test_naming_policy.py, the run above from a tmp_path project root and from another directory, asserting exit 0 and no "declares" line for the empty path under the chosen rule, and the control unchanged; in tests/test_pin_validator.py or tests/test_neutral_pin_validator.py, --pin-source openXdox= against a scaffolded project, asserting the same refusal or note and not a finding that names .. Reverting the fix fails both.

Not in this issue.

Related: #338 and the PR that fixes it (fix/link-source-values); #312 and #295 (validate-pins.py's --pin-source).

Activity

  1. brettheap commented on Oct 14, 2026

    @brettheap
    ContributorAuthor

    CLAIMED — lane openRepoShape-5, session 50cede29-ab82-4ca3-9f67-d98e1a58c8d2@Eagle, 2026-10-14T22:35:48Z, for #442

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

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

    1. existing `CLAIMED —` comments on opensoft/openRepoShape#442:
       none
    2. `gh pr list --repo opensoft/openRepoShape --state all --search "#442"`, kept where the row or its body names `#442`:
    453	validate-repository-naming.py, repo_shape.py: a `--link-source` value is `PRODUCT=PATH` only when its key names a chain link, and a link source that cannot be entered is a WARNING with the system's reason, not a traceback (#338)	fix/link-source-values	MERGED
    3. `git ls-remote --heads [email protected]:opensoft/openRepoShape` branches naming `442` 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

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions