@kya-os/mcp 1.10.1 → 1.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (220) hide show
  1. package/AUDITABILITY.md +441 -0
  2. package/CHANGELOG.md +88 -0
  3. package/CONFORMANCE.md +598 -0
  4. package/README.md +67 -4
  5. package/SPEC.md +1827 -0
  6. package/dist/audit/adapters/legacy-audit-log.d.ts +20 -0
  7. package/dist/audit/adapters/legacy-audit-log.d.ts.map +1 -0
  8. package/dist/audit/adapters/legacy-audit-log.js +56 -0
  9. package/dist/audit/adapters/legacy-audit-log.js.map +1 -0
  10. package/dist/audit/adapters/mcp.d.ts +105 -0
  11. package/dist/audit/adapters/mcp.d.ts.map +1 -0
  12. package/dist/audit/adapters/mcp.js +213 -0
  13. package/dist/audit/adapters/mcp.js.map +1 -0
  14. package/dist/audit/assurance.d.ts +22 -0
  15. package/dist/audit/assurance.d.ts.map +1 -0
  16. package/dist/audit/assurance.js +39 -0
  17. package/dist/audit/assurance.js.map +1 -0
  18. package/dist/audit/checkpoint-coordinator.d.ts +51 -0
  19. package/dist/audit/checkpoint-coordinator.d.ts.map +1 -0
  20. package/dist/audit/checkpoint-coordinator.js +112 -0
  21. package/dist/audit/checkpoint-coordinator.js.map +1 -0
  22. package/dist/audit/checkpoint.d.ts +59 -0
  23. package/dist/audit/checkpoint.d.ts.map +1 -0
  24. package/dist/audit/checkpoint.js +219 -0
  25. package/dist/audit/checkpoint.js.map +1 -0
  26. package/dist/audit/cli.d.ts +8 -0
  27. package/dist/audit/cli.d.ts.map +1 -0
  28. package/dist/audit/cli.js +85 -0
  29. package/dist/audit/cli.js.map +1 -0
  30. package/dist/audit/crypto.d.ts +37 -0
  31. package/dist/audit/crypto.d.ts.map +1 -0
  32. package/dist/audit/crypto.js +68 -0
  33. package/dist/audit/crypto.js.map +1 -0
  34. package/dist/audit/errors.d.ts +29 -0
  35. package/dist/audit/errors.d.ts.map +1 -0
  36. package/dist/audit/errors.js +33 -0
  37. package/dist/audit/errors.js.map +1 -0
  38. package/dist/audit/evidence.d.ts +45 -0
  39. package/dist/audit/evidence.d.ts.map +1 -0
  40. package/dist/audit/evidence.js +151 -0
  41. package/dist/audit/evidence.js.map +1 -0
  42. package/dist/audit/index.d.ts +27 -0
  43. package/dist/audit/index.d.ts.map +1 -0
  44. package/dist/audit/index.js +27 -0
  45. package/dist/audit/index.js.map +1 -0
  46. package/dist/audit/integrity.d.ts +19 -0
  47. package/dist/audit/integrity.d.ts.map +1 -0
  48. package/dist/audit/integrity.js +64 -0
  49. package/dist/audit/integrity.js.map +1 -0
  50. package/dist/audit/merkle.d.ts +31 -0
  51. package/dist/audit/merkle.d.ts.map +1 -0
  52. package/dist/audit/merkle.js +195 -0
  53. package/dist/audit/merkle.js.map +1 -0
  54. package/dist/audit/mirror-service.d.ts +19 -0
  55. package/dist/audit/mirror-service.d.ts.map +1 -0
  56. package/dist/audit/mirror-service.js +54 -0
  57. package/dist/audit/mirror-service.js.map +1 -0
  58. package/dist/audit/projection.d.ts +90 -0
  59. package/dist/audit/projection.d.ts.map +1 -0
  60. package/dist/audit/projection.js +142 -0
  61. package/dist/audit/projection.js.map +1 -0
  62. package/dist/audit/providers/anchor.d.ts +23 -0
  63. package/dist/audit/providers/anchor.d.ts.map +1 -0
  64. package/dist/audit/providers/anchor.js +25 -0
  65. package/dist/audit/providers/anchor.js.map +1 -0
  66. package/dist/audit/providers/evidence.d.ts +36 -0
  67. package/dist/audit/providers/evidence.d.ts.map +1 -0
  68. package/dist/audit/providers/evidence.js +2 -0
  69. package/dist/audit/providers/evidence.js.map +1 -0
  70. package/dist/audit/providers/journal.d.ts +35 -0
  71. package/dist/audit/providers/journal.d.ts.map +1 -0
  72. package/dist/audit/providers/journal.js +2 -0
  73. package/dist/audit/providers/journal.js.map +1 -0
  74. package/dist/audit/providers/memory-journal.d.ts +24 -0
  75. package/dist/audit/providers/memory-journal.d.ts.map +1 -0
  76. package/dist/audit/providers/memory-journal.js +73 -0
  77. package/dist/audit/providers/memory-journal.js.map +1 -0
  78. package/dist/audit/providers/observer.d.ts +30 -0
  79. package/dist/audit/providers/observer.d.ts.map +1 -0
  80. package/dist/audit/providers/observer.js +100 -0
  81. package/dist/audit/providers/observer.js.map +1 -0
  82. package/dist/audit/providers/outbox.d.ts +37 -0
  83. package/dist/audit/providers/outbox.d.ts.map +1 -0
  84. package/dist/audit/providers/outbox.js +52 -0
  85. package/dist/audit/providers/outbox.js.map +1 -0
  86. package/dist/audit/providers/recorder-client.d.ts +22 -0
  87. package/dist/audit/providers/recorder-client.d.ts.map +1 -0
  88. package/dist/audit/providers/recorder-client.js +17 -0
  89. package/dist/audit/providers/recorder-client.js.map +1 -0
  90. package/dist/audit/providers/source-state.d.ts +37 -0
  91. package/dist/audit/providers/source-state.d.ts.map +1 -0
  92. package/dist/audit/providers/source-state.js +94 -0
  93. package/dist/audit/providers/source-state.js.map +1 -0
  94. package/dist/audit/recorder-service.d.ts +78 -0
  95. package/dist/audit/recorder-service.d.ts.map +1 -0
  96. package/dist/audit/recorder-service.js +331 -0
  97. package/dist/audit/recorder-service.js.map +1 -0
  98. package/dist/audit/replay-bundle.d.ts +52 -0
  99. package/dist/audit/replay-bundle.d.ts.map +1 -0
  100. package/dist/audit/replay-bundle.js +551 -0
  101. package/dist/audit/replay-bundle.js.map +1 -0
  102. package/dist/audit/schemas.d.ts +1144 -0
  103. package/dist/audit/schemas.d.ts.map +1 -0
  104. package/dist/audit/schemas.js +483 -0
  105. package/dist/audit/schemas.js.map +1 -0
  106. package/dist/audit/service.d.ts +91 -0
  107. package/dist/audit/service.d.ts.map +1 -0
  108. package/dist/audit/service.js +222 -0
  109. package/dist/audit/service.js.map +1 -0
  110. package/dist/audit/testing/index.d.ts +2 -0
  111. package/dist/audit/testing/index.d.ts.map +1 -0
  112. package/dist/audit/testing/index.js +2 -0
  113. package/dist/audit/testing/index.js.map +1 -0
  114. package/dist/audit/testing/provider-contracts.d.ts +51 -0
  115. package/dist/audit/testing/provider-contracts.d.ts.map +1 -0
  116. package/dist/audit/testing/provider-contracts.js +391 -0
  117. package/dist/audit/testing/provider-contracts.js.map +1 -0
  118. package/dist/audit/types.d.ts +356 -0
  119. package/dist/audit/types.d.ts.map +1 -0
  120. package/dist/audit/types.js +49 -0
  121. package/dist/audit/types.js.map +1 -0
  122. package/dist/audit/verifier.d.ts +73 -0
  123. package/dist/audit/verifier.d.ts.map +1 -0
  124. package/dist/audit/verifier.js +322 -0
  125. package/dist/audit/verifier.js.map +1 -0
  126. package/dist/card/proof/canonical.d.ts.map +1 -1
  127. package/dist/card/proof/canonical.js +19 -1
  128. package/dist/card/proof/canonical.js.map +1 -1
  129. package/dist/delegation/delegation-graph.d.ts +4 -0
  130. package/dist/delegation/delegation-graph.d.ts.map +1 -1
  131. package/dist/delegation/delegation-graph.js +28 -2
  132. package/dist/delegation/delegation-graph.js.map +1 -1
  133. package/dist/delegation/statuslist-manager.d.ts +5 -0
  134. package/dist/delegation/statuslist-manager.d.ts.map +1 -1
  135. package/dist/delegation/statuslist-manager.js.map +1 -1
  136. package/dist/delegation/storage/memory-graph-storage.d.ts +4 -2
  137. package/dist/delegation/storage/memory-graph-storage.d.ts.map +1 -1
  138. package/dist/delegation/storage/memory-graph-storage.js +18 -0
  139. package/dist/delegation/storage/memory-graph-storage.js.map +1 -1
  140. package/dist/delegation/storage/memory-statuslist-storage.d.ts +5 -2
  141. package/dist/delegation/storage/memory-statuslist-storage.d.ts.map +1 -1
  142. package/dist/delegation/storage/memory-statuslist-storage.js +21 -2
  143. package/dist/delegation/storage/memory-statuslist-storage.js.map +1 -1
  144. package/dist/delegation/utils.d.ts.map +1 -1
  145. package/dist/delegation/utils.js +2 -42
  146. package/dist/delegation/utils.js.map +1 -1
  147. package/dist/delegation/vc-verifier.d.ts +4 -0
  148. package/dist/delegation/vc-verifier.d.ts.map +1 -1
  149. package/dist/delegation/vc-verifier.js +44 -13
  150. package/dist/delegation/vc-verifier.js.map +1 -1
  151. package/dist/errors.d.ts +1 -1
  152. package/dist/errors.js +1 -1
  153. package/dist/index.d.ts +2 -1
  154. package/dist/index.d.ts.map +1 -1
  155. package/dist/index.js +3 -1
  156. package/dist/index.js.map +1 -1
  157. package/dist/middleware/kya-os-transport.d.ts.map +1 -1
  158. package/dist/middleware/kya-os-transport.js +10 -3
  159. package/dist/middleware/kya-os-transport.js.map +1 -1
  160. package/dist/middleware/with-kya-os-server.d.ts +6 -0
  161. package/dist/middleware/with-kya-os-server.d.ts.map +1 -1
  162. package/dist/middleware/with-kya-os-server.js +2 -0
  163. package/dist/middleware/with-kya-os-server.js.map +1 -1
  164. package/dist/middleware/with-kya-os.config-types.d.ts +15 -0
  165. package/dist/middleware/with-kya-os.config-types.d.ts.map +1 -1
  166. package/dist/middleware/with-kya-os.config-types.js.map +1 -1
  167. package/dist/middleware/with-kya-os.d.ts.map +1 -1
  168. package/dist/middleware/with-kya-os.delegation-gate.d.ts.map +1 -1
  169. package/dist/middleware/with-kya-os.delegation-gate.js +96 -3
  170. package/dist/middleware/with-kya-os.delegation-gate.js.map +1 -1
  171. package/dist/middleware/with-kya-os.deps.d.ts +2 -0
  172. package/dist/middleware/with-kya-os.deps.d.ts.map +1 -1
  173. package/dist/middleware/with-kya-os.js +23 -0
  174. package/dist/middleware/with-kya-os.js.map +1 -1
  175. package/dist/middleware/with-kya-os.policy-gate.d.ts.map +1 -1
  176. package/dist/middleware/with-kya-os.policy-gate.js +29 -4
  177. package/dist/middleware/with-kya-os.policy-gate.js.map +1 -1
  178. package/dist/middleware/with-kya-os.protocol.d.ts.map +1 -1
  179. package/dist/middleware/with-kya-os.protocol.js +10 -0
  180. package/dist/middleware/with-kya-os.protocol.js.map +1 -1
  181. package/dist/middleware/with-kya-os.session.d.ts.map +1 -1
  182. package/dist/middleware/with-kya-os.session.js +208 -2
  183. package/dist/middleware/with-kya-os.session.js.map +1 -1
  184. package/dist/middleware/with-kya-os.types.d.ts +6 -0
  185. package/dist/middleware/with-kya-os.types.d.ts.map +1 -1
  186. package/dist/middleware/with-kya-os.types.js.map +1 -1
  187. package/dist/proof/generator.d.ts.map +1 -1
  188. package/dist/proof/generator.js +6 -5
  189. package/dist/proof/generator.js.map +1 -1
  190. package/dist/proof/verifier.d.ts +12 -0
  191. package/dist/proof/verifier.d.ts.map +1 -1
  192. package/dist/proof/verifier.js +35 -4
  193. package/dist/proof/verifier.js.map +1 -1
  194. package/dist/session/manager.js +1 -1
  195. package/dist/session/manager.js.map +1 -1
  196. package/dist/utils/canonical-json.d.ts +15 -0
  197. package/dist/utils/canonical-json.d.ts.map +1 -0
  198. package/dist/utils/canonical-json.js +109 -0
  199. package/dist/utils/canonical-json.js.map +1 -0
  200. package/dist/utils/crypto-service.d.ts.map +1 -1
  201. package/dist/utils/crypto-service.js +5 -0
  202. package/dist/utils/crypto-service.js.map +1 -1
  203. package/dist/utils/index.d.ts +1 -0
  204. package/dist/utils/index.d.ts.map +1 -1
  205. package/dist/utils/index.js +1 -0
  206. package/dist/utils/index.js.map +1 -1
  207. package/package.json +29 -11
  208. package/schemas/README.md +27 -1
  209. package/schemas/audit-anchor-receipt.schema.json +16 -0
  210. package/schemas/audit-bundle-manifest.schema.json +71 -0
  211. package/schemas/audit-checkpoint.schema.json +37 -0
  212. package/schemas/audit-consistency-proof.schema.json +17 -0
  213. package/schemas/audit-entry.schema.json +33 -0
  214. package/schemas/audit-event.schema.json +168 -0
  215. package/schemas/audit-inclusion-proof.schema.json +17 -0
  216. package/schemas/audit-observation.schema.json +40 -0
  217. package/schemas/audit-receipt.schema.json +32 -0
  218. package/schemas/audit-verification-policy.schema.json +71 -0
  219. package/schemas/audit-verification-report.schema.json +29 -0
  220. package/schemas/well-known-mcpi.json +17 -0
