@ixo/topic-protocol 1.0.0-rc.1 → 1.0.0-rc.2

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 (40) hide show
  1. package/README.md +1 -1
  2. package/dist/schemas/topic-contract-body.schema.json +12 -21
  3. package/dist/schemas/topic-contract-state.schema.json +18 -93
  4. package/dist/schemas/topic-operation.schema.json +2 -2
  5. package/dist/schemas/topic-root.schema.json +5 -1
  6. package/dist/schemas/topic-shape.schema.json +5 -4
  7. package/dist/src/contracts/schemas.d.ts +394 -75
  8. package/dist/src/contracts/topic-contract.d.ts +15 -1
  9. package/dist/src/contracts/topic-contract.js.map +1 -1
  10. package/dist/src/index.d.ts +4 -4
  11. package/dist/src/index.js +1 -1
  12. package/dist/src/index.js.map +1 -1
  13. package/dist/src/projector/payload.d.ts +34 -0
  14. package/dist/src/projector/payload.js +93 -2
  15. package/dist/src/projector/payload.js.map +1 -1
  16. package/dist/src/projector/state.js +54 -0
  17. package/dist/src/projector/state.js.map +1 -1
  18. package/dist/src/projector/types.d.ts +44 -2
  19. package/dist/src/projector/types.js.map +1 -1
  20. package/dist/src/shapes/now.d.ts +2 -2
  21. package/dist/src/shapes/now.js +38 -19
  22. package/dist/src/shapes/now.js.map +1 -1
  23. package/dist/src/shapes/progress.d.ts +3 -3
  24. package/dist/src/shapes/progress.js +391 -77
  25. package/dist/src/shapes/progress.js.map +1 -1
  26. package/dist/src/shapes/recipes.js +102 -53
  27. package/dist/src/shapes/recipes.js.map +1 -1
  28. package/dist/src/shapes/resolver.js +13 -3
  29. package/dist/src/shapes/resolver.js.map +1 -1
  30. package/dist/src/shapes/state.d.ts +72 -20
  31. package/dist/src/shapes/state.js +1 -0
  32. package/dist/src/shapes/state.js.map +1 -1
  33. package/dist/src/shapes/types.d.ts +155 -4
  34. package/dist/src/shapes/types.js +3 -1
  35. package/dist/src/shapes/types.js.map +1 -1
  36. package/package.json +1 -1
  37. package/recipes/agent-delivery.json +166 -33
  38. package/recipes/registry.json +6 -6
  39. package/recipes/research-brief.json +148 -30
  40. package/recipes/verified-work-payment.json +172 -34
package/README.md CHANGED
@@ -9,7 +9,7 @@ identity of a discussion.
9
9
 
10
10
  ## Status
11
11
 
12
- **Version:** 1.0.0-rc.1
12
+ **Version:** 1.0.0-rc.2
13
13
 
14
14
  The normative Topic Shape progression and Portal Now projection are defined in
15
15
  [Topic Shape Framework v1](docs/topic-shape-framework.md).
