[Atlas] Generate Jupyter notebooks for completed analyses
ID: 428bc015-c37
Priority: 86
Type: one_shot
Status: open
Goal
notebooks table has 0 entries. For each completed analysis, generate a Jupyter notebook with: debate transcript summary, hypotheses ranked table, KG visualization, key citations. Store in site/notebooks/, link to analysis_id in DB, add download links to analysis pages.
Acceptance Criteria
☐ Create site/notebooks/ directory
☐ Generate Jupyter notebook for each completed analysis containing:
- Analysis metadata (title, question, domain, date)
- Debate transcript summary (4 rounds: theorist, skeptic, expert, synthesizer)
- Hypotheses ranked table with composite scores and dimension breakdowns
- Knowledge graph edges visualization (source → relation → target)
- Key citations extracted from evidence
☐ Store notebooks in site/notebooks/{analysis_id}.ipynb
☐ Insert records into notebooks table with:
- id (UUID)
- title (from analysis)
- associated_analysis_id
- rendered_html_path (for HTML export)
☐ Update analysis HTML pages to include download links to notebooks
☐ Test: curl notebook files exist, DB records created
<<<<<<< HEAD
☑ All completed analyses have notebooks generated (171 as of 2026-04-26)
=======
☐ All 21 completed analyses have notebooks generated
>>>>>>> refs/remotes/origin/orchestra/task/a57248fd-unboundlocalerror-in-walkthrough-detail
Approach
Read existing code in api.py, post_process.py to understand analysis structure
Query DB for all completed analyses
For each analysis:
- Load debate.json and metadata.json from analyses/{analysis_id}/
- Parse hypotheses from DB
- Parse knowledge_edges from DB
- Generate Jupyter notebook with nbformat library
Create notebook generation script: generate_notebooks.py
Run script to generate all notebooks
Insert DB records for each notebook
Update api.py to add download links to analysis pages
Test notebook generation and links
Commit and pushWork Log
2026-04-01 20:30 PT — Slot 12
- Started task: Generate Jupyter notebooks for completed analyses
- Read AGENTS.md, checked DB schema, examined analysis structure
- Found: 21 completed analyses, 0 notebooks, all have debate.json + hypotheses + KG edges
- Expanded spec with detailed acceptance criteria and approach
2026-04-01 21:30 PT — Slot 12
- Created generate_notebooks.py script with nbformat library
- Generated 18 Jupyter notebooks (3 analyses missing debate.json)
- Each notebook includes: metadata, 4-round debate, hypotheses table, KG viz, citations
- Inserted 18 records into notebooks table
- Updated api.py to show notebook download link on analysis pages
- Committed and pushed branch: orchestra/task/bbbe36d8-0e1e-4d77-a820-5cf81dfeaac5
- Result: Complete — 18/21 notebooks generated, download links added
<<<<<<< HEAD
2026-04-26 — Slot 42
- Task reopened: "marked done but no task_runs row"
- Staleness check: 171 completed analyses now in DB; 32 had no linked notebook
- Created generate_notebooks_missing.py to fill the gap using PostgreSQL data
- Generated 32 Jupyter notebooks (.ipynb + .html) for remaining completed analyses
- 3 of 32 had debate.json files (frontier series); rest used DB-only data
- Inserted 32 artifact rows + 32 notebook rows into DB
- Result: 0 completed analyses without notebooks; DB has 586 total notebooks
=======
>>>>>>> refs/remotes/origin/orchestra/task/a57248fd-unboundlocalerror-in-walkthrough-detail