Repository navigation
Descendant referent follows the declared pin chain (#40) - #42
Conversation
RULING — Brett Heap, 2026-09-05, verbatim: "elect the shape for both, follow the pin chain, no family yet" — recorded on opensoft/openXfactory#656 (opensoft/openXfactory#656 (comment)). THE DEFECT. `descendant_referents()` derives the referent from the NAME alone, so `validate-repository-naming.py --explain codexDox` says *a CLAIM: needs a declared pin on openDox or openxDox* — and under the ratified split-opendox-two-layer-product (openxFactory, ceb6dc9e) and its OQ-2 there is ONE pin chain: descendants pin `openXdox`, `openXdox` pins `openDox`, and no direct `openDox` pin exists inside the family. What answers today is a case-folding coincidence — `openXdox` casefolds onto the accepted x-stem spelling `openxDox` — which holds for this family's spelling and no other. `LedgerxWallet -> openXwallet -> openWallet` is the same latent gap. THE RULE. A `<Domainx><Product>` name classifies as a domain descendant when its declared pins REACH the matching `open<Product>` through a chain of declared neutral-product pins. The chain is RECORDED, never inferred: the descendant's own manifest carries `naming.referent_chain: [openXdox, openDox]`, whose first entry must be in its `neutral_product_pins:` and whose last must be a referent the name could have. A DIRECT pin stays sufficient — this is an addition, and every name that classified on 2026-09-02 classifies the same way. The check stays OFFLINE (2026-09-02): a link whose tree is reachable is VERIFIED against that tree's own declaration; a link whose tree is not reachable is `declared-unverified`, a warning that never changes the classification; a reachable link that declares something else BREAKS the chain, the residual assembly-root reading wins, the overlap is recorded, and every message NAMES the link that broke. WHAT CHANGED - contracts/repository-naming.yaml: the rule as data beside the existing referent rule — `referent.chain:` (record_field, link_declared_by, max_length, unverified_status) and `referent.example_chains:` carrying both worked cases, plus `codexDox` in the examples. - scripts/repo_shape.py: `ReferentResolution` (none/direct/verified/ declared-unverified/broken), `NamingPolicy.resolve_referent()`, `chain_rule()`, chain-aware `classify()`, and the offline link readers (`declared_neutral_pins`, `resolve_link_source`, `link_pins_from_trees`). `PIN_SOURCE_ENV_PREFIX`/`pin_source_env_name` move here from validate-pins.py: one checkout answers both questions about a product. - scripts/validate-repository-naming.py: `--referent-chain` and `--link-source [PRODUCT=]PATH`; `--project` reads the chain from each leg's `naming.referent_chain:`; `--explain` now names BOTH ways a referent may be reached; warnings print and change no exit code. - scaffold-project.py: `--referent-chain`, checked before anything is created, and recorded in the manifest it writes. - templates/assembly-root/project.yaml + scripts/validate-manifest.py: the field is documented where it is written, and the project's own gate reads it — one reading of the chain for both the leg's classification and its `naming:` record, and `referent_declared: true` is answered by the FIRST LINK's pin file, because that is the pin the project holds. - README § "A descendant form is a claim; a claim needs a referent": two paragraphs quoting the ruling and citing openxFactory#656. - tests: 413 -> 446. Direct pin unchanged, two-link chain verified, link tree unreachable -> declared-unverified and still a descendant, four ways to break a chain (unpinned first entry, wrong last entry, cycle, over-length), a broken chain never taking away a direct pin, `LedgerxWallet -> openXwallet -> openWallet` as the second worked case, every `example_chains:` row exercised from the contract, the link readers, the CLI, the manifest gate, and the scaffold end to end. Nothing else in the standard moves; the shape still confers nothing. Closes #40 Refs opensoft/openXfactory#656 Lane: openxfactory-4-opendox-extraction (formerly openxfactory-opendox) Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_011z8xpxRKZXyN3jLzFHoxj1
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 5 days and 9 hours by commenting @sourcery-ai review. Upgrade to get a review now.
Reviewer's GuideThis PR extends descendant referent resolution from direct pins to explicitly recorded neutral-product pin chains, validating reachable links offline while treating unavailable links as non-failing warnings; it propagates the result through classification, CLI and manifest gates, scaffolding, generated metadata, documentation, and comprehensive regression tests. Entity relationship diagram for recorded referent chainserDiagram
DESCENDANT_MANIFEST {
string repository
string referent_chain
string neutral_product_pins
}
LINK_MANIFEST {
string product
string neutral_product_pins
}
REFERENT_PIN_CONTRACT {
string product
string commit
string tree_digest
}
DESCENDANT_MANIFEST }o--o{ LINK_MANIFEST : records_chain_to
LINK_MANIFEST }o--o{ REFERENT_PIN_CONTRACT : declares_pin_on
Flow diagram for recorded descendant referent-chain resolutionflowchart TD
A[Descendant name] --> B[Read naming.referent_chain]
B --> C{Direct referent pin?}
C -->|Yes| D[Classify as descendant]
C -->|No| E{Recorded chain valid?}
E -->|No| F[Use residual assembly-root reading]
E -->|Yes| G[Verify each link locally]
G -->|All links agree| D
G -->|Link unavailable| H[Classify as descendant]
H --> I[Emit declared-unverified warning]
G -->|Link disagrees| F
File-Level Changes
Assessment against linked issues
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
|
LANDING — lane openxfactory-4-opendox-extraction (formerly openxfactory-opendox), session 011z8xpxRKZXyN3jLzFHoxj1, 2026-09-05T16:26Z, PR #42 into openRepoShape main at head 1b3b0e3 on Brett Heap's word "merge 42" (2026-09-05T16:26Z) under his 2026-09-05T14:52Z ruling "follow the pin chain" (opensoft/openXfactory#656). Lane: openxfactory-4-opendox-extraction (formerly openxfactory-opendox) |
There was a problem hiding this comment.
🟡 Changes recommended
There are correctness/documentation inconsistencies in chain link-source resolution and contract example data that should be addressed to avoid mis-verifying chains and confusing worked-case semantics.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
This PR updates openRepoShape’s naming policy and validators so a domain-descendant’s referent can be resolved offline via an explicitly recorded neutral-product pin chain (e.g., codexDox pins openXdox, which pins openDox), while preserving the existing “direct referent pin is sufficient” behavior.
Changes:
- Add chain-as-data to
contracts/repository-naming.yamland implement chain-aware referent resolution + offline link verification/warnings. - Extend the naming CLI, manifest validator, and project scaffolder to read/record
naming.referent_chainand to surfacedeclared-unverifiedvs broken-chain behavior. - Update templates/docs and expand tests to cover direct pins, verified/unverified chains, and broken chains.
File summaries
| File | Description |
|---|---|
| tests/test_scaffold_pin_and_reuse.py | Adds end-to-end scaffold tests for chain-based descendants and refusal cases. |
| tests/test_repo_hygiene.py | Raises README line cap to accommodate new referent-chain documentation. |
| tests/test_naming_policy.py | Adds unit tests for chain resolution, offline link reading, and CLI behavior. |
| tests/test_manifest_validator.py | Adds manifest-gate tests for chain reachability, warnings, and broken-chain findings. |
| templates/assembly-root/scripts/validate-pins.py | Moves shared pin_source_env_name logic into repo_shape. |
| templates/assembly-root/scripts/validate-manifest.py | Validates recorded referent chains; emits warnings for unread links without changing exit code. |
| templates/assembly-root/project.yaml | Documents how referent_chain is recorded and verified offline. |
| scripts/validate-repository-naming.py | Adds --referent-chain / --link-source, reads chains from manifests, and prints chain/warnings in --explain. |
| scripts/shape_materialize.py | Writes referent_chain into scaffolded naming: blocks and updates plan notes to reflect chain support. |
| scripts/repo_shape.py | Implements ReferentResolution, chain-aware classify(), and offline link-manifest readers. |
| scaffold-project.py | Adds --referent-chain, validates recorded chains pre-scaffold, and prints offline warnings. |
| README.md | Documents the “referent reached through a recorded pin chain” rule and offline verification semantics. |
| contracts/repository-naming.yaml | Encodes the chain rule as contract data (referent.chain.*) and adds worked-case example chains. |
Review details
Suppressed comments (1)
contracts/repository-naming.yaml:237
LedgerxWalletis listed in bothreferent.chain.example_chains(implying it pinsopenXwallet) andexample_referents(implying it pinsopenWalletdirectly). This contradicts the surrounding comments/tests that say an example should declare either a direct referent pin or a chain, and it can mislead readers about the worked-case facts. Consider removingLedgerxWalletfromexample_referentsso it is exercised only throughexample_chains.
example_referents:
MedxChart: openChart
LedgerxWallet: openWallet
codexFactory: openxFactory
- Files reviewed: 13/13 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.
| for path, how in candidates: | ||
| if link_manifest_path(path) is not None: | ||
| return path, how | ||
| return None, None |
|
LANDED — lane openxfactory-4-opendox-extraction, session 011z8xpxRKZXyN3jLzFHoxj1, 2026-09-05T16:27Z: PR #42 squash-merged into openRepoShape main as Lane: openxfactory-4-opendox-extraction (formerly openxfactory-opendox) |
…) (#45) Ruled by Brett Heap on 2026-09-05: "elect the shape for both, follow the pin chain, no family yet" (openxFactory#656), for openDox and openXdox. The scaffold refused both: accepts_role() admitted only project-leg/<role> and a declared domain-descendant/assembly, and the project-leg/assembly overlap the classifier computed for open<Product> was discarded. The neutral-product family now ADMITS the declared assembly role as data (admits_declared_role, the descendant family's own mechanism), and classify carries that role where the name also satisfies the leg form, consuming (neutral-product, None) so project-leg/assembly survives in also_matches: the form still wins, the overlap is recorded, not resolved. accepts_role admits ("neutral-product", "assembly"). install is admitted into no role, and could not be. Electing confers nothing, so openDox mounting openDox-spec and openDox-code is a fact about layout, not a claim about neutrality. 496 tests (+28). Referent-chain logic from #42 untouched. Lane: xfactory-2 (xFactory-2) Co-authored-by: Claude Fable 5.1 <[email protected]>



Lane: openxfactory-4-opendox-extraction (formerly openxfactory-opendox)
RULING — Brett Heap, 2026-09-05, verbatim: "elect the shape for both, follow the pin chain, no family yet" — recorded on opensoft/openXfactory#656 (opensoft/openXfactory#656 (comment)). This PR is the part of that ruling that lands in this repository.
The defect
descendant_referents()derives the referent from the NAME alone, sovalidate-repository-naming.py --explain codexDoxsays a CLAIM: needs a declared pin on openDox or openxDox. Under the ratifiedsplit-opendox-two-layer-product(openxFactory,ceb6dc9e) and its ruling OQ-2 there is ONE pin chain: descendants pinopenXdox,openXdoxpinsopenDox, and no directopenDoxpin exists inside the family. What answers today is a case-folding coincidence —openXdoxcasefolds onto the accepted x-stem spellingopenxDox— which holds for this family's spelling and for no other.LedgerxWallet -> openXwallet -> openWalletis the same latent gap, andopenWallethas no repository at all yet.The design
naming.referent_chain: [openXdox, openDox]. Its first entry must be in itsneutral_product_pins:(the pin this project actually holds); its last must be a referent the name could have.MedxChartanswers exactly as it did on 2026-09-02, and a broken chain recorded beside a direct pin is a warning to repair, never an answer taken away.declared-unverifiedwhen not. A link beyond the first is a declaration in ANOTHER tree. Where that tree is on the disk —--link-source [PRODUCT=]PATH,SHAPE_PIN_SOURCE_<PRODUCT>, or a checkout beside the root, the lookup ordervalidate-pins.pyalready uses — the link is VERIFIED against its ownneutral_product_pins:. Where it is not, the link is reporteddeclared-unverified: a WARNING, no exit code, and the name STILL classifies as a descendant. Failing there would make the answer depend on which trees happen to be on the disk, which is the network dependency wearing a different coat.openInkdeclaresopenQuill, notopenScriberather than "the chain is invalid".contracts/repository-naming.yamlbeside the existing referent rule:referent.chain:(record_field,link_declared_by,max_length,unverified_status) andreferent.example_chains:.Worked cases
codexDoxopenXdoxopenDoxLedgerxWalletopenXwalletopenWalletBoth are in the contract file as
example_chains:and both are exercised from that data by the suite. Neither asserts that anything exists.--explain codexDoxnow names both ways a referent may be reached: a CLAIM: needs a declared pin on openDox or openxDox, or a declared chain (naming.referent_chain) of pins ending in one of them.What changed
contracts/repository-naming.yaml(the rule as data) ·scripts/repo_shape.py(ReferentResolution,resolve_referent(),chain_rule(), chain-awareclassify(), the offline link readers;pin_source_env_namemoves here fromvalidate-pins.pybecause one checkout answers both questions about a product) ·scripts/validate-repository-naming.py(--referent-chain,--link-source;--projectreads the chain from each leg) ·scaffold-project.py(--referent-chain, checked before anything is created) ·templates/assembly-root/project.yaml+scripts/validate-manifest.py(the field documented where it is written, and the project's own gate reading it —referent_declared: trueis answered by the FIRST LINK's pin file, because that is the pin the project holds) ·README.md§ "A descendant form is a claim; a claim needs a referent" · tests 435 -> 468.Nothing else in the standard moves; the shape still confers nothing.
Sibling disclosure
Lane
codex-intake-shape's PR #37 landed first (a48d1f3), so this branch was rebased onto it and merged, as disclosed on #40: the README paragraph sits in the descendant section, away from #37's hunks, and the one real overlap — the README line cap intests/test_repo_hygiene.py— was resolved by keeping #37's history entries and appending this change's (700 -> 725). The openxFactory doctrine sentence indocs/project-repo-schema.md§ the same title is amended in the openxFactory amendment PR, not here.Closes #40
Refs opensoft/openXfactory#656
🤖 Generated with Claude Code
https://claude.ai/code/session_011z8xpxRKZXyN3jLzFHoxj1
Summary by Sourcery
Follow explicitly recorded neutral-product pin chains when resolving descendant referents while preserving direct-pin behavior and offline validation.
New Features:
Bug Fixes:
Enhancements:
Documentation:
Tests: