@wowok/skills 1.1.4 → 1.1.6

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.
@@ -137,6 +137,10 @@ When user asks about field meanings:
137
137
  | Skill | Purpose |
138
138
  |-------|---------|
139
139
  | [wowok-safety](../wowok-safety/SKILL.md) | Pre-operation safety checks |
140
+ | [wowok-guard](../wowok-guard/SKILL.md) | Guard design & validation |
140
141
  | [wowok-tools](../wowok-tools/SKILL.md) | Tool selection patterns |
141
142
  | [wowok-order](../wowok-order/SKILL.md) | Order lifecycle (buyer) |
142
143
  | [wowok-provider](../wowok-provider/SKILL.md) | Service management (merchant) |
144
+ | [wowok-arbitrator](../wowok-arbitrator/SKILL.md) | Dispute resolution |
145
+ | [wowok-machine](../wowok-machine/SKILL.md) | Workflow design |
146
+ | [wowok-messenger](../wowok-messenger/SKILL.md) | Encrypted communication |
@@ -21,435 +21,221 @@ when_to_use:
21
21
 
22
22
  # WoWok Service Provider Guide
23
23
 
24
- Build and operate commercial services on WoWok as a service provider.
25
-
26
- > **Role**: Service Provider (Merchant/Seller)
27
- > **Prerequisites**: Understand CREATE vs MODIFY pattern — use `schema_query({ action: "get", name: "onchain_operations" })`
28
- > **Customer Perspective**: See [wowok-order](../wowok-order/SKILL.md)
29
- > **Arbitration**: See [wowok-arbitrator](../wowok-arbitrator/SKILL.md)
30
- > **Machine Design**: See [wowok-machine](../wowok-machine/SKILL.md) for workflow details
31
- > **Messenger**: See [wowok-messenger](../wowok-messenger/SKILL.md) for customer communication
32
- > **Tools**: See [wowok-tools](../wowok-tools/SKILL.md)
33
-
34
- ---
35
-
36
- ## Core Concepts
37
-
38
- ### Dependency-First Construction
39
-
40
- Commercial services MUST be built in strict dependency order. An object cannot reference another that does not yet exist.
41
-
42
- **Build Sequence**:
43
- ```
44
- Permission → Service (unpublished) → Machine (Nodes but unpublished) → Guards → Allocators → Reward/Arbitration → Publish Machine → Bind to Service → Publish Service
45
- ```
46
-
47
- **Immutability Rules**:
48
- | Object | When Immutable | Impact |
49
- |--------|---------------|--------|
50
- | **Guard** | After creation | CREATE-only, cannot modify |
51
- | **Machine** | After `publish: true` | Nodes locked, workflow frozen |
52
- | **Service** | After `publish: true` | `machine` and `order_allocators` locked |
53
-
54
- ### CREATE vs MODIFY Pattern
55
-
56
- The unified pattern across all operations:
57
- - **Object shape** (`{ name?, ... }`) = **CREATE** new object
58
- - **String value** (`"<name>"`) = **MODIFY** existing object
59
-
60
- **Schema Reference**: `schema_query({ action: "get", name: "onchain_operations" })`
61
-
62
- ### Key Object Relationships
63
-
64
- ```
65
- Service (merchant storefront)
66
- ├── machine → Machine (workflow definition)
67
- ├── order_allocators → Allocators (fund distribution rules)
68
- ├── arbitrations → Arbitration[] (dispute resolution options)
69
- ├── compensation_fund → Customer protection pool
70
- ├── sales → SalesItem[] (products with WIP files)
71
- ├── discount → Discount[] (coupons)
72
- ├── rewards → Reward[] (order/user behavior incentives)
73
- └── um → Contact (customer service)
74
-
75
- Order (created per purchase)
76
- ├── builder → Customer (order owner)
77
- ├── progress → Progress (workflow state)
78
- └── allocation → Allocation (fund distribution engine)
79
- ```
24
+ > **Role**: Service Provider (Merchant/Seller)
25
+ > **Related Skills**: [wowok-order](../wowok-order/SKILL.md) (customer), [wowok-machine](../wowok-machine/SKILL.md) (workflow), [wowok-guard](../wowok-guard/SKILL.md) (validation rules), [wowok-messenger](../wowok-messenger/SKILL.md) (communication), [wowok-safety](../wowok-safety/SKILL.md) (safety)
80
26
 
