Implement strict document composition

This commit is contained in:
2026-09-06 20:26:57 +00:00
parent a0cd0977ee
commit 3257b2124c
8 changed files with 438 additions and 21 deletions

View File

@@ -79,6 +79,15 @@ Assigned to document composition:
ConfigKit semantic path model; both precise locations and composite origins are
retained. Default values never participate in strict composition.
Implementation record (2026-09-06): `composeDocuments`, its pre-order claim
collection, conflict construction, and recursive mapping join in `compose.go` adapt
the assigned production symbols. `TestComposeDocumentsJoinsDisjointMappingsAndTracksClaims`,
`TestComposeDocumentsRejectsEveryPresentNonMappingOverlap`, and
`TestComposeDocumentsReportsAllClaimantsAtExactLocations` adapt the assigned cases.
The planned empty-mapping difference is covered separately: empty mappings retain
container provenance but contribute no child claims. No unplanned semantic deviation
from the extracted additive composer was required.
### Imports
Assigned to explicit import traversal and glob handling:

View File

@@ -10,6 +10,9 @@ module and package documentation boundary. Its implemented public primitives are
- a parser-independent ordered tree in `internal/document`;
- the sole upstream YAML integration in `internal/yaml`, which translates validated
input into that owned tree and exposes no parser types outside its boundary;
- a private strict composer in `compose.go` that joins only disjoint document-tree
definitions, retains ordered claims and composite mapping origins, reports every
conflicting location, and never aliases an input tree;
- a per-operation private reflection descriptor graph in `schema.go` for supported
types, YAML field binding, inlining, secret tags, recursion, and semantic paths;
- descriptor-driven canonical projection, detached typed cloning, cycle/limit