@wowok/skills 2.0.2 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/cli.js +66 -5
- package/dist/cli.js.map +1 -1
- package/dist/skills.js +1 -1
- package/dist/skills.js.map +1 -1
- package/package.json +1 -1
- package/scripts/install.js +52 -0
- package/wowok-arbitrator/SKILL.md +18 -27
- package/wowok-auditor/SKILL.md +6 -6
- package/wowok-machine/SKILL.md +10 -10
- package/wowok-onboard/SKILL.md +192 -100
- package/wowok-order/SKILL.md +72 -217
- package/wowok-planner/SKILL.md +24 -9
- package/wowok-provider/SKILL.md +42 -190
package/wowok-order/SKILL.md
CHANGED
|
@@ -14,38 +14,24 @@ when_to_use:
|
|
|
14
14
|
|
|
15
15
|
# WoWok Customer Guide
|
|
16
16
|
|
|
17
|
-
> **Role**: Customer (Buyer/Order Holder)
|
|
18
|
-
> **
|
|
19
|
-
> Guard
|
|
17
|
+
> **Role**: Customer (Buyer/Order Holder)
|
|
18
|
+
> **Guides**: [wowok-provider](../wowok-provider/SKILL.md) · [wowok-arbitrator](../wowok-arbitrator/SKILL.md) · [wowok-machine](../wowok-machine/SKILL.md) · [wowok-messenger](../wowok-messenger/SKILL.md)
|
|
19
|
+
> Guard patterns / safety rules / tool references live in the MCP knowledge layer — query via `schema_query` (`get_guard_design_patterns`, `get_safety_rules`, `get_tool_reference`).
|
|
20
20
|
|
|
21
21
|
---
|
|
22
22
|
|
|
23
23
|
## Core Concepts (Design Invariants Not in Schema)
|
|
24
24
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
### The No-Bypass Rule
|
|
30
|
-
|
|
31
|
-
A forward with `namedOperator === ""` signals "user-operable". **However**: if that forward also binds a Guard, passport verification is mandatory and **cannot be bypassed**. `order.next` fails without validated passport. This is a protocol invariant.
|
|
32
|
-
|
|
33
|
-
### Weight Accumulation
|
|
34
|
-
|
|
35
|
-
Each forward contributes `weight` toward a node's `threshold`. `weight ≥ threshold` → one operation suffices. Multi-forward nodes may require cumulative multi-party contributions. Parse the `machineNode2file` JSON output; never query node-by-node.
|
|
36
|
-
|
|
37
|
-
### Allocation Triggers
|
|
38
|
-
|
|
39
|
-
Allocation evaluates when Progress reaches **any** configured node (not just exit nodes). The winning Allocator is the first whose Guard returns `true`. Rules are immutable after Service publish — both parties see identical conditions.
|
|
25
|
+
- **Objects**: Purchase creates **Order** (fund escrow, you are `builder`), **Progress** (Machine node tracker), **Allocation** (fund distribution). Only `builder` withdraws; agents operate but never access funds.
|
|
26
|
+
- **No-Bypass Rule**: A forward with `namedOperator === ""` is "user-operable", but if it also binds a Guard, passport verification is mandatory and cannot be bypassed (`order.next` fails without validated passport).
|
|
27
|
+
- **Weight Accumulation**: Each forward contributes `weight` toward a node's `threshold`; `weight ≥ threshold` → one operation suffices. Parse `machineNode2file` JSON; never query node-by-node.
|
|
28
|
+
- **Allocation Triggers**: Allocation evaluates when Progress reaches **any** configured node (not just exit nodes). Winning Allocator = first whose Guard returns `true`. Rules immutable after publish.
|
|
40
29
|
|
|
41
30
|
---
|
|
42
31
|
|
|
43
32
|
## Phase 1: Pre-Purchase Due Diligence (MANDATORY GATE)
|
|
44
33
|
|
|
45
|
-
> **⛔ Complete E1-E11 in order
|
|
46
|
-
> **⚠️ = explain risk, wait for decision. 🔴 = strongly advise against purchase.**
|
|
47
|
-
|
|
48
|
-
---
|
|
34
|
+
> **⛔ Complete E1-E11 in order; user must confirm every item.** **⚠️** = explain risk, wait. **🔴** = strongly advise against.
|
|
49
35
|
|
|
50
36
|
### E1 — Service Basic Status
|
|
51
37
|
|
|
@@ -55,52 +41,35 @@ Query `query_toolkit` → `onchain_objects` for `<service_name_or_id>`. Save: `b
|
|
|
55
41
|
- `bPaused === true` → 🔴 **ABORT**
|
|
56
42
|
- OK → E2
|
|
57
43
|
|
|
58
|
-
---
|
|
59
|
-
|
|
60
44
|
### E2 — Product & WIP Verification
|
|
61
45
|
|
|
62
|
-
From E1 `sales[]
|
|
63
|
-
|
|
64
|
-
**WIP Verification** (mandatory when `wip_hash` non-empty):
|
|
46
|
+
From E1 `sales[]`; skip `suspension === true`. Verify WIP (mandatory when `wip_hash` non-empty): `wip_file` → `type: "verify"`, `wipFilePath: "<wip_url>"`, `hash_equal: "<wip_hash>"`.
|
|
65
47
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
- `wip_hash` empty → no on-chain commitment (auto-verified, weaker evidence)
|
|
48
|
+
- `wip_hash` empty → no on-chain commitment (weaker evidence)
|
|
69
49
|
- Verification fails → 🔴 **WIP tampered after publish**
|
|
70
50
|
- No `wip` URL → ⚠️ No product evidence
|
|
71
|
-
- Verified → E3
|
|
72
|
-
|
|
73
|
-
---
|
|
74
51
|
|
|
75
52
|
### E3 — Machine Workflow Analysis (CORE)
|
|
76
53
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
54
|
+
1. `query_toolkit` → `onchain_objects` for `<machine_id>`; fail if `bPublished === false` or `bPaused === true`.
|
|
55
|
+
2. Entry-node check: entry node (`prev_node: ""`) must have ≥1 forward, else Progress stuck at `current=""` → 🔴 BLOCKER.
|
|
56
|
+
3. `machineNode2file` → export full Machine JSON (parse locally; see [wowok-machine](../wowok-machine/SKILL.md)).
|
|
80
57
|
|
|
81
|
-
**
|
|
82
|
-
|
|
83
|
-
**Step 3: Classify every forward**:
|
|
58
|
+
**Classify every forward**:
|
|
84
59
|
|
|
85
60
|
| `namedOperator` | `guard` | User Can Execute? | Operation Path |
|
|
86
61
|
|-----------------|---------|-------------------|----------------|
|
|
87
|
-
| `Some("")` | `None` | ✅ Independently |
|
|
88
|
-
| `Some("")` | `Some({...})` | ⚠️
|
|
89
|
-
| `None` | Any | ❌ Provider/permission-holder
|
|
90
|
-
| `Some("<other>")` | Any | ❌ Named operator
|
|
91
|
-
|
|
92
|
-
> **⚠ CRITICAL ROUTING RULE**: When `namedOperator=""` (empty string = OrderHolder), you MUST use `order.progress` (NOT `progress.operate`). Direct `progress::next` will abort with "Permission denied" (code 5) because the Progress-level permission check does not recognize the OrderHolder short-circuit. The empty-string `namedOperator` is set automatically by `service::buy` when an Order is created — the customer (order.builder) becomes the operator for the `""` namespace. In ALL other cases (non-empty `namedOperator` or `permissionIndex`-only), use `progress.operate` on the Progress object directly.
|
|
62
|
+
| `Some("")` | `None` | ✅ Independently | `order.progress` |
|
|
63
|
+
| `Some("")` | `Some({...})` | ⚠️ Guard passport (no bypass) | `order.progress` + Passport |
|
|
64
|
+
| `None` | Any | ❌ Provider/permission-holder | `progress.operate` |
|
|
65
|
+
| `Some("<other>")` | Any | ❌ Named operator | `progress.operate` |
|
|
93
66
|
|
|
94
|
-
|
|
95
|
-
- Terminal nodes (no outgoing forwards) → order ends
|
|
96
|
-
- Refund paths → lead to 100%→Order Allocator (cross-check E5)
|
|
97
|
-
- Arbitration paths → lead to arbitration nodes
|
|
98
|
-
- User-blocked paths → all forwards require `namedOperator ≠ ""`
|
|
67
|
+
> **⚠ ROUTING RULE**: `namedOperator=""` (OrderHolder) → use `order.progress` (NOT `progress.operate`); `progress::next` aborts "Permission denied" (code 5) because Progress-level checks don't recognize the OrderHolder short-circuit. The `""` operator is set by `service::buy` (customer = operator). All other cases (non-empty `namedOperator` or `permissionIndex`) → `progress.operate`.
|
|
99
68
|
|
|
100
|
-
**
|
|
69
|
+
**Detect paths**: terminal (no outgoing) → order ends; refund → 100%→Order Allocator (E5); arbitration → arb nodes; user-blocked → all forwards `namedOperator ≠ ""`.
|
|
101
70
|
|
|
102
|
-
| Signal | Level |
|
|
103
|
-
|
|
71
|
+
| Risk Signal | Level |
|
|
72
|
+
|-------------|-------|
|
|
104
73
|
| No user-operable path from critical node | 🔴 Stuck unless provider acts |
|
|
105
74
|
| No refund path | 🔴 No fund recovery |
|
|
106
75
|
| No arbitration path | 🔴 No recourse |
|
|
@@ -109,35 +78,21 @@ Use `wip_file` → `type: "verify"`, `wipFilePath: "<wip_url>"`, `hash_equal: "<
|
|
|
109
78
|
|
|
110
79
|
> **🔴 "No refund" + "No arbitration" → strongly advise against purchase.**
|
|
111
80
|
|
|
112
|
-
---
|
|
113
|
-
|
|
114
81
|
### E4 — Guards Analysis
|
|
115
82
|
|
|
116
|
-
Guard structure
|
|
117
|
-
|
|
118
|
-
**Step 1**: Collect unique Guard IDs from E3 Machine JSON (`forward.guard.guard`), E1 `order_allocators`, E1 `buy_guard`. Deduplicate.
|
|
119
|
-
|
|
120
|
-
**Step 2**: `guard2file` → export each unique Guard as JSON. Skip duplicates (same address = same Guard).
|
|
121
|
-
|
|
122
|
-
**Step 3**: `wowok_buildin_info` → `info: "guard instructions"` for instruction reference.
|
|
123
|
-
|
|
124
|
-
**Step 4**: For each exported Guard file, classify:
|
|
83
|
+
Guard structure/instructions: `schema_query` action='get_guard_design_patterns' + action='get_guard_templates'. Steps: (1) collect unique Guard IDs from E3 `forward.guard.guard` + E1 `order_allocators` + `buy_guard`, dedupe; (2) `guard2file` export each; (3) `wowok_buildin_info` → `info: "guard instructions"`; (4) classify:
|
|
125
84
|
|
|
126
85
|
| Level | Criteria | Action |
|
|
127
86
|
|-------|----------|--------|
|
|
128
87
|
| 🟢 Simple | Clear purpose, few conditions | Explain |
|
|
129
88
|
| 🟡 Complex | Multi-layer, intent clear | Explain step-by-step |
|
|
130
|
-
| 🔴 Ambiguous | Unclear logic
|
|
89
|
+
| 🔴 Ambiguous | Unclear logic/dependencies | **Warn. Never speculate. User must review file.** |
|
|
131
90
|
|
|
132
91
|
> **⛔ Never invent Guard logic. Prioritize Guards gating user-operable forwards and refund allocators.**
|
|
133
92
|
|
|
134
|
-
---
|
|
135
|
-
|
|
136
93
|
### E5 — Fund Allocation Rules
|
|
137
94
|
|
|
138
|
-
From E1 `order_allocators.allocators[]
|
|
139
|
-
|
|
140
|
-
**Risk Rules**:
|
|
95
|
+
From E1 `order_allocators.allocators[]`: cross-ref Guard (E4) → trigger; map to Machine node (E3) → when fires; present outcome.
|
|
141
96
|
|
|
142
97
|
| Check | Risk |
|
|
143
98
|
|-------|------|
|
|
@@ -146,22 +101,16 @@ From E1 `order_allocators.allocators[]`. For each Allocator: cross-reference Gua
|
|
|
146
101
|
| Triggers only on provider-only paths | ⚠️ Unilateral collection |
|
|
147
102
|
| No allocators on user-operable paths | ⚠️ No financial control |
|
|
148
103
|
|
|
149
|
-
> **
|
|
150
|
-
|
|
151
|
-
---
|
|
104
|
+
> **Safeguard**: 100%→Order Allocator on a user-operable forward.
|
|
152
105
|
|
|
153
106
|
### E6 — Arbitration Availability
|
|
154
107
|
|
|
155
|
-
Batch query E1 `arbitrations[]` via `onchain_objects
|
|
156
|
-
|
|
157
|
-
Also: `onchain_events` → `type: "ArbEvent"`, `limit: 20`, filter for these Arb IDs.
|
|
108
|
+
Batch query E1 `arbitrations[]` via `onchain_objects` (process: [wowok-arbitrator](../wowok-arbitrator/SKILL.md)). Also `onchain_events` → `type: "ArbEvent"`, `limit: 20`, filter those Arb IDs.
|
|
158
109
|
|
|
159
110
|
- `arbitrations[]` empty → 🔴 no recourse
|
|
160
111
|
- Any Arb `bPaused === true` → 🔴 unavailable
|
|
161
112
|
- High `fee` / closed `voting_guard` / no history → ⚠️
|
|
162
113
|
|
|
163
|
-
---
|
|
164
|
-
|
|
165
114
|
### E7 — Compensation Fund
|
|
166
115
|
|
|
167
116
|
From E1: `compensation_fund`, `compensation_lock_duration`.
|
|
@@ -169,8 +118,6 @@ From E1: `compensation_fund`, `compensation_lock_duration`.
|
|
|
169
118
|
- Balance < planned order amount → ⚠️ may not cover award
|
|
170
119
|
- Lock near expiry → ⚠️ provider may withdraw
|
|
171
120
|
|
|
172
|
-
---
|
|
173
|
-
|
|
174
121
|
### E8 — Contact Channel
|
|
175
122
|
|
|
176
123
|
Query `onchain_objects` for E1 `um` ID.
|
|
@@ -179,61 +126,48 @@ Query `onchain_objects` for E1 `um` ID.
|
|
|
179
126
|
- `ims[]` empty → 🔴 **No Messenger**
|
|
180
127
|
- Has active `ims[]` → E9
|
|
181
128
|
|
|
182
|
-
---
|
|
183
|
-
|
|
184
129
|
### E9 — Chain Reputation
|
|
185
130
|
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
**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.
|
|
189
|
-
|
|
190
|
-
- Dispute rate >10% → ⚠️
|
|
191
|
-
|
|
192
|
-
---
|
|
131
|
+
Sentiment: `query_toolkit` → `onchain_table_item_entity_linker` for provider; compute likes/dislikes from `votes[]`. Orders: batch query `votes[].address` via `onchain_objects` (50/batch, max 200), filter `service` match; aggregate dispute rate (`dispute ≠ []` / total) + repeat-buyer ratio. Dispute rate >10% → ⚠️.
|
|
193
132
|
|
|
194
|
-
### E10 — Privacy Information Matching
|
|
133
|
+
### E10 — Privacy Information Matching (LocalInfo reuse)
|
|
195
134
|
|
|
196
|
-
From E1 `customer_required[]
|
|
135
|
+
From E1 `customer_required[]` (e.g. `["name", "phone", "shipping_address"]`). Reuse locally-stored private info so the user never re-types it:
|
|
197
136
|
|
|
198
|
-
|
|
137
|
+
1. `query_toolkit` → `query_type: "local_info_list"` to list stored private info (each `name` → `default` + optional `contents`).
|
|
138
|
+
2. Match each `customer_required` name against a local `name` (case-insensitive):
|
|
139
|
+
- **Matched** → auto-fill the `default`; confirm "use this?" and offer any `contents` alternatives.
|
|
140
|
+
- **Missing** → ask the user for the value.
|
|
141
|
+
3. **Save** any newly-provided value via `local_info_operation` → `add: { op: "add", data: [{ name, default }] }` (100% local, never on-chain).
|
|
199
142
|
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
---
|
|
143
|
+
> **⛔ Never send private info without explicit user confirmation per item.** Transmission: **Messenger only** (Phase 2), never on-chain.
|
|
203
144
|
|
|
204
145
|
### E11 — Trust Score Synthesis (Preorder Advice)
|
|
205
146
|
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
`wowok({ tool: "trust_score", data: { service: "<service_id>", depth: "preorder", order_amount: "<planned_amount>" } })`
|
|
147
|
+
`wowok({ tool: "trust_score", data: { service: "<service_id>", depth: "preorder", order_amount: "<planned_amount>" } })`.
|
|
209
148
|
|
|
210
149
|
- Returns trust score + per-dimension risks + preorder advice (order confidence, game strategies, preference match, industry risks, `blocking_reminders`); non-empty `blocking_reminders` → ⛔ resolve with user BEFORE Phase 2.
|
|
211
|
-
-
|
|
212
|
-
- Optional `preferences` / `user_metrics` reflect the buyer's
|
|
213
|
-
|
|
214
|
-
> Fast pre-screen: at E1 you may call `depth: "evaluate"` (default) for a quick score; 🔴 `risk_score` (<50) → advise early abort, skip E2–E10.
|
|
215
|
-
|
|
216
|
-
---
|
|
150
|
+
- Compare candidates: `compare_with: ["<id2>", ...]` (1–9, same `depth: "preorder"`) → gains `comparison` block with per-metric bests, **NO overall ranking** (buyer decides).
|
|
151
|
+
- Optional `preferences` / `user_metrics` reflect the buyer's priorities.
|
|
152
|
+
- Fast pre-screen at E1: `depth: "evaluate"` (default); 🔴 `risk_score` <50 → advise early abort, skip E2–E10.
|
|
217
153
|
|
|
218
154
|
### Pre-Purchase GATE
|
|
219
155
|
|
|
220
|
-
**Abort
|
|
221
|
-
|
|
222
|
-
**Any ⚠️** → explain risk, wait for user decision. **All OK** → Phase 2.
|
|
156
|
+
**Abort**: E1 `bPublished=false`/`bPaused=true`; E8 `um=null`; E3 no-refund + E6 no-arb → strongly advise ABORT; E4 ambiguous Guards → user must review; E11 `blocking_reminders` → resolve. **Any ⚠️** → explain + wait. **All OK** → Phase 2.
|
|
223
157
|
|
|
224
158
|
---
|
|
225
159
|
|
|
226
160
|
## Phase 2: Consensus Building
|
|
227
161
|
|
|
228
|
-
|
|
162
|
+
Foundation = immutable on-chain rules (Phase 1). Messenger = encrypted, self-verifiable supplement (clarifies, cannot override on-chain). Full ops: [wowok-messenger](../wowok-messenger/SKILL.md).
|
|
229
163
|
|
|
230
164
|
### 2.1 Send Privacy Info
|
|
231
165
|
|
|
232
|
-
Contact `ims[]` from E8. Send E10 info via `messenger_operation` → `send_message`. **Messenger only — never on-chain.**
|
|
166
|
+
Contact `ims[]` from E8. Send E10 info via `messenger_operation` → `send_message`. **Messenger only — never on-chain.** Explicit user confirmation per item. After sending, persist any newly-provided value via `local_info_operation` `add` (so future orders auto-fill).
|
|
233
167
|
|
|
234
168
|
### 2.2 Negotiate
|
|
235
169
|
|
|
236
|
-
Clarify via Messenger: deliverables (E2 WIP), timeline (E3 nodes), refund/cancellation (E3/E5), privacy
|
|
170
|
+
Clarify via Messenger: deliverables (E2 WIP), timeline (E3 nodes), refund/cancellation (E3/E5), privacy received (E10). Evidence value requires recipient **explicit confirmation** (ARK signature). WTS evidence: [wowok-messenger](../wowok-messenger/SKILL.md).
|
|
237
171
|
|
|
238
172
|
### 2.3 Consensus GATE
|
|
239
173
|
|
|
@@ -245,11 +179,7 @@ Clarify via Messenger: deliverables (E2 WIP), timeline (E3 nodes), refund/cancel
|
|
|
245
179
|
|
|
246
180
|
## Phase 3: Order Creation
|
|
247
181
|
|
|
248
|
-
|
|
249
|
-
- Excess `buy.total_pay` auto-refunded. Agents cannot withdraw.
|
|
250
|
-
- Discounts: query `onchain_received` (type `0x2::service::Discount`), filter by `service`, validate time/benchmark. Rate: `total_pay × (off / 10000)`. Fixed: `min(off, total_pay)`.
|
|
251
|
-
|
|
252
|
-
Post-creation: notify via Messenger with order ID.
|
|
182
|
+
Not in schema: excess `buy.total_pay` auto-refunded; agents cannot withdraw. Discounts: query `onchain_received` (type `0x2::service::Discount`), filter by `service`, validate time/benchmark; rate = `total_pay × (off / 10000)`; fixed = `min(off, total_pay)`. Post-creation: notify via Messenger with order ID.
|
|
253
183
|
|
|
254
184
|
---
|
|
255
185
|
|
|
@@ -257,142 +187,67 @@ Post-creation: notify via Messenger with order ID.
|
|
|
257
187
|
|
|
258
188
|
### Progress Advancement
|
|
259
189
|
|
|
260
|
-
When user reaches a node,
|
|
190
|
+
When user reaches a node, cross-reference Phase 1: (1) E3 user-operable forwards; (2) E4 Guard requirements; (3) E5 financial outcome. Present all three — never just the operation name.
|
|
261
191
|
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
3. **E5 Allocation**: financial outcome of each path?
|
|
265
|
-
|
|
266
|
-
Present all three dimensions. Never just the operation name.
|
|
267
|
-
|
|
268
|
-
- `namedOperator === ""` + no Guard → `order.progress` directly
|
|
269
|
-
- `namedOperator === ""` + Guard → passport required, no bypass
|
|
192
|
+
- `namedOperator === ""` + no Guard → `order.progress`
|
|
193
|
+
- `namedOperator === ""` + Guard → passport required (no bypass)
|
|
270
194
|
- `namedOperator !== ""` → not user-operable
|
|
271
195
|
|
|
272
196
|
### Progress.current="" Diagnostic (stuck at initial state)
|
|
273
197
|
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
1. **Root cause**: Machine entry node (`prev_node: ""`) has empty `forwards[]` — Progress cannot advance.
|
|
277
|
-
2. **Query Machine**: `query_toolkit` → `onchain_objects` for `progress.machine` → inspect `node.pairs` for `prev_node: ""`.
|
|
278
|
-
3. **If forwards empty**: Machine must be republished with ≥1 forward on the entry node (nodes are immutable after publish — clone + add forward + new Machine + rebind to Service).
|
|
279
|
-
4. **MCP auto-diagnostic**: `query_toolkit` now attaches `_diagnostic` with cause + 5-step fix guide when `current=""` is detected.
|
|
198
|
+
Root cause: entry node (`prev_node: ""`) has empty `forwards[]`. Fix: clone Machine + add forward + republish + rebind (nodes immutable after publish). MCP `query_toolkit` attaches `_diagnostic` (cause + 5-step fix) when `current=""` is detected.
|
|
280
199
|
|
|
281
200
|
---
|
|
282
201
|
|
|
283
202
|
## Phase 5: Arbitration
|
|
284
203
|
|
|
285
|
-
Process: [wowok-arbitrator](../wowok-arbitrator/SKILL.md).
|
|
286
|
-
|
|
287
|
-
Flow: `arbitration.dispute` → WTS evidence → Messenger → `order.arb_confirm` → voting → (`order.arb_objection`) → `order.arb_claim_compensation`.
|
|
204
|
+
Process: [wowok-arbitrator](../wowok-arbitrator/SKILL.md). Flow: `arbitration.dispute` → WTS evidence → Messenger → `order.arb_confirm` → voting → (`order.arb_objection`) → `order.arb_claim_compensation`.
|
|
288
205
|
|
|
289
|
-
|
|
206
|
+
Not in schema: fee paid separately (not from Order); one compensation claim per Order; source = `compensation_fund` (E7).
|
|
290
207
|
|
|
291
208
|
---
|
|
292
209
|
|
|
293
210
|
## Fund Management
|
|
294
211
|
|
|
295
|
-
Builder-only
|
|
212
|
+
Builder-only: `order.transfer_to` (ownership), `order.receive` (withdraw). Agents may execute `receive`, but only the builder receives funds.
|
|
296
213
|
|
|
297
|
-
###
|
|
214
|
+
### Withdraw via `order.receive`
|
|
298
215
|
|
|
299
|
-
After Allocation distributes
|
|
216
|
+
After Allocation distributes `CoinWrapper` objects to the Order, the builder MUST call `order.receive` to unwrap + withdraw; otherwise funds stay locked as `CoinWrapper`.
|
|
300
217
|
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
#### Step 1: Query received objects (optional but recommended)
|
|
304
|
-
|
|
305
|
-
Before calling `order.receive`, query what the Order has received to verify there are funds to withdraw:
|
|
218
|
+
- **Schema**: `receive` accepts `ReceivedObjectsOrRecentlySchema` (consistent with `owner_receive` on ALL objects). Pass directly — do NOT wrap in `{result: ...}` (that is `QueryReceivedResult`).
|
|
219
|
+
- **Simplest form** — `"recently"` auto-receives all recently-received `CoinWrapper`:
|
|
306
220
|
|
|
307
221
|
```json
|
|
308
|
-
{
|
|
309
|
-
"tool": "query_toolkit",
|
|
310
|
-
"query_type": "onchain_received",
|
|
311
|
-
"name_or_address": "<order_name_or_address>",
|
|
312
|
-
"type": "CoinWrapper"
|
|
313
|
-
}
|
|
222
|
+
{ "tool": "onchain_operations", "data": { "operation_type": "order", "data": { "object": "<order_id>", "receive": "recently" } }, "env": { "account": "<builder>", "network": "testnet", "confirmed": true } }
|
|
314
223
|
```
|
|
315
224
|
|
|
316
|
-
**
|
|
317
|
-
|
|
318
|
-
#### Step 2: Call `order.receive` with `"recently"` (simplest form)
|
|
319
|
-
|
|
320
|
-
Use the string `"recently"` to auto-receive all recently received `CoinWrapper` objects:
|
|
321
|
-
|
|
322
|
-
```json
|
|
323
|
-
{
|
|
324
|
-
"tool": "onchain_operations",
|
|
325
|
-
"data": {
|
|
326
|
-
"operation_type": "order",
|
|
327
|
-
"data": {
|
|
328
|
-
"object": "<order_name_or_address>",
|
|
329
|
-
"receive": "recently"
|
|
330
|
-
}
|
|
331
|
-
},
|
|
332
|
-
"env": {
|
|
333
|
-
"account": "<builder_account_name>",
|
|
334
|
-
"network": "testnet",
|
|
335
|
-
"confirmed": true
|
|
336
|
-
}
|
|
337
|
-
}
|
|
338
|
-
```
|
|
339
|
-
|
|
340
|
-
**Expected result**:
|
|
341
|
-
- Builder account receives the underlying token (e.g., WOW) — `CoinWrapper` is auto-unwrapped
|
|
342
|
-
- Transaction digest returned
|
|
343
|
-
- Order's received `CoinWrapper` objects are consumed
|
|
344
|
-
|
|
345
|
-
#### Step 2 (alternatives)
|
|
225
|
+
- **Precise form** — pass an explicit `[{id, type}]` array, or pass the `ReceivedBalance` from `query_toolkit` → `query_type: "onchain_received"` (type `CoinWrapper`) directly as `receive`.
|
|
226
|
+
- **Result** — builder receives the underlying token (CoinWrapper auto-unwrapped); digest returned.
|
|
346
227
|
|
|
347
|
-
|
|
228
|
+
**When to call**:
|
|
348
229
|
|
|
349
|
-
|
|
230
|
+
| Trigger | Action |
|
|
231
|
+
|---------|--------|
|
|
232
|
+
| Allocation fires (refund on `return_approved`) | `order.receive` → withdraw to builder |
|
|
233
|
+
| Arbitration awards compensation | `order.receive` → withdraw to builder |
|
|
234
|
+
| Multi-stage allocation (partial refund + deduction) | `order.receive` `"recently"` (all at once) |
|
|
235
|
+
| Order closed with no allocation | Do NOT call (nothing to withdraw) |
|
|
350
236
|
|
|
351
|
-
|
|
352
|
-
- ❌ **Do NOT call `order.receive` if no funds received yet** — query first via Step 1
|
|
353
|
-
- ✅ Only the **builder** (Order owner) can call `receive` — agents cannot withdraw funds (they can execute the call, but only builder receives)
|
|
354
|
-
- ✅ `CoinWrapper` is auto-unwrapped to the underlying token (e.g., WOW)
|
|
355
|
-
- ✅ The `receive` field is consistent with `owner_receive` on all other objects (arbitration/contact/demand/machine/permission/repository/reward/service/treasury)
|
|
356
|
-
|
|
357
|
-
#### When to Call `order.receive`
|
|
358
|
-
|
|
359
|
-
| Trigger | Why | Action |
|
|
360
|
-
|---------|-----|--------|
|
|
361
|
-
| Allocation fires (e.g., refund Allocator triggers on `return_approved`) | Order receives `CoinWrapper` with refund amount | Call `order.receive` to withdraw to builder account |
|
|
362
|
-
| Arbitration awards compensation | Order receives `CoinWrapper` with award amount | Call `order.receive` to withdraw to builder account |
|
|
363
|
-
| Multi-stage allocation (partial refund + partial deduction) | Order receives multiple `CoinWrapper` objects | Call `order.receive` with `"recently"` to receive all at once |
|
|
364
|
-
| Order closed with no allocation | No `CoinWrapper` received | Do NOT call `order.receive` (nothing to withdraw) |
|
|
237
|
+
**Pitfalls**: don't wrap in `{result:...}`; query first (don't call with no funds); only builder receives; CoinWrapper auto-unwraps to the underlying token.
|
|
365
238
|
|
|
366
239
|
---
|
|
367
240
|
|
|
368
|
-
## Phase
|
|
369
|
-
|
|
370
|
-
> **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.
|
|
371
|
-
|
|
372
|
-
**Key fields in `semantic.customer_advice`**:
|
|
373
|
-
- `reminders[]`: stage-aware reminders with priority (`required` blocks purchase; `recommended` = strong caution; `info` = advisory; `reminder` = timed nudge)
|
|
374
|
-
- `risk_score`: 0-100 (🟢≥85 low | 🟡70-84 | 🟠50-69 | 🔴<50 high — advise against purchase)
|
|
375
|
-
- `preference_match`: 0-100 score with `matches`/`mismatches` arrays (≥75 strong match, <50 significant mismatch)
|
|
241
|
+
## Phase 6: Customer Intelligence (MCP-Handled)
|
|
376
242
|
|
|
377
|
-
|
|
243
|
+
> **MCP auto-populates `semantic.customer_advice`** in order/query responses when `customer_intelligence` is ON (default). Read from MCP output — do NOT recompute.
|
|
378
244
|
|
|
379
|
-
|
|
245
|
+
Key fields: `reminders[]` (`required` blocks purchase; `recommended` = strong caution; `info` = advisory; `reminder` = timed nudge); `risk_score` 0-100 (🟢≥85 | 🟡70-84 | 🟠50-69 | 🔴<50 advise against); `preference_match` 0-100 with `matches`/`mismatches` (≥75 strong, <50 mismatch).
|
|
380
246
|
|
|
381
|
-
**Runtime toggle**: `config_operation` → `action: "toggle"`, `service: "order_monitor"` (default OFF)
|
|
247
|
+
**Red lines** (do not purchase): no arb + no refund path, OR `compensation_ratio < 0.5`. **Post-purchase**: monitor refund Allocator triggers, WIP hash mismatch, merchant unreachable (>3d warning, >7d arb), evidence collection (≥3 items). **Runtime toggle**: `config_operation` → `action: "toggle"`, `service: "order_monitor"` (default OFF).
|
|
382
248
|
|
|
383
249
|
---
|
|
384
250
|
|
|
385
251
|
### Phase Dependency
|
|
386
252
|
|
|
387
|
-
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. E11 (Trust Score) runs LAST —
|
|
388
|
-
|
|
389
|
-
### ⚠️ Critical Attention Items
|
|
390
|
-
|
|
391
|
-
1. **E4 Ambiguous Guards** — blind spot. User must review file directly. AI must not speculate.
|
|
392
|
-
2. **E3 no-refund + E6 no-arb** — no mechanism to recover funds. Single most important decision factor.
|
|
393
|
-
3. **E3 Forward with Guard** — "user-operable" is misleading if Guard blocks you. Verify requirements.
|
|
394
|
-
4. **E2 WIP hash mismatch** — seller altered claims post-publish. Red flag regardless of other factors.
|
|
395
|
-
5. **E9 High dispute rate** — >10% quantitative warning independent of structural analysis.
|
|
396
|
-
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.
|
|
397
|
-
|
|
398
|
-
---
|
|
253
|
+
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. E11 (Trust Score) runs LAST — aggregates all prior findings.
|
package/wowok-planner/SKILL.md
CHANGED
|
@@ -75,20 +75,35 @@ The ODG (Object Dependency Graph) is the single output artifact, persisted via `
|
|
|
75
75
|
"status": "confirmed",
|
|
76
76
|
"account": "merchant_v1",
|
|
77
77
|
"objects": [
|
|
78
|
-
{ "id": "
|
|
79
|
-
{ "id": "
|
|
80
|
-
{ "id": "
|
|
81
|
-
{ "id": "
|
|
78
|
+
{ "id": "obj_account", "type": "account", "status": "created", "reversible": true, "dependencies": [], "user_decisions": { "reuse": false, "network": "testnet" } },
|
|
79
|
+
{ "id": "obj_permission", "type": "permission", "status": "planned", "reversible": true, "dependencies": ["obj_account"], "user_decisions": { "reuse": false, "indexes": { "provider": 1000 } } },
|
|
80
|
+
{ "id": "obj_service", "type": "service", "status": "planned", "reversible": true, "dependencies": ["obj_permission"], "user_decisions": { "name": "...", "publish": "deferred", "note": "DRAFT first — Guards reference it by LocalMark NAME to break the Guard↔Service cycle" } },
|
|
81
|
+
{ "id": "obj_machine", "type": "machine", "status": "planned", "reversible": false, "dependencies": ["obj_service", "obj_permission"], "user_decisions": { "nodes": [...], "forwards": [...], "publish": "deferred" } },
|
|
82
|
+
{ "id": "obj_guard_*", "type": "guard", "status": "planned", "reversible": false, "dependencies": ["obj_machine", "obj_service"], "user_decisions": { "logic": "...", "note": "references machine node names + service name via LocalMark NAME" } },
|
|
83
|
+
{ "id": "obj_treasury", "type": "treasury", "status": "planned", "reversible": true, "dependencies": ["obj_permission"], "user_decisions": { "reuse": false, "note": "optional fund pool for organizations; referenced by order_allocators as Entity recipient" } },
|
|
84
|
+
{ "id": "obj_contact", "type": "contact", "status": "planned", "reversible": true, "dependencies": ["obj_permission", "obj_account"], "user_decisions": { "reuse": false, "messenger": true, "anti_spam": "open", "note": "Service.um → Contact → ims[]; messenger enabled + anti-spam configured" } },
|
|
85
|
+
{ "id": "obj_arbitration", "type": "arbitration", "status": "planned", "reversible": true, "dependencies": ["obj_permission"], "user_decisions": { "reuse": true, "note": "REUSE third-party; permission MUST differ from Service (E_ARBITRATION_PERMISSION_CONFLICT); compensation_fund > 0 requires non-empty arbitrations" } }
|
|
82
86
|
],
|
|
83
87
|
"phases": [
|
|
84
|
-
{ "phase": 1, "objects": ["obj_permission"], "gate": "user_confirm" },
|
|
85
|
-
{ "phase": 2, "objects": ["obj_service", "
|
|
86
|
-
{ "phase": 3, "objects": ["obj_guard_*"], "gate": "
|
|
87
|
-
{ "phase": 4, "objects": ["obj_allocator_*"], "gate": "allocation_audit" },
|
|
88
|
-
{ "phase": 5, "objects": ["
|
|
88
|
+
{ "phase": 1, "objects": ["obj_account", "obj_permission"], "gate": "user_confirm" },
|
|
89
|
+
{ "phase": 2, "objects": ["obj_service"], "gate": "user_confirm", "note": "Service DRAFT created BEFORE Machine so Guards can reference it by name" },
|
|
90
|
+
{ "phase": 3, "objects": ["obj_machine", "obj_guard_*"], "gate": "risk_check", "note": "Machine + Guards designed together; guards bound to forwards before publish" },
|
|
91
|
+
{ "phase": 4, "objects": ["publish_machine", "obj_treasury", "obj_allocator_*"], "gate": "allocation_audit", "note": "Machine published; Treasury (optional) created before order_allocators references it" },
|
|
92
|
+
{ "phase": 5, "objects": ["obj_contact", "obj_arbitration"], "gate": "user_confirm", "note": "Contact + third-party Arbitration configured BEFORE publish; arbitration.permission != service.permission" },
|
|
93
|
+
{ "phase": 6, "objects": ["publish_service"], "gate": "final_audit" }
|
|
89
94
|
],
|
|
90
95
|
"risk_assessment": { "critical": [], "warnings": [], "irreversible_count": 1 }
|
|
91
96
|
}
|
|
92
97
|
```
|
|
93
98
|
|
|
94
99
|
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 `evaluate_project` (evaluation_type='risk'), `final_audit` runs the pre-publish audit checklist (see wowok-auditor).
|
|
100
|
+
|
|
101
|
+
**Dependency-chain ordering rules (authoritative, verified from Move/SDK):**
|
|
102
|
+
1. **Service DRAFT is created BEFORE Machine** — Guards reference the Service by LocalMark NAME, so the Service skeleton must exist first to break the Guard↔Service circular dependency.
|
|
103
|
+
2. **Machine + Guards are designed together** (one phase) — a forward's Guard depends on the Machine's node names; the Allocator's Guard depends on both Machine and Service.
|
|
104
|
+
3. **Machine publishes before Service binds it** — `service.machine` must reference a *published* Machine.
|
|
105
|
+
4. **`order_allocators` is L1-locked** — set it before `service.publish`; personal merchants route to Permission owner, organizations route to a Treasury (`Entity` recipient).
|
|
106
|
+
5. **Contact (customer service)** is configured before Service publish — `Service.um → Contact → ims[]`, with the local account enabled as messenger and anti-spam set.
|
|
107
|
+
6. **Arbitration is third-party and before publish** — `arbitration.permission != service.permission` (`E_ARBITRATION_PERMISSION_CONFLICT`); `compensation_fund > 0` requires non-empty `arbitrations` (`E_ARBITRATION_NOT_SET_WITH_COMPENSATION_FUND`).
|
|
108
|
+
|
|
109
|
+
These rules are the single source of truth for the dependency chain; the phase list above is their concrete serialization. Hand-off to `wowok-onboard` (Review opening + 12 rounds) follows this same chain.
|