feat: derived family relations (spec 063 S5) #1248
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/063-derived-relations"
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?
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):
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.