@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
@@ -31,15 +31,29 @@ when_to_use:
31
31
 
32
32
  A **driving mode** is a curated bundle of: industry traits, default Permission indexes, default Machine node graph, default Guard templates, default Allocator strategy, a 10-round build script, an audit checklist, and a failure playbook. Modes are **presets, not constraints** — every underlying MCP operation remains available. Users can override any default or switch to `general` (free) mode at any time.
33
33
 
34
- > **Authoritative cross-reference**: This skill's mode definitions are aligned with the following internal references:
35
- > - [Guard Template Library](../references/guard-template-library.md) — Guard templates referenced by mode `Guards` column
36
- > - [Machine Template Library](../references/machine-template-library.md) Machine shapes referenced by mode `Machine Shape` column
37
- > - [Machine Scenario Ledger](../references/machine-scenario-ledger.md) — 10 business scenarios per mode
38
- > - [Guard Scenario Ledger](../references/guard-scenario-ledger.md) Guard usage scenarios per mode
39
- > - [Merchant Scenario Coordination §5](../references/merchant-scenario-coordination.md) — 6 industry modes × merchant perspective
40
- > - [On-chain Constants](../references/onchain-constants.md) Permission index ranges and capacity limits
41
- >
42
- > When a mode's defaults disagree with these references, the **design references** in this directory are authoritative (P15 decision: bidirectional cross-reference, with design references as single source of truth for object semantics).
34
+ ### On-Chain Capacity Limits (Inline Reference)
35
+
36
+ Mode defaults respect these on-chain constants. When a mode's suggested count exceeds a limit, the SDK will reject the operation.
37
+
38
+ | Constant | Value | Scope |
39
+ |----------|-------|-------|
40
+ | `MAX_NODE_COUNT_SDK` | 100 | Max nodes per Machine (SDK limit; on-chain allows 200) |
41
+ | `MAX_FORWARD_COUNT` | 20 | Max global forwards per Machine |
42
+ | `MAX_FORWARD_ORDER_COUNT` | 20 | Max forwards per node pair |
43
+ | `MAX_NODE_PAIR_COUNT` | 40 | Max pairs per node |
44
+ | `USER_DEFINED_PERM_INDEX_START` | 1000 | Custom permission_index start (0-999 reserved for built-in) |
45
+ | `MAX_PERM_FOR_ENTITY` | 1000 | Max permissions per Entity |
46
+ | `MAX_ADMIN_COUNT` | 500 | Max admins per Permission object |
47
+ | `MAX_AGENT_COUNT` | 10 | Max agents per Order |
48
+ | `MAX_DISPUTE_COUNT` | 10 | Max concurrent disputes per Order |
49
+ | `MAX_SHARING_COUNT` | 100 | Max sharing entries per allocator |
50
+ | `MAX_VOTING_GUARD_COUNT` | 50 | Max voting guards per Arbitration |
51
+ | `MAX_POLICY_COUNT` | 50 | Max policies per Repository |
52
+ | `MAX_ID_COUNT_ONCE` | 100 | Max IDs per Repository operation |
53
+ | `MAX_REWARD_COUNT` | 20 | Max rewards per Demand/Repository |
54
+ | `MAX_CONTEXT_REPOSITORY_COUNT` | 30 | Max context repositories per Progress |
55
+ | `MAX_NAMED_OPERATOR_COUNT` | 60 | Max named operators per Forward |
56
+ | `MAX_NAMED_OPERATOR_ADDRESS_COUNT` | 80 | Max addresses per named operator |
43
57
 
44
58
  ### What Driving Modes Solve
45
59
 
@@ -64,16 +78,7 @@ The selection algorithm maps the user's business description to industry traits,
64
78
 
65
79
  ### Trait Extraction
66
80
 
67
- ```typescript
68
- type IndustryTraits = {
69
- has_logistics: boolean; // physical goods to ship?
70
- communication_heavy: boolean; // lots of back-and-forth before delivery?
71
- pure_digital: boolean; // deliverable is a file / digital artifact?
72
- long_cycle: boolean; // multi-week or multi-month engagement?
73
- deposit_required: boolean; // collect refundable deposit?
74
- multi_tier_allocation: boolean; // pay multiple parties per segment?
75
- };
76
- ```
81
+ Industry traits used for mode selection: `has_logistics` (physical goods to ship?), `communication_heavy` (lots of back-and-forth before delivery?), `pure_digital` (deliverable is a file/digital artifact?), `long_cycle` (multi-week or multi-month engagement?), `deposit_required` (collect refundable deposit?), `multi_tier_allocation` (pay multiple parties per segment?).
77
82
 
78
83
  ### Selection Matrix
79
84
 
@@ -102,101 +107,81 @@ When two modes specify different Permission indexes for the same role, user deci
102
107
 
103
108
  ## Phase 1 Mode Details (Freelance & Rental)