81
27
  ---
82
28
 
83
- ## Phase 1: Service Design (Commercial Intent)
84
-
85
- Design your service offering before building. This phase defines what customers see and how orders flow.
86
-
87
- ### 1.1 Product Promise (WIP Files)
88
-
89
- WIP (Witness Immutable Promise) files are **immutable product commitments** — your on-chain promise to customers.
90
-
91
- **Creating WIP Files**:
92
-
93
- **Tool**: `wip_file` with `type: "generate"` operation.
94
-
95
- **Schema Reference**: `schema_query({ action: "get", name: "wip_file" })`
29
+ ## ⚠️ PRE-FLIGHT: Required Items Checklist
96
30
 
97
- **Key Parameters**:
98
- - `options.markdown_text`: Product description in markdown format
99
- - `options.images`: Array of image sources for product visuals
100
- - `outputPath`: Output file path for generated WIP file
31
+ **THIS SECTION IS MANDATORY.** Before ANY service creation or publication, the AI MUST collect explicit user confirmation for EVERY required item. **Do NOT skip, do NOT fabricate, do NOT proceed with missing items.**
101
32
 
102
- **Attaching to Service**:
33
+ ### The Golden Rule
103
34
 
104
- **Operation**: `onchain_operations` with `operation_type: "service"`.
105
-
106
- **Key Fields**:
107
- - `sales.op`: Operation type ("add", "set", "remove")
108
- - `sales.sales`: Array of sales items, each with:
109
- - `name`: Product name
110
- - `price`: Price in token units
111
- - `stock`: Available quantity
112
- - `wip`: URL to WIP file (your official site, GitHub, etc.)
113
- - `wip_hash`: SHA256 hash of WIP file for verification (default: `""`, uses hash embedded in WIP file unless explicitly set for verification)
114
-
115
- **Why WIP Matters**:
116
- - **Immutable commitment**: Hashed and signed on-chain
117
- - **Arbitration evidence**: Disputes resolved against your WIP claims
118
- - **Customer trust**: Transparent specifications reduce uncertainty
119
- - **Legal protection**: Tamper-proof record of promises
120
-
121
- ### 1.2 Service Workflow (Machine Design)
122
-
123
- Machine defines your **service process** — from order creation to completion. Design from a **commercial intent** perspective, not technical implementation.
124
-
125
- **Key Design Questions**:
126
- 1. **Service stages**: What are the key milestones? (e.g., confirmed → processing → shipped → delivered)
127
- 2. **Validation points**: Where do you need customer confirmation or external verification?
128
- 3. **Branching paths**: What happens on success vs. failure? (e.g., on-time vs. late delivery)
129
- 4. **Fund release triggers**: At which nodes and how to allocate order funds?
130
-
131
- **Integration with Allocators**:
132
- - Each terminal node should map to an allocator strategy
133
- - Guards determine which allocator executes
134
- - Design Machine and Allocators together for coherent fund flow
135
-
136
- > **Implementation**: See [wowok-machine](../wowok-machine/SKILL.md) for node definition syntax, Guard conditions, and Forward configurations.
137
-
138
- ### 1.3 Fund Distribution Strategy (Allocators)
139
-
140
- Allocators define **who gets what** under different outcomes. Design these alongside your Machine workflow.
141
-
142
- **Allocator + Machine Integration**:
143
35
  ```
144
- "delivered" "order_complete" (threshold: 1)
145
- └── Forward: "customer_signed" (weight: 1)
146
- └── Allocator: "completed" → 95% merchant, 5% platform
147
-
148
- "delivered" → "package_lost" (threshold: 2)
149
- ├── Forward: "customer_reports_lost" (weight: 1)
150
- ├── Forward: "merchant_confirms_lost" (weight: 1)
151
- └── Allocator: "package_lost" → 100% to order (buyer can withdraw)
36
+ NEVER guess what the user sells, how their workflow operates, or how funds are distributed.
37
+ These are BUSINESS decisions that ONLY the user can make.
152
38
 
153
- Note: Arbitration is an independent action that can be triggered at any time.
39
+ User hasn't provided it ASK.
40
+ User provides incomplete info → ASK for clarification.
41
+ User says "just make something up" → REFUSE and explain why each item matters.
154
42
  ```
