open-standards/wai/wai-quantum/schemas/verdict.v1.json
Transaction Science d3cef1a13e wai-quantum: a receipt seals what the answer must do, the layer that checked it, and what that layer does not show
A job's receipt showed that a result is the one its signer sealed. A verdict
(wai.quantum.verdict/1) already said how far the engine checked a circuit
job's intent, as a level. It now names what did the checking, a job on a
provider's device and a qudit job carry one, and a verifier works a sealed
verdict out again. The contract is quantum-providers §8.9.

The layer. Every check, and the verdict, names its layer and that layer's
limits: exact_simulation, stabilizer, pass_equivalence, reading, certificate,
random_states, agreement, samples, physical_consistency or unchecked
(verdict::LAYERS). The verdict's is the weakest of its checks', and unchecked
where an intent was not decided or none was given. The result's accuracy
class is beside it under executed.accuracy.

More intents. expectation (an observable's exact value on the program's
state), and four of the answer the job returned: outcomes, conserves (weight
or parity), counts (the job's own counts held to a stated distribution, by a
test at a level or within a distance) and agrees (those counts held to the
exact distribution the engine computes of the program). outcomes and
conserves are decided by the program's exact distribution where the run is
the program's own, and on the counts otherwise.

More jobs. provider::read reads an intent before the job is sent and refuses
a sampled one there (J020); provider::seal seals the verdict with the
device's answer. A qudit job takes an intent of its counts. An
energy-landscape job's own sealed word reads as a verdict (verdict::of_job,
which panicked on one: its `verdict` is a word, not an object). A job whose
form holds no intent, or one another host sealed, is signed off
(engine::signoff, wai.quantum.signoff/1, schemas/signoff.v1.json): a job
about that job, sealing its digest, the intent and the verdict together.

Verifying. job::answer_of routes a job that seals a verdict to job::rerun,
and job::verdict and verdict_of_text work it out again too
(verdict::recheck, within the state vector of 22 qubits): `answer` gives the
level, holds, the layer and its limits, the accuracy class, and `again`:
reproduced, partly, host_statement or differs. A verdict that is not of its
own form, names another method or class than the result, another job than a
sign-off holds, or a check decided here otherwise, differs, and the job is
not valid though its seal holds. A sampled check's samples and a proof
another engine version reached are the host's statement, not a difference.
A verdict sealed before layers were named is held to its level and its
checks. A job that asks for no verdict gives the bytes it gave.

Conformance. quantum-conformance/verdicts/: 21 sealed jobs and what a
verifier must say of each, written by hand from §8.9: verdicts that hold, one
that fails, ones no layer decided, ones past what a verifier works out
again, five a host sealed that its job does not bear out, one changed after
its seal, a provider's, a qudit job's, and sign-offs of a wasmQ job and an
energy-landscape job. tests/verdict_conformance.rs holds the kept jobs to the
manifest (natively and under wasm32-wasip2) and makes each again with this
engine. quantum-conformance/intents/ gains twelve cases, and its harness
holds each verdict to its layer, every kind of intent and every layer a
circuit job's verdict can stand on. wai-quantum-verdict.yml runs the new set
and requires the new tests by name.

What moves with it: the answer set's stored seal is over a verdict, so it is
written again (WAI_ANSWER_BUNDLE_WRITE=1); wai-web's pinned course check
holds each case's verdict, so its digest moves, and the page gains
QuantumEngine.signoff and a wasm test (wai-web-wasm.yml counts 24);
schema::FILES gains signoff.v1.json (acknowledged in the changes entry);
the qudit referee reads `intent` as a member of a request.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
2026-11-11 11:01:31 -05:00

410 lines
11 KiB
JSON

