Skip to content

Naming families are six everywhere: handbook.html said five and four, the assembly-root README template said four; a hygiene test now ties every count to the policy (#87) - #88

Merged
brettheap merged 1 commit into
mainfrom
docs/naming-families-count
Sep 10, 2026
Merged

brettheap merged 1 commit into
mainfrom
docs/naming-families-count

Conversation

@brettheap

@brettheap brettheap commented Sep 10, 2026 •

Copy link
Copy Markdown
Contributor

Lane: xfactory-2 (xFactory-2)
Claim: #87 (CLAIMED comment, 2026-09-10, on Brett Heap's "fix the naming-families drift in handbook.html and the assembly-root README")

Closes #87.

docs/handbook.html said "five naming families" in its Layout paragraph and "four" in its file table, with an aside about the README having said four; templates/assembly-root/README.md has said "the four naming families (copied from the shape)" since #1. The policy has SIX since #86. This makes every count six, extends the handbook's Layout paragraph with the sixth form in the README's own wording (<user>-wip, the person's workspace repository, unambiguous by construction), and drops the aside, both halves of which were now false. The handbook's markup stays balanced (dt/dd counts unchanged; one matched <p> pair removed; html.parser feeds it cleanly). The assembly-root README is a TEMPLATED file — new projects only; existing projects' READMEs are project-owned and not re-synced. templates/family-root/README.md carries no such phrase.

A hygiene test now ties the count to the policy: test_every_naming_families_count_matches_the_policy loads the six top-level forms through the project's own NamingPolicy loader and asserts every <word> naming families in every tracked .md/.html spells that number. Red on main (it found five, four, four and four), green here. Full suite: 888 passed, 1 skipped.

Not here, as #87 records: the handbook is also missing the sections the README gained since #71 (the Families workstation layout, "Carrying in-flight work to another workstation", the park/resume commands) — a regeneration of the designed page, its own object.

🤖 Generated with Claude Code

Summary by Sourcery

Align all naming-family documentation with the six-family policy and add a repository-wide guard against future count drift.

Bug Fixes:

  • Correct naming-family counts in the handbook and assembly-root README so all references reflect the six-family policy, including the <user>-wip workspace form.

Enhancements:

  • Remove the obsolete handbook aside describing conflicting naming-family counts.

Documentation:

  • Update user-facing repository documentation and the assembly-root README template to consistently describe six naming families.

Tests:

  • Add a hygiene test that derives the expected naming-family count from NamingPolicy and checks all tracked Markdown and HTML prose for stale counts.

… the assembly-root README template said four; a hygiene test now ties every count to the policy (#87)

#87: found while landing #86 (the sixth form, `workspace` = `<user>-wip`).
Three places quoted the naming-families count in prose and none of them
agreed with `contracts/repository-naming.yaml`, or with each other.

docs/handbook.html (the designed one-page reading of the README, #69/#71):
- "The three legs" section, the families sentence: "five" -> "six", and the
  sentence now names the sixth form the same way it names the other five —
  "`<user>-wip`, the person's workspace repository, unambiguous by
  construction" — appended after "family holders" (the README's own Layout
  block, lines ~509-517, is the wording source).
- The Layout reference table: "the four naming families, as data" -> "the
  six naming families, as data" (matches the README's own Layout block,
  line 1188).
- Dropped the `<p class="aside">` note saying the README's line reads "the
  four naming families" against a naming section that counts five — both
  halves are now false (the README says six in both places), so there is
  nothing left for the aside to explain. The page has no changelog/"what
  changed" block, so none was invented for the still-pending Families
  workstation layout / "Carrying in-flight work" / park and resume sections
  #87 calls out — those stay a separate, larger regeneration, not this
  object.
- `<dt>`/`</dt>` balance unchanged (23/23 before and after); `<p>`/`</p>`
  count moved from 148/113 to 147/112, the same 35-open-without-close
  offset the file already carried, since the removed aside was one closed
  `<p>...</p>` pair. Fed the file through `html.parser.HTMLParser` with no
  exception.

templates/assembly-root/README.md, line 150: "the four naming families
(copied from the shape)" -> "the six naming families (copied from the
shape)". THIS FILE IS TEMPLATED: its bytes are materialized into every
newly scaffolded project's own README.md, so this fix reaches NEW projects
only — an existing project's README is project-owned and is not re-synced
by `update-shape.py`. `templates/family-root/README.md` carries no "naming
families" sentence at all (checked; nothing to fix there).

tests/test_repo_hygiene.py gains
`test_every_naming_families_count_matches_the_policy`: loads
`contracts/repository-naming.yaml` through `scripts/repo_shape.py`'s own
`NamingPolicy.load()` (the same top-level `families` list
`validate-repository-naming.py --explain` counts and that
`test_naming_policy.py` parametrizes over as `FAMILY_IDS` — `project-leg`'s
three `roles:` sub-entries nest one level deeper and are not counted
again), maps the count to its spelled word for a small range (one..ten),
then walks every `git ls-files`-tracked `.md`/`.html` file tree-wide, in
`test_no_committed_file_names_a_host_absolute_path`'s style (a decode
failure is skipped, not failed), asserting every `(\w+) naming families`
match spells that word. Grepping the tree once while writing it found the
phrase in exactly three of the repository's eighteen tracked `.md`/`.html`
files — README.md, docs/handbook.html, templates/assembly-root/README.md —
all three fixed above; templates/family-root/README.md has none today but
is still walked, so a copy landing there later is caught the same way with
no test change required.