155
43
 
156
- **Allocation Modes** (3 types, executed in order):
157
- 1. **Amount**: Fixed allocation amount (U64) for each recipient
158
- 2. **Rate**: Percentage in basis points (10000 = 100%, 500 = 5%)
159
- - If no Surplus defined, sum of all Rates must equal 10000 (100%)
160
- 3. **Surplus**: Receives remaining funds (maximum one per allocator)
44
+ ### Required Items
161
45
 
162
- **How Allocation Executes**:
163
- - When an allocator Guard returns `true`, funds are distributed immediately per that allocator's `sharing` rules. If multiple Guards may evaluate to `true`, query and compare their validation logic and `sharing` rules to determine the most favorable outcome for your interests.
46
+ For each item, the user must provide one of: **"Reuse existing: `<name_or_id>`"** OR **"Create new: `<details>`"**
164
47
 
165
- **Query Guard Logic**: Use `query_toolkit` with `query_type: "onchain_objects"` to query Guard objects by ID or name. Retrieve detailed validation logic including required node conditions, evidence submissions, and permission checks.
48
+ | # | Item | User Must Provide | Why Not Fabricate |
49
+ |---|------|-------------------|--------------------|
50
+ | **R1** | **Account** | Account name/address. Default `""` is fine. | Safe default exists |
51
+ | **R2** | **Permission** | Existing Permission to reuse, OR name + type_parameter for new. **Reuse strongly recommended.** | Controls access to ALL your services |
52
+ | **R3** | **Service** | Service name, type_parameter. What kind of service? | Your brand identity on-chain |
53
+ | **R4** | **Machine** | Nodes, state transitions (pairs), forward paths. | IS your business process |
54
+ | **R5** | **Guards** | For each Guard: validation logic, conditions. Reuse or define new. | Enforces your business rules |
55
+ | **R6** | **Guard Bindings** | Which Guard validates which Machine forward? | Wrong binding = unauthorized access |
56
+ | **R7** | **Allocators** | For each outcome: who gets what %/amount? (e.g. "success: 95% me, 5% platform") | IS your revenue model |
166
57
 
167
- **Schema Reference**: `schema_query({ action: "get", name: "onchain_operations_service" })` — look for `order_allocators` field
58
+ **Conditionally Required:**
168
59
 
169
- ---
170
-
171
- ## Phase 2: Trust Mechanisms (Customer Confidence)
172
-
173
- Configure mechanisms that assure customers they can trust your service.
174
-
175
- ### 2.1 Compensation Fund (compensation_fund)
176
-
177
- A **dedicated pool** that pays customers if arbitration rules in their favor. Demonstrates your commitment to fair resolution.
178
-
179
- **Setting Up Compensation Fund**:
180
-
181
- **Operation**: `onchain_operations` with `operation_type: "service"`.
60
+ | # | Item | Trigger | User Must Provide |
61
+ |---|------|---------|-------------------|
62
+ | **C1** | **Contact (um)** | If `customer_required` is set | Contact name/ID |
63
+ | **C2** | **WIP Files** | Physical goods | Product description, images |
64
+ | **C3** | **Sales Products** | Listing products | Name, price, stock, WIP per product |
182
65
 
