@wowok/agent-mcp 2.7.1 → 2.7.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 (597) hide show
  1. package/dist/config/index.js +1 -1
  2. package/dist/config/runtime.js +1 -238
  3. package/dist/customer/account-events.d.ts +32 -0
  4. package/dist/customer/account-events.js +1 -0
  5. package/dist/customer/customer-advice.d.ts +1 -0
  6. package/dist/customer/customer-advice.js +1 -130
  7. package/dist/customer/index.js +1 -11
  8. package/dist/customer/industry-risks.js +1 -438
  9. package/dist/customer/info-puzzle.js +1 -681
  10. package/dist/customer/order-monitor.js +1 -328
  11. package/dist/customer/order-strategy.d.ts +1 -1
  12. package/dist/customer/order-strategy.js +1 -373
  13. package/dist/customer/post-purchase.js +1 -351
  14. package/dist/customer/preorder-compare.js +1 -34
  15. package/dist/customer/reminder-system.d.ts +2 -0
  16. package/dist/customer/reminder-system.js +1 -316
  17. package/dist/customer/risk-assessment.d.ts +1 -0
  18. package/dist/customer/risk-assessment.js +1 -397
  19. package/dist/customer/types.d.ts +2 -0
  20. package/dist/customer/types.js +1 -13
  21. package/dist/customer/user-preferences.js +1 -460
  22. package/dist/evaluation/arbitration-game.d.ts +9 -2
  23. package/dist/evaluation/arbitration-game.js +1 -48
  24. package/dist/evaluation/builtins/arbitration-score.d.ts +41 -0
  25. package/dist/evaluation/builtins/arbitration-score.js +1 -0
  26. package/dist/evaluation/builtins/demand-match.js +1 -153
  27. package/dist/evaluation/builtins/index.d.ts +1 -0
  28. package/dist/evaluation/builtins/index.js +1 -10
  29. package/dist/evaluation/builtins/service-risk.js +1 -55
  30. package/dist/evaluation/capability.js +1 -13
  31. package/dist/evaluation/category-match-rules.d.ts +30 -0
  32. package/dist/evaluation/category-match-rules.js +1 -0
  33. package/dist/evaluation/composer.js +1 -40
  34. package/dist/evaluation/engine.js +1 -175
  35. package/dist/evaluation/extract.js +1 -115
  36. package/dist/evaluation/game-strategy.d.ts +27 -0
  37. package/dist/evaluation/game-strategy.js +1 -0
  38. package/dist/evaluation/gap.js +1 -100
  39. package/dist/evaluation/index.d.ts +2 -0
  40. package/dist/evaluation/index.js +1 -11
  41. package/dist/evaluation/location-match.d.ts +42 -0
  42. package/dist/evaluation/location-match.js +1 -0
  43. package/dist/evaluation/node-game.d.ts +31 -3
  44. package/dist/evaluation/node-game.js +1 -57
  45. package/dist/evaluation/path-reasoning.d.ts +35 -0
  46. package/dist/evaluation/path-reasoning.js +1 -0
  47. package/dist/evaluation/region.d.ts +6 -0
  48. package/dist/evaluation/region.js +1 -36
  49. package/dist/evaluation/types.d.ts +18 -0
  50. package/dist/evaluation/types.js +1 -1
  51. package/dist/evaluation/user-injection.js +1 -27
  52. package/dist/experience/experience-reuse.js +1 -103
  53. package/dist/experience/index.js +1 -5
  54. package/dist/experience/intent-distill.js +1 -83
  55. package/dist/experience/realtime-feedback.js +1 -94
  56. package/dist/experience/types.js +1 -1
  57. package/dist/experience/user-profile.d.ts +1 -1
  58. package/dist/experience/user-profile.js +1 -171
  59. package/dist/extensions/business-modules.js +1 -287
  60. package/dist/extensions/capability-manifest.js +1 -781
  61. package/dist/extensions/constraint-registry.js +1 -198
  62. package/dist/extensions/index.d.ts +6 -0
  63. package/dist/extensions/index.js +1 -6
  64. package/dist/extensions/industry-layers.d.ts +75 -0
  65. package/dist/extensions/industry-layers.js +1 -0
  66. package/dist/extensions/industry-pack.d.ts +105 -0
  67. package/dist/extensions/industry-pack.js +1 -0
  68. package/dist/extensions/metric-registry.js +1 -257
  69. package/dist/extensions/mode-evaluator.d.ts +1 -1
  70. package/dist/extensions/mode-evaluator.js +1 -170
  71. package/dist/extensions/modes.js +1 -499
  72. package/dist/extensions/registry.d.ts +1 -0
  73. package/dist/extensions/registry.js +1 -717
  74. package/dist/extensions/types.js +1 -1
  75. package/dist/graph/base.d.ts +8 -0
  76. package/dist/graph/base.js +1 -0
  77. package/dist/harness/auto-escalation.js +1 -68
  78. package/dist/harness/checkpoint.js +1 -129
  79. package/dist/harness/index.d.ts +1 -0
  80. package/dist/harness/index.js +1 -78
  81. package/dist/harness/plan.d.ts +2 -0
  82. package/dist/harness/plan.js +1 -315
  83. package/dist/harness/recover.d.ts +1 -1
  84. package/dist/harness/recover.js +1 -139
  85. package/dist/harness/types.d.ts +2 -3
  86. package/dist/harness/types.js +1 -1
  87. package/dist/harness/verify.js +1 -237
  88. package/dist/index.js +1 -273
  89. package/dist/intent/enrich.js +1 -67
  90. package/dist/intent/index.js +1 -60
  91. package/dist/intent/matcher.js +1 -81
  92. package/dist/intent/store.js +1 -55
  93. package/dist/intent/types.js +1 -10
  94. package/dist/knowledge/acquisition-flywheel.js +1 -192
  95. package/dist/knowledge/allocation-confirm.js +1 -534
  96. package/dist/knowledge/allocation-context.js +1 -249
  97. package/dist/knowledge/allocation-ledger.js +1 -463
  98. package/dist/knowledge/allocation-puzzle.js +1 -298
  99. package/dist/knowledge/allocation-risk.js +1 -568
  100. package/dist/knowledge/allocation-templates.js +1 -970
  101. package/dist/knowledge/allocation-translation.js +1 -585
  102. package/dist/knowledge/anti-cheat.d.ts +37 -0
  103. package/dist/knowledge/anti-cheat.js +1 -0
  104. package/dist/knowledge/arb-confirm.d.ts +28 -0
  105. package/dist/knowledge/arb-confirm.js +1 -0
  106. package/dist/knowledge/arb-risk.js +1 -210
  107. package/dist/knowledge/arb-translation.d.ts +48 -0
  108. package/dist/knowledge/arb-translation.js +1 -0
  109. package/dist/knowledge/arbitration-confirm.js +1 -559
  110. package/dist/knowledge/arbitration-context.js +1 -505
  111. package/dist/knowledge/arbitration-ledger.js +1 -521
  112. package/dist/knowledge/arbitration-puzzle.js +1 -304
  113. package/dist/knowledge/arbitration-risk.js +1 -423
  114. package/dist/knowledge/arbitration-templates.js +1 -276
  115. package/dist/knowledge/arbitration-translation.js +1 -487
  116. package/dist/knowledge/audit-rules.js +1 -141
  117. package/dist/knowledge/bridge-confirm.d.ts +26 -0
  118. package/dist/knowledge/bridge-confirm.js +1 -0
  119. package/dist/knowledge/bridge-risk.js +1 -263
  120. package/dist/knowledge/bridge-translation.d.ts +37 -0
  121. package/dist/knowledge/bridge-translation.js +1 -0
  122. package/dist/knowledge/contact-confirm.d.ts +27 -0
  123. package/dist/knowledge/contact-confirm.js +1 -0
  124. package/dist/knowledge/contact-risk.js +1 -200
  125. package/dist/knowledge/contact-templates.js +1 -60
  126. package/dist/knowledge/contact-translation.d.ts +39 -0
  127. package/dist/knowledge/contact-translation.js +1 -0
  128. package/dist/knowledge/demand-confirm.js +1 -206
  129. package/dist/knowledge/demand-context.d.ts +17 -0
  130. package/dist/knowledge/demand-context.js +1 -0
  131. package/dist/knowledge/demand-ledger.d.ts +26 -0
  132. package/dist/knowledge/demand-ledger.js +1 -0
  133. package/dist/knowledge/demand-matching.js +1 -132
  134. package/dist/knowledge/demand-puzzle.d.ts +29 -0
  135. package/dist/knowledge/demand-puzzle.js +1 -0
  136. package/dist/knowledge/demand-risk.js +1 -240
  137. package/dist/knowledge/demand-templates.d.ts +12 -0
  138. package/dist/knowledge/demand-templates.js +1 -0
  139. package/dist/knowledge/demand-translation.js +1 -354
  140. package/dist/knowledge/deployment-scanner.js +1 -823
  141. package/dist/knowledge/dynamic-pricing.js +1 -87
  142. package/dist/knowledge/evidence-review.d.ts +12 -0
  143. package/dist/knowledge/evidence-review.js +1 -0
  144. package/dist/knowledge/examples-scanner-cli.js +1 -26
  145. package/dist/knowledge/examples-scanner.js +1 -843
  146. package/dist/knowledge/flywheel-loop.d.ts +0 -1
  147. package/dist/knowledge/flywheel-loop.js +1 -404
  148. package/dist/knowledge/fund-layer.js +1 -973
  149. package/dist/knowledge/glossary.js +1 -211
  150. package/dist/knowledge/guard-confirm.js +1 -406
  151. package/dist/knowledge/guard-context.js +1 -287
  152. package/dist/knowledge/guard-design-patterns.js +1 -360
  153. package/dist/knowledge/guard-ledger.js +1 -260
  154. package/dist/knowledge/guard-lint.js +1 -670
  155. package/dist/knowledge/guard-migration.d.ts +1 -1
  156. package/dist/knowledge/guard-migration.js +1 -228
  157. package/dist/knowledge/guard-puzzle.js +1 -805
  158. package/dist/knowledge/guard-render.js +1 -700
  159. package/dist/knowledge/guard-risk.js +1 -1879
  160. package/dist/knowledge/guard-submission-prompt.js +1 -171
  161. package/dist/knowledge/guard-templates.js +1 -1105
  162. package/dist/knowledge/guard-translation.js +1 -1119
  163. package/dist/knowledge/index.d.ts +71 -3
  164. package/dist/knowledge/index.js +1 -436
  165. package/dist/knowledge/industry-evolution.js +1 -323
  166. package/dist/knowledge/industry-generalizer.js +1 -381
  167. package/dist/knowledge/industry-registry.js +1 -174
  168. package/dist/knowledge/intent-metrics.d.ts +4 -3
  169. package/dist/knowledge/intent-metrics.js +1 -566
  170. package/dist/knowledge/machine-confirm.js +1 -559
  171. package/dist/knowledge/machine-context.js +1 -833
  172. package/dist/knowledge/machine-ledger.js +1 -338
  173. package/dist/knowledge/machine-puzzle.js +1 -494
  174. package/dist/knowledge/machine-render.js +1 -565
  175. package/dist/knowledge/machine-risk.js +1 -669
  176. package/dist/knowledge/machine-templates.js +1 -1597
  177. package/dist/knowledge/machine-topology.js +1 -234
  178. package/dist/knowledge/machine-translation.js +1 -513
  179. package/dist/knowledge/market-metrics.d.ts +12 -0
  180. package/dist/knowledge/market-metrics.js +1 -0
  181. package/dist/knowledge/market-operations.d.ts +46 -0
  182. package/dist/knowledge/market-operations.js +1 -0
  183. package/dist/knowledge/mcp-schema-audit-cli.js +1 -45
  184. package/dist/knowledge/mcp-schema-audit.d.ts +22 -22
  185. package/dist/knowledge/mcp-schema-audit.js +1 -777
  186. package/dist/knowledge/onchain-constants.js +1 -35
  187. package/dist/knowledge/order-confirm.js +1 -573
  188. package/dist/knowledge/order-context.js +1 -390
  189. package/dist/knowledge/order-ledger.js +1 -341
  190. package/dist/knowledge/order-puzzle.js +1 -255
  191. package/dist/knowledge/order-risk.js +1 -653
  192. package/dist/knowledge/order-templates.js +1 -368
  193. package/dist/knowledge/order-translation.js +1 -550
  194. package/dist/knowledge/overrides-loader.js +1 -65
  195. package/dist/knowledge/passport-confirm.js +1 -531
  196. package/dist/knowledge/passport-context.js +1 -306
  197. package/dist/knowledge/passport-ledger.js +1 -282
  198. package/dist/knowledge/passport-puzzle.js +1 -333
  199. package/dist/knowledge/passport-risk.js +1 -450
  200. package/dist/knowledge/passport-templates.js +1 -568
  201. package/dist/knowledge/passport-translation.js +1 -516
  202. package/dist/knowledge/payment-confirm.d.ts +26 -0
  203. package/dist/knowledge/payment-confirm.js +1 -0
  204. package/dist/knowledge/payment-risk.js +1 -249
  205. package/dist/knowledge/payment-translation.d.ts +37 -0
  206. package/dist/knowledge/payment-translation.js +1 -0
  207. package/dist/knowledge/permission-confirm.js +1 -426
  208. package/dist/knowledge/permission-context.js +1 -224
  209. package/dist/knowledge/permission-ledger.d.ts +11 -0
  210. package/dist/knowledge/permission-ledger.js +1 -403
  211. package/dist/knowledge/permission-puzzle.js +1 -173
  212. package/dist/knowledge/permission-risk.js +1 -411
  213. package/dist/knowledge/permission-templates.js +1 -234
  214. package/dist/knowledge/permission-translation.js +1 -350
  215. package/dist/knowledge/personal-confirm.d.ts +29 -0
  216. package/dist/knowledge/personal-confirm.js +1 -0
  217. package/dist/knowledge/personal-risk.js +1 -212
  218. package/dist/knowledge/personal-translation.d.ts +37 -0
  219. package/dist/knowledge/personal-translation.js +1 -0
  220. package/dist/knowledge/process-model.d.ts +1 -11
  221. package/dist/knowledge/process-model.js +1 -160
  222. package/dist/knowledge/progress-confirm.js +1 -456
  223. package/dist/knowledge/progress-context.js +1 -452
  224. package/dist/knowledge/progress-ledger.js +1 -330
  225. package/dist/knowledge/progress-puzzle.js +1 -219
  226. package/dist/knowledge/progress-risk.js +1 -461
  227. package/dist/knowledge/progress-templates.js +1 -228
  228. package/dist/knowledge/progress-translation.js +1 -405
  229. package/dist/knowledge/proof-confirm.js +1 -187
  230. package/dist/knowledge/proof-context.d.ts +17 -0
  231. package/dist/knowledge/proof-context.js +1 -0
  232. package/dist/knowledge/proof-ledger.d.ts +34 -0
  233. package/dist/knowledge/proof-ledger.js +1 -0
  234. package/dist/knowledge/proof-puzzle.d.ts +35 -0
  235. package/dist/knowledge/proof-puzzle.js +1 -0
  236. package/dist/knowledge/proof-risk.js +1 -207
  237. package/dist/knowledge/proof-templates.d.ts +22 -0
  238. package/dist/knowledge/proof-templates.js +1 -0
  239. package/dist/knowledge/proof-translation.js +1 -283
  240. package/dist/knowledge/registrar-confirm.d.ts +26 -0
  241. package/dist/knowledge/registrar-confirm.js +1 -0
  242. package/dist/knowledge/registrar-risk.js +1 -217
  243. package/dist/knowledge/registrar-translation.d.ts +37 -0
  244. package/dist/knowledge/registrar-translation.js +1 -0
  245. package/dist/knowledge/repository-confirm.js +1 -286
  246. package/dist/knowledge/repository-context.d.ts +12 -0
  247. package/dist/knowledge/repository-context.js +1 -0
  248. package/dist/knowledge/repository-ledger.d.ts +25 -0
  249. package/dist/knowledge/repository-ledger.js +1 -0
  250. package/dist/knowledge/repository-puzzle.d.ts +30 -0
  251. package/dist/knowledge/repository-puzzle.js +1 -0
  252. package/dist/knowledge/repository-risk.js +1 -373
  253. package/dist/knowledge/repository-templates.d.ts +14 -0
  254. package/dist/knowledge/repository-templates.js +1 -0
  255. package/dist/knowledge/repository-translation.js +1 -445
  256. package/dist/knowledge/reputation-rules.js +1 -99
  257. package/dist/knowledge/resource-confirm.d.ts +25 -0
  258. package/dist/knowledge/resource-confirm.js +1 -0
  259. package/dist/knowledge/resource-risk.js +1 -157
  260. package/dist/knowledge/resource-translation.d.ts +37 -0
  261. package/dist/knowledge/resource-translation.js +1 -0
  262. package/dist/knowledge/reward-confirm.js +1 -526
  263. package/dist/knowledge/reward-context.d.ts +2 -2
  264. package/dist/knowledge/reward-context.js +1 -504
  265. package/dist/knowledge/reward-ledger.js +1 -502
  266. package/dist/knowledge/reward-puzzle.js +1 -300
  267. package/dist/knowledge/reward-risk.js +1 -627
  268. package/dist/knowledge/reward-templates.js +1 -197
  269. package/dist/knowledge/reward-translation.js +1 -501
  270. package/dist/knowledge/safety-rules.d.ts +1 -0
  271. package/dist/knowledge/safety-rules.js +1 -404
  272. package/dist/knowledge/scenario-modes.js +1 -321
  273. package/dist/knowledge/service-confirm.js +1 -807
  274. package/dist/knowledge/service-context.js +1 -403
  275. package/dist/knowledge/service-ledger.js +1 -609
  276. package/dist/knowledge/service-puzzle.js +1 -236
  277. package/dist/knowledge/service-risk.d.ts +1 -1
  278. package/dist/knowledge/service-risk.js +1 -651
  279. package/dist/knowledge/service-templates.js +1 -456
  280. package/dist/knowledge/service-translation.js +1 -622
  281. package/dist/knowledge/template-registry.js +1 -353
  282. package/dist/knowledge/tool-constraints.js +1 -195
  283. package/dist/knowledge/tools-reference.js +1 -178
  284. package/dist/knowledge/treasury-confirm.js +1 -512
  285. package/dist/knowledge/treasury-context.js +1 -363
  286. package/dist/knowledge/treasury-ledger.js +1 -300
  287. package/dist/knowledge/treasury-puzzle.js +1 -216
  288. package/dist/knowledge/treasury-risk.js +1 -440
  289. package/dist/knowledge/treasury-templates.js +1 -358
  290. package/dist/knowledge/treasury-translation.js +1 -498
  291. package/dist/knowledge/trust-metrics.js +1 -198
  292. package/dist/knowledge/universal-template.d.ts +22 -0
  293. package/dist/knowledge/universal-template.js +1 -0
  294. package/dist/knowledge/util-confirm.d.ts +24 -0
  295. package/dist/knowledge/util-confirm.js +1 -0
  296. package/dist/knowledge/util-risk.js +1 -135
  297. package/dist/knowledge/util-translation.d.ts +38 -0
  298. package/dist/knowledge/util-translation.js +1 -0
  299. package/dist/knowledge/workflow-guidance.d.ts +116 -0
  300. package/dist/knowledge/workflow-guidance.js +1 -0
  301. package/dist/loop-engineering/aggregate.js +1 -132
  302. package/dist/loop-engineering/context-collect.js +1 -83
  303. package/dist/loop-engineering/diagnose.js +1 -273
  304. package/dist/loop-engineering/improve.js +1 -405
  305. package/dist/loop-engineering/index.js +1 -4
  306. package/dist/loop-engineering/pipeline.js +1 -56
  307. package/dist/mode-market/index.js +1 -3
  308. package/dist/mode-market/registry.js +1 -124
  309. package/dist/mode-market/review.js +1 -214
  310. package/dist/mode-market/submission.js +1 -85
  311. package/dist/participation/collaborator-interest.d.ts +23 -0
  312. package/dist/participation/collaborator-interest.js +1 -0
  313. package/dist/participation/customer-interest.d.ts +25 -0
  314. package/dist/participation/customer-interest.js +1 -0
  315. package/dist/participation/employee-kpi.d.ts +25 -0
  316. package/dist/participation/employee-kpi.js +1 -0
  317. package/dist/participation/employee-store.d.ts +16 -0
  318. package/dist/participation/employee-store.js +1 -0
  319. package/dist/participation/index.d.ts +2 -0
  320. package/dist/participation/index.js +1 -0
  321. package/dist/participation/merchant-interest.js +1 -100
  322. package/dist/participation/radar-core.d.ts +13 -3
  323. package/dist/participation/radar-core.js +1 -269
  324. package/dist/participation/supplier-interest.d.ts +25 -0
  325. package/dist/participation/supplier-interest.js +1 -0
  326. package/dist/persona/analyzer.js +1 -66
  327. package/dist/persona/bridge.js +1 -86
  328. package/dist/persona/defaults.js +1 -195
  329. package/dist/persona/experience-bridge.js +1 -23
  330. package/dist/persona/index.d.ts +9 -2
  331. package/dist/persona/index.js +1 -71
  332. package/dist/persona/local-region.d.ts +20 -0
  333. package/dist/persona/local-region.js +1 -0
  334. package/dist/persona/model.js +1 -111
  335. package/dist/persona/overrides.d.ts +10 -0
  336. package/dist/persona/overrides.js +1 -0
  337. package/dist/persona/pack-personae.d.ts +11 -0
  338. package/dist/persona/pack-personae.js +1 -0
  339. package/dist/persona/store.js +1 -62
  340. package/dist/persona/strategy-intent.d.ts +20 -0
  341. package/dist/persona/strategy-intent.js +1 -0
  342. package/dist/persona/types.d.ts +6 -2
  343. package/dist/persona/types.js +1 -5
  344. package/dist/project/business-puzzle.d.ts +1 -1
  345. package/dist/project/business-puzzle.js +1 -383
  346. package/dist/project/context-assembly.js +1 -254
  347. package/dist/project/deployment-bridge.js +1 -120
  348. package/dist/project/deployment-doc.js +1 -1126
  349. package/dist/project/edit-planner.js +1 -1342
  350. package/dist/project/evaluation.d.ts +37 -1
  351. package/dist/project/evaluation.js +1 -2011
  352. package/dist/project/game-theory.js +1 -177
  353. package/dist/project/graph-builder.js +1 -656
  354. package/dist/project/graph.d.ts +3 -6
  355. package/dist/project/graph.js +1 -340
  356. package/dist/project/handlers.d.ts +33 -2
  357. package/dist/project/handlers.js +1 -1784
  358. package/dist/project/index.d.ts +2 -0
  359. package/dist/project/index.js +1 -301
  360. package/dist/project/intent-analyzer.js +1 -149
  361. package/dist/project/machine-nodes.js +1 -36
  362. package/dist/project/merchant-guide.d.ts +19 -0
  363. package/dist/project/merchant-guide.js +1 -264
  364. package/dist/project/migration.js +1 -125
  365. package/dist/project/mode-actions.js +1 -309
  366. package/dist/project/namespace.js +1 -206
  367. package/dist/project/participation-radar.js +1 -428
  368. package/dist/project/pipeline-actions.js +1 -109
  369. package/dist/project/project-store.js +1 -422
  370. package/dist/project/query.js +1 -153
  371. package/dist/project/reverse-mapping.d.ts +34 -0
  372. package/dist/project/reverse-mapping.js +1 -0
  373. package/dist/project/risk-aggregator.js +1 -295
  374. package/dist/project/rollback-policy.js +1 -290
  375. package/dist/project/semantic-assembler.js +1 -345
  376. package/dist/project/semantic-graph.d.ts +3 -5
  377. package/dist/project/semantic-graph.js +1 -292
  378. package/dist/project/stage-gate.js +1 -369
  379. package/dist/project/substep-trace.js +1 -332
  380. package/dist/project/task-tracker.js +1 -78
  381. package/dist/project/workflow-design-assessment.d.ts +24 -0
  382. package/dist/project/workflow-design-assessment.js +1 -0
  383. package/dist/role/derivation.d.ts +18 -0
  384. package/dist/role/derivation.js +1 -0
  385. package/dist/role/index.d.ts +5 -0
  386. package/dist/role/index.js +1 -0
  387. package/dist/role/model.d.ts +8 -0
  388. package/dist/role/model.js +1 -0
  389. package/dist/role/resolution.d.ts +11 -0
  390. package/dist/role/resolution.js +1 -0
  391. package/dist/role/types.d.ts +11 -0
  392. package/dist/role/types.js +1 -0
  393. package/dist/rules.js +1 -52
  394. package/dist/safety/confirm-gate.d.ts +1 -1
  395. package/dist/safety/confirm-gate.js +1 -88
  396. package/dist/safety/index.js +1 -3
  397. package/dist/safety/preview.js +1 -52
  398. package/dist/schema/call/allocation.d.ts +186 -1385
  399. package/dist/schema/call/allocation.js +1 -34
  400. package/dist/schema/call/arbitration.d.ts +272 -1871
  401. package/dist/schema/call/arbitration.js +1 -113
  402. package/dist/schema/call/base.d.ts +1831 -9076
  403. package/dist/schema/call/base.js +1 -370
  404. package/dist/schema/call/bridge.d.ts +911 -3171
  405. package/dist/schema/call/bridge.js +1 -458
  406. package/dist/schema/call/contact.d.ts +135 -931
  407. package/dist/schema/call/contact.js +1 -37
  408. package/dist/schema/call/demand.d.ts +164 -1194
  409. package/dist/schema/call/demand.js +1 -47
  410. package/dist/schema/call/guard.d.ts +298 -1140
  411. package/dist/schema/call/guard.js +1 -161
  412. package/dist/schema/call/handler.js +1 -322
  413. package/dist/schema/call/index.js +1 -20
  414. package/dist/schema/call/machine.d.ts +459 -5403
  415. package/dist/schema/call/machine.js +1 -193
  416. package/dist/schema/call/order.d.ts +137 -844
  417. package/dist/schema/call/order.js +1 -35
  418. package/dist/schema/call/payment.d.ts +74 -561
  419. package/dist/schema/call/payment.js +1 -37
  420. package/dist/schema/call/permission-handler.js +1 -54
  421. package/dist/schema/call/permission.d.ts +335 -2791
  422. package/dist/schema/call/permission.js +1 -105
  423. package/dist/schema/call/personal.d.ts +227 -1814
  424. package/dist/schema/call/personal.js +1 -78
  425. package/dist/schema/call/progress.d.ts +140 -843
  426. package/dist/schema/call/progress.js +1 -47
  427. package/dist/schema/call/proof.d.ts +42 -258
  428. package/dist/schema/call/proof.js +1 -33
  429. package/dist/schema/call/repository.d.ts +324 -2222
  430. package/dist/schema/call/repository.js +1 -77
  431. package/dist/schema/call/reward.d.ts +153 -1183
  432. package/dist/schema/call/reward.js +1 -30
  433. package/dist/schema/call/semantic.js +1 -1679
  434. package/dist/schema/call/service.d.ts +376 -3431
  435. package/dist/schema/call/service.js +1 -184
  436. package/dist/schema/call/treasury.d.ts +252 -2158
  437. package/dist/schema/call/treasury.js +1 -71
  438. package/dist/schema/common/index.d.ts +222 -697
  439. package/dist/schema/common/index.js +1 -407
  440. package/dist/schema/config/index.d.ts +18 -161
  441. package/dist/schema/config/index.js +1 -68
  442. package/dist/schema/employee/index.d.ts +99 -0
  443. package/dist/schema/employee/index.js +1 -0
  444. package/dist/schema/evaluation/index.d.ts +1062 -3748
  445. package/dist/schema/evaluation/index.js +1 -356
  446. package/dist/schema/index.d.ts +3 -0
  447. package/dist/schema/index.js +1 -17
  448. package/dist/schema/industry-pack/index.d.ts +132 -0
  449. package/dist/schema/industry-pack/index.js +1 -0
  450. package/dist/schema/intent-radar/index.d.ts +92 -245
  451. package/dist/schema/intent-radar/index.js +1 -89
  452. package/dist/schema/local/index.d.ts +2045 -18080
  453. package/dist/schema/local/index.js +1 -927
  454. package/dist/schema/local/wip.d.ts +61 -651
  455. package/dist/schema/local/wip.js +1 -187
  456. package/dist/schema/messenger/index.d.ts +949 -5557
  457. package/dist/schema/messenger/index.js +1 -475
  458. package/dist/schema/operations.d.ts +2969 -26518
  459. package/dist/schema/operations.js +1 -520
  460. package/dist/schema/persona/index.d.ts +469 -1820
  461. package/dist/schema/persona/index.js +1 -148
  462. package/dist/schema/project/index.d.ts +1027 -8408
  463. package/dist/schema/project/index.js +1 -2057
  464. package/dist/schema/query/index.d.ts +12041 -75261
  465. package/dist/schema/query/index.js +1 -1646
  466. package/dist/schema/schema-query/index.d.ts +35 -98
  467. package/dist/schema/schema-query/index.js +1 -104
  468. package/dist/schema/schema-version.js +1 -76
  469. package/dist/schema/task-status.d.ts +26 -132
  470. package/dist/schema/task-status.js +1 -36
  471. package/dist/schema/trust/index.d.ts +194 -1290
  472. package/dist/schema/trust/index.js +1 -314
  473. package/dist/schema/utils/guard-parser.js +1 -419
  474. package/dist/schema/utils/guard-query-utils.js +1 -46
  475. package/dist/schema/utils/node-parser.js +1 -369
  476. package/dist/schema/utils/object-type-utils.js +1 -35
  477. package/dist/schema/utils/permission-index-utils.js +1 -7
  478. package/dist/schema/utils/permission-machine-check.js +1 -121
  479. package/dist/schema/utils/skills-recommendation.d.ts +1 -0
  480. package/dist/schema/utils/skills-recommendation.js +1 -77
  481. package/dist/schema/workspace/index.d.ts +69 -0
  482. package/dist/schema/workspace/index.js +1 -0
  483. package/dist/schema-query-impl/index.js +1 -0
  484. package/dist/schemas/account_operation.output.json +3147 -1652
  485. package/dist/schemas/account_operation.schema.json +225 -218
  486. package/dist/schemas/bridge_operation.output.json +1168 -650
  487. package/dist/schemas/bridge_operation.schema.json +736 -504
  488. package/dist/schemas/config_operation.output.json +185 -179
  489. package/dist/schemas/config_operation.schema.json +21 -26
  490. package/dist/schemas/employee_operation.output.json +207 -0
  491. package/dist/schemas/employee_operation.schema.json +176 -0
  492. package/dist/schemas/evaluation_operation.output.json +2329 -557
  493. package/dist/schemas/evaluation_operation.schema.json +2939 -720
  494. package/dist/schemas/guard2file.output.json +58 -64
  495. package/dist/schemas/guard2file.schema.json +79 -81
  496. package/dist/schemas/index.json +29 -11
  497. package/dist/schemas/industry_pack_operation.output.json +594 -0
  498. package/dist/schemas/industry_pack_operation.schema.json +55 -0
  499. package/dist/schemas/intent_radar.output.json +275 -200
  500. package/dist/schemas/intent_radar.schema.json +124 -123
  501. package/dist/schemas/local_info_operation.output.json +1174 -657
  502. package/dist/schemas/local_info_operation.schema.json +119 -125
  503. package/dist/schemas/local_mark_operation.output.json +1239 -689
  504. package/dist/schemas/local_mark_operation.schema.json +91 -96
  505. package/dist/schemas/machineNode2file.output.json +63 -69
  506. package/dist/schemas/machineNode2file.schema.json +79 -81
  507. package/dist/schemas/messenger_operation.output.json +2722 -1528
  508. package/dist/schemas/messenger_operation.schema.json +1482 -1264
  509. package/dist/schemas/onchain_events.output.json +2590 -975
  510. package/dist/schemas/onchain_events.schema.json +117 -99
  511. package/dist/schemas/onchain_operations.output.json +3957 -2309
  512. package/dist/schemas/onchain_operations.schema.json +20799 -9285
  513. package/dist/schemas/onchain_operations_allocation.schema.json +172 -108
  514. package/dist/schemas/onchain_operations_arbitration.schema.json +233 -146
  515. package/dist/schemas/onchain_operations_contact.schema.json +129 -90
  516. package/dist/schemas/onchain_operations_demand.schema.json +170 -112
  517. package/dist/schemas/onchain_operations_gen_passport.schema.json +61 -646
  518. package/dist/schemas/onchain_operations_gen_proof.schema.json +40 -172
  519. package/dist/schemas/onchain_operations_guard.schema.json +3765 -294
  520. package/dist/schemas/onchain_operations_machine.schema.json +537 -164
  521. package/dist/schemas/onchain_operations_order.schema.json +126 -96
  522. package/dist/schemas/onchain_operations_payment.schema.json +82 -67
  523. package/dist/schemas/onchain_operations_permission.schema.json +331 -93
  524. package/dist/schemas/onchain_operations_personal.schema.json +636 -96
  525. package/dist/schemas/onchain_operations_progress.schema.json +125 -92
  526. package/dist/schemas/onchain_operations_proof.schema.json +76 -69
  527. package/dist/schemas/onchain_operations_repository.schema.json +636 -249
  528. package/dist/schemas/onchain_operations_reward.schema.json +218 -108
  529. package/dist/schemas/onchain_operations_service.schema.json +679 -221
  530. package/dist/schemas/onchain_operations_treasury.schema.json +401 -135
  531. package/dist/schemas/onchain_table_data.output.json +6018 -2430
  532. package/dist/schemas/onchain_table_data.schema.json +544 -430
  533. package/dist/schemas/persona_operation.output.json +1568 -265
  534. package/dist/schemas/persona_operation.schema.json +346 -202
  535. package/dist/schemas/project_operation.output.json +6957 -5147
  536. package/dist/schemas/project_operation.schema.json +1050 -1020
  537. package/dist/schemas/query_task_status.output.json +195 -99
  538. package/dist/schemas/query_task_status.schema.json +12 -18
  539. package/dist/schemas/query_toolkit.output.json +18870 -14566
  540. package/dist/schemas/query_toolkit.schema.json +614 -522
  541. package/dist/schemas/schema_query.output.json +127 -129
  542. package/dist/schemas/schema_query.schema.json +64 -69
  543. package/dist/schemas/trust_score.output.json +678 -587
  544. package/dist/schemas/trust_score.schema.json +289 -277
  545. package/dist/schemas/wip_file.output.json +116 -124
  546. package/dist/schemas/wip_file.schema.json +142 -143
  547. package/dist/schemas/workspace_operation.output.json +277 -0
  548. package/dist/schemas/workspace_operation.schema.json +45 -0
  549. package/dist/schemas/wowok_buildin_info.output.json +1693 -723
  550. package/dist/schemas/wowok_buildin_info.schema.json +576 -512
  551. package/dist/telemetry/index.js +1 -112
  552. package/dist/telemetry/redact.js +1 -23
  553. package/dist/telemetry/storage.js +1 -80
  554. package/dist/tools/handlers/bridge.d.ts +8 -1
  555. package/dist/tools/handlers/bridge.js +1 -1
  556. package/dist/tools/handlers/config.js +1 -74
  557. package/dist/tools/handlers/employee.d.ts +2 -0
  558. package/dist/tools/handlers/employee.js +1 -0
  559. package/dist/tools/handlers/evaluation.js +1 -123
  560. package/dist/tools/handlers/file-export.js +1 -90
  561. package/dist/tools/handlers/industry-pack.d.ts +2 -0
  562. package/dist/tools/handlers/industry-pack.js +1 -0
  563. package/dist/tools/handlers/intent-radar.js +1 -76
  564. package/dist/tools/handlers/local.js +1 -53
  565. package/dist/tools/handlers/messenger.js +1 -188
  566. package/dist/tools/handlers/onchain.js +1 -1180
  567. package/dist/tools/handlers/persona.js +1 -89
  568. package/dist/tools/handlers/project.js +1 -211
  569. package/dist/tools/handlers/query.js +1 -434
  570. package/dist/tools/handlers/schema-query.js +1 -176
  571. package/dist/tools/handlers/task-status.js +1 -26
  572. package/dist/tools/handlers/trust.js +1 -380
  573. package/dist/tools/handlers/wip.js +1 -90
  574. package/dist/tools/handlers/workspace.d.ts +2 -0
  575. package/dist/tools/handlers/workspace.js +1 -0
  576. package/dist/tools/index.d.ts +2 -1
  577. package/dist/tools/index.js +1 -1382
  578. package/dist/tools/retry.js +1 -85
  579. package/dist/tools/rules-hook.d.ts +1 -1
  580. package/dist/tools/rules-hook.js +1 -23
  581. package/dist/tools/shared.d.ts +1 -1
  582. package/dist/tools/shared.js +1 -130
  583. package/dist/tools/types.d.ts +2 -1
  584. package/dist/tools/types.js +1 -1
  585. package/dist/tools/upgrade-check.d.ts +19 -0
  586. package/dist/tools/upgrade-check.js +1 -0
  587. package/dist/tools/wip-deploy-assist.js +1 -306
  588. package/dist/tools/wrap.js +1 -500
  589. package/package.json +7 -6
  590. package/dist/knowledge/arbitration-trust.d.ts +0 -24
  591. package/dist/knowledge/arbitration-trust.js +0 -117
  592. package/dist/schema/call/bridge-handler.d.ts +0 -8
  593. package/dist/schema/call/bridge-handler.js +0 -265
  594. package/dist/schema/sync-layer4.d.ts +0 -21
  595. package/dist/schema/sync-layer4.js +0 -286
  596. package/dist/schema-query/index.js +0 -810
  597. /package/dist/{schema-query → schema-query-impl}/index.d.ts +0 -0
