[Atlas] Add origin badges to artifact detail pages

← All Specs

[Atlas] Add origin badges to artifact detail pages

Goal

Complete the origin tracking showcase (d16-27-ORIG0001) by adding INTERNAL/EXTERNAL origin badges to the artifact detail page at /artifacts/{id}. The origin_type and origin_url columns already exist in the artifacts table — this task adds the frontend rendering.

Background

The artifacts table has:

  • origin_type TEXT — 'internal' or 'external'
  • origin_url TEXT — URL for external artifacts (e.g., PubMed URL for papers)

The artifact_registry.py stores _origin in metadata with type and url fields.

The artifact detail page at GET /artifacts/{artifact_id} currently shows artifact metadata but does NOT display origin badges. The d16-27-ORIG0001 demo spec requires:

  • Side-by-side internal vs external artifact cards
  • Origin badges (🔵 INTERNAL / 🟢 EXTERNAL) on artifact cards
  • Mixed provenance chain DAG with origin badges on each node

Approach

Step 1: Inspect existing artifact detail page

Find the HTML generation for /artifacts/{artifact_id} in api.py and understand where to add origin badge rendering.

Step 2: Add origin badge HTML

Add an origin badge section above the artifact metadata card:

<div class="origin-badge origin-{origin_type}">
  {INTERNAL or EXTERNAL} · {origin_url if present}
</div>

Style it to be visible but secondary — a small colored chip at the top.

Step 3: Verify with existing artifacts

Test with an internal artifact (e.g., model-9ccc79de-a12a-42b7-830c-90e9c61cd087) and an external artifact (e.g., any paper artifact) to confirm badges render correctly.

Acceptance Criteria

☐ Internal artifacts show "INTERNAL" badge in a neutral/blue style
☐ External artifacts show "EXTERNAL" badge in a green style with origin URL
☐ Origin badges visible on artifact detail page at /artifacts/{id}
☐ Origin URL is clickable for external artifacts (opens in new tab)
☐ Badges consistent with SciDEX dark theme
☐ No regression: existing artifact page content still renders correctly
☐ Work log updated

Dependencies

  • a17-26-ORIG0001 (origin tracking columns and backfill) — already done
  • d16-25-DPAP0001 (authored paper) — already done, provides internal artifact example

Dependents

  • d16-27-ORIG0001 (origin tracking showcase — needs badges on artifact pages)

Work Log

_Not started yet_

File: e90797ac_p85_origin_tracking_spec.md
Modified: 2026-05-01 20:13
Size: 2.7 KB