183
- **Key Fields**:
184
- - `compensation_fund_add`: Add funds to compensation pool (BalanceType)
185
- - `setting_locked_time_add`: Lock duration in milliseconds (minimum 30 days = 2592000000ms)
66
+ ### Information Collection Protocol
186
67
 
187
- **Merchant Commitment (Constraint)**:
188
68
  ```
189
- Merchant withdrawal constraints from compensation_fund:
190
- 1. Pause Service (stop accepting new orders)
191
- 2. Wait compensation_lock_duration (≥30 days)
192
- 3. Then can withdraw remaining funds via compensation_fund_receive
193
-
194
- This commitment ensures existing orders can still claim compensation during the lock period.
69
+ STEP 0: Present checklist R1-R7 to user
70
+ ├── Each item: "Reuse or create new? Provide details."
71
+ ├── Track status: [pending] / [confirmed: reuse <id>] / [confirmed: create]
72
+ ├── If user indicates physical goods / customer_required → also confirm C1-C3
73
+ └── ⛔ GATE: ALL R1-R7 must be [confirmed] before any on-chain action
74
+ └── NOT confirmed STOP. Ask. Do NOT suggest creating service.
195
75
  ```
196
76
 
197
- **Customer-Facing Benefits**:
198
- - Display `compensation_fund` balance in service listing
199
- - Higher balance + longer lock = more confidence for high-value orders
200
- - Shows merchant has "skin in the game" for fair resolution
201
- - Customers can claim compensation via arbitration — see [wowok-order](../wowok-order/SKILL.md) for customer arbitration process
202
-
203
- ### 2.2 Arbitration Configuration
204
-
205
- Configure which arbitration services can resolve disputes for your orders.
77
+ ### Anti-Fabrication Rules (HARD Constraints)
206
78
 
207
- **Operation**: `onchain_operations` with `operation_type: "service"`.
208
-
209
- **Key Fields**:
210
- - `arbitrations.op`: Operation type ("add", "set", "remove")
211
- - `arbitrations.list`: Array of Arbitration object IDs/names
212
-
213
- **Why Multiple Arbitrations**:
214
- - Customers evaluate on-chain data to choose the most trusted Arbitration from your approved list
215
- - Different arbitrations may specialize (e.g., product quality vs. service delivery)
79
+ | Never... | Because... |
80
+ |----------|------------|
81
+ | Invent product names, prices, descriptions | You don't know what they sell |
82
+ | Design workflow nodes without user input | You don't know their business process |
83
+ | Decide fund splits | You don't know their revenue model |
84
+ | Assume Guard logic | You don't know their security requirements |
85
+ | Skip the checklist | Even if user seems to know what they want |
216
86
 
217
87
  ---
218
88
 
