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

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 (77) hide show
  1. package/README.md +9 -2
  2. package/dist/schemas/action-receipt.schema.json +105 -11
  3. package/dist/schemas/decision-to-pay-template-v2.schema.json +301 -0
  4. package/dist/schemas/decision-to-pay-template.schema.json +346 -0
  5. package/dist/schemas/payable-obligation-v2.schema.json +319 -0
  6. package/dist/schemas/payable-obligation.schema.json +312 -0
  7. package/dist/schemas/payment-terms-v2.schema.json +238 -0
  8. package/dist/schemas/payment-terms.schema.json +287 -0
  9. package/dist/schemas/topic-action-request.schema.json +30 -0
  10. package/dist/schemas/topic-contract-body.schema.json +66 -0
  11. package/dist/schemas/topic-contract-state.schema.json +70 -276
  12. package/dist/schemas/topic-flow-binding.schema.json +28 -0
  13. package/dist/schemas/topic-kind-profile.schema.json +32 -2
  14. package/dist/schemas/topic-operation.schema.json +2 -2
  15. package/dist/schemas/topic-recipe.schema.json +19 -0
  16. package/dist/schemas/topic-root.schema.json +17 -1
  17. package/dist/schemas/topic-shape.schema.json +79 -0
  18. package/dist/src/action-runtime/types.d.ts +101 -0
  19. package/dist/src/action-runtime/types.js +12 -0
  20. package/dist/src/action-runtime/types.js.map +1 -0
  21. package/dist/src/contracts/schemas.d.ts +4706 -966
  22. package/dist/src/contracts/schemas.js +22 -0
  23. package/dist/src/contracts/schemas.js.map +1 -1
  24. package/dist/src/contracts/topic-contract.d.ts +38 -6
  25. package/dist/src/contracts/topic-contract.js +3 -1
  26. package/dist/src/contracts/topic-contract.js.map +1 -1
  27. package/dist/src/contracts/topic-kind-profile.d.ts +29 -0
  28. package/dist/src/contracts/topic-kind-profile.js +31 -0
  29. package/dist/src/contracts/topic-kind-profile.js.map +1 -1
  30. package/dist/src/errors.d.ts +1 -1
  31. package/dist/src/errors.js.map +1 -1
  32. package/dist/src/index.d.ts +12 -3
  33. package/dist/src/index.js +11 -2
  34. package/dist/src/index.js.map +1 -1
  35. package/dist/src/projector/payload.d.ts +18 -0
  36. package/dist/src/projector/payload.js +57 -1
  37. package/dist/src/projector/payload.js.map +1 -1
  38. package/dist/src/projector/state.js +144 -0
  39. package/dist/src/projector/state.js.map +1 -1
  40. package/dist/src/projector/types.d.ts +22 -4
  41. package/dist/src/projector/types.js.map +1 -1
  42. package/dist/src/shapes/canonical.d.ts +2 -0
  43. package/dist/src/shapes/canonical.js +20 -0
  44. package/dist/src/shapes/canonical.js.map +1 -0
  45. package/dist/src/shapes/claims.d.ts +12 -0
  46. package/dist/src/shapes/claims.js +20 -0
  47. package/dist/src/shapes/claims.js.map +1 -0
  48. package/dist/src/shapes/now.d.ts +2 -0
  49. package/dist/src/shapes/now.js +42 -0
  50. package/dist/src/shapes/now.js.map +1 -0
  51. package/dist/src/shapes/progress.d.ts +3 -0
  52. package/dist/src/shapes/progress.js +176 -0
  53. package/dist/src/shapes/progress.js.map +1 -0
  54. package/dist/src/shapes/recipes.d.ts +5 -0
  55. package/dist/src/shapes/recipes.js +337 -0
  56. package/dist/src/shapes/recipes.js.map +1 -0
  57. package/dist/src/shapes/resolver.d.ts +14 -0
  58. package/dist/src/shapes/resolver.js +111 -0
  59. package/dist/src/shapes/resolver.js.map +1 -0
  60. package/dist/src/shapes/state.d.ts +53 -0
  61. package/dist/src/shapes/state.js +2 -0
  62. package/dist/src/shapes/state.js.map +1 -0
  63. package/dist/src/shapes/types.d.ts +241 -0
  64. package/dist/src/shapes/types.js +42 -0
  65. package/dist/src/shapes/types.js.map +1 -0
  66. package/package.json +6 -2
  67. package/recipes/README.md +12 -0
  68. package/recipes/agent-delivery.json +607 -0
  69. package/recipes/registry.json +41 -0
  70. package/recipes/research-brief.json +460 -0
  71. package/recipes/verified-work-payment.json +663 -0
  72. package/templates/decision-to-pay/README.md +67 -0
  73. package/templates/decision-to-pay/milestone-payment-release.template.json +195 -0
  74. package/templates/decision-to-pay/outcome-payment-claim.template.json +198 -0
  75. package/templates/decision-to-pay/payment-on-delivery.template.json +198 -0
  76. package/templates/decision-to-pay/verified-work-payment.template.json +283 -0
  77. package/templates/decision-to-pay/verified-work-payment.v0.2.template.json +319 -0
