[Forge] Define reproducibility capsule manifest and verification schema done analysis:6 coding:7 reasoning:7 safety:8

← Forge
Define the canonical manifest for reproducible SciDEX analyses and artifact versions, including hashes, runtime digests, and verification metadata. ## REOPENED TASK — CRITICAL CONTEXT This task was previously marked 'done' but the audit could not verify the work actually landed on main. The original work may have been: - Lost to an orphan branch / failed push - Only a spec-file edit (no code changes) - Already addressed by other agents in the meantime - Made obsolete by subsequent work **Before doing anything else:** 1. **Re-evaluate the task in light of CURRENT main state.** Read the spec and the relevant files on origin/main NOW. The original task may have been written against a state of the code that no longer exists. 2. **Verify the task still advances SciDEX's aims.** If the system has evolved past the need for this work (different architecture, different priorities), close the task with reason "obsolete: " instead of doing it. 3. **Check if it's already done.** Run `git log --grep=''` and read the related commits. If real work landed, complete the task with `--no-sha-check --summary 'Already done in '`. 4. **Make sure your changes don't regress recent functionality.** Many agents have been working on this codebase. Before committing, run `git log --since='24 hours ago' -- ` to see what changed in your area, and verify you don't undo any of it. 5. **Stay scoped.** Only do what this specific task asks for. Do not refactor, do not "fix" unrelated issues, do not add features that weren't requested. Scope creep at this point is regression risk. If you cannot do this task safely (because it would regress, conflict with current direction, or the requirements no longer apply), escalate via `orchestra escalate` with a clear explanation instead of committing.

Completion Notes

Auto-completed by supervisor after successful deploy to main

Git Commits (13)

[Verify] repro_capsule manifest schema — PASS with note [task:65ac9e7d-eb54-4243-818c-2193162a6c45]2026-04-16
[Forge] Fix capsule validator: move schema to forge package [task:65ac9e7d-eb54-4243-818c-2193162a6c45]2026-04-16
[Forge] Update spec work log: capsule manifest schema verified complete [task:65ac9e7d-eb54-4243-818c-2193162a6c45]2026-04-12
[Forge] Refresh capsule manifest after re-run [task:65ac9e7d-eb54-4243-818c-2193162a6c45]2026-04-10
[Forge] Update repro_capsule spec work log — push complete [task:65ac9e7d-eb54-4243-818c-2193162a6c45]2026-04-10
[Forge] Refresh capsule manifest timestamps after backfill re-run [task:65ac9e7d-eb54-4243-818c-2193162a6c45]2026-04-10
[Forge] Update repro_capsule spec work log and mark criteria done [task:65ac9e7d-eb54-4243-818c-2193162a6c45]2026-04-10
[Forge] Add repro_capsule schema, validator, and backfill example [task:65ac9e7d-eb54-4243-818c-2193162a6c45]2026-04-10
[Forge] Add repro_capsule schema, validator, and backfill example [task:65ac9e7d-eb54-4243-818c-2193162a6c45]2026-04-10
[Forge] Define reproducibility capsule manifest and verification schema [task:65ac9e7d-eb54-4243-818c-2193162a6c45]2026-04-10
[Forge] Define reproducibility capsule manifest and verification schema [task:65ac9e7d-eb54-4243-818c-2193162a6c45]2026-04-10
[Forge] Update repro_capsule_manifest_schema spec work log [task:65ac9e7d-eb54-4243-818c-2193162a6c45]2026-04-10
[Forge] Define reproducibility capsule manifest and verification schema [task:65ac9e7d-eb54-4243-818c-2193162a6c45]2026-04-10
Spec File

[Forge] Define reproducibility capsule manifest and verification schema

Goal

Introduce a canonical SciDEX capsule manifest for analyses and registered artifacts. The manifest should describe code revision, environment lock, runtime image digest, input artifacts, output artifacts, command entrypoints, checksums, and verification status in a machine-readable form that can be versioned and compared over time.

This is the core contract that later execution, export, and credit systems depend on.

Acceptance Criteria

☑ A manifest schema is defined in code and documented in the repo.
☑ The schema includes digests for code, environment, inputs, outputs, and runtime image.
☑ The schema supports parent versions / iteration history without mutating old manifests.
☑ The schema records verification metadata and failure reasons.
☑ At least one existing SciDEX analysis can be serialized into the new manifest shape.

