T-XIU4-nearest-first-link-resolution-and-the-add-never-redefine
State: planning/proposed · Impact: medium · Complexity: medium
Definition kinds inherit down the containment tree, and a unit adds but never redefines (D-XCXA-module-graph). Ids resolve flat across the vault, but slugs can repeat across units, so a slug-only or ambiguous link needs a tie-break (D-SK9G-cross-project-addressing). Nothing enforces the add-never-redefine rule yet.
Proposed
Section titled “Proposed”| Part | Behaviour |
|---|---|
| Resolver | An id resolves flat by basename. A slug-only or ambiguous target resolves from the linking entity’s root, then up its ancestor roots in turn; the nearest match wins. A qualified slug:ID resolves through the projects: roster. |
| Audit: re-declared id | A child root that declares an id an ancestor root already declares fails audit, naming both roots. |
| Audit: silent contradiction | A child definition that contradicts an ancestor’s definition without a related link to it is flagged. |
| One resolver | sdlc docs generate and SDF call the same resolver, so the index and the app agree on every link. |
Acceptance criteria
Section titled “Acceptance criteria”- AC-1: The resolver walks from the linking entity’s root up its ancestors for slug-only and ambiguous targets, then the roster for qualified ids. Fixtures with nested roots pin the nearest match, a match only in a grandparent, and a qualified id.
- AC-2:
sdlc entities auditfails a child that re-declares an ancestor’s id, and flags a child definition that contradicts an ancestor without arelatedlink. Fixtures pin each rule and the passing case where the child links the ancestor. - AC-3:
sdlc docs generateand SDF resolve links through the same resolver. - AC-4: With only one root declared, resolution and audit output are unchanged.
Out of scope
Section titled “Out of scope”- Union loading and flat id resolution (T-G3EH-federated-planning-roots-union-loading-flat-resolution-union).
- The qualified wikilink pattern and the
unverifiedstate (T-KBOI-qualified-wikilink-pattern-resolver-and-the-audit-unverified). - Inheritance of work kinds, which never inherit.
Dependencies
Section titled “Dependencies”- T-G3EH-federated-planning-roots-union-loading-flat-resolution-union (federated root loading, in the modularization stack).
- T-CY6T-control-units-a-planning-root-is-the-boundary-and-every, which defines the containment tree the walk climbs.
Depends on
Section titled “Depends on”T-G3EH-federated-planning-roots-union-loading-flat-resolution-union, T-CY6T-control-units-a-planning-root-is-the-boundary-and-every