feat: multi-level derived relations (spec 063 S6) #1253
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/063-multilevel-derived"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Derivation generalizes from the S5 depth-2 rules to a bounded breadth-first walk over explicit edges with a CLOSED term table — derived relations across generations, never stored:
10 new derived-only tokens: render-only (parse rejects with 400, DB CHECK untouched, no migration). Shortest path wins per pair; ties vertical < collateral < affinal, then lexical. S5 guards unchanged: explicit rows suppress all derivations toward that pair (blended families), no self-paths, visibility filter, non-monotone paths and step-relations/partner-chains derive nothing.
Engine lives in PersonRelationService (termForRoles + collateralTerm + isMonotoneSegment, static and unit-testable); graph loaded as a capped recursive CTE around the viewed person.
Tests: 39 PersonRelation green (8 new Postgres integration cases: 5-generation chain, grand-uncle/nephew/cousin shapes, sibling-in-law both variants, shortest-path priority, explicit-row suppression, derived-not-storable), 266 web unit (sort ranks extended, token lists pinned), 126 E2E.
Closes spec 063 tasks S063T010, S063T011.