fix: COI direct-ancestor bug — correct Wright algorithm + frontend relation guard #45
Reference in New Issue
Block a user
Delete Branch "fix/pairing-coi-and-direct-relation-guard"
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?
Problem
Direct parent × offspring pairings (e.g. River as sire of the selected dam) showed 0.00% COI because
getAncestors()started traversal at generation 1 — the dog itself was never included in its own ancestor map, so it could never appear as a common ancestor.Backend Fix —
server/routes/pedigree.jsRoot cause (old code)
Fix (new code)
Wright formula
Additional backend improvements
processedPathsSet prevents double-countingGET /api/pedigree/relations/:sireId/:damId— returns{ related, relationship }for use by frontenddirectRelationfield included in/trial-pairingresponseFrontend Fix —
client/src/pages/PairingSimulator.jsx/api/pedigree/relationsendpointCloses
Supersedes PR #44 — this branch includes all fixes from that PR plus the frontend guard.