{"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://app.prooftask.ai/.well-known/prooftask-authority-chain-v1.schema.json","title":"Prooftask portable authority chain v1","description":"Recorder-attested permission history. Organizational trust anchors and later known revocations are separate relying-party inputs. Schema checks structure; the offline verifier enforces signatures, source binding and attenuation.","type":"object","additionalProperties":false,"required":["schema","asOf","subjectDigest","grants","bindings"],"properties":{"schema":{"const":"prooftask.authority-chain/v1"},"asOf":{"type":"string","pattern":"^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}\\.[0-9]{3}Z$","minLength":24,"maxLength":24},"subjectDigest":{"type":"string","pattern":"^[a-f0-9]{64}$"},"grants":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["id","records"],"properties":{"id":{"type":"string","minLength":1,"maxLength":1000},"records":{"type":"array","items":{"$ref":"#/$defs/record"},"minItems":1,"maxItems":100}}},"minItems":0,"maxItems":500},"bindings":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["sourceEventHash","nodeId","missing"],"properties":{"sourceEventHash":{"type":"string","pattern":"^(sha256:)?[a-f0-9]{64}$"},"nodeId":{"anyOf":[{"type":"string","minLength":1,"maxLength":1000},{"type":"null"}]},"missing":{"anyOf":[{"const":"LEGACY_MATERIAL_UNAVAILABLE"},{"type":"null"}]}}},"minItems":0,"maxItems":10000}},"$defs":{"grant":{"type":"object","additionalProperties":false,"required":["id","kind","parentId","subjectId","tenantId","organizationId","role","basis","assurance","authorityReference","scopes","delegableScopes","projectIds","validFrom","validUntil","approvedBy","revokedAt"],"properties":{"id":{"type":"string","minLength":1,"maxLength":1000},"kind":{"enum":["ROOT","MEMBERSHIP","SESSION","AGENT","CAPABILITY"]},"parentId":{"anyOf":[{"type":"string","minLength":1,"maxLength":1000},{"type":"null"}]},"subjectId":{"type":"string","minLength":1,"maxLength":1000},"tenantId":{"type":"string","minLength":1,"maxLength":1000},"organizationId":{"type":"string","minLength":1,"maxLength":1000},"role":{"type":"string","minLength":1,"maxLength":1000},"basis":{"enum":["SELF_ATTESTED","CUSTOMER_APPROVAL","HOST_RECORDED","MEMBERSHIP","AGENT_DELEGATION","SUPPLIER_CAPABILITY","SERVICE"]},"assurance":{"enum":["VERIFIED","ADMIN_APPROVED","ATTESTED","UNKNOWN"]},"authorityReference":{"type":"string","minLength":1,"maxLength":1000},"scopes":{"type":"array","items":{"type":"string","minLength":1,"maxLength":500},"minItems":0,"maxItems":100,"uniqueItems":true},"delegableScopes":{"type":"array","items":{"type":"string","minLength":1,"maxLength":500},"minItems":0,"maxItems":100,"uniqueItems":true},"projectIds":{"anyOf":[{"type":"array","items":{"type":"string","minLength":1,"maxLength":500},"minItems":0,"maxItems":100,"uniqueItems":true},{"type":"null"}]},"validFrom":{"type":"string","pattern":"^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}\\.[0-9]{3}Z$","minLength":24,"maxLength":24},"validUntil":{"type":"string","pattern":"^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}\\.[0-9]{3}Z$","minLength":24,"maxLength":24},"approvedBy":{"type":"string","minLength":1,"maxLength":1000},"revokedAt":{"anyOf":[{"type":"string","pattern":"^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}\\.[0-9]{3}Z$","minLength":24,"maxLength":24},{"type":"null"}]}}},"record":{"type":"object","additionalProperties":false,"required":["body","signature"],"properties":{"body":{"type":"object","additionalProperties":false,"required":["schema","canonicalization","revision","previousDigest","recordedAt","keyId","change","grant"],"properties":{"schema":{"const":"prooftask.authority-event/v1"},"canonicalization":{"const":"prooftask.jcs-rfc8785/v2"},"revision":{"type":"integer","minimum":1,"maximum":100},"previousDigest":{"anyOf":[{"type":"string","pattern":"^[a-f0-9]{64}$"},{"type":"null"}]},"recordedAt":{"type":"string","pattern":"^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}\\.[0-9]{3}Z$","minLength":24,"maxLength":24},"keyId":{"type":"string","minLength":1,"maxLength":1000},"change":{"enum":["CREATE","REVOKE","EXTEND_PROJECTS","RENEW","OBSERVE_LEGACY"]},"grant":{"$ref":"#/$defs/grant"}}},"signature":{"type":"object","additionalProperties":false,"required":["algorithm","value"],"properties":{"algorithm":{"const":"Ed25519"},"value":{"type":"string","pattern":"^[A-Za-z0-9_-]{86}$"}}}}}}}