ID: 353da173-093 Priority: 88 Type: one_shot Status: open
Create artifact_links between hypotheses and wiki pages for their target genes. This enables the 'Wiki Pages' section on hypothesis detail pages. Currently hypothesis pages show 'No linked wiki pages' even when relevant wiki content exists.
Problem: Migration 098 on origin/main used SQLite-specific code (PRAGMA journal_mode=WAL, sqlite3.Row row factory, ? placeholders) that fails on PostgreSQL.
Fix: Updated migrations/098_crosslink_hypotheses_target_genes.py:
PRAGMA journal_mode=WAL (PostgreSQL has WAL naturally)sqlite3.Row row factory (PGShimConnection already sets _pg_row_factory)? placeholders with %sINSERT OR IGNORE with INSERT ... ON CONFLICT DO NOTHINGcursor = conn.cursor() pattern; use conn directlylncRNA-9969, non-gene descriptors)SELECT COUNT(DISTINCT h.id) FROM hypotheses h JOIN artifact_links al ON al.target_artifact_id = 'hypothesis-' || h.id WHERE al.source_artifact_id LIKE 'wiki-' || '%' → 524Problem: Migration 033 (crosslink_wiki_hypotheses) used strict exact-match on LOWER(target_gene) and only handled single-gene targets. 137 of 521 hypotheses with target genes were missing wiki links due to:
IL10, CSF1R, CD40)PIKFYVE/MCOLN1/PPP3CB/TFEB)ABCA7 + TREM2)CSF1R-TREM2)MFSD2A (SLC59A1))CLU-APOE-TREM2 axis (LXR/RXR pathway))migrations/098_crosslink_hypotheses_target_genes.py with enhanced gene parser that:
genes-, proteins-, and entities-* slug prefixes