@wowok/skills 1.1.0 → 1.1.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.
- package/README.md +16 -20
- package/dist/cli.js +114 -19
- package/dist/cli.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +11 -1
- package/dist/index.js.map +1 -1
- package/dist/skills.d.ts +46 -1
- package/dist/skills.d.ts.map +1 -1
- package/dist/skills.js +154 -16
- package/dist/skills.js.map +1 -1
- package/dist/types.d.ts +31 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +3 -4
- package/scripts/install.js +5 -3
- package/wowok-arbitrator/SKILL.md +279 -0
- package/wowok-guard/SKILL.md +143 -167
- package/wowok-machine/SKILL.md +167 -279
- package/wowok-order/SKILL.md +281 -429
- package/wowok-provider/SKILL.md +453 -0
- package/wowok-safety/SKILL.md +42 -20
- package/wowok-tools/SKILL.md +328 -343
- package/schemas/onchain_operations/_common.md +0 -406
- package/schemas/onchain_operations/_index.md +0 -196
- package/schemas/onchain_operations/allocation.md +0 -28
- package/schemas/onchain_operations/arbitration.md +0 -106
- package/schemas/onchain_operations/contact.md +0 -40
- package/schemas/onchain_operations/demand.md +0 -53
- package/schemas/onchain_operations/gen_passport.md +0 -23
- package/schemas/onchain_operations/guard.md +0 -56
- package/schemas/onchain_operations/machine.md +0 -89
- package/schemas/onchain_operations/order.md +0 -56
- package/schemas/onchain_operations/payment.md +0 -24
- package/schemas/onchain_operations/permission.md +0 -68
- package/schemas/onchain_operations/personal.md +0 -58
- package/schemas/onchain_operations/progress.md +0 -38
- package/schemas/onchain_operations/repository.md +0 -70
- package/schemas/onchain_operations/reward.md +0 -38
- package/schemas/onchain_operations/service.md +0 -78
- package/schemas/onchain_operations/treasury.md +0 -68
- package/schemas/schema-account_operation.md +0 -402
- package/schemas/schema-guard2file.md +0 -153
- package/schemas/schema-local_info_operation.md +0 -160
- package/schemas/schema-local_mark_operation.md +0 -148
- package/schemas/schema-machineNode2file.md +0 -155
- package/schemas/schema-messenger_operation.md +0 -547
- package/schemas/schema-onchain_events.md +0 -201
- package/schemas/schema-onchain_table_data.md +0 -334
- package/schemas/schema-query_toolkit.md +0 -395
- package/schemas/schema-wip_file.md +0 -240
- package/schemas/schema-wowok_buildin_info.md +0 -296
- package/wowok-build/SKILL.md +0 -139
package/wowok-order/SKILL.md
CHANGED
|
@@ -1,533 +1,385 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: wowok-order
|
|
3
3
|
description: |
|
|
4
|
-
WoWok
|
|
5
|
-
|
|
6
|
-
resolution. Includes order splitting (Allocation), incentive distribution
|
|
7
|
-
(Reward), and arbitration patterns.
|
|
4
|
+
WoWok Customer Guide — complete order lifecycle for buyers: service evaluation,
|
|
5
|
+
consensus building, order creation, progress tracking, and dispute resolution.
|
|
8
6
|
|
|
9
|
-
|
|
10
|
-
order
|
|
7
|
+
Covers the full buyer journey: pre-purchase due diligence based on on-chain objects, consensus establishment with Messenger as off-chain
|
|
8
|
+
but self-verifiable evidence supplement, order operations, progress advancement
|
|
9
|
+
with game theory, and arbitration when needed.
|
|
11
10
|
when_to_use:
|
|
12
|
-
- User
|
|
13
|
-
- User
|
|
14
|
-
- User needs to
|
|
15
|
-
- User
|
|
16
|
-
- User wants to
|
|
11
|
+
- User is a customer/buyer placing or managing orders
|
|
12
|
+
- User wants to evaluate services before purchasing
|
|
13
|
+
- User needs to communicate with sellers via Messenger
|
|
14
|
+
- User asks about order progress, payments, or refunds
|
|
15
|
+
- User wants to file disputes or arbitration claims
|
|
16
|
+
- User mentions "buy", "order", "purchase", "refund", "dispute", "arbitration"
|
|
17
17
|
---
|
|
18
18
|
|
|
19
|
-
# WoWok
|
|
19
|
+
# WoWok Customer Guide
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
Complete guide for buyers on WoWok — from service discovery to order completion.
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
> **Role**: Customer (Buyer/Order Holder)
|
|
24
|
+
> **Provider Guide**: See [wowok-provider](../wowok-provider/SKILL.md)
|
|
25
|
+
> **Arbitration Guide**: See [wowok-arbitrator](../wowok-arbitrator/SKILL.md)
|
|
26
|
+
> **Messenger**: See [wowok-messenger](../wowok-messenger/SKILL.md) for encrypted communication
|
|
27
|
+
> **Tools**: See [wowok-tools](../wowok-tools/SKILL.md)
|
|
24
28
|
|
|
25
|
-
|
|
26
|
-
|--------|-----------|---------|
|
|
27
|
-
| **Order** | User purchase | Order management and escrow |
|
|
28
|
-
| **Progress** | Order creation | Workflow state tracking |
|
|
29
|
-
| **Allocation** | Order completion | Fund distribution per consensus |
|
|
30
|
-
| **Arb(s)** | Dispute request | Arbitration for compensation |
|
|
29
|
+
---
|
|
31
30
|
|
|
32
|
-
|
|
33
|
-
User Purchase
|
|
34
|
-
↓
|
|
35
|
-
Service ──→ Order ──→ Progress ──→ Allocation
|
|
36
|
-
↓ ↓
|
|
37
|
-
Payment Node Transitions
|
|
38
|
-
(escrow) (Guard validated)
|
|
39
|
-
↓
|
|
40
|
-
Completion
|
|
41
|
-
↓
|
|
42
|
-
Fund Distribution
|
|
43
|
-
```
|
|
31
|
+
## Core Concepts
|
|
44
32
|
|
|
45
|
-
|
|
33
|
+
### Order Lifecycle Objects
|
|
46
34
|
|
|
47
|
-
|
|
48
|
-
Demand → Order → Payment → Progress → Completion
|
|
49
|
-
↓
|
|
50
|
-
Arbitration (disputes)
|
|
51
|
-
```
|
|
35
|
+
When you purchase from a Service, three runtime objects are created:
|
|
52
36
|
|
|
53
|
-
|
|
37
|
+
| Object | Purpose | Key Points |
|
|
38
|
+
|--------|---------|------------|
|
|
39
|
+
| **Order** | Fund escrow & ownership | You are the `builder` (owner). Agents can help operate but **only you can withdraw funds**. |
|
|
40
|
+
| **Progress** | Workflow state tracking | Tracks which Machine node you're at. Advanced via Order operations. |
|
|
41
|
+
| **Allocation** | Fund distribution engine | Executes the winning allocator strategy when reaching exit nodes. |
|
|
54
42
|
|
|
55
|
-
|
|
56
|
-
Service (marketplace)
|
|
57
|
-
├── Machine (workflow template)
|
|
58
|
-
├── Allocation (order splitting rules)
|
|
59
|
-
├── Reward (incentive pool)
|
|
60
|
-
└── Treasury (team fund)
|
|
61
|
-
|
|
62
|
-
Order (instance)
|
|
63
|
-
├── references Service
|
|
64
|
-
├── references Machine (for workflow)
|
|
65
|
-
├── Payment (funds transfer)
|
|
66
|
-
└── Progress (workflow tracking)
|
|
67
|
-
```
|
|
43
|
+
### Allocators vs Allocation
|
|
68
44
|
|
|
69
|
-
|
|
45
|
+
- **Allocators** (Service level): Multiple distribution strategies defined by seller, each with a Guard condition
|
|
46
|
+
- **Allocation** (Order level): Auto-created execution engine that evaluates all allocator Guards and runs the strategy whose Guard returns `true`
|
|
70
47
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
service: "<service_name_or_id>",
|
|
77
|
-
machine: "<machine_name_or_id>",
|
|
78
|
-
buyer: "<buyer_address>",
|
|
79
|
-
seller: "<seller_address>",
|
|
80
|
-
price: "<amount>",
|
|
81
|
-
token_type: "<token_type>",
|
|
82
|
-
...
|
|
83
|
-
}
|
|
84
|
-
})
|
|
85
|
-
```
|
|
48
|
+
**When Allocation Executes**:
|
|
49
|
+
- Allocation evaluates **whenever the Progress reaches a node** that triggers fund distribution
|
|
50
|
+
- **Any node** (not just exit nodes) can be configured to trigger Allocation evaluation
|
|
51
|
+
- The winning allocator is the one whose Guard validates `true` for the current state
|
|
52
|
+
- Guards can check: Progress node, time elapsed, signatures, or any on-chain data
|
|
86
53
|
|
|
87
|
-
|
|
54
|
+
**Consensus Principle**: Allocators and their Guard conditions are immutable and transparent. Both parties see the same rules, but choose different paths based on their interests.
|
|
88
55
|
|
|
89
|
-
|
|
90
|
-
```
|
|
91
|
-
onchain_operations({
|
|
92
|
-
operation_type: "payment",
|
|
93
|
-
data: {
|
|
94
|
-
op: "send",
|
|
95
|
-
from: "<sender_account>",
|
|
96
|
-
to: "<recipient_address>",
|
|
97
|
-
amount: "<amount>",
|
|
98
|
-
token_type: "<token_type>"
|
|
99
|
-
}
|
|
100
|
-
})
|
|
101
|
-
```
|
|
56
|
+
---
|
|
102
57
|
|
|
103
|
-
|
|
104
|
-
Orders can hold funds in escrow. Payment is released when order progresses through the Machine workflow.
|
|
58
|
+
## Phase 1: Service Evaluation (Pre-Purchase)
|
|
105
59
|
|
|
106
|
-
|
|
60
|
+
Thoroughly investigate before committing funds.
|
|
107
61
|
|
|
108
|
-
|
|
62
|
+
### 1.1 Query Service Configuration
|
|
109
63
|
|
|
110
|
-
|
|
111
|
-
```
|
|
112
|
-
onchain_operations({
|
|
113
|
-
operation_type: "allocation",
|
|
114
|
-
data: {
|
|
115
|
-
op: "create",
|
|
116
|
-
name: "<allocation_name>",
|
|
117
|
-
service: "<service_id>",
|
|
118
|
-
rules: [
|
|
119
|
-
{
|
|
120
|
-
recipient: "<address_or_guard>",
|
|
121
|
-
share: <percentage_or_fixed>,
|
|
122
|
-
discount_type: "RATES" // or "FIXED"
|
|
123
|
-
}
|
|
124
|
-
]
|
|
125
|
-
}
|
|
126
|
-
})
|
|
127
|
-
```
|
|
64
|
+
**Tool**: Use `query_toolkit` with `onchain_objects` query type to retrieve Service configuration.
|
|
128
65
|
|
|
129
|
-
|
|
130
|
-
| Type | Description |
|
|
131
|
-
|------|-------------|
|
|
132
|
-
| `RATES` | Percentage-based split (e.g., 30% = 30/100) |
|
|
133
|
-
| `FIXED` | Fixed amount split |
|
|
66
|
+
**Schema Reference**: `schema_query({ action: "get", name: "query_toolkit" })`
|
|
134
67
|
|
|
135
|
-
|
|
68
|
+
**Key Fields to Analyze**:
|
|
136
69
|
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
70
|
+
| Field | What to Check | Risk Signals |
|
|
71
|
+
|-------|---------------|--------------|
|
|
72
|
+
| `sales` | Pricing, stock, WIP files | No `wip_hash` = unverified product claims |
|
|
73
|
+
| `machine` | Workflow complexity | Overly complex = higher dispute risk |
|
|
74
|
+
| `allocators` | Fund distribution rules | Unfair splits = reconsider purchase |
|
|
75
|
+
| `arbitrations` | Available dispute resolution | None available = higher risk |
|
|
76
|
+
| `compensation_fund` | Arbitration payout capacity | Low balance = limited recourse |
|
|
144
77
|
|
|
145
|
-
**
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
{ recipient: "<seller>", share: 70, discount_type: "RATES" },
|
|
150
|
-
{ recipient: "<affiliate>", share: 27, discount_type: "RATES" }
|
|
151
|
-
]
|
|
152
|
-
```
|
|
78
|
+
**WIP File Verification**:
|
|
79
|
+
- `wip`: URL to product description/images
|
|
80
|
+
- `wip_hash`: Integrity hash (if empty, auto-verified; if provided, must match)
|
|
81
|
+
- **This is the seller's immutable commitment on-chain** — serves as arbitration evidence
|
|
153
82
|
|
|
154
|
-
|
|
83
|
+
### 1.2 Evaluate Service Reputation
|
|
155
84
|
|
|
156
|
-
|
|
85
|
+
Query the Service's EntityLinker for community endorsement data.
|
|
157
86
|
|
|
158
|
-
|
|
159
|
-
```
|
|
160
|
-
onchain_operations({
|
|
161
|
-
operation_type: "reward",
|
|
162
|
-
data: {
|
|
163
|
-
op: "create",
|
|
164
|
-
name: "<reward_name>",
|
|
165
|
-
service: "<service_id>",
|
|
166
|
-
...
|
|
167
|
-
}
|
|
168
|
-
})
|
|
169
|
-
```
|
|
87
|
+
**Tool**: `query_toolkit` with `onchain_table_item_entity_linker` query type.
|
|
170
88
|
|
|
171
|
-
|
|
172
|
-
1. User meets Reward conditions (validated by Guard)
|
|
173
|
-
2. User claims reward → `onchain_table_data` query `onchain_table_item_reward_record`
|
|
174
|
-
3. Tokens are distributed from the Reward pool
|
|
89
|
+
**Key Metrics to Calculate**:
|
|
175
90
|
|
|
176
|
-
|
|
91
|
+
| Metric | How to Calculate | Good Sign |
|
|
92
|
+
|--------|------------------|-----------|
|
|
93
|
+
| **Completion Rate** | % orders reaching terminal nodes | >90% |
|
|
94
|
+
| **Arbitration Rate** | % orders with non-empty `dispute` | <5% |
|
|
95
|
+
| **Avg Resolution Time** | Time from creation to completion | Short |
|
|
96
|
+
| **Repeat Customer Rate** | % builders appearing multiple times | High |
|
|
97
|
+
| **Community Sentiment** | likes vs dislikes in EntityLinker | Positive |
|
|
177
98
|
|
|
178
|
-
|
|
99
|
+
---
|
|
179
100
|
|
|
180
|
-
|
|
181
|
-
```
|
|
182
|
-
onchain_operations({
|
|
183
|
-
operation_type: "treasury",
|
|
184
|
-
data: {
|
|
185
|
-
op: "deposit",
|
|
186
|
-
service: "<service_id>",
|
|
187
|
-
amount: "<amount>",
|
|
188
|
-
token_type: "<token_type>"
|
|
189
|
-
}
|
|
190
|
-
})
|
|
191
|
-
```
|
|
101
|
+
## Phase 2: Consensus Building (CRITICAL)
|
|
192
102
|
|
|
193
|
-
|
|
194
|
-
```
|
|
195
|
-
onchain_operations({
|
|
196
|
-
operation_type: "treasury",
|
|
197
|
-
data: {
|
|
198
|
-
op: "withdraw",
|
|
199
|
-
service: "<service_id>",
|
|
200
|
-
amount: "<amount>",
|
|
201
|
-
token_type: "<token_type>",
|
|
202
|
-
recipient: "<address>"
|
|
203
|
-
}
|
|
204
|
-
})
|
|
205
|
-
```
|
|
103
|
+
Establish mutual understanding with seller BEFORE purchasing. Consensus is built on **immutable on-chain data** (Guard, Machine, Allocators), with Messenger serving as **off-chain but self-verifiable evidence supplement**.
|
|
206
104
|
|
|
207
|
-
###
|
|
208
|
-
```
|
|
209
|
-
onchain_table_data({
|
|
210
|
-
query_type: "onchain_table_item_treasury_history",
|
|
211
|
-
parent: "<treasury_id>",
|
|
212
|
-
address: "<payment_id>"
|
|
213
|
-
})
|
|
214
|
-
```
|
|
105
|
+
### Consensus Layers
|
|
215
106
|
|
|
216
|
-
|
|
107
|
+
| Layer | Source | Immutability | Purpose |
|
|
108
|
+
|-------|--------|--------------|---------|
|
|
109
|
+
| **On-Chain Foundation** | Service.machine, order_allocators, Guards | Immutable after publish | Transparent rules both parties agree to |
|
|
110
|
+
| **Off-Chain Supplement** | Messenger WTS files | Self-verifiable via signatures | Clarification, negotiation, evidence |
|
|
217
111
|
|
|
218
|
-
|
|
112
|
+
> **Core Principle**: On-chain data (Machine workflow, Allocator rules, Guard conditions) forms the **immutable consensus foundation**. Messenger communication provides **clarification and evidence** but cannot override on-chain rules.
|
|
219
113
|
|
|
220
|
-
|
|
221
|
-
```
|
|
222
|
-
onchain_operations({
|
|
223
|
-
operation_type: "arbitration",
|
|
224
|
-
data: {
|
|
225
|
-
op: "create",
|
|
226
|
-
name: "<arbitration_name>",
|
|
227
|
-
...
|
|
228
|
-
}
|
|
229
|
-
})
|
|
230
|
-
```
|
|
114
|
+
> **Full Messenger Guide**: See [wowok-messenger](../wowok-messenger/SKILL.md) for complete messaging operations, WTS evidence generation, and list management.
|
|
231
115
|
|
|
232
|
-
###
|
|
233
|
-
```
|
|
234
|
-
onchain_events({
|
|
235
|
-
type: "arbitration",
|
|
236
|
-
cursor: null,
|
|
237
|
-
limit: 20
|
|
238
|
-
})
|
|
239
|
-
```
|
|
116
|
+
### 2.1 Verify On-Chain Consensus First
|
|
240
117
|
|
|
241
|
-
|
|
118
|
+
Before contacting seller, thoroughly understand the immutable rules:
|
|
242
119
|
|
|
243
|
-
|
|
120
|
+
**Tool**: `query_toolkit` with `onchain_objects` query type to retrieve Service data.
|
|
244
121
|
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
op: "create",
|
|
251
|
-
service: "<service_id>",
|
|
252
|
-
description: "<request_description>",
|
|
253
|
-
...
|
|
254
|
-
}
|
|
255
|
-
})
|
|
256
|
-
```
|
|
122
|
+
**Key On-Chain Consensus Elements**:
|
|
123
|
+
- **Machine**: Workflow nodes and transitions — defines how order progresses
|
|
124
|
+
- **Allocators**: Fund distribution strategies — defines who gets what under which conditions
|
|
125
|
+
- **Guards**: Validation logic — determines which allocator executes
|
|
126
|
+
- **Arbitrations**: Available dispute resolution services
|
|
257
127
|
|
|
258
|
-
###
|
|
259
|
-
```
|
|
260
|
-
onchain_table_data({
|
|
261
|
-
query_type: "onchain_table_item_demand_presenter",
|
|
262
|
-
parent: "<demand_id>",
|
|
263
|
-
address: "<presenter_address>"
|
|
264
|
-
})
|
|
265
|
-
```
|
|
128
|
+
### 2.2 Get Service Contact
|
|
266
129
|
|
|
267
|
-
|
|
130
|
+
**Steps**:
|
|
131
|
+
1. Query Service object to extract `um` field (Contact object ID)
|
|
132
|
+
2. Query Contact object to retrieve `ims[]` array (Messenger addresses)
|
|
268
133
|
|
|
269
|
-
|
|
270
|
-
```
|
|
271
|
-
Permission → Guard → Service → Machine → Allocation → Reward
|
|
272
|
-
```
|
|
134
|
+
**Tool**: `query_toolkit` with `onchain_objects` query type.
|
|
273
135
|
|
|
274
|
-
### 2.
|
|
275
|
-
```
|
|
276
|
-
1. Buyer creates Order referencing Service + Machine
|
|
277
|
-
2. Buyer sends Payment to Order (escrow)
|
|
278
|
-
3. Seller advances Progress through Machine nodes
|
|
279
|
-
4. On completion, Allocation splits payment automatically
|
|
280
|
-
5. Reward distributes incentives if conditions met
|
|
281
|
-
```
|
|
136
|
+
### 2.3 Send Encrypted Messages
|
|
282
137
|
|
|
283
|
-
|
|
284
|
-
```
|
|
285
|
-
1. Either party initiates Arbitration
|
|
286
|
-
2. Arbiter reviews evidence
|
|
287
|
-
3. Arbiter resolves → funds released per resolution
|
|
288
|
-
```
|
|
138
|
+
Use Messenger to clarify on-chain rules and negotiate specifics.
|
|
289
139
|
|
|
290
|
-
|
|
140
|
+
**Tool**: `messenger_operation` with `send_message` operation.
|
|
291
141
|
|
|
292
|
-
|
|
293
|
-
```
|
|
294
|
-
query_toolkit({
|
|
295
|
-
query_type: "onchain_objects",
|
|
296
|
-
objects: ["<order_name_or_id>"]
|
|
297
|
-
})
|
|
298
|
-
```
|
|
142
|
+
**Schema Reference**: `schema_query({ action: "get", name: "messenger_operation" })`
|
|
299
143
|
|
|
300
|
-
|
|
301
|
-
```
|
|
302
|
-
onchain_table_data({
|
|
303
|
-
query_type: "onchain_table",
|
|
304
|
-
parent: "<progress_id>"
|
|
305
|
-
})
|
|
306
|
-
```
|
|
144
|
+
**Evidence Closure Principle**: Messages only become valid evidence when the recipient **explicitly confirms** (ARK signature). One-sided claims are not evidence.
|
|
307
145
|
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
})
|
|
314
|
-
```
|
|
146
|
+
**Why Messenger Matters** (as consensus supplement):
|
|
147
|
+
- ✅ End-to-end encrypted (NOT on-chain) — privacy for negotiations
|
|
148
|
+
- ✅ Creates tamper-proof audit trail (WTS files) — see [wowok-messenger](../wowok-messenger/SKILL.md) for WTS generation
|
|
149
|
+
- ✅ Clarifies on-chain rules without modifying them
|
|
150
|
+
- ✅ Generates arbitration evidence for off-chain commitments
|
|
315
151
|
|
|
316
|
-
|
|
152
|
+
**AI Should Proactively Suggest Clarifying**:
|
|
153
|
+
- Exact deliverables and acceptance criteria
|
|
154
|
+
- Timeline and milestones
|
|
155
|
+
- Edge case handling
|
|
156
|
+
- Refund/cancellation terms
|
|
157
|
+
- Delivery logistics (address, phone)
|
|
158
|
+
- Custom requirements
|
|
317
159
|
|
|
318
|
-
|
|
319
|
-
|-------|-------|-----|
|
|
320
|
-
| "service not found" | Service doesn't exist | Create Service first |
|
|
321
|
-
| "machine not found" | Machine doesn't exist | Create Machine first |
|
|
322
|
-
| "insufficient balance" | Not enough tokens | Check balance with account_balance |
|
|
323
|
-
| "allocation failed" | Invalid split rules | Check total shares = 100% |
|
|
324
|
-
| "progress blocked" | Guard condition not met | Check forward Guard logic |
|
|
325
|
-
| "arbitration not found" | No Arbiter configured | Create Arbitration object |
|
|
160
|
+
**Request Explicit Confirmation**: Ensure the seller responds and confirms understanding before proceeding. Unconfirmed messages have limited evidentiary value.
|
|
326
161
|
|
|
327
|
-
|
|
162
|
+
---
|
|
328
163
|
|
|
329
|
-
|
|
164
|
+
## Phase 3: Order Creation
|
|
330
165
|
|
|
331
|
-
|
|
166
|
+
Once consensus is reached, create the order through Service operation.
|
|
332
167
|
|
|
333
|
-
|
|
168
|
+
### 3.1 Key Parameters
|
|
334
169
|
|
|
335
|
-
|
|
336
|
-
order_allocators: {
|
|
337
|
-
description: "Insurance order revenue allocation",
|
|
338
|
-
threshold: 0,
|
|
339
|
-
allocators: [{
|
|
340
|
-
guard: "insurance_withdraw_guard_v1",
|
|
341
|
-
sharing: [{ who: { Signer: "signer" }, sharing: 10000, mode: "Rate" }]
|
|
342
|
-
}]
|
|
343
|
-
}
|
|
344
|
-
```
|
|
170
|
+
**Operation**: `onchain_operations` with `operation_type: "service"`
|
|
345
171
|
|
|
346
|
-
|
|
172
|
+
**Schema Reference**: `schema_query({ action: "get", name: "onchain_operations_service" })`
|
|
347
173
|
|
|
348
|
-
**
|
|
174
|
+
**Key Parameters**:
|
|
349
175
|
|
|
350
|
-
|
|
176
|
+
| Parameter | Purpose | Notes |
|
|
177
|
+
|-----------|---------|-------|
|
|
178
|
+
| `buy.items` | Products to purchase | Reference `Service.sales` |
|
|
179
|
+
| `buy.total_pay` | Payment budget | **Excess automatically refunded** |
|
|
180
|
+
| `buy.discount` | Coupon object ID | Optional — see 3.1.1 below |
|
|
181
|
+
| `agents` | Delegated operators | Can operate order but **CANNOT withdraw funds** |
|
|
351
182
|
|
|
352
|
-
|
|
353
|
-
order_allocators: {
|
|
354
|
-
description: "Order fund allocation",
|
|
355
|
-
threshold: 0,
|
|
356
|
-
allocators: [
|
|
357
|
-
{
|
|
358
|
-
guard: "service_merchant_win_v2",
|
|
359
|
-
sharing: [{ who: { Signer: "signer" }, sharing: 10000, mode: "Rate" }]
|
|
360
|
-
},
|
|
361
|
-
{
|
|
362
|
-
guard: "service_customer_win_v2",
|
|
363
|
-
sharing: [{ who: { Signer: "signer" }, sharing: 10000, mode: "Rate" }]
|
|
364
|
-
}
|
|
365
|
-
]
|
|
366
|
-
}
|
|
367
|
-
```
|
|
183
|
+
#### 3.1.1 Using Discount Coupons
|
|
368
184
|
|
|
369
|
-
|
|
185
|
+
When creating an order via the `buy` operation, you can apply a discount coupon by including the `discount` field with the coupon name/ID.
|
|
370
186
|
|
|
371
|
-
|
|
187
|
+
| `namedNewOrder` | Local name for Order | Recommended for easy reference |
|
|
188
|
+
| `namedNewProgress` | Local name for Progress | Recommended |
|
|
189
|
+
| `namedNewAllocation` | Local name for Allocation | Recommended |
|
|
372
190
|
|
|
373
|
-
|
|
191
|
+
### 3.2 Private Information Handling
|
|
374
192
|
|
|
375
|
-
|
|
193
|
+
If Service requires private info (`customer_required`):
|
|
376
194
|
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
data: {
|
|
381
|
-
object: "insurance_service_v1",
|
|
382
|
-
order_new: {
|
|
383
|
-
buy: {
|
|
384
|
-
items: [{ name: "Outdoor Accident Insurance", stock: 1, wip_hash: "" }],
|
|
385
|
-
total_pay: { balance: 100000000 }
|
|
386
|
-
},
|
|
387
|
-
namedNewOrder: { name: "test_insurance_order_v1", replaceExistName: true }
|
|
388
|
-
}
|
|
389
|
-
}
|
|
390
|
-
})
|
|
391
|
-
```
|
|
195
|
+
1. **NEVER put on-chain** — send via Messenger
|
|
196
|
+
2. Include order ID in the message
|
|
197
|
+
3. Confirm receipt with seller
|
|
392
198
|
|
|
393
|
-
**
|
|
199
|
+
**Tool**: `messenger_operation` with `send_message` operation.
|
|
394
200
|
|
|
395
|
-
|
|
201
|
+
### 3.3 Post-Creation Notification
|
|
396
202
|
|
|
397
|
-
|
|
398
|
-
order_new: {
|
|
399
|
-
buy: {
|
|
400
|
-
items: [{ name: "Iceland Adventure", stock: 1 }],
|
|
401
|
-
total_pay: { balance: 200000000 }
|
|
402
|
-
},
|
|
403
|
-
namedNewOrder: { name: "alice_travel_order_v1" }
|
|
404
|
-
}
|
|
405
|
-
```
|
|
203
|
+
**Mandatory**: Notify Service customer service via Messenger with order ID and submitted info reference.
|
|
406
204
|
|
|
407
|
-
|
|
205
|
+
---
|
|
408
206
|
|
|
409
|
-
|
|
207
|
+
## Phase 4: Order Operations
|
|
410
208
|
|
|
411
|
-
|
|
209
|
+
All operations use `operation_type: "order"`.
|
|
412
210
|
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
amount: { type: "Fixed", value: 30000 },
|
|
437
|
-
expiration_time: null
|
|
438
|
-
}
|
|
439
|
-
]
|
|
440
|
-
}
|
|
441
|
-
})
|
|
442
|
-
```
|
|
211
|
+
**Schema Reference**: `schema_query({ action: "get", name: "onchain_operations_order" })`
|
|
212
|
+
|
|
213
|
+
### 4.1 Permission Hierarchy
|
|
214
|
+
|
|
215
|
+
| Role | Can Do | Cannot Do |
|
|
216
|
+
|------|--------|-----------|
|
|
217
|
+
| **Builder** (You) | Everything + withdraw funds | — |
|
|
218
|
+
| **Agents** | Operate progress, arbitration, cancel | **Withdraw funds** |
|
|
219
|
+
|
|
220
|
+
> **Critical**: You maintain ultimate financial control. Agents assist but cannot access funds.
|
|
221
|
+
|
|
222
|
+
### 4.2 Progress Advancement
|
|
223
|
+
|
|
224
|
+
**Key Rule**: As the order holder (builder), you advance progress **through the Order object**.
|
|
225
|
+
|
|
226
|
+
The Machine workflow defines who can operate each forward transition:
|
|
227
|
+
- **Order-operable forwards**: `namedOperator === ""` — you can execute via `order.progress`
|
|
228
|
+
- **Permission-operable forwards**: Require specific namespace permission — typically for Service Provider or collaborators
|
|
229
|
+
|
|
230
|
+
**Steps**:
|
|
231
|
+
1. Query Order object to get `progress` (Progress ID) and `machine` (Machine ID)
|
|
232
|
+
2. Query Progress object to get `current_node`
|
|
233
|
+
3. Query Machine table to find valid transitions from current node
|
|
443
234
|
|
|
444
|
-
|
|
445
|
-
- `
|
|
446
|
-
- `
|
|
447
|
-
- `reward_shipping_timeout_v2`: order at "Shipping" node > 2 days → 30000 compensation
|
|
235
|
+
**Tools**:
|
|
236
|
+
- `query_toolkit` with `onchain_objects` query type
|
|
237
|
+
- `query_toolkit` with `onchain_table` query type
|
|
448
238
|
|
|
449
|
-
|
|
239
|
+
> **Note**: Service Providers or their collaborators may operate other forwards directly via Progress if the Machine design grants them permission. The Machine consensus is immutable — both parties operate within the same transparent rules.
|
|
450
240
|
|
|
451
|
-
|
|
241
|
+
### 4.3 Path Selection & Game Theory
|
|
452
242
|
|
|
453
|
-
|
|
243
|
+
**Core Principle**: Same transparent rules, different optimal paths based on interests.
|
|
244
|
+
|
|
245
|
+
**Example Scenario**:
|
|
454
246
|
|
|
455
247
|
```
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
248
|
+
Current Node: "delivery_pending"
|
|
249
|
+
├── Path A → "delivery_confirmed"
|
|
250
|
+
│ ├── Guard: buyer signs receipt
|
|
251
|
+
│ └── Allocation: 95% seller, 5% platform
|
|
252
|
+
│
|
|
253
|
+
├── Path B → "dispute_filed"
|
|
254
|
+
│ ├── Guard: arbitration requested
|
|
255
|
+
│ └── Allocation: funds frozen
|
|
256
|
+
│
|
|
257
|
+
└── Path C → "return_initiated"
|
|
258
|
+
├── Guard: within return window
|
|
259
|
+
└── Allocation: 90% refund, 10% fee
|
|
465
260
|
```
|
|
466
261
|
|
|
467
|
-
|
|
262
|
+
**AI Decision Framework**:
|
|
263
|
+
|
|
264
|
+
1. **Query all valid paths** from current node
|
|
265
|
+
2. **Evaluate Guard conditions** for each path
|
|
266
|
+
3. **Assess Allocation impact** (query `service.order_allocators`)
|
|
267
|
+
4. **Present options** with consequences:
|
|
268
|
+
|
|
269
|
+
| Path | Guard Required | Financial Outcome | Best For |
|
|
270
|
+
|------|----------------|-------------------|----------|
|
|
271
|
+
| A | Sign receipt | Pay seller 95% | Satisfied customer |
|
|
272
|
+
| B | Request arbitration | Frozen | Disputed order |
|
|
273
|
+
| C | Return in window | 90% refund | Unsatisfied customer |
|
|
274
|
+
|
|
275
|
+
**AI Guidance**:
|
|
276
|
+
- Always present ALL available paths
|
|
277
|
+
- Explain Guard requirements
|
|
278
|
+
- Map to Allocation consequences
|
|
279
|
+
- Recommend based on user's goals and evidence
|
|
280
|
+
|
|
281
|
+
---
|
|
282
|
+
|
|
283
|
+
## Phase 5: Arbitration (When Needed)
|
|
284
|
+
|
|
285
|
+
When disputes cannot be resolved directly, use third-party Arbitration.
|
|
286
|
+
|
|
287
|
+
### 5.1 Arbitration Process
|
|
288
|
+
|
|
289
|
+
| Step | Operation | Key Points |
|
|
290
|
+
|------|-----------|------------|
|
|
291
|
+
| 1 | `arbitration.dispute` | Create Arb object, **pay fee separately** (NOT from Order) |
|
|
292
|
+
| 2 | Generate WTS | Export Messenger history as tamper-proof evidence |
|
|
293
|
+
| 3 | Send evidence | Via Messenger to Arbitration's contact (encrypted) |
|
|
294
|
+
| 4 | `order.arb_confirm` | Signal "all evidence submitted" |
|
|
295
|
+
| 5 | Wait for voting | Arbitration organizes voters |
|
|
296
|
+
| 6 | `order.arb_objection` | (Optional) Object to unfavorable result |
|
|
297
|
+
| 7 | `order.arb_claim_compensation` | Claim payout from `service.compensation_fund` |
|
|
298
|
+
|
|
299
|
+
**Schema References**:
|
|
300
|
+
- `schema_query({ action: "get", name: "onchain_operations_arbitration" })`
|
|
301
|
+
- `schema_query({ action: "get", name: "onchain_operations_order" })`
|
|
302
|
+
- `schema_query({ action: "get", name: "messenger_operation" })`
|
|
468
303
|
|
|
469
|
-
###
|
|
304
|
+
### 5.2 Key Rules
|
|
470
305
|
|
|
471
|
-
**
|
|
306
|
+
- **Multiple Arb Objects**: Can arbitrate on multiple services simultaneously
|
|
307
|
+
- **One Compensation**: Only ONE claim per Order (choose best result)
|
|
308
|
+
- **Time Sensitivity**: Long arbitration may exceed order deadlines — discuss timelines pre-purchase
|
|
309
|
+
- **Evidence Privacy**: WTS files verify authenticity via `messenger_operation` with `verify_wts` operation
|
|
472
310
|
|
|
473
|
-
|
|
311
|
+
### 5.3 Arb Object Lifecycle
|
|
474
312
|
|
|
475
313
|
```
|
|
476
|
-
|
|
477
|
-
onchain_operations({
|
|
478
|
-
operation_type: "arbitration",
|
|
479
|
-
data: {
|
|
480
|
-
object: { name: "travel_arbitration_v1", permission: "travel_permission_v1" },
|
|
481
|
-
description: "Arbitration for Iceland travel service disputes"
|
|
482
|
-
}
|
|
483
|
-
})
|
|
484
|
-
|
|
485
|
-
// Bind during Service update:
|
|
486
|
-
onchain_operations({
|
|
487
|
-
operation_type: "service",
|
|
488
|
-
data: {
|
|
489
|
-
object: "travel_service_v1",
|
|
490
|
-
arbitrations: { op: "add", objects: ["travel_arbitration_v1"] }
|
|
491
|
-
}
|
|
492
|
-
})
|
|
314
|
+
Principal_confirming → Arbitrator_confirming → Voting → Arbitrated → Objectionable → Finished/Withdrawn
|
|
493
315
|
```
|
|
494
316
|
|
|
495
|
-
|
|
317
|
+
---
|
|
496
318
|
|
|
497
|
-
|
|
319
|
+
## Fund Management
|
|
498
320
|
|
|
499
|
-
|
|
321
|
+
### Receiving Funds (`order.receive`)
|
|
500
322
|
|
|
501
|
-
|
|
323
|
+
Extract funds sent to Order (compensation, penalties, rewards) to your wallet.
|
|
502
324
|
|
|
503
|
-
|
|
325
|
+
**Operation**: `onchain_operations` with `operation_type: "order"` and `receive` field.
|
|
504
326
|
|
|
505
|
-
|
|
506
|
-
1. SERVICE SETUP (one-time)
|
|
507
|
-
Permission → Guard(s) → Machine → Service (with allocation) → Publish
|
|
327
|
+
**Schema Reference**: `schema_query({ action: "get", name: "onchain_operations_order" })`
|
|
508
328
|
|
|
509
|
-
|
|
510
|
-
|
|
329
|
+
**Sources**:
|
|
330
|
+
- Arbitration compensation (from `service.compensation_fund`)
|
|
331
|
+
- Service penalties (late delivery, quality issues)
|
|
332
|
+
- Collaboration payments
|
|
333
|
+
- Direct transfers
|
|
511
334
|
|
|
512
|
-
|
|
513
|
-
onchain_operations(operation_type: "progress", data: { object, order, node: { name, forward } })
|
|
335
|
+
**Who Can Execute**: Builder and agents (but only builder receives).
|
|
514
336
|
|
|
515
|
-
|
|
516
|
-
Allocation fires → Payment split per allocator Guards
|
|
337
|
+
### Ownership Transfer (`order.transfer_to`)
|
|
517
338
|
|
|
518
|
-
|
|
519
|
-
Reward Guard validates → tokens distributed to claimant
|
|
339
|
+
Transfer order ownership to new address. Requires builder permission.
|
|
520
340
|
|
|
521
|
-
|
|
522
|
-
Arbitration → arb_confirm/arb_objection → resolution
|
|
523
|
-
```
|
|
341
|
+
**Operation**: `onchain_operations` with `operation_type: "order"` and `transfer_to` field.
|
|
524
342
|
|
|
525
343
|
---
|
|
526
344
|
|
|
527
|
-
##
|
|
345
|
+
## Quick Reference
|
|
346
|
+
|
|
347
|
+
### Essential Schemas
|
|
348
|
+
|
|
349
|
+
| Purpose | Schema Name |
|
|
350
|
+
|---------|-------------|
|
|
351
|
+
| Service operations (purchase) | `onchain_operations_service` |
|
|
352
|
+
| Order operations (progress, arbitration, receive) | `onchain_operations_order` |
|
|
353
|
+
| Arbitration operations (dispute) | `onchain_operations_arbitration` |
|
|
354
|
+
| Messenger (encrypted communication) | `messenger_operation` |
|
|
355
|
+
| Query toolkit (object data, tables) | `query_toolkit` |
|
|
356
|
+
|
|
357
|
+
**Query Schema**: `schema_query({ action: "get", name: "<schema_name>" })`
|
|
358
|
+
|
|
359
|
+
### Common Workflows
|
|
360
|
+
|
|
361
|
+
**Evaluate → Communicate → Purchase → Track → Complete/Dispute**
|
|
362
|
+
|
|
363
|
+
1. Query Service → Check sales, machine, allocators, arbitrations
|
|
364
|
+
2. Messenger contact → Clarify terms, save WTS
|
|
365
|
+
3. Service operation → Create order with named objects
|
|
366
|
+
4. Order operations → Advance progress, choose paths
|
|
367
|
+
5. Receive funds or arbitration → Extract to wallet
|
|
368
|
+
|
|
369
|
+
---
|
|
528
370
|
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
-
|
|
533
|
-
-
|
|
371
|
+
## Safety Checklist
|
|
372
|
+
|
|
373
|
+
Before purchasing:
|
|
374
|
+
- [ ] Verified WIP file and product claims
|
|
375
|
+
- [ ] Reviewed allocators (fair distribution?)
|
|
376
|
+
- [ ] Checked available arbitrations
|
|
377
|
+
- [ ] Established Messenger contact with seller
|
|
378
|
+
- [ ] Clarified deliverables, timeline, refund policy
|
|
379
|
+
- [ ] Saved conversation as WTS evidence
|
|
380
|
+
|
|
381
|
+
Before advancing progress:
|
|
382
|
+
- [ ] Understand ALL available paths
|
|
383
|
+
- [ ] Know Guard requirements for chosen path
|
|
384
|
+
- [ ] Aware of Allocation consequences
|
|
385
|
+
- [ ] Have required evidence/proof ready
|