open-standards/wai/wai-quantum/schemas/plan.v1.json
Transaction Science 2778ddd525 wai-quantum: the planner under a contract, its reasoning sealed, a provider's answer shadowed
Re-landed from PR #668 (branch wai/quantum-planner-contract, merged with main
495651ddd at 37350335b) as one commit on main, under the land-it model. Five
review rounds; round 5's findings (two high: workers that died as PID 1) were
fixed on the branch, and its CI reds were traced and fixed before landing.

A job may carry a contract (deadline, energy ceiling, cost, accuracy); the
planner chooses a route that meets it or refuses with every route's reason,
and its reasoning is sealed in the receipt. Under #676's reading child the
contract job is planned in the child from the per-method timings the parent
sends, bounded as a job naming its chosen method plus its reasoning, kept
across a restart. Both verifiers (Rust and receipt_verify.py) check the
planner statement beside wasmQ's; the receipts corpus is regenerated with
both kinds (268 crafted receipts, 14 plants caught). The views page carries
its engine raw-deflated and stays under its 1 MiB limit (669,484 bytes).

Passed before the push (Framework, linux; M3, macOS): every repository
check, receipts conformance, breaking, corpora, catalogue, the qpu clients,
energy (wai-rs, wai-quantum full, serve), the CLI tests and clippy, writer,
smoke, cross-simulator corpus, job receipts, wasmQ tests and vectors, the
engine with and without receipts under -D warnings, the docs pages, and the
service suite with clippy.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-09 17:42:46 -05:00

45 lines
1.5 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/plan.v1.json",
"title": "wai.quantum.plan/1",
"description": "What a job will run, before it runs: the method the planner chose and why, the memory the job is admitted with (an upper estimate) and its work in the method's own unit. The command line's plan --json and both servers' plan tools give it. A job with a contract carries the planner's reasoning.",
"type": "object",
"required": [
"method",
"why",
"memory_bytes",
"work",
"qubits"
],
"properties": {
"method": {
"type": "string"
},
"why": {
"type": "string"
},
"memory_bytes": {
"type": "integer",
"minimum": 0
},
"work": {
"type": "integer",
"minimum": 0,
"description": "The method's own unit: an upper bound on what the run takes where the method's cost is known beforehand, and with `metered` what the meter holds it to."
},
"qubits": {
"type": "integer",
"minimum": 0
},
"target": {
"$ref": "job-result.v1.json#/$defs/target_placement"
},
"planner": {
"$ref": "job-result.v1.json#/$defs/planner"
},
"metered": {
"type": "boolean",
"description": "True when a job naming method mps would pass one job's work at the bond it asks for: it runs under a meter of the bonds it reaches, may take far less than `work`, and stops with J011 if it passes `work`."
}
}
}