[Atlas] Add mermaid diagrams to 10 wiki entity pages done

← Atlas
Many wiki entities lack mermaid diagrams, leaving entity pages less useful for mechanism inspection. Verification: - 10 wiki entities gain substantive mermaid_diagram content - Diagrams encode real relationships already present in KG or citations - Generated diagrams render without Mermaid syntax errors Start by reading this task's spec. Pick high-degree or high-traffic wiki entities from PostgreSQL (dbname=scidex user=scidex_app) without diagrams. Use existing KG edges and cited evidence to build compact diagrams. Validate Mermaid syntax and update the wiki entity records.
Spec File

Goal

Add substantive mermaid diagrams to wiki entities that still lack mechanism or relationship visualizations. Diagrams should encode real KG or citation-backed relationships, not decorative placeholders.

Acceptance Criteria

☑ A concrete batch of wiki entities gains non-empty mermaid_diagram content
☑ Diagrams reflect existing KG edges, cited mechanisms, or documented relationships
☑ Mermaid syntax is validated before completion
☑ Before/after missing-diagram counts are recorded

Approach

  • Select high-value entities where mermaid_diagram IS NULL OR mermaid_diagram = ''.
  • Gather KG edges, entity metadata, and citation context.
  • Write compact mermaid diagrams showing relationships or pathways.
  • Validate syntax and verify the updated rows.
  • Dependencies

    • 415b277f-03b - Atlas quest

    Dependents

    • Entity pages, wiki navigation, and Atlas visualization quality

    Work Log

    2026-04-20 - Quest engine template

    • Created reusable spec for quest-engine generated wiki mermaid diagram tasks.

    2026-04-21 13:54 PT - Slot codex:53

    • Started task 30edcd20-c8b0-42ea-9d12-59e5b23636bc in worktree orchestra/task/30edcd20-add-mermaid-diagrams-to-10-wiki-entity-p.
    • Obsolescence check: current PostgreSQL wiki_entities has 18 rows with null/empty mermaid_diagram; prior task 8d3dc7eb added 12 diagrams but did not exhaust the remaining queue.
    • Plan: add a deterministic curated script for 10 remaining biomedical entities, validate each diagram with scidex.atlas.validate_mermaid.validate_mermaid, apply through save_wiki_entity(), then record before/after counts and spot checks.

    2026-04-21 14:04 PT - Slot codex:53

    • Added mermaid/add_curated_mermaid_batch_30edcd20.py with 10 citation/KG-grounded diagrams for Addiction, adenosine, Brainstem, cardiovascular disease, Encephalitis, frontotemporal, Neural Stem Cell, Schwann Cell, SEMAGLUTIDE, and Spinal Cord Injury.
    • Dry-run validation passed for all 10 diagrams with before count 18 missing wiki_entities.mermaid_diagram rows.
    • Applied the batch through save_wiki_entity() with source mermaid.add_curated_mermaid_batch_30edcd20; before/after missing count: 18 -> 8.
    • Verified all 10 updated rows have flowchart TD diagrams, lengths 437-518 chars, and validate_mermaid() returned valid=True with no issues for each row.
    • Confirmed 10 db_write_journal rows for this task/source and spot-checked GET /api/atlas/entity/Addiction -> HTTP 200 with wiki.mermaid_diagram length 514.

    2026-04-22 14:15 UTC - Slot minimax:74 (task 2900f0ab)

    • Obsolescence check: verified task is already resolved by task 30edcd20.
    • Evidence: wiki_entities has 14,284 of 14,287 rows with non-null mermaid diagrams; only 3 remain without (empty-name artifacts, not in scope).
    • Spot-checked 10 entities via API: all confirmed flowchart TD with lengths 437-518 chars.
    • Prior work log from 30edcd20 at commit 8373b948e already covered this; no duplicate work needed.
    • Source batch: mermaid/add_curated_mermaid_batch_30edcd20.py (10 entities).

    Sibling Tasks in Quest (Atlas) ↗