@wowok/agent-mcp 3.1.3 → 3.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (384) hide show
  1. package/dist/config/config-audit.spec.d.ts +1 -0
  2. package/dist/config/config-audit.spec.js +1 -0
  3. package/dist/config/exposure.d.ts +108 -0
  4. package/dist/config/exposure.js +1 -0
  5. package/dist/config/index.d.ts +2 -0
  6. package/dist/config/index.js +1 -1
  7. package/dist/config/judgment.d.ts +1228 -0
  8. package/dist/config/judgment.js +1 -0
  9. package/dist/config/judgment.spec.d.ts +1 -0
  10. package/dist/config/judgment.spec.js +1 -0
  11. package/dist/config/rule-engine.d.ts +299 -0
  12. package/dist/config/rule-engine.js +1 -0
  13. package/dist/config/rule-engine.spec.d.ts +1 -0
  14. package/dist/config/rule-engine.spec.js +1 -0
  15. package/dist/config/severity.d.ts +7 -0
  16. package/dist/config/severity.js +1 -0
  17. package/dist/customer/order-monitor.d.ts +3 -1
  18. package/dist/customer/order-monitor.js +1 -1
  19. package/dist/evaluation/acceptance.d.ts +1 -0
  20. package/dist/evaluation/acceptance.js +1 -1
  21. package/dist/evaluation/arbitration-game.js +1 -1
  22. package/dist/evaluation/builtins/demand-match.js +1 -1
  23. package/dist/evaluation/builtins/graph-service.js +1 -1
  24. package/dist/evaluation/builtins/graph-service.spec.js +1 -1
  25. package/dist/evaluation/engine.js +1 -1
  26. package/dist/evaluation/game-strategy.d.ts +2 -2
  27. package/dist/evaluation/game-strategy.js +1 -1
  28. package/dist/evaluation/match-operation.d.ts +2 -2
  29. package/dist/evaluation/match-operation.js +1 -1
  30. package/dist/evaluation/standards.d.ts +3 -25
  31. package/dist/evaluation/standards.js +1 -1
  32. package/dist/evaluation/types.d.ts +2 -1
  33. package/dist/experience/realtime-feedback.js +1 -1
  34. package/dist/extensions/business-modules.js +1 -1
  35. package/dist/extensions/custom-registry-file.js +1 -1
  36. package/dist/extensions/industry-audit.spec.d.ts +1 -0
  37. package/dist/extensions/industry-audit.spec.js +1 -0
  38. package/dist/extensions/industry-layers.d.ts +8 -0
  39. package/dist/extensions/industry-layers.js +1 -1
  40. package/dist/extensions/industry-pack.d.ts +2 -0
  41. package/dist/extensions/industry-pack.js +1 -1
  42. package/dist/extensions/mode-evaluator.js +1 -1
  43. package/dist/extensions/modes.js +1 -1
  44. package/dist/graph/onchain/analyze.d.ts +3 -1
  45. package/dist/graph/onchain/analyze.js +1 -1
  46. package/dist/graph/onchain/analyze.spec.js +1 -1
  47. package/dist/graph/onchain/edge-schema.d.ts +1 -0
  48. package/dist/graph/onchain/edge-schema.js +1 -1
  49. package/dist/graph/onchain/expand.js +1 -1
  50. package/dist/graph/onchain/exploration.d.ts +28 -0
  51. package/dist/graph/onchain/exploration.js +1 -0
  52. package/dist/graph/onchain/exploration.spec.d.ts +1 -0
  53. package/dist/graph/onchain/exploration.spec.js +1 -0
  54. package/dist/graph/onchain/exposure.d.ts +18 -0
  55. package/dist/graph/onchain/exposure.js +1 -0
  56. package/dist/graph/onchain/exposure.spec.d.ts +1 -0
  57. package/dist/graph/onchain/exposure.spec.js +1 -0
  58. package/dist/graph/onchain/graph-policy.spec.d.ts +1 -0
  59. package/dist/graph/onchain/graph-policy.spec.js +1 -0
  60. package/dist/graph/onchain/index.d.ts +6 -0
  61. package/dist/graph/onchain/index.js +1 -1
  62. package/dist/graph/onchain/interest.js +1 -1
  63. package/dist/graph/onchain/interest.spec.js +1 -1
  64. package/dist/graph/onchain/names.js +1 -1
  65. package/dist/graph/onchain/names.spec.js +1 -1
  66. package/dist/graph/onchain/policy.d.ts +8 -0
  67. package/dist/graph/onchain/policy.js +1 -0
  68. package/dist/graph/onchain/proposal-graph.js +1 -1
  69. package/dist/graph/onchain/proposal-graph.spec.js +1 -1
  70. package/dist/graph/onchain/synthesis.d.ts +20 -0
  71. package/dist/graph/onchain/synthesis.js +1 -0
  72. package/dist/graph/onchain/synthesis.spec.d.ts +1 -0
  73. package/dist/graph/onchain/synthesis.spec.js +1 -0
  74. package/dist/graph/onchain/types.d.ts +11 -1
  75. package/dist/keeper/keeper.spec.js +1 -1
  76. package/dist/knowledge/alloc-audit-policy.spec.d.ts +1 -0
  77. package/dist/knowledge/alloc-audit-policy.spec.js +1 -0
  78. package/dist/knowledge/allocation-ledger.js +1 -1
  79. package/dist/knowledge/allocation-puzzle.d.ts +1 -1
  80. package/dist/knowledge/allocation-puzzle.js +1 -1
  81. package/dist/knowledge/allocation-risk.d.ts +4 -1
  82. package/dist/knowledge/allocation-risk.js +1 -1
  83. package/dist/knowledge/allocation-templates.js +1 -1
  84. package/dist/knowledge/arb-risk.d.ts +6 -5
  85. package/dist/knowledge/arb-risk.js +1 -1
  86. package/dist/knowledge/arbitration-ledger.d.ts +4 -4
  87. package/dist/knowledge/arbitration-ledger.js +1 -1
  88. package/dist/knowledge/arbitration-puzzle.d.ts +1 -1
  89. package/dist/knowledge/arbitration-puzzle.js +1 -1
  90. package/dist/knowledge/arbitration-risk.d.ts +4 -1
  91. package/dist/knowledge/arbitration-risk.js +1 -1
  92. package/dist/knowledge/arbitration-templates.js +1 -1
  93. package/dist/knowledge/baselines/judgment-baselines.json +289 -0
  94. package/dist/knowledge/baselines/risk-baselines.spec.js +1 -1
  95. package/dist/knowledge/baselines/rules/alloc_audit.json +290 -0
  96. package/dist/knowledge/baselines/rules/allocation.json +492 -0
  97. package/dist/knowledge/baselines/rules/arb.json +155 -0
  98. package/dist/knowledge/baselines/rules/arbitration.json +366 -0
  99. package/dist/knowledge/baselines/rules/bridge.json +197 -0
  100. package/dist/knowledge/baselines/rules/contact.json +152 -0
  101. package/dist/knowledge/baselines/rules/demand.json +158 -0
  102. package/dist/knowledge/baselines/rules/graph.json +453 -0
  103. package/dist/knowledge/baselines/rules/guard.json +981 -0
  104. package/dist/knowledge/baselines/rules/machine.json +706 -0
  105. package/dist/knowledge/baselines/rules/order.json +549 -0
  106. package/dist/knowledge/baselines/rules/payment.json +205 -0
  107. package/dist/knowledge/baselines/rules/permission.json +330 -0
  108. package/dist/knowledge/baselines/rules/personal.json +139 -0
  109. package/dist/knowledge/baselines/rules/progress.json +346 -0
  110. package/dist/knowledge/baselines/rules/proof.json +158 -0
  111. package/dist/knowledge/baselines/rules/registrar.json +159 -0
  112. package/dist/knowledge/baselines/rules/repository.json +244 -0
  113. package/dist/knowledge/baselines/rules/resource.json +117 -0
  114. package/dist/knowledge/baselines/rules/reward.json +471 -0
  115. package/dist/knowledge/baselines/rules/service.json +595 -0
  116. package/dist/knowledge/baselines/rules/treasury.json +440 -0
  117. package/dist/knowledge/baselines/rules/util.json +101 -0
  118. package/dist/knowledge/bridge-risk.d.ts +6 -5
  119. package/dist/knowledge/bridge-risk.js +1 -1
  120. package/dist/knowledge/builtin-templates.d.ts +26 -0
  121. package/dist/knowledge/builtin-templates.js +1 -0
  122. package/dist/knowledge/contact-risk.d.ts +6 -5
  123. package/dist/knowledge/contact-risk.js +1 -1
  124. package/dist/knowledge/demand-risk.d.ts +6 -5
  125. package/dist/knowledge/demand-risk.js +1 -1
  126. package/dist/knowledge/event-semantics.js +1 -1
  127. package/dist/knowledge/facts-sync.spec.d.ts +1 -0
  128. package/dist/knowledge/facts-sync.spec.js +1 -0
  129. package/dist/knowledge/getting-started.js +1 -1
  130. package/dist/knowledge/guard-design-patterns.js +1 -1
  131. package/dist/knowledge/guard-field-cognition.d.ts +1 -1
  132. package/dist/knowledge/guard-field-cognition.js +1 -1
  133. package/dist/knowledge/guard-ledger.js +1 -1
  134. package/dist/knowledge/guard-risk.d.ts +4 -1
  135. package/dist/knowledge/guard-risk.js +1 -1
  136. package/dist/knowledge/guard-templates.js +1 -1
  137. package/dist/knowledge/guard-translation.js +1 -1
  138. package/dist/knowledge/index.d.ts +10 -2
  139. package/dist/knowledge/index.js +1 -1
  140. package/dist/knowledge/industry-registry.js +1 -1
  141. package/dist/knowledge/industry-strategy.js +1 -1
  142. package/dist/knowledge/jsonrpc-enum.js +1 -1
  143. package/dist/knowledge/machine-ledger.js +1 -1
  144. package/dist/knowledge/machine-risk.d.ts +4 -1
  145. package/dist/knowledge/machine-risk.js +1 -1
  146. package/dist/knowledge/machine-templates.js +1 -1
  147. package/dist/knowledge/machine-translation.js +1 -1
  148. package/dist/knowledge/migration-preflight.js +1 -1
  149. package/dist/knowledge/operation-dictionary.js +1 -1
  150. package/dist/knowledge/order-ledger.js +1 -1
  151. package/dist/knowledge/order-puzzle.d.ts +3 -3
  152. package/dist/knowledge/order-puzzle.js +1 -1
  153. package/dist/knowledge/order-risk.d.ts +6 -3
  154. package/dist/knowledge/order-risk.js +1 -1
  155. package/dist/knowledge/order-templates.js +1 -1
  156. package/dist/knowledge/passport-ledger.js +1 -1
  157. package/dist/knowledge/passport-templates.js +1 -1
  158. package/dist/knowledge/payment-risk.d.ts +8 -6
  159. package/dist/knowledge/payment-risk.js +1 -1
  160. package/dist/knowledge/payment-tracker.js +1 -1
  161. package/dist/knowledge/permission-ledger.js +1 -1
  162. package/dist/knowledge/permission-puzzle.d.ts +12 -12
  163. package/dist/knowledge/permission-puzzle.js +1 -1
  164. package/dist/knowledge/permission-risk.d.ts +4 -7
  165. package/dist/knowledge/permission-risk.js +1 -1
  166. package/dist/knowledge/permission-templates.js +1 -1
  167. package/dist/knowledge/personal-risk.d.ts +6 -5
  168. package/dist/knowledge/personal-risk.js +1 -1
  169. package/dist/knowledge/progress-ledger.js +1 -1
  170. package/dist/knowledge/progress-puzzle.d.ts +2 -2
  171. package/dist/knowledge/progress-puzzle.js +1 -1
  172. package/dist/knowledge/progress-risk.d.ts +4 -1
  173. package/dist/knowledge/progress-risk.js +1 -1
  174. package/dist/knowledge/progress-templates.js +1 -1
  175. package/dist/knowledge/proof-risk.d.ts +6 -5
  176. package/dist/knowledge/proof-risk.js +1 -1
  177. package/dist/knowledge/puzzle-projections.js +1 -1
  178. package/dist/knowledge/recipient-constraint.d.ts +20 -1
  179. package/dist/knowledge/recipient-constraint.js +1 -1
  180. package/dist/knowledge/registrar-risk.d.ts +6 -5
  181. package/dist/knowledge/registrar-risk.js +1 -1
  182. package/dist/knowledge/repository-risk.d.ts +7 -6
  183. package/dist/knowledge/repository-risk.js +1 -1
  184. package/dist/knowledge/resource-risk.d.ts +6 -5
  185. package/dist/knowledge/resource-risk.js +1 -1
  186. package/dist/knowledge/reward-ledger.d.ts +1 -1
  187. package/dist/knowledge/reward-ledger.js +1 -1
  188. package/dist/knowledge/reward-puzzle.d.ts +2 -2
  189. package/dist/knowledge/reward-puzzle.js +1 -1
  190. package/dist/knowledge/reward-risk.d.ts +4 -1
  191. package/dist/knowledge/reward-risk.js +1 -1
  192. package/dist/knowledge/rule-node-analyzers.spec.js +1 -1
  193. package/dist/knowledge/rule-outcome.js +1 -1
  194. package/dist/knowledge/scenario-modes.d.ts +2 -2
  195. package/dist/knowledge/scenario-modes.js +1 -1
  196. package/dist/knowledge/scenario-topology.js +1 -1
  197. package/dist/knowledge/service-allocator-audit-node.js +1 -1
  198. package/dist/knowledge/service-ledger.js +1 -1
  199. package/dist/knowledge/service-puzzle.d.ts +2 -2
  200. package/dist/knowledge/service-puzzle.js +1 -1
  201. package/dist/knowledge/service-risk-node.js +1 -1
  202. package/dist/knowledge/service-risk.d.ts +4 -1
  203. package/dist/knowledge/service-risk.js +1 -1
  204. package/dist/knowledge/service-templates.js +1 -1
  205. package/dist/knowledge/strategy-manuals.d.ts +1 -1
  206. package/dist/knowledge/strategy-manuals.js +1 -1
  207. package/dist/knowledge/template-loader.d.ts +84 -0
  208. package/dist/knowledge/template-loader.js +1 -0
  209. package/dist/knowledge/template-loader.spec.d.ts +1 -0
  210. package/dist/knowledge/template-loader.spec.js +1 -0
  211. package/dist/knowledge/template-registry.js +1 -1
  212. package/dist/knowledge/template-scanner.d.ts +17 -0
  213. package/dist/knowledge/template-scanner.js +1 -0
  214. package/dist/knowledge/template-scanner.spec.d.ts +1 -0
  215. package/dist/knowledge/template-scanner.spec.js +1 -0
  216. package/dist/knowledge/tools-reference.js +1 -1
  217. package/dist/knowledge/treasury-ledger.d.ts +1 -1
  218. package/dist/knowledge/treasury-ledger.js +1 -1
  219. package/dist/knowledge/treasury-puzzle.d.ts +3 -3
  220. package/dist/knowledge/treasury-puzzle.js +1 -1
  221. package/dist/knowledge/treasury-risk.d.ts +4 -1
  222. package/dist/knowledge/treasury-risk.js +1 -1
  223. package/dist/knowledge/treasury-templates.js +1 -1
  224. package/dist/knowledge/util-risk.d.ts +6 -5
  225. package/dist/knowledge/util-risk.js +1 -1
  226. package/dist/knowledge/workflow-guidance.d.ts +4 -0
  227. package/dist/knowledge/workflow-guidance.js +1 -1
  228. package/dist/knowledge/workspace-lists.js +1 -1
  229. package/dist/monitor/MonitorLoop.js +1 -1
  230. package/dist/participation/arbitrator-interest.js +1 -1
  231. package/dist/participation/radar-core.js +1 -1
  232. package/dist/persona/analyzer.js +1 -1
  233. package/dist/persona/index.js +1 -1
  234. package/dist/persona/model.js +1 -1
  235. package/dist/persona/persona-audit.spec.d.ts +1 -0
  236. package/dist/persona/persona-audit.spec.js +1 -0
  237. package/dist/persona/types.d.ts +2 -0
  238. package/dist/playbooks/service-build/business-puzzle.js +1 -1
  239. package/dist/playbooks/service-build/facet-money.d.ts +11 -0
  240. package/dist/playbooks/service-build/facet-money.js +1 -1
  241. package/dist/playbooks/service-build/machine-panorama.d.ts +17 -0
  242. package/dist/playbooks/service-build/machine-panorama.js +1 -1
  243. package/dist/playbooks/service-build/merchant-guide.d.ts +2 -2
  244. package/dist/playbooks/service-build/migration-planner.d.ts +43 -0
  245. package/dist/playbooks/service-build/migration-planner.js +1 -0
  246. package/dist/playbooks/service-build/object-panorama.d.ts +42 -1
  247. package/dist/playbooks/service-build/object-panorama.js +1 -1
  248. package/dist/playbooks/service-build/participation-radar.js +1 -1
  249. package/dist/playbooks/service-build/pipeline-actions.d.ts +1 -1
  250. package/dist/playbooks/service-build/reverse-mapping.d.ts +1 -0
  251. package/dist/playbooks/service-build/reverse-mapping.js +1 -1
  252. package/dist/playbooks/service-build/risk-aggregator.d.ts +2 -1
  253. package/dist/playbooks/service-build/risk-aggregator.js +1 -1
  254. package/dist/playbooks/service-build/semantic-graph.js +1 -1
  255. package/dist/playbooks/service-build/service-panorama.d.ts +53 -1
  256. package/dist/playbooks/service-build/service-panorama.js +1 -1
  257. package/dist/playbooks/service-build/topology-evaluation.spec.js +1 -1
  258. package/dist/playbooks/service-build/topology-query.js +1 -1
  259. package/dist/playbooks/service-build/workflow-design-assessment.d.ts +2 -2
  260. package/dist/playbooks/service-build/workflow-design-assessment.js +1 -1
  261. package/dist/relationship/registry.js +1 -1
  262. package/dist/review/machine.js +1 -1
  263. package/dist/review/order.js +1 -1
  264. package/dist/review/service.js +1 -1
  265. package/dist/review/types.d.ts +7 -0
  266. package/dist/safety/confirm-gate.js +1 -1
  267. package/dist/schema/benchmark-migration/index.d.ts +207 -0
  268. package/dist/schema/benchmark-migration/index.js +1 -0
  269. package/dist/schema/call/allocation.d.ts +1 -1
  270. package/dist/schema/call/allocation.js +1 -1
  271. package/dist/schema/call/arbitration.d.ts +1 -1
  272. package/dist/schema/call/arbitration.js +1 -1
  273. package/dist/schema/call/base.d.ts +5 -5
  274. package/dist/schema/call/base.js +1 -1
  275. package/dist/schema/call/contact.d.ts +1 -1
  276. package/dist/schema/call/demand.d.ts +1 -1
  277. package/dist/schema/call/guard.d.ts +3 -3
  278. package/dist/schema/call/machine.d.ts +5 -5
  279. package/dist/schema/call/order.d.ts +3 -3
  280. package/dist/schema/call/payment.js +1 -1
  281. package/dist/schema/call/permission-handler.d.ts +1 -1
  282. package/dist/schema/call/permission-handler.js +1 -1
  283. package/dist/schema/call/permission.d.ts +16 -16
  284. package/dist/schema/call/permission.js +1 -1
  285. package/dist/schema/call/personal.d.ts +8 -8
  286. package/dist/schema/call/personal.js +1 -1
  287. package/dist/schema/call/progress.d.ts +3 -3
  288. package/dist/schema/call/repository.d.ts +11 -11
  289. package/dist/schema/call/repository.js +1 -1
  290. package/dist/schema/call/reward.d.ts +1 -1
  291. package/dist/schema/call/semantic.js +1 -1
  292. package/dist/schema/call/service.d.ts +7 -7
  293. package/dist/schema/call/service.js +1 -1
  294. package/dist/schema/call/treasury.d.ts +1 -1
  295. package/dist/schema/common/index.d.ts +6 -6
  296. package/dist/schema/common/index.js +1 -1
  297. package/dist/schema/config/index.d.ts +50 -1
  298. package/dist/schema/config/index.js +1 -1
  299. package/dist/schema/evaluation/index.d.ts +27 -11
  300. package/dist/schema/evaluation/index.js +1 -1
  301. package/dist/schema/goal/index.d.ts +5 -5
  302. package/dist/schema/goal/planning.d.ts +15 -15
  303. package/dist/schema/goal/planning.js +1 -1
  304. package/dist/schema/index.d.ts +1 -0
  305. package/dist/schema/index.js +1 -1
  306. package/dist/schema/interaction/index.d.ts +1 -1
  307. package/dist/schema/local/index.js +1 -1
  308. package/dist/schema/messenger/index.d.ts +26 -26
  309. package/dist/schema/operations.d.ts +33 -33
  310. package/dist/schema/operations.js +1 -1
  311. package/dist/schema/persona/index.d.ts +4708 -0
  312. package/dist/schema/persona/index.js +1 -1
  313. package/dist/schema/query/bi.d.ts +232 -25
  314. package/dist/schema/query/bi.js +1 -1
  315. package/dist/schema/query/index.d.ts +35 -35
  316. package/dist/schema/query/index.js +1 -1
  317. package/dist/schema/schema-version.js +1 -1
  318. package/dist/schema/workflow/index.d.ts +1 -1
  319. package/dist/schema/workspace/index.d.ts +53 -0
  320. package/dist/schema/workspace/index.js +1 -1
  321. package/dist/schema-query-impl/index.d.ts +9 -0
  322. package/dist/schema-query-impl/index.js +1 -1
  323. package/dist/schemas/benchmark_migration_operation.output.json +793 -0
  324. package/dist/schemas/benchmark_migration_operation.schema.json +83 -0
  325. package/dist/schemas/bridge_operation.schema.json +5 -5
  326. package/dist/schemas/config_operation.output.json +252 -0
  327. package/dist/schemas/config_operation.schema.json +21 -1
  328. package/dist/schemas/evaluation_operation.output.json +22 -10
  329. package/dist/schemas/goal_operation.schema.json +8 -8
  330. package/dist/schemas/guard2file.schema.json +1 -1
  331. package/dist/schemas/index.json +7 -1
  332. package/dist/schemas/machineNode2file.schema.json +1 -1
  333. package/dist/schemas/messenger_operation.schema.json +24 -12
  334. package/dist/schemas/onchain_events.output.json +1 -1
  335. package/dist/schemas/onchain_operations.output.json +4 -2
  336. package/dist/schemas/onchain_operations.schema.json +189 -139
  337. package/dist/schemas/onchain_operations_allocation.schema.json +13 -11
  338. package/dist/schemas/onchain_operations_arbitration.schema.json +10 -8
  339. package/dist/schemas/onchain_operations_contact.schema.json +7 -5
  340. package/dist/schemas/onchain_operations_demand.schema.json +7 -5
  341. package/dist/schemas/onchain_operations_gen_passport.schema.json +5 -3
  342. package/dist/schemas/onchain_operations_gen_proof.schema.json +1 -1
  343. package/dist/schemas/onchain_operations_guard.schema.json +5 -3
  344. package/dist/schemas/onchain_operations_machine.schema.json +22 -18
  345. package/dist/schemas/onchain_operations_order.schema.json +11 -7
  346. package/dist/schemas/onchain_operations_payment.schema.json +3 -3
  347. package/dist/schemas/onchain_operations_permission.schema.json +19 -11
  348. package/dist/schemas/onchain_operations_personal.schema.json +16 -10
  349. package/dist/schemas/onchain_operations_progress.schema.json +11 -7
  350. package/dist/schemas/onchain_operations_proof.schema.json +5 -3
  351. package/dist/schemas/onchain_operations_repository.schema.json +12 -8
  352. package/dist/schemas/onchain_operations_reward.schema.json +11 -9
  353. package/dist/schemas/onchain_operations_service.schema.json +28 -22
  354. package/dist/schemas/onchain_operations_treasury.schema.json +11 -9
  355. package/dist/schemas/onchain_table_data.output.json +27 -17
  356. package/dist/schemas/persona_operation.output.json +15875 -1
  357. package/dist/schemas/persona_operation.schema.json +3056 -478
  358. package/dist/schemas/query_toolkit.output.json +343 -63
  359. package/dist/schemas/query_toolkit.schema.json +1 -1
  360. package/dist/schemas/workflow_operation.schema.json +4 -2
  361. package/dist/schemas/workspace_operation.output.json +181 -1
  362. package/dist/schemas/workspace_operation.schema.json +61 -2
  363. package/dist/strategy/scorecard.js +1 -1
  364. package/dist/tools/handlers/benchmark-migration.d.ts +2 -0
  365. package/dist/tools/handlers/benchmark-migration.js +1 -0
  366. package/dist/tools/handlers/config.js +1 -1
  367. package/dist/tools/handlers/industry-pack.js +1 -1
  368. package/dist/tools/handlers/onchain.js +1 -1
  369. package/dist/tools/handlers/query.js +1 -1
  370. package/dist/tools/handlers/schema-query.js +1 -1
  371. package/dist/tools/handlers/workspace.js +1 -1
  372. package/dist/tools/index.js +1 -1
  373. package/dist/tools/move-fn-index.gen.d.ts +3 -0
  374. package/dist/tools/move-fn-index.gen.js +1 -0
  375. package/dist/tools/registry/business.js +1 -1
  376. package/dist/tools/registry/config.js +1 -1
  377. package/dist/tools/registry/evaluation.js +1 -1
  378. package/dist/tools/registry/onchain.js +1 -1
  379. package/dist/tools/sanitize-output.d.ts +3 -0
  380. package/dist/tools/sanitize-output.js +1 -0
  381. package/dist/tools/sanitize-output.spec.d.ts +1 -0
  382. package/dist/tools/sanitize-output.spec.js +1 -0
  383. package/package.json +9 -4
  384. package/dist/knowledge/baselines/evaluation-baselines.json +0 -79