{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://git.transaction.science/Transaction-Science/open-standards/raw/branch/main/wai/wai-quantum/schemas/verdict.v1.json",
"title": "wai.quantum.verdict/1",
"description": "How far the engine checked an answer, as one level of an ordered ladder (wai-quantum://docs/verdicts): refused, parsed, executed, evidence, proof; and the layer that decided it, with that layer's limits. A level says how far the engine checked, not that the answer is good: holds says whether the intents held (true, false, or null when none was decided), and layer names what decided them: exact simulation, a stabilizer check, checked rewrites, the answer held to its problem's own checks, agreement of the run's samples with a simulation, samples held to a distribution, physical consistency, random states, or unchecked. A job's result carries one under verdict when the job gives an intent or asks for one, and the receipt seals it; both MCP servers state one beside every answer about a program.",
"type": "object",
"required": [
"schema",
"level",
"rank",
"holds",
"statement",
"parsed",
"executed",
"intent",
"critique",
"repairs"
],
"properties": {
"schema": {
"const": "wai.quantum.verdict/1"
},
"level": {
"enum": [
"refused",
"parsed",
"executed",
"evidence",
"proof"
]
},
"rank": {
"type": "integer",
"minimum": 0,
"maximum": 4,
"description": "The level's place on the ladder, from 0 (refused) to 4 (proof)."
},
"holds": {
"type": [
"boolean",
"null"
]
},
"statement": {
"type": "string",
"description": "The level in one plain line."
},
"layer": {
"enum": [
"unchecked",
"physical_consistency",
"samples",
"agreement",
"random_states",
"certificate",
"reading",
"pass_equivalence",
"stabilizer",
"exact_simulation"
],
"description": "The layer that decided the intents: the weakest of the checks' layers, and unchecked when an intent was not decided or none was given. Absent from a verdict sealed before layers were named."
},
"limits": {
"type": "string",
"description": "What that layer does not show."
},
"parsed": {
"type": "object",
"description": "Whether the reader took the program, and its warnings and notes with their codes, or its refusal.",
"required": [
"ok"
],
"properties": {
"ok": {
"type": "boolean"
},
"diagnostics": {
"type": "array",
"items": {
"$ref": "tools.v1.json#/$defs/diagnostic"
}
},
"code": {
"type": "string"
},
"outcome": {
"enum": [
"refused",
"retry",
"failed",
"lowered",
"carried",
"preserved",
"warned",
"dropped",
"defaulted"
]
},
"message": {
"type": "string"
},
"line": {
"type": "integer",
"minimum": 1
},
"column": {
"type": "integer",
"minimum": 1
},
"length": {
"type": "integer",
"minimum": 0
},
"text": {
"type": "string",
"description": "The refusal as the reader wrote it, with its line and code."
}
}
},
"executed": {
"type": [
"object",
"null"
],
"description": "The method that ran and its accuracy class, and the distance a compile put between the program and what ran.",
"properties": {
"method": {
"type": "string"
},
"accuracy": {
"type": [
"string",
"null"
]
},
"compiled_distance": {
"type": [
"number",
"null"
]
}
}
},
"intent": {
"type": "array",
"items": {
"$ref": "#/$defs/check"
}
},
"critique": {
"type": "array",
"description": "The program's smells, each with its lines.",
"items": {
"type": "object"
}
},
"repairs": {
"type": "array",
"description": "Each edit a repair made, with the code it answered and the lines it changed.",
"items": {
"type": "object"
}
},
"refusal": {
"type": "object",
"description": "For a refused job: its message and its codes.",
"properties": {
"message": {
"type": "string"
},
"code": {
"type": [
"string",
"null"
]
},
"codes": {
"type": "array",
"items": {
"type": "string"
}
},
"outcome": {
"enum": [
"refused",
"retry",
"failed",
"lowered",
"carried",
"preserved",
"warned",
"dropped",
"defaulted"
]
},
"meaning": {
"type": "string"
}
}
},
"sealed": {
"type": "boolean"
}
},
"$defs": {
"check": {
"type": "object",
"description": "One intent's check: what it asked, whether it held, how strong the check was, how it was made, the layer it stands on and that layer's limits.",
"required": [
"kind",
"outcome",
"strength",
"how"
],
"properties": {
"kind": {
"enum": [
"distribution",
"equivalent",
"prepares",
"sampled",
"compiled",
"expectation",
"outcomes",
"conserves",
"counts",
"agrees",
"landscape"
]
},
"outcome": {
"enum": [
"holds",
"fails",
"unchecked"
]
},
"strength": {
"enum": [
"proof",
"evidence",
"none"
]
},
"how": {
"type": "string"
},
"layer": {
"enum": [
"unchecked",
"physical_consistency",
"samples",
"agreement",
"random_states",
"certificate",
"reading",
"pass_equivalence",
"stabilizer",
"exact_simulation"
],
"description": "The layer the check stands on: unchecked when it was not decided."
},
"limits": {
"type": "string",
"description": "What that layer does not show."
},
"why": {
"type": "string"
},
"distance": {
"type": "number"
},
"tolerance": {
"type": "number"
},
"observable": {
"type": "string",
"description": "An expectation intent: the observable."
},
"value": {
"type": "number",
"description": "An expectation intent: the observable's exact value on the program's state."
},
"expected": {
"type": "number",
"description": "An expectation intent: the value the intent states."
},
"outside": {
"type": "number",
"description": "An outcomes or a conserves intent: how much lies outside, as probability of the exact distribution or as a fraction of the samples."
},
"samples": {
"type": "integer",
"description": "An outcomes or a conserves intent checked on the job's counts: how many samples."
},
"said": {
"type": "string",
"description": "An energy-landscape job's own word: solved, missed, failed or unchecked."
},
"outcomes": {
"type": "integer",
"description": "The outcomes the distribution holds, or the samples' distinct outcomes."
},
"distribution": {
"type": "object",
"additionalProperties": {
"type": "number"
},
"description": "The program's distribution, when its outcomes are few enough to list."
},
"largest_gaps": {
"type": "array",
"items": {
"type": "object",
"properties": {
"outcome": {
"type": "string"
},
"program": {
"type": "number"
},
"intent": {
"type": "number"
}
}
}
},
"global_phase": {
"type": [
"number",
"null"
]
},
"method": {
"type": "string",
"description": "A sampled intent: the method the samples were run by."
},
"seed": {
"type": "integer"
},
"shots": {
"type": "integer"
},
"alpha": {
"type": "number"
},
"fit": {
"type": "object",
"description": "A sampled intent: the test, its statistic, degrees of freedom and p-value, the level, and whether it rejected.",
"properties": {
"test": {
"type": "string"
},
"statistic": {
"type": "number"
},
"dof": {
"type": "integer"
},
"p_value": {
"type": "number"
},
"alpha": {
"type": "number"
},
"shots": {
"type": "integer"
},
"rejected": {
"type": "boolean"
},
"smallest_expected": {
"type": [
"number",
"null"
]
},
"impossible": {
"type": [
"integer",
"array",
"boolean"
],
"description": "The outcomes sampled that the stated distribution gives probability 0: the first 64, in order."
},
"impossible_outcomes": {
"type": "integer",
"description": "How many outcomes sampled the stated distribution gives probability 0."
},
"note": {
"type": "string"
}
}
},
"counts": {
"type": "object",
"additionalProperties": {
"type": "integer"
}
},
"name": {
"type": "string"
},
"note": {
"type": "string"
}
}
}
}
}