@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,319 @@
1
+ {
2
+ "$schema": "../../schemas/decision-to-pay-template-v2.schema.json",
3
+ "version": 2,
4
+ "id": "urn:ixo:decision-to-pay:template:verified-work-payment",
5
+ "templateVersion": "0.2.0",
6
+ "label": "Verified Work Payment",
7
+ "description": "Commission work through a Deed-bound Job, grant a selected Service Agent exact claim authority, escrow an intent, evaluate submitted evidence, and let the IXO Claims module record the determination and control payment.",
8
+ "maturity": "candidate",
9
+ "compatibility": {
10
+ "protocolPackage": "@ixo/topic-protocol",
11
+ "protocolVersion": "0.8.0",
12
+ "sourceCommit": "3cab2dd2f2606d33da588e9875c025eaea4b9e4c",
13
+ "claimsModule": "v8",
14
+ "sdkVersion": "3.0.0",
15
+ "implementationStatus": "candidate_contract",
16
+ "requiredExtensions": [
17
+ "org.ixo.payment-terms/v2",
18
+ "org.ixo.payable-obligation/v2",
19
+ "ixo.claims.v1beta1",
20
+ "ixo-evaluation-engine/signed-receipt"
21
+ ],
22
+ "constraints": [
23
+ "The Deed is the executable work-package authority; the Job Topic is its binder, message thread and projection.",
24
+ "The IXO Claims module is authoritative for intent, escrow, claim, evaluation, payment, deposits, disputes and adjudication.",
25
+ "The bounded mainnet pilot requires human-signed evaluations; capped automation is testnet-only until separately approved."
26
+ ]
27
+ },
28
+ "topic": {
29
+ "kind": "org.ixo.job-card",
30
+ "profile": "https://topic-protocol.ixo.world/profiles/job-card",
31
+ "domain": "deed",
32
+ "role": "contract_binder_and_message_thread",
33
+ "bindingPaths": {
34
+ "deed": "/bindings/deed",
35
+ "claimCollection": "/bindings/claimCollection",
36
+ "manifest": "/bindings/verifiedWorkPaymentManifest",
37
+ "claimSchema": "/bindings/claimSchema",
38
+ "rubric": "/bindings/rubric"
39
+ },
40
+ "lifecyclePolicy": {
41
+ "topicIsProjection": true,
42
+ "chainStateIsAuthoritative": true,
43
+ "resolveRule": "Resolve the Job only after the configured completion rule and a terminal Claims-module state; settlement alone does not rewrite the Job contract."
44
+ }
45
+ },
46
+ "authorities": {
47
+ "workPackage": "deed",
48
+ "conversation": "job_topic",
49
+ "claims": "ixo.claims.v1beta1",
50
+ "evaluation": "ixo_evaluation_engine",
51
+ "orchestration": "ixo_portal"
52
+ },
53
+ "actors": [
54
+ {
55
+ "role": "deed_owner",
56
+ "identity": "did",
57
+ "required": true,
58
+ "capabilities": ["deed/configure", "claims/authorise", "claims/pause"],
59
+ "constraints": ["Must control the Deed entity and its Claims admin account."]
60
+ },
61
+ {
62
+ "role": "payer",
63
+ "identity": "did",
64
+ "required": true,
65
+ "capabilities": ["claims/fund-intent"],
66
+ "constraints": ["Payment accounts must be entity accounts configured on the Claim Collection."]
67
+ },
68
+ {
69
+ "role": "service_agent",
70
+ "identity": "did",
71
+ "required": true,
72
+ "capabilities": ["bid/submit", "claim/intent", "claim/submit"],
73
+ "constraints": ["Claim and intent actions require the accepted bid's scoped SubmitClaimAuthorization."]
74
+ },
75
+ {
76
+ "role": "evaluation_engine",
77
+ "identity": "did",
78
+ "required": true,
79
+ "capabilities": ["claim/read-evidence", "evaluation/issue-receipt"],
80
+ "constraints": ["May submit MsgEvaluateClaim only when an explicit environment-specific chain grant and policy enable automation."]
81
+ },
82
+ {
83
+ "role": "human_evaluator",
84
+ "identity": "did",
85
+ "required": true,
86
+ "capabilities": ["claim/evaluate"],
87
+ "constraints": ["A changed determination requires a newly issued final receipt before signing MsgEvaluateClaim."]
88
+ },
89
+ {
90
+ "role": "adjudicator",
91
+ "identity": "did",
92
+ "required": true,
93
+ "capabilities": ["claim/adjudicate-dispute"],
94
+ "constraints": ["Must be whitelisted by the Claim Collection and sign the canonical resolution payload."
95
+ ]
96
+ }
97
+ ],
98
+ "resources": [
99
+ {
100
+ "role": "deed",
101
+ "type": "ixo.iid.entity.deed",
102
+ "required": true,
103
+ "authority": "deed",
104
+ "binding": "topic_binding",
105
+ "confidentiality": "public",
106
+ "notes": "Owns the executable work package and Claim Collection."
107
+ },
108
+ {
109
+ "role": "payment_terms",
110
+ "type": "org.ixo.payment-terms",
111
+ "required": true,
112
+ "authority": "bound_resource",
113
+ "binding": "deed_linked_resource",
114
+ "schemaRef": "https://topic-protocol.ixo.world/schemas/payment-terms-v2.schema.json",
115
+ "confidentiality": "vfs_ucan"
116
+ },
117
+ {
118
+ "role": "payable_obligation",
119
+ "type": "org.ixo.payable-obligation",
120
+ "required": true,
121
+ "authority": "ixo_claims_module",
122
+ "binding": "claims_record",
123
+ "schemaRef": "https://topic-protocol.ixo.world/schemas/payable-obligation-v2.schema.json",
124
+ "confidentiality": "room_encrypted",
125
+ "notes": "Read-only projection; cannot approve, settle or reverse payment."
126
+ },
127
+ {
128
+ "role": "bid_schema",
129
+ "type": "surveyjs.bid",
130
+ "required": true,
131
+ "authority": "deed",
132
+ "binding": "deed_linked_resource",
133
+ "confidentiality": "vfs_ucan"
134
+ },
135
+ {
136
+ "role": "claim_schema",
137
+ "type": "surveyjs.claim",
138
+ "required": true,
139
+ "authority": "deed",
140
+ "binding": "deed_linked_resource",
141
+ "confidentiality": "vfs_ucan"
142
+ },
143
+ {
144
+ "role": "claim_collection",
145
+ "type": "ixo.claims.v1beta1.Collection",
146
+ "required": true,
147
+ "authority": "ixo_claims_module",
148
+ "binding": "claims_record",
149
+ "confidentiality": "claims_module"
150
+ },
151
+ {
152
+ "role": "rubric",
153
+ "type": "ixo.evaluation.rubric",
154
+ "required": true,
155
+ "authority": "deed",
156
+ "binding": "deed_linked_resource",
157
+ "confidentiality": "vfs_ucan"
158
+ },
159
+ {
160
+ "role": "evaluation_receipt",
161
+ "type": "ixo.udid.impact-determination",
162
+ "required": true,
163
+ "authority": "evaluation_engine",
164
+ "binding": "content_addressed_receipt",
165
+ "confidentiality": "room_encrypted"
166
+ },
167
+ {
168
+ "role": "evidence",
169
+ "type": "ixo.vfs",
170
+ "required": true,
171
+ "authority": "bound_resource",
172
+ "binding": "vfs_attachment",
173
+ "confidentiality": "vfs_ucan"
174
+ }
175
+ ],
176
+ "lifecycle": [
177
+ {
178
+ "sequence": 1,
179
+ "id": "validate-deed",
180
+ "authority": "deed",
181
+ "preconditions": ["All constitutional, instruction, schema, collection, rubric, service, capability and funding checks pass."],
182
+ "result": "A content-addressed readiness report authorises Job launch."
183
+ },
184
+ {
185
+ "sequence": 2,
186
+ "id": "create-job-topic",
187
+ "authority": "job_topic",
188
+ "preconditions": ["The Topic is created inside the validated Deed domain with every required binding."],
189
+ "result": "The Job binder and participant message thread exist without becoming payment authority."
190
+ },
191
+ {
192
+ "sequence": 3,
193
+ "id": "submit-bid",
194
+ "authority": "bids_service",
195
+ "preconditions": ["The Service Agent uses the Deed bid schema and signs the bid."],
196
+ "result": "A pending bid binds provider identity, price, quota, intent duration and expiry."
197
+ },
198
+ {
199
+ "sequence": 4,
200
+ "id": "accept-bid-and-grant",
201
+ "authority": "cosmos_authz",
202
+ "messageType": "/cosmos.authz.v1beta1.MsgGrant",
203
+ "preconditions": ["The accepted bid values pass the Payment Terms and collection caps."],
204
+ "result": "The selected Service Agent receives an exact SubmitClaimAuthorization."
205
+ },
206
+ {
207
+ "sequence": 5,
208
+ "id": "claim-intent",
209
+ "authority": "ixo_claims_module",
210
+ "messageType": "/ixo.claims.v1beta1.MsgClaimIntent",
211
+ "preconditions": ["Collection intent policy permits the action and the scoped grant covers the amount and duration."],
212
+ "result": "The Claims module records an active intent and escrows the configured funds."
213
+ },
214
+ {
215
+ "sequence": 6,
216
+ "id": "submit-claim",
217
+ "authority": "ixo_claims_module",
218
+ "messageType": "/ixo.claims.v1beta1.MsgSubmitClaim",
219
+ "preconditions": ["Work evidence validates against the bound claim schema and the required intent is active."],
220
+ "result": "The Claims module records the evidence-bound claim."
221
+ },
222
+ {
223
+ "sequence": 7,
224
+ "id": "evaluate-evidence",
225
+ "authority": "evaluation_engine",
226
+ "preconditions": ["Claim, collection, Deed, claim schema, rubric and evidence digests all match."],
227
+ "result": "The engine normalises facts, applies the rubric and issues a signed UDID Impact Determination receipt."
228
+ },
229
+ {
230
+ "sequence": 8,
231
+ "id": "record-evaluation",
232
+ "authority": "ixo_claims_module",
233
+ "messageType": "/ixo.claims.v1beta1.MsgEvaluateClaim",
234
+ "preconditions": ["The authorised signer verifies that the receipt and proposed chain status match exactly."],
235
+ "result": "The Claims module records APPROVED, REJECTED, FLAGGED or INVALIDATED and applies canonical payment rules."
236
+ },
237
+ {
238
+ "sequence": 9,
239
+ "id": "project-payment",
240
+ "authority": "ixo_claims_module",
241
+ "preconditions": ["Portal reads payment state from Claims and Blocksync instead of a local settlement state machine."],
242
+ "result": "The Job displays the authoritative payment status and transaction reference."
243
+ },
244
+ {
245
+ "sequence": 10,
246
+ "id": "dispute-and-adjudicate",
247
+ "authority": "ixo_claims_module",
248
+ "messageType": "/ixo.claims.v1beta1.MsgDisputeClaim",
249
+ "preconditions": ["The disputing DID is registered and deposits and adjudicators are configured."],
250
+ "result": "A canonical dispute is opened; a whitelisted adjudicator later resolves it with MsgAdjudicateDispute."
251
+ }
252
+ ],
253
+ "capabilityPolicy": {
254
+ "submitClaimAuthorization": {
255
+ "typeUrl": "/ixo.claims.v1beta1.SubmitClaimAuthorization",
256
+ "requiredConstraints": ["collectionId", "agentQuota", "maxAmount", "intentDurationNs", "memberAddress"],
257
+ "deriveFromAcceptedBid": true,
258
+ "expiryBound": "min(job_end,collection_end)"
259
+ },
260
+ "evaluateClaimAuthorization": {
261
+ "typeUrl": "/ixo.claims.v1beta1.EvaluateClaimAuthorization",
262
+ "requiredConstraints": ["collectionId", "claimIds", "agentQuota", "beforeDate", "maxCustomAmount"],
263
+ "expiryBound": "collection_end"
264
+ },
265
+ "engineUcan": {
266
+ "abilities": ["ixo:matrix-claims-bot", "subscriptions/read"],
267
+ "audienceBound": true,
268
+ "resourceBound": true,
269
+ "timeBound": true,
270
+ "revocable": true,
271
+ "environmentBound": true
272
+ },
273
+ "revocationTriggers": ["job_cancelled", "job_completed", "job_expired", "bidder_removed", "security_incident"]
274
+ },
275
+ "pilotPolicy": {
276
+ "intentPolicy": "REQUIRED",
277
+ "assetType": "native",
278
+ "payoutTimeoutNs": "0",
279
+ "mainnetEvaluationMode": "HUMAN_SIGNED",
280
+ "testnetAutomation": "CAPPED",
281
+ "deferredFeatures": ["cw20", "cw1155", "team_budgets", "delayed_withdrawal", "mainnet_automation", "other_decision_to_pay_templates"]
282
+ },
283
+ "settlement": {
284
+ "templateMovesFunds": false,
285
+ "claimsModuleMovesFunds": true,
286
+ "authority": "ixo.claims.v1beta1",
287
+ "adapter": "canonical_impactxclient_sdk",
288
+ "approvalTrigger": "MsgEvaluateClaim(APPROVED)",
289
+ "disputeRecourse": "deposit_slashing_and_adjudication_not_payment_reversal"
290
+ },
291
+ "privacy": {
292
+ "topicIsConfidentialityBoundary": false,
293
+ "topicCapabilityGrantsVfsAccess": false,
294
+ "sensitiveResourceStorage": "encrypted_room_or_ucan_vfs",
295
+ "receiptExcludesPii": true
296
+ },
297
+ "acceptanceCriteria": [
298
+ {
299
+ "id": "deed-ready",
300
+ "statement": "Job launch is impossible until the complete Deed work package passes readiness checks.",
301
+ "verification": "Negative fixtures omit each required resource and assert launch remains blocked."
302
+ },
303
+ {
304
+ "id": "least-authority",
305
+ "statement": "An accepted bid grants only the negotiated claim scope and rejected, expired or excessive actions fail.",
306
+ "verification": "Inspect the decoded authz grant and execute negative chain vectors."
307
+ },
308
+ {
309
+ "id": "proof-to-payment",
310
+ "statement": "Required intent, evidence-bound claim, signed receipt and human evaluation produce the exact Claims-module payment.",
311
+ "verification": "Publish real-wallet transaction hashes, receipt CID and payment projection from testnet."
312
+ },
313
+ {
314
+ "id": "flag-and-dispute",
315
+ "statement": "FLAGGED is non-terminal and unpaid; canonical disputes lock deposits and require whitelisted adjudication.",
316
+ "verification": "Run flag, re-evaluation, awarded-dispute and dismissed-dispute conformance vectors."
317
+ }
318
+ ]
319
+ }