@@ -0,0 +1,549 @@
1
+ {
2
+ "comment": "Order rule pack (R-O) — declarative form of the retired in-code Order risk rules. Facts are produced by the kernel extractor (order-risk.ts, bound to the live agent/dispute limits and the first-offender scans over items/agents); rules only reference fact names. Levels/wording can be retuned per rule and rules can be disabled (enabled=false, trace left) via the judgment document — factory rules can never be deleted or invented here.",
3
+ "facts": {
4
+ "object": "Order object address (present → the informational naming/observability rules surface).",
5
+ "is_buy_operation": "Whether the context is a create-via-service::buy operation.",
6
+ "operation": "The Order operation being attempted (set_agent_list, update_required_info, progress_advance, arb_*, receive, transfer_to, service_buy).",
7
+ "items_count": "KERNEL — number of items in the buy payload.",
8
+ "items_empty_hash_present": "KERNEL — first-offender scan: some item has a missing/empty wip_hash.",
9
+ "items_empty_hash_name": "KERNEL — rendered name of the first empty-wip_hash item ('undefined' when the item carries no name field).",
10
+ "distinct_agents": "KERNEL — distinct agent count of a set_agent_list payload (Set-deduped, matching the on-chain re-add semantics).",
11
+ "agents_input_count": "KERNEL — raw input agent-list length (0 when the agents array is absent).",
12
+ "agents_over_max": "KERNEL — distinct_agents exceeds MAX_AGENT_COUNT (chain-limit comparison sunk into the extractor).",
13
+ "max_agent_count": "KERNEL CONSTANT — live MAX_AGENT_COUNT from the published package.",
14
+ "dispute_count": "KERNEL — current dispute count, defaulting to 0.",
15
+ "disputes_at_max": "KERNEL — dispute_count has reached MAX_DISPUTE_COUNT.",
16
+ "max_dispute_count": "KERNEL CONSTANT — live MAX_DISPUTE_COUNT from the published package.",
17
+ "claimed_by_set": "Whether the Order's claimed_by flag is set.",
18
+ "claimed_by_display": "KERNEL — rendered claimed_by flag ('false' when absent, mirroring the retired default).",
19
+ "current_service_machine": "Current Service.machine address (snapshot divergence probe).",
20
+ "order_machine_snapshot": "The Order's machine snapshot (copied from the Service at buy time).",
21
+ "machine_snapshot_diverges": "KERNEL — both machine addresses present and different (fact-to-fact comparison sunk into the extractor).",
22
+ "progress_bound": "Whether a Progress object is bound to the Order.",
23
+ "receiving_exists": "Whether a Receiving object exists at the caller's address (the real receive gate created by the allocation payout).",
24
+ "caller_is_owner": "Whether the caller is the Order owner.",
25
+ "caller_is_agent": "Whether the caller is an agent on the Order.",
26
+ "service_published": "Whether the target Service is published (buy pre-flight).",
27
+ "service_paused": "Whether the target Service is paused (buy pre-flight).",
28
+ "transfer_to_new_owner_display": "KERNEL — rendered new owner address ('(unknown)' when absent).",
29
+ "new_owner_str": "KERNEL — String()-rendered new owner address ('undefined' when absent, mirroring the retired template literal)."
30
+ },
31
+ "rules": [
32
+ {
33
+ "rule_id": "R-O-1-01",
34
+ "dimension": "structural",
35
+ "trigger": "Order has 14 fields but no Permission field (unique among 22 objects)",
36
+ "cases": [
37
+ {
38
+ "when": { "field": "is_buy_operation", "op": "eq", "value": true },
39
+ "level": "low",
40
+ "title": "Order uses owner/agent dual-layer (no Permission)",
41
+ "description": "Order is the only business object among 22 WoWok objects that does NOT use the Permission system. All access control flows through inline owner-only and owner-or-agent permission checks.",
42
+ "scenario": "Developer assumes Order uses Permission and writes permission::check logic",
43
+ "mitigation": "Use owner/agent checks directly. Do NOT attempt to apply a Permission object to Order.",
44
+ "evidence": "no_permission_field",
45
+ "stakeholders": ["system", "owner", "agent"]
46
+ }
47
+ ]
48
+ },
49
+ {
50
+ "rule_id": "R-O-1-02",
51
+ "dimension": "structural",
52
+ "trigger": "Item count check (informational; no Move-level limit on items)",
53
+ "cases": [
54
+ {
55
+ "when": { "field": "items_count", "op": "gt", "value": 50 },
56
+ "level": "low",
57
+ "title": "Large items list may exceed tx size limits",
58
+ "description": "${items_count} items in a single Order — no protocol limit, but large lists increase transaction size and may hit gas/size limits",
59
+ "scenario": "Bulk purchase with many line items",
60
+ "mitigation": "Split into multiple Orders if items > 50",
61
+ "evidence": "items_count=${items_count}",
62
+ "stakeholders": ["owner"]
63
+ }
64
+ ]
65
+ },
66
+ {
67
+ "rule_id": "R-O-1-03",
68
+ "dimension": "structural",
69
+ "trigger": "dispute count >= MAX_DISPUTE_COUNT (10)",
70
+ "cases": [
71
+ {
72
+ "when": { "field": "disputes_at_max", "op": "eq", "value": true },
73
+ "level": "high",
74
+ "title": "Dispute count at MAX_DISPUTE_COUNT limit",
75
+ "description": "Order already has ${dispute_count} disputes (MAX_DISPUTE_COUNT=${max_dispute_count}). Next dispute() call will abort E_MAX_DISPUTE_COUNT.",
76
+ "scenario": "Filing 11th dispute on an Order with 10 existing disputes",
77
+ "mitigation": "Resolve existing disputes (via arb_claim_compensation) before filing new ones. Note: claimed_by blocks ALL future disputes.",
78
+ "evidence": "dispute_count=${dispute_count}",
79
+ "stakeholders": ["owner", "agent", "arbitrator"]
80
+ }
81
+ ]
82
+ },
83
+ {
84
+ "rule_id": "R-O-1-04",
85
+ "dimension": "structural",
86
+ "trigger": "set agent list — list REPLACEMENT semantics (omitted agents lose access) and distinct count limit",
87
+ "cases": [
88
+ {
89
+ "when": { "field": "agents_over_max", "op": "eq", "value": true },
90
+ "level": "high",
91
+ "title": "Distinct agent count exceeds MAX_AGENT_COUNT",
92
+ "description": "Attempting to set ${distinct_agents} distinct agents (input ${agents_input_count}; duplicates are deduped on-chain). Move asserts length < MAX_AGENT_COUNT (${max_agent_count}) before each push — the call will abort E_MAX_AGENT_COUNT.",
93
+ "scenario": "Setting 11 distinct agents in one call",
94
+ "mitigation": "Reduce to at most ${max_agent_count} distinct agents per call, or set in two batches (second call REPLACES the first — union the lists manually).",
95
+ "evidence": "distinct_agents=${distinct_agents}, input_count=${agents_input_count}, max=${max_agent_count}",
96
+ "stakeholders": ["owner", "system"]
97
+ }
98
+ ]
99
+ },
100
+ {
101
+ "rule_id": "R-O-1-05",
102
+ "dimension": "structural",
103
+ "trigger": "wip_hash is empty string in any item",
104
+ "cases": [
105
+ {
106
+ "when": { "field": "items_empty_hash_present", "op": "eq", "value": true },
107
+ "level": "high",
108
+ "title": "Empty wip_hash in item",
109
+ "description": "Item \"${items_empty_hash_name}\" has empty wip_hash. Move rejects empty strings (F-O-18).",
110
+ "scenario": "User submits item without computing WIP hash",
111
+ "mitigation": "Compute wip_hash from the work-in-progress file content before the buy.",
112
+ "evidence": "item=${items_empty_hash_name}",
113
+ "stakeholders": ["owner"]
114
+ }
115
+ ]
116
+ },
117
+ {
118
+ "rule_id": "R-O-2-01",
119
+ "dimension": "semantic",
120
+ "trigger": "Order.machine snapshot differs from current Service.machine",
121
+ "cases": [
122
+ {
123
+ "when": { "field": "machine_snapshot_diverges", "op": "eq", "value": true },
124
+ "level": "high",
125
+ "title": "Machine snapshot diverges from Service.machine",
126
+ "description": "Order.machine=${order_machine_snapshot} was snapshotted at buy time. Service.machine is now ${current_service_machine}. Same Service has Orders running different Machine versions.",
127
+ "scenario": "Service provider upgrades Machine after some Orders are created",
128
+ "mitigation": "Audit each Order's machine snapshot separately. Document Machine version per Order. Plan migration paths for legacy Orders.",
129
+ "evidence": "order_machine=${order_machine_snapshot}, service_machine=${current_service_machine}",
130
+ "stakeholders": ["owner", "service_provider", "arbitrator"]
131
+ }
132
+ ]
133
+ },
134
+ {
135
+ "rule_id": "R-O-2-02",
136
+ "dimension": "semantic",
137
+ "trigger": "SDK uses 'builder' field for Move's 'owner' field (naming deviation)",
138
+ "cases": [
139
+ {
140
+ "when": { "field": "object", "op": "truthy" },
141
+ "level": "medium",
142
+ "title": "SDK builder ≠ Move owner (only naming deviation in 22 objects)",
143
+ "description": "SDK ObjectOrder.builder corresponds to Move Order.owner. This is the only field name deviation across all 22 WoWok objects. All Order knowledge uses Move's 'owner' as canonical.",
144
+ "scenario": "Developer reads SDK 'builder' and assumes it's a different concept from owner",
145
+ "mitigation": "Use moveToSdkField()/sdkToMoveField() helpers from order-ledger.ts. Document 'builder = owner' in all SDK consumers.",
146
+ "evidence": "sdk_field=builder, move_field=owner",
147
+ "stakeholders": ["system"]
148
+ }
149
+ ]
150
+ },
151
+ {
152
+ "rule_id": "R-O-2-03",
153
+ "dimension": "semantic",
154
+ "trigger": "E_PROGRESS_NOT_SPECIFIED — single real semantics (order creation without Progress), commonly misdocumented as an agent-list/ownership freeze",
155
+ "cases": [
156
+ {
157
+ "when": { "all": [
158
+ { "field": "operation", "op": "eq", "value": "service_buy" },
159
+ { "field": "progress_bound", "op": "eq", "value": false }
160
+ ] },
161
+ "level": "high",
162
+ "title": "Order creation will abort E_PROGRESS_NOT_SPECIFIED — machine bound but Progress missing",
163
+ "description": "Order creation asserts progress.is_some() whenever machine.is_some(). A buy against a machine-driven Service MUST bind a Progress object (via the service's bind-order-progress call) before the order record is created, else E_PROGRESS_NOT_SPECIFIED (code 3).",
164
+ "scenario": "Machine-driven Service purchased without creating/binding the Progress object first",
165
+ "mitigation": "Bind Progress before the order record is created: use the service's bind-order-progress call, which performs the package-internal progress binding. Note: setting the agent list / transferring ownership are NOT affected — they are never frozen by Progress binding.",
166
+ "evidence": "operation=${operation}, progress_bound=${progress_bound}",
167
+ "stakeholders": ["owner"]
168
+ }
169
+ ]
170
+ },
171
+ {
172
+ "rule_id": "R-O-2-04",
173
+ "dimension": "semantic",
174
+ "trigger": "SaleItem.item → PurchasedItem.name field name mapping",
175
+ "cases": [
176
+ {
177
+ "when": { "field": "is_buy_operation", "op": "eq", "value": true },
178
+ "level": "low",
179
+ "title": "SaleItem.item (Move) maps to PurchasedItem.name (SDK)",
180
+ "description": "Move struct SaleItem uses field 'item', but SDK ObjectOrder.items uses field 'name'. This is the second naming deviation in Order system (after builder/owner).",
181
+ "scenario": "Cross-layer data mapping between Move and SDK",
182
+ "mitigation": "Use consistent SDK field names in user-facing code; document Move ↔ SDK mapping in audit logs.",
183
+ "evidence": "move_field=SaleItem.item, sdk_field=PurchasedItem.name",
184
+ "stakeholders": ["system"]
185
+ }
186
+ ]
187
+ },
188
+ {
189
+ "rule_id": "R-O-3-01",
190
+ "dimension": "authority",
191
+ "trigger": "Agent attempts receive or transfer_to (L1 owner-only operations)",
192
+ "cases": [
193
+ {
194
+ "when": { "all": [
195
+ { "field": "operation", "op": "in", "value": ["receive", "transfer_to"] },
196
+ { "field": "caller_is_agent", "op": "truthy" },
197
+ { "field": "caller_is_owner", "op": "falsy" }
198
+ ] },
199
+ "level": "high",
200
+ "title": "Agent attempting owner-only operation",
201
+ "description": "Agent cannot call ${operation} — these are L1 owner-only operations. Agent can operate progress/arb_*/required_info but CANNOT receive funds or transfer ownership.",
202
+ "scenario": "Logistics agent tries to collect payment on behalf of buyer",
203
+ "mitigation": "Owner must call receive/transfer_to directly. If delegation is needed, owner can transfer_to a multi-sig wallet that includes the agent.",
204
+ "evidence": "operation=${operation}, caller=agent",
205
+ "stakeholders": ["agent", "owner"]
206
+ }
207
+ ]
208
+ },
209
+ {
210
+ "rule_id": "R-O-3-02",
211
+ "dimension": "authority",
212
+ "trigger": "Non-owner non-agent attempts operation (no permission)",
213
+ "cases": [
214
+ {
215
+ "when": { "all": [
216
+ { "field": "operation", "op": "present" },
217
+ { "field": "caller_is_owner", "op": "eq", "value": false },
218
+ { "field": "caller_is_agent", "op": "eq", "value": false }
219
+ ] },
220
+ "level": "high",
221
+ "title": "Non-owner non-agent attempting operation",
222
+ "description": "Caller is neither owner nor agent. L2 operations (progress, arb_confirm, arb_objection) require the owner-or-agent permission check — aborts E_NOT_OP_PERMISSION. L1 operations (transfer_to, set agent list, update required_info) additionally require the owner-only check — aborts E_NOT_THE_OWNER.",
223
+ "scenario": "Random address attempts to advance someone else's Order",
224
+ "mitigation": "Verify caller is owner or in agent[] before submitting transaction.",
225
+ "evidence": "operation=${operation}, caller=unauthorized",
226
+ "stakeholders": ["system"]
227
+ }
228
+ ]
229
+ },
230
+ {
231
+ "rule_id": "R-O-3-03",
232
+ "dimension": "authority",
233
+ "trigger": "arb_claim_compensation called (sets claimed_by, irreversible)",
234
+ "cases": [
235
+ {
236
+ "when": { "field": "operation", "op": "eq", "value": "arb_claim_compensation" },
237
+ "level": "high",
238
+ "title": "arb_claim_compensation is IRREVERSIBLE (claimed_by one-time set)",
239
+ "description": "Setting claimed_by is permanent. After this call: (1) claimed_by cannot be reset, (2) NO new disputes can be filed (E_ORDER_ALREADY_CLAIMED), (3) all unresolved disputes become unactionable. If first compensation is insufficient, buyer has no recourse.",
240
+ "scenario": "Buyer claims partial compensation, then discovers additional damages",
241
+ "mitigation": "BEFORE claiming: (1) enumerate ALL disputes, (2) ensure proposition covers all damages, (3) confirm Arb ruling is final. Add explicit user confirmation (C-O-08).",
242
+ "evidence": "operation=arb_claim_compensation, current_claimed_by=${claimed_by_display}",
243
+ "stakeholders": ["owner", "agent", "arbitrator"],
244
+ "exposure": {
245
+ "loss_parties": [
246
+ { "role": "buyer", "basis": "Claiming permanently consumes the dispute channel: every unresolved dispute becomes unactionable and no new dispute can ever be filed, so any shortfall in this first payout is unrecoverable." }
247
+ ],
248
+ "gain_paths": []
249
+ }
250
+ }
251
+ ]
252
+ },
253
+ {
254
+ "rule_id": "R-O-3-04",
255
+ "dimension": "authority",
256
+ "trigger": "dispute attempted after claimed_by is set",
257
+ "cases": [
258
+ {
259
+ "when": { "all": [
260
+ { "field": "claimed_by_set", "op": "truthy" },
261
+ { "field": "operation", "op": "in", "value": ["arb_confirm", "arb_objection"] }
262
+ ] },
263
+ "level": "high",
264
+ "title": "Cannot file new dispute after claimed_by is set",
265
+ "description": "Order.claimed_by is set — any new dispute() call aborts E_ORDER_ALREADY_CLAIMED. arb_confirm/arb_objection trigger dispute() internally.",
266
+ "scenario": "Buyer claims compensation then tries to file additional dispute",
267
+ "mitigation": "Resolve ALL disputes BEFORE calling arb_claim_compensation. claimed_by is terminal for dispute flow.",
268
+ "evidence": "operation=${operation}, claimed_by_set=true",
269
+ "stakeholders": ["owner", "agent"]
270
+ }
271
+ ]
272
+ },
273
+ {
274
+ "rule_id": "R-O-4-01",
275
+ "dimension": "lifecycle",
276
+ "trigger": "Attempt to create Order independently (not via the buy flow)",
277
+ "cases": [
278
+ {
279
+ "when": { "all": [
280
+ { "field": "is_buy_operation", "op": "eq", "value": false },
281
+ { "field": "operation", "op": "eq", "value": "service_buy" },
282
+ { "field": "object", "op": "falsy" }
283
+ ] },
284
+ "level": "critical",
285
+ "title": "Order cannot be created independently (compound creation only)",
286
+ "description": "Order record creation is package-only — only the buy flow can create Orders. Any attempt to create one directly will fail at the Move module boundary. Order + Allocation + Progress are created atomically in one transaction.",
287
+ "scenario": "Developer tries to construct Order independently for testing",
288
+ "mitigation": "Always use the buy flow to create Orders. For testing, deploy a minimal Service with machine/allocators configured.",
289
+ "evidence": "independent_creation_attempted",
290
+ "stakeholders": ["system", "owner"]
291
+ }
292
+ ]
293
+ },
294
+ {
295
+ "rule_id": "R-O-4-02",
296
+ "dimension": "lifecycle",
297
+ "trigger": "set agent list attempted mid-fulfillment (Progress bound) — replacement may revoke active agents",
298
+ "cases": [
299
+ {
300
+ "when": { "all": [
301
+ { "field": "operation", "op": "eq", "value": "set_agent_list" },
302
+ { "field": "progress_bound", "op": "truthy" }
303
+ ] },
304
+ "level": "medium",
305
+ "title": "Mid-fulfillment agent-list replacement — replacement may silently revoke active agents",
306
+ "description": "Setting the agent list is allowed at ANY time (no Progress freeze exists on-chain), but it REPLACES the entire list: an active agent omitted from the new list immediately loses L2 access (Progress advance, arb operations) and their EntityOrders role record is removed. A workflow waiting on that agent to advance Progress would stall.",
307
+ "scenario": "Owner adjusts the agent list mid-fulfillment and accidentally drops the agent responsible for the next Progress node",
308
+ "mitigation": "When changing agents mid-fulfillment, always include the union of current active agents plus the additions. Query the current agent list first (order query), merge, then submit.",
309
+ "evidence": "operation=set_agent_list, progress_bound=${progress_bound}",
310
+ "stakeholders": ["owner", "agent"],
311
+ "exposure": {
312
+ "loss_parties": [
313
+ { "role": "buyer", "basis": "If the workflow was waiting on the dropped agent, the order stalls at that node — escrowed order funds freeze until the agent list is repaired." },
314
+ { "role": "merchant", "basis": "The merchant revenue share of the same stalled orders freezes with them." }
315
+ ],
316
+ "gain_paths": []
317
+ }
318
+ }
319
+ ]
320
+ },
321
+ {
322
+ "rule_id": "R-O-4-03",
323
+ "dimension": "lifecycle",
324
+ "trigger": "Progress advance attempted without progress bound",
325
+ "cases": [
326
+ {
327
+ "when": { "all": [
328
+ { "field": "operation", "op": "eq", "value": "progress_advance" },
329
+ { "field": "progress_bound", "op": "eq", "value": false }
330
+ ] },
331
+ "level": "high",
332
+ "title": "Cannot advance Progress — no Progress bound to Order",
333
+ "description": "Order has no progress field set (Service had no machine configured). Cannot advance a non-existent Progress. SDK CallOrder validates this pre-flight (CallOrder_Data.progress requires order.machine and order.progress).",
334
+ "scenario": "Buyer tries to advance Progress on an Order created from a Service without machine",
335
+ "mitigation": "Use a Service with machine configured. If manual lifecycle is needed, track state off-chain.",
336
+ "evidence": "operation=progress_advance, progress_bound=false",
337
+ "stakeholders": ["owner", "agent"]
338
+ }
339
+ ]
340
+ },
341
+ {
342
+ "rule_id": "R-O-4-04",
343
+ "dimension": "lifecycle",
344
+ "trigger": "arb_confirm/arb_objection/arb_claim_compensation (irreversible Arb operations)",
345
+ "cases": [
346
+ {
347
+ "when": { "field": "operation", "op": "in", "value": ["arb_confirm", "arb_objection", "arb_claim_compensation"] },
348
+ "level": "high",
349
+ "title": "${operation} is irreversible (triggers Arb flow)",
350
+ "description": "${operation} triggers the Arbitration workflow which cannot be undone. arb_confirm files a new dispute, arb_objection requests re-arbitration, arb_claim_compensation sets claimed_by permanently.",
351
+ "scenario": "User accidentally files arb_confirm without understanding consequences",
352
+ "mitigation": "Add explicit user confirmation (C-O-08, C-O-11, C-O-12) before these operations. Show warning text describing irreversibility.",
353
+ "evidence": "operation=${operation}",
354
+ "stakeholders": ["owner", "agent", "arbitrator"]
355
+ }
356
+ ]
357
+ },
358
+ {
359
+ "rule_id": "R-O-4-05",
360
+ "dimension": "lifecycle",
361
+ "trigger": "receive attempted but no Receiving exists at the caller's address (the allocation payout has not distributed a payment)",
362
+ "cases": [
363
+ {
364
+ "when": { "all": [
365
+ { "field": "operation", "op": "eq", "value": "receive" },
366
+ { "field": "receiving_exists", "op": "eq", "value": false }
367
+ ] },
368
+ "level": "high",
369
+ "title": "receive blocked — no Receiving object (the allocation payout has not run)",
370
+ "description": "Receiving the payment is gated by Receiving existence: the allocation payout must have run on the Order's Allocation object and included the caller's address in the payment recipients. Without a Receiving, the transaction cannot be constructed (no E_ORDER_DELIVERING abort exists on-chain — Progress terminal state is NOT a receive gate).",
371
+ "scenario": "Buyer tries to collect a payment before the allocation flow has distributed it",
372
+ "mitigation": "1) Confirm the allocation payout has run on the Order's Allocation (query its payment vector) 2) Confirm the caller's address is in the allocator's sharing recipients 3) Retry receive with the correct Receiving object ID. If the merchant withholds allocation, file arb_confirm to dispute.",
373
+ "evidence": "operation=receive, receiving_exists=${receiving_exists}",
374
+ "stakeholders": ["owner"],
375
+ "exposure": {
376
+ "loss_parties": [
377
+ { "role": "buyer", "basis": "The payout cannot be collected: with no Receiving at the caller's address there is no receive path — the buyer's share sits undistributed in the Allocation." }
378
+ ],
379
+ "gain_paths": [
380
+ {
381
+ "role": "merchant",
382
+ "path": "Withholding the allocation run keeps the order's escrow undistributed instead of paying the buyer's share out.",
383
+ "viability": "conditional",
384
+ "gate": "Executes only if the merchant actually withholds the allocation rather than the payout merely pending — the buyer's remedy is filing a dispute."
385
+ }
386
+ ]
387
+ }
388
+ }
389
+ ]
390
+ },
391
+ {
392
+ "rule_id": "R-O-4-06",
393
+ "dimension": "lifecycle",
394
+ "trigger": "transfer_to attempted (irreversible ownership transfer)",
395
+ "cases": [
396
+ {
397
+ "when": { "field": "operation", "op": "eq", "value": "transfer_to" },
398
+ "level": "critical",
399
+ "title": "transfer_to is IRREVERSIBLE — new owner takes over ALL permissions",
400
+ "description": "Ownership transfer to ${transfer_to_new_owner_display} is permanent. New owner becomes the sole receiver of payments and gains full L1 control. Original owner loses ALL access.",
401
+ "scenario": "Buyer transfers Order to wrong address by mistake",
402
+ "mitigation": "1) Verify new owner address twice. 2) Coordinate with new owner before transfer. 3) Add explicit user confirmation (C-O-10). Note: transfer_to is allowed at any time (no Progress freeze exists).",
403
+ "evidence": "new_owner=${new_owner_str}",
404
+ "stakeholders": ["owner"],
405
+ "exposure": {
406
+ "loss_parties": [
407
+ { "role": "buyer", "basis": "The original owner loses ALL access and payment receivership the moment the transfer lands — there is no reversal path." }
408
+ ],
409
+ "gain_paths": [
410
+ {
411
+ "role": "neutral",
412
+ "path": "Whichever address is submitted becomes the sole receiver of all remaining payments and the full L1 controller of the Order.",
413
+ "viability": "viable",
414
+ "gate": "The Move layer performs no destination verification — the transfer executes exactly as submitted and cannot be undone."
415
+ }
416
+ ]
417
+ }
418
+ }
419
+ ]
420
+ },
421
+ {
422
+ "rule_id": "R-O-5-01",
423
+ "dimension": "cross_object",
424
+ "trigger": "Service.machine upgraded after Order creation (snapshot divergence)",
425
+ "cases": [
426
+ {
427
+ "when": { "field": "is_buy_operation", "op": "eq", "value": true },
428
+ "level": "low",
429
+ "title": "Service snapshot mechanism — order.machine is a copy, not a reference",
430
+ "description": "When the buy flow creates an Order, order.machine is COPIED from service.machine. Future Service.machine upgrades do NOT affect this Order. Same Service may have Orders running different Machine versions.",
431
+ "scenario": "Service provider upgrades Machine workflow — old Orders keep old workflow",
432
+ "mitigation": "Track Machine version per Order (via order.machine address). Plan migration paths for legacy Orders. Document that old Orders are decoupled.",
433
+ "evidence": "snapshot_mechanism",
434
+ "stakeholders": ["owner", "service_provider", "arbitrator"]
435
+ }
436
+ ]
437
+ },
438
+ {
439
+ "rule_id": "R-O-5-02",
440
+ "dimension": "cross_object",
441
+ "trigger": "Order references Progress that no longer exists or is corrupted",
442
+ "cases": [
443
+ {
444
+ "when": { "all": [
445
+ { "field": "progress_bound", "op": "truthy" },
446
+ { "field": "object", "op": "truthy" }
447
+ ] },
448
+ "level": "medium",
449
+ "title": "Order-Progress 1:1 binding (E_PROGRESS_ALREADY_SPECIFIED)",
450
+ "description": "Order.progress is one-time-set at binding (package-only). Cannot be rebound. If Progress object is corrupted, Order becomes stuck — cannot advance, cannot rebind.",
451
+ "scenario": "Progress object becomes unresponsive or corrupted",
452
+ "mitigation": "Ensure Progress integrity via Machine audit before publishing Service. Use arb_claim_compensation as escape hatch if Progress is stuck.",
453
+ "evidence": "progress_bound=${progress_bound}",
454
+ "stakeholders": ["owner", "agent"]
455
+ }
456
+ ]
457
+ },
458
+ {
459
+ "rule_id": "R-O-5-03",
460
+ "dimension": "cross_object",
461
+ "trigger": "Order references Allocation that no longer exists or is corrupted",
462
+ "cases": [
463
+ {
464
+ "when": { "all": [
465
+ { "field": "object", "op": "truthy" },
466
+ { "field": "progress_bound", "op": "truthy" }
467
+ ] },
468
+ "level": "medium",
469
+ "title": "Order-Allocation 1:1 binding (E_ALLOCATION_ALREADY_SPECIFIED)",
470
+ "description": "Order.allocation is one-time-set at binding (package-only). Cannot be rebound. If Allocation object is corrupted, fund distribution is blocked.",
471
+ "scenario": "Allocation object has wrong allocator configuration",
472
+ "mitigation": "Audit order_allocators configuration on Service BEFORE publishing. Use compensation_fund as fallback fund source.",
473
+ "evidence": "allocation_binding",
474
+ "stakeholders": ["owner", "service_provider"]
475
+ }
476
+ ]
477
+ },
478
+ {
479
+ "rule_id": "R-O-5-04",
480
+ "dimension": "cross_object",
481
+ "trigger": "Arbitration dispute appended to Order.dispute list",
482
+ "cases": [
483
+ {
484
+ "when": { "field": "operation", "op": "eq", "value": "arb_confirm" },
485
+ "level": "low",
486
+ "title": "Arb object will be appended to order.dispute (package-only dispute())",
487
+ "description": "arb_confirm triggers the Arb module to append the Arb object to the order.dispute list (package-internal). Max 10 disputes (MAX_DISPUTE_COUNT). Frozen when claimed_by is set.",
488
+ "scenario": "Multiple arb_confirm calls create multiple Arb objects on same Order",
489
+ "mitigation": "Track dispute count. Once at 10, no more disputes can be filed. Resolve existing disputes before filing new ones.",
490
+ "evidence": "operation=arb_confirm, current_disputes=${dispute_count}",
491
+ "stakeholders": ["arbitrator", "owner", "agent"]
492
+ }
493
+ ]
494
+ },
495
+ {
496
+ "rule_id": "R-O-5-05",
497
+ "dimension": "cross_object",
498
+ "trigger": "External system expects OrderCompletedEvent (does not exist)",
499
+ "cases": [
500
+ {
501
+ "when": { "any": [
502
+ { "field": "is_buy_operation", "op": "truthy" },
503
+ { "field": "object", "op": "truthy" }
504
+ ] },
505
+ "level": "medium",
506
+ "title": "Only NewOrderEvent emitted — no OrderCompletedEvent",
507
+ "description": "Move contract ONLY emits NewOrderEvent at creation. Order completion/cancellation/refund are IMPLICIT — must be inferred by querying Progress.current_node (terminal? cancel?) or Order.claimed_by. External monitoring requires polling, not event-driven.",
508
+ "scenario": "Analytics dashboard expects OrderCompletedEvent to track completion rate",
509
+ "mitigation": "Build composite query: NewOrderEvent + Order.progress query → infer completion. Document this limitation in monitoring tools. Long-term: advocate for Move upgrade to add OrderCompletedEvent.",
510
+ "evidence": "no_order_completed_event",
511
+ "stakeholders": ["system"]
512
+ }
513
+ ]
514
+ },
515
+ {
516
+ "rule_id": "R-O-5-06",
517
+ "dimension": "cross_object",
518
+ "trigger": "buy pre-flight: Service not published or paused",
519
+ "cases": [
520
+ {
521
+ "when": { "all": [
522
+ { "field": "is_buy_operation", "op": "truthy" },
523
+ { "field": "service_published", "op": "eq", "value": false }
524
+ ] },
525
+ "level": "critical",
526
+ "title": "Service not published — the buy will abort E_NOT_PUBLISHED",
527
+ "description": "Cannot create Order from an unpublished Service. Service must be published (bPublished=true) before the buy can be called.",
528
+ "scenario": "Buyer attempts to purchase from a draft Service",
529
+ "mitigation": "Verify Service.bPublished=true before buying. Service owner must publish the Service first.",
530
+ "evidence": "service_published=${service_published}",
531
+ "stakeholders": ["owner"]
532
+ },
533
+ {
534
+ "when": { "all": [
535
+ { "field": "is_buy_operation", "op": "truthy" },
536
+ { "field": "service_paused", "op": "eq", "value": true }
537
+ ] },
538
+ "level": "critical",
539
+ "title": "Service paused — the buy will abort E_PAUSED",
540
+ "description": "Cannot create Order from a paused Service. Service must be unpaused before the buy can be called.",
541
+ "scenario": "Buyer attempts to purchase from a paused Service (e.g. during maintenance)",
542
+ "mitigation": "Wait for the Service owner to unpause. Check Service.paused before buying.",
543
+ "evidence": "service_paused=${service_paused}",
544
+ "stakeholders": ["owner"]
545
+ }
546
+ ]
547
+ }
548
+ ]
549
+ }