@wowok/skills 1.2.4 → 1.2.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.
Files changed (53) hide show
  1. package/README.md +34 -16
  2. package/dist/cli.js +6 -2
  3. package/dist/cli.js.map +1 -1
  4. package/dist/skills.d.ts +32 -1
  5. package/dist/skills.d.ts.map +1 -1
  6. package/dist/skills.js +63 -0
  7. package/dist/skills.js.map +1 -1
  8. package/dist/types.d.ts +8 -0
  9. package/dist/types.d.ts.map +1 -1
  10. package/examples/Insurance/Insurance.md +543 -475
  11. package/examples/MyShop/MyShop.md +865 -746
  12. package/examples/MyShop_Advanced/MyShop_Advanced.md +1520 -1376
  13. package/examples/ThreeBody_Signature/ThreeBody_Signature.md +891 -651
  14. package/examples/Travel/Travel.md +952 -848
  15. package/package.json +2 -2
  16. package/scripts/install.js +3 -17
  17. package/wowok-arbitrator/SKILL.md +18 -57
  18. package/wowok-auditor/SKILL.md +16 -12
  19. package/wowok-distill/SKILL.md +237 -0
  20. package/wowok-guard/SKILL.md +40 -354
  21. package/wowok-machine/SKILL.md +21 -127
  22. package/wowok-messenger/SKILL.md +14 -59
  23. package/wowok-onboard/SKILL.md +42 -12
  24. package/wowok-order/SKILL.md +20 -169
  25. package/wowok-output/SKILL.md +0 -10
  26. package/wowok-planner/SKILL.md +29 -9
  27. package/wowok-provider/SKILL.md +72 -32
  28. package/wowok-safety/SKILL.md +8 -80
  29. package/wowok-scenario/SKILL.md +70 -102
  30. package/wowok-tools/SKILL.md +68 -107
  31. package/references/glossary.ts +0 -297
  32. package/references/guard-scenario-ledger.md +0 -353
  33. package/references/guard-template-library.md +0 -481
  34. package/references/machine-design-reference.md +0 -398
  35. package/references/machine-scenario-ledger.md +0 -227
  36. package/references/machine-template-library.md +0 -522
  37. package/references/merchant-scenario-coordination.md +0 -383
  38. package/references/object-collaboration.md +0 -362
  39. package/references/onchain-constants.md +0 -81
  40. package/wowok-arbitrator/APPENDIX.md +0 -545
  41. package/wowok-auditor/APPENDIX.md +0 -487
  42. package/wowok-guard/APPENDIX.md +0 -430
  43. package/wowok-machine/APPENDIX.md +0 -407
  44. package/wowok-messenger/APPENDIX.md +0 -550
  45. package/wowok-onboard/APPENDIX.md +0 -502
  46. package/wowok-order/APPENDIX.md +0 -777
  47. package/wowok-output/APPENDIX.md +0 -575
  48. package/wowok-planner/APPENDIX.md +0 -726
  49. package/wowok-provider/APPENDIX.md +0 -455
  50. package/wowok-safety/APPENDIX.md +0 -565
  51. package/wowok-scenario/APPENDIX.md +0 -97
  52. package/wowok-scenario/MODE-DETAILS.md +0 -275
  53. package/wowok-tools/APPENDIX.md +0 -394
