@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,198 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "../../schemas/decision-to-pay-template.schema.json",
|
|
3
|
+
"version": 1,
|
|
4
|
+
"id": "urn:ixo:decision-to-pay:template:outcome-payment-claim",
|
|
5
|
+
"templateVersion": "0.1.0",
|
|
6
|
+
"label": "Outcome Payment Claim",
|
|
7
|
+
"description": "Adjudicate a payment claim against a pinned outcome contract, approved methodology, immutable intervention handoff, admissible evidence, and authorised evaluation and approval records.",
|
|
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
|
+
"outcome contract or deed resource",
|
|
19
|
+
"evaluation runtime and oracle adapter",
|
|
20
|
+
"claims authority adapter",
|
|
21
|
+
"payment-rail adapter"
|
|
22
|
+
],
|
|
23
|
+
"constraints": [
|
|
24
|
+
"The template assumes an immutable Delivery Packet for the intervention or service that produced the claimed result.",
|
|
25
|
+
"Outcome claims without external work require a future generalized obligation handoff and cannot bypass the current settlement gate.",
|
|
26
|
+
"A supported evaluation is evidence for approval and is never itself payment authority."
|
|
27
|
+
]
|
|
28
|
+
},
|
|
29
|
+
"topic": {
|
|
30
|
+
"primaryRole": "payment_claim",
|
|
31
|
+
"kindRef": {"source": "standard", "kind": "claims"},
|
|
32
|
+
"recipe": "claims",
|
|
33
|
+
"workingMode": "client",
|
|
34
|
+
"temporalMode": "finite",
|
|
35
|
+
"acceptance": {
|
|
36
|
+
"requiredTopicContractPaths": [
|
|
37
|
+
"/intent/text",
|
|
38
|
+
"/outcome/statement/text",
|
|
39
|
+
"/completion/definition",
|
|
40
|
+
"/completion/acceptanceAuthorityIds",
|
|
41
|
+
"/attachments/0"
|
|
42
|
+
],
|
|
43
|
+
"allowHonestDraft": true
|
|
44
|
+
},
|
|
45
|
+
"lifecyclePolicy": {
|
|
46
|
+
"separateTopicContractOutcomeAxes": true,
|
|
47
|
+
"waitingRule": "The Claims Topic may wait on admissible evidence, evaluator availability, manual review, dispute resolution, claim authority, funding, or payment finality.",
|
|
48
|
+
"resolveRule": "Resolve only under the accepted claim-closure rule; a supported outcome, approved claim, and confirmed settlement remain separate facts."
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
"actors": [
|
|
52
|
+
{"role": "payer", "label": "Outcome payer or funder", "required": true, "identity": "did", "capabilities": ["ixo.payment/accept-terms"]},
|
|
53
|
+
{"role": "claimant", "label": "Outcome provider and claimant", "required": true, "identity": "did", "capabilities": ["ixo.payment/record-claim"]},
|
|
54
|
+
{"role": "evaluator", "label": "Independent evaluator or oracle", "required": true, "identity": "did", "capabilities": ["ixo.payment/evaluate"], "constraints": ["Must bind the exact approved rubric, evidence digests, trace digests, delivery packet, and capability."]},
|
|
55
|
+
{"role": "approval_authority", "label": "Outcome payment approval authority", "required": true, "identity": "did", "capabilities": ["ixo.payment/approve"]},
|
|
56
|
+
{"role": "claims_authority", "label": "External claims authority", "required": true, "identity": "did", "capabilities": ["ixo.payment/record-claim"]},
|
|
57
|
+
{"role": "settlement_controller", "label": "Settlement controller", "required": true, "identity": "did", "capabilities": ["ixo.payment/record-settlement"]},
|
|
58
|
+
{"role": "beneficiary_representative", "label": "Beneficiary or affected-party representative", "required": false, "identity": "did", "capabilities": ["topic/read"]}
|
|
59
|
+
],
|
|
60
|
+
"resources": [
|
|
61
|
+
{"role": "outcome_contract", "type": "ixo.outcome-contract", "required": true, "binding": "vfs_attachment", "authority": "bound_resource", "availability": "external", "confidentiality": "vfs_ucan", "notes": "Must pin the result definition, population or asset scope, baseline, measurement window, methodology, pricing rule, dispute rights, and authority."},
|
|
62
|
+
{"role": "claim_collection", "type": "ixo.claim-collection", "required": true, "binding": "vfs_attachment", "authority": "external_system", "availability": "external", "confidentiality": "vfs_ucan"},
|
|
63
|
+
{"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"},
|
|
64
|
+
{"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"},
|
|
65
|
+
{"role": "intervention_delivery", "type": "ixo.delivery-packet", "required": true, "binding": "protocol_record", "authority": "protocol_record", "availability": "topic_protocol_0.7", "schemaRef": "https://topic-protocol.ixo.world/schemas/delivery-packet.schema.json", "confidentiality": "room_encrypted"},
|
|
66
|
+
{"role": "outcome_evidence", "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"},
|
|
67
|
+
{"role": "approved_rubric", "type": "ixo.evaluation-rubric", "required": true, "binding": "external_reference", "authority": "bound_resource", "availability": "external", "confidentiality": "vfs_ucan"}
|
|
68
|
+
],
|
|
69
|
+
"protocolContracts": [
|
|
70
|
+
{"name": "topic-contract-state", "source": "topic_protocol", "schemaRef": "https://topic-protocol.ixo.world/schemas/topic-contract-state.schema.json", "required": true},
|
|
71
|
+
{"name": "delivery-packet", "source": "topic_protocol", "schemaRef": "https://topic-protocol.ixo.world/schemas/delivery-packet.schema.json", "required": true},
|
|
72
|
+
{"name": "delivery-decision", "source": "topic_protocol", "schemaRef": "https://topic-protocol.ixo.world/schemas/delivery-decision.schema.json", "required": true},
|
|
73
|
+
{"name": "evaluation-assertion", "source": "topic_protocol", "schemaRef": "https://topic-protocol.ixo.world/schemas/evaluation-assertion.schema.json", "required": true},
|
|
74
|
+
{"name": "approval-decision", "source": "topic_protocol", "schemaRef": "https://topic-protocol.ixo.world/schemas/approval-decision.schema.json", "required": true},
|
|
75
|
+
{"name": "claim-record", "source": "topic_protocol", "schemaRef": "https://topic-protocol.ixo.world/schemas/claim-record.schema.json", "required": true},
|
|
76
|
+
{"name": "settlement-receipt", "source": "topic_protocol", "schemaRef": "https://topic-protocol.ixo.world/schemas/settlement-receipt.schema.json", "required": true},
|
|
77
|
+
{"name": "payment-terms", "source": "contract_pack", "schemaRef": "https://topic-protocol.ixo.world/schemas/payment-terms.schema.json", "required": true},
|
|
78
|
+
{"name": "payable-obligation", "source": "contract_pack", "schemaRef": "https://topic-protocol.ixo.world/schemas/payable-obligation.schema.json", "required": true}
|
|
79
|
+
],
|
|
80
|
+
"operations": [
|
|
81
|
+
"propose-contract",
|
|
82
|
+
"update-contract",
|
|
83
|
+
"accept-contract",
|
|
84
|
+
"supersede-contract",
|
|
85
|
+
"submit-delivery",
|
|
86
|
+
"record-delivery-decision",
|
|
87
|
+
"record-evaluation",
|
|
88
|
+
"record-approval",
|
|
89
|
+
"record-claim",
|
|
90
|
+
"record-settlement",
|
|
91
|
+
"record-decision",
|
|
92
|
+
"change-status",
|
|
93
|
+
"resolve-conflict"
|
|
94
|
+
],
|
|
95
|
+
"gates": [
|
|
96
|
+
{
|
|
97
|
+
"id": "outcome-terms-accepted",
|
|
98
|
+
"stage": "terms",
|
|
99
|
+
"description": "The claim must pin an accepted outcome contract, methodology, pricing rule, claim collection, payment terms, and authority model.",
|
|
100
|
+
"all": [
|
|
101
|
+
{"contract": "topic-contract-state", "path": "/contracts/effective/body/status", "operator": "equals", "value": "accepted"},
|
|
102
|
+
{"contract": "payment-terms", "path": "/status", "operator": "equals", "value": "accepted"},
|
|
103
|
+
{"contract": "payment-terms", "path": "/calculation/model", "operator": "equals", "value": "outcome"}
|
|
104
|
+
],
|
|
105
|
+
"onFailure": "block"
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
"id": "intervention-handoff-accepted",
|
|
109
|
+
"stage": "delivery",
|
|
110
|
+
"description": "The claimed result must bind an accepted immutable intervention or service handoff.",
|
|
111
|
+
"all": [
|
|
112
|
+
{"contract": "delivery-packet", "path": "/status", "operator": "equals", "value": "submitted"},
|
|
113
|
+
{"contract": "delivery-decision", "path": "/decision", "operator": "equals", "value": "accepted"},
|
|
114
|
+
{"contract": "delivery-decision", "path": "/deliveryPacketDigest", "operator": "digest_matches", "value": "claim_delivery_packet"}
|
|
115
|
+
],
|
|
116
|
+
"onFailure": "block"
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
"id": "outcome-evidence-admissible",
|
|
120
|
+
"stage": "evaluation",
|
|
121
|
+
"description": "Evidence provenance, methodology version, measurement window, population or asset scope, and evaluator authority must pass before determination.",
|
|
122
|
+
"all": [
|
|
123
|
+
{"contract": "evaluation-assertion", "path": "/rubric/governanceStatus", "operator": "all_equal", "value": "approved"},
|
|
124
|
+
{"contract": "evaluation-assertion", "path": "/evidenceDigests", "operator": "min_count", "value": 1},
|
|
125
|
+
{"contract": "operator-verification", "path": "/evidenceAdmissibility", "operator": "equals", "value": "passed"},
|
|
126
|
+
{"contract": "operator-verification", "path": "/evaluatorCapability", "operator": "equals", "value": "valid"}
|
|
127
|
+
],
|
|
128
|
+
"onFailure": "human_review"
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
"id": "outcome-supported",
|
|
132
|
+
"stage": "evaluation",
|
|
133
|
+
"description": "Every settlement-referenced evaluation must support the exact claim; non-terminal or contested outcomes cannot pay.",
|
|
134
|
+
"all": [
|
|
135
|
+
{"contract": "evaluation-assertion", "path": "/outcome", "operator": "all_equal", "value": "supported"},
|
|
136
|
+
{"contract": "evaluation-assertion", "path": "/deliveryPacketDigest", "operator": "all_equal", "value": "claim_delivery_packet_digest"}
|
|
137
|
+
],
|
|
138
|
+
"onFailure": "human_review"
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
"id": "outcome-payment-approved",
|
|
142
|
+
"stage": "approval",
|
|
143
|
+
"description": "Approval must apply the pinned policy to the exact packet and evaluation set.",
|
|
144
|
+
"all": [
|
|
145
|
+
{"contract": "approval-decision", "path": "/decision", "operator": "equals", "value": "approved"},
|
|
146
|
+
{"contract": "approval-decision", "path": "/evaluationIds", "operator": "all_equal", "value": "settlement_evaluation_ids"}
|
|
147
|
+
],
|
|
148
|
+
"onFailure": "block"
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
"id": "outcome-claim-approved",
|
|
152
|
+
"stage": "claim",
|
|
153
|
+
"description": "The external claims authority must approve the current claim for the calculated amount, asset, and recipient.",
|
|
154
|
+
"all": [
|
|
155
|
+
{"contract": "claim-record", "path": "/status", "operator": "equals", "value": "approved"},
|
|
156
|
+
{"contract": "claim-record", "path": "/requested", "operator": "digest_matches", "value": "payable_obligation_requested"},
|
|
157
|
+
{"contract": "claim-record", "path": "/evaluationIds", "operator": "all_equal", "value": "approval_evaluation_ids"}
|
|
158
|
+
],
|
|
159
|
+
"onFailure": "block"
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
"id": "outcome-settlement-clear",
|
|
163
|
+
"stage": "settlement",
|
|
164
|
+
"description": "Identity, eligibility, funding, dispute, trusted-time, revocation, and replay checks must pass before the receipt is admitted.",
|
|
165
|
+
"all": [
|
|
166
|
+
{"contract": "operator-verification", "path": "/identity", "operator": "equals", "value": "passed"},
|
|
167
|
+
{"contract": "operator-verification", "path": "/eligibility", "operator": "equals", "value": "passed"},
|
|
168
|
+
{"contract": "operator-verification", "path": "/funding", "operator": "equals", "value": "passed"},
|
|
169
|
+
{"contract": "operator-verification", "path": "/disputeHold", "operator": "equals", "value": false},
|
|
170
|
+
{"contract": "operator-verification", "path": "/revocation", "operator": "equals", "value": "clear"},
|
|
171
|
+
{"contract": "operator-verification", "path": "/idempotencyKey", "operator": "exists"}
|
|
172
|
+
],
|
|
173
|
+
"onFailure": "block"
|
|
174
|
+
}
|
|
175
|
+
],
|
|
176
|
+
"settlement": {
|
|
177
|
+
"movesFunds": false,
|
|
178
|
+
"requiresExternalAdapter": true,
|
|
179
|
+
"failClosed": true,
|
|
180
|
+
"requiredAxes": ["delivery", "evaluation", "approval", "claim", "settlement"],
|
|
181
|
+
"exactMatchFields": ["topicId", "deliveryPacketId", "deliveryPacketDigest", "evaluationIds", "approvalId", "claimId", "amount", "asset", "recipient"],
|
|
182
|
+
"terminalState": "confirmed"
|
|
183
|
+
},
|
|
184
|
+
"privacy": {
|
|
185
|
+
"topicIsConfidentialityBoundary": false,
|
|
186
|
+
"topicCapabilityGrantsVfsAccess": false,
|
|
187
|
+
"sensitiveResourceStorage": "encrypted_room_or_ucan_vfs",
|
|
188
|
+
"minimumRoomVisibleFields": ["claim reference", "claim status", "evaluation status", "settlement status"]
|
|
189
|
+
},
|
|
190
|
+
"acceptanceCriteria": [
|
|
191
|
+
{"id": "honest-draft", "statement": "A Claims Draft may begin without fabricating outcome, methodology, evidence, amount, claimant, or authority."},
|
|
192
|
+
{"id": "methodology-pinned", "statement": "The evaluation references an approved immutable rubric and exact evidence and trace digests."},
|
|
193
|
+
{"id": "non-terminal-blocked", "statement": "Refuted, insufficient-evidence, human-review, disputed, or superseded evaluations cannot support settlement."},
|
|
194
|
+
{"id": "approval-is-separate", "statement": "A supported evaluation cannot directly approve a claim or move funds."},
|
|
195
|
+
{"id": "claim-state-retained", "statement": "Claim updates retain packet, evaluation, approval, claimant, requested amount, asset, recipient, source, and replay key."},
|
|
196
|
+
{"id": "operator-gates", "statement": "Funding, identity, eligibility, revocation, disputes, trusted time, idempotency, and finality are verified by deployed adapters before settlement confirmation."}
|
|
197
|
+
]
|
|
198
|
+
}
|
|
@@ -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
|
+
}
|