@wowok/agent-mcp 2.6.0 → 2.6.3

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 (186) hide show
  1. package/README.md +5 -3
  2. package/dist/customer/info-puzzle.d.ts +1 -1
  3. package/dist/customer/info-puzzle.js +4 -2
  4. package/dist/customer/risk-assessment.js +26 -4
  5. package/dist/customer/types.d.ts +2 -0
  6. package/dist/examples/guard-template-balance-check.json +38 -0
  7. package/dist/examples/guard-template-time-lock.json +39 -0
  8. package/dist/examples/machine-template-7node-rental.json +114 -0
  9. package/dist/examples/rental-ziroom-machine-create.json +137 -0
  10. package/dist/examples/rental-ziroom-permission-create.json +35 -0
  11. package/dist/examples/rental-ziroom-service-create.json +80 -0
  12. package/dist/examples/retail-myshop-service-create.json +88 -0
  13. package/dist/extensions/capability-manifest.d.ts +125 -0
  14. package/dist/extensions/capability-manifest.js +594 -0
  15. package/dist/extensions/constraint-registry.d.ts +24 -0
  16. package/dist/extensions/constraint-registry.js +196 -0
  17. package/dist/extensions/index.d.ts +12 -0
  18. package/dist/extensions/index.js +6 -0
  19. package/dist/extensions/metric-registry.d.ts +26 -0
  20. package/dist/extensions/metric-registry.js +257 -0
  21. package/dist/extensions/mode-evaluator.d.ts +15 -0
  22. package/dist/extensions/mode-evaluator.js +170 -0
  23. package/dist/extensions/modes.d.ts +2 -0
  24. package/dist/extensions/modes.js +493 -0
  25. package/dist/extensions/registry.d.ts +50 -0
  26. package/dist/extensions/registry.js +662 -0
  27. package/dist/extensions/types.d.ts +219 -0
  28. package/dist/extensions/types.js +1 -0
  29. package/dist/index.js +50 -0
  30. package/dist/knowledge/deployment-scanner.d.ts +3 -0
  31. package/dist/knowledge/deployment-scanner.js +64 -3
  32. package/dist/knowledge/fund-layer.d.ts +72 -0
  33. package/dist/knowledge/fund-layer.js +420 -0
  34. package/dist/knowledge/guard-render.d.ts +57 -0
  35. package/dist/knowledge/guard-render.js +700 -0
  36. package/dist/knowledge/guard-risk.d.ts +13 -0
  37. package/dist/knowledge/guard-risk.js +57 -0
  38. package/dist/knowledge/guard-submission-prompt.d.ts +31 -0
  39. package/dist/knowledge/guard-submission-prompt.js +171 -0
  40. package/dist/knowledge/guard-templates.js +278 -0
  41. package/dist/knowledge/machine-ledger.js +1 -1
  42. package/dist/knowledge/machine-render.d.ts +41 -0
  43. package/dist/knowledge/machine-render.js +565 -0
  44. package/dist/knowledge/machine-templates.js +24 -5
  45. package/dist/knowledge/reward-confirm.js +2 -2
  46. package/dist/knowledge/reward-puzzle.js +1 -1
  47. package/dist/knowledge/reward-risk.js +9 -9
  48. package/dist/knowledge/reward-templates.js +2 -2
  49. package/dist/knowledge/service-confirm.d.ts +15 -6
  50. package/dist/knowledge/service-confirm.js +119 -11
  51. package/dist/knowledge/service-context.js +1 -1
  52. package/dist/knowledge/service-ledger.js +1 -1
  53. package/dist/knowledge/service-risk.d.ts +1 -1
  54. package/dist/knowledge/service-risk.js +3 -3
  55. package/dist/knowledge/service-templates.js +2 -2
  56. package/dist/knowledge/service-translation.d.ts +1 -1
  57. package/dist/knowledge/service-translation.js +7 -7
  58. package/dist/knowledge/tool-constraints.js +6 -2
  59. package/dist/project/deployment-bridge.d.ts +1 -1
  60. package/dist/project/deployment-bridge.js +31 -7
  61. package/dist/project/deployment-doc.d.ts +3 -0
  62. package/dist/project/deployment-doc.js +76 -14
  63. package/dist/project/edit-planner.d.ts +123 -0
  64. package/dist/project/edit-planner.js +1371 -0
  65. package/dist/project/evaluation.d.ts +2 -0
  66. package/dist/project/evaluation.js +873 -88
  67. package/dist/project/graph-builder.d.ts +4 -1
  68. package/dist/project/graph-builder.js +132 -62
  69. package/dist/project/graph.d.ts +1 -0
  70. package/dist/project/handlers.d.ts +317 -6
  71. package/dist/project/handlers.js +1171 -19
  72. package/dist/project/stage-gate.d.ts +4 -0
  73. package/dist/project/stage-gate.js +64 -5
  74. package/dist/project/task-tracker.d.ts +26 -0
  75. package/dist/project/task-tracker.js +78 -0
  76. package/dist/safety/preview.js +16 -0
  77. package/dist/schema/call/allocation.d.ts +16 -16
  78. package/dist/schema/call/allocation.js +2 -2
  79. package/dist/schema/call/arbitration.js +19 -6
  80. package/dist/schema/call/base.d.ts +21 -13
  81. package/dist/schema/call/base.js +27 -6
  82. package/dist/schema/call/bridge.d.ts +5 -5
  83. package/dist/schema/call/bridge.js +3 -1
  84. package/dist/schema/call/contact.js +2 -2
  85. package/dist/schema/call/demand.d.ts +23 -31
  86. package/dist/schema/call/demand.js +2 -2
  87. package/dist/schema/call/guard.js +2 -2
  88. package/dist/schema/call/machine.d.ts +1976 -752
  89. package/dist/schema/call/machine.js +50 -4
  90. package/dist/schema/call/order.d.ts +149 -228
  91. package/dist/schema/call/order.js +4 -3
  92. package/dist/schema/call/payment.d.ts +183 -3
  93. package/dist/schema/call/payment.js +21 -3
  94. package/dist/schema/call/permission.js +2 -2
  95. package/dist/schema/call/personal.d.ts +241 -52
  96. package/dist/schema/call/progress.d.ts +53 -61
  97. package/dist/schema/call/progress.js +18 -4
  98. package/dist/schema/call/repository.d.ts +23 -31
  99. package/dist/schema/call/repository.js +2 -2
  100. package/dist/schema/call/reward.js +3 -3
  101. package/dist/schema/call/semantic.d.ts +1 -1
  102. package/dist/schema/call/semantic.js +37 -2
  103. package/dist/schema/call/service.d.ts +275 -127
  104. package/dist/schema/call/service.js +89 -13
  105. package/dist/schema/call/treasury.js +3 -3
  106. package/dist/schema/common/index.d.ts +13 -2
  107. package/dist/schema/common/index.js +80 -15
  108. package/dist/schema/local/index.d.ts +32 -35
  109. package/dist/schema/local/index.js +28 -6
  110. package/dist/schema/messenger/index.d.ts +274 -46
  111. package/dist/schema/operations.d.ts +1264 -544
  112. package/dist/schema/operations.js +65 -7
  113. package/dist/schema/project/index.d.ts +2846 -167
  114. package/dist/schema/project/index.js +570 -16
  115. package/dist/schema/query/index.d.ts +922 -349
  116. package/dist/schema/query/index.js +205 -42
  117. package/dist/schema/schema-query/index.d.ts +65 -3
  118. package/dist/schema/schema-query/index.js +38 -5
  119. package/dist/schema/utils/node-parser.js +20 -4
  120. package/dist/schema/utils/object-type-utils.d.ts +12 -0
  121. package/dist/schema/utils/object-type-utils.js +35 -0
  122. package/dist/schema/utils/permission-machine-check.d.ts +49 -0
  123. package/dist/schema/utils/permission-machine-check.js +121 -0
  124. package/dist/schema/utils/skills-recommendation.d.ts +2 -0
  125. package/dist/schema/utils/skills-recommendation.js +76 -0
  126. package/dist/schema-query/index.d.ts +20 -1
  127. package/dist/schema-query/index.js +306 -4
  128. package/dist/schemas/account_operation.output.json +7 -1
  129. package/dist/schemas/account_operation.schema.json +3 -3
  130. package/dist/schemas/bridge_operation.output.json +6 -0
  131. package/dist/schemas/bridge_operation.schema.json +1 -1
  132. package/dist/schemas/guard-templates.json +379 -0
  133. package/dist/schemas/guard2file.schema.json +1 -1
  134. package/dist/schemas/index.json +1 -1
  135. package/dist/schemas/local_info_operation.output.json +6 -0
  136. package/dist/schemas/local_mark_operation.output.json +7 -1
  137. package/dist/schemas/local_mark_operation.schema.json +1 -1
  138. package/dist/schemas/machineNode2file.schema.json +1 -1
  139. package/dist/schemas/messenger_operation.schema.json +4 -4
  140. package/dist/schemas/onchain_events.output.json +1 -1
  141. package/dist/schemas/onchain_operations.output.json +2820 -0
  142. package/dist/schemas/onchain_operations.schema.json +444 -330
  143. package/dist/schemas/onchain_operations_allocation.schema.json +37 -28
  144. package/dist/schemas/onchain_operations_arbitration.schema.json +16 -14
  145. package/dist/schemas/onchain_operations_contact.schema.json +10 -10
  146. package/dist/schemas/onchain_operations_demand.schema.json +10 -10
  147. package/dist/schemas/onchain_operations_gen_passport.schema.json +16 -16
  148. package/dist/schemas/onchain_operations_gen_proof.schema.json +2 -2
  149. package/dist/schemas/onchain_operations_guard.schema.json +2 -2
  150. package/dist/schemas/onchain_operations_machine.schema.json +43 -35
  151. package/dist/schemas/onchain_operations_order.schema.json +72 -78
  152. package/dist/schemas/onchain_operations_payment.schema.json +141 -111
  153. package/dist/schemas/onchain_operations_permission.schema.json +3 -3
  154. package/dist/schemas/onchain_operations_personal.schema.json +7 -7
  155. package/dist/schemas/onchain_operations_progress.schema.json +9 -9
  156. package/dist/schemas/onchain_operations_proof.schema.json +8 -8
  157. package/dist/schemas/onchain_operations_repository.schema.json +10 -10
  158. package/dist/schemas/onchain_operations_reward.schema.json +14 -14
  159. package/dist/schemas/onchain_operations_service.schema.json +119 -48
  160. package/dist/schemas/onchain_operations_treasury.schema.json +11 -11
  161. package/dist/schemas/onchain_table_data.output.json +33 -25
  162. package/dist/schemas/onchain_table_data.schema.json +22 -21
  163. package/dist/schemas/project_operation.output.json +2194 -23
  164. package/dist/schemas/project_operation.schema.json +84 -6
  165. package/dist/schemas/query_toolkit.output.json +108 -80
  166. package/dist/schemas/query_toolkit.schema.json +12 -12
  167. package/dist/schemas/schema_query.output.json +70 -3
  168. package/dist/schemas/schema_query.schema.json +18 -3
  169. package/dist/schemas/wowok_buildin_info.output.json +81 -8
  170. package/dist/schemas/wowok_buildin_info.schema.json +46 -2
  171. package/dist/tools/handlers/local.js +20 -5
  172. package/dist/tools/handlers/onchain.js +594 -6
  173. package/dist/tools/handlers/project.js +76 -4
  174. package/dist/tools/handlers/query.js +27 -0
  175. package/dist/tools/handlers/schema-query.js +43 -1
  176. package/dist/tools/handlers/task-status.d.ts +170 -0
  177. package/dist/tools/handlers/task-status.js +55 -0
  178. package/dist/tools/handlers/wip.js +47 -1
  179. package/dist/tools/index.d.ts +8 -0
  180. package/dist/tools/index.js +387 -12
  181. package/dist/tools/retry.d.ts +8 -0
  182. package/dist/tools/retry.js +85 -0
  183. package/dist/tools/wip-deploy-assist.d.ts +28 -0
  184. package/dist/tools/wip-deploy-assist.js +278 -0
  185. package/package.json +2 -2
  186. package/dist/schemas/guard-node-examples.md +0 -199
