@wowok/skills 1.2.3 → 1.2.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. package/README.md +34 -16
  2. package/dist/cli.js +6 -2
  3. package/dist/cli.js.map +1 -1
  4. package/dist/skills.d.ts +32 -1
  5. package/dist/skills.d.ts.map +1 -1
  6. package/dist/skills.js +63 -0
  7. package/dist/skills.js.map +1 -1
  8. package/dist/types.d.ts +8 -0
  9. package/dist/types.d.ts.map +1 -1
  10. package/examples/Insurance/Insurance.md +543 -475
  11. package/examples/MyShop/MyShop.md +865 -746
  12. package/examples/MyShop_Advanced/MyShop_Advanced.md +1520 -1376
  13. package/examples/ThreeBody_Signature/ThreeBody_Signature.md +891 -651
  14. package/examples/Travel/Travel.md +952 -848
  15. package/package.json +2 -2
  16. package/scripts/install.js +3 -17
  17. package/wowok-arbitrator/SKILL.md +18 -57
  18. package/wowok-auditor/SKILL.md +16 -12
  19. package/wowok-distill/SKILL.md +237 -0
  20. package/wowok-guard/SKILL.md +40 -354
  21. package/wowok-machine/SKILL.md +21 -127
  22. package/wowok-messenger/SKILL.md +14 -59
  23. package/wowok-onboard/SKILL.md +42 -12
  24. package/wowok-order/SKILL.md +20 -169
  25. package/wowok-output/SKILL.md +0 -10
  26. package/wowok-planner/SKILL.md +28 -9
  27. package/wowok-provider/SKILL.md +91 -49
  28. package/wowok-safety/SKILL.md +8 -80
  29. package/wowok-scenario/SKILL.md +63 -98
  30. package/wowok-tools/SKILL.md +111 -122
  31. package/references/glossary.ts +0 -297
  32. package/references/guard-scenario-ledger.md +0 -353
  33. package/references/guard-template-library.md +0 -481
  34. package/references/machine-design-reference.md +0 -398
  35. package/references/machine-scenario-ledger.md +0 -227
  36. package/references/machine-template-library.md +0 -522
  37. package/references/merchant-scenario-coordination.md +0 -383
  38. package/references/object-collaboration.md +0 -362
  39. package/references/onchain-constants.md +0 -81
  40. package/wowok-arbitrator/APPENDIX.md +0 -545
  41. package/wowok-auditor/APPENDIX.md +0 -487
  42. package/wowok-guard/APPENDIX.md +0 -428
  43. package/wowok-machine/APPENDIX.md +0 -407
  44. package/wowok-messenger/APPENDIX.md +0 -550
  45. package/wowok-onboard/APPENDIX.md +0 -500
  46. package/wowok-order/APPENDIX.md +0 -777
  47. package/wowok-output/APPENDIX.md +0 -575
  48. package/wowok-planner/APPENDIX.md +0 -724
  49. package/wowok-provider/APPENDIX.md +0 -453
  50. package/wowok-safety/APPENDIX.md +0 -561
  51. package/wowok-scenario/APPENDIX.md +0 -97
  52. package/wowok-scenario/MODE-DETAILS.md +0 -275
  53. package/wowok-tools/APPENDIX.md +0 -388
