Repository navigation
Description
(lane openRepoShape-5, 2026-10-23)
Goal: a repository name that ends in a line feed matches no family of the naming policy, as it matches none that it should not, and validate-repository-naming.py refuses it by name.
Problem
#1139's Goal says that every ^...$ pattern that reads a value from a file with .match refuses a value that ends in a line feed. #1166 (#1139) ends the seven module-level patterns of the two validators, scripts/family.py, scripts/shape_advisory.py and update-shape.py in \Z, and reads the three ids with fullmatch. It does not touch NamingPolicy, whose patterns come from contracts/repository-naming.yaml, every one ^...$, and are read with .match. In Python $ also matches just before a trailing line feed, and the YAML reader reads a double-quoted "...\n" as the text and a line feed. Found by lane 5's independent review of #1166, finding 1 (#1166 issuecomment-6352173084).
Where, on main 961640c6:
scripts/repo_shape.py:2264(descendant_referents,family["_re"].match(name)),:2266(family["_split_re"].match(name)),:2432(matches,role["_re"].match(name)) and:2435(family["_re"].match(name)).scripts/repo_shape.py:2228:topic_pattern,^xf-project-[a-z0-9][a-z0-9-]*$by default. Nothing outsidetests/test_naming_policy.py:422reads it at main, and the data'stopic.patternandtopic.id_pattern(contracts/repository-naming.yaml:481-482) are read by no tool.- The data's patterns:
contracts/repository-naming.yamllines 125, 182, 202, 221 (split_pattern), 336, 345, 353, 359, 376 and 412.
Which readers can be handed a name that ends in a line feed:
scripts/validate-repository-naming.py --project project.yaml, which the root template runs attemplates/assembly-root/Makefile:48andtemplates/assembly-root/.github/workflows/validate.yml:310. It names each leg withrepo_basename(str(leg["repository"]))(:1097,:1180), andrepo_basenamestrips nothing.- Its argv names (
:1465,repo_basename(n)). Names read from stdin are stripped (:1258). - Not reachable, measured: an adoption plan's
legs.assembly,legs.specandlegs.codethat end in a line feed areREFUSED unsafe-value: legs.<role> is 'NorthWind-spec\n', exit 2, before any name is classified (checked_value), on main and at validate-manifest.py, validate-family.py, family.py and update-shape.py: anid:, a date or arepository:ending in a line feed is refused by name, and a pin'ssource_repository:that is no path orowner/reponame is named as the pin's (#1139) #1166's head. - Not measured, read at their call sites:
scaffold-project.py,setup-project.py,family.pyandshape_materialize.pytake the name from argv, whichchecked_valuerefuses first.validate-family.py:603strips it.
The cost is small: a hand-edited manifest or a $'Atlas\n' argument. But the answer is wrong in two places. The gate exits 0 for a name that no family spells, and its table splits the name from its family over two lines.
Measured
On main 961640c6 and at #1166's head 2593952c, in scratch clones of the shared repository, Python 3.12.3, git 2.43.0, a stub gh and no network.
In process (NamingPolicy.load(contracts/repository-naming.yaml)). Each of these names, with a trailing line feed, gives the same matches and classify as without it, at main and at #1166's head alike (scripts/repo_shape.py is not in #1166's diff):
| Name | classify(name) with and without \n |
|---|---|
Atlas |
('project-leg', 'assembly') |
Atlas-spec, Atlas-code |
('project-leg', 'spec'), ('project-leg', 'code') |
openFoo |
('neutral-product', 'assembly') |
Thing-Install |
('install', None) |
user-wip |
('workspace', None) |
InkxRouter, MedxScribe |
('project-leg', 'assembly'), and descendant_referents gives ('openRouter', 'openxRouter') and ('openScribe', 'openxScribe') |
Atlas-Spec (a capital S) is None with and without the line feed. topic_pattern.match('xf-project-atlas\n') is a match.
The gate over a manifest (validate-repository-naming.py --project project.yaml in a scaffolded root, one leg's repository: written "testorg/Atlas\n"):
| Run | Naming gate | validate-manifest.py |
|---|---|---|
main, leg testorg/Atlas\n |
exit 0; ' Atlas', then ' project-leg/assembly' on the next line |
manifest ok, exit 0 |
main, testorg/Atlas-spec\n and testorg/Atlas-code\n |
exit 0, the same split | manifest ok, exit 0 |
| #1166's head, the same three | exit 0, the same split | exit 1, FINDING manifest-leg-repository: leg 'assembly': repository is 'testorg/Atlas\n', expected <org>/<Name> |
So after #1166 the project's gate as a whole still fails, through the manifest check, but the naming step passes and prints the split table.
Argv: validate-repository-naming.py $'Atlas\n' and $'Atlas-spec\n' exit 0 at main and at #1166's head, each name and its family on two lines. The same name from stdin is stripped and gives the family on one line.
The fix probed. In a scratch clone of main (commit 2776736ec, never pushed), .fullmatch in place of .match at the four sites of repo_shape.py (:2264, :2266, :2432, :2435) gives:
- every name above, with a line feed, has
matches == [],classify is Noneand no referents; the names without it are unchanged; - the naming gate over the three manifests above exits 1,
FINDING naming-unclassified: Atlas(andAtlas-spec,Atlas-code); over argv the same; validate-manifest.pyat main, run beside thatrepo_shape.py, also saysFINDING naming-unclassified: leg 'assembly': 'Atlas\n' matches no family in the naming policy, exit 1, so this one change closes the leg-repository gap in both gates, for a project whose ownrepo_shape.pyis updated;tests/test_naming_policy.py,tests/test_pinned_copy_text.py,tests/test_path_guard_hygiene.pyandtests/test_repo_hygiene.pypass, with the probe rows: 504 passed, 18 deselected, in 50.38s.
Suggested fix
- In
NamingPolicy, read the name withfullmatchat the four sites. Every shipped pattern starts with^and ends with$, sofullmatchchanges no answer except a trailing line feed (the run above). - A fork's policy. A fork may have written a pattern with no
$, which.matchreads as a prefix andfullmatchwould read as the whole name. Either say incontracts/repository-naming.yaml's header that a pattern is read against the whole name, or keep.matchand refuse a name that holds a line feed at the entry ofmatches,classifyanddescendant_referents. The first is the shorter change. topic_patternhas no production reader at main. Leave it, and put a one-line note beside it that a reader must usefullmatch; a row cannot fail on main without a reader.scripts/repo_shape.pyis a pinned copy (tests/test_pinned_copy_text.py).fullmatchneeds no import, and the change reaches a project only throughupdate-shape.py, as validate-manifest.py, validate-family.py, family.py and update-shape.py: anid:, a date or arepository:ending in a line feed is refused by name, and a pin'ssource_repository:that is no path orowner/reponame is named as the pin's (#1139) #1166's body says ofPROJECT_ID_RE.
Verify
- Rows for each of the four sites, table-driven over
policy.familiesand each family's roles, so a family added to the data is covered: a name that ends in a line feed givesmatches == [],classify is Noneanddescendant_referents == (). Each row fails on main. - A row for the gate:
validate-repository-naming.py --projectover a manifest whose legrepository:ends in a line feed, for each of the three roles, exits 1 withnaming-unclassified; and one over an argv name. - Names without a line feed give the answers they gave:
tests/test_naming_policy.pypasses unchanged. - Mutants: each of the four sites put back to
.matchis killed by a row. tests/test_pinned_copy_text.py,tests/test_path_guard_hygiene.py,tests/test_repo_hygiene.py,tests/test_agents_md_codes.pyandtests/test_cli_reference.pypass. No new refusal code is needed, so nothing inAGENTS.mdchanges.
Found by lane 5's independent review of #1166 (#1139), finding 1 (#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
brettheap commentedon Nov 8, 2026
CLAIMED — lane openRepoShape-5, session 50cede29-ab82-4ca3-9f67-d98e1a58c8d2@Eagle, 2026-11-08T16:05:52Z, for #1202
Logged in
lanes/log/openRepoShape-5.mdat8b3e487116b3f11412fff0ab9e6c5371cddb1c86.The three reads (lane-collision-protocol Rule 1):
validate-repository-naming.py: every name the gate tables or refuses …