@@ -245,11 +245,102 @@
245
245
  ],
246
246
  "additionalProperties": false,
247
247
  "description": "The created project."
248
+ },
249
+ "recommended_creation_order": {
250
+ "type": "array",
251
+ "items": {
252
+ "type": "object",
253
+ "properties": {
254
+ "step": {
255
+ "type": "number",
256
+ "description": "Step number (1-based)."
257
+ },
258
+ "object": {
259
+ "type": "string",
260
+ "description": "Object type to create (e.g. 'Permission', 'Service (unpublished)')."
261
+ },
262
+ "reason": {
263
+ "type": "string",
264
+ "description": "Why this step is here, including dependencies and irreversibility notes."
265
+ },
266
+ "required": {
267
+ "type": "boolean",
268
+ "description": "Whether this step is mandatory for a working deployment."
269
+ }
270
+ },
271
+ "required": [
272
+ "step",
273
+ "object",
274
+ "reason",
275
+ "required"
276
+ ],
277
+ "additionalProperties": false
278
+ },
279
+ "description": "Canonical deployment sequence satisfying dependency constraints. All industries share this base order; see IndustryMode.build_notes for industry-specific deviations."
280
+ },
281
+ "blueprint": {
282
+ "type": "object",
283
+ "properties": {
284
+ "objects_count": {
285
+ "type": "number",
286
+ "description": "Number of draft objects created from the template."
287
+ },
288
+ "edges_count": {
289
+ "type": "number",
290
+ "description": "Number of graph edges from the template."
291
+ },
292
+ "industry_source": {
293
+ "type": "string",
294
+ "description": "Industry mode name that sourced the template."
295
+ },
296
+ "applied_template": {
297
+ "type": "string",
298
+ "description": "Template identifier applied."
299
+ },
300
+ "steps_count": {
301
+ "type": "number",
302
+ "description": "Number of deployment steps in the template."
303
+ },
304
+ "scenarios_count": {
305
+ "type": "number",
306
+ "description": "Number of scenarios in the template."
307
+ },
308
+ "key_risk": {
309
+ "type": [
310
+ "string",
311
+ "null"
312
+ ],
313
+ "description": "Industry-specific key risk note (or null)."
314
+ }
315
+ },
316
+ "required": [
317
+ "objects_count",
318
+ "edges_count",
319
+ "industry_source",
320
+ "applied_template",
321
+ "steps_count",
322
+ "scenarios_count"
323
+ ],
324
+ "additionalProperties": false,
325
+ "description": "Blueprint summary — present when industry template applied successfully. Objects have status='draft' and address='draft:<name>'."
326
+ },
327
+ "blueprint_warning": {
328
+ "type": "string",
329
+ "description": "Warning message — present when industry template application failed. Project is created without blueprint; use add_object to manually add objects."
330
+ },
331
+ "blueprint_skipped": {
332
+ "type": "boolean",
333
+ "description": "True when skip_templates=true was passed — no industry blueprint objects were created."
334
+ },
335
+ "hint": {
336
+ "type": "string",
337
+ "description": "User-facing hint — guides to next action (e.g. add_object, generate_deployment_doc)."
248
338
  }
249
339
  },
250
340
  "required": [
251
341
  "action",
252
- "project"
342
+ "project",
343
+ "recommended_creation_order"
253
344
  ],
254
345
  "additionalProperties": false
255
346
  },
@@ -344,7 +435,7 @@
344
435
  },
345
436
  "objectAddress": {
346
437
  "type": "string",
347
- "description": "On-chain object address (0x...)."
438
+ "description": "On-chain object address (0x...) or 'draft:<name>' sentinel for blueprint objects."
348
439
  },
349
440
  "objectType": {
350
441
  "type": [
@@ -362,12 +453,7 @@
362
453
  },
363
454
  "role": {
364
455
  "type": "string",
365
- "enum": [
366
- "core",
367
- "dependency",
368
- "reference"
369
- ],
370
- "description": "Object role in project."
456
+ "description": "Object role in project. Valid values: 'core' (the Service), 'dependency' (required binding), 'reference' (optional/auxiliary). Other values indicate data corruption — see objectGroups.other bucket."
371
457
  },
372
458
  "tags": {
373
459
  "anyOf": [
@@ -591,12 +677,128 @@
591
677
  "items": {
592
678
  "$ref": "#/definitions/project_operation/properties/result/anyOf/2/properties/objects/items"
593
679
  },
594
- "description": "Project objects (rigid relationships)."
680
+ "description": "Project objects (rigid relationships). Flat list — use objectGroups for role-based navigation."
681
+ },
682
+ "objectGroups": {
683
+ "type": "object",
684
+ "properties": {
685
+ "core": {
686
+ "type": "array",
687
+ "items": {
688
+ "$ref": "#/definitions/project_operation/properties/result/anyOf/2/properties/objects/items"
689
+ },
690
+ "description": "Core objects (the Service) — the primary deliverable of the project."
691
+ },
692
+ "dependency": {
693
+ "type": "array",
694
+ "items": {
695
+ "$ref": "#/definitions/project_operation/properties/result/anyOf/2/properties/objects/items"
696
+ },
697
+ "description": "Dependency objects (Permission, Machine, Guard, Allocation, Treasury, etc.) — required for the Service to function."
698
+ },
699
+ "reference": {
700
+ "type": "array",
701
+ "items": {
702
+ "$ref": "#/definitions/project_operation/properties/result/anyOf/2/properties/objects/items"
703
+ },
704
+ "description": "Reference objects (read-only or external) — tracked but not owned by this project."
705
+ },
706
+ "other": {
707
+ "type": "array",
708
+ "items": {
709
+ "$ref": "#/definitions/project_operation/properties/result/anyOf/2/properties/objects/items"
710
+ },
711
+ "description": "Objects with invalid or missing role (data corruption, legacy data). Grouped here for visibility — should normally be empty. Check server logs for warnings."
712
+ },
713
+ "stats": {
714
+ "type": "object",
715
+ "properties": {
716
+ "total": {
717
+ "type": "number",
718
+ "description": "Total object count."
719
+ },
720
+ "core_count": {
721
+ "type": "number",
722
+ "description": "Number of core objects."
723
+ },
724
+ "dependency_count": {
725
+ "type": "number",
726
+ "description": "Number of dependency objects."
727
+ },
728
+ "reference_count": {
729
+ "type": "number",
730
+ "description": "Number of reference objects."
731
+ },
732
+ "other_count": {
733
+ "type": "number",
734
+ "description": "Number of objects with invalid/missing role (in 'other' bucket). Normally 0."
735
+ },
736
+ "by_type": {
737
+ "type": "object",
738
+ "additionalProperties": {
739
+ "type": "number"
740
+ },
741
+ "description": "Object count grouped by objectType prefix (e.g. {'service': 1, 'permission': 1, 'guard': 5})."
742
+ }
743
+ },
744
+ "required": [
745
+ "total",
746
+ "core_count",
747
+ "dependency_count",
748
+ "reference_count",
749
+ "other_count",
750
+ "by_type"
751
+ ],
752
+ "additionalProperties": false,
753
+ "description": "Aggregate counts for quick project sizing."
754
+ }
755
+ },
756
+ "required": [
757
+ "core",
758
+ "dependency",
759
+ "reference",
760
+ "other",
761
+ "stats"
762
+ ],
763
+ "additionalProperties": false,
764
+ "description": "Objects grouped by role (core/dependency/reference/other) for easier navigation. The 'other' bucket captures objects with invalid roles (H-05 fix). The flat `objects` array is preserved for backward compatibility."
595
765
  },
596
766
  "graphEdgeCount": {
597
767
  "type": "number",
598
768
  "description": "Number of persisted graph edges."
599
769
  },
770
+ "serviceStatus": {
771
+ "anyOf": [
772
+ {
773
+ "type": "object",
774
+ "properties": {
775
+ "published": {
776
+ "type": [
777
+ "boolean",
778
+ "null"
779
+ ],
780
+ "description": "Whether the on-chain Service is published (live). null = unknown / query failed."
781
+ },
782
+ "paused": {
783
+ "type": [
784
+ "boolean",
785
+ "null"
786
+ ],
787
+ "description": "Whether the on-chain Service is paused (not accepting orders). null = unknown."
788
+ }
789
+ },
790
+ "required": [
791
+ "published",
792
+ "paused"
793
+ ],
794
+ "additionalProperties": false
795
+ },
796
+ {
797
+ "type": "null"
798
+ }
799
+ ],
800
+ "description": "On-chain Service status (published / paused). Separate from the project's local lifecycle status. null if the project has no serviceAddress or the on-chain query failed."
801
+ },
600
802
  "evaluations": {
601
803
  "type": "array",
602
804
  "items": {
@@ -770,7 +972,9 @@
770
972
  "action",
771
973
  "project",
772
974
  "objects",
975
+ "objectGroups",
773
976
  "graphEdgeCount",
977
+ "serviceStatus",
774
978
  "evaluations",
775
979
  "versions"
776
980
  ],
@@ -958,37 +1162,157 @@
958
1162
  "type": "string",
959
1163
  "const": "build_graph"
960
1164
  },
1165
+ "async_mode": {
1166
+ "type": "boolean",
1167
+ "description": "True when graph is building asynchronously (background task). When true, call query_task_status with task_id to retrieve the result."
1168
+ },
1169
+ "task_id": {
1170
+ "type": "string",
1171
+ "description": "Async task id — present only when async_mode=true. Use with query_task_status."
1172
+ },
961
1173
  "nodeCount": {
962
1174
  "type": "number",
963
- "description": "Total nodes in the constructed graph."
1175
+ "description": "Total nodes in the constructed graph (sync mode only)."
964
1176
  },
965
1177
  "edgeCount": {
966
1178
  "type": "number",
967
- "description": "Total edges (after conflict resolution + dedup)."
1179
+ "description": "Total edges (after conflict resolution + dedup) (sync mode only)."
968
1180
  },
969
1181
  "edgesBySource": {
970
1182
  "type": "object",
971
1183
  "additionalProperties": {
972
1184
  "type": "number"
973
1185
  },
974
- "description": "Edge counts by source: { internal: N, registrar: N, potential: N }."
1186
+ "description": "Edge counts by source: { internal: N, registrar: N, potential: N } (sync mode only)."
975
1187
  },
976
1188
  "reputationCount": {
977
1189
  "type": "number",
978
- "description": "Number of objects with Registrar reputation data."
1190
+ "description": "Number of objects with Registrar reputation data (sync mode only)."
979
1191
  },
980
1192
  "builtAt": {
981
1193
  "type": "number",
982
- "description": "Build timestamp (ms)."
1194
+ "description": "Build timestamp in ms (sync mode only)."
1195
+ },
1196
+ "binding_verification": {
1197
+ "anyOf": [
1198
+ {
1199
+ "type": "object",
1200
+ "properties": {
1201
+ "service": {
1202
+ "type": "string",
1203
+ "description": "Service object address that was verified."
1204
+ },
1205
+ "bindings": {
1206
+ "type": "object",
1207
+ "additionalProperties": {
1208
+ "type": "object",
1209
+ "properties": {
1210
+ "expected": {
1211
+ "type": "string",
1212
+ "description": "Expected target object type."
1213
+ },
1214
+ "actual": {
1215
+ "type": [
1216
+ "string",
1217
+ "null"
1218
+ ],
1219
+ "description": "Actual on-chain value (address or null)."
1220
+ },
1221
+ "count": {
1222
+ "type": "number",
1223
+ "description": "Item count for array fields (order_allocators, arbitrations)."
1224
+ },
1225
+ "verified": {
1226
+ "type": "boolean",
1227
+ "description": "Whether the binding exists on-chain."
1228
+ }
1229
+ },
1230
+ "required": [
1231
+ "expected",
1232
+ "actual",
1233
+ "verified"
1234
+ ],
1235
+ "additionalProperties": false
1236
+ },
1237
+ "description": "Per-field binding verification result."
1238
+ },
1239
+ "all_verified": {
1240
+ "type": "boolean",
1241
+ "description": "True when all critical bindings exist on-chain."
1242
+ }
1243
+ },
1244
+ "required": [
1245
+ "service",
1246
+ "bindings",
1247
+ "all_verified"
1248
+ ],
1249
+ "additionalProperties": false
1250
+ },
1251
+ {
1252
+ "type": "null"
1253
+ }
1254
+ ],
1255
+ "description": "On-chain verification of Service bindings (F-15). Null when no Service address or query failed. Sync mode only."
1256
+ },
1257
+ "topEdges": {
1258
+ "type": "array",
1259
+ "items": {
1260
+ "type": "object",
1261
+ "properties": {
1262
+ "source": {
1263
+ "type": "string",
1264
+ "description": "Source object address."
1265
+ },
1266
+ "target": {
1267
+ "type": "string",
1268
+ "description": "Target object address."
1269
+ },
1270
+ "fieldName": {
1271
+ "type": [
1272
+ "string",
1273
+ "null"
1274
+ ],
1275
+ "description": "Field name on the source object (or null)."
1276
+ },
1277
+ "relationshipType": {
1278
+ "type": "string",
1279
+ "description": "Relationship type (bind, create, trigger, etc.)."
1280
+ },
1281
+ "weight": {
1282
+ "type": [
1283
+ "number",
1284
+ "null"
1285
+ ],
1286
+ "description": "Edge weight (0-1, higher = more important)."
1287
+ },
1288
+ "verified": {
1289
+ "type": "boolean",
1290
+ "description": "Whether the edge has been verified on-chain."
1291
+ }
1292
+ },
1293
+ "required": [
1294
+ "source",
1295
+ "target",
1296
+ "fieldName",
1297
+ "relationshipType",
1298
+ "weight",
1299
+ "verified"
1300
+ ],
1301
+ "additionalProperties": false
1302
+ },
1303
+ "description": "Top 5 critical edges by weight (sync mode only). Preview of the most important relationships — call get_graph for the full list."
1304
+ },
1305
+ "visualization": {
1306
+ "type": "string",
1307
+ "description": "Mermaid-style ASCII visualization of top edges (sync mode only). Compact format: 'source --field--> target'."
1308
+ },
1309
+ "hint": {
1310
+ "type": "string",
1311
+ "description": "User-facing hint — guides to next action (e.g. call get_graph for full list, or query_task_status for async result)."
983
1312
  }
984
1313
  },
985
1314
  "required": [
986
- "action",
987
- "nodeCount",
988
- "edgeCount",
989
- "edgesBySource",
990
- "reputationCount",
991
- "builtAt"
1315
+ "action"
992
1316
  ],
993
1317
  "additionalProperties": false
994
1318
  },
