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{
"_reset_note": "This task was reset after a database incident on 2026-04-17.\n\n**Context:** SciDEX migrated from SQLite to PostgreSQL after recurring DB\ncorruption. Some work done during Apr 16-17 may have been lost.\n\n**Before starting work:**\n1. Check if the task's goal is ALREADY satisfied (run the relevant checks)\n2. Check `git log --all --grep=task:YOUR_TASK_ID` for prior commits\n3. If complete, verify and mark done. If partial, continue. If not done, proceed.\n\n**DB change:** SciDEX now uses PostgreSQL. `get_db()` auto-detects via\nSCIDEX_DB_BACKEND=postgres env var.",
"_reset_at": "2026-04-18T06:29:22.046013+00:00",
"_reset_from_status": "done"
}