[Demo] Versioned artifact demo: create protein design with 3 iterations
Goal
Demonstrate the artifact versioning system with a concrete, visually compelling example: an engineered TREM2 protein variant for Alzheimer's disease, refined across three design iterations. This showcases protein_design artifact type, version creation, version diffing, and the version browser UI.
TREM2 Context
TREM2 (Triggering Receptor Expressed on Myeloid Cells 2) is a key receptor in microglial function. Variants like R47H increase AD risk. Engineering improved variants is an active research area — perfect for demonstrating iterative design.
Three Versions
v1: Initial AlphaFold Prediction
{
"artifact_type": "protein_design",
"title": "TREM2 Ectodomain Variant — AlphaFold Base",
"version_number": 1,
"version_tag": "initial",
"metadata": {
"uniprot_id": "Q9NZC2",
"method": "alphafold",
"sequence": "MEPLR...(truncated)...RDHPG",
"mutations": [],
"predicted_stability": 0.72,
"binding_affinity": {"target": "Aβ oligomers", "kd_nm": 850},
"plddt_score": 0.89,
"design_rationale": "Wild-type ectodomain structure as baseline for optimization"
}
}
v2: Stability-Optimized
{
"version_number": 2,
"version_tag": "stability-opt",
"changelog": "Introduced 3 stabilizing mutations from Rosetta energy minimization",
"metadata": {
"method": "rosetta_relax",
"mutations": ["T96S", "K186R", "A192V"],
"predicted_stability": 0.91,
"binding_affinity": {"target": "Aβ oligomers", "kd_nm": 780},
"delta_G_kcal": -2.3,
"design_rationale": "Rosetta-guided mutations to improve thermostability without disrupting binding interface"
}
}
v3: Binding-Affinity Tuned
{
"version_number": 3,
"version_tag": "binding-opt",
"changelog": "Interface mutations to enhance Aβ binding while maintaining stability gains",
"metadata": {
"method": "rosetta_interface_design",
"mutations": ["T96S", "K186R", "A192V", "H157Y", "R62W"],
"predicted_stability": 0.88,
"binding_affinity": {"target": "Aβ oligomers", "kd_nm": 120},
"delta_G_kcal": -1.8,
"design_rationale": "Interface residue optimization for enhanced Ab oligomer recognition. Slight stability trade-off accepted for 6.5x binding improvement."
}
}
Demo Walkthrough
Register v1 via register_artifact(artifact_type="protein_design", ...)
Create v2 via create_version(v1_id, ...) — verify v1.is_latest=FALSE
Create v3 via create_version(v2_id, ...)
Show get_version_history() returns all 3 versions ordered
Show diff_versions(v1, v3) highlighting mutations, stability, and binding changes
Render version timeline sidebar on the artifact page
Link all versions to existing TREM2-related hypotheses via artifact_linksAcceptance Criteria
☑ All 3 versions registered with correct lineage
☑ Version history shows ordered timeline
☑ Diff between v1 and v3 shows accumulated mutations and metric changes
☑ Version timeline sidebar renders on artifact page
☑ Versions linked to relevant TREM2 hypotheses
☑ Protein design metadata validates (sequence, mutations, stability, binding)
☑ Work log updated with timestamped entry
Dependencies
- a17-18-VERS0001 (version tracking schema)
- a17-19-TYPE0001 (protein_design artifact type)
- a17-20-VAPI0001 (create_version, get_history, diff APIs)
Work Log
2026-04-03 22:08 PT — Slot 20
- Started task: Create versioned TREM2 protein design demo
- Read spec and verified dependencies (a17-18-VERS0001, a17-19-TYPE0001, a17-20-VAPI0001) are all complete
- Examined artifact_registry.py: register_artifact, create_artifact_version, get_version_history, diff_versions functions exist
- Created
register_trem2_direct.py to register 3 versions via direct SQL (to avoid DB lock issues)
- Successfully registered all 3 versions:
- v1 (protein_design-c3b1f0e8-c85f-4f69-9cb5-2a7ffcf95edd): AlphaFold base
- v2 (protein_design-4d04635c-5ce4-4615-a10f-69e353daf16b): Stability-optimized (3 mutations)
- v3 (protein_design-05748b75-8d32-47b4-9981-210f56fba8eb): Binding-affinity tuned (5 mutations, 6.5x improvement)
- Linked to 5 existing TREM2 hypotheses
- Updated api.py:artifact_detail() to display version history timeline with:
- Version number, tag, changelog
- Current version highlighted
- Links to navigate between versions
- Ready to test after API restart
2026-04-04 05:09 PT — Slot 10
- Reacquired task lease after stale-task reap and validated spec scope against Quest 16 demo priorities.
- Reworked
register_trem2_direct.py into an idempotent demo loader with deterministic IDs (protein_design-trem2-demo-v1..v3), explicit version lineage, and derives_from links.
- Added hypothesis-linking logic to connect all 3 versions to top 5 existing TREM2 hypothesis artifacts through
artifact_links.
- Executed
timeout 300 python3 register_trem2_direct.py successfully: created all three versions and 15 hypothesis support links.
- Verified lineage via SQLite (
version_number 1→2→3, parent chain intact, only v3 is_latest=1).
- Verified API outputs:
-
/api/artifacts/protein_design-trem2-demo-v3/versions returns all three ordered versions.
-
/api/artifacts/protein_design-trem2-demo-v1/diff/protein_design-trem2-demo-v3 returns metadata/metric changes and version deltas.
-
http://localhost:8000/artifact/protein_design-trem2-demo-v3 returns 200 and contains
Version History,
stability-opt,
binding-opt, and
CURRENT.
- Core routes (
/,
/exchange,
/gaps,
/graph,
/analyses/,
/atlas.html,
/how.html,
/artifacts) return 200/301/302 as expected.
- Ran
timeout 300 python3 link_checker.py (required timeout wrapper): completed with pre-existing large broken-link inventory; results written to logs/link-check-latest.json.
2026-04-14 02:55 PT — Slot 54
- Critical bug fix:
get_version_history() was walking backward only (following parent_version_id chains), which correctly found ancestors but failed to find descendants. For TREM2 v1 (which has no parent, but has children v2→v3), the function returned only [v1] instead of [v1, v2, v3].
- Fix applied: Rewrote
get_version_history() in scidex/atlas/artifact_registry.py to:
1. Walk backward to find the root ancestor
2. Walk forward through children using
parent_version_id lookups
3. Collect all lineage IDs and fetch them ordered by
version_number
- Verified: Starting from any of the 3 TREM2 versions,
get_version_history() now returns all 3 versions in order (v1, v2, v3)
- Also verified:
diff_versions(v1, v3) correctly shows accumulated mutations (0→3→5) and binding affinity improvement (850nM→120nM, 7x)
- Committed:
[Atlas] Fix get_version_history to walk forward through children [task:d16-20-AVER0001] → 68a5e80f1
- Pushed:
git push origin HEAD --force-with-lease to orchestra/task/ce1f232d-push-main-race
- Root cause: The original implementation assumed version history meant "ancestors only" (parent chain). But SciDEX uses child references (
parent_version_id on the child pointing to parent) for forward lineage. The function was reversed in direction — it could find ancestors but not descendants.