Repository navigation
Naming: a descendant form is a claim that needs a pin; declared role wins otherwise (Brett, 2026-09-02) - #4
Conversation
On the first real pilot, `./setup.sh --project MedxScribe --org MedxSoft`
reached step (4) and step (5) refused:
REFUSED naming-role-mismatch: 'MedxScribe' classifies as
domain-descendant, not as the 'assembly' form of a project leg
No `opensoft/openScribe` exists. MedxScribe is an ordinary project in the
Medx family, not a descendant of anything — and every project in a
`<Domainx>` family org (MedxSoft: MedxEHR, MedxGlass, ...) hit the same
wall. Reading `<Domainx><Product>` as a FACT about the world, when it is
only a shape of characters, made an ordinary project unscaffoldable in
the one organisation shaped to have many of them.
Ruled by Brett Heap on 2026-09-02: "Descendant only if it pins
open<Product>." The descendant form is a CLAIM, and a claim needs a
REFERENT. A name classifies as a domain descendant only when the project
declares a pin on the matching `open<Product>`; otherwise the DECLARED
ROLE wins and the name is a valid assembly root. The overlap is not
discarded — it is RECORDED, in the manifest and in `--explain`.
`neutral-product` and `install` are unchanged: `open` in front and
`-Install` behind say what a name is in its own characters, so those two
are unambiguous by construction and win outright. The refusals that were
real stay real: a `-spec` name offered as the assembly root, and a
neutral-product or install form used as any leg, are all still refused.
THE CHECK STAYS OFFLINE. The referent is a pin the project DECLARES —
`neutral_product_pins:` in `project.yaml` and the pin file beside it —
which is a fact in its own tree. Nothing here asks GitHub whether
`open<Product>` exists, because a rule needing the network is unrunnable
in the fork-and-run case this standard is built for.
What moved:
contracts/repository-naming.yaml the precedence commentary rewritten;
the domain-descendant family gains `requires_referent: true` and a
`referent:` block (split pattern, `open{product}` canonical, the
x-stem `openx{product}` also accepted because `codexFactory`
descends from `openxFactory`). Examples stay truthful:
`example_referents` says MedxChart is a descendant BECAUSE
MedxChart pins openChart, and `claim_without_referent_examples`
keeps the pilot case in the data.
scripts/repo_shape.py `classify(name, declared_role,
declared_pins)` in the ruled order: neutral-product -> install ->
domain-descendant ONLY with a referent -> project-leg by declared
role -> project-leg residual. It returns a `Classification`, a
2-tuple by construction so no call site changes, carrying
`also_matches` and the `reason` --explain prints.
scripts/validate-repository-naming.py `--role` and `--pins` for a
one-off check; `--project` reads the legs' roles and
`neutral_product_pins:` out of the manifest; `--explain` prints
"descendant form, no referent pin declared -> assembly root by
declared role" and the `also_matches` record.
scaffold-project.py the descendant/assembly overlap no
longer refuses. Each leg gets a `naming:` block in project.yaml,
and the plan prints one NOTE naming the pin that would change the
answer.
templates/assembly-root/ project.yaml carries optional
`neutral_product_pins:` and per-leg `naming:`;
validate-manifest.py checks form, role, also_matches, the recorded
referent, and refuses `referent_declared: true` with no
`contracts/<referent>-pin.yaml` in the tree. Both fields are
OPTIONAL, so `schema_version` does not move — a manifest written
before they existed is not thereby wrong.
A `naming:` record cannot vouch for its own descent: the declaration is
`neutral_product_pins:` alone, and `referent_declared:` is checked
against it rather than folded into it.
The README naming section is rewritten and its line cap moves 150 -> 172,
once, for a rule the standard actually gained.
python3 -m pytest tests -q -> 137 passed in 22.75s
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01HGKwdQsmvRZx4fGQESdFGZ
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 17 hours and 29 minutes by commenting @sourcery-ai review. Upgrade to get a review now.
Reviewer's GuideUpdates repository naming so Sequence diagram for offline descendant-form validationsequenceDiagram
participant User
participant Validator as NamingValidator
participant Manifest as project.yaml
participant Policy as NamingPolicy
participant PinFile as PinFile
User->>Validator: validate MedxChart with --project
Validator->>Manifest: Read legs and neutral_product_pins
Manifest-->>Validator: role and declared pins
Validator->>Policy: classify(name, role, pins)
Policy->>Policy: derive openChart referent
Policy-->>Validator: domain-descendant plus overlap data
Validator->>PinFile: Check contracts/openchart-pin.yaml
PinFile-->>Validator: Pin file exists
Validator-->>User: Valid manifest
Entity relationship diagram for naming claims and referentserDiagram
PROJECT_MANIFEST ||--o{ PROJECT_LEG : contains
PROJECT_MANIFEST ||--o{ NEUTRAL_PRODUCT_PIN : declares
PROJECT_LEG ||--o| NAMING_RECORD : records
NAMING_RECORD }o..|| NEUTRAL_PRODUCT_PIN : may_reference
PROJECT_MANIFEST {
string neutral_product_pins
}
PROJECT_LEG {
string role
string repository
}
NAMING_RECORD {
string form
string also_matches
string descendant_referent
boolean referent_declared
}
NEUTRAL_PRODUCT_PIN {
string product
string pin_file
}
Flow diagram for offline repository-name classificationflowchart TD
A[Repository name] --> B{Matches neutral-product or install?}
B -->|Yes| C[Classify as unambiguous form]
B -->|No| D{Matches domain-descendant form?}
D -->|Yes| E{Matching neutral-product pin declared?}
E -->|Yes| F[Classify as domain-descendant]
E -->|No| G{Declared project-leg role matches?}
D -->|No| G
G -->|Yes| H[Classify as declared project-leg role]
G -->|No| I[Classify as residual project-leg]
F --> J[Record also_matches]
H --> J
I --> J
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
There was a problem hiding this comment.
🟡 Changes recommended
There are confirmed correctness issues in pin normalization/type-handling and a potential IndexError in classify() when policy data diverges from split parsing.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
This PR updates the repository naming policy so that <Domainx><Product> names are treated as descendant claims that only classify as domain-descendant when the project explicitly declares a matching neutral-product pin, while otherwise allowing the declared project-leg role to win and recording overlaps for offline traceability.
Changes:
- Extend naming-policy classification to consider declared roles and declared neutral-product pins; record overlaps (
also_matches) and explanations (reason). - Update scaffold + templates to write per-leg
naming:records (and emit a NOTE for descendant-shaped overlaps) while keeping validation offline. - Add/expand unit + e2e + manifest validation tests and update README naming semantics.
File summaries
| File | Description |
|---|---|
contracts/repository-naming.yaml |
Makes domain-descendant require a declared referent pin and adds referent metadata/examples to keep the policy testable offline. |
scripts/repo_shape.py |
Implements classify(name, declared_role, declared_pins) returning a Classification with also_matches and reason. |
scripts/validate-repository-naming.py |
Adds --role/--pins, reads declared roles/pins from manifests, and improves --explain output for overlaps/claims. |
scaffold-project.py |
Relaxes descendant/assembly overlap refusal, writes naming: blocks into project.yaml, and prints a descendant overlap NOTE. |
templates/assembly-root/project.yaml |
Adds optional neutral_product_pins: and per-leg optional naming: records to the scaffolded manifest template. |
templates/assembly-root/scripts/validate-manifest.py |
Validates optional naming: records and referent pin-file presence while keeping checks offline. |
README.md |
Documents the updated “descendant is a claim needing a referent” semantics and the offline declaration mechanism. |
tests/test_naming_policy.py |
Adds unit coverage for claim-without-referent behavior, pin-driven descendant classification, and CLI explain output. |
tests/test_manifest_validator.py |
Adds validation coverage for optional naming: blocks, overlap correctness, and referent pin-file checks. |
tests/test_scaffold_e2e.py |
Adds an end-to-end pilot-case scaffold test ensuring overlap recording and validator agreement. |
tests/test_repo_hygiene.py |
Updates README line-cap to accommodate the new naming rule documentation. |
Review details
- Files reviewed: 11/11 changed files
- Comments generated: 3
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| claimed = "domain-descendant" in by_family | ||
| referents = self.descendant_referents(name) if claimed else () | ||
| declared = next((r for r in referents if r.casefold() in pins), None) | ||
| if claimed and (declared or not self.requires_referent("domain-descendant")): | ||
| return answer( | ||
| "domain-descendant", by_family["domain-descendant"][0], | ||
| f"descendant form with a declared pin on {declared} → domain " | ||
| "descendant" if declared else | ||
| "descendant form (this policy does not require a referent)") | ||
|
|
||
| leg_roles = [r for r in (by_family.get("project-leg") or []) if r] | ||
| chosen = None | ||
| if declared_role is not None and declared_role in leg_roles: | ||
| chosen, how = declared_role, "by declared role" | ||
| elif leg_roles: | ||
| chosen, how = leg_roles[0], "by its residual project-leg form" | ||
| if chosen is not None: | ||
| if claimed: | ||
| reason = (f"descendant form, no referent pin declared (it would " | ||
| f"need {referents[0]}) → {chosen} root {how}") | ||
| else: | ||
| reason = f"project leg, {chosen} {how}" | ||
| return answer("project-leg", chosen, reason) |
| `validate-manifest.py` against this list; reading it as a declaration here | ||
| would let a claim vouch for itself. | ||
| """ | ||
| return {str(pin) for pin in (data.get("neutral_product_pins") or []) if pin} |
| a `naming:` block assert its own descent, which is a claim promoting | ||
| itself to a referent: exactly the move the 2026-09-02 ruling forbids. | ||
| """ | ||
| return {str(pin) for pin in (manifest.get("neutral_product_pins") or []) if pin} |



What happened
The first real pilot. From a MedxSoft fork,
./setup.sh --project MedxScribe --visibility private --org MedxSoft --yesreached step (4) naming policy and step (5) refused:
No
opensoft/openScribeexists. MedxScribe is an ordinary project in the Medxfamily, not a descendant of anything. Every project in a
<Domainx>family org(MedxSoft: MedxEHR, MedxGlass, …) hits this. The policy was reading a SHAPE OF
CHARACTERS as a FACT ABOUT THE WORLD, and doing it in the one kind of
organisation built to hold many such names.
The ruling
Brett Heap, 2026-09-02:
The semantics
Two of the four forms are unambiguous by construction and are unchanged.
open<Product>and<X>-Installsay what they are in their own characters:nothing else spells them, so they win outright and need nothing declared.
The descendant form is a CLAIM that needs a REFERENT. Classification order:
neutral-productinstalldomain-descendant— only if the derivedopen<Product>is in theproject's declared pins
project-legin the declared role, where the name satisfies itproject-legresidual — the widest form, deliberately lastWith no referent,
MedxScribeisproject-leg/assemblywithalso_matches: [domain-descendant].MedxChartis a descendant, becauseMedxChart pins
openChart— the contract now says so inexample_referentsrather than leaving it to be inferred from spelling.
The overlap is recorded, not discarded. Every classification carries
also_matches, and each leg of a scaffoldedproject.yamlgets:with one NOTE in the scaffold plan:
It stays offline. The referent is
neutral_product_pins:in the project'sown
project.yamlplus the pin file beside it — a fact in its own tree. Nothingasks GitHub whether
open<Product>exists, because a rule that needed thenetwork would be unrunnable in the fork-and-run case this standard exists for.
A claim cannot vouch for itself.
neutral_product_pins:is the onlydeclaration; a leg's
referent_declared:is a record checked against it,never folded into it.
The real refusals survive. A
-specname offered as the assembly root, anda neutral-product or install form used as any leg, are still refused — a
declared role wins only where the NAME satisfies it.
Changed
contracts/repository-naming.yamlrequires_referent: trueand areferent:block on domain-descendant;example_referentsandclaim_without_referent_exampleskeep the data truthful and the pilot case testable from the contractscripts/repo_shape.pyclassify(name, declared_role, declared_pins); returns aClassification— a 2-tuple by construction, so no call site changed — carryingalso_matchesand thereason--explainprintsscripts/validate-repository-naming.py--role,--pins;--projectreads the legs' roles andneutral_product_pins:;--explainprints the reasoningscaffold-project.pynaming:block; prints the NOTEtemplates/assembly-root/neutral_product_pins:and per-legnaming:;validate-manifest.pychecks both and refusesreferent_declared: truewith nocontracts/<referent>-pin.yaml. Both fields OPTIONAL, soschema_versiondoes not moveREADME.mdTests
New: classification units for
MedxScribe(no pins → assembly,also_matchesdescendant),
MedxChartwith{openChart}→ descendant,MedxChartwithout →assembly with the overlap recorded,
openScribe→ neutral-product regardless,Foo-Install→ install regardless,MedxScribe-specoffered as assembly →refused; an e2e scaffold of
MedxScribe --local-remote-dirasserting success,the NOTE and the exact
naming:block; manifest-validator positive and negativecases including the missing pin file. No real repository is created anywhere.
Merge note
setup.shandtests/test_setup_sh.pyare untouched, and the README edit isconfined to the naming section, so this should not collide with
fix/setup-org-detection. AGENTS.md is untouched: it does not mention therefusal.
🤖 Generated with Claude Code
https://claude.ai/code/session_01HGKwdQsmvRZx4fGQESdFGZ
Summary by Sourcery
Make descendant-shaped repository names require an explicit neutral-product pin while preserving their overlaps and allowing valid declared project roles to proceed offline.
New Features:
<Domainx><Product>name as a domain descendant, allowing the declared project-leg role to resolve unreferenced overlaps.--explain.Bug Fixes:
MedxScribeto scaffold successfully when they do not declare a matching neutral-product pin.Enhancements:
Documentation:
Tests: