@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
@@ -48,7 +48,7 @@ Allocation evaluates when Progress reaches **any** configured node (not just exi
48
48
 
49
49
  ### E1 — Service Basic Status
50
50
 
51
- Query `query_toolkit` → `onchain_objects` for `<service_name_or_id>`. Fields in schema. Save: `bPublished`, `bPaused`, `sales`, `machine`, `buy_guard`, `customer_required`, `arbitrations`, `compensation_fund`, `compensation_lock_duration`, `order_allocators`, `um`.
51
+ Query `query_toolkit` → `onchain_objects` for `<service_name_or_id>`. Save: `bPublished`, `bPaused`, `sales`, `machine`, `buy_guard`, `customer_required`, `arbitrations`, `compensation_fund`, `compensation_lock_duration`, `order_allocators`, `um`.
52
52
 
53
53
  - `bPublished === false` → 🔴 **ABORT**
54
54
  - `bPaused === true` → 🔴 **ABORT**
@@ -130,7 +130,7 @@ Guard structure and instruction reference: [wowok-guard](../wowok-guard/SKILL.md
130
130
 
131
131
  ### E5 — Fund Allocation Rules
132
132
 
133
- From E1 `order_allocators.allocators[]`. Fields in schema. For each Allocator: cross-reference Guard (E4) → trigger condition; map to Machine node (E3) → when it fires; present distribution outcome.
133
+ From E1 `order_allocators.allocators[]`. For each Allocator: cross-reference Guard (E4) → trigger condition; map to Machine node (E3) → when it fires; present distribution outcome.
134
134
 
135
135
  **Risk Rules**:
136
136
 
@@ -147,7 +147,7 @@ From E1 `order_allocators.allocators[]`. Fields in schema. For each Allocator: c
147
147
 
148
148
  ### E6 — Arbitration Availability
149
149
 
150
- Batch query E1 `arbitrations[]` via `onchain_objects`. Fields in schema. Arb process: [wowok-arbitrator](../wowok-arbitrator/SKILL.md).
150
+ Batch query E1 `arbitrations[]` via `onchain_objects`. Arb process: [wowok-arbitrator](../wowok-arbitrator/SKILL.md).
151
151
 
152
152
  Also: `onchain_events` → `type: "ArbEvent"`, `limit: 20`, filter for these Arb IDs.
153
153
 
@@ -159,7 +159,7 @@ Also: `onchain_events` → `type: "ArbEvent"`, `limit: 20`, filter for these Arb
159
159
 
160
160
  ### E7 — Compensation Fund
161
161
 
162
- From E1: `compensation_fund`, `compensation_lock_duration`. Balance type in schema.
162
+ From E1: `compensation_fund`, `compensation_lock_duration`.
163
163
 
164
164
  - Balance < planned order amount → ⚠️ may not cover award
165
165
  - Lock near expiry → ⚠️ provider may withdraw
@@ -168,7 +168,7 @@ From E1: `compensation_fund`, `compensation_lock_duration`. Balance type in sche
168
168
 
169
169
  ### E8 — Contact Channel
170
170
 
171
- Query `onchain_objects` for E1 `um` ID. Contact fields in schema.
171
+ Query `onchain_objects` for E1 `um` ID.
172
172
 
173
173
  - `um === null` → 🔴 **ABORT**
174
174
  - `ims[]` empty → 🔴 **No Messenger**
@@ -178,7 +178,7 @@ Query `onchain_objects` for E1 `um` ID. Contact fields in schema.
178
178
 
179
179
  ### E9 — Chain Reputation
180
180
 
181
- **Sentiment**: `query_toolkit` → `onchain_table_item_entity_linker` for provider address. Compute likes/dislikes ratio from `votes[]` (fields in schema).
181
+ **Sentiment**: `query_toolkit` → `onchain_table_item_entity_linker` for provider address. Compute likes/dislikes ratio from `votes[]`.
182
182
 
183
183
  **Orders**: Batch query `votes[].address` via `onchain_objects` (50/batch, max 200). Filter Order-type objects where `service` matches. Aggregate dispute rate (`dispute ≠ []` / total) and repeat buyer ratio.
184
184
 
@@ -198,28 +198,9 @@ For matched: present value, ask "correct?" and "OK to send?". For missing: ask u
198
198
 
199
199
  ### Pre-Purchase GATE
200
200
 
201
- ```
202
- ┌──────────────────────────────────────────────────────┐
203
- │ PRE-PURCHASE GATE │
204
- ├──────────┬───────────────────────────────────────────┤
205
- │ E1 │ Service Status [ ] OK [ ] ⚠️ │
206
- │ E2 │ Product & WIP [ ] OK [ ] ⚠️ │
207
- │ E3 │ Machine Workflow [ ] OK [ ] ⚠️ │
208
- │ E4 │ Guards Logic [ ] OK [ ] 🔴 │
209
- │ E5 │ Fund Allocation [ ] OK [ ] ⚠️ │
210
- │ E6 │ Arbitration [ ] OK [ ] ⚠️ │
211
- │ E7 │ Compensation Fund [ ] OK [ ] ⚠️ │
212
- │ E8 │ Contact Channel [ ] OK [ ] ⚠️ │
213
- │ E9 │ Chain Reputation [ ] OK [ ] ⚠️ │
214
- │ E10 │ Privacy Info Match [ ] OK [ ] ⚠️ │
215
- ├──────────┴───────────────────────────────────────────┤
216
- │ ⛔ E1 bPublished=false / E8 um=null → ABORT │
217
- │ ⛔ E3 no-refund + E6 no-arb → strongly advise ABORT │
218
- │ ⛔ E4 ambiguous Guards → user MUST manually review │
219
- │ ⛔ Any ⚠️ → explain risk, wait for user decision │
220
- │ ✅ All OK → Phase 2 │
221
- └──────────────────────────────────────────────────────┘
222
- ```
201
+ **Abort conditions**: E1 `bPublished=false`/`bPaused=true` → ABORT; E8 `um=null` → ABORT; E3 no-refund + E6 no-arb → strongly advise ABORT; E4 ambiguous Guards → user MUST manually review.
202
+
203
+ **Any ⚠️** → explain risk, wait for user decision. **All OK** → Phase 2.
223
204
 
224
205
  ---
225
206
 
@@ -245,8 +226,6 @@ Clarify via Messenger: deliverables (E2 WIP), timeline (E3 nodes), refund/cancel
245
226
 
246
227
  ## Phase 3: Order Creation
247
228
 
248
- Schema: `wowok({ tool: "schema_query", data: { action: "get", name: "onchain_operations_service" } })`. Safety: [wowok-safety](../wowok-safety/SKILL.md).
249
-
250
229
  **Not in schema**:
251
230
  - Excess `buy.total_pay` auto-refunded. Agents cannot withdraw.
252
231
  - Discounts: query `onchain_received` (type `0x2::service::Discount`), filter by `service`, validate time/benchmark. Rate: `total_pay × (off / 10000)`. Fixed: `min(off, total_pay)`.
@@ -257,8 +236,6 @@ Post-creation: notify via Messenger with order ID.
257
236
 
258
237
  ## Phase 4: Order Operations
259
238
 
260
- Schema: `wowok({ tool: "schema_query", data: { action: "get", name: "onchain_operations_order" } })`.
261
-
262
239
  ### Progress Advancement
263
240
 
264
241
  When user reaches a node, AI MUST cross-reference Phase 1:
@@ -277,7 +254,7 @@ Present all three dimensions. Never just the operation name.
277
254
 
278
255
  ## Phase 5: Arbitration
279
256
 
280
- Schema: `wowok({ tool: "schema_query", data: { action: "get", name: "onchain_operations_arbitration" } })`. Process: [wowok-arbitrator](../wowok-arbitrator/SKILL.md).
257
+ Process: [wowok-arbitrator](../wowok-arbitrator/SKILL.md).
281
258
 
282
259
  Flow: `arbitration.dispute` → WTS evidence → Messenger → `order.arb_confirm` → voting → (`order.arb_objection`) → `order.arb_claim_compensation`.
283
260
 
@@ -287,145 +264,30 @@ Flow: `arbitration.dispute` → WTS evidence → Messenger → `order.arb_confir
287
264
 
288
265
  ## Fund Management
289
266
 
290
- Schema: `onchain_operations_order`. Builder-only operations: `order.transfer_to` (ownership), `order.receive` (withdraw — agents can execute, only builder receives).
267
+ Builder-only operations: `order.transfer_to` (ownership), `order.receive` (withdraw — agents can execute, only builder receives).
291
268
 
292
269
  ---
293
270
 
294
- ## Phase 3: Customer Intelligence (Optional Enhancement)
295
-
296
- > **When to use**: When `customer_intelligence` runtime service is enabled (default ON), the MCP server automatically populates `semantic.customer_advice` in order/query operations. This is a layer ON TOP of E1-E10 — never a replacement for due diligence.
297
-
298
- ### Information Puzzle (6 dimensions)
299
-
300
- E1-E10 captures static facts. The information puzzle assembles them into a dynamic, evolving picture that gets richer with every query:
301
-
302
- | Dimension | Source | Fragments |
303
- |-----------|--------|-----------|
304
- | Service basics | E1 query | publish/pause/price/sales/WIP |
305
- | Workflow structure | E3 machineNode2file | nodes/forwards/user-operable/refund path |
306
- | Fund safety | E5 + E7 | allocators/compensation/price anomaly |
307
- | Trust signals | E6 + E9 | arbitration/reviews/dispute rate |
308
- | Merchant behavior | onchain_events | completion rate/trend/refund rate |
309
- | Market context | batch query_toolkit | similar services/price distribution |
310
-
311
- **Incremental collection**: Don't fetch all 6 every time. Browse = dim 1+6, Evaluate = +2/3/4, Preorder = +5, Monitoring = 2+5.
312
-
313
- ### Risk Scoring (4 dimensions, 100 points)
314
-
315
- E1-E10 produces ⚠️/🔴 flags. Risk scoring converts them to a quantitative score:
316
-
317
- | Dimension | Max | Key checks |
318
- |-----------|-----|------------|
319
- | Workflow | 35 | refund path / arbitration path / user-operable / dead ends |
320
- | Fund | 25 | compensation coverage / allocator fairness / price anomaly / lock duration |
321
- | Trust | 20 | arbitration independence / dispute rate / reputation / trust score |
322
- | Behavior | 20 | completion trend / response time / refund rate / arb loss rate / anomalies |
323
-
324
- **Levels**: 🟢 ≥85 low | 🟡 70-84 medium-low | 🟠 50-69 medium-high | 🔴 <50 high (advise against)
325
-
326
- ### User Preference Matching (7 dimensions, 100 points)
327
-
328
- When the user has 3+ historical orders, the system infers preferences and scores each Service:
329
-
330
- | Dimension | Max | What it measures |
331
- |-----------|-----|------------------|
332
- | Price | 25 | budget fit or market avg comparison |
333
- | Time | 15 | cycle ≤ max_acceptable_cycle |
334
- | Region | 10 | preferred_region match |
335
- | Brand | 10 | min_order_history + merchant age |
336
- | Bargain | 15 | reward/discount presence |
337
- | Emotion | 10 | after_sales_expectation + transparency |
338
- | Risk | 15 | risk_score ≥ min_trust_score + arb/comp requirements |
339
-
340
- **Score ≥ 75** = strong match. **< 50** = significant mismatch. The `matches`/`mismatches` arrays explain the score so you can present tradeoffs to the user.
341
-
342
- ### Reminder System (6 stages, 4 priorities)
343
-
344
- Reminders are populated in `semantic.customer_advice.reminders` based on the operation stage:
271
+ ## Phase 3: Customer Intelligence (MCP-Handled)
345
272
 
346
- | Stage | When | Example reminders |
347
- |-------|------|-------------------|
348
- | browse | query_toolkit on Service | reviews summary / price anomaly / no arb / no comp |
349
- | evaluate | deeper analysis | checklist / high risk (required) / ambiguous guard (required) / no refund path |
350
- | preorder | order creation | payment confirm (required) / compensation insufficient / arb missing (required) |
351
- | in_progress | order monitoring | progress stalled / compensation drop / messenger unanswered |
352
- | complete | order done | review reminder / review window |
353
- | after_sale | post-purchase | arb window / refund received |
273
+ > **MCP auto-populates `semantic.customer_advice`** in order/query responses when `customer_intelligence` is ON (default). Read these fields from MCP output — do NOT recompute internally.
354
274
 
355
- **Priority order**: `required` (blocks purchase) > `recommended` (strong caution) > `info` (advisory) > `reminder` (timed nudge). Fatigue control: max 3 high-risk reminders per response.
356
-
357
- ### Game Strategy Quick Reference (8 scenarios)
358
-
359
- When the user faces a specific negotiation, refer to the strategy matrix:
360
-
361
- | Scenario | Merchant tactic | User strategy |
362
- |----------|------------------|---------------|
363
- | Info asymmetry | Hides Machine details | Demand machineNode2file export + Messenger Q&A |
364
- | Fund safety | No/low compensation | Require 100% coverage + WTS agreement |
365
- | Refund dispute | No refund path | Demand 100%→Order Allocator + Messenger terms |
366
- | Arb fairness | Self-built arbitration | Verify arb owner via query_toolkit |
367
- | Pricing | Price >120% market avg | Reference market_context.avg_price + request discount/Reward |
368
- | Delivery SLA | No milestone nodes | Require milestone config + written timeline |
369
- | Quality | WIP hash unverified | Require WIP verify + sample/staged delivery |
370
- | After-sales | No Messenger | Require Messenger config + written after-sales terms |
275
+ **Key fields in `semantic.customer_advice`**:
276
+ - `reminders[]`: stage-aware reminders with priority (`required` blocks purchase; `recommended` = strong caution; `info` = advisory; `reminder` = timed nudge)
277
+ - `risk_score`: 0-100 (🟢≥85 low | 🟡70-84 | 🟠50-69 | 🔴<50 high — advise against purchase)
278
+ - `preference_match`: 0-100 score with `matches`/`mismatches` arrays (≥75 strong match, <50 significant mismatch)
371
279
 
372
280
  **Red lines** (do not purchase): no arb + no refund path, OR compensation_ratio < 0.5.
373
281
 
374
- ### Industry Personalization (6 industries)
375
-
376
- Each industry has specific risk checks and preference templates:
377
-
378
- | Industry | Cycle (days) | Response (h) | Arb | Comp | Risk appetite | Delivery |
379
- |----------|--------------|--------------|-----|------|---------------|----------|
380
- | freelance | 30 | 4 | ✓ | ✓ | balanced | normal |
381
- | rental | 7 | 8 | ✓ | ✓ | conservative | normal |
382
- | education | 90 | 24 | ✓ | ✓ | conservative | flexible |
383
- | travel | 14 | 2 | ✓ | ✓ | conservative | urgent |
384
- | subscription | 30 | 24 | – | – | aggressive | normal |
385
- | retail | 7 | 8 | ✓ | ✓ | balanced | normal |
386
-
387
- **Industry-specific risks**: freelance checks WIP verified + milestone nodes; rental checks compensation coverage + lock duration; travel checks urgent delivery + Messenger; subscription checks no-lockin + user-operable; etc.
388
-
389
- ### Post-Purchase Support (4 phases)
390
-
391
- When the order is in progress or completed, post-purchase support covers:
392
-
393
- - **Refund tracking**: monitor refund Allocator triggers, check refunded vs order amount
394
- - **Quality issue**: WIP hash mismatch detection + evidence collection (≥3 items recommended)
395
- - **Merchant unreachable**: >3 days warning, >7 days arbitration advice (if available)
396
- - **Arbitration support**: evidence collection → application template → progress monitoring → result interpretation
282
+ **Post-purchase**: monitor refund Allocator triggers, WIP hash mismatch, merchant unreachable (>3d warning, >7d arb advice), evidence collection (≥3 items).
397
283
 
398
- ### Runtime Service Toggles
399
-
400
- Use `config_operation` to toggle Phase 3 services at runtime:
401
-
402
- | Service | Default | What it controls |
403
- |---------|---------|------------------|
404
- | `customer_intelligence` | ON | Populates `semantic.customer_advice` (reminders + risk + preference match) |
405
- | `order_monitor` | OFF | Active order monitoring (Progress stall + compensation change + Messenger timeout) |
406
-
407
- Toggle example: `config_operation` → `action: "toggle"`, `service: "order_monitor"` to enable active monitoring when the user has active orders.
284
+ **Runtime toggle**: `config_operation` → `action: "toggle"`, `service: "order_monitor"` (default OFF) to enable active Progress stall + compensation change + Messenger timeout monitoring.
408
285
 
409
286
  ---
410
287
 
411
- ## Quick Reference
412
-
413
- Schemas: `wowok({ tool: "schema_query", data: { action: "get", name: "<name>" } })` for `onchain_operations_service`, `onchain_operations_order`, `onchain_operations_arbitration`, `messenger_operation`, `query_toolkit`, `onchain_table_data`, `wip_file`.
414
-
415
288
  ### Phase Dependency
416
289
 
417
- ```
418
- E1 (Service) ──→ E2 (Products/WIP)
419
- │ │
420
- │ ├──→ E8 (Contact) ├──→ E7 (Compensation)
421
- │ ├──→ E10 (Privacy) └──→ E6 (Arbitrations)
422
-
423
- └──→ E3 (Machine) ──→ E4 (Guards) ──→ E5 (Allocators)
424
-
425
- └──→ E9 (Reputation)
426
- ```
427
-
428
- > E3→E4→E5 is a strict chain. E6-E10 run in parallel after E1.
290
+ E1 (Service) → E2 (Products/WIP), E8 (Contact), E10 (Privacy), E7 (Compensation), E6 (Arbitrations) run in parallel after E1. E3 (Machine) → E4 (Guards) → E5 (Allocators) is a strict chain. E9 (Reputation) follows E3.
429
291
 
430
292
  ### ⚠️ Critical Attention Items
431
293
 
@@ -437,14 +299,3 @@ E1 (Service) ──→ E2 (Products/WIP)
437
299
  6. **Phase 3 customer_advice** — when `customer_intelligence` is ON, read `semantic.customer_advice` first in every order/query response. The `reminders` array is pre-sorted by priority; `required` items block purchase.
438
300
 
439
301
  ---
440
-
441
- ## Appendices (Progressive Disclosure)
442
-
443
- > The following sections have been extracted to [APPENDIX.md](./APPENDIX.md) for on-demand loading:
444
- > - Dialogue Scripts (R1-R10) — guided conversation scripts
445
- > - Decision Trees — branching logic reference
446
- > - Failure Playbooks — recovery scenarios
447
- > - Tier Layering — expertise-tier based guidance
448
- > - Phase 3 Integration — information puzzle + risk scoring + preference matching + game strategy + post-purchase playbook
449
- >
450
- > Load APPENDIX.md when the user needs guided dialogue, recovery help, or tier-specific guidance.
@@ -146,13 +146,3 @@ When user asks about field meanings:
146
146
  | [wowok-messenger](../wowok-messenger/SKILL.md) | Encrypted communication |
147
147
 
148
148
  ---
149
-
150
- ## Appendices (Progressive Disclosure)
151
-
152
- > The following sections have been extracted to [APPENDIX.md](./APPENDIX.md) for on-demand loading:
153
- > - Dialogue Scripts (R1-R10) — guided conversation scripts
154
- > - Decision Trees — branching logic reference
155
- > - Failure Playbooks — recovery scenarios
156
- > - Tier Layering — expertise-tier based guidance
157
- >
158
- > Load APPENDIX.md when the user needs guided dialogue, recovery help, or tier-specific guidance.
@@ -62,12 +62,32 @@ A confirmed ODG JSON document (see §ODG Data Structure) with: scenario tag, com
62
62
 
63
63
  ---
64
64
 
65
- ## Appendices (Progressive Disclosure)
66
-
67
- > The following sections have been extracted to [APPENDIX.md](./APPENDIX.md) for on-demand loading:
68
- > - Dialogue Scripts (R1-R10) — guided conversation scripts
69
- > - Decision Trees — branching logic reference
70
- > - Failure Playbooks — recovery scenarios
71
- > - Tier Layering — expertise-tier based guidance
72
- >
73
- > Load APPENDIX.md when the user needs guided dialogue, recovery help, or tier-specific guidance.
65
+ ## ODG Data Structure
66
+
67
+ The ODG (Object Dependency Graph) is the single output artifact, persisted via `local_info_operation` and consumed by the Harness:
68
+
69
+ ```json
70
+ {
71
+ "task_id": "task_20260714_001",
72
+ "scenario": "freelance",
73
+ "version": 1,
74
+ "status": "confirmed",
75
+ "account": "merchant_v1",
76
+ "objects": [
77
+ { "id": "obj_permission", "type": "permission", "status": "planned", "reversible": true, "dependencies": [], "user_decisions": { "reuse": false, "indexes": { "provider": 1000 } } },
78
+ { "id": "obj_service", "type": "service", "status": "planned", "reversible": true, "dependencies": ["obj_permission"], "user_decisions": { "name": "...", "publish": "deferred" } },
79
+ { "id": "obj_machine", "type": "machine", "status": "planned", "reversible": false, "dependencies": ["obj_permission"], "user_decisions": { "nodes": [...], "forwards": [...], "publish": "deferred" } },
80
+ { "id": "obj_arbitration", "type": "arbitration", "status": "planned", "reversible": true, "dependencies": [], "user_decisions": { "voting_guard_count": 3, "fee_balance": "1000 WOW", "note": "arbiters live in voting_guard, NOT Permission index 1500" } }
81
+ ],
82
+ "phases": [
83
+ { "phase": 1, "objects": ["obj_permission"], "gate": "user_confirm" },
84
+ { "phase": 2, "objects": ["obj_service", "obj_machine", "obj_arbitration"], "gate": "risk_check" },
85
+ { "phase": 3, "objects": ["obj_guard_*"], "gate": "passport_test" },
86
+ { "phase": 4, "objects": ["obj_allocator_*"], "gate": "allocation_audit" },
87
+ { "phase": 5, "objects": ["publish"], "gate": "final_audit" }
88
+ ],
89
+ "risk_assessment": { "critical": [], "warnings": [], "irreversible_count": 1 }
90
+ }
91
+ ```
92
+
93
+ Each object has: `id`, `type`, `status` (planned/created/published), `reversible` (true/false), `dependencies` (other object IDs), `user_decisions` (typed fields). Phases gate progression — `risk_check` calls `aggregate_risks`, `final_audit` calls `generate_deployment_doc` + `trace_substeps`.
@@ -22,7 +22,23 @@ when_to_use:
22
22
  # WoWok Service Provider Guide
23
23
 
24
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), [wowok-tools](../wowok-tools/SKILL.md) (MCP tools)
25
+ > **Related Skills**: [wowok-order](../wowok-order/SKILL.md) (customer), [wowok-machine](../wowok-machine/SKILL.md) (workflow), [wowok-messenger](../wowok-messenger/SKILL.md) (communication), [wowok-distill](../wowok-distill/SKILL.md) (distillation review)
26
+
27
+ ---
28
+
29
+ ## MCP Knowledge Layer
30
+
31
+ The following rule tables have been pushed down to the MCP knowledge layer and are automatically applied during project operations. You do NOT need to manually check these — the MCP server enforces them.
32
+
33
+ | Rule Category | MCP Knowledge Module | Applied By |
34
+ |---------------|---------------------|------------|
35
+ | Safety rules (confirmation, immutability, object reuse) | `knowledge/safety-rules.ts` | `aggregate_risks` + `onchain_operations` pre-publish |
36
+ | Guard design patterns | `knowledge/guard-design-patterns.ts` | `aggregate_risks` (guard risk assessment) |
37
+ | Machine topology rules | `knowledge/machine-risk.ts` | `aggregate_risks` (machine risk assessment) |
38
+ | Scenario mode defaults | `knowledge/scenario-modes.ts` | `analyze_intent` (pass `industry` parameter) |
39
+ | Tool reference (gas, faucet, wrappers) | `knowledge/tools-reference.ts` | All tool calls automatically |
40
+
41
+ **How to use**: Call `project_operation` with `action: "aggregate_risks"` after completing your puzzle — the MCP server will automatically apply all relevant safety rules and return risk findings.
26
42
 
27
43
  ---
28
44
 
@@ -112,7 +128,7 @@ STEP 2: Trust Layer
112
128
  - Allocator guard → pass/fail only
113
129
  - Machine forward guard → if retained_submission is used, ensure b_submission:true entries match expected types
114
130
  - Reward guard → pass/fail only
115
- Full design reference: [wowok-guard](../wowok-guard/SKILL.md)
131
+ Guard design patterns: MCP `knowledge/guard-design-patterns.ts` (auto-applied via `aggregate_risks`)
116
132
 
117
133
  STEP 3: Business Logic (MODIFY)
118
134
  ├── Machine — bind Guards to forwards
@@ -165,8 +181,7 @@ STEP 5: Post-Publish (MODIFY Service — mutable after publish)
165
181
 
166
182
  ### Service Object Relationships
167
183
 
168
- > **Authoritative source**: [Object Collaboration Diagram](../references/object-collaboration.md) §1 (22-object collaboration DAG, 83 relationships).
169
- > This tree is a simplified view. Cross-reference the above for the full graph and [Object Boundary Conditions](../references/object-collaboration.md#boundary-conditions) for mutability rules.
184
+ > **Boundary conditions**: Use MCP `project_operation` with action `get_reversibility` to query the full 22-object lifecycle reversibility matrix (mutability, prerequisites, capacity limits, irreversibility). Key rules: Service/Machine are IMMUTABLE after publish; Payment is FROZEN at creation; Order/Progress/Arbitration operations are irreversible.
170
185
 
171
186
  ```
172
187
  Service (merchant storefront)
@@ -189,10 +204,10 @@ Order (per purchase, runtime-created)
189
204
  ├── arbitration → Arbitration (optional, immutable once set)
190
205
  └── allocation → Fund distribution engine (triggered via Progress.forward)
191
206
 
192
- Cross-object references (see [Object Collaboration Diagram §6](../references/object-collaboration.md#guard-and-machine-global-usage) for Guard/Machine global usage):
207
+ Cross-object references:
193
208
  - Guard is referenced by 9 object types (Service.buy_guard, Machine.forward.guard, Allocation.allocation_guard, Arbitration.voting_guard, Reward.claim_guard, Repository.write_guard, Treasury.external_guard, Demand.recommend_guard, Passport.guard)
194
209
  - Machine is referenced by 4 object types (Service.machine, Order.machine, Progress.machine, Order snapshot)
195
- - Permission is the central hub — 11 objects hold BuiltinPermissionIndex (see [Object Collaboration Diagram §5](../references/object-collaboration.md#permission-reverse-reference-table) for reverse-reference table)
210
+ - Permission is the central hub — 11 objects hold BuiltinPermissionIndex
196
211
  ```
197
212
 
198
213
  ### Allocators + Machine Integration
@@ -264,41 +279,66 @@ Attach: wowok({ tool: "onchain_operations", data: { operation_type: "service", .
264
279
 
265
280
  ---
266
281
 
267
- ## Order Fulfillment
282
+ ## Project Iteration: Fork vs In-Place
268
283
 
269
- | Object | Purpose | Operation |
270
- |--------|---------|-----------|
271
- | Order | Fund escrow | Read-only |
272
- | **Progress** | Workflow state | **Operate this** — `hold: true` (lock) → work → `hold: false` (submit) |
284
+ When a merchant wants to modify an existing service (change workflow, add allocators, update guards), the AI must determine whether to modify the current version (in-place) or fork a new version.
273
285
 
274
- **AI Reminder**: When fulfilling, check `customer_required` fields. Missing → prompt via Messenger.
286
+ ### Decision Rule
275
287
 
276
- ---
288
+ | Scenario | Strategy | MCP Action |
289
+ |----------|----------|------------|
290
+ | Service NOT yet published | **In-place** — modify the current version directly | `onchain_operations` (modify) |
291
+ | Service IS published | **Fork** — create a new version, preserve original as read-only | `project_operation` → `fork_project` |
277
292
 
278
- ## Quick Reference
293
+ ### Fork Workflow
279
294
 
280
- | Purpose | Schema |
281
- |---------|--------|
282
- | Service ops | `onchain_operations_service` |
283
- | Machine ops | `onchain_operations_machine` |
284
- | Guard ops | `onchain_operations_guard` |
285
- | Progress ops | `onchain_operations_progress` |
286
- | WIP generation | `wip_file` |
287
- | Messenger | `messenger_operation` |
288
- | Query | `query_toolkit` |
295
+ When the service is already published and the user wants structural changes, use MCP `project_operation` action `fork_project` (creates a new version with copies of stage.json/manifest/deployment docs; original v1 stays read-only; no on-chain objects copied since they're immutable). Then work on v2 using the normal 5-stage flow, reusing v1 on-chain objects by address and creating new objects only for changed parts. Publish v2 when ready — v1 continues running uninterrupted.
289
296
 
290
- **Export**: `machineNode2file`, `guard2file` | **Query Schema**: `wowok({ tool: "schema_query", data: { action: "get", name: "<name>" } })`
297
+ Before forking, verify necessity via `get_reversibility` (query_object_type: "service", query_lifecycle_state: "published") `struct_reversible="immutable"` confirms fork is required, or `get_project_status` `has_published_object=true`.
298
+
299
+ ### When to Recommend Forking
300
+
301
+ - User says "I want to change my workflow" → check if published → recommend fork
302
+ - User says "I want to add a new product line" → if same Machine can handle it, in-place modify Service.sales; if needs new Machine, fork
303
+ - User says "I want to change fund distribution" → if Service not published, in-place; if published, fork (allocators are frozen after publish)
291
304
 
292
305
  ---
293
306
 
307
+ ## Distillation Review
308
+
309
+ The MCP server runs an offline flywheel that collects operational signals from your deployments and generates improvement proposals. Periodically review these proposals to optimize your service.
310
+
311
+ ### When to Review
312
+
313
+ - After publishing a service and running it for a while
314
+ - When the user asks "any improvements?" or "what did the system learn?"
315
+ - As part of routine service maintenance
316
+
317
+ ### How to Review
318
+
319
+ Use the [wowok-distill](../wowok-distill/SKILL.md) skill for guided review, or call MCP `project_operation` actions directly in order: (1) `get_improvement_queue` with `queue_filter_status: "pending"` to list proposals (title, priority, confidence, description); (2) `apply_improvement` with `proposal_id` + `review_status: "approved"` or `"rejected"` — approved proposals write overrides to `~/.wowok/overrides/` (config) or `patches/` (source); (3) `get_flywheel_config` to verify `applied_count` increased and `pending_count` decreased. Overrides are hot-loaded — next operation uses the new config immediately.
320
+
321
+ ### Override Categories
322
+
323
+ Only these categories can be overridden (no arbitrary changes):
324
+
325
+ | Category | What It Controls | Example |
326
+ |----------|-----------------|---------|
327
+ | risk-thresholds | Risk assessment cutoffs | max_retries, min_deposit |
328
+ | descriptions | AI guidance text | industry descriptions |
329
+ | industry-profiles | Industry trait profiles | rental traits, freelance traits |
330
+ | scenario-defaults | Default parameters per scenario | default allocators, machine nodes |
331
+ | recovery-priorities | Error recovery order | which failures to fix first |
332
+
294
333
  ---
295
334
 
296
- ## Appendices (Progressive Disclosure)
335
+ ## Order Fulfillment
336
+
337
+ | Object | Purpose | Operation |
338
+ |--------|---------|-----------|
339
+ | Order | Fund escrow | Read-only |
340
+ | **Progress** | Workflow state | **Operate this** — `hold: true` (lock) → work → `hold: false` (submit) |
341
+
342
+ **AI Reminder**: When fulfilling, check `customer_required` fields. Missing → prompt via Messenger.
297
343
 
298
- > The following sections have been extracted to [APPENDIX.md](./APPENDIX.md) for on-demand loading:
299
- > - Dialogue Scripts (R1-R10) — guided conversation scripts
300
- > - Decision Trees — branching logic reference
301
- > - Failure Playbooks — recovery scenarios
302
- > - Tier Layering — expertise-tier based guidance
303
- >
304
- > Load APPENDIX.md when the user needs guided dialogue, recovery help, or tier-specific guidance.
344
+ ---
@@ -70,20 +70,7 @@ Empty string `""` means the default account. Always use `""` when the user does
70
70
 
71
71
  ### 2.1 Confirmation Template
72
72
 
73
- ```
74
- 📋 **Operation Preview**
75
-
76
- | Field | Value |
77
- |-------|-------|
78
- | Operation | {operation_type} — {op} |
79
- | Object | {object_name} |
80
- | Network | {network} |
81
- | Account | {account} |
82
-
83
- ⚠️ **This will {describe_what_will_happen}**
84
-
85
- Proceed with execution?
86
- ```
73
+ Present a preview table (Operation, Object, Network, Account) with a warning describing what will happen, then ask: "Proceed with execution?"
87
74
 
88
75
  ### 2.2 Amount Verification
89
76
 
@@ -98,26 +85,7 @@ Proceed with execution?
98
85
 
99
86
  ### 2.3 Publish Confirmation
100
87
 
101
- Before publishing a Service or Machine:
102
-
103
- 1. **Export and review**:
104
- - Use `guard2file` to export Guard definitions
105
- - Use `machineNode2file` to export Machine nodes
106
-
107
- 2. **Verify logic**: Confirm Guards and Machine nodes match user intent
108
-
109
- 3. **Warn about immutability**: Once published, many fields become locked
110
-
111
- ```
112
- ⚠️ PUBLISH CONFIRMATION REQUIRED
113
-
114
- You are about to publish:
115
- - {Service|Machine}: {name}
116
- - This will make it publicly accessible on-chain
117
- - After publish: {list what becomes immutable}
118
-
119
- This action cannot be easily undone. Proceed?
120
- ```
88
+ Before publishing a Service or Machine: (1) Export and review — use `guard2file` to export Guard definitions, `machineNode2file` to export Machine nodes; (2) Verify logic — confirm Guards and Machine nodes match user intent; (3) Warn about immutability — once published, many fields become locked. Present a publish confirmation warning listing what becomes immutable, then ask: "This action cannot be easily undone. Proceed?"
121
89
 
122
90
  ---
123
91
 
@@ -209,32 +177,15 @@ Use `Payment` objects for commercial transfers when possible — they offer Guar
209
177
 
210
178
  ## 8. Testing & Validation Workflow
211
179
 
212
- 1. **Design Phase**: Use `wowok_buildin_info` to discover available permissions, Guard instructions, and value types
213
-
214
- **Tool**: `wowok_buildin_info` with `info: "built-in permissions"`, `info: "guard instructions"`, or `info: "value types"`.
180
+ 1. **Design Phase**: Discover available permissions, Guard instructions, and value types via `wowok_buildin_info` (`info: "built-in permissions"` / `"guard instructions"` / `"value types"`).
181
+ 2. **Export & Review**: Before publishing, use `guard2file` and `machineNode2file` to export and review definitions.
182
+ 3. **Incremental Testing**: Build objects step-by-step, verifying each step.
183
+ 4. **Final Validation**: Test all Guard conditions and Machine transitions before publishing.
184
+ 5. **Publish**: Only after thorough testing, publish Service and Machine.
215
185
 
216
186
  ### 8.1 Value Types — Built-in Type Annotation System
217
187
 
218
- WoWok's value type system is the foundation for type-safe data declarations used across Guards, records, and query instructions. Every data field in a Guard table or Guard submission carries a `value_type` annotation, ensuring the protocol can validate and process data correctly.
219
-
220
- **When value types matter:**
221
- - Defining Guard table columns: each Identifier in a Guard's `table` block requires a `value_type`
222
- - Submitting data to Guards: `GuardSubmission` entries must match their declared `value_type`
223
- - Reading Guard exports: `guard2file` output shows `value_type` for every Identifier
224
- - Designing query instructions: both parameters and return values carry `value_type` annotations
225
-
226
- - **String format is recommended** (e.g., `"U64"`, `"Address"`, `"VecString"`) for readability in Guard tables and submissions.
227
- - Numeric codes (0–18) are accepted but obscure — prefer string names in all user-facing contexts.
228
- - `Value` (19) is a protocol-internal type for dynamic value handling. It must **never** be used directly in user-defined Guards or submissions.
229
- **Available value types** (queried via `wowok_buildin_info` with `info: "value types"`)
230
-
231
- 2. **Export & Review**: Before publishing, use `guard2file` and `machineNode2file` to export and review definitions
232
-
233
- 3. **Incremental Testing**: Build objects step-by-step, verifying each step
234
-
235
- 4. **Final Validation**: Test all Guard conditions and Machine transitions before publishing
236
-
237
- 5. **Publish**: Only after thorough testing, publish Service and Machine
188
+ Every data field in a Guard table or submission carries a `value_type` annotation. Value types matter when: defining Guard table columns, submitting data to Guards, reading `guard2file` exports, and designing query instructions. **String format is recommended** (`"U64"`, `"Address"`, `"VecString"`) for readability; numeric codes (0–18) are accepted but obscure. `Value` (19) is protocol-internal never use in user-defined Guards. Available types are queried via `wowok_buildin_info` with `info: "value types"`.
238
189
 
239
190
  ---
240
191
 
@@ -251,29 +202,6 @@ For complex objects with many fields (Service, Machine), use **incremental build
251
202
 
252
203
  ## Schema Reference
253
204
 
254
- | Purpose | Schema Name |
255
- |---------|-------------|
256
- | Query toolkit | `query_toolkit` |
257
- | Token list | `query_toolkit` with `query_type: "token_list"` |
258
- | Guard export | `guard2file` |
259
- | Machine export | `machineNode2file` |
260
- | Build-in info | `wowok_buildin_info` |
261
- | Built-in permissions | `wowok_buildin_info` with `info: "built-in permissions"` |
262
- | Guard instructions | `wowok_buildin_info` with `info: "guard instructions"` |
263
- | Value types | `wowok_buildin_info` with `info: "value types"` |
264
-
265
- **Query Schema**: `wowok({ tool: "schema_query", data: { action: "get", name: "<schema_name>" } })`
266
-
267
205
  **Related Skills**: [wowok-tools](../wowok-tools/SKILL.md) | [wowok-guard](../wowok-guard/SKILL.md) | [wowok-machine](../wowok-machine/SKILL.md) | [wowok-order](../wowok-order/SKILL.md) | [wowok-provider](../wowok-provider/SKILL.md) | [wowok-arbitrator](../wowok-arbitrator/SKILL.md) | [wowok-messenger](../wowok-messenger/SKILL.md)
268
206
 
269
207
  ---
270
-
271
- ## Appendices (Progressive Disclosure)
272
-
273
- > The following sections have been extracted to [APPENDIX.md](./APPENDIX.md) for on-demand loading:
274
- > - Dialogue Scripts (R1-R10) — guided conversation scripts
275
- > - Decision Trees — branching logic reference
276
- > - Failure Playbooks — recovery scenarios
277
- > - Tier Layering — expertise-tier based guidance
278
- >
279
- > Load APPENDIX.md when the user needs guided dialogue, recovery help, or tier-specific guidance.