@@ -1,1119 +1 @@
1
- import { MAX_SUBMISSION_SIZE_PASSPORT } from "@wowok/wowok";
2
- export const SEMANTIC_TO_SCHEMA_RULES = [
3
- {
4
- id: "P02",
5
- pattern_name: "Query published object + system context",
6
- data_source_combination: "Type1 + Type4",
7
- semantic_intent: "Query published on-chain object fields and compare with system context",
8
- match_keywords: ["paused", "published", "service status", "machine status", "paused", "published"],
9
- schema_elements: {
10
- root_type: "logic_equal / logic_and",
11
- table_entries: [
12
- { value_type: "Address", b_submission: false, purpose: "Published object address constant (Type1)" },
13
- ],
14
- context_nodes: [
15
- { context_type: "Signer", purpose: "Optional: identity validation" },
16
- ],
17
- tree_structure: "logic_equal(query(<instruction>, object: { identifier: 0 }), identifier[1] or context(Signer))",
18
- },
19
- constraints: [
20
- "The object_type of table[0] must match the target object type of the query instruction",
21
- "The query return type must be compatible with the comparison object",
22
- "The object must be published (published=true) to ensure fields are immutable",
23
- ],
24
- example: {
25
- root: {
26
- type: "logic_equal",
27
- nodes: [
28
- { type: "query", query: "service.paused", object: { identifier: 0 }, parameters: [] },
29
- { type: "identifier", identifier: 1 },
30
- ],
31
- },
32
- table: [
33
- { identifier: 0, b_submission: false, value_type: "Address", value: "0xSERVICE", name: "Service object address" },
34
- { identifier: 1, b_submission: false, value_type: "Bool", value: false, name: "Expected paused state (false=not paused)" },
35
- ],
36
- },
37
- },
38
- {
39
- id: "P03",
40
- pattern_name: "Identity check (single address)",
41
- data_source_combination: "Type4 + Type1 constant",
42
- semantic_intent: "Only a specific address can perform the operation",
43
- match_keywords: ["only", "allow", "authorize", "identity", "specified address", "signer"],
44
- schema_elements: {
45
- root_type: "logic_equal",
46
- table_entries: [
47
- { value_type: "Address", b_submission: false, purpose: "Authorized address constant (Type1 constant)" },
48
- ],
49
- context_nodes: [
50
- { context_type: "Signer", purpose: "Current transaction signer (Type4)" },
51
- ],
52
- tree_structure: "logic_equal(context(Signer), identifier[0])",
53
- },
54
- constraints: [
55
- "root must be logic_equal (returns Bool)",
56
- "table[0] must be Address type, b_submission=false",
57
- "context(Signer) returns the current transaction signer address",
58
- ],
59
- example: {
60
- root: {
61
- type: "logic_equal",
62
- nodes: [
63
- { type: "context", context: "Signer" },
64
- { type: "identifier", identifier: 0 },
65
- ],
66
- },
67
- table: [
68
- { identifier: 0, b_submission: false, value_type: "Address", value: "0xabc...", name: "Authorized operator address" },
69
- ],
70
- },
71
- },
72
- {
73
- id: "P04",
74
- pattern_name: "Identity check (whitelist)",
75
- data_source_combination: "Type4 + Type1 constant (VecAddress)",
76
- semantic_intent: "Addresses in the whitelist can perform this operation",
77
- match_keywords: ["whitelist", "multiple addresses", "list", "allowlist", "roster"],
78
- schema_elements: {
79
- root_type: "vec_contains_address",
80
- table_entries: [
81
- { value_type: "VecAddress", b_submission: false, purpose: "Authorized address list (Type1 constant)" },
82
- ],
83
- context_nodes: [
84
- { context_type: "Signer", purpose: "Signer being looked up (Type4)" },
85
- ],
86
- tree_structure: "vec_contains_address(identifier[0], context(Signer))",
87
- },
88
- constraints: [
89
- "root vec_contains_address returns Bool",
90
- "table[0] must be VecAddress type",
91
- "context(Signer) is the element being looked up",
92
- ],
93
- example: {
94
- root: {
95
- type: "vec_contains_address",
96
- nodes: [
97
- { type: "identifier", identifier: 0 },
98
- { type: "context", context: "Signer" },
99
- ],
100
- },
101
- table: [
102
- { identifier: 0, b_submission: false, value_type: "VecAddress", value: ["0xabc...", "0xdef..."], name: "Authorized address whitelist" },
103
- ],
104
- },
105
- },
106
- {
107
- id: "P05",
108
- pattern_name: "Time lock",
109
- data_source_combination: "Type2 + Type4 + Type1 constant",
110
- semantic_intent: "This operation can only be executed after waiting N milliseconds",
111
- match_keywords: ["wait", "time", "lock", "delay", "hours", "days", "milliseconds"],
112
- schema_elements: {
113
- root_type: "logic_as_u256_greater_or_equal",
114
- table_entries: [
115
- { value_type: "Address", b_submission: true, purpose: "Source object address (e.g. Order, Type3) or constant (Type1)" },
116
- { value_type: "U64", b_submission: false, purpose: "Lock duration (in milliseconds, 1000 for tests, Type1 constant)" },
117
- ],
118
- query_nodes: [
119
- { query_name: "progress.current_time", object_type: "Progress", convert_witness: 100 },
120
- ],
121
- context_nodes: [
122
- { context_type: "Clock", purpose: "Current on-chain timestamp (Type4)" },
123
- ],
124
- tree_structure: "logic_as_u256_greater_or_equal(context(Clock), calc_number_add(query(1272: progress.current_time, witness=100, identifier[0]), identifier[1]))",
125
- },
126
- constraints: [
127
- "Time unit is milliseconds; use 1000ms for tests and adjust in production",
128
- "convert_witness=100 (TypeOrderProgress) converts from Order to Progress",
129
- "The object_type of table[0] must match the witness source type (Order)",
130
- "calc_number_add returns U256, context(Clock) returns U64, auto-widened",
131
- "Key: use progress.current_time(1272) rather than progress.session.forward.time(1271); the latter querying an unforwarded session returns 0 and disables the time lock",
132
- ],
133
- example: {
134
- root: {
135
- type: "logic_as_u256_greater_or_equal",
136
- nodes: [
137
- { type: "context", context: "Clock" },
138
- {
139
- type: "calc_number_add",
140
- nodes: [
141
- {
142
- type: "query",
143
- query: "progress.current_time",
144
- object: { identifier: 0, convert_witness: 100 },
145
- parameters: [],
146
- },
147
- { type: "identifier", identifier: 1 },
148
- ],
149
- },
150
- ],
151
- },
152
- table: [
153
- { identifier: 0, b_submission: true, value_type: "Address", name: "Target Order address", object_type: "Order" },
154
- { identifier: 1, b_submission: false, value_type: "U64", value: 1000, name: "Lock duration (milliseconds)" },
155
- ],
156
- },
157
- },
158
- {
159
- id: "P06",
160
- pattern_name: "Progress state check",
161
- data_source_combination: "Type2 + Type1 constant",
162
- semantic_intent: "The order progress must reach the specified node before this operation can be executed",
163
- match_keywords: ["progress", "node", "state", "completed", "reach", "current node"],
164
- schema_elements: {
165
- root_type: "logic_equal",
166
- table_entries: [
167
- { value_type: "Address", b_submission: true, purpose: "Source Order address (Type3, witness source)" },
168
- { value_type: "String", b_submission: false, purpose: "Expected node name (Type1 constant)" },
169
- ],
170
- query_nodes: [
171
- { query_name: "progress.current", object_type: "Progress", convert_witness: 100 },
172
- ],
173
- tree_structure: "logic_equal(query(1253: progress.current, witness=100, identifier[0]), identifier[1])",
174
- },
175
- constraints: [
176
- "query returns String; identifier[1] must be String type",
177
- "logic_equal comparison on String is case-sensitive",
178
- "For case-insensitive comparison, use logic_string_nocase_equal",
179
- "convert_witness=100 (TypeOrderProgress) converts from Order",
180
- "Type2 stacks on Type3: the source object Order is submitted (b_submission=true)",
181
- ],
182
- example: {
183
- root: {
184
- type: "logic_equal",
185
- nodes: [
186
- {
187
- type: "query",
188
- query: "progress.current",
189
- object: { identifier: 0, convert_witness: 100 },
190
- parameters: [],
191
- },
192
- { type: "identifier", identifier: 1 },
193
- ],
194
- },
195
- table: [
196
- { identifier: 0, b_submission: true, value_type: "Address", name: "Target Order address", object_type: "Order" },
197
- { identifier: 1, b_submission: false, value_type: "String", value: "Completed", name: "Expected progress node name" },
198
- ],
199
- },
200
- },
201
- {
202
- id: "P07",
203
- pattern_name: "One-time claim check",
204
- data_source_combination: "Type3 + Type1 constant",
205
- semantic_intent: "Users can only claim the reward once",
206
- match_keywords: ["once", "claim", "duplicate", "already claimed", "claimed before"],
207
- schema_elements: {
208
- root_type: "logic_equal",
209
- table_entries: [
210
- { value_type: "Address", b_submission: true, purpose: "Reward object address (Type3, submitted)" },
211
- { value_type: "U64", b_submission: false, purpose: "Expected historical claim count 0 (Type1 constant)" },
212
- ],
213
- query_nodes: [
214
- { query_name: "reward.record.count", object_type: "Reward" },
215
- ],
216
- tree_structure: "logic_equal(query_reward_record_count(object: { identifier: 0 }, recipient: context(Signer)), identifier[1])",
217
- },
218
- constraints: [
219
- "query_reward_record_count returns U64",
220
- "Comparing count == 0 means no history record (can claim)",
221
- "recipient defaults to context(Signer) to ensure the claimer's identity is bound",
222
- "Type3 submitted objects must have constraint rules (here the constraint is count==0 and recipient=Signer)",
223
- ],
224
- example: {
225
- root: {
226
- type: "logic_equal",
227
- nodes: [
228
- {
229
- type: "query_reward_record_count",
230
- object: { identifier: 0 },
231
- },
232
- { type: "identifier", identifier: 1 },
233
- ],
234
- },
235
- table: [
236
- { identifier: 0, b_submission: true, value_type: "Address", name: "Reward object address", object_type: "Reward" },
237
- { identifier: 1, b_submission: false, value_type: "U64", value: 0, name: "Expected historical claim count (0)" },
238
- ],
239
- },
240
- },
241
- {
242
- id: "P08",
243
- pattern_name: "Submitted object identity validation",
244
- data_source_combination: "Type3 + Type4",
245
- semantic_intent: "Verify that the owner of the submitted object matches the signer",
246
- match_keywords: ["ownership", "belonging", "customer", "submitted object", "order.customer"],
247
- schema_elements: {
248
- root_type: "logic_equal",
249
- table_entries: [
250
- { value_type: "Address", b_submission: true, purpose: "Submitted Order address (Type3)" },
251
- ],
252
- context_nodes: [
253
- { context_type: "Signer", purpose: "Current signer (Type4), compared with order.customer" },
254
- ],
255
- query_nodes: [
256
- { query_name: "order.customer", object_type: "Order" },
257
- ],
258
- tree_structure: "logic_equal(query(1550: order.customer, object: { identifier: 0 }), context(Signer))",
259
- },
260
- constraints: [
261
- "query returns Address, context(Signer) returns Address, types compatible",
262
- "Type3 submitted object constraint: indirectly binds submitter identity via order.customer == Signer",
263
- "Ensures callers cannot submit other users' Order addresses",
264
- ],
265
- example: {
266
- root: {
267
- type: "logic_equal",
268
- nodes: [
269
- {
270
- type: "query",
271
- query: "order.customer",
272
- object: { identifier: 0 },
273
- parameters: [],
274
- },
275
- { type: "context", context: "Signer" },
276
- ],
277
- },
278
- table: [
279
- { identifier: 0, b_submission: true, value_type: "Address", name: "User-submitted Order address", object_type: "Order" },
280
- ],
281
- },
282
- },
283
- {
284
- id: "P09",
285
- pattern_name: "Submitted object + witness derivation query",
286
- data_source_combination: "Type3 + Type2 (source is Type3)",
287
- semantic_intent: "User submits an Order and queries the Progress state via witness",
288
- match_keywords: ["submit", "derive", "witness", "order to progress", "convert"],
289
- schema_elements: {
290
- root_type: "logic_equal / logic_and",
291
- table_entries: [
292
- { value_type: "Address", b_submission: true, purpose: "Submitted Order address (Type3, witness source)" },
293
- { value_type: "String", b_submission: false, purpose: "Expected node name (Type1 constant)" },
294
- ],
295
- query_nodes: [
296
- { query_name: "progress.current", object_type: "Progress", convert_witness: 100 },
297
- ],
298
- tree_structure: "logic_equal(query(1253: progress.current, object: { identifier: 0, convert_witness: 100 }), identifier[1])",
299
- },
300
- constraints: [
301
- "Type2 stacks on Type3: the source object Order has b_submission=true",
302
- "witness=100 (TypeOrderProgress) derives Progress from the submitted Order",
303
- "query returns String; identifier[1] must be String type",
304
- "Key: Type2 can stack on Type1 or Type3, depending on the source object's b_submission",
305
- ],
306
- example: {
307
- root: {
308
- type: "logic_equal",
309
- nodes: [
310
- {
311
- type: "query",
312
- query: "progress.current",
313
- object: { identifier: 0, convert_witness: 100 },
314
- parameters: [],
315
- },
316
- { type: "identifier", identifier: 1 },
317
- ],
318
- },
319
- table: [
320
- { identifier: 0, b_submission: true, value_type: "Address", name: "User-submitted Order address", object_type: "Order" },
321
- { identifier: 1, b_submission: false, value_type: "String", value: "Inspecting", name: "Expected progress node name" },
322
- ],
323
- },
324
- },
325
- {
326
- id: "P10",
327
- pattern_name: "Multi-condition combination (AND/OR)",
328
- data_source_combination: "Type1 + Type2 + Type3 + Type4 (combination)",
329
- semantic_intent: "Multiple conditions must all be satisfied (AND) or any one is satisfied (OR)",
330
- match_keywords: ["and", "simultaneously", "all satisfied", "AND", "and also", "also need", "or", "any", "OR", "or", "one of"],
331
- schema_elements: {
332
- root_type: "logic_and / logic_or",
333
- table_entries: [],
334
- tree_structure: "logic_and/logic_or([condition1, condition2, ...]) — each condition can be any combination of P03-P09",
335
- },
336
- constraints: [
337
- "All subnodes of logic_and/logic_or must return Bool",
338
- "Subnode count 2-8 (MAX_MULTI_OPERANDS)",
339
- "Each subcondition can be any node that returns Bool",
340
- "Multi-condition combination is a container for other Patterns and does not stand alone",
341
- ],
342
- example: {
343
- root: {
344
- type: "logic_and",
345
- nodes: [
346
- {},
347
- {},
348
- ],
349
- },
350
- },
351
- },
352
- {
353
- id: "P11",
354
- pattern_name: "Entity registration check",
355
- data_source_combination: "Type1 system address + Type3",
356
- semantic_intent: "Verify that the user is registered in the entity registrar",
357
- match_keywords: ["register", "entity", "EntityRegistrar", "member", "certify"],
358
- schema_elements: {
359
- root_type: "logic_and",
360
- table_entries: [
361
- { value_type: "Address", b_submission: false, purpose: "EntityRegistrar system address 0xaab (Type1 system address)" },
362
- { value_type: "Address", b_submission: true, purpose: "User address (Type3, submitted)" },
363
- ],
364
- query_nodes: [
365
- { query_name: "entity.registrar.records", object_type: "EntityRegistrar" },
366
- ],
367
- tree_structure: "logic_and(query(1760: entity.registrar.records, object: { identifier: 0 }, parameters: [identifier[1]]), ...)",
368
- },
369
- constraints: [
370
- "EntityRegistrar address is fixed at 0xaab (system address)",
371
- "EntityLinker address is fixed at 0xaaa",
372
- "table[0] has is_system_address=true",
373
- "query parameters must match the instruction definition",
374
- ],
375
- example: {
376
- root: {
377
- type: "logic_and",
378
- nodes: [
379
- {
380
- type: "query",
381
- query: "entity.registrar.records",
382
- object: { identifier: 0 },
383
- parameters: [{ type: "identifier", identifier: 1 }],
384
- },
385
- ],
386
- },
387
- table: [
388
- { identifier: 0, b_submission: false, value_type: "Address", value: "0xaab", name: "EntityRegistrar system address" },
389
- { identifier: 1, b_submission: true, value_type: "Address", name: "User address (submitted)" },
390
- ],
391
- },
392
- },
393
- {
394
- id: "P12",
395
- pattern_name: "Dynamic voting weight",
396
- data_source_combination: "Type3 + Type4 + Type1 constant",
397
- semantic_intent: "Voting weight equals the reputation score (extracted from submitted data)",
398
- match_keywords: ["weight", "vote", "reputation", "score", "voting", "weight"],
399
- schema_elements: {
400
- root_type: "logic_and",
401
- table_entries: [
402
- { value_type: "Address", b_submission: true, purpose: "Voter address (Type3)" },
403
- { value_type: "U64", b_submission: true, purpose: "Voter weight (Type3, extracted by GuardIdentifier)" },
404
- ],
405
- context_nodes: [
406
- { context_type: "Signer", purpose: "Validate voter identity (Type4)" },
407
- ],
408
- query_nodes: [
409
- { query_name: "entity.registrar.records", object_type: "EntityRegistrar" },
410
- ],
411
- tree_structure: "logic_and(identity check: logic_equal(context(Signer), identifier[0]), weight comparison: GuardIdentifier extracts identifier[1])",
412
- },
413
- constraints: [
414
- "The table entry referenced by GuardIdentifier must be numeric (U8-U256)",
415
- "b_submission must be true (weight is submitted at runtime by the voter)",
416
- "Non-numeric types cause E_GUARD_IDENTIFIER_NOT_NUMBER error",
417
- "Weight value is cast to u32",
418
- "voting_guard scene special constraint: GuardIdentifier numeric",
419
- ],
420
- example: {
421
- root: {
422
- type: "logic_and",
423
- nodes: [
424
- {},
425
- {},
426
- ],
427
- },
428
- table: [
429
- { identifier: 0, b_submission: true, value_type: "Address", name: "Voter address" },
430
- { identifier: 1, b_submission: true, value_type: "U64", name: "Voter weight (extracted from reputation score)" },
431
- ],
432
- },
433
- },
434
- {
435
- id: "P13",
436
- pattern_name: "Repository data query",
437
- data_source_combination: "Type1 + Type2",
438
- semantic_intent: "Query Repository data and validate",
439
- match_keywords: ["Repository", "storage", "data source", "weather", "external data", "oracle"],
440
- schema_elements: {
441
- root_type: "logic_and",
442
- table_entries: [
443
- { value_type: "Address", b_submission: false, purpose: "Repository address (Type1 constant)" },
444
- ],
445
- query_nodes: [
446
- { query_name: "repository.data", object_type: "Repository" },
447
- ],
448
- tree_structure: "logic_and(query(1167: repository.data, object: { identifier: 0 }, parameters: [...]), [data validation condition])",
449
- },
450
- constraints: [
451
- "quote_guard is a RIGID verification requirement: any guard querying Repository data with quote_guard must satisfy it",
452
- "Two-phase: passport generation scans/prepares quote_guard, passport verification re-checks + verifies (see R-X1-10)",
453
- "If quote_guard==None: no access control — Repository data is freely queryable",
454
- "rep semantics: repository.data query does not depend on runtime submission, so rep=true",
455
- ],
456
- example: {
457
- root: {
458
- type: "logic_and",
459
- nodes: [
460
- {
461
- type: "query",
462
- query: "repository.data",
463
- object: { identifier: 0 },
464
- parameters: [{ type: "identifier", identifier: 1 }],
465
- },
466
- {},
467
- ],
468
- },
469
- table: [
470
- { identifier: 0, b_submission: false, value_type: "Address", value: "0xREPO", name: "Repository address" },
471
- ],
472
- },
473
- },
474
- {
475
- id: "P14",
476
- pattern_name: "Pure dependency combination",
477
- data_source_combination: "None (rely only)",
478
- semantic_intent: "Does not compute itself; fully depends on the results of other Guards",
479
- match_keywords: ["depend", "combine", "reuse", "rely", "delegate"],
480
- schema_elements: {
481
- root_type: "logic_and / logic_or (minimized tautology)",
482
- table_entries: [],
483
- tree_structure: "root: minimized (e.g. context(Clock) >= 0, tautology) + rely: { guards: [...], logic_or: false }",
484
- },
485
- constraints: [
486
- "Depended-on Guards must have rep=true (repository.data query does not depend on runtime submission)",
487
- "rely.guards supports at most 4 (MAX_DEPENDED_COUNT)",
488
- "Self-reference is forbidden",
489
- "AND logic: all dependencies must pass; OR logic: any one passing is sufficient",
490
- ],
491
- example: {
492
- root: {
493
- type: "logic_as_u256_greater_or_equal",
494
- nodes: [
495
- { type: "context", context: "Clock" },
496
- { type: "identifier", identifier: 0 },
497
- ],
498
- },
499
- table: [
500
- { identifier: 0, b_submission: false, value_type: "U64", value: 0, name: "Tautology baseline value (0)" },
501
- ],
502
- rely: { guards: ["guard_a", "guard_b"], logic_or: false },
503
- },
504
- },
505
- {
506
- id: "P15",
507
- pattern_name: "Submission data retention pattern (retained_submission)",
508
- data_source_combination: "Type3 + Type4 (submission + system context binding)",
509
- semantic_intent: "Guard accepts runtime-submitted data but ensures it is trustworthy via Signer binding and type checking",
510
- match_keywords: ["submit", "retain", "retained", "submission", "bind signer", "submission check"],
511
- schema_elements: {
512
- root_type: "logic_and",
513
- table_entries: [
514
- { value_type: "Address", b_submission: true, purpose: "Submitted object address (Type3, requires Signer binding)" },
515
- { value_type: "U256", b_submission: true, purpose: "Submitted numeric value (e.g. amount, weight, requires range check)" },
516
- ],
517
- context_nodes: [
518
- { context_type: "Signer", purpose: "Validate submitter identity to ensure submission data ownership" },
519
- ],
520
- tree_structure: "logic_and(logic_equal(context(Signer), query(..., signer_field)), logic_as_u256_greater_or_equal(identifier[1], identifier[2]))",
521
- },
522
- constraints: [
523
- "The name of each b_submission=true entry must be a complete natural-language description (not a technical identifier)",
524
- "The submitted object address should be bound to Signer (query the signer/owner field of the submitted object to validate ownership)",
525
- "Submitted numeric values should have range checks (>= min, <= max)",
526
- "Total table size must not exceed 40000 bytes",
527
- `Total submission bytes must not exceed ${MAX_SUBMISSION_SIZE_PASSPORT}`,
528
- ],
529
- example: {
530
- root: {
531
- type: "logic_and",
532
- nodes: [
533
- {
534
- type: "logic_equal",
535
- nodes: [
536
- { type: "context", context: "Signer" },
537
- {
538
- type: "query",
539
- query: 1237,
540
- object: { identifier: 0 },
541
- parameters: [],
542
- },
543
- ],
544
- },
545
- {
546
- type: "logic_as_u256_greater_or_equal",
547
- nodes: [
548
- { type: "identifier", identifier: 1 },
549
- { type: "identifier", identifier: 2 },
550
- ],
551
- },
552
- ],
553
- },
554
- table: [
555
- { identifier: 0, b_submission: true, value_type: "Address", name: "Submitted Order object address; must belong to the current signer" },
556
- { identifier: 1, b_submission: true, value_type: "U256", name: "Submitted amount (unit: MIST); must be >= minimum amount" },
557
- { identifier: 2, b_submission: false, value_type: "U256", value: 1000000, name: "Minimum amount constant (1 MIST)" },
558
- ],
559
- },
560
- },
561
- {
562
- id: "P16",
563
- pattern_name: "Circular reference pattern (Guard references the host object itself)",
564
- data_source_combination: "Type1 (host object as constant, using name instead of address)",
565
- semantic_intent: "Guard binds to a Host Object while querying the Host Object's own fields; uses name reference to achieve circular binding",
566
- match_keywords: ["circular reference", "self", "host", "host", "circular", "self-reference"],
567
- schema_elements: {
568
- root_type: "logic_equal / logic_and",
569
- table_entries: [
570
- { value_type: "Address", b_submission: false, purpose: "Host object name (SDK resolves to address at binding time)" },
571
- ],
572
- query_nodes: [
573
- { query_name: "query_service_* / query_machine_*", object_type: "Service / Machine" },
574
- ],
575
- tree_structure: "logic_equal(query(<host_field_query>, object: { identifier: 0 }), identifier[1] or context(Signer))",
576
- },
577
- constraints: [
578
- "The Host Object must not be published (bPublished=false) when creating and binding the Guard",
579
- "Use the Host Object name (not address) in the table; the SDK resolves it at binding time",
580
- "The Host Object can only be published after the Guard is bound",
581
- "Guard verification only runs normally after the Host Object is published",
582
- "Use guard2file to export Guard backups for easy rebuilding",
583
- ],
584
- example: {
585
- root: {
586
- type: "logic_equal",
587
- nodes: [
588
- {
589
- type: "query",
590
- query: 1231,
591
- object: { identifier: 0 },
592
- parameters: [],
593
- },
594
- { type: "identifier", identifier: 1 },
595
- ],
596
- },
597
- table: [
598
- { identifier: 0, b_submission: false, value_type: "Address", value: "my_service", name: "Host Service name (circular reference, resolved by SDK at binding time)" },
599
- { identifier: 1, b_submission: false, value_type: "Bool", value: false, name: "Expected Service paused state (false=not paused)" },
600
- ],
601
- },
602
- },
603
- {
604
- id: "P17",
605
- pattern_name: "Query parameter translation pattern (type conversion node combination)",
606
- data_source_combination: "Type1/2 + type conversion (query parameter type translation)",
607
- semantic_intent: "Guard queries parameters that require type conversion (e.g. Address → U64 timestamp key); uses convert_* nodes to translate",
608
- match_keywords: ["type conversion", "translate", "convert", "timestamp key", "parameter translation", "address to u64"],
609
- schema_elements: {
610
- root_type: "logic_equal / logic_as_u256_greater_or_equal",
611
- table_entries: [
612
- { value_type: "Address", b_submission: false, purpose: "Query target object address (Type1/2)" },
613
- { value_type: "U64", b_submission: false, purpose: "Comparison baseline value (e.g. timestamp threshold)" },
614
- ],
615
- query_nodes: [
616
- { query_name: "query_repository_data / query_progress_history_*", object_type: "Repository / Progress" },
617
- ],
618
- tree_structure: "logic_as_u256_greater_or_equal(query(<query_with_converted_param>, object: { identifier: 0 }, parameters: [convert_number_address(identifier[1])]), identifier[2])",
619
- },
620
- constraints: [
621
- "The query parameter type must match the parameters type defined in GUARDQUERY",
622
- "If the table declares Address but the query requires U64, convert_number_address must be used to translate",
623
- "The input type of convert_* nodes must be compatible with the child node's return type",
624
- "The translated type must match the parameters definition of the query instruction",
625
- "Use wowok_buildin_info info='guard instructions' to verify parameter types",
626
- ],
627
- example: {
628
- root: {
629
- type: "logic_as_u256_greater_or_equal",
630
- nodes: [
631
- {
632
- type: "query",
633
- query: 1167,
634
- object: { identifier: 0 },
635
- parameters: [
636
- {
637
- type: "convert_number_address",
638
- nodes: [
639
- { type: "identifier", identifier: 1 },
640
- ],
641
- },
642
- ],
643
- },
644
- { type: "identifier", identifier: 2 },
645
- ],
646
- },
647
- table: [
648
- { identifier: 0, b_submission: false, value_type: "Address", value: "0xrepo", name: "Repository address constant" },
649
- { identifier: 1, b_submission: false, value_type: "U64", value: 1700000000000, name: "Timestamp key (U64, needs to be converted to Address for Repository query)" },
650
- { identifier: 2, b_submission: false, value_type: "U256", value: 100, name: "Expected Repository data value" },
651
- ],
652
- },
653
- },
654
- ];
655
- export const SCHEMA_TO_SEMANTIC_RULES = [
656
- { element_type: "node", type_name: "logic_equal", semantic: "Equality comparison (==), returns Bool. Accepts any type but both operands must be type-compatible", return_type: "Bool", child_constraints: "2 child nodes, types must be compatible" },
657
- { element_type: "node", type_name: "logic_not", semantic: "Logical NOT (!), returns Bool", return_type: "Bool", child_constraints: "1 child node, must be Bool" },
658
- { element_type: "node", type_name: "logic_and", semantic: "Logical AND; true if all child nodes are true", return_type: "Bool", child_constraints: "2-8 Bool child nodes (MAX_MULTI_OPERANDS)" },
659
- { element_type: "node", type_name: "logic_or", semantic: "Logical OR; true if any child node is true", return_type: "Bool", child_constraints: "2-8 Bool child nodes" },
660
- { element_type: "node", type_name: "logic_as_u256_greater", semantic: "Numeric greater than (>), auto-widened to U256", return_type: "Bool", child_constraints: "2 numeric child nodes (U8-U256 compatible)" },
661
- { element_type: "node", type_name: "logic_as_u256_lesser", semantic: "Numeric less than (<)", return_type: "Bool", child_constraints: "2 numeric child nodes" },
662
- { element_type: "node", type_name: "logic_as_u256_equal", semantic: "Numeric equality (==)", return_type: "Bool", child_constraints: "2 numeric child nodes" },
663
- { element_type: "node", type_name: "logic_as_u256_greater_or_equal", semantic: "Numeric greater than or equal (>=)", return_type: "Bool", child_constraints: "2 numeric child nodes" },
664
- { element_type: "node", type_name: "logic_as_u256_lesser_or_equal", semantic: "Numeric less than or equal (<=)", return_type: "Bool", child_constraints: "2 numeric child nodes" },
665
- { element_type: "node", type_name: "logic_string_contains", semantic: "String contains (case-sensitive)", return_type: "Bool", child_constraints: "2 String child nodes" },
666
- { element_type: "node", type_name: "logic_string_nocase_contains", semantic: "String contains (case-insensitive)", return_type: "Bool", child_constraints: "2 String child nodes" },
667
- { element_type: "node", type_name: "logic_string_nocase_equal", semantic: "String equality (case-insensitive)", return_type: "Bool", child_constraints: "2 String child nodes" },
668
- { element_type: "node", type_name: "identifier", semantic: "References the value of a table entry. The data source type depends on b_submission: false=Type1 constant, true=Type3 submitted", return_type: "Determined by table entry value_type", child_constraints: "No child nodes; requires identifier field to reference table", data_source_class: "Type1_OnChainConstant" },
669
- { element_type: "node", type_name: "context", semantic: "Transaction context data (Type4 SystemContext). Signer=signer address, Clock=on-chain timestamp (U64), Guard=ObjectID of the Guard currently being verified", return_type: "Address (Signer/Guard) / U64 (Clock)", child_constraints: "No child nodes", data_source_class: "Type4_SystemContext" },
670
- { element_type: "node", type_name: "query", semantic: "Queries on-chain object data. The data source type depends on object.convert_witness: present=Type2 (witness-derived), absent+constant=Type1, absent+submitted=Type3", return_type: "Determined by the query instruction", child_constraints: "Requires query + object + parameters fields", data_source_class: "Type1_OnChainConstant", discovery_tool: "wowok_buildin_info(info='guard instructions')" },
671
- { element_type: "node", type_name: "calc_number_add", semantic: "Numeric addition", return_type: "U256", child_constraints: "2 numeric child nodes" },
672
- { element_type: "node", type_name: "calc_number_subtract", semantic: "Numeric subtraction", return_type: "U256", child_constraints: "2 numeric child nodes" },
673
- { element_type: "node", type_name: "calc_number_multiply", semantic: "Numeric multiplication", return_type: "U256", child_constraints: "2 numeric child nodes" },
674
- { element_type: "node", type_name: "calc_number_divide", semantic: "Numeric division", return_type: "U256", child_constraints: "2 numeric child nodes" },
675
- { element_type: "node", type_name: "calc_number_mod", semantic: "Numeric modulo", return_type: "U256", child_constraints: "2 numeric child nodes" },
676
- { element_type: "node", type_name: "calc_string_length", semantic: "String length", return_type: "U64", child_constraints: "1 String child node" },
677
- { element_type: "node", type_name: "calc_string_contains", semantic: "String contains (returns Bool)", return_type: "Bool", child_constraints: "2 String child nodes" },
678
- { element_type: "node", type_name: "calc_string_nocase_contains", semantic: "String contains (case-insensitive, returns Bool)", return_type: "Bool", child_constraints: "2 String child nodes" },
679
- { element_type: "node", type_name: "calc_string_nocase_equal", semantic: "String equality (case-insensitive, returns Bool)", return_type: "Bool", child_constraints: "2 String child nodes" },
680
- { element_type: "node", type_name: "calc_string_indexof", semantic: "String find index", return_type: "U64", child_constraints: "2 String child nodes + order" },
681
- { element_type: "node", type_name: "calc_string_nocase_indexof", semantic: "String find index (case-insensitive)", return_type: "U64", child_constraints: "2 String child nodes + order" },
682
- { element_type: "node", type_name: "convert_number_address", semantic: "Number → Address conversion (e.g. timestamp to address)", return_type: "Address", child_constraints: "1 numeric child node" },
683
- { element_type: "node", type_name: "convert_address_number", semantic: "Address → Number conversion", return_type: "U256", child_constraints: "1 Address child node" },
684
- { element_type: "node", type_name: "convert_number_string", semantic: "Number → String conversion", return_type: "String", child_constraints: "1 numeric child node" },
685
- { element_type: "node", type_name: "convert_string_number", semantic: "String → Number conversion", return_type: "U256", child_constraints: "1 String child node" },
686
- { element_type: "node", type_name: "convert_safe_u8", semantic: "Safe conversion to U8 (errors on overflow)", return_type: "U8", child_constraints: "1 numeric child node" },
687
- { element_type: "node", type_name: "convert_safe_u16", semantic: "Safe conversion to U16", return_type: "U16", child_constraints: "1 numeric child node" },
688
- { element_type: "node", type_name: "convert_safe_u32", semantic: "Safe conversion to U32", return_type: "U32", child_constraints: "1 numeric child node" },
689
- { element_type: "node", type_name: "convert_safe_u64", semantic: "Safe conversion to U64", return_type: "U64", child_constraints: "1 numeric child node" },
690
- { element_type: "node", type_name: "convert_safe_u128", semantic: "Safe conversion to U128", return_type: "U128", child_constraints: "1 numeric child node" },
691
- { element_type: "node", type_name: "convert_safe_u256", semantic: "Safe conversion to U256", return_type: "U256", child_constraints: "1 numeric child node" },
692
- { element_type: "node", type_name: "value_type", semantic: "Returns the value's type identifier (U8) — used for dynamic type checking", return_type: "U8", child_constraints: "1 variable child node" },
693
- { element_type: "node", type_name: "vec_length", semantic: "Vector length", return_type: "U64", child_constraints: "1 vec child node" },
694
- { element_type: "node", type_name: "vec_contains_bool", semantic: "Whether the vector contains a Bool value", return_type: "Bool", child_constraints: "1 VecBool + 1 Bool" },
695
- { element_type: "node", type_name: "vec_contains_address", semantic: "Whether the vector contains an Address (whitelist check)", return_type: "Bool", child_constraints: "1 VecAddress + 1 Address" },
696
- { element_type: "node", type_name: "vec_contains_string", semantic: "Whether the vector contains a String", return_type: "Bool", child_constraints: "1 VecString + 1 String" },
697
- { element_type: "node", type_name: "vec_contains_string_nocase", semantic: "Whether the vector contains a String (case-insensitive)", return_type: "Bool", child_constraints: "1 VecString + 1 String" },
698
- { element_type: "node", type_name: "vec_contains_number", semantic: "Whether the vector contains a number", return_type: "Bool", child_constraints: "1 Vec* + 1 Number" },
699
- { element_type: "node", type_name: "vec_indexof_bool", semantic: "Bool vector find index", return_type: "U64", child_constraints: "VecBool + Bool + order" },
700
- { element_type: "node", type_name: "vec_indexof_address", semantic: "Address vector find index", return_type: "U64", child_constraints: "VecAddress + Address + order" },
701
- { element_type: "node", type_name: "vec_indexof_string", semantic: "String vector find index", return_type: "U64", child_constraints: "VecString + String + order" },
702
- { element_type: "node", type_name: "vec_indexof_string_nocase", semantic: "String vector find index (case-insensitive)", return_type: "U64", child_constraints: "VecString + String + order" },
703
- { element_type: "node", type_name: "vec_indexof_number", semantic: "Numeric vector find index", return_type: "U64", child_constraints: "Vec* + Number + order" },
704
- { element_type: "node", type_name: "query_reward_record_find", semantic: "Query reward claim records (returns the found record)", return_type: "Bool", child_constraints: "Requires object + recipient + where + find" },
705
- { element_type: "node", type_name: "query_reward_record_count", semantic: "Query reward claim record count (U64)", return_type: "U64", child_constraints: "Requires object + recipient (optional)" },
706
- { element_type: "node", type_name: "query_reward_record_exists", semantic: "Query whether a reward claim record exists (Bool)", return_type: "Bool", child_constraints: "Requires object + recipient (optional)" },
707
- { element_type: "node", type_name: "query_progress_history_find", semantic: "Query whether a specified session exists in Progress history", return_type: "Bool", child_constraints: "Requires object + where + find" },
708
- { element_type: "node", type_name: "query_progress_history_session_find", semantic: "Query a Progress session", return_type: "Bool", child_constraints: "Requires object + historyIdx + where + find" },
709
- { element_type: "node", type_name: "query_progress_history_session_forward_find", semantic: "Query whether a specified forward exists in a Progress session", return_type: "Bool", child_constraints: "Requires object + historyIdx + sessionIdx + where + find" },
710
- { element_type: "node", type_name: "query_progress_history_session_count", semantic: "Query the number of Progress sessions", return_type: "U64", child_constraints: "Requires object + historyIdx" },
711
- { element_type: "node", type_name: "query_progress_history_session_forward_count", semantic: "Query the number of forwards in a Progress session", return_type: "U64", child_constraints: "Requires object + historyIdx + sessionIdx" },
712
- { element_type: "node", type_name: "query_progress_history_session_forward_retained_submission_count", semantic: "Query the retained submission count of a forward in a Progress session", return_type: "U64", child_constraints: "Requires object + historyIdx + sessionIdx + forwardIdx" },
713
- { element_type: "witness", type_name: "TypeOrderProgress", semantic: "Reads the order.progress field from an Order address to derive Progress (100, single hop)", data_source_class: "Type2_WitnessDerived", discovery_tool: "wowok_buildin_info(info='guard instructions')" },
714
- { element_type: "witness", type_name: "TypeOrderMachine", semantic: "Reads the order.machine field from an Order address to derive Machine (101, single hop)", data_source_class: "Type2_WitnessDerived" },
715
- { element_type: "witness", type_name: "TypeOrderService", semantic: "Reads the order.service field from an Order address to derive Service (102, single hop)", data_source_class: "Type2_WitnessDerived" },
716
- { element_type: "witness", type_name: "TypeProgressMachine", semantic: "Reads the progress.machine field from a Progress address to derive Machine (103, single hop)", data_source_class: "Type2_WitnessDerived" },
717
- { element_type: "witness", type_name: "TypeArbOrder", semantic: "Reads the arb.order field from an Arb address to derive Order (104, single hop)", data_source_class: "Type2_WitnessDerived" },
718
- { element_type: "witness", type_name: "TypeArbArbitration", semantic: "Reads the arb.arbitration field from an Arb address to derive the parent Arbitration service (105, single hop)", data_source_class: "Type2_WitnessDerived" },
719
- { element_type: "witness", type_name: "TypeArbProgress", semantic: "Derives from Arb in two hops: arb.order → order.progress (106, multi-hop)", data_source_class: "Type2_WitnessDerived" },
720
- { element_type: "witness", type_name: "TypeArbMachine", semantic: "Derives from Arb in two hops: arb.order → order.machine (107, multi-hop)", data_source_class: "Type2_WitnessDerived" },
721
- { element_type: "witness", type_name: "TypeArbService", semantic: "Derives from Arb in two hops: arb.order → order.service (108, multi-hop)", data_source_class: "Type2_WitnessDerived" },
722
- { element_type: "context", type_name: "Signer", semantic: "Current transaction signer address (TransactionContext.sender())", return_type: "Address", data_source_class: "Type4_SystemContext" },
723
- { element_type: "context", type_name: "Clock", semantic: "Current on-chain timestamp (reads timestamp_ms of WOW_CLOCK_OBJECT_ID 0x6)", return_type: "U64", data_source_class: "Type4_SystemContext" },
724
- { element_type: "context", type_name: "Guard", semantic: "ObjectID of the Guard object currently being verified (self-reference, rare)", return_type: "Address", data_source_class: "Type4_SystemContext" },
725
- { element_type: "table_entry", type_name: "Bool", semantic: "Boolean constant or submission" },
726
- { element_type: "table_entry", type_name: "Address", semantic: "Address constant (Type1) or submission (Type3). Object address type" },
727
- { element_type: "table_entry", type_name: "String", semantic: "String constant or submission" },
728
- { element_type: "table_entry", type_name: "U8", semantic: "8-bit unsigned integer" },
729
- { element_type: "table_entry", type_name: "U16", semantic: "16-bit unsigned integer" },
730
- { element_type: "table_entry", type_name: "U32", semantic: "32-bit unsigned integer" },
731
- { element_type: "table_entry", type_name: "U64", semantic: "64-bit unsigned integer (commonly used for timestamps)" },
732
- { element_type: "table_entry", type_name: "U128", semantic: "128-bit unsigned integer" },
733
- { element_type: "table_entry", type_name: "U256", semantic: "256-bit unsigned integer (auto-widening target for numeric operations)" },
734
- { element_type: "table_entry", type_name: "VecAddress", semantic: "Address vector (used for whitelists, Type1 constant)" },
735
- { element_type: "table_entry", type_name: "VecString", semantic: "String vector" },
736
- { element_type: "table_entry", type_name: "VecU64", semantic: "U64 vector" },
737
- { element_type: "table_entry", type_name: "VecU8", semantic: "U8 vector (raw bytes)" },
738
- { element_type: "table_entry", type_name: "Value", semantic: "Dynamic type (19, first byte is the type identifier) — used for Repository data, EntityRegistrar records, Passport submission value" },
739
- { element_type: "rely", type_name: "rely_and", semantic: "Depends on other Guards, AND logic (all must pass). Depended-on Guards must have rep=true", child_constraints: "At most 4 dependencies, each with rep=true (repository.data query does not depend on submission)" },
740
- { element_type: "rely", type_name: "rely_or", semantic: "Depends on other Guards, OR logic (any one passing is sufficient). Depended-on Guards must have rep=true", child_constraints: "At most 4 dependencies, each with rep=true" },
741
- ];
742
- export const GUARD_CONSTRAINT_RULES = [
743
- {
744
- id: "ROOT_01",
745
- name: "root returns Bool",
746
- description: "The Guard root node must return a Bool type",
747
- category: "root",
748
- phase: "creation",
749
- validation_logic: "root.node_type must be in the allowedTypes list (logic_*, calc_string_contains, vec_contains_*, query_reward_record_exists, query[Bool return], identifier[Bool type])",
750
- failure_message: "Guard root node must be an operation that returns Bool",
751
- verification_location: "SDK buildNode(root, ValueType.Bool, ...)",
752
- pitfall_number: 7,
753
- },
754
- {
755
- id: "TABLE_01",
756
- name: "identifier uniqueness",
757
- description: "Each identifier in the table must be unique (0-255)",
758
- category: "table",
759
- phase: "creation",
760
- validation_logic: "No duplicate identifiers in the table",
761
- failure_message: "Duplicate table identifier",
762
- verification_location: "SDK lodash groupBy",
763
- },
764
- {
765
- id: "TABLE_02",
766
- name: "identifier referential integrity",
767
- description: "Every identifier node in the computation tree must exist in the table",
768
- category: "table",
769
- phase: "creation",
770
- validation_logic: "Traverse the computation tree; each identifier node's index exists in the table",
771
- failure_message: "Identifier not found in table",
772
- verification_location: "SDK buildNode",
773
- pitfall_number: 1,
774
- },
775
- {
776
- id: "TABLE_03",
777
- name: "Constant entries must have a value",
778
- description: "Entries with b_submission=false must have a value field",
779
- category: "table",
780
- phase: "creation",
781
- validation_logic: "All entries with b_submission=false have a non-empty value field",
782
- failure_message: "Constant table entry must have a value",
783
- verification_location: "SDK operate",
784
- },
785
- {
786
- id: "TABLE_04",
787
- name: "table size limit",
788
- description: "At most 256 entries; serialized size must not exceed 40000 bytes",
789
- category: "table",
790
- phase: "creation",
791
- validation_logic: "table.length <= 256 && serialize(table).length <= 40000",
792
- failure_message: "Table exceeds size limit (256 entries or 40000 bytes)",
793
- verification_location: "Move guard::new",
794
- },
795
- {
796
- id: "TABLE_05",
797
- name: "submission entry value is 1 byte (type code only)",
798
- description: "Entries with b_submission=true have a serialized value of just 1 byte (the type code)",
799
- category: "table",
800
- phase: "creation",
801
- validation_logic: "When b_submission=true, bcsValue.length === 1 and bcsValue[0] === valueType",
802
- failure_message: "Submission table entry value must be 1 byte (type code only)",
803
- verification_location: "native deserialize_constants",
804
- },
805
- {
806
- id: "QUERY_01",
807
- name: "query instruction valid",
808
- description: "The query field of a query node must be a valid GUARDQUERY ID or name",
809
- category: "query",
810
- phase: "creation",
811
- validation_logic: "The query field exists in GUARDQUERY (via isValidGuardQueryIdOrName)",
812
- failure_message: "Invalid Guard query instruction",
813
- verification_location: "SDK getGuardQueryInfo",
814
- pitfall_number: 3,
815
- },
816
- {
817
- id: "QUERY_02",
818
- name: "query parameter count match",
819
- description: "The number and types of parameters in a query node must match the instruction definition",
820
- category: "query",
821
- phase: "creation",
822
- validation_logic: "parameters.length === instruction.parameters.length && type-compatible",
823
- failure_message: "Query parameter count or type mismatch",
824
- verification_location: "SDK buildNode",
825
- pitfall_number: 3,
826
- },
827
- {
828
- id: "QUERY_03",
829
- name: "query return type compatible",
830
- description: "The return type of a query node must be compatible with the parent node's expected type",
831
- category: "query",
832
- phase: "creation",
833
- validation_logic: "checkType(query.return_type, parent.expected_type)",
834
- failure_message: "Query return type incompatible with parent node",
835
- verification_location: "SDK checkType",
836
- },
837
- {
838
- id: "QUERY_04",
839
- name: "query object identifier's value_type is Address",
840
- description: "The table entry referenced by query node's object.identifier must have value_type of Address",
841
- category: "query",
842
- phase: "creation",
843
- validation_logic: "table[object.identifier].value_type === Address",
844
- failure_message: "Query object identifier must reference an Address-type table entry",
845
- verification_location: "SDK buildNode L603-609",
846
- },
847
- {
848
- id: "WITNESS_01",
849
- name: "witness type valid",
850
- description: "convert_witness must be a valid WitnessType (100-108)",
851
- category: "witness",
852
- phase: "creation",
853
- validation_logic: "The witness value is within the range allowed by WitnessTypeSchema (100-108)",
854
- failure_message: "Invalid witness type",
855
- verification_location: "SDK isWitnessType",
856
- pitfall_number: 4,
857
- },
858
- {
859
- id: "WITNESS_02",
860
- name: "witness target matches query objectType",
861
- description: "The witness's target type must match the query instruction's objectType",
862
- category: "witness",
863
- phase: "creation",
864
- validation_logic: "witness.target_type === instruction.objectType",
865
- failure_message: "Witness target type does not match query object type",
866
- verification_location: "SDK buildNode L613-619",
867
- pitfall_number: 4,
868
- },
869
- {
870
- id: "WITNESS_03",
871
- name: "witness source matches tableItem object_type",
872
- description: "The witness's source type must match the object_type declared in the table entry (if declared)",
873
- category: "witness",
874
- phase: "creation",
875
- validation_logic: "table[identifier].object_type === witness.source_type (if tableItem.object_type is declared)",
876
- failure_message: "Witness source type does not match table entry object_type",
877
- verification_location: "SDK buildNode L622-631",
878
- pitfall_number: 4,
879
- },
880
- {
881
- id: "RELY_01",
882
- name: "rely dependency count ≤ 4",
883
- description: "rely.guards supports at most 4 dependencies (MAX_DEPENDED_COUNT)",
884
- category: "rely",
885
- phase: "creation",
886
- validation_logic: "rely.guards.length <= 4",
887
- failure_message: "Rely dependencies exceed limit (4)",
888
- verification_location: "SDK reliesAdd",
889
- },
890
- {
891
- id: "RELY_02",
892
- name: "rely dependency rep=true",
893
- description: "All rely-depended Guards must have rep=true (repository.data query does not depend on runtime submission)",
894
- category: "rely",
895
- phase: "creation",
896
- validation_logic: "Query each depended Guard's rep field; must be true",
897
- failure_message: "Rely dependency has rep=false (not standalone)",
898
- verification_location: "Move guard::relies_add",
899
- pitfall_number: 8,
900
- },
901
- {
902
- id: "RELY_03",
903
- name: "rely forbids self-reference",
904
- description: "A Guard cannot depend on itself",
905
- category: "rely",
906
- phase: "creation",
907
- validation_logic: "rely.guards does not contain the current Guard's address",
908
- failure_message: "Guard cannot rely on itself",
909
- verification_location: "SDK reliesAdd",
910
- },
911
- {
912
- id: "BINDING_01",
913
- name: "voting_guard GuardIdentifier numeric",
914
- description: "The table entry referenced by Arbitration voting_guard's GuardIdentifier must be of a numeric type",
915
- category: "binding",
916
- phase: "creation",
917
- validation_logic: "If binding=voting_guard, the table entry pointed to by GuardIdentifier has value_type in [U8,U16,U32,U64,U128,U256]",
918
- failure_message: "E_GUARD_IDENTIFIER_NOT_NUMBER: voting_guard weight must be numeric",
919
- verification_location: "Move Arbitration",
920
- pitfall_number: 9,
921
- },
922
- {
923
- id: "BINDING_02",
924
- name: "Repository id_from_submission Address",
925
- description: "The table entry referenced by Repository write_guard's id_from_submission must be of Address type",
926
- category: "binding",
927
- phase: "creation",
928
- validation_logic: "If binding=write_guard and id_from_submission is set, table[id_from_submission].value_type === Address",
929
- failure_message: "Repository id_from_submission must be Address type",
930
- verification_location: "Move Repository",
931
- },
932
- {
933
- id: "BINDING_03",
934
- name: "Repository data_from_submission type match",
935
- description: "The table entry referenced by Repository write_guard's data_from_submission must match the Repository value_type",
936
- category: "binding",
937
- phase: "creation",
938
- validation_logic: "If binding=write_guard and data_from_submission is set, table[data_from_submission].value_type === Repository.value_type",
939
- failure_message: "Repository data_from_submission type mismatch",
940
- verification_location: "Move Repository",
941
- },
942
- {
943
- id: "INPUT_01",
944
- name: "root byte stream non-empty",
945
- description: "The serialized byte stream of root cannot be empty",
946
- category: "input",
947
- phase: "creation",
948
- validation_logic: "input.length > 0",
949
- failure_message: "Input cannot be empty",
950
- verification_location: "SDK newGuard",
951
- },
952
- {
953
- id: "INPUT_02",
954
- name: "root byte stream ≤ MAX_INPUT_SIZE",
955
- description: "The serialized byte stream of root must not exceed MAX_INPUT_SIZE",
956
- category: "input",
957
- phase: "creation",
958
- validation_logic: "input.length <= MAX_INPUT_SIZE",
959
- failure_message: "Input size exceeds maximum limit",
960
- verification_location: "SDK newGuard",
961
- },
962
- {
963
- id: "IMMUTABLE_01",
964
- name: "Guard immutable=true after creation",
965
- description: "After creation, a Guard cannot be modified or deleted (CREATE-only)",
966
- category: "immutable",
967
- phase: "creation",
968
- validation_logic: "After guard::create, the immutable field is set to true",
969
- failure_message: "Guard is immutable after creation",
970
- verification_location: "Move guard::create",
971
- },
972
- {
973
- id: "RUN_IMMUTABLE_01",
974
- name: "Guard must be immutable=true to verify",
975
- description: "At runtime verification, the Guard must be frozen (immutable=true)",
976
- category: "immutable",
977
- phase: "runtime",
978
- validation_logic: "guard.immutable === true",
979
- failure_message: "Guard must be immutable to verify",
980
- verification_location: "native verify_guard L497-506",
981
- },
982
- {
983
- id: "RUN_SUB_01",
984
- name: "submission type byte matches table declaration",
985
- description: "The value[0] (type byte) of submission must match the value_type declared in the table",
986
- category: "table",
987
- phase: "runtime",
988
- validation_logic: "submission_value[0] === table[identifier].value_type",
989
- failure_message: "Submission type byte does not match table declaration",
990
- verification_location: "native parse_table_items L306",
991
- },
992
- {
993
- id: "RUN_SUB_02",
994
- name: "table entries with b_submission=true must be found in submission",
995
- description: "All table entries declared as submitted must have corresponding submission data",
996
- category: "table",
997
- phase: "runtime",
998
- validation_logic: "forall identifier in table where b_submission=true: identifier in submission_map",
999
- failure_message: "Missing submission for declared b_submission=true table entry",
1000
- verification_location: "native parse_table_items L301-321",
1001
- },
1002
- {
1003
- id: "RUN_SUB_03",
1004
- name: `submission total bytes ≤ MAX_SUBMISSION_SIZE_PASSPORT (${MAX_SUBMISSION_SIZE_PASSPORT})`,
1005
- description: `The total bytes of all data submitted at runtime must not exceed ${MAX_SUBMISSION_SIZE_PASSPORT}`,
1006
- category: "table",
1007
- phase: "runtime",
1008
- validation_logic: `total_submission_bytes <= ${MAX_SUBMISSION_SIZE_PASSPORT}`,
1009
- failure_message: `Submission exceeds MAX_SUBMISSION_SIZE_PASSPORT (${MAX_SUBMISSION_SIZE_PASSPORT} bytes)`,
1010
- verification_location: "Move verify L252",
1011
- },
1012
- {
1013
- id: "RUN_WITNESS_01",
1014
- name: "witness derivation source object must have the required relation field",
1015
- description: "When witness conversion occurs, the source object must contain the relation field needed for derivation",
1016
- category: "witness",
1017
- phase: "runtime",
1018
- validation_logic: "The source object exists and contains the field required for witness derivation (e.g. order.progress field is non-empty)",
1019
- failure_message: "Witness source object missing required field for derivation",
1020
- verification_location: "native convert_witness",
1021
- },
1022
- {
1023
- id: "RUN_WITNESS_02",
1024
- name: "witness-derived target object must exist",
1025
- description: "The target object derived by witness must exist on-chain",
1026
- category: "witness",
1027
- phase: "runtime",
1028
- validation_logic: "The derived target object ID exists on-chain",
1029
- failure_message: "Witness derived target object does not exist",
1030
- verification_location: "native convert_witness",
1031
- },
1032
- {
1033
- id: "RUN_QUERY_01",
1034
- name: "query target object must exist and type match",
1035
- description: "The target object of a query must exist on-chain and its type must match",
1036
- category: "query",
1037
- phase: "runtime",
1038
- validation_logic: "Target object exists && object type matches query.objectType",
1039
- failure_message: "Query target object does not exist or type mismatch",
1040
- verification_location: "native process_object_query",
1041
- },
1042
- {
1043
- id: "RUN_IMPACK_01",
1044
- name: "at least one impack guard",
1045
- description: "Passport verification requires at least one impack guard",
1046
- category: "runtime",
1047
- phase: "runtime",
1048
- validation_logic: "impack_list.length >= 1 (note: impack_list is always empty during verify phase; this constraint is checked in result_for_permission phase)",
1049
- failure_message: "No impack guard found",
1050
- verification_location: "Move verify L281",
1051
- },
1052
- {
1053
- id: "RUN_IMPACK_02",
1054
- name: "impack guard failure fails the entire passport",
1055
- description: "If any impack guard verification fails, the entire passport verification fails",
1056
- category: "runtime",
1057
- phase: "runtime",
1058
- validation_logic: "forall guard in impack_list: guard.result === true",
1059
- failure_message: "Impack guard verification failed",
1060
- verification_location: "Move verify L270-275",
1061
- },
1062
- {
1063
- id: "RUN_TX_01",
1064
- name: "Passport tx_hash must match the current transaction",
1065
- description: "The tx_hash recorded in the Passport must match the hash of the currently executing transaction",
1066
- category: "runtime",
1067
- phase: "runtime",
1068
- validation_logic: "passport.tx_hash === current_tx_hash",
1069
- failure_message: "Passport tx_hash does not match current transaction",
1070
- verification_location: "Move verify L231",
1071
- },
1072
- {
1073
- id: "RUN_RELY_01",
1074
- name: "rely guard must have been added to passport",
1075
- description: "Guards relied on must have been registered in the passport",
1076
- category: "rely",
1077
- phase: "runtime",
1078
- validation_logic: "forall guard in rely.guards: guard in passport.relies",
1079
- failure_message: "Rely guard not added to passport",
1080
- verification_location: "Move calculate_relies_result",
1081
- },
1082
- ];
1083
- export function matchSemanticPattern(userIntent) {
1084
- const lower = userIntent.toLowerCase();
1085
- return SEMANTIC_TO_SCHEMA_RULES.filter((rule) => rule.match_keywords.some((kw) => lower.includes(kw.toLowerCase())));
1086
- }
1087
- export function explainNode(nodeType) {
1088
- return SCHEMA_TO_SEMANTIC_RULES.find((r) => r.element_type === "node" && r.type_name === nodeType);
1089
- }
1090
- export function explainWitness(witnessType) {
1091
- const witnessMap = {
1092
- 100: "TypeOrderProgress",
1093
- 101: "TypeOrderMachine",
1094
- 102: "TypeOrderService",
1095
- 103: "TypeProgressMachine",
1096
- 104: "TypeArbOrder",
1097
- 105: "TypeArbArbitration",
1098
- 106: "TypeArbProgress",
1099
- 107: "TypeArbMachine",
1100
- 108: "TypeArbService",
1101
- };
1102
- const name = witnessMap[witnessType];
1103
- return SCHEMA_TO_SEMANTIC_RULES.find((r) => r.element_type === "witness" && r.type_name === name);
1104
- }
1105
- export function explainContext(contextType) {
1106
- return SCHEMA_TO_SEMANTIC_RULES.find((r) => r.element_type === "context" && r.type_name === contextType);
1107
- }
1108
- export function getConstraintsByCategory(category) {
1109
- return GUARD_CONSTRAINT_RULES.filter((r) => r.category === category);
1110
- }
1111
- export function getConstraintsByPhase(phase) {
1112
- return GUARD_CONSTRAINT_RULES.filter((r) => r.phase === phase);
1113
- }
1114
- export function getPatternById(id) {
1115
- return SEMANTIC_TO_SCHEMA_RULES.find((r) => r.id === id);
1116
- }
1117
- export function getDataSourceCombinations() {
1118
- return [...new Set(SEMANTIC_TO_SCHEMA_RULES.map((r) => r.data_source_combination))];
1119
- }
1
+ import{MAX_SUBMISSION_SIZE_PASSPORT}from'@wowok/wowok';export const SEMANTIC_TO_SCHEMA_RULES=[{'id':'P02','pattern_name':'Query\x20published\x20object\x20+\x20system\x20context','data_source_combination':'Type1\x20+\x20Type4','semantic_intent':'Query\x20published\x20on-chain\x20object\x20fields\x20and\x20compare\x20with\x20system\x20context','match_keywords':['paused','published','service\x20status','machine\x20status','paused','published'],'schema_elements':{'root_type':'logic_equal\x20/\x20logic_and','table_entries':[{'value_type':'Address','b_submission':![],'purpose':'Published\x20object\x20address\x20constant\x20(Type1)'}],'context_nodes':[{'context_type':'Signer','purpose':'Optional:\x20identity\x20validation'}],'tree_structure':'logic_equal(query(<instruction>,\x20object:\x20{\x20identifier:\x200\x20}),\x20identifier[1]\x20or\x20context(Signer))'},'constraints':['The\x20object_type\x20of\x20table[0]\x20must\x20match\x20the\x20target\x20object\x20type\x20of\x20the\x20query\x20instruction','The\x20query\x20return\x20type\x20must\x20be\x20compatible\x20with\x20the\x20comparison\x20object','The\x20object\x20must\x20be\x20published\x20(published=true)\x20to\x20ensure\x20fields\x20are\x20immutable'],'example':{'root':{'type':'logic_equal','nodes':[{'type':'query','query':'service.paused','object':{'identifier':0x0},'parameters':[]},{'type':'identifier','identifier':0x1}]},'table':[{'identifier':0x0,'b_submission':![],'value_type':'Address','value':'0xSERVICE','name':'Service\x20object\x20address'},{'identifier':0x1,'b_submission':![],'value_type':'Bool','value':![],'name':'Expected\x20paused\x20state\x20(false=not\x20paused)'}]}},{'id':'P03','pattern_name':'Identity\x20check\x20(single\x20address)','data_source_combination':'Type4\x20+\x20Type1\x20constant','semantic_intent':'Only\x20a\x20specific\x20address\x20can\x20perform\x20the\x20operation','match_keywords':['only','allow','authorize','identity','specified\x20address','signer'],'schema_elements':{'root_type':'logic_equal','table_entries':[{'value_type':'Address','b_submission':![],'purpose':'Authorized\x20address\x20constant\x20(Type1\x20constant)'}],'context_nodes':[{'context_type':'Signer','purpose':'Current\x20transaction\x20signer\x20(Type4)'}],'tree_structure':'logic_equal(context(Signer),\x20identifier[0])'},'constraints':['root\x20must\x20be\x20logic_equal\x20(returns\x20Bool)','table[0]\x20must\x20be\x20Address\x20type,\x20b_submission=false','context(Signer)\x20returns\x20the\x20current\x20transaction\x20signer\x20address'],'example':{'root':{'type':'logic_equal','nodes':[{'type':'context','context':'Signer'},{'type':'identifier','identifier':0x0}]},'table':[{'identifier':0x0,'b_submission':![],'value_type':'Address','value':'0xabc...','name':'Authorized\x20operator\x20address'}]}},{'id':'P04','pattern_name':'Identity\x20check\x20(whitelist)','data_source_combination':'Type4\x20+\x20Type1\x20constant\x20(VecAddress)','semantic_intent':'Addresses\x20in\x20the\x20whitelist\x20can\x20perform\x20this\x20operation','match_keywords':['whitelist','multiple\x20addresses','list','allowlist','roster'],'schema_elements':{'root_type':'vec_contains_address','table_entries':[{'value_type':'VecAddress','b_submission':![],'purpose':'Authorized\x20address\x20list\x20(Type1\x20constant)'}],'context_nodes':[{'context_type':'Signer','purpose':'Signer\x20being\x20looked\x20up\x20(Type4)'}],'tree_structure':'vec_contains_address(identifier[0],\x20context(Signer))'},'constraints':['root\x20vec_contains_address\x20returns\x20Bool','table[0]\x20must\x20be\x20VecAddress\x20type','context(Signer)\x20is\x20the\x20element\x20being\x20looked\x20up'],'example':{'root':{'type':'vec_contains_address','nodes':[{'type':'identifier','identifier':0x0},{'type':'context','context':'Signer'}]},'table':[{'identifier':0x0,'b_submission':![],'value_type':'VecAddress','value':['0xabc...','0xdef...'],'name':'Authorized\x20address\x20whitelist'}]}},{'id':'P05','pattern_name':'Time\x20lock','data_source_combination':'Type2\x20+\x20Type4\x20+\x20Type1\x20constant','semantic_intent':'This\x20operation\x20can\x20only\x20be\x20executed\x20after\x20waiting\x20N\x20milliseconds','match_keywords':['wait','time','lock','delay','hours','days','milliseconds'],'schema_elements':{'root_type':'logic_as_u256_greater_or_equal','table_entries':[{'value_type':'Address','b_submission':!![],'purpose':'Source\x20object\x20address\x20(e.g.\x20Order,\x20Type3)\x20or\x20constant\x20(Type1)'},{'value_type':'U64','b_submission':![],'purpose':'Lock\x20duration\x20(in\x20milliseconds,\x201000\x20for\x20tests,\x20Type1\x20constant)'}],'query_nodes':[{'query_name':'progress.current_time','object_type':'Progress','convert_witness':0x64}],'context_nodes':[{'context_type':'Clock','purpose':'Current\x20on-chain\x20timestamp\x20(Type4)'}],'tree_structure':'logic_as_u256_greater_or_equal(context(Clock),\x20calc_number_add(query(1272:\x20progress.current_time,\x20witness=100,\x20identifier[0]),\x20identifier[1]))'},'constraints':['Time\x20unit\x20is\x20milliseconds;\x20use\x201000ms\x20for\x20tests\x20and\x20adjust\x20in\x20production','convert_witness=100\x20(TypeOrderProgress)\x20converts\x20from\x20Order\x20to\x20Progress','The\x20object_type\x20of\x20table[0]\x20must\x20match\x20the\x20witness\x20source\x20type\x20(Order)','calc_number_add\x20returns\x20U256,\x20context(Clock)\x20returns\x20U64,\x20auto-widened','Key:\x20use\x20progress.current_time(1272)\x20rather\x20than\x20progress.session.forward.time(1271);\x20the\x20latter\x20querying\x20an\x20unforwarded\x20session\x20returns\x200\x20and\x20disables\x20the\x20time\x20lock'],'example':{'root':{'type':'logic_as_u256_greater_or_equal','nodes':[{'type':'context','context':'Clock'},{'type':'calc_number_add','nodes':[{'type':'query','query':'progress.current_time','object':{'identifier':0x0,'convert_witness':0x64},'parameters':[]},{'type':'identifier','identifier':0x1}]}]},'table':[{'identifier':0x0,'b_submission':!![],'value_type':'Address','name':'Target\x20Order\x20address','object_type':'Order'},{'identifier':0x1,'b_submission':![],'value_type':'U64','value':0x3e8,'name':'Lock\x20duration\x20(milliseconds)'}]}},{'id':'P06','pattern_name':'Progress\x20state\x20check','data_source_combination':'Type2\x20+\x20Type1\x20constant','semantic_intent':'The\x20order\x20progress\x20must\x20reach\x20the\x20specified\x20node\x20before\x20this\x20operation\x20can\x20be\x20executed','match_keywords':['progress','node','state','completed','reach','current\x20node'],'schema_elements':{'root_type':'logic_equal','table_entries':[{'value_type':'Address','b_submission':!![],'purpose':'Source\x20Order\x20address\x20(Type3,\x20witness\x20source)'},{'value_type':'String','b_submission':![],'purpose':'Expected\x20node\x20name\x20(Type1\x20constant)'}],'query_nodes':[{'query_name':'progress.current','object_type':'Progress','convert_witness':0x64}],'tree_structure':'logic_equal(query(1253:\x20progress.current,\x20witness=100,\x20identifier[0]),\x20identifier[1])'},'constraints':['query\x20returns\x20String;\x20identifier[1]\x20must\x20be\x20String\x20type','logic_equal\x20comparison\x20on\x20String\x20is\x20case-sensitive','For\x20case-insensitive\x20comparison,\x20use\x20logic_string_nocase_equal','convert_witness=100\x20(TypeOrderProgress)\x20converts\x20from\x20Order','Type2\x20stacks\x20on\x20Type3:\x20the\x20source\x20object\x20Order\x20is\x20submitted\x20(b_submission=true)'],'example':{'root':{'type':'logic_equal','nodes':[{'type':'query','query':'progress.current','object':{'identifier':0x0,'convert_witness':0x64},'parameters':[]},{'type':'identifier','identifier':0x1}]},'table':[{'identifier':0x0,'b_submission':!![],'value_type':'Address','name':'Target\x20Order\x20address','object_type':'Order'},{'identifier':0x1,'b_submission':![],'value_type':'String','value':'Completed','name':'Expected\x20progress\x20node\x20name'}]}},{'id':'P07','pattern_name':'One-time\x20claim\x20check','data_source_combination':'Type3\x20+\x20Type1\x20constant','semantic_intent':'Users\x20can\x20only\x20claim\x20the\x20reward\x20once','match_keywords':['once','claim','duplicate','already\x20claimed','claimed\x20before'],'schema_elements':{'root_type':'logic_equal','table_entries':[{'value_type':'Address','b_submission':!![],'purpose':'Reward\x20object\x20address\x20(Type3,\x20submitted)'},{'value_type':'U64','b_submission':![],'purpose':'Expected\x20historical\x20claim\x20count\x200\x20(Type1\x20constant)'}],'query_nodes':[{'query_name':'reward.record.count','object_type':'Reward'}],'tree_structure':'logic_equal(query_reward_record_count(object:\x20{\x20identifier:\x200\x20},\x20recipient:\x20context(Signer)),\x20identifier[1])'},'constraints':['query_reward_record_count\x20returns\x20U64','Comparing\x20count\x20==\x200\x20means\x20no\x20history\x20record\x20(can\x20claim)','recipient\x20defaults\x20to\x20context(Signer)\x20to\x20ensure\x20the\x20claimer\x27s\x20identity\x20is\x20bound','Type3\x20submitted\x20objects\x20must\x20have\x20constraint\x20rules\x20(here\x20the\x20constraint\x20is\x20count==0\x20and\x20recipient=Signer)'],'example':{'root':{'type':'logic_equal','nodes':[{'type':'query_reward_record_count','object':{'identifier':0x0}},{'type':'identifier','identifier':0x1}]},'table':[{'identifier':0x0,'b_submission':!![],'value_type':'Address','name':'Reward\x20object\x20address','object_type':'Reward'},{'identifier':0x1,'b_submission':![],'value_type':'U64','value':0x0,'name':'Expected\x20historical\x20claim\x20count\x20(0)'}]}},{'id':'P08','pattern_name':'Submitted\x20object\x20identity\x20validation','data_source_combination':'Type3\x20+\x20Type4','semantic_intent':'Verify\x20that\x20the\x20owner\x20of\x20the\x20submitted\x20object\x20matches\x20the\x20signer','match_keywords':['ownership','belonging','customer','submitted\x20object','order.customer'],'schema_elements':{'root_type':'logic_equal','table_entries':[{'value_type':'Address','b_submission':!![],'purpose':'Submitted\x20Order\x20address\x20(Type3)'}],'context_nodes':[{'context_type':'Signer','purpose':'Current\x20signer\x20(Type4),\x20compared\x20with\x20order.customer'}],'query_nodes':[{'query_name':'order.customer','object_type':'Order'}],'tree_structure':'logic_equal(query(1550:\x20order.customer,\x20object:\x20{\x20identifier:\x200\x20}),\x20context(Signer))'},'constraints':['query\x20returns\x20Address,\x20context(Signer)\x20returns\x20Address,\x20types\x20compatible','Type3\x20submitted\x20object\x20constraint:\x20indirectly\x20binds\x20submitter\x20identity\x20via\x20order.customer\x20==\x20Signer','Ensures\x20callers\x20cannot\x20submit\x20other\x20users\x27\x20Order\x20addresses'],'example':{'root':{'type':'logic_equal','nodes':[{'type':'query','query':'order.customer','object':{'identifier':0x0},'parameters':[]},{'type':'context','context':'Signer'}]},'table':[{'identifier':0x0,'b_submission':!![],'value_type':'Address','name':'User-submitted\x20Order\x20address','object_type':'Order'}]}},{'id':'P09','pattern_name':'Submitted\x20object\x20+\x20witness\x20derivation\x20query','data_source_combination':'Type3\x20+\x20Type2\x20(source\x20is\x20Type3)','semantic_intent':'User\x20submits\x20an\x20Order\x20and\x20queries\x20the\x20Progress\x20state\x20via\x20witness','match_keywords':['submit','derive','witness','order\x20to\x20progress','convert'],'schema_elements':{'root_type':'logic_equal\x20/\x20logic_and','table_entries':[{'value_type':'Address','b_submission':!![],'purpose':'Submitted\x20Order\x20address\x20(Type3,\x20witness\x20source)'},{'value_type':'String','b_submission':![],'purpose':'Expected\x20node\x20name\x20(Type1\x20constant)'}],'query_nodes':[{'query_name':'progress.current','object_type':'Progress','convert_witness':0x64}],'tree_structure':'logic_equal(query(1253:\x20progress.current,\x20object:\x20{\x20identifier:\x200,\x20convert_witness:\x20100\x20}),\x20identifier[1])'},'constraints':['Type2\x20stacks\x20on\x20Type3:\x20the\x20source\x20object\x20Order\x20has\x20b_submission=true','witness=100\x20(TypeOrderProgress)\x20derives\x20Progress\x20from\x20the\x20submitted\x20Order','query\x20returns\x20String;\x20identifier[1]\x20must\x20be\x20String\x20type','Key:\x20Type2\x20can\x20stack\x20on\x20Type1\x20or\x20Type3,\x20depending\x20on\x20the\x20source\x20object\x27s\x20b_submission'],'example':{'root':{'type':'logic_equal','nodes':[{'type':'query','query':'progress.current','object':{'identifier':0x0,'convert_witness':0x64},'parameters':[]},{'type':'identifier','identifier':0x1}]},'table':[{'identifier':0x0,'b_submission':!![],'value_type':'Address','name':'User-submitted\x20Order\x20address','object_type':'Order'},{'identifier':0x1,'b_submission':![],'value_type':'String','value':'Inspecting','name':'Expected\x20progress\x20node\x20name'}]}},{'id':'P10','pattern_name':'Multi-condition\x20combination\x20(AND/OR)','data_source_combination':'Type1\x20+\x20Type2\x20+\x20Type3\x20+\x20Type4\x20(combination)','semantic_intent':'Multiple\x20conditions\x20must\x20all\x20be\x20satisfied\x20(AND)\x20or\x20any\x20one\x20is\x20satisfied\x20(OR)','match_keywords':['and','simultaneously','all\x20satisfied','AND','and\x20also','also\x20need','or','any','OR','or','one\x20of'],'schema_elements':{'root_type':'logic_and\x20/\x20logic_or','table_entries':[],'tree_structure':'logic_and/logic_or([condition1,\x20condition2,\x20...])\x20—\x20each\x20condition\x20can\x20be\x20any\x20combination\x20of\x20P03-P09'},'constraints':['All\x20subnodes\x20of\x20logic_and/logic_or\x20must\x20return\x20Bool','Subnode\x20count\x202-8\x20(MAX_MULTI_OPERANDS)','Each\x20subcondition\x20can\x20be\x20any\x20node\x20that\x20returns\x20Bool','Multi-condition\x20combination\x20is\x20a\x20container\x20for\x20other\x20Patterns\x20and\x20does\x20not\x20stand\x20alone'],'example':{'root':{'type':'logic_and','nodes':[{},{}]}}},{'id':'P11','pattern_name':'Entity\x20registration\x20check','data_source_combination':'Type1\x20system\x20address\x20+\x20Type3','semantic_intent':'Verify\x20that\x20the\x20user\x20is\x20registered\x20in\x20the\x20entity\x20registrar','match_keywords':['register','entity','EntityRegistrar','member','certify'],'schema_elements':{'root_type':'logic_and','table_entries':[{'value_type':'Address','b_submission':![],'purpose':'EntityRegistrar\x20system\x20address\x200xaab\x20(Type1\x20system\x20address)'},{'value_type':'Address','b_submission':!![],'purpose':'User\x20address\x20(Type3,\x20submitted)'}],'query_nodes':[{'query_name':'entity.registrar.records','object_type':'EntityRegistrar'}],'tree_structure':'logic_and(query(1760:\x20entity.registrar.records,\x20object:\x20{\x20identifier:\x200\x20},\x20parameters:\x20[identifier[1]]),\x20...)'},'constraints':['EntityRegistrar\x20address\x20is\x20fixed\x20at\x200xaab\x20(system\x20address)','EntityLinker\x20address\x20is\x20fixed\x20at\x200xaaa','table[0]\x20has\x20is_system_address=true','query\x20parameters\x20must\x20match\x20the\x20instruction\x20definition'],'example':{'root':{'type':'logic_and','nodes':[{'type':'query','query':'entity.registrar.records','object':{'identifier':0x0},'parameters':[{'type':'identifier','identifier':0x1}]}]},'table':[{'identifier':0x0,'b_submission':![],'value_type':'Address','value':'0xaab','name':'EntityRegistrar\x20system\x20address'},{'identifier':0x1,'b_submission':!![],'value_type':'Address','name':'User\x20address\x20(submitted)'}]}},{'id':'P12','pattern_name':'Dynamic\x20voting\x20weight','data_source_combination':'Type3\x20+\x20Type4\x20+\x20Type1\x20constant','semantic_intent':'Voting\x20weight\x20equals\x20the\x20reputation\x20score\x20(extracted\x20from\x20submitted\x20data)','match_keywords':['weight','vote','reputation','score','voting','weight'],'schema_elements':{'root_type':'logic_and','table_entries':[{'value_type':'Address','b_submission':!![],'purpose':'Voter\x20address\x20(Type3)'},{'value_type':'U64','b_submission':!![],'purpose':'Voter\x20weight\x20(Type3,\x20extracted\x20by\x20GuardIdentifier)'}],'context_nodes':[{'context_type':'Signer','purpose':'Validate\x20voter\x20identity\x20(Type4)'}],'query_nodes':[{'query_name':'entity.registrar.records','object_type':'EntityRegistrar'}],'tree_structure':'logic_and(identity\x20check:\x20logic_equal(context(Signer),\x20identifier[0]),\x20weight\x20comparison:\x20GuardIdentifier\x20extracts\x20identifier[1])'},'constraints':['The\x20table\x20entry\x20referenced\x20by\x20GuardIdentifier\x20must\x20be\x20numeric\x20(U8-U256)','b_submission\x20must\x20be\x20true\x20(weight\x20is\x20submitted\x20at\x20runtime\x20by\x20the\x20voter)','Non-numeric\x20types\x20cause\x20E_GUARD_IDENTIFIER_NOT_NUMBER\x20error','Weight\x20value\x20is\x20cast\x20to\x20u32','voting_guard\x20scene\x20special\x20constraint:\x20GuardIdentifier\x20numeric'],'example':{'root':{'type':'logic_and','nodes':[{},{}]},'table':[{'identifier':0x0,'b_submission':!![],'value_type':'Address','name':'Voter\x20address'},{'identifier':0x1,'b_submission':!![],'value_type':'U64','name':'Voter\x20weight\x20(extracted\x20from\x20reputation\x20score)'}]}},{'id':'P13','pattern_name':'Repository\x20data\x20query','data_source_combination':'Type1\x20+\x20Type2','semantic_intent':'Query\x20Repository\x20data\x20and\x20validate','match_keywords':['Repository','storage','data\x20source','weather','external\x20data','oracle'],'schema_elements':{'root_type':'logic_and','table_entries':[{'value_type':'Address','b_submission':![],'purpose':'Repository\x20address\x20(Type1\x20constant)'}],'query_nodes':[{'query_name':'repository.data','object_type':'Repository'}],'tree_structure':'logic_and(query(1167:\x20repository.data,\x20object:\x20{\x20identifier:\x200\x20},\x20parameters:\x20[...]),\x20[data\x20validation\x20condition])'},'constraints':['quote_guard\x20is\x20a\x20RIGID\x20verification\x20requirement:\x20any\x20guard\x20querying\x20Repository\x20data\x20with\x20quote_guard\x20must\x20satisfy\x20it','Two-phase:\x20passport\x20generation\x20scans/prepares\x20quote_guard,\x20passport\x20verification\x20re-checks\x20+\x20verifies\x20(see\x20R-X1-10)','If\x20quote_guard==None:\x20no\x20access\x20control\x20—\x20Repository\x20data\x20is\x20freely\x20queryable','rep\x20semantics:\x20repository.data\x20query\x20does\x20not\x20depend\x20on\x20runtime\x20submission,\x20so\x20rep=true'],'example':{'root':{'type':'logic_and','nodes':[{'type':'query','query':'repository.data','object':{'identifier':0x0},'parameters':[{'type':'identifier','identifier':0x1}]},{}]},'table':[{'identifier':0x0,'b_submission':![],'value_type':'Address','value':'0xREPO','name':'Repository\x20address'}]}},{'id':'P14','pattern_name':'Pure\x20dependency\x20combination','data_source_combination':'None\x20(rely\x20only)','semantic_intent':'Does\x20not\x20compute\x20itself;\x20fully\x20depends\x20on\x20the\x20results\x20of\x20other\x20Guards','match_keywords':['depend','combine','reuse','rely','delegate'],'schema_elements':{'root_type':'logic_and\x20/\x20logic_or\x20(minimized\x20tautology)','table_entries':[],'tree_structure':'root:\x20minimized\x20(e.g.\x20context(Clock)\x20>=\x200,\x20tautology)\x20+\x20rely:\x20{\x20guards:\x20[...],\x20logic_or:\x20false\x20}'},'constraints':['Depended-on\x20Guards\x20must\x20have\x20rep=true\x20(repository.data\x20query\x20does\x20not\x20depend\x20on\x20runtime\x20submission)','rely.guards\x20supports\x20at\x20most\x204\x20(MAX_DEPENDED_COUNT)','Self-reference\x20is\x20forbidden','AND\x20logic:\x20all\x20dependencies\x20must\x20pass;\x20OR\x20logic:\x20any\x20one\x20passing\x20is\x20sufficient'],'example':{'root':{'type':'logic_as_u256_greater_or_equal','nodes':[{'type':'context','context':'Clock'},{'type':'identifier','identifier':0x0}]},'table':[{'identifier':0x0,'b_submission':![],'value_type':'U64','value':0x0,'name':'Tautology\x20baseline\x20value\x20(0)'}],'rely':{'guards':['guard_a','guard_b'],'logic_or':![]}}},{'id':'P15','pattern_name':'Submission\x20data\x20retention\x20pattern\x20(retained_submission)','data_source_combination':'Type3\x20+\x20Type4\x20(submission\x20+\x20system\x20context\x20binding)','semantic_intent':'Guard\x20accepts\x20runtime-submitted\x20data\x20but\x20ensures\x20it\x20is\x20trustworthy\x20via\x20Signer\x20binding\x20and\x20type\x20checking','match_keywords':['submit','retain','retained','submission','bind\x20signer','submission\x20check'],'schema_elements':{'root_type':'logic_and','table_entries':[{'value_type':'Address','b_submission':!![],'purpose':'Submitted\x20object\x20address\x20(Type3,\x20requires\x20Signer\x20binding)'},{'value_type':'U256','b_submission':!![],'purpose':'Submitted\x20numeric\x20value\x20(e.g.\x20amount,\x20weight,\x20requires\x20range\x20check)'}],'context_nodes':[{'context_type':'Signer','purpose':'Validate\x20submitter\x20identity\x20to\x20ensure\x20submission\x20data\x20ownership'}],'tree_structure':'logic_and(logic_equal(context(Signer),\x20query(...,\x20signer_field)),\x20logic_as_u256_greater_or_equal(identifier[1],\x20identifier[2]))'},'constraints':['The\x20name\x20of\x20each\x20b_submission=true\x20entry\x20must\x20be\x20a\x20complete\x20natural-language\x20description\x20(not\x20a\x20technical\x20identifier)','The\x20submitted\x20object\x20address\x20should\x20be\x20bound\x20to\x20Signer\x20(query\x20the\x20signer/owner\x20field\x20of\x20the\x20submitted\x20object\x20to\x20validate\x20ownership)','Submitted\x20numeric\x20values\x20should\x20have\x20range\x20checks\x20(>=\x20min,\x20<=\x20max)','Total\x20table\x20size\x20must\x20not\x20exceed\x2040000\x20bytes','Total\x20submission\x20bytes\x20must\x20not\x20exceed\x20'+MAX_SUBMISSION_SIZE_PASSPORT],'example':{'root':{'type':'logic_and','nodes':[{'type':'logic_equal','nodes':[{'type':'context','context':'Signer'},{'type':'query','query':0x4d5,'object':{'identifier':0x0},'parameters':[]}]},{'type':'logic_as_u256_greater_or_equal','nodes':[{'type':'identifier','identifier':0x1},{'type':'identifier','identifier':0x2}]}]},'table':[{'identifier':0x0,'b_submission':!![],'value_type':'Address','name':'Submitted\x20Order\x20object\x20address;\x20must\x20belong\x20to\x20the\x20current\x20signer'},{'identifier':0x1,'b_submission':!![],'value_type':'U256','name':'Submitted\x20amount\x20(unit:\x20MIST);\x20must\x20be\x20>=\x20minimum\x20amount'},{'identifier':0x2,'b_submission':![],'value_type':'U256','value':0xf4240,'name':'Minimum\x20amount\x20constant\x20(1\x20MIST)'}]}},{'id':'P16','pattern_name':'Circular\x20reference\x20pattern\x20(Guard\x20references\x20the\x20host\x20object\x20itself)','data_source_combination':'Type1\x20(host\x20object\x20as\x20constant,\x20using\x20name\x20instead\x20of\x20address)','semantic_intent':'Guard\x20binds\x20to\x20a\x20Host\x20Object\x20while\x20querying\x20the\x20Host\x20Object\x27s\x20own\x20fields;\x20uses\x20name\x20reference\x20to\x20achieve\x20circular\x20binding','match_keywords':['circular\x20reference','self','host','host','circular','self-reference'],'schema_elements':{'root_type':'logic_equal\x20/\x20logic_and','table_entries':[{'value_type':'Address','b_submission':![],'purpose':'Host\x20object\x20name\x20(SDK\x20resolves\x20to\x20address\x20at\x20binding\x20time)'}],'query_nodes':[{'query_name':'query_service_*\x20/\x20query_machine_*','object_type':'Service\x20/\x20Machine'}],'tree_structure':'logic_equal(query(<host_field_query>,\x20object:\x20{\x20identifier:\x200\x20}),\x20identifier[1]\x20or\x20context(Signer))'},'constraints':['The\x20Host\x20Object\x20must\x20not\x20be\x20published\x20(bPublished=false)\x20when\x20creating\x20and\x20binding\x20the\x20Guard','Use\x20the\x20Host\x20Object\x20name\x20(not\x20address)\x20in\x20the\x20table;\x20the\x20SDK\x20resolves\x20it\x20at\x20binding\x20time','The\x20Host\x20Object\x20can\x20only\x20be\x20published\x20after\x20the\x20Guard\x20is\x20bound','Guard\x20verification\x20only\x20runs\x20normally\x20after\x20the\x20Host\x20Object\x20is\x20published','Use\x20guard2file\x20to\x20export\x20Guard\x20backups\x20for\x20easy\x20rebuilding'],'example':{'root':{'type':'logic_equal','nodes':[{'type':'query','query':0x4cf,'object':{'identifier':0x0},'parameters':[]},{'type':'identifier','identifier':0x1}]},'table':[{'identifier':0x0,'b_submission':![],'value_type':'Address','value':'my_service','name':'Host\x20Service\x20name\x20(circular\x20reference,\x20resolved\x20by\x20SDK\x20at\x20binding\x20time)'},{'identifier':0x1,'b_submission':![],'value_type':'Bool','value':![],'name':'Expected\x20Service\x20paused\x20state\x20(false=not\x20paused)'}]}},{'id':'P17','pattern_name':'Query\x20parameter\x20translation\x20pattern\x20(type\x20conversion\x20node\x20combination)','data_source_combination':'Type1/2\x20+\x20type\x20conversion\x20(query\x20parameter\x20type\x20translation)','semantic_intent':'Guard\x20queries\x20parameters\x20that\x20require\x20type\x20conversion\x20(e.g.\x20Address\x20→\x20U64\x20timestamp\x20key);\x20uses\x20convert_*\x20nodes\x20to\x20translate','match_keywords':['type\x20conversion','translate','convert','timestamp\x20key','parameter\x20translation','address\x20to\x20u64'],'schema_elements':{'root_type':'logic_equal\x20/\x20logic_as_u256_greater_or_equal','table_entries':[{'value_type':'Address','b_submission':![],'purpose':'Query\x20target\x20object\x20address\x20(Type1/2)'},{'value_type':'U64','b_submission':![],'purpose':'Comparison\x20baseline\x20value\x20(e.g.\x20timestamp\x20threshold)'}],'query_nodes':[{'query_name':'query_repository_data\x20/\x20query_progress_history_*','object_type':'Repository\x20/\x20Progress'}],'tree_structure':'logic_as_u256_greater_or_equal(query(<query_with_converted_param>,\x20object:\x20{\x20identifier:\x200\x20},\x20parameters:\x20[convert_number_address(identifier[1])]),\x20identifier[2])'},'constraints':['The\x20query\x20parameter\x20type\x20must\x20match\x20the\x20parameters\x20type\x20defined\x20in\x20GUARDQUERY','If\x20the\x20table\x20declares\x20Address\x20but\x20the\x20query\x20requires\x20U64,\x20convert_number_address\x20must\x20be\x20used\x20to\x20translate','The\x20input\x20type\x20of\x20convert_*\x20nodes\x20must\x20be\x20compatible\x20with\x20the\x20child\x20node\x27s\x20return\x20type','The\x20translated\x20type\x20must\x20match\x20the\x20parameters\x20definition\x20of\x20the\x20query\x20instruction','Use\x20wowok_buildin_info\x20info=\x27guard\x20instructions\x27\x20to\x20verify\x20parameter\x20types'],'example':{'root':{'type':'logic_as_u256_greater_or_equal','nodes':[{'type':'query','query':0x48f,'object':{'identifier':0x0},'parameters':[{'type':'convert_number_address','nodes':[{'type':'identifier','identifier':0x1}]}]},{'type':'identifier','identifier':0x2}]},'table':[{'identifier':0x0,'b_submission':![],'value_type':'Address','value':'0xrepo','name':'Repository\x20address\x20constant'},{'identifier':0x1,'b_submission':![],'value_type':'U64','value':0x18bcfe56800,'name':'Timestamp\x20key\x20(U64,\x20needs\x20to\x20be\x20converted\x20to\x20Address\x20for\x20Repository\x20query)'},{'identifier':0x2,'b_submission':![],'value_type':'U256','value':0x64,'name':'Expected\x20Repository\x20data\x20value'}]}}];export const SCHEMA_TO_SEMANTIC_RULES=[{'element_type':'node','type_name':'logic_equal','semantic':'Equality\x20comparison\x20(==),\x20returns\x20Bool.\x20Accepts\x20any\x20type\x20but\x20both\x20operands\x20must\x20be\x20type-compatible','return_type':'Bool','child_constraints':'2\x20child\x20nodes,\x20types\x20must\x20be\x20compatible'},{'element_type':'node','type_name':'logic_not','semantic':'Logical\x20NOT\x20(!),\x20returns\x20Bool','return_type':'Bool','child_constraints':'1\x20child\x20node,\x20must\x20be\x20Bool'},{'element_type':'node','type_name':'logic_and','semantic':'Logical\x20AND;\x20true\x20if\x20all\x20child\x20nodes\x20are\x20true','return_type':'Bool','child_constraints':'2-8\x20Bool\x20child\x20nodes\x20(MAX_MULTI_OPERANDS)'},{'element_type':'node','type_name':'logic_or','semantic':'Logical\x20OR;\x20true\x20if\x20any\x20child\x20node\x20is\x20true','return_type':'Bool','child_constraints':'2-8\x20Bool\x20child\x20nodes'},{'element_type':'node','type_name':'logic_as_u256_greater','semantic':'Numeric\x20greater\x20than\x20(>),\x20auto-widened\x20to\x20U256','return_type':'Bool','child_constraints':'2\x20numeric\x20child\x20nodes\x20(U8-U256\x20compatible)'},{'element_type':'node','type_name':'logic_as_u256_lesser','semantic':'Numeric\x20less\x20than\x20(<)','return_type':'Bool','child_constraints':'2\x20numeric\x20child\x20nodes'},{'element_type':'node','type_name':'logic_as_u256_equal','semantic':'Numeric\x20equality\x20(==)','return_type':'Bool','child_constraints':'2\x20numeric\x20child\x20nodes'},{'element_type':'node','type_name':'logic_as_u256_greater_or_equal','semantic':'Numeric\x20greater\x20than\x20or\x20equal\x20(>=)','return_type':'Bool','child_constraints':'2\x20numeric\x20child\x20nodes'},{'element_type':'node','type_name':'logic_as_u256_lesser_or_equal','semantic':'Numeric\x20less\x20than\x20or\x20equal\x20(<=)','return_type':'Bool','child_constraints':'2\x20numeric\x20child\x20nodes'},{'element_type':'node','type_name':'logic_string_contains','semantic':'String\x20contains\x20(case-sensitive)','return_type':'Bool','child_constraints':'2\x20String\x20child\x20nodes'},{'element_type':'node','type_name':'logic_string_nocase_contains','semantic':'String\x20contains\x20(case-insensitive)','return_type':'Bool','child_constraints':'2\x20String\x20child\x20nodes'},{'element_type':'node','type_name':'logic_string_nocase_equal','semantic':'String\x20equality\x20(case-insensitive)','return_type':'Bool','child_constraints':'2\x20String\x20child\x20nodes'},{'element_type':'node','type_name':'identifier','semantic':'References\x20the\x20value\x20of\x20a\x20table\x20entry.\x20The\x20data\x20source\x20type\x20depends\x20on\x20b_submission:\x20false=Type1\x20constant,\x20true=Type3\x20submitted','return_type':'Determined\x20by\x20table\x20entry\x20value_type','child_constraints':'No\x20child\x20nodes;\x20requires\x20identifier\x20field\x20to\x20reference\x20table','data_source_class':'Type1_OnChainConstant'},{'element_type':'node','type_name':'context','semantic':'Transaction\x20context\x20data\x20(Type4\x20SystemContext).\x20Signer=signer\x20address,\x20Clock=on-chain\x20timestamp\x20(U64),\x20Guard=ObjectID\x20of\x20the\x20Guard\x20currently\x20being\x20verified','return_type':'Address\x20(Signer/Guard)\x20/\x20U64\x20(Clock)','child_constraints':'No\x20child\x20nodes','data_source_class':'Type4_SystemContext'},{'element_type':'node','type_name':'query','semantic':'Queries\x20on-chain\x20object\x20data.\x20The\x20data\x20source\x20type\x20depends\x20on\x20object.convert_witness:\x20present=Type2\x20(witness-derived),\x20absent+constant=Type1,\x20absent+submitted=Type3','return_type':'Determined\x20by\x20the\x20query\x20instruction','child_constraints':'Requires\x20query\x20+\x20object\x20+\x20parameters\x20fields','data_source_class':'Type1_OnChainConstant','discovery_tool':'wowok_buildin_info(info=\x27guard\x20instructions\x27)'},{'element_type':'node','type_name':'calc_number_add','semantic':'Numeric\x20addition','return_type':'U256','child_constraints':'2\x20numeric\x20child\x20nodes'},{'element_type':'node','type_name':'calc_number_subtract','semantic':'Numeric\x20subtraction','return_type':'U256','child_constraints':'2\x20numeric\x20child\x20nodes'},{'element_type':'node','type_name':'calc_number_multiply','semantic':'Numeric\x20multiplication','return_type':'U256','child_constraints':'2\x20numeric\x20child\x20nodes'},{'element_type':'node','type_name':'calc_number_divide','semantic':'Numeric\x20division','return_type':'U256','child_constraints':'2\x20numeric\x20child\x20nodes'},{'element_type':'node','type_name':'calc_number_mod','semantic':'Numeric\x20modulo','return_type':'U256','child_constraints':'2\x20numeric\x20child\x20nodes'},{'element_type':'node','type_name':'calc_string_length','semantic':'String\x20length','return_type':'U64','child_constraints':'1\x20String\x20child\x20node'},{'element_type':'node','type_name':'calc_string_contains','semantic':'String\x20contains\x20(returns\x20Bool)','return_type':'Bool','child_constraints':'2\x20String\x20child\x20nodes'},{'element_type':'node','type_name':'calc_string_nocase_contains','semantic':'String\x20contains\x20(case-insensitive,\x20returns\x20Bool)','return_type':'Bool','child_constraints':'2\x20String\x20child\x20nodes'},{'element_type':'node','type_name':'calc_string_nocase_equal','semantic':'String\x20equality\x20(case-insensitive,\x20returns\x20Bool)','return_type':'Bool','child_constraints':'2\x20String\x20child\x20nodes'},{'element_type':'node','type_name':'calc_string_indexof','semantic':'String\x20find\x20index','return_type':'U64','child_constraints':'2\x20String\x20child\x20nodes\x20+\x20order'},{'element_type':'node','type_name':'calc_string_nocase_indexof','semantic':'String\x20find\x20index\x20(case-insensitive)','return_type':'U64','child_constraints':'2\x20String\x20child\x20nodes\x20+\x20order'},{'element_type':'node','type_name':'convert_number_address','semantic':'Number\x20→\x20Address\x20conversion\x20(e.g.\x20timestamp\x20to\x20address)','return_type':'Address','child_constraints':'1\x20numeric\x20child\x20node'},{'element_type':'node','type_name':'convert_address_number','semantic':'Address\x20→\x20Number\x20conversion','return_type':'U256','child_constraints':'1\x20Address\x20child\x20node'},{'element_type':'node','type_name':'convert_number_string','semantic':'Number\x20→\x20String\x20conversion','return_type':'String','child_constraints':'1\x20numeric\x20child\x20node'},{'element_type':'node','type_name':'convert_string_number','semantic':'String\x20→\x20Number\x20conversion','return_type':'U256','child_constraints':'1\x20String\x20child\x20node'},{'element_type':'node','type_name':'convert_safe_u8','semantic':'Safe\x20conversion\x20to\x20U8\x20(errors\x20on\x20overflow)','return_type':'U8','child_constraints':'1\x20numeric\x20child\x20node'},{'element_type':'node','type_name':'convert_safe_u16','semantic':'Safe\x20conversion\x20to\x20U16','return_type':'U16','child_constraints':'1\x20numeric\x20child\x20node'},{'element_type':'node','type_name':'convert_safe_u32','semantic':'Safe\x20conversion\x20to\x20U32','return_type':'U32','child_constraints':'1\x20numeric\x20child\x20node'},{'element_type':'node','type_name':'convert_safe_u64','semantic':'Safe\x20conversion\x20to\x20U64','return_type':'U64','child_constraints':'1\x20numeric\x20child\x20node'},{'element_type':'node','type_name':'convert_safe_u128','semantic':'Safe\x20conversion\x20to\x20U128','return_type':'U128','child_constraints':'1\x20numeric\x20child\x20node'},{'element_type':'node','type_name':'convert_safe_u256','semantic':'Safe\x20conversion\x20to\x20U256','return_type':'U256','child_constraints':'1\x20numeric\x20child\x20node'},{'element_type':'node','type_name':'value_type','semantic':'Returns\x20the\x20value\x27s\x20type\x20identifier\x20(U8)\x20—\x20used\x20for\x20dynamic\x20type\x20checking','return_type':'U8','child_constraints':'1\x20variable\x20child\x20node'},{'element_type':'node','type_name':'vec_length','semantic':'Vector\x20length','return_type':'U64','child_constraints':'1\x20vec\x20child\x20node'},{'element_type':'node','type_name':'vec_contains_bool','semantic':'Whether\x20the\x20vector\x20contains\x20a\x20Bool\x20value','return_type':'Bool','child_constraints':'1\x20VecBool\x20+\x201\x20Bool'},{'element_type':'node','type_name':'vec_contains_address','semantic':'Whether\x20the\x20vector\x20contains\x20an\x20Address\x20(whitelist\x20check)','return_type':'Bool','child_constraints':'1\x20VecAddress\x20+\x201\x20Address'},{'element_type':'node','type_name':'vec_contains_string','semantic':'Whether\x20the\x20vector\x20contains\x20a\x20String','return_type':'Bool','child_constraints':'1\x20VecString\x20+\x201\x20String'},{'element_type':'node','type_name':'vec_contains_string_nocase','semantic':'Whether\x20the\x20vector\x20contains\x20a\x20String\x20(case-insensitive)','return_type':'Bool','child_constraints':'1\x20VecString\x20+\x201\x20String'},{'element_type':'node','type_name':'vec_contains_number','semantic':'Whether\x20the\x20vector\x20contains\x20a\x20number','return_type':'Bool','child_constraints':'1\x20Vec*\x20+\x201\x20Number'},{'element_type':'node','type_name':'vec_indexof_bool','semantic':'Bool\x20vector\x20find\x20index','return_type':'U64','child_constraints':'VecBool\x20+\x20Bool\x20+\x20order'},{'element_type':'node','type_name':'vec_indexof_address','semantic':'Address\x20vector\x20find\x20index','return_type':'U64','child_constraints':'VecAddress\x20+\x20Address\x20+\x20order'},{'element_type':'node','type_name':'vec_indexof_string','semantic':'String\x20vector\x20find\x20index','return_type':'U64','child_constraints':'VecString\x20+\x20String\x20+\x20order'},{'element_type':'node','type_name':'vec_indexof_string_nocase','semantic':'String\x20vector\x20find\x20index\x20(case-insensitive)','return_type':'U64','child_constraints':'VecString\x20+\x20String\x20+\x20order'},{'element_type':'node','type_name':'vec_indexof_number','semantic':'Numeric\x20vector\x20find\x20index','return_type':'U64','child_constraints':'Vec*\x20+\x20Number\x20+\x20order'},{'element_type':'node','type_name':'query_reward_record_find','semantic':'Query\x20reward\x20claim\x20records\x20(returns\x20the\x20found\x20record)','return_type':'Bool','child_constraints':'Requires\x20object\x20+\x20recipient\x20+\x20where\x20+\x20find'},{'element_type':'node','type_name':'query_reward_record_count','semantic':'Query\x20reward\x20claim\x20record\x20count\x20(U64)','return_type':'U64','child_constraints':'Requires\x20object\x20+\x20recipient\x20(optional)'},{'element_type':'node','type_name':'query_reward_record_exists','semantic':'Query\x20whether\x20a\x20reward\x20claim\x20record\x20exists\x20(Bool)','return_type':'Bool','child_constraints':'Requires\x20object\x20+\x20recipient\x20(optional)'},{'element_type':'node','type_name':'query_progress_history_find','semantic':'Query\x20whether\x20a\x20specified\x20session\x20exists\x20in\x20Progress\x20history','return_type':'Bool','child_constraints':'Requires\x20object\x20+\x20where\x20+\x20find'},{'element_type':'node','type_name':'query_progress_history_session_find','semantic':'Query\x20a\x20Progress\x20session','return_type':'Bool','child_constraints':'Requires\x20object\x20+\x20historyIdx\x20+\x20where\x20+\x20find'},{'element_type':'node','type_name':'query_progress_history_session_forward_find','semantic':'Query\x20whether\x20a\x20specified\x20forward\x20exists\x20in\x20a\x20Progress\x20session','return_type':'Bool','child_constraints':'Requires\x20object\x20+\x20historyIdx\x20+\x20sessionIdx\x20+\x20where\x20+\x20find'},{'element_type':'node','type_name':'query_progress_history_session_count','semantic':'Query\x20the\x20number\x20of\x20Progress\x20sessions','return_type':'U64','child_constraints':'Requires\x20object\x20+\x20historyIdx'},{'element_type':'node','type_name':'query_progress_history_session_forward_count','semantic':'Query\x20the\x20number\x20of\x20forwards\x20in\x20a\x20Progress\x20session','return_type':'U64','child_constraints':'Requires\x20object\x20+\x20historyIdx\x20+\x20sessionIdx'},{'element_type':'node','type_name':'query_progress_history_session_forward_retained_submission_count','semantic':'Query\x20the\x20retained\x20submission\x20count\x20of\x20a\x20forward\x20in\x20a\x20Progress\x20session','return_type':'U64','child_constraints':'Requires\x20object\x20+\x20historyIdx\x20+\x20sessionIdx\x20+\x20forwardIdx'},{'element_type':'witness','type_name':'TypeOrderProgress','semantic':'Reads\x20the\x20order.progress\x20field\x20from\x20an\x20Order\x20address\x20to\x20derive\x20Progress\x20(100,\x20single\x20hop)','data_source_class':'Type2_WitnessDerived','discovery_tool':'wowok_buildin_info(info=\x27guard\x20instructions\x27)'},{'element_type':'witness','type_name':'TypeOrderMachine','semantic':'Reads\x20the\x20order.machine\x20field\x20from\x20an\x20Order\x20address\x20to\x20derive\x20Machine\x20(101,\x20single\x20hop)','data_source_class':'Type2_WitnessDerived'},{'element_type':'witness','type_name':'TypeOrderService','semantic':'Reads\x20the\x20order.service\x20field\x20from\x20an\x20Order\x20address\x20to\x20derive\x20Service\x20(102,\x20single\x20hop)','data_source_class':'Type2_WitnessDerived'},{'element_type':'witness','type_name':'TypeProgressMachine','semantic':'Reads\x20the\x20progress.machine\x20field\x20from\x20a\x20Progress\x20address\x20to\x20derive\x20Machine\x20(103,\x20single\x20hop)','data_source_class':'Type2_WitnessDerived'},{'element_type':'witness','type_name':'TypeArbOrder','semantic':'Reads\x20the\x20arb.order\x20field\x20from\x20an\x20Arb\x20address\x20to\x20derive\x20Order\x20(104,\x20single\x20hop)','data_source_class':'Type2_WitnessDerived'},{'element_type':'witness','type_name':'TypeArbArbitration','semantic':'Reads\x20the\x20arb.arbitration\x20field\x20from\x20an\x20Arb\x20address\x20to\x20derive\x20the\x20parent\x20Arbitration\x20service\x20(105,\x20single\x20hop)','data_source_class':'Type2_WitnessDerived'},{'element_type':'witness','type_name':'TypeArbProgress','semantic':'Derives\x20from\x20Arb\x20in\x20two\x20hops:\x20arb.order\x20→\x20order.progress\x20(106,\x20multi-hop)','data_source_class':'Type2_WitnessDerived'},{'element_type':'witness','type_name':'TypeArbMachine','semantic':'Derives\x20from\x20Arb\x20in\x20two\x20hops:\x20arb.order\x20→\x20order.machine\x20(107,\x20multi-hop)','data_source_class':'Type2_WitnessDerived'},{'element_type':'witness','type_name':'TypeArbService','semantic':'Derives\x20from\x20Arb\x20in\x20two\x20hops:\x20arb.order\x20→\x20order.service\x20(108,\x20multi-hop)','data_source_class':'Type2_WitnessDerived'},{'element_type':'context','type_name':'Signer','semantic':'Current\x20transaction\x20signer\x20address\x20(TransactionContext.sender())','return_type':'Address','data_source_class':'Type4_SystemContext'},{'element_type':'context','type_name':'Clock','semantic':'Current\x20on-chain\x20timestamp\x20(reads\x20timestamp_ms\x20of\x20WOW_CLOCK_OBJECT_ID\x200x6)','return_type':'U64','data_source_class':'Type4_SystemContext'},{'element_type':'context','type_name':'Guard','semantic':'ObjectID\x20of\x20the\x20Guard\x20object\x20currently\x20being\x20verified\x20(self-reference,\x20rare)','return_type':'Address','data_source_class':'Type4_SystemContext'},{'element_type':'table_entry','type_name':'Bool','semantic':'Boolean\x20constant\x20or\x20submission'},{'element_type':'table_entry','type_name':'Address','semantic':'Address\x20constant\x20(Type1)\x20or\x20submission\x20(Type3).\x20Object\x20address\x20type'},{'element_type':'table_entry','type_name':'String','semantic':'String\x20constant\x20or\x20submission'},{'element_type':'table_entry','type_name':'U8','semantic':'8-bit\x20unsigned\x20integer'},{'element_type':'table_entry','type_name':'U16','semantic':'16-bit\x20unsigned\x20integer'},{'element_type':'table_entry','type_name':'U32','semantic':'32-bit\x20unsigned\x20integer'},{'element_type':'table_entry','type_name':'U64','semantic':'64-bit\x20unsigned\x20integer\x20(commonly\x20used\x20for\x20timestamps)'},{'element_type':'table_entry','type_name':'U128','semantic':'128-bit\x20unsigned\x20integer'},{'element_type':'table_entry','type_name':'U256','semantic':'256-bit\x20unsigned\x20integer\x20(auto-widening\x20target\x20for\x20numeric\x20operations)'},{'element_type':'table_entry','type_name':'VecAddress','semantic':'Address\x20vector\x20(used\x20for\x20whitelists,\x20Type1\x20constant)'},{'element_type':'table_entry','type_name':'VecString','semantic':'String\x20vector'},{'element_type':'table_entry','type_name':'VecU64','semantic':'U64\x20vector'},{'element_type':'table_entry','type_name':'VecU8','semantic':'U8\x20vector\x20(raw\x20bytes)'},{'element_type':'table_entry','type_name':'Value','semantic':'Dynamic\x20type\x20(19,\x20first\x20byte\x20is\x20the\x20type\x20identifier)\x20—\x20used\x20for\x20Repository\x20data,\x20EntityRegistrar\x20records,\x20Passport\x20submission\x20value'},{'element_type':'rely','type_name':'rely_and','semantic':'Depends\x20on\x20other\x20Guards,\x20AND\x20logic\x20(all\x20must\x20pass).\x20Depended-on\x20Guards\x20must\x20have\x20rep=true','child_constraints':'At\x20most\x204\x20dependencies,\x20each\x20with\x20rep=true\x20(repository.data\x20query\x20does\x20not\x20depend\x20on\x20submission)'},{'element_type':'rely','type_name':'rely_or','semantic':'Depends\x20on\x20other\x20Guards,\x20OR\x20logic\x20(any\x20one\x20passing\x20is\x20sufficient).\x20Depended-on\x20Guards\x20must\x20have\x20rep=true','child_constraints':'At\x20most\x204\x20dependencies,\x20each\x20with\x20rep=true'}];export const GUARD_CONSTRAINT_RULES=[{'id':'ROOT_01','name':'root\x20returns\x20Bool','description':'The\x20Guard\x20root\x20node\x20must\x20return\x20a\x20Bool\x20type','category':'root','phase':'creation','validation_logic':'root.node_type\x20must\x20be\x20in\x20the\x20allowedTypes\x20list\x20(logic_*,\x20calc_string_contains,\x20vec_contains_*,\x20query_reward_record_exists,\x20query[Bool\x20return],\x20identifier[Bool\x20type])','failure_message':'Guard\x20root\x20node\x20must\x20be\x20an\x20operation\x20that\x20returns\x20Bool','verification_location':'SDK\x20buildNode(root,\x20ValueType.Bool,\x20...)','pitfall_number':0x7},{'id':'TABLE_01','name':'identifier\x20uniqueness','description':'Each\x20identifier\x20in\x20the\x20table\x20must\x20be\x20unique\x20(0-255)','category':'table','phase':'creation','validation_logic':'No\x20duplicate\x20identifiers\x20in\x20the\x20table','failure_message':'Duplicate\x20table\x20identifier','verification_location':'SDK\x20lodash\x20groupBy'},{'id':'TABLE_02','name':'identifier\x20referential\x20integrity','description':'Every\x20identifier\x20node\x20in\x20the\x20computation\x20tree\x20must\x20exist\x20in\x20the\x20table','category':'table','phase':'creation','validation_logic':'Traverse\x20the\x20computation\x20tree;\x20each\x20identifier\x20node\x27s\x20index\x20exists\x20in\x20the\x20table','failure_message':'Identifier\x20not\x20found\x20in\x20table','verification_location':'SDK\x20buildNode','pitfall_number':0x1},{'id':'TABLE_03','name':'Constant\x20entries\x20must\x20have\x20a\x20value','description':'Entries\x20with\x20b_submission=false\x20must\x20have\x20a\x20value\x20field','category':'table','phase':'creation','validation_logic':'All\x20entries\x20with\x20b_submission=false\x20have\x20a\x20non-empty\x20value\x20field','failure_message':'Constant\x20table\x20entry\x20must\x20have\x20a\x20value','verification_location':'SDK\x20operate'},{'id':'TABLE_04','name':'table\x20size\x20limit','description':'At\x20most\x20256\x20entries;\x20serialized\x20size\x20must\x20not\x20exceed\x2040000\x20bytes','category':'table','phase':'creation','validation_logic':'table.length\x20<=\x20256\x20&&\x20serialize(table).length\x20<=\x2040000','failure_message':'Table\x20exceeds\x20size\x20limit\x20(256\x20entries\x20or\x2040000\x20bytes)','verification_location':'Move\x20guard::new'},{'id':'TABLE_05','name':'submission\x20entry\x20value\x20is\x201\x20byte\x20(type\x20code\x20only)','description':'Entries\x20with\x20b_submission=true\x20have\x20a\x20serialized\x20value\x20of\x20just\x201\x20byte\x20(the\x20type\x20code)','category':'table','phase':'creation','validation_logic':'When\x20b_submission=true,\x20bcsValue.length\x20===\x201\x20and\x20bcsValue[0]\x20===\x20valueType','failure_message':'Submission\x20table\x20entry\x20value\x20must\x20be\x201\x20byte\x20(type\x20code\x20only)','verification_location':'native\x20deserialize_constants'},{'id':'QUERY_01','name':'query\x20instruction\x20valid','description':'The\x20query\x20field\x20of\x20a\x20query\x20node\x20must\x20be\x20a\x20valid\x20GUARDQUERY\x20ID\x20or\x20name','category':'query','phase':'creation','validation_logic':'The\x20query\x20field\x20exists\x20in\x20GUARDQUERY\x20(via\x20isValidGuardQueryIdOrName)','failure_message':'Invalid\x20Guard\x20query\x20instruction','verification_location':'SDK\x20getGuardQueryInfo','pitfall_number':0x3},{'id':'QUERY_02','name':'query\x20parameter\x20count\x20match','description':'The\x20number\x20and\x20types\x20of\x20parameters\x20in\x20a\x20query\x20node\x20must\x20match\x20the\x20instruction\x20definition','category':'query','phase':'creation','validation_logic':'parameters.length\x20===\x20instruction.parameters.length\x20&&\x20type-compatible','failure_message':'Query\x20parameter\x20count\x20or\x20type\x20mismatch','verification_location':'SDK\x20buildNode','pitfall_number':0x3},{'id':'QUERY_03','name':'query\x20return\x20type\x20compatible','description':'The\x20return\x20type\x20of\x20a\x20query\x20node\x20must\x20be\x20compatible\x20with\x20the\x20parent\x20node\x27s\x20expected\x20type','category':'query','phase':'creation','validation_logic':'checkType(query.return_type,\x20parent.expected_type)','failure_message':'Query\x20return\x20type\x20incompatible\x20with\x20parent\x20node','verification_location':'SDK\x20checkType'},{'id':'QUERY_04','name':'query\x20object\x20identifier\x27s\x20value_type\x20is\x20Address','description':'The\x20table\x20entry\x20referenced\x20by\x20query\x20node\x27s\x20object.identifier\x20must\x20have\x20value_type\x20of\x20Address','category':'query','phase':'creation','validation_logic':'table[object.identifier].value_type\x20===\x20Address','failure_message':'Query\x20object\x20identifier\x20must\x20reference\x20an\x20Address-type\x20table\x20entry','verification_location':'SDK\x20buildNode\x20L603-609'},{'id':'WITNESS_01','name':'witness\x20type\x20valid','description':'convert_witness\x20must\x20be\x20a\x20valid\x20WitnessType\x20(100-108)','category':'witness','phase':'creation','validation_logic':'The\x20witness\x20value\x20is\x20within\x20the\x20range\x20allowed\x20by\x20WitnessTypeSchema\x20(100-108)','failure_message':'Invalid\x20witness\x20type','verification_location':'SDK\x20isWitnessType','pitfall_number':0x4},{'id':'WITNESS_02','name':'witness\x20target\x20matches\x20query\x20objectType','description':'The\x20witness\x27s\x20target\x20type\x20must\x20match\x20the\x20query\x20instruction\x27s\x20objectType','category':'witness','phase':'creation','validation_logic':'witness.target_type\x20===\x20instruction.objectType','failure_message':'Witness\x20target\x20type\x20does\x20not\x20match\x20query\x20object\x20type','verification_location':'SDK\x20buildNode\x20L613-619','pitfall_number':0x4},{'id':'WITNESS_03','name':'witness\x20source\x20matches\x20tableItem\x20object_type','description':'The\x20witness\x27s\x20source\x20type\x20must\x20match\x20the\x20object_type\x20declared\x20in\x20the\x20table\x20entry\x20(if\x20declared)','category':'witness','phase':'creation','validation_logic':'table[identifier].object_type\x20===\x20witness.source_type\x20(if\x20tableItem.object_type\x20is\x20declared)','failure_message':'Witness\x20source\x20type\x20does\x20not\x20match\x20table\x20entry\x20object_type','verification_location':'SDK\x20buildNode\x20L622-631','pitfall_number':0x4},{'id':'RELY_01','name':'rely\x20dependency\x20count\x20≤\x204','description':'rely.guards\x20supports\x20at\x20most\x204\x20dependencies\x20(MAX_DEPENDED_COUNT)','category':'rely','phase':'creation','validation_logic':'rely.guards.length\x20<=\x204','failure_message':'Rely\x20dependencies\x20exceed\x20limit\x20(4)','verification_location':'SDK\x20reliesAdd'},{'id':'RELY_02','name':'rely\x20dependency\x20rep=true','description':'All\x20rely-depended\x20Guards\x20must\x20have\x20rep=true\x20(repository.data\x20query\x20does\x20not\x20depend\x20on\x20runtime\x20submission)','category':'rely','phase':'creation','validation_logic':'Query\x20each\x20depended\x20Guard\x27s\x20rep\x20field;\x20must\x20be\x20true','failure_message':'Rely\x20dependency\x20has\x20rep=false\x20(not\x20standalone)','verification_location':'Move\x20guard::relies_add','pitfall_number':0x8},{'id':'RELY_03','name':'rely\x20forbids\x20self-reference','description':'A\x20Guard\x20cannot\x20depend\x20on\x20itself','category':'rely','phase':'creation','validation_logic':'rely.guards\x20does\x20not\x20contain\x20the\x20current\x20Guard\x27s\x20address','failure_message':'Guard\x20cannot\x20rely\x20on\x20itself','verification_location':'SDK\x20reliesAdd'},{'id':'BINDING_01','name':'voting_guard\x20GuardIdentifier\x20numeric','description':'The\x20table\x20entry\x20referenced\x20by\x20Arbitration\x20voting_guard\x27s\x20GuardIdentifier\x20must\x20be\x20of\x20a\x20numeric\x20type','category':'binding','phase':'creation','validation_logic':'If\x20binding=voting_guard,\x20the\x20table\x20entry\x20pointed\x20to\x20by\x20GuardIdentifier\x20has\x20value_type\x20in\x20[U8,U16,U32,U64,U128,U256]','failure_message':'E_GUARD_IDENTIFIER_NOT_NUMBER:\x20voting_guard\x20weight\x20must\x20be\x20numeric','verification_location':'Move\x20Arbitration','pitfall_number':0x9},{'id':'BINDING_02','name':'Repository\x20id_from_submission\x20Address','description':'The\x20table\x20entry\x20referenced\x20by\x20Repository\x20write_guard\x27s\x20id_from_submission\x20must\x20be\x20of\x20Address\x20type','category':'binding','phase':'creation','validation_logic':'If\x20binding=write_guard\x20and\x20id_from_submission\x20is\x20set,\x20table[id_from_submission].value_type\x20===\x20Address','failure_message':'Repository\x20id_from_submission\x20must\x20be\x20Address\x20type','verification_location':'Move\x20Repository'},{'id':'BINDING_03','name':'Repository\x20data_from_submission\x20type\x20match','description':'The\x20table\x20entry\x20referenced\x20by\x20Repository\x20write_guard\x27s\x20data_from_submission\x20must\x20match\x20the\x20Repository\x20value_type','category':'binding','phase':'creation','validation_logic':'If\x20binding=write_guard\x20and\x20data_from_submission\x20is\x20set,\x20table[data_from_submission].value_type\x20===\x20Repository.value_type','failure_message':'Repository\x20data_from_submission\x20type\x20mismatch','verification_location':'Move\x20Repository'},{'id':'INPUT_01','name':'root\x20byte\x20stream\x20non-empty','description':'The\x20serialized\x20byte\x20stream\x20of\x20root\x20cannot\x20be\x20empty','category':'input','phase':'creation','validation_logic':'input.length\x20>\x200','failure_message':'Input\x20cannot\x20be\x20empty','verification_location':'SDK\x20newGuard'},{'id':'INPUT_02','name':'root\x20byte\x20stream\x20≤\x20MAX_INPUT_SIZE','description':'The\x20serialized\x20byte\x20stream\x20of\x20root\x20must\x20not\x20exceed\x20MAX_INPUT_SIZE','category':'input','phase':'creation','validation_logic':'input.length\x20<=\x20MAX_INPUT_SIZE','failure_message':'Input\x20size\x20exceeds\x20maximum\x20limit','verification_location':'SDK\x20newGuard'},{'id':'IMMUTABLE_01','name':'Guard\x20immutable=true\x20after\x20creation','description':'After\x20creation,\x20a\x20Guard\x20cannot\x20be\x20modified\x20or\x20deleted\x20(CREATE-only)','category':'immutable','phase':'creation','validation_logic':'After\x20guard::create,\x20the\x20immutable\x20field\x20is\x20set\x20to\x20true','failure_message':'Guard\x20is\x20immutable\x20after\x20creation','verification_location':'Move\x20guard::create'},{'id':'RUN_IMMUTABLE_01','name':'Guard\x20must\x20be\x20immutable=true\x20to\x20verify','description':'At\x20runtime\x20verification,\x20the\x20Guard\x20must\x20be\x20frozen\x20(immutable=true)','category':'immutable','phase':'runtime','validation_logic':'guard.immutable\x20===\x20true','failure_message':'Guard\x20must\x20be\x20immutable\x20to\x20verify','verification_location':'native\x20verify_guard\x20L497-506'},{'id':'RUN_SUB_01','name':'submission\x20type\x20byte\x20matches\x20table\x20declaration','description':'The\x20value[0]\x20(type\x20byte)\x20of\x20submission\x20must\x20match\x20the\x20value_type\x20declared\x20in\x20the\x20table','category':'table','phase':'runtime','validation_logic':'submission_value[0]\x20===\x20table[identifier].value_type','failure_message':'Submission\x20type\x20byte\x20does\x20not\x20match\x20table\x20declaration','verification_location':'native\x20parse_table_items\x20L306'},{'id':'RUN_SUB_02','name':'table\x20entries\x20with\x20b_submission=true\x20must\x20be\x20found\x20in\x20submission','description':'All\x20table\x20entries\x20declared\x20as\x20submitted\x20must\x20have\x20corresponding\x20submission\x20data','category':'table','phase':'runtime','validation_logic':'forall\x20identifier\x20in\x20table\x20where\x20b_submission=true:\x20identifier\x20in\x20submission_map','failure_message':'Missing\x20submission\x20for\x20declared\x20b_submission=true\x20table\x20entry','verification_location':'native\x20parse_table_items\x20L301-321'},{'id':'RUN_SUB_03','name':'submission\x20total\x20bytes\x20≤\x20MAX_SUBMISSION_SIZE_PASSPORT\x20('+MAX_SUBMISSION_SIZE_PASSPORT+')','description':'The\x20total\x20bytes\x20of\x20all\x20data\x20submitted\x20at\x20runtime\x20must\x20not\x20exceed\x20'+MAX_SUBMISSION_SIZE_PASSPORT,'category':'table','phase':'runtime','validation_logic':'total_submission_bytes\x20<=\x20'+MAX_SUBMISSION_SIZE_PASSPORT,'failure_message':'Submission\x20exceeds\x20MAX_SUBMISSION_SIZE_PASSPORT\x20('+MAX_SUBMISSION_SIZE_PASSPORT+'\x20bytes)','verification_location':'Move\x20verify\x20L252'},{'id':'RUN_WITNESS_01','name':'witness\x20derivation\x20source\x20object\x20must\x20have\x20the\x20required\x20relation\x20field','description':'When\x20witness\x20conversion\x20occurs,\x20the\x20source\x20object\x20must\x20contain\x20the\x20relation\x20field\x20needed\x20for\x20derivation','category':'witness','phase':'runtime','validation_logic':'The\x20source\x20object\x20exists\x20and\x20contains\x20the\x20field\x20required\x20for\x20witness\x20derivation\x20(e.g.\x20order.progress\x20field\x20is\x20non-empty)','failure_message':'Witness\x20source\x20object\x20missing\x20required\x20field\x20for\x20derivation','verification_location':'native\x20convert_witness'},{'id':'RUN_WITNESS_02','name':'witness-derived\x20target\x20object\x20must\x20exist','description':'The\x20target\x20object\x20derived\x20by\x20witness\x20must\x20exist\x20on-chain','category':'witness','phase':'runtime','validation_logic':'The\x20derived\x20target\x20object\x20ID\x20exists\x20on-chain','failure_message':'Witness\x20derived\x20target\x20object\x20does\x20not\x20exist','verification_location':'native\x20convert_witness'},{'id':'RUN_QUERY_01','name':'query\x20target\x20object\x20must\x20exist\x20and\x20type\x20match','description':'The\x20target\x20object\x20of\x20a\x20query\x20must\x20exist\x20on-chain\x20and\x20its\x20type\x20must\x20match','category':'query','phase':'runtime','validation_logic':'Target\x20object\x20exists\x20&&\x20object\x20type\x20matches\x20query.objectType','failure_message':'Query\x20target\x20object\x20does\x20not\x20exist\x20or\x20type\x20mismatch','verification_location':'native\x20process_object_query'},{'id':'RUN_IMPACK_01','name':'at\x20least\x20one\x20impack\x20guard','description':'Passport\x20verification\x20requires\x20at\x20least\x20one\x20impack\x20guard','category':'runtime','phase':'runtime','validation_logic':'impack_list.length\x20>=\x201\x20(note:\x20impack_list\x20is\x20always\x20empty\x20during\x20verify\x20phase;\x20this\x20constraint\x20is\x20checked\x20in\x20result_for_permission\x20phase)','failure_message':'No\x20impack\x20guard\x20found','verification_location':'Move\x20verify\x20L281'},{'id':'RUN_IMPACK_02','name':'impack\x20guard\x20failure\x20fails\x20the\x20entire\x20passport','description':'If\x20any\x20impack\x20guard\x20verification\x20fails,\x20the\x20entire\x20passport\x20verification\x20fails','category':'runtime','phase':'runtime','validation_logic':'forall\x20guard\x20in\x20impack_list:\x20guard.result\x20===\x20true','failure_message':'Impack\x20guard\x20verification\x20failed','verification_location':'Move\x20verify\x20L270-275'},{'id':'RUN_TX_01','name':'Passport\x20tx_hash\x20must\x20match\x20the\x20current\x20transaction','description':'The\x20tx_hash\x20recorded\x20in\x20the\x20Passport\x20must\x20match\x20the\x20hash\x20of\x20the\x20currently\x20executing\x20transaction','category':'runtime','phase':'runtime','validation_logic':'passport.tx_hash\x20===\x20current_tx_hash','failure_message':'Passport\x20tx_hash\x20does\x20not\x20match\x20current\x20transaction','verification_location':'Move\x20verify\x20L231'},{'id':'RUN_RELY_01','name':'rely\x20guard\x20must\x20have\x20been\x20added\x20to\x20passport','description':'Guards\x20relied\x20on\x20must\x20have\x20been\x20registered\x20in\x20the\x20passport','category':'rely','phase':'runtime','validation_logic':'forall\x20guard\x20in\x20rely.guards:\x20guard\x20in\x20passport.relies','failure_message':'Rely\x20guard\x20not\x20added\x20to\x20passport','verification_location':'Move\x20calculate_relies_result'}];export function matchSemanticPattern(a){const b=a['toLowerCase']();return SEMANTIC_TO_SCHEMA_RULES['filter'](c=>c['match_keywords']['some'](d=>b['includes'](d['toLowerCase']())));}export function explainNode(a){return SCHEMA_TO_SEMANTIC_RULES['find'](b=>b['element_type']==='node'&&b['type_name']===a);}export function explainWitness(a){const b={0x64:'TypeOrderProgress',0x65:'TypeOrderMachine',0x66:'TypeOrderService',0x67:'TypeProgressMachine',0x68:'TypeArbOrder',0x69:'TypeArbArbitration',0x6a:'TypeArbProgress',0x6b:'TypeArbMachine',0x6c:'TypeArbService'},c=b[a];return SCHEMA_TO_SEMANTIC_RULES['find'](d=>d['element_type']==='witness'&&d['type_name']===c);}export function explainContext(a){return SCHEMA_TO_SEMANTIC_RULES['find'](b=>b['element_type']==='context'&&b['type_name']===a);}export function getConstraintsByCategory(a){return GUARD_CONSTRAINT_RULES['filter'](b=>b['category']===a);}export function getConstraintsByPhase(a){return GUARD_CONSTRAINT_RULES['filter'](b=>b['phase']===a);}export function getPatternById(a){return SEMANTIC_TO_SCHEMA_RULES['find'](b=>b['id']===a);}export function getDataSourceCombinations(){return[...new Set(SEMANTIC_TO_SCHEMA_RULES['map'](a=>a['data_source_combination']))];}