@@ -1,502 +0,0 @@
1
- # Appendix — wowok-onboard
2
-
3
- > This file is loaded on-demand (Progressive Disclosure).
4
- > Main skill: [SKILL.md](./SKILL.md)
5
-
6
- ---
7
-
8
- ## Onboarding Flow (R1-R10)
9
-
10
- Every round follows the same shape: state the goal, ask the key question(s), execute the MCP calls, verify success criteria, persist checkpoint, fall back on failure.
11
-
12
- > **Tool Call Convention**: All tool references in this document (e.g., `onchain_operations`, `query_toolkit`, `account_operation`) are sub-tools invoked via the single unified `wowok` tool. Translate every reference to `wowok({ tool: "<sub-tool-name>", data: {<params>} })`. See [wowok-tools](../wowok-tools/SKILL.md) for the full interface.
13
-
14
- ## Project-Based Deployment Integration
15
-
16
- The onboarding flow is integrated with the MCP project-based 5-stage deployment pipeline. Each stage gates progression to the next, with `project_operation` action calls providing deterministic validation:
17
-
18
- - **Stage 1 (Project Naming)** → R1-R2 — establish `project` namespace and `version` for all subsequent calls
19
- - **Stage 2 (Business Puzzle)** → R2 calls `project_operation` → `action: "analyze_intent"` to obtain the Object Dependency Graph (ODG), missing field list (puzzles), and `next_step` guidance that drives R3-R8 field completion
20
- - **Stage 3 (Risk Calibration)** → after R8 checkpoint, calls `project_operation` → `action: "aggregate_risks"` to evaluate risk across all puzzles; CRITICAL risks block progression
21
- - **Stage 4 (Deployment Doc)** → once risks pass, calls `project_operation` → `action: "generate_deployment_doc"` to produce the deployment document; D-errors block progression to R9
22
- - **Stage 5 (Substep Trace)** → R9-R10 calls `project_operation` → `action: "trace_substeps"` to validate substep linkage integrity (D-10 check) before execution via `onchain_operations`
23
-
24
- All `project_operation` calls return a `can_proceed` boolean and a `next_action` hint. The onboarding AI MUST honor the gate semantics: stop on `can_proceed: false`, fix the reported issues, and only proceed when `can_proceed: true`.
25
-
26
- ### R1: Welcome + Account Setup
27
-
28
- **AI Goal**: Confirm the user is new (or resuming), establish the working account, fund it via faucet if empty.
29
-
30
- **Key Questions**:
31
- - Are you creating a new account or importing/reusing an existing one?
32
- - If existing: which account name or address?
33
- - (Resume path) Do you want to resume your last onboarding session?
34
-
35
- **Tool Calls**:
36
- 1. `query_toolkit` → `local_names` — list existing accounts and local marks
37
- 2. If new: `account_operation` → `gen` (with `m: true` if Messenger is needed) → returns account name/address
38
- 3. `query_toolkit` → `account_balance` — verify balance > 0
39
- 4. If balance = 0: `account_operation` → `faucet` (testnet) OR `account_operation` → `transfer` from a funded account (mainnet)
40
-
41
- **Success Criteria**: An account with non-zero balance is committed as the working account; its name is recorded for every subsequent `env.account`.
42
-
43
- **Fallback**: Faucet fails → instruct user to wait 60s and retry, or fund via `transfer` from another account they own. Account name collision → append `_v1`, `_v2` per wowok-safety §1.1.
44
-
45
- **Checkpoint**: Persist `{ round: R1, account: <name>, balance: <n>, project: <project_name>, version: <version> }` via `local_info_operation`. The `project` and `version` fields establish the Stage 1 Project Naming namespace and MUST be carried forward in every subsequent `project_operation` call (Stage 2-5) and referenced in checkpoints R2-R10.
46
-
47
- ---
48
-
49
- ### R2: Industry Mode Selection
50
-
51
- **AI Goal**: Match the user's business to a wowok-scenario driving mode so subsequent rounds receive pre-filled defaults.
52
-
53
- **Key Questions**:
54
- - What are you selling? (services, rentals, courses, travel packages, subscriptions, or something else)
55
- - Do you collect deposits, charge per hour, or charge per milestone?
56
- - Will you need to ship physical goods?
57
-
58
- **Tool Calls**:
59
- 0. `project_operation` → `action: "analyze_intent"` with `project`, `version`, `user_intent`, `industry` — 获取 ODG + 缺失字段清单 + 下一步建议。MCP 返回的 puzzles 和 next_step 指导后续 R3-R8 的字段补全。
60
- 1. Internally classify the user's answers into `traits` (`has_logistics`, `communication_heavy`, `pure_digital`, `long_cycle`, `deposit_required`, `multi_tier_allocation`).
61
- 2. Match to a mode via [wowok-scenario](../wowok-scenario/SKILL.md) §Mode Selection Logic:
62
- - freelance (Phase 1) — pure digital, no deposit, milestone allocation
63
- - rental (Phase 1) — deposit required, return inspection
64
- - education (Phase 2) — long cycle, attendance Guard
65
- - travel (Phase 2) — multi-segment, multi-tier allocation
66
- - subscription (Phase 3) — periodic charge, cancel Guard
67
- - general — escape hatch, manual configuration
68
- 3. (Optional) `query_toolkit` → `read_mark` to recall any previously saved industry template the user has used.
69
-
70
- **Success Criteria**: A mode is selected and its `IndustryModeSchema` loaded into context for rounds R3-R8.
71
-
72
- **Fallback**: User wants a hybrid → load two modes and surface conflicts for user decision (per wowok-scenario §Mode Composition). User wants full manual → switch to `general` mode and skip default pre-fills.
73
-
74
- **Checkpoint**: Persist `{ round: R2, mode: <name>, traits: {...} }`.
75
-
76
- ---
77
-
78
- ### R3: Service Definition
79
-
80
- **AI Goal**: Create the unpublished Service draft with name, type_parameter, and metadata fields. Pull defaults from the selected mode.
81
-
82
- **Key Questions**:
83
- - What is the service name? (Mode default: e.g., "Logo Design Service" for freelance)
84
- - What is the type_parameter (token type for payments, e.g., `"0x2::wow::WOW"`)?
85
- - What is the deliverable description and pricing? (Mode template fills placeholders)
86
-
87
- **Tool Calls**:
88
- 1. `onchain_operations` → `operation_type: "service"` with:
89
- - `data.name`, `data.type_parameter`, `data.description`
90
- - `data.permission` left empty for now (Permission comes in R4) OR pass a Permission object shape that auto-creates (wowok-safety §1.1 — SDK auto-creates a Permission if object shape passed)
91
- - `publish: false` (mandatory — **DRAFT** creation, Service stays draft until R10 publish; this is a deliberate two-phase pattern: draft in R3-R8 allows iterative MODIFY, then irreversible publish in R10)
92
- - `env.account` = R1 account
93
- 2. (Optional, physical goods) `wip_file` → `generate` to produce WIP file URL + hash for product metadata
94
- 3. `local_mark_operation` → tag the new Service with a friendly name (e.g., `freelance_logo_v1`)
95
-
96
- **Success Criteria**: Service draft created on-chain, returns `service_id`, `bPublished: false`. Local mark persisted.
97
-
98
- **Fallback**: Name conflict on local mark → use versioned name. Type parameter unknown → default to `"0x2::wow::WOW"` and confirm with user. Missing description → use mode template's default description with user edits.
99
-
100
- **Checkpoint**: Persist `{ round: R3, service_id, service_name, type_parameter }`.
101
-
102
- ---
103
-
104
- ### R4: Permission Setup
105
-
106
- **AI Goal**: Configure the merchant access control matrix — who can read, advance, allocate, arbitrate. Reuse existing Permission when possible (wowok-safety §1.1 strong recommendation).
107
-
108
- **Key Questions**:
109
- - Do you already have a Permission object to reuse? (recommended)
110
- - If creating new: which roles do you need? Mode defaults apply (e.g., freelance: provider=1000, customer uses namedOperator:"", arbiter=1500; rental: owner=1000, renter uses namedOperator:"", arbiter=1500).
111
-
112
- **Tool Calls**:
113
- 1. If reuse: `query_toolkit` → `onchain_objects` (filter type=Permission) to list candidates; confirm with user by name.
114
- 2. If create: `onchain_operations` → `operation_type: "permission"` with `data.name`, `data.type_parameter`, plus index assignments if needed.
115
- 3. `onchain_operations` → `operation_type: "service"` MODIFY the R3 Service draft to bind `data.permission = "<permission_name_or_id>"`.
116
-
117
- **Success Criteria**: Permission exists (reused or created) and is bound to the Service. Permission indexes referenced by later Machine Forwards are recorded.
118
-
119
- **Fallback**: User wants complex role split (beyond mode defaults) → flag as Advanced tier, switch to manual Permission design, hand off context to [wowok-safety](../wowok-safety/SKILL.md) for index rules. Custom index below 1000 → SDK rejects, instruct user to use 1000-65535 range.
120
-
121
- **Checkpoint**: Persist `{ round: R4, permission_id, indexes_used: [...] }`.
122
-
123
- ---
124
-
125
- ### R5: Machine Configuration
126
-
127
- **AI Goal**: Build the workflow state machine for the Service. Mode templates provide default node graph — user confirms or customizes.
128
-
129
- **Key Questions**:
130
- - Confirm the default nodes from your industry mode (e.g., freelance: ordered → in_progress → delivered → accepted → completed; rental: reserved → paid_deposit → in_use → returned → deposit_refunded → completed).
131
- - Who advances each transition? (Mode default assigns permissionIndex)
132
- - Any timeout/auto-advance rules? (e.g., customer auto-accept after 7 days)
133
-
134
- **Tool Calls**:
135
- 1. `onchain_operations` → `operation_type: "machine"` CREATE with:
136
- - `data.nodes` from mode template (names + node keys)
137
- - `data.pairs` (prev_node, threshold)
138
- - `data.forwards` (name, weight, permissionIndex, namedOperator if needed)
139
- - Guards NOT bound yet (come in R7)
140
- - `publish: false`
141
- 2. (Optional) `machineNode2file` → export the Machine for user review before publish
142
- 3. `local_mark_operation` → tag Machine (e.g., `freelance_machine_v1`)
143
-
144
- **Success Criteria**: Machine created on-chain, returns `machine_id`, `bPublished: false`. All Forwards reference valid permission indexes (validated against R4 Permission).
145
-
146
- **Fallback**: Node count < 2 → enforce minimum 2 (entry + terminal). Forward missing permissionIndex AND namedOperator → SDK error, fill with mode default. User wants a non-mode workflow → switch to `general` mode, hand off to [wowok-machine](../wowok-machine/SKILL.md) for full design guidance.
147
-
148
- **Checkpoint**: Persist `{ round: R5, machine_id, node_count, forward_count }`.
149
-
150
- ---
151
-
152
- ### R6: Progress Binding
153
-
154
- **AI Goal**: Create the Progress template that will track each customer's order through the Machine. Bind it to the Machine.
155
-
156
- **Key Questions**:
157
- - Confirm the Progress should mirror every Machine node (typical) or only customer-visible milestones (alternative).
158
- - Do you want customer-facing labels for each state? (e.g., "In Progress" vs. internal "Node 3")
159
-
160
- **Tool Calls**:
161
- 1. `onchain_operations` → `operation_type: "progress"` CREATE with:
162
- - `data.machine = "<machine_name_or_id>"` (resolves via `GetObjectExisted()`)
163
- - `data.belong_to` = the Service (so Progress instances spawn per Order)
164
- - Optional metadata fields
165
- 2. `onchain_operations` → `operation_type: "machine"` MODIFY (if Machine needs Progress reference)
166
- 3. `onchain_operations` → `operation_type: "service"` MODIFY to bind `data.progress` if the Service schema requires it
167
-
168
- **Success Criteria**: Progress template created and bound to Machine. Subsequent `order.create` will spawn a Progress instance per order.
169
-
170
- **Fallback**: Binding fails because Machine is already published → unpublish is impossible (immutable); create a NEW Machine and rebind. Progress field missing → use mode default template.
171
-
172
- **Checkpoint**: Persist `{ round: R6, progress_id }`.
173
-
174
- ---
175
-
176
- ### R7: Guard Configuration
177
-
178
- **AI Goal**: Create the validation rules that gate order placement, advancement, and fund release. Use the circular reference pattern (wowok-tools §Object-Guard Circular Reference Pattern).
179
-
180
- **Key Questions** (mode-specific defaults shown):
181
- - Freelance: buy_guard (KYC + amount cap), deliver_guard (customer acceptance), withdraw_guard (acceptance triggers allocation), refund_guard (100% refund on dispute)
182
- - Rental: deposit_guard (deposit frozen before pickup), return_guard (renter triggers return), inspect_guard (owner verifies condition), refund_guard (deposit release on inspection pass), damage_guard (deduct deposit)
183
- - Which subset? Any custom conditions?
184
-
185
- **Tool Calls** (per Guard, repeat):
186
- 1. `onchain_operations` → `operation_type: "guard"` CREATE — for Guards that reference the protected object, use the object's NAME in the table (SDK resolves at runtime)
187
- 2. `onchain_operations` → `operation_type: "gen_passport"` — static test each Guard with a mock submission to verify logic before binding
188
- 3. `onchain_operations` → `operation_type: "machine"` MODIFY to bind Guards to specific Forwards (for workflow Gates)
189
- 4. `onchain_operations` → `operation_type: "service"` MODIFY to bind Guards to `order_allocators` (for fund gates)
190
- 5. `guard2file` → export Guards for review
191
-
192
- **Success Criteria**: All planned Guards created, `gen_passport` returned PASS for each with mock submissions, Guards bound to the correct Machine Forwards and Service Allocators.
193
-
194
- **Fallback**: `gen_passport` fails → isolate the failing Guard via `guard2file` export, inspect logic, consult [wowok-guard](../wowok-guard/SKILL.md) §10 traps, fix and re-test. Type mismatch in `convert_witness` → re-create Guard with correct target type (Guard is immutable after creation).
195
-
196
- **Checkpoint**: Persist `{ round: R7, guards: [{name, id, bound_to}], passport_tests: [...] }`.
197
-
198
- ---
199
-
200
- ### R8: Allocation Setup
201
-
202
- **AI Goal**: Configure the fund distribution strategy. Bind Allocators to the Service's `order_allocators` and to Guards that trigger release.
203
-
204
- **Key Questions** (mode defaults):
205
- - Freelance: 100% to provider on acceptance, 100% refund on dispute, 0% platform
206
- - Rental: rent → 100% owner at pickup, deposit → 100% renter on inspection pass, deposit → 100% owner on damage
207
- - What are your split percentages? Confirm sharing sum = 10000 (basis points).
208
- - Who is the recipient? (Entity for known addresses, GuardIdentifier for dynamic Order/customer)
209
-
210
- **Tool Calls**:
211
- 1. `onchain_operations` → `operation_type: "allocation"` CREATE — one Allocation per terminal path, each with Guard-gated sharing array
212
- 2. `onchain_operations` → `operation_type: "service"` MODIFY to set `data.order_allocators = [{ allocators: [...] }]`
213
- 3. Verify each Allocator's Guard references R7 Guards and recipient types are correct (`Entity` for merchant, `GuardIdentifier` for customer/Order)
214
- 4. (Optional) `onchain_operations` → `operation_type: "reward"` CREATE if the mode includes incentive pools
215
-
216
- **Success Criteria**: `order_allocators` configured on the Service. Sum of `sharing` per Allocator path = 10000. Each Allocator's trigger Guard exists and tested. Pre-publish Allocation audit returns PASS.
217
-
218
- **Fallback**: Sharing sum ≠ 10000 → auto-correct to 10000 with user confirmation. Missing refund path → block and prompt (per wowok-safety — refund Allocator is required for dispute flow). Recipient uses `Signer` instead of `Entity` → fix per [wowok-provider](../wowok-provider/SKILL.md) §Recipient Types.
219
-
220
- **Checkpoint**: Persist `{ round: R8, allocators: [{name, id, trigger_guard}], refund_path_covered: true }`.
221
-
222
- **Stage 3 Gate: Risk Calibration**
223
- After R8 checkpoint, call `project_operation` → `action: "aggregate_risks"` with `project`, `version`, `puzzles` (from R2's analyze_intent).
224
- - If `can_proceed: false` (CRITICAL risks) → fix risks before proceeding
225
- - If `can_proceed: true` → proceed to Stage 4
226
- - The `next_action` field tells you the next step
227
-
228
- **Stage 4 Gate: Deployment Document**
229
- After risks pass, call `project_operation` → `action: "generate_deployment_doc"` with `project`, `version`, `business_intent`, `objects`, `edges`, `steps`, `risk_status`, `risk_critical_count`, `risk_high_count`.
230
- - If `can_proceed: false` (D-errors) → fix doc errors
231
- - If `can_proceed: true` → proceed to R9 (deployment execution)
232
- - The `next_action` field tells you the next step
233
-
234
- ---
235
-
236
- ### R9: Test Order (Dry Run)
237
-
238
- **AI Goal**: Validate the full stack end-to-end before the irreversible publish step. Use a second account as the buyer.
239
-
240
- **Key Questions**:
241
- - Do you have a second account to play the customer, or should we create one?
242
- - Confirm test parameters: test amount, test deliverable hash.
243
-
244
- **Tool Calls**:
245
- 0. `project_operation` → `action: "trace_substeps"` with `project`, `version`, `network`, `substeps` (from Stage 4 deployment doc) — 验证子步骤衔接完整性 (D-10 check).
246
- - If `can_proceed: false` → fix substep issues
247
- - If `can_proceed: true` → execute substeps via onchain_operations
248
- 1. `account_operation` → `gen` (second account, the "buyer")
249
- 2. `account_operation` → `faucet` for the buyer
250
- 3. `onchain_operations` → `operation_type: "order"` CREATE — buyer places order on the Service draft
251
- 4. `onchain_operations` → `operation_type: "progress"` with `hold: true` then `hold: false` to advance through each Machine node
252
- 5. At each terminal node: `onchain_operations` → `operation_type: "allocation"` with `alloc_by_guard` to verify fund distribution
253
- 6. `onchain_operations` → `operation_type: "order"` to verify buyer can withdraw refund if applicable
254
- 7. `query_toolkit` → `onchain_events` to verify all expected events fired
255
-
256
- **Success Criteria**: Test order traverses the full Machine, all Guards pass with mock submissions, Allocation distributes funds correctly to merchant and (if tested) refund path returns funds to buyer. Event log matches expected sequence.
257
-
258
- **Fallback**: Guard blocks at a node → check `gen_passport` output, re-collect correct submission, retry. Allocation distributes wrong amount → halt, review Allocator sharing array. Order creation fails → check Service is in correct state and Permission allows buyer role.
259
-
260
- **Checkpoint**: Persist `{ round: R9, test_order_id, test_passed: true, event_log_summary }`.
261
-
262
- ---
263
-
264
- ### R10: Publish + Post-Publish Verification
265
-
266
- **AI Goal**: Execute the irreversible publish sequence with full pre-publish audit, then verify immutability locks are in place and hand off to operations.
267
-
268
- **Key Questions**:
269
- - Final confirmation: publish is irreversible. Machine nodes, Service `machine` and `order_allocators` will be locked forever. Proceed?
270
- - Do you want to add a Compensation Fund before publish (recommended for trust)?
271
-
272
- **Tool Calls**:
273
- 1. Pre-publish audit (mandatory, per wowok-safety):
274
- - `machineNode2file` → export Machine, verify topology
275
- - `guard2file` → export all Guards, verify logic
276
- - `query_toolkit` → `onchain_objects` → re-check Permission, Service, Machine, Progress, Guards, Allocation all exist and are correctly bound
277
- 2. **Publish Machine FIRST** — `onchain_operations` → `operation_type: "machine"` with `publish: true` (PUBLISH, irreversible). Machine locked. This MUST happen before Service publish because the Service depends on a published Machine.
278
- 3. `onchain_operations` → `operation_type: "service"` MODIFY to bind `data.machine = "<published_machine_id>"`
279
- 4. **Publish Service SECOND** — `onchain_operations` → `operation_type: "service"` with `publish: true` (PUBLISH, irreversible). Service locked. Order is mandatory: **Machine first, then Service** (Service depends on Machine).
280
- 5. (Optional) `onchain_operations` → `operation_type: "service"` MODIFY to add `compensation_fund_add` and `setting_locked_time_add`
281
- 6. Post-publish verification:
282
- - `query_toolkit` → `onchain_objects` (Service) → confirm `bPublished: true`, `machine` field is locked, `order_allocators` is locked
283
- - `onchain_events` → confirm Publish event fired
284
-
285
- **Success Criteria**: Both Machine and Service `bPublished: true`. Service `machine` and `order_allocators` fields are immutable. Publish event recorded on-chain. Handoff packet produced.
286
-
287
- **Fallback**: Pre-publish audit fails → return to the failing round (R5/R6/R7/R8) and fix; do NOT publish. Publish transaction fails (gas) → re-faucet, retry. Post-publish immutability check fails (rare) → escalate to manual intervention, this should not happen at the protocol level.
288
-
289
- **Checkpoint**: Persist `{ round: R10, published: true, machine_immutable: true, service_immutable: true, publish_digest }`. Mark onboarding COMPLETE.
290
-
291
- **Handoff Packet** (emitted to user and to [wowok-provider](../wowok-provider/SKILL.md)):
292
- - Service ID + name + publish digest
293
- - Machine ID + node topology summary
294
- - Permission ID + role/index map
295
- - Progress template ID
296
- - Guard IDs + bindings
297
- - Allocator IDs + trigger map
298
- - Test order digest + result
299
- - Recommended next Skill: wowok-provider (operations), wowok-analytics (post-30-day audit), wowok-arbitrator (dispute setup)
300
-
301
- ---
302
-
303
- ## Decision Trees
304
-
305
- ### D1: Account Path
306
-
307
- ```
308
- User enters onboarding
309
- ├── Has account with balance > 0? ── YES ──→ use it, advance to R2
310
- ├── Has account but balance = 0? ── YES ──→ faucet/transfer, advance to R2
311
- └── No account ──→ account.gen ──→ faucet ──→ advance to R2
312
- ```
313
-
314
- ### D2: Industry Mode Match
315
-
316
- ```
317
- User's business description
318
- ├── deposit_required? ── YES ──→ rental mode
319
- ├── multi_tier_allocation? ── YES ──→ travel mode
320
- ├── long_cycle + attendance? ── YES ──→ education mode
321
- ├── periodic_charge + cancel_anytime? ── YES ──→ subscription mode
322
- ├── pure_digital + milestone? ── YES ──→ freelance mode
323
- └── none of the above ──→ general mode (escape hatch)
324
- ```
325
-
326
- ### D3: Reuse vs Create (per object)
327
-
328
- ```
329
- For each of Permission / Machine / Guard / Contact / Arbitration:
330
- ├── User provides existing name/ID? ──→ REUSE (string reference)
331
- ├── User says "create new"? ──→ CREATE (object shape)
332
- └── User unsure? ──→ query on-chain, present candidates, let user pick
333
- ```
334
-
335
- ### D4: Resume from Checkpoint
336
-
337
- ```
338
- Onboarding session starts
339
- ├── local_info_operation returns R{N} checkpoint? ── YES
340
- │ ├── Query on-chain: are R{N} objects still valid? ── YES ──→ resume at R{N+1}
341
- │ └── On-chain state changed (e.g., Service published by another path)? ──→ restart at R1 with warning
342
- └── No checkpoint ──→ start fresh at R1
343
- ```
344
-
345
- ### D5: Pre-Publish Audit Outcome
346
-
347
- ```
348
- R10 pre-publish audit
349
- ├── All checks PASS ──→ publish Machine, then Service ──→ post-publish verify ──→ COMPLETE
350
- ├── Warnings only (e.g., no Compensation Fund) ──→ ask user, then publish or fix
351
- └── Blockers (e.g., Machine not bound to Service) ──→ return to specific round, fix, re-audit
352
- ```
353
-
354
- ---
355
-
356
- ## Failure Playbooks
357
-
358
- ### F1: Faucet Exhausted / Gas Unavailable
359
-
360
- **Symptom**: `account_operation.faucet` returns rate-limit or mainnet has no faucet.
361
-
362
- **Recovery**:
363
- 1. Check if user has another funded account → `account_operation.transfer` to the working account (1 WOW = 10^9 base units is enough for dozens of txns).
364
- 2. If no other account → instruct user to acquire WOW from an exchange or another wallet, then resume.
365
- 3. Do NOT reduce example prices/stock on mainnet without user confirmation (per wowok-tools §Mainnet operations).
366
-
367
- ### F2: Guard `gen_passport` Test Fails
368
-
369
- **Symptom**: Static Guard test returns FAIL on a specific Guard.
370
-
371
- **Recovery**:
372
- 1. `guard2file` export the failing Guard.
373
- 2. Inspect: table entry type, `convert_witness` target type, `rely` chain completeness.
374
- 3. Cross-reference [wowok-guard](../wowok-guard/SKILL.md) §10 traps.
375
- 4. Guard is immutable after creation → CREATE a new Guard with corrected logic, re-test.
376
- 5. Update all references (Machine Forwards, Service Allocators) to the new Guard via MODIFY.
377
-
378
- ### F3: Test Order Stuck at a Node
379
-
380
- **Symptom**: `progress.hold` succeeds but advancing to next node fails.
381
-
382
- **Recovery**:
383
- 1. `query_toolkit` → `onchain_objects` (Progress) → inspect `current_node`, `forward_history`.
384
- 2. Identify which Forward is missing — likely a `namedOperator` not assigned, or a Guard blocking.
385
- 3. If Guard blocking → re-collect submission, re-call `progress.hold: false` with correct submission.
386
- 4. If namedOperator missing → `progress` MODIFY to assign the role address.
387
- 5. If terminal node reached but Allocation didn't fire → call `allocation.alloc_by_guard` manually with Order ID submission.
388
-
389
- ### F4: Publish Fails
390
-
391
- **Symptom**: `service.publish: true` transaction reverts.
392
-
393
- **Recovery**:
394
- 1. Check Machine is published FIRST (Service publish requires published Machine).
395
- 2. Check `service.machine` field is bound to the published Machine ID.
396
- 3. Check `order_allocators` is configured and each Allocator's Guard exists.
397
- 4. Re-run pre-publish audit, fix any blockers, retry.
398
- 5. NEVER use `--no-verify` or skip checks — publish is irreversible, must be correct.
399
-
400
- ### F5: User Abandons Mid-Onboarding
401
-
402
- **Symptom**: User stops responding or explicitly says "I'll come back later".
403
-
404
- **Recovery**:
405
- 1. Persist final checkpoint via `local_info_operation` with current round, all object IDs, and user decisions.
406
- 2. Confirm to user: "Your progress is saved at round R{N}. Resume anytime by saying 'continue onboarding'."
407
- 3. Do NOT clean up draft objects — they remain on-chain unpublished and can be resumed.
408
- 4. On resume, re-validate all checkpoint objects via `query_toolkit` before continuing (on-chain state is source of truth).
409
-
410
- ### F6: Mode Mismatch Detected Late
411
-
412
- **Symptom**: User picks freelance mode in R2 but in R5 describes a deposit requirement (rental trait).
413
-
414
- **Recovery**:
415
- 1. Acknowledge the mismatch: "Your description sounds more like rental mode. Switch?"
416
- 2. If user confirms → load rental mode defaults, re-evaluate R3-R5 parameters with new defaults (do NOT discard user's Service name/description unless they conflict).
417
- 3. If user wants hybrid → load both modes, surface conflicting fields, let user decide per field.
418
- 4. Update checkpoint with the corrected mode.
419
-
420
- ---
421
-
422
- ## Tier Layering
423
-
424
- ### Novice Tier (default)
425
-
426
- - Full guided R1-R10 sequence
427
- - Mode defaults auto-applied, user only confirms
428
- - Pre-publish audit is mandatory and blocking
429
- - Every round shows a plain-language explanation before the MCP call
430
- - Checkpoint persistence is automatic
431
-
432
- ### Advanced Tier
433
-
434
- - User can skip non-essential rounds via "skip R6 Progress, I'll bind later"
435
- - Mode defaults shown but user can override any field
436
- - Pre-publish audit runs but warnings are non-blocking (blockers still block)
437
- - User can call MCP tools directly with the Skill providing context, not commands
438
- - Trigger: user says "I know what I'm doing" or has completed prior onboardings
439
-
440
- ### Expert Tier
441
-
442
- - User invokes MCP tools directly; Skill provides only the dependency graph and audit checklist
443
- - Mode selection optional — user can build fully custom configuration
444
- - Pre-publish audit optional but strongly recommended
445
- - Skill acts as a reference card, not a guide
446
- - Trigger: user explicitly asks for "expert mode" or invokes MCP operations by name
447
-
448
- ---
449
-
450
- ## Handoff Protocol
451
-
452
- ### When to Hand Off
453
-
454
- | Trigger | Target Skill | Reason |
455
- |---------|-------------|--------|
456
- | R10 publish succeeds | [wowok-provider](../wowok-provider/SKILL.md) | Merchant enters operations phase |
457
- | User asks about a specific industry scenario | [wowok-scenario](../wowok-scenario/SKILL.md) | Industry mode lookup |
458
- | R7 Guard design gets complex | [wowok-guard](../wowok-guard/SKILL.md) | Advanced Guard patterns |
459
- | R5 Machine design goes beyond mode template | [wowok-machine](../wowok-machine/SKILL.md) | Custom workflow design |
460
- | User mentions a customer-side flow | [wowok-order](../wowok-order/SKILL.md) | Buyer perspective |
461
- | Test order reveals dispute scenario | [wowok-arbitrator](../wowok-arbitrator/SKILL.md) | Dispute resolution setup |
462
- | Publish completed + 30 days elapsed | wowok-analytics (Phase 2) | Usage and business audit |
463
-
464
- ### Handoff Packet Format
465
-
466
- When handing off, emit this context bundle so the receiving Skill does not need to re-query:
467
-
468
- ```yaml
469
- handoff:
470
- from: wowok-onboard
471
- to: <target_skill>
472
- state:
473
- journey: onboarding
474
- completed_rounds: R1-R10
475
- mode: freelance # or rental / general / etc.
476
- account: <name>
477
- objects:
478
- service_id: 0x...
479
- machine_id: 0x...
480
- permission_id: 0x...
481
- progress_id: 0x...
482
- guard_ids: [0x..., 0x...]
483
- allocator_ids: [0x..., 0x...]
484
- test_order_id: 0x...
485
- publish_digest: <tx_digest>
486
- carry_context:
487
- - mode_defaults # so receiving Skill knows what was pre-filled
488
- - user_decisions # any deviations from mode defaults
489
- next_actions:
490
- - tool: query_toolkit
491
- action: onchain_objects
492
- reason: "Verify published Service state"
493
- ```
494
-
495
- ### Resumption Protocol
496
-
497
- When `wowok-onboard` is invoked and a checkpoint exists:
498
- 1. Read checkpoint via `local_info_operation`.
499
- 2. For each object ID in the checkpoint, `query_toolkit` → `onchain_objects` to verify it still exists and is in the expected state.
500
- 3. If all valid → resume at the next round.
501
- 4. If any object is missing or state changed → surface the discrepancy, ask user whether to restart or attempt recovery.
502
- 5. **Invariant**: on-chain state is the source of truth. Checkpoint is a hint, not a guarantee.