[Exchange] Backfill gene_expression_context for top 20 hypotheses done

← Exchange
138 of 149 hypotheses are missing gene_expression_context. This task enriches the top 20 by composite_score with Allen Brain Atlas gene expression data, linking target genes to brain region expression patterns relevant to Alzheimer's disease. ## REOPENED TASK — CRITICAL CONTEXT This task was previously marked 'done' but the audit could not verify the work actually landed on main. The original work may have been: - Lost to an orphan branch / failed push - Only a spec-file edit (no code changes) - Already addressed by other agents in the meantime - Made obsolete by subsequent work **Before doing anything else:** 1. **Re-evaluate the task in light of CURRENT main state.** Read the spec and the relevant files on origin/main NOW. The original task may have been written against a state of the code that no longer exists. 2. **Verify the task still advances SciDEX's aims.** If the system has evolved past the need for this work (different architecture, different priorities), close the task with reason "obsolete: " instead of doing it. 3. **Check if it's already done.** Run `git log --grep=''` and read the related commits. If real work landed, complete the task with `--no-sha-check --summary 'Already done in '`. 4. **Make sure your changes don't regress recent functionality.** Many agents have been working on this codebase. Before committing, run `git log --since='24 hours ago' -- ` to see what changed in your area, and verify you don't undo any of it. 5. **Stay scoped.** Only do what this specific task asks for. Do not refactor, do not "fix" unrelated issues, do not add features that weren't requested. Scope creep at this point is regression risk. If you cannot do this task safely (because it would regress, conflict with current direction, or the requirements no longer apply), escalate via `orchestra escalate` with a clear explanation instead of committing.

Completion Notes

Auto-completed by supervisor after successful deploy to main

Git Commits (6)

[Exchange] Work log: PG compat fix + backfill run 2026-04-20 [task:a320aaa1-bbf3-452f-ad5b-118ad721c3d3]2026-04-20
[Exchange] Fix PG compat in backfill_gex_top20: remove sqlite3 row factory and PRAGMA/IMMEDIATE [task:a320aaa1-bbf3-452f-ad5b-118ad721c3d3]2026-04-20
[Forge] backfill_gex_top20_a320aaa1.py: fix PostgreSQL compatibility [task:5b88ec15-2824-432e-9d49-eb34e2c92cfe]2026-04-20
[Exchange] Work log: PG compat fix + backfill run 2026-04-20 [task:a320aaa1-bbf3-452f-ad5b-118ad721c3d3]2026-04-20
[Exchange] Fix PG compat in backfill_gex_top20: remove sqlite3 row factory and PRAGMA/IMMEDIATE [task:a320aaa1-bbf3-452f-ad5b-118ad721c3d3]2026-04-20
[Exchange] api.py: Add PATCH /api/hypotheses/{id}/gene-expression-context endpoint + backfill script for top 20 hypotheses2026-04-16
Spec File

[Exchange] Backfill gene_expression_context for top 20 hypotheses

ID: a320aaa1-bbf Priority: 88 Type: one_shot Status: open

Goal

138 of 149 hypotheses are missing gene_expression_context. This task enriches the top 20 by composite_score with Allen Brain Atlas gene expression data, linking target genes to brain region expression patterns relevant to Alzheimer's disease.

Acceptance Criteria

☐ Concrete deliverables created
☐ Work log updated with timestamped entry

Work Log

  • 2026-04-20 — Verified task re-opened: 359 of 747 hypotheses missing gene_expression_context. Pushed fixed backfill script (removed sqlite3.row_factory, PRAGMA busy_timeout, BEGIN IMMEDIATE — all SQLite/PG-incompatible patterns). Ran backfill: 2 of 20 top-scoring missing hypotheses enriched (TYROBP=h-f503b337, PVALB=h-7b7ab657). Remaining 18 lacked identifiable gene targets in current GENE_EXPRESSION_DATA dictionary. Total missing went from 359 to 357. Push forced to origin/orchestra/task/a320aaa1-backfill-gene-expression-context-for-top. Gene set covers: LRP1, GRIN2B, MTOR, MCOLN1, CHMP4B, PVALB, HFE, PARP1, C1QA, CLU, PINK1, PARK2, LRRK2, SLC16A1, ATG7, PIKFYVE, TYROBP, PLCG2, SYK, PPP3CB, TREM2, APOE, TFEB, IL1B, NFKB1, C3, C1QB.

Payload JSON
{
  "_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"
}

Sibling Tasks in Quest (Exchange) ↗