@@ -1,13 +1,12 @@
1
1
  {
2
2
  "$schema": "https://json-schema.org/draft/2020-12/schema",
3
3
  "$id": "https://topic-protocol.ixo.world/schemas/topic-contract-body.schema.json",
4
- "title": "Topic contract body v3",
4
+ "title": "Topic contract body v4",
5
5
  "type": "object",
6
- "required": ["version", "revision", "status", "kindRef", "authoredBy", "authoredAt", "workingMode", "baseRecipe", "shapeSources", "shapeDigest"],
6
+ "required": ["version", "revision", "kindRef", "authoredBy", "authoredAt", "workingMode", "baseRecipe", "shapeSources", "shapeDigest"],
7
7
  "properties": {
8
- "version": { "const": 3 },
8
+ "version": { "const": 4 },
9
9
  "revision": { "type": "string", "minLength": 1 },
10
- "status": { "enum": ["draft", "accepted", "superseded"] },
11
10
  "kindRef": { "type": "object" },
12
11
  "kindProfile": { "type": "object" },
13
12
  "kindResource": { "type": "object" },
@@ -19,6 +18,8 @@
19
18
  "shapeSources": { "type": "array", "minItems": 1, "items": { "$ref": "#/$defs/shapeSource" } },
20
19
  "shapeDigest": { "$ref": "#/$defs/digest" },
21
20
  "claimBinding": { "type": "object", "required": ["entityDid", "collectionId"], "properties": { "entityDid": { "type": "string", "pattern": "^did:ixo:" }, "collectionId": { "type": "string", "minLength": 1 } }, "additionalProperties": false },
21
+ "activationPolicy": { "$ref": "#/$defs/activationPolicy" },
22
+ "assentPolicy": { "$ref": "#/$defs/assentPolicy" },
22
23
  "locale": { "type": "string" },
23
24
  "timezone": { "type": "string" },
24
25
  "temporalMode": { "enum": ["finite", "ongoing"] },
@@ -38,29 +39,19 @@
38
39
  "decision": { "type": "object" },
39
40
  "plan": { "type": "object" },
40
41
  "attachments": { "type": "array", "items": { "type": "object" } },
41
- "fieldProvenance": {
42
- "type": "object",
43
- "propertyNames": { "pattern": "^/" },
44
- "additionalProperties": { "$ref": "#/$defs/fieldProvenance" }
45
- }
42
+ "fieldProvenance": { "type": "object", "propertyNames": { "pattern": "^/" }, "additionalProperties": { "$ref": "#/$defs/fieldProvenance" } }
46
43
  },
47
44
  "additionalProperties": false,
48
45
  "$defs": {
49
46
  "digest": { "type": "string", "pattern": "^sha256:[0-9a-f]{64}$" },
50
47
  "digestRef": { "type": "object", "required": ["id", "version", "digest"], "properties": { "id": { "type": "string", "format": "uri" }, "version": { "type": "string", "minLength": 1 }, "digest": { "$ref": "#/$defs/digest" } }, "additionalProperties": false },
51
48
  "shapeSource": { "type": "object", "required": ["kind", "id", "version", "digest"], "properties": { "kind": { "enum": ["base-recipe", "topic-recipe", "kind", "topic"] }, "id": { "type": "string", "format": "uri" }, "version": { "type": "string", "minLength": 1 }, "digest": { "$ref": "#/$defs/digest" } }, "additionalProperties": false },
49
+ "subject": { "type": "object", "required": ["kind", "id"], "properties": { "kind": { "enum": ["actor", "role"] }, "id": { "type": "string", "minLength": 1 } }, "additionalProperties": false },
50
+ "confirmationRule": { "type": "object", "required": ["mode", "subjects"], "properties": { "mode": { "enum": ["any", "all", "threshold"] }, "subjects": { "type": "array", "minItems": 1, "items": { "$ref": "#/$defs/subject" } }, "threshold": { "type": "integer", "minimum": 1 } }, "additionalProperties": false },
51
+ "assentPolicy": { "type": "object", "required": ["mode", "signatories"], "properties": { "mode": { "enum": ["any", "all", "threshold"] }, "signatories": { "type": "array", "minItems": 1, "items": { "$ref": "#/$defs/subject" } }, "threshold": { "type": "integer", "minimum": 1 } }, "additionalProperties": false },
52
+ "disputePolicy": { "type": "object", "properties": { "resolvers": { "type": "array", "minItems": 1, "items": { "$ref": "#/$defs/subject" } }, "process": { "type": "object", "required": ["kind", "id"], "properties": { "kind": { "enum": ["flow", "resource"] }, "id": { "type": "string", "minLength": 1 }, "label": { "type": "string" } }, "additionalProperties": false } }, "additionalProperties": false },
53
+ "activationPolicy": { "type": "object", "properties": { "editors": { "type": "array", "minItems": 1, "items": { "$ref": "#/$defs/subject" } }, "confirmation": { "$ref": "#/$defs/confirmationRule" }, "lifecycle": { "type": "object", "required": ["onExpiry"], "properties": { "effectiveAt": { "type": "string", "format": "date-time" }, "reviewAt": { "type": "string", "format": "date-time" }, "expiresAt": { "type": "string", "format": "date-time" }, "onExpiry": { "const": "pause-consequential" } }, "additionalProperties": false }, "dispute": { "$ref": "#/$defs/disputePolicy" } }, "additionalProperties": false },
52
54
  "risk": { "type": "object", "required": ["id", "description", "status"], "properties": { "id": { "type": "string" }, "description": { "type": "string" }, "impact": { "enum": ["low", "medium", "high", "critical"] }, "status": { "enum": ["open", "mitigated", "accepted", "closed"] }, "owner": { "type": "string" }, "mitigation": { "type": "string" } }, "additionalProperties": false },
53
- "fieldProvenance": {
54
- "type": "object",
55
- "required": ["basis", "acceptance", "sourceEventIds"],
56
- "properties": {
57
- "basis": { "enum": ["explicit", "contextual", "inferred", "suggested", "retrieved"] },
58
- "acceptance": { "enum": ["proposed", "accepted", "rejected", "superseded"] },
59
- "sourceEventIds": { "type": "array", "items": { "type": "string" } },
60
- "createdBy": { "type": "string" },
61
- "createdAt": { "type": "string", "format": "date-time" }
62
- },
63
- "additionalProperties": false
64
- }
55
+ "fieldProvenance": { "type": "object", "required": ["basis", "acceptance", "sourceEventIds"], "properties": { "basis": { "enum": ["explicit", "contextual", "inferred", "suggested", "retrieved"] }, "acceptance": { "enum": ["proposed", "accepted", "rejected", "superseded"] }, "sourceEventIds": { "type": "array", "items": { "type": "string" } }, "createdBy": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" } }, "additionalProperties": false }
65
56
  }
66
57
  }
@@ -1,112 +1,37 @@
1
1
  {
2
2
  "$schema": "https://json-schema.org/draft/2020-12/schema",
3
3
  "$id": "https://topic-protocol.ixo.world/schemas/topic-contract-state.schema.json",
4
- "title": "Qi Topic Contract state profile v3",
4
+ "title": "Qi Topic Contract state profile v4",
5
5
  "type": "object",
6
6
  "required": ["version", "profile", "schema", "topicId", "anchor", "manifest", "contracts", "shape", "progress", "projection", "policy", "bindings", "provenance"],
7
7
  "properties": {
8
- "version": { "const": 3 },
9
- "profile": { "const": "qi.topic-contract-state/v3" },
8
+ "version": { "const": 4 },
9
+ "profile": { "const": "qi.topic-contract-state/v4" },
10
10
  "schema": { "const": "https://topic-protocol.ixo.world/schemas/topic-contract-state.schema.json" },
11
11
  "topicId": { "$ref": "#/$defs/topicId" },
12
- "anchor": {
13
- "type": "object",
14
- "required": ["mode", "roomId", "rootEventId", "manifestSource"],
15
- "properties": { "mode": { "enum": ["native", "adopted"] }, "roomId": { "type": "string", "pattern": "^!" }, "rootEventId": { "type": "string", "pattern": "^\\$" }, "manifestSource": { "enum": ["root-event", "state-event"] } },
16
- "additionalProperties": false
17
- },
18
- "manifest": {
19
- "type": "object",
20
- "required": ["version", "id", "title", "kind", "status", "createdBy", "createdAt", "baseRecipe", "shapeDigest"],
21
- "properties": {
22
- "version": { "const": 3 }, "id": { "$ref": "#/$defs/topicId" }, "title": { "type": "string", "minLength": 1, "maxLength": 280 },
23
- "kind": { "type": "string", "minLength": 1 }, "status": { "enum": ["draft", "active", "waiting", "blocked", "resolved", "archived", "redirected"] },
24
- "createdBy": { "type": "string", "minLength": 1 }, "createdAt": { "type": "string", "format": "date-time" },
25
- "baseRecipe": { "enum": ["project", "flow", "proposal", "evaluation", "claims", "research", "discussion", "incident"] },
26
- "topicRecipeRef": { "type": "object" }, "shapeDigest": { "$ref": "#/$defs/digest" }
27
- },
28
- "additionalProperties": true
29
- },
30
- "contracts": { "type": "object" },
31
- "shape": {
32
- "type": "object",
33
- "required": ["digest", "sources"],
34
- "properties": {
35
- "digest": { "$ref": "#/$defs/digest" },
36
- "sources": { "type": "array", "minItems": 1, "items": { "type": "object", "required": ["kind", "id", "version", "digest"], "properties": { "kind": { "enum": ["base-recipe", "topic-recipe", "kind", "topic"] }, "id": { "type": "string", "format": "uri" }, "version": { "type": "string" }, "digest": { "$ref": "#/$defs/digest" } }, "additionalProperties": false } }
37
- },
38
- "additionalProperties": false
39
- },
40
- "progress": {
41
- "type": "object",
42
- "required": ["version", "topicId", "topicRevision", "contractRevision", "shapeDigest", "phase", "condition", "reasonCode", "axisStates", "stateTags", "candidates", "provenance"],
43
- "properties": {
44
- "version": { "const": 1 }, "topicId": { "$ref": "#/$defs/topicId" }, "topicRevision": { "type": "string" }, "contractRevision": { "type": "string" },
45
- "shapeDigest": { "$ref": "#/$defs/digest" }, "phase": { "$ref": "#/$defs/phase" }, "condition": { "$ref": "#/$defs/condition" }, "reasonCode": { "type": "string" },
46
- "axisStates": { "type": "object", "additionalProperties": { "type": "string" } }, "stateTags": { "type": "array", "items": { "type": "object" } },
47
- "candidates": { "type": "array", "items": { "type": "object" } }, "provenance": { "type": "array", "items": { "type": "string" } }, "block": { "type": "object" }
48
- },
49
- "additionalProperties": false
50
- },
51
- "projection": {
52
- "type": "object",
53
- "required": ["revision", "contractRevision", "title", "status", "kindRef", "attachmentCount", "operationCount"],
54
- "properties": {
55
- "revision": { "type": "string", "minLength": 1 }, "contractRevision": { "type": "string", "minLength": 1 }, "title": { "type": "string", "minLength": 1 },
56
- "status": { "enum": ["draft", "active", "waiting", "blocked", "resolved", "archived", "redirected"] }, "kindRef": { "type": "object" },
57
- "attachmentCount": { "type": "integer", "minimum": 0 }, "operationCount": { "type": "integer", "minimum": 0 },
58
- "claimBinding": { "type": "object", "required": ["entityDid", "collectionId"], "properties": { "entityDid": { "type": "string" }, "collectionId": { "type": "string" } }, "additionalProperties": false },
59
- "claimResolution": { "type": "object", "required": ["entityDid", "collectionId", "protocolDid", "rubric"], "properties": { "entityDid": { "type": "string" }, "collectionId": { "type": "string" }, "protocolDid": { "type": "string" }, "rubric": { "type": "object" } }, "additionalProperties": false }
60
- },
61
- "additionalProperties": true
62
- },
12
+ "anchor": { "type": "object", "required": ["mode", "roomId", "rootEventId", "manifestSource"], "properties": { "mode": { "enum": ["native", "adopted"] }, "roomId": { "type": "string", "pattern": "^!" }, "rootEventId": { "type": "string", "pattern": "^\\$" }, "manifestSource": { "enum": ["root-event", "state-event"] } }, "additionalProperties": false },
13
+ "manifest": { "type": "object", "required": ["version", "id", "title", "kind", "status", "createdBy", "createdAt", "baseRecipe", "shapeDigest"], "properties": { "version": { "const": 4 }, "id": { "$ref": "#/$defs/topicId" }, "title": { "type": "string", "minLength": 1, "maxLength": 280 }, "kind": { "type": "string", "minLength": 1 }, "status": { "enum": ["draft", "active", "waiting", "blocked", "resolved", "archived", "redirected"] }, "createdBy": { "type": "string", "minLength": 1 }, "createdAt": { "type": "string", "format": "date-time" }, "baseRecipe": { "enum": ["project", "flow", "proposal", "evaluation", "claims", "research", "discussion", "incident"] }, "topicRecipeRef": { "type": "object" }, "shapeDigest": { "$ref": "#/$defs/digest" } }, "additionalProperties": true },
14
+ "contracts": { "type": "object", "properties": { "proposed": { "allOf": [{ "$ref": "#/$defs/contractRef" }, { "type": "object", "properties": { "confirmations": { "type": "array", "items": { "type": "object" } }, "assents": { "type": "array", "items": { "type": "object" } } } }] }, "effective": { "allOf": [{ "$ref": "#/$defs/contractRef" }, { "type": "object", "required": ["effectiveAt", "confirmations"], "properties": { "effectiveAt": { "type": "string", "format": "date-time" }, "confirmations": { "type": "array", "items": { "type": "object" } }, "assents": { "type": "array", "items": { "type": "object" } } } }] }, "superseded": { "type": "array", "items": { "type": "object" } } }, "additionalProperties": false },
15
+ "shape": { "type": "object", "required": ["digest", "sources"], "properties": { "digest": { "$ref": "#/$defs/digest" }, "sources": { "type": "array", "minItems": 1, "items": { "$ref": "#/$defs/shapeSource" } } }, "additionalProperties": false },
16
+ "progress": { "type": "object", "required": ["version", "topicId", "topicRevision", "contractRevision", "shapeDigest", "phase", "condition", "reasonCode", "axisStates", "stateTags", "candidates", "obligations", "provenance"], "properties": { "version": { "const": 2 }, "topicId": { "$ref": "#/$defs/topicId" }, "topicRevision": { "type": "string" }, "contractRevision": { "type": "string" }, "shapeDigest": { "$ref": "#/$defs/digest" }, "phase": { "$ref": "#/$defs/phase" }, "condition": { "$ref": "#/$defs/condition" }, "reasonCode": { "type": "string" }, "axisStates": { "type": "object", "additionalProperties": { "type": "string" } }, "stateTags": { "type": "array", "items": { "type": "object" } }, "candidates": { "type": "array", "items": { "type": "object" } }, "obligations": { "type": "array", "items": { "$ref": "#/$defs/obligation" } }, "primaryObligationId": { "type": "string" }, "evaluatedAt": { "type": "object" }, "provenance": { "type": "array", "items": { "type": "string" } }, "block": { "type": "object" }, "dispute": { "type": "object" } }, "additionalProperties": false },
17
+ "projection": { "type": "object", "required": ["revision", "contractRevision", "title", "status", "setupStatus", "kindRef", "attachmentCount", "operationCount"], "properties": { "revision": { "type": "string", "minLength": 1 }, "contractRevision": { "type": "string", "minLength": 1 }, "title": { "type": "string", "minLength": 1 }, "status": { "enum": ["draft", "active", "waiting", "blocked", "resolved", "archived", "redirected"] }, "setupStatus": { "enum": ["draft", "awaiting-confirmation", "scheduled", "confirmed", "review-due", "expired", "disputed"] }, "kindRef": { "type": "object" }, "attachmentCount": { "type": "integer", "minimum": 0 }, "operationCount": { "type": "integer", "minimum": 0 }, "claimBinding": { "type": "object" }, "claimResolution": { "type": "object" } }, "additionalProperties": true },
63
18
  "policy": { "type": "object" },
64
- "bindings": {
65
- "type": "object",
66
- "properties": {
67
- "flows": { "type": "array", "items": { "$ref": "https://topic-protocol.ixo.world/schemas/topic-flow-binding.schema.json" } },
68
- "context": {
69
- "type": "array",
70
- "items": {
71
- "type": "object",
72
- "required": ["type", "id"],
73
- "properties": {
74
- "type": { "enum": ["ixo.resource", "ixo.flow", "matrix.conversation", "ixo.entity", "ixo.service"] },
75
- "id": { "type": "string", "minLength": 1 },
76
- "label": { "type": "string" }
77
- },
78
- "additionalProperties": false
79
- }
80
- },
81
- "udidReferences": {
82
- "type": "array",
83
- "items": {
84
- "type": "object",
85
- "required": ["id", "role"],
86
- "properties": {
87
- "id": { "type": "string", "minLength": 1 },
88
- "role": { "enum": ["evaluation", "decision", "effect", "settlement"] },
89
- "digest": { "$ref": "#/$defs/digest" }
90
- },
91
- "additionalProperties": false
92
- }
93
- }
94
- },
95
- "additionalProperties": false
96
- },
97
- "provenance": { "type": "object" }, "extensions": { "type": "object" }
19
+ "bindings": { "type": "object", "properties": { "flows": { "type": "array", "items": { "$ref": "https://topic-protocol.ixo.world/schemas/topic-flow-binding.schema.json" } }, "context": { "type": "array", "items": { "type": "object" } }, "udidReferences": { "type": "array", "items": { "type": "object" } } }, "additionalProperties": false },
20
+ "provenance": { "type": "object" },
21
+ "extensions": { "type": "object" }
98
22
  },
99
23
  "additionalProperties": false,
100
24
  "$defs": {
101
25
  "topicId": { "type": "string", "pattern": "^ixo:topic:[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$" },
102
26
  "digest": { "type": "string", "pattern": "^sha256:[0-9a-f]{64}$" },
103
27
  "phase": { "enum": ["forming", "working", "verifying", "deciding", "effecting", "settling", "complete", "dormant"] },
104
- "condition": { "enum": ["on-track", "needs-input", "needs-acceptance", "waiting", "blocked", "failed", "disputed", "degraded"] },
105
- "temporalTarget": {
106
- "oneOf": [
28
+ "condition": { "enum": ["on-track", "needs-input", "needs-confirmation", "review-due", "expired", "waiting", "blocked", "failed", "disputed", "degraded"] },
29
+ "shapeSource": { "type": "object", "required": ["kind", "id", "version", "digest"], "properties": { "kind": { "enum": ["base-recipe", "topic-recipe", "kind", "topic"] }, "id": { "type": "string", "format": "uri" }, "version": { "type": "string" }, "digest": { "$ref": "#/$defs/digest" } }, "additionalProperties": false },
30
+ "contractRef": { "type": "object", "required": ["revision", "bodyHash", "bodyRef"], "properties": { "revision": { "type": "string" }, "bodyHash": { "$ref": "#/$defs/digest" }, "bodyRef": { "type": "object" }, "body": { "type": "object" } }, "additionalProperties": true },
31
+ "obligation": { "type": "object", "required": ["id", "code", "kind", "phase", "status", "priority", "blocking", "assignedActors", "consequence", "presentation", "provenance"], "properties": { "id": { "type": "string" }, "code": { "type": "string" }, "kind": { "enum": ["safety", "input", "confirmation", "assent", "transition", "wait", "review", "expiry", "dispute"] }, "phase": { "$ref": "#/$defs/phase" }, "status": { "enum": ["open", "ready", "waiting", "blocked", "unavailable"] }, "priority": { "type": "integer" }, "blocking": { "type": "boolean" }, "responsibility": { "type": "object" }, "assignedActors": { "type": "array", "items": { "type": "string" } }, "requiredAbility": { "type": "string" }, "consequence": { "enum": ["none", "shared-state", "external-effect", "settlement"] }, "focusPath": { "type": "string" }, "transitionCode": { "type": "string" }, "command": { "type": "string" }, "handoff": { "type": "object" }, "presentation": { "type": "object" }, "provenance": { "type": "array", "items": { "type": "string" } } }, "additionalProperties": false },
32
+ "temporalTarget": { "oneOf": [
107
33
  { "type": "object", "required": ["precision", "value", "timezone"], "properties": { "precision": { "const": "date" }, "value": { "type": "string", "format": "date" }, "timezone": { "type": "string" } }, "additionalProperties": false },
108
34
  { "type": "object", "required": ["precision", "value", "timezone"], "properties": { "precision": { "const": "datetime" }, "value": { "type": "string", "format": "date-time" }, "timezone": { "type": "string" } }, "additionalProperties": false }
109
- ]
110
- }
35
+ ] }
111
36
  }
112
37
  }
@@ -8,7 +8,7 @@
8
8
  "version": { "enum": [1, 2] },
9
9
  "operationId": { "type": "string", "minLength": 1 },
10
10
  "topicId": { "type": "string", "pattern": "^ixo:topic:[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$" },
11
- "type": { "type": "string", "enum": ["rename", "change-status", "update-overview", "link-context", "unlink-context", "attach-files", "detach-files", "record-decision", "propose-contract", "update-contract", "accept-contract", "supersede-contract", "bind-automation", "update-automation", "pause-automation", "remove-automation", "bind-flow", "update-flow-binding", "unbind-flow", "request-action", "cancel-action", "record-action-receipt", "bind-external-work", "sync-external-work", "unlink-external-work", "submit-delivery", "record-delivery-decision", "record-evaluation", "record-approval", "record-claim", "record-settlement", "redirect", "branch", "merge", "resolve-conflict"] },
11
+ "type": { "type": "string", "enum": ["rename", "change-status", "update-overview", "link-context", "unlink-context", "attach-files", "detach-files", "record-decision", "record-outcome", "propose-contract", "update-contract", "accept-contract", "confirm-setup", "withdraw-setup-confirmation", "record-assent", "withdraw-assent", "raise-dispute", "resolve-dispute", "supersede-contract", "bind-automation", "update-automation", "pause-automation", "remove-automation", "bind-flow", "update-flow-binding", "unbind-flow", "request-action", "cancel-action", "record-action-receipt", "bind-external-work", "sync-external-work", "unlink-external-work", "submit-delivery", "record-delivery-decision", "record-evaluation", "record-approval", "record-claim", "record-settlement", "redirect", "branch", "merge", "resolve-conflict"] },
12
12
  "previousRevision": { "type": "string", "minLength": 1 },
13
13
  "actor": { "type": "string", "minLength": 1 },
14
14
  "createdAt": { "type": "string", "format": "date-time" },
@@ -20,7 +20,7 @@
20
20
  {
21
21
  "if": {
22
22
  "properties": {
23
- "type": { "enum": ["propose-contract", "update-contract", "accept-contract", "supersede-contract", "bind-automation", "update-automation", "pause-automation", "remove-automation", "bind-flow", "update-flow-binding", "unbind-flow", "request-action", "cancel-action", "record-action-receipt", "bind-external-work", "sync-external-work", "unlink-external-work", "submit-delivery", "record-delivery-decision", "record-evaluation", "record-approval", "record-claim", "record-settlement"] }
23
+ "type": { "enum": ["record-outcome", "propose-contract", "update-contract", "accept-contract", "confirm-setup", "withdraw-setup-confirmation", "record-assent", "withdraw-assent", "raise-dispute", "resolve-dispute", "supersede-contract", "bind-automation", "update-automation", "pause-automation", "remove-automation", "bind-flow", "update-flow-binding", "unbind-flow", "request-action", "cancel-action", "record-action-receipt", "bind-external-work", "sync-external-work", "unlink-external-work", "submit-delivery", "record-delivery-decision", "record-evaluation", "record-approval", "record-claim", "record-settlement"] }
24
24
  },
25
25
  "required": ["type"]
26
26
  },
@@ -5,7 +5,7 @@
5
5
  "type": "object",
6
6
  "required": ["version", "id", "title", "status", "createdBy", "createdAt"],
7
7
  "properties": {
8
- "version": { "enum": [1, 2, 3] },
8
+ "version": { "enum": [1, 2, 3, 4] },
9
9
  "id": { "type": "string", "pattern": "^ixo:topic:[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$" },
10
10
  "title": { "type": "string", "minLength": 1, "maxLength": 280 },
11
11
  "kind": { "type": "string", "enum": ["discussion", "question", "decision", "proposal", "task", "incident", "flow", "agent_task", "evaluation", "claims"] },
@@ -65,6 +65,10 @@
65
65
  {
66
66
  "if": { "properties": { "version": { "const": 3 } }, "required": ["version"] },
67
67
  "then": { "properties": { "kind": true, "baseRecipe": true, "shapeDigest": true }, "required": ["kind", "baseRecipe", "shapeDigest"] }
68
+ },
69
+ {
70
+ "if": { "properties": { "version": { "const": 4 } }, "required": ["version"] },
71
+ "then": { "properties": { "kind": true, "baseRecipe": true, "shapeDigest": true }, "required": ["kind", "baseRecipe", "shapeDigest"] }
68
72
  }
69
73
  ]
70
74
  }
@@ -42,7 +42,7 @@
42
42
  "minItems": 1,
43
43
  "items": {
44
44
  "type": "object",
45
- "required": ["code", "phase", "predecessor", "target", "command", "requiredAbility", "assignedTo", "gates", "confirmation", "consequence", "evidence"],
45
+ "required": ["code", "phase", "predecessor", "target", "command", "requiredAbility", "assignedTo", "gates", "confirmation", "consequence", "evidence", "presentation"],
46
46
  "properties": {
47
47
  "code": { "type": "string", "minLength": 1 },
48
48
  "phase": { "$ref": "#/$defs/phase" },
@@ -56,13 +56,13 @@
56
56
  "properties": { "kind": { "enum": ["actor", "role"] }, "value": { "type": "string", "minLength": 1 } },
57
57
  "additionalProperties": false
58
58
  },
59
- "gates": { "type": "array", "items": { "type": "object", "required": ["kind"], "properties": { "kind": { "enum": ["field", "field-any", "record", "receipt", "axis", "binding", "condition"] } }, "additionalProperties": true } },
59
+ "gates": { "type": "array", "items": { "type": "object", "required": ["kind"], "properties": { "kind": { "enum": ["field", "field-any", "record", "receipt", "axis", "binding", "condition"] }, "requirement": { "$ref": "#/$defs/requirement" } }, "additionalProperties": true } },
60
60
  "confirmation": { "enum": ["none", "viewer", "authority"] },
61
61
  "consequence": { "enum": ["none", "shared-state", "external-effect", "settlement"] },
62
62
  "evidence": { "type": "object", "required": ["kind", "type"], "properties": { "kind": { "enum": ["operation", "record", "receipt"] }, "type": { "type": "string", "minLength": 1 }, "finality": { "enum": ["observed", "accepted", "verified", "final"] } }, "additionalProperties": false },
63
63
  "completesTopic": { "type": "boolean" },
64
64
  "handoff": { "type": "object", "required": ["kind", "binding"], "properties": { "kind": { "enum": ["flow", "resource"] }, "binding": { "type": "string", "minLength": 1 } }, "additionalProperties": false },
65
- "presentation": { "type": "object" }
65
+ "presentation": { "type": "object", "required": ["reasonCode", "actionLabelKey", "bodyKey", "purposeKey", "unlocksKey", "priority"], "properties": { "reasonCode": { "type": "string", "minLength": 1 }, "actionLabelKey": { "type": "string", "minLength": 1 }, "bodyKey": { "type": "string", "minLength": 1 }, "purposeKey": { "type": "string", "minLength": 1 }, "unlocksKey": { "type": "string", "minLength": 1 }, "priority": { "type": "integer" }, "focusPath": { "type": "string" } }, "additionalProperties": false }
66
66
  },
67
67
  "additionalProperties": false
68
68
  }
@@ -73,7 +73,8 @@
73
73
  "additionalProperties": false,
74
74
  "$defs": {
75
75
  "phase": { "enum": ["forming", "working", "verifying", "deciding", "effecting", "settling", "complete", "dormant"] },
76
- "condition": { "enum": ["on-track", "needs-input", "needs-acceptance", "waiting", "blocked", "failed", "disputed", "degraded"] },
76
+ "condition": { "enum": ["on-track", "needs-input", "needs-confirmation", "review-due", "expired", "waiting", "blocked", "failed", "disputed", "degraded"] },
77
+ "requirement": { "type": "object", "required": ["code", "labelKey", "promptKey", "purposeKey", "priority"], "properties": { "code": { "type": "string", "minLength": 1 }, "labelKey": { "type": "string", "minLength": 1 }, "promptKey": { "type": "string", "minLength": 1 }, "purposeKey": { "type": "string", "minLength": 1 }, "priority": { "type": "integer" }, "focusPath": { "type": "string" }, "assignedTo": { "type": "object", "required": ["kind", "value"], "properties": { "kind": { "enum": ["actor", "role"] }, "value": { "type": "string", "minLength": 1 } }, "additionalProperties": false } }, "additionalProperties": false },
77
78
  "axisState": { "type": "object", "required": ["axis", "state"], "properties": { "axis": { "type": "string", "minLength": 1 }, "state": { "type": "string", "minLength": 1 } }, "additionalProperties": false }
78
79
  }
79
80
  }