{"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://microsoft.github.io/waza/schemas/adapter-translation-1.0.schema.json","title":"Waza portable adapter translation 1.0","description":"Offline translation of one work descriptor to exactly one public runner contract call. Translation executes nothing, opens no store and makes no queueing, placement or retry decision.","type":"object","additionalProperties":false,"required":["kind","schema_version","adapter","status","descriptor_sha256","diagnostics"],"properties":{"kind":{"const":"waza.adapter-translation"},"schema_version":{"const":"1.0"},"adapter":{"$ref":"#/$defs/adapter"},"status":{"enum":["translated","rejected"]},"descriptor_sha256":{"$ref":"#/$defs/digest"},"work_id":{"type":"string","minLength":1,"maxLength":256},"operation":{"enum":["submit","checkpoint","resume","status"]},"call":{"$ref":"#/$defs/call"},"summary":{"type":"object","additionalProperties":false,"properties":{"run_key":{"type":"string"},"selection":{"type":"object","additionalProperties":false,"required":["shard","task","trial","attempt"],"properties":{"shard":{"type":"string"},"task":{"type":"string"},"trial":{"type":"integer","minimum":1},"attempt":{"type":"integer","minimum":1}}},"versions":{"type":"array","items":{"type":"string"}},"required_capabilities":{"type":"array","items":{"type":"string"}},"optional_capabilities":{"type":"array","items":{"type":"string"}},"timeout_ms":{"type":"integer","minimum":1},"allow_paid_execution":{"type":"boolean"},"request_sha256":{"$ref":"#/$defs/digest"},"policy":{"enum":["omitted","distinct","reuse"]},"parent":{"$ref":"execution-attempt-1.0.schema.json#/$defs/parent"},"source":{"$ref":"execution-attempt-1.0.schema.json#/$defs/source"},"checkpoint_sha256":{"$ref":"#/$defs/digest"},"logical":{"$ref":"execution-attempt-1.0.schema.json#/$defs/logical"}}},"diagnostics":{"$ref":"#/$defs/diagnostics"}},"allOf":[{"if":{"properties":{"status":{"const":"translated"}}},"then":{"required":["work_id","operation","call","summary"],"properties":{"diagnostics":{"maxItems":0}}},"else":{"properties":{"diagnostics":{"minItems":1}},"not":{"anyOf":[{"required":["work_id"]},{"required":["operation"]},{"required":["call"]},{"required":["summary"]}]}}}],"$defs":{"digest":{"type":"string","minLength":64,"maxLength":64,"pattern":"^[a-f0-9]{64}$"},"adapter":{"type":"object","additionalProperties":false,"required":["name","version","runner_versions"],"properties":{"name":{"type":"string","minLength":1,"maxLength":128},"version":{"type":"string","minLength":1,"maxLength":64},"runner_versions":{"type":"array","minItems":1,"items":{"type":"string"}}}},"call":{"description":"The single public contract call. input is the exact stdin/body text; it is absent for read-only status.","type":"object","additionalProperties":false,"required":["command","http"],"properties":{"command":{"type":"array","minItems":2,"items":{"type":"string","minLength":1}},"http":{"type":"object","additionalProperties":false,"required":["method","path"],"properties":{"method":{"enum":["GET","POST"]},"path":{"type":"string","pattern":"^/api/v1/"}}},"input":{"type":"string","minLength":2},"input_sha256":{"$ref":"#/$defs/digest"}},"dependentRequired":{"input":["input_sha256"],"input_sha256":["input"]}},"diagnostics":{"type":"array","maxItems":16,"items":{"type":"object","additionalProperties":false,"required":["code","message"],"properties":{"code":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[a-z][a-z0-9_]*$"},"message":{"type":"string","minLength":1,"maxLength":4096}}}}}}