{ "$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/set.v1.json", "title": "wai.quantum.set/1", "description": "A set's result: many programs, or one program over a grid of its inputs, run as one job (engine::sets). Its head holds the count, how many items finished and failed, the Merkle root over the items' leaves, the set's energy and time; the set's receipt seals the set's request and its head. Each item is a plain job with its own receipt, its index, its point in a sweep, and its path to the root, so it is shown sealed by the set alone. A result names the engine that made it and this schema (engine and schema).", "type": "object", "required": [ "format", "count", "done", "failed", "root", "items" ], "properties": { "engine": { "type": "object", "description": "The engine that made the result: the wai-quantum crate's name and version.", "required": [ "name", "version" ], "properties": { "name": { "const": "wai-quantum" }, "version": { "type": "string" } } }, "schema": { "const": "wai.quantum.set/1" }, "format": { "const": "wai.quantum.set/1" }, "count": { "type": "integer", "minimum": 1 }, "done": { "type": "integer", "minimum": 0 }, "failed": { "type": "integer", "minimum": 0 }, "root": { "type": "string", "description": "The Merkle root of the items' leaves, in hex (domains moq-jwp:merkle-leaf and moq-jwp:merkle-node, version 1)." }, "energy": { "$ref": "job-result.v1.json#/$defs/energy" }, "elapsed_ms": { "type": "integer", "minimum": 0 }, "receipt": { "$ref": "receipt.v2.json" }, "items": { "type": "array", "items": { "$ref": "#/$defs/item" } } }, "$defs": { "item": { "type": "object", "description": "One item: its index, its point in a sweep, its request (a plain job, complete in itself), and its result with its own receipt, or why it failed; and its path to the set's root.", "required": [ "index", "request", "status", "path" ], "properties": { "index": { "type": "integer", "minimum": 0 }, "point": { "type": "object", "description": "A sweep's item: the value of each input it was run at." }, "status": { "enum": [ "done", "failed" ] }, "method": { "type": "string" }, "why": { "type": "string" }, "request": { "$ref": "job-request.v1.json" }, "result": { "$ref": "job-result.v1.json" }, "error": { "type": "string" }, "code": { "type": "string", "description": "A failed item's refusal code (engine::refusal)." }, "path": { "type": "array", "items": { "type": "string" }, "description": "The item's leaf's sibling digests up to the root, in hex." } } }, "verify": { "type": "object", "description": "A set's check: the set's receipt over its request and head, the items the request gives at their indices, every item's own receipt, the root over the leaves and each item's path.", "required": [ "valid", "signed", "derived", "items", "items_sealed", "root" ], "properties": { "valid": { "type": "boolean" }, "signed": { "type": "boolean" }, "derived": { "type": "boolean" }, "items": { "type": "integer", "minimum": 0 }, "items_sealed": { "type": "boolean" }, "root": { "type": "boolean" }, "key": { "type": [ "string", "null" ] }, "signer": { "type": [ "string", "null" ], "description": "That key as a did:key, where a surface gives it." }, "reasons": { "type": "array", "items": { "type": "string" }, "description": "Each rule the set's receipt breaks (the provider protocol's sections 8.4 and 8.6): none when it is valid." }, "form": { "type": [ "string", "null" ] }, "time": { "type": "object", "description": "What the set's receipt seals of when it was issued (the provider protocol's section 8.2): the time, in milliseconds since 1970 by its signer's clock, or that it seals none.", "required": [ "sealed" ], "properties": { "sealed": { "type": "boolean" }, "issued_ms": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "not_after_ms": { "type": [ "integer", "null" ], "minimum": 0, "maximum": 9007199254740991, "description": "The first moment the receipt is no longer offered; null when it states none." } } }, "trust": { "type": "object", "description": "With a trust list (section 8.8): whether it lists the receipt's key, and the window and revocation its entry gives.", "required": [ "listed" ], "properties": { "listed": { "type": "boolean" }, "not_before_ms": { "type": [ "integer", "null" ], "minimum": 0, "maximum": 9007199254740991 }, "not_after_ms": { "type": [ "integer", "null" ], "minimum": 0, "maximum": 9007199254740991 }, "revoked_from_ms": { "type": [ "integer", "null" ], "minimum": 0, "maximum": 9007199254740991 } } }, "checked_at_ms": { "type": "integer", "minimum": 0, "maximum": 9007199254740991, "description": "With a time to hold the receipt to (section 8.8): that time." }, "skew_ms": { "type": "integer", "minimum": 0, "description": "How far after checked_at_ms a receipt's issue may be." }, "given": { "enum": [ "text", "members", "parsed" ], "description": "From a surface that says how the job was given (the provider protocol's section 9): its own text; its members, judged as the message wrote them; or a value already parsed, with no text to judge." }, "not_seen": { "type": "array", "items": { "type": "string" }, "description": "For a job given parsed: what parsing loses, which this verdict could not see." } } } } }