104
109
 
105
- > The full detail for Phase 1 priority modes (Freelance & Rental) including industry traits, Machine templates, Guard templates, Allocator strategies, 10-round build scripts, audit checklists, and failure playbooks has been extracted to [MODE-DETAILS.md](./MODE-DETAILS.md) for on-demand loading.
106
- >
107
- > **Load MODE-DETAILS.md when:**
108
- > - User selects `freelance` or `rental` mode
109
- > - wowok-onboard R3-R8 needs Machine/Guard/Allocator defaults
110
- > - User asks "what does the freelance/rental mode include?"
111
- > - Pre-publish audit needs mode-specific checklist
110
+ > **Mode defaults** (traits, machine_shape, guards, allocator, key_risk, build_notes) are provided by MCP `project_operation` action `analyze_intent` pass `industry` parameter and the MCP auto-fills scenario defaults from `knowledge/scenario-modes.ts`. The AI does NOT need to look up per-industry presets manually.
112
111
 
113
112
  ### Quick Reference (mode summaries)
114
113
 
115
114
  | Mode | Machine Shape | Guards | Allocators | Key Risk |
116
115
  |------|---------------|--------|------------|----------|
117
- | `freelance` | 7 nodes (ordered→...→completed/refunded) | 5 (buy/deliver/accept/withdraw/refund) | 2 (100% provider / 100% refund) | Customer never accepts delivery |
118
- | `rental` | 10 nodes (reserved→...→deposit_refunded/deducted) | 5 (deposit/return/inspect/refund/damage) | 3 (rent / refund / deduct) | Owner claims damage without pre-rental WIP |
116
+ | `freelance` | 7 nodes (ordered→...→completed→{wonder\|no_wonder}) | 5 (buy/deliver/accept/withdraw/rating_window) | 2 (100% provider at completed / 0 at wonder-no_wonder) | Customer never accepts delivery |
117
+ | `rental` | 10 nodes (reserved→...→completed→{wonder\|no_wonder}) | 5 (deposit/return/inspect/damage/rating_window) | 3 (rent at completed / refund-to-order via Allocator / damage deduct) | Owner claims damage without pre-rental WIP |
118
+
119
+ > **Dispute Independence**: `refunded`/`disputed`/`arb` MUST NOT appear as Machine nodes (R-M1-11 critical). Refunds flow through Allocator (100%→OrderHolder) or Arbitration (dispute → ruling → arb_withdraw), both off-Machine. Wonder/no_wonder are post-completion reputation terminals only.
120
+
121
+ ### Freelance Audit Checklist (pre-publish BLOCKERS)
122
+
123
+ - `accept_guard` exists + `gen_passport` tested — BLOCKER (no acceptance = funds stuck)
124
+ - 100% refund Allocator (sharing.who=OrderHolder) — BLOCKER (no refund path = dispute deadlock)
125
+ - Machine MUST NOT contain `refunded`/`disputed`/`arb` nodes (R-M1-11 critical) — BLOCKER. Refund flows through Allocator or Arbitration, both off-Machine
126
+ - `withdraw_guard` only triggers at `Progress.current=completed` — BLOCKER (prevents premature payout)
127
+ - `deliver_guard` validates WIP hash — recommended
128
+ - Optional: wonder/no_wonder terminals after `completed` for post-purchase rating (enables Reward wonder_praise template)
129
+
130
+ ### Freelance Failure Playbooks
131
+
132
+ - Customer never accepts: `accept_guard` includes timeout auto-accept forward (threshold met by `namedOperator:""` after N days)
133
+ - Wrong deliverable hash: `deliver_guard` enforces WIP match → re-generate WIP, re-submit via `progress.hold:false`
134
+ - No arbiter assigned: bind Arbitration via `service.arbitrations` AND configure `Arbitration.voting_guard` (NOT Permission index 1500 — arbiters live in voting_guard, never in Permission)
135
+
136
+ ### Rental Audit Checklist (pre-publish BLOCKERS)
137
+
138
+ - `deposit_guard` validates `Order.balance ≥ deposit_amount` — BLOCKER (renter runs off with item)
139
+ - 100% refund Allocator (sharing.who=OrderHolder) — BLOCKER (no refund = deposit theft)
140
+ - `damage_guard` requires pre+post WIP hash diff — BLOCKER (no evidence = arbitrary deduction)
141
+ - Machine MUST NOT contain `deposit_refunded`/`deposit_deducted`/`refunded` nodes (R-M1-11 critical) — BLOCKER. Deposit refund/deduction flows through Allocator, not Machine terminals
142
+ - Pre-rental WIP generated + hash stored — BLOCKER (can't prove damage without pre-hash)
143
+ - Rental period timeout forward on `in_use` node — recommended
144
+
145
+ ### Rental Failure Playbooks
146
+
147
+ - Renter never returns: timeout forward to `damage_confirmed`, `deposit_deduct` Allocator fires
148
+ - No pre-rental WIP: impossible post-publish — audit checklist blocks this at publish time
149
+ - Owner refuses inspect: timeout forward auto-passes `inspect_guard`, `refund_guard` fires, deposit returns
150
+ - Double-spend dispute: Machine topology ensures mutually exclusive forwards (first-Pair-wins), `escalate_arbiter` routes to Arbitration
119
151
 
120
152
  ---
121
153
 
122
154
  ## Education Mode (Phase 2 — Outline)
123
155
 
124
- ### Industry Traits
125
-
126
- ```typescript
127
- const educationTraits: IndustryTraits = {
128
- has_logistics: false,
129
- communication_heavy: true,
130
- pure_digital: false,
131
- long_cycle: true,
132
- deposit_required: true, // tuition pre-pay
133
- multi_tier_allocation: false,
134
- };
135
- ```
156
+ **Traits**: communication_heavy, long_cycle, deposit_required (tuition pre-pay), not pure_digital.
136
157
 
137
158
  ### Mode Outline
138
159
 
139
- - **Default Machine**: enroll → pay_tuition → session_1 → session_2 → ... → session_N → completed / refunded
160
+ - **Default Machine**: enroll → pay_tuition → session_1 → session_2 → ... → session_N → completed {wonder | no_wonder}
140
161
  - **Default Guards**: `attendance_guard` (per session, student signs), `refund_guard` (institution approval OR arbiter)
141
162
  - **Default Allocator**: 1/N of tuition released per session attendance; unearned portion refundable on `refund_guard`
142
163
  - **Key trait**: `setting_locked_time` on Service prevents institution from changing rules mid-semester (regulatory compliance)
143
164
  - **GTM angle**: targets "tutoring institutions run away with prepaid tuition" pain point; policy-driven adoption
144
165
 
145
- ### Phase 2 Build Status
146
-
147
- - Machine template: drafted, needs 1 pilot institution test
148
- - Guards: `attendance_guard` needs WIP hash for session content commitment
149
- - Allocator: per-session release needs threshold-based trigger
150
- - Audit checklist: pending real-world pilot
151
-
152
166
  ---
153
167
 
154
168
  ## Travel Mode (Phase 2 — Outline)
155
169
 
156
- ### Industry Traits
157
-
158
- ```typescript
159
- const travelTraits: IndustryTraits = {
160
- has_logistics: false,
161
- communication_heavy: true,
162
- pure_digital: false,
163
- long_cycle: true,
164
- deposit_required: true, // deposit + final payment
165
- multi_tier_allocation: true, // agency → hotel → guide → driver
166
- };
167
- ```
170
+ **Traits**: communication_heavy, long_cycle, deposit_required (deposit + final payment), multi_tier_allocation (agency → hotel → guide → driver).
168
171
 
169
172
  ### Mode Outline
170
173
 
171
- - **Default Machine**: order → pay_deposit → pay_final → segment_D1 → segment_D2 → ... → return → completed / refunded
174
+ - **Default Machine**: order → pay_deposit → pay_final → segment_D1 → segment_D2 → ... → return → completed {wonder | no_wonder}
172
175
  - **Default Guards**: `segment_guard` (per-segment arrival WIP, e.g., hotel check-in), `refund_guard` (agency approval OR arbiter for trip interruption)
173
176
  - **Default Allocator**: multi-tier — deposit 20% to agency, final 80% to agency, then agency-side Allocation splits to hotel/guide/driver per segment
174
177
  - **Key trait**: multi-tier Allocation is WoWok's unique advantage over traditional travel platforms
175
178
  - **GTM angle**: targets "paid in full then service shrinks" pain point
176
179
 
177
- ### Phase 2 Build Status
178
-
179
- - Machine template: drafted, needs multi-tier Allocation pilot
180
- - Guards: `segment_guard` needs standardized WIP templates per segment type (hotel, transport, activity)
181
- - Allocator: multi-tier waterfall needs guard chaining validation
182
- - Audit checklist: pending real-world pilot
183
-
184
180
  ---
185
181
 
186
182
  ## Subscription Mode (Phase 3 — Outline)
187
183
 
188
- ### Industry Traits
189
-
190
- ```typescript
191
- const subscriptionTraits: IndustryTraits = {
192
- has_logistics: false,
193
- communication_heavy: false,
194
- pure_digital: true,
195
- long_cycle: true,
196
- deposit_required: false,
197
- multi_tier_allocation: false,
198
- };
199
- ```
184
+ **Traits**: pure_digital, long_cycle, not deposit_required, not communication_heavy.
200
185
 
201
186
  ### Mode Outline
202
187
 
@@ -206,13 +191,6 @@ const subscriptionTraits: IndustryTraits = {
206
191
  - **Key trait**: pure digital, native WoWok soil; directly attacks "auto-renew trap" and "platform takes 30%" pain points
207
192
  - **GTM angle**: independent creators (Indie Hackers, niche SaaS, paid newsletters)
208
193
 
209
- ### Phase 3 Build Status
210
-
211
- - Machine template: planned
212
- - Guards: `charge_guard` needs periodic trigger mechanism (off-chain scheduler + on-chain Guard)
213
- - Allocator: per-period release straightforward
214
- - Audit checklist: pending design review
215
-
216
194
  ---
217
195
 
218
196
  ## Escape Hatch
@@ -228,14 +206,7 @@ Any user can switch from a driving mode to `general` (free) mode at any time. Th
228
206
 
229
207
  ### How to Switch
230
208
 
231
- ```
232
- User says: "switch to general mode" or "configure manually"
233
- ├── Stop applying mode defaults to remaining rounds
234
- ├── Surface the IndustryModeSchema shape as a blank template
235
- ├── User provides: Permission indexes, Machine nodes, Guards, Allocators manually
236
- ├── wowok-onboard R3-R8 still execute, but with empty defaults
237
- └── wowok-machine / wowok-guard / wowok-provider become primary references
238
- ```
209
+ When user says "switch to general mode" or "configure manually": stop applying mode defaults to remaining rounds, surface the `IndustryModeSchema` shape as a blank template, let user provide Permission indexes/Machine nodes/Guards/Allocators manually. wowok-onboard R3-R8 still execute with empty defaults; wowok-machine / wowok-guard / wowok-provider become primary references.
239
210
 
240
211
  ### Warning
241
212
 
@@ -252,11 +223,8 @@ User can switch back to a driving mode after using general mode:
252
223
 
253
224
  ---
254
225
 
255
- ## Appendices (Progressive Disclosure)
226
+ ## Tier Layering
256
227
 
257
- > The following sections have been extracted to [APPENDIX.md](./APPENDIX.md) for on-demand loading:
258
- > - Tier Layeringexpertise-tier based guidance
259
- > - IndustryModeSchemaschema reference
260
- > - Quick Reference — lookup table
261
- >
262
- > Load APPENDIX.md when the user needs tier-specific guidance, schema reference, or quick lookup.
228
+ - **Novice**: Full driving mode mode defaults fill all rounds, user only confirms
229
+ - **Advanced**: Customize defaults user overrides specific fields (e.g., Allocator split), audit checklist still runs
230
+ - **Expert**: General mode no defaults, raw MCP operations, wowok-machine/guard/provider become primary references
@@ -142,90 +142,95 @@ Step 3: MODIFY reward { object: "reward_v1", guard_add: [...] } // bind guard
142
142
 
143
143
  ---
144
144
 
145
- ## The 17 Sub-Tools (all via `wowok({ tool, data })`)
145
+ ## Sub-Tool Schema-Inexpressible Constraints
146
146
 
147
- ### 1. `onchain_operations`16 Sub-Types
147
+ > MCP schemas define field types/validation. The constraints below are business rules NOT expressible in schemas AI must know them before calling.
148
148
 
149
- > **Schema**: `wowok({ tool: "schema_query", data: { action: "get", name: "onchain_operations" } })` for the full discriminated union. Per-type schemas: `onchain_operations_service`, `onchain_operations_machine`, etc.
149
+ ### `onchain_operations` (18 sub-types)
150
150
 
151
- | `operation_type` | Schema-Inexpressible Constraints |
151
+ | `operation_type` | Key Constraints (not in schema) |
152
152
  |-----------------|----------------------------------|
153
- | `service` | `machine` field must reference a **published** Machine. Allocators evaluated in array order (first-Guard-wins). Publish locks `machine`/`order_allocators`; `sales`/`discount`/`description` remain mutable. |
154
- | `machine` | Nodes immutable after publish. Forward requires ≥1 of `namedOperator`/`permissionIndex` (both empty = SDK error). Weight `u16` (0–65535), threshold `u32`. `""` = entry node. Full lifecycle → [wowok-machine](../wowok-machine/SKILL.md). |
155
- | `progress` | Two-phase advancement: `hold: true` (lock) → `hold: false` (submit). `adminUnhold: true` force-releases others' locks. SDK fetches Machine internally when resolving `object_address`. |
156
- | `arbitration` | MAX 20 propositions, 520 voters. Non-Finished withdrawal triggers 30-day mandatory wait. Verdict (state 2→3) is **irreversible** by arbitrator — only customer can object via `order.arb_objection`. Voting weight from Guard `b_submission:true` must be numeric (U8–U256→u32). Full workflow → [wowok-arbitrator](../wowok-arbitrator/SKILL.md). |
157
- | `guard` | Two creation modes: `root.type: "node"` (inline) or `"file"` (from JSON/Markdown). MAX 4 `rely` dependencies. Guards with `rep: false` **excluded** from other Guards' `rely` lists. Global system addresses (`0xaab` EntityRegistrar, `0xaaa` EntityLinker) require table entries. Full design → [wowok-guard](../wowok-guard/SKILL.md). |
158
- | `gen_passport` | MAX 20 Guards/call (AND-ed — all must pass). Omit `info` to auto-fetch submissions from Guards. Passport frozen after creation (immutable credential). Usage → [wowok-guard](../wowok-guard/SKILL.md). |
159
- | `order` | Builder-owned: agents can operate but **cannot withdraw** — only builder receives funds. `order.progress` with Guard requires Passport (mandatory, not bypassable). Arbitration via `order.arb_confirm`/`arb_objection` (not via `arbitration` directly). `arb_claim_compensation` once-only, from Service's compensation fund. Full flow → [wowok-order](../wowok-order/SKILL.md). |
160
- | `payment` | `type_parameter` required (e.g., `"0x2::wow::WOW"`). Irreversible — no refund mechanism. |
161
- | `personal` | **Permanently public** — no private field exists. Warn users before writing sensitive data. |
162
- | `demand` | Guard-gated: `guards` filter which presenters can submit solutions. Separate from Service. |
163
- | `treasury` | Guardable deposits (`external_deposit_guard`) and withdrawals (`external_withdraw_guard`). Each entry creates a Payment record in history table for auditability. |
164
- | `repository` | Composite key: `name + entity` (address or number). Guardable writes validate both writer eligibility and data content. |
165
- | `reward` | `guard_add` AmountType: `Fixed` (equal) or `GuardU64Identifier` (dynamic from submission). `guard_expiration_time` freezes the Guard list; `null` to remove. |
166
- | `allocation` | Auto-executes on Progress advancement; modes evaluated in order (Amount → Rate → Surplus), first-Guard-wins per mode. |
167
- | `contact` | Bridge between Service (`um` field) and Messenger: holds `ims[]` (messenger addresses). |
168
- | `permission` | Indices 0–65535 (0–999 reserved for protocol; custom ≥1000). SDK rejects custom below 1000. Reuse across objects. |
169
-
170
- ### WIP Hash Dispute-Prevention Mechanism
171
-
172
- When a customer browses products, the AI agent MUST capture the `wip_hash` from the Service query result (the `sale.wip_hash` field for each product). When creating an order, pass the captured hash in `buy.items[].wip_hash`.
173
-
174
- This is a two-layer protection:
175
- 1. **Off-chain** (SDK `verify_wip`): downloads the WIP file and verifies its hash matches the captured hash — detects WIP file tampering.
176
- 2. **On-chain** (Move contract `assert!(sale.wip_hash == i.wip_hash)`): confirms the Service's sale hasn't been updated between browse and purchase time.
177
-
178
- If the merchant swaps the WIP file or changes `sale.wip_hash` after the customer browses, the order will fail the customer is protected from bait-and-switch.
153
+ | `service` | `machine` must be **published**. Allocators: array order = priority (first-Guard-wins). Publish locks `machine`/`order_allocators`; `sales`/`discount`/`description` stay mutable. |
154
+ | `machine` | Nodes immutable after publish. Forward needs ≥1 of `namedOperator`/`permissionIndex` (both empty = SDK error). `""` = entry node. → [wowok-machine](../wowok-machine/SKILL.md) |
155
+ | `progress` | Two-phase: `hold:true` (lock) → `hold:false` (submit). `adminUnhold:true` force-releases. SDK auto-fetches Machine when resolving `object_address`. |
156
+ | `arbitration` | MAX 20 propositions, 520 voters. Verdict (2→3) **irreversible** — only customer can `order.arb_objection`. Non-Finished withdrawal = 30-day wait. → [wowok-arbitrator](../wowok-arbitrator/SKILL.md) |
157
+ | `guard` | `root.type:"node"` (inline) or `"file"` (JSON/MD). MAX 4 `rely`. `rep:false` Guards excluded from others' `rely`. System addresses `0xaab`/`0xaaa` need table entries. → [wowok-guard](../wowok-guard/SKILL.md) |
158
+ | `gen_passport` | MAX 20 Guards/call (AND-ed). Omit `info` to auto-fetch. Passport = frozen immutable credential. |
159
+ | `order` | Agents can operate but **cannot withdraw** — only builder. `order.progress`+Guard requires Passport. Arb via `order.arb_confirm`/`arb_objection` (not `arbitration` directly). `arb_claim_compensation` once-only. → [wowok-order](../wowok-order/SKILL.md) |
160
+ | `payment` | `type_parameter` required. **Irreversible** — no refund. |
161
+ | `personal` | **Permanently public** — warn users before writing sensitive data. |
162
+ | `demand` | Guard-gated: `guards` filter presenters. Separate from Service. |
163
+ | `treasury` | Guardable deposits/withdrawals. Each entry creates Payment record for audit. |
164
+ | `repository` | Composite key: `name + entity`. Guard validates writer + content. |
165
+ | `reward` | `guard_add`: `Fixed` (equal) or `GuardU64Identifier` (dynamic). `guard_expiration_time` freezes Guard list; `null` removes. |
166
+ | `allocation` | Auto-executes on Progress advance. Order: Amount → Rate → Surplus, first-Guard-wins per mode. |
167
+ | `contact` | Bridge: Service `um` Messenger `ims[]`. IM mutations need permission index 453; no events (poll `ims[]`). |
168
+ | `permission` | 0–999 reserved; custom ≥1000. SDK rejects <1000. Reusable across objects. |
169
+ | `proof` | Immutable (freeze_object). `proof_type=1` reserved for WTS; >100 for custom. Large data → Repository + `about_address`, not inline. |
170
+ | `gen_proof` | Convenience wrapper: creates Proof without `namedNew`. Same immutability rules. Use `proof` with `namedNew` when naming is needed. |
171
+
172
+ **WIP hash anti-bait**: Capture `sale.wip_hash` when browsing; pass in `buy.items[].wip_hash`. Two-layer: SDK verifies file hash off-chain, Move asserts on-chain. Merchant swap = order fails.
173
+
174
+ ### Other Tools (compact)
175
+
176
+ | Tool | Key Constraints |
177
+ |------|----------------|
178
+ | `query_toolkit` | `token_list` cached (first query populates). `account_balance`: `balance=true` for totals, `coin={cursor,limit}` for paginated. `onchain_objects` batches 50/req. `local_names` resolves accounts + marks. |
179
+ | `onchain_table_data` | 12 types. Global (no `parent`): `entity_registrar`, `entity_linker`. `onchain_table_item_generic` = universal fallback. |
180
+ | `account_operation` | `faucet` testnet/localnet only. Mainnet funding: `transfer` from existing account (1 WOW = 10^9 base units). `gen` with `m` enables Messenger. Private keys never leave device. |
181
+ | `local_mark_operation` | Max 50 tags/entry (64 chars). `replaceExistName:true` steals names — prefer `_v1`/`_v2`. |
182
+ | `local_info_operation` | Max 50 contents/entry, 300 chars each. |
183
+ | `messenger_operation` | Stranger: 1 msg before reply (~480 chars). Guard block → rejection includes guard list; sender needs Passport. WTS: `generate` needs continuous sequences. → [wowok-messenger](../wowok-messenger/SKILL.md) |
184
+ | `wip_file` | `verify`: hash → signatures stepwise. `wip2html`: single file or directory. |
185
+ | `guard2file` | Read-only export to JSON/Markdown. |
186
+ | `machineNode2file` | Read-only; exports complete topology. |
187
+ | `onchain_events` | 6 event types; cursor `{eventSeq, txDigest}`. |
188
+ | `wowok_buildin_info` | 5 info types. Guard instructions filter by `name`/`return_type`/`param_count`. **Never use Value type 19**. |
189
+ | `schema_query` | `list` returns empty if schemas not generated → `npm run generate:schemas`. |
179
190
 
180
191
  ---
181
192
 
182
- ### 2. `query_toolkit`Read (Local + On-Chain)
193
+ ## Supporting ObjectsWhen to Use
183
194
 
184
- 9 query types. Schema-inexpressible: `token_list` is **cached** (populated on first query). `account_balance` dual-mode: `balance=true` for totals, `coin={cursor,limit}` for paginated coin objects. `onchain_objects` batches 50/request internally. `local_names` resolves to account names AND local marks simultaneously.
195
+ > MCP handles risk assessment + confirmation rules automatically. This section covers business decisions NOT in schemas WHEN and WHY to choose each object type.
185
196
 
186
- ### 3. `onchain_table_data` — Dynamic Table Queries
197
+ ### Proof vs WIP
187
198
 
188
- 12 query types. **Global** (no `parent`): `entity_registrar`, `entity_linker`. All others require `parent`. `onchain_table_item_generic` accepts arbitrary key types — universal fallback for custom objects.
199
+ | Aspect | Proof (on-chain) | WIP (off-chain file) |
200
+ |--------|-----------------|---------------------|
201
+ | Purpose | Cryptographic attestation (merkle root, server signature, timestamp) | Product description + images for arbitration evidence |
202
+ | Immutability | `freeze_object` — permanent on-chain record | File hash anchored on-chain; file stored off-chain |
203
+ | Size | `MAX_PROOF_SIZE` (compact digests only) | Unlimited (file-based) |
204
+ | Use when | Need on-chain timestamp + signature verification | Need product evidence for order disputes |
189
205
 
190
- ### 4. `account_operation` Wallet (ALL LOCAL)
206
+ `gen_proof` = convenience (no `namedNew` wrapper). `proof` with `namedNew` = named object for reuse by reference. For large data, store in Repository and set `about_address` to the Repository ID.
191
207
 
192
- `faucet` only testnet/localnet. `gen` with `m` enables Messenger. `signData` supports UTF-8/base64/hex. `get` with `balance_required` splits existing coins (no minting). Private keys never leave the device.
208
+ ### Treasury vs Allocation
193
209
 
194
- **Mainnet operations**: `faucet` is unavailable on mainnet. To fund new accounts, use `transfer` from an existing account with sufficient balance:
195
- ```
196
- {"transfer": {"amount": 1000000000, "name_or_address_from": "", "name_or_address_to": "new_account", "network": "mainnet"}}
197
- ```
198
- - 1 WOW (10^9 base units) per account is sufficient for dozens of transactions
199
- - `name_or_address_from: ""` uses the default account
200
-
201
- ### 5. `local_mark_operation` — Address Book (ALL LOCAL)
202
-
203
- Max 50 tags/entry (64 chars each). `replaceExistName:true` steals existing names — prefer versioned names (`_v1`, `_v2`).
210
+ | Aspect | Treasury | Allocation |
211
+ |--------|----------|------------|
212
+ | Purpose | Team fund management (deposit/withdraw with audit trail) | Order fund distribution (auto-trigger on Progress advance) |
213
+ | Trigger | Manual deposit/withdraw (Guard-gated) | Automatic when Progress reaches configured node |
214
+ | Guard | External guard on withdrawals | Allocation guard on distribution rules |
215
+ | Use when | Holding pooled funds, compensation funds, team wallets | Splitting order payments among recipients |
204
216
 
205
- ### 6. `local_info_operation` Private Data (ALL LOCAL)
217
+ Compensation fund = Treasury bound to Service. Each Treasury entry creates a Payment record for audit. Withdrawal requires Guard verification.
206
218
 
207
- Max 50 contents/entry, 300 chars each.
219
+ ### Reward (Incentive Pools)
208
220
 
209
- ---
221
+ Guard-gated claim pools: `claim_guard` verifies eligibility before payout. `guard_add` modes: `Fixed` (equal split among claimants) or `GuardU64Identifier` (dynamic amount from Guard table index). `guard_expiration_time` freezes the Guard list (set `null` to remove freeze). Use cases: customer loyalty rewards, referral bonuses, airdrop campaigns, attendance rewards. Query claim history via `query_toolkit` → `onchain_table_item_reward_record`.
210
222
 
211
- ### 7. `messenger_operation` — Encrypted Messaging
223
+ ### Demand (Customer-Posted Requests)
212
224
 
213
- **Stranger rules** (not in schema): 1 message before reply required (max ~480 chars); reply auto-adds stranger to friends; cool-down window after rejection.
225
+ Demand is the **inverse** of Service: customer posts a request + optional reward pool, providers submit offers. Guard-gated: `guards` filter which providers can present. `recommend_guard` filters presenter submissions. Separate `operation_type: "demand"` — NOT `service`. Use when: customer needs competitive bids (custom work, bulk procurement, reverse-auction marketplace). Pair with Reward to incentivize providers.
214
226
 
215
- **Guard flow** (not in schema): When guard blocks a stranger message, rejection reply includes guard list — sender must obtain valid Passport to resend.
227
+ ### Repository (On-Chain Database)
216
228
 
217
- **WTS** (not in schema): `generate` requires continuous sequences (gaps break chain). `verify` `sign` `wts2html` pipeline. `proof_message` anchors to blockchain. Full design [wowok-messenger](../wowok-messenger/SKILL.md).
229
+ Composite key: `name + entity`. Guard validates writer identity + content integrity. `id_from_submission` (must be Address) and `data_from_submission` (must match Repository's `value_type`) extract structured data from Guard submissions. Use cases: supply-chain tracking, multi-party attestation, dynamic pricing data, KYC registries. MAX 50 policies per Repository, 100 IDs per operation. Guard design: see [wowok-guard](../wowok-guard/SKILL.md) §"Where Guards Attach".
218
230
 
219
- ---
231
+ ### Contact (Service.um Bridge)
220
232
 
221
- | # | Tool | Schema-Inexpressible |
222
- |---|------|---------------------|
223
- | 8 | `wip_file` | `verify` checks hash → signatures stepwise. `wip2html` accepts single file or directory. |
224
- | 9 | `guard2file` | Read-only export to JSON/Markdown. |
225
- | 10 | `machineNode2file` | Read-only; exports complete topology. |
226
- | 11 | `onchain_events` | 6 event types; paginated via cursor `{eventSeq, txDigest}`. |
227
- | 12 | `wowok_buildin_info` | 5 info types. Guard instructions filter by `name`/`return_type`/`param_count`. **Never use Value type 19** (internal, SDK rejects). |
228
- | 13 | `schema_query` | `list` returns empty if schemas not generated → run `npm run generate:schemas`. |
233
+ Contact is the on-chain bridge: `Service.um` → `Contact` → `ims[]` (Messenger endpoints). Create BEFORE Service publish when `customer_required` is set. Contact can also bind to `Permission.um` (bidirectional dependency — clear `Permission.um` via `permission_um_set(null)` before deleting Contact). IM list mutations (`im_add`/`im_remove`) require permission index 453; no events emitted (poll `ims[]` field). Full Messenger integration: see [wowok-messenger](../wowok-messenger/SKILL.md).
229
234
 
230
235
  ---
231
236
 
@@ -250,41 +255,7 @@ Discover? → tool: "schema_query" / "wowok_buildin_info" / "onchain_events"
250
255
 
251
256
  ## Examples Reference
252
257
 
253
- The deployment package includes 5 complete examples in the `examples/` directory. These serve as reference implementations to help explain concepts and demonstrate patterns to users.
254
-
255
- ### Matching User Intent to Examples
256
-
257
- When a user describes their needs, reference the appropriate example to illustrate the approach:
258
-
259
- | User Intent | Example | Complexity | Key Techniques Demonstrated |
260
- |-------------|---------|------------|----------------------------|
261
- | Simple service with time-lock | Insurance | ⭐ Low | Two-node workflow, convert_witness, time-lock Guard |
262
- | E-commerce store setup | MyShop | ⭐⭐ Medium | Four-node workflow, Permission indexes, Messenger integration, discounts |
263
- | Complex multi-path order flow | MyShop_Advanced | ⭐⭐⭐ High | 11+ nodes, dual-signature (threshold=2), Merkle Root verification, Reward pool |
264
- | Weather/data validation service | Travel | ⭐⭐⭐ High | Repository queries, convert_number_address, supply chain sub-orders |
265
- | Signature/authorization service | ThreeBody_Signature | ⭐ Low | Buy Guard for access control, Machine-Service binding |
266
-
267
- ### Finding Examples by Technique
268
-
269
- When explaining a specific technique to users, reference where it appears:
270
-
271
- | Technique | Example | Location |
272
- |-----------|---------|----------|
273
- | convert_witness: 100 (Order to Progress) | Insurance, Travel | Insurance Step 2 |
274
- | Repository data query Guard | Travel | Step 3.1 |
275
- | Dual-signature (threshold=2) | MyShop_Advanced | Lost/Return nodes |
276
- | Reward pool with Guard verification | MyShop_Advanced | reward_wonderful_v2 Guards |
277
- | Buy Guard (restricting purchasers) | ThreeBody_Signature | Step 2 |
278
- | Discount coupons | MyShop | Step 8 |
279
- | Arbitration with voting_guard | MyShop_Advanced | Step 9 |
280
- | Time-lock Guard | Insurance, Travel | Step 2 / Step 3.2 |
281
-
282
- ### How to Use Examples with Users
283
-
284
- 1. **Assess complexity** — Match user requirements to the appropriate complexity level
285
- 2. **Reference the example** — Show users the relevant example path and explain which techniques it demonstrates
286
- 3. **Extract patterns** — Use JSON snippets from examples as templates to help users understand the structure
287
- 4. **Reference test results** — Each example includes `*_TestResults.md` with real testnet execution results for troubleshooting
258
+ 5 examples in `examples/` directory: **Insurance** (⭐ time-lock Guard), **MyShop** (⭐⭐ e-commerce, Messenger, discounts), **MyShop_Advanced** (⭐⭐⭐ 11+ nodes, dual-sig, Merkle Root, Reward), **Travel** (⭐⭐⭐ Repository Guard, supply chain), **ThreeBody_Signature** (⭐ Buy Guard). Each includes `*_TestResults.md` with real testnet data. Match user intent example complexity → extract JSON patterns.
288
259
 
289
260
  ---
290
261
 
@@ -305,13 +276,3 @@ When explaining a specific technique to users, reference where it appears:
305
276
  | Arbitration called directly | Customer path: `order.arb_confirm` / `order.arb_objection`. Order is the interface |
306
277
 
307
278
  ---
308
-
309
- ## Appendices (Progressive Disclosure)
310
-
311
- > The following sections have been extracted to [APPENDIX.md](./APPENDIX.md) for on-demand loading:
312
- > - Dialogue Scripts (R1-R10) — guided conversation scripts
313
- > - Decision Trees — branching logic reference
314
- > - Failure Playbooks — recovery scenarios
315
- > - Tier Layering — expertise-tier based guidance
316
- >
317
- > Load APPENDIX.md when the user needs guided dialogue, recovery help, or tier-specific guidance.