@@ -22,6 +22,8 @@ This example sets `env.confirmed: true` on irreversible operations (e.g., `publi
22
22
 
23
23
  ---
24
24
 
25
+ > **💡 Call Format**: All WoWok operations go through a single unified `wowok` tool. The AI calls `wowok({ tool: "<sub-tool>", data: {<params>} })`. If parameters don't match the schema, the response includes the correct schema for self-correction. See [Response Format](../../docs/response-format.md) for details.
26
+
25
27
  ## Core Requirements & Features
26
28
 
27
29
  | Requirement | Description | Implementation |
@@ -50,27 +52,36 @@ Before running this example, ensure you have:
50
52
 
51
53
  ```json
52
54
  {
53
- "gen": {
54
- "name": "travel_provider",
55
- "replaceExistName": true
55
+ "tool": "account_operation",
56
+ "data": {
57
+ "gen": {
58
+ "name": "travel_provider",
59
+ "replaceExistName": true
60
+ }
56
61
  }
57
62
  }
58
63
  ```
59
64
 
60
65
  ```json
61
66
  {
62
- "gen": {
63
- "name": "weather_provider",
64
- "replaceExistName": true
67
+ "tool": "account_operation",
68
+ "data": {
69
+ "gen": {
70
+ "name": "weather_provider",
71
+ "replaceExistName": true
72
+ }
65
73
  }
66
74
  }
67
75
  ```
68
76
 
69
77
  ```json
70
78
  {
71
- "gen": {
72
- "name": "alice",
73
- "replaceExistName": true
79
+ "tool": "account_operation",
80
+ "data": {
81
+ "gen": {
82
+ "name": "alice",
83
+ "replaceExistName": true
84
+ }
74
85
  }
75
86
  }
76
87
  ```
@@ -81,27 +92,36 @@ Before running this example, ensure you have:
81
92
 
82
93
  ```json
83
94
  {
84
- "faucet": {
85
- "network": "testnet",
86
- "name_or_address": "travel_provider"
95
+ "tool": "account_operation",
96
+ "data": {
97
+ "faucet": {
98
+ "network": "testnet",
99
+ "name_or_address": "travel_provider"
100
+ }
87
101
  }
88
102
  }
89
103
  ```
90
104
 
91
105
  ```json
92
106
  {
93
- "faucet": {
94
- "network": "testnet",
95
- "name_or_address": "weather_provider"
107
+ "tool": "account_operation",
108
+ "data": {
109
+ "faucet": {
110
+ "network": "testnet",
111
+ "name_or_address": "weather_provider"
112
+ }
96
113
  }
97
114
  }
98
115
  ```
99
116
 
100
117
  ```json
101
118
  {
102
- "faucet": {
103
- "network": "testnet",
104
- "name_or_address": "alice"
119
+ "tool": "account_operation",
120
+ "data": {
121
+ "faucet": {
122
+ "network": "testnet",
123
+ "name_or_address": "alice"
124
+ }
105
125
  }
106
126
  }
107
127
  ```
@@ -162,19 +182,22 @@ Day 5: 1783900800000 (2026-07-13T00:00:00.000Z)
162
182
 
163
183
  ```json
164
184
  {
165
- "operation_type": "permission",
185
+ "tool": "onchain_operations",
166
186
  "data": {
167
- "object": {
168
- "name": "weather_permission",
169
- "replaceExistName": true
187
+ "operation_type": "permission",
188
+ "data": {
189
+ "object": {
190
+ "name": "weather_permission",
191
+ "replaceExistName": true
192
+ },
193
+ "description": "Weather repository permission"
170
194
  },
171
- "description": "Weather repository permission"
172
- },
173
- "env": {
174
- "account": "weather_provider",
175
- "network": "testnet",
176
- "no_cache": true,
177
- "confirmed": true
195
+ "env": {
196
+ "account": "weather_provider",
197
+ "network": "testnet",
198
+ "no_cache": true,
199
+ "confirmed": true
200
+ }
178
201
  }
179
202
  }
180
203
  ```
@@ -185,33 +208,36 @@ Day 5: 1783900800000 (2026-07-13T00:00:00.000Z)
185
208
 
186
209
  ```json
187
210
  {
188
- "operation_type": "repository",
211
+ "tool": "onchain_operations",
189
212
  "data": {
190
- "object": {
191
- "name": "weather_repo",
192
- "permission": "weather_permission",
193
- "replaceExistName": true,
194
- "onChain": true
213
+ "operation_type": "repository",
214
+ "data": {
215
+ "object": {
216
+ "name": "weather_repo",
217
+ "permission": "weather_permission",
218
+ "replaceExistName": true,
219
+ "onChain": true
220
+ },
221
+ "description": "Weather data repository for Iceland travel activities",
222
+ "policies": {
223
+ "op": "add",
224
+ "policy": [
225
+ {
226
+ "name": "Condition",
227
+ "description": "Weather condition policy for activity dates",
228
+ "write_guard": [],
229
+ "id_from": "None",
230
+ "value_type": "String"
231
+ }
232
+ ]
233
+ }
195
234
  },
196
- "description": "Weather data repository for Iceland travel activities",
197
- "policies": {
198
- "op": "add",
199
- "policy": [
200
- {
201
- "name": "Condition",
202
- "description": "Weather condition policy for activity dates",
203
- "write_guard": [],
204
- "id_from": "None",
205
- "value_type": "String"
206
- }
207
- ]
235
+ "env": {
236
+ "account": "weather_provider",
237
+ "network": "testnet",
238
+ "no_cache": true,
239
+ "confirmed": true
208
240
  }
209
- },
210
- "env": {
211
- "account": "weather_provider",
212
- "network": "testnet",
213
- "no_cache": true,
214
- "confirmed": true
215
241
  }
216
242
  }
217
243
  ```
@@ -226,29 +252,32 @@ Add 5 days of weather data. The `weather_check_guard` (Step 3.1) only verifies t
226
252
 
227
253
  ```json
228
254
  {
229
- "operation_type": "repository",
255
+ "tool": "onchain_operations",
230
256
  "data": {
231
- "object": "weather_repo",
232
- "data_add": {
233
- "name": "Condition",
234
- "items": [
235
- {
236
- "data": [
237
- {"id": <DAY1_TIMESTAMP>, "data": "sunny"},
238
- {"id": <DAY2_TIMESTAMP>, "data": "sunny"},
239
- {"id": <DAY3_TIMESTAMP>, "data": "sunny"},
240
- {"id": <DAY4_TIMESTAMP>, "data": "sunny"},
241
- {"id": <DAY5_TIMESTAMP>, "data": "rainy"}
242
- ]
243
- }
244
- ]
257
+ "operation_type": "repository",
258
+ "data": {
259
+ "object": "weather_repo",
260
+ "data_add": {
261
+ "name": "Condition",
262
+ "items": [
263
+ {
264
+ "data": [
265
+ {"id": <DAY1_TIMESTAMP>, "data": "sunny"},
266
+ {"id": <DAY2_TIMESTAMP>, "data": "sunny"},
267
+ {"id": <DAY3_TIMESTAMP>, "data": "sunny"},
268
+ {"id": <DAY4_TIMESTAMP>, "data": "sunny"},
269
+ {"id": <DAY5_TIMESTAMP>, "data": "rainy"}
270
+ ]
271
+ }
272
+ ]
273
+ }
274
+ },
275
+ "env": {
276
+ "account": "weather_provider",
277
+ "network": "testnet",
278
+ "no_cache": true,
279
+ "confirmed": true
245
280
  }
246
- },
247
- "env": {
248
- "account": "weather_provider",
249
- "network": "testnet",
250
- "no_cache": true,
251
- "confirmed": true
252
281
  }
253
282
  }
254
283
  ```
@@ -265,25 +294,28 @@ Create a Permission object to manage access control for the travel service. Add
265
294
 
266
295
  ```json
267
296
  {
268
- "operation_type": "permission",
297
+ "tool": "onchain_operations",
269
298
  "data": {
270
- "object": {
271
- "name": "travel_permission",
272
- "tags": ["travel", "iceland", "tourism"],
273
- "replaceExistName": true
299
+ "operation_type": "permission",
300
+ "data": {
301
+ "object": {
302
+ "name": "travel_permission",
303
+ "tags": ["travel", "iceland", "tourism"],
304
+ "replaceExistName": true
305
+ },
306
+ "description": "Permission for Iceland travel service",
307
+ "table": {
308
+ "op": "add perm by entity",
309
+ "entity": {"name_or_address": "travel_provider"},
310
+ "index": [1000, 1001, 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1009, 306]
311
+ }
274
312
  },
275
- "description": "Permission for Iceland travel service",
276
- "table": {
277
- "op": "add perm by entity",
278
- "entity": {"name_or_address": "travel_provider"},
279
- "index": [1000, 1001, 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1009, 306]
313
+ "env": {
314
+ "account": "travel_provider",
315
+ "network": "testnet",
316
+ "no_cache": true,
317
+ "confirmed": true
280
318
  }
281
- },
282
- "env": {
283
- "account": "travel_provider",
284
- "network": "testnet",
285
- "no_cache": true,
286
- "confirmed": true
287
319
  }
288
320
  }
289
321
  ```
@@ -300,20 +332,23 @@ Create an Arbitration object for dispute resolution.
300
332
 
301
333
  ```json
302
334
  {
303
- "operation_type": "arbitration",
335
+ "tool": "onchain_operations",
304
336
  "data": {
305
- "object": {
306
- "name": "travel_arbitration",
307
- "permission": "travel_permission",
308
- "replaceExistName": true
337
+ "operation_type": "arbitration",
338
+ "data": {
339
+ "object": {
340
+ "name": "travel_arbitration",
341
+ "permission": "travel_permission",
342
+ "replaceExistName": true
343
+ },
344
+ "description": "Arbitration for Iceland travel service disputes"
309
345
  },
310
- "description": "Arbitration for Iceland travel service disputes"
311
- },
312
- "env": {
313
- "account": "travel_provider",
314
- "network": "testnet",
315
- "no_cache": true,
316
- "confirmed": true
346
+ "env": {
347
+ "account": "travel_provider",
348
+ "network": "testnet",
349
+ "no_cache": true,
350
+ "confirmed": true
351
+ }
317
352
  }
318
353
  }
319
354
  ```
@@ -328,21 +363,24 @@ Create the Service without publishing to obtain its address for Guard creation.
328
363
 
329
364
  ```json
330
365
  {
331
- "operation_type": "service",
366
+ "tool": "onchain_operations",
332
367
  "data": {
333
- "object": {
334
- "name": "travel_service",
335
- "permission": "travel_permission",
336
- "replaceExistName": true
368
+ "operation_type": "service",
369
+ "data": {
370
+ "object": {
371
+ "name": "travel_service",
372
+ "permission": "travel_permission",
373
+ "replaceExistName": true
374
+ },
375
+ "description": "Iceland travel service: Blue Lagoon SPA + Glacier Ice Scooting.",
376
+ "pause": false
337
377
  },
338
- "description": "Iceland travel service: Blue Lagoon SPA + Glacier Ice Scooting.",
339
- "pause": false
340
- },
341
- "env": {
342
- "account": "travel_provider",
343
- "network": "testnet",
344
- "no_cache": true,
345
- "confirmed": true
378
+ "env": {
379
+ "account": "travel_provider",
380
+ "network": "testnet",
381
+ "no_cache": true,
382
+ "confirmed": true
383
+ }
346
384
  }
347
385
  }
348
386
  ```
@@ -359,21 +397,24 @@ Create a Treasury object to aggregate merchant revenue. The Treasury uses the **
359
397
 
360
398
  ```json
361
399
  {
362
- "operation_type": "treasury",
400
+ "tool": "onchain_operations",
363
401
  "data": {
364
- "object": {
365
- "name": "travel_treasury",
366
- "type_parameter": "0x2::wow::WOW",
367
- "permission": "travel_permission",
368
- "replaceExistName": true
402
+ "operation_type": "treasury",
403
+ "data": {
404
+ "object": {
405
+ "name": "travel_treasury",
406
+ "type_parameter": "0x2::wow::WOW",
407
+ "permission": "travel_permission",
408
+ "replaceExistName": true
409
+ },
410
+ "description": "Treasury for aggregating travel service merchant revenue. Uses the same Permission as the Service (travel_permission) for consistency — a single permission organization governs both fund collection and service operations."
369
411
  },
370
- "description": "Treasury for aggregating travel service merchant revenue. Uses the same Permission as the Service (travel_permission) for consistency — a single permission organization governs both fund collection and service operations."
371
- },
372
- "env": {
373
- "account": "travel_provider",
374
- "network": "testnet",
375
- "no_cache": true,
376
- "confirmed": true
412
+ "env": {
413
+ "account": "travel_provider",
414
+ "network": "testnet",
415
+ "no_cache": true,
416
+ "confirmed": true
417
+ }
377
418
  }
378
419
  }
379
420
  ```
@@ -404,54 +445,57 @@ repository.data has("Condition", convert_number_address(activity_date))
404
445
 
405
446
  ```json
406
447
  {
407
- "operation_type": "guard",
448
+ "tool": "onchain_operations",
408
449
  "data": {
409
- "namedNew": {
410
- "name": "weather_check_guard",
411
- "tags": ["weather", "check", "travel"],
412
- "replaceExistName": true
413
- },
414
- "description": "Weather check guard for ice scooting activity. Checks if weather data exists for the activity date.",
415
- "table": [
416
- {
417
- "identifier": 0,
418
- "b_submission": false,
419
- "value_type": "Address",
420
- "value": "weather_repo",
421
- "name": "Weather Repository address"
422
- },
423
- {
424
- "identifier": 1,
425
- "b_submission": false,
426
- "value_type": "String",
427
- "value": "Condition",
428
- "name": "Repository policy name"
450
+ "operation_type": "guard",
451
+ "data": {
452
+ "namedNew": {
453
+ "name": "weather_check_guard",
454
+ "tags": ["weather", "check", "travel"],
455
+ "replaceExistName": true
429
456
  },
430
- {
431
- "identifier": 2,
432
- "b_submission": true,
433
- "value_type": "U64",
434
- "name": "Activity date timestamp (submitted at runtime)"
435
- }
436
- ],
437
- "root": {
438
- "type": "query",
439
- "query": "repository.data has",
440
- "object": {"identifier": 0},
441
- "parameters": [
442
- {"type": "identifier", "identifier": 1},
457
+ "description": "Weather check guard for ice scooting activity. Checks if weather data exists for the activity date.",
458
+ "table": [
459
+ {
460
+ "identifier": 0,
461
+ "b_submission": false,
462
+ "value_type": "Address",
463
+ "value": "weather_repo",
464
+ "name": "Weather Repository address"
465
+ },
466
+ {
467
+ "identifier": 1,
468
+ "b_submission": false,
469
+ "value_type": "String",
470
+ "value": "Condition",
471
+ "name": "Repository policy name"
472
+ },
443
473
  {
444
- "type": "convert_number_address",
445
- "node": {"type": "identifier", "identifier": 2}
474
+ "identifier": 2,
475
+ "b_submission": true,
476
+ "value_type": "U64",
477
+ "name": "Activity date timestamp (submitted at runtime)"
446
478
  }
447
- ]
479
+ ],
480
+ "root": {
481
+ "type": "query",
482
+ "query": "repository.data has",
483
+ "object": {"identifier": 0},
484
+ "parameters": [
485
+ {"type": "identifier", "identifier": 1},
486
+ {
487
+ "type": "convert_number_address",
488
+ "node": {"type": "identifier", "identifier": 2}
489
+ }
490
+ ]
491
+ }
492
+ },
493
+ "env": {
494
+ "account": "travel_provider",
495
+ "network": "testnet",
496
+ "no_cache": true,
497
+ "confirmed": true
448
498
  }
449
- },
450
- "env": {
451
- "account": "travel_provider",
452
- "network": "testnet",
453
- "no_cache": true,
454
- "confirmed": true
455
499
  }
456
500
  }
457
501
  ```
@@ -478,53 +522,56 @@ clock > progress.current_time + 1000
478
522
 
479
523
  ```json
480
524
  {
481
- "operation_type": "guard",
525
+ "tool": "onchain_operations",
482
526
  "data": {
483
- "namedNew": {
484
- "name": "travel_complete_guard",
485
- "tags": ["travel", "time-lock", "complete"],
486
- "replaceExistName": true
487
- },
488
- "description": "Time-lock guard for travel order completion. Requires current clock > progress.current_time + 1000ms.",
489
- "table": [
490
- {
491
- "identifier": 0,
492
- "b_submission": true,
493
- "value_type": "Address",
494
- "name": "Order ID (submitted at runtime)"
527
+ "operation_type": "guard",
528
+ "data": {
529
+ "namedNew": {
530
+ "name": "travel_complete_guard",
531
+ "tags": ["travel", "time-lock", "complete"],
532
+ "replaceExistName": true
495
533
  },
496
- {
497
- "identifier": 1,
498
- "b_submission": false,
499
- "value_type": "U64",
500
- "value": 1000,
501
- "name": "Time-lock duration in ms"
502
- }
503
- ],
504
- "root": {
505
- "type": "logic_as_u256_greater",
506
- "nodes": [
507
- {"type": "context", "context": "Clock"},
534
+ "description": "Time-lock guard for travel order completion. Requires current clock > progress.current_time + 1000ms.",
535
+ "table": [
508
536
  {
509
- "type": "calc_number_add",
510
- "nodes": [
511
- {
512
- "type": "query",
513
- "query": "progress.current_time",
514
- "object": {"identifier": 0, "convert_witness": "OrderProgress"},
515
- "parameters": []
516
- },
517
- {"type": "identifier", "identifier": 1}
518
- ]
537
+ "identifier": 0,
538
+ "b_submission": true,
539
+ "value_type": "Address",
540
+ "name": "Order ID (submitted at runtime)"
541
+ },
542
+ {
543
+ "identifier": 1,
544
+ "b_submission": false,
545
+ "value_type": "U64",
546
+ "value": 1000,
547
+ "name": "Time-lock duration in ms"
519
548
  }
520
- ]
549
+ ],
550
+ "root": {
551
+ "type": "logic_as_u256_greater",
552
+ "nodes": [
553
+ {"type": "context", "context": "Clock"},
554
+ {
555
+ "type": "calc_number_add",
556
+ "nodes": [
557
+ {
558
+ "type": "query",
559
+ "query": "progress.current_time",
560
+ "object": {"identifier": 0, "convert_witness": "OrderProgress"},
561
+ "parameters": []
562
+ },
563
+ {"type": "identifier", "identifier": 1}
564
+ ]
565
+ }
566
+ ]
567
+ }
568
+ },
569
+ "env": {
570
+ "account": "travel_provider",
571
+ "network": "testnet",
572
+ "no_cache": true,
573
+ "confirmed": true
521
574
  }
522
- },
523
- "env": {
524
- "account": "travel_provider",
525
- "network": "testnet",
526
- "no_cache": true,
527
- "confirmed": true
528
575
  }
529
576
  }
530
577
  ```
@@ -546,33 +593,36 @@ Creates a Guard that allows order cancellation. This Guard always passes (return
546
593
 
547
594
  ```json
548
595
  {
549
- "operation_type": "guard",
596
+ "tool": "onchain_operations",
550
597
  "data": {
551
- "namedNew": {
552
- "name": "travel_cancel_guard",
553
- "tags": ["travel", "cancel"],
554
- "replaceExistName": true
555
- },
556
- "description": "Cancel guard for travel orders. Always passes - cancellation is controlled by permission-based access.",
557
- "table": [
558
- {
559
- "identifier": 0,
560
- "b_submission": false,
561
- "value_type": "Bool",
562
- "value": true,
563
- "name": "Always true"
598
+ "operation_type": "guard",
599
+ "data": {
600
+ "namedNew": {
601
+ "name": "travel_cancel_guard",
602
+ "tags": ["travel", "cancel"],
603
+ "replaceExistName": true
604
+ },
605
+ "description": "Cancel guard for travel orders. Always passes - cancellation is controlled by permission-based access.",
606
+ "table": [
607
+ {
608
+ "identifier": 0,
609
+ "b_submission": false,
610
+ "value_type": "Bool",
611
+ "value": true,
612
+ "name": "Always true"
613
+ }
614
+ ],
615
+ "root": {
616
+ "type": "identifier",
617
+ "identifier": 0
564
618
  }
565
- ],
566
- "root": {
567
- "type": "identifier",
568
- "identifier": 0
619
+ },
620
+ "env": {
621
+ "account": "travel_provider",
622
+ "network": "testnet",
623
+ "no_cache": true,
624
+ "confirmed": true
569
625
  }
570
- },
571
- "env": {
572
- "account": "travel_provider",
573
- "network": "testnet",
574
- "no_cache": true,
575
- "confirmed": true
576
626
  }
577
627
  }
578
628
  ```
@@ -585,66 +635,69 @@ Checks if order progress current node is "Complete" AND order belongs to this se
585
635
 
586
636
  ```json
587
637
  {
588
- "operation_type": "guard",
638
+ "tool": "onchain_operations",
589
639
  "data": {
590
- "namedNew": {
591
- "name": "merchant_victory_guard",
592
- "tags": ["merchant", "victory", "complete", "level3-scene-combined"],
593
- "replaceExistName": true
594
- },
595
- "description": "Guard for merchant victory: checks if order progress current node is Complete AND order belongs to travel_service. VERIFIER CONSTRAINT LEVEL 3 (scene-combined): No Signer binding needed because the allocator uses sharing.who=Entity (travel_treasury) — funds always flow to the Treasury regardless of caller (R-C3-06 safe). Two-fold verification: (1) order at Complete node, (2) order belongs to this service (prevents cross-service theft, R-C3-05).",
596
- "table": [
597
- {
598
- "identifier": 0,
599
- "b_submission": true,
600
- "value_type": "Address",
601
- "name": "Order ID (submitted at runtime)"
602
- },
603
- {
604
- "identifier": 1,
605
- "b_submission": false,
606
- "value_type": "String",
607
- "value": "Complete",
608
- "name": "Complete node name"
640
+ "operation_type": "guard",
641
+ "data": {
642
+ "namedNew": {
643
+ "name": "merchant_victory_guard",
644
+ "tags": ["merchant", "victory", "complete", "level3-scene-combined"],
645
+ "replaceExistName": true
609
646
  },
610
- {
611
- "identifier": 2,
612
- "b_submission": false,
613
- "value_type": "Address",
614
- "value": "travel_service",
615
- "name": "Service address (this service)"
616
- }
617
- ],
618
- "root": {
619
- "type": "logic_and",
620
- "nodes": [
647
+ "description": "Guard for merchant victory: checks if order progress current node is Complete AND order belongs to travel_service. VERIFIER CONSTRAINT LEVEL 3 (scene-combined): No Signer binding needed because the allocator uses sharing.who=Entity (travel_treasury) — funds always flow to the Treasury regardless of caller (R-C3-06 safe). Two-fold verification: (1) order at Complete node, (2) order belongs to this service (prevents cross-service theft, R-C3-05).",
648
+ "table": [
621
649
  {
622
- "type": "logic_equal",
623
- "nodes": [
624
- {
625
- "type": "query",
626
- "query": "progress.current",
627
- "object": {"identifier": 0, "convert_witness": "OrderProgress"},
628
- "parameters": []
629
- },
630
- {"type": "identifier", "identifier": 1}
631
- ]
650
+ "identifier": 0,
651
+ "b_submission": true,
652
+ "value_type": "Address",
653
+ "name": "Order ID (submitted at runtime)"
632
654
  },
633
655
  {
634
- "type": "logic_equal",
635
- "nodes": [
636
- {"type": "query", "query": "order.service", "object": {"identifier": 0}, "parameters": []},
637
- {"type": "identifier", "identifier": 2}
638
- ]
656
+ "identifier": 1,
657
+ "b_submission": false,
658
+ "value_type": "String",
659
+ "value": "Complete",
660
+ "name": "Complete node name"
661
+ },
662
+ {
663
+ "identifier": 2,
664
+ "b_submission": false,
665
+ "value_type": "Address",
666
+ "value": "travel_service",
667
+ "name": "Service address (this service)"
639
668
  }
640
- ]
669
+ ],
670
+ "root": {
671
+ "type": "logic_and",
672
+ "nodes": [
673
+ {
674
+ "type": "logic_equal",
675
+ "nodes": [
676
+ {
677
+ "type": "query",
678
+ "query": "progress.current",
679
+ "object": {"identifier": 0, "convert_witness": "OrderProgress"},
680
+ "parameters": []
681
+ },
682
+ {"type": "identifier", "identifier": 1}
683
+ ]
684
+ },
685
+ {
686
+ "type": "logic_equal",
687
+ "nodes": [
688
+ {"type": "query", "query": "order.service", "object": {"identifier": 0}, "parameters": []},
689
+ {"type": "identifier", "identifier": 2}
690
+ ]
691
+ }
692
+ ]
693
+ }
694
+ },
695
+ "env": {
696
+ "account": "travel_provider",
697
+ "network": "testnet",
698
+ "no_cache": true,
699
+ "confirmed": true
641
700
  }
642
- },
643
- "env": {
644
- "account": "travel_provider",
645
- "network": "testnet",
646
- "no_cache": true,
647
- "confirmed": true
648
701
  }
649
702
  }
650
703
  ```
@@ -669,90 +722,93 @@ Checks if progress current is "Cancel" or "Ice Scooting" AND order belongs to th
669
722
 
670
723
  ```json
671
724
  {
672
- "operation_type": "guard",
725
+ "tool": "onchain_operations",
673
726
  "data": {
674
- "namedNew": {
675
- "name": "no_ice_scooting_guard",
676
- "tags": ["user", "cancel", "ice_scooting", "level3-scene-combined"],
677
- "replaceExistName": true
678
- },
679
- "description": "Guard for user not participating in ice scooting: checks if progress current is Cancel or Ice Scooting AND order belongs to travel_service. VERIFIER CONSTRAINT LEVEL 3 (scene-combined): No Signer binding needed because the allocator uses sharing.who=Entity (travel_treasury) for merchant portion and sharing.who=GuardIdentifier(0) for customer refund (escrow to Order address). Two-fold verification: (1) order at Cancel/Ice Scooting node, (2) order belongs to this service (prevents cross-service theft, R-C3-05).",
680
- "table": [
681
- {
682
- "identifier": 0,
683
- "b_submission": true,
684
- "value_type": "Address",
685
- "name": "Order ID (submitted at runtime)"
686
- },
687
- {
688
- "identifier": 1,
689
- "b_submission": false,
690
- "value_type": "String",
691
- "value": "Cancel",
692
- "name": "Cancel node name"
693
- },
694
- {
695
- "identifier": 2,
696
- "b_submission": false,
697
- "value_type": "String",
698
- "value": "Ice Scooting",
699
- "name": "Ice Scooting node name"
727
+ "operation_type": "guard",
728
+ "data": {
729
+ "namedNew": {
730
+ "name": "no_ice_scooting_guard",
731
+ "tags": ["user", "cancel", "ice_scooting", "level3-scene-combined"],
732
+ "replaceExistName": true
700
733
  },
701
- {
702
- "identifier": 3,
703
- "b_submission": false,
704
- "value_type": "Address",
705
- "value": "travel_service",
706
- "name": "Service address (this service)"
707
- }
708
- ],
709
- "root": {
710
- "type": "logic_and",
711
- "nodes": [
734
+ "description": "Guard for user not participating in ice scooting: checks if progress current is Cancel or Ice Scooting AND order belongs to travel_service. VERIFIER CONSTRAINT LEVEL 3 (scene-combined): No Signer binding needed because the allocator uses sharing.who=Entity (travel_treasury) for merchant portion and sharing.who=GuardIdentifier(0) for customer refund (escrow to Order address). Two-fold verification: (1) order at Cancel/Ice Scooting node, (2) order belongs to this service (prevents cross-service theft, R-C3-05).",
735
+ "table": [
712
736
  {
713
- "type": "logic_or",
714
- "nodes": [
715
- {
716
- "type": "logic_equal",
717
- "nodes": [
718
- {
719
- "type": "query",
720
- "query": "progress.current",
721
- "object": {"identifier": 0, "convert_witness": "OrderProgress"},
722
- "parameters": []
723
- },
724
- {"type": "identifier", "identifier": 1}
725
- ]
726
- },
727
- {
728
- "type": "logic_equal",
729
- "nodes": [
730
- {
731
- "type": "query",
732
- "query": "progress.current",
733
- "object": {"identifier": 0, "convert_witness": "OrderProgress"},
734
- "parameters": []
735
- },
736
- {"type": "identifier", "identifier": 2}
737
- ]
738
- }
739
- ]
737
+ "identifier": 0,
738
+ "b_submission": true,
739
+ "value_type": "Address",
740
+ "name": "Order ID (submitted at runtime)"
740
741
  },
741
742
  {
742
- "type": "logic_equal",
743
- "nodes": [
744
- {"type": "query", "query": "order.service", "object": {"identifier": 0}, "parameters": []},
745
- {"type": "identifier", "identifier": 3}
746
- ]
743
+ "identifier": 1,
744
+ "b_submission": false,
745
+ "value_type": "String",
746
+ "value": "Cancel",
747
+ "name": "Cancel node name"
748
+ },
749
+ {
750
+ "identifier": 2,
751
+ "b_submission": false,
752
+ "value_type": "String",
753
+ "value": "Ice Scooting",
754
+ "name": "Ice Scooting node name"
755
+ },
756
+ {
757
+ "identifier": 3,
758
+ "b_submission": false,
759
+ "value_type": "Address",
760
+ "value": "travel_service",
761
+ "name": "Service address (this service)"
747
762
  }
748
- ]
763
+ ],
764
+ "root": {
765
+ "type": "logic_and",
766
+ "nodes": [
767
+ {
768
+ "type": "logic_or",
769
+ "nodes": [
770
+ {
771
+ "type": "logic_equal",
772
+ "nodes": [
773
+ {
774
+ "type": "query",
775
+ "query": "progress.current",
776
+ "object": {"identifier": 0, "convert_witness": "OrderProgress"},
777
+ "parameters": []
778
+ },
779
+ {"type": "identifier", "identifier": 1}
780
+ ]
781
+ },
782
+ {
783
+ "type": "logic_equal",
784
+ "nodes": [
785
+ {
786
+ "type": "query",
787
+ "query": "progress.current",
788
+ "object": {"identifier": 0, "convert_witness": "OrderProgress"},
789
+ "parameters": []
790
+ },
791
+ {"type": "identifier", "identifier": 2}
792
+ ]
793
+ }
794
+ ]
795
+ },
796
+ {
797
+ "type": "logic_equal",
798
+ "nodes": [
799
+ {"type": "query", "query": "order.service", "object": {"identifier": 0}, "parameters": []},
800
+ {"type": "identifier", "identifier": 3}
801
+ ]
802
+ }
803
+ ]
804
+ }
805
+ },
806
+ "env": {
807
+ "account": "travel_provider",
808
+ "network": "testnet",
809
+ "no_cache": true,
810
+ "confirmed": true
749
811
  }
750
- },
751
- "env": {
752
- "account": "travel_provider",
753
- "network": "testnet",
754
- "no_cache": true,
755
- "confirmed": true
756
812
  }
757
813
  }
758
814
  ```
@@ -777,66 +833,69 @@ Checks if progress current is "SPA" AND order belongs to this service. If passed
777
833
 
778
834
  ```json
779
835
  {
780
- "operation_type": "guard",
836
+ "tool": "onchain_operations",
781
837
  "data": {
782
- "namedNew": {
783
- "name": "no_spa_guard",
784
- "tags": ["user", "cancel", "spa", "level3-scene-combined"],
785
- "replaceExistName": true
786
- },
787
- "description": "Guard for user not participating in SPA: checks if progress current is SPA AND order belongs to travel_service. VERIFIER CONSTRAINT LEVEL 3 (scene-combined): No Signer binding needed because the allocator uses sharing.who=Entity (travel_treasury) for merchant portion and sharing.who=GuardIdentifier(0) for customer refund (escrow to Order address). Two-fold verification: (1) order at SPA node, (2) order belongs to this service (prevents cross-service theft, R-C3-05).",
788
- "table": [
789
- {
790
- "identifier": 0,
791
- "b_submission": true,
792
- "value_type": "Address",
793
- "name": "Order ID (submitted at runtime)"
794
- },
795
- {
796
- "identifier": 1,
797
- "b_submission": false,
798
- "value_type": "String",
799
- "value": "SPA",
800
- "name": "SPA node name"
838
+ "operation_type": "guard",
839
+ "data": {
840
+ "namedNew": {
841
+ "name": "no_spa_guard",
842
+ "tags": ["user", "cancel", "spa", "level3-scene-combined"],
843
+ "replaceExistName": true
801
844
  },
802
- {
803
- "identifier": 2,
804
- "b_submission": false,
805
- "value_type": "Address",
806
- "value": "travel_service",
807
- "name": "Service address (this service)"
808
- }
809
- ],
810
- "root": {
811
- "type": "logic_and",
812
- "nodes": [
845
+ "description": "Guard for user not participating in SPA: checks if progress current is SPA AND order belongs to travel_service. VERIFIER CONSTRAINT LEVEL 3 (scene-combined): No Signer binding needed because the allocator uses sharing.who=Entity (travel_treasury) for merchant portion and sharing.who=GuardIdentifier(0) for customer refund (escrow to Order address). Two-fold verification: (1) order at SPA node, (2) order belongs to this service (prevents cross-service theft, R-C3-05).",
846
+ "table": [
813
847
  {
814
- "type": "logic_equal",
815
- "nodes": [
816
- {
817
- "type": "query",
818
- "query": "progress.current",
819
- "object": {"identifier": 0, "convert_witness": "OrderProgress"},
820
- "parameters": []
821
- },
822
- {"type": "identifier", "identifier": 1}
823
- ]
848
+ "identifier": 0,
849
+ "b_submission": true,
850
+ "value_type": "Address",
851
+ "name": "Order ID (submitted at runtime)"
824
852
  },
825
853
  {
826
- "type": "logic_equal",
827
- "nodes": [
828
- {"type": "query", "query": "order.service", "object": {"identifier": 0}, "parameters": []},
829
- {"type": "identifier", "identifier": 2}
830
- ]
854
+ "identifier": 1,
855
+ "b_submission": false,
856
+ "value_type": "String",
857
+ "value": "SPA",
858
+ "name": "SPA node name"
859
+ },
860
+ {
861
+ "identifier": 2,
862
+ "b_submission": false,
863
+ "value_type": "Address",
864
+ "value": "travel_service",
865
+ "name": "Service address (this service)"
831
866
  }
832
- ]
867
+ ],
868
+ "root": {
869
+ "type": "logic_and",
870
+ "nodes": [
871
+ {
872
+ "type": "logic_equal",
873
+ "nodes": [
874
+ {
875
+ "type": "query",
876
+ "query": "progress.current",
877
+ "object": {"identifier": 0, "convert_witness": "OrderProgress"},
878
+ "parameters": []
879
+ },
880
+ {"type": "identifier", "identifier": 1}
881
+ ]
882
+ },
883
+ {
884
+ "type": "logic_equal",
885
+ "nodes": [
886
+ {"type": "query", "query": "order.service", "object": {"identifier": 0}, "parameters": []},
887
+ {"type": "identifier", "identifier": 2}
888
+ ]
889
+ }
890
+ ]
891
+ }
892
+ },
893
+ "env": {
894
+ "account": "travel_provider",
895
+ "network": "testnet",
896
+ "no_cache": true,
897
+ "confirmed": true
833
898
  }
834
- },
835
- "env": {
836
- "account": "travel_provider",
837
- "network": "testnet",
838
- "no_cache": true,
839
- "confirmed": true
840
899
  }
841
900
  }
842
901
  ```
@@ -865,119 +924,122 @@ Create a Machine to define the travel service workflow with all nodes and forwar
865
924
 
866
925
  ```json
867
926
  {
868
- "operation_type": "machine",
927
+ "tool": "onchain_operations",
869
928
  "data": {
870
- "object": {
871
- "name": "travel_machine",
872
- "permission": "travel_permission",
873
- "replaceExistName": true
874
- },
875
- "description": "Iceland travel service workflow: (init) -> Buy Insurance -> SPA -> Ice Scooting -> Complete/Cancel",
876
- "node": {
877
- "op": "add",
878
- "bReplace": true,
879
- "nodes": [
880
- {
881
- "name": "Buy Insurance",
882
- "pairs": [
883
- {
884
- "prev_node": "",
885
- "threshold": 1,
886
- "forwards": [
887
- {
888
- "name": "buy_insurance",
889
- "weight": 1,
890
- "permissionIndex": 1000
891
- }
892
- ]
893
- }
894
- ]
895
- },
896
- {
897
- "name": "SPA",
898
- "pairs": [
899
- {
900
- "prev_node": "Buy Insurance",
901
- "threshold": 1,
902
- "forwards": [
903
- {
904
- "name": "go_spa",
905
- "weight": 1,
906
- "permissionIndex": 1001
907
- }
908
- ]
909
- }
910
- ]
911
- },
912
- {
913
- "name": "Ice Scooting",
914
- "pairs": [
915
- {
916
- "prev_node": "SPA",
917
- "threshold": 1,
918
- "forwards": [
919
- {
920
- "name": "go_ice_scooting",
921
- "weight": 1,
922
- "permissionIndex": 1004,
923
- "guard": {
924
- "guard": "weather_check_guard",
925
- "retained_submission": []
929
+ "operation_type": "machine",
930
+ "data": {
931
+ "object": {
932
+ "name": "travel_machine",
933
+ "permission": "travel_permission",
934
+ "replaceExistName": true
935
+ },
936
+ "description": "Iceland travel service workflow: (init) -> Buy Insurance -> SPA -> Ice Scooting -> Complete/Cancel",
937
+ "node": {
938
+ "op": "add",
939
+ "bReplace": true,
940
+ "nodes": [
941
+ {
942
+ "name": "Buy Insurance",
943
+ "pairs": [
944
+ {
945
+ "prev_node": "",
946
+ "threshold": 1,
947
+ "forwards": [
948
+ {
949
+ "name": "buy_insurance",
950
+ "weight": 1,
951
+ "permissionIndex": 1000
926
952
  }
927
- }
928
- ]
929
- }
930
- ]
931
- },
932
- {
933
- "name": "Complete",
934
- "pairs": [
935
- {
936
- "prev_node": "Ice Scooting",
937
- "threshold": 1,
938
- "forwards": [
939
- {
940
- "name": "complete_trip",
941
- "weight": 1,
942
- "permissionIndex": 1002,
943
- "guard": {
944
- "guard": "travel_complete_guard",
945
- "retained_submission": []
953
+ ]
954
+ }
955
+ ]
956
+ },
957
+ {
958
+ "name": "SPA",
959
+ "pairs": [
960
+ {
961
+ "prev_node": "Buy Insurance",
962
+ "threshold": 1,
963
+ "forwards": [
964
+ {
965
+ "name": "go_spa",
966
+ "weight": 1,
967
+ "permissionIndex": 1001
946
968
  }
947
- }
948
- ]
949
- }
950
- ]
951
- },
952
- {
953
- "name": "Cancel",
954
- "pairs": [
955
- {
956
- "prev_node": "Ice Scooting",
957
- "threshold": 1,
958
- "forwards": [
959
- {
960
- "name": "cancel_trip",
961
- "weight": 1,
962
- "permissionIndex": 1003,
963
- "guard": {
964
- "guard": "travel_cancel_guard",
965
- "retained_submission": []
969
+ ]
970
+ }
971
+ ]
972
+ },
973
+ {
974
+ "name": "Ice Scooting",
975
+ "pairs": [
976
+ {
977
+ "prev_node": "SPA",
978
+ "threshold": 1,
979
+ "forwards": [
980
+ {
981
+ "name": "go_ice_scooting",
982
+ "weight": 1,
983
+ "permissionIndex": 1004,
984
+ "guard": {
985
+ "guard": "weather_check_guard",
986
+ "retained_submission": []
987
+ }
966
988
  }
967
- }
968
- ]
969
- }
970
- ]
971
- }
972
- ]
989
+ ]
990
+ }
991
+ ]
992
+ },
993
+ {
994
+ "name": "Complete",
995
+ "pairs": [
996
+ {
997
+ "prev_node": "Ice Scooting",
998
+ "threshold": 1,
999
+ "forwards": [
1000
+ {
1001
+ "name": "complete_trip",
1002
+ "weight": 1,
1003
+ "permissionIndex": 1002,
1004
+ "guard": {
1005
+ "guard": "travel_complete_guard",
1006
+ "retained_submission": []
1007
+ }
1008
+ }
1009
+ ]
1010
+ }
1011
+ ]
1012
+ },
1013
+ {
1014
+ "name": "Cancel",
1015
+ "pairs": [
1016
+ {
1017
+ "prev_node": "Ice Scooting",
1018
+ "threshold": 1,
1019
+ "forwards": [
1020
+ {
1021
+ "name": "cancel_trip",
1022
+ "weight": 1,
1023
+ "permissionIndex": 1003,
1024
+ "guard": {
1025
+ "guard": "travel_cancel_guard",
1026
+ "retained_submission": []
1027
+ }
1028
+ }
1029
+ ]
1030
+ }
1031
+ ]
1032
+ }
1033
+ ]
1034
+ },
1035
+ "publish": true
973
1036
  },
974
- "publish": true
975
- },
976
- "env": {
977
- "account": "travel_provider",
978
- "network": "testnet",
979
- "no_cache": true,
980
- "confirmed": true
1037
+ "env": {
1038
+ "account": "travel_provider",
1039
+ "network": "testnet",
1040
+ "no_cache": true,
1041
+ "confirmed": true
1042
+ }
981
1043
  }
982
1044
  }
983
1045
  ```
@@ -1018,89 +1080,92 @@ Configure the travel service (created unpublished in Step 2.5) with all bindings
1018
1080
 
1019
1081
  ```json
1020
1082
  {
1021
- "operation_type": "service",
1083
+ "tool": "onchain_operations",
1022
1084
  "data": {
1023
- "object": {
1024
- "name": "travel_service",
1025
- "permission": "travel_permission",
1026
- "replaceExistName": true
1027
- },
1028
- "description": "Iceland travel service: Blue Lagoon SPA + Glacier Ice Scooting.",
1029
- "machine": "travel_machine",
1030
- "sales": {
1031
- "op": "add",
1032
- "sales": [
1033
- {
1034
- "name": "Iceland Travel Package",
1035
- "price": "500000000",
1036
- "stock": "99",
1037
- "suspension": false,
1038
- "wip": "",
1039
- "wip_hash": ""
1040
- }
1041
- ]
1042
- },
1043
- "arbitrations": {
1044
- "op": "add",
1045
- "objects": ["travel_arbitration"]
1046
- },
1047
- "order_allocators": {
1048
- "description": "Travel order revenue allocation based on progress state",
1049
- "threshold": 0,
1050
- "allocators": [
1051
- {
1052
- "guard": "merchant_victory_guard",
1053
- "fix": "0",
1054
- "sharing": [
1055
- {
1056
- "who": {"Entity": {"name_or_address": "travel_treasury"}},
1057
- "sharing": 10000,
1058
- "mode": "Rate"
1059
- }
1060
- ]
1061
- },
1062
- {
1063
- "guard": "no_ice_scooting_guard",
1064
- "fix": "0",
1065
- "sharing": [
1066
- {
1067
- "who": {"Entity": {"name_or_address": "travel_treasury"}},
1068
- "sharing": 8000,
1069
- "mode": "Rate"
1070
- },
1071
- {
1072
- "who": {"GuardIdentifier": 0},
1073
- "sharing": 2000,
1074
- "mode": "Rate"
1075
- }
1076
- ]
1077
- },
1078
- {
1079
- "guard": "no_spa_guard",
1080
- "fix": "0",
1081
- "sharing": [
1082
- {
1083
- "who": {"Entity": {"name_or_address": "travel_treasury"}},
1084
- "sharing": 500,
1085
- "mode": "Rate"
1086
- },
1087
- {
1088
- "who": {"GuardIdentifier": 0},
1089
- "sharing": 9500,
1090
- "mode": "Rate"
1091
- }
1092
- ]
1093
- }
1094
- ]
1085
+ "operation_type": "service",
1086
+ "data": {
1087
+ "object": {
1088
+ "name": "travel_service",
1089
+ "permission": "travel_permission",
1090
+ "replaceExistName": true
1091
+ },
1092
+ "description": "Iceland travel service: Blue Lagoon SPA + Glacier Ice Scooting.",
1093
+ "machine": "travel_machine",
1094
+ "sales": {
1095
+ "op": "add",
1096
+ "sales": [
1097
+ {
1098
+ "name": "Iceland Travel Package",
1099
+ "price": "500000000",
1100
+ "stock": "99",
1101
+ "suspension": false,
1102
+ "wip": "",
1103
+ "wip_hash": ""
1104
+ }
1105
+ ]
1106
+ },
1107
+ "arbitrations": {
1108
+ "op": "add",
1109
+ "objects": ["travel_arbitration"]
1110
+ },
1111
+ "order_allocators": {
1112
+ "description": "Travel order revenue allocation based on progress state",
1113
+ "threshold": 0,
1114
+ "allocators": [
1115
+ {
1116
+ "guard": "merchant_victory_guard",
1117
+ "fix": "0",
1118
+ "sharing": [
1119
+ {
1120
+ "who": {"Entity": {"name_or_address": "travel_treasury"}},
1121
+ "sharing": 10000,
1122
+ "mode": "Rate"
1123
+ }
1124
+ ]
1125
+ },
1126
+ {
1127
+ "guard": "no_ice_scooting_guard",
1128
+ "fix": "0",
1129
+ "sharing": [
1130
+ {
1131
+ "who": {"Entity": {"name_or_address": "travel_treasury"}},
1132
+ "sharing": 8000,
1133
+ "mode": "Rate"
1134
+ },
1135
+ {
1136
+ "who": {"GuardIdentifier": 0},
1137
+ "sharing": 2000,
1138
+ "mode": "Rate"
1139
+ }
1140
+ ]
1141
+ },
1142
+ {
1143
+ "guard": "no_spa_guard",
1144
+ "fix": "0",
1145
+ "sharing": [
1146
+ {
1147
+ "who": {"Entity": {"name_or_address": "travel_treasury"}},
1148
+ "sharing": 500,
1149
+ "mode": "Rate"
1150
+ },
1151
+ {
1152
+ "who": {"GuardIdentifier": 0},
1153
+ "sharing": 9500,
1154
+ "mode": "Rate"
1155
+ }
1156
+ ]
1157
+ }
1158
+ ]
1159
+ },
1160
+ "pause": false,
1161
+ "publish": true
1095
1162
  },
1096
- "pause": false,
1097
- "publish": true
1098
- },
1099
- "env": {
1100
- "account": "travel_provider",
1101
- "network": "testnet",
1102
- "no_cache": true,
1103
- "confirmed": true
1163
+ "env": {
1164
+ "account": "travel_provider",
1165
+ "network": "testnet",
1166
+ "no_cache": true,
1167
+ "confirmed": true
1168
+ }
1104
1169
  }
1105
1170
  }
1106
1171
  ```
@@ -1149,39 +1214,42 @@ The customer (Alice) purchases the travel package. This creates an Order, a Prog
1149
1214
 
1150
1215
  ```json
1151
1216
  {
1152
- "operation_type": "service",
1217
+ "tool": "onchain_operations",
1153
1218
  "data": {
1154
- "object": "travel_service",
1155
- "order_new": {
1156
- "buy": {
1157
- "items": [
1158
- {
1159
- "name": "Iceland Travel Package",
1160
- "stock": "1",
1161
- "wip_hash": ""
1162
- }
1163
- ],
1164
- "total_pay": {"balance": "500000000"}
1165
- },
1166
- "namedNewOrder": {
1167
- "name": "alice_travel_order",
1168
- "replaceExistName": true
1169
- },
1170
- "namedNewProgress": {
1171
- "name": "alice_travel_progress",
1172
- "replaceExistName": true
1173
- },
1174
- "namedNewAllocation": {
1175
- "name": "alice_travel_allocation",
1176
- "replaceExistName": true
1219
+ "operation_type": "service",
1220
+ "data": {
1221
+ "object": "travel_service",
1222
+ "order_new": {
1223
+ "buy": {
1224
+ "items": [
1225
+ {
1226
+ "name": "Iceland Travel Package",
1227
+ "stock": "1",
1228
+ "wip_hash": ""
1229
+ }
1230
+ ],
1231
+ "total_pay": {"balance": "500000000"}
1232
+ },
1233
+ "namedNewOrder": {
1234
+ "name": "alice_travel_order",
1235
+ "replaceExistName": true
1236
+ },
1237
+ "namedNewProgress": {
1238
+ "name": "alice_travel_progress",
1239
+ "replaceExistName": true
1240
+ },
1241
+ "namedNewAllocation": {
1242
+ "name": "alice_travel_allocation",
1243
+ "replaceExistName": true
1244
+ }
1177
1245
  }
1246
+ },
1247
+ "env": {
1248
+ "account": "alice",
1249
+ "network": "testnet",
1250
+ "no_cache": true,
1251
+ "confirmed": true
1178
1252
  }
1179
- },
1180
- "env": {
1181
- "account": "alice",
1182
- "network": "testnet",
1183
- "no_cache": true,
1184
- "confirmed": true
1185
1253
  }
1186
1254
  }
1187
1255
  ```
@@ -1204,20 +1272,23 @@ Move from initial node ("") to "Buy Insurance" node.
1204
1272
 
1205
1273
  ```json
1206
1274
  {
1207
- "operation_type": "progress",
1275
+ "tool": "onchain_operations",
1208
1276
  "data": {
1209
- "object": "alice_travel_progress",
1210
- "operate": {
1211
- "operation": {
1212
- "next_node_name": "Buy Insurance",
1213
- "forward": "buy_insurance"
1277
+ "operation_type": "progress",
1278
+ "data": {
1279
+ "object": "alice_travel_progress",
1280
+ "operate": {
1281
+ "operation": {
1282
+ "next_node_name": "Buy Insurance",
1283
+ "forward": "buy_insurance"
1284
+ }
1214
1285
  }
1286
+ },
1287
+ "env": {
1288
+ "account": "travel_provider",
1289
+ "network": "testnet",
1290
+ "no_cache": true
1215
1291
  }
1216
- },
1217
- "env": {
1218
- "account": "travel_provider",
1219
- "network": "testnet",
1220
- "no_cache": true
1221
1292
  }
1222
1293
  }
1223
1294
  ```
@@ -1230,20 +1301,23 @@ Move from "Buy Insurance" to "SPA" node.
1230
1301
 
1231
1302
  ```json
1232
1303
  {
1233
- "operation_type": "progress",
1304
+ "tool": "onchain_operations",
1234
1305
  "data": {
1235
- "object": "alice_travel_progress",
1236
- "operate": {
1237
- "operation": {
1238
- "next_node_name": "SPA",
1239
- "forward": "go_spa"
1306
+ "operation_type": "progress",
1307
+ "data": {
1308
+ "object": "alice_travel_progress",
1309
+ "operate": {
1310
+ "operation": {
1311
+ "next_node_name": "SPA",
1312
+ "forward": "go_spa"
1313
+ }
1240
1314
  }
1315
+ },
1316
+ "env": {
1317
+ "account": "travel_provider",
1318
+ "network": "testnet",
1319
+ "no_cache": true
1241
1320
  }
1242
- },
1243
- "env": {
1244
- "account": "travel_provider",
1245
- "network": "testnet",
1246
- "no_cache": true
1247
1321
  }
1248
1322
  }
1249
1323
  ```
@@ -1256,43 +1330,46 @@ Move from "SPA" to "Ice Scooting" node. This forward has a Guard (`weather_check
1256
1330
 
1257
1331
  ```json
1258
1332
  {
1259
- "operation_type": "progress",
1333
+ "tool": "onchain_operations",
1260
1334
  "data": {
1261
- "object": "alice_travel_progress",
1262
- "operate": {
1263
- "operation": {
1264
- "next_node_name": "Ice Scooting",
1265
- "forward": "go_ice_scooting"
1335
+ "operation_type": "progress",
1336
+ "data": {
1337
+ "object": "alice_travel_progress",
1338
+ "operate": {
1339
+ "operation": {
1340
+ "next_node_name": "Ice Scooting",
1341
+ "forward": "go_ice_scooting"
1342
+ }
1266
1343
  }
1344
+ },
1345
+ "submission": {
1346
+ "type": "submission",
1347
+ "guard": [
1348
+ {
1349
+ "object": "weather_check_guard",
1350
+ "impack": true
1351
+ }
1352
+ ],
1353
+ "submission": [
1354
+ {
1355
+ "guard": "weather_check_guard",
1356
+ "submission": [
1357
+ {
1358
+ "identifier": 2,
1359
+ "b_submission": true,
1360
+ "value_type": "U64",
1361
+ "value": <ACTIVITY_DATE_TIMESTAMP>,
1362
+ "name": "Activity date timestamp"
1363
+ }
1364
+ ]
1365
+ }
1366
+ ]
1367
+ },
1368
+ "env": {
1369
+ "account": "travel_provider",
1370
+ "network": "testnet",
1371
+ "no_cache": true
1267
1372
  }
1268
- },
1269
- "submission": {
1270
- "type": "submission",
1271
- "guard": [
1272
- {
1273
- "object": "weather_check_guard",
1274
- "impack": true
1275
- }
1276
- ],
1277
- "submission": [
1278
- {
1279
- "guard": "weather_check_guard",
1280
- "submission": [
1281
- {
1282
- "identifier": 2,
1283
- "b_submission": true,
1284
- "value_type": "U64",
1285
- "value": <ACTIVITY_DATE_TIMESTAMP>,
1286
- "name": "Activity date timestamp"
1287
- }
1288
- ]
1289
- }
1290
- ]
1291
- },
1292
- "env": {
1293
- "account": "travel_provider",
1294
- "network": "testnet",
1295
- "no_cache": true
1296
1373
  }
1297
1374
  }
1298
1375
  ```
@@ -1309,43 +1386,46 @@ Move from "Ice Scooting" to "Complete" node. This forward has a Guard (`travel_c
1309
1386
 
1310
1387
  ```json
1311
1388
  {
1312
- "operation_type": "progress",
1389
+ "tool": "onchain_operations",
1313
1390
  "data": {
1314
- "object": "alice_travel_progress",
1315
- "operate": {
1316
- "operation": {
1317
- "next_node_name": "Complete",
1318
- "forward": "complete_trip"
1391
+ "operation_type": "progress",
1392
+ "data": {
1393
+ "object": "alice_travel_progress",
1394
+ "operate": {
1395
+ "operation": {
1396
+ "next_node_name": "Complete",
1397
+ "forward": "complete_trip"
1398
+ }
1319
1399
  }
1400
+ },
1401
+ "submission": {
1402
+ "type": "submission",
1403
+ "guard": [
1404
+ {
1405
+ "object": "travel_complete_guard",
1406
+ "impack": true
1407
+ }
1408
+ ],
1409
+ "submission": [
1410
+ {
1411
+ "guard": "travel_complete_guard",
1412
+ "submission": [
1413
+ {
1414
+ "identifier": 0,
1415
+ "b_submission": true,
1416
+ "value_type": "Address",
1417
+ "value": "<ORDER_OBJECT_ID>",
1418
+ "name": "Order ID"
1419
+ }
1420
+ ]
1421
+ }
1422
+ ]
1423
+ },
1424
+ "env": {
1425
+ "account": "travel_provider",
1426
+ "network": "testnet",
1427
+ "no_cache": true
1320
1428
  }
1321
- },
1322
- "submission": {
1323
- "type": "submission",
1324
- "guard": [
1325
- {
1326
- "object": "travel_complete_guard",
1327
- "impack": true
1328
- }
1329
- ],
1330
- "submission": [
1331
- {
1332
- "guard": "travel_complete_guard",
1333
- "submission": [
1334
- {
1335
- "identifier": 0,
1336
- "b_submission": true,
1337
- "value_type": "Address",
1338
- "value": "<ORDER_OBJECT_ID>",
1339
- "name": "Order ID"
1340
- }
1341
- ]
1342
- }
1343
- ]
1344
- },
1345
- "env": {
1346
- "account": "travel_provider",
1347
- "network": "testnet",
1348
- "no_cache": true
1349
1429
  }
1350
1430
  }
1351
1431
  ```
@@ -1362,35 +1442,38 @@ Move from "Ice Scooting" to "Complete" node. This forward has a Guard (`travel_c
1362
1442
 
1363
1443
  ```json
1364
1444
  {
1365
- "operation_type": "progress",
1445
+ "tool": "onchain_operations",
1366
1446
  "data": {
1367
- "object": "alice_travel_progress",
1368
- "operate": {
1369
- "operation": {
1370
- "next_node_name": "Cancel",
1371
- "forward": "cancel_trip"
1447
+ "operation_type": "progress",
1448
+ "data": {
1449
+ "object": "alice_travel_progress",
1450
+ "operate": {
1451
+ "operation": {
1452
+ "next_node_name": "Cancel",
1453
+ "forward": "cancel_trip"
1454
+ }
1372
1455
  }
1456
+ },
1457
+ "submission": {
1458
+ "type": "submission",
1459
+ "guard": [
1460
+ {
1461
+ "object": "travel_cancel_guard",
1462
+ "impack": true
1463
+ }
1464
+ ],
1465
+ "submission": [
1466
+ {
1467
+ "guard": "travel_cancel_guard",
1468
+ "submission": []
1469
+ }
1470
+ ]
1471
+ },
1472
+ "env": {
1473
+ "account": "travel_provider",
1474
+ "network": "testnet",
1475
+ "no_cache": true
1373
1476
  }
1374
- },
1375
- "submission": {
1376
- "type": "submission",
1377
- "guard": [
1378
- {
1379
- "object": "travel_cancel_guard",
1380
- "impack": true
1381
- }
1382
- ],
1383
- "submission": [
1384
- {
1385
- "guard": "travel_cancel_guard",
1386
- "submission": []
1387
- }
1388
- ]
1389
- },
1390
- "env": {
1391
- "account": "travel_provider",
1392
- "network": "testnet",
1393
- "no_cache": true
1394
1477
  }
1395
1478
  }
1396
1479
  ```
@@ -1423,13 +1506,16 @@ The allocation Guard requires the Order ID as a submission (identifier: 0). Quer
1423
1506
 
1424
1507
  ```json
1425
1508
  {
1426
- "operation_type": "progress",
1509
+ "tool": "onchain_operations",
1427
1510
  "data": {
1428
- "object": "alice_travel_progress"
1429
- },
1430
- "env": {
1431
- "network": "testnet",
1432
- "no_cache": true
1511
+ "operation_type": "progress",
1512
+ "data": {
1513
+ "object": "alice_travel_progress"
1514
+ },
1515
+ "env": {
1516
+ "network": "testnet",
1517
+ "no_cache": true
1518
+ }
1433
1519
  }
1434
1520
  }
1435
1521
  ```
@@ -1444,38 +1530,41 @@ When the Progress is "Complete", the `merchant_victory_guard` passes, and 100% o
1444
1530
 
1445
1531
  ```json
1446
1532
  {
1447
- "operation_type": "allocation",
1533
+ "tool": "onchain_operations",
1448
1534
  "data": {
1449
- "object": "alice_travel_allocation",
1450
- "alloc_by_guard": "merchant_victory_guard"
1451
- },
1452
- "submission": {
1453
- "type": "submission",
1454
- "guard": [
1455
- {
1456
- "object": "merchant_victory_guard",
1457
- "impack": true
1458
- }
1459
- ],
1460
- "submission": [
1461
- {
1462
- "guard": "merchant_victory_guard",
1463
- "submission": [
1464
- {
1465
- "identifier": 0,
1466
- "b_submission": true,
1467
- "value_type": "Address",
1468
- "value": "<ORDER_OBJECT_ID>",
1469
- "name": "Order ID"
1470
- }
1471
- ]
1472
- }
1473
- ]
1474
- },
1475
- "env": {
1476
- "account": "travel_provider",
1477
- "network": "testnet",
1478
- "no_cache": true
1535
+ "operation_type": "allocation",
1536
+ "data": {
1537
+ "object": "alice_travel_allocation",
1538
+ "alloc_by_guard": "merchant_victory_guard"
1539
+ },
1540
+ "submission": {
1541
+ "type": "submission",
1542
+ "guard": [
1543
+ {
1544
+ "object": "merchant_victory_guard",
1545
+ "impack": true
1546
+ }
1547
+ ],
1548
+ "submission": [
1549
+ {
1550
+ "guard": "merchant_victory_guard",
1551
+ "submission": [
1552
+ {
1553
+ "identifier": 0,
1554
+ "b_submission": true,
1555
+ "value_type": "Address",
1556
+ "value": "<ORDER_OBJECT_ID>",
1557
+ "name": "Order ID"
1558
+ }
1559
+ ]
1560
+ }
1561
+ ]
1562
+ },
1563
+ "env": {
1564
+ "account": "travel_provider",
1565
+ "network": "testnet",
1566
+ "no_cache": true
1567
+ }
1479
1568
  }
1480
1569
  }
1481
1570
  ```
@@ -1492,20 +1581,23 @@ For refund scenarios (Cancel or SPA), use the corresponding Guard. The same subm
1492
1581
 
1493
1582
  ```json
1494
1583
  {
1495
- "operation_type": "allocation",
1584
+ "tool": "onchain_operations",
1496
1585
  "data": {
1497
- "object": "alice_travel_allocation",
1498
- "alloc_by_guard": "no_ice_scooting_guard"
1499
- },
1500
- "submission": {
1501
- "type": "submission",
1502
- "guard": [{"object": "no_ice_scooting_guard", "impack": true}],
1503
- "submission": [{
1504
- "guard": "no_ice_scooting_guard",
1505
- "submission": [{"identifier": 0, "b_submission": true, "value_type": "Address", "value": "<ORDER_OBJECT_ID>", "name": "Order ID"}]
1506
- }]
1507
- },
1508
- "env": {"account": "travel_provider", "network": "testnet", "no_cache": true, "confirmed": true}
1586
+ "operation_type": "allocation",
1587
+ "data": {
1588
+ "object": "alice_travel_allocation",
1589
+ "alloc_by_guard": "no_ice_scooting_guard"
1590
+ },
1591
+ "submission": {
1592
+ "type": "submission",
1593
+ "guard": [{"object": "no_ice_scooting_guard", "impack": true}],
1594
+ "submission": [{
1595
+ "guard": "no_ice_scooting_guard",
1596
+ "submission": [{"identifier": 0, "b_submission": true, "value_type": "Address", "value": "<ORDER_OBJECT_ID>", "name": "Order ID"}]
1597
+ }]
1598
+ },
1599
+ "env": {"account": "travel_provider", "network": "testnet", "no_cache": true, "confirmed": true}
1600
+ }
1509
1601
  }
1510
1602
  ```
1511
1603
 
@@ -1513,20 +1605,23 @@ For refund scenarios (Cancel or SPA), use the corresponding Guard. The same subm
1513
1605
 
1514
1606
  ```json
1515
1607
  {
1516
- "operation_type": "allocation",
1608
+ "tool": "onchain_operations",
1517
1609
  "data": {
1518
- "object": "alice_travel_allocation",
1519
- "alloc_by_guard": "no_spa_guard"
1520
- },
1521
- "submission": {
1522
- "type": "submission",
1523
- "guard": [{"object": "no_spa_guard", "impack": true}],
1524
- "submission": [{
1525
- "guard": "no_spa_guard",
1526
- "submission": [{"identifier": 0, "b_submission": true, "value_type": "Address", "value": "<ORDER_OBJECT_ID>", "name": "Order ID"}]
1527
- }]
1528
- },
1529
- "env": {"account": "travel_provider", "network": "testnet", "no_cache": true, "confirmed": true}
1610
+ "operation_type": "allocation",
1611
+ "data": {
1612
+ "object": "alice_travel_allocation",
1613
+ "alloc_by_guard": "no_spa_guard"
1614
+ },
1615
+ "submission": {
1616
+ "type": "submission",
1617
+ "guard": [{"object": "no_spa_guard", "impack": true}],
1618
+ "submission": [{
1619
+ "guard": "no_spa_guard",
1620
+ "submission": [{"identifier": 0, "b_submission": true, "value_type": "Address", "value": "<ORDER_OBJECT_ID>", "name": "Order ID"}]
1621
+ }]
1622
+ },
1623
+ "env": {"account": "travel_provider", "network": "testnet", "no_cache": true, "confirmed": true}
1624
+ }
1530
1625
  }
1531
1626
  ```
1532
1627
 
@@ -1538,13 +1633,16 @@ After allocation, query the Allocation and Payment objects to verify the fund di
1538
1633
 
1539
1634
  ```json
1540
1635
  {
1541
- "operation_type": "allocation",
1636
+ "tool": "onchain_operations",
1542
1637
  "data": {
1543
- "object": "alice_travel_allocation"
1544
- },
1545
- "env": {
1546
- "network": "testnet",
1547
- "no_cache": true
1638
+ "operation_type": "allocation",
1639
+ "data": {
1640
+ "object": "alice_travel_allocation"
1641
+ },
1642
+ "env": {
1643
+ "network": "testnet",
1644
+ "no_cache": true
1645
+ }
1548
1646
  }
1549
1647
  }
1550
1648
  ```
@@ -1617,17 +1715,20 @@ Create the Service with all configurations — including `pause: false` and `pub
1617
1715
  When a forward has a Guard, the Progress operation requires a `submission` field at the **top level** (not inside `data`):
1618
1716
  ```json
1619
1717
  {
1620
- "operation_type": "progress",
1621
- "data": {...},
1622
- "submission": {
1623
- "type": "submission",
1624
- "guard": [{"object": "guard_name", "impack": true}],
1625
- "submission": [{
1626
- "guard": "guard_name",
1627
- "submission": [{"identifier": 0, "b_submission": true, "value_type": "Address", "value": "0x...", "name": "Order ID"}]
1628
- }]
1629
- },
1630
- "env": {"no_cache": true, ...}
1718
+ "tool": "onchain_operations",
1719
+ "data": {
1720
+ "operation_type": "progress",
1721
+ "data": {...},
1722
+ "submission": {
1723
+ "type": "submission",
1724
+ "guard": [{"object": "guard_name", "impack": true}],
1725
+ "submission": [{
1726
+ "guard": "guard_name",
1727
+ "submission": [{"identifier": 0, "b_submission": true, "value_type": "Address", "value": "0x...", "name": "Order ID"}]
1728
+ }]
1729
+ },
1730
+ "env": {"no_cache": true, ...}
1731
+ }
1631
1732
  }
1632
1733
  ```
1633
1734
 
@@ -1648,19 +1749,22 @@ Weather data in the Repository is keyed by timestamp (`id`). The `weather_check_
1648
1749
  Customers place orders using the `order_new` field in the Service operation. This automatically creates Order, Progress, and Allocation objects:
1649
1750
  ```json
1650
1751
  {
1651
- "operation_type": "service",
1752
+ "tool": "onchain_operations",
1652
1753
  "data": {
1653
- "object": "service_name",
1654
- "order_new": {
1655
- "buy": {
1656
- "items": [{"name": "Product", "stock": "1", "wip_hash": ""}],
1657
- "total_pay": {"balance": "price_amount"}
1658
- },
1659
- "namedNewOrder": {"name": "order_name", "replaceExistName": true},
1660
- "namedNewProgress": {"name": "progress_name", "replaceExistName": true},
1661
- "namedNewAllocation": {"name": "allocation_name", "replaceExistName": true}
1662
- }
1663
- },
1664
- "env": {"account": "customer", "network": "testnet", "no_cache": true, "confirmed": true}
1754
+ "operation_type": "service",
1755
+ "data": {
1756
+ "object": "service_name",
1757
+ "order_new": {
1758
+ "buy": {
1759
+ "items": [{"name": "Product", "stock": "1", "wip_hash": ""}],
1760
+ "total_pay": {"balance": "price_amount"}
1761
+ },
1762
+ "namedNewOrder": {"name": "order_name", "replaceExistName": true},
1763
+ "namedNewProgress": {"name": "progress_name", "replaceExistName": true},
1764
+ "namedNewAllocation": {"name": "allocation_name", "replaceExistName": true}
1765
+ }
1766
+ },
1767
+ "env": {"account": "customer", "network": "testnet", "no_cache": true, "confirmed": true}
1768
+ }
1665
1769
  }
1666
1770
  ```