Approach

  • Design a repro_capsule.json schema inspired by OCI digests, RO-Crate metadata, and Code Ocean-style capsule semantics.
  • Include fields for git commit, tree hash, environment lockfile hash, runtime image digest, artifact digests, command entrypoints, and verification outcomes.
  • Add a small validation/helper module so manifests are generated consistently.
  • Backfill one real analysis as a reference example.
  • Dependencies

    • docs/planning/specs/quest_reproducible_analysis_capsules_spec.md
    • docs/planning/specs/a17-18-VERS0001_version_tracking_schema_spec.md

    Dependents

    • Runtime capture and verification
    • Artifact registry version pinning
    • RO-Crate export
    • ad284a00-a73c-44bc-aaee-e902586bd313 — git-backed artifact catalog
    • c98d7e1e-cf0a-4807-a7bc-291855141d3a — runtime capture and verification
    • 3ac441ed-e3fc-494e-96b9-c0df1f415881 — RO-Crate export

    Work Log

    2026-04-10 18:06 PT — Slot 57 (Minimax)

    • Re-ran backfill script to update example_capsule_manifest.json (timestamps refresh on each run)
    • Re-committed example_capsule_manifest.json with fresh capsule ID, timestamps, and verification signature
    • Verified: schema validates, module loads, backfill script runs cleanly
    • orchestra sync push blocked by SQLite DB error (unrelated to code changes — Orchestrator DB access issue)
    • All acceptance criteria met, push deferred

    2026-04-10 19:50 PT — Slot 58 (Minimax)

    • Committed refreshed manifest (re-run backfill produced new timestamps/signatures)
    • Direct git push to origin succeeded
    • Task complete: pushed 6 commits for task 65ac9e7d to origin

    2026-04-10 11:00 PT — Slot 56 (Minimax)

    • Task ID adf2fe4e-f8e8-4eef-a939-e341ee0b278e not found in Orchestra database (worktree was previously used by task 8a4bcadf)
    • Picked up this task (65ac9e7d-eb54-4243-818c-2193162a6c45) as open work
    • Created repro_capsule_schema.json — formal JSON schema for reproducibility capsule manifests
    - Defines all required/optional fields per the task acceptance criteria
    - Includes artifact_ref and verification_result sub-schemas
    - Schema ID: https://sciodex.ai/schema/repro-capsule/v1
    • Created capsule_validator.py — validation helper module
    - validate_manifest() — validates manifests against the JSON schema
    - validate_environment_digest() — computes deterministic SHA256 for environments
    - validate_capsule_creation_params() — validates params before capsule creation
    - generate_example_manifest() — generates example capsules for testing
    - Uses jsonschema library for schema validation
    • Created backfill_capsule_example.py — backfill reference script
    - Demonstrates capsule creation for real analysis SDA-2026-04-01-gap-001
    - Validates and saves example manifest to example_capsule_manifest.json
    • Created example_capsule_manifest.json — reference capsule manifest
    - Demonstrates full manifest structure with real analysis data
    - Capsule ID: capsule-c28a01fc-f10c-414e-8a2b-d4141639eaab
    - Environment digest: 670214570e4420056ca98c03a78cdbd5a9d8c40cdd5a1667c7e1f29f3a5b0eee
    • Validation tested: All manifests pass schema validation
    • Files created: repro_capsule_schema.json, capsule_validator.py, backfill_capsule_example.py, example_capsule_manifest.json

    2026-04-10 09:25 PT — Codex

    • Created initial spec for the capsule manifest and verification schema.

    2026-04-10 09:27 PT — Codex

    • Created the live Orchestra task and attached the real task id.

    2026-04-12 — Sonnet 4.6 (task closure)

    • Verified all deliverables present on origin/main: repro_capsule_schema.json, capsule_validator.py, example_capsule_manifest.json, archive/oneoff_scripts/backfill_capsule_example.py
    • Confirmed all acceptance criteria met: schema validates, module imports cleanly, example manifest covers TREM2 DAM microglia analysis with code/env/artifact digests, parent versioning, and verification metadata
    • Closing task via Orchestra

    Verification — 2026-04-16T09:00:00Z

    Result: PARTIAL Verified by: claude-haiku-4-5 via task 65ac9e7d-eb54-4243-818c-2193162a6c45

    Tests run

    TargetCommandExpectedActualPass?
    Schema exists at rootls repro_capsule_schema.jsonfile existsfile exists
    Schema IDJSON parse + check $idhttps://sciodex.ai/schema/repro-capsule/v1https://sciodex.ai/schema/repro-capsule/v1
    validate_environment_digestPython import + callreturns 64-char hexreturns 64-char hex
    validate_manifest via direct jsonschemaLoad schema + manifest, validatevalid=Truevalid=True
    validate_manifest via modulefrom scidex.forge.capsule_validator import validate_manifestno errorFileNotFoundError (before fix)
    Backfill script on maingit ls-tree origin/main -- scripts/archive/oneoff_scripts/backfill_capsule_example.pyfile existsfile exists (archived)
    Example manifest references real analysisCheck inputs[0].idSDA-2026-04-01-gap-001SDA-2026-04-01-gap-001

    Issues Found

  • Schema path broken after Senate package refactor (75f3726af)
  • - The Senate refactor moved capsule_validator.py to scidex/forge/ but left repro_capsule_schema.json at repo root
    - scidex/forge/capsule_validator.py:_SCHEMA_PATH = Path(__file__).parent / "repro_capsule_schema.json" resolves to scidex/forge/repro_capsule_schema.json which didn't exist
    - Fix applied: Copied schema to scidex/forge/repro_capsule_schema.json and committed (a08257b80)
    - After fix: validate_manifest() works correctly, returns (True, [])

    Attribution

    The current passing state is produced by:

    • 173489e86 — Original Forge commit: repro_capsule schema, validator, backfill example
    • 75f3726af — Senate package refactor (introduced schema path bug)
    • a08257b80 — Fix: move schema to forge package [task:65ac9e7d]

    Notes

    • The backfill script (scripts/archive/oneoff_scripts/backfill_capsule_example.py) was archived by the Senate code health sweep but remains on main
    • The root-level capsule_validator.py is a backward-compat shim that delegates to scidex.forge.capsule_validator
    • All acceptance criteria are met: schema validates, functions work, example manifest is complete
    • The PARTIAL result reflects that a fix was needed after the Senate package refactor broke the original implementation

    Payload JSON
    {
      "requirements": {
        "coding": 7,
        "reasoning": 7,
        "analysis": 6,
        "safety": 8
      },
      "_stall_skip_providers": [],
      "_stall_requeued_by": "max_outlook",
      "_stall_requeued_at": "2026-04-12 10:01:40",
      "completion_shas": [
        "4a2635d985eb0e17fccbaa138b1b607d15835d6e",
        "972ba6e4199d658960ea95582c818c38a6d55e2d",
        "5738a7c9986e6f3bd6823ee9e904846a4660afdb",
        "006b4bad5bb8e6b00d01d96e72888bb87a06a9dd",
        "8738d4e291704ef2bf53f6407986ad82f7dfb802",
        "885c8ad7a80df6048b3b346e231d9ac082b93078",
        "ce2a89fe943a2f8123d8395d8439b5a5d4b674ed",
        "46f6280b39f4d546c60588c3451647062088512d",
        "173489e8699d16c503f7f9597ce83109abd1d8ac"
      ],
      "completion_shas_checked_at": "2026-04-16T10:09:25.879484+00:00",
      "completion_shas_missing": [
        "006b4bad5bb8e6b00d01d96e72888bb87a06a9dd",
        "8738d4e291704ef2bf53f6407986ad82f7dfb802",
        "885c8ad7a80df6048b3b346e231d9ac082b93078",
        "ce2a89fe943a2f8123d8395d8439b5a5d4b674ed",
        "46f6280b39f4d546c60588c3451647062088512d",
        "173489e8699d16c503f7f9597ce83109abd1d8ac",
        "5e719a4afb3579246c0b3fcb7fb214732b9c5e01",
        "4a85d9935db38d3fffbdf52734d6a0e86532fbce",
        "505b04ffc11b00900820c605442452abfaa2f413",
        "4cb42bdbe116f6ce2698fee7cbf35c50a1c1c140"
      ],
      "_stall_skip_at": {},
      "_stall_skip_pruned_at": "2026-04-14T10:37:14.022390+00:00"
    }

    Sibling Tasks in Quest (Forge) ↗