@@ -0,0 +1,168 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://schema.kya-os.org/v1/protocol/audit/event/v1.0.0",
4
+ "title": "KYA-OS Audit Producer Event v1",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": ["schema", "eventId", "eventType", "eventVersion", "binding", "occurredAt", "tenantRef", "source", "action", "outcome", "evidence", "details", "privacy"],
8
+ "properties": {
9
+ "schema": { "const": "https://schema.kya-os.org/v1/protocol/audit/event/v1.0.0" },
10
+ "eventId": { "type": "string", "minLength": 1, "maxLength": 256 },
11
+ "eventType": {
12
+ "enum": [
13
+ "session.established", "session.rejected", "session.expired", "session.replay_rejected",
14
+ "tool.call.started", "tool.call.completed", "tool.call.failed", "tool.call.denied", "tool.call.challenged",
15
+ "proof.generated", "proof.verified", "proof.rejected",
16
+ "delegation.issued", "delegation.verified", "delegation.rejected", "delegation.revoked", "delegation.cascade_revoked", "delegation.outbound_attached",
17
+ "authorization.evaluated", "authorization.approved", "authorization.denied", "authorization.step_up_required", "grant.used",
18
+ "consent.requested", "consent.approved", "consent.denied", "credential.required", "credential.verified", "credential.failed",
19
+ "key.rotated", "policy.changed", "configuration.changed", "integrity_suite.transitioned",
20
+ "ledger.epoch.started", "ledger.epoch.transitioned", "checkpoint.created", "checkpoint.anchored", "checkpoint.anchor_failed", "evidence.disposed", "projection.reconciled",
21
+ "audit.source_high_water", "audit.accessed", "audit.exported", "legal_hold.applied", "retention.executed"
22
+ ]
23
+ },
24
+ "eventVersion": { "const": "1.0.0" },
25
+ "binding": { "type": "string", "maxLength": 256, "pattern": "^urn:kya-os:audit-binding:[a-z0-9][a-z0-9._:-]*$" },
26
+ "occurredAt": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 },
27
+ "tenantRef": { "$ref": "#/$defs/partyRef" },
28
+ "source": {
29
+ "type": "object", "additionalProperties": false,
30
+ "required": ["producer", "sourceId"],
31
+ "properties": {
32
+ "producer": { "$ref": "#/$defs/partyRef" },
33
+ "sourceId": { "type": "string", "minLength": 1, "maxLength": 256 },
34
+ "sourceSequence": { "$ref": "#/$defs/decimal" },
35
+ "previousSourceEventDigest": { "$ref": "#/$defs/digest" }
36
+ }
37
+ },
38
+ "correlationId": { "type": "string", "minLength": 1, "maxLength": 256 },
39
+ "causationId": { "type": "string", "minLength": 1, "maxLength": 256 },
40
+ "trace": {
41
+ "type": "object", "additionalProperties": false,
42
+ "properties": {
43
+ "traceId": { "type": "string", "pattern": "^[a-f0-9]{32}$" },
44
+ "spanId": { "type": "string", "pattern": "^[a-f0-9]{16}$" }
45
+ }
46
+ },
47
+ "session": {
48
+ "type": "object", "additionalProperties": false, "required": ["ref"],
49
+ "properties": {
50
+ "ref": { "$ref": "#/$defs/partyRef" },
51
+ "handshakeNonceCommitment": { "$ref": "#/$defs/digest" }
52
+ }
53
+ },
54
+ "actor": { "$ref": "#/$defs/partyRef" },
55
+ "responsibleParty": { "$ref": "#/$defs/partyRef" },
56
+ "resource": { "$ref": "#/$defs/partyRef" },
57
+ "action": {
58
+ "type": "object", "additionalProperties": false, "required": ["category"],
59
+ "properties": {
60
+ "category": { "type": "string", "minLength": 1, "maxLength": 128 },
61
+ "name": { "type": "string", "minLength": 1, "maxLength": 256 },
62
+ "detailRef": { "$ref": "#/$defs/evidenceRef" }
63
+ }
64
+ },
65
+ "outcome": { "enum": ["succeeded", "failed", "denied", "challenged", "unknown"] },
66
+ "reason": {
67
+ "type": "object", "additionalProperties": false, "required": ["code"],
68
+ "properties": {
69
+ "code": { "type": "string", "minLength": 1, "maxLength": 128 },
70
+ "detailRef": { "$ref": "#/$defs/evidenceRef" }
71
+ }
72
+ },
73
+ "authorization": {
74
+ "type": "object", "additionalProperties": false, "required": ["source", "decision"],
75
+ "properties": {
76
+ "source": { "enum": ["delegation", "grant", "anonymous", "policy"] },
77
+ "decision": { "enum": ["allowed", "denied", "step_up_required", "needs_authorization"] },
78
+ "scopeId": { "type": "string", "minLength": 1, "maxLength": 256 },
79
+ "delegationRef": { "type": "string", "minLength": 1, "maxLength": 256 },
80
+ "delegationCredentialDigest": { "$ref": "#/$defs/digest" },
81
+ "delegationChainDigests": { "type": "array", "maxItems": 256, "items": { "$ref": "#/$defs/digest" } },
82
+ "statusEvidence": { "type": "array", "maxItems": 256, "items": { "$ref": "#/$defs/evidenceRef" } },
83
+ "grantRef": { "type": "string", "minLength": 1, "maxLength": 256 },
84
+ "policyId": { "type": "string", "minLength": 1, "maxLength": 256 },
85
+ "policyVersion": { "type": "string", "minLength": 1, "maxLength": 256 },
86
+ "policyDigest": { "$ref": "#/$defs/digest" },
87
+ "verificationCode": { "type": "string", "minLength": 1, "maxLength": 128 }
88
+ }
89
+ },
90
+ "proof": { "$ref": "#/$defs/evidenceRef" },
91
+ "evidence": { "type": "array", "maxItems": 256, "items": { "$ref": "#/$defs/evidenceRef" } },
92
+ "details": { "$ref": "#/$defs/details" },
93
+ "privacy": {
94
+ "type": "object", "additionalProperties": false,
95
+ "required": ["classification", "retentionClass"],
96
+ "properties": {
97
+ "classification": { "enum": ["public", "internal", "confidential", "restricted"] },
98
+ "retentionClass": { "type": "string", "minLength": 1, "maxLength": 128 },
99
+ "legalHold": { "type": "string", "minLength": 1, "maxLength": 256 }
100
+ }
101
+ }
102
+ },
103
+ "allOf": [
104
+ { "if": { "properties": { "eventType": { "pattern": "^session\\." } } }, "then": { "properties": { "details": { "properties": { "family": { "const": "session" } } } } } },
105
+ { "if": { "properties": { "eventType": { "pattern": "^tool\\." } } }, "then": { "properties": { "details": { "properties": { "family": { "const": "tool" } } } } } },
106
+ { "if": { "properties": { "eventType": { "pattern": "^proof\\." } } }, "then": { "properties": { "details": { "properties": { "family": { "const": "proof" } } } } } },
107
+ { "if": { "properties": { "eventType": { "pattern": "^delegation\\." } } }, "then": { "properties": { "details": { "properties": { "family": { "const": "delegation" } } } } } },
108
+ { "if": { "properties": { "eventType": { "pattern": "^(authorization\\.|grant\\.)" } } }, "then": { "properties": { "details": { "properties": { "family": { "const": "authorization" } } } } } },
109
+ { "if": { "properties": { "eventType": { "pattern": "^(consent\\.|credential\\.)" } } }, "then": { "properties": { "details": { "properties": { "family": { "const": "consent" } } } } } },
110
+ { "if": { "properties": { "eventType": { "pattern": "^(key\\.|policy\\.|configuration\\.|integrity_suite\\.)" } } }, "then": { "properties": { "details": { "properties": { "family": { "const": "key" } } } } } },
111
+ { "if": { "properties": { "eventType": { "pattern": "^(ledger\\.|checkpoint\\.|evidence\\.|projection\\.)" } } }, "then": { "properties": { "details": { "properties": { "family": { "const": "ledger" } } } } } },
112
+ { "if": { "properties": { "eventType": { "pattern": "^(audit\\.|legal_hold\\.|retention\\.)" } } }, "then": { "properties": { "details": { "properties": { "family": { "const": "administration" } } } } } }
113
+ ],
114
+ "$defs": {
115
+ "decimal": { "type": "string", "maxLength": 20, "pattern": "^(0|[1-9][0-9]*)$" },
116
+ "digest": { "type": "string", "pattern": "^sha256:[a-f0-9]{64}$" },
117
+ "signerRef": {
118
+ "type": "object", "additionalProperties": false, "required": ["did", "kid", "alg"],
119
+ "properties": {
120
+ "did": { "type": "string", "minLength": 5, "maxLength": 2048, "pattern": "^did:[^\\r\\n]+$" },
121
+ "kid": { "type": "string", "minLength": 1, "maxLength": 2304 },
122
+ "alg": { "enum": ["EdDSA", "ES256"] }
123
+ }
124
+ },
125
+ "evidenceRef": {
126
+ "type": "object", "additionalProperties": false,
127
+ "required": ["objectId", "ciphertextDigest", "mediaType", "size", "encryption"],
128
+ "properties": {
129
+ "objectId": { "type": "string", "minLength": 1, "maxLength": 256 },
130
+ "ciphertextDigest": { "$ref": "#/$defs/digest" },
131
+ "plaintextCommitment": { "$ref": "#/$defs/digest" },
132
+ "mediaType": { "type": "string", "minLength": 1, "maxLength": 256 },
133
+ "size": { "$ref": "#/$defs/decimal" },
134
+ "encryption": {
135
+ "type": "object", "additionalProperties": false,
136
+ "required": ["suite", "keyId", "nonce", "aadDigest"],
137
+ "properties": {
138
+ "suite": { "const": "A256GCM" },
139
+ "keyId": { "type": "string", "minLength": 1, "maxLength": 256 },
140
+ "nonce": { "type": "string", "minLength": 1, "maxLength": 256 },
141
+ "aadDigest": { "$ref": "#/$defs/digest" }
142
+ }
143
+ }
144
+ }
145
+ },
146
+ "partyRef": {
147
+ "oneOf": [
148
+ { "type": "object", "additionalProperties": false, "required": ["kind", "did"], "properties": { "kind": { "const": "public_did" }, "did": { "type": "string", "minLength": 5, "maxLength": 2048, "pattern": "^did:[^\\r\\n]+$" } } },
149
+ { "type": "object", "additionalProperties": false, "required": ["kind", "did"], "properties": { "kind": { "const": "pairwise_did" }, "did": { "type": "string", "minLength": 5, "maxLength": 2048, "pattern": "^did:[^\\r\\n]+$" } } },
150
+ { "type": "object", "additionalProperties": false, "required": ["kind", "value", "keyId"], "properties": { "kind": { "const": "keyed_commitment" }, "value": { "$ref": "#/$defs/digest" }, "keyId": { "type": "string", "minLength": 1, "maxLength": 256 } } },
151
+ { "type": "object", "additionalProperties": false, "required": ["kind", "ref"], "properties": { "kind": { "const": "evidence_ref" }, "ref": { "$ref": "#/$defs/evidenceRef" } } }
152
+ ]
153
+ },
154
+ "details": {
155
+ "oneOf": [
156
+ { "type": "object", "additionalProperties": false, "required": ["family", "phase"], "properties": { "family": { "const": "session" }, "phase": { "enum": ["established", "rejected", "expired", "replay_rejected"] }, "reasonCode": { "type": "string", "minLength": 1, "maxLength": 128 } } },
157
+ { "type": "object", "additionalProperties": false, "required": ["family", "phase", "attempt"], "properties": { "family": { "const": "tool" }, "phase": { "enum": ["started", "completed", "failed", "denied", "challenged"] }, "attempt": { "$ref": "#/$defs/decimal" }, "idempotencyRef": { "type": "string", "minLength": 1, "maxLength": 256 } } },
158
+ { "type": "object", "additionalProperties": false, "required": ["family", "phase"], "properties": { "family": { "const": "proof" }, "phase": { "enum": ["generated", "verified", "rejected"] }, "proofDigest": { "$ref": "#/$defs/digest" }, "verificationCode": { "type": "string", "minLength": 1, "maxLength": 128 } } },
159
+ { "type": "object", "additionalProperties": false, "required": ["family", "phase", "delegationRef"], "properties": { "family": { "const": "delegation" }, "phase": { "enum": ["issued", "verified", "rejected", "revoked", "cascade_revoked", "outbound_attached"] }, "delegationRef": { "type": "string", "minLength": 1, "maxLength": 256 }, "parentRef": { "type": "string", "minLength": 1, "maxLength": 256 }, "statusEvidence": { "type": "array", "maxItems": 256, "items": { "$ref": "#/$defs/evidenceRef" } } } },
160
+ { "type": "object", "additionalProperties": false, "required": ["family", "phase"], "properties": { "family": { "const": "authorization" }, "phase": { "enum": ["evaluated", "approved", "denied", "step_up_required", "grant_used"] }, "policyDigest": { "$ref": "#/$defs/digest" }, "grantRef": { "type": "string", "minLength": 1, "maxLength": 256 } } },
161
+ { "type": "object", "additionalProperties": false, "required": ["family", "phase"], "properties": { "family": { "const": "consent" }, "phase": { "enum": ["requested", "approved", "denied", "credential_required", "credential_verified", "credential_failed"] }, "consentRef": { "type": "string", "minLength": 1, "maxLength": 256 } } },
162
+ { "type": "object", "additionalProperties": false, "required": ["family", "phase"], "properties": { "family": { "const": "key" }, "phase": { "enum": ["rotated", "policy_changed", "configuration_changed", "integrity_suite_transitioned"] }, "previousSigner": { "$ref": "#/$defs/signerRef" }, "nextSigner": { "$ref": "#/$defs/signerRef" }, "configurationDigest": { "$ref": "#/$defs/digest" } } },
163
+ { "type": "object", "additionalProperties": false, "required": ["family", "phase"], "properties": { "family": { "const": "ledger" }, "phase": { "enum": ["epoch_started", "epoch_transitioned", "checkpoint_created", "checkpoint_anchored", "checkpoint_anchor_failed", "evidence_disposed", "projection_reconciled"] }, "checkpointDigest": { "$ref": "#/$defs/digest" }, "previousEpochId": { "type": "string", "minLength": 1, "maxLength": 256 }, "previousTerminalCheckpointDigest": { "$ref": "#/$defs/digest" }, "successorEpochIds": { "type": "array", "maxItems": 256, "items": { "type": "string", "minLength": 1, "maxLength": 256 } }, "targetEvidenceRef": { "$ref": "#/$defs/evidenceRef" } } },
164
+ { "type": "object", "additionalProperties": false, "required": ["family", "phase"], "properties": { "family": { "const": "administration" }, "phase": { "enum": ["source_high_water", "accessed", "exported", "legal_hold_applied", "retention_executed"] }, "purpose": { "type": "string", "minLength": 1, "maxLength": 256 }, "sourceSequence": { "$ref": "#/$defs/decimal" }, "selectionDigest": { "$ref": "#/$defs/digest" } } }
165
+ ]
166
+ }
167
+ }
168
+ }
@@ -0,0 +1,17 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://schema.kya-os.org/v1/protocol/audit/inclusion-proof/v1.0.0",
4
+ "title": "KYA-OS RFC 9162 Inclusion Proof v1",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": ["leafIndex", "treeSize", "auditPath"],
8
+ "properties": {
9
+ "leafIndex": { "$ref": "#/$defs/decimal" },
10
+ "treeSize": { "$ref": "#/$defs/decimal" },
11
+ "auditPath": { "type": "array", "items": { "$ref": "#/$defs/digest" } }
12
+ },
13
+ "$defs": {
14
+ "decimal": { "type": "string", "maxLength": 20, "pattern": "^(0|[1-9][0-9]*)$" },
15
+ "digest": { "type": "string", "pattern": "^sha256:[a-f0-9]{64}$" }
16
+ }
17
+ }
@@ -0,0 +1,40 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://schema.kya-os.org/v1/protocol/audit/observation/v1.0.0",
4
+ "title": "KYA-OS Independent Checkpoint Observation Receipt v1",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": ["core", "observationDigest", "jws"],
8
+ "properties": {
9
+ "core": { "$ref": "#/$defs/core" },
10
+ "observationDigest": { "$ref": "#/$defs/digest" },
11
+ "jws": { "type": "string", "minLength": 1, "maxLength": 4096 }
12
+ },
13
+ "$defs": {
14
+ "decimal": { "type": "string", "maxLength": 20, "pattern": "^(0|[1-9][0-9]*)$" },
15
+ "digest": { "type": "string", "pattern": "^sha256:[a-f0-9]{64}$" },
16
+ "signer": {
17
+ "type": "object", "additionalProperties": false, "required": ["did", "kid", "alg"],
18
+ "properties": {
19
+ "did": { "type": "string", "minLength": 5, "maxLength": 2048, "pattern": "^did:[^\\r\\n]+$" },
20
+ "kid": { "type": "string", "minLength": 1, "maxLength": 2304 },
21
+ "alg": { "enum": ["EdDSA", "ES256"] }
22
+ }
23
+ },
24
+ "core": {
25
+ "type": "object", "additionalProperties": false,
26
+ "required": ["schema", "observerId", "observer", "ledgerId", "ledgerEpochId", "checkpointDigest", "treeSize", "observedAt", "previousObservationDigest"],
27
+ "properties": {
28
+ "schema": { "const": "https://schema.kya-os.org/v1/protocol/audit/observation/v1.0.0" },
29
+ "observerId": { "type": "string", "minLength": 1, "maxLength": 256 },
30
+ "observer": { "$ref": "#/$defs/signer" },
31
+ "ledgerId": { "type": "string", "minLength": 1, "maxLength": 256 },
32
+ "ledgerEpochId": { "type": "string", "minLength": 1, "maxLength": 256 },
33
+ "checkpointDigest": { "$ref": "#/$defs/digest" },
34
+ "treeSize": { "$ref": "#/$defs/decimal" },
35
+ "observedAt": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 },
36
+ "previousObservationDigest": { "oneOf": [{ "$ref": "#/$defs/digest" }, { "type": "null" }] }
37
+ }
38
+ }
39
+ }
40
+ }
@@ -0,0 +1,32 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://schema.kya-os.org/v1/protocol/audit/receipt/v1.0.0",
4
+ "title": "KYA-OS Audit Recorder Receipt Core v1",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": ["schema", "ledgerId", "ledgerEpochId", "sequence", "eventId", "entryDigest", "previousEntryDigest", "recordedAt", "recorder", "integritySuite"],
8
+ "properties": {
9
+ "schema": { "const": "https://schema.kya-os.org/v1/protocol/audit/receipt/v1.0.0" },
10
+ "ledgerId": { "type": "string", "minLength": 1, "maxLength": 256 },
11
+ "ledgerEpochId": { "type": "string", "minLength": 1, "maxLength": 256 },
12
+ "sequence": { "$ref": "#/$defs/decimal" },
13
+ "eventId": { "type": "string", "minLength": 1, "maxLength": 256 },
14
+ "entryDigest": { "$ref": "#/$defs/digest" },
15
+ "previousEntryDigest": { "oneOf": [{ "$ref": "#/$defs/digest" }, { "type": "null" }] },
16
+ "recordedAt": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 },
17
+ "recorder": { "$ref": "#/$defs/signerRef" },
18
+ "integritySuite": { "const": "KYA-AUDIT-JCS-SHA256-JWS-2026" }
19
+ },
20
+ "$defs": {
21
+ "decimal": { "type": "string", "maxLength": 20, "pattern": "^(0|[1-9][0-9]*)$" },
22
+ "digest": { "type": "string", "pattern": "^sha256:[a-f0-9]{64}$" },
23
+ "signerRef": {
24
+ "type": "object", "additionalProperties": false, "required": ["did", "kid", "alg"],
25
+ "properties": {
26
+ "did": { "type": "string", "minLength": 5, "maxLength": 2048, "pattern": "^did:[^\\r\\n]+$" },
27
+ "kid": { "type": "string", "minLength": 1, "maxLength": 2304 },
28
+ "alg": { "enum": ["EdDSA", "ES256"] }
29
+ }
30
+ }
31
+ }
32
+ }
@@ -0,0 +1,71 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://schema.kya-os.org/v1/protocol/audit/verification-policy/v1.0.0",
4
+ "title": "KYA-OS Out-of-Band Audit Verification Policy v1",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": ["policyId", "trustedLedgerEpochs", "trustedObservers", "authorizedExporters", "acceptedIntegritySuites", "acceptedAlgorithms", "keyRevocationMode"],
8
+ "properties": {
9
+ "policyId": { "type": "string", "minLength": 1, "maxLength": 256 },
10
+ "trustedLedgerEpochs": { "type": "array", "items": { "$ref": "#/$defs/ledgerTrust" } },
11
+ "trustedObservers": { "type": "array", "items": { "$ref": "#/$defs/keyPolicy" } },
12
+ "trustedSupportingAnchors": { "type": "array", "items": { "$ref": "#/$defs/anchorTrust" } },
13
+ "authorizedExporters": { "type": "array", "items": { "$ref": "#/$defs/exporter" } },
14
+ "acceptedIntegritySuites": { "type": "array", "minItems": 1, "items": { "type": "string", "minLength": 1, "maxLength": 128 }, "uniqueItems": true },
15
+ "acceptedAlgorithms": { "type": "array", "minItems": 1, "items": { "enum": ["EdDSA", "ES256"] }, "uniqueItems": true },
16
+ "keyRevocationMode": { "enum": ["as_observed", "current", "both"] },
17
+ "requiredCheckpointFreshnessMs": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 },
18
+ "requiredAuditProfile": { "enum": ["AAP-0", "AAP-1", "AAP-2", "AAP-3", "AAP-4"] }
19
+ },
20
+ "$defs": {
21
+ "digest": { "type": "string", "pattern": "^sha256:[a-f0-9]{64}$" },
22
+ "signer": {
23
+ "type": "object", "additionalProperties": false, "required": ["did", "kid", "alg"],
24
+ "properties": {
25
+ "did": { "type": "string", "minLength": 5, "maxLength": 2048, "pattern": "^did:[^\\r\\n]+$" },
26
+ "kid": { "type": "string", "minLength": 1, "maxLength": 2304 },
27
+ "alg": { "enum": ["EdDSA", "ES256"] }
28
+ }
29
+ },
30
+ "keyPolicy": {
31
+ "type": "object", "additionalProperties": false, "required": ["signer"],
32
+ "kyaOrderedNumberRange": { "first": "validFrom", "last": "validUntil" },
33
+ "properties": {
34
+ "signer": { "$ref": "#/$defs/signer" },
35
+ "validFrom": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 },
36
+ "validUntil": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 },
37
+ "validFromCheckpoint": { "$ref": "#/$defs/digest" },
38
+ "validUntilCheckpoint": { "$ref": "#/$defs/digest" }
39
+ }
40
+ },
41
+ "ledgerTrust": {
42
+ "type": "object", "additionalProperties": false,
43
+ "required": ["ledgerId", "ledgerEpochId", "recorderKeys"],
44
+ "properties": {
45
+ "ledgerId": { "type": "string", "minLength": 1, "maxLength": 256 },
46
+ "ledgerEpochId": { "type": "string", "minLength": 1, "maxLength": 256 },
47
+ "recorderKeys": { "type": "array", "minItems": 1, "items": { "$ref": "#/$defs/keyPolicy" } },
48
+ "validFromCheckpoint": { "$ref": "#/$defs/digest" },
49
+ "validUntilCheckpoint": { "$ref": "#/$defs/digest" }
50
+ }
51
+ },
52
+ "anchorTrust": {
53
+ "type": "object", "additionalProperties": false, "required": ["kind", "providerId"],
54
+ "properties": {
55
+ "kind": { "enum": ["worm", "rfc3161", "scitt"] },
56
+ "providerId": { "type": "string", "minLength": 1, "maxLength": 256 },
57
+ "validFrom": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 },
58
+ "validUntil": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }
59
+ }
60
+ },
61
+ "exporter": {
62
+ "type": "object", "additionalProperties": false,
63
+ "required": ["signerKeys", "allowedLedgerIds", "allowedPurposes"],
64
+ "properties": {
65
+ "signerKeys": { "type": "array", "minItems": 1, "items": { "$ref": "#/$defs/keyPolicy" } },
66
+ "allowedLedgerIds": { "type": "array", "minItems": 1, "items": { "type": "string", "minLength": 1, "maxLength": 256 }, "uniqueItems": true },
67
+ "allowedPurposes": { "type": "array", "minItems": 1, "items": { "type": "string", "minLength": 1, "maxLength": 256 }, "uniqueItems": true }
68
+ }
69
+ }
70
+ }
71
+ }
@@ -0,0 +1,29 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://schema.kya-os.org/v1/protocol/audit/verification-report/v1.0.0",
4
+ "title": "KYA-OS Audit Verification Report v1",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": ["schema", "policyId", "cryptographicIntegrity", "chainIntegrity", "checkpointIntegrity", "anchorIntegrity", "scopeEvidenceCompleteness", "authorizedAsObserved", "currentAuthorization"],
8
+ "properties": {
9
+ "schema": { "const": "https://schema.kya-os.org/v1/protocol/audit/verification-report/v1.0.0" },
10
+ "policyId": { "type": "string", "minLength": 1 },
11
+ "verifiedAt": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 },
12
+ "cryptographicIntegrity": { "$ref": "#/$defs/dimension" },
13
+ "chainIntegrity": { "$ref": "#/$defs/dimension" },
14
+ "checkpointIntegrity": { "$ref": "#/$defs/dimension" },
15
+ "anchorIntegrity": { "$ref": "#/$defs/dimension" },
16
+ "scopeEvidenceCompleteness": { "$ref": "#/$defs/dimension" },
17
+ "authorizedAsObserved": { "$ref": "#/$defs/dimension" },
18
+ "currentAuthorization": { "$ref": "#/$defs/dimension" }
19
+ },
20
+ "$defs": {
21
+ "dimension": {
22
+ "type": "object", "additionalProperties": false, "required": ["verdict", "reasonCodes"],
23
+ "properties": {
24
+ "verdict": { "enum": ["valid", "invalid", "indeterminate"] },
25
+ "reasonCodes": { "type": "array", "items": { "type": "string", "minLength": 1 }, "uniqueItems": true }
26
+ }
27
+ }
28
+ }
29
+ }
@@ -72,6 +72,23 @@
72
72
  "crisp": {
73
73
  "type": "boolean",
74
74
  "description": "Server supports CRISP constraint evaluation."
75
+ },
76
+ "audit": {
77
+ "type": "object",
78
+ "additionalProperties": false,
79
+ "required": ["profile", "recorderTopology", "delivery", "journalDurability", "atomicAppend", "sourceHighWater", "merkleCheckpoints", "independentObservation", "supportingAnchors", "evidenceRetention"],
80
+ "properties": {
81
+ "profile": { "enum": ["AAP-0", "AAP-1", "AAP-2", "AAP-3", "AAP-4"] },
82
+ "recorderTopology": { "enum": ["none", "self-hosted", "managed", "verified-mirror"] },
83
+ "delivery": { "enum": ["best-effort", "buffered", "required"] },
84
+ "journalDurability": { "enum": ["none", "ephemeral", "durable"] },
85
+ "atomicAppend": { "type": "boolean" },
86
+ "sourceHighWater": { "type": "boolean" },
87
+ "merkleCheckpoints": { "type": "boolean" },
88
+ "independentObservation": { "type": "boolean" },
89
+ "supportingAnchors": { "type": "array", "items": { "enum": ["worm", "rfc3161", "scitt"] }, "uniqueItems": true },
90
+ "evidenceRetention": { "enum": ["none", "inline", "separate"] }
91
+ }
75
92
  }
76
93
  },
77
94
  "additionalProperties": true