@@ -0,0 +1,198 @@
1
+ {
2
+ "$schema": "../../schemas/decision-to-pay-template.schema.json",
3
+ "version": 1,
4
+ "id": "urn:ixo:decision-to-pay:template:payment-on-delivery",
5
+ "templateVersion": "0.1.0",
6
+ "label": "Payment on Delivery",
7
+ "description": "Release payment only after the agreed goods or service have been received and accepted for quantity, condition, timing, and recipient authority.",
8
+ "maturity": "draft",
9
+ "compatibility": {
10
+ "protocolPackage": "@ixo/topic-protocol",
11
+ "protocolVersion": "0.7.0",
12
+ "sourceCommit": "40d1ce5160757553cd57f670b5b1708a5c0d0ea3",
13
+ "implementationStatus": "design_ready_extension_required",
14
+ "requiredExtensions": [
15
+ "org.ixo.payment-terms/v1",
16
+ "org.ixo.payable-obligation/v1",
17
+ "ixo.payment capability policy/v1",
18
+ "org.ixo.delivery-order resource contract",
19
+ "physical delivery verification adapter",
20
+ "payment-rail adapter"
21
+ ],
22
+ "constraints": [
23
+ "Topic Protocol Delivery Packet means governed external-work handoff and must not be presented as physical proof of delivery.",
24
+ "The delivery-order resource must remain authoritative for order, shipment, recipient, quantity, and condition semantics."
25
+ ]
26
+ },
27
+ "topic": {
28
+ "primaryRole": "delivery_case",
29
+ "kindRef": {"source": "standard", "kind": "task"},
30
+ "recipe": "project",
31
+ "workingMode": "client",
32
+ "temporalMode": "finite",
33
+ "acceptance": {
34
+ "requiredTopicContractPaths": [
35
+ "/intent/text",
36
+ "/outcome/statement/text",
37
+ "/ownerId",
38
+ "/completion/definition",
39
+ "/completion/acceptanceAuthorityIds"
40
+ ],
41
+ "allowHonestDraft": true
42
+ },
43
+ "lifecyclePolicy": {
44
+ "separateTopicContractOutcomeAxes": true,
45
+ "waitingRule": "The Topic waits when delivery evidence, recipient acceptance, inspection, claim approval, or payment finality is outstanding.",
46
+ "resolveRule": "Resolve only under the accepted closure rule after delivery exceptions and required recourse windows are handled."
47
+ }
48
+ },
49
+ "actors": [
50
+ {"role": "payer", "label": "Buyer or payer", "required": true, "identity": "did", "capabilities": ["ixo.payment/accept-terms"]},
51
+ {"role": "supplier", "label": "Supplier and claimant", "required": true, "identity": "did", "capabilities": ["ixo.payment/submit-delivery", "ixo.payment/record-claim"]},
52
+ {"role": "recipient", "label": "Authorised recipient", "required": true, "identity": "did", "capabilities": ["ixo.payment/acknowledge-receipt"]},
53
+ {"role": "delivery_verifier", "label": "Delivery verifier", "required": true, "identity": "did", "capabilities": ["ixo.payment/evaluate-delivery"]},
54
+ {"role": "payment_approver", "label": "Payment approval authority", "required": true, "identity": "did", "capabilities": ["ixo.payment/approve"]},
55
+ {"role": "settlement_controller", "label": "Settlement controller", "required": true, "identity": "did", "capabilities": ["ixo.payment/record-settlement"]}
56
+ ],
57
+ "resources": [
58
+ {
59
+ "role": "delivery_order",
60
+ "type": "org.ixo.delivery-order",
61
+ "required": true,
62
+ "binding": "typed_context",
63
+ "authority": "bound_resource",
64
+ "availability": "proposed_extension",
65
+ "confidentiality": "room_encrypted",
66
+ "notes": "Must pin order lines, expected quantities, acceptable condition, delivery window, destination, and authorised recipient."
67
+ },
68
+ {"role": "payment_terms", "type": "org.ixo.payment-terms", "required": true, "binding": "typed_context", "authority": "bound_resource", "availability": "contract_pack", "schemaRef": "https://topic-protocol.ixo.world/schemas/payment-terms.schema.json", "confidentiality": "vfs_ucan"},
69
+ {"role": "payable_obligation", "type": "org.ixo.payable-obligation", "required": true, "binding": "typed_context", "authority": "bound_resource", "availability": "contract_pack", "schemaRef": "https://topic-protocol.ixo.world/schemas/payable-obligation.schema.json", "confidentiality": "room_encrypted"},
70
+ {"role": "fulfilment_work", "type": "ixo.external-work-binding", "required": true, "binding": "protocol_record", "authority": "external_system", "availability": "topic_protocol_0.7", "schemaRef": "https://topic-protocol.ixo.world/schemas/external-work-binding.schema.json", "confidentiality": "room_encrypted"},
71
+ {"role": "proof_of_delivery", "type": "ixo.vfs", "required": true, "binding": "vfs_attachment", "authority": "bound_resource", "availability": "topic_protocol_0.7", "schemaRef": "https://topic-protocol.ixo.world/schemas/topic-file-attachment.schema.json", "confidentiality": "vfs_ucan"}
72
+ ],
73
+ "protocolContracts": [
74
+ {"name": "topic-contract-state", "source": "topic_protocol", "schemaRef": "https://topic-protocol.ixo.world/schemas/topic-contract-state.schema.json", "required": true},
75
+ {"name": "external-work-binding", "source": "topic_protocol", "schemaRef": "https://topic-protocol.ixo.world/schemas/external-work-binding.schema.json", "required": true},
76
+ {"name": "delivery-packet", "source": "topic_protocol", "schemaRef": "https://topic-protocol.ixo.world/schemas/delivery-packet.schema.json", "required": true},
77
+ {"name": "delivery-decision", "source": "topic_protocol", "schemaRef": "https://topic-protocol.ixo.world/schemas/delivery-decision.schema.json", "required": true},
78
+ {"name": "evaluation-assertion", "source": "topic_protocol", "schemaRef": "https://topic-protocol.ixo.world/schemas/evaluation-assertion.schema.json", "required": true},
79
+ {"name": "approval-decision", "source": "topic_protocol", "schemaRef": "https://topic-protocol.ixo.world/schemas/approval-decision.schema.json", "required": true},
80
+ {"name": "claim-record", "source": "topic_protocol", "schemaRef": "https://topic-protocol.ixo.world/schemas/claim-record.schema.json", "required": true},
81
+ {"name": "settlement-receipt", "source": "topic_protocol", "schemaRef": "https://topic-protocol.ixo.world/schemas/settlement-receipt.schema.json", "required": true},
82
+ {"name": "payment-terms", "source": "contract_pack", "schemaRef": "https://topic-protocol.ixo.world/schemas/payment-terms.schema.json", "required": true},
83
+ {"name": "payable-obligation", "source": "contract_pack", "schemaRef": "https://topic-protocol.ixo.world/schemas/payable-obligation.schema.json", "required": true},
84
+ {"name": "delivery-order", "source": "proposed_extension", "schemaRef": "urn:ixo:decision-to-pay:schema:delivery-order:v1", "required": true}
85
+ ],
86
+ "operations": [
87
+ "propose-contract",
88
+ "update-contract",
89
+ "accept-contract",
90
+ "supersede-contract",
91
+ "bind-external-work",
92
+ "sync-external-work",
93
+ "submit-delivery",
94
+ "record-delivery-decision",
95
+ "record-evaluation",
96
+ "record-approval",
97
+ "record-claim",
98
+ "record-settlement",
99
+ "change-status",
100
+ "resolve-conflict"
101
+ ],
102
+ "gates": [
103
+ {
104
+ "id": "delivery-terms-accepted",
105
+ "stage": "terms",
106
+ "description": "Order, delivery acceptance criteria, payment terms, payer, payee, and recipient authority must be pinned before dispatch.",
107
+ "all": [
108
+ {"contract": "topic-contract-state", "path": "/contracts/effective/body/status", "operator": "equals", "value": "accepted"},
109
+ {"contract": "payment-terms", "path": "/status", "operator": "equals", "value": "accepted"}
110
+ ],
111
+ "onFailure": "block"
112
+ },
113
+ {
114
+ "id": "physical-delivery-evidenced",
115
+ "stage": "delivery",
116
+ "description": "The handoff must reference physical proof covering recipient, time, place, quantity, and condition.",
117
+ "all": [
118
+ {"contract": "delivery-packet", "path": "/status", "operator": "equals", "value": "submitted"},
119
+ {"contract": "delivery-packet", "path": "/evidence", "operator": "min_count", "value": 1},
120
+ {"contract": "delivery-packet", "path": "/paymentTerms/digest", "operator": "digest_matches", "value": "accepted_payment_terms"}
121
+ ],
122
+ "onFailure": "return_for_changes"
123
+ },
124
+ {
125
+ "id": "recipient-and-condition-accepted",
126
+ "stage": "delivery",
127
+ "description": "An authorised verifier must accept the exact delivery packet under the delivery-order acceptance policy.",
128
+ "all": [
129
+ {"contract": "delivery-decision", "path": "/decision", "operator": "equals", "value": "accepted"},
130
+ {"contract": "delivery-decision", "path": "/deliveryPacketDigest", "operator": "digest_matches", "value": "current_delivery_packet"}
131
+ ],
132
+ "onFailure": "open_incident"
133
+ },
134
+ {
135
+ "id": "delivery-evaluation-supported",
136
+ "stage": "evaluation",
137
+ "description": "Quantity, condition, timing, and recipient checks must all be supported or explicitly routed for review.",
138
+ "all": [
139
+ {"contract": "evaluation-assertion", "path": "/outcome", "operator": "all_equal", "value": "supported"},
140
+ {"contract": "evaluation-assertion", "path": "/deliveryPacketDigest", "operator": "all_equal", "value": "current_delivery_packet_digest"}
141
+ ],
142
+ "onFailure": "human_review"
143
+ },
144
+ {
145
+ "id": "delivery-payment-approved",
146
+ "stage": "approval",
147
+ "description": "The authorised payment decision must approve the accepted delivery and exact evaluation set.",
148
+ "all": [
149
+ {"contract": "approval-decision", "path": "/decision", "operator": "equals", "value": "approved"},
150
+ {"contract": "approval-decision", "path": "/evaluationIds", "operator": "all_equal", "value": "settlement_evaluation_ids"}
151
+ ],
152
+ "onFailure": "block"
153
+ },
154
+ {
155
+ "id": "delivery-claim-approved",
156
+ "stage": "claim",
157
+ "description": "The current claim must be approved and exactly match the payable obligation.",
158
+ "all": [
159
+ {"contract": "claim-record", "path": "/status", "operator": "equals", "value": "approved"},
160
+ {"contract": "claim-record", "path": "/requested", "operator": "digest_matches", "value": "payable_obligation_requested"}
161
+ ],
162
+ "onFailure": "block"
163
+ },
164
+ {
165
+ "id": "delivery-settlement-clear",
166
+ "stage": "settlement",
167
+ "description": "No unresolved delivery dispute, refund hold, identity failure, funding failure, or replay conflict may remain.",
168
+ "all": [
169
+ {"contract": "operator-verification", "path": "/disputeHold", "operator": "equals", "value": false},
170
+ {"contract": "operator-verification", "path": "/identity", "operator": "equals", "value": "passed"},
171
+ {"contract": "operator-verification", "path": "/funding", "operator": "equals", "value": "passed"},
172
+ {"contract": "operator-verification", "path": "/idempotencyKey", "operator": "exists"}
173
+ ],
174
+ "onFailure": "block"
175
+ }
176
+ ],
177
+ "settlement": {
178
+ "movesFunds": false,
179
+ "requiresExternalAdapter": true,
180
+ "failClosed": true,
181
+ "requiredAxes": ["delivery", "evaluation", "approval", "claim", "settlement"],
182
+ "exactMatchFields": ["topicId", "deliveryPacketId", "deliveryPacketDigest", "evaluationIds", "approvalId", "claimId", "amount", "asset", "recipient"],
183
+ "terminalState": "confirmed"
184
+ },
185
+ "privacy": {
186
+ "topicIsConfidentialityBoundary": false,
187
+ "topicCapabilityGrantsVfsAccess": false,
188
+ "sensitiveResourceStorage": "encrypted_room_or_ucan_vfs",
189
+ "minimumRoomVisibleFields": ["delivery phase", "delivery window", "exception state"]
190
+ },
191
+ "acceptanceCriteria": [
192
+ {"id": "honest-draft", "statement": "A title and Task Kind create a valid Draft without inventing order, delivery, recipient, or payment details."},
193
+ {"id": "physical-semantics", "statement": "The client distinguishes physical proof of delivery from the protocol Delivery Packet handoff."},
194
+ {"id": "partial-delivery-exception", "statement": "Partial, damaged, late, refused, or misdirected delivery blocks automatic payment and opens a visible exception path."},
195
+ {"id": "recipient-authority", "statement": "Receipt acknowledgement from an unauthorised identity cannot accept delivery."},
196
+ {"id": "fail-closed-payment", "statement": "No payment is recorded until delivery, evaluation, approval, claim, operator, and exact-match gates pass."}
197
+ ]
198
+ }
@@ -0,0 +1,283 @@
1
+ {
2
+ "$schema": "../../schemas/decision-to-pay-template.schema.json",
3
+ "version": 1,
4
+ "id": "urn:ixo:decision-to-pay:template:verified-work-payment",
5
+ "templateVersion": "0.1.0",
6
+ "label": "Verified Work Payment",
7
+ "description": "Commission work, preserve the accepted terms and evidence, review the immutable delivery handoff, and allow settlement only after evaluation, approval, and claim gates agree.",
8
+ "maturity": "draft",
9
+ "compatibility": {
10
+ "protocolPackage": "@ixo/topic-protocol",
11
+ "protocolVersion": "0.7.0",
12
+ "sourceCommit": "40d1ce5160757553cd57f670b5b1708a5c0d0ea3",
13
+ "implementationStatus": "draft_contract_extension",
14
+ "requiredExtensions": [
15
+ "org.ixo.payment-terms/v1",
16
+ "org.ixo.payable-obligation/v1",
17
+ "ixo.payment capability policy/v1",
18
+ "payment-rail adapter"
19
+ ],
20
+ "constraints": [
21
+ "The Job Card and external-work bridge are shipped protocol contracts; the shared payment resources are draft extensions to the 0.7 baseline and do not establish deployed payment support.",
22
+ "External work completion may produce handoff_ready only and never directly produces delivery acceptance, claim approval, or settlement confirmation."
23
+ ]
24
+ },
25
+ "topic": {
26
+ "primaryRole": "work_case",
27
+ "kindRef": {
28
+ "source": "custom",
29
+ "customId": "org.ixo.job-card",
30
+ "label": "Job",
31
+ "baseKind": "task"
32
+ },
33
+ "kindProfile": {
34
+ "id": "https://topic-protocol.ixo.world/profiles/job-card",
35
+ "version": "1.0.0",
36
+ "schema": "https://topic-protocol.ixo.world/schemas/topic-kind-profile.schema.json",
37
+ "digest": "sha256:0991eb565e1253c5caf92e7f06a392edacda6d9d90c3b3111ebfa6bf65b8eaf5"
38
+ },
39
+ "recipe": "project",
40
+ "workingMode": "client",
41
+ "temporalMode": "finite",
42
+ "acceptance": {
43
+ "requiredTopicContractPaths": [
44
+ "/intent/text",
45
+ "/outcome/statement/text",
46
+ "/ownerId",
47
+ "/completion/definition",
48
+ "/completion/acceptanceAuthorityIds",
49
+ "/kindResource/value/jobNumber",
50
+ "/kindResource/value/phase"
51
+ ],
52
+ "allowHonestDraft": true
53
+ },
54
+ "lifecyclePolicy": {
55
+ "separateTopicContractOutcomeAxes": true,
56
+ "waitingRule": "The Topic may be waiting while delivery, evaluation, approval, claim, or payment confirmation is outstanding.",
57
+ "resolveRule": "Resolve only under the accepted completion rule; do not infer resolution from an external tracker state or a settlement receipt alone."
58
+ }
59
+ },
60
+ "actors": [
61
+ {
62
+ "role": "payer",
63
+ "label": "Client or payer",
64
+ "required": true,
65
+ "identity": "did",
66
+ "capabilities": ["ixo.payment/accept-terms"]
67
+ },
68
+ {
69
+ "role": "work_provider",
70
+ "label": "Work provider and claimant",
71
+ "required": true,
72
+ "identity": "did",
73
+ "capabilities": ["topic/write", "ixo.payment/submit-delivery", "ixo.payment/record-claim"]
74
+ },
75
+ {
76
+ "role": "delivery_acceptor",
77
+ "label": "Delivery acceptance authority",
78
+ "required": true,
79
+ "identity": "did",
80
+ "capabilities": ["ixo.payment/accept-delivery"]
81
+ },
82
+ {
83
+ "role": "evaluator",
84
+ "label": "Authorised evaluator",
85
+ "required": true,
86
+ "identity": "did",
87
+ "capabilities": ["ixo.payment/evaluate"]
88
+ },
89
+ {
90
+ "role": "payment_approver",
91
+ "label": "Payment approval authority",
92
+ "required": true,
93
+ "identity": "did",
94
+ "capabilities": ["ixo.payment/approve"]
95
+ },
96
+ {
97
+ "role": "settlement_controller",
98
+ "label": "Settlement controller",
99
+ "required": true,
100
+ "identity": "did",
101
+ "capabilities": ["ixo.payment/record-settlement"],
102
+ "constraints": ["Must not be inferred from room membership, external tracker access, or payment recipient identity."]
103
+ }
104
+ ],
105
+ "resources": [
106
+ {
107
+ "role": "job_card",
108
+ "type": "org.ixo.job-card",
109
+ "required": true,
110
+ "binding": "kind_resource",
111
+ "authority": "bound_resource",
112
+ "availability": "topic_protocol_0.7",
113
+ "schemaRef": "https://topic-protocol.ixo.world/schemas/job-card.schema.json",
114
+ "confidentiality": "room_encrypted"
115
+ },
116
+ {
117
+ "role": "payment_terms",
118
+ "type": "org.ixo.payment-terms",
119
+ "required": true,
120
+ "binding": "typed_context",
121
+ "authority": "bound_resource",
122
+ "availability": "contract_pack",
123
+ "schemaRef": "https://topic-protocol.ixo.world/schemas/payment-terms.schema.json",
124
+ "confidentiality": "vfs_ucan"
125
+ },
126
+ {
127
+ "role": "payable_obligation",
128
+ "type": "org.ixo.payable-obligation",
129
+ "required": true,
130
+ "binding": "typed_context",
131
+ "authority": "bound_resource",
132
+ "availability": "contract_pack",
133
+ "schemaRef": "https://topic-protocol.ixo.world/schemas/payable-obligation.schema.json",
134
+ "confidentiality": "room_encrypted",
135
+ "notes": "The envelope projects separate authoritative protocol records and cannot approve or settle itself."
136
+ },
137
+ {
138
+ "role": "external_work",
139
+ "type": "ixo.external-work-binding",
140
+ "required": true,
141
+ "binding": "protocol_record",
142
+ "authority": "external_system",
143
+ "availability": "topic_protocol_0.7",
144
+ "schemaRef": "https://topic-protocol.ixo.world/schemas/external-work-binding.schema.json",
145
+ "confidentiality": "room_encrypted"
146
+ },
147
+ {
148
+ "role": "delivery_evidence",
149
+ "type": "ixo.vfs",
150
+ "required": true,
151
+ "binding": "vfs_attachment",
152
+ "authority": "bound_resource",
153
+ "availability": "topic_protocol_0.7",
154
+ "schemaRef": "https://topic-protocol.ixo.world/schemas/topic-file-attachment.schema.json",
155
+ "confidentiality": "vfs_ucan"
156
+ }
157
+ ],
158
+ "protocolContracts": [
159
+ {"name": "topic-contract-state", "source": "topic_protocol", "schemaRef": "https://topic-protocol.ixo.world/schemas/topic-contract-state.schema.json", "required": true},
160
+ {"name": "job-card", "source": "topic_protocol", "schemaRef": "https://topic-protocol.ixo.world/schemas/job-card.schema.json", "required": true},
161
+ {"name": "external-work-binding", "source": "topic_protocol", "schemaRef": "https://topic-protocol.ixo.world/schemas/external-work-binding.schema.json", "required": true},
162
+ {"name": "delivery-packet", "source": "topic_protocol", "schemaRef": "https://topic-protocol.ixo.world/schemas/delivery-packet.schema.json", "required": true},
163
+ {"name": "delivery-decision", "source": "topic_protocol", "schemaRef": "https://topic-protocol.ixo.world/schemas/delivery-decision.schema.json", "required": true},
164
+ {"name": "evaluation-assertion", "source": "topic_protocol", "schemaRef": "https://topic-protocol.ixo.world/schemas/evaluation-assertion.schema.json", "required": true},
165
+ {"name": "approval-decision", "source": "topic_protocol", "schemaRef": "https://topic-protocol.ixo.world/schemas/approval-decision.schema.json", "required": true},
166
+ {"name": "claim-record", "source": "topic_protocol", "schemaRef": "https://topic-protocol.ixo.world/schemas/claim-record.schema.json", "required": true},
167
+ {"name": "settlement-receipt", "source": "topic_protocol", "schemaRef": "https://topic-protocol.ixo.world/schemas/settlement-receipt.schema.json", "required": true},
168
+ {"name": "payment-terms", "source": "contract_pack", "schemaRef": "https://topic-protocol.ixo.world/schemas/payment-terms.schema.json", "required": true},
169
+ {"name": "payable-obligation", "source": "contract_pack", "schemaRef": "https://topic-protocol.ixo.world/schemas/payable-obligation.schema.json", "required": true}
170
+ ],
171
+ "operations": [
172
+ "propose-contract",
173
+ "update-contract",
174
+ "accept-contract",
175
+ "supersede-contract",
176
+ "bind-external-work",
177
+ "sync-external-work",
178
+ "submit-delivery",
179
+ "record-delivery-decision",
180
+ "record-evaluation",
181
+ "record-approval",
182
+ "record-claim",
183
+ "record-settlement",
184
+ "change-status",
185
+ "resolve-conflict"
186
+ ],
187
+ "gates": [
188
+ {
189
+ "id": "terms-accepted",
190
+ "stage": "terms",
191
+ "description": "The Topic contract and pinned Payment Terms must both be accepted before work can become payable.",
192
+ "all": [
193
+ {"contract": "topic-contract-state", "path": "/contracts/effective/body/status", "operator": "equals", "value": "accepted"},
194
+ {"contract": "payment-terms", "path": "/status", "operator": "equals", "value": "accepted"}
195
+ ],
196
+ "onFailure": "block"
197
+ },
198
+ {
199
+ "id": "delivery-submitted",
200
+ "stage": "delivery",
201
+ "description": "An immutable Delivery Packet must bind the accepted contract, work snapshot, deliverables, evidence, and payment terms.",
202
+ "all": [
203
+ {"contract": "delivery-packet", "path": "/status", "operator": "equals", "value": "submitted"},
204
+ {"contract": "delivery-packet", "path": "/contract/digest", "operator": "digest_matches", "value": "effective_topic_contract"},
205
+ {"contract": "delivery-packet", "path": "/paymentTerms/digest", "operator": "digest_matches", "value": "accepted_payment_terms"}
206
+ ],
207
+ "onFailure": "return_for_changes"
208
+ },
209
+ {
210
+ "id": "delivery-accepted",
211
+ "stage": "delivery",
212
+ "description": "The authorised delivery decision must accept the exact submitted packet.",
213
+ "all": [
214
+ {"contract": "delivery-decision", "path": "/decision", "operator": "equals", "value": "accepted"},
215
+ {"contract": "delivery-decision", "path": "/deliveryPacketDigest", "operator": "digest_matches", "value": "current_delivery_packet"}
216
+ ],
217
+ "onFailure": "block"
218
+ },
219
+ {
220
+ "id": "evaluation-supported",
221
+ "stage": "evaluation",
222
+ "description": "Every settlement-referenced evaluation must support the delivery under an approved rubric.",
223
+ "all": [
224
+ {"contract": "evaluation-assertion", "path": "/outcome", "operator": "all_equal", "value": "supported"},
225
+ {"contract": "evaluation-assertion", "path": "/rubric/governanceStatus", "operator": "all_equal", "value": "approved"}
226
+ ],
227
+ "onFailure": "human_review"
228
+ },
229
+ {
230
+ "id": "payment-approved",
231
+ "stage": "approval",
232
+ "description": "An authorised approval decision must approve the exact packet and evaluation set.",
233
+ "all": [
234
+ {"contract": "approval-decision", "path": "/decision", "operator": "equals", "value": "approved"},
235
+ {"contract": "approval-decision", "path": "/evaluationIds", "operator": "all_equal", "value": "settlement_evaluation_ids"}
236
+ ],
237
+ "onFailure": "block"
238
+ },
239
+ {
240
+ "id": "claim-approved",
241
+ "stage": "claim",
242
+ "description": "The current claim must be approved for the exact payer-approved amount, asset, and recipient.",
243
+ "all": [
244
+ {"contract": "claim-record", "path": "/status", "operator": "equals", "value": "approved"},
245
+ {"contract": "claim-record", "path": "/requested", "operator": "digest_matches", "value": "payable_obligation_requested"}
246
+ ],
247
+ "onFailure": "block"
248
+ },
249
+ {
250
+ "id": "settlement-operator-ready",
251
+ "stage": "settlement",
252
+ "description": "Funding, identity, dispute, replay, and payment-rail checks remain external operator gates.",
253
+ "all": [
254
+ {"contract": "operator-verification", "path": "/funding", "operator": "equals", "value": "passed"},
255
+ {"contract": "operator-verification", "path": "/identity", "operator": "equals", "value": "passed"},
256
+ {"contract": "operator-verification", "path": "/disputeHold", "operator": "equals", "value": false},
257
+ {"contract": "operator-verification", "path": "/idempotencyKey", "operator": "exists"}
258
+ ],
259
+ "onFailure": "block"
260
+ }
261
+ ],
262
+ "settlement": {
263
+ "movesFunds": false,
264
+ "requiresExternalAdapter": true,
265
+ "failClosed": true,
266
+ "requiredAxes": ["delivery", "evaluation", "approval", "claim", "settlement"],
267
+ "exactMatchFields": ["topicId", "deliveryPacketId", "deliveryPacketDigest", "evaluationIds", "approvalId", "claimId", "amount", "asset", "recipient"],
268
+ "terminalState": "confirmed"
269
+ },
270
+ "privacy": {
271
+ "topicIsConfidentialityBoundary": false,
272
+ "topicCapabilityGrantsVfsAccess": false,
273
+ "sensitiveResourceStorage": "encrypted_room_or_ucan_vfs",
274
+ "minimumRoomVisibleFields": ["jobNumber", "phase", "priority", "scheduled.start"]
275
+ },
276
+ "acceptanceCriteria": [
277
+ {"id": "honest-draft", "statement": "The template can create a Draft from title and Kind without inventing commercial terms, authority, evidence, amount, or deadline."},
278
+ {"id": "immutable-handoff", "statement": "A correction creates a superseding Delivery Packet and never rewrites the accepted packet."},
279
+ {"id": "tracker-is-not-authority", "statement": "External work completion cannot set delivery, evaluation, approval, claim, or settlement state."},
280
+ {"id": "fail-closed-payment", "statement": "Settlement is blocked unless all exact-match and operator gates pass."},
281
+ {"id": "separate-statuses", "statement": "The UI renders Topic, contract, outcome, external work, delivery, evaluation, approval, claim, and settlement statuses separately."}
282
+ ]
283
+ }