# SPARTAN Sample Capsule v0.1 — Verify It Yourself

This bundle is a working, locally-verifiable demonstration of the SPARTAN Evidence Capsule v0.1 product loop. It exists so you can verify, on your own machine, what `spartan capsule build` / `verify` / `view` actually produce — without installing SPARTAN, running a scanner, or trusting Higgs AI.

## What this demo IS

- A real SPARTAN Evidence Capsule v0.1 archive (`evidence.tar.gz`), built from a real SPARTAN validation run against a small intentionally-vulnerable demo repository (`examples/demo-repo` in the SPARTAN source tree).
- The static HTML report (`report.html`) that `spartan capsule view` produces from that capsule. The producer's absolute filesystem path has been replaced with the bundle-relative path `dist/spartan-sample-capsule-v0.1/evidence.tar.gz` so the artifact is safe to share publicly; everything else is the renderer's literal output.
- The terminal output of `spartan capsule verify` against the capsule (`verify-output.txt`), with the same path substitution applied. All level outcomes, hashes, and event identifiers are the renderer's literal output.
- The SARIF v2.1.0 export (`findings.sarif`) that `spartan capsule sarif` produces from the capsule. This is the same finding set rendered into the OASIS Standard SARIF format. It is consumable by GitHub code scanning (uploaded via the code-scanning REST API or an Actions workflow), opened in viewer-style tools like VS Code's SARIF Viewer or Microsoft's Sarif Multitool, or inspected directly as JSON. Every `result.level` is `"note"`; risk and evidence-tier information is in `result.properties` rather than the SARIF level field, by design.
- The claims and non-claims SPARTAN makes about Capsule v0.1 (`CLAIMS_AND_NON_CLAIMS.md`).
- A manifest of the bundle's files with sizes and SHA-256 hashes (`MANIFEST.json`).

## Download the bundle as one file

The full bundle is also available as a single downloadable archive:

- `spartan-sample-capsule-v0.1.zip` — contains exactly eight files: `index.html`, `report.html`, `evidence.tar.gz`, `findings.sarif`, `verify-output.txt`, `README_VERIFY_IT_YOURSELF.md`, `CLAIMS_AND_NON_CLAIMS.md`, and `MANIFEST.json`.

Verification is two steps:

1. **The on-disk `MANIFEST.json` verifies the zip.** A recipient who downloaded only the zip checks its SHA-256 against the `wrapper_archive.sha256` field of the canonical `MANIFEST.json` hosted in the SPARTAN source tree (under `dist/spartan-sample-capsule-v0.1/MANIFEST.json`). Do this before unzipping:

   ```bash
   shasum -a 256 spartan-sample-capsule-v0.1.zip
   # Compare against `wrapper_archive.sha256` in the on-disk MANIFEST.json.
   ```

2. **The in-zip `MANIFEST.json` verifies the seven sibling files.** After unzipping, the in-zip `MANIFEST.json`'s `files[]` array carries size and SHA-256 for the seven non-MANIFEST files (`index.html`, `report.html`, `evidence.tar.gz`, `findings.sarif`, `verify-output.txt`, `README_VERIFY_IT_YOURSELF.md`, `CLAIMS_AND_NON_CLAIMS.md`). The in-zip MANIFEST does not hash itself and does not carry a `wrapper_archive` block — those concerns belong to the on-disk MANIFEST, which is the canonical reference for the zip's identity.

## What this demo IS NOT

- **Not production customer evidence.** The repository scanned is a synthetic demo, not a real codebase or product.
- **Not a signed artifact.** Evidence Capsule v0.1 is unsigned. Verification reports `SIGNATURE: NOT_PRESENT`.
- **Not a replay-bearing artifact.** The capsule does not carry runtime artifacts and cannot be re-executed against the original repository state. Verification reports `REPLAY: NOT_PRESENT`.
- **Not a compliance certification.** SPARTAN packages evidence; compliance is a separate process.
- **Not a claim that `examples/demo-repo` is safe.** The repository is intentionally vulnerable; the findings are real.
- **Not a vulnerability scanner replacement.** SPARTAN is the evidence layer that sits *next to* scanners; it is not itself a scanner.

## Verify it yourself (Node 20+, no network required)

If you have a SPARTAN checkout on the same machine you can verify and re-render the bundle:

```bash
# 1. Verify the capsule. All three supported levels should PASS.
#    SIGNATURE and REPLAY should report NOT_PRESENT.
spartan capsule verify evidence.tar.gz

# 2. Render the HTML report locally. Compare with the bundled report.html.
spartan capsule view evidence.tar.gz --format html --out my-report.html

# 3. Export findings as SARIF v2.1.0. Compare with the bundled findings.sarif.
#    `spartan capsule sarif` only emits when verify returns ok:true.
spartan capsule sarif evidence.tar.gz --out my-findings.sarif
```

