JSON-as-IR: a versioned selene_run schema
One schema (kernel snippet, qubits, shots, records, metrics) so a single <SeleneRun /> renders every future experiment.
Results · real Selene shots
schema_v1_covers_9_of_9_demos · zero_extras_escape_hatchZod schema v1 (kernel · verdict · metrics · series) covers every shipped Nadarasa demo. /nadarasa/schema-coverage runs each adapter live, validates against the schema, and asserts no `extras` escape hatch is used. 9/9 green.
Why this matters
Every demo JSON in src/data/demos/ has a bespoke shape. Adding a new experiment means hand-writing a React route for it. A versioned schema collapses that to: write the kernel + post-processor, register it under the schema, and a generic component renders it.
What the repo already has
Nine demo JSON files under src/data/demos/ (G1–G4, G7–G11) all covered by adapters in src/lib/selene-run-convert.ts.
What's missing
Nothing required by the card's refutation criterion. The remaining bespoke routes (g2.tsx, g3.tsx, …) are kept for their richer per-experiment narrative; the schema view is the canonical generic renderer and ships on /nadarasa/g1-schema.
Smallest experiment
Build it or kill itQubits
n/a
Ancilla pattern
n/a
Shots
n/a
Predicted outcome
All nine converters round-trip through SeleneRunSchema (Zod) and render through <SeleneRun /> without an `extras` escape hatch. Live conformance dashboard at /nadarasa/schema-coverage shows 9/9 green.
Refutation criterion
If any demo's converter needs the `extras` escape hatch to render correctly, the schema is wrong — redesign.
Kernel sketch
Untested — sketch only// selene_run.schema.json (sketch)
{
"version": 1,
"kernel": { "snippet": "string", "qubits": "int", "shots": "int" },
"verdict": { "text": "string", "good": "bool" },
"metrics": [{ "name": "string", "value": "number", "unit": "string" }],
"series": [{ "kind": "histogram|bar|line", "yKeys": ["..."], "points": [...] }]
}Host pipeline
Adapter per demo: bespoke JSON → SeleneRun. <SeleneRun /> consumes the schema, no per-experiment React. /nadarasa/schema-coverage runs every adapter at render time and validates against the Zod schema.
Related
Files in this repo
- · src/lib/selene-run-schema.ts
- · src/lib/selene-run-convert.ts
- · src/components/selene/SeleneRun.tsx
- · src/routes/nadarasa.g1-schema.tsx
- · src/routes/nadarasa.schema-coverage.tsx