@wowok/skills 1.2.2 → 1.2.4
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/package.json +2 -1
- package/references/glossary.ts +297 -0
- package/references/guard-scenario-ledger.md +353 -0
- package/references/guard-template-library.md +481 -0
- package/references/machine-design-reference.md +398 -0
- package/references/machine-scenario-ledger.md +227 -0
- package/references/machine-template-library.md +522 -0
- package/references/merchant-scenario-coordination.md +383 -0
- package/references/object-collaboration.md +362 -0
- package/references/onchain-constants.md +81 -0
- package/scripts/install.js +15 -0
- package/wowok-arbitrator/SKILL.md +3 -3
- package/wowok-guard/APPENDIX.md +4 -2
- package/wowok-guard/SKILL.md +4 -4
- package/wowok-machine/SKILL.md +3 -3
- package/wowok-messenger/SKILL.md +1 -1
- package/wowok-onboard/APPENDIX.md +34 -4
- package/wowok-order/SKILL.md +4 -4
- package/wowok-planner/APPENDIX.md +27 -1
- package/wowok-provider/APPENDIX.md +31 -1
- package/wowok-provider/SKILL.md +20 -18
- package/wowok-safety/APPENDIX.md +17 -13
- package/wowok-safety/SKILL.md +1 -1
- package/wowok-tools/APPENDIX.md +67 -61
- package/wowok-tools/SKILL.md +45 -17
|
@@ -9,6 +9,20 @@
|
|
|
9
9
|
|
|
10
10
|
Every round follows the same shape: state the goal, ask the key question(s), execute the MCP calls, verify success criteria, persist checkpoint, fall back on failure.
|
|
11
11
|
|
|
12
|
+
> **Tool Call Convention**: All tool references in this document (e.g., `onchain_operations`, `query_toolkit`, `account_operation`) are sub-tools invoked via the single unified `wowok` tool. Translate every reference to `wowok({ tool: "<sub-tool-name>", data: {<params>} })`. See [wowok-tools](../wowok-tools/SKILL.md) for the full interface.
|
|
13
|
+
|
|
14
|
+
## Project-Based Deployment Integration
|
|
15
|
+
|
|
16
|
+
The onboarding flow is integrated with the MCP project-based 5-stage deployment pipeline. Each stage gates progression to the next, with `project_operation` action calls providing deterministic validation:
|
|
17
|
+
|
|
18
|
+
- **Stage 1 (Project Naming)** → R1-R2 — establish `project` namespace and `version` for all subsequent calls
|
|
19
|
+
- **Stage 2 (Business Puzzle)** → R2 calls `project_operation` → `action: "analyze_intent"` to obtain the Object Dependency Graph (ODG), missing field list (puzzles), and `next_step` guidance that drives R3-R8 field completion
|
|
20
|
+
- **Stage 3 (Risk Calibration)** → after R8 checkpoint, calls `project_operation` → `action: "aggregate_risks"` to evaluate risk across all puzzles; CRITICAL risks block progression
|
|
21
|
+
- **Stage 4 (Deployment Doc)** → once risks pass, calls `project_operation` → `action: "generate_deployment_doc"` to produce the deployment document; D-errors block progression to R9
|
|
22
|
+
- **Stage 5 (Substep Trace)** → R9-R10 calls `project_operation` → `action: "trace_substeps"` to validate substep linkage integrity (D-10 check) before execution via `onchain_operations`
|
|
23
|
+
|
|
24
|
+
All `project_operation` calls return a `can_proceed` boolean and a `next_action` hint. The onboarding AI MUST honor the gate semantics: stop on `can_proceed: false`, fix the reported issues, and only proceed when `can_proceed: true`.
|
|
25
|
+
|
|
12
26
|
### R1: Welcome + Account Setup
|
|
13
27
|
|
|
14
28
|
**AI Goal**: Confirm the user is new (or resuming), establish the working account, fund it via faucet if empty.
|
|
@@ -28,7 +42,7 @@ Every round follows the same shape: state the goal, ask the key question(s), exe
|
|
|
28
42
|
|
|
29
43
|
**Fallback**: Faucet fails → instruct user to wait 60s and retry, or fund via `transfer` from another account they own. Account name collision → append `_v1`, `_v2` per wowok-safety §1.1.
|
|
30
44
|
|
|
31
|
-
**Checkpoint**: Persist `{ round: R1, account: <name>, balance: <n> }` via `local_info_operation`.
|
|
45
|
+
**Checkpoint**: Persist `{ round: R1, account: <name>, balance: <n>, project: <project_name>, version: <version> }` via `local_info_operation`. The `project` and `version` fields establish the Stage 1 Project Naming namespace and MUST be carried forward in every subsequent `project_operation` call (Stage 2-5) and referenced in checkpoints R2-R10.
|
|
32
46
|
|
|
33
47
|
---
|
|
34
48
|
|
|
@@ -42,6 +56,7 @@ Every round follows the same shape: state the goal, ask the key question(s), exe
|
|
|
42
56
|
- Will you need to ship physical goods?
|
|
43
57
|
|
|
44
58
|
**Tool Calls**:
|
|
59
|
+
0. `project_operation` → `action: "analyze_intent"` with `project`, `version`, `user_intent`, `industry` — 获取 ODG + 缺失字段清单 + 下一步建议。MCP 返回的 puzzles 和 next_step 指导后续 R3-R8 的字段补全。
|
|
45
60
|
1. Internally classify the user's answers into `traits` (`has_logistics`, `communication_heavy`, `pure_digital`, `long_cycle`, `deposit_required`, `multi_tier_allocation`).
|
|
46
61
|
2. Match to a mode via [wowok-scenario](../wowok-scenario/SKILL.md) §Mode Selection Logic:
|
|
47
62
|
- freelance (Phase 1) — pure digital, no deposit, milestone allocation
|
|
@@ -73,7 +88,7 @@ Every round follows the same shape: state the goal, ask the key question(s), exe
|
|
|
73
88
|
1. `onchain_operations` → `operation_type: "service"` with:
|
|
74
89
|
- `data.name`, `data.type_parameter`, `data.description`
|
|
75
90
|
- `data.permission` left empty for now (Permission comes in R4) OR pass a Permission object shape that auto-creates (wowok-safety §1.1 — SDK auto-creates a Permission if object shape passed)
|
|
76
|
-
- `publish: false` (mandatory — Service stays draft)
|
|
91
|
+
- `publish: false` (mandatory — **DRAFT** creation, Service stays draft until R10 publish; this is a deliberate two-phase pattern: draft in R3-R8 allows iterative MODIFY, then irreversible publish in R10)
|
|
77
92
|
- `env.account` = R1 account
|
|
78
93
|
2. (Optional, physical goods) `wip_file` → `generate` to produce WIP file URL + hash for product metadata
|
|
79
94
|
3. `local_mark_operation` → tag the new Service with a friendly name (e.g., `freelance_logo_v1`)
|
|
@@ -204,6 +219,18 @@ Every round follows the same shape: state the goal, ask the key question(s), exe
|
|
|
204
219
|
|
|
205
220
|
**Checkpoint**: Persist `{ round: R8, allocators: [{name, id, trigger_guard}], refund_path_covered: true }`.
|
|
206
221
|
|
|
222
|
+
**Stage 3 Gate: Risk Calibration**
|
|
223
|
+
After R8 checkpoint, call `project_operation` → `action: "aggregate_risks"` with `project`, `version`, `puzzles` (from R2's analyze_intent).
|
|
224
|
+
- If `can_proceed: false` (CRITICAL risks) → fix risks before proceeding
|
|
225
|
+
- If `can_proceed: true` → proceed to Stage 4
|
|
226
|
+
- The `next_action` field tells you the next step
|
|
227
|
+
|
|
228
|
+
**Stage 4 Gate: Deployment Document**
|
|
229
|
+
After risks pass, call `project_operation` → `action: "generate_deployment_doc"` with `project`, `version`, `business_intent`, `objects`, `edges`, `steps`, `risk_status`, `risk_critical_count`, `risk_high_count`.
|
|
230
|
+
- If `can_proceed: false` (D-errors) → fix doc errors
|
|
231
|
+
- If `can_proceed: true` → proceed to R9 (deployment execution)
|
|
232
|
+
- The `next_action` field tells you the next step
|
|
233
|
+
|
|
207
234
|
---
|
|
208
235
|
|
|
209
236
|
### R9: Test Order (Dry Run)
|
|
@@ -215,6 +242,9 @@ Every round follows the same shape: state the goal, ask the key question(s), exe
|
|
|
215
242
|
- Confirm test parameters: test amount, test deliverable hash.
|
|
216
243
|
|
|
217
244
|
**Tool Calls**:
|
|
245
|
+
0. `project_operation` → `action: "trace_substeps"` with `project`, `version`, `network`, `substeps` (from Stage 4 deployment doc) — 验证子步骤衔接完整性 (D-10 check).
|
|
246
|
+
- If `can_proceed: false` → fix substep issues
|
|
247
|
+
- If `can_proceed: true` → execute substeps via onchain_operations
|
|
218
248
|
1. `account_operation` → `gen` (second account, the "buyer")
|
|
219
249
|
2. `account_operation` → `faucet` for the buyer
|
|
220
250
|
3. `onchain_operations` → `operation_type: "order"` CREATE — buyer places order on the Service draft
|
|
@@ -244,9 +274,9 @@ Every round follows the same shape: state the goal, ask the key question(s), exe
|
|
|
244
274
|
- `machineNode2file` → export Machine, verify topology
|
|
245
275
|
- `guard2file` → export all Guards, verify logic
|
|
246
276
|
- `query_toolkit` → `onchain_objects` → re-check Permission, Service, Machine, Progress, Guards, Allocation all exist and are correctly bound
|
|
247
|
-
2. `onchain_operations` → `operation_type: "machine"` with `publish: true`
|
|
277
|
+
2. **Publish Machine FIRST** — `onchain_operations` → `operation_type: "machine"` with `publish: true` (PUBLISH, irreversible). Machine locked. This MUST happen before Service publish because the Service depends on a published Machine.
|
|
248
278
|
3. `onchain_operations` → `operation_type: "service"` MODIFY to bind `data.machine = "<published_machine_id>"`
|
|
249
|
-
4. `onchain_operations` → `operation_type: "service"` with `publish: true`
|
|
279
|
+
4. **Publish Service SECOND** — `onchain_operations` → `operation_type: "service"` with `publish: true` (PUBLISH, irreversible). Service locked. Order is mandatory: **Machine first, then Service** (Service depends on Machine).
|
|
250
280
|
5. (Optional) `onchain_operations` → `operation_type: "service"` MODIFY to add `compensation_fund_add` and `setting_locked_time_add`
|
|
251
281
|
6. Post-publish verification:
|
|
252
282
|
- `query_toolkit` → `onchain_objects` (Service) → confirm `bPublished: true`, `machine` field is locked, `order_allocators` is locked
|
package/wowok-order/SKILL.md
CHANGED
|
@@ -245,7 +245,7 @@ Clarify via Messenger: deliverables (E2 WIP), timeline (E3 nodes), refund/cancel
|
|
|
245
245
|
|
|
246
246
|
## Phase 3: Order Creation
|
|
247
247
|
|
|
248
|
-
Schema: `
|
|
248
|
+
Schema: `wowok({ tool: "schema_query", data: { action: "get", name: "onchain_operations_service" } })`. Safety: [wowok-safety](../wowok-safety/SKILL.md).
|
|
249
249
|
|
|
250
250
|
**Not in schema**:
|
|
251
251
|
- Excess `buy.total_pay` auto-refunded. Agents cannot withdraw.
|
|
@@ -257,7 +257,7 @@ Post-creation: notify via Messenger with order ID.
|
|
|
257
257
|
|
|
258
258
|
## Phase 4: Order Operations
|
|
259
259
|
|
|
260
|
-
Schema: `
|
|
260
|
+
Schema: `wowok({ tool: "schema_query", data: { action: "get", name: "onchain_operations_order" } })`.
|
|
261
261
|
|
|
262
262
|
### Progress Advancement
|
|
263
263
|
|
|
@@ -277,7 +277,7 @@ Present all three dimensions. Never just the operation name.
|
|
|
277
277
|
|
|
278
278
|
## Phase 5: Arbitration
|
|
279
279
|
|
|
280
|
-
Schema: `
|
|
280
|
+
Schema: `wowok({ tool: "schema_query", data: { action: "get", name: "onchain_operations_arbitration" } })`. Process: [wowok-arbitrator](../wowok-arbitrator/SKILL.md).
|
|
281
281
|
|
|
282
282
|
Flow: `arbitration.dispute` → WTS evidence → Messenger → `order.arb_confirm` → voting → (`order.arb_objection`) → `order.arb_claim_compensation`.
|
|
283
283
|
|
|
@@ -410,7 +410,7 @@ Toggle example: `config_operation` → `action: "toggle"`, `service: "order_moni
|
|
|
410
410
|
|
|
411
411
|
## Quick Reference
|
|
412
412
|
|
|
413
|
-
Schemas: `
|
|
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
414
|
|
|
415
415
|
### Phase Dependency
|
|
416
416
|
|
|
@@ -9,6 +9,20 @@
|
|
|
9
9
|
|
|
10
10
|
Each round follows: state the goal, ask the minimum questions needed, gather inputs (LLM translation only when free text is ambiguous), update the ODG in memory, persist checkpoint, advance.
|
|
11
11
|
|
|
12
|
+
> **Tool Call Convention**: All tool references in this document (e.g., `project_operation`, `onchain_operations`) are sub-tools invoked via the single unified `wowok` tool. Translate every reference to `wowok({ tool: "<sub-tool-name>", data: {<params>} })`. See [wowok-tools](../wowok-tools/SKILL.md) for the full interface.
|
|
13
|
+
|
|
14
|
+
## Project-Based Deployment Integration
|
|
15
|
+
|
|
16
|
+
The planner flow integrates with the MCP project-based deployment pipeline (5 stages). Each stage maps to specific R rounds:
|
|
17
|
+
|
|
18
|
+
- **Stage 1 (Project Naming)** → R1 — establish the `project` and `version` identifiers used by all subsequent `project_operation` calls.
|
|
19
|
+
- **Stage 2 (Business Puzzle)** → R1 — call `project_operation` → `action: "analyze_intent"` to replace internal Scenario Registry matching; the MCP side performs Scenario Registry matching + ODG skeleton generation + puzzle initialization in one call.
|
|
20
|
+
- **Stage 3 (Risk Calibration)** → R9 — call `project_operation` → `action: "aggregate_risks"` to perform L1/L2/L3 risk assessment on the assembled puzzles.
|
|
21
|
+
- **Stage 4 (Deployment Doc)** → after R9 — call `project_operation` → `action: "generate_deployment_doc"` to produce the markdown deployment doc with D-01..D-18 scanner checks.
|
|
22
|
+
- **Stage 5 (Substep Trace)** → R10 — call `project_operation` → `action: "trace_substeps"` to verify substep continuity before handoff to the Harness.
|
|
23
|
+
|
|
24
|
+
All `project_operation` calls use the unified `project` + `version` keys established in R1. The `next_action` field returned by each call drives the stage transition.
|
|
25
|
+
|
|
12
26
|
### R1: Intent Capture
|
|
13
27
|
|
|
14
28
|
**AI Goal**: Capture the user's natural-language intent and classify it against the Scenario Registry.
|
|
@@ -20,7 +34,7 @@ Each round follows: state the goal, ask the minimum questions needed, gather inp
|
|
|
20
34
|
|
|
21
35
|
**Tool Calls**:
|
|
22
36
|
1. `query_toolkit` → `local_names` — check for any prior planning checkpoint to offer a resume path.
|
|
23
|
-
2. (
|
|
37
|
+
2. `project_operation` → `action: "analyze_intent"` with `project`, `version`, `user_intent`, `industry` (if known) — MCP 内部完成 Scenario Registry 匹配 + ODG 生成 + puzzle 初始化. Returns `puzzles`, `next_step`, `next_action`. If `next_action: "aggregate_risks"` indicates puzzles are complete, you can proceed directly to Stage 3.
|
|
24
38
|
3. If no candidate matches → select `general` scenario (no failure — the fallback is intentional).
|
|
25
39
|
|
|
26
40
|
**Success Criteria**: A `scenario` field is set on the ODG (one of `freelance`, `rental`, `digital_goods`, `travel_package`, `general`). The scenario's ODG template is loaded as the working skeleton.
|
|
@@ -193,6 +207,9 @@ Each round follows: state the goal, ask the minimum questions needed, gather inp
|
|
|
193
207
|
- Confirm the fund-risk paths (deposit escrow, refund Allocator)?
|
|
194
208
|
|
|
195
209
|
**Tool Calls**:
|
|
210
|
+
0. `project_operation` → `action: "aggregate_risks"` with `project`, `version`, `puzzles` (from R1's analyze_intent) — MCP 内部完成 L1/L2/L3 风险评估. Returns `findings`, `can_proceed`, `next_action`.
|
|
211
|
+
- If `can_proceed: false` (CRITICAL risks) → record in ODG risk_assessment, block execution
|
|
212
|
+
- If `can_proceed: true` → proceed to Stage 4
|
|
196
213
|
1. (Internal) Compute `reversible` per object (see §Reversibility Matrix).
|
|
197
214
|
2. (Internal) Estimate `estimated_time` per phase from scenario template defaults (Tier 1 ≈ 10 min, Tier 2 ≈ 30 min, Tier 3 ≈ 60 min, excluding human response time).
|
|
198
215
|
3. (Internal) List every object whose creation or publish is irreversible; require explicit per-item acknowledgment.
|
|
@@ -203,6 +220,12 @@ Each round follows: state the goal, ask the minimum questions needed, gather inp
|
|
|
203
220
|
|
|
204
221
|
**Checkpoint**: Persist `{ round: R9, risk_assessment, acknowledgments: [...] }`.
|
|
205
222
|
|
|
223
|
+
**Stage 4 Gate: Deployment Document**
|
|
224
|
+
After risks pass, call `project_operation` → `action: "generate_deployment_doc"` with `project`, `version`, `business_intent`, `objects`, `edges`, `steps`, `risk_status`, `risk_critical_count`, `risk_high_count`.
|
|
225
|
+
- Returns markdown deployment doc + D-01..D-18 scanner checks
|
|
226
|
+
- If `can_proceed: false` (D-errors) → fix doc errors
|
|
227
|
+
- If `can_proceed: true` → proceed to R10
|
|
228
|
+
|
|
206
229
|
---
|
|
207
230
|
|
|
208
231
|
### R10: Execution Handoff
|
|
@@ -214,6 +237,9 @@ Each round follows: state the goal, ask the minimum questions needed, gather inp
|
|
|
214
237
|
- Which execution delegate should run the phases? (default: wowok-onboard for a fresh build; wowok-provider for extensions)
|
|
215
238
|
|
|
216
239
|
**Tool Calls**:
|
|
240
|
+
0. `project_operation` → `action: "trace_substeps"` with `project`, `version`, `network`, `substeps` (from Stage 4 deployment doc) — 验证子步骤衔接完整性.
|
|
241
|
+
- If `can_proceed: false` → fix substep issues before handoff
|
|
242
|
+
- If `can_proceed: true` → handoff to Harness/wowok-onboard for execution
|
|
217
243
|
1. (Internal) Emit the Harness handoff packet (see §Handoff Protocol).
|
|
218
244
|
2. `local_info_operation` → persist the final ODG under a stable `task_id` key so the Harness can read it.
|
|
219
245
|
3. (Internal) Register per-phase verification hooks: after each phase, the Harness must re-query on-chain state and reconcile with the ODG before advancing.
|
|
@@ -9,6 +9,18 @@
|
|
|
9
9
|
|
|
10
10
|
A 10-round dialogue for the merchant operations journey: from "I want to set up a service" through "published, live, and accepting orders". This dialogue assumes the merchant has an account (per [wowok-onboard](../wowok-onboard/SKILL.md) R1) and may have a partial configuration. Each round maps to one R-item in the §PRE-FLIGHT checklist or one STEP in the §Service Build Lifecycle. The §Anti-Fabrication Rules are non-negotiable throughout — the AI never invents products, prices, workflow, or fund splits.
|
|
11
11
|
|
|
12
|
+
> **Tool Call Convention**: All tool references in this document (e.g., `onchain_operations`, `query_toolkit`, `messenger_operation`) are sub-tools invoked via the single unified `wowok` tool. Translate every reference to `wowok({ tool: "<sub-tool-name>", data: {<params>} })`. See [wowok-tools](../wowok-tools/SKILL.md) for the full interface.
|
|
13
|
+
|
|
14
|
+
## Project-Based Deployment Integration
|
|
15
|
+
|
|
16
|
+
The provider flow integrates with the MCP project-based deployment pipeline (5 stages). The relevant stages for the operations journey are:
|
|
17
|
+
|
|
18
|
+
- **Stage 3 (Risk Calibration)** → R5 — call `project_operation` → `action: "aggregate_risks"` to replace the manual pre-publish audit checklist with an MCP-driven risk assessment.
|
|
19
|
+
- **Stage 4 (Deployment Doc)** → after R5 — call `project_operation` → `action: "generate_deployment_doc"` to produce the markdown deployment doc with D-01..D-18 scanner checks before publish.
|
|
20
|
+
- **Stage 5 (Substep Trace)** → R6 — call `project_operation` → `action: "trace_substeps"` to verify publish substep continuity before the irreversible publish sequence.
|
|
21
|
+
|
|
22
|
+
All `project_operation` calls use the unified `project` + `version` keys from the prior planning phase (wowok-planner R1). The `next_action` field returned by each call drives the stage transition.
|
|
23
|
+
|
|
12
24
|
### R1: PRE-FLIGHT Checklist Presentation
|
|
13
25
|
|
|
14
26
|
**AI Goal**: Present the R1-R7 checklist (plus conditional C1-C3) and collect the user's intent for each item: REUSE existing, CREATE new, or PENDING. Do NOT proceed to any on-chain action until all items are confirmed.
|
|
@@ -103,6 +115,10 @@ A 10-round dialogue for the merchant operations journey: from "I want to set up
|
|
|
103
115
|
- Confirm: Allocator splits match your stated revenue model?
|
|
104
116
|
|
|
105
117
|
**Tool Calls**:
|
|
118
|
+
0. `project_operation` → `action: "aggregate_risks"` with `project`, `version`, `puzzles` (from prior planning) — MCP 内部完成风险评估, replacing the manual audit checklist.
|
|
119
|
+
- If `can_proceed: false` (CRITICAL risks) → block publish, fix risks
|
|
120
|
+
- If `can_proceed: true` → proceed to deployment doc generation
|
|
121
|
+
- The `next_action` field guides the next step
|
|
106
122
|
1. `guard2file` → export all Guards, present for review.
|
|
107
123
|
2. `machineNode2file` → export the Machine, present for review.
|
|
108
124
|
3. `query_toolkit` → `onchain_objects` for the Service — re-check `machine`, `order_allocators`, `buy_guard`, `permission` all bound correctly.
|
|
@@ -114,6 +130,12 @@ A 10-round dialogue for the merchant operations journey: from "I want to set up
|
|
|
114
130
|
|
|
115
131
|
**Checkpoint**: Persist `{ round: R5, audit_pass: true, user_confirmed: true, guard_exports: [...], machine_export: <path> }`.
|
|
116
132
|
|
|
133
|
+
**Stage 4 Gate: Deployment Document**
|
|
134
|
+
After audit passes, call `project_operation` → `action: "generate_deployment_doc"` with `project`, `version`, `business_intent`, `objects`, `edges`, `steps`, `risk_status`, `risk_critical_count`, `risk_high_count`.
|
|
135
|
+
- Returns markdown deployment doc + D-01..D-18 scanner checks
|
|
136
|
+
- If `can_proceed: false` (D-errors) → fix doc errors before publish
|
|
137
|
+
- If `can_proceed: true` → proceed to R6 (Publish)
|
|
138
|
+
|
|
117
139
|
### R6: Publish (Machine First, Then Service)
|
|
118
140
|
|
|
119
141
|
**AI Goal**: Execute STEP 4: publish the Machine (irreversible), bind it to the Service, then publish the Service (irreversible). Both `machine`/`order_allocators` fields become immutable on Service publish.
|
|
@@ -123,12 +145,20 @@ A 10-round dialogue for the merchant operations journey: from "I want to set up
|
|
|
123
145
|
- Confirm the operating account has sufficient gas.
|
|
124
146
|
|
|
125
147
|
**Tool Calls**:
|
|
148
|
+
0. `project_operation` → `action: "trace_substeps"` with `project`, `version`, `network` (testnet first), `substeps` (from Stage 4 deployment doc) — 验证发布子步骤衔接完整性.
|
|
149
|
+
- If `can_proceed: false` → fix substep issues before publish
|
|
150
|
+
- If `can_proceed: true` → proceed with publish sequence (Machine first, then Service)
|
|
126
151
|
1. `onchain_operations` → `operation_type: "machine"` with `publish: true` — Machine locked.
|
|
127
152
|
2. `onchain_operations` → `operation_type: "service"` MODIFY to bind `data.machine = "<published_machine_id>"`.
|
|
128
153
|
3. `onchain_operations` → `operation_type: "service"` with `publish: true` — Service `machine` and `order_allocators` locked.
|
|
129
154
|
4. Post-publish verification: `query_toolkit` → `onchain_objects` for the Service — confirm `bPublished: true`, `machine` field locked, `order_allocators` locked.
|
|
130
155
|
5. `onchain_events` → confirm Publish event fired.
|
|
131
156
|
|
|
157
|
+
**Publish Order (Irreversibility Notes)**:
|
|
158
|
+
- Machine publish is irreversible (immutable) — nodes, forwards, guards, thresholds all become immutable.
|
|
159
|
+
- Service publish is irreversible (immutable) — `machine` and `order_allocators` fields become locked.
|
|
160
|
+
- **Order**: publish Machine FIRST, then publish Service. Service publish requires the Machine to be published; binding `data.machine` to an unpublished Machine will revert.
|
|
161
|
+
|
|
132
162
|
**Success Criteria**: Both Machine and Service `bPublished: true`. Service `machine` and `order_allocators` fields are immutable. Publish event recorded.
|
|
133
163
|
|
|
134
164
|
**Fallback**: Pre-publish audit fails → return to R5 and fix; do NOT publish. Publish transaction fails (gas) → re-faucet, retry. Service publish fails with "machine not published" → confirm Machine publish succeeded first (use `env.no_cache: true`). Post-publish immutability check fails (rare) → escalate; protocol-level invariant violated.
|
|
@@ -292,7 +322,7 @@ Should I add a Compensation Fund?
|
|
|
292
322
|
|
|
293
323
|
```
|
|
294
324
|
Merchant daily check-in:
|
|
295
|
-
├── New orders? ──→ query_toolkit
|
|
325
|
+
├── New orders? ──→ `wowok({ tool: "query_toolkit", data: { query_type: "onchain_events", ... } })` (NewOrderEvent) → fulfill per Machine workflow
|
|
296
326
|
├── Orders stuck at a node? ──→ query Progress → check Forward operators / Guard submissions → advance or contact customer
|
|
297
327
|
├── Customer messages? ──→ messenger_operation.watch_conversations (unreadOnly: true) → respond
|
|
298
328
|
├── Funds to claim? ──→ allocation.alloc_by_guard (anyone can trigger; verify fund flow)
|
package/wowok-provider/SKILL.md
CHANGED
|
@@ -91,20 +91,22 @@ STEP 0: Present checklist R1-R7 to user
|
|
|
91
91
|
Once R1-R7 confirmed, execute in strict order. All operations use R1 (Account) as `env.account`.
|
|
92
92
|
|
|
93
93
|
```
|
|
94
|
+
All Tool: references below are sub-tools invoked via wowok({ tool: "<name>", data: { operation_type: "<type>", ... } })
|
|
95
|
+
|
|
94
96
|
STEP 1: Foundation
|
|
95
97
|
├── Permission — REUSE existing (strongly recommended)
|
|
96
|
-
│ Tool: onchain_operations (permission) | Fields: name, type_parameter
|
|
98
|
+
│ Tool: "onchain_operations" (permission) | Fields: name, type_parameter
|
|
97
99
|
├── Service (unpublished) — CREATE new
|
|
98
|
-
│ Tool: onchain_operations (service) | Fields: name, type_parameter, permission
|
|
100
|
+
│ Tool: "onchain_operations" (service) | Fields: name, type_parameter, permission
|
|
99
101
|
└── Machine (unpublished) — CREATE new or REUSE template
|
|
100
|
-
Tool: onchain_operations (machine) | Fields: nodes, pairs, forwards
|
|
101
|
-
Discovery: query_toolkit (account_list, local_mark_list, onchain_objects)
|
|
102
|
-
Template: machineNode2file (export existing for editing)
|
|
102
|
+
Tool: "onchain_operations" (machine) | Fields: nodes, pairs, forwards
|
|
103
|
+
Discovery: "query_toolkit" (account_list, local_mark_list, onchain_objects)
|
|
104
|
+
Template: "machineNode2file" (export existing for editing)
|
|
103
105
|
|
|
104
106
|
STEP 2: Trust Layer
|
|
105
107
|
└── Guards — CREATE new or REUSE existing
|
|
106
|
-
Tool: onchain_operations (guard) | Fields: logic, instructions
|
|
107
|
-
Template: guard2file (export existing for editing)
|
|
108
|
+
Tool: "onchain_operations" (guard) | Fields: logic, instructions
|
|
109
|
+
Template: "guard2file" (export existing for editing)
|
|
108
110
|
⚠️ Design your Guard tables based on how the target object reads data:
|
|
109
111
|
- buy_guard → pass/fail only, no data extraction
|
|
110
112
|
- Allocator guard → pass/fail only
|
|
@@ -114,22 +116,22 @@ STEP 2: Trust Layer
|
|
|
114
116
|
|
|
115
117
|
STEP 3: Business Logic (MODIFY)
|
|
116
118
|
├── Machine — bind Guards to forwards
|
|
117
|
-
│ Tool: onchain_operations (machine)
|
|
119
|
+
│ Tool: "onchain_operations" (machine)
|
|
118
120
|
├── Service — set Allocators
|
|
119
|
-
│ Tool: onchain_operations (service) | Fields: order_allocators
|
|
121
|
+
│ Tool: "onchain_operations" (service) | Fields: order_allocators
|
|
120
122
|
├── Arbitrations (optional) — REUSE existing Arb services
|
|
121
|
-
│ Tool: onchain_operations (service) | Fields: arbitrations.list
|
|
123
|
+
│ Tool: "onchain_operations" (service) | Fields: arbitrations.list
|
|
122
124
|
├── Compensation Fund (optional): compensation_fund_add + setting_locked_time_add (default 30 days, configurable)
|
|
123
|
-
│ Tool: onchain_operations (service)
|
|
125
|
+
│ Tool: "onchain_operations" (service)
|
|
124
126
|
└── Reward (optional) — incentive pools
|
|
125
127
|
|
|
126
128
|
STEP 4: Publication
|
|
127
129
|
├── Publish Machine → IMMUTABLE
|
|
128
|
-
│ Tool: onchain_operations (machine) | publish: true
|
|
130
|
+
│ Tool: "onchain_operations" (machine) | publish: true
|
|
129
131
|
├── Bind Machine to Service
|
|
130
|
-
│ Tool: onchain_operations (service) | machine: "<machine_id>"
|
|
132
|
+
│ Tool: "onchain_operations" (service) | machine: "<machine_id>"
|
|
131
133
|
└── Publish Service → machine/allocators LOCKED
|
|
132
|
-
Tool: onchain_operations (service) | publish: true
|
|
134
|
+
Tool: "onchain_operations" (service) | publish: true
|
|
133
135
|
|
|
134
136
|
⚠️ Pre-Publish Verification:
|
|
135
137
|
1. Re-check PRE-FLIGHT: all R1-R7 still confirmed?
|
|
@@ -233,7 +235,7 @@ Each `sharing[].who` field determines where funds go. Choose the correct type ba
|
|
|
233
235
|
After the Progress reaches a terminal state, the fund allocation is NOT automatic — it must be triggered explicitly. **Anyone can call this operation**; the caller does not need to be the merchant or customer. The Guard verification determines which allocator's rules apply.
|
|
234
236
|
|
|
235
237
|
```
|
|
236
|
-
Tool: onchain_operations
|
|
238
|
+
Tool: wowok({ tool: "onchain_operations", data: { operation_type: "allocation", ... } })
|
|
237
239
|
Operation: alloc_by_guard
|
|
238
240
|
Required submission: Order ID (matching the Guard's b_submission identifier)
|
|
239
241
|
```
|
|
@@ -249,8 +251,8 @@ Required submission: Order ID (matching the Guard's b_submission identifier)
|
|
|
249
251
|
Immutable product commitment for arbitration evidence.
|
|
250
252
|
|
|
251
253
|
```
|
|
252
|
-
Create: wip_file
|
|
253
|
-
Attach: onchain_operations
|
|
254
|
+
Create: wowok({ tool: "wip_file", data: { op: "generate", ... } }) → markdown_text + images → outputPath
|
|
255
|
+
Attach: wowok({ tool: "onchain_operations", data: { operation_type: "service", ... } }) → sales.sales[{
|
|
254
256
|
name, price, stock, wip: "<URL>", wip_hash: "" (auto)
|
|
255
257
|
}]
|
|
256
258
|
```
|
|
@@ -285,7 +287,7 @@ Attach: onchain_operations (service) → sales.sales[{
|
|
|
285
287
|
| Messenger | `messenger_operation` |
|
|
286
288
|
| Query | `query_toolkit` |
|
|
287
289
|
|
|
288
|
-
**Export**: `machineNode2file`, `guard2file` | **Query Schema**: `
|
|
290
|
+
**Export**: `machineNode2file`, `guard2file` | **Query Schema**: `wowok({ tool: "schema_query", data: { action: "get", name: "<name>" } })`
|
|
289
291
|
|
|
290
292
|
---
|
|
291
293
|
|
package/wowok-safety/APPENDIX.md
CHANGED
|
@@ -9,6 +9,8 @@
|
|
|
9
9
|
|
|
10
10
|
A guided 10-round dialogue for the safety verification journey — runs before ANY on-chain write operation. Each round has a specific AI Goal, Key Questions, Tool Calls, Success Criteria, Fallback, and Checkpoint. Checkpoints persist via `local_info_operation` so the verification can resume after interruption.
|
|
11
11
|
|
|
12
|
+
> **Tool Call Convention**: All tool references in this document are sub-tools invoked via the single unified `wowok` tool. Translate every reference to `wowok({ tool: "<sub-tool-name>", data: {<params>} })`. See [wowok-tools](../wowok-tools/SKILL.md) for the full interface.
|
|
13
|
+
|
|
12
14
|
> **Trigger**: This dialogue is automatically invoked when the user requests an on-chain write operation (transfer, publish, create, modify, etc.). It is the safety gate that all writes must pass through.
|
|
13
15
|
|
|
14
16
|
### R1 — Operation Intent Capture
|
|
@@ -309,24 +311,26 @@ What level of confirmation does this operation need?
|
|
|
309
311
|
### D3: LOCAL vs ON-CHAIN vs QUERY
|
|
310
312
|
|
|
311
313
|
```
|
|
314
|
+
All sub-tools below are accessed via: wowok({ tool: "<sub-tool-name>", data: {<params>} })
|
|
315
|
+
|
|
312
316
|
Classifying the operation:
|
|
313
317
|
├── LOCAL ONLY (no gas, no confirmation)
|
|
314
|
-
│ ├── account_operation (gen, get, faucet, messenger, etc.)
|
|
315
|
-
│ ├── local_mark_operation
|
|
316
|
-
│ └── local_info_operation
|
|
318
|
+
│ ├── tool: "account_operation" (gen, get, faucet, messenger, etc.)
|
|
319
|
+
│ ├── tool: "local_mark_operation"
|
|
320
|
+
│ └── tool: "local_info_operation"
|
|
317
321
|
├── ON-CHAIN (gas required, confirmation required)
|
|
318
|
-
│ ├── onchain_operations (all 16 operation_types)
|
|
319
|
-
│ ├── messenger_operation (some ops — sign, proof_message)
|
|
320
|
-
│ └── wip_file (sign)
|
|
322
|
+
│ ├── tool: "onchain_operations" (all 16 operation_types)
|
|
323
|
+
│ ├── tool: "messenger_operation" (some ops — sign, proof_message)
|
|
324
|
+
│ └── tool: "wip_file" (sign)
|
|
321
325
|
├── QUERY (read-only, no gas, no confirmation)
|
|
322
|
-
│ ├── query_toolkit
|
|
323
|
-
│ ├── onchain_table_data
|
|
324
|
-
│ ├── onchain_events
|
|
325
|
-
│ ├── guard2file
|
|
326
|
-
│ ├── machineNode2file
|
|
327
|
-
│ └── wowok_buildin_info
|
|
326
|
+
│ ├── tool: "query_toolkit"
|
|
327
|
+
│ ├── tool: "onchain_table_data"
|
|
328
|
+
│ ├── tool: "onchain_events"
|
|
329
|
+
│ ├── tool: "guard2file"
|
|
330
|
+
│ ├── tool: "machineNode2file"
|
|
331
|
+
│ └── tool: "wowok_buildin_info"
|
|
328
332
|
└── ENCRYPTED (local encryption, no gas)
|
|
329
|
-
└── messenger_operation (watch/send messages — local ops)
|
|
333
|
+
└── tool: "messenger_operation" (watch/send messages — local ops)
|
|
330
334
|
```
|
|
331
335
|
|
|
332
336
|
### D4: Publish Readiness Check
|
package/wowok-safety/SKILL.md
CHANGED
|
@@ -262,7 +262,7 @@ For complex objects with many fields (Service, Machine), use **incremental build
|
|
|
262
262
|
| Guard instructions | `wowok_buildin_info` with `info: "guard instructions"` |
|
|
263
263
|
| Value types | `wowok_buildin_info` with `info: "value types"` |
|
|
264
264
|
|
|
265
|
-
**Query Schema**: `
|
|
265
|
+
**Query Schema**: `wowok({ tool: "schema_query", data: { action: "get", name: "<schema_name>" } })`
|
|
266
266
|
|
|
267
267
|
**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
268
|
|