feat: multi-level derived relations (spec 063 S6) #1253

Merged
chris merged 2 commits from feat/063-multilevel-derived into main 2026-10-16 10:22:39 +02:00
Owner

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:

  • Vertical chains to 4 generations: GREAT_GRANDPARENT/GREAT_GREAT_GRANDPARENT + mirrors (da: oldeforælder/tipoldeforælder)
  • Collateral: uncle/aunt, grand-uncle/aunt, nephew/niece, grand-nephew/niece, COUSIN (combined gender forms where the locale lacks neutral terms)
  • Affinal: NEW SIBLING_IN_LAW (partner's sibling / sibling's partner) alongside the existing in-laws

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.

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: - Vertical chains to 4 generations: GREAT_GRANDPARENT/GREAT_GREAT_GRANDPARENT + mirrors (da: oldeforælder/tipoldeforælder) - Collateral: uncle/aunt, grand-uncle/aunt, nephew/niece, grand-nephew/niece, COUSIN (combined gender forms where the locale lacks neutral terms) - Affinal: NEW SIBLING_IN_LAW (partner's sibling / sibling's partner) alongside the existing in-laws 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.
feat: multi-level derived relations (spec 063 S6)
Some checks failed
Wiki Sync / Sync wiki from docs (push) Has been skipped
Build and Deploy / Detect changed services and test scopes (push) Successful in 2s
Build and Deploy / Build converter worker image (push) Has been skipped
Build and Deploy / Build postgres image (push) Has been skipped
Build and Deploy / Build plants worker image (push) Has been skipped
Build and Deploy / Smoke API and media worker (push) Has been skipped
Build and Deploy / Smoke web (push) Has been skipped
Build and Deploy / Smoke ML worker (push) Has been skipped
Build and Deploy / Smoke people worker (push) Has been skipped
Build and Deploy / Build Android CI image (push) Has been skipped
Build and Deploy / Android unit tests and debug APK (push) Has been skipped
Build and Deploy / Build people worker image (push) Has been skipped
Build and Deploy / Deploy postgres (push) Has been skipped
Build and Deploy / Build API image (push) Has been skipped
Build and Deploy / Build media worker image (push) Has been skipped
Build and Deploy / Build ML worker image (push) Has been skipped
Build and Deploy / Build web image (push) Has been skipped
Build and Deploy / Deploy API (push) Has been skipped
Build and Deploy / Deploy web (push) Has been skipped
Build and Deploy / Deploy media worker (push) Has been skipped
Build and Deploy / Deploy ML worker (push) Has been skipped
Build and Deploy / Deploy plants worker (push) Has been skipped
Build and Deploy / Deploy people worker (push) Has been skipped
Build and Deploy / Deploy converter worker (push) Has been skipped
Build and Deploy / Clean Docker build artifacts (push) Has been skipped
Build and Deploy / Run scoped PR tests (push) Failing after 13m40s
62e1e593b5
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:

- Vertical chains up/down to 4 (great-/great-great-grandparents and
  -children)
- Collateral up^a down^b: sibling, uncle/aunt, grand-uncle/aunt,
  nephew/niece, grand-nephew/niece, cousin
- Affinal: child-in-law, parent-in-law, NEW sibling-in-law (partner's
  sibling / sibling's partner)

10 new derived-only tokens (render-only: parse() rejects them 400, DB
CHECK untouched, no migration). Shortest path wins per pair; ties
vertical < collateral < affinal, then lexical. 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.

Web: 10 label keys en/de/da (combined gender forms where the locale
lacks neutral terms; da uses native oldeforælder/tipoldeforælder/
oldebarn/tipoldebarn, niese spelling per DDO), sort ranks extended
(vertical 5, in-laws 6, collateral 7), derived-only token list pinned
by tests.

Tests: 39 PersonRelation green (8 new Postgres integration cases +
shortest-path/suppression/not-storable), 266 web unit, 126 E2E.
chore: retrigger CI (flaky E2E timeouts under runner load; 8/8 green locally)
All checks were successful
Wiki Sync / Sync wiki from docs (push) Has been skipped
Build and Deploy / Detect changed services and test scopes (push) Successful in 2s
Build and Deploy / Build converter worker image (push) Has been skipped
Build and Deploy / Build postgres image (push) Has been skipped
Build and Deploy / Build plants worker image (push) Has been skipped
Build and Deploy / Smoke API and media worker (push) Has been skipped
Build and Deploy / Smoke web (push) Has been skipped
Build and Deploy / Smoke ML worker (push) Has been skipped
Build and Deploy / Smoke people worker (push) Has been skipped
Build and Deploy / Build Android CI image (push) Has been skipped
Build and Deploy / Android unit tests and debug APK (push) Has been skipped
Build and Deploy / Build people worker image (push) Has been skipped
Build and Deploy / Deploy postgres (push) Has been skipped
Build and Deploy / Build API image (push) Has been skipped
Build and Deploy / Build media worker image (push) Has been skipped
Build and Deploy / Build ML worker image (push) Has been skipped
Build and Deploy / Build web image (push) Has been skipped
Build and Deploy / Deploy API (push) Has been skipped
Build and Deploy / Deploy web (push) Has been skipped
Build and Deploy / Deploy media worker (push) Has been skipped
Build and Deploy / Deploy ML worker (push) Has been skipped
Build and Deploy / Deploy plants worker (push) Has been skipped
Build and Deploy / Deploy people worker (push) Has been skipped
Build and Deploy / Deploy converter worker (push) Has been skipped
Build and Deploy / Clean Docker build artifacts (push) Has been skipped
Build and Deploy / Run scoped PR tests (push) Successful in 12m6s
4d29e700c5
chris merged commit 8311f460bb into main 2026-10-16 10:22:39 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
chris/memories!1253
No description provided.