219
- ## Phase 3: Build & Publish
220
-
221
- Execute the dependency-first build process.
222
-
223
- ### 3.1 4-Phase Build Process
224
-
225
- ```
226
- PHASE 1 Foundation
227
- ├── 1. Permission (CREATE)
228
- ├── 2. Service (CREATE, unpublished) define basic info
229
- └── 3. Machine (CREATE, unpublished) — define ALL nodes and transitions
230
-
231
- PHASE 2 Trust Layer
232
- └── 4. Guards (CREATE) schema_query({ action: "get", name: "onchain_operations_guard" }) — validate Reward claims, Allocator conditions, Machine node transitions, etc. Create all Guards needed for your workflow.
233
-
234
- PHASE 3 Business Logic
235
- ├── 5. Machine Node Guards (MODIFY Machine) bind Guards to Machine node forwards for workflow validation at each operation
236
- ├── 6. Allocators (MODIFY Service) fund distribution rules
237
- ├── 7. Rewards (CREATE/MODIFY Service) optional incentive pools
238
- ├── 8. Arbitrations (MODIFY Service) dispute resolution options
239
- └── 9. Compensation Fund (MODIFY Service) add funds
240
-
241
- PHASE 4 Publication
242
- ├── 10. Publish Machine nodes become IMMUTABLE
243
- ├── 11. Bind Machine to Service — MODIFY Service.machine
244
- └── 12. Publish Service — everything LOCKED
245
- ```
246
-
247
- ### 3.2 Pre-Build Discovery
248
-
249
- Query existing resources to avoid collisions:
250
-
251
- **Tools**:
252
- - `query_toolkit` with `query_type: "account_list"` list account objects
253
- - `query_toolkit` with `query_type: "local_mark_list"` — list local marks
254
- - `query_toolkit` with `query_type: "onchain_objects"` query specific objects
255
-
256
- ### 3.3 Reuse Existing Templates
257
-
258
- Export from proven services instead of building from scratch:
259
-
260
- **Tools**:
261
- - `machineNode2file` export Machine nodes to JSON file for editing
262
- - `guard2file` export Guard rules to JSON file for editing
263
-
264
- **Schema References**:
265
- - `schema_query({ action: "get", name: "machineNode2file" })`
266
- - `schema_query({ action: "get", name: "guard2file" })`
89
+ ## Service Build Lifecycle
90
+
91
+ Once R1-R7 confirmed, execute in strict order. All operations use R1 (Account) as `env.account`.
92
+
93
+ ```
94
+ STEP 1: Foundation
95
+ ├── Permission — REUSE existing (strongly recommended)
96
+ │ Tool: onchain_operations (permission) | Fields: name, type_parameter
97
+ ├── Service (unpublished) CREATE new
98
+ │ Tool: onchain_operations (service) | Fields: name, type_parameter, permission
99
+ └── Machine (unpublished) — CREATE new or REUSE template
100
+ Tool: onchain_operations (machine) | Fields: nodes, pairs, forwards
101
+ Discovery: query_toolkit (account_list, local_mark_list, onchain_objects)
102
+ Template: machineNode2file (export existing for editing)
103
+
104
+ STEP 2: Trust Layer
105
+ └── Guards — CREATE new or REUSE existing
106
+ Tool: onchain_operations (guard) | Fields: logic, instructions
107
+ Template: guard2file (export existing for editing)
108
+ ⚠️ Design your Guard tables based on how the target object reads data:
109
+ - buy_guard pass/fail only, no data extraction
110
+ - Allocator guard → pass/fail only
111
+ - Machine forward guard → if retained_submission is used, ensure b_submission:true entries match expected types
112
+ - Reward guard pass/fail only
113
+ Full design reference: [wowok-guard](../wowok-guard/SKILL.md)
114
+
115
+ STEP 3: Business Logic (MODIFY)
116
+ ├── Machine — bind Guards to forwards
117
+ │ Tool: onchain_operations (machine)
118
+ ├── Service — set Allocators
119
+ │ Tool: onchain_operations (service) | Fields: order_allocators
120
+ ├── Arbitrations (optional) — REUSE existing Arb services
121
+ │ Tool: onchain_operations (service) | Fields: arbitrations.list
122
+ ├── Compensation Fund (optional): compensation_fund_add + setting_locked_time_add (min 30d)
123
+ │ Tool: onchain_operations (service)
124
+ └── Reward (optional)incentive pools
125
+
126
+ STEP 4: Publication
127
+ ├── Publish Machine → IMMUTABLE
128
+ │ Tool: onchain_operations (machine) | publish: true
129
+ ├── Bind Machine to Service
130
+ │ Tool: onchain_operations (service) | machine: "<machine_id>"
131
+ └── Publish Service machine/allocators LOCKED
132
+ Tool: onchain_operations (service) | publish: true
133
+
134
+ ⚠️ Pre-Publish Verification:
135
+ 1. Re-check PRE-FLIGHT: all R1-R7 still confirmed?
136
+ 2. guard2file export Guards review
137
+ 3. machineNode2file export Machine → review
138
+ 4. Allocator splits match user's stated model?
139
+ 5. Warn: publish = immutable. Proceed?
140
+
141
+ STEP 5: Post-Publish (MODIFY Service — mutable after publish)
142
+ ├── description, location
143
+ ├── sales (products with WIP) — ⛔ user MUST provide: name, price, stock, WIP
144
+ ├── customer_required
145
+ └── um — Contact (REUSE existing or CREATE new)
146
+ ⚠️ If customer_required is set → um MUST be set
147
+ ```
148
+
149
+ ### Object Reuse & Immutability
150
+
151
+ | Object | Reuse Strategy | When Locked |
152
+ |--------|---------------|-------------|
153
+ | **Permission** | **Strongly recommended** — centralized control | Never |
154
+ | Machine | Reuse via `machineNode2file` template | After publish |
155
+ | Contact (um) | Reuse existing customer service Contact | Never |
156
+ | Arbitration | Always reuse existing Arb services | — |
157
+ | Guard | Reuse if logic matches | After creation |
158
+ | Service | — | After publish: machine, order_allocators frozen |
267
159
 
