Skip to content

park and resume move to opensoft/openRepoTools: --install places one command and points at the other installer, the command tests go with the files, and nothing under templates/ moves (#92) - #94

Merged
brettheap merged 3 commits into
mainfrom
feat/carve-estate-commands
Sep 10, 2026

Conversation

@brettheap

@brettheap brettheap commented Sep 10, 2026 •

Copy link
Copy Markdown
Contributor

Lane: xfactory-2 (xFactory-2)
Claim: #92 (comment)

Part of #92 (slice S2). Held as a DRAFT until slice T1 (opensoft/openRepoTools#1) is on that repository's main, so the pointer this branch adds names a file somebody can actually curl. Based on d090a7a (#91/#93), which landed while this branch was being written and is the commit the umbrella's pin move is recorded against (#92 (comment)); this branch is rebased onto it and is ONE commit. docs/handbook.html's footer names README.md's BLOB HASH, which #93 made the guard's check (4) — git hash-object README.md on the working tree, no commit object involved — so the page and the README it is a reading of land together, self-consistently, in that one commit, and nothing here needs a follow-up to re-cut.

Merge order — both gates are now open. T1 landed: openRepoTools' main is 9fbf01c, and https://raw.githubusercontent.com/opensoft/openRepoTools/main/openRepoTools returns HTTP 200, so the pointer this branch prints names a file anybody can fetch. T1 carries d090a7a's park/resume (843/1338 lines, park_every_estate present) and pins commit: "d090a7a141048b214f0420a8c7afbfff62472d1a", so Brett's park-everything ruling (#91) travelled with the files rather than being deleted here.

Why this may merge before workBenches#33 (W1), even though #92's Order lists W1 first. W1's reason for going first was that it pins a commit at which park and resume still exist in this repository — and that pin is d090a7a, a commit on this repository's main (gh api repos/opensoft/openRepoShape/compare/main...d090a7a → identical today; an ancestor of main after this squash lands, never an orphaned branch commit). Its bytes stay fetchable at that ref: gh api "…/contents/park?ref=d090a7a" returns the 842-line file and https://raw.githubusercontent.com/opensoft/openRepoShape/d090a7a…/park returns HTTP 200, both verified at this head. W1 also holds VENDORED COPIES taken at apply time and checked against recorded sha256 rows, not re-fetched at build or check time, so nothing in W1 reads this repository's main at all. Deleting the files from main therefore cannot break W1's pin, its update-upstream.py check, or a later re-apply at that same commit.

What leaves. park (842 lines), resume (1337) and tests/test_park_resume_commands.py (1442) are deleted, not emptied. tests/test_park_resume_targets.py stays untouched and green: it tests make park and make resume in the two root templates, which is layer 2, and layer 2 is not moving.

The shim. INSTALLABLES=(openRepoShape), and the all-or-none collection machinery around it is kept whole — the property F10 of the review on #83 bought is a property of the STRUCTURE, and an installer that holds it only while the list is long loses it the next time somebody shortens the list, which is this commit. --install now prints, after the count line and before the PATH note, unconditionally:

openRepoShape: installed at /home/…/.local/bin/openRepoShape
openRepoShape: 1 of 1 placed in /home/…/.local/bin
  park and resume are installed by openRepoTools, not by this command:
    curl -fsSL https://raw.githubusercontent.com/opensoft/openRepoTools/main/openRepoTools | bash -s -- --install
  /home/…/.local/bin is not on $PATH. Add it:
    export PATH="/home/…/.local/bin:$PATH"

It does not fetch from openRepoTools, and that is the design rather than an omission: a command that reached into another repository to complete its own install would make the standard depend on its tools at runtime. The header paragraph and the usage() block that said THREE commands are the pointer now; openRepoShape --install install (or update) this command into ~/.local/bin already said "this command", singular, and needed no edit.

Documents. No new ## heading, so README_HEADING_TO_HANDBOOK_ID and the page's section ids do not move. README.md: Quick start step 3 and "Install the command" go from THREE commands to one, and the second gains openRepoTools' own one-liner in a sh block, cross-linked to "Carrying in-flight work to another workstation"; the park <Name> / resume <Name> subsection says openRepoTools --install and links to it; the native-Windows warning names openRepoTools' install line. The park/resume documentation itself is UNCHANGED — those commands still exist and still behave as it says, park-everything included; only where they are installed from changed, which is one clause of one sentence. The README's Layout block has no park/resume rows to lose (the plan expected two; the rows are on the handbook page, not in the README, and the page's are removed) and gains no openRepoTools row, because that block is the layout of THIS repository. AGENTS.md keeps rules 1-4 of "Parking and resuming"; the installed-commands paragraph and rules 5-6 become two lines pointing at opensoft/openRepoTools' AGENTS.md. docs/handbook.html follows in six regions, hand-edited in the page's own design: the masthead's fastest path (:491), step 3 on all three platform tabs (:736), #park's subsection (:1368, which is where the one-liner appears as a sh block, next to the commands a reader came for), the Windows warning (:1466), #layout (:1499, the two rows out and openRepoShape reading the README's own "installs itself as a command"), and #agents (:1546, where AGENTS.md's departed rules leave a bullet that is now about the MAKE targets and says where the installed commands' rules live). The footer's README.md blob is this README's git hash-object.

templates/ is untouched — the acceptance criterion of #92, checked and not hoped for:

$ git diff --stat origin/main -- templates/
$

Nothing. Every park and resume under templates/ is the Make target or the extension script it dispatches to, so no project can receive an upstream-changed row from this work.

Tests. python3 -m pytest tests -q: 815 passed, 1 skipped (4m20s, exit 0) at head dd84b19 (814/1 at d62c834; the extra test is NIT 1's). CI at that head: tests, tests-windows and tests-macos all SUCCESS, SonarCloud SUCCESS. tests/test_openreposhape_command.py: INSTALLED = ("openRepoShape",) and every install test still loops over it; test_help_names_the_other_two_commands → test_help_points_at_openrepotools (asserts the install line byte for byte in --help); test_install_places_all_three_or_none → test_a_failed_fetch_replaces_nothing, run from stdin with the whole of INSTALLED withheld and TWO witnesses in the bin directory — an older openRepoShape and a park an install before the carve left there, both byte-unchanged, because this command does not place park and so does not tidy one away either; and new test_install_points_at_openrepotools, which drives the FETCHING install through a gh and a curl that log every call, asserts the log holds at least one request, and asserts no request in it names openRepoTools. tests/test_repo_hygiene.py: SHIPPED_BASH = ["setup.sh", "openRepoShape"], plus two new tests — test_the_openrepotools_install_line_is_the_same_everywhere (byte-identical in the shim, README.md and docs/handbook.html: it is copied and pasted by somebody who cannot check it, the argument test_the_windows_commands_name_files_that_exist already makes) and test_nothing_here_installs_park_or_resume (a file of either name back at this root, or anything but this command in INSTALLABLES, fails). Both new assertions were proven to BITE, not merely to pass: deleting the shim's pointer line and altering one byte of the curl line each fail test_install_points_at_openrepotools before being reverted.

By hand, in a clone of this branch: bash -n openRepoShape clean; OPENREPOSHAPE_BIN_DIR=$(mktemp -d) holding a pre-placed dummy park → 1 of 1 placed, the two pointer lines, openRepoShape byte-identical to the checkout, and the dummy park byte-unchanged by sha256; the same install from stdin behind a logging gh/curl made exactly one request, gh api repos/opensoft/openRepoShape/contents/openRepoShape?ref=main, and none naming openRepoTools; grep -rn '\bpark\b' README.md AGENTS.md returns only make park lines, the park <Name> section's own prose about the verbs, and the pointer — no line claims this repository installs either.

Line caps. AGENTS.md 381 → 351, cap unmoved at 381. README.md 1225 → 1230, cap raised to 1230 with a dated docstring entry naming what the five lines bought: where the verbs went, said in both places somebody reads an install line (a person who ran the old one-liner has park on PATH and no way to learn from this file why it stopped being replaced), and openRepoTools' own one-liner as a sh block rather than a sentence naming a repository — the same argument the openRepoShape install block itself won over "fetch the file and run it" (#38). No second Invoke-WebRequest in either file: grep -c gives 1 and 1, so test_the_windows_commands_name_files_that_exist's single-match unpack is intact.

Decisions beyond the plan, for the reviewer. (1) ONE commit rather than the planned two, and no handbook follow-up: the split existed only for the commit-sha handbook strategy #93 retired in favour of the blob hash; (2) the README Layout block is left alone (it never listed the two files); (3) test_the_openrepotools_install_line_is_the_same_everywhere and test_nothing_here_installs_park_or_resume are additions the plan did not ask for, and both encode a reviewer question from #92's own list (do the shim's and README's lines match byte for byte; is the carve real) as a test rather than as a one-time check; (4) docs/handbook.html is in that first test's file list, so the page's copy of the line cannot drift either; (5) the handbook's #agents bullet is a SEVENTH region the plan's four did not name — AGENTS.md's rules 5-6 left, and a page quoting a section its source no longer has is the drift the guard exists to prevent; (6) the shim's $OPENREPOSHAPE_BIN_DIR help line reads "where --install puts it" rather than "puts them", and the all-or-none refusal reads "places every one of the N it collects or none of them" so it is grammatical at one.

One thing done and undone, stated plainly. While proving the install by hand I ran bash openRepoShape --install once WITHOUT OPENREPOSHAPE_BIN_DIR, which replaced ~/.local/bin/openRepoShape on this workstation with this branch's copy. It was restored to origin/main's bytes immediately (cmp clean, mode 755, --version prints openRepoShape (opensoft/openRepoShape @ main)); ~/.local/bin/park and ~/.local/bin/resume were never written — this branch's --install places one file. No committed file is affected.

Fix round after the adversarial review (d62c834 → head below; the review's one DEFECT was this body's stale merge-order block, corrected above). NIT 1, the one worth a commit: the review proved that at ONE installable, "collect everything then place it" and the pre-#82 "fetch and place one at a time, dying on the first failure" are indistinguishable to this suite — it rewrote install_commands into the old shape and 110 tests stayed green. New test_all_or_none_still_holds_at_more_than_one_installable runs a COPY of the shim whose INSTALLABLES carries a second synthetic name (the real array untouched — a test that edited it would measure the thing it changed), from its own file so only witness must be fetched, with the fake server refusing it, and asserts THE STRUCTURAL PROPERTY FIRST: the older openRepoShape already in the bin directory comes out byte for byte. A per-file installer refuses too and can refuse in words that look right; what separates the shapes is whether the file it COULD place was placed before it found the one it could not. Proven both ways in a scratch copy that was never committed — the pre-#82 shape fails on that assertion even with its refusal text written to match, and test_a_failed_fetch_replaces_nothing passes under the same mutation, which is why the new test had to exist. NIT 2: --help's $OPENREPOSHAPE_BIN_DIR row is back in column with the other two. NIT 3: openRepoTools' paragraph and sh block move ABOVE "Or type the long line, on a machine you would rather install nothing on", so the two installers read together and the reader who wanted no install is not handed one next; curl line byte-identical, README.md still 1230 lines, footer blob re-cut to f7a81dd — the page needs no counterpart edit, it carries no "install nothing" alternative to order against. NIT 4: AGENTS.md's cap comes DOWN 381 → 351 with a dated entry naming #92, because the two entries above it earn thirty lines of headroom with the rules this branch moved out. NIT 5: the comment above the PATH note claimed the note was about openRepoTools' directory as well; openRepoTools reads $OPENREPOTOOLS_BIN_DIR and this note prints $OPENREPOSHAPE_BIN_DIR, so the comment now says what the code does and that the two defaults coincide only when neither variable is set (comment only, no behaviour changed).

Review comments. Copilot's second review raised one finding and it is fixed at dd84b19: fake_github's optional request log was appended to as >> {log} — an unquoted path interpolated into a /bin/sh script — so a $TMPDIR or --basetemp containing a space split the redirection target and the log never landed where the assertion reads it. Proven both ways with --basetemp='…/a dir with spaces/t': test_install_points_at_openrepotools fails on the unquoted version (FileNotFoundError on the log it was told to read) and passes on the fixed one. The sibling had it too, and worse: test_install_from_a_file_never_calls_gh's fake gh is touch {marker}, also unquoted, where the failure is SILENT — touch given a split path creates files nobody named, none of them $marker, so assert not marker.exists() would pass whether or not gh had been called. Both are now quoted the way the exec cat '{served / name}' route beside them always was, each with a comment naming the failure the quotes prevent; no assertion moved and no test intent changed. grep -nE "touch |>> |exec cat " over that file names three interpolated paths and all three are quoted, and the same grep over the rest of tests/ finds no other generated shell script that interpolates a path. Sourcery declined the review on a rate limit (its own message, not a finding); SonarCloud is SUCCESS.

🤖 Generated with Claude Code

Summary by Sourcery

Move the standalone park and resume commands to openRepoTools while limiting this repository's installer to openRepoShape and documenting the separate installation path.

New Features:

  • Point users to openRepoTools for installing the park and resume commands while keeping the local installer focused on openRepoShape.
  • Preserve all-or-none installation behavior and explicitly avoid fetching openRepoTools during installation.

Bug Fixes:

  • Prevent stale or partial installations by retaining atomic install safeguards and leaving existing park files untouched.

Enhancements:

  • Move the standalone park and resume command implementations and their command tests out of this repository.
  • Update README, handbook, and assistant guidance to reflect the new command ownership and installation flow.
  • Add coverage for installer ownership, cross-document install-line consistency, and the atomic-install invariant with multiple installables.

CI:

  • Update Bash syntax checks to validate only the entry points shipped by this repository.

Tests:

  • Adjust installer and repository-hygiene tests for the single shipped command and add safeguards against reinstalling the moved commands.

Chores:

  • Leave the templates/ targets and related tests unchanged.

…command and prints the pointer at that installer, the command tests go with the files, and nothing under templates/ moves (#92)

`park` and `resume` are DELETED here and are opensoft/openRepoTools' commands
now, with an installer of their own (#92, and the direction behind it: tools
depend on the shape, the shape depends on nothing). `tests/test_park_resume_
commands.py` — 1442 lines — goes with them.
`tests/test_park_resume_targets.py` STAYS, because it tests `make park` and
`make resume` in the two root templates, and layer 2 is not moving.

THE SHIM. `INSTALLABLES=(openRepoShape)`, and the all-or-none collection
around it is kept whole. The property F10 of the review on #83 bought — a
failed fetch replaces NOTHING and names what it could not get — is a property
of the structure and not of the count, and an installer that holds it only
while the list is long is an installer that loses it the next time somebody
shortens the list, which is this commit. `--install` prints, after the count
line and before the PATH note, unconditionally:

      park and resume are installed by openRepoTools, not by this command:
        curl -fsSL https://raw.githubusercontent.com/opensoft/openRepoTools/main/openRepoTools | bash -s -- --install

IT DOES NOT FETCH FROM THAT REPOSITORY, and that is the whole design of the
line: a command that reached into another repository to complete its own
install would make this standard depend on its tools at runtime.
`test_install_points_at_openrepotools` runs the FETCHING install — from stdin,
so every file is requested — through a `gh` and a `curl` that log every call,
asserts the log holds at least one request, and asserts that no request in it
names openRepoTools. The header paragraph and the `usage()` block that said
THREE commands are the pointer now; `openRepoShape --install  install (or
update) this command into ~/.local/bin` already said "this command", singular,
and needed no edit.

README.md and AGENTS.md follow. No new `## ` heading, so
`README_HEADING_TO_HANDBOOK_ID` and the page's section ids do not move. The
two install paragraphs go from THREE commands to one and gain the sentence
saying where the verbs went; "Install the command" gains openRepoTools' own
one-liner in a `sh` block, cross-linked to "Carrying in-flight work to another
workstation" — which is otherwise unchanged, because it documents two commands
that still exist and still work exactly as it says, park-everything (#91)
included. AGENTS.md keeps rules 1-4 of "Parking and resuming" (they are about
`make park` and `make resume`); the installed-commands paragraph and rules 5-6
— including #91's park-everything sentence, which is about the INSTALLED
`park` — are two lines pointing at opensoft/openRepoTools' AGENTS.md, which is
where an agent driving those two commands reads them now. AGENTS.md: 381 ->
351, cap unmoved. README.md: 1225 -> 1230, and the cap moves with a dated
entry saying which five lines it bought.

THE macOS JOB drops `/bin/bash -n park` and `-n resume`. That step exists
because the README claims a stock Mac's bash 3.2 parses every bash file this
standard ships; openRepoTools' own CI gains it for the same reason, and the
repository that ships a file is the one that can make the claim.

`docs/handbook.html` follows in six regions, hand-edited in the page's own
design rather than re-sha'd: the masthead's fastest path and step 3 on all
three platform tabs (ONE command, and the verbs named as openRepoTools' with a
link); `#park`'s `park <Name>` subsection, which carries the one-liner itself
as a `sh` block where a reader meets those commands; the `Native Windows parks
nothing` warning; `#layout`, whose `park` and `resume` rows go and whose
`openRepoShape` row becomes the README's own "installs itself as a command";
and `#agents`, where AGENTS.md's departed rules 5-6 leave a bullet that is now
about the MAKE targets and says where an assistant reads the installed
commands' rules. The footer's `README.md blob` moves to this README's hash.
ONE COMMIT rather than #92's planned two: that plan assumed check (4) of
`test_the_handbook_follows_the_readmes_outline` still diffed against a named
COMMIT, which needed the page to name a commit on this branch and a follow-up
to re-cut it after the squash. #91 (d090a7a) replaced that with
`git hash-object README.md` on the working tree, so page and README land
together in one self-consistent commit and no follow-up is owed.

TWO NEW HYGIENE TESTS, because a carve nobody asserts on is a carve that comes
back by copy: `test_the_openrepotools_install_line_is_the_same_everywhere`
holds the one install line byte-identical in the shim, README.md and
docs/handbook.html — it is copied and pasted by somebody who cannot check it,
the same argument `test_the_windows_commands_name_files_that_exist` makes —
and `test_nothing_here_installs_park_or_resume` fails if a file of either name
returns to this root or if `INSTALLABLES` names anything but this command.

NOTHING UNDER `templates/` IS TOUCHED. `git diff --stat origin/main --
templates/` on this branch is empty, which is the acceptance criterion of #92
and the reason no project receives an `upstream-changed` row from this work:
every `park` and `resume` under `templates/` is the Make target or the
extension script it dispatches to.

Co-authored-by: Claude Fable 5.1 <[email protected]>
Lane: xfactory-2 (xFactory-2)
Copilot AI lite review requested due to automatic review settings September 10, 2026 16:33
@brettheap

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@sourcery-ai

sourcery-ai Bot commented Sep 10, 2026

Copy link
Copy Markdown

Reviewer's Guide

This PR moves the installed park and resume commands to openRepoTools: openRepoShape now installs only itself, prints the other repository’s installer without invoking it, removes the root command implementations and tests, and updates CI, documentation, hygiene checks, and parity tests while leaving templates/ untouched.

Sequence diagram for split command installation

sequenceDiagram
    participant User
    participant openRepoShape
    participant BinDir
    participant openRepoTools

    User->>openRepoShape: --install
    openRepoShape->>BinDir: install openRepoShape
    openRepoShape-->>User: print openRepoTools installer
    User->>openRepoTools: --install
    openRepoTools->>BinDir: install park and resume
Loading

Flow diagram for the new openRepoShape installation behavior

flowchart TD
    Start[Run openRepoShape --install] --> Place[Place openRepoShape only]
    Place --> Print[Print openRepoTools --install one-liner]
    Print --> Path[Print PATH guidance when needed]
    Print -. does not fetch or invoke .-> Tools[openRepoTools installer]
Loading

File-Level Changes

Change Details Files
Carve the installed park and resume commands out of this repository while preserving the template-level Make targets.
  • Delete the root command implementations and their command-specific test suite.
  • Remove the commands from shipped Bash and CI syntax checks.
  • Retain documentation and tests for templates/ targets, which remain unchanged.
park
resume
tests/test_park_resume_commands.py
.github/workflows/tests.yml
tests/test_repo_hygiene.py
Reduce openRepoShape --install to installing only itself and make it point users to openRepoTools for the other commands.
  • Set the installable collection to openRepoShape while retaining all-or-none staging and replacement behavior.
  • Print the byte-exact openRepoTools installer command without fetching or installing park or resume.
  • Add tests covering the one-command install, failure atomicity, stale sibling preservation, pointer output, and absence of openRepoTools fetches.
openRepoShape
tests/test_openreposhape_command.py
tests/test_repo_hygiene.py
Update repository guidance and user-facing documentation to reflect the command ownership transfer.
  • Replace local installation claims with the openRepoTools installer pointer in README.md, AGENTS.md, and the handbook.
  • Keep the existing park/resume behavior and template documentation intact while updating installation references, layout entries, Windows guidance, and assistant rules.
  • Add cross-file parity coverage for the installer line and refresh the handbook's README blob hash.
README.md
AGENTS.md
docs/handbook.html
tests/test_repo_hygiene.py

Possibly linked issues


Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The carve-out is implemented consistently across code, tests, CI, and documentation, with explicit guards to prevent regressions (re-shipping or fetching openRepoTools).

Pull request overview

This PR updates openRepoShape to stop shipping/installing the park and resume user commands (now owned by opensoft/openRepoTools) while keeping openRepoShape’s installer semantics intact and updating docs/tests/CI accordingly.

Changes:

  • Remove root-level park/resume commands and their command-level test suite from this repository.
  • Update openRepoShape --install to place only openRepoShape, and print a byte-identical one-liner pointing to openRepoTools for park/resume.
  • Refresh README/handbook/AGENTS guidance, update repo hygiene checks, and adjust CI parsing checks to reflect the new ownership boundary.
File summaries
File Description
openRepoShape Installer now places only openRepoShape and prints the openRepoTools installer line for park/resume.
park Deleted (commands moved out of this repo).
resume Deleted (commands moved out of this repo).
tests/test_park_resume_commands.py Deleted (command-level tests move with the commands).
tests/test_openreposhape_command.py Updates install/help expectations for the single installed command and verifies the pointer is text-only (no fetching openRepoTools).
tests/test_repo_hygiene.py Updates shipped-bash list, README length cap, and adds assertions ensuring the openRepoTools installer line is consistent and this repo doesn’t re-ship park/resume.
README.md Updates installation and workstation handoff sections to reflect openRepoTools ownership and includes the new one-liner.
docs/handbook.html Mirrors README/AGENTS updates and removes park/resume from the “layout of this repository” section.
AGENTS.md Removes installed-command details for park/resume and points assistants to openRepoTools’ AGENTS.md.
.github/workflows/tests.yml Stops parsing park/resume under macOS bash 3.2 in this repo’s workflow.
Review details
  • Files reviewed: 10/10 changed files
  • Comments generated: 0
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

…ioural guard at two installables, the README's two installers read together, AGENTS.md's cap follows the file down, and two comments say what the code does (#92)

NIT 1, and the one worth the commit. The review proved that at ONE installable
"collect everything, then place it" and the pre-#82 "fetch and place one file
at a time, dying on the first failure" are indistinguishable to this suite: it
rewrote `install_commands` into the old shape and 110 tests stayed green. The
code is right and the argument for keeping `collect_commands` is right; what
was gone is the guard. `test_all_or_none_still_holds_at_more_than_one_
installable` runs a COPY of the shim whose `INSTALLABLES` carries a second
synthetic name, from its own file so that `openRepoShape` comes from the
sibling beside it and only `witness` must be fetched, with the fake server
refusing `witness` — and asserts THE STRUCTURAL PROPERTY FIRST, before any
message: the older `openRepoShape` already in the bin directory comes out byte
for byte. A per-file installer refuses too, and can refuse in words that look
right; what tells the shapes apart is whether the file it COULD place was
placed before it found the one it could not. Proven both ways in a scratch
copy that was never committed: the pre-#82 shape fails this test on that
assertion even when its refusal text is written to match, and
`test_a_failed_fetch_replaces_nothing` passes under the same mutation, which
is why the new test had to exist. The real `INSTALLABLES` is untouched — a test
that edited it would be measuring the thing it changed.

NIT 2. `--help`'s `$OPENREPOSHAPE_BIN_DIR` row lost its column when "puts them"
became "puts it"; all three `(default …)` now start at the same column again.

NIT 3. `#### Install the command` handed a reader who had just taken the "on a
machine you would rather install nothing on" branch an install one-liner as the
next thing on the page. openRepoTools' paragraph and its `sh` block move UP, to
sit with the openRepoShape install they belong beside; the long line closes the
section as the alternative it is. The `curl` line is byte-identical, README.md
stays 1230 lines, and `docs/handbook.html`'s footer moves to the new
`git hash-object README.md`. The page needs no counterpart edit: it carries no
"install nothing" alternative to be ordered against (`grep -i 'long line'` on
the page finds nothing), which is why only the blob hash moves here.

NIT 4. AGENTS.md's cap comes DOWN, 381 -> 351, with a dated entry naming #92.
The two entries above it earn thirty lines of headroom with the
installed-commands paragraph and points 5-6, which this branch moved to
openRepoTools' AGENTS.md; a cap left at 381 would let the next procedure spend
lines nobody argued for. The entry says which points stay and why (1-4 are
about `make park` and `make resume`, which both root templates still ship).

NIT 5. The comment above the PATH note claimed the note was about the directory
openRepoTools would use as well. It is not: openRepoTools reads
`$OPENREPOTOOLS_BIN_DIR` and this note prints `$OPENREPOSHAPE_BIN_DIR`, so with
`OPENREPOSHAPE_BIN_DIR=/opt/bin` set the note names `/opt/bin` directly under a
line about a command that would install to `~/.local/bin`. The comment now says
what the code does — this command's own directory — and that the two defaults
coincide only when neither variable is set. Comment only; no behaviour changed.

The review's one DEFECT was in the pull request body rather than the diff (a
merge-order block that openRepoTools#1 has since made false) and is fixed
there, not here.

Co-authored-by: Claude Fable 5.1 <[email protected]>
Lane: xfactory-2 (xFactory-2)
Copilot AI review requested due to automatic review settings September 10, 2026 16:58

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

The new test helper that logs fake gh/curl calls redirects to an unquoted temp-path file, which can break when the temp directory contains spaces.

Review details

Suppressed comments (1)

Previously missed (1) — in code that hasn't changed since the last review.

tests/test_openreposhape_command.py:497

  • The generated fake gh/curl scripts append to requests.log using an unquoted path (>> {log}), which will break if the temp directory path contains spaces or other shell-special characters. Quoting the redirection target makes the helper robust without changing test intent.
  • Files reviewed: 10/10 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry @brettheap, you've used your own review budget of 250,000 diff characters for the last 7 days.

You can request another review in 7 hours and 56 minutes by commenting @sourcery-ai review. Upgrade to get a review now.

…to, so a $TMPDIR or --basetemp with a space in it cannot send a witness somewhere nobody looks (#92)

Copilot's review on PR #94, taken. `fake_github`'s optional request log was
appended to as `>> {log}` — an unquoted path interpolated into a `/bin/sh`
script — so a temporary directory with a space in it split the redirection
target and the log never landed where the assertion reads it. Proven both
ways with `--basetemp='<…>/a dir with spaces/t'`:
`test_install_points_at_openrepotools` fails on the unquoted version
(`FileNotFoundError` on the log it was told to read) and passes on this one.

THE SIBLING HAD IT TOO, and worse. `test_install_from_a_file_never_calls_gh`
writes a fake `gh` whose whole job is `touch {marker}`, also unquoted. There
the failure is SILENT rather than loud: `touch` given a split path creates
files nobody named and none of them is `$marker`, so `assert not
marker.exists()` passes whether or not `gh` was called at all — a witness
that cannot be found is a test that guards nothing. Both are now quoted the
way the `exec cat '{served / name}'` route beside them always was, with a
comment on each saying which failure the quotes prevent.

No test intent changed and no assertion moved. `grep -nE "touch |>> |exec cat "`
over this file names three interpolated paths and all three are quoted; the
same grep over the rest of `tests/` finds no other generated shell script that
interpolates a path.

Co-authored-by: Claude Fable 5.1 <[email protected]>
Lane: xfactory-2 (xFactory-2)
Copilot AI review requested due to automatic review settings September 10, 2026 17:08
@sonarqubecloud

Copy link
Copy Markdown

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The carve-out is consistently applied across installer behavior, documentation, CI, and tests, with explicit invariants guarding against drift and accidental reintroduction of park/resume in this repository.

Review details
  • Files reviewed: 10/10 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

@brettheap
brettheap merged commit 0fa73b7 into main Sep 10, 2026
6 checks passed
@brettheap
brettheap deleted the feat/carve-estate-commands branch September 10, 2026 17:21
brettheap added a commit to opensoft/openRepoTools that referenced this pull request Sep 10, 2026
…ume carve (#5)

openRepoShape's `main` advanced past the park/resume carve
(opensoft/openRepoShape#94, slice S2 of #92): `park` and `resume` left its
tree for this repository's own copies. Bump `contracts/openreposhape-pin.yaml`'s
`commit:` and `digests.tree_sha256`, and the `upstream/openRepoShape` gitlink,
together in one commit, per the README's "Bumping the pin" procedure — the
edit lands before the `git add`, so the moved gitlink never lands paired with
the old pin file. The digest is recomputed with the pinned checkout's own
`scripts/repo_shape.py`, never adjusted to fit.

`tests/test_upstream_pin.py`'s pre-carve witness entry for `park` is deleted
here too, as its own docstring said to: 0fa73b7's tree no longer carries the
file `test_park_resume_commands.py` used to diff against.

Lane: openreposhape-2 (openRepoShape-2)

Co-authored-by: Claude Fable 5.1 <[email protected]>
brettheap added a commit that referenced this pull request Oct 13, 2026
…d `open_glass` share one `SHAPE_PIN_SOURCE_<PRODUCT>`, so `--pin` refuses the pair and `validate-pins.py` notes a declared one and reads the variable for neither (#275) (#409)

`pin_source_env_name` turns every character outside `[A-Z0-9_]` into `_`, so
`open-glass`, `open_glass` and `open.glass` are three legal product names, with
three pin files (`contracts/<product lowercased>-pin.yaml`), and one variable,
`SHAPE_PIN_SOURCE_OPEN_GLASS`. On ab623dd (this branch's main parent; the same
rows reproduce on c7c02fa), with the issue's own probe against local bare
remotes and a `gh` that exits 97:

| step | ab623dd | this head (6494714) |
|---|---|---|
| `scaffold-project.py --pin open-glass@<A> --pin open_glass@<B>` | exit 0, three repositories | exit 2 `scaffold-pin-collides`, nothing created |
| `validate-pins.py`, no source, on a project that already declares the pair | exit 0, both skips offer `SHAPE_PIN_SOURCE_OPEN_GLASS` | exit 0, one `note neutral-pin-source-collides`; the skips offer `--pin-source <product>=<path>` and a sibling checkout only |
| `SHAPE_PIN_SOURCE_OPEN_GLASS=<open-glass>` | `neutral-pin-source-unreadable` for `open_glass`, exit 1 | exit 0, the note; the variable is read for neither pin, so each pin is read from its own source or skipped |
| `SHAPE_PIN_SOURCE_OPEN_GLASS=<open_glass>` | `neutral-pin-source-unreadable` for `open-glass`, exit 1 | the same |
| `--pin-source open-glass=... --pin-source open_glass=...` | exit 0 | both pins recompute, exit 0, the note |

**What changed.** Every variable name is kept: an operator may have set one and
the docs name them. What is done instead:

- `scripts/repo_shape.py`: `pin_source_env_collisions(products)` is the one
  pure answer, `{variable: [products]}` for each variable two or more distinct
  products share. Distinct means distinct PIN FILES (`pin_product_key`,
  `lower()`, which is what `contracts/<product lowercased>-pin.yaml` is named
  by), so a product typed twice or in two cases is #241's file collision and
  never this one. `pin_source_env_shared` is the set of those keys.
- `scaffold-project.py`: `_refuse_colliding_pins` (left where it is) names each
  variable's `--pin` arguments as typed after #241's file sentences, in the same
  `scaffold-pin-collides` refusal. Dry run and real run say the same no, before
  any process starts and ahead of the leg-path refusal. #241's wording and
  remediation are unchanged when only a file collides. A NEW pair is still
  refused, so the situation is not created anew.
- `templates/assembly-root/scripts/validate-pins.py`: one NOTE per variable,
  `neutral-pin-source-collides`, naming every product and the variable, the
  keyed `--pin-source <product>=<path>` that reads each pin, and that which
  declaration stays is the human's decision. It is never a finding and never
  moves the exit code. A product whose variable is shared does not read it (rule
  2 of `resolve_neutral_pin_source`), and its skip hint offers the keyed
  `--pin-source <product>=<path>` and not the variable or the bare form.
  A variable one product has to itself reads and is offered exactly as before.
- `scripts/repo_shape.py`, the two chain readers: `link_pins_from_trees` does
  not read a variable two links of one chain share, and the
  `declared-unverified` hint stops naming it. Only a hand-written chain can have
  two such links, since scaffold takes every link but the first from the naming
  policy's alphanumeric `open<Product>` form.

Each reader of `pin_source_env_name`, decided:

| site | decision |
|---|---|
| `scaffold-project.py --pin` | refuse (above) |
| `validate-pins.py` rule 2 and the skip hint | a note, and the variable is neither read nor offered for a shared product |
| `repo_shape.py` `resolve_link_source` (via `link_pins_from_trees`) | skip the variable when another link of the chain shares it |
| `repo_shape.py` `_chain_link_findings` hint | omit the variable for a shared link |
| `adopt-project.py --pin`, `plan`, `check`, `execute` | not in this PR, see below |

**Fix round 1 (from the review of 34dbd86).**

**The design change: a declared pair is a NOTE and not a finding. This is the
lane coordinator's decision, and Brett may reverse it.** The first round made
`neutral-pin-source-collides` a FINDING. Main through ab623dd scaffolds such a
project (`--pin open-glass@A --pin open_glass@B` exits 0), and
`update-shape.py apply` runs the NEW `validate-pins.py` over the rewritten root,
so for a project already declaring the pair the finding ended every apply as
`REFUSED update-validators-red`, rolled back, for this update and every later
one, until a person deleted a true declaration of descent. AGENTS.md tells an
agent never to edit "a pinned file, a digest or a manifest to make a row go
green", and the finding's remediation was exactly that, so the person was
locked out. The coordinator chose the review's option (b): it is a NOTE now.
The guard stays (the variable is read for neither pin), each pin still verifies
from its own source, scaffold still refuses a new pair, and `validate-pins.py`
says the rest in one line. To put the finding back, restore 34dbd86's
`report.finding(...)` call in `_report_pin_source_collisions` (it is not a word
swap for `report.advise`: `advise` takes one string, `finding` a code and a
detail), give the finding the remediation 34dbd86 had, and turn the tests that
expect the note (and `test_a_project_declaring_a_colliding_pair_takes_a_shape_update`)
back into exit 1; the first round's versions of all of them are on 34dbd86.

- **Proved on a real old project.** Main (ab623dd) scaffolded the pair into
  local bare remotes; `update-shape.py apply` to the first round's head 34dbd86
  exited 2 `REFUSED update-validators-red` and rolled back (`git branch` shows
  only `main`); to this head it exits 0, the project's validator passes and
  prints the note, and the doctor's `pins` row is `ok` before and after. The
  doctor prints `passes` for a validator that exits 0 and does not echo its
  stdout, so the note itself is visible in `update-shape.py apply`'s output and
  in `validate-pins.py`'s, and the verdict moves for no reason but the update
  (`COMPLIANT, SHAPE BEHIND` to `COMPLIANT`). It is now a test:
  `test_a_project_declaring_a_colliding_pair_takes_a_shape_update`, over local
  stand-ins beside the project, so no `gh` is asked.
- **Collisions by the variable.** Pairs were decided by `casefold()`, but
  the pin file is `lower()`. `openß`/`openss`, `openſ`/`opens`, `openfi`/`openfi`
  and `openς`/`openσ` (the letters are U+00DF, U+017F, U+FB01 and U+03C2 beside
  U+03C3) share a variable and have two pin files, and were never found. They
  are now, from the pin-file fold (`pin_product_key`). A pool of 31
  names is checked pairwise against `neutral_pin_path` and
  `pin_source_env_name` themselves, and no single product is ever a collision.
  They are reachable only from a hand-written `project.yaml`.
- **Windows.** The guard's only test needed the `#!` `gh` stub and was
  skipped on Windows. `test_a_shared_variable_answers_for_neither_pin_with_no_gh`
  puts a checkout of each pin beside the project, names one in the variable, and
  needs no `gh`: on ab623dd it is `neutral-pin-source-unreadable`, here each pin
  reads its own sibling. The hint and the non-ASCII rows are tested in-process,
  with no skip and no filesystem.
- **The hint.** For a product two pins share, the skip hint offers the keyed
  `--pin-source <product>=<path>`: the bare form answers for every pin with no
  more specific source, so with two pins it gives the other the finding this
  issue is about.
- **Trailers and title.** The trailers of the earlier commits (a30091f and
  34dbd86 name Sonnet 5.5) are settled in this message, which carries Opus 5.5.
  The PR title now names `repo_shape.py`.
- `scaffold-project.py` is not touched this round: `fix/adopt-pin-writes-pin-file`
  moves that code, and the change would only conflict with it.

**Left out.**

- `adopt-project.py` is untouched. Its half arrives with #273's PR, which moves
  scaffold's pin machinery into a shared module and routes adopt through
  `pin_source_env_collisions`. Once it lands, the one place that still keys by
  `casefold()` (`pin_variable_collisions` in `scripts/shape_materialize.py`)
  should read `pin_product_key`; it cannot differ for an ASCII `--pin`, which
  is all `PIN_ARG_RE` takes.
- `scaffold-project.py`'s own `_colliding_pin_variables` also keys its
  argument lists by `casefold()` and one docstring there still says the
  project's validator reports the pair "as a finding"; both go with the code
  when #273 moves it. #312's `PinSources` keys `--pin-source` by `casefold()`
  too, so `openß=` and `openss=` are one key there; that is #312's.
- A product in `neutral_product_pins:` and a chain link in
  `naming.referent_chain` that share a variable are read by two validators in
  one process, and neither sees both sets. Not detected here.
- The doctor does not print a passing validator's stdout, so its `pins` row
  does not carry the note. Not changed: it would add a file to this PR.
- No `--help` text changed, so `docs/cli.md` is untouched. `README.md` is at its
  line cap and its blob is pinned by `docs/handbook.html`, so the one README
  sentence this wants needs a regenerated handbook and waits for its own change.
- `validate-pins.py` and `repo_shape.py` ship into projects, so every project's
  `shape-pin.yaml` reads `upstream-changed` for both until `update-shape.py
  apply`, which now succeeds for a project that declares such a pair.

**Evidence.** All on the head (6494714), with git-filter-repo 2.47.0 on PATH, a
`gh` that cannot be reached (a stub first on PATH, `GH_TOKEN` bogus, an empty
`GH_CONFIG_DIR`), and the repository-local `user.name` blanked at command-line
scope, as the standard's checkout sets one that two scaffold tests read.

- `tests/test_pin_source_env_collisions.py` is 137 tests and passes on this
  head. Laid over 34dbd86, 50 fail and 87 pass: the note and update tests, the
  non-ASCII rows, the hint, the sibling guard, and `pin_product_key` itself
  (which 34dbd86 does not have); the scaffold refusals, the chain readers and
  the controls hold on both.
- Targeted, run on ad6f569, whose tree differs from this head in
  `tests/test_pin_source_env_collisions.py` only (the last edits made one
  comparison read the committed blob and wrapped one line): the new file,
  `test_pin_validator`, `test_neutral_pin_validator`, `test_cli_reference`,
  `test_manifest_validator`, `test_naming_policy` and `test_repo_hygiene`
  **445 passed**; the scaffold pin, collision, referent-chain, leg-path and e2e
  files **245 passed**; `tests/test_update_shape*.py` **218 passed, 3 skipped**
  (junctions, NTFS only); `tests/test_shape_doctor.py` **254 passed, 3 skipped**
  (the PowerShell line, a Windows host only).
- On this head itself: the new file, `test_repo_hygiene`, `test_cli_reference`,
  `test_pin_validator` and `test_neutral_pin_validator` **244 passed**.
- This head merged with origin/main a983e6a, in a throwaway worktree: the new
  file, `test_pin_validator`, `test_neutral_pin_validator`, the scaffold pin,
  collision, referent-chain and e2e files, the whole doctor file and
  `test_cli_reference` **590 passed, 3 skipped** (the PowerShell line); the new
  file alone, in its final form, **137 passed**. origin/main had moved twice
  since; the merge-tree below is against it.
- Twelve mutation probes, each hunk reverted alone: all caught. The
  note-to-finding one is caught by the update test (a committed mutant, since the
  test clones the repository's HEAD) and the guards by the sibling test, run with
  every test that needs a `#!` stub deselected as a Windows runner would;
  the hint one by an in-process test.
- Nothing ran on macOS or Windows before this PR's CI.

**Merge-tree, as computed during the fix round on 2026-10-12** (every sha and
head is the one it had then; main and the other branches have moved since).
`git merge-tree --write-tree` of this head (6494714) against origin/main 1f90a0f
is clean, and so is the merge of origin/main a983e6a, which the merged-tree runs
above used. #312, #309, #270, #268, #228, #245 and #351 have landed. The rest
were computed on ad6f569 (the same tree but for one test file) against
a983e6a. Open PRs touching this branch's files, all clean against the head: #314, #355
and #373 (`scaffold-project.py`), #343 (`validate-pins.py`), #390 (`repo_shape.py`)
and #394 (`repo_shape.py`, which conflicts with origin/main by itself). The other 25 open PRs and the lane-5 branches
`fix/adopt-check-link-and-manifest`, `fix/scaffold-free-text-values`,
`fix/family-init-values`, `docs/adopt-execute-exits`,
`fix/yaml-flow-brackets-surrogates` and `fix/adopt-pin-writes-pin-file`
(#273's, 7a94b6b, also clean for this head) are clean too. #356, #382 and
`fix/adopt-record-submodule-placement` conflict with origin/main and not with
this head; #358, `fix/adopt-late-failure-notice` and
`fix/adopt-plan-quote-yaml-keywords` conflict with both, with origin/main by
themselves, so they are not this branch's. Neither are the five PRs below #200
that origin/main has not landed (#94, #96, #98, #100 and #161), which conflict
with it too. The PR set is read from the refs under `refs/pull/` that
origin/main's history has no `(#n)` subject for, not from GitHub, so a closed
one may be in it.

**One conflict, with `fix/link-source-values` (#338, 40762ca) in
`scripts/repo_shape.py`, four hunks.** Not resolved in either branch; take both
sides: (1) `resolve_link_source`'s signature, `default_source=None,
env_shared: bool = False, *, tried: list | None = None`; (2) its docstring, both
paragraphs; (3) `link_pins_from_trees`'s docstring, both paragraphs; (4) its
call, `default_source, pin_product_key(name) in shared, tried=asked)` followed
by #338's `if tried is not None: tried[name] = asked`. The auto-merged
`resolve_link_source` body already composes: a shared variable is never an
`env` candidate and so never appears in #338's `tried`.

**Known limits after the re-verification (APPROVE WITH NITS, 0 blockers, 0 should-fixes, 3 nits, at 6494714).** For the four non-ASCII pairs this change now detects (`ß`/`ss`, `ſ`/`s`, `fi`/`fi`, `ς`/`σ`), the keyed `--pin-source <product>=<path>` form does NOT separate the two pins: #312's source lookup folds both keys into one, so one pin can get a false `unreadable` finding. A sibling checkout does separate them. Only a hand-written `project.yaml` can declare such a pair. The doctor's `pins` row still prints only "passes" for a validator that passes, so it does not carry the collision note; that needs `shape-doctor.py`, and is left for a follow-up. The wording for restoring the finding is under "Fix round 1" above: it is 34dbd86's `report.finding(...)` call, not a word swap.

Reviewed adversarially at 34dbd86 (CHANGES NEEDED: 0 blockers, 2 should-fixes, 5 nits). The first should-fix was the finding itself, which locked a project that already declares the pair out of every `update-shape.py apply`; the second was a description that had gone stale. Fix round 1 (6494714) made the pair a NOTE, which is the coordinator's decision and one Brett may reverse (the way back is above), keyed collisions by the pin file's own fold, gave the guard a test that runs on Windows, and made a shared product's skip hint offer the keyed `--pin-source`. Its re-verification at 6494714 found every finding handled: APPROVE WITH NITS (0 blockers, 0 should-fixes, 3 nits: the keyed form and the non-ASCII pairs, the doctor's silence about the note, and the wording for restoring the finding, each stated above). CI is green on Linux, macOS and Windows, with SonarCloud passing, at b70a07d (main a73b4e9 merged in). Its merge with main 5a25387 passed the targeted set (the six pin and scaffold test files, `tests/test_validate_pins_unreadable_workflow.py`, `tests/test_ruleset_hint_tracking_branch.py` and `tests/test_shape_doctor.py`): 850 passed, 3 skipped.

Closes #275

Lane: openreposhape-5 (openRepoShape-5)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
brettheap added a commit that referenced this pull request Oct 13, 2026
… writes its pin file as the scaffold does, so an adopted root passes `validate-pins.py` (#273); a `--pin-source` that cannot answer is `pin-source-unreadable` (#339) (#508)

**Brought up to date after #409 squash-landed** by merging origin/main (9736424, #409's squash) as f9ed46f. Its `scaffold-project.py` conflict was resolved to this branch's side once `git diff b70a07d 9736424 -- scaffold-project.py` (#409's final head against its squash) came out empty. So the file is the one tested on this branch plus main's own later changes to it, and holds nothing of #409's; details below.

This branch carries #275's adopt half. It was built on `fix/pin-source-env-collisions`, PR #409 (#275's scaffold half and its fix round), merged at 6494714 as 583f647, over the earlier 5690235 (34dbd86). After 6494714, #409 only merged main, five times, up to its final head b70a07d, and none of those merges has a hand edit (`git show --remerge-diff` is empty for each). Adopt's refusal of two products that share a source variable goes through #409's function, so this branch lands after #409. It was never rebased.

`git diff b70a07d 9736424` is empty for each file #409 touched: `scaffold-project.py`, `scripts/repo_shape.py`, `templates/assembly-root/scripts/validate-pins.py` and `tests/test_pin_source_env_collisions.py`. What f9ed46f resolves, four files with one hunk each:
- **`scaffold-project.py`.**
  - The conflict hunk is main's block from `PIN_COLLISION_REMEDIATION` through `_pin_collision_remediation`, which #409's squash edits: it adds `PIN_VARIABLE_REMEDIATION`, `_colliding_pin_variables` and `_pin_collision_remediation` and changes `_refuse_colliding_pins`. This branch moved all of that to `scripts/shape_materialize.py`. The hunk takes this branch's side. (The merge commit's message says "re-adds"; this is the exact account.)
  - #409's auto-merged import of `PIN_SOURCE_ENV_PREFIX, pin_source_env_collisions` is dropped, because nothing in the file uses either name any more.
  - It is not `git checkout --ours` of the whole file. Main changed the file beyond #409 since this branch last merged it: #355's `--tracking-branch` check (6c2a371) and a73b4e9's `RULESET_HINT`. Those lines stay.
  - The result is the file `git merge-tree` gives for this branch with main before the squash (518010b). Its diff from the file tested here has the same patch-id as main's own 3ef059c..518010b change to it.
- **`templates/assembly-root/scripts/validate-pins.py`.** Main's side, which is #409's final blob, with main's #359 workflow reader in it. This branch had no change of its own to the file beyond #409.
- **`adopt-project.py`, `_commit_the_split`.**
  - Main: #445 wraps the function in its late-failure `try`, and #394 builds an `append` with the plan's submodule record.
  - This branch: its only edits there were a comment and `neutral_pins=_recorded_pins(plan)` on the materializer call.
  - Both now sit on main's call inside the `try`: `append=append, neutral_pins=_recorded_pins(plan)`.
- **`docs/cli.md`.** It is regenerated with `scripts/render-cli-reference.py`, and `--check` is ok. It differs from main's only in the `--pin`, `--pin-owner` and `--pin-source` help of `adopt-project.py plan`.

`scripts/repo_shape.py`, `templates/assembly-root/scripts/validate-pins.py` and `tests/test_pin_source_env_collisions.py` are main's blobs, which are #409's: this branch adds nothing to them. Nothing of #409 is lost. Its scaffold behaviour is `shape_materialize.refuse_colliding_pins` and `pin_variable_collisions`, keyed by #409's `pin_product_key`.

**73d65c6, after the merge.**
- **The change.** `_read_pins` reads `plan.get("pins")` where it read `plan.data.get("pins")`.
- **Why.** #445's `tests/test_adopt_late_failure.py` hands `_commit_the_split` a `SplitPlan` as its plan, a `dict` that adds `entries`. On f9ed46f, three of its tests stopped at "committing the split" with `AttributeError: 'SplitPlan' object has no attribute 'data'` (3 failed, 83 passed in that file).
- **Nothing else changes.** `Plan.get` with no default returns `plan.data.get(key)` exactly, so a loaded plan reads as before.

`adopt-project.py plan --pin` took a NAME only (`--pin openGlass`) and refused a trailing `@<commit>`. `plan`, `check` and `execute` each exited 0, and `execute` printed `adoption verified`. The manifest then listed the name in `neutral_product_pins:` with no `contracts/<product>-pin.yaml` beside it, and on its first run the adopted root's own `validate-pins.py` refused it as `neutral-pin-missing`.

#273's table, reproduced on c7c02fa with the issue's own commands (local bare remotes, and a stub `gh` that exits 97):

| `--pin` | c7c02fa | this branch |
|---|---|---|
| `openGlass` | `execute` exit 0, `- openGlass`; clone's `validate-pins.py` exit 2 `neutral-pin-missing` | `plan` exit 2 `pin-malformed`, with the scaffold's remediation (`--pin openGlass@<40 hex>`); no plan is written |
| `opensoft/openGlass` | exit 0, `- opensoft/openGlass`; exit 2 `neutral-pin-missing` for `contracts/opensoft/openglass-pin.yaml` | `plan` exit 2 `pin-malformed` |
| `spec` | exit 0; `validate-pins.py` exit 0, reading the leg's `contracts/spec-pin.yaml` as the neutral pin | `spec@<sha>` is `adopt-pin-collides` at `plan` |
| `shape` | exit 0; `contracts/shape-pin.yaml` read as the neutral pin | `shape@<sha>` is `adopt-pin-collides` at `plan` |
| `openGlass@<sha>`, `opensoft/openGlass@<sha>` | `plan` exit 2 `adopt-pin-malformed` | `plan`, `check` and `execute` exit 0, and `gh` is called 0 times. `contracts/openglass-pin.yaml` is written and the manifest lists `- openGlass`. In the clone, `validate-manifest.py` exits 0, and `validate-pins.py` exits 0 with `openGlass: pin commit … digest recomputes` |

Brett ruled for decision 1's first option ("go with your recommendation on #273"): adopt takes the scaffold's pin and writes the scaffold's pin file. That reverses the NAME-only `--pin` from #6, and the comment that described it is replaced with the new contract.

- **One implementation.** The scaffold's pin code moved into `scripts/shape_materialize.py`, next to `neutral_pin_path` and the materializer that writes the file. What moved:
  - `PIN_ARG_RE`, `parse_pin`, `pin_digest_from_source` and `pin_digest_from_gh`;
  - `declared_pin_values`, `declared_pin_products` and `PIN_COLLISION_REMEDIATION` (in #309's wording);
  - from #275's branch, `PIN_VARIABLE_REMEDIATION` and the variable check;
  - `_refuse_colliding_pins`, split into the pure `pin_collisions` and `pin_variable_collisions`, and `refuse_colliding_pins(refusal=...)`, which raises one refusal for both.

  The code did not move verbatim. `_refuse_colliding_pins` became the three functions above; `pin_digest_from_source` was rewritten for #339 (below); and fix round 1 changed three of them (below): `pin_variable_collisions` keys each pin by #275's `pin_product_key`, `pin_digest_from_source` spells a path that is not printable, and `pin_digest_from_gh` refuses a missing `gh`. The scaffold's behaviour is otherwise unchanged. `scaffold-project.py` imports what it calls under its old names. Lane 5's review ran 34 scaffold cases (every pin refusal, the `gh` stub's four modes, dry and real successes) on 34dbd86 and on this branch at 7a94b6b. rc, stdout, stderr, the `gh` log and the files made were identical, apart from the shape's own commit and digest and #339's row. Its pin tests and #275's pass as they are. `tests/test_git_output_decoding.py`'s exemption for `pin_digest_from_gh` follows the function to its new file.
- **`plan`.** `--pin`, `--pin-owner` and `--pin-source` mean what they mean for the scaffold. `plan` reads the digest from `--pin-source` or `gh api`, and records product, repository, commit, digest and `digest_source` in the plan, so `check` and `execute` read no network for a pin. `plan` refuses:
  - a name with no `@<commit>`, as `pin-malformed`. That includes an empty `--pin ''`, which adopt used to drop and now refuses, as the scaffold always has;
  - `spec`, `code` and `shape`, in any case, as `adopt-pin-collides` (#273 decision 4), in the scaffold's sentence and remediation (#241, #309);
  - one product given twice, the same way, whether it is a repeat or two names that share one file (decision 5);
  - two products that one `SHAPE_PIN_SOURCE_<PRODUCT>` names, such as `open-glass` and `open_glass`, the same way, through #275's check;
  - a leg path over a pin's file, as `adopt-leg-path-collides`;
  - a `--pin-source` path that `check` would refuse in `digest_source:` (fix round 1), as `adopt-unwritable-value`. It is asked only when a `--pin` records the path;
  - with no `gh` on PATH and no `--pin-source`, `gh-not-found` (fix round 1).
- **`check` and `execute`.** These are new `check` findings, and `execute` refuses each one before any leg exists. They come from `_leg_findings`, the list `check` and `_refuse_what_check_finds` share:
  - `plan-pin-unrecorded`: a name alone (an old plan's `pins: [openGlass]`, or a hand edit), or an entry missing its commit or digest;
  - `plan-pin-malformed`;
  - `plan-pin-collides`, which covers two pins at one file, a pin at a file the shape writes, and two products that share one source variable;
  - `plan-root-holds-pin`: a source path kept in the root at the pin's file. The materializer would write the shape's pin beside it under `shape/`, and `validate-pins.py` would read the source's file instead.

  How each finding ends:
  - `plan-pin-unrecorded` and `plan-pin-malformed` end with the `plan --pin <product>@<40 hex commit>` that records the pin whole.
  - `plan-pin-collides` ends with re-running `plan` with each product once, or, for two products that share a source variable, with one product of each such group.
  - `plan-root-holds-pin` ends with the kept path's own remedy: send that entry to a leg, `drop` it, or rename it in the source and re-run `plan`.

  A leg moved over a pin's file in the plan is `plan-leg-path-collides`.
- **Also part of #386: its `pins:` row.** A hand-edited `pins:` that is not a list (a name such as `pins: openGlass`, a number, a mapping, a quoted string) is now `plan-pin-malformed` in `check` (`` `pins:` is 'openGlass', not a list of pins ``), and `execute` refuses it before any leg exists.
  - Where: `_read_pins` in `adopt-project.py`; the test row is `plan-pin-malformed-not-a-list` in `tests/test_adopt_pins.py`.
  - Before: on main, `check` said `plan ok` for the name, the mapping and the string, and gave a traceback for the number (reproduced by lane 5's review on cb7063f). #386 records that `execute` then wrote the name as eight one-letter pins.
  - Not fixed here: #386's other keys, `allow_empty_legs:`, `paths:`, `legs:` and `source:`, so #386 stays open. Lane 2's #435 takes all of #386, `pins:` included, and its `pins:` rule keeps only text items where this branch writes mappings; whichever lands second reconciles them (#435 (comment), and "Where the meaning meets" below).
- **`execute`.** It writes each pin through `materialize_assembly_root(neutral_pins=...)`. The manifest lists the product with the owner stripped (decision 3), so the entry and the file agree.
- **Docs.** `--help` is updated and `docs/cli.md` regenerated (`render-cli-reference.py --check` ok).

`pin_digest_from_source` caught only `Refusal`. A directory that is no clone is git's own failure, so it was always `pin-source-unreadable`, exit 2. A path `subprocess.run` cannot enter never reaches git: it is a `FileNotFoundError`, `NotADirectoryError` or `PermissionError` out of `cwd=`, and nothing caught it. `scaffold-project.py --pin ... --pin-source <that>` ended `--dry-run` and the real run alike in a traceback, exit 1. Since the move above, `adopt-project.py plan --pin` reads its digest through the same function and ended the same way. Both reach it through `declared_pin_values`, and `check` and `execute` read no source, so that call is the only reader.

The issue's table, run on ab623dd for the scaffold and on d806e8f for `adopt-project.py plan` (adopt has no `--pin-source` on ab623dd), then on this head. `gh` is a stub that logs and exits 97, with `GH_TOKEN` bogus and an empty `GH_CONFIG_DIR`; it was called 0 times in every run:

| `--pin-source` | before | this branch |
|---|---|---|
| a directory that is not a clone | `pin-source-unreadable`, exit 2 | unchanged |
| a path that does not exist | `FileNotFoundError` traceback, exit 1 | `pin-source-unreadable`, exit 2: `<path> could not answer for opensoft/openGlass @ <40 hex>: no such directory` |
| a file | `NotADirectoryError`, exit 1 | exit 2, `... it is a file, not a directory` |
| under a parent this user cannot enter | `PermissionError`, exit 1 | exit 2, `... Permission denied` |
| a symlink loop (not in the issue) | `RuntimeError` out of `Path.resolve()` on 3.12, exit 1 | exit 2, `... Too many levels of symbolic links` |

The real run and `--dry-run` give the same stdout and stderr, and nothing exists afterwards (no remote directory, no work directory; for adopt, no plan file).

What changed, in `scripts/shape_materialize.py` only:
- `pin_digest_from_source` catches `OSError` as well as `Refusal` and raises the existing `pin-source-unreadable` with its remediation unchanged. The message names the path and the reason.
- `stat()` judges the source inside the guard, as #312 does in `validate-pins.py`, and the sentences are that file's: a missing path, or one beneath a file, is "no such directory"; a file is "it is a file, not a directory"; any other `OSError`, from `stat()` or from git's `cwd=`, is the system's own reason (`strerror`). It is not `exists()`/`is_dir()`, which before 3.14 swallow only a missing path. A source `stat()` can read but `cwd=` cannot enter, a directory with no search bit, fails in `tree_digest` and the same guard answers it.
- `declared_pin_values` resolves the path through a guarded `_resolved_pin_source`. `Path.resolve()` raises a `RuntimeError` on a symlink loop before 3.13 (an `OSError` since), before the digest was asked for. As typed, `stat()` meets the loop and says so.
- A source that answers is read exactly as before: a relative path resolves against the working directory, a symlink to a clone is followed, `digest_source` reads `local-clone (<path as typed>)`, and the digest is `tree_digest`'s.

`tests/test_pin_source_unreadable.py` (46 tests in the #339 commit; fix round 1 adds 17 for S1 and moves one, below) runs each case through `scaffold-project.py --dry-run`, its real run and `adopt-project.py plan`: missing, a file, beneath a file, relative and missing, a parent and a source with no search bit (skipped on Windows and as root, by a mark, so before any fixture builds a directory), a 300-character name, a symlink loop (skipped on Windows) and a directory that is no clone. Each asserts exit 2, the refusal naming the path and the reason, its remediation, no traceback and nothing created. It also holds `--dry-run` and the real run to the same stdout and stderr, checks the path is printed escaped under an ASCII stderr and as a surrogate when it is not UTF-8, and checks that a relative source and a symlink to a clone read as before. The session `gh` guard fails any test whose run called `gh`.

origin/main ab623dd reached this branch through implQ's branch: 34dbd86 is a30091f merged with ab623dd. One file conflicted there, `templates/assembly-root/scripts/validate-pins.py`, in seven hunks, because #312 (8cdca5e) replaced `keyed_sources` and `default_source` with `PinSources` and #275 added `env_shared` and `shared`. #312's blob is the same at its PR head, at the squash and at ab623dd, so it landed the file implQ resolved against. The resolution keeps #312's side in all seven and adds #275's on top:

| # | hunk | resolution |
|---|---|---|
| 1 | `resolve_neutral_pin_source` signature | #312's `sources: PinSources` and 3-tuple return, plus #275's `env_shared: bool = False` |
| 2 | its docstring tail | #312's `Returns (path, how, typed)` text, plus #275's "Rule 2 is skipped when `env_shared`" paragraph |
| 3 | `_recompute_neutral_pin_digest` signature | #312's `sources`, plus #275's `shared: frozenset[str]` after `report` |
| 4 | the `resolve_neutral_pin_source(...)` call inside it | #312's 3-tuple unpack, plus `env_shared = product.casefold() in shared` and the extra argument |
| 5 | `_check_one_neutral_product_pin` signature | #312's `sources`, plus #275's `shared` |
| 6 | its call of `_recompute_neutral_pin_digest` | `sources, report, shared` |
| 7 | `_check_neutral_product_pins` docstring and body | #312's `PinSources(...)` and `_note_unused_pin_sources`, plus #275's paragraph, `_report_pin_source_collisions(products, report)` and `shared = frozenset(pin_source_env_shared(products))` |

This branch's own merge of 34dbd86 (5690235) had no conflict, and neither had its merge of #409's fix round, 6494714 (583f647). That fix round made `neutral-pin-source-collides` a note and keyed "one product" by `repo_shape.pin_product_key`. At 421e4e5, `templates/assembly-root/scripts/validate-pins.py`, `scripts/repo_shape.py` and `tests/test_pin_source_env_collisions.py` were byte-identical to the tree `git merge-tree` gives for 6494714 with origin/main 3ef059c (blobs 5604007, 091966b, 5220787), so this branch added nothing to those three files beyond #409. The 34dbd86 merge brought in #335, #312, #317, #270 (f795cf7), #344 and #349 with no conflict. Earlier merges of origin/main (87373a6, for #309's reworded constant, and e43fa95) are unchanged.

Fix round 1 merged origin/main three more times:
- **cd1fc79 (2bcfa69).** It brought #245, #351, #350, #345, #372, #371, #354, #380, #377 and the rest since ab623dd, with no conflict.
- **45e01f4 (4098b61).** It brought #396's `tests/test_agents_md_codes.py`. That test finds `scaffold-pin-collides` as a string constant of `scripts/shape_materialize.py`, which `SHIPPED` lists.
- **3ef059c (421e4e5), #314.** One conflict, one hunk in `adopt-project.py`. This branch's `_refuse_an_unrecordable_pin_source` and #314's section "The project must be able to hold what `execute` writes into it (#261)" were added at the same place; both are kept. Where the two meet, lane 5's earlier recipe applies:
  - `_flag_plan` builds each pin as the `PIN_FIELDS` mapping `plan` writes, not `list(pins)` of products. So the plan `plan` asks the validator about is the plan it writes.
  - #314's `test_plan_asks_what_check_asks_of_the_same_keys` plans `--pin openGlass@<commit> --pin-source <stand-in>` where it planned the name alone, which `plan` now refuses.

Then f9ed46f, after #409 squash-landed, and 73d65c6 after it (top of this description).

On the merged tree exactly one test failed: `tests/test_adopt_template_values.py::test_check_finds_and_execute_refuses_a_hand_edited_value[pins-surrogate]`. It plans, then hand-edits the plan to `pins: ["openX\ud800"]`, a name-only pin with a lone surrogate. Before this branch the refusal's headline was `REFUSED plan-unwritable-value`. A name-only pin in a plan is now `plan-pin-unrecorded` (#273), so `check` has a second, independent finding for that very plan, and the headline is the first finding's:

```
REFUSED plan-pin-unrecorded: 2 finding(s) ...
FINDING plan-pin-unrecorded: `pins:` entry 1, 'openX\ud800', is a name with no commit and no digest ...
FINDING plan-unwritable-value: a `pins:` item is 'openX\ud800', which `execute` writes into the assembly root's `project.yaml`, and it holds a lone surrogate ...
```

Nothing about #270's contract changed. The lone surrogate is still found as `plan-unwritable-value`, listed under the refusal, and `execute` still refuses before any leg exists. `check` builds `_leg_findings`, where `_pin_findings` sits, before it calls `_value_findings`, so the pin finding comes first. d806e8f changes one assertion for that row, `pins` only: the headline is `REFUSED plan-pin-unrecorded: ` where it was `PLAN_REFUSED`. The other 15 rows and the finding assertions, including the `plan-unwritable-value` line, are untouched.

Lane 5's review of 7a94b6b found 3 should-fix and 5 nits. Each is answered here:
- **#409's `pin_product_key` (review N1).** The merge of #409's fix round could not carry it, because this branch had moved the function that used it out of `scaffold-project.py`. `pin_variable_collisions` now keys each pin by that function, where it casefolded. `openß` and `openss` are two pin files and one `SHAPE_PIN_SOURCE_OPENSS`, and a casefold named each of the two pins twice. No `--pin` or recorded `pins:` entry `PIN_ARG_RE` admits can spell either, so the test asks the function directly. `refuse_colliding_pins`' docstring now says, in #409's words, that the root's `validate-pins.py` only notes such a pair.
- **S1, a `--pin-source` path that is not printable.** `pin_digest_from_source` names the path as typed unless it is not printable (`str.isprintable`), and then as Python's `repr` spells it (`shown_source`). That covers the refusal's head and git's own reason, which names the directory it ran in. Printed raw, an ESC reached the terminal, and a line break or a carriage return began a line of the path's choosing, a forged `REFUSED` line among them, from the scaffold and from adopt. The traceback #339 replaced had shown a `repr`. A printable path is named byte for byte as before.
- **S2, no `gh` on PATH.** `pin_digest_from_gh` refuses as `gh-not-found`, exit 2, as `repo_shape.tree_digest_from_gh` names it, and offers `--pin-source`. It was a `FileNotFoundError` traceback, exit 1, from the scaffold and, new with this branch, from `adopt-project.py plan --pin`.
- **S3, a hand-edited `commit:` or `tree_sha256:`.** The lane's decision is to accept it and document it (option (c)); no behaviour changed. A pair that disagrees passes `check` and `execute` (`adoption verified`), because neither reads a network for a pin, by design. The adopted root's own `validate-pins.py` then exits 1 with `neutral-pin-digest-mismatch` wherever it can read the product. `check` now says so once, after the pins it will write: "each pin as `plan` read it, not read again here: the root's own `validate-pins.py` recomputes its digest wherever it can read the product". Options (a), `execute` recomputes before it creates the legs, and (b), `check` recomputes from a clone still on the machine, are filed as #449.
- **N2, a `--pin-source` that `plan` cannot record.** `plan` asks `check`'s question (`one_printable_line`) of the path it records in each pin's `digest_source:`, before any digest is read. It refuses one that fails as `adopt-unwritable-value`, in #270's words (`unwritable_reason`), or as "an invisible formatting character" where those name nothing. Before, it was planned, exit 0, and printed raw in the report. `check` then refused it as `plan-pin-malformed` and said to re-run the same `plan`. The report's `pin` line and `check`'s `write` line now spell the digest's source with `_shown`. The scaffold half is pre-existing (a line break in the path is written into the pin file; a byte that is not UTF-8 dies after all three repositories exist) and is filed as #450.
- **N3, six hunks no test guarded.** Each now has a test that fails when it alone is reverted:
  - the two name guards (a `pins:` name holding an ESC and a forged line);
  - the lower-casing of the commit and the digest (an upper-cased hand edit);
  - the `digest_source` printability check;
  - the not-text check (`commit: 1234567` unquoted);
  - the gitlink filter (a submodule kept where the pin is written is `plan-submodule-root` alone).
- **N4.** This body.
- **N5, #339's third decision.** A `--pin-source` that nothing reads is still silent, now in adopt too. This PR does not decide it. #451, filed, lays out refuse, note and leave, so closing #339 loses nothing.

Lane 5's second review, of 421e4e5, found no blocking item, 2 should-fix items and 3 nits. The two should-fix items are this body: the landing after #409 (above) and #386 (above). The code needed no change for them. f63d1ed adds two tests and no code:
- **n1. `plan` asks nothing of a `--pin-source` no `--pin` records.** With the `args.pin and` guard dropped, such a path holding an ESC or a zero-width joiner was refused in a sentence naming no file ("`execute` writes into , and ..."), and every test still passed. `test_a_pin_source_no_pin_records_is_not_asked_about` holds the plan to exit 0 and `pins: []`, with the path named nowhere in the plan or the report. The ESC row is POSIX-only by the file's `POSIX_NAMES` mark; the zero-width joiner row runs everywhere. It holds #451's answer today, silence, so a decision there changes this test on purpose.
- **n2. A printable `--pin-source` is printed as it is.** With `_spelled` in place of `_shown` in `plan`'s `pin` line, every test still passed. `test_a_printable_pin_source_is_printed_as_it_is` holds `plan`'s `pin` line, and `check`'s `write` line for the plan `plan` wrote, to their exact text, ending `(local-clone (<path>))` with no backtick.
- **n3** needs a code change and is left out (below).

**Fix round 2, on f63d1ed.** Each run had a `gh` stub first on PATH (it logs and exits 97), `GH_TOKEN` bogus, an empty `GH_CONFIG_DIR`, `git-filter-repo` 2.47.0 next on PATH, and the identity blanked with `GIT_CONFIG_COUNT`; the session `gh` guard came first inside each run.
- **The pin set: 812 passed, 2 skipped.** It covers adopt pins, adopt plan, #339's file, #275's tests, the pin and neutral-pin validators, git output decoding, adopt template values, CLI reference, scaffold pin and reuse, scaffold pin collisions, #314's two files and #396's file. The skips are `test_adopt_plan.py:403` (no MedxEHR clone) and `test_adopt_template_values.py:223` (this host reads `git config user.name` from the repository, not from `GIT_CONFIG_GLOBAL`). That is fix round 1's 809 passed, plus the three new rows.
- **Shape doctor and scaffold leg-path collisions: 369 passed, 3 skipped** (the PowerShell line exists only on a Windows host).
- **Mutation probes**, each one line changed in a throwaway worktree, over `tests/test_adopt_pins.py` and `tests/test_pin_source_unreadable.py` less the five end-to-end adoptions:
  - the `args.pin and` guard dropped: 2 failed, both n1 rows;
  - `plan`'s `pin` line `_spelled`: 1 failed, the n2 test;
  - `check`'s `write` line `_spelled`: 2 failed, the n2 test and `test_an_upper_cased_hand_edit_is_written_lower_cased`;
  - `plan`'s `pin` line raw: 1 failed, the no-break-space test that already guarded that hunk.

**On the merged tree, 73d65c6** (the merge f9ed46f and the `_read_pins` commit), with the same harness:
- **The pin set** above, with #445's `test_adopt_late_failure.py`, `test_adopt_git_reads.py` and `test_adopt_filter_repo_failure.py` and #387's `test_adopt_empty_symlinks.py` and `test_adopt_root_manifest.py`: **988 passed, 2 skipped**. The skips are the two above.
- **Shape doctor, scaffold leg-path collisions and the adopt suites:** **967 passed, 3 skipped** (the PowerShell line). The adopt suites are e2e, execute refusals, verify, root shape paths (#387's too), leg-path collisions, clone template, ignored shape files and submodules.
- **On the merge alone, f9ed46f** (the same tree as before the `_read_pins` commit): `tests/test_adopt_late_failure.py` gave 3 failed, 83 passed, the three `AttributeError` rows above.
- `render-cli-reference.py --check` is ok on the merged tree. pyflakes reports the same four warnings on `adopt-project.py`, `scaffold-project.py` and `scripts/shape_materialize.py` as before the merge.

**Fix round 1, on 421e4e5.** Each run had `git-filter-repo` 2.47.0 on PATH and the identity blanked with `GIT_CONFIG_COUNT`. A `gh` stub that logs and exits 97 was first on PATH, with `GH_TOKEN` bogus and an empty `GH_CONFIG_DIR`, and the session `gh` guard came first inside each run.
- **The pin set:** 809 passed, 2 skipped (the same files and skips as above).
- **Doctor and scaffold:** 782 passed, 3 skipped (the PowerShell line exists only on a Windows host). It covers shape doctor, scaffold leg-path collisions, scaffold e2e, referent chain links, naming policy, repo hygiene and #351's free-text values.
- **The adopt suites:** 882 passed. It covers e2e, execute refusals, verify, spec-only, leg paths, root shape paths, plan escapes, leg-path collisions, clone template and submodules.
- **Before the #314 merge,** on 74ce4d9's tree: the first two sets gave 577 passed, 2 skipped and 782 passed, 3 skipped. On 2bcfa69's tree (the merges alone, before the fix) they gave 542 passed, 2 skipped and 782 passed, 3 skipped. After the 45e01f4 merge, `tests/test_agents_md_codes.py`, repo hygiene and CLI reference: 110 passed.
- **Lane 5's second review** also ran 421e4e5 merged with main cb7063f and with 53bee5b: the pin set, the manifest-value set, and the doctor set with #357's `tests/test_doctor_validator_rows.py`. All passed, with only the skips above.

Proof that fix round 1's tests test something:
- **On 2bcfa69's tree,** with this head's two test files laid over it, 31 of the new rows fail:
  - S1: 17;
  - N2 and its report spelling: 7;
  - S2: 3;
  - the `pin_product_key` port: 2;
  - `check`'s S3 line: 1;
  - the not-UTF-8 `adopt plan` row: 1.

  The N3 rows pass there, as they must: they guard hunks this branch already had.
- **Mutation probes.** Each hunk was reverted alone, in a throwaway worktree, and both test files were run: 18 of 18 were caught.
  - **The port:** the casefold keying (2 fail); the casefold lookup alone (2).
  - **S1:** the path named raw (13); git's reason named raw (2); every path `repr`'d, printable or not (27).
  - **S2:** no `except` (3).
  - **N2:** no `plan` check (11); only #270's question asked (1); the formatting-character reason said otherwise (1); the report's `pin` line raw (1); `check`'s `write` line raw (1).
  - **S3:** the line dropped (1).
  - **N3:** the `_pin_fix` name guard (1); the `_read_pins` path guard (1); the lower-casing (1); the `digest_source` check (1); the not-text check (1); the gitlink filter (1).
- **The issue rows reproduced.** S1, S2 and N2 were reproduced on 2bcfa69's tree and shown gone on the fix (a probe driving both tools; `gh` was called 0 times).

**Before fix round 1.** Runs were on 7a94b6b, with `git-filter-repo` 2.47.0 first on PATH and the repository-local `user.name` blanked with `GIT_CONFIG_COUNT` (a workstation whose standard checkout sets one fails `test_the_scaffold_refuses_with_no_elector` on main itself; CI sets none). 7a94b6b differs from ffd1297 in `tests/test_pin_source_unreadable.py` only, so the three suites that do not read that file ran on ffd1297:

- the new file: 46 passed;
- adopt pins, adopt plan, git output decoding: 172 passed, 1 skipped (the MedxEHR clone is absent);
- scaffold pin and reuse, pin collisions, e2e, referent chain links, neutral pin and pin validators, #275's tests, naming policy, repo hygiene, CLI reference, scaffold leg-path collisions: 571 passed;
- shape doctor: 254 passed, 3 skipped (the PowerShell line exists only on a Windows host);
- the new file with repo hygiene, git output decoding and CLI reference, once more after the last edit: 176 passed.

Earlier on 5690235 and d806e8f, before the #339 commit: the adopt suites (e2e, execute refusals, verify, spec-only, leg paths, root shape paths, plan escapes, leg-path collisions, clone template) 740 passed, and `tests/test_adopt_template_values.py` with #273's other adopt tests 489 passed, 2 skipped. They were not re-run on 7a94b6b: the #339 diff touches `pin_digest_from_source` and the call in `declared_pin_values`, which those suites reach through `test_adopt_pins.py` only. Nothing was run on macOS or Windows.

Proof the new tests test something:
- **On d806e8f.** 38 of the 46 fail, each on the traceback and its exit 1. The 8 that pass are the unchanged behaviour: the not-a-clone refusal (4 rows) and the valid-source rows (4).
- **Mutation probes.** Ten hunks reverted one at a time, each failing at least one new test: the `OSError` catch (16 fail), the catch narrowed to `OSError` only (21), the missing-path clause (9), the clause narrowed to `FileNotFoundError` (3), the `S_ISDIR` judgement (3), the loop guard (4), no resolve at all (3), the old `.resolve()` call (4), the reason as `str(exc)` (12), and the file sentence as the OS's (3).
- #273's own 52 tests still fail on c7c02fa (51 fail or error; the one that passes checks the test's own table), and its 18 mutation probes were each caught.

**Re-verified after the merge.** An independent re-verification of f9ed46f and 73d65c6 found the code correct:
- #409 is carried whole. A 30,000-case fuzz of `--pin` lists through #409's final refusal and this branch's port differed in 0 cases.
- `scaffold-project.py` equals the tested file plus main's own changes that are not #409's (same patch-id).
- `_commit_the_split` keeps #445's `try` and #394's `append`.
- `_read_pins` reads a loaded plan as before.

Its findings were all in this description (the #506 bullet and three stale facts), now fixed. Runs on the head and on its merge with main 48585e6: 988 passed, 2 skipped; and 967 passed, 3 skipped.

`git merge-tree --write-tree` was run at 01:48Z on 2026-10-13, comparing hunks per file. Each PR head, fetched from `refs/pull/<n>/head` with no `gh`, was merged with 73d65c6 and with origin/main 9736424 alone. Two sets were asked about:
- every PR this description listed before that main does not now contain;
- every PR numbered above #468 whose head main does not contain: #473, #474, #490, #491, #493, #494, #495, #496, #497, #503, #504 and #505.

**Open state, read with `gh` by the coordinator at 02:00Z and refreshed at 02:25Z after a re-verification on main 48585e6.** Every pull request named below is open. #184, #94, #96, #98, #100 and #161 are closed, and #465 landed as 48585e6. `fix/adopt-plan-quote-yaml-keywords` has no pull request. #506 (`fix/scaffold-reuse-seeded-legs`) opened after this list was made, and the re-verification reads it.

- **Landed since the last draft of this list:** #343, #346, #355, #358, #373, #378, #382, #387, #394, #397, #401, #404, #409, #419, #452, #456, #465, #466 and #484. #394's `_commit_the_split` conflict and #401's `docs/cli.md` conflict are both resolved in f9ed46f, above.
- **Clean, 20:** #266, #347, #356, #374, #376, #384, #395, #453, #467, #468, #473, #474, #490, #491, #493, #494, #495, #497, #503 and #505. #453, #468 and #491 were updated onto main since the first read and now merge clean. #507 (lane 5's #486-#488) shares only the generated `docs/cli.md` with this branch and merges clean with it.
- **Conflicting with main alone, and this branch adds no hunk:**
  - #402: `shape-doctor.py` 5;
  - #496: `shape-doctor.py` 10 and `tests/test_shape_doctor.py` 1.

**Conflicts this branch adds:**
- **#435** (3efcc7a, lane 2's `fix/adopt-plan-field-types`, for #386).
  - It adds 2 hunks in `adopt-project.py`: 5 here, against 3 with main alone. They are `render_plan`'s `pins:` line and `Plan.pins`.
  - Keep this branch's `_pin_lines` and `_pin_products`. The rest is under "Where the meaning meets".
- **#504** (37ef29a, `fix/adopt-root-kept-symlinks`).
  - It adds 1 hunk in `adopt-project.py`: 2 here, against 1 with main alone. It is the materializer call in `_commit_the_split`.
  - Keep both arguments and both comments: `append=append, neutral_pins=_recorded_pins(plan), spell=_spelled`.
- **#506** (119d8c4, `fix/scaffold-reuse-seeded-legs`).
  - It adds 1 hunk in `scaffold-project.py`. With main alone, #506 conflicts only in `docs/handbook.html`.
  - #506 inserts `LEG_TEMPLATES` right after `declared_pin_products`, which this branch moved out, and rewrites `_reusable_remotes` further down. Keeping both sides breaks the file with an unterminated string literal.
  - Keep only #506's `LEG_TEMPLATES` block. Drop #506's `declared_pin_values`/`declared_pin_products`, which moved here, and this branch's three-line `_reusable_remotes` opener, which #506 rewrites below. Resolved that way, pyflakes is clean and #506's scaffold tests pass (88).
- **`fix/adopt-plan-quote-yaml-keywords`** (ed9968f; a branch with no pull request).
  - It adds 2 hunks in `adopt-project.py`: 3 here, against 1 with main alone.
  - One is `render_plan`'s `pins:` line. Keep `_pin_lines`, which already sends product, repository and `digest_source` through `y`.
  - The other is `_refuse_unholdable_values`' signature. Keep `pins: dict`, with that branch's `_validator_judged` and `_named_as_read` above it.
- `fix/adopt-late-failure-notice` is no longer on origin. #445, the late-failure notice, is on main and merged here.

**Where the meaning meets:**
- **#435 and #386.** The coordinator has said this on #435: #435 (comment)
  - #435's `_plan_key_findings` (`plan-bad-pins`) keeps only text items in `pins:`, and its `PINS_REMEDIATION` tells a person to write `pins: [openGlass]`.
  - This branch writes each pin as a mapping, and it makes a name alone `plan-pin-unrecorded`.
  - Read from #435's code, not run: on a tree with both, the plan `plan --pin` writes is `plan-bad-pins` in `check`.
  - Whichever lands second reconciles them, with three changes:
    - `_plan_key_findings` takes this branch's mappings, or leaves `pins:` items to `_read_pins`;
    - a `pins:` that is not a list gives one finding, not both `plan-bad-pins` and `plan-pin-malformed`;
    - `PINS_REMEDIATION` says the mapping `plan` writes.
  - Until that is done, `tests/test_adopt_pins.py::test_a_plan_with_a_whole_pin_checks_ok` fails.
- **#314.** It landed, and it is merged here (above).
- **`fix/adopt-plan-quote-yaml-keywords`.** Its pin tests are written against the name-only `--pin`. They need the `name@commit` form, and their expected `pins: [...]` line becomes `_pin_lines`'s mapping.

- **Two unwritable values are refused in two runs (lane 5's second review, n3).** `plan --elected-by 'A<LF>B' --pin openGlass@<sha> --pin-source <a path holding an ESC>` refuses the elector alone, exit 2. Re-run with the elector retyped, it refuses the source; #270's refusal names every unwritable value at once. Reproduced on 421e4e5, with `gh` called 0 times. One refusal would need a code change, not made here:
  - `_refuse_an_unrecordable_pin_source` would split into a function that returns the sentence;
  - `_checked_plan_inputs` would ask it before #270's `unwritable_values` raise, and raise one `adopt-unwritable-value` that names both, with both remediations;
  - a test would add the two-value row.

  N2's question is `one_printable_line`, not `unwritable_reason`, so it cannot simply join #270's list.
- **Docs.** The README, AGENTS.md and `docs/handbook.html` are unchanged, because none of them calls adopt's `--pin` a name. A sentence saying adopt now takes the scaffold's `--pin` is a follow-up. It costs an AGENTS.md line-cap raise, and a README edit forces the handbook's README blob to change.
- **A product spelled `null`, `true` or `false`.** The scaffold already accepts `--pin null@<sha>`: it exits 0 and builds a root whose `validate-pins.py` exits 1 `neutral-pin-entry-malformed`. Adopt's `plan` writes `product: null` through `y`, and `check` then finds `plan-pin-malformed` and refuses it before any leg exists. The one fix for both tools is in `parse_pin`, and it would change the scaffold's behaviour.
- **Wording shared with the scaffold.** `digest_source` is written bare into the pin file, so a `--pin-source` path holding ` #` is cut short there. `templates/assembly-root/contracts/neutral-product-pin.yaml` and `validate-pins.py`'s `neutral-pin-missing` remediation name only the scaffold as the writer. Two comments in `scripts/repo_shape.py` still name the scaffold's `pin_digest_from_gh`, in a digest-pinned shipped copy.
- **Filed as follow-ups:**
  - #449: S3, a hand-edited `commit:` or `tree_sha256:` that disagrees, with options (a) and (b);
  - #450: the scaffold half of N2, a `--pin-source` path no file can hold;
  - #451: #339's third decision (N5), a `--pin-source` that nothing reads.
- **`validate-pins.py` prints a `--pin-source` path raw** in `neutral-pin-source-unreadable`, the twin of S1. It is a shipped template that #409 and other open PRs edit, so it is left for its own change. No issue is filed for it yet.
- **Windows and macOS** were not run here; CI ran both (below). Two assertions that depend on what Windows answers for a path (a name past the filesystem's limit, a path beneath a file) check only the refusal and its remediation there. Fix round 1's rows that need a control character or a byte that is not UTF-8 in a path, or a symlink to `git`, are skipped on Windows by a mark, and so is fix round 2's ESC row. The rows for a no-break space and a zero-width joiner run everywhere, and so does the in-process `gh-not-found` test.

Reviewed independently by lane 5 at 7a94b6b (3 should-fix, 5 nits: fix round 1) and at 421e4e5 (0 blockers, 2 should-fix, 3 nits: fix round 2). After #409's squash, the re-verification of f9ed46f and 73d65c6 found the code correct; its 1 should-fix and 3 nits were in this description and are fixed. GitHub's update-branch then merged main twice (33bae3f, 2170526), with no hand edit. CI's tests, tests-macos and tests-windows and SonarCloud all passed at 2170526 (main cac6bb2 merged in). On that head merged with main 57c85e9 (#490, #474 and #468, none of which touches this branch's files), the pin and adopt set with `tests/test_update_shape_landing.py` gave 1112 passed, 2 skipped, and the doctor, adopt end-to-end, unfinished-merge and bootstrap set gave 1056 passed, 3 skipped (the doctor's PowerShell line, which exists only on a Windows host).

Closes #273
Closes #339

Lane: openreposhape-5 (openRepoShape-5)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants