feat: derived family relations (spec 063 S5) #1248

Merged
chris merged 1 commit from feat/063-derived-relations into main 2026-10-15 23:47:14 +02:00
Owner

Smart relations: three read-time derivation rules over the stored relation graph — never persisted, so derived relations update automatically whenever base relations change.

Rules (depth-2, guarded):

  • Grandparent: X parent of Y, Y parent of Z => X grandparent of Z / Z grandchild of X
  • Sibling: shared explicit parent => SIBLING
  • Child-in-law: X parent of Y, Y partner/spouse Z => Z child-in-law of X / X parent-in-law of Z

Guards: an explicit row between a pair suppresses all derivations toward it (blended families — the biological parent relation wins, no in-law), no self-relations through cycles, opposite person must be visible to the viewer. Derived items carry relationId/createdAt null + derived=true; POSTing a derived pair pins/promotes it to an explicit row.

API: family-graph neighborhood query + in-memory composition, dedup per pair/type, chosen-representative thumbnails and visibility via existing parameterized SQL fragments. 30/30 PersonRelation tests (8 new: chains both sides, two-shared-parent dedup, PARTNER+SPOUSE in-law variants, blended suppression, 2-cycle, visibility, promote-then-409).

Web: derived flag + nullable ids in the client type; derived tiles show an emerald provenance dot (Udledt/Hergeleitet/Derived) instead of the X; delete flow null-safe and derived rows survive explicit deletes; collision-proof row keys. 255 unit + 126 E2E green.

Closes spec 063 tasks S063T008, S063T009.

Smart relations: three read-time derivation rules over the stored relation graph — never persisted, so derived relations update automatically whenever base relations change. Rules (depth-2, guarded): - Grandparent: X parent of Y, Y parent of Z => X grandparent of Z / Z grandchild of X - Sibling: shared explicit parent => SIBLING - Child-in-law: X parent of Y, Y partner/spouse Z => Z child-in-law of X / X parent-in-law of Z Guards: an explicit row between a pair suppresses all derivations toward it (blended families — the biological parent relation wins, no in-law), no self-relations through cycles, opposite person must be visible to the viewer. Derived items carry relationId/createdAt null + derived=true; POSTing a derived pair pins/promotes it to an explicit row. API: family-graph neighborhood query + in-memory composition, dedup per pair/type, chosen-representative thumbnails and visibility via existing parameterized SQL fragments. 30/30 PersonRelation tests (8 new: chains both sides, two-shared-parent dedup, PARTNER+SPOUSE in-law variants, blended suppression, 2-cycle, visibility, promote-then-409). Web: derived flag + nullable ids in the client type; derived tiles show an emerald provenance dot (Udledt/Hergeleitet/Derived) instead of the X; delete flow null-safe and derived rows survive explicit deletes; collision-proof row keys. 255 unit + 126 E2E green. Closes spec 063 tasks S063T008, S063T009.
feat: derived family relations (spec 063 S5)
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 8s
Build and Deploy / Build plants worker image (push) Has been skipped
Build and Deploy / Build converter worker image (push) Has been skipped
Build and Deploy / Build postgres 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 26m36s
89904bdec7
Read-time derivation over the relation graph — never stored, so derived
relations update automatically when base relations change:

- X parent of Y, Y parent of Z => X grandparent of Z / Z grandchild of X
- shared explicit parent => SIBLING
- X parent of Y, Y partner/spouse Z => Z child-in-law of X / X
  parent-in-law of Z

Guards: no derivation toward a pair with any explicit row (blended
families: the biological parent row wins, no in-law), no self-relations
through cycles, depth-2 only, opposite person must be visible to the
viewer. Derived items: relationId/createdAt null, derived=true.

API: family-graph neighborhood query + in-memory composition table,
dedup per pair/type, thumbnails and visibility via the existing
parameterized fragments. 30/30 PersonRelation tests incl. 8 new.

Web: PersonRelationView gains derived flag + nullable relationId/
createdAt; derived tiles show an emerald provenance dot (title/aria
'Udledt/Hergeleitet/Derived') and never an X; delete flow null-safe and
keeps derived rows on explicit deletes; row keys collision-proof;
pinned derived pair promotes to explicit without duplicates. 255 unit +
126 E2E green.
chris merged commit c6ee556100 into main 2026-10-15 23:47:14 +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!1248
No description provided.