@ixo/topic-protocol 0.6.0 → 0.8.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.
- package/README.md +6 -2
- package/dist/schemas/action-receipt.schema.json +105 -11
- package/dist/schemas/approval-decision.schema.json +30 -0
- package/dist/schemas/claim-record.schema.json +30 -0
- package/dist/schemas/decision-to-pay-template.schema.json +346 -0
- package/dist/schemas/delivery-decision.schema.json +28 -0
- package/dist/schemas/delivery-packet.schema.json +58 -0
- package/dist/schemas/evaluation-assertion.schema.json +37 -0
- package/dist/schemas/external-work-binding.schema.json +83 -0
- package/dist/schemas/external-work-state-map.schema.json +29 -0
- package/dist/schemas/payable-obligation.schema.json +312 -0
- package/dist/schemas/payment-terms.schema.json +287 -0
- package/dist/schemas/settlement-receipt.schema.json +53 -0
- package/dist/schemas/topic-action-request.schema.json +30 -0
- package/dist/schemas/topic-contract-state.schema.json +29 -3
- package/dist/schemas/topic-flow-binding.schema.json +28 -0
- package/dist/schemas/topic-kind-profile.schema.json +32 -2
- package/dist/schemas/topic-operation.schema.json +2 -2
- package/dist/schemas/topic-state.schema.json +14 -0
- package/dist/schemas/work-item-snapshot.schema.json +73 -0
- package/dist/src/action-runtime/types.d.ts +101 -0
- package/dist/src/action-runtime/types.js +12 -0
- package/dist/src/action-runtime/types.js.map +1 -0
- package/dist/src/contracts/schemas.d.ts +3611 -130
- package/dist/src/contracts/schemas.js +28 -0
- package/dist/src/contracts/schemas.js.map +1 -1
- package/dist/src/contracts/topic-contract.d.ts +8 -1
- package/dist/src/contracts/topic-contract.js.map +1 -1
- package/dist/src/contracts/topic-kind-profile.d.ts +29 -0
- package/dist/src/contracts/topic-kind-profile.js +31 -0
- package/dist/src/contracts/topic-kind-profile.js.map +1 -1
- package/dist/src/errors.d.ts +1 -1
- package/dist/src/errors.js.map +1 -1
- package/dist/src/index.d.ts +4 -1
- package/dist/src/index.js +4 -1
- package/dist/src/index.js.map +1 -1
- package/dist/src/projector/payload.d.ts +47 -0
- package/dist/src/projector/payload.js +140 -2
- package/dist/src/projector/payload.js.map +1 -1
- package/dist/src/projector/state.js +150 -0
- package/dist/src/projector/state.js.map +1 -1
- package/dist/src/projector/types.d.ts +15 -3
- package/dist/src/projector/types.js.map +1 -1
- package/dist/src/work-bridge/mapping.d.ts +2 -0
- package/dist/src/work-bridge/mapping.js +17 -0
- package/dist/src/work-bridge/mapping.js.map +1 -0
- package/dist/src/work-bridge/project.d.ts +7 -0
- package/dist/src/work-bridge/project.js +262 -0
- package/dist/src/work-bridge/project.js.map +1 -0
- package/dist/src/work-bridge/types.d.ts +232 -0
- package/dist/src/work-bridge/types.js +26 -0
- package/dist/src/work-bridge/types.js.map +1 -0
- package/package.json +4 -2
- package/templates/decision-to-pay/README.md +59 -0
- package/templates/decision-to-pay/milestone-payment-release.template.json +195 -0
- package/templates/decision-to-pay/outcome-payment-claim.template.json +198 -0
- package/templates/decision-to-pay/payment-on-delivery.template.json +198 -0
- package/templates/decision-to-pay/verified-work-payment.template.json +283 -0
|
@@ -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
|
+
}
|