Repository navigation
Description
Lane: openreposhape-2 (openRepoShape-2)
What is wrong. ONE rule — "do these two remote spellings name the same
repository?" — is written TWICE, and the second copy was written on purpose as
a stopgap three commits ago.
templates/family-root/scripts/siblings.py:132-330—SCHEME_RE,
SCHEME_ONLY_RE,DRIVE_RE,base_is_a_path,_one_level_up,
join_relative,resolve_relative,same_repository. This is the
definitionmake siblingsREFUSES a working clone by (WRONG ORIGIN,
verify_sibling:418).scripts/shape_materialize.py:439-643—REMOTE_SCHEME_RE,
REMOTE_SCHEME_ONLY_RE,REMOTE_DRIVE_RE,remote_key,
remote_is_a_path,_up_one,join_remote,resolved_remote,
CREDENTIAL_RE,redacted,same_repository. This is the definition
shape-doctor.py'smembersrow REPORTS by (shape-doctor.py: the members row calls a beside-the-holder repository the working clone on its project id alone, where the family's own verifier also requires the origin #146, landed as 5c63116).
The second copy's own section comment says why it is there and what ends it:
"scripts/repo_shape.py, where a rule shared by every tool otherwise belongs,
is digest-pinned into every project, so a line added to it leaves every estate
upstream-changed until it re-pins — a price this defect does not justify on
its own… Consolidating both copies into repo_shape.py is the better
long-term home and can ride the next change that has to move the pin anyway."
The InkRouter re-pin that was in flight while #147 was open has landed (estate
at shape cd57c4b), and one more re-pin is owed after this, so the pinned
change is welcome now.
What holds the two copies together today is a PARITY TEST —
tests/test_shape_doctor.py::test_the_doctor_and_siblings_agree_on_what_one_repository_is
— which runs 14 url pairs and 10 relative-url pairs through BOTH and asserts
they answer the same. A parity test is the right instrument for two copies and
the wrong one for a rule that should have one: it can only ever say the two
have not drifted YET, and every fix to the rule has to be written twice or it
re-creates the disagreement #147 removed.
#149 IS THAT FIX, and it is why this is worth doing now. same_repository
lowercases the WHOLE normalised remote. For a remote with a HOST that is
right — GitHub treats an owner and a name case-insensitively, and a report
that called https://GitHub.com/Org/Repo and https://github.com/org/repo
two repositories would send somebody to delete a good clone over a
capitalisation. For a FILESYSTEM PATH on a case-sensitive host it is wrong:
/srv/mirrors/IRRS.git and /srv/mirrors/irrs.git are two different bare
repositories on Linux, and both copies answer that they are one. With one
copy that is a one-place change; with two it is the same edit made twice and
a parity table that cannot tell whether either is right.
What would fix it.
- MOVE the rule into
scripts/repo_shape.py, in a section of its own beside
the other shared vocabulary (checked_value,SAFE_PATH_RE, which draws
the same drive-letter-versus-scp-colon distinction).repo_shape.pyis
stdlib-only and Python 3.9-safe and already ships into every assembly root
AND every family holder (COPIED_FROM_SHAPEandFAMILY_COPIED_FROM_SHAPE
both name it), which is exactly whysiblings.pycan import it: the
holder's copy sits besidesiblings.pyinscripts/, andsiblings.py
already reaches it with the samesys.pathlinebootstrap.pyand
validate-family.pyuse. templates/family-root/scripts/siblings.pyimports it and keeps only
resolve_relative(the wrapper that reads the holder's ownorigin) and
clone_url.shape-doctor.pyreaches it through its EXISTING guarded
repo_shapeimport and drops the three names from theshape_materialize
one.scripts/shape_materialize.pykeeps a pointer where the block was and
no code: it never called any of these itself.- The parity test becomes an IDENTITY assertion —
siblings.same_repository is repo_shape.same_repository, and the same for the resolver — after which
the two tables run against the one function, with an expected answer per
row rather than a comparison between two implementations that could both
be wrong. - same_repository folds the case of a filesystem path, so two bare repositories on a case-sensitive host that differ only in case are called one repository #149's rule lands in the moved code: fold case only for a remote that
names a HOST, preserve it for a filesystem path, with the table rows same_repository folds the case of a filesystem path, so two bare repositories on a case-sensitive host that differ only in case are called one repository #149
asks for.
The pinned-copy consequence. scripts/repo_shape.py and
templates/family-root/scripts/siblings.py are both digest-pinned, so every
project and every holder reads upstream-changed for them in
update-shape.py check until its estate re-pins. That is the price named
above and it is owed either way: this is the change that was told to ride it.
Activity
brettheap commentedon Sep 12, 2026
(lane openreposhape-2 (openRepoShape-2), 2026-09-12T18:42Z) CLAIMED — session 9c6378ea, on Brett Heap's word 'do all 4'. Branch refactor/remote-rule-in-repo-shape, worktree ~/projects/openRepoShape--consolidate-remote-rule on Eagle, from origin/main 5c63116. Scope: the remote-url rule moves into scripts/repo_shape.py as one copy, siblings.py and shape-doctor.py import it, the parity test becomes an identity assertion over one function, and #149's case rule lands with the move (the one deliberate behaviour change).
siblings.py and shape-doctor.py answer "is this the same repository" …
brettheap commentedon Sep 12, 2026
(lane openreposhape-2 (openRepoShape-2), 2026-09-12T19:25Z) PULL REQUEST OPEN: #156 (head 7038429).
A RELATIVE remote is a filesystem path too, and the trailing `owner/r…
brettheap commentedon Sep 12, 2026
(lane openreposhape-2 (openRepoShape-2), 2026-09-12T22:40Z) REVIEW ROUND TAKEN: PR #156 is at head 0cc60d9 — Copilot (twice) and Codex (P1) found two places where #149's rule as first written either did not reach or reached too far, both fixed and answered on their threads; a third finding is older than this change and is filed unclaimed as #157. CI green on ubuntu, windows and macos; SonarCloud gate OK with 0 open issues on the PR; suite 1154 passed / 1 skipped.
The two copies of "is this the same repository" become ONE definition…
brettheap commentedon Sep 12, 2026
(lane openreposhape-2 (openRepoShape-2), 2026-09-12T22:42:11Z) MERGED — #156 → 313c57c (squash), on Brett Heap's word 'land 152 and 156 when they report, then re-pin'. the two copies of 'is this the same repository' — siblings.py's and shape_materialize.py's — become ONE definition in the pinned scripts/repo_shape.py; siblings.py keeps only resolve_relative + clone_url, the doctor imports from repo_shape, the parity test is an identity assertion with an expected answer per row; #149's rule lands once: a filesystem path (absolute, file:// with empty authority, Windows drive, ./ or ../) keeps its case, a host or bare Org/Repo folds it; 2 Copilot rounds + Codex P1 taken, #157 filed for a path/path tail question out of scope; 1154 passed / 1 skipped; Sonar 0; PINNED repo_shape.py + siblings.py → estate re-pin follows. Object complete.
same_repository compares two filesystem paths by EXACT equality, so /…