@wowok/skills 1.2.3 → 1.2.5
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 +34 -16
- package/dist/cli.js +6 -2
- package/dist/cli.js.map +1 -1
- package/dist/skills.d.ts +32 -1
- package/dist/skills.d.ts.map +1 -1
- package/dist/skills.js +63 -0
- package/dist/skills.js.map +1 -1
- package/dist/types.d.ts +8 -0
- package/dist/types.d.ts.map +1 -1
- package/examples/Insurance/Insurance.md +543 -475
- package/examples/MyShop/MyShop.md +865 -746
- package/examples/MyShop_Advanced/MyShop_Advanced.md +1520 -1376
- package/examples/ThreeBody_Signature/ThreeBody_Signature.md +891 -651
- package/examples/Travel/Travel.md +952 -848
- package/package.json +2 -2
- package/scripts/install.js +3 -17
- package/wowok-arbitrator/SKILL.md +18 -57
- package/wowok-auditor/SKILL.md +16 -12
- package/wowok-distill/SKILL.md +237 -0
- package/wowok-guard/SKILL.md +40 -354
- package/wowok-machine/SKILL.md +21 -127
- package/wowok-messenger/SKILL.md +14 -59
- package/wowok-onboard/SKILL.md +42 -12
- package/wowok-order/SKILL.md +20 -169
- package/wowok-output/SKILL.md +0 -10
- package/wowok-planner/SKILL.md +28 -9
- package/wowok-provider/SKILL.md +91 -49
- package/wowok-safety/SKILL.md +8 -80
- package/wowok-scenario/SKILL.md +63 -98
- package/wowok-tools/SKILL.md +111 -122
- package/references/glossary.ts +0 -297
- package/references/guard-scenario-ledger.md +0 -353
- package/references/guard-template-library.md +0 -481
- package/references/machine-design-reference.md +0 -398
- package/references/machine-scenario-ledger.md +0 -227
- package/references/machine-template-library.md +0 -522
- package/references/merchant-scenario-coordination.md +0 -383
- package/references/object-collaboration.md +0 -362
- package/references/onchain-constants.md +0 -81
- package/wowok-arbitrator/APPENDIX.md +0 -545
- package/wowok-auditor/APPENDIX.md +0 -487
- package/wowok-guard/APPENDIX.md +0 -428
- package/wowok-machine/APPENDIX.md +0 -407
- package/wowok-messenger/APPENDIX.md +0 -550
- package/wowok-onboard/APPENDIX.md +0 -500
- package/wowok-order/APPENDIX.md +0 -777
- package/wowok-output/APPENDIX.md +0 -575
- package/wowok-planner/APPENDIX.md +0 -724
- package/wowok-provider/APPENDIX.md +0 -453
- package/wowok-safety/APPENDIX.md +0 -561
- package/wowok-scenario/APPENDIX.md +0 -97
- package/wowok-scenario/MODE-DETAILS.md +0 -275
- package/wowok-tools/APPENDIX.md +0 -388
package/wowok-machine/SKILL.md
CHANGED
|
@@ -26,7 +26,7 @@ Design, build, and operate automated workflow templates.
|
|
|
26
26
|
|
|
27
27
|
> **Role**: Service Provider or Workflow Designer
|
|
28
28
|
> **Key Tools**: `onchain_operations` with `operation_type: "machine"`
|
|
29
|
-
> **Related Skills**: [wowok-
|
|
29
|
+
> **Related Skills**: [wowok-provider](../wowok-provider/SKILL.md) (Service binding), [wowok-order](../wowok-order/SKILL.md) (customer perspective), [wowok-messenger](../wowok-messenger/SKILL.md) (privacy)
|
|
30
30
|
|
|
31
31
|
---
|
|
32
32
|
|
|
@@ -36,93 +36,27 @@ Design, build, and operate automated workflow templates.
|
|
|
36
36
|
|
|
37
37
|
Machines are **immutable after `publish: true`**; Guards are **CREATE-only**. Design the complete workflow before publishing.
|
|
38
38
|
|
|
39
|
-
##
|
|
39
|
+
## MCP Knowledge Layer
|
|
40
40
|
|
|
41
|
-
The
|
|
41
|
+
The following content has been pushed down to the MCP knowledge layer and is applied automatically — this Skill no longer duplicates it:
|
|
42
42
|
|
|
43
|
-
|
|
43
|
+
| Content | MCP Knowledge Module | Applied Via |
|
|
44
|
+
|---------|---------------------|-------------|
|
|
45
|
+
| Node design rules (node type specs, forward guard design patterns, topology limits) | `knowledge/machine-risk.ts` (`MACHINE_RISK_RULES`), `machine-topology.ts`, `machine-translation.ts` | `project_operation.analyze_intent` (business puzzle) + `project_operation.aggregate_risks` (via `assessMachineRisks`) |
|
|
46
|
+
| Machine scene/template selection | `knowledge/machine-ledger.ts`, `machine-templates.ts` | `project_operation.analyze_intent` |
|
|
47
|
+
| Forward Guard design patterns | `knowledge/guard-design-patterns.ts` (`GUARD_DESIGN_PATTERNS`) | `project_operation.aggregate_risks` (via `assessGuardRisks`) |
|
|
48
|
+
| Safety rules (immutability, confirmation) | `knowledge/safety-rules.ts` | Pre-publish checks + `project_operation.aggregate_risks` |
|
|
49
|
+
| Publish gate (4-layer fail-closed: checklist → risk → user → environment) | `knowledge/machine-confirm.ts` (`PUBLISH_CHECKLIST`, `confirmPublish`) | `project_operation.aggregate_risks` + pre-publish gate |
|
|
44
50
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
| Module | Entry Points | Purpose |
|
|
48
|
-
|--------|--------------|---------|
|
|
49
|
-
| `machine-ledger.ts` | `MACHINE_SCENES`, `inferSceneFromFlow(flow)`, `findScene(id)` | 10 industry scenes + keyword-based scene inference |
|
|
50
|
-
| `machine-templates.ts` | `MACHINE_TEMPLATES`, `getTemplateById(id)`, `fillTemplate(id, params)`, `forkTemplate(id, overrides)`, `walkDecisionTree(answers)` | 10 starter templates + parameter fill + Q1-Q9 decision tree |
|
|
51
|
-
| `machine-translation.ts` | `SEMANTIC_TO_MACHINE_RULES`, `MACHINE_CONSTRAINT_RULES`, `matchSemanticPattern(text)`, `identifyExecutionMode(threshold, fwdCount)`, `identifyTopology(pairs)`, `explainForwardPermission(fwd)` | 12 semantic patterns + 28 on-chain constraints (creation/structure/node_operation/publish/runtime) |
|
|
52
|
-
| `machine-topology.ts` | `analyzeTopology(nodes, pairs)`, `identifyTopologyPattern(topology)`, `formatTopologySummary(topology)`, `MAX_NODE_COUNT=200`, `MAX_NODE_PAIR_COUNT=40`, `MAX_FORWARD_COUNT=20` | DAG analysis: entry/terminal/orphaned/dead-branch/cycle, on-chain limit checks |
|
|
53
|
-
| `machine-risk.ts` | `MACHINE_RISK_RULES` (39 rules), `assessMachineRisks(machine, ctx)`, `getRiskRulesByCategory(cat)`, `getRiskSummary(assessment)` | 5 risk dimensions (R-M1 structural, R-M2 guard, R-M3 permission, R-M4 immutability, R-M5 environment) |
|
|
54
|
-
| `machine-puzzle.ts` | `initPuzzleFromIntent(intent)`, `initPuzzleFromTemplate(id)`, `checkPuzzleCompleteness(puzzle)`, `recommendNextStep(puzzle)`, `derivePuzzleFromMachineJson(json)`, `generateConfirmationText(puzzle)` | 8-dimension information model (A-H): business_flow, node_design, guard_acceptance, permission_model, threshold_weight, branch_topology, overall_objective, risk_assessment |
|
|
55
|
-
| `machine-confirm.ts` | `PUBLISH_CHECKLIST` (10 items C-01..C-10), `CONFIRMATION_QUESTIONS` (6 items Q1-Q6), `runStaticChecklist(machine)`, `integrateRiskAssessment(machine, ctx)`, `parseUserConfirmation(input)`, `verifyEnvironment(machine, ctx, isMainnet)`, `confirmPublish(machine, ctx, isMainnet, userInput)`, `progressiveCheck(machine, scope)`, `overrideBlockWithReason(result, reason)`, `generateFullConfirmationText(...)` | 4-layer fail-closed gate: checklist → risk → user → environment. **CRITICAL risks cannot be overridden.** |
|
|
56
|
-
| `machine-context.ts` | `injectMachineContext(intent, mode, options)`, `suggestWorkflow(intent)`, `buildPromptFromContext(bundle)`, `getMachineKnowledgeSnapshot()`, `getRelatedGuardScenes(sceneId)`, `getVerificationNotes(mode?)`, `CONTEXT_PRESETS.{newUserIntent, midDesignReview, prePublishFull, crossMachine, guardIntegration, allocationIntegration}` | Aggregator module. **8 injection modes** select curated subset of knowledge based on user task. Use this as the main entry point. |
|
|
57
|
-
|
|
58
|
-
### The 8 Context Injection Modes
|
|
59
|
-
|
|
60
|
-
The user's current task determines what context to surface (never dump everything):
|
|
61
|
-
|
|
62
|
-
| Mode | When to Use | What It Surfaces |
|
|
63
|
-
|------|-------------|------------------|
|
|
64
|
-
| `initial_design` | User just described intent | Matched scene + top 3 templates + initial puzzle |
|
|
65
|
-
| `mid_design_review` | User is mid-design | Missing puzzle dimensions + structure/node_op constraints |
|
|
66
|
-
| `pre_publish_check` | User about to publish | Full risk assessment + progressive checklist (R5 subset) + verification notes |
|
|
67
|
-
| `post_publish_runtime` | Machine already published | Runtime-only constraints + environment risks |
|
|
68
|
-
| `intent_match` | Lightweight intent inference | Top 2 templates + creation constraints (no verification notes) |
|
|
69
|
-
| `cross_machine` | Cross-Machine dependency design | P-M-CROSS-MACHINE pattern + structure/publish constraints |
|
|
70
|
-
| `guard_integration` | Deep-dive on Guard binding | Guard bridge to `guard-ledger.ts` + R-M2 risks |
|
|
71
|
-
| `allocation_integration` | Deep-dive on Allocator at terminals | P-M-ALLOCATION-INTEGRATED pattern + Allocator-related risks |
|
|
72
|
-
|
|
73
|
-
### Recommended Usage Pattern
|
|
74
|
-
|
|
75
|
-
```typescript
|
|
76
|
-
// 1. First user message — lightweight workflow suggestion
|
|
77
|
-
const suggestion = suggestWorkflow(userIntent);
|
|
78
|
-
// suggestion.matched_scene, suggestion.suggested_templates, suggestion.initial_puzzle, suggestion.next_step
|
|
79
|
-
|
|
80
|
-
// 2. Mid-design — inject context to surface missing info
|
|
81
|
-
const bundle = injectMachineContext(intent, 'mid_design_review', { existing_puzzle: puzzle });
|
|
82
|
-
|
|
83
|
-
// 3. Pre-publish — full ConfirmGate
|
|
84
|
-
const gate = confirmPublish(machineJson, projectContext, isMainnet, userConfirmationInput);
|
|
85
|
-
if (gate.status !== 'approved') {
|
|
86
|
-
// STOP — do not call onchain_operations with publish: true
|
|
87
|
-
console.log(gate.block_reason);
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
// 4. Or use the preset wrapper for common cases
|
|
91
|
-
const preset = CONTEXT_PRESETS.prePublishFull(intent, machineJson, projectContext);
|
|
92
|
-
const prompt = buildPromptFromContext(preset); // inject into AI prompt
|
|
93
|
-
```
|
|
94
|
-
|
|
95
|
-
### Verification Notes (06 §14)
|
|
96
|
-
|
|
97
|
-
Five topics were verified at the code level. These notes are embedded in `MACHINE_VERIFICATION_NOTES` and surfaced whenever the consumer's mode touches them:
|
|
98
|
-
|
|
99
|
-
| Topic | Judgment | Verified Semantic |
|
|
100
|
-
|-------|----------|-------------------|
|
|
101
|
-
| `bReplace` | YES | Acts at pairs-list level of an existing node (NOT whole-Machine). `false`=merge, `true`=replace that node's pairs list. |
|
|
102
|
-
| `um` | PARTIAL | Messenger Contact reference (off-chain metadata). Omitting has zero on-chain impact. |
|
|
103
|
-
| `consensus_repositories` | PARTIAL | Declarative-only field. Not consumed by on-chain flow. Hint for off-chain tooling. |
|
|
104
|
-
| `namedOperator_assignment` | PARTIAL | Move `progress::new` does NOT accept namedOperator. MCP/SDK translates to separate `namedOperator_add` tx (permission index 221). |
|
|
105
|
-
| `cross_machine_dependency` | PARTIAL | Indirect via `progress::new -> assert_published`. Use `convert_witness` TypeOrderProgress (100) / TypeOrderProgressSession (103). |
|
|
106
|
-
|
|
107
|
-
> **Test coverage**: 8 `.spec.ts` files covering machine-ledger, machine-templates, machine-translation, machine-topology, machine-risk, machine-puzzle, machine-confirm, and machine-context — over 400 tests, all passing.
|
|
51
|
+
This Skill keeps the **workflow conversation guidance**, **business flow design patterns**, and **machine lifecycle scripts**. The MCP layer handles node-design rule evaluation, scene/template selection, and risk aggregation.
|
|
108
52
|
|
|
109
53
|
---
|
|
110
54
|
|
|
111
55
|
## Machine Architecture
|
|
112
56
|
|
|
113
|
-
|
|
114
|
-
Machine
|
|
115
|
-
└── Nodes
|
|
116
|
-
└── Pairs
|
|
117
|
-
├── prev_node: which prior node ("" = entry point, multiple allowed)
|
|
118
|
-
├── threshold: required total forward weight to advance
|
|
119
|
-
└── Forwards (MachineForward)
|
|
120
|
-
├── name, weight
|
|
121
|
-
├── permissionIndex | namedOperator: who can execute
|
|
122
|
-
└── guard (optional): condition that must pass
|
|
123
|
-
```
|
|
57
|
+
**Machine** → **Nodes** → **Pairs** (`prev_node` ["" = entry, multiple allowed], `threshold` [required total forward weight to advance]) → **Forwards** (`name`, `weight`, `permissionIndex` | `namedOperator` [who can execute], `guard` [optional condition]).
|
|
124
58
|
|
|
125
|
-
>
|
|
59
|
+
> All field types, limits, and valid values are in the MCP schema (`onchain_operations_machine`). This document focuses on design decisions **not captured** by the schema.
|
|
126
60
|
|
|
127
61
|
### Forward Permission Model
|
|
128
62
|
|
|
@@ -140,7 +74,7 @@ Machine
|
|
|
140
74
|
|
|
141
75
|
A Guard validates the Forward's execution condition. **Retained submissions**: when `retained_submission` is set on a Guard, submitted values are stored in Progress history, uniquely located by `(current_node, next_node, forward_name)`. Later nodes query these values from history.
|
|
142
76
|
|
|
143
|
-
> **Guard construction**:
|
|
77
|
+
> **Guard construction**: Forward Guard design patterns (table design, computation trees, query instructions) now live in the MCP knowledge layer — see `knowledge/guard-design-patterns.ts` (`GUARD_DESIGN_PATTERNS`), auto-applied via `project_operation.aggregate_risks`. Query available Guard instructions via `wowok_buildin_info`.
|
|
144
78
|
|
|
145
79
|
### Threshold Mechanics
|
|
146
80
|
|
|
@@ -166,30 +100,19 @@ Users execute Forwards from the current node, accumulating weight within a **ses
|
|
|
166
100
|
|
|
167
101
|
### Dependency-First Construction
|
|
168
102
|
|
|
169
|
-
Build in this exact order:
|
|
170
|
-
|
|
171
|
-
```
|
|
172
|
-
1. Permission (CREATE/MODIFY) → access control foundation
|
|
173
|
-
2. Machine (CREATE, unpublished) → define all nodes
|
|
174
|
-
3. Guards (CREATE) → build validation conditions
|
|
175
|
-
4. Bind Guards to Forwards (MODIFY Machine) → set `guard` on each Forward; all operations (`add`, `set`, `add forward`) accept full `MachineForward` including `guard` + `retained_submission`
|
|
176
|
-
5. Publish Machine → nodes IMMUTABLE
|
|
177
|
-
6. Bind Machine to Service → workflow goes live
|
|
178
|
-
```
|
|
103
|
+
Build in this exact order: (1) Permission (CREATE/MODIFY) → access control foundation; (2) Machine (CREATE, unpublished) → define all nodes; (3) Guards (CREATE) → build validation conditions; (4) Bind Guards to Forwards (MODIFY Machine) → set `guard` on each Forward; all operations (`add`, `set`, `add forward`) accept full `MachineForward` including `guard` + `retained_submission`; (5) Publish Machine → nodes IMMUTABLE; (6) Bind Machine to Service → workflow goes live.
|
|
179
104
|
|
|
180
105
|
**Why this order matters**: Publishing locks the Machine. Guards are immutable. Publishing before Guards are ready means Guards can never be added — the Machine is frozen without validation rules. **Create Guards, test them, then publish.**
|
|
181
106
|
|
|
182
107
|
### Node Operations (Pre-Publish Only)
|
|
183
108
|
|
|
184
|
-
Nine operations are available via the `node` field.
|
|
109
|
+
Nine operations are available via the `node` field. Key design notes not captured by schema:
|
|
185
110
|
|
|
186
111
|
- `add` / `set` with `bReplace: false` (default) **merges** into existing nodes; `true` replaces all.
|
|
187
112
|
- `clear` is **irreversible** — instant wipe with no undo. Export via `machineNode2file` first.
|
|
188
113
|
- `exchange` swaps two node positions without delete/recreate. `rename` auto-updates all Pair references.
|
|
189
114
|
- `add forward` supports the full `MachineForward` structure including `guard` with `retained_submission`.
|
|
190
115
|
|
|
191
|
-
> **Schema**: `schema_query({ action: "get", name: "onchain_operations_machine" })` for full operation parameters.
|
|
192
|
-
|
|
193
116
|
### File-Based Workflow
|
|
194
117
|
|
|
195
118
|
```
|
|
@@ -220,22 +143,11 @@ Two paths: **Service Order** (automatic when Order created on Service with bound
|
|
|
220
143
|
|
|
221
144
|
Two-phase operations (`hold`/`unhold`) allow locking resources during multi-step operations; `adminUnhold` force-releases stale locks.
|
|
222
145
|
|
|
223
|
-
> **Querying**: Progress state via `onchain_objects`, history via `onchain_table` / `onchain_table_item_progress_history`.
|
|
146
|
+
> **Querying**: Progress state via `onchain_objects`, history via `onchain_table` / `onchain_table_item_progress_history`.
|
|
224
147
|
|
|
225
148
|
### Runtime: Advancing the Workflow
|
|
226
149
|
|
|
227
|
-
The runtime loop (
|
|
228
|
-
|
|
229
|
-
```
|
|
230
|
-
1. Query active Forwards → onchain_objects reveals current node name and available Pairs/Forwards
|
|
231
|
-
2. Execute Forward → weight accumulates in session; Guard validates (pass/fail);
|
|
232
|
-
retained_submission stores values indexed by (current_node, next_node, forward_name)
|
|
233
|
-
3. Threshold met → session commits to history (all completed Forwards recorded);
|
|
234
|
-
node transitions; session resets; new Forwards unlocked
|
|
235
|
-
4. OR threshold NOT met → session stays open; more Forwards can execute in same session;
|
|
236
|
-
weight from repeated same Forwards ignored
|
|
237
|
-
5. OR competing Pair wins first → other incomplete Pairs abandoned; next session starts on winner node
|
|
238
|
-
```
|
|
150
|
+
The runtime loop: (1) Query active Forwards via `onchain_objects` (reveals current node + available Pairs/Forwards); (2) Execute Forward → weight accumulates in session, Guard validates (pass/fail), `retained_submission` stores values indexed by `(current_node, next_node, forward_name)`; (3) Threshold met → session commits to history, node transitions, session resets, new Forwards unlocked; (4) Threshold NOT met → session stays open, more Forwards can execute, repeated same Forwards ignored; (5) Competing Pair wins first → other incomplete Pairs abandoned.
|
|
239
151
|
|
|
240
152
|
**What the user sees**: At any node, callers can discover which Forwards are available (by querying the Machine definition and cross-referencing with their permissions). Executing a Forward that requires a Guard triggers Guard verification — the caller must submit required data. Successful Forward execution is recorded on-chain; failed Guard rejections are visible as transaction errors.
|
|
241
153
|
|
|
@@ -286,7 +198,7 @@ Decompose complex workflows into multiple Machines connected by Guard-based vali
|
|
|
286
198
|
3. "Does any step depend on an external process completing first?"
|
|
287
199
|
4. "Which party creates the sub-order, and which party verifies it?"
|
|
288
200
|
|
|
289
|
-
> **Guard construction**: Cross-Machine Guards use `convert_witness` with Progress query instructions.
|
|
201
|
+
> **Guard construction**: Cross-Machine Guards use `convert_witness` with Progress query instructions. Design rules now live in the MCP knowledge layer — see `knowledge/guard-design-patterns.ts` (`GUARD_DESIGN_PATTERNS`), applied via `project_operation.aggregate_risks`. Query available Guard instructions via `wowok_buildin_info`.
|
|
290
202
|
|
|
291
203
|
### Dual-Signature Consensus
|
|
292
204
|
|
|
@@ -329,28 +241,10 @@ Before `publish: true`, verify:
|
|
|
329
241
|
|
|
330
242
|
## Guard + Machine Immutability Deadlock
|
|
331
243
|
|
|
332
|
-
Both Guards and published Machines are **immutable**:
|
|
333
|
-
|
|
334
|
-
```
|
|
335
|
-
Guard created with bug → Cannot fix (immutable)
|
|
336
|
-
→ Must create new Guard
|
|
337
|
-
→ Must rebind to Machine
|
|
338
|
-
→ Machine already published? Cannot modify (immutable)
|
|
339
|
-
→ DEADLOCK: new Guard exists but cannot be attached
|
|
340
|
-
```
|
|
244
|
+
Both Guards and published Machines are **immutable**. A Guard created with a bug cannot be fixed (immutable) → must create new Guard → must rebind to Machine → but Machine already published cannot be modified (immutable) → **DEADLOCK**: new Guard exists but cannot be attached.
|
|
341
245
|
|
|
342
246
|
**Prevention**: Test every Guard via `gen_passport` before binding. Verify computation tree, submission types, and query instructions against all scenarios.
|
|
343
247
|
|
|
344
248
|
**If deadlocked**: Only recovery is a completely new Machine with new nodes and Guard bindings, then rebind to Service. Keep Machines unpublished until all Guards are verified.
|
|
345
249
|
|
|
346
|
-
---
|
|
347
|
-
|
|
348
|
-
## Appendices (Progressive Disclosure)
|
|
349
|
-
|
|
350
|
-
> The following sections have been extracted to [APPENDIX.md](./APPENDIX.md) for on-demand loading:
|
|
351
|
-
> - Dialogue Scripts / Onboarding Flow (R1-R10) — guided conversation scripts
|
|
352
|
-
> - Decision Trees — branching logic reference
|
|
353
|
-
> - Failure Playbooks — recovery scenarios
|
|
354
|
-
> - Tier Layering — expertise-tier based guidance
|
|
355
|
-
>
|
|
356
|
-
> Load APPENDIX.md when the user needs guided dialogue, recovery help, or tier-specific guidance.
|
|
250
|
+
---
|
package/wowok-messenger/SKILL.md
CHANGED
|
@@ -25,7 +25,7 @@ always: false
|
|
|
25
25
|
End-to-end encrypted messaging with tamper-proof audit trails.
|
|
26
26
|
|
|
27
27
|
> **Role**: Any WoWok participant
|
|
28
|
-
>
|
|
28
|
+
> All 16 operations with full parameter types and constraints are in the MCP schema (`messenger_operation`). This document focuses on **design decisions and strategy** not captured by the schema.
|
|
29
29
|
> **Related Skills**: [wowok-guard](../wowok-guard/SKILL.md) (guard design), [wowok-arbitrator](../wowok-arbitrator/SKILL.md) (WTS evidence in disputes), [wowok-order](../wowok-order/SKILL.md) (customer perspective), [wowok-provider](../wowok-provider/SKILL.md) (service provider perspective), [wowok-safety](../wowok-safety/SKILL.md) (safety)
|
|
30
30
|
|
|
31
31
|
---
|
|
@@ -65,6 +65,14 @@ Before any communication:
|
|
|
65
65
|
|
|
66
66
|
A single device supports up to 1000 messenger accounts. Exceeding this returns "Maximum 1000 messenger accounts allowed". Use `account_operation → messenger { m: null }` to disable unused accounts.
|
|
67
67
|
|
|
68
|
+
### Contact Object (On-Chain Bridge)
|
|
69
|
+
|
|
70
|
+
The on-chain **Contact** object (`operation_type: "contact"`) is the bridge between a Service and Messenger: `Service.um` → Contact → `ims[]` (Messenger endpoint addresses). Customers query the Contact's `ims[]` to find where to send messages.
|
|
71
|
+
|
|
72
|
+
**When to create**: Before Service publish, when `customer_required` is set (Service.um must point to a Contact). Reuse an existing Contact if you serve multiple Services with the same support channel.
|
|
73
|
+
|
|
74
|
+
**Lifecycle**: Contact is mutable (unlike Proof/Guard). `im_add`/`im_remove` require permission index 453 (CONTACT_IM). No events emitted on IM mutations — poll `ims[]` field. If Contact is bound to `Permission.um` via `permission_um_set`, clear that binding BEFORE deleting the Contact (else dangling pointer). Full business guidance: [wowok-tools](../wowok-tools/SKILL.md) §"Contact (Service.um Bridge)".
|
|
75
|
+
|
|
68
76
|
---
|
|
69
77
|
|
|
70
78
|
## Daily Communication
|
|
@@ -109,12 +117,7 @@ Three independently managed lists. Schema covers all operations — here are the
|
|
|
109
117
|
|
|
110
118
|
## Anti-Spam Strategy
|
|
111
119
|
|
|
112
|
-
The four-layer protection model evaluates every incoming message:
|
|
113
|
-
|
|
114
|
-
```
|
|
115
|
-
Blacklist → Friends List → Guard Verification → Stranger Rules
|
|
116
|
-
(reject) (accept) (accept if passport valid) (one-message limit)
|
|
117
|
-
```
|
|
120
|
+
The four-layer protection model evaluates every incoming message: Blacklist (reject) → Friends List (accept) → Guard Verification (accept if passport valid) → Stranger Rules (one-message limit).
|
|
118
121
|
|
|
119
122
|
This section covers **how to configure these layers intelligently** for different user profiles — configuration combinations, not just field descriptions.
|
|
120
123
|
|
|
@@ -193,15 +196,7 @@ A WTS file is a **tamper-proof, self-verifying export** of a continuous conversa
|
|
|
193
196
|
|
|
194
197
|
### The Workflow
|
|
195
198
|
|
|
196
|
-
When a dispute requires evidence:
|
|
197
|
-
|
|
198
|
-
```
|
|
199
|
-
1. generate_wts → export messages by time/messageId/seqIndex range
|
|
200
|
-
2. sign_wts → add your Falcon512 signature (both parties can sign)
|
|
201
|
-
3. verify_wts → validate hash chain, continuity, and all signatures
|
|
202
|
-
4. wts2html → (optional) convert to human-readable HTML
|
|
203
|
-
5. send_file → submit signed WTS to the arbitrator via messenger
|
|
204
|
-
```
|
|
199
|
+
When a dispute requires evidence: (1) `generate_wts` → export messages by time/messageId/seqIndex range; (2) `sign_wts` → add your Falcon512 signature (both parties can sign); (3) `verify_wts` → validate hash chain, continuity, and all signatures; (4) `wts2html` → (optional) convert to human-readable HTML; (5) `send_file` → submit signed WTS to the arbitrator via messenger.
|
|
205
200
|
|
|
206
201
|
> **Key design decision**: Include the **full conversation** when generating WTS for arbitration — not just favorable messages. The arbitrator needs to see who said what, who acknowledged what, and the exact sequence. Selective exports undermine your credibility.
|
|
207
202
|
|
|
@@ -219,41 +214,11 @@ When a dispute requires evidence:
|
|
|
219
214
|
|
|
220
215
|
## Messenger Across Roles
|
|
221
216
|
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
### Customer
|
|
225
|
-
|
|
226
|
-
| Touchpoint | Messenger Operation | When |
|
|
227
|
-
|------------|-------------------|------|
|
|
228
|
-
| Pre-order inquiry | `send_message` to service provider | Before order creation — ask about service details, pricing, custom requirements |
|
|
229
|
-
| Submit required info | `send_message` with delivery address, phone, etc. | After order creation — the Service's `customer_required` fields dictate what to send |
|
|
230
|
-
| Track progress | `watch_messages` with provider | During order fulfillment — receive status updates |
|
|
231
|
-
| Raise dispute | `generate_wts` + `sign_wts` + `send_file` to arbitrator | When resolution fails — submit evidence |
|
|
217
|
+
**Customer**: Pre-order inquiry (`send_message` to provider) → submit required info (`customer_required` fields) → track progress (`watch_messages`) → raise dispute (`generate_wts` + `sign_wts` + `send_file` to arbitrator). Full workflow: [wowok-order](../wowok-order/SKILL.md).
|
|
232
218
|
|
|
233
|
-
|
|
219
|
+
**Service Provider**: Monitor inquiries (`watch_conversations` with `unreadOnly` or `listFilterMode: "stranger"`) → respond to customers (reply auto-adds to friends) → request customer info → document agreements (creates evidence trail) → dispute defense (`generate_wts` + `sign_wts` + `send_file`). Full workflow: [wowok-provider](../wowok-provider/SKILL.md).
|
|
234
220
|
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
| Touchpoint | Messenger Operation | When |
|
|
238
|
-
|------------|-------------------|------|
|
|
239
|
-
| Monitor inquiries | `watch_conversations` with `unreadOnly` or `listFilterMode: "stranger"` | Daily — check for new customer messages |
|
|
240
|
-
| Respond to customers | `send_message` (reply auto-adds to friends) | As needed — timely response builds trust |
|
|
241
|
-
| Request customer info | `send_message` asking for `customer_required` fields | After order creation if not yet provided |
|
|
242
|
-
| Document agreements | `send_message` confirming terms, changes, custom work | Immediately after agreement — creates evidence trail |
|
|
243
|
-
| Dispute defense | `generate_wts` + `sign_wts` + `send_file` | When a customer escalates — prove good-faith communication |
|
|
244
|
-
|
|
245
|
-
> **Full workflow**: See [wowok-provider](../wowok-provider/SKILL.md) for the complete service provider journey.
|
|
246
|
-
|
|
247
|
-
### Arbitrator
|
|
248
|
-
|
|
249
|
-
| Touchpoint | Messenger Operation | When |
|
|
250
|
-
|------------|-------------------|------|
|
|
251
|
-
| Receive evidence | `watch_messages` or `watch_conversations` | When parties submit WTS files |
|
|
252
|
-
| Verify evidence | `verify_wts` on received files | Before reviewing — ensure evidence integrity |
|
|
253
|
-
| Communicate with parties | `send_message` for clarification requests | During dispute review |
|
|
254
|
-
| Sign attestation | `sign_wts` on verified evidence | After verification — arbitrator endorses authenticity |
|
|
255
|
-
|
|
256
|
-
> **Full workflow**: See [wowok-arbitrator](../wowok-arbitrator/SKILL.md) for the complete arbitration process.
|
|
221
|
+
**Arbitrator**: Receive evidence (`watch_messages`/`watch_conversations`) → verify evidence (`verify_wts`) → communicate with parties (`send_message` for clarifications) → sign attestation (`sign_wts` on verified evidence). Full workflow: [wowok-arbitrator](../wowok-arbitrator/SKILL.md).
|
|
257
222
|
|
|
258
223
|
---
|
|
259
224
|
|
|
@@ -267,13 +232,3 @@ This section shows **how Messenger fits into each participant's workflow** — n
|
|
|
267
232
|
- **Stale passports**: `passportValiditySeconds` too short causes frequent re-verification failures. Match duration to your Guard's data volatility.
|
|
268
233
|
|
|
269
234
|
---
|
|
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.
|
package/wowok-onboard/SKILL.md
CHANGED
|
@@ -24,7 +24,21 @@ when_to_use:
|
|
|
24
24
|
|
|
25
25
|
Guides a new merchant from zero to first published Service in 10 rounds. Each round collects one core decision, calls specific MCP operations, and verifies success before advancing.
|
|
26
26
|
|
|
27
|
-
> **Related Skills**: [wowok-
|
|
27
|
+
> **Related Skills**: [wowok-provider](../wowok-provider/SKILL.md) (post-onboard operations), [wowok-machine](../wowok-machine/SKILL.md) (workflow design)
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
## MCP Knowledge Layer
|
|
32
|
+
|
|
33
|
+
The following content has been pushed down to the MCP knowledge layer and is applied automatically — this Skill no longer duplicates it:
|
|
34
|
+
|
|
35
|
+
| Content | MCP Knowledge Module | Applied Via |
|
|
36
|
+
|---------|---------------------|-------------|
|
|
37
|
+
| Scenario mode details (per-industry Permission/Machine/Guard/Allocator defaults) | `knowledge/scenario-modes.ts` (`SCENARIO_MODES`, `matchScenarioMode`, `inferScenarioTraits`) | `project_operation.analyze_intent` — auto-applied when `industry` parameter is passed |
|
|
38
|
+
| Safety rules (immutability, confirmation, object reuse) | `knowledge/safety-rules.ts` (`CONFIRMATION_RULES`) | Pre-publish checks + `project_operation.aggregate_risks` |
|
|
39
|
+
| Guard / Machine design rules | `knowledge/guard-design-patterns.ts`, `machine-risk.ts` | `project_operation.aggregate_risks` |
|
|
40
|
+
|
|
41
|
+
This Skill keeps the **overall onboarding flow** and **R1-R10 build order** (see below). Pass the user's industry to `analyze_intent` and the MCP layer auto-fills the scenario defaults — no need to look up per-industry presets manually.
|
|
28
42
|
|
|
29
43
|
---
|
|
30
44
|
|
|
@@ -35,7 +49,7 @@ The onboarding skill dismantles the "16 operation_type × 14 object_type" wall.
|
|
|
35
49
|
### What This Skill Does
|
|
36
50
|
|
|
37
51
|
- Converts "I want to open a shop" into a 10-round guided build plan
|
|
38
|
-
-
|
|
52
|
+
- Industry defaults auto-applied via `project_operation.analyze_intent` (pass `industry` parameter; defaults sourced from MCP `knowledge/scenario-modes.ts`)
|
|
39
53
|
- Enforces dependency order: Permission → Service → Machine → Progress → Guard → Allocation → Order → Publish
|
|
40
54
|
- Persists checkpoints after each round via `local_info_operation` so users can resume
|
|
41
55
|
- Hands off to [wowok-provider](../wowok-provider/SKILL.md) once the Service is published
|
|
@@ -53,13 +67,29 @@ A published Service with: published Machine, bound Progress, validated Guards, c
|
|
|
53
67
|
|
|
54
68
|
---
|
|
55
69
|
|
|
56
|
-
##
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
70
|
+
## MCP 5-Stage Pipeline Integration
|
|
71
|
+
|
|
72
|
+
The onboarding flow is gated by the MCP project-based 5-stage deployment pipeline. Each stage gates progression — the AI MUST honor `can_proceed: false` by stopping and fixing reported issues:
|
|
73
|
+
|
|
74
|
+
| Stage | Rounds | MCP Action | Gate |
|
|
75
|
+
|-------|--------|------------|------|
|
|
76
|
+
| 1. Project Naming | R1-R2 | Establish `project` + `version` namespace | — |
|
|
77
|
+
| 2. Business Puzzle | R2 | `analyze_intent` (pass `industry`) → ODG + missing fields + `next_step` | — |
|
|
78
|
+
| 3. Risk Calibration | After R8 | `aggregate_risks` → risk assessment across all puzzles | CRITICAL risks block |
|
|
79
|
+
| 4. Deployment Doc | After risks pass | `generate_deployment_doc` → deployment doc with D-01..D-18 checks | D-errors block R9 |
|
|
80
|
+
| 5. Substep Trace | R9-R10 | `trace_substeps` → validate substep linkage (D-10 check) | Linkage errors block publish |
|
|
81
|
+
|
|
82
|
+
## R1-R10 Build Order
|
|
83
|
+
|
|
84
|
+
| Round | Object | MCP Operation | Key Decision |
|
|
85
|
+
|-------|--------|---------------|--------------|
|
|
86
|
+
| R1 | Account | `account_operation.gen` + `faucet` | New or reuse? |
|
|
87
|
+
| R2 | Industry mode | `project_operation.analyze_intent` (pass `industry`) | Which driving mode? |
|
|
88
|
+
| R3 | Service | `onchain_operations.service` CREATE | Name, type_parameter, description |
|
|
89
|
+
| R4 | Permission | `onchain_operations.permission` CREATE/REUSE | Indexes 1000/1500 (customer uses `namedOperator:""`) |
|
|
90
|
+
| R5 | Machine | `onchain_operations.machine` CREATE | Nodes, forwards (mode defaults from MCP) |
|
|
91
|
+
| R6 | Progress | `onchain_operations.progress` CREATE + bind | Mirror Machine nodes |
|
|
92
|
+
| R7 | Guards | `onchain_operations.guard` CREATE + `gen_passport` test | 5 Guard templates (mode defaults from MCP) |
|
|
93
|
+
| R8 | Allocation | `onchain_operations.allocation` CREATE + `service.order_allocators` | Fund split (mode defaults from MCP) |
|
|
94
|
+
| R9 | Test order | `onchain_operations.order` CREATE + `progress` advance + `allocation.alloc_by_guard` | Full flow dry run |
|
|
95
|
+
| R10 | Publish | `onchain_operations.machine` publish + `service` publish | Pre-publish audit must PASS |
|