Confirmed red on origin/main's content: stashed just the two doc fixes
(`git stash push -- docs/handbook.html templates/assembly-root/README.md`)
with the new test in place, and it failed —
`{'docs/handbook.html': ['five', 'four', 'four'], 'templates/assembly-
root/README.md': ['four']}` — against the policy's six; popped the stash
and it passed.

README.md and AGENTS.md are untouched — their line-count caps in this same
test file (1219 and 374 respectively) still hold exactly, so neither cap
needed moving. docs/handbook.html carries no line-count cap in this suite.

45 passed (tests/test_repo_hygiene.py); 888 passed, 1 skipped for the full
suite (`python3 -m pytest tests -q`).

Lane: xfactory-2 (xFactory-2)
Co-Authored-By: Claude Fable 5.1 <[email protected]>
@brettheap

Copy link
Copy Markdown
Contributor Author

@codex review

@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 10 hours and 31 minutes by commenting @sourcery-ai review. Upgrade to get a review now.

@sourcery-ai

sourcery-ai Bot commented Sep 10, 2026

Copy link
Copy Markdown

Reviewer's Guide

The PR resolves naming-family count drift by updating the handbook and assembly-root README template to six families, documenting <user>-wip, and adding a dynamic hygiene test that keeps all tracked Markdown/HTML prose aligned with the policy.

Flow diagram for policy-driven naming-family count validation

flowchart LR
    P["repository-naming.yaml policy"] --> L[NamingPolicy loader]
    L --> T[test_every_naming_families_count_matches_the_policy]
    T --> F["Tracked .md and .html files"]
    F --> V["Every <word> naming families count"]
    V --> R["Count matches six"]
Loading

File-Level Changes

Change Details Files
Synchronize all documented naming-family counts with the six top-level forms in the naming policy.
  • Update the handbook’s naming overview to include <user>-wip and say six.
  • Change the handbook layout table and assembly-root README template from four to six.
  • Remove the handbook aside that described the obsolete discrepancy.
docs/handbook.html
templates/assembly-root/README.md
Add a repository-wide hygiene test that derives the expected count from NamingPolicy and checks tracked prose.
  • Load the policy through the project’s own loader and map its family count to a number word.
  • Scan tracked Markdown and HTML files for <word> naming families and report mismatches.
  • Ignore non-UTF-8 files and nested roles while counting only top-level policy families.
tests/test_repo_hygiene.py

Assessment against linked issues

Issue Objective Addressed Explanation
#87 Update the handbook and assembly-root README template so every documented naming-families count is six and the handbook lists the sixth workspace form, <user>-wip, while removing the obsolete contradictory aside. ✅
#87 Add a hygiene test that derives the expected naming-families count from the repository naming policy and checks all tracked Markdown and HTML documentation for inconsistent counts, including the family-root template. ✅

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

@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 changes are documentation-alignment plus a targeted hygiene test, with only a minor maintainability improvement suggested for clearer future test failures.

Pull request overview

This PR aligns all prose references to the repository-naming policy’s six top-level naming families across the handbook and assembly-root README template, and adds a hygiene test to prevent future drift by deriving the expected count directly from NamingPolicy.

Changes:

  • Update docs/handbook.html to consistently state “six naming families”, include the <user>-wip workspace form, and remove an obsolete aside.
  • Update templates/assembly-root/README.md to say “the six naming families (copied from the shape)”.
  • Add a repo hygiene test that loads contracts/repository-naming.yaml via NamingPolicy and asserts any tracked .md/.html prose count matches the policy.
File summaries
File Description
tests/test_repo_hygiene.py Adds a policy-derived guard test that prevents naming-family count drift in tracked .md/.html prose.
templates/assembly-root/README.md Updates the assembly-root README template’s layout table to reflect six naming families.
docs/handbook.html Fixes inconsistent naming-family counts, adds the workspace form to the list, and removes a now-false aside.
Review details
  • Files reviewed: 3/3 changed files
  • Comments generated: 1
  • Review effort level: Lite

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

Comment on lines +1063 to +1065
policy = NamingPolicy.load(REPO / "contracts" / "repository-naming.yaml")
expected = NAMING_FAMILIES_NUMBER_WORDS[len(policy.families)]
tracked = subprocess.run(["git", "ls-files"], cwd=str(REPO),

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a36113012d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +1070 to +1071
if not rel.lower().endswith((".md", ".html")):
continue

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Include the policy's own family count in the scan

When another family is added, contracts/repository-naming.yaml:5 can remain the six live naming families without failing this test because the extension filter skips YAML entirely; even after every Markdown/HTML count is updated, the policy's own stale prose count survives. Include that policy comment in the scan and account for its intervening live wording so the claimed every-count invariant covers all existing count statements.

Useful? React with 👍 / 👎.

@brettheap
brettheap merged commit cbca5b4 into main Sep 10, 2026
6 checks passed
brettheap added a commit that referenced this pull request Sep 10, 2026
…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]>
@brettheap
brettheap deleted the docs/naming-families-count branch September 11, 2026 20:05
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.

Naming-families count drift: docs/handbook.html says five and four, the assembly-root README template says four; the policy has six

2 participants