268
160
  ---
269
161
 
270
- ## Phase 4: Customer Attraction & Incentives
271
-
272
- Optional mechanisms to attract and retain customers.
273
-
274
- ### 4.1 Discount Coupons
162
+ ## Key Concepts
275
163
 
276
- Issue promotional discounts to attract new customers or reward loyal ones (AI: query `schema_query` for `onchain_operations_service` to view `discount` field definitions).
277
- **Operation**: `onchain_operations` with `operation_type: "service"`.
164
+ ### Service Object Relationships
278
165
 
279
- ### 4.2 Review & Reward Incentives
280
-
281
- Encourage post-order feedback and engagement.
282
-
283
- **Design Pattern — Review Incentive**:
284
- ```
285
- Machine Workflow:
286
- "order_completed" → "like" (threshold: 1)
287
- └── Forward: "positive_feedback" (weight: 1)
288
-
289
- "order_completed" → "suggest" (threshold: 1)
290
- └── Forward: "negative_feedback" (weight: 1)
291
166
  ```
167
+ Service (merchant storefront)
168
+ ├── machine → Machine (workflow)
169
+ ├── order_allocators → Fund distribution rules
170
+ ├── arbitrations → Dispute resolution (optional)
171
+ ├── compensation_fund → Customer protection (optional)
172
+ ├── sales → Products with WIP files
173
+ ├── rewards → Incentive pools (optional)
174
+ └── um → Contact (customer service)
292
175
 
293
- **Creating Reward Pool**:
294
-
295
- **Operation**: `onchain_operations` with `operation_type: "reward"`.
296
-
297
- **Example Configuration**:
298
-
299
- Create 2 Guards that check if Progress reached "like" node, then bind to Reward with different amounts:
300
-
301
- ```
302
- Guard 1: "reward_like_200k"
303
- └── Condition: progress.current_node == "like"
304
-
305
- Guard 2: "reward_suggest_100k"
306
- └── Condition: progress.current_node == "suggest"
307
-
308
- Reward Configuration:
309
- ├── Guard: "reward_like_200k"
310
- │ └── Amount: 200000
311
-
312
- └── Guard: "reward_suggest_100k"
313
- └── Amount: 100000
314
- ```
315
-
316
- > **Note**: Reward is an optional advanced feature. See `schema_query({ action: "get", name: "onchain_operations_reward" })` for full configuration.
317
-
318
- ### 4.3 Supply Chain Promises (Sub-Orders)
319
-
320
- Demonstrate quality by committing to purchase from trusted suppliers.
321
-
322
- **Use Case — Travel Service**:
323
- ```
324
- Travel Service promises:
325
- "We only book 5-star hotels from trusted hotel groups"
326
-
327
- Machine Implementation:
328
- ├── "Book Hotel" Node
329
- │ └── forward_to_order_create: {
330
- │ service: "trusted-hotel-group-service",
331
- │ // Creates sub-order on hotel service
332
- │ }
333
-
334
- └── Guard: "hotel_booking_confirmed"
335
- └── Validates sub-order created and confirmed
176
+ Order (per purchase)
177
+ ├── builder → Customer
178
+ ├── progress Workflow state
179
+ └── allocation → Fund distribution engine
336
180
  ```
