@wowok/skills 1.1.6 → 1.1.8
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 +9 -4
- package/dist/cli.js +4 -5
- package/dist/cli.js.map +1 -1
- package/dist/skills.js +1 -1
- package/dist/skills.js.map +1 -1
- package/dist/types.d.ts +1 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +3 -1
- package/dist/types.js.map +1 -1
- package/package.json +1 -1
- package/scripts/install.js +3 -1
- package/wowok-guard/SKILL.md +12 -12
- package/wowok-machine/SKILL.md +136 -150
- package/wowok-messenger/SKILL.md +148 -177
- package/wowok-order/SKILL.md +1 -1
- package/wowok-provider/SKILL.md +3 -3
- package/wowok-safety/SKILL.md +6 -4
- package/wowok-tools/SKILL.md +106 -156
package/wowok-machine/SKILL.md
CHANGED
|
@@ -9,7 +9,7 @@ description: |
|
|
|
9
9
|
Covers Machine architecture (Nodes, Pairs, Forwards, Guards, Thresholds),
|
|
10
10
|
lifecycle management (create, configure, publish, pause), node operations
|
|
11
11
|
(add, exchange, rename, granular forward/prior-node manipulation),
|
|
12
|
-
Progress integration, cross-
|
|
12
|
+
Progress integration, cross-Machine supply chain composition via Guard verification, privacy-preserving
|
|
13
13
|
consensus patterns, and export/import workflows via machineNode2file.
|
|
14
14
|
when_to_use:
|
|
15
15
|
- User wants to create or modify a Machine workflow
|
|
@@ -24,108 +24,69 @@ when_to_use:
|
|
|
24
24
|
|
|
25
25
|
Design, build, and operate automated workflow templates.
|
|
26
26
|
|
|
27
|
-
> **Role**: Service Provider or Workflow Designer
|
|
28
|
-
> **Key Tools**: `onchain_operations` with `operation_type: "machine"`
|
|
27
|
+
> **Role**: Service Provider or Workflow Designer
|
|
28
|
+
> **Key Tools**: `onchain_operations` with `operation_type: "machine"`
|
|
29
29
|
> **Related Skills**: [wowok-guard](../wowok-guard/SKILL.md) (Guards), [wowok-provider](../wowok-provider/SKILL.md) (Service binding), [wowok-order](../wowok-order/SKILL.md) (customer perspective), [wowok-messenger](../wowok-messenger/SKILL.md) (privacy), [wowok-safety](../wowok-safety/SKILL.md) (safety), [wowok-tools](../wowok-tools/SKILL.md) (schema reference)
|
|
30
30
|
|
|
31
31
|
---
|
|
32
32
|
|
|
33
33
|
## Core Concepts
|
|
34
34
|
|
|
35
|
-
|
|
35
|
+
**Machine** = workflow blueprint (directed graph of Nodes → Pairs → Forwards). **Progress** = live workflow instance, one per order.
|
|
36
36
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
**Key Analogy**: Machine = workflow blueprint, Progress = live workflow instance.
|
|
40
|
-
|
|
41
|
-
### Immutability Rules
|
|
42
|
-
|
|
43
|
-
| Object | When Immutable | Impact |
|
|
44
|
-
|--------|---------------|--------|
|
|
45
|
-
| **Machine** | After `publish: true` | All nodes are locked; workflow topology frozen |
|
|
46
|
-
| **Guard** | After creation | CREATE-only, cannot modify |
|
|
47
|
-
|
|
48
|
-
Because published Machines are immutable, you must design the complete workflow before publishing. However, before publishing, nodes can be freely added, removed, renamed, and reorganized.
|
|
49
|
-
|
|
50
|
-
---
|
|
37
|
+
Machines are **immutable after `publish: true`**; Guards are **CREATE-only**. Design the complete workflow before publishing.
|
|
51
38
|
|
|
52
39
|
## Machine Architecture
|
|
53
40
|
|
|
54
|
-
### The Building Blocks
|
|
55
|
-
|
|
56
|
-
A Machine is composed of three structural layers:
|
|
57
|
-
|
|
58
41
|
```
|
|
59
42
|
Machine
|
|
60
|
-
└── Nodes
|
|
61
|
-
└── Pairs
|
|
62
|
-
├── prev_node: which prior node
|
|
43
|
+
└── Nodes
|
|
44
|
+
└── Pairs
|
|
45
|
+
├── prev_node: which prior node ("" = entry point, multiple allowed)
|
|
63
46
|
├── threshold: required total forward weight to advance
|
|
64
|
-
└── Forwards (
|
|
65
|
-
├── name
|
|
66
|
-
├── weight: contribution toward threshold
|
|
47
|
+
└── Forwards (MachineForward)
|
|
48
|
+
├── name, weight
|
|
67
49
|
├── permissionIndex | namedOperator: who can execute
|
|
68
50
|
└── guard (optional): condition that must pass
|
|
69
51
|
```
|
|
70
52
|
|
|
71
|
-
**Schema
|
|
72
|
-
|
|
73
|
-
### Node
|
|
74
|
-
|
|
75
|
-
A Node represents a **stage or state** in the workflow. Each node has a unique name and contains one or more Pairs defining how to reach it and what Forwards are available from it.
|
|
76
|
-
|
|
77
|
-
Node names must be unique within a Machine. The empty string (`""`) represents the initial state — any Pair with `prev_node: ""` is an entry point. A Machine can have multiple entry nodes, each with its own threshold configuration.
|
|
78
|
-
|
|
79
|
-
### Pair (NodePair)
|
|
53
|
+
> **Schema**: `schema_query({ action: "get", name: "onchain_operations_machine" })` — all field types, limits, valid values. This document focuses on design decisions **not captured** by the schema.
|
|
80
54
|
|
|
81
|
-
|
|
82
|
-
- **`prev_node`**: Source node name (`""` for entry point)
|
|
83
|
-
- **`threshold`**: Total weight required to trigger advancement
|
|
84
|
-
- **`forwards`**: Available operations from this Pair
|
|
55
|
+
### Forward Permission Model
|
|
85
56
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
### Forward
|
|
89
|
-
|
|
90
|
-
A Forward is a **named operation** that users execute to advance the workflow. Each Forward has:
|
|
91
|
-
|
|
92
|
-
- **`name`**: A descriptive operation identifier (e.g., "Confirm Order", "Ship Goods", "Complete Signature").
|
|
93
|
-
- **`weight`**: A 16-bit unsigned integer (0-65535) representing this Forward's contribution toward the threshold. When the sum of completed Forward weights in the current session meets or exceeds the Pair's threshold, the node transition triggers.
|
|
94
|
-
- **`permissionIndex`** and/or **`namedOperator`**: At least one must be specified — both can be set simultaneously, in which case the executor needs EITHER permission to execute the Forward.
|
|
95
|
-
|
|
96
|
-
**Permission Model**:
|
|
97
|
-
|
|
98
|
-
| Field | Scope | Typical Use |
|
|
57
|
+
| Field | Scope | When to Use |
|
|
99
58
|
|-------|-------|-------------|
|
|
100
|
-
| `permissionIndex` | Shared across ALL Progress instances
|
|
101
|
-
| `namedOperator` | Per-Progress namespace |
|
|
102
|
-
|
|
103
|
-
- Use `namedOperator: ""` (empty string) to grant order owner and their agents the right to execute the Forward. This is the standard way to let customers operate on their own orders.
|
|
104
|
-
- Use `namedOperator: "<role_name>"` for role-based operators managed per Progress instance — ideal when different orders have different delivery personnel or reviewers.
|
|
105
|
-
- **Both set**: When `permissionIndex` AND `namedOperator` are both specified, the executor needs EITHER permission to execute the Forward — the permissions act as alternatives. This is useful when the same operation should be executable by either internal staff (via `permissionIndex`) or external roles (via `namedOperator`).
|
|
59
|
+
| `permissionIndex` | Shared across ALL Progress instances | Internal staff (warehouse, admin, platform) — same for every order |
|
|
60
|
+
| `namedOperator` | Per-Progress namespace | Roles that differ per order (delivery person, reviewer, agent) |
|
|
106
61
|
|
|
107
|
-
|
|
62
|
+
- `namedOperator: ""` (empty string): grants **order owner and agents** the right to execute. Standard way to let customers operate.
|
|
63
|
+
- `namedOperator: "<role_name>"`: role-based operators managed per Progress instance. Each Progress independently assigns addresses to role names.
|
|
64
|
+
- **Both fields set**: executor needs EITHER permission — internal staff OR external roles.
|
|
65
|
+
- **Design principle**: Use custom permissions (dedicated Permission object with custom indices), not built-in indices. Define workflow-specific roles, reference those indices in Forwards.
|
|
108
66
|
|
|
109
67
|
### Guard on Forwards
|
|
110
68
|
|
|
111
|
-
A Forward
|
|
69
|
+
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.
|
|
112
70
|
|
|
113
|
-
**
|
|
71
|
+
> **Guard construction**: See [wowok-guard](../wowok-guard/SKILL.md) for table design, computation trees, and query instructions.
|
|
114
72
|
|
|
115
|
-
|
|
73
|
+
### Threshold Mechanics
|
|
116
74
|
|
|
117
|
-
|
|
75
|
+
Users execute Forwards from the current node, accumulating weight within a **session**. When the sum of completed Forward weights meets or exceeds the Pair's threshold, the session finalizes and the workflow advances.
|
|
118
76
|
|
|
119
|
-
|
|
77
|
+
**Session behavior**: Each Forward is counted once per session. Repeated execution of the same Forward within one session adds no extra weight. A completed Forward cannot be re-executed until session reset (on node transition).
|
|
120
78
|
|
|
121
|
-
|
|
79
|
+
**Competing Transitions**: If a node has multiple Pairs to different targets, the **first Pair to meet its threshold wins** — remaining incomplete Forwards in other Pairs are **abandoned**. Competing paths are mutually exclusive by design. A Pair whose threshold can never be met because users always prefer another path creates a **dead branch**.
|
|
122
80
|
|
|
123
|
-
**
|
|
81
|
+
**Execution Patterns**:
|
|
124
82
|
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
83
|
+
| Pattern | Mechanism | Use Case |
|
|
84
|
+
|---------|-----------|----------|
|
|
85
|
+
| Sequential | `threshold=1`, single Forward `weight=1` | Single actor each step |
|
|
86
|
+
| Parallel AND | `threshold=N`, N Forwards `weight=1` | All parties must contribute |
|
|
87
|
+
| Parallel OR | Multiple Pairs, each `threshold=1` | Mutually exclusive branches |
|
|
88
|
+
| Weighted Voting | `threshold=100`, varied weights (e.g., 60+40) | Unequal stakeholder power |
|
|
89
|
+
| Hybrid | `threshold=5`, mixed weights (3+1+1) | Key party required, others optional |
|
|
129
90
|
|
|
130
91
|
---
|
|
131
92
|
|
|
@@ -133,56 +94,82 @@ The threshold is the **trigger value** for node advancement. Users execute Forwa
|
|
|
133
94
|
|
|
134
95
|
### Dependency-First Construction
|
|
135
96
|
|
|
136
|
-
|
|
97
|
+
Build in this exact order:
|
|
137
98
|
|
|
138
99
|
```
|
|
139
|
-
1. Permission (CREATE
|
|
140
|
-
2. Machine (CREATE, unpublished) → define
|
|
141
|
-
3. Guards (CREATE) → build conditions
|
|
142
|
-
4. Bind Guards to Forwards (MODIFY Machine) →
|
|
143
|
-
5. Publish Machine → nodes
|
|
144
|
-
6. Bind Machine to Service
|
|
100
|
+
1. Permission (CREATE/MODIFY) → access control foundation
|
|
101
|
+
2. Machine (CREATE, unpublished) → define all nodes
|
|
102
|
+
3. Guards (CREATE) → build validation conditions
|
|
103
|
+
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`
|
|
104
|
+
5. Publish Machine → nodes IMMUTABLE
|
|
105
|
+
6. Bind Machine to Service → workflow goes live
|
|
145
106
|
```
|
|
146
107
|
|
|
147
|
-
**
|
|
108
|
+
**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.**
|
|
148
109
|
|
|
149
110
|
### Node Operations (Pre-Publish Only)
|
|
150
111
|
|
|
151
|
-
|
|
112
|
+
Nine operations are available via the `node` field. Query schema for full parameters. Key design notes not captured by schema:
|
|
113
|
+
|
|
114
|
+
- `add` / `set` with `bReplace: false` (default) **merges** into existing nodes; `true` replaces all.
|
|
115
|
+
- `clear` is **irreversible** — instant wipe with no undo. Export via `machineNode2file` first.
|
|
116
|
+
- `exchange` swaps two node positions without delete/recreate. `rename` auto-updates all Pair references.
|
|
117
|
+
- `add forward` supports the full `MachineForward` structure including `guard` with `retained_submission`.
|
|
152
118
|
|
|
153
|
-
**
|
|
119
|
+
> **Schema**: `schema_query({ action: "get", name: "onchain_operations_machine" })` for full operation parameters.
|
|
120
|
+
|
|
121
|
+
### File-Based Workflow
|
|
122
|
+
|
|
123
|
+
```
|
|
124
|
+
1. machineNode2file → export nodes to JSON/Markdown
|
|
125
|
+
2. Edit locally
|
|
126
|
+
3. node.json_or_markdown_file → COMPLETE REPLACEMENT of all nodes
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
Always start from an on-chain export when available — exact current state beats rebuilding from scratch.
|
|
154
130
|
|
|
155
131
|
---
|
|
156
132
|
|
|
157
133
|
## Progress: The Live Workflow Instance
|
|
158
134
|
|
|
135
|
+
### Machine vs Progress
|
|
136
|
+
|
|
137
|
+
- **Machine**: Workflow blueprint — defines the topology, permissions, thresholds, and Guards. Shared across all orders.
|
|
138
|
+
- **Progress**: Live instance — tracks current node, session state, history. One per order (when Service-bound) or standalone.
|
|
139
|
+
|
|
159
140
|
### Progress Creation
|
|
160
141
|
|
|
161
|
-
|
|
162
|
-
- **Service Order**: When an Order is created on a Service with a bound Machine, Progress is automatically instantiated
|
|
163
|
-
- **Direct Creation**: Via `progress_new` operation with appropriate permissions
|
|
142
|
+
Two paths: **Service Order** (automatic when Order created on Service with bound Machine) or **Direct Creation** (via `progress_new`). For direct creation, pre-configure via `progress_new` fields on the Machine operation — this sets initial named operators, task binding, and repository list before the first Progress is spawned.
|
|
164
143
|
|
|
165
|
-
###
|
|
144
|
+
### Execution Paths
|
|
166
145
|
|
|
167
|
-
**Order-associated Progress
|
|
146
|
+
- **Order-associated Progress**: When a Forward uses `namedOperator: ""`, the order owner/agents execute via `order` operations.
|
|
147
|
+
- **Standalone Progress**: All other cases — advance via direct `progress` operations.
|
|
168
148
|
|
|
169
|
-
|
|
149
|
+
Two-phase operations (`hold`/`unhold`) allow locking resources during multi-step operations; `adminUnhold` force-releases stale locks.
|
|
170
150
|
|
|
171
|
-
**
|
|
151
|
+
> **Querying**: Progress state via `onchain_objects`, history via `onchain_table` / `onchain_table_item_progress_history`. Schema: `schema_query({ action: "get", name: "onchain_table_data" })`.
|
|
172
152
|
|
|
173
|
-
|
|
153
|
+
### Runtime: Advancing the Workflow
|
|
174
154
|
|
|
175
|
-
|
|
155
|
+
The runtime loop (schema: `onchain_operations` with `operation_type: "progress"` or `"order"`):
|
|
176
156
|
|
|
177
|
-
|
|
157
|
+
```
|
|
158
|
+
1. Query active Forwards → onchain_objects reveals current node name and available Pairs/Forwards
|
|
159
|
+
2. Execute Forward → weight accumulates in session; Guard validates (pass/fail);
|
|
160
|
+
retained_submission stores values indexed by (current_node, next_node, forward_name)
|
|
161
|
+
3. Threshold met → session commits to history (all completed Forwards recorded);
|
|
162
|
+
node transitions; session resets; new Forwards unlocked
|
|
163
|
+
4. OR threshold NOT met → session stays open; more Forwards can execute in same session;
|
|
164
|
+
weight from repeated same Forwards ignored
|
|
165
|
+
5. OR competing Pair wins first → other incomplete Pairs abandoned; next session starts on winner node
|
|
166
|
+
```
|
|
178
167
|
|
|
179
|
-
**
|
|
168
|
+
**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.
|
|
180
169
|
|
|
181
|
-
|
|
182
|
-
- `query_toolkit` with `query_type: "onchain_table"` — query all history records from Progress table (paginated)
|
|
183
|
-
- `query_toolkit` with `query_type: "onchain_table_item_progress_history"` — query single history record by sequence number
|
|
170
|
+
**Session lifecycle**: A session begins when the first Forward executes from a new node. It stays open until threshold is met (closing the session and advancing) or the order completes/aborts. No session timeout — sessions persist until resolved. `hold`/`unhold` lock the session during multi-step external operations; `adminUnhold` force-releases stale locks.
|
|
184
171
|
|
|
185
|
-
**
|
|
172
|
+
> **Order-associated execution**: Forwards with `namedOperator: ""` are executable via `order` operations by the order owner/agents. All other Forwards use `progress` operations. See [wowok-order](../wowok-order/SKILL.md) for the customer execution flow.
|
|
186
173
|
|
|
187
174
|
---
|
|
188
175
|
|
|
@@ -202,85 +189,84 @@ Shipping → Delivery Complete → Order Complete
|
|
|
202
189
|
└──→ Return Complete
|
|
203
190
|
```
|
|
204
191
|
|
|
205
|
-
###
|
|
192
|
+
### Cross-Machine Supply Chain Composition
|
|
206
193
|
|
|
207
|
-
|
|
194
|
+
Decompose complex workflows into multiple Machines connected by Guard-based validation — avoiding monolithic bloat.
|
|
208
195
|
|
|
209
|
-
|
|
210
|
-
Start → Buy Insurance (creates sub-order on Insurance Service) → Main Activity → Complete
|
|
211
|
-
```
|
|
212
|
-
|
|
213
|
-
**Key Characteristics**:
|
|
214
|
-
- The Forward uses `forward_to_order_create` to specify the target Service for the sub-order
|
|
215
|
-
- The Guard on the Forward validates that the sub-order was successfully created
|
|
216
|
-
- Useful for supply chain transparency: "We use X supplier" becomes verifiable on-chain
|
|
196
|
+
**Sub-Progress Dependency**: Machine A's Forward Guards query Machine B's Progress to verify it has reached a target node before advancing.
|
|
217
197
|
|
|
218
|
-
**
|
|
219
|
-
- Forward "Buy Insurance" on the "Start" node creates a sub-order on the Insurance Service
|
|
220
|
-
- The Insurance sub-order follows its own Machine workflow independently
|
|
221
|
-
- Both workflows (Travel and Insurance) progress in parallel
|
|
198
|
+
**Sub-Order Verification**: Machine A's Forward Guard validates an Order exists on another Service with its Progress at the required state. The sub-order is created independently — the Guard only verifies.
|
|
222
199
|
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
Require both parties (customer and merchant) to confirm before advancing — used for sensitive operations like returns, lost packages, and completion.
|
|
200
|
+
**Multi-Party Chain**: Supplier → Manufacturer → Retailer, each Machine's entry condition verifies upstream completion via Guards querying `retained_submission` values.
|
|
226
201
|
|
|
227
|
-
|
|
228
|
-
-
|
|
229
|
-
-
|
|
202
|
+
**When to decompose** into multiple Machines:
|
|
203
|
+
- A sub-process is independently valuable as a standalone Service
|
|
204
|
+
- Different participant sets operate in different phases
|
|
205
|
+
- The sub-process is reusable across multiple parent workflows
|
|
230
206
|
|
|
231
|
-
|
|
207
|
+
**When to keep in one**:
|
|
208
|
+
- Same participants and permission model throughout
|
|
209
|
+
- Dense sequential data flow with no clear boundary
|
|
232
210
|
|
|
233
|
-
|
|
211
|
+
**Questions to ask the user**:
|
|
212
|
+
1. "Are there phases handled by different teams or services?"
|
|
213
|
+
2. "Could any part be offered as a standalone service?"
|
|
214
|
+
3. "Does any step depend on an external process completing first?"
|
|
215
|
+
4. "Which party creates the sub-order, and which party verifies it?"
|
|
234
216
|
|
|
235
|
-
|
|
217
|
+
> **Guard construction**: Cross-Machine Guards use `convert_witness` with Progress query instructions. See [wowok-guard](../wowok-guard/SKILL.md). Query available Guard instructions via `wowok_buildin_info`.
|
|
236
218
|
|
|
237
|
-
|
|
219
|
+
### Dual-Signature Consensus
|
|
238
220
|
|
|
239
|
-
|
|
221
|
+
Require both customer and merchant to confirm: `threshold=2` with two Forwards (`namedOperator: ""` for customer, `permissionIndex` for merchant), each `weight=1`. Both must execute to advance.
|
|
240
222
|
|
|
241
|
-
|
|
242
|
-
|----------|-----------------|----------------|
|
|
243
|
-
| Merchant ships order | Receives address via Messenger, replies with tracking number | Merchant submits Merkle Root to Guard on Forward |
|
|
244
|
-
| Customer returns item | Sends return tracking number via Messenger | Customer submits Merkle Root to Guard on Forward |
|
|
245
|
-
| Mutual confirmation | Both parties sign via Messenger | Both submit confirmation proofs |
|
|
223
|
+
### Privacy (Messenger)
|
|
246
224
|
|
|
247
|
-
|
|
225
|
+
Sensitive data flows through Messenger's end-to-end encryption; only Merkle Root proofs go on-chain. The principle: **who performs the action submits the proof**.
|
|
248
226
|
|
|
249
227
|
> **Full Guide**: See [wowok-messenger](../wowok-messenger/SKILL.md) for WTS evidence generation.
|
|
250
228
|
|
|
251
229
|
---
|
|
252
230
|
|
|
253
|
-
##
|
|
254
|
-
|
|
255
|
-
Handle service failures through automated compensation workflows. Guards validate penalty payments before allowing continuation.
|
|
256
|
-
|
|
257
|
-
### Late Delivery Penalty Pattern
|
|
231
|
+
## Common Pitfalls
|
|
258
232
|
|
|
259
|
-
|
|
233
|
+
### Mutability Traps
|
|
260
234
|
|
|
261
|
-
**
|
|
262
|
-
-
|
|
263
|
-
-
|
|
264
|
-
- Customer protection guarantee
|
|
265
|
-
- Service accountability
|
|
235
|
+
All stem from the same root: **every on-chain object has a publish/create freeze point**. See [Guard + Machine Immutability Deadlock](#guard--machine-immutability-deadlock). Key rules:
|
|
236
|
+
- Never publish before all Guards are created, tested, and bound.
|
|
237
|
+
- `clear` is irreversible — export via `machineNode2file` first.
|
|
266
238
|
|
|
267
|
-
|
|
239
|
+
### Pre-Publish Validation Checklist
|
|
268
240
|
|
|
269
|
-
|
|
241
|
+
Before `publish: true`, verify:
|
|
270
242
|
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
- **
|
|
274
|
-
-
|
|
275
|
-
-
|
|
276
|
-
-
|
|
277
|
-
-
|
|
243
|
+
- [ ] **Entry point exists**: at least one Pair with `prev_node: ""` — workflow cannot start otherwise
|
|
244
|
+
- [ ] **Every node has outgoing Forwards** (except terminals): no dead-end nodes
|
|
245
|
+
- [ ] **Every node has incoming Pair** (except entry): no orphaned nodes
|
|
246
|
+
- [ ] **All thresholds independently achievable**: no dead branches (competing Pair always wins first)
|
|
247
|
+
- [ ] All Guards exist on-chain and tested (use `gen_passport`)
|
|
248
|
+
- [ ] `namedOperator` vs `permissionIndex` correct per Forward
|
|
249
|
+
- [ ] Every Forward has at least one of `namedOperator` or `permissionIndex`
|
|
250
|
+
- [ ] Terminal nodes mapped to Allocator entries for fund distribution
|
|
251
|
+
- [ ] Tested end-to-end on testnet via a test Progress
|
|
252
|
+
- [ ] Current state exported via `machineNode2file` as backup
|
|
278
253
|
|
|
279
254
|
**Always test on testnet before mainnet** — Machines are immutable after publish.
|
|
280
255
|
|
|
281
256
|
---
|
|
282
257
|
|
|
283
|
-
##
|
|
258
|
+
## Guard + Machine Immutability Deadlock
|
|
259
|
+
|
|
260
|
+
Both Guards and published Machines are **immutable**:
|
|
261
|
+
|
|
262
|
+
```
|
|
263
|
+
Guard created with bug → Cannot fix (immutable)
|
|
264
|
+
→ Must create new Guard
|
|
265
|
+
→ Must rebind to Machine
|
|
266
|
+
→ Machine already published? Cannot modify (immutable)
|
|
267
|
+
→ DEADLOCK: new Guard exists but cannot be attached
|
|
268
|
+
```
|
|
284
269
|
|
|
285
|
-
**
|
|
270
|
+
**Prevention**: Test every Guard via `gen_passport` before binding. Verify computation tree, submission types, and query instructions against all scenarios.
|
|
286
271
|
|
|
272
|
+
**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.
|