{"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://main.pre.bi/schemas/result-envelope.schema.json","title":"Pre ResultEnvelope v1","type":"object","required":["schemaVersion","requestId","decidedAt","decision","execution","objective","resolvedAuthority","events","artifacts","receipt","output","errors","remainingObligations","recommendedNextAction"],"properties":{"schemaVersion":{"const":"pre.result.v1"},"requestId":{"$ref":"#/$defs/requestAddress"},"decidedAt":{"$ref":"#/$defs/timestamp"},"decision":{"enum":["accepted","denied"]},"execution":{"$ref":"#/$defs/execution"},"objective":{"$ref":"#/$defs/objective"},"resolvedAuthority":{"type":"array","uniqueItems":true,"items":{"$ref":"#/$defs/address"}},"events":{"type":"array","uniqueItems":true,"items":{"$ref":"#/$defs/address"}},"artifacts":{"type":"array","uniqueItems":true,"items":{"$ref":"#/$defs/address"}},"receipt":{"oneOf":[{"$ref":"#/$defs/address"},{"type":"null"}]},"output":{"oneOf":[{"type":"object","additionalProperties":{"$ref":"#/$defs/jsonValue"}},{"type":"null"}]},"errors":{"type":"array","items":{"$ref":"#/$defs/protocolError"}},"remainingObligations":{"type":"array","uniqueItems":true,"items":{"$ref":"#/$defs/address"}},"recommendedNextAction":{"oneOf":[{"$ref":"#/$defs/recommendedAction"},{"type":"null"}]}},"additionalProperties":false,"$defs":{"address":{"type":"string","minLength":3,"maxLength":255,"pattern":"^[a-z][a-z0-9-]{0,31}:[a-z0-9][a-z0-9._~-]{0,63}(?::[a-z0-9][a-z0-9._~-]{0,63})*$"},"requestAddress":{"type":"string","minLength":9,"maxLength":255,"pattern":"^request:[a-z0-9][a-z0-9._~-]{0,63}(?::[a-z0-9][a-z0-9._~-]{0,63})*$"},"token":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[a-z][a-z0-9-]{0,63}$"},"timestamp":{"type":"string","minLength":20,"maxLength":40,"pattern":"^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(?:\\.\\d{1,9})?Z$"},"jsonValue":{"oneOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"array","items":{"$ref":"#/$defs/jsonValue"}},{"type":"object","additionalProperties":{"$ref":"#/$defs/jsonValue"}}]},"execution":{"type":"object","required":["status"],"properties":{"status":{"enum":["not-started","pending","running","succeeded","failed"]}},"additionalProperties":false},"objective":{"type":"object","required":["status","verdictRef"],"properties":{"status":{"enum":["unverified","verified","not-met","not-applicable"]},"verdictRef":{"oneOf":[{"$ref":"#/$defs/address"},{"type":"null"}]}},"additionalProperties":false},"protocolError":{"type":"object","required":["code","message"],"properties":{"code":{"$ref":"#/$defs/token"},"message":{"type":"string"}},"additionalProperties":false},"recommendedAction":{"type":"object","required":["action"],"properties":{"action":{"$ref":"#/$defs/token"},"target":{"$ref":"#/$defs/address"}},"additionalProperties":false}}}
