Repository navigation
scripts/repo_shape.py resolve_link_source (:2401-2402) and scripts/validate-repository-naming.py _link_sources_from_args (:408): a bare --link-source <path> answers for EVERY chain link that has no more specific source, so in a chain of three or more links one tree is read as two links' declarations and a correct chain is reported broken, a FINDING (exit 1) for a name that holds no direct pin on its referent #441
Description
Lane: openreposhape-5 (openRepoShape-5)
(lane openRepoShape-5, 2026-10-12T17:59:09Z)
What is wrong. A --link-source value with no LINK= before the path is a bare PATH. _link_sources_from_args keeps the last one as default_source (scripts/validate-repository-naming.py:408), and resolve_link_source appends it as the LAST candidate for every link it is asked about (scripts/repo_shape.py:2401-2402, rule 4: "applies to whichever link has no more specific answer"). link_pins_from_trees (:2409) asks once per link of the recorded chain and hands each the same default_source. A link with no keyed source, no SHAPE_PIN_SOURCE_<LINK> and no checkout beside the project therefore falls through to the one bare tree.
That is right for a chain with ONE holder link, the ordinary two-link openXdox → openDox, where the bare tree is that holder's. In a chain of three or more links, one tree cannot be the declaration of two links. With the chain openXdox → openYdox → openInk and a bare path that is openXdox's tree:
openXdoxis answered from it, correctly (it declaresopenYdox);openYdoxis answered from the SAMEproject.yaml, which declaresopenYdoxand notopenInk, so_chain_link_findings(scripts/repo_shape.py:1242) says "openYdox declares openYdox, not openInk" about a tree nobody read, and the chain is BROKEN.
For a name that holds no direct pin on its referent, that is FINDING codexInk: the declared chain ... is broken, exit 1, for a chain that holds. For codexDox it is the same text as a WARNING, exit 0, because its pin on openXdox is also a direct pin on the referent openxDox (openXdox is the x-stem spelling), so the finding is hidden by an accident of the name. On the #338 branch the bookkeeping makes it worse: its LinkSources counts the one bare value as USED for both links, so nothing says a single tree answered twice.
Found by lane 5's review of fix/link-source-values at 40762ca (the fix for #338), as its F2, and listed by that fix's writer as a candidate follow-up. It is pre-existing: the output below is the same on origin/main 1f90a0f and on that branch (run on both, 2026-10-12T16:15Z). 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" "$D/trees/openYdox"
printf 'neutral_product_pins:\n - openYdox\n' > "$D/trees/openXdox/project.yaml" # openXdox pins openYdox
printf 'neutral_product_pins:\n - openInk\n' > "$D/trees/openYdox/project.yaml" # openYdox pins openInk
cat > "$D/work/codexInk/project.yaml" <<'YML'
neutral_product_pins:
- openXdox
legs:
- repository: testorg/codexInk
path: "."
role: assembly
naming:
referent_chain: [openXdox, openYdox, openInk]
YML
cd "$D/work/codexInk"
python3 "$U/scripts/validate-repository-naming.py" --project project.yaml --link-source "$D/trees/openXdox"; echo "exit $?"
python3 "$U/scripts/validate-repository-naming.py" --project project.yaml \
--link-source "openXdox=$D/trees/openXdox" --link-source "openYdox=$D/trees/openYdox"; echo "exit $?"Observed on origin/main 1f90a0f and on 40762ca, Python 3.12.3:
| the run | result |
|---|---|
one bare --link-source <openXdox's tree> |
FINDING codexInk: the declared chain openXdox → openYdox → openInk is broken (openYdox declares openYdox, not openInk), the name classified project-leg/assembly, exit 1 |
each link keyed (openXdox=, openYdox=) |
codexInk classified domain-descendant/assembly, nothing else, exit 0 |
no --link-source |
two declared-unverified WARNINGs, one per link, exit 0 |
Nothing shipped passes --link-source: make validate and validate.yml run --project project.yaml alone (templates/assembly-root/Makefile:47, templates/assembly-root/.github/workflows/validate.yml:187). Only a person who types one bare tree for a chain of three or more links reaches it, which is why it is a follow-up and not a blocker for #338.
What it should do. The author decides; the one thing that cannot stand is a tree answering for a link it is not:
- a bare value counts only for the FIRST link of the chain (the pin the project actually holds, and the only link a person has a tree for in the ordinary case), or only where exactly one link of the chain is a holder, and says so in
--help; or - a bare value is refused, with a message naming the links it cannot answer for and the
LINK=PATHspelling that can, when more than one holder link would take it; or - a link read from a bare tree is accepted only when that tree says it is that link (its
project.yamlnames the repository), which needs a decision about what a link's manifest must carry.
Whichever it is, the bookkeeping (LinkSources.used) must stop counting one value as the answer for two links without saying so, and --help and the module docstring (rule 4) must say what a bare value means in a longer chain.
How to test. In tests/test_naming_policy.py, beside the --link-source tests (CHAIN_ARGS, naming_from and _tree there are #338's; before it lands, run_script(VALIDATOR, ...) and _tree serve), add the run above: --project with a three-link chain, one bare tree, codexInk (no direct pin, so the broken chain is a FINDING), asserting the exit and the text under the chosen rule; and the keyed-both run still exiting 0. Run it from a tmp_path directory of its own, as the neighbouring tests do, so no checkout beside it answers. Reverting the fix fails it.
Not in this issue.
- How a value holding
=is read (scripts/validate-repository-naming.py:_link_sources_from_argssplits every--link-sourcevalue at its first=and nothing reports a value no chain link used, so a link tree under a directory nameda=b, or behind a mistyped key, is silently skipped (declared-unverified, exit 0), andrepo_shape.link_manifest_pathlets a source this user cannot enter (keyed,SHAPE_PIN_SOURCE_<LINK>or a sibling checkout) end the naming gate in aPermissionErrortraceback before Python 3.14 #338) and what is said of a source that cannot answer (scripts/validate-repository-naming.py:_link_sources_from_argssplits every--link-sourcevalue at its first=and nothing reports a value no chain link used, so a link tree under a directory nameda=b, or behind a mistyped key, is silently skipped (declared-unverified, exit 0), andrepo_shape.link_manifest_pathlets a source this user cannot enter (keyed,SHAPE_PIN_SOURCE_<LINK>or a sibling checkout) end the naming gate in aPermissionErrortraceback before Python 3.14 #338): both are the fix for that issue. validate-pins.py's--pin-sourcehas the same documented rule, rule 4 ofresolve_neutral_pin_source(templates/assembly-root/scripts/validate-pins.py, "applies to whichever pin does not already have a more specific answer"). It asks a different question, a pin's digest at a named commit, and was not examined here.- The two-link chain, where the rule is right.
Related: #338 and the PR that fixes it (fix/link-source-values).
Activity
validate-repository-naming.py, repo_shape.py: a `--link-source` value…
brettheap commentedon Oct 14, 2026
v1.1.0 (triage of 2026-10-14): #442 can ride along (backlog); it is the empty-path half of the same argument parsing.
brettheap commentedon Oct 14, 2026
CLAIMED — lane openRepoShape-5, session 50cede29-ab82-4ca3-9f67-d98e1a58c8d2@Eagle, 2026-10-14T22:34:59Z, for #441
Logged in
lanes/log/openRepoShape-5.mdat9c129701876bc4c90b2d171265b246b7ab05ad31.The three reads (lane-collision-protocol Rule 1):
Merge origin/main (#551) into fix/link-source-chain-defaults: docs/ha…
validate-repository-naming.py: a chain of one link is no first link r…
tests/test_link_source_chain_defaults.py: a two-link chain read from …
scripts/shape_materialize.py: the `pin-source-unused` refusal says `-…
Merge main 66267f0 (#589, #582, #576 and eleven more) into fix/540-pi…
scaffold-project.py and adopt-project.py: a pin records `digest_sourc…
repo_shape.py and validate-repository-naming.py: a chain link, a decl…
Pinned shape copies: one bump, so AGENTS-shape.md is true of every ro…