@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,595 @@
1
+ {
2
+ "comment": "Service rule pack (R-S) — declarative form of the retired in-code Service risk rules (25 rules, 22 operation + 3 state-only buyer). Facts are produced by the kernel extractor (service-risk.ts, bound to the live service limits, the BigInt compensation-fund comparison and the first-offender WIP scans); 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
+ "sales_op": "KERNEL — the sales operation kind (add / set / remove / clear).",
5
+ "sales_projected_count": "KERNEL — projected sales count after an add/set (set: incoming count; add: current count + incoming).",
6
+ "sales_over_limit": "KERNEL — sales_projected_count exceeds MAX_SALE_COUNT (chain-limit comparison sunk into the extractor).",
7
+ "max_sale_count": "KERNEL CONSTANT — live MAX_SALE_COUNT from the published package.",
8
+ "repositories_op": "KERNEL — the repositories operation kind (add / set / remove / clear).",
9
+ "repositories_projected_count": "KERNEL — projected repositories count after an add/set.",
10
+ "repositories_over_limit": "KERNEL — repositories_projected_count exceeds MAX_REPOSITORY_COUNT.",
11
+ "max_repository_count": "KERNEL CONSTANT — live MAX_REPOSITORY_COUNT from the published package.",
12
+ "arbitrations_op": "KERNEL — the arbitrations operation kind (add / set / remove / clear).",
13
+ "arbitrations_present": "KERNEL — an arbitrations operation is present in the call (truthy gate of the retired check).",
14
+ "arbitrations_projected_count": "KERNEL — projected arbitrations count after an add/set.",
15
+ "arbitrations_over_limit": "KERNEL — arbitrations_projected_count exceeds MAX_ARBITRATION_COUNT.",
16
+ "max_arbitration_count": "KERNEL CONSTANT — live MAX_ARBITRATION_COUNT from the published package.",
17
+ "max_wip_hash_length": "KERNEL CONSTANT — live MAX_WIP_HASH_LENGTH from the published package.",
18
+ "max_wip_length": "KERNEL CONSTANT — live MAX_WIP_LENGTH from the published package.",
19
+ "wip_hash_offender_present": "KERNEL — first-offender scan over add/set sales: some wip_hash exceeds MAX_WIP_HASH_LENGTH (per-sale hash-before-url order preserved).",
20
+ "wip_hash_offender_name": "KERNEL — sale name of the over-length wip_hash offender.",
21
+ "wip_hash_offender_len": "KERNEL — length of the over-length wip_hash.",
22
+ "wip_url_offender_present": "KERNEL — first-offender scan over add/set sales: some wip URL exceeds MAX_WIP_LENGTH.",
23
+ "wip_url_offender_name": "KERNEL — sale name of the over-length wip URL offender.",
24
+ "wip_url_offender_len": "KERNEL — length of the over-length wip URL.",
25
+ "wip_local_present": "KERNEL — first-offender scan: some non-empty sale.wip classifies as local (path / localhost / LAN / unrecognized).",
26
+ "wip_local_sale_name": "KERNEL — sale name of the first local-wip offender.",
27
+ "wip_local_value": "KERNEL — the offending wip string itself.",
28
+ "wip_local_type": "KERNEL — regex classification of the offending wip ('local filesystem path' / 'localhost/loopback URL' / 'LAN (private IP) URL' / 'unrecognized format (not a network URL)').",
29
+ "wip_missing_hash_present": "KERNEL — first-offender scan over add/set sales: some sale has a wip URL but no wip_hash (tampering window).",
30
+ "wip_missing_hash_name": "KERNEL — sale name of the missing-wip_hash offender.",
31
+ "compensation_fund_add_present": "Whether a compensation_fund deposit is configured in the call.",
32
+ "compensation_fund_deposit": "KERNEL — String()-rendered deposit amount (mirrors the retired template literal).",
33
+ "order_new_items_count": "KERNEL — item count of the order_new buy payload (absent when there is no order_new).",
34
+ "order_new_empty_hash_count": "KERNEL — items with an empty-string wip_hash in the order_new buy payload.",
35
+ "discount_count": "KERNEL — discount issuance count.",
36
+ "discount_over_cap": "KERNEL — discount_count exceeds MAX_DISCOUNT_TOTAL_COUNT.",
37
+ "max_discount_total_count": "KERNEL CONSTANT — live MAX_DISCOUNT_TOTAL_COUNT from the published package.",
38
+ "publish": "Whether the publish operation is requested.",
39
+ "publish_blockers": "KERNEL — '; '-joined publish blockers ('order_allocators not set (F-S-18, E_NO_ALLOCATOR)', 'compensation_fund > 0 but no arbitrations (F-S-19, E_ARBITRATION_NOT_SET_WITH_COMPENSATION_FUND)').",
40
+ "publish_blocker_count": "KERNEL — number of publish blockers.",
41
+ "pause": "The pause/resume switch being set (present for any pause operation).",
42
+ "buy_guard_display": "KERNEL — rendered buy_guard ('(cleared)' when null; the fact is absent when the call carries no buy_guard field at all).",
43
+ "builder": "New owner address of the ownership transfer (builder field).",
44
+ "current_bPublished": "Current on-chain Service.bPublished state.",
45
+ "current_bPaused": "Current on-chain Service.bPaused state.",
46
+ "comp_fund_display": "KERNEL — rendered compensation_fund balance ('0' when absent).",
47
+ "comp_fund_positive_no_arb": "KERNEL — BigInt comparison: compensation_fund balance > 0 while no arbitration is bound (malformed balances are skipped, never fabricated).",
48
+ "comp_fund_unclaimable": "KERNEL — state-only R-S-5-05 probe: the balance is present, parses as BigInt, is > 0, and no arbitration is bound.",
49
+ "setting_lock_duration_add": "Milliseconds being added to setting_lock_duration (safe_add, only-increase).",
50
+ "post_publish_blocked_fields": "KERNEL — ', '-joined list of publish-locked fields touched post-publish ('machine (306)', 'arbitrations (308)', 'order_allocators (313)').",
51
+ "post_publish_blocked_fields_compact": "KERNEL — comma-joined variant of the same list.",
52
+ "post_publish_blocked_count": "KERNEL — number of publish-locked fields touched post-publish.",
53
+ "machine": "Machine address being bound (present for any machine op; null = clear).",
54
+ "machine_display_cleared": "KERNEL — rendered machine ('(cleared)' when null/absent).",
55
+ "order_allocators_display": "KERNEL — rendered order_allocators ('(set)' for a non-null value, '(cleared)' for null; the fact is absent when the call carries no order_allocators field at all).",
56
+ "repositories_addset_count": "KERNEL — repository object count of an add/set op.",
57
+ "rewards_addset_count": "KERNEL — reward object count of an add/set op.",
58
+ "rewards_op": "KERNEL — the rewards operation kind (add / set / remove / clear)."
59
+ },
60
+ "rules": [
61
+ {
62
+ "rule_id": "R-S-1-01",
63
+ "dimension": "structural",
64
+ "trigger": "sales count exceeds MAX_SALE_COUNT (50)",
65
+ "cases": [
66
+ {
67
+ "when": { "field": "sales_over_limit", "op": "eq", "value": true },
68
+ "level": "high",
69
+ "title": "Sales count exceeds limit",
70
+ "description": "Service would have ${sales_projected_count} sales items, exceeds MAX_SALE_COUNT ${max_sale_count}",
71
+ "scenario": "Adding too many product SKUs",
72
+ "mitigation": "Split into multiple Service objects or remove discontinued items",
73
+ "evidence": "sales_count=${sales_projected_count}",
74
+ "stakeholders": ["owner", "system"]
75
+ }
76
+ ]
77
+ },
78
+ {
79
+ "rule_id": "R-S-1-02",
80
+ "dimension": "structural",
81
+ "trigger": "repositories count exceeds MAX_REPOSITORY_COUNT (100)",
82
+ "cases": [
83
+ {
84
+ "when": { "field": "repositories_over_limit", "op": "eq", "value": true },
85
+ "level": "medium",
86
+ "title": "Repositories count exceeds limit",
87
+ "description": "Service would have ${repositories_projected_count} repositories, exceeds MAX_REPOSITORY_COUNT ${max_repository_count}",
88
+ "scenario": "Binding too many data repositories",
89
+ "mitigation": "Consolidate repositories or remove inactive ones",
90
+ "evidence": "repositories_count=${repositories_projected_count}",
91
+ "stakeholders": ["owner"]
92
+ }
93
+ ]
94
+ },
95
+ {
96
+ "rule_id": "R-S-1-03",
97
+ "dimension": "structural",
98
+ "trigger": "arbitrations count exceeds MAX_ARBITRATION_COUNT (20)",
99
+ "cases": [
100
+ {
101
+ "when": { "field": "arbitrations_over_limit", "op": "eq", "value": true },
102
+ "level": "high",
103
+ "title": "Arbitrations count exceeds limit",
104
+ "description": "Service would have ${arbitrations_projected_count} arbitrations, exceeds MAX_ARBITRATION_COUNT ${max_arbitration_count}",
105
+ "scenario": "Binding too many Arbitration objects",
106
+ "mitigation": "Use 1-3 Arbitration objects covering different dispute scopes",
107
+ "evidence": "arbitrations_count=${arbitrations_projected_count}",
108
+ "stakeholders": ["owner", "arbitrator"]
109
+ }
110
+ ]
111
+ },
112
+ {
113
+ "rule_id": "R-S-1-04",
114
+ "dimension": "structural",
115
+ "trigger": "WIP hash length exceeds MAX_WIP_HASH_LENGTH (64) or URL exceeds MAX_WIP_LENGTH (1024)",
116
+ "cases": [
117
+ {
118
+ "when": { "field": "wip_hash_offender_present", "op": "eq", "value": true },
119
+ "level": "high",
120
+ "title": "WIP hash length exceeds limit",
121
+ "description": "Sale \"${wip_hash_offender_name}\" wip_hash length ${wip_hash_offender_len} > MAX_WIP_HASH_LENGTH ${max_wip_hash_length}",
122
+ "scenario": "Malformed WIP hash (should be sha256 hex, 64 chars)",
123
+ "mitigation": "Use sha256 hex hash (64 characters, no prefix)",
124
+ "evidence": "wip_hash_length=${wip_hash_offender_len}",
125
+ "stakeholders": ["owner", "customer"]
126
+ },
127
+ {
128
+ "when": { "field": "wip_url_offender_present", "op": "eq", "value": true },
129
+ "level": "high",
130
+ "title": "WIP URL length exceeds limit",
131
+ "description": "Sale \"${wip_url_offender_name}\" wip URL length ${wip_url_offender_len} > MAX_WIP_LENGTH ${max_wip_length}",
132
+ "scenario": "WIP URL too long (use IPFS or short HTTPS URL)",
133
+ "mitigation": "Use IPFS CID or shorter URL",
134
+ "evidence": "wip_url_length=${wip_url_offender_len}",
135
+ "stakeholders": ["owner"]
136
+ }
137
+ ]
138
+ },
139
+ {
140
+ "rule_id": "R-S-1-05",
141
+ "dimension": "structural",
142
+ "trigger": "sale.wip is a local path / localhost / LAN URL (not network-deployable) — every customer order fails",
143
+ "cases": [
144
+ {
145
+ "when": { "field": "wip_local_present", "op": "eq", "value": true },
146
+ "level": "critical",
147
+ "title": "WIP is not network-deployed — every customer order will fail",
148
+ "description": "Sale \"${wip_local_sale_name}\" wip \"${wip_local_value}\" is a ${wip_local_type}. It passes set-time verification on the merchant's own machine but is unreachable by customers on other machines — order_new aborts 100% when a customer tries to buy.",
149
+ "scenario": "Merchant sets wip to a local file path / localhost / LAN URL and publishes the Service; the on-chain wip points at the merchant's machine; customers cannot fetch it.",
150
+ "mitigation": "Deploy the .wip file to a public host (GitHub Pages, IPFS, or your own website) and set sale.wip to the public URL. Or leave sale.wip empty (\"\") to skip WIP verification (TESTING ONLY — not recommended for production).",
151
+ "evidence": "sale=${wip_local_sale_name}, wip=${wip_local_value}",
152
+ "stakeholders": ["owner", "customer"]
153
+ }
154
+ ]
155
+ },
156
+ {
157
+ "rule_id": "R-S-2-01",
158
+ "dimension": "semantic",
159
+ "trigger": "WIP hash tampering risk — owner updates WIP file without updating wip_hash",
160
+ "cases": [
161
+ {
162
+ "when": { "field": "wip_missing_hash_present", "op": "eq", "value": true },
163
+ "level": "critical",
164
+ "title": "WIP hash missing — tampering risk",
165
+ "description": "Sale \"${wip_missing_hash_name}\" has wip URL but no wip_hash. Owner could replace the WIP file without customers noticing.",
166
+ "scenario": "Owner sets wip without hash, then changes file content later",
167
+ "mitigation": "Always compute sha256(wip_file_content) and set as wip_hash. SDK auto-derives if omitted, but explicit hash is safer.",
168
+ "evidence": "sale=${wip_missing_hash_name}",
169
+ "stakeholders": ["customer", "owner"],
170
+ "exposure": {
171
+ "loss_parties": [
172
+ { "role": "buyer", "basis": "The buyer pays against a WIP whose content is not hash-pinned — the served file can be silently replaced after the sale terms were presented, and what is delivered can differ from what was agreed." }
173
+ ],
174
+ "gain_paths": [
175
+ {
176
+ "role": "merchant",
177
+ "path": "Substituted content rides the normal order flow: with no wip_hash there is no on-chain check pinning the delivered content — payment still escrows and routes through the standard allocator path to the merchant.",
178
+ "viability": "viable",
179
+ "gate": "The missing wip_hash is directly observed on the sale entry; nothing on-chain pins the served file, so the substitution path is executable as-is."
180
+ }
181
+ ]
182
+ }
183
+ }
184
+ ]
185
+ },
186
+ {
187
+ "rule_id": "R-S-2-02",
188
+ "dimension": "semantic",
189
+ "trigger": "compensation_fund confused with Service balance (internal Balance<T>)",
190
+ "cases": [
191
+ {
192
+ "when": { "field": "compensation_fund_add_present", "op": "eq", "value": true },
193
+ "level": "high",
194
+ "title": "compensation_fund is internal Balance<T>, NOT Service-owned Treasury",
195
+ "description": "Depositing ${compensation_fund_deposit} to compensation_fund. This balance is internal to Service<T> and is consumed by the arbitration compensation claim, not by owner withdrawals. Owner can only withdraw via compensation_fund_withdraw (requires bPaused=true + lock_duration expired).",
196
+ "scenario": "Owner confuses compensation_fund with general Treasury",
197
+ "mitigation": "Use external Treasury (referenced via order_allocators.sharing.who=Entity) for general funds. Use compensation_fund only for arbitration payouts.",
198
+ "evidence": "deposit=${compensation_fund_deposit}",
199
+ "stakeholders": ["owner", "arbitrator", "customer"]
200
+ }
201
+ ]
202
+ },
203
+ {
204
+ "rule_id": "R-S-2-03",
205
+ "dimension": "semantic",
206
+ "trigger": "quote side effect — stock deduction not rolled back on later failure",
207
+ "cases": [
208
+ {
209
+ "when": { "field": "order_new_items_count", "op": "gte", "value": 1 },
210
+ "level": "high",
211
+ "title": "Order flow: stock deducted at quote stage — NOT rolled back on failure",
212
+ "description": "Order will deduct stock at Stage 3 (quote). If Stages 4-7 fail, stock remains deducted. Customer must manually re-add stock or accept the loss.",
213
+ "scenario": "Customer's transaction fails after quote but stock is gone",
214
+ "mitigation": "1) Monitor failed transactions and re-add the stock. 2) Set sales suspension during high-failure periods. 3) Use small batch orders to limit blast radius.",
215
+ "evidence": "items=${order_new_items_count}",
216
+ "stakeholders": ["owner", "customer"]
217
+ }
218
+ ]
219
+ },
220
+ {
221
+ "rule_id": "R-S-2-04",
222
+ "dimension": "semantic",
223
+ "trigger": "Discount issuance — verify type and total count semantics",
224
+ "cases": [
225
+ {
226
+ "when": { "field": "discount_over_cap", "op": "eq", "value": true },
227
+ "level": "medium",
228
+ "title": "Discount count exceeds total cap",
229
+ "description": "Issuing ${discount_count} discounts exceeds MAX_DISCOUNT_TOTAL_COUNT ${max_discount_total_count}",
230
+ "scenario": "Bulk discount issuance",
231
+ "mitigation": "Issue in batches of <= 1000 (MAX_DISCOUNT_COUNT_ONCE) and keep total <= ${max_discount_total_count}",
232
+ "evidence": "count=${discount_count}",
233
+ "stakeholders": ["owner"]
234
+ }
235
+ ]
236
+ },
237
+ {
238
+ "rule_id": "R-S-2-05",
239
+ "dimension": "semantic",
240
+ "trigger": "Order placed without verifying WIP hash — buyer passes empty wip_hash",
241
+ "cases": [
242
+ {
243
+ "when": { "field": "order_new_empty_hash_count", "op": "gte", "value": 1 },
244
+ "level": "medium",
245
+ "title": "Order with empty wip_hash — SDK auto-fills from sale",
246
+ "description": "${order_new_empty_hash_count} item(s) have empty wip_hash. SDK will auto-fill from sale.wip_hash at order time. If owner updates the WIP file between viewing and ordering, buyer receives the new (potentially different) content.",
247
+ "scenario": "Time-of-check to time-of-use WIP mismatch",
248
+ "mitigation": "Buyer should explicitly pass the wip_hash they saw when viewing the product. Empty string is convenience but riskier.",
249
+ "evidence": "empty_hash_items=${order_new_empty_hash_count}",
250
+ "stakeholders": ["customer"]
251
+ }
252
+ ]
253
+ },
254
+ {
255
+ "rule_id": "R-S-3-01",
256
+ "dimension": "authority",
257
+ "trigger": "publish operation — requires SERVICE_PUBLISH (311) + prerequisites",
258
+ "cases": [
259
+ {
260
+ "when": { "all": [
261
+ { "field": "publish", "op": "truthy" },
262
+ { "field": "publish_blocker_count", "op": "gte", "value": 1 }
263
+ ] },
264
+ "level": "critical",
265
+ "title": "Publish blocked — prerequisites not met",
266
+ "description": "Cannot publish: ${publish_blockers}",
267
+ "scenario": "Owner attempts publish without configuring prerequisites",
268
+ "mitigation": "Configure order_allocators (and arbitrations if compensation_fund > 0) before publish",
269
+ "evidence": "blockers=${publish_blocker_count}",
270
+ "stakeholders": ["owner"]
271
+ }
272
+ ]
273
+ },
274
+ {
275
+ "rule_id": "R-S-3-02",
276
+ "dimension": "authority",
277
+ "trigger": "pause operation — affects new orders but not existing Progress",
278
+ "cases": [
279
+ {
280
+ "when": { "field": "pause", "op": "eq", "value": true },
281
+ "level": "medium",
282
+ "title": "Pausing Service — new orders blocked, existing Progress continues",
283
+ "description": "Service.bPaused = true will reject new orders (E_PAUSED, service:19). Existing orders' Progress continues normally.",
284
+ "scenario": "Owner pauses for maintenance/stockout",
285
+ "mitigation": "Communicate pause to customers. Use compensation_fund_withdraw only when paused.",
286
+ "evidence": "pause=true",
287
+ "stakeholders": ["owner", "customer"]
288
+ },
289
+ {
290
+ "when": { "field": "pause", "op": "eq", "value": false },
291
+ "level": "medium",
292
+ "title": "Resuming Service — new orders accepted",
293
+ "description": "Service.bPaused = false will allow new orders again.",
294
+ "scenario": "Owner resumes after maintenance",
295
+ "mitigation": "Verify stock levels before resuming.",
296
+ "evidence": "pause=false",
297
+ "stakeholders": ["owner", "customer"]
298
+ }
299
+ ]
300
+ },
301
+ {
302
+ "rule_id": "R-S-3-03",
303
+ "dimension": "authority",
304
+ "trigger": "buy_guard change — post-publish mutable (unusual exception)",
305
+ "cases": [
306
+ {
307
+ "when": { "all": [
308
+ { "field": "buy_guard_display", "op": "present" },
309
+ { "field": "current_bPublished", "op": "truthy" }
310
+ ] },
311
+ "level": "medium",
312
+ "title": "buy_guard change post-publish — unusual mutability",
313
+ "description": "buy_guard is the ONLY publish-locked-field exception: it remains mutable post-publish. Other fields (machine/arbitrations/order_allocators) are immutable.",
314
+ "scenario": "Owner changes buy_guard strategy after publish (e.g. whitelist → public)",
315
+ "mitigation": "Document buy_guard changes for transparency. Customers should re-verify buy_guard before ordering.",
316
+ "evidence": "buy_guard=${buy_guard_display}",
317
+ "stakeholders": ["owner", "customer"]
318
+ }
319
+ ]
320
+ },
321
+ {
322
+ "rule_id": "R-S-3-04",
323
+ "dimension": "authority",
324
+ "trigger": "Ownership transfer (builder field) — irreversible",
325
+ "cases": [
326
+ {
327
+ "when": { "field": "builder", "op": "truthy" },
328
+ "level": "high",
329
+ "title": "Service ownership transfer — IRREVERSIBLE",
330
+ "description": "Transferring Service to ${builder}. Original owner loses ALL control. New owner inherits permission + compensation_fund + all bindings.",
331
+ "scenario": "Owner transfers Service to new address",
332
+ "mitigation": "1) Verify new owner address twice. 2) Withdraw compensation_fund first (if applicable). 3) Export Service JSON before transfer.",
333
+ "evidence": "new_owner=${builder}",
334
+ "stakeholders": ["owner"]
335
+ }
336
+ ]
337
+ },
338
+ {
339
+ "rule_id": "R-S-4-01",
340
+ "dimension": "lifecycle",
341
+ "trigger": "publish is irreversible — bPublished cannot be reset to false",
342
+ "cases": [
343
+ {
344
+ "when": { "all": [
345
+ { "field": "publish", "op": "truthy" },
346
+ { "field": "current_bPublished", "op": "truthy" }
347
+ ] },
348
+ "level": "high",
349
+ "title": "Service already published — publish is no-op",
350
+ "description": "Service.bPublished is already true. Subsequent publish calls have no effect (bPublished is one-shot, cannot revert).",
351
+ "scenario": "Owner calls publish again on already-published Service",
352
+ "mitigation": "Skip publish if already published. To 'reset' a Service, create a new one.",
353
+ "evidence": "bPublished=true",
354
+ "stakeholders": ["owner"]
355
+ },
356
+ {
357
+ "when": { "field": "publish", "op": "truthy" },
358
+ "level": "high",
359
+ "title": "Publish is IRREVERSIBLE — 3 fields will be locked forever",
360
+ "description": "Once published: machine (306), arbitrations (308), order_allocators (313) become permanently immutable. bPublished cannot be reset to false. Clone Service to make changes.",
361
+ "scenario": "Owner publishes Service for the first time",
362
+ "mitigation": "Verify all configurations before publish. Run pre-publish checklist (confirm-gate.ts).",
363
+ "evidence": "bPublished=false→true",
364
+ "stakeholders": ["owner", "customer"]
365
+ }
366
+ ]
367
+ },
368
+ {
369
+ "rule_id": "R-S-4-02",
370
+ "dimension": "lifecycle",
371
+ "trigger": "setting_lock_duration add — only-increase mechanism",
372
+ "cases": [
373
+ {
374
+ "when": { "field": "setting_lock_duration_add", "op": "present" },
375
+ "level": "medium",
376
+ "title": "setting_lock_duration can only INCREASE",
377
+ "description": "Adding ${setting_lock_duration_add} ms to setting_lock_duration. New value = old + input (safe_add). Cannot be decreased — protects customers from owner reducing lock to withdraw compensation_fund faster.",
378
+ "scenario": "Owner extends lock period to build trust",
379
+ "mitigation": "Ensure extension is intentional. Lock affects rewards/compensation_fund_withdraw/compensation_fund_receive.",
380
+ "evidence": "add_ms=${setting_lock_duration_add}",
381
+ "stakeholders": ["owner", "customer"]
382
+ }
383
+ ]
384
+ },
385
+ {
386
+ "rule_id": "R-S-4-03",
387
+ "dimension": "lifecycle",
388
+ "trigger": "machine/arbitrations/order_allocators modification after publish — SDK blocks",
389
+ "cases": [
390
+ {
391
+ "when": { "all": [
392
+ { "field": "current_bPublished", "op": "truthy" },
393
+ { "field": "post_publish_blocked_count", "op": "gte", "value": 1 }
394
+ ] },
395
+ "level": "high",
396
+ "title": "Post-publish modification blocked by SDK",
397
+ "description": "Service is published. Cannot modify: ${post_publish_blocked_fields}. SDK checkNotPublished() will abort. To change these fields, clone the Service.",
398
+ "scenario": "Owner attempts to change locked field post-publish",
399
+ "mitigation": "Create a new Service with the desired configuration. Migrate active orders if needed.",
400
+ "evidence": "blocked=${post_publish_blocked_fields_compact}",
401
+ "stakeholders": ["owner"]
402
+ }
403
+ ]
404
+ },
405
+ {
406
+ "rule_id": "R-S-4-04",
407
+ "dimension": "lifecycle",
408
+ "trigger": "sales modification — stock/price changes affect future orders only",
409
+ "cases": [
410
+ {
411
+ "when": { "field": "sales_op", "op": "present" },
412
+ "level": "low",
413
+ "title": "Sales modification affects future orders only",
414
+ "description": "Sales add/set/remove/clear changes do NOT affect already-created Orders. Existing Orders' Progress continues with the original sale parameters.",
415
+ "scenario": "Owner updates prices mid-campaign",
416
+ "mitigation": "Communicate price/stock changes to customers. Existing orders are unaffected.",
417
+ "evidence": "sales_op=${sales_op}",
418
+ "stakeholders": ["owner", "customer"]
419
+ }
420
+ ]
421
+ },
422
+ {
423
+ "rule_id": "R-S-4-05",
424
+ "dimension": "lifecycle",
425
+ "trigger": "Service paused (state-only buyer rule) — new orders are suspended",
426
+ "cases": [
427
+ {
428
+ "when": { "field": "current_bPaused", "op": "eq", "value": true },
429
+ "level": "high",
430
+ "title": "Service is paused — ordering suspended",
431
+ "description": "Service.bPaused is true. The merchant has actively paused the Service; new orders cannot be placed until it resumes.",
432
+ "scenario": "Buyer performs due diligence on a paused Service",
433
+ "mitigation": "Confirm with the merchant (via Messenger) when the Service will resume before ordering.",
434
+ "evidence": "bPaused=true",
435
+ "stakeholders": ["customer"]
436
+ }
437
+ ]
438
+ },
439
+ {
440
+ "rule_id": "R-S-4-06",
441
+ "dimension": "lifecycle",
442
+ "trigger": "Service not published (state-only buyer rule) — cannot be ordered",
443
+ "cases": [
444
+ {
445
+ "when": { "field": "current_bPublished", "op": "eq", "value": false },
446
+ "level": "high",
447
+ "title": "Service is not published — cannot be ordered",
448
+ "description": "Service.bPublished is false. The Service is still a draft: it is not visible on the market and order_new will fail.",
449
+ "scenario": "Buyer evaluates a draft Service shared out-of-band",
450
+ "mitigation": "Wait until the merchant publishes the Service (publish is irreversible — configuration is locked at that point).",
451
+ "evidence": "bPublished=false",
452
+ "stakeholders": ["customer"]
453
+ }
454
+ ]
455
+ },
456
+ {
457
+ "rule_id": "R-S-5-01",
458
+ "dimension": "cross_object",
459
+ "trigger": "Machine binding — post-publish immutable, Progress inherits",
460
+ "cases": [
461
+ {
462
+ "when": { "all": [
463
+ { "field": "machine", "op": "present" },
464
+ { "field": "current_bPublished", "op": "truthy" }
465
+ ] },
466
+ "level": "high",
467
+ "title": "Machine binding immutable post-publish",
468
+ "description": "Service is published; machine cannot be changed. All future Progress objects will use the bound Machine.",
469
+ "scenario": "Owner wants to upgrade workflow post-publish",
470
+ "mitigation": "Create new Service with new Machine. Migrate customers via discounts.",
471
+ "evidence": "machine=${machine_display_cleared}",
472
+ "stakeholders": ["owner"]
473
+ },
474
+ {
475
+ "when": { "field": "machine", "op": "present" },
476
+ "level": "medium",
477
+ "title": "Machine binding — verify Machine is published",
478
+ "description": "Binding Machine ${machine}. Ensure Machine is published — Service cannot bind unpublished Machine.",
479
+ "scenario": "Owner binds Machine before publishing Service",
480
+ "mitigation": "Verify Machine.bPublished = true before binding.",
481
+ "evidence": "machine=${machine}",
482
+ "stakeholders": ["owner"]
483
+ }
484
+ ]
485
+ },
486
+ {
487
+ "rule_id": "R-S-5-02",
488
+ "dimension": "cross_object",
489
+ "trigger": "Arbitration binding — required when compensation_fund > 0",
490
+ "cases": [
491
+ {
492
+ "when": { "all": [
493
+ { "field": "arbitrations_present", "op": "eq", "value": true },
494
+ { "field": "comp_fund_positive_no_arb", "op": "eq", "value": true }
495
+ ] },
496
+ "level": "high",
497
+ "title": "Arbitration required — compensation_fund has balance",
498
+ "description": "compensation_fund balance is ${comp_fund_display}. Publish will fail (E_ARBITRATION_NOT_SET_WITH_COMPENSATION_FUND) until arbitrations is non-empty.",
499
+ "scenario": "Owner deposits compensation_fund without configuring arbitrations",
500
+ "mitigation": "Add at least 1 Arbitration object before publish.",
501
+ "evidence": "compensation_fund=${comp_fund_display}",
502
+ "stakeholders": ["owner"]
503
+ }
504
+ ]
505
+ },
506
+ {
507
+ "rule_id": "R-S-5-03",
508
+ "dimension": "cross_object",
509
+ "trigger": "order_allocators binding — publish prerequisite, post-publish immutable",
510
+ "cases": [
511
+ {
512
+ "when": { "all": [
513
+ { "field": "order_allocators_display", "op": "present" },
514
+ { "field": "current_bPublished", "op": "truthy" }
515
+ ] },
516
+ "level": "high",
517
+ "title": "order_allocators immutable post-publish",
518
+ "description": "Service is published; order_allocators cannot be changed. Fund distribution strategy is permanently locked.",
519
+ "scenario": "Owner wants to adjust fee split post-publish",
520
+ "mitigation": "Create new Service with new allocators. Cannot migrate existing Orders.",
521
+ "evidence": "order_allocators=${order_allocators_display}",
522
+ "stakeholders": ["owner"]
523
+ },
524
+ {
525
+ "when": { "all": [
526
+ { "field": "order_allocators_display", "op": "present" },
527
+ { "field": "order_allocators_display", "op": "eq", "value": "(cleared)" },
528
+ { "field": "publish", "op": "truthy" }
529
+ ] },
530
+ "level": "critical",
531
+ "title": "Publish without order_allocators — will fail",
532
+ "description": "Publish will abort with E_NO_ALLOCATOR. order_allocators is a mandatory publish prerequisite.",
533
+ "scenario": "Owner attempts publish without configuring allocators",
534
+ "mitigation": "Set order_allocators before publish.",
535
+ "evidence": "order_allocators=null",
536
+ "stakeholders": ["owner"]
537
+ }
538
+ ]
539
+ },
540
+ {
541
+ "rule_id": "R-S-5-04",
542
+ "dimension": "cross_object",
543
+ "trigger": "Repository/Reward binding — verify object types before adding",
544
+ "cases": [
545
+ {
546
+ "when": { "all": [
547
+ { "field": "repositories_op", "op": "in", "value": ["add", "set"] }
548
+ ] },
549
+ "level": "low",
550
+ "title": "Repository binding — verify object types",
551
+ "description": "Adding ${repositories_addset_count} repositories. SDK uses queryObjectsWithType to validate each is ObjectType.Repository before binding.",
552
+ "scenario": "Owner adds non-Repository object by mistake",
553
+ "mitigation": "Use LocalMark names or addresses that are confirmed Repository objects.",
554
+ "evidence": "objects=${repositories_addset_count}",
555
+ "stakeholders": ["owner"]
556
+ },
557
+ {
558
+ "when": { "all": [
559
+ { "field": "rewards_op", "op": "in", "value": ["add", "set"] }
560
+ ] },
561
+ "level": "low",
562
+ "title": "Reward binding — verify object types",
563
+ "description": "Adding ${rewards_addset_count} rewards. SDK validates ObjectType.Reward. add is always allowed; only remove/clear are time-locked after publish.",
564
+ "scenario": "Owner adds Reward objects",
565
+ "mitigation": "Verify Reward objects exist and are active. Remember that removing them later requires pause + setting_lock_duration elapsed.",
566
+ "evidence": "objects=${rewards_addset_count}",
567
+ "stakeholders": ["owner"]
568
+ }
569
+ ]
570
+ },
571
+ {
572
+ "rule_id": "R-S-5-05",
573
+ "dimension": "cross_object",
574
+ "trigger": "compensation_fund has balance but no Arbitration bound (state-only buyer rule)",
575
+ "cases": [
576
+ {
577
+ "when": { "field": "comp_fund_unclaimable", "op": "eq", "value": true },
578
+ "level": "high",
579
+ "title": "Compensation fund without Arbitration — fund is unclaimable",
580
+ "description": "compensation_fund balance is ${comp_fund_display} but no Arbitration object is bound. Compensation is claimed via dispute → arbiter ruling with indemnity → fee withdrawal; without an Arbitration binding there is no dispute path to trigger a payout.",
581
+ "scenario": "Buyer sees a compensation fund but no dispute path to claim it",
582
+ "mitigation": "Require the merchant to bind at least one Arbitration object before ordering.",
583
+ "evidence": "compensation_fund=${comp_fund_display}, arbitrations=0",
584
+ "stakeholders": ["customer", "owner"],
585
+ "exposure": {
586
+ "loss_parties": [
587
+ { "role": "buyer", "basis": "The advertised compensation protection cannot be exercised: without a bound Arbitration there is no dispute-to-payout path, so a harmed buyer has no way to reach the compensation fund." }
588
+ ],
589
+ "gain_paths": []
590
+ }
591
+ }
592
+ ]
593
+ }
594
+ ]
595
+ }