337
181
 
338
- **Benefits**:
339
- - **Transparency & Quality assurance**: Commits you to vetted suppliers
340
- - **Trust building**: "We use X brand" becomes verifiable on-chain
341
-
342
- **Prerequisites**:
343
- - Supplier Service must be published first
344
- - Your Machine references their Service ID
345
-
346
- ---
347
-
348
- ## Phase 5: Order Fulfillment
349
-
350
- Handle active orders through workflow progression.
351
-
352
- ### 5.1 Progress Operations
353
-
354
- Advance orders through your Machine workflow via the Progress object.
355
-
356
- **Key Principle**:
357
- | Object | Purpose | Operation Target |
358
- |--------|---------|------------------|
359
- | **Order** | Fund escrow, ownership | Read-only for workflow |
360
- | **Progress** | Workflow state, node execution | **Operate via this** |
361
-
362
- **Two-Phase Operation** (recommended):
182
+ ### Allocators + Machine Integration
363
183
 
364
- **Operation**: `onchain_operations` with `operation_type: "progress"`.
184
+ Design together for coherent fund flow. **Allocation Modes** (execute in order):
185
+ 1. **Amount** — Fixed U64 per recipient
186
+ 2. **Rate** — Basis points (10000 = 100%)
187
+ 3. **Surplus** — Receives remainder (max 1)
365
188
 
366
- **Step 1: Lock permission** (Prevents race conditions):
367
- - `object`: Progress object ID (from Order.progress)
368
- - `operate.operation`: Target node operation (e.g., `{ Next: "shipped" }`)
369
- - `operate.hold`: `true` to lock permission
370
-
371
- **Step 2: Complete off-chain work, then submit**:
372
- - Same operation with `hold: false` to release lock and submit
373
-
374
- **Schema Reference**: `schema_query({ action: "get", name: "onchain_operations_progress" })`
375
-
376
- ### 5.2 Voluntary Compensation
377
-
378
- Proactively compensate for service failures to maintain relationships.
379
-
380
- **Scenario — Late Delivery**:
381
- ```
382
- Machine Design:
383
- ├── "Shipping" Node
384
- │ ├── Forward: "On Time" (normal)
385
- │ └── Forward: "Late" (penalty trigger)
386
-
387
- └── Guard "late_penalty"
388
- ├── IF delivery_time > promised + grace_period
389
- ├── THEN require Payment from merchant to Order
390
- └── Validate: Payment ≥ configured_penalty
391
189
  ```
190
+ Example: Delivery workflow
191
+ "delivered" → "order_complete" (threshold: 1)
192
+ └── Forward: "customer_signed" → Allocator: 95% merchant, 5% platform
392
193
 
393
- **Payment Flow**:
394
- ```
395
- Merchant or Participant Wallet
396
- ├──→ Payment (penalty) ──→ Customer's Order
397
- │ └──→ Customer extracts via receive()
398
- └──→ Guard validates before workflow continues
194
+ "delivered" → "package_lost" (threshold: 2)
195
+ ├── Forward: "customer_reports_lost"
196
+ ├── Forward: "merchant_confirms_lost"
197
+ └── Allocator: 100% to order (buyer withdraws)
399
198
  ```
400
199
 
