@wowok/skills 1.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +156 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +177 -0
- package/dist/cli.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +19 -0
- package/dist/index.js.map +1 -0
- package/dist/skills.d.ts +5 -0
- package/dist/skills.d.ts.map +1 -0
- package/dist/skills.js +46 -0
- package/dist/skills.js.map +1 -0
- package/dist/types.d.ts +9 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +3 -0
- package/dist/types.js.map +1 -0
- package/examples/Insurance/Insurance.md +594 -0
- package/examples/Insurance/Insurance_TestResults.md +481 -0
- package/examples/Insurance/insurance_complete_guard_v1.json +50 -0
- package/examples/MyShop/MyShop.md +1353 -0
- package/examples/MyShop/MyShop_TestResults.md +1003 -0
- package/examples/MyShop_Advanced/MyShop_Advanced.md +1898 -0
- package/examples/MyShop_Advanced/MyShop_Advanced_MerchantSystem_TestResults.md +1297 -0
- package/examples/MyShop_Advanced/MyShop_Advanced_OrderFlow_TestResults.md +743 -0
- package/examples/MyShop_Advanced/machine_nodes.json +222 -0
- package/examples/ThreeBody_Signature/ThreeBody_Signature.md +776 -0
- package/examples/ThreeBody_Signature/ThreeBody_Signature_TestResults.md +599 -0
- package/examples/Travel/Travel.md +1157 -0
- package/examples/Travel/Travel_TestResults.md +743 -0
- package/examples/Travel/calc-weather-timestamps.js +8 -0
- package/examples/Travel/travel_machine_v2_export.json +104 -0
- package/examples/Travel/weather_check_guard_v1.json +51 -0
- package/package.json +56 -0
- package/schemas/onchain_operations/_common.md +236 -0
- package/schemas/onchain_operations/_index.md +22 -0
- package/schemas/onchain_operations/allocation.md +50 -0
- package/schemas/onchain_operations/arbitration.md +95 -0
- package/schemas/onchain_operations/contact.md +36 -0
- package/schemas/onchain_operations/demand.md +52 -0
- package/schemas/onchain_operations/gen_passport.md +43 -0
- package/schemas/onchain_operations/guard.md +136 -0
- package/schemas/onchain_operations/machine.md +70 -0
- package/schemas/onchain_operations/order.md +57 -0
- package/schemas/onchain_operations/payment.md +32 -0
- package/schemas/onchain_operations/permission.md +57 -0
- package/schemas/onchain_operations/personal.md +59 -0
- package/schemas/onchain_operations/progress.md +35 -0
- package/schemas/onchain_operations/repository.md +81 -0
- package/schemas/onchain_operations/reward.md +40 -0
- package/schemas/onchain_operations/service.md +104 -0
- package/schemas/onchain_operations/treasury.md +74 -0
- package/schemas/schema-account_operation.md +402 -0
- package/schemas/schema-guard2file.md +153 -0
- package/schemas/schema-local_info_operation.md +160 -0
- package/schemas/schema-local_mark_operation.md +148 -0
- package/schemas/schema-machineNode2file.md +155 -0
- package/schemas/schema-messenger_operation.md +547 -0
- package/schemas/schema-onchain_events.md +201 -0
- package/schemas/schema-onchain_table_data.md +334 -0
- package/schemas/schema-query_toolkit.md +375 -0
- package/schemas/schema-wip_file.md +240 -0
- package/schemas/schema-wowok_buildin_info.md +296 -0
- package/scripts/install.js +113 -0
- package/wowok-build/SKILL.md +606 -0
- package/wowok-guard/SKILL.md +374 -0
- package/wowok-machine/SKILL.md +512 -0
- package/wowok-order/SKILL.md +499 -0
- package/wowok-safety/SKILL.md +381 -0
- package/wowok-tools/SKILL.md +635 -0
|
@@ -0,0 +1,374 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: wowok-guard
|
|
3
|
+
description: |
|
|
4
|
+
WoWok Guard design mastery — comprehensive reference for the recursive,
|
|
5
|
+
strongly-typed GuardNode computational tree (70+ node types). Covers all
|
|
6
|
+
logic, arithmetic, conversion, vector, record-check, and special node types
|
|
7
|
+
with correct type names as defined in the MCP SDK source. Guards are immutable
|
|
8
|
+
once created — get the design right the first time.
|
|
9
|
+
|
|
10
|
+
Use this skill for ANY Guard creation, modification, or troubleshooting.
|
|
11
|
+
Guards are the most complex WoWok component; incorrect node types cause
|
|
12
|
+
immediate runtime failures.
|
|
13
|
+
when_to_use:
|
|
14
|
+
- User wants to create or modify a Guard
|
|
15
|
+
- User asks about Guard logic, validation rules, trust rules
|
|
16
|
+
- User encounters Guard validation errors
|
|
17
|
+
- User mentions "guard", "validation", "trust rules", "verify", "condition"
|
|
18
|
+
always: false
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
# WoWok Guard Design Reference
|
|
22
|
+
|
|
23
|
+
## Core Concept
|
|
24
|
+
|
|
25
|
+
A Guard is a **recursive computational tree** that evaluates to a boolean result. It's an on-chain validator — once created, it's IMMUTABLE. Every operation protected by a Guard must pass its validation for the operation to succeed.
|
|
26
|
+
|
|
27
|
+
## Guard Structure
|
|
28
|
+
|
|
29
|
+
```typescript
|
|
30
|
+
Guard {
|
|
31
|
+
namedNew?: { name: string; tags?: string[]; onChain?: boolean; replaceExistName?: boolean };
|
|
32
|
+
description?: string;
|
|
33
|
+
|
|
34
|
+
table: { // Data table — what the Guard validates
|
|
35
|
+
identifier: number; // 0-255, unique within this Guard
|
|
36
|
+
b_submission: boolean; // Must user submit this value?
|
|
37
|
+
value_type: ValueType; // Expected type (0-18)
|
|
38
|
+
value?: SupportedValue; // Default value (if b_submission = false)
|
|
39
|
+
name?: string; // Human-readable field name
|
|
40
|
+
}[];
|
|
41
|
+
|
|
42
|
+
root: {
|
|
43
|
+
type: "node";
|
|
44
|
+
node: GuardNode; // The recursive validation tree
|
|
45
|
+
} | {
|
|
46
|
+
type: "file";
|
|
47
|
+
file_path: string; // Load from JSON/Markdown file
|
|
48
|
+
format?: "json" | "markdown";
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
rely?: { // Depend on other Guards
|
|
52
|
+
guards: string[]; // Guard IDs or names
|
|
53
|
+
logic_or?: boolean; // OR (true) vs AND (false/default)
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
**CRITICAL**: The Guard's `table` defines ALL data the Guard uses — both submitted values and values passed from the calling object. Every `identifier` node in the tree references a table entry.
|
|
59
|
+
|
|
60
|
+
---
|
|
61
|
+
|
|
62
|
+
## GuardNode — The Computational Tree
|
|
63
|
+
|
|
64
|
+
The GuardNode is a `z.discriminatedUnion("type", [...])` — 70+ type variants. Every node has a `type` field. Below are all categories.
|
|
65
|
+
|
|
66
|
+
### Leaf Nodes (No Children)
|
|
67
|
+
|
|
68
|
+
#### identifier — Read from Guard Table
|
|
69
|
+
```typescript
|
|
70
|
+
{ type: "identifier"; identifier: number }
|
|
71
|
+
```
|
|
72
|
+
Returns the value at the specified Guard table index (0-255). This is how data enters the computation tree.
|
|
73
|
+
|
|
74
|
+
#### value_type — Get ValueType of Child
|
|
75
|
+
```typescript
|
|
76
|
+
{ type: "value_type"; node: GuardNode }
|
|
77
|
+
```
|
|
78
|
+
Returns U8: the ValueType identifier of the child node's result.
|
|
79
|
+
|
|
80
|
+
---
|
|
81
|
+
|
|
82
|
+
### Query Node — Fetch On-Chain Data
|
|
83
|
+
|
|
84
|
+
```typescript
|
|
85
|
+
{
|
|
86
|
+
type: "query";
|
|
87
|
+
query: number | string; // Query instruction ID or name
|
|
88
|
+
object: {
|
|
89
|
+
identifier: number; // Guard table index for target object
|
|
90
|
+
convert_witness?: number; // Optional witness conversion
|
|
91
|
+
};
|
|
92
|
+
parameters: GuardNode[]; // Parameters for the query
|
|
93
|
+
}
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
Fetches data from on-chain WoWok objects. The `query` field references a built-in query instruction (e.g., `1001` for permission description, or name `"permission.description"`). Use `wowok_buildin_info` with `info_type: "guard_instructions"` to discover available queries.
|
|
97
|
+
|
|
98
|
+
**System Addresses for Entity Queries**:
|
|
99
|
+
| Constant | Value | Use For |
|
|
100
|
+
|----------|-------|---------|
|
|
101
|
+
| ENTITY_LINKER_ADDRESS | 0xaaa | EntityLinker queries |
|
|
102
|
+
| ENTITY_REGISTRAR_ADDRESS | 0xaab | EntityRegistrar queries |
|
|
103
|
+
|
|
104
|
+
---
|
|
105
|
+
|
|
106
|
+
### Logic & Comparison Nodes
|
|
107
|
+
|
|
108
|
+
All return **Bool**. Each takes 2-8 children unless noted.
|
|
109
|
+
|
|
110
|
+
#### Core Logic
|
|
111
|
+
| type | Children | Description |
|
|
112
|
+
|------|----------|-------------|
|
|
113
|
+
| `logic_and` | `nodes[]` | ALL children must be true |
|
|
114
|
+
| `logic_or` | `nodes[]` | ANY child must be true |
|
|
115
|
+
| `logic_not` | `node` (1) | Inverts boolean result |
|
|
116
|
+
|
|
117
|
+
#### Equality
|
|
118
|
+
| type | Children | Description |
|
|
119
|
+
|------|----------|-------------|
|
|
120
|
+
| `logic_equal` | `nodes[]` | Type+value equality; all must match first |
|
|
121
|
+
| `logic_string_nocase_equal` | `nodes[]` | Case-insensitive string equality |
|
|
122
|
+
|
|
123
|
+
#### String Comparison
|
|
124
|
+
| type | Children | Description |
|
|
125
|
+
|------|----------|-------------|
|
|
126
|
+
| `logic_string_contains` | `nodes[]` | First contains all others (case-sensitive) |
|
|
127
|
+
| `logic_string_nocase_contains` | `nodes[]` | First contains all others (case-insensitive) |
|
|
128
|
+
|
|
129
|
+
#### Numeric Comparison (U256)
|
|
130
|
+
| type | Children | Description |
|
|
131
|
+
|------|----------|-------------|
|
|
132
|
+
| `logic_as_u256_equal` | `nodes[]` | First == all others |
|
|
133
|
+
| `logic_as_u256_greater` | `nodes[]` | First > all others |
|
|
134
|
+
| `logic_as_u256_lesser` | `nodes[]` | First < all others |
|
|
135
|
+
| `logic_as_u256_greater_or_equal` | `nodes[]` | First >= all others |
|
|
136
|
+
| `logic_as_u256_lesser_or_equal` | `nodes[]` | First <= all others |
|
|
137
|
+
|
|
138
|
+
---
|
|
139
|
+
|
|
140
|
+
### Arithmetic Nodes (calc_*)
|
|
141
|
+
|
|
142
|
+
#### Numeric (all return U256, 2-8 children)
|
|
143
|
+
| type | Operation |
|
|
144
|
+
|------|-----------|
|
|
145
|
+
| `calc_number_add` | first + second + third + ... |
|
|
146
|
+
| `calc_number_subtract` | first - second - third - ... |
|
|
147
|
+
| `calc_number_multiply` | first × second × third × ... |
|
|
148
|
+
| `calc_number_divide` | (first / second) / third / ... (throws on zero) |
|
|
149
|
+
| `calc_number_mod` | (first % second) % third % ... (throws on zero) |
|
|
150
|
+
|
|
151
|
+
#### String (return U64 or Bool)
|
|
152
|
+
| type | Children | Returns | Description |
|
|
153
|
+
|------|----------|---------|-------------|
|
|
154
|
+
| `calc_string_length` | `node` (1) | U64 | UTF-8 byte length |
|
|
155
|
+
| `calc_string_contains` | `nodes[]` (2-8) | Bool | cs substring check |
|
|
156
|
+
| `calc_string_nocase_contains` | `nodes[]` (2-8) | Bool | ci substring check |
|
|
157
|
+
| `calc_string_nocase_equal` | `nodes[]` (2-8) | Bool | ci equality |
|
|
158
|
+
|
|
159
|
+
#### String Index (return U64)
|
|
160
|
+
| type | Children | Description |
|
|
161
|
+
|------|----------|-------------|
|
|
162
|
+
| `calc_string_indexof` | `nodeLeft` + `nodeRight` + `order` | Find substring index (cs). `order`: "forward" \| "backward". Not found → u64::MAX |
|
|
163
|
+
| `calc_string_nocase_indexof` | `nodeLeft` + `nodeRight` + `order` | Find substring index (ci) |
|
|
164
|
+
|
|
165
|
+
---
|
|
166
|
+
|
|
167
|
+
### Type Conversion Nodes (convert_*)
|
|
168
|
+
|
|
169
|
+
All take single `node` child.
|
|
170
|
+
|
|
171
|
+
| type | Input → Output | Description |
|
|
172
|
+
|------|---------------|-------------|
|
|
173
|
+
| `convert_number_address` | Number → Address | Numeric to Address type |
|
|
174
|
+
| `convert_address_number` | Address → U256 | Address to numeric |
|
|
175
|
+
| `convert_number_string` | Number → String | Numeric to string |
|
|
176
|
+
| `convert_string_number` | String → U256 | Parse string as number (throws if invalid) |
|
|
177
|
+
| `convert_safe_u8` | any → U8 | Safe cast to U8 (throws on overflow) |
|
|
178
|
+
| `convert_safe_u16` | any → U16 | Safe cast to U16 |
|
|
179
|
+
| `convert_safe_u32` | any → U32 | Safe cast to U32 |
|
|
180
|
+
| `convert_safe_u64` | any → U64 | Safe cast to U64 |
|
|
181
|
+
| `convert_safe_u128` | any → U128 | Safe cast to U128 |
|
|
182
|
+
| `convert_safe_u256` | any → U256 | Safe cast to U256 |
|
|
183
|
+
|
|
184
|
+
---
|
|
185
|
+
|
|
186
|
+
### Vector Operations (vec_*)
|
|
187
|
+
|
|
188
|
+
#### Vector Properties
|
|
189
|
+
| type | Children | Returns | Description |
|
|
190
|
+
|------|----------|---------|-------------|
|
|
191
|
+
| `vec_length` | `node` (1) | U64 | Number of elements |
|
|
192
|
+
|
|
193
|
+
#### Vector Containment (2-8 children, returns Bool)
|
|
194
|
+
|
|
195
|
+
First node = vector, remaining nodes = values to check.
|
|
196
|
+
|
|
197
|
+
| type | Vector Type | Element Type |
|
|
198
|
+
|------|------------|--------------|
|
|
199
|
+
| `vec_contains_bool` | VecBool (9) or Value (19) | Bool (0) or Value (19) |
|
|
200
|
+
| `vec_contains_address` | VecAddress (10) or Value (19) | Address (1) or Value (19) |
|
|
201
|
+
| `vec_contains_string` | VecString (11) or Value (19) | String (2) or Value (19) |
|
|
202
|
+
| `vec_contains_string_nocase` | VecString or Value (19) | String or Value (19), ci |
|
|
203
|
+
| `vec_contains_number` | VecU8-VecU256 or Value (19) | U8-U256 or Value (19) |
|
|
204
|
+
|
|
205
|
+
#### Vector Index (return U64)
|
|
206
|
+
|
|
207
|
+
| type | Children | Description |
|
|
208
|
+
|------|----------|-------------|
|
|
209
|
+
| `vec_indexof_bool` | `nodeLeft` + `nodeRight` + `order` | Find bool index |
|
|
210
|
+
| `vec_indexof_address` | `nodeLeft` + `nodeRight` + `order` | Find address index |
|
|
211
|
+
| `vec_indexof_string` | `nodeLeft` + `nodeRight` + `order` | Find string index (cs) |
|
|
212
|
+
| `vec_indexof_string_nocase` | `nodeLeft` + `nodeRight` + `order` | Find string index (ci) |
|
|
213
|
+
| `vec_indexof_number` | `nodeLeft` + `nodeRight` + `order` | Find number index |
|
|
214
|
+
|
|
215
|
+
`order`: "forward" \| "backward". Not found → u64::MAX.
|
|
216
|
+
|
|
217
|
+
---
|
|
218
|
+
|
|
219
|
+
### Record Check Nodes (record_*)
|
|
220
|
+
|
|
221
|
+
Query on-chain records to validate operations. All return **Bool**.
|
|
222
|
+
|
|
223
|
+
These nodes check historical records (orders, progress steps, rewards, treasury operations) to enforce limits.
|
|
224
|
+
|
|
225
|
+
| type | Key Parameters | Description |
|
|
226
|
+
|------|---------------|-------------|
|
|
227
|
+
| `record_check_recipient_order` | `receipt_type` + `recipient` | Check order count/status by recipient |
|
|
228
|
+
| `record_check_recipient_progress` | `recipient` | Check progress count by recipient |
|
|
229
|
+
| `record_check_recipient_reward` | `recipient` | Check reward claims by recipient |
|
|
230
|
+
| `record_check_treasury_history_item` | `historyIdx` + `sessionIdx` | Verify treasury operation |
|
|
231
|
+
| `record_check_treasury_history_item_no_um` | `historyIdx` + `sessionIdx` | Same but ignores Contact |
|
|
232
|
+
| `record_check_treasury_history_session` | `historyIdx` | Count treasury sessions |
|
|
233
|
+
| `record_check_progress_history_item` | `historyIdx` + `sessionIdx` + `forwardIdx` | Verify progress step |
|
|
234
|
+
| `record_check_progress_history_item_no_um` | `historyIdx` + `sessionIdx` + `forwardIdx` | Same but ignores Contact |
|
|
235
|
+
| `record_check_progress_history_session` | `historyIdx` + `sessionIdx` | Session info |
|
|
236
|
+
| `record_check_progress_history` | `historyIdx` | Count progress history |
|
|
237
|
+
|
|
238
|
+
Each uses `GuardNode` sub-nodes for its parameters (e.g., `recipient` is a GuardNode returning Address).
|
|
239
|
+
|
|
240
|
+
---
|
|
241
|
+
|
|
242
|
+
## Guard Design Workflow
|
|
243
|
+
|
|
244
|
+
### Step 1: Query Available Instructions
|
|
245
|
+
```
|
|
246
|
+
wowok_buildin_info({ info_type: "guard_instructions" })
|
|
247
|
+
```
|
|
248
|
+
Discover what queries are available and their expected parameter types.
|
|
249
|
+
|
|
250
|
+
### Step 2: Query Value Types
|
|
251
|
+
```
|
|
252
|
+
wowok_buildin_info({ info_type: "value_types" })
|
|
253
|
+
```
|
|
254
|
+
Understand the ValueType enum (Bool=0, Address=1, String=2, U8=3, ..., U256=8, VecBool=9, ..., VecVecU8=18).
|
|
255
|
+
|
|
256
|
+
### Step 3: Design the Table
|
|
257
|
+
Decide what data the Guard needs:
|
|
258
|
+
- **Submitted data** (b_submission = true): User provides at operation time
|
|
259
|
+
- **Passed data** (b_submission = false): Object provides automatically
|
|
260
|
+
|
|
261
|
+
### Step 4: Build the Root Tree
|
|
262
|
+
- Start with `logic_and` as the root
|
|
263
|
+
- Add child nodes for each condition
|
|
264
|
+
- Use `query` + `identifier` patterns for data fetching
|
|
265
|
+
- Use comparison nodes for validation
|
|
266
|
+
|
|
267
|
+
### Step 5: Create Guard (Dry-Run First)
|
|
268
|
+
```
|
|
269
|
+
onchain_operations({
|
|
270
|
+
operation_type: "guard",
|
|
271
|
+
data: {
|
|
272
|
+
namedNew: { name: "my_guard" },
|
|
273
|
+
description: "Validates X, Y, Z",
|
|
274
|
+
table: [...],
|
|
275
|
+
root: { type: "node", node: { type: "logic_and", nodes: [...] } }
|
|
276
|
+
}
|
|
277
|
+
// NO submission → dry run
|
|
278
|
+
})
|
|
279
|
+
```
|
|
280
|
+
|
|
281
|
+
### Step 6: Export for Review
|
|
282
|
+
```
|
|
283
|
+
guard2file({ guard: "my_guard", file_path: "./my_guard.json", format: "json" })
|
|
284
|
+
```
|
|
285
|
+
|
|
286
|
+
### Step 7: Execute
|
|
287
|
+
Add `submission` after confirming the dry-run result.
|
|
288
|
+
|
|
289
|
+
---
|
|
290
|
+
|
|
291
|
+
## Common Guard Patterns
|
|
292
|
+
|
|
293
|
+
### Pattern 1: Identity Check (is sender == expected address?)
|
|
294
|
+
```typescript
|
|
295
|
+
{
|
|
296
|
+
type: "logic_equal",
|
|
297
|
+
nodes: [
|
|
298
|
+
{ type: "identifier", identifier: 0 }, // submitted address
|
|
299
|
+
{ type: "identifier", identifier: 1 } // stored address
|
|
300
|
+
]
|
|
301
|
+
}
|
|
302
|
+
```
|
|
303
|
+
|
|
304
|
+
### Pattern 2: Minimum Balance
|
|
305
|
+
```typescript
|
|
306
|
+
{
|
|
307
|
+
type: "logic_as_u256_greater_or_equal",
|
|
308
|
+
nodes: [
|
|
309
|
+
{
|
|
310
|
+
type: "query",
|
|
311
|
+
query: "balance", // check wowok_buildin_info for correct ID
|
|
312
|
+
object: { identifier: 0 }, // account from table[0]
|
|
313
|
+
parameters: [
|
|
314
|
+
{ type: "identifier", identifier: 1 } // coin_type from table[1]
|
|
315
|
+
]
|
|
316
|
+
},
|
|
317
|
+
{ type: "identifier", identifier: 2 } // minimum balance from table[2]
|
|
318
|
+
]
|
|
319
|
+
}
|
|
320
|
+
```
|
|
321
|
+
|
|
322
|
+
### Pattern 3: Entity Registration Count
|
|
323
|
+
```typescript
|
|
324
|
+
{
|
|
325
|
+
type: "logic_as_u256_greater",
|
|
326
|
+
nodes: [
|
|
327
|
+
{
|
|
328
|
+
type: "query",
|
|
329
|
+
query: "entity_registrar_records_length",
|
|
330
|
+
object: { identifier: 0 }, // ENTITY_REGISTRAR_ADDRESS (0xaab)
|
|
331
|
+
parameters: []
|
|
332
|
+
},
|
|
333
|
+
{ type: "identifier", identifier: 1 } // 0 (check count > 0)
|
|
334
|
+
]
|
|
335
|
+
}
|
|
336
|
+
```
|
|
337
|
+
|
|
338
|
+
### Pattern 4: Rate Limiting (record check)
|
|
339
|
+
```typescript
|
|
340
|
+
{
|
|
341
|
+
type: "logic_not",
|
|
342
|
+
node: {
|
|
343
|
+
type: "record_check_recipient_order",
|
|
344
|
+
receipt_type: "specific_value",
|
|
345
|
+
recipient: { type: "identifier", identifier: 0 }
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
// Inverts: "has records" → false (blocked)
|
|
349
|
+
```
|
|
350
|
+
|
|
351
|
+
---
|
|
352
|
+
|
|
353
|
+
## Critical Rules
|
|
354
|
+
|
|
355
|
+
1. **`identifier` nodes reference table indices** — NOT arbitrary names. Every identifier must be defined in `table[]`.
|
|
356
|
+
2. **`query` nodes need `object.identifier`** — the target object comes from the Guard table.
|
|
357
|
+
3. **`query` instruction IDs come from `wowok_buildin_info`** — never guess query instruction IDs.
|
|
358
|
+
4. **Entity queries use system addresses** — ENTITY_LINKER_ADDRESS (0xaaa) and ENTITY_REGISTRAR_ADDRESS (0xaab).
|
|
359
|
+
5. **Root should return Bool** — final result determines pass/fail.
|
|
360
|
+
6. **node type names are lower_snake_case** — `logic_and`, `calc_number_add`, `convert_number_address`, etc.
|
|
361
|
+
7. **Guards are IMMUTABLE** — after creation, they cannot be modified. Export → Edit → Create New.
|
|
362
|
+
8. **Use `guard2file` for review** — always export and verify Guard logic before executing.
|
|
363
|
+
|
|
364
|
+
## Common Errors
|
|
365
|
+
|
|
366
|
+
| Error | Cause | Fix |
|
|
367
|
+
|-------|-------|-----|
|
|
368
|
+
| "unknown node type" | Wrong type name | Use exact names from this reference |
|
|
369
|
+
| "identifier out of range" | Table index mismatch | Verify identifiers match table indices |
|
|
370
|
+
| "query not found" | Invalid instruction ID | Query `wowok_buildin_info` for valid IDs |
|
|
371
|
+
| "type mismatch" | Wrong ValueType in table | Match table type to actual value type |
|
|
372
|
+
| "table field required" | Missing table array | Guards MUST have `table[]` |
|
|
373
|
+
| "guard validation failed" | Logic error | Export with `guard2file`, review logic |
|
|
374
|
+
| "object not found" | Wrong query object | Verify object addresses/identifiers |
|