{"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://app.prooftask.ai/.well-known/prooftask-result-package-v2.schema.json","title":"Prooftask signed Result package v2","type":"object","additionalProperties":false,"required":["protected","payload","signature"],"properties":{"protected":{"type":"string","minLength":1,"maxLength":2048,"pattern":"^[A-Za-z0-9_-]+$"},"payload":{"type":"string","minLength":1,"maxLength":2097152,"pattern":"^[A-Za-z0-9_-]+$"},"signature":{"type":"string","minLength":1,"maxLength":86,"pattern":"^[A-Za-z0-9_-]+$"}},"$defs":{"digest":{"type":"object","additionalProperties":false,"required":["algorithm","value"],"properties":{"algorithm":{"const":"sha-256"},"value":{"type":"string","pattern":"^[a-f0-9]{64}$","minLength":64,"maxLength":64}}},"reference":{"type":"object","additionalProperties":false,"required":["kind","id","version","sourceDigest"],"properties":{"kind":{"enum":["SPECIFICATION","DELIVERY","ACCEPTANCE"]},"id":{"type":"string","minLength":1,"maxLength":512},"version":{"type":"integer","minimum":1,"maximum":9007199254740991},"sourceDigest":{"type":"object","additionalProperties":false,"required":["algorithm","value","profile"],"properties":{"algorithm":{"const":"sha-256"},"value":{"type":"string","pattern":"^(sha256:)?[a-f0-9]{64}$","minLength":64,"maxLength":71},"profile":{"enum":["LEGACY_ARTIFACT","JEP_EVENT"]}}}}},"actor":{"type":"object","additionalProperties":false,"required":["id","organizationId","role","attribution","authority","binding","execution"],"properties":{"id":{"type":"string","minLength":1,"maxLength":512},"organizationId":{"type":"string","minLength":1,"maxLength":512},"role":{"type":"string","minLength":1,"maxLength":512},"attribution":{"const":"RECORDER_ASSERTION"},"authority":{"type":"object","additionalProperties":false,"required":["assurance","reference","scopes"],"properties":{"assurance":{"enum":["VERIFIED","ADMIN_APPROVED","ATTESTED","UNKNOWN"]},"reference":{"anyOf":[{"type":"string","minLength":1,"maxLength":2048},{"type":"null"}]},"scopes":{"type":"array","items":{"type":"string","minLength":1,"maxLength":512},"maxItems":50}}},"binding":{"type":"object","additionalProperties":false,"required":["method","reference"],"properties":{"method":{"anyOf":[{"type":"string","minLength":1,"maxLength":512},{"type":"null"}]},"reference":{"anyOf":[{"type":"string","minLength":1,"maxLength":2048},{"type":"null"}]}}},"execution":{"anyOf":[{"type":"object","additionalProperties":false,"required":["kind","id","grantId","delegatedBy","authorizedAt","expiresAt"],"properties":{"kind":{"const":"AGENT"},"id":{"type":"string","minLength":1,"maxLength":512},"grantId":{"type":"string","minLength":1,"maxLength":512},"delegatedBy":{"type":"string","minLength":1,"maxLength":512},"authorizedAt":{"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},"expiresAt":{"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"}]}}},"evidence":{"type":"object","additionalProperties":false,"required":["id","kind","criterionId","reference","claim","artifact","acquisition","custody"],"properties":{"id":{"type":"string","pattern":"^evidence_[a-f0-9]{64}$","minLength":73,"maxLength":73},"kind":{"enum":["FILE_REFERENCE","DECLARED_REFERENCE","SOURCE_OBSERVATION"]},"criterionId":{"type":"string","minLength":1,"maxLength":512},"reference":{"type":"string","minLength":1,"maxLength":2048},"claim":{},"artifact":{"anyOf":[{"type":"object","additionalProperties":false,"required":["digest","name","size","mediaType"],"properties":{"digest":{"$ref":"#/$defs/digest"},"name":{"anyOf":[{"type":"string","minLength":1,"maxLength":512},{"type":"null"}]},"size":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"mediaType":{"anyOf":[{"type":"string","minLength":1,"maxLength":512},{"type":"null"}]}}},{"type":"null"}]},"acquisition":{"type":"object","additionalProperties":false,"required":["method","assurance","sourceSystem","sourceId"],"properties":{"method":{"type":"string","minLength":1,"maxLength":512},"assurance":{"type":"string","minLength":1,"maxLength":512},"sourceSystem":{"anyOf":[{"type":"string","minLength":1,"maxLength":512},{"type":"null"}]},"sourceId":{"anyOf":[{"type":"string","minLength":1,"maxLength":2048},{"type":"null"}]}}},"custody":{"type":"object","additionalProperties":false,"required":["mode","originalIncluded"],"properties":{"mode":{"const":"REFERENCE_ONLY"},"originalIncluded":{"const":false}}}}},"manifest":{"type":"object","additionalProperties":false,"required":["digest","evidence"],"properties":{"digest":{"$ref":"#/$defs/digest"},"evidence":{"type":"array","items":{"$ref":"#/$defs/evidence"},"maxItems":10000}}},"delivery":{"type":"object","additionalProperties":false,"required":["reference","specification","previousDeliveryId","respondsToDecisionId","evidence","recordedAt","actor"],"properties":{"reference":{"$ref":"#/$defs/reference"},"specification":{"$ref":"#/$defs/reference"},"previousDeliveryId":{"anyOf":[{"type":"string","minLength":1,"maxLength":512},{"type":"null"}]},"respondsToDecisionId":{"anyOf":[{"type":"string","minLength":1,"maxLength":512},{"type":"null"}]},"evidence":{"$ref":"#/$defs/manifest"},"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},"actor":{"$ref":"#/$defs/actor"}}},"decision":{"type":"object","additionalProperties":false,"required":["reference","specification","delivery","evidenceDigest","assessmentEventHash","action","recordedAt","actor","statement"],"properties":{"reference":{"$ref":"#/$defs/reference"},"specification":{"$ref":"#/$defs/reference"},"delivery":{"anyOf":[{"$ref":"#/$defs/reference"},{"type":"null"}]},"evidenceDigest":{"anyOf":[{"$ref":"#/$defs/digest"},{"type":"null"}]},"assessmentEventHash":{"anyOf":[{"type":"string","pattern":"^(sha256:)?[a-f0-9]{64}$","minLength":64,"maxLength":71},{"type":"null"}]},"action":{"enum":["ACCEPT","REQUEST_CHANGES","REQUEST_EVIDENCE","REJECT"]},"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},"actor":{"$ref":"#/$defs/actor"},"statement":{}}},"transition":{"type":"object","additionalProperties":false,"required":["id","kind","action","recordedAt","previousEventDigest","sourceEventDigest","previousState","nextState","deliveryId","decisionId","actor","statement"],"properties":{"id":{"type":"string","minLength":1,"maxLength":512},"kind":{"enum":["BUYER_COMMIT","SUPPLIER_REPRESENTATIVE","SUPPLIER_RESPONSE","DATE_REVISION_REQUEST","SUBMIT","REVIEW","CONCERN","RESOLVE_CONCERN","SUPERSEDE"]},"action":{"anyOf":[{"enum":["ACCEPT","DECLINE","REQUEST_CHANGES","REQUEST_EVIDENCE","REJECT","REAFFIRM","WITHDRAW"]},{"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},"previousEventDigest":{"anyOf":[{"type":"string","pattern":"^(sha256:)?[a-f0-9]{64}$","minLength":64,"maxLength":71},{"type":"null"}]},"sourceEventDigest":{"type":"string","pattern":"^(sha256:)?[a-f0-9]{64}$","minLength":64,"maxLength":71},"previousState":{"enum":["AWAITING_SUPPLIER","AGREEMENT_CHANGES_REQUESTED","SUPPLIER_DECLINED","LOCKED","SUBMITTED","CHANGES_REQUESTED","AWAITING_EVIDENCE","BUYER_CONFIRMED","BUYER_REJECTED","SUPERSEDED","CONFIRMATION_CONTESTED","CONFIRMATION_WITHDRAWN"]},"nextState":{"enum":["AWAITING_SUPPLIER","AGREEMENT_CHANGES_REQUESTED","SUPPLIER_DECLINED","LOCKED","SUBMITTED","CHANGES_REQUESTED","AWAITING_EVIDENCE","BUYER_CONFIRMED","BUYER_REJECTED","SUPERSEDED","CONFIRMATION_CONTESTED","CONFIRMATION_WITHDRAWN"]},"deliveryId":{"anyOf":[{"type":"string","minLength":1,"maxLength":512},{"type":"null"}]},"decisionId":{"anyOf":[{"type":"string","minLength":1,"maxLength":512},{"type":"null"}]},"actor":{"$ref":"#/$defs/actor"},"statement":{}}},"party":{"type":"object","additionalProperties":false,"required":["id","name"],"properties":{"id":{"type":"string","minLength":1,"maxLength":512},"name":{"type":"string","minLength":1,"maxLength":512}}},"content":{"type":"object","additionalProperties":false,"required":["schema","canonicalization","identity","profile","specification","deliveries","decisions","observations","history","current","issuance"],"properties":{"schema":{"const":"prooftask.result-core/v1"},"canonicalization":{"const":"prooftask.jcs-rfc8785/v2"},"identity":{"type":"object","additionalProperties":false,"required":["id","issuer"],"properties":{"id":{"type":"string","pattern":"^result_[a-f0-9]{64}$","minLength":71,"maxLength":71},"issuer":{"const":"https://app.prooftask.ai"}}},"profile":{"enum":["CUSTOM_DELIVERY","API_INTEGRATION"]},"specification":{"type":"object","additionalProperties":false,"required":["reference","sourceSchema","parties","terms","termsDigest"],"properties":{"reference":{"$ref":"#/$defs/reference"},"sourceSchema":{"type":"string","minLength":1,"maxLength":512},"parties":{"type":"object","additionalProperties":false,"required":["buyer","provider"],"properties":{"buyer":{"$ref":"#/$defs/party"},"provider":{"$ref":"#/$defs/party"}}},"terms":{},"termsDigest":{"$ref":"#/$defs/digest"}}},"deliveries":{"type":"array","items":{"$ref":"#/$defs/delivery"},"maxItems":500},"decisions":{"type":"array","items":{"$ref":"#/$defs/decision"},"maxItems":500},"observations":{"$ref":"#/$defs/manifest"},"history":{"type":"object","additionalProperties":false,"required":["coverage","events"],"properties":{"coverage":{"enum":["BUYER_DECISION_EVENTS","SOURCE_PROFILE_REQUIRED"]},"events":{"type":"array","items":{"$ref":"#/$defs/transition"},"maxItems":500}}},"current":{"type":"object","additionalProperties":false,"required":["sourceState","deliveryId","decisionId"],"properties":{"sourceState":{"type":"string","minLength":1,"maxLength":512},"deliveryId":{"anyOf":[{"type":"string","minLength":1,"maxLength":512},{"type":"null"}]},"decisionId":{"anyOf":[{"type":"string","minLength":1,"maxLength":512},{"type":"null"}]}}},"issuance":{"type":"object","additionalProperties":false,"required":["kind","state","id"],"properties":{"kind":{"enum":["RESULT_RECORD","COMPLETION_RECEIPT"]},"state":{"enum":["ISSUED","NOT_ISSUED"]},"id":{"anyOf":[{"type":"string","minLength":1,"maxLength":512},{"type":"null"}]}}}}},"packageHeader":{"type":"object","additionalProperties":false,"required":["alg","kid","typ","cty"],"properties":{"alg":{"const":"Ed25519"},"kid":{"type":"string","minLength":1,"maxLength":128,"pattern":"^[A-Za-z0-9][A-Za-z0-9._:/-]{0,127}$"},"typ":{"const":"prooftask-result-package+jws"},"cty":{"const":"application/json"}}},"packageContent":{"type":"object","additionalProperties":false,"required":["schema","canonicalization","verificationProfile","exportedAt","issuerRelease","coverage","core","files","manifest"],"properties":{"schema":{"const":"prooftask.result-package/v2"},"canonicalization":{"const":"prooftask.jcs-rfc8785/v2"},"verificationProfile":{"const":"prooftask.result-package-verification/v2"},"exportedAt":{"type":"string","minLength":1,"maxLength":24},"issuerRelease":{"anyOf":[{"type":"null"},{"type":"object","additionalProperties":false,"required":["commitSha","deploymentId","environment"],"properties":{"commitSha":{"type":"string","minLength":1,"maxLength":256},"deploymentId":{"type":"string","minLength":1,"maxLength":256},"environment":{"type":"string","minLength":1,"maxLength":256}}}]},"coverage":{"const":"SINGLE_SPECIFICATION_HISTORY"},"core":{"description":"Unsigned content contract. JSON Schema checks structure only; the profile also requires relational validation. Source hashes are preserved, not recomputed with JCS. Claims and terms remain profile-specific JSON. No authentication or current-status assertion.","type":"object","additionalProperties":false,"required":["content","versionDigest"],"properties":{"content":{"$ref":"#/$defs/content"},"versionDigest":{"$ref":"#/$defs/digest"}}},"files":{"type":"array","minItems":3,"maxItems":3,"prefixItems":[{"type":"object","additionalProperties":false,"required":["path","mediaType","content"],"properties":{"path":{"const":"source-record.json"},"mediaType":{"const":"application/json"},"content":{"type":"string","minLength":1,"maxLength":2097152}}},{"type":"object","additionalProperties":false,"required":["path","mediaType","content"],"properties":{"path":{"const":"result.txt"},"mediaType":{"const":"text/plain"},"content":{"type":"string","minLength":1,"maxLength":2097152}}},{"type":"object","additionalProperties":false,"required":["path","mediaType","content"],"properties":{"path":{"const":"authority-chain.json"},"mediaType":{"const":"application/json"},"content":{"type":"string","minLength":1,"maxLength":2097152}}}],"items":false},"manifest":{"type":"array","minItems":4,"maxItems":4,"prefixItems":[{"type":"object","additionalProperties":false,"required":["path","mediaType","byteLength","digest"],"properties":{"path":{"const":"result.json"},"mediaType":{"const":"application/json"},"byteLength":{"type":"integer","minimum":0,"maximum":2097152},"digest":{"$ref":"#/$defs/digest"}}},{"type":"object","additionalProperties":false,"required":["path","mediaType","byteLength","digest"],"properties":{"path":{"const":"source-record.json"},"mediaType":{"const":"application/json"},"byteLength":{"type":"integer","minimum":0,"maximum":2097152},"digest":{"$ref":"#/$defs/digest"}}},{"type":"object","additionalProperties":false,"required":["path","mediaType","byteLength","digest"],"properties":{"path":{"const":"result.txt"},"mediaType":{"const":"text/plain"},"byteLength":{"type":"integer","minimum":0,"maximum":2097152},"digest":{"$ref":"#/$defs/digest"}}},{"type":"object","additionalProperties":false,"required":["path","mediaType","byteLength","digest"],"properties":{"path":{"const":"authority-chain.json"},"mediaType":{"const":"application/json"},"byteLength":{"type":"integer","minimum":0,"maximum":2097152},"digest":{"$ref":"#/$defs/digest"}}}],"items":false}}}}}