@@ -1531,7 +1855,7 @@
1531
1855
  ],
1532
1856
  "additionalProperties": false
1533
1857
  },
1534
- "description": "D-01..D-18 check results."
1858
+ "description": "D-01..D-20 check results (20 deployment checks including D-19 Machine entry-node forward and D-20 Service compensation_fund)."
1535
1859
  },
1536
1860
  "errors": {
1537
1861
  "type": "array",
@@ -1547,23 +1871,1870 @@
1547
1871
  "errors"
1548
1872
  ],
1549
1873
  "additionalProperties": false,
1550
- "description": "Deployment doc validation result against D-01..D-18."
1874
+ "description": "Deployment doc validation result against D-01..D-20."
1551
1875
  },
1552
1876
  "saved": {
1553
1877
  "type": "boolean",
1554
1878
  "description": "Whether the markdown was persisted to SQLite project_documents table."
1879
+ },
1880
+ "detail_level": {
1881
+ "type": "string",
1882
+ "enum": [
1883
+ "summary",
1884
+ "detailed",
1885
+ "full"
1886
+ ],
1887
+ "description": "Effective detail level used to render the deployment doc. 'summary' (default) shows only key bindings; 'detailed' adds sale/arbitration lists; 'full' shows complete config."
1888
+ },
1889
+ "stage_gate": {
1890
+ "type": "object",
1891
+ "properties": {
1892
+ "stage": {
1893
+ "type": "number",
1894
+ "description": "The stage that was validated (4 = deployment doc generation gate)."
1895
+ },
1896
+ "passed": {
1897
+ "type": "boolean",
1898
+ "description": "True iff no FAIL checks exist — gate allows advancing to Stage 5."
1899
+ },
1900
+ "can_proceed": {
1901
+ "type": "boolean",
1902
+ "description": "Alias for `passed` — whether the stage gate allows advancement."
1903
+ },
1904
+ "blocking_issues": {
1905
+ "type": "array",
1906
+ "items": {
1907
+ "type": "string"
1908
+ },
1909
+ "description": "FAIL status messages — must be resolved before deploying."
1910
+ },
1911
+ "warnings": {
1912
+ "type": "array",
1913
+ "items": {
1914
+ "type": "string"
1915
+ },
1916
+ "description": "WARN status messages — non-blocking, user may proceed at own risk."
1917
+ },
1918
+ "checks": {
1919
+ "type": "array",
1920
+ "items": {
1921
+ "type": "object",
1922
+ "properties": {
1923
+ "dimension": {
1924
+ "type": "string",
1925
+ "enum": [
1926
+ "semantic",
1927
+ "tools",
1928
+ "reversibility",
1929
+ "risk",
1930
+ "isolation",
1931
+ "gas_budget"
1932
+ ],
1933
+ "description": "The validation dimension."
1934
+ },
1935
+ "status": {
1936
+ "type": "string",
1937
+ "enum": [
1938
+ "PASS",
1939
+ "WARN",
1940
+ "FAIL"
1941
+ ],
1942
+ "description": "Check result status."
1943
+ },
1944
+ "message": {
1945
+ "type": "string",
1946
+ "description": "Human-readable check result message."
1947
+ }
1948
+ },
1949
+ "required": [
1950
+ "dimension",
1951
+ "status",
1952
+ "message"
1953
+ ],
1954
+ "additionalProperties": false
1955
+ },
1956
+ "description": "Per-dimension check results."
1957
+ }
1958
+ },
1959
+ "required": [
1960
+ "stage",
1961
+ "passed",
1962
+ "can_proceed",
1963
+ "blocking_issues",
1964
+ "warnings",
1965
+ "checks"
1966
+ ],
1967
+ "additionalProperties": false,
1968
+ "description": "Stage gate validation (GLM6 5-stage lifecycle handoff). Validates Stage 3 risk score threshold (>=80 PASS, >=50 WARN, <50 FAIL) and Stage 4 deployment doc generation prerequisite."
1969
+ },
1970
+ "deployment_scan": {
1971
+ "type": "object",
1972
+ "properties": {
1973
+ "overall_readiness": {
1974
+ "type": "string",
1975
+ "enum": [
1976
+ "ready",
1977
+ "blocked",
1978
+ "warnings"
1979
+ ],
1980
+ "description": "'ready' = all 20 checks pass; 'blocked' = any critical fail; 'warnings' = only warning fails."
1981
+ },
1982
+ "critical_count": {
1983
+ "type": "number",
1984
+ "description": "Number of critical findings (blocks deployment)."
1985
+ },
1986
+ "warning_count": {
1987
+ "type": "number",
1988
+ "description": "Number of warning findings (non-blocking)."
1989
+ },
1990
+ "findings": {
1991
+ "type": "array",
1992
+ "items": {
1993
+ "type": "object",
1994
+ "properties": {
1995
+ "check_id": {
1996
+ "type": "string",
1997
+ "description": "D-XX check id (e.g. 'D-19') or sub-id (e.g. 'D-10a')."
1998
+ },
1999
+ "severity": {
2000
+ "type": "string",
2001
+ "enum": [
2002
+ "critical",
2003
+ "warning",
2004
+ "info"
2005
+ ],
2006
+ "description": "Finding severity."
2007
+ },
2008
+ "message": {
2009
+ "type": "string",
2010
+ "description": "Human-readable finding message."
2011
+ },
2012
+ "location": {
2013
+ "type": "string",
2014
+ "description": "Document location (section, line, or step id)."
2015
+ },
2016
+ "suggestion": {
2017
+ "type": "string",
2018
+ "description": "Suggested fix."
2019
+ }
2020
+ },
2021
+ "required": [
2022
+ "check_id",
2023
+ "severity",
2024
+ "message"
2025
+ ],
2026
+ "additionalProperties": false
2027
+ },
2028
+ "description": "All findings from the 20 D-XX deployment checks."
2029
+ },
2030
+ "checks": {
2031
+ "type": "object",
2032
+ "properties": {
2033
+ "D01_object_defined": {
2034
+ "type": "string",
2035
+ "enum": [
2036
+ "pass",
2037
+ "fail"
2038
+ ]
2039
+ },
2040
+ "D02_dependency_complete": {
2041
+ "type": "string",
2042
+ "enum": [
2043
+ "pass",
2044
+ "fail"
2045
+ ]
2046
+ },
2047
+ "D03_scenario_covered": {
2048
+ "type": "string",
2049
+ "enum": [
2050
+ "pass",
2051
+ "fail"
2052
+ ]
2053
+ },
2054
+ "D04_testnet_topo_order": {
2055
+ "type": "string",
2056
+ "enum": [
2057
+ "pass",
2058
+ "fail"
2059
+ ]
2060
+ },
2061
+ "D05_testnet_network": {
2062
+ "type": "string",
2063
+ "enum": [
2064
+ "pass",
2065
+ "fail"
2066
+ ]
2067
+ },
2068
+ "D06_testnet_replace": {
2069
+ "type": "string",
2070
+ "enum": [
2071
+ "pass",
2072
+ "fail"
2073
+ ]
2074
+ },
2075
+ "D07_permission_index": {
2076
+ "type": "string",
2077
+ "enum": [
2078
+ "pass",
2079
+ "fail"
2080
+ ]
2081
+ },
2082
+ "D08_guard_gen_passport": {
2083
+ "type": "string",
2084
+ "enum": [
2085
+ "pass",
2086
+ "fail"
2087
+ ]
2088
+ },
2089
+ "D09_machine_node_count": {
2090
+ "type": "string",
2091
+ "enum": [
2092
+ "pass",
2093
+ "fail"
2094
+ ]
2095
+ },
2096
+ "D10_substep_coherence": {
2097
+ "type": "string",
2098
+ "enum": [
2099
+ "pass",
2100
+ "fail"
2101
+ ]
2102
+ },
2103
+ "D11_mainnet_testnet_match": {
2104
+ "type": "string",
2105
+ "enum": [
2106
+ "pass",
2107
+ "fail"
2108
+ ]
2109
+ },
2110
+ "D12_mainnet_network": {
2111
+ "type": "string",
2112
+ "enum": [
2113
+ "pass",
2114
+ "fail"
2115
+ ]
2116
+ },
2117
+ "D13_mainnet_replace": {
2118
+ "type": "string",
2119
+ "enum": [
2120
+ "pass",
2121
+ "fail"
2122
+ ]
2123
+ },
2124
+ "D14_testnet_verification": {
2125
+ "type": "string",
2126
+ "enum": [
2127
+ "pass",
2128
+ "fail"
2129
+ ]
2130
+ },
2131
+ "D15_mainnet_verification": {
2132
+ "type": "string",
2133
+ "enum": [
2134
+ "pass",
2135
+ "fail"
2136
+ ]
2137
+ },
2138
+ "D16_no_critical_risk": {
2139
+ "type": "string",
2140
+ "enum": [
2141
+ "pass",
2142
+ "fail"
2143
+ ]
2144
+ },
2145
+ "D17_no_high_risk": {
2146
+ "type": "string",
2147
+ "enum": [
2148
+ "pass",
2149
+ "fail"
2150
+ ]
2151
+ },
2152
+ "D18_completeness_checklist": {
2153
+ "type": "string",
2154
+ "enum": [
2155
+ "pass",
2156
+ "fail"
2157
+ ]
2158
+ },
2159
+ "D19_machine_entry_forward": {
2160
+ "type": "string",
2161
+ "enum": [
2162
+ "pass",
2163
+ "fail"
2164
+ ],
2165
+ "description": "Machine entry node (prev_node='') forwards non-empty — avoids Progress stuck at current=''."
2166
+ },
2167
+ "D20_service_compensation_fund": {
2168
+ "type": "string",
2169
+ "enum": [
2170
+ "pass",
2171
+ "fail"
2172
+ ],
2173
+ "description": "Service compensation_fund (Balance<T>) present or industry-exempt — ensures arbitration refund capability."
2174
+ }
2175
+ },
2176
+ "required": [
2177
+ "D01_object_defined",
2178
+ "D02_dependency_complete",
2179
+ "D03_scenario_covered",
2180
+ "D04_testnet_topo_order",
2181
+ "D05_testnet_network",
2182
+ "D06_testnet_replace",
2183
+ "D07_permission_index",
2184
+ "D08_guard_gen_passport",
2185
+ "D09_machine_node_count",
2186
+ "D10_substep_coherence",
2187
+ "D11_mainnet_testnet_match",
2188
+ "D12_mainnet_network",
2189
+ "D13_mainnet_replace",
2190
+ "D14_testnet_verification",
2191
+ "D15_mainnet_verification",
2192
+ "D16_no_critical_risk",
2193
+ "D17_no_high_risk",
2194
+ "D18_completeness_checklist",
2195
+ "D19_machine_entry_forward",
2196
+ "D20_service_compensation_fund"
2197
+ ],
2198
+ "additionalProperties": false,
2199
+ "description": "Per-check pass/fail status for all 20 D-XX checks."
2200
+ }
2201
+ },
2202
+ "required": [
2203
+ "overall_readiness",
2204
+ "critical_count",
2205
+ "warning_count",
2206
+ "findings",
2207
+ "checks"
2208
+ ],
2209
+ "additionalProperties": false,
2210
+ "description": "Deployment scanner result — 20 D-XX checks including D-19 (Machine entry forward) and D-20 (Service compensation_fund)."
1555
2211
  }
