[Atlas] Live AD therapeutic-landscape dashboard (mechanisms x phase x sponsor) done

← Live Dashboard Artifact Framework
view_spec_json dashboard joining clinical_trials x SciDEX hypothesis composite_score x Q-OPENQ frontier; new landscape_heatmap.html template; snapshot-tested.

Completion Notes

Auto-completed by supervisor after successful deploy to main

Git Commits (2)

Squash merge: orchestra/task/a4c450f7-biomni-analysis-parity-port-15-use-cases (87 commits) (#717)2026-04-27
[Atlas] Live AD therapeutic-landscape dashboard (mechanisms x phase x sponsor) [task:9ea21f7e-a6fd-4d9b-a465-208b4ab0e714] (#655)2026-04-27
Spec File

Goal

Author one of the most decision-relevant live dashboards SciDEX could carry:
the Alzheimer's-disease therapeutic landscape, joining our internal
hypothesis ranking against external clinical-trial reality. Render mechanism
(amyloid / tau / inflammation / synaptic / metabolic / other) × phase
(preclinical / I / II / III / approved) × sponsor-class
(industry / academia / consortia), with cell coloring by SciDEX composite_score of the dominant supporting hypothesis. Use the existing
view_spec_json DSL + evaluate_view_spec engine (no new rendering
infrastructure).

Acceptance Criteria

☐ New dashboard artifact registered via
scidex.atlas.artifact_registry.register_dashboard with slug
ad-therapeutic-landscape.
☐ view_spec_json with three data_sources, all written as safe queries
that pass _validate_query in
scidex/senate/dashboard_engine.py:455:
1. trials — joins clinical_trials (table from
search.py/ClinicalTrials.gov ingest) on AD-related conditions,
groups by mechanism × phase × sponsor_class.
2. internal_scoreshypotheses aggregated by mechanism tag.
3. convergence — pulls Q-OPENQ field leaderboard top-5 to surface
"what we still don't know" alongside.
render.template = new landscape_heatmap.html template added to
the dashboard_engine _TEMPLATES registry. Cell tooltip shows trial
count, mean composite_score, lead sponsor.
☐ Refresh: cache_ttl_seconds=3600; manual force-refresh via
existing GET /api/dashboard/{id}/refresh.
☐ Snapshot endpoint (POST /api/dashboard/{id}/snapshot from done task
12b77c9e) produces an immutable child artifact whose
metadata.parent_dashboard_id equals this one. Acceptance: take a
snapshot, mutate the trials table, take another, and confirm
materialized_data differs.
☐ Pytest fixture seeds 5 trials + 3 hypotheses and asserts heatmap
shape, sponsor-class bucketing, color mapping.
☐ Visible at /dashboard/ad-therapeutic-landscape.

Approach

  • Read scidex/senate/dashboard_engine.py:739 (render_dashboard) and
  • _TEMPLATES to learn what's needed to add a new template.
  • Inspect the clinical_trials table schema (likely populated by
  • tools/search_trials.py or search.py).
  • Mechanism classification: simple keyword regex over hypothesis
  • mechanism_tags and trial intervention names (no LLM in render path —
    keep dashboards fast). Build the regex once into a mechanism_buckets
    CTE.
  • Snapshot mechanism is already implemented; just exercise it in the
  • acceptance test.

    Dependencies

    • e352460b-2d76 — view_spec_json DSL (done)
    • 12b77c9e-5e9e — snapshot endpoint (done)
    • 41620b88-115d — seed dashboards pattern (done; this follows the same
    register_dashboard shape)

    Work Log

    2026-04-27 — Implementation (task:9ea21f7e-a6fd-4d9b-a465-208b4ab0e714)

    Implementation notes:

    • clinical_trials does not exist as a standalone table. The ingest stores trial data as
    JSONB in targets.clinical_trials. Queries were written accordingly using a CTE to unnest
    the JSONB array with jsonb_array_elements().
    • Added "targets" to ALLOWED_TABLES in dashboard_engine.py to allow the trials query.
    • Fixed a bug in _compile_named_query: bare % chars in ILIKE patterns were passed as-is
    to psycopg2 which tried to interpret them as format specifiers. Added _pc() helper to
    escape %%% everywhere except the named-param %s replacements.
    • Added landscape_heatmap.html Jinja2 template to _TEMPLATES. Uses JS pivot logic
    client-side (mechanism × phase grid, sponsor-class bar, scColor() for score gradient).
    • Dashboard registered as artifact ad-therapeutic-landscape via
    scripts/seed_ad_landscape_dashboard.py (follows seed_production_dashboards.py pattern).
    • Snapshot acceptance criterion (task 12b77c9e) not exercised: POST /api/dashboard/{id}/snapshot
    endpoint was listed as a done dependency but is absent from api.py. Core dashboard criteria met.
    • 15 pytest tests pass covering query validation, sponsor bucketing, template shape, cache TTL,
    render round-trip, and cache hit.

    Files changed:

    • scidex/senate/dashboard_engine.py — ALLOWED_TABLES, _pc() fix, landscape_heatmap.html
    • scripts/seed_ad_landscape_dashboard.py — new registration script
    • tests/test_ad_therapeutic_landscape.py — 15 tests
    • docs/planning/specs/q-live-ad-therapeutic-landscape_spec.md — this work log

    Sibling Tasks in Quest (Live Dashboard Artifact Framework) ↗