Repository navigation
The scaffold learns --family: the clone lands at <into>/<Family>/<Project>, and standing in a family folder is detected and said in the plan (#76) - #78
Conversation
…ject>, and standing in a family folder is detected and said in the plan (#76) `setup-project.py` is the flow (#50) and the native-Windows way in, so RULING 2 of 2026-09-09 puts the flag there: native Windows gets `--family` by the same flag and the same landing rule as `setup.sh` and the `openRepoShape` command, which parse nothing and only pass it through. WHAT IT DOES. `--family <Family>` lands the clone at `<into>/<Family>/<Project>` instead of `<into>/<Project>`, creating `<into>/<Family>/` if it is not there -- the plain folder the ruling placed, holding the holder clone and the members' working clones as siblings. It is never nested twice: a person already standing in `.../<Family>` means the folder they are IN, decided by its BASENAME rather than by a manifest, because a family folder with no holder cloned into it yet is still the folder they are standing in. Pointing `--family` at a family DIFFERENT from the one whose folder `<into>` is refuses, names both, and names the two ways out (`cd` out, or drop the flag); nothing is moved and there is no --force, which is the same reasoning the issue used to reject a setup.sh that relocates a checkout. DETECTION, ADVISORY, NO FLAG. When `<into>/<basename>/family.yaml` parses with `kind: family-manifest` and a `name:` equal to that basename, the plan says one line and the landing is exactly what it was. All three facts have to agree, or it says nothing: a folder's name alone would make every directory in an estate a family folder. Read with the standard's own YAML reader, and any read failure means "not a family folder" -- this is advice in a plan, so a half-written manifest must not refuse a scaffold that never needed it. THE PROJECT RECORDS NOTHING. No `project.yaml` field and no file: membership is recorded in the HOLDER's `family.yaml` and nowhere that could disagree with it. The shape confers nothing and membership confers nothing, so the hand-over's next commands end with the `family.py add --family-root <landing>/<Family> --member <org>/<Project>` that writes it there -- run from a checkout of openRepoShape (ruling 1b), with a note when no `family.yaml` is at that path yet, since a member may exist before its holder does. WHERE THE CLONE GOES IS DECIDED ONCE, in step (3), and step (7) reads it, so the path the person read in the plan and the path the clone goes to cannot drift. `<into>/<Family>/` is created in step (7) and nowhere earlier: a rehearsal that stops at the plan leaves the disk exactly as it found it. The holder name is checked against the naming policy's DECLARED-ONLY `family` form through the same classifier `scripts/family.py init` asks (`_classify_family_name`), so a name that is a holder here and not there cannot happen; `openGlass` and `<X>-Install` are unambiguous by construction and cannot be declared into a holder. That is the one import this entry point takes from the checkout, and only after `_main` has confirmed there is one -- the parse-time guards still copy the house pattern, because at parse time there may be no checkout at all. `setup.sh` needed NO change: it parses nothing, and naming a flag there is what `test_setup_sh_parses_no_flags_of_its_own` exists to refuse. The `openRepoShape` shim gains `--family` to its value-taking case list so `openRepoShape Atlas --family InkRouter --org Northwind` never reads `InkRouter` as a second project name. The landing rule is a PURE-path function, so `tests/test_windows_paths.py` asks it the Windows question from Linux the way it asks `root_key`. Lane: xfactory-2 (xFactory-2) Co-Authored-By: Claude Fable 5.1 <[email protected]>
|
@codex review |
There was a problem hiding this comment.
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 1 day and 9 hours by commenting @sourcery-ai review. Upgrade to get a review now.
Reviewer's GuideThe scaffold now supports optional family membership by computing family-aware clone destinations, safely detecting or rejecting family-folder contexts, validating holder names, and directing membership recording to the holder’s manifest without writing family data into the new project; documentation, shim parsing, and cross-platform regression tests were updated accordingly. Sequence diagram for family-aware project scaffoldingsequenceDiagram
participant User
participant Setup as setup-project.py
participant Policy as repository naming policy
participant FS as Filesystem
participant Holder as Family holder
User->>Setup: Run with optional --family Family
Setup->>FS: family_folder_here(shape_root, into)
FS-->>Setup: Family folder status
alt Different family detected with --family
Setup-->>User: Refuse nested family and show ways out
else Valid family context
Setup->>Setup: family_landing(into, family)
Setup->>Policy: check_family_name(shape_root, family)
Policy-->>Setup: Validate family holder name
Setup-->>User: Print plan and landing path
alt User confirms
Setup->>FS: Create landing directory
Setup->>FS: Clone project
Setup-->>User: Print family.py add command
User->>Holder: Run family.py add
Holder->>Holder: Write membership to family.yaml
end
end
Flow diagram for family-aware scaffold landingflowchart TD
A[Parse --family and --into] --> B[resolve_family]
B --> C{Existing family folder?}
C -->|Different family with --family| D[Refuse nested family]
C -->|Same family or no family| E[Compute landing directory]
E --> F{Plan only?}
F -->|Yes| G[Print landing plan]
F -->|No| H[Create landing directory]
H --> I[Clone project]
I --> J[Print family.py add command]
J --> K[Holder family.yaml records membership]
File-Level Changes
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
There was a problem hiding this comment.
🟢 Approval recommended
The landing/detection/refusal rules are implemented coherently and are backed by thorough tests (including Windows path semantics) and aligned documentation updates.
Pull request overview
Adds first-class family-aware landing behavior to the project scaffold entry points, enabling a workstation layout where a plain <Family>/ folder contains the holder clone and member working clones as siblings, while ensuring family membership remains recorded only in the holder (via family.yaml).
Changes:
- Add
--family <Family>tosetup-project.py, including landing rules (<into>/<Family>/<Project>), no-double-nesting behavior, and refusal when attempting to nest one family inside another. - Extend the
openRepoShapeshim to treat--familyas a value-taking flag so the family name is never misparsed as a second<Project>. - Add/extend tests and docs to cover landing behavior (including Windows pure-path checks), holder-name validation via naming policy, “rehearsal creates nothing” behavior, and updated README/AGENTS guidance.
File summaries
| File | Description |
|---|---|
setup-project.py |
Implements --family, advisory detection of standing in a family folder, landing computation, naming-policy validation for holder form, and prints the family.py add next-command. |
openRepoShape |
Adds --family to the shim’s value-taking flag list to prevent misparsing the value as a positional project name. |
tests/test_setup_project_py.py |
Adds comprehensive behavioral coverage for family landing, detection, refusal cases, “records nothing in project”, next-command output, and rehearsal behavior. |
tests/test_windows_paths.py |
Adds pure-path Windows/Posix assertions for the family_landing rule without requiring Windows runners. |
tests/test_openreposhape_command.py |
Verifies shim parsing so --family <Name> does not become a second project positional. |
README.md |
Documents --family landing semantics and clarifies it changes only the clone parent directory and records nothing in the project. |
AGENTS.md |
Updates the scaffold parameter table and documents advisory detection behavior when standing in a family folder. |
tests/test_repo_hygiene.py |
Bumps README/AGENTS line caps with rationale tied to the new --family documentation requirements. |
Review details
- Files reviewed: 8/8 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.
…hygiene caps carry both slices' entries A merge rather than a rebase because the organisation's ruleset refuses a force-push to any branch, and a ruleset refusal is not something to work around. The one conflict was tests/test_repo_hygiene.py's README.md and AGENTS.md size caps, which both slices raised with commentary; both entries are kept, #78's first, and the caps are the merged files' exact counts (1073 and 308). README.md and AGENTS.md merged cleanly. The tree is byte-identical to the rebased form of this branch. The squash on merge folds this commit away. Lane: xfactory-2 (xFactory-2) Co-Authored-By: Claude Fable 5.1 <[email protected]>
…se Speckit's verbs, and refuse by name when the overlay is not installed (#77) (#80) * make park / make resume: the assembly root and the family holder expose Speckit's verbs, and refuse by name when the overlay is not installed (#77) Slice S2 of #77, under Brett Heap's RULING of 2026-09-09 (ruling 1: Speckit owns the mechanics and the root exposes the verbs; ruling 5: the family holder gets them too) and the claim of 2026-09-09T17:55Z. The assembly-root template Makefile gains `park` and `resume`, three lines each: test the extension script, or print `make park needs the Speckit worktree overlay; install it with: setup-openspeckit` and exit 2. `ARGS` reaches the script, so `make park ARGS=--dry-run` is the rehearsal both documents promise. NOTHING of park or resume is reimplemented here — the WIP commit, the push, the `git worktree add`, the `.specify/feature.json` rewrite and the soft reset are the Speckit git extension's, one implementation, and a second one in a Makefile would have no tests of its own. One `OVERLAY_MISSING` message serves both targets so the two refusals cannot drift apart. The family holder gains the same two verbs and runs each member's own IN THE MEMBER'S WORKING CLONE BESIDE THE HOLDER — `scripts/siblings.py --make <target>`, with `--make-arg` appended verbatim to that member's `make` line, which is how `make park ARGS=--dry-run` reaches every member. NOT `members/<Project>`: that copy is pinned, DETACHED and holds nobody's features, so a holder that parked it would report "nothing to park" for every member while the person's work sat untouched next door — the wrong question, answered confidently. `siblings.py` is where the dispatch belongs because it already knows where a sibling is and how to prove the clone there IS that member (its `origin`, its own `project.yaml` id); that check now has ONE definition, `verify_sibling`, used by the placement half and by the dispatch, and the 17 existing siblings scenarios pass unedited. With `--make` it clones nothing and fetches nothing: dispatching is all it does. A member with no working clone is reported and SKIPPED naming `make siblings`, a member whose verb refuses has that refusal printed where it happened, every member is tried, and the run exits non-zero if any was skipped or refused — a `make resume` on a fresh machine that skipped every member must never read as success. `scripts/bootstrap.py` is untouched, so the `update-shape.py` surface for an existing holder is `Makefile`, `AGENTS-shape.md` and `scripts/siblings.py`. GNU make reports ANY non-zero recipe status as its own exit 2 and prints `Error <code>`, so the extension's 1/2/3 cannot come back out of `make` as 1/2/3. Nothing here swallows or rewrites a code; the Makefile comment, the new test file's header and its assertions all say so plainly rather than pretending otherwise. Docs: the two PINNED `AGENTS-shape.md` copies gain the verbs (park before leaving a workstation; clone, `make bootstrap`, `make resume` on the next; never commit under `worktrees/`; the holder's verbs run in the working clones beside it, and a member that is skipped or refuses is reported and the rest still run) — that is what reaches existing roots as `upstream-changed` through `update-shape.py apply`. The templated READMEs gain a "Parking work for another workstation" block and two rows in the holder's target table. This repository's own README gains `## Carrying in-flight work to another workstation`: the two verbs, who implements them, that the record is the person's in a repository they own and named once in `~/.agents/workspace.yaml`, that `resume` refuses on divergence, the holder's half and that it runs in the working clones beside it, that nothing under `worktrees/` is committed or synced, and that native Windows parks nothing because the PowerShell mirror has neither script. `AGENTS.md` gains a short `## Parking and resuming` procedure: the commands, the `setup-openspeckit` prerequisite, never force-push a parked branch on a person's behalf, and that the divergence refusal is not a thing to work around. Tests: `test_make_targets_exist` gains `park:`/`resume:`; the new `tests/test_park_resume_targets.py` (27 cases) covers the refusal by name in a scaffolded root with no `.specify/`, the `ARGS` pass-through and the exit code through an executable stub, `.PHONY`, `make help`, and a real workstation layout — the holder at `<F>/<F>`, a working clone per member beside it, bare repositories in a temporary directory — proving the verb runs in both clones with `ARGS`, that `members/<Project>` (stubbed as `PINNED-*` on purpose) is NEVER invoked, that a missing clone is skipped by name and the next member still runs, that a member's exit 3 is reported and the rest still run, that `--dry-run` runs nothing, and that the dispatch clones and fetches nothing. The `README.md` and `AGENTS.md` line caps move with a dated entry each, in the style of the two entries #78 and #79 wrote today. Lane: xfactory-2 (xFactory-2) Co-Authored-By: Claude Fable 5.1 <[email protected]> * siblings.py --make: the target and every make-arg are validated by pattern before they reach the subprocess (SonarCloud S8705 on #80) (#77) SonarCloud's quality gate on PR #80 raised `pythonsecurity:S8705` on the dispatch's `subprocess.run([make, target, *make_args], cwd=...)`: both values arrive on this command's own command line and reach a subprocess's argv with nothing between them. Nothing was injectable — the call is a LIST with no shell, so `park; rm -rf /` would be ONE argument make has no rule for, never a second command — but the check is cheap, it is right, and a file that runs a subprocess should say on the same screen what constrains its argv. Two patterns at module level, with the WHY beside them: MAKE_TARGET_RE [A-Za-z][A-Za-z0-9_.-]* MAKE_ASSIGNMENT_RE [A-Za-z_][A-Za-z0-9_]*=[^\x00-\x1f\x7f]* A make TARGET NAME, and a `NAME=value` make ASSIGNMENT whose value carries no control character — the newline especially. They are narrow because the holder only ever passes one shape of either, `make park` and `ARGS=<flags>`, so anything else is a mistake worth refusing by name rather than a case worth carrying. `validated_make_call` refuses AT PARSE TIME, before anything runs, with `make-target-invalid` or `make-arg-invalid` (exit 2) naming the pattern and the offending value `repr()`'d and saying "Nothing was run." Not at the first member: a bad value discovered after one member's verb had already committed and pushed somebody's work would be a refusal that came too late to be one. `--make ''` reaches that refusal rather than quietly becoming a placement run — the dispatch branch now tests `is not None` instead of truthiness. `is_a_make_call` is the one predicate both the parse-time refusal and the call site use, and the call site restates it: a reader (or a scanner) looking at the `subprocess.run` finds the constraint beside it instead of three hundred lines up, and the sanitized values go into named locals immediately before the call. That branch cannot fire, and says so. `make_program` now resolves `$MAKE` through `shutil.which` as well as PATH, so what reaches the subprocess is an absolute executable this file resolved rather than a string somebody left in an environment variable; `$MAKE` set to something unexecutable is `make-not-executable` (exit 2) instead of an exec failure per member. Tests: `--make` refused for `park; rm -rf /`, the empty string, `../park`, `park park`, an embedded newline and `park$(id)`; `--make-arg` refused for an embedded newline, `not an assignment`, `=x`, `9ARGS=x` and a bare `ARGS`; accepted for `ARGS=--dry-run`, `ARGS=` (what `make park` with no ARGS produces), a multi-flag value and `SPECKIT_LANE=xfactory-2`; `$MAKE` pointed at a non-executable refused. Each refusal asserts exit 2, the code by name, the value in the message, and that no member's stub ran. `-park` is deliberately not in the target list: argparse refuses a value that looks like an option before this file's check ever sees it. Lane: xfactory-2 (xFactory-2) Co-Authored-By: Claude Fable 5.1 <[email protected]> --------- Co-authored-by: Claude Fable 5.1 <[email protected]>
…he family workstation layout, --family, park/resume and the user commands, the workspace form; a guard that the page follows the README's outline (#89) (#90) * docs/handbook.html: the designed reading of the README at cbca5b4 — the family workstation layout, --family, park/resume and the user commands, the workspace form; a guard that the page follows the README's outline (#89) The page was cut from README.md at `c093813` (#69, PR #71) and #88 fixed one word in it. Everything the README gained in between was missing, so the designed page told a newcomer less than the file it is a reading of. This is the regeneration, at `cbca5b4`, in the page's own design and voice. WHAT THE PAGE GAINED - `#park`, a new section between "Keeping shape current" and "The degrade rule" — the whole of `## Carrying in-flight work to another workstation` (#80): the two root verbs and `ARGS=--dry-run`; `### park <Name>` and `resume <Name>`, from anywhere (#83) with the estate resolution, `--repo`, the fresh-machine `resume --workspace`, and what the two leave behind (including READ THE LINES, not the exit code); `### Who implements it, and what the record is` — the Speckit git extension rather than this repository, the person's record named once in `~/.agents/workspace.yaml`, `<user>-wip` with the home-org default and the opt-in `orgs:` map (#86), nothing under `worktrees/` ever committed, `resume` refusing on divergence, the family holder's dispatch into the WORKING clones, and native Windows parking nothing. One rail entry, `Park and resume`. - `#families` gained two `<h3>`s: "The workstation layout: a plain folder, and two copies of every member" (#79) — the plain `<Family>/`, the holder at `<Family>/<Family>`, `--into` as the PARENT and `--work-dir` as the override, `make siblings`, which copy you work in, and that nothing ever moves a checkout — and "The InkRouter example", whose five `family.py` commands and two trees are the README's current ones (the block it replaced still named `../InkRouter` as the holder). Plus the holder's own `make validate` and its COPY pin. - `#start` gained "Joining a family" (`--family <Family>`, and that standing in the folder needs no flag at all — AGENTS.md) and "What setup.sh actually runs", the seven-command flow including `mkdir -p <into>/<Family>` (#78), with the developer path from a checkout. The install step and the masthead's fastest path now say THREE commands, `unchanged` per file, and what `park` and `resume` are (#83). The rehearsal flag's Windows spelling is the README's own `py setup-project.py … --local-remote-dir .\rehearsal` (#70), replacing an aside that told the reader to go and read `--help`. - `#legs` links `<user>-wip` to where such a repository lives, and gained the paragraph a reader of `openDox` needs: a neutral product may elect the shape and be its own assembly root, `also_matches` recorded rather than thrown away. `#layout` lists `park` and `resume`. `#agents` gained the rule that a refused `park` or `resume` is never worked around with a reset, a stash or a force-push, and that `--workspace` is nobody else's flag to pass. FIDELITY. 39 code blocks on the page: 31 byte-identical to a README block (whole, or a contiguous run of its lines), 0 re-wrapped, 5 quoted from README prose, 2 from README inline code, 1 assembled by the page from three quoted commands (the masthead). Every one of the 13 GitHub anchors resolves to a real README or AGENTS.md heading, all 27 in-page hrefs resolve to an id on the page, and the file still parses with `html.parser` with every tag balanced: one file, inline CSS and one inline script, one Google Fonts link with real fallback stacks, no images and no other network call. THE GUARD. `tests/test_repo_hygiene.py::test_the_handbook_follows_the_readmes_outline` ties the two files together, because nothing did: an explicit `README_HEADING_TO_HANDBOOK_ID` maps every `## ` heading of README.md to the id of the page element that carries it, so a new README section with no entry fails NAMING THE HEADING and a heading deliberately folded into a neighbour is a named decision; `HANDBOOK_SECTION_WITHOUT_A_README_H2` accounts for the four page sections that are not a README `## ` at all, so a page section cannot become unexplained. And the page names the README commit it is a reading of, exactly once, whose README must be byte-identical to the one in the tree — `git diff <sha> -- README.md`, against the working tree, so the page goes stale the moment the README changes rather than one commit later. That last check is skipped, and only that one, when the named commit is not in the clone: a `fetch-depth: 1` CI checkout has one commit and the object is absent there, while the outline checks are tree-only and run everywhere. Evidence: `python3 -m pytest tests/test_repo_hygiene.py -q` 46 passed; `python3 -m pytest tests -q` 889 passed, 1 skipped (`SHAPE_MEDXEHR_CLONE` is unset — pre-existing and unrelated). The five ways the new guard can fail were each exercised in a throwaway clone. Docs and one test only; no README, script, template or workflow change, and both size caps are untouched. Lane: xfactory-2 (xFactory-2) Co-Authored-By: Claude Fable 5.1 <[email protected]> * tests.yml: fetch full history so the handbook's staleness check bites in CI (#89) Ruled by Brett Heap on 2026-09-10: *set fetch-depth 0 so the staleness check bites in CI.* `test_the_handbook_follows_the_readmes_outline` compares README.md against the commit `docs/handbook.html` says it is a reading of, which needs that commit's OBJECT present. `actions/checkout`'s default `fetch-depth: 1` fetches one commit, so the object was absent and that one check skipped itself: green in CI, red only on the machine where the page would be regenerated, which is the wrong way round. All three jobs — `tests`, `tests-windows`, `tests-macos`, the only three `actions/checkout` steps in the file — now check out with `fetch-depth: 0`, and each says why in a comment naming the test. The test's BEHAVIOUR is unchanged: the "skipped when the named commit is not in this clone" branch stays, because a `git clone --depth 1` still hits it and a failure about the clone is not a failure about the page. Only its docstring moves, to say that CI is no longer such a clone. Evidence: `python3 -m pytest tests/test_repo_hygiene.py -q` 46 passed (with tests/test_windows_paths.py, 84 passed). The workflow parses under PyYAML and compares equal to HEAD's parse with the three checkout `with:` blocks removed — nothing else in the file moved. No actionlint on this machine; CI's own actionlint step lints `templates/assembly-root/.github/workflows/validate.yml` only, which is untouched. Lane: xfactory-2 (xFactory-2) Co-Authored-By: Claude Fable 5.1 <[email protected]> --------- Co-authored-by: Claude Fable 5.1 <[email protected]>



Lane: xfactory-2 (xFactory-2)
Claim: #76 (comment) (2026-09-09T15:40Z, on Brett Heap's "claim 76 and start on it"), slice (B) of two
Ruling: #76 (comment) (ruling 2 especially: the flag is honoured by
setup-project.py, so native Windows gets it by the same rule)Governing: #76 (the scaffold side; the family side is the companion PR from branch
feat/family-siblings-and-init-landing).setup-project.pylearns--family <Family>. The new project's clone lands at<into>/<Family>/<Project>instead of<into>/<Project>, and<into>/<Family>/is created when absent — but only on the real run, so a rehearsal that stops at the plan leaves the disk exactly as it found it. NO DOUBLE NESTING: standing in the family folder already (<into>'s basename is<Family>) lands at<into>/<Project>, decided by the basename rather than the manifest so the FIRST member of a brand-new family does not land one level too deep. NEVER A FAMILY INSIDE A FAMILY: when<into>is a different family's folder (its<X>/<X>/family.yamlsayskind: family-manifestand names<X>), the run refuses, naming both families and both ways out. The holder name is checked against the naming policy's declared-onlyfamilyform through the same classifierfamily.py inituses.Detection without the flag, advisory: standing in a family folder is read (all three facts must agree — folder name,
kind: family-manifest,name:), printed in the(3) projectblock asstanding in the <X> family folder; the project lands beside its holder, and any read failure means "not a family folder" — advice in a plan never refuses a scaffold that did not need it.The project records NOTHING about its family:
scaffold_argsis never given--family, and a test walks the whole clone to prove it. Membership lives in the holder'sfamily.yaml, written byfamily.py add— which is now the last of the "next commands", with a note when no holder is on disk there yet.setup.shis untouched, correctly: it parses nothing and already passes the flag through. TheopenRepoShapeshim names--familyamong its value-taking flags soopenRepoShape Atlas --family InkRouternever readsInkRouteras a second project.Tests: ten new cases in
test_setup_project_py.py(landing, folder created, no double nesting with and without the flag, a same-named plain directory is only a directory, the nesting refusal, theaddline and the holder note, four bad holder names refused in the policy's own words, a rehearsal makes no folder), one in the shim's suite (the value is never the project), three pure-path Windows landing tests. README and AGENTS.md size caps intest_repo_hygiene.pybumped with commentary. Full suite in the worktree: 641 passed, 1 skipped.Decisions the ruling did not settle, for the reviewer: the family lines print inside the
(3) projectblock rather than under a step of their own; the holder-form check runs in step (4) beside the three repository names;family_landingis a pure-path function so Windows can be asked from Linux; there is still no--dry-runonsetup-project.py— the offline rehearsal is--local-remote-dirwith no--yesand no terminal, as before.🤖 Generated with Claude Code
Summary by Sourcery
Support family-aware project scaffolding while keeping family membership recorded only by the family holder.
New Features:
--familysupport to scaffold projects, placing new clones under a family directory while avoiding duplicate or cross-family nesting.Bug Fixes:
--familyvalue as a second project argument.Enhancements:
family.yaml.Documentation:
Tests: