Feat/ibd suggestion target guid - #30
Merged
Merged
Conversation
`/api/v1/ibd/attest` gates on `owns_sample(attester_did, claimed_sample)`, but a self-publishing Edge client has no way to learn its server-side `core.biosample.sample_guid` — the suggestions payload returned only the *candidate's* guid, so Navigator could never fill in `claimed_sample` and the attest endpoint was unreachable from the edge. `suggestions_for_did` already joins on `ms.target_sample_guid` (that is how the per-DID scope is enforced), so surfacing it costs nothing and leaks nothing: the caller owns that sample by construction. `suggested_sample_guid` supplies the `counterpart_sample` of the same report. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The de-novo loader reuses a catalog row only when it matches on
`coordinates @> {'hs1': ...}`, so markers whose hs1 coordinate had not been
lifted yet missed the match and got a fresh hs1-only row — and that row is what
`tree.haplogroup_variant` points at. `variant-name-reconcile` later adopted the
marker's name onto the branch row but never touches `coordinates`, leaving the
tree with correct names and, on the 2026-08-04 prod dump, GRCh38 for only 44,181
of 203,983 branch SNPs (21.7%).
The Navigator places each source in its native build with no liftover
(`place_y_consensus_decodingus`), and `parse_decodingus_json(json, build_key)`
drops every locus lacking that build's coordinate — so a GRCh38 subject saw
3,413 of 11,421 Y nodes. All 33 backbone nodes survived; what vanished was the
terminal tree (node visibility 81% at depth 0-10 → 21% at 31-40), so GRCh38
subjects placed plausibly but shallow rather than failing outright.
Copy GRCh38/GRCh37 from the marker's catalog row (same canonical_name AND
identical hs1 site + alleles) rather than chain-lifting: the catalog row holds
YBrowse's own values, and a lift would re-derive them and can mismap in the
inverted / ampliconic Y blocks. All 132,183 candidate rows agree with their twin
on position and alleles (0 swapped), so the copy is exact. Rows whose twin
disagrees are not filled — the match is enforced in the join.
Verified against a restored copy of the 2026-08-04 prod dump and against
decodingus_cutover: 130,553 rows filled in 34s, GRCh38 44,181 → 174,734, node
visibility 3,413 → 11,104/11,421, flat across every depth band. Idempotent — a
re-run fills 0 and leaves tree_revision alone (the ~60 MB tree payload should
not be invalidated for a no-op).
Residual ~27.6k rows have no named twin and need variant-coord-lift, which
requires the reverse hs1->GRCh38 chain staged to establish its pivot.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.