Without a SPARTAN checkout, you can still:

- Read the bundled `report.html` directly in any browser. It is static HTML with no JavaScript and no external assets.
- Read `verify-output.txt` to see the literal output of `spartan capsule verify`.
- Inspect `findings.sarif` directly as JSON, open it in a viewer-style tool such as VS Code's SARIF Viewer or Microsoft's Sarif Multitool, or upload it to GitHub code scanning via the code-scanning REST API or an Actions workflow.
- Recompute file hashes against `MANIFEST.json` with any standard SHA-256 tool (e.g., `shasum -a 256 evidence.tar.gz` on macOS/Linux).

## Expected outcomes

`spartan capsule verify evidence.tar.gz` should report:

| Level          | Expected outcome |
|----------------|------------------|
| `STRUCTURE`    | `PASS`           |
| `REDACTION`    | `PASS`           |
| `AUDIT_DIGEST` | `PASS`           |
| `SIGNATURE`    | `NOT_PRESENT`    |
| `REPLAY`       | `NOT_PRESENT`    |

Overall: `ok: true`.

The bundled `verify-output.txt` is the output of this command on the machine that built the bundle, with the producer's absolute filesystem path replaced by the bundle-relative path `dist/spartan-sample-capsule-v0.1/evidence.tar.gz` so the artifact is safe to share publicly. All level outcomes, hashes, schema identifiers, and event identifiers are the verifier's literal output and should match yours exactly. Your `capsule_path` field will show whatever absolute path your shell resolves.

## What the report shows

The bundled `report.html` shows:

- The capsule's identity (`capsule_id`, `source_run_id`, schema version, `created_at`).
- The verification summary (the same five levels above).
- What was scanned (the demo repo at the run's commit ref, post-redaction).
- The 11 findings the run produced, broken down by evidence tier (`EVIDENCE_BACKED`, `ANALYST_HYPOTHESIS`) and risk class (`CRITICAL`, `HIGH`).
- The redaction report (which patterns ran, how many redactions occurred, which files the residue scan checked).
- The audit digest (algorithm, root hash, per-event entries).
- An explicit non-claims block: not signed, not replay-verified, not hermetic, no live-system authority.
- A footer stating: *"This page is a rendered view of the capsule. It does not add any claims beyond what `spartan capsule verify` proves."*

## What the SARIF export shows

The bundled `findings.sarif` is a SARIF v2.1.0 document. The top-level `$schema` points at the OASIS Standard schema. `runs[0]` contains:

- `tool.driver.name: "SPARTAN"`, `tool.driver.semanticVersion: <SPARTAN version>`, and the full `FINDING_TYPES` enum enumerated under `tool.driver.rules[]`.
- 11 `results`, one per finding in the capsule. Each result carries the finding's reasoning summary as `message.text`, the file path as `locations[].physicalLocation.artifactLocation.uri`, and the SPARTAN-specific fields (`finding_id`, `risk_class`, `evidence_tier`, `reproducer_class`, `capsule_id`, `source_run_id`) under `result.properties`.
- Every `result.level` is `"note"`. SPARTAN deliberately does not map `risk_class` to SARIF severity — `risk_class` is impact severity, SARIF `level` is confidence-of-action, and conflating the two would silently inflate `ANALYST_HYPOTHESIS` findings in tools that gate on SARIF level. Consumers can map `risk_class` and `evidence_tier` per their own policy.
- `runs[0].properties.spartan_verify_levels` carries all five verify outcomes including `SIGNATURE: NOT_PRESENT` and `REPLAY: NOT_PRESENT`. The SARIF document makes no signing or replay claim.
- `runs[0].properties.spartan_non_claims` is `{ signed: false, replay_bearing: false, hermetic_execution: false, compliance_certification: false, production_gating: false }`.

## The principle

The capsule proves. The view explains. Both run locally. Neither requires a SPARTAN service or a Higgs AI account.

## Where to learn more

- **`CLAIMS_AND_NON_CLAIMS.md`** (in this bundle) — the explicit, line-by-line list of what Capsule v0.1 claims and what it does not.
- **`docs/spartan/SPARTAN_CAPSULE_V0_1_REVIEWER_BRIEF.md`** (in the SPARTAN source tree) — the full reviewer brief, sized for AppSec engineers and security architects.
- **`docs/spartan/evidence-capsule-v0.1.md`** (in the SPARTAN source tree) — the full Evidence Capsule v0.1 reference.
- **`docs/spartan/PRODUCT_BOUNDARY.md`** (in the SPARTAN source tree) — SPARTAN's product boundary as a standalone product.
