@wowok/skills 1.1.5 → 1.1.7

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 CHANGED
@@ -170,6 +170,7 @@ const providerSkill = getSkillByName('wowok-provider');
170
170
  | `wowok-messenger` | Encrypted messaging (E2E communication, WTS evidence, conversation management) | All Roles | On-demand |
171
171
  | `wowok-guard` | Guard design mastery (programmable trust rules) | All Roles | On-demand |
172
172
  | `wowok-machine` | Machine workflow design (state machines, progress tracking) | Service Provider | On-demand |
173
+ | `wowok-output` | Output processing (address resolution, name mapping, amount formatting) | All Roles | Always |
173
174
  | `wowok-tools` | MCP tool usage mastery (13 tools, schema references) | All Roles | Always |
174
175
  | `wowok-safety` | Safety protocol (dry-run → confirm → execute) | All Roles | Always |
175
176
 
@@ -1 +1 @@
1
- {"version":3,"file":"skills.d.ts","sourceRoot":"","sources":["../src/skills.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAEpE;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,eAAO,MAAM,WAAW,EAAE,WA0EzB,CAAC;AAEF;;GAEG;AACH,wBAAgB,SAAS,IAAI,KAAK,EAAE,CAEnC;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,KAAK,GAAG,SAAS,CAE9D;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,SAAS,GAAG,KAAK,EAAE,CAExD;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,QAAQ,GAAG,WAAW,GAAG,KAAK,EAAE,CAExE;AAED;;GAEG;AACH,wBAAgB,aAAa,IAAI,UAAU,EAAE,CA4B5C;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,KAAK,EAAE,CAyBvD"}
1
+ {"version":3,"file":"skills.d.ts","sourceRoot":"","sources":["../src/skills.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAEpE;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,eAAO,MAAM,WAAW,EAAE,WAkFzB,CAAC;AAEF;;GAEG;AACH,wBAAgB,SAAS,IAAI,KAAK,EAAE,CAEnC;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,KAAK,GAAG,SAAS,CAE9D;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,SAAS,GAAG,KAAK,EAAE,CAExD;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,QAAQ,GAAG,WAAW,GAAG,KAAK,EAAE,CAExE;AAED;;GAEG;AACH,wBAAgB,aAAa,IAAI,UAAU,EAAE,CA4B5C;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,KAAK,EAAE,CAyBvD"}
package/dist/skills.js CHANGED
@@ -77,7 +77,7 @@ exports.wowokSkills = {
77
77
  },
78
78
  {
79
79
  name: 'wowok-tools',
80
- description: 'MCP tool usage mastery — query_toolkit, onchain_operations, messenger_operation, schema_query, and all 13+ tools with correct parameter formats. ALWAYS loaded for all roles.',
80
+ description: 'MCP tool usage mastery — query_toolkit, onchain_operations, messenger_operation, schema_query, and all 13 tools with correct parameter formats. ALWAYS loaded for all roles.',
81
81
  version: '1.0.0',
82
82
  role: 'shared',
83
83
  loading: 'always',
@@ -91,6 +91,14 @@ exports.wowokSkills = {
91
91
  loading: 'always',
92
92
  related: ['wowok-tools']
93
93
  },
94
+ {
95
+ name: 'wowok-output',
96
+ description: 'Output processing — post-processes all WoWok tool responses for human-readable presentation. Handles address resolution, name mapping, amount formatting, and data visualization. ALWAYS loaded for all roles.',
97
+ version: '1.0.0',
98
+ role: 'shared',
99
+ loading: 'always',
100
+ related: ['wowok-tools']
101
+ },
94
102
  {
95
103
  name: 'wowok-guard',
96
104
  description: 'Guard design mastery — programmable trust rules, multi-signature authorization, guard2file export/import. Used by providers and arbitrators for complex validation logic.',
@@ -1 +1 @@
1
- {"version":3,"file":"skills.js","sourceRoot":"","sources":["../src/skills.ts"],"names":[],"mappings":";;;AAwGA,8BAEC;AAKD,wCAEC;AAKD,0CAEC;AAKD,gDAEC;AAKD,sCA4BC;AAMD,0CAyBC;AA7LD;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEU,QAAA,WAAW,GAAgB;IACtC,MAAM,EAAE;QACN,wBAAwB;QACxB;YACE,IAAI,EAAE,aAAa;YACnB,WAAW,EAAE,sKAAsK;YACnL,OAAO,EAAE,OAAO;YAChB,IAAI,EAAE,UAAU;YAChB,OAAO,EAAE,WAAW;YACpB,OAAO,EAAE,CAAC,gBAAgB,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,aAAa,CAAC;SAClF;QAED,wBAAwB;QACxB;YACE,IAAI,EAAE,gBAAgB;YACtB,WAAW,EAAE,gNAAgN;YAC7N,OAAO,EAAE,OAAO;YAChB,IAAI,EAAE,UAAU;YAChB,OAAO,EAAE,WAAW;YACpB,OAAO,EAAE,CAAC,eAAe,EAAE,aAAa,EAAE,iBAAiB,EAAE,aAAa,CAAC;SAC5E;QACD;YACE,IAAI,EAAE,eAAe;YACrB,WAAW,EAAE,6JAA6J;YAC1K,OAAO,EAAE,OAAO;YAChB,IAAI,EAAE,UAAU;YAChB,OAAO,EAAE,WAAW;YACpB,OAAO,EAAE,CAAC,gBAAgB,EAAE,aAAa,CAAC;SAC3C;QAED,0BAA0B;QAC1B;YACE,IAAI,EAAE,kBAAkB;YACxB,WAAW,EAAE,oMAAoM;YACjN,OAAO,EAAE,OAAO;YAChB,IAAI,EAAE,YAAY;YAClB,OAAO,EAAE,WAAW;YACpB,OAAO,EAAE,CAAC,aAAa,EAAE,iBAAiB,EAAE,aAAa,CA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CAAC,EAAE,CAAC;QAC3G,OAAO,eAAe,CAAC,UAAU,CAAC,CAAC;IACrC,CAAC;IAED,sBAAsB;IACtB,IAAI,4EAA4E,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;QAC7F,OAAO,eAAe,CAAC,YAAY,CAAC,CAAC;IACvC,CAAC;IAED,iBAAiB;IACjB,IAAI,yEAAyE,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;QAC1F,OAAO,CAAC,cAAc,CAAC,aAAa,CAAE,CAAC,CAAC;IAC1C,CAAC;IAED,uCAAuC;IACvC,OAAO,kBAAkB,CAAC,WAAW,CAAC,CAAC;AACzC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wowok/skills",
3
- "version": "1.1.5",
3
+ "version": "1.1.7",
4
4
  "description": "WoWok AI Skills for Claude and other AI assistants - Helping AI use WoWok MCP tools correctly",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -4,7 +4,7 @@ description: |
4
4
  WoWok Arbitrator — build and operate on-chain arbitration services.
5
5
  Create Arbitration objects, configure voting rules (open or guard-based weighted),
6
6
  manage dispute cases through their full lifecycle, and earn fees from resolution.
7
-
7
+
8
8
  Core value: achieve trust consensus between merchants and users through
9
9
  transparent, fair, and efficient dispute resolution.
10
10
  when_to_use:
@@ -18,7 +18,55 @@ when_to_use:
18
18
 
19
19
  Build trust through fair dispute resolution. Arbitration services enable neutral third parties to resolve conflicts between customers and merchants, earning fees while establishing on-chain reputation.
20
20
 
21
- > **Related Skills**: [wowok-order](../wowok-order/SKILL.md) (customer disputes), [wowok-provider](../wowok-provider/SKILL.md) (service arbitration config), [wowok-guard](../wowok-guard/SKILL.md) (voting_guard design), [wowok-messenger](../wowok-messenger/SKILL.md) (evidence exchange)
21
+ > **Related Skills**: [wowok-order](../wowok-order/SKILL.md) (customer disputes), [wowok-provider](../wowok-provider/SKILL.md) (service arbitration config), [wowok-guard](../wowok-guard/SKILL.md) (voting_guard design), [wowok-machine](../wowok-machine/SKILL.md) (workflow analysis), [wowok-messenger](../wowok-messenger/SKILL.md) (evidence exchange), [wowok-safety](../wowok-safety/SKILL.md) (safety)
22
+
23
+ ---
24
+
25
+ ## ⚠️ PRE-FLIGHT: Required Items Checklist
26
+
27
+ **THIS SECTION IS MANDATORY.** Before ANY arbitration service creation, the AI MUST collect explicit user confirmation for EVERY required item. **Do NOT skip, do NOT fabricate, do NOT proceed with missing items.**
28
+
29
+ ### The Golden Rule
30
+
31
+ ```
32
+ NEVER guess the user's fee model, voting structure, or Guard design.
33
+ These are BUSINESS and GOVERNANCE decisions that ONLY the user can make.
34
+
35
+ User hasn't provided it → ASK.
36
+ User provides incomplete info → ASK for clarification.
37
+ User says "just make something up" → REFUSE and explain why each item matters.
38
+ ```
39
+
40
+ ### Required Items
41
+
42
+ | # | Item | User Must Provide | Why Not Fabricate |
43
+ |---|------|-------------------|--------------------|
44
+ | **R1** | **Account** | Which account to operate from. Default `""` is fine. | Safe default exists |
45
+ | **R2** | **Arbitration Name** | Service name. What kind of arbitration? | Your brand and reputation on-chain |
46
+ | **R3** | **Fee** | How much per case? (e.g. "10 WOW per dispute") | IS your revenue model — you cannot guess pricing |
47
+ | **R4** | **Voting Guard(s)** | Who votes and with what weight? Open voting (centralized) or Guard-based (decentralized)? | ⛔ Guards are **immutable after creation** — wrong design = create replacement Guard |
48
+ | **R5** | **Usage Guard** | Who can file disputes? Public or restricted? | Controls your case volume and quality |
49
+ | **R6** | **Contact (um)** | Messenger Contact name/ID for evidence exchange | Without this, customers cannot submit evidence — service is broken |
50
+
51
+ ### Information Collection Protocol
52
+
53
+ ```
54
+ STEP 0: Present checklist R1-R6 to user
55
+ ├── Each item: "Reuse or create new? Provide details."
56
+ ├── Track status: [pending] / [confirmed: reuse <id>] / [confirmed: create]
57
+ └── ⛔ GATE: ALL R1-R6 must be [confirmed] before any on-chain action
58
+ └── NOT confirmed → STOP. Ask. Do NOT suggest creating arbitration.
59
+ ```
60
+
61
+ All subsequent on-chain operations use R1 (Account) as `env.account`.
62
+
63
+ ### Anti-Fabrication Rules (HARD Constraints)
64
+
65
+ | Never... | Because... |
66
+ |----------|------------|
67
+ | Invent a fee amount | You don't know their pricing strategy |
68
+ | Assume usage_guard logic | You don't know their target audience |
69
+ | Skip the checklist | Arbitration design decisions are on-chain and visible |
22
70
 
23
71
  ---
24
72
 
@@ -39,9 +87,11 @@ Neither party can force outcome unilaterally — the design forces collaboration
39
87
 
40
88
  ### Arb State Machine
41
89
 
90
+ Customer dispute creates Arb directly at (1). State (0) entered only via `reset`.
91
+
42
92
  | State | Available Operations | Next State |
43
93
  |-------|---------------------|------------|
44
- | **(0) Principal_confirming** | Customer (via Order): `arb_confirm` | → (1) |
94
+ | **(0) Revision Pending** | Customer (via Order): `arb_confirm` | → (1) |
45
95
  | **(1) Arbitrator_confirming** | Arbitrator: `confirm` → (2), `reset` → (0), feedback | → (2) or (0) |
46
96
  | **(2) Voting** | Arbitrator: vote, set deadline, `arbitration` → (3), feedback | → (3) |
47
97
  | **(3) Arbitrated** | Customer (via Order): `arb_objection` → (4), `arb_claim_compensation` → (5) | → (4) or (5) |
@@ -67,7 +117,9 @@ Neither party can force outcome unilaterally — the design forces collaboration
67
117
  | `usage_guard` | Who can file disputes | Public vs invitation-only |
68
118
  | `um` | Contact for evidence exchange | Messenger addresses for WTS verification |
69
119
 
70
- **Start paused** (`pause: true`). Configure everything before accepting disputes.
120
+ **⚠️ Start paused** (`pause: true`). **Forgetting to unpause = all disputes silently rejected with no error.** Complete all configuration — fee, guards, um — before unpausing.
121
+
122
+ **⚠️ Guard Immutability**: Once a Guard is created, its rules **cannot be modified**. If your `voting_guard` design is wrong, you must create a replacement Guard and reconfigure the Arbitration — wasteful but not fatal. Test with `gen_passport` before finalizing.
71
123
 
72
124
  ### Voting Modes
73
125
 
@@ -81,54 +133,34 @@ Neither party can force outcome unilaterally — the design forces collaboration
81
133
  - `FixedValue(u32)`: Equal weight for all qualified voters
82
134
  - `GuardIdentifier(u8)`: Dynamic weight from credential (e.g., reputation score, token balance)
83
135
  - Max 50 guards — enables tiered voting (experts + community, token-holders + NFT-holders)
136
+ - **Guard table design**: When using `GuardIdentifier`, the referenced index must be a `b_submission: true` entry of **numeric type** (U8–U256). Its value is cast to u32 as the voter's weight. The `name` field of that entry should explain its purpose to Passport applicants.
84
137
 
85
138
  **Voting Flow**: Voter selects a voting guard → System verifies voter's Passport against that guard → Calculates weight based on guard's rule → Applies weight to selected propositions. One vote per voter per case.
86
139
 
140
+ > **Guard Design Reference**: Voting guards follow the same construction as all Guards. See [wowok-guard](../wowok-guard/SKILL.md) for table design, computation trees, and the full type requirements by object.
141
+
87
142
  ---
88
143
 
89
144
  ## Phase 2: Handle Cases
90
145
 
91
146
  ### Case Lifecycle
92
147
 
93
- **1. Arrival** (`dispute` by customer)
94
- - Arb created in state (1)
95
- - Fee locked in `arb.fee`
96
- - Customer's propositions recorded
97
-
98
- **2. Review** Two paths:
99
-
100
- | Path | Condition | Action | Result |
101
- |------|-----------|--------|--------|
102
- | **Proceed** | Propositions clear, evidence sufficient | `confirm` + `voting_deadline` | → Voting (2) |
103
- | **Revise** | Ambiguous claims, insufficient evidence | `reset` + feedback | → Principal_confirming (0) |
148
+ | # | Step | State | Action |
149
+ |---|------|-------|--------|
150
+ | 1 | **Arrival** | (1) | Arb created via customer `dispute`. Fee locked, propositions recorded. |
151
+ | 2 | **Review** ⚠️ | (1) | `confirm` (proceed) or `reset` (send back). **Insufficient → MUST reset.** |
152
+ | 3 | **Voting** | (2) | Vote, set `voting_deadline` (≤ 3 days). Max 520 voters. |
153
+ | 4 | **Finalize** ⛔ | (2)→(3) | `arbitration`: sets `feedback` + `indemnity`. **Irreversible** by arbitrator. |
154
+ | 5 | **Resolution** | (3) | Customer: `arb_claim_compensation` → (5), or `arb_objection` → (4). |
155
+ | 6 | **Objection** | (4) | Only `reset` → (0) for revision. |
156
+ | 7 | **Withdraw** | (5)/(3)/(4) | Finished: **immediate**. Others: ⛔ **30-day mandatory wait**. |
104
157
 
105
- **Best Practice**: Use `reset` proactively. A revision cycle is faster than a flawed arbitration followed by objection.
158
+ **Reset feedback channels**:
106
159
 
107
- **3. Voting** (state 2)
108
- - Votes accumulate on propositions
109
- - Voters can change votes (old votes replaced)
110
- - Max 520 voters per case
111
-
112
- **4. Finalization** (`arbitration` operation)
113
- - Sets `feedback` (reasoned decision)
114
- - Sets `indemnity` (compensation amount, 0 = provider wins)
115
- - Requires deadline passed (if set)
116
- - → Arbitrated (3)
117
-
118
- **5. Resolution** — Customer chooses (via Order operations):
119
-
120
- | Choice | Action | Result |
121
- |--------|--------|--------|
122
- | **Accept** | `arb_claim_compensation` | → Finished (5), fee withdrawable |
123
- | **Object** | `arb_objection` | → Objectionable (4) |
124
-
125
- **6. Objection Handling**
126
- - Only action: `reset` → back to (0) for revision
127
- - Forces collaborative resolution — no override mechanism
128
-
129
- **7. Fee Withdrawal**
130
- - From Finished: Immediate
131
- - From Arbitrated/Objectionable: 30-day wait (protects customer rights)
160
+ | Channel | Use | Visibility |
161
+ |---------|-----|------------|
162
+ | **Messenger** (preferred) | Specific evidence, privacy-sensitive | Encrypted, off-chain |
163
+ | **on-chain feedback** | General clarification, procedural | Public, permanent |
132
164
 
133
165
  ---
134
166
 
@@ -154,63 +186,32 @@ Customer pays fee
154
186
 
155
187
  Arbitrator sets `indemnity` → Customer claims via `order.arb_claim_compensation` → Funds transfer from `service.compensation_fund` to Order.
156
188
 
157
- **Key Principle**: Arbitrator decides amount, provider's fund pays it. This aligns incentives providers have reason to avoid disputes, arbitrators have reason to be fair.
158
-
159
- > See [wowok-order](../wowok-order/SKILL.md) for customer-side arbitration operations.
189
+ > **Note**: The compensation payout comes from the **provider's** compensation_fund, not the arbitrator's funds. Customers should assess the provider's fund balance before purchase this is covered in [wowok-order](../wowok-order/SKILL.md) Phase 1.1.
160
190
 
161
191
  ---
162
192
 
163
- ## Integration Patterns
193
+ ## Integration
164
194
 
165
- ### Evidence Workflow (Messenger)
195
+ ### Evidence (Messenger)
166
196
 
167
197
  1. Customer queries Arbitration's `um` → gets Messenger addresses
168
198
  2. Customer sends WTS evidence files (encrypted, off-chain)
169
- 3. Arbitrator verifies WTS authenticity (`messenger_operation` with `verify_wts`)
199
+ 3. Arbitrator verifies WTS authenticity (`verify_wts`)
170
200
  4. Only verified evidence considered valid
171
201
 
172
- **Why WTS**: Cryptographically proves communication history without on-chain exposure.
173
-
174
- ### Guard Relationships
175
-
176
- | Guard | Purpose | Effect |
177
- |-------|---------|--------|
178
- | `usage_guard` | Access control | Must satisfy to file dispute |
179
- | `voting_guard` | Authentication + weight | Must satisfy to vote; weight from rule |
202
+ **⚠️ `um` must be configured before unpausing** — without it customers cannot submit evidence.
180
203
 
181
- **Design Principle**: `usage_guard` = yes/no gate; `voting_guard` = credential-verified weighted participation.
182
-
183
- ### Service Provider Integration
204
+ ### Service Provider
184
205
 
185
206
  Providers list approved Arbitrations in their Service. Customers choose from this list when disputes arise.
186
207
 
187
- **Trust Flywheel**: Fair arbitrators get listed by more providers → more cases → more revenue → stronger reputation → more provider listings.
188
-
189
208
  ---
190
209
 
191
210
  ## Design Principles
192
211
 
193
- ### Fairness Mechanisms
194
-
195
- 1. **Separated Powers**: Arbitrator cannot force acceptance; customer cannot force ruling
196
- 2. **Revision Cycles**: `reset` enables correction without penalty
197
- 3. **Objection Rights**: Customer always retains right to contest
198
- 4. **Transparent Rules**: All voting logic on-chain, verifiable
199
- 5. **Timed Withdrawal**: 30-day wait protects customer claim rights
200
-
201
- ### Efficiency Mechanisms
202
-
203
- 1. **State Machine**: Clear progression, no ambiguity about next steps
204
- 2. **Weighted Voting**: Credential-based influence reduces voter spam
205
- 3. **Deadline Enforcement**: Optional time-boxing prevents indefinite delays
206
- 4. **Fee Incentive**: Arbitrator earns per case, motivated to resolve
207
-
208
- ### Trust Building
209
-
210
- 1. **On-Chain Reputation**: Past rulings (`feedback`) are public and permanent
211
- 2. **Consistent Standards**: Apply uniform criteria across similar cases
212
- 3. **Reasoned Decisions**: Detailed `arbitration.feedback` explains logic
213
- 4. **Professional Response**: Monitor Messenger, verify WTS promptly
212
+ - **Fairness**: Separated powers (neither side can force outcome), revision cycles (`reset`), customer objection rights, transparent on-chain rules, 30-day withdrawal protection.
213
+ - **Efficiency**: Clear state machine, weighted voting to reduce spam, deadline enforcement, fee incentive for timely resolution.
214
+ - **Trust**: ⚠️ Feedback is permanently public be reasoned and professional. Apply consistent standards. Monitor Messenger, verify WTS promptly.
214
215
 
215
216
  ---
216
217
 
@@ -221,34 +222,24 @@ Providers list approved Arbitrations in their Service. Customers choose from thi
221
222
  | Operation | State | Purpose |
222
223
  |-----------|-------|---------|
223
224
  | `confirm` | (1)→(2) | Start voting, set deadline |
224
- | `reset` | (1)→(0), (4)→(0) | Request revision |
225
+ | `reset` | (1)→(0), (4)→(0) | Request revision (requires feedback) |
225
226
  | `vote` | (2) | Cast weighted votes |
226
- | `arbitration` | (2)→(3) | Finalize with indemnity |
227
- | `arb_withdraw` | (5), (3), (4) | Extract fee to balance |
227
+ | `arbitration` | (2)→(3) | Finalize verdict (**irreversible**) |
228
+ | `arb_withdraw` | (5), (3), (4) | Extract fee (30-day wait if not finished) |
228
229
 
229
230
  ### Common Workflows
230
231
 
231
- **Standard Resolution**:
232
- ```
233
- Dispute → Review → Confirm → Vote → Finalize → arb_claim_compensation → Withdraw
234
- ```
235
-
236
- **With Revision**:
237
- ```
238
- Dispute → Reset → arb_confirm → Confirm → Vote → Finalize → arb_claim_compensation → Withdraw
239
- ```
240
-
241
- **With Objection**:
242
- ```
243
- Dispute → Confirm → Vote → Finalize → arb_objection → Reset → arb_confirm → Confirm → Vote → Finalize → arb_claim_compensation → Withdraw
244
- ```
232
+ See [Core Architecture > Key Flows](#arb-state-machine) above.
245
233
 
246
234
  ### Critical Constraints
247
235
 
248
236
  - Max 20 propositions per case
249
237
  - Max 520 voters per case
250
238
  - Max 50 voting guards per Arbitration
251
- - 30-day withdrawal wait for non-finished cases
239
+ - 30-day withdrawal wait for non-finished cases (mandatory, cannot bypass)
240
+ - ⛔ Guard is **immutable after creation** — test before finalizing
241
+ - ⛔ `arbitration` verdict is **irreversible** by arbitrator — only customer can object
242
+ - ⛔ `feedback` is **permanently public on-chain** — use Messenger for privacy-sensitive communication
252
243
 
253
244
  ### Schema Access
254
245
 
@@ -262,18 +253,21 @@ schema_query({ action: "get", name: "messenger_operation" })
262
253
 
263
254
  ## Best Practices
264
255
 
265
- 1. **Configure before unpause**: Fee, contact, voting rules ready first
266
- 2. **Reset proactively**: Unclear case? Send back immediately
267
- 3. **Verify all evidence**: Use `verify_wts` before evaluating
268
- 4. **Write detailed feedback**: Your on-chain reputation
269
- 5. **Set fair indemnity**: Proportional to order value and dispute nature
270
- 6. **Test guards first**: Use `gen_passport` to verify voting_guard logic
271
- 7. **Monitor compensation funds**: Warn if provider fund insufficient for indemnity
256
+ 1. **Configure before unpause**: Fee, contact, voting rules ready first. ⚠️ Unpause is the last step.
257
+ 2. **Reset proactively**: Unclear case? Send back immediately with clear feedback (Messenger preferred for privacy).
258
+ 3. **Verify all evidence**: Use `verify_wts` before evaluating — unverified evidence is not evidence.
259
+ 4. **Write detailed feedback**: Your on-chain reputation is permanent. Be professional, reasoned, and fair.
260
+ 5. **Set fair indemnity**: Proportional to order value and dispute nature.
261
+ 6. **Test guards first**: Use `gen_passport` to verify voting_guard logic before deployment.
262
+ 7. **Set reasonable deadlines**: Suggest 3 days for voting — balances efficiency with thoroughness.
272
263
 
273
264
  ### Common Pitfalls
274
265
 
275
- - **Paused Arbitration**: Silently rejects disputes — remember to unpause
276
- - **Past deadline**: Set future timestamps only
277
- - **Empty reset feedback**: Explain why revision needed
278
- - **Early withdrawal**: Wait for Finished state or 30-day timer
279
- - **Unverified evidence**: Always verify WTS before using
266
+ | Pitfall | Consequence | Prevention |
267
+ |---------|------------|------------|
268
+ | **Paused Arbitration** | All disputes silently rejected | Verify `pause: false` after configuration |
269
+ | **Wrong Guard design** | Must create replacement Guard | Test with `gen_passport` before creating |
270
+ | **Past deadline** | Vote cannot be finalized | Set future timestamps only |
271
+ | **Empty reset feedback** | Customer doesn't know what to fix | Always provide feedback on reset |
272
+ | **Early withdrawal** | Funds locked for 30 days if not finished | Wait for Finished state |
273
+ | **Unverified evidence** | Ruling based on invalid claims | Always verify WTS first |
@@ -6,7 +6,7 @@ description: |
6
6
  the trust layer for Services (buy_guard), Arbitration (voting_guard weight,
7
7
  usage_guard), Machines (forward validation), Demands (recommendation filtering),
8
8
  Rewards (claim eligibility), and Repositories (write validation with data extraction).
9
- Guards also enable off-chain use cases: generate a Passport via `gen_passport` to
9
+ Guards also enable off-chain use cases: generate a Passport via `onchain_operations` (`operation_type: "gen_passport"`) to
10
10
  obtain a signed, time-bound credential for off-chain permission verification.
11
11
  when_to_use:
12
12
  - User wants to create or modify a Guard
@@ -22,13 +22,8 @@ when_to_use:
22
22
  # WoWok Guard Design Reference
23
23
 
24
24
  > **Role**: Service Provider, Arbitrator, or any builder needing programmable on-chain validation
25
- > **Prerequisites**: Understand CREATE vs MODIFY pattern — Guards are CREATE-only; once deployed on-chain their logic is frozen forever
26
- > **Machine Integration**: See [wowok-machine](../wowok-machine/SKILL.md) for how Guards attach to workflow node forwards
27
- > **Service Provider**: See [wowok-provider](../wowok-provider/SKILL.md) for buy_guard, allocator guards, and reward guard configuration
28
- > **Customer Order Operations**: See [wowok-order](../wowok-order/SKILL.md) for Guard submissions during Progress advancement and the arbitration dispute process from the customer's perspective
29
- > **Arbitrator Operations**: See [wowok-arbitrator](../wowok-arbitrator/SKILL.md) for voting_guard and usage_guard configuration, vote organization, and the full Arb case lifecycle from the arbitrator's perspective
30
- > **Messenger**: See [wowok-messenger](../wowok-messenger/SKILL.md) for encrypted evidence exchange
31
- > **Tools**: See [wowok-tools](../wowok-tools/SKILL.md)
25
+ > **Prerequisites**: Guards are CREATE-only; frozen on-chain once deployed
26
+ > **Related Skills**: [wowok-machine](../wowok-machine/SKILL.md) (forward guards), [wowok-provider](../wowok-provider/SKILL.md) (buy_guard, allocator guards), [wowok-order](../wowok-order/SKILL.md) (guard submissions), [wowok-arbitrator](../wowok-arbitrator/SKILL.md) (voting_guard, usage_guard), [wowok-messenger](../wowok-messenger/SKILL.md) (encrypted evidence), [wowok-safety](../wowok-safety/SKILL.md) (naming, confirmation), [wowok-tools](../wowok-tools/SKILL.md) (tool reference)
32
27
 
33
28
  ---
34
29
 
@@ -58,9 +53,9 @@ Every Guard is built from three layers, each with a distinct role:
58
53
 
59
54
  **The root is the question**: It must return Bool. Intermediate nodes return numbers, strings, addresses, or vectors. Guard is **strongly typed** — the type system is strictly enforced at creation time. Type mismatches (e.g., passing a string to a numeric comparison node) will cause validation errors and prevent Guard creation.
60
55
 
61
- **The rely is composition**: Up to 4 dependent Guards. When `rely.logic_or` is false (default), all dependencies must pass. When true, any dependency passing is sufficient. This lets you build complex validation from simple, tested components. A Guard can only depend on Guards that are themselves standalone (`immutable: true` and `rep: true`) no circular or transitive dependency chains.
56
+ **The rely is composition**: Up to 4 dependent Guards. When `rely.logic_or` is false (default), all dependencies must pass (AND). When true, any passing is sufficient (OR). A Guard can only depend on Guards with `rep: true` `rep` is the Guard's internal flag indicating it has no external Repository dependency and can serve as a dependency. Guards with `rep: false` cannot appear in `rely` lists. Violations are caught by the contract layer at creation time.
62
57
 
63
- ### 4. Where Guards Attach in the Ecosystem
58
+ ### Where Guards Attach in the Ecosystem
64
59
 
65
60
  Guards are not standalone — they plug into other WoWok objects as validation rules. Understanding these integration points is essential because the **context** of the Guard determines what data is available to it and what happens when it fails.
66
61
 
@@ -108,11 +103,24 @@ Every Guard answers these questions:
108
103
  | "Vote weight equals reputation score" | Dynamic weight | GuardIdentifier extracts numeric value from Passport | Table needs numeric submission entry at referenced index. Guard validates eligibility AND weight range |
109
104
  | "Only premium members can file disputes" | Membership verification | Entity registration or tier check | `query` on ENTITY_REGISTRAR_ADDRESS or Repository. Combine entity existence check with tier comparison via `logic_and` |
110
105
 
106
+ ### Quick Decision: What Guard Pattern Fits?
107
+
108
+ ```
109
+ Identity check? → context(Signer) + logic_equal (single address) / vec_contains_address (allowlist)
110
+ Time constraint? → context(Clock) + calc_number_* comparisons
111
+ External data? → query + table entry declaring target object address
112
+ Progress state? → query_progress_history_find + convert_witness
113
+ One-time claim? → query_reward_record_count + logic_equal(0)
114
+ Dynamic weight? → GuardIdentifier + numeric table entry (b_submission: true)
115
+ External Repository? → query + table entry declaring Repository address
116
+ Entity reputation? → query + table entry declaring ENTITY_REGISTRAR_ADDRESS(0xaab) / ENTITY_LINKER_ADDRESS(0xaaa)
117
+ ```
118
+
111
119
  ### Design Before Building
112
120
 
113
- The Guard design process is entirely upfront. There is no "draft" or "edit" phase after creation. Design thoroughly before calling the create operation:
121
+ **Design thoroughly before calling the create operation** there is no edit phase after creation (see The Immutability Contract above).
114
122
 
115
- 1. **Query available query instructions first**: Before designing any Guard that queries on-chain data, use `wowok_buildin_info` with query `"guard queries"` to retrieve the complete list of available query instructions. Each query has a specific ID, name, parameters, and return type — you MUST verify these details before constructing your Guard. Never guess query instruction names or parameter types.
123
+ 1. **Query available query instructions first**: Before designing any Guard that queries on-chain data, use `wowok_buildin_info` with info `"guard instructions"` to retrieve the complete list of available query instructions. Each query has a specific ID, name, parameters, and return type — you MUST verify these details before constructing your Guard. Never guess query instruction names or parameter types.
116
124
  2. List every data dependency — what must the caller provide? What constants are baked in?
117
125
  3. Sketch the logic tree — what comparisons, arithmetic, and logical combinations produce the final boolean?
118
126
  4. Verify types — does every comparison receive compatible operands? Are all conversions explicit?
@@ -130,7 +138,7 @@ The Guard table is the **complete declaration of information** the Guard consume
130
138
  |-------|---------|---------------|
131
139
  | `identifier` | Unique index (0–255). The computation tree uses this number to reference the entry. | Always |
132
140
  | `b_submission` | Whether the **caller** must provide this value at runtime. `true` = runtime submission; `false` = pre-set constant. | Always |
133
- | `value_type` | The type of the value: Bool, Address, String, U8–U256, or vector types. Uses numeric type codes (use `wowok_buildin_info` with query `"value types"` for the complete mapping). | Always |
141
+ | `value_type` | The type of the value: Bool, Address, String, U8–U256, or vector types. Uses numeric type codes (use `wowok_buildin_info` with info `"value types"` for the complete mapping). | Always |
134
142
  | `value` | The constant value when `b_submission` is false; a placeholder when `b_submission` is true. | When `b_submission` is false |
135
143
  | `name` | Human-readable label describing what this entry represents. | Always |
136
144
 
@@ -141,7 +149,9 @@ The Guard table is the **complete declaration of information** the Guard consume
141
149
  - **Non-submission entries must have a value.** These are baked into the Guard immutably.
142
150
  - **Submission entries use placeholder values.** The actual value is provided by the caller at runtime.
143
151
  - **Query target objects must be of type Address in the table.** Their `object_type` field should match the expected query target type (Progress, Order, Machine, Reward, etc.).
152
+ - **Querying EntityRegistrar or EntityLinker requires system address table entries.** Add entries for `ENTITY_REGISTRAR_ADDRESS` (`0xaab`) or `ENTITY_LINKER_ADDRESS` (`0xaaa`) to the table as Address-type constants when your query instruction targets these global registries. Without them, creation fails.
144
153
  - **Maximum 256 table entries** (identifiers 0–255). The total serialized table size must not exceed 40000 bytes.
154
+ - **Submission entries must have descriptive `name` values.** For `b_submission: true` entries, `name` is the contract between Guard and caller — it tells callers what data they must provide. Use natural language that explains the purpose and necessity: "The order ID that identifies the target Order for verification" not `"order_id"`, "The signer's account address that will be compared against the authorized list" not `"addr"`. This is critical because callers see only this name when submitting data.
145
155
 
146
156
  ### The convert_witness Mechanism
147
157
 
@@ -150,26 +160,14 @@ The Guard table is the **complete declaration of information** the Guard consume
150
160
  **Core principle**: Caller submits what they have (e.g., Order ID); Guard queries what it needs (e.g., Progress state) via witness conversion.
151
161
 
152
162
  **Rules**:
153
- - Witness type encodes source→target transformation (e.g., `100` = Order→Progress)
163
+ - Witness type encodes source→target transformation
154
164
  - Table entry's `object_type` must match witness source type
155
165
  - Query instruction's object type must match witness target type
156
166
  - Type mismatches cause Guard creation to fail
157
167
 
158
- **Available Witness Types**:
168
+ **Available witness types** are defined in the schema — query `wowok_buildin_info` with info `"guard instructions"` for the complete list with use cases.
159
169
 
160
- | Witness Type | Value | Source Target | Use Case |
161
- |--------------|-------|-----------------|----------|
162
- | TypeOrderProgress | 100 | Order → Progress | Check if order has reached a specific workflow node (e.g., 'complete') before allowing reward claims |
163
- | TypeOrderMachine | 101 | Order → Machine | Verify the workflow structure or check node configurations |
164
- | TypeOrderService | 102 | Order → Service | Validate the service offering details or check service-level configurations |
165
- | TypeProgressMachine | 103 | Progress → Machine | Access workflow definition from a Progress context |
166
- | TypeArbOrder | 104 | Arb → Order | In arbitration voting guards, verify order details like payment amount or service ID |
167
- | TypeArbArbitration | 105 | Arb → Arbitration | Access arbitration configuration or fee settings from within an Arb case |
168
- | TypeArbProgress | 106 | Arb → Progress | Check order workflow state during arbitration validation |
169
- | TypeArbMachine | 107 | Arb → Machine | Access workflow definition for dispute context analysis |
170
- | TypeArbService | 108 | Arb → Service | Verify service terms or compensation fund status during arbitration |
171
-
172
- **Example**: To validate that an order has reached the 'complete' node, query the Order with `convert_witness=100` (TypeOrderProgress) and check the Progress's `current_node` field.
170
+ **Notable**: `TypeArbArbitration (105)`: Arb and Arbitration are **different on-chain objects**. The witness queries the Arbitration (parent service) from an Arb (case) address — the binding is set when Arbitration creates the Arb. Schema describes this as "access arbitration configuration or fee settings."
173
171
 
174
172
  ---
175
173
 
@@ -181,7 +179,6 @@ The root tree is a computational expression whose terminal nodes read data and w
181
179
 
182
180
  - **Type safety is enforced at creation time.** Every node validates that its children return types compatible with its operation. A `logic_equal` node that receives a String child and a U64 child will fail validation.
183
181
  - **Evaluation order is stack-based.** Children are evaluated in reverse, so the first child in the array appears at the top of the evaluation stack.
184
- - **The root must return Bool.** Logic and comparison nodes produce Bool. Arithmetic nodes produce numbers. Conversion nodes produce the target type. Ensure your outermost node is a logic or comparison type.
185
182
  - **Every `identifier` node's index must exist in the table.** This is validated at creation time.
186
183
 
187
184
  ### Discovering Available Node Types
@@ -199,7 +196,7 @@ This returns the complete `GuardNodeSchema` definition — every node type, its
199
196
 
200
197
  **Key principle**: Every node declares its return type and the types it expects from children. The schema enforces these constraints at Guard creation time — type mismatches cause creation to fail. All numeric comparisons normalize to U256, enabling cross-type comparisons without explicit conversion.
201
198
 
202
- **Query instructions**: For the `query` node, discover available instructions via `wowok_buildin_info` with query `"guard instructions"`. Use the `filter` parameter to narrow results by name, return type, parameter count, or object type — more effective than browsing raw ID ranges.
199
+ **Query instructions**: For the `query` node, discover available instructions via `wowok_buildin_info` with info `"guard instructions"`. Use the `filter` parameter to narrow results by name, return type, parameter count, or object type — more effective than browsing raw ID ranges.
203
200
 
204
201
  ---
205
202
 
@@ -211,6 +208,10 @@ Guard creation is a **single atomic operation** — it either succeeds (the Guar
211
208
 
212
209
  Use `onchain_operations` with `operation_type: "guard"`.
213
210
 
211
+ **Two creation modes**:
212
+ - `root.type: "node"` — build the computation tree directly in the operation payload.
213
+ - `root.type: "file"` — load the tree from a `guard2file`-exported JSON/Markdown file. Use this to iterate on existing Guards: export → edit file → create new Guard from file.
214
+
214
215
  **Schema Reference**: `schema_query({ action: "get", name: "onchain_operations_guard" })`
215
216
 
216
217
  ---
@@ -221,9 +222,9 @@ Use `onchain_operations` with `operation_type: "guard"`.
221
222
 
222
223
  Before embedding a Guard into a live Machine, Service, or Arbitration, test it in isolation.
223
224
 
224
- **Tool**: `gen_passport`
225
+ **Tool**: `onchain_operations` with `operation_type: "gen_passport"`
225
226
 
226
- **Schema Reference**: `schema_query({ action: "get", name: "gen_passport" })`
227
+ **Schema Reference**: `schema_query({ action: "get", name: "onchain_operations_gen_passport" })`
227
228
 
228
229
  This tool verifies one or more Guards and, on success, generates an immutable Passport — a verified credential stored on-chain. Use it to:
229
230
 
@@ -232,12 +233,32 @@ This tool verifies one or more Guards and, on success, generates an immutable Pa
232
233
 
233
234
  The Passport itself is useful beyond testing — it serves as a reusable on-chain credential for offline verification, transaction condition checking, and multi-guard validation. A single Passport can satisfy multiple Guards in a single transaction.
234
235
 
236
+ **Multi-Guard behavior**: When verifying multiple Guards, they are AND-ed — all must pass for the Passport to be generated. Each Guard's submission is passed independently.
237
+
238
+ **Optional `info` field**: If you omit `info` (submission data), the system attempts to auto-fetch existing submissions from the Guard. Provide `info` explicitly when testing with custom inputs.
239
+
240
+ **Passport query**: Once generated, query the Passport object via `query_toolkit` → `onchain_objects` to inspect its data, validated Guards, and timestamp.
241
+
235
242
  ### Query On-Chain Guards
236
243
 
237
244
  **Tool**: `query_toolkit` with `query_type: "onchain_objects"`
238
245
 
239
246
  Guards are **public consensus**. Once bound to objects (Service, Machine, Arbitration), they become the trusted executor of rights and obligations. All parties can inspect the exact validation rules — this transparency is the foundation of trustless interaction. Query Guards before engaging with any protected operation.
240
247
 
248
+ Query results include `_guard_node_comments` — human-readable annotations for each computation node automatically injected by the system. Use these to quickly verify that the Guard's logic matches the intended design without manually decoding the node tree.
249
+
250
+ ### Guard Iteration Workflow
251
+
252
+ Guards are immutable but iterable. The full cycle:
253
+
254
+ ```
255
+ 1. guard2file <existing_guard> → JSON/Markdown file
256
+ 2. Edit file (table, root tree, rely)
257
+ 3. Review edited JSON with user → confirm
258
+ 4. onchain_operations(guard) with root.type="file" → new Guard created
259
+ 5. Update all references (Machine forwards, Service buy_guard, Arbitration voting_guard, etc.)
260
+ ```
261
+
241
262
  ---
242
263
 
243
264
  ## Guard Data Flow: How Objects Read Guard Data
@@ -258,12 +279,24 @@ Machine's forward `guard` validates state transitions. If `retained_submission`
258
279
 
259
280
  ### Repository: Policy Write Guard with Data Extraction
260
281
 
261
- Repository's `write_guard` validates writes. If `id_from_submission` is set, reads entity ID from that submission index; if `data_from_submission` is set, reads data value from that index. Guard table must include entries for the data being extracted.
282
+ Repository's `write_guard` validates writes. If `id_from_submission` is set, reads entity ID from that submission index **the index must be Address type**. If `data_from_submission` is set, reads data value from that index — **the value type must match the Repository's declared value_type**. Guard table must include entries for the data being extracted.
262
283
 
263
284
  ---
264
285
 
265
286
  **Key Principle**: Design your Guard table based on what data the target object needs to read. Objects don't just validate — they consume Guard submissions as structured data inputs.
266
287
 
288
+ ### Type Requirements by Object
289
+
290
+ Each object extracts Guard data with precise type expectations. Mismatches cause creation or runtime failure:
291
+
292
+ | Object | Extraction Field | Table Index Requirement | Type Constraint |
293
+ |--------|-----------------|------------------------|-----------------|
294
+ | **Arbitration** `voting_guard` | Vote weight via `GuardIdentifier(u8)` | Index must be `b_submission: true` | **Numeric** (U8–U256, cast to u32) |
295
+ | **Demand** `ServiceGuard` | `service_identifier` mapping | Index must be `b_submission: true` | Depends on Service validation |
296
+ | **Machine** Forward | `retained_submission` | Index must be `b_submission: true`; uniquely located by `node→next_node→forward` triple | As declared in table |
297
+ | **Repository** | `id_from_submission` | Index must be `b_submission: true` | **Must be Address** |
298
+ | **Repository** | `data_from_submission` | Index must be `b_submission: true` | **Must match Repository's value_type** |
299
+
267
300
  ---
268
301
 
269
302
  ## Best Practices
@@ -274,7 +307,7 @@ Repository's `write_guard` validates writes. If `id_from_submission` is set, rea
274
307
 
275
308
  2. **Type mismatches in comparison nodes**: A `logic_equal` comparing a String to a U64 fails validation. Use explicit conversion nodes (`convert_string_number`, `convert_number_string`) when types differ. Numeric comparisons use `logic_as_u256_*` variants which auto-widen to U256.
276
309
 
277
- 3. **Wrong query instruction IDs or parameter counts**: Query instructions are system-defined. Always discover them through `wowok_buildin_info` with `"guard instructions"`. The parameter count and types in your query node must match the instruction exactly — off-by-one parameter counts are a common failure.
310
+ 3. **Wrong query instruction IDs or parameter counts**: Query instructions are system-defined. Always discover them through `wowok_buildin_info` with info `"guard instructions"`. The parameter count and types in your query node must match the instruction exactly — off-by-one parameter counts are a common failure.
278
311
 
279
312
  4. **Missing convert_witness**: When accessing Progress data from an Order ID in the table, the query node needs `convert_witness` with the appropriate witness type. Without it, the runtime looks for a Progress at the Order's address — which does not exist as a Progress object. The creation-time validation catches this mismatch.
280
313
 
@@ -284,7 +317,7 @@ Repository's `write_guard` validates writes. If `id_from_submission` is set, rea
284
317
 
285
318
  7. **Root not returning Bool**: The outermost node of the tree must produce Bool. Logic and comparison nodes return Bool; arithmetic, conversion, and string operation nodes do not. Ensure your tree terminates at a logic or comparison node — the creation validation will reject non-Bool roots.
286
319
 
287
- 8. **Dependency on non-standalone Guards**: A Guard's `rely` entries must reference Guards that are themselves standalone (`immutable: true` and `rep: true`). Guards with their own dependencies cannot be used as dependencies for others this is a strict no-transitive-dependency rule.
320
+ 8. **Dependency on non-standalone Guards**: A Guard's `rely` entries must reference Guards with `rep: true` meaning they have no external Repository dependency. Guards that depend on a Repository (`rep: false`) cannot serve as dependencies. The contract layer catches violations at creation time.
288
321
 
289
322
  9. **Forgetting voting_guard weight type validation**: When using `GuardIdentifier`, the referenced identifier must exist in the guard's table and its value type must be numeric. The system checks this when the VotingGuard is added to the Arbitration — if the identifier does not exist or is non-numeric, the operation reverts with `E_GUARD_IDENTIFIER_NOT_NUMBER`.
290
323
 
@@ -296,10 +329,10 @@ Repository's `write_guard` validates writes. If `id_from_submission` is set, rea
296
329
 
297
330
  | Tool | Purpose |
298
331
  |------|---------|
299
- | `wowok_buildin_info` (`query: "guard instructions"`) | Discover all available query instructions — their IDs, parameter types, return types, and target object types |
300
- | `wowok_buildin_info` (`query: "value types"`) | Discover the numeric codes for all supported value types used in table entries |
301
- | `wowok_buildin_info` (`query: "built-in permissions"`) | Discover all built-in permission index codes for use with `permission.entity.perm has` queries |
302
- | `gen_passport` | Test Guard validation with runtime submissions and generate a verified on-chain credential on success |
332
+ | `wowok_buildin_info` (`info: "guard instructions"`) | Discover all available query instructions — their IDs, parameter types, return types, and target object types |
333
+ | `wowok_buildin_info` (`info: "value types"`) | Discover the numeric codes for all supported value types used in table entries |
334
+ | `wowok_buildin_info` (`info: "built-in permissions"`) | Discover all built-in permission index codes for use with `permission.entity.perm has` queries |
335
+ | `onchain_operations` (`operation_type: "gen_passport"`) | Test Guard validation with runtime submissions and generate a verified on-chain credential on success |
303
336
  | `guard2file` | Export an existing Guard's complete definition (description, table, root tree, dependencies) to a local JSON or Markdown file |
304
337
  | `query_toolkit` (`query_type: "onchain_objects"`) | Query any Guard object on-chain by name or address to inspect its full definition |
305
338
  | `schema_query` (`name: "onchain_operations_guard"`) | Retrieve the complete Guard operation schema with all parameter definitions |