401
- **Benefits**:
402
- - Retains customers through proactive accountability
403
- - Avoids escalation to arbitration
404
- - Differentiates your service with guarantees
405
-
406
- ### 5.3 Customer Service
200
+ ### WIP Files (Witness Immutable Promise)
407
201
 
408
- Handle inquiries and issues via Messenger.
202
+ Immutable product commitment for arbitration evidence.
409
203
 
410
- **Setup**:
411
204
  ```
412
- Service.umContact.object_id
413
- Contact.ims[] Your customer service addresses
205
+ Create: wip_filegenerate → markdown_text + images → outputPath
206
+ Attach: onchain_operations (service) sales.sales[{
207
+ name, price, stock, wip: "<URL>", wip_hash: "" (auto)
208
+ }]
414
209
  ```
415
210
 
416
- **Best Practices**:
417
- - Respond promptly to build trust
418
- - Document all agreements (generates WTS evidence)
419
- - Confirm understanding explicitly (ARK signature required for evidence)
420
- - Proactively communicate delays
211
+ ### Compensation Fund (Optional but Recommended)
421
212
 
422
- > **AI reminder**: When fulfilling an order, the AI should proactively check whether the Service's `customer_required` fields (phone, email, delivery address, etc.) have been provided by the customer. If any are missing, prompt the provider to request them from the customer via Messenger using `messenger_operation` with `send_message`.
423
-
424
- > **Full Guide**: See [wowok-messenger](../wowok-messenger/SKILL.md) for messaging, WTS generation, and evidence management.
213
+ - Add: `compensation_fund_add` | Lock: `setting_locked_time_add` (min 30d = 2592000000ms)
214
+ - **Withdraw**: Pause Service → Wait lock duration → `compensation_fund_receive`
425
215
 
426
216
  ---
427
217
 
428
- ## Best Practices & Common Pitfalls
218
+ ## Order Fulfillment
429
219
 
430
- ### Design Principles
220
+ | Object | Purpose | Operation |
221
+ |--------|---------|-----------|
222
+ | Order | Fund escrow | Read-only |
223
+ | **Progress** | Workflow state | **Operate this** — `hold: true` (lock) → work → `hold: false` (submit) |
431
224
 
432
- | Do | Don't |
433
- |----|-------|
434
- | Design Machine + Allocators together | Design workflow without considering fund flow |
435
- | Provide generous compensation_fund | Skip compensation fund for high-value services |
436
- | Use clear, verifiable Guard conditions | Create ambiguous validation logic |
437
- | Test on testnet first, then mainnet | Publish to mainnet without testing |
438
- | Document WIP thoroughly | Make vague product promises |
225
+ **AI Reminder**: When fulfilling, check `customer_required` fields. Missing → prompt via Messenger.
439
226
 
440
227
  ---
441
228
 
442
229
  ## Quick Reference
443
230
 
444
- ### Essential Schemas
445
-
446
- | Purpose | Schema Name |
447
- |---------|-------------|
448
- | Service operations | `onchain_operations_service` |
449
- | Machine operations | `onchain_operations_machine` |
450
- | Guard operations | `onchain_operations_guard` |
451
- | WIP file generation | `wip_file` |
452
- | Messenger operations | `messenger_operation` |
453
- | Query toolkit | `query_toolkit` |
454
-
455
- **Query Schema**: `schema_query({ action: "get", name: "<schema_name>" })`
231
+ | Purpose | Schema |
232
+ |---------|--------|
233
+ | Service ops | `onchain_operations_service` |
234
+ | Machine ops | `onchain_operations_machine` |
235
+ | Guard ops | `onchain_operations_guard` |
236
+ | Progress ops | `onchain_operations_progress` |
237
+ | WIP generation | `wip_file` |
238
+ | Messenger | `messenger_operation` |
239
+ | Query | `query_toolkit` |
240
+
241
+ **Export**: `machineNode2file`, `guard2file` | **Query Schema**: `schema_query({ action: "get", name: "<name>" })`