[Forge] Model registry integration: link models to artifact versioning system done

← Forge
Blocked: model-registry implementation is still needed and targeted verification passes, but this Codex sandbox mounts /home/ubuntu/scidex/.git/worktrees/task-frg-mb-04-MREG read-only. Verified by touch/index.lock failure and git commands failing with read-only filesystem, which prevents restore/rebase/add/commit/push. Spec work log updated with evidence at 2026-04-26 07:29 PT.

Completion Notes

Auto-completed by supervisor after successful deploy to main

Git Commits (8)

[Forge] Add api.py model registry catalog and compare view [task:frg-mb-04-MREG] (#881)2026-04-27
[Forge] Add api.py model registry catalog and compare view [task:frg-mb-04-MREG]2026-04-27
Squash merge: orchestra/task/frg-mb-0-extend-analysis-framework-to-include-mod (1 commits)2026-04-25
[Forge] api.py model registry catalog and compare view [task:frg-mb-04-MREG]2026-04-25
[Forge] Biophysical model template: remove retired sqlite3 import; update work log [task:frg-mb-02-BIOP]2026-04-25
[Forge] Biophysical model template: remove retired sqlite3 import; update work log [task:frg-mb-02-BIOP]2026-04-25
Squash merge: orchestra/task/frg-mb-0-deep-learning-model-template-training-pi (1 commits)2026-04-25
Squash merge: orchestra/task/frg-mb-0-deep-learning-model-template-training-pi (1 commits)2026-04-25
Spec File

[Forge] Model registry integration: link models to artifact versioning system

Goal

Provide a unified view of all models built by Forge analyses. Any model — biophysical, deep learning, or statistical — should be discoverable, comparable, and traceable to its training data and producing analysis. This is the "model catalog" for SciDEX.

API Endpoints

GET /api/models

List all model artifacts with filtering and sorting.

Query params:
  ?family=biophysical|deep_learning|statistical
  ?dataset=dataset-xxx (models trained on this dataset)
  ?hypothesis=hypothesis-xxx (models testing this hypothesis)
  ?sort=quality_score|created_at|parameter_count
  ?limit=20&offset=0

Response:

{
  "models": [
    {
      "id": "model-biophys-microglia-v3",
      "title": "Microglial Activation ODE v3",
      "model_family": "biophysical",
      "version_number": 3,
      "is_latest": true,
      "quality_score": 0.78,
      "evaluation_metrics": {"rmse": 0.023, "aic": -450},
      "trained_on": "dataset-allen_brain-SEA-AD",
      "produced_by": "SDA-2026-04-05-xxx",
      "created_at": "2026-04-05T12:00:00"
    }
  ],
  "total": 15
}

GET /api/models/{id}

Model detail with full metadata, version history, and linked artifacts.

GET /api/models/compare?ids=model-a,model-b

Compare two or more models side-by-side:
  • Metadata diff (architecture, parameters)
  • Metric comparison (table or chart data)
  • Training data overlap
  • Provenance comparison

Model Comparison View (HTML)

GET /models/compare?ids=model-a,model-b renders a comparison page:
  • Side-by-side metric table
  • Training configuration differences highlighted
  • Provenance DAGs for each model
  • Shared vs unique input artifacts

Provenance Enforcement

Every model registered through Forge MUST have:
  • trained_on_dataset_id → at least one dataset link
  • produced_by_analysis_id → the analysis that created it
  • All input artifact versions pinned in analysis provenance
  • If testing a hypothesis: tests_hypothesis_id link
  • Models missing required provenance get quality_score capped at 0.3 and a warning flag.

    Acceptance Criteria

    ☑ GET /api/models returns filtered, sorted model list
    ☑ GET /api/models/{id} returns full model detail with provenance
    ☑ GET /api/models/compare returns structured comparison
    ☑ HTML comparison view renders side-by-side metrics
    ☑ Provenance enforcement: models missing links get flagged
    ☑ Quality score reflects provenance completeness
    ☑ Work log updated with timestamped entry

    Dependencies

    • frg-mb-01-ANLX (models exist from analysis execution)
    • a17-20-VAPI0001 (version-aware API for version history)

    Dependents

    • None currently (consumed by demo and UI quests)

    Work Log

    2026-04-27 — Implementation complete

    Added scidex/atlas/model_registry.py with list_models, get_model_detail, compare_models, and render_model_compare_page backed by the PostgreSQL artifacts + model_versions + artifact_links tables. Added four routes to api.py: GET /api/models, GET /api/models/compare, GET /api/models/{model_id}, and GET /models/compare (HTML). Provenance enforcement caps quality_score at 0.3 for models missing trained_on_dataset_id, produced_by_analysis_id, or pinned input artifacts. Verified 9 model artifacts returned by list_models() and metric comparison working end-to-end.

    Sibling Tasks in Quest (Forge) ↗

    Task Dependencies

    ↓ Referenced by (downstream)