1556
2212
  },
1557
2213
  "required": [
1558
2214
  "action",
1559
2215
  "markdown",
1560
2216
  "validation",
1561
- "saved"
2217
+ "saved",
2218
+ "detail_level",
2219
+ "stage_gate",
2220
+ "deployment_scan"
2221
+ ],
2222
+ "additionalProperties": false
2223
+ },
2224
+ {
2225
+ "type": "object",
2226
+ "properties": {
2227
+ "action": {
2228
+ "type": "string",
2229
+ "const": "pre_evaluate_check"
2230
+ },
2231
+ "ready": {
2232
+ "type": "boolean",
2233
+ "description": "True if evaluate_project will produce meaningful results (no hard blockers). If false, address the items in `missing` first."
2234
+ },
2235
+ "missing": {
2236
+ "type": "array",
2237
+ "items": {
2238
+ "type": "object",
2239
+ "properties": {
2240
+ "id": {
2241
+ "type": "string",
2242
+ "description": "Check ID (e.g. PE-01, PE-06)."
2243
+ },
2244
+ "description": {
2245
+ "type": "string",
2246
+ "description": "What is missing."
2247
+ },
2248
+ "impact": {
2249
+ "type": "string",
2250
+ "description": "How it affects the evaluation, and how to fix it."
2251
+ }
2252
+ },
2253
+ "required": [
2254
+ "id",
2255
+ "description",
2256
+ "impact"
2257
+ ],
2258
+ "additionalProperties": false
2259
+ },
2260
+ "description": "Hard blockers — must be resolved before evaluation."
2261
+ },
2262
+ "warnings": {
2263
+ "type": "array",
2264
+ "items": {
2265
+ "type": "object",
2266
+ "properties": {
2267
+ "id": {
2268
+ "type": "string",
2269
+ "description": "Check ID (e.g. PE-02, PE-03)."
2270
+ },
2271
+ "description": {
2272
+ "type": "string",
2273
+ "description": "What is suboptimal."
2274
+ },
2275
+ "impact": {
2276
+ "type": "string",
2277
+ "description": "How it affects the evaluation, and how to improve it."
2278
+ }
2279
+ },
2280
+ "required": [
2281
+ "id",
2282
+ "description",
2283
+ "impact"
2284
+ ],
2285
+ "additionalProperties": false
2286
+ },
2287
+ "description": "Soft issues — evaluation runs but quality may be reduced."
2288
+ },
2289
+ "summary": {
2290
+ "type": "string",
2291
+ "description": "One-line human-readable status."
2292
+ },
2293
+ "counts": {
2294
+ "type": "object",
2295
+ "properties": {
2296
+ "objects": {
2297
+ "type": "number",
2298
+ "description": "Total project_objects count."
2299
+ },
2300
+ "edges": {
2301
+ "type": "number",
2302
+ "description": "Total graph_edges count."
2303
+ },
2304
+ "uncached": {
2305
+ "type": "number",
2306
+ "description": "Objects with no cached on-chain data."
2307
+ },
2308
+ "stale": {
2309
+ "type": "number",
2310
+ "description": "Objects with cache older than 24 hours."
2311
+ },
2312
+ "dangling_edges": {
2313
+ "type": "number",
2314
+ "description": "Edges referencing objects not in project_objects."
2315
+ },
2316
+ "drafts": {
2317
+ "type": "number",
2318
+ "description": "Objects still in draft (not yet on-chain)."
2319
+ }
2320
+ },
2321
+ "required": [
2322
+ "objects",
2323
+ "edges",
2324
+ "uncached",
2325
+ "stale",
2326
+ "dangling_edges",
2327
+ "drafts"
2328
+ ],
2329
+ "additionalProperties": false,
2330
+ "description": "Quick-scan counts for triage."
2331
+ }
2332
+ },
2333
+ "required": [
2334
+ "action",
2335
+ "ready",
2336
+ "missing",
2337
+ "warnings",
2338
+ "summary",
2339
+ "counts"
2340
+ ],
2341
+ "additionalProperties": false
2342
+ },
2343
+ {
2344
+ "type": "object",
2345
+ "properties": {
2346
+ "action": {
2347
+ "type": "string",
2348
+ "const": "verify_deployment"
2349
+ },
2350
+ "verifiedCount": {
2351
+ "type": "number",
2352
+ "description": "Number of objects actually verified (excludes drafts and unreachable)."
2353
+ },
2354
+ "matched": {
2355
+ "type": "number",
2356
+ "description": "Objects whose on-chain state matches SQLite."
2357
+ },
2358
+ "mismatched": {
2359
+ "type": "number",
2360
+ "description": "Objects whose on-chain state differs from SQLite (see `results[].differences`)."
2361
+ },
2362
+ "missing": {
2363
+ "type": "number",
2364
+ "description": "Objects that no longer exist on-chain (deleted or never deployed)."
2365
+ },
2366
+ "unreachable": {
2367
+ "type": "number",
2368
+ "description": "Objects that could not be queried (network error)."
2369
+ },
2370
+ "results": {
2371
+ "type": "array",
2372
+ "items": {
2373
+ "type": "object",
2374
+ "properties": {
2375
+ "objectAddress": {
2376
+ "type": "string"
2377
+ },
2378
+ "objectName": {
2379
+ "type": [
2380
+ "string",
2381
+ "null"
2382
+ ]
2383
+ },
2384
+ "objectType": {
2385
+ "type": [
2386
+ "string",
2387
+ "null"
2388
+ ]
2389
+ },
2390
+ "status": {
2391
+ "type": "string",
2392
+ "enum": [
2393
+ "matched",
2394
+ "mismatched",
2395
+ "missing",
2396
+ "unreachable"
2397
+ ],
2398
+ "description": "Verification status: 'matched' = on-chain matches SQLite; 'mismatched' = on-chain differs (see differences); 'missing' = object no longer exists on-chain; 'unreachable' = query failed (network error or rate limit)."
2399
+ },
2400
+ "differences": {
2401
+ "type": "array",
2402
+ "items": {
2403
+ "type": "object",
2404
+ "properties": {
2405
+ "field": {
2406
+ "type": "string",
2407
+ "description": "Field path that differs."
2408
+ },
2409
+ "sqlite": {
2410
+ "description": "Value recorded in SQLite."
2411
+ },
2412
+ "onchain": {
2413
+ "description": "Value observed on-chain."
2414
+ }
2415
+ },
2416
+ "required": [
2417
+ "field"
2418
+ ],
2419
+ "additionalProperties": false
2420
+ },
2421
+ "description": "Per-field differences (only for status='mismatched')."
2422
+ },
2423
+ "bindings": {
2424
+ "type": "object",
2425
+ "properties": {
2426
+ "machine": {
2427
+ "type": "boolean"
2428
+ },
2429
+ "permission": {
2430
+ "type": "boolean"
2431
+ },
2432
+ "buy_guard": {
2433
+ "type": "boolean"
2434
+ },
2435
+ "order_allocators": {
2436
+ "type": "boolean"
2437
+ }
2438
+ },
2439
+ "required": [
2440
+ "machine",
2441
+ "permission",
2442
+ "buy_guard",
2443
+ "order_allocators"
2444
+ ],
2445
+ "additionalProperties": false,
2446
+ "description": "Critical binding status (only for Service objects). Each boolean indicates whether the binding is set to a non-null value on-chain."
2447
+ },
2448
+ "error": {
2449
+ "type": "string",
2450
+ "description": "Error message (only for status='unreachable')."
2451
+ }
2452
+ },
2453
+ "required": [
2454
+ "objectAddress",
2455
+ "objectName",
2456
+ "objectType",
2457
+ "status"
2458
+ ],
2459
+ "additionalProperties": false
2460
+ },
2461
+ "description": "Per-object verification results."
2462
+ },
2463
+ "summary": {
2464
+ "type": "string",
2465
+ "description": "One-line human-readable summary."
2466
+ }
2467
+ },
2468
+ "required": [
2469
+ "action",
2470
+ "verifiedCount",
2471
+ "matched",
2472
+ "mismatched",
2473
+ "missing",
2474
+ "unreachable",
2475
+ "results",
2476
+ "summary"
2477
+ ],
2478
+ "additionalProperties": false
2479
+ },
2480
+ {
2481
+ "type": "object",
2482
+ "properties": {
2483
+ "action": {
2484
+ "type": "string",
2485
+ "const": "get_machine_graph"
2486
+ },
2487
+ "machineAddress": {
2488
+ "type": "string",
2489
+ "description": "The Machine object address."
2490
+ },
2491
+ "machineName": {
2492
+ "type": [
2493
+ "string",
2494
+ "null"
2495
+ ],
2496
+ "description": "The Machine's local name (from LocalMark) if available."
2497
+ },
2498
+ "nodes": {
2499
+ "type": "array",
2500
+ "items": {
2501
+ "type": "object",
2502
+ "properties": {
2503
+ "name": {
2504
+ "type": "string",
2505
+ "description": "Node name."
2506
+ },
2507
+ "description": {
2508
+ "type": [
2509
+ "string",
2510
+ "null"
2511
+ ],
2512
+ "description": "Node description if set, else null."
2513
+ }
2514
+ },
2515
+ "required": [
2516
+ "name",
2517
+ "description"
2518
+ ],
2519
+ "additionalProperties": false
2520
+ },
2521
+ "description": "Workflow nodes (states)."
2522
+ },
2523
+ "edges": {
2524
+ "type": "array",
2525
+ "items": {
2526
+ "type": "object",
2527
+ "properties": {
2528
+ "from": {
2529
+ "type": "string",
2530
+ "description": "Source node name (prev_node)."
2531
+ },
2532
+ "to": {
2533
+ "type": "string",
2534
+ "description": "Target node name (next_node)."
2535
+ },
2536
+ "threshold": {
2537
+ "type": "number",
2538
+ "description": "Minimum weighted forward count required to advance."
2539
+ },
2540
+ "forwards": {
2541
+ "type": "array",
2542
+ "items": {
2543
+ "type": "object",
2544
+ "properties": {
2545
+ "name": {
2546
+ "type": "string",
2547
+ "description": "Forward name."
2548
+ },
2549
+ "weight": {
2550
+ "type": "number",
2551
+ "description": "Forward weight (for weighted threshold)."
2552
+ },
2553
+ "guard": {
2554
+ "type": [
2555
+ "string",
2556
+ "null"
2557
+ ],
2558
+ "description": "Guard object address if the forward is guard-gated, else null."
2559
+ },
2560
+ "named_operator": {
2561
+ "type": [
2562
+ "string",
2563
+ "null"
2564
+ ],
2565
+ "description": "Named operator if set, else null."
2566
+ },
2567
+ "permission_index": {
2568
+ "type": [
2569
+ "number",
2570
+ "null"
2571
+ ],
2572
+ "description": "Permission index if set, else null."
2573
+ }
2574
+ },
2575
+ "required": [
2576
+ "name",
2577
+ "weight",
2578
+ "guard",
2579
+ "named_operator",
2580
+ "permission_index"
2581
+ ],
2582
+ "additionalProperties": false
2583
+ },
2584
+ "description": "Forwards within this pair — each is an advance operation."
2585
+ }
2586
+ },
2587
+ "required": [
2588
+ "from",
2589
+ "to",
2590
+ "threshold",
2591
+ "forwards"
2592
+ ],
2593
+ "additionalProperties": false
2594
+ },
2595
+ "description": "Directed edges (pairs) connecting nodes. Each edge has a threshold and forwards."
2596
+ },
2597
+ "published": {
2598
+ "type": [
2599
+ "boolean",
2600
+ "null"
2601
+ ],
2602
+ "description": "Whether the Machine is published (locked for production). null = unknown."
2603
+ },
2604
+ "paused": {
2605
+ "type": [
2606
+ "boolean",
2607
+ "null"
2608
+ ],
2609
+ "description": "Whether the Machine is paused (not generating new Progress). null = unknown."
2610
+ },
2611
+ "mermaid": {
2612
+ "type": "string",
2613
+ "description": "Mermaid stateDiagram-v2 string visualizing the directed graph. Entry nodes start from [*]. Edge labels include forward name + threshold + guard info. Cycles (revision loops) are rendered as normal edges. Includes a color legend comment block + BehaviorTree.CPP-style color annotations (entry=green, terminal=red, revision=amber, normal=blue). Renderable in markdown viewers."
2614
+ },
2615
+ "tree_outline": {
2616
+ "type": "string",
2617
+ "description": "Indented Markdown outline of the directed graph (human-editable format). Lists edges as outline entries with forwards nested under each edge. Includes a Backrefs section consolidating incoming edges per node (editing aid — answers 'who transitions INTO node X?'). Bidirectional with parseMachineTreeIndented(). Includes JSON code block for round-trip safety. Use this for the download -> edit -> republish workflow."
2618
+ },
2619
+ "ascii_art": {
2620
+ "type": "string",
2621
+ "description": "ASCII art directed graph visualization using arrow notation (A -forward-> B). Cycle (revision loop) and terminal annotations included. Terminal-friendly, avoids JSON escaping issues that affect multi-line Mermaid strings. Use when rendering in plain-text contexts."
2622
+ },
2623
+ "markmap": {
2624
+ "type": "string",
2625
+ "description": "Markmap-compatible Markdown string (heading levels represent hierarchy). Edge-centric layout with forwards nested under edges. Renderable by VS Code Markmap extension or markmap.js. Provides an interactive mind-map view of the workflow."
2626
+ }
2627
+ },
2628
+ "required": [
2629
+ "action",
2630
+ "machineAddress",
2631
+ "machineName",
2632
+ "nodes",
2633
+ "edges",
2634
+ "published",
2635
+ "paused",
2636
+ "mermaid",
2637
+ "tree_outline",
2638
+ "ascii_art",
2639
+ "markmap"
2640
+ ],
2641
+ "additionalProperties": false
2642
+ },
2643
+ {
2644
+ "type": "object",
2645
+ "properties": {
2646
+ "action": {
2647
+ "type": "string",
2648
+ "const": "get_guard_graph"
2649
+ },
2650
+ "guardAddress": {
2651
+ "type": "string",
2652
+ "description": "The Guard object address."
2653
+ },
2654
+ "guardName": {
2655
+ "type": [
2656
+ "string",
2657
+ "null"
2658
+ ],
2659
+ "description": "The Guard's local name (from LocalMark) if available."
2660
+ },
2661
+ "root": {
2662
+ "type": "object",
2663
+ "properties": {
2664
+ "type": {
2665
+ "type": "string",
2666
+ "description": "Guard node type (logic_and, query, identifier, context, calc_*, convert_*, vec_*, etc.)."
2667
+ },
2668
+ "nodes": {
2669
+ "type": "array",
2670
+ "items": {
2671
+ "type": "object",
2672
+ "properties": {
2673
+ "type": {
2674
+ "type": "string",
2675
+ "description": "Guard node type (logic_and, query, identifier, context, calc_*, convert_*, vec_*, etc.)."
2676
+ },
2677
+ "nodes": {
2678
+ "type": "array",
2679
+ "items": {
2680
+ "$ref": "#/definitions/project_operation/properties/result/anyOf/22/properties/root/properties/nodes/items"
2681
+ },
2682
+ "description": "Child nodes (for logic_and/or, calc_*, vec_contains_*, etc.)."
2683
+ },
2684
+ "node": {
2685
+ "$ref": "#/definitions/project_operation/properties/result/anyOf/22/properties/root/properties/nodes/items",
2686
+ "description": "Single child (for logic_not, convert_*, value_type)."
2687
+ },
2688
+ "nodeLeft": {
2689
+ "$ref": "#/definitions/project_operation/properties/result/anyOf/22/properties/root/properties/nodes/items",
2690
+ "description": "Left child (for vec_indexof_*)."
2691
+ },
2692
+ "nodeRight": {
2693
+ "$ref": "#/definitions/project_operation/properties/result/anyOf/22/properties/root/properties/nodes/items",
2694
+ "description": "Right child (for vec_indexof_*)."
2695
+ },
2696
+ "query": {
2697
+ "type": [
2698
+ "number",
2699
+ "string"
2700
+ ],
2701
+ "description": "Query instruction ID or name (for query nodes)."
2702
+ },
2703
+ "object": {
2704
+ "type": "object",
2705
+ "properties": {
2706
+ "identifier": {
2707
+ "type": "number"
2708
+ },
2709
+ "convert_witness": {
2710
+ "type": "number"
2711
+ }
2712
+ },
2713
+ "additionalProperties": false,
2714
+ "description": "Query target object reference."
2715
+ },
2716
+ "parameters": {
2717
+ "type": "array",
2718
+ "items": {
2719
+ "$ref": "#/definitions/project_operation/properties/result/anyOf/22/properties/root/properties/nodes/items"
2720
+ },
2721
+ "description": "Query parameters."
2722
+ },
2723
+ "identifier": {
2724
+ "type": "number",
2725
+ "description": "Table entry index (for identifier nodes)."
2726
+ },
2727
+ "context": {
2728
+ "type": "string",
2729
+ "description": "Context type: Signer, Clock, or Guard."
2730
+ }
2731
+ },
2732
+ "required": [
2733
+ "type"
2734
+ ],
2735
+ "additionalProperties": false
2736
+ },
2737
+ "description": "Child nodes (for logic_and/or, calc_*, vec_contains_*, etc.)."
2738
+ },
2739
+ "node": {
2740
+ "$ref": "#/definitions/project_operation/properties/result/anyOf/22/properties/root/properties/nodes/items",
2741
+ "description": "Single child (for logic_not, convert_*, value_type)."
2742
+ },
2743
+ "nodeLeft": {
2744
+ "$ref": "#/definitions/project_operation/properties/result/anyOf/22/properties/root/properties/nodes/items",
2745
+ "description": "Left child (for vec_indexof_*)."
2746
+ },
2747
+ "nodeRight": {
2748
+ "$ref": "#/definitions/project_operation/properties/result/anyOf/22/properties/root/properties/nodes/items",
2749
+ "description": "Right child (for vec_indexof_*)."
2750
+ },
2751
+ "query": {
2752
+ "type": [
2753
+ "number",
2754
+ "string"
2755
+ ],
2756
+ "description": "Query instruction ID or name (for query nodes)."
2757
+ },
2758
+ "object": {
2759
+ "type": "object",
2760
+ "properties": {
2761
+ "identifier": {
2762
+ "type": "number"
2763
+ },
2764
+ "convert_witness": {
2765
+ "type": "number"
2766
+ }
2767
+ },
2768
+ "additionalProperties": false,
2769
+ "description": "Query target object reference."
2770
+ },
2771
+ "parameters": {
2772
+ "type": "array",
2773
+ "items": {
2774
+ "$ref": "#/definitions/project_operation/properties/result/anyOf/22/properties/root/properties/nodes/items"
2775
+ },
2776
+ "description": "Query parameters."
2777
+ },
2778
+ "identifier": {
2779
+ "type": "number",
2780
+ "description": "Table entry index (for identifier nodes)."
2781
+ },
2782
+ "context": {
2783
+ "type": "string",
2784
+ "description": "Context type: Signer, Clock, or Guard."
2785
+ }
2786
+ },
2787
+ "required": [
2788
+ "type"
2789
+ ],
2790
+ "additionalProperties": false,
2791
+ "description": "Root computation node (returns Bool). The tree is recursive — each node may have children."
2792
+ },
2793
+ "table": {
2794
+ "type": "array",
2795
+ "items": {
2796
+ "type": "object",
2797
+ "properties": {
2798
+ "identifier": {
2799
+ "type": "number",
2800
+ "description": "Table entry index (0-255)."
2801
+ },
2802
+ "b_submission": {
2803
+ "type": "boolean",
2804
+ "description": "Whether this entry is submitted at runtime."
2805
+ },
2806
+ "value_type": {
2807
+ "type": [
2808
+ "number",
2809
+ "string"
2810
+ ],
2811
+ "description": "Value type (numeric code or name)."
2812
+ },
2813
+ "value": {
2814
+ "description": "Constant value (if b_submission=false)."
2815
+ },
2816
+ "name": {
2817
+ "type": "string",
2818
+ "description": "Human-readable name/description."
2819
+ }
2820
+ },
2821
+ "required": [
2822
+ "identifier",
2823
+ "b_submission",
2824
+ "value_type"
2825
+ ],
2826
+ "additionalProperties": false
2827
+ },
2828
+ "description": "Guard data table entries (constants + submission slots)."
2829
+ },
2830
+ "rely": {
2831
+ "anyOf": [
2832
+ {
2833
+ "type": "object",
2834
+ "properties": {
2835
+ "guards": {
2836
+ "type": "array",
2837
+ "items": {
2838
+ "type": "string"
2839
+ }
2840
+ },
2841
+ "logic_or": {
2842
+ "type": "boolean"
2843
+ }
2844
+ },
2845
+ "required": [
2846
+ "guards"
2847
+ ],
2848
+ "additionalProperties": false
2849
+ },
2850
+ {
2851
+ "type": "null"
2852
+ }
2853
+ ],
2854
+ "description": "Rely dependencies (other Guards this Guard depends on). null = no rely."
2855
+ },
2856
+ "immutable": {
2857
+ "type": [
2858
+ "boolean",
2859
+ "null"
2860
+ ],
2861
+ "description": "Whether the Guard is immutable (frozen for verification). null = unknown."
2862
+ },
2863
+ "mermaid": {
2864
+ "type": "string",
2865
+ "description": "Mermaid flowchart TD string visualizing the tree. Node shapes: {}=decision (logic_*), []=computation/query, ([])=leaf (identifier), {{}}=context. Includes a color legend comment block + BehaviorTree.CPP-style color annotations (control=blue, decision=amber, computation=purple, query=cyan, leaf=gray, context=green)."
2866
+ },
2867
+ "tree_outline": {
2868
+ "type": "string",
2869
+ "description": "Indented Markdown outline of the tree (human-editable format). Bidirectional with parseGuardTreeIndented(). Includes JSON code block for round-trip safety."
2870
+ },
2871
+ "ascii_art": {
2872
+ "type": "string",
2873
+ "description": "ASCII art tree visualization using box-drawing characters (+-- --, |). Table summary appended. Terminal-friendly, avoids JSON escaping issues that affect multi-line Mermaid strings."
2874
+ },
2875
+ "markmap": {
2876
+ "type": "string",
2877
+ "description": "Markmap-compatible Markdown string (heading levels represent tree depth). Root -> branches -> leaves hierarchy. Renderable by VS Code Markmap extension or markmap.js. Provides an interactive mind-map view of the Guard tree."
2878
+ }
2879
+ },
2880
+ "required": [
2881
+ "action",
2882
+ "guardAddress",
2883
+ "guardName",
2884
+ "root",
2885
+ "table",
2886
+ "rely",
2887
+ "immutable",
2888
+ "mermaid",
2889
+ "tree_outline",
2890
+ "ascii_art",
2891
+ "markmap"
2892
+ ],
2893
+ "additionalProperties": false
2894
+ },
2895
+ {
2896
+ "type": "object",
2897
+ "properties": {
2898
+ "action": {
2899
+ "type": "string",
2900
+ "const": "plan_object_edit"
2901
+ },
2902
+ "plan_id": {
2903
+ "type": "string",
2904
+ "description": "Unique plan ID (UUID). Pass to apply_object_edit within 10 minutes to execute."
2905
+ },
2906
+ "object_kind": {
2907
+ "type": "string",
2908
+ "enum": [
2909
+ "machine",
2910
+ "guard"
2911
+ ],
2912
+ "description": "The object kind that was edited."
2913
+ },
2914
+ "object_address": {
2915
+ "type": "string",
2916
+ "description": "The on-chain object address being edited."
2917
+ },
2918
+ "object_name": {
2919
+ "type": [
2920
+ "string",
2921
+ "null"
2922
+ ],
2923
+ "description": "The object's local name (from LocalMark) if available."
2924
+ },
2925
+ "expected_hash": {
2926
+ "type": "string",
2927
+ "description": "SHA-256 hash of (current_onchain_state + edited_content). Pass to apply_object_edit as expected_hash for stale-edit detection."
2928
+ },
2929
+ "diff": {
2930
+ "type": "object",
2931
+ "properties": {
2932
+ "added": {
2933
+ "type": "array",
2934
+ "items": {
2935
+ "type": "string"
2936
+ },
2937
+ "description": "List of added items (node names, edge 'from->to', table identifiers, etc.)."
2938
+ },
2939
+ "removed": {
2940
+ "type": "array",
2941
+ "items": {
2942
+ "type": "string"
2943
+ },
2944
+ "description": "List of removed items."
2945
+ },
2946
+ "modified": {
2947
+ "type": "array",
2948
+ "items": {
2949
+ "type": "string"
2950
+ },
2951
+ "description": "List of modified items with a brief description of the change."
2952
+ },
2953
+ "summary": {
2954
+ "type": "string",
2955
+ "description": "Human-readable one-line diff summary (e.g. '2 nodes added, 1 edge removed, 3 forwards modified')."
2956
+ }
2957
+ },
2958
+ "required": [
2959
+ "added",
2960
+ "removed",
2961
+ "modified",
2962
+ "summary"
2963
+ ],
2964
+ "additionalProperties": false,
2965
+ "description": "Structured diff between current on-chain state and edited content."
2966
+ },
2967
+ "warnings": {
2968
+ "type": "array",
2969
+ "items": {
2970
+ "type": "object",
2971
+ "properties": {
2972
+ "id": {
2973
+ "type": "string",
2974
+ "description": "Warning identifier (e.g. 'W-01')."
2975
+ },
2976
+ "description": {
2977
+ "type": "string",
2978
+ "description": "What the warning is about."
2979
+ },
2980
+ "impact": {
2981
+ "type": "string",
2982
+ "description": "Potential impact if ignored."
2983
+ }
2984
+ },
2985
+ "required": [
2986
+ "id",
2987
+ "description",
2988
+ "impact"
2989
+ ],
2990
+ "additionalProperties": false
2991
+ },
2992
+ "description": "Non-blocking warnings (the edit can still proceed, but review is recommended)."
2993
+ },
2994
+ "blocking_errors": {
2995
+ "type": "array",
2996
+ "items": {
2997
+ "type": "object",
2998
+ "properties": {
2999
+ "id": {
3000
+ "type": "string",
3001
+ "description": "Error identifier (e.g. 'E-01')."
3002
+ },
3003
+ "description": {
3004
+ "type": "string",
3005
+ "description": "What the error is."
3006
+ },
3007
+ "impact": {
3008
+ "type": "string",
3009
+ "description": "Why this blocks execution."
3010
+ }
3011
+ },
3012
+ "required": [
3013
+ "id",
3014
+ "description",
3015
+ "impact"
3016
+ ],
3017
+ "additionalProperties": false
3018
+ },
3019
+ "description": "Blocking errors (the edit CANNOT proceed until these are fixed)."
3020
+ },
3021
+ "can_apply": {
3022
+ "type": "boolean",
3023
+ "description": "Whether apply_object_edit can proceed. false if blocking_errors is non-empty."
3024
+ },
3025
+ "prepared_call": {
3026
+ "anyOf": [
3027
+ {},
3028
+ {
3029
+ "type": "null"
3030
+ }
3031
+ ],
3032
+ "description": "The prepared onchain_operations call data (operation_type + data). null if can_apply=false. Pass this to onchain_operations to execute the edit."
3033
+ },
3034
+ "expires_at": {
3035
+ "type": "string",
3036
+ "description": "ISO timestamp when the plan expires (10 minutes from creation). After expiry, apply_object_edit will refuse to proceed."
3037
+ },
3038
+ "summary": {
3039
+ "type": "string",
3040
+ "description": "Human-readable one-line plan summary."
3041
+ }
3042
+ },
3043
+ "required": [
3044
+ "action",
3045
+ "plan_id",
3046
+ "object_kind",
3047
+ "object_address",
3048
+ "object_name",
3049
+ "expected_hash",
3050
+ "diff",
3051
+ "warnings",
3052
+ "blocking_errors",
3053
+ "can_apply",
3054
+ "expires_at",
3055
+ "summary"
3056
+ ],
3057
+ "additionalProperties": false
3058
+ },
3059
+ {
3060
+ "type": "object",
3061
+ "properties": {
3062
+ "action": {
3063
+ "type": "string",
3064
+ "const": "apply_object_edit"
3065
+ },
3066
+ "plan_id": {
3067
+ "type": "string",
3068
+ "description": "The plan ID that was applied."
3069
+ },
3070
+ "applied": {
3071
+ "type": "boolean",
3072
+ "description": "Whether the plan was successfully applied (hash matched and plan was fresh)."
3073
+ },
3074
+ "hash_match": {
3075
+ "type": "boolean",
3076
+ "description": "Whether the expected_hash matched the stored plan hash. false = stale edit detected."
3077
+ },
3078
+ "prepared_call": {
3079
+ "anyOf": [
3080
+ {},
3081
+ {
3082
+ "type": "null"
3083
+ }
3084
+ ],
3085
+ "description": "The prepared onchain_operations call data. Pass this to onchain_operations to execute the edit on-chain. null if applied=false."
3086
+ },
3087
+ "error": {
3088
+ "type": [
3089
+ "string",
3090
+ "null"
3091
+ ],
3092
+ "description": "Error message if applied=false (e.g. 'Plan not found', 'Hash mismatch — on-chain state changed', 'Plan expired'). null on success."
3093
+ },
3094
+ "next_step": {
3095
+ "type": "string",
3096
+ "description": "Instructions for the next step (typically 'Pass prepared_call to onchain_operations to execute the edit on-chain')."
3097
+ }
3098
+ },
3099
+ "required": [
3100
+ "action",
3101
+ "plan_id",
3102
+ "applied",
3103
+ "hash_match",
3104
+ "error",
3105
+ "next_step"
3106
+ ],
3107
+ "additionalProperties": false
3108
+ },
3109
+ {
3110
+ "type": "object",
3111
+ "properties": {
3112
+ "action": {
3113
+ "type": "string",
3114
+ "const": "patch_machine_nodes"
3115
+ },
3116
+ "machine_address": {
3117
+ "type": "string",
3118
+ "description": "The Machine object address being patched."
3119
+ },
3120
+ "machine_name": {
3121
+ "type": [
3122
+ "string",
3123
+ "null"
3124
+ ],
3125
+ "description": "The Machine's local name (from LocalMark) if available."
3126
+ },
3127
+ "operations_applied": {
3128
+ "type": "number",
3129
+ "description": "Number of patch operations successfully applied."
3130
+ },
3131
+ "operations_failed": {
3132
+ "type": "array",
3133
+ "items": {
3134
+ "type": "object",
3135
+ "properties": {
3136
+ "operation": {
3137
+ "type": "string",
3138
+ "description": "The original operation string."
3139
+ },
3140
+ "error": {
3141
+ "type": "string",
3142
+ "description": "Why the operation failed."
3143
+ }
3144
+ },
3145
+ "required": [
3146
+ "operation",
3147
+ "error"
3148
+ ],
3149
+ "additionalProperties": false
3150
+ },
3151
+ "description": "Operations that failed parse/apply (not applied). Also surfaced as E-OP entries in blocking_errors for schema symmetry with plan_object_edit."
3152
+ },
3153
+ "patched_nodes": {
3154
+ "type": "array",
3155
+ "items": {},
3156
+ "description": "The patched Machine nodes (after applying all successful operations)."
3157
+ },
3158
+ "patched_edges": {
3159
+ "type": "array",
3160
+ "items": {},
3161
+ "description": "The patched Machine edges (after applying all successful operations)."
3162
+ },
3163
+ "diff": {
3164
+ "type": "object",
3165
+ "properties": {
3166
+ "added": {
3167
+ "type": "array",
3168
+ "items": {
3169
+ "type": "string"
3170
+ },
3171
+ "description": "List of added items."
3172
+ },
3173
+ "removed": {
3174
+ "type": "array",
3175
+ "items": {
3176
+ "type": "string"
3177
+ },
3178
+ "description": "List of removed items."
3179
+ },
3180
+ "modified": {
3181
+ "type": "array",
3182
+ "items": {
3183
+ "type": "string"
3184
+ },
3185
+ "description": "List of modified items."
3186
+ },
3187
+ "summary": {
3188
+ "type": "string",
3189
+ "description": "Human-readable one-line diff summary."
3190
+ }
3191
+ },
3192
+ "required": [
3193
+ "added",
3194
+ "removed",
3195
+ "modified",
3196
+ "summary"
3197
+ ],
3198
+ "additionalProperties": false,
3199
+ "description": "Diff between original and patched Machine."
3200
+ },
3201
+ "warnings": {
3202
+ "type": "array",
3203
+ "items": {
3204
+ "type": "object",
3205
+ "properties": {
3206
+ "id": {
3207
+ "type": "string",
3208
+ "description": "Warning identifier (e.g. 'W-01' unreachable node, 'W-02' self-loop)."
3209
+ },
3210
+ "description": {
3211
+ "type": "string",
3212
+ "description": "What the warning is about."
3213
+ },
3214
+ "impact": {
3215
+ "type": "string",
3216
+ "description": "Potential impact if ignored."
3217
+ }
3218
+ },
3219
+ "required": [
3220
+ "id",
3221
+ "description",
3222
+ "impact"
3223
+ ],
3224
+ "additionalProperties": false
3225
+ },
3226
+ "description": "Non-blocking warnings from validateMachine (W-01 unreachable, W-02 self-loop)."
3227
+ },
3228
+ "blocking_errors": {
3229
+ "type": "array",
3230
+ "items": {
3231
+ "type": "object",
3232
+ "properties": {
3233
+ "id": {
3234
+ "type": "string",
3235
+ "description": "Error identifier (e.g. 'E-01' no entry forward, 'E-02' orphan endpoint, 'E-03' too many nodes, 'E-OP' operation failed)."
3236
+ },
3237
+ "description": {
3238
+ "type": "string",
3239
+ "description": "What the error is."
3240
+ },
3241
+ "impact": {
3242
+ "type": "string",
3243
+ "description": "Why this blocks execution."
3244
+ }
3245
+ },
3246
+ "required": [
3247
+ "id",
3248
+ "description",
3249
+ "impact"
3250
+ ],
3251
+ "additionalProperties": false
3252
+ },
3253
+ "description": "Blocking errors (operation failures + structural validation). The patch CANNOT proceed until these are fixed. Empty array when can_apply=true."
3254
+ },
3255
+ "can_apply": {
3256
+ "type": "boolean",
3257
+ "description": "Whether the patch can be applied on-chain. false if any blocking_errors exist (operation failures or validateMachine blocking errors)."
3258
+ },
3259
+ "prepared_call": {
3260
+ "anyOf": [
3261
+ {},
3262
+ {
3263
+ "type": "null"
3264
+ }
3265
+ ],
3266
+ "description": "The prepared onchain_operations call data. null if can_apply=false."
3267
+ },
3268
+ "summary": {
3269
+ "type": "string",
3270
+ "description": "Human-readable one-line patch summary."
3271
+ }
3272
+ },
3273
+ "required": [
3274
+ "action",
3275
+ "machine_address",
3276
+ "machine_name",
3277
+ "operations_applied",
3278
+ "operations_failed",
3279
+ "patched_nodes",
3280
+ "patched_edges",
3281
+ "diff",
3282
+ "warnings",
3283
+ "blocking_errors",
3284
+ "can_apply",
3285
+ "summary"
3286
+ ],
3287
+ "additionalProperties": false
3288
+ },
3289
+ {
3290
+ "type": "object",
3291
+ "properties": {
3292
+ "action": {
3293
+ "type": "string",
3294
+ "const": "patch_guard_tree"
3295
+ },
3296
+ "guard_address": {
3297
+ "type": "string",
3298
+ "description": "The Guard object address being patched."
3299
+ },
3300
+ "guard_name": {
3301
+ "type": [
3302
+ "string",
3303
+ "null"
3304
+ ],
3305
+ "description": "The Guard's local name (from LocalMark) if available."
3306
+ },
3307
+ "operations_applied": {
3308
+ "type": "number",
3309
+ "description": "Number of Guard patch operations successfully applied."
3310
+ },
3311
+ "operations_failed": {
3312
+ "type": "array",
3313
+ "items": {
3314
+ "type": "object",
3315
+ "properties": {
3316
+ "operation": {
3317
+ "type": "string",
3318
+ "description": "The original operation string."
3319
+ },
3320
+ "error": {
3321
+ "type": "string",
3322
+ "description": "Why the operation failed."
3323
+ }
3324
+ },
3325
+ "required": [
3326
+ "operation",
3327
+ "error"
3328
+ ],
3329
+ "additionalProperties": false
3330
+ },
3331
+ "description": "Operations that failed parse/apply (not applied). Also surfaced as E-OP entries in blocking_errors."
3332
+ },
3333
+ "patched_root": {
3334
+ "description": "The patched Guard root node (after applying all successful operations). For set_root, this is the new root; otherwise the original root unchanged."
3335
+ },
3336
+ "patched_table": {
3337
+ "type": "array",
3338
+ "items": {},
3339
+ "description": "The patched Guard table entries (after applying all successful table operations)."
3340
+ },
3341
+ "patched_rely": {
3342
+ "anyOf": [
3343
+ {},
3344
+ {
3345
+ "type": "null"
3346
+ }
3347
+ ],
3348
+ "description": "The patched rely field (cross-guard composition). null if rely was cleared or never set. Shape: { guards: string[], logic_or?: boolean }."
3349
+ },
3350
+ "diff": {
3351
+ "type": "object",
3352
+ "properties": {
3353
+ "added": {
3354
+ "type": "array",
3355
+ "items": {
3356
+ "type": "string"
3357
+ },
3358
+ "description": "List of added items (table entries, tree nodes)."
3359
+ },
3360
+ "removed": {
3361
+ "type": "array",
3362
+ "items": {
3363
+ "type": "string"
3364
+ },
3365
+ "description": "List of removed items."
3366
+ },
3367
+ "modified": {
3368
+ "type": "array",
3369
+ "items": {
3370
+ "type": "string"
3371
+ },
3372
+ "description": "List of modified items with a brief description of the change."
3373
+ },
3374
+ "summary": {
3375
+ "type": "string",
3376
+ "description": "Human-readable one-line diff summary."
3377
+ }
3378
+ },
3379
+ "required": [
3380
+ "added",
3381
+ "removed",
3382
+ "modified",
3383
+ "summary"
3384
+ ],
3385
+ "additionalProperties": false,
3386
+ "description": "Diff between original and patched Guard (root tree + table)."
3387
+ },
3388
+ "warnings": {
3389
+ "type": "array",
3390
+ "items": {
3391
+ "type": "object",
3392
+ "properties": {
3393
+ "id": {
3394
+ "type": "string",
3395
+ "description": "Warning identifier (e.g. 'W-01' dead submission slot, 'W-02' orphan table entry, 'W-03' deep nesting)."
3396
+ },
3397
+ "description": {
3398
+ "type": "string",
3399
+ "description": "What the warning is about."
3400
+ },
3401
+ "impact": {
3402
+ "type": "string",
3403
+ "description": "Potential impact if ignored."
3404
+ }
3405
+ },
3406
+ "required": [
3407
+ "id",
3408
+ "description",
3409
+ "impact"
3410
+ ],
3411
+ "additionalProperties": false
3412
+ },
3413
+ "description": "Non-blocking warnings from validateGuard (W-01 dead submission slot, W-02 orphan table entry, W-03 deep nesting > 16)."
3414
+ },
3415
+ "blocking_errors": {
3416
+ "type": "array",
3417
+ "items": {
3418
+ "type": "object",
3419
+ "properties": {
3420
+ "id": {
3421
+ "type": "string",
3422
+ "description": "Error identifier (e.g. 'E-01' no root, 'E-02' identifier not in table, 'E-03' table too large, 'E-OP' operation failed)."
3423
+ },
3424
+ "description": {
3425
+ "type": "string",
3426
+ "description": "What the error is."
3427
+ },
3428
+ "impact": {
3429
+ "type": "string",
3430
+ "description": "Why this blocks execution."
3431
+ }
3432
+ },
3433
+ "required": [
3434
+ "id",
3435
+ "description",
3436
+ "impact"
3437
+ ],
3438
+ "additionalProperties": false
3439
+ },
3440
+ "description": "Blocking errors (operation failures + structural validation). The patch CANNOT proceed until these are fixed. Empty array when can_apply=true."
3441
+ },
3442
+ "can_apply": {
3443
+ "type": "boolean",
3444
+ "description": "Whether the patch can be applied on-chain. false if any blocking_errors exist."
3445
+ },
3446
+ "prepared_call": {
3447
+ "anyOf": [
3448
+ {},
3449
+ {
3450
+ "type": "null"
3451
+ }
3452
+ ],
3453
+ "description": "The prepared onchain_operations call data (operation_type='guard'). null if can_apply=false."
3454
+ },
3455
+ "summary": {
3456
+ "type": "string",
3457
+ "description": "Human-readable one-line patch summary."
3458
+ }
3459
+ },
3460
+ "required": [
3461
+ "action",
3462
+ "guard_address",
3463
+ "guard_name",
3464
+ "operations_applied",
3465
+ "operations_failed",
3466
+ "patched_table",
3467
+ "diff",
3468
+ "warnings",
3469
+ "blocking_errors",
3470
+ "can_apply",
3471
+ "summary"
3472
+ ],
3473
+ "additionalProperties": false
3474
+ },
3475
+ {
3476
+ "type": "object",
3477
+ "properties": {
3478
+ "action": {
3479
+ "type": "string",
3480
+ "const": "clone_project_to_network"
3481
+ },
3482
+ "new_project_id": {
3483
+ "type": "string",
3484
+ "description": "The newly created project's UUID."
3485
+ },
3486
+ "new_prefix": {
3487
+ "type": "string",
3488
+ "description": "New project prefix ('<source_prefix>_<target_network>')."
3489
+ },
3490
+ "target_network": {
3491
+ "type": "string",
3492
+ "enum": [
3493
+ "testnet",
3494
+ "mainnet"
3495
+ ],
3496
+ "description": "The target network the new project is bound to."
3497
+ },
3498
+ "cloned_objects_count": {
3499
+ "type": "number",
3500
+ "description": "Number of object metadata entries copied (objectAddress is empty — await on-chain deployment)."
3501
+ },
3502
+ "message": {
3503
+ "type": "string",
3504
+ "description": "Human-readable summary of the clone operation."
3505
+ },
3506
+ "next_steps": {
3507
+ "type": "string",
3508
+ "description": "Instructions for deploying the cloned objects on the target network."
3509
+ }
3510
+ },
3511
+ "required": [
3512
+ "action",
3513
+ "new_project_id",
3514
+ "new_prefix",
3515
+ "target_network",
3516
+ "cloned_objects_count",
3517
+ "message",
3518
+ "next_steps"
3519
+ ],
3520
+ "additionalProperties": false
3521
+ },
3522
+ {
3523
+ "type": "object",
3524
+ "properties": {
3525
+ "action": {
3526
+ "type": "string",
3527
+ "const": "migrate_network"
3528
+ },
3529
+ "new_project_id": {
3530
+ "type": "string",
3531
+ "description": "The newly created project's UUID."
3532
+ },
3533
+ "new_prefix": {
3534
+ "type": "string",
3535
+ "description": "New project prefix ('<source_prefix>_<target_network>')."
3536
+ },
3537
+ "target_network": {
3538
+ "type": "string",
3539
+ "enum": [
3540
+ "testnet",
3541
+ "mainnet"
3542
+ ],
3543
+ "description": "The target network the new project is bound to."
3544
+ },
3545
+ "cloned_objects_count": {
3546
+ "type": "number",
3547
+ "description": "Number of object metadata entries copied (objectAddress is empty — await on-chain deployment)."
3548
+ },
3549
+ "message": {
3550
+ "type": "string",
3551
+ "description": "Human-readable summary of the migration operation."
3552
+ },
3553
+ "next_steps": {
3554
+ "type": "string",
3555
+ "description": "Instructions for deploying the migrated objects on the target network."
3556
+ }
3557
+ },
3558
+ "required": [
3559
+ "action",
3560
+ "new_project_id",
3561
+ "new_prefix",
3562
+ "target_network",
3563
+ "cloned_objects_count",
3564
+ "message",
3565
+ "next_steps"
3566
+ ],
3567
+ "additionalProperties": false
3568
+ },
3569
+ {
3570
+ "type": "object",
3571
+ "properties": {
3572
+ "action": {
3573
+ "type": "string",
3574
+ "const": "migrate_to_mainnet"
3575
+ },
3576
+ "migration_status": {
3577
+ "type": "string",
3578
+ "description": "Overall migration status (e.g. 'step_1_complete_steps_2_5_pending_user_action')."
3579
+ },
3580
+ "source_project": {
3581
+ "type": "object",
3582
+ "properties": {
3583
+ "prefix": {
3584
+ "type": "string"
3585
+ },
3586
+ "network": {
3587
+ "type": "string"
3588
+ },
3589
+ "preserved": {
3590
+ "type": "boolean",
3591
+ "description": "Whether the source project is preserved unchanged (always true)."
3592
+ }
3593
+ },
3594
+ "required": [
3595
+ "prefix",
3596
+ "network",
3597
+ "preserved"
3598
+ ],
3599
+ "additionalProperties": false
3600
+ },
3601
+ "target_project": {
3602
+ "type": "object",
3603
+ "properties": {
3604
+ "prefix": {
3605
+ "type": "string"
3606
+ },
3607
+ "project_id": {
3608
+ "type": "string"
3609
+ },
3610
+ "network": {
3611
+ "type": "string"
3612
+ },
3613
+ "cloned_objects_count": {
3614
+ "type": "number"
3615
+ }
3616
+ },
3617
+ "required": [
3618
+ "prefix",
3619
+ "project_id",
3620
+ "network",
3621
+ "cloned_objects_count"
3622
+ ],
3623
+ "additionalProperties": false
3624
+ },
3625
+ "key_principle": {
3626
+ "type": "string",
3627
+ "description": "Explains that testnet/mainnet are different projects with different addresses for same names."
3628
+ },
3629
+ "migration_plan": {
3630
+ "type": "array",
3631
+ "items": {
3632
+ "type": "object",
3633
+ "properties": {
3634
+ "step": {
3635
+ "type": "number",
3636
+ "description": "Step number (1-5)."
3637
+ },
3638
+ "status": {
3639
+ "type": "string",
3640
+ "enum": [
3641
+ "completed",
3642
+ "pending_user_action"
3643
+ ],
3644
+ "description": "Whether this step is done or awaits user action."
3645
+ },
3646
+ "action": {
3647
+ "type": "string",
3648
+ "description": "The action to perform (e.g. 'clone_project_to_network', 'onchain_operations', 'local_mark_operation', 'update_project', 'build_graph')."
3649
+ },
3650
+ "description": {
3651
+ "type": "string",
3652
+ "description": "Human-readable description of what this step does."
3653
+ },
3654
+ "result": {
3655
+ "type": "string",
3656
+ "description": "Result of this step (only present when status='completed')."
3657
+ },
3658
+ "deployment_plan": {
3659
+ "type": "array",
3660
+ "items": {
3661
+ "type": "object",
3662
+ "properties": {
3663
+ "order": {
3664
+ "type": "number"
3665
+ },
3666
+ "object_type": {
3667
+ "type": "string"
3668
+ },
3669
+ "object_name": {
3670
+ "type": "string"
3671
+ },
3672
+ "operation_type": {
3673
+ "type": "string"
3674
+ },
3675
+ "localmark_name": {
3676
+ "type": "string"
3677
+ },
3678
+ "note": {
3679
+ "type": "string"
3680
+ }
3681
+ },
3682
+ "required": [
3683
+ "order",
3684
+ "object_type",
3685
+ "object_name",
3686
+ "operation_type",
3687
+ "localmark_name",
3688
+ "note"
3689
+ ],
3690
+ "additionalProperties": false
3691
+ },
3692
+ "description": "Deployment plan for step 2 (on-chain deployment). Only present for step 2."
3693
+ },
3694
+ "names_to_register": {
3695
+ "type": "array",
3696
+ "items": {
3697
+ "type": "string"
3698
+ },
3699
+ "description": "LocalMark names to re-register on mainnet. Only present for step 3."
3700
+ },
3701
+ "critical_note": {
3702
+ "type": "string",
3703
+ "description": "Critical note for this step."
3704
+ }
3705
+ },
3706
+ "required": [
3707
+ "step",
3708
+ "status",
3709
+ "action",
3710
+ "description"
3711
+ ],
3712
+ "additionalProperties": false
3713
+ },
3714
+ "description": "5-step migration plan. Step 1 is completed; steps 2-5 require user action."
3715
+ },
3716
+ "summary": {
3717
+ "type": "string",
3718
+ "description": "Human-readable summary of the migration."
3719
+ }
3720
+ },
3721
+ "required": [
3722
+ "action",
3723
+ "migration_status",
3724
+ "source_project",
3725
+ "target_project",
3726
+ "key_principle",
3727
+ "migration_plan",
3728
+ "summary"
1562
3729
  ],
1563
3730
  "additionalProperties": false
1564
3731
  }
1565
3732
  ],
1566
3733
  "description": "Query result — shape depends on action"
3734
+ },
3735
+ "skills_recommended": {
3736
+ "type": "string",
3737
+ "description": "Skills recommendation hint (F-10). Informational only — MCP executes independently of skills. Present when the action benefits from skills' business-semantic guidance (e.g. service/machine/guard/evaluation). Users without skills installed can ignore this field."
1567
3738
  }
1568
3739
  },
1569
3740
  "required": [