[Artifacts] Artifact version browser UI: timeline, diff view, provenance graph
Goal
Make artifact versioning visible and navigable in the web UI. Users should be able to see the full history of any artifact, compare versions, and trace provenance chains visually.
Components
1. Version Timeline Sidebar
A vertical timeline showing all versions of an artifact:
v3 (latest) ● 2026-04-05 [stable]
"Binding-affinity tuned"
v2 ● 2026-04-04
"Stability-optimized mutations"
v1 ● 2026-04-03
"Initial AlphaFold prediction"
- Each entry shows: version_number, version_tag (if set), created_at, changelog excerpt
- Click any version to view its detail
- Current version highlighted
- Compact by default, expandable
2. Version Diff View
Side-by-side comparison of two versions:
- Metadata field diffs highlighted (added=green, removed=red, changed=yellow)
- For protein designs: show mutation differences
- For models: show metric improvements/regressions
- For datasets: show schema changes, row count changes
- Use the
/api/artifact/{id}/diff/{other_id} endpoint
3. Provenance Graph
Interactive DAG visualization showing how artifacts relate:
- Reuse the
subgraph_widget_html() pattern from the KG viewer
- Nodes = artifacts (colored by type: paper=blue, dataset=green, model=purple, etc.)
- Edges = artifact_links (derives_from, supports, cites, etc.)
- Version numbers shown on nodes
- Click a node to navigate to its artifact page
- Use the
/api/analysis/{id}/provenance endpoint for analysis-centric views
4. Integration Points
- Artifact detail page: Add version timeline sidebar + provenance graph tab
- Analysis detail page: Add provenance DAG showing inputs → analysis → outputs
- Hypothesis page: Show linked artifacts with their versions
- Dataset page: Show derived tabular datasets and their versions
Technical Approach
- Server-side rendered HTML (matching existing SciDEX patterns — no React/Vue)
- JavaScript for interactive provenance graph (vis.js or d3.js, matching existing graph page)
- CSS consistent with existing scidex-dark theme
- Endpoints already defined in a17-20 and a17-24
Acceptance Criteria
☑ Version timeline sidebar renders on artifact detail pages
☑ Timeline shows version_number, tag, date, and changelog
☑ Clicking a version navigates to that version's detail
☑ Diff view shows metadata differences between two versions
☑ Provenance graph renders as interactive DAG
☑ Provenance graph nodes are colored by artifact type
☑ Provenance graph is navigable (click to follow links)
☑ Components work on analysis detail pages
☑ Consistent with existing SciDEX dark theme
☑ Work log updated with timestamped entry
Dependencies
- a17-20-VAPI0001 (version API endpoints)
- a17-24-REPR0001 (provenance DAG endpoint)
Dependents
- d16-20-AVER0001 (demo: versioned protein design showcase)
- d16-24-PROV0001 (demo: end-to-end provenance)
Work Log
2026-04-16 11:30 PT — Slot 0 (minimax:74)
- Implemented artifact_provenance_graph_html function (api.py:2339-2470): New D3 force-directed graph visualization for artifact provenance, reusing subgraph_widget_html pattern but adapted for artifact nodes (colored by artifact_type, links to /artifact/ pages)
- Enhanced artifact_detail page (api.py ~22181):
- Replaced simple provenance chain text list with interactive provenance DAG graph using artifact_provenance_graph_html
- Enhanced version timeline to show vertical timeline with clickable version nodes, version badges, and current version highlight
- Added version diff view with dropdown selectors to compare any two versions, showing metadata differences (added=green, removed=red, changed=yellow)
- Added provenance graph to analysis_detail_main (api.py ~34047):
- Fetches analysis provenance via artifact_registry.get_analysis_provenance()
- Displays interactive provenance DAG with workflow steps and reproducibility status
- Graph shows inputs → analysis → outputs lineage
- Modified page_template (api.py:3539) to accept optional extra_scripts parameter for injecting page-specific JavaScript
- Tested: python3 -m py_compile api.py → Syntax OK
- Commits: [Atlas] Artifact version browser UI: timeline, diff, provenance graph [task:a17-25-AVUI0001]