[Demo] Add mermaid pathway diagrams to hypothesis detail pages

← All Specs

[Demo] Add mermaid pathway diagrams to hypothesis detail pages

ID: 0d1af4f7-008 Priority: 96 Type: one_shot Status: done

Goal

Add interactive mermaid.js pathway diagrams showing disease mechanism cascades on hypothesis detail pages. Each hypothesis with a target_pathway or target_gene should display a relevant pathway diagram. This is D-PRIORITY for Quest 16 (Demo Showcase) and Quest 2 (Exchange).

Acceptance Criteria

☐ Concrete deliverables created
☐ Work log updated with timestamped entry

Work Log

2026-04-23 15:49Z - Codex

  • Read AGENTS.md, CLAUDE.md, alignment-feedback-loops.md, landscape-gap-framework.md, and current hypothesis detail rendering code.
  • Obsolescence check: hypothesis detail pages already had Mermaid infrastructure and stored pathway diagrams in PostgreSQL, but the route only rendered stored diagrams beginning with graph; current backfilled diagrams commonly begin with flowchart TD, so those valid diagrams were silently skipped.
  • Implemented a targeted api.py fix to normalize fenced Mermaid source first and accept both graph and flowchart syntax for the Curated Mechanism Pathway block.
  • Added regression coverage in tests/test_hypothesis_pathway_diagrams.py for a live flowchart pathway diagram rendering on /hypothesis/{id}.

2026-04-23 16:12Z - Codex

  • Verified local PostgreSQL data includes 1004 targeted hypotheses, 667 stored pathway diagrams, and 310 flowchart diagrams affected by the previous guard.
  • Tested: pytest -q tests/test_hypothesis_pathway_diagrams.py passed (1 test, warnings only).

Already Resolved — 2026-04-23 17:05Z

  • Evidence: pytest -q tests/test_hypothesis_pathway_diagrams.py passed (1 test)
  • Commit: 6f2f76425 ([Demo] Render flowchart pathway diagrams on hypotheses [task:0d1af4f7-0084-4c5e-88df-5fc472934fe0]), merged as dd89155a9
  • Summary: Fix normalizes fenced Mermaid source and accepts both graph and flowchart syntax for pathway diagrams.

Verification — 2026-04-23 18:38Z

  • Evidence: git fetch origin main → already at 2ab493fd6 (same commit). pytest -q tests/test_hypothesis_pathway_diagrams.py → 1 passed.
  • Confirmed: task resolved, no further work needed. Worktree is clean (only .orchestra-slot.json modified by slot machinery).

Verification — 2026-04-23 19:10Z

  • Evidence: git fetch origin main → HEAD at 38360637e. pytest -q tests/test_hypothesis_pathway_diagrams.py → 1 passed in 54s. Test file exists on main.
  • Confirmed: task resolved, no further work needed.

Tasks using this spec (1)
[Demo] Add mermaid pathway diagrams to hypothesis detail pag
Demo failed P96
File: 0d1af4f7_008_spec.md
Modified: 2026-04-25 23:40
Size: 2.5 KB