### wai-quantum: the engine's answers as views in agent hosts, the answer view layer, correctness records and a model harness

The engine's answers drawn where an agent works, written by a model as views whose numbers the engine computes, and the model scored on them.

- **Views in agent hosts** (`engine::views`; the Model Context Protocol's extension `io.modelcontextprotocol/ui`, version 2026-01-26): both MCP servers serve six `ui://wai-quantum/*` resources (the circuit, a result with its verdict, a receipt, a critique, an estimate's frontier, a device target's map) to a host that declares the extension, and each tool names its view in `_meta.ui.resourceUri`. The job-polling tool belongs to the view (`visibility: ["app"]`) and is kept from the model. A host without the extension gets the plain text it got before, and the text of a result is the same either way.
  - One self-contained page (`wai-quantum/views/`), with the view named in it: 802 495 bytes, under the extension's 1 MiB. Of that, the script is 93 783 bytes (the Studio's English words among it), the styles 49 020, and the engine 193 530 as WebAssembly (258 040 in base64) and 401 202 as JavaScript. It is built from the Studio's components by `quantum-studio/build-views.mjs`, and its manifest records each part's size and SHA-256 and every source's.
  - The receipt is checked inside the view, by the engine's own `job::verify` built with no imports (`wai/wai-quantum-views`). The extension's default content-security policy refuses to compile WebAssembly, as measured in a headless browser, so the page also carries the engine translated to JavaScript and uses whichever runs.
  - The page builds byte for byte the same in a clean CI image on x86_64 Linux. The engine's bytes change with any change to `wai-quantum`, and between macOS and Linux, so CI holds the script and the styles to their sources and warns when the engine needs a rebuild.
  - A scripted host (`quantum-studio/test/views.test.mjs`) runs against both servers in a headless browser: it lists, reads and draws every view, verifies the receipt in the view in both forms, refuses a changed one, and holds every page to the limit.
- **The answer view layer** (`wai/extensions/quantum-answers.md`, `wai.quantum.answer/1`, a draft; `engine::answer`): fourteen views and eleven engine calls written beside an OpenQASM 3 program, one statement a line. Every number a view shows comes from an `@` call that the host carries out.
  - A streaming reader (`Stream`) gives each statement as it arrives, and the same answer however the text is split.
  - `@Seal` seals the calls. A stored answer carries its receipt, which is checked by running the answer again.
  - Codes `J100` to `J112`, each with its outcome (dropped, defaulted or warned), sit beside the reader's `Q` codes (`docs/job-refusals.md`).
  - Conformance (`quantum-conformance/answers/`): twenty cases covering every code, run natively, under `wasm32-wasip2` and in the browser build.
  - The token cost is measured and recorded (§9). On the harness's fourteen tasks, in the vocabularies of three open-weight models, the layer takes 29 to 32 percent more tokens than a job's JSON for the same request. The cost is per statement (24 to 28 tokens for one sample and one verdict), and noise that two calls share is named once. The whole layer is 2.7 to 2.8 times the program alone.
  - Surfaces:
    - wai-web: `AnswerStream`, `engine_answer_parse`, `engine_answer_prompt`, `engine_answer_verify` and `engine_answer_marker`, with `answer_value` and `answer_evaluate` on the page's engine;
    - the Studio's answer pane, which draws each statement as the assistant streams it, runs its calls and seals the answer;
    - the desktop app's `answer`.
- **Correctness records** (`engine::telemetry`, `wai.quantum.telemetry/1`): off by default. Turned on in the Studio, it keeps one record per answer in the browser: the codes, the verdict level, the repairs, whether it was accepted, and the receipt id. Nothing is sent anywhere, and the records leave only when exported. The failures export as an eval corpus in the intent conformance format. A test shows that nothing is kept while it is off.
- **A model harness** (`wai-quantum eval run` and `eval corpus`; `quantum-conformance/eval/`):
  - Fourteen tasks from the intent conformance set and the worked examples. Each has a reference program that a test holds to its intent by proof.
  - It asks a model at temperature 0, on this machine or a private network (any other host is refused unless allowed), for a program or for an answer in the layer. Optional repair rounds send the engine's codes back.
  - Each answer is scored as valid, and as solved with its verdict level. Joules per solved task are reported where the model server's process energy can be read (macOS).
  - A report ranks nothing and is not committed.
  - One open-weight model on the build host (35 billion parameters, 3 billion active, 5-bit, temperature 0), measured in §9.1 of the spec:
    - asked for the program, 12 of 14 answers were valid and 11 solved, and 13 and 12 after one repair round;
    - asked for the layer, 4 were valid and 3 solved, and 7 and 6 after one repair round.
    - Its errors are its own: an unnamed fence, a view given a call where it takes a program, undeclared names, and arguments written as `name=value`.
    - The prompt now gives each argument's kind and the rules those errors broke. The reader answers `name=value` by saying that arguments go by position.
- **Schemas** (the version contract): the answer layer's documents (`wai.quantum.answer/1`: an answer read, carried out, a seal's request and result, a stored answer checked; labelled a draft whose form may change before the extension settles), a correctness record and its corpus (`wai.quantum.telemetry/1`), the views page's manifest (`wai.quantum.views-bundle/1`), and the harness's report, corpus and token counts (`wai.quantum.eval-report/1`, `wai.quantum.eval-answers/1`, `wai.quantum.token-cost/1`, the command line's). The view's own tool `poll_quantum_job` answers to the job's schema. The views name a compile's gate set by its basis.
- **The engine**: the order of a program's final measurements makes no difference. Equivalence, the verdict's reference check and the rewriter compare which qubit each bit reads, not the order the measurements were written in. The harness found this: a correct GHZ state measured in the reverse order was refused.
- **CI**:
  - `wai-quantum-views.yml`: the crate, the page against its sources, and the scripted host on `macos`;
  - the answer set under `wasm32-wasip2` in `wai-quantum-verdict.yml`;
  - the eval and views tests in `wai-quantum-cli.yml`;
  - the telemetry test, the page check and the desktop app's answer test in `wai-quantum-studio.yml`;
  - wai-web's test pins (with every entry's of this release, 26 native and 18 `wasm32`).

