@wowok/agent-mcp 3.1.2 → 3.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (300) hide show
  1. package/dist/config/runtime.js +1 -1
  2. package/dist/customer/index.d.ts +3 -9
  3. package/dist/customer/index.js +1 -1
  4. package/dist/customer/industry-risks.d.ts +3 -17
  5. package/dist/customer/industry-risks.js +1 -1
  6. package/dist/customer/types.d.ts +1 -165
  7. package/dist/customer/types.js +1 -1
  8. package/dist/customer/user-preferences.d.ts +0 -49
  9. package/dist/customer/user-preferences.js +1 -1
  10. package/dist/evaluation/architecture.spec.d.ts +1 -0
  11. package/dist/evaluation/architecture.spec.js +1 -0
  12. package/dist/evaluation/builtins/graph-service.d.ts +16 -0
  13. package/dist/evaluation/builtins/graph-service.js +1 -0
  14. package/dist/evaluation/builtins/graph-service.spec.d.ts +1 -0
  15. package/dist/evaluation/builtins/graph-service.spec.js +1 -0
  16. package/dist/evaluation/builtins/index.d.ts +1 -1
  17. package/dist/evaluation/builtins/index.js +1 -1
  18. package/dist/evaluation/builtins/purity.spec.d.ts +1 -0
  19. package/dist/evaluation/builtins/purity.spec.js +1 -0
  20. package/dist/evaluation/engine.js +1 -1
  21. package/dist/evaluation/facets/catalog.d.ts +19 -0
  22. package/dist/evaluation/facets/catalog.js +1 -0
  23. package/dist/evaluation/guard-scan.d.ts +10 -0
  24. package/dist/evaluation/guard-scan.js +1 -0
  25. package/dist/evaluation/standards.d.ts +31 -0
  26. package/dist/evaluation/standards.js +1 -0
  27. package/dist/evaluation/standards.spec.d.ts +1 -0
  28. package/dist/evaluation/standards.spec.js +1 -0
  29. package/dist/evaluation/types.d.ts +9 -0
  30. package/dist/experience/realtime-feedback.js +1 -1
  31. package/dist/extensions/index.d.ts +1 -1
  32. package/dist/extensions/index.js +1 -1
  33. package/dist/extensions/industry-layers.d.ts +6 -5
  34. package/dist/extensions/industry-layers.js +1 -1
  35. package/dist/extensions/industry-pack.js +1 -1
  36. package/dist/graph/onchain/analyze.d.ts +13 -0
  37. package/dist/graph/onchain/analyze.js +1 -1
  38. package/dist/graph/onchain/analyze.spec.js +1 -1
  39. package/dist/graph/onchain/dataplane.d.ts +1 -1
  40. package/dist/graph/onchain/dataplane.js +1 -1
  41. package/dist/graph/onchain/edge-batch.spec.d.ts +1 -0
  42. package/dist/graph/onchain/edge-batch.spec.js +1 -0
  43. package/dist/graph/onchain/edge-schema.d.ts +10 -2
  44. package/dist/graph/onchain/edge-schema.js +1 -1
  45. package/dist/graph/onchain/entity-profile.spec.d.ts +1 -0
  46. package/dist/graph/onchain/entity-profile.spec.js +1 -0
  47. package/dist/graph/onchain/event-history.spec.d.ts +1 -0
  48. package/dist/graph/onchain/event-history.spec.js +1 -0
  49. package/dist/graph/onchain/expand.js +1 -1
  50. package/dist/graph/onchain/extract-deep.spec.d.ts +1 -0
  51. package/dist/graph/onchain/extract-deep.spec.js +1 -0
  52. package/dist/graph/onchain/extract.d.ts +11 -3
  53. package/dist/graph/onchain/extract.js +1 -1
  54. package/dist/graph/onchain/facet-projection.d.ts +99 -0
  55. package/dist/graph/onchain/facet-projection.js +1 -0
  56. package/dist/graph/onchain/facet-projection.spec.d.ts +1 -0
  57. package/dist/graph/onchain/facet-projection.spec.js +1 -0
  58. package/dist/graph/onchain/facts.d.ts +103 -0
  59. package/dist/graph/onchain/facts.js +1 -0
  60. package/dist/graph/onchain/facts.spec.d.ts +1 -0
  61. package/dist/graph/onchain/facts.spec.js +1 -0
  62. package/dist/graph/onchain/field-manifest.d.ts +29 -0
  63. package/dist/graph/onchain/field-manifest.js +1 -0
  64. package/dist/graph/onchain/field-manifest.spec.d.ts +1 -0
  65. package/dist/graph/onchain/field-manifest.spec.js +1 -0
  66. package/dist/graph/onchain/fixtures.d.ts +80 -0
  67. package/dist/graph/onchain/fixtures.js +1 -0
  68. package/dist/graph/onchain/fixtures.spec.d.ts +1 -0
  69. package/dist/graph/onchain/fixtures.spec.js +1 -0
  70. package/dist/graph/onchain/index.d.ts +8 -2
  71. package/dist/graph/onchain/index.js +1 -1
  72. package/dist/graph/onchain/interest.js +1 -1
  73. package/dist/graph/onchain/label-lint.spec.d.ts +1 -0
  74. package/dist/graph/onchain/label-lint.spec.js +1 -0
  75. package/dist/graph/onchain/names.d.ts +23 -0
  76. package/dist/graph/onchain/names.js +1 -0
  77. package/dist/graph/onchain/names.spec.d.ts +1 -0
  78. package/dist/graph/onchain/names.spec.js +1 -0
  79. package/dist/graph/onchain/onchain.spec.js +1 -1
  80. package/dist/graph/onchain/proposal-graph.d.ts +11 -0
  81. package/dist/graph/onchain/proposal-graph.js +1 -0
  82. package/dist/graph/onchain/proposal-graph.spec.d.ts +1 -0
  83. package/dist/graph/onchain/proposal-graph.spec.js +1 -0
  84. package/dist/graph/onchain/sdk-batch.d.ts +5 -1
  85. package/dist/graph/onchain/sdk-batch.js +1 -1
  86. package/dist/graph/onchain/strategy.d.ts +16 -0
  87. package/dist/graph/onchain/strategy.js +1 -1
  88. package/dist/graph/onchain/strategy.spec.js +1 -1
  89. package/dist/graph/onchain/table-ledger.spec.d.ts +1 -0
  90. package/dist/graph/onchain/table-ledger.spec.js +1 -0
  91. package/dist/graph/onchain/types.d.ts +46 -6
  92. package/dist/graph/onchain/viewport.d.ts +1 -0
  93. package/dist/graph/onchain/viewport.js +1 -1
  94. package/dist/harness/index.d.ts +1 -5
  95. package/dist/harness/index.js +1 -1
  96. package/dist/harness/verify.d.ts +6 -1
  97. package/dist/harness/verify.js +1 -1
  98. package/dist/index.js +1 -1
  99. package/dist/knowledge/allocation-ledger.js +1 -1
  100. package/dist/knowledge/allocation-risk.d.ts +0 -2
  101. package/dist/knowledge/allocation-risk.js +1 -1
  102. package/dist/knowledge/arb-risk.d.ts +0 -1
  103. package/dist/knowledge/arb-risk.js +1 -1
  104. package/dist/knowledge/arbitration-risk.d.ts +0 -2
  105. package/dist/knowledge/arbitration-risk.js +1 -1
  106. package/dist/knowledge/baselines/evaluation-baselines.json +79 -0
  107. package/dist/knowledge/baselines/guard-lint-baseline.spec.d.ts +1 -0
  108. package/dist/knowledge/baselines/guard-lint-baseline.spec.js +1 -0
  109. package/dist/knowledge/baselines/risk-baselines.spec.d.ts +1 -0
  110. package/dist/knowledge/baselines/risk-baselines.spec.js +1 -0
  111. package/dist/knowledge/baselines/risk-cases.d.ts +8 -0
  112. package/dist/knowledge/baselines/risk-cases.js +1 -0
  113. package/dist/knowledge/bridge-risk.d.ts +0 -1
  114. package/dist/knowledge/bridge-risk.js +1 -1
  115. package/dist/knowledge/contact-risk.d.ts +0 -1
  116. package/dist/knowledge/contact-risk.js +1 -1
  117. package/dist/knowledge/contract-invariants.d.ts +1 -0
  118. package/dist/knowledge/contract-invariants.js +1 -1
  119. package/dist/knowledge/demand-risk.d.ts +0 -1
  120. package/dist/knowledge/demand-risk.js +1 -1
  121. package/dist/knowledge/getting-started.js +1 -1
  122. package/dist/knowledge/guard-eval.d.ts +15 -0
  123. package/dist/knowledge/guard-eval.js +1 -0
  124. package/dist/knowledge/guard-eval.spec.d.ts +1 -0
  125. package/dist/knowledge/guard-eval.spec.js +1 -0
  126. package/dist/knowledge/guard-lint.d.ts +1 -1
  127. package/dist/knowledge/guard-lint.js +1 -1
  128. package/dist/knowledge/guard-risk.d.ts +4 -19
  129. package/dist/knowledge/guard-risk.js +1 -1
  130. package/dist/knowledge/index.d.ts +41 -43
  131. package/dist/knowledge/index.js +1 -1
  132. package/dist/knowledge/industry-registry.js +1 -1
  133. package/dist/knowledge/industry-rule-node.d.ts +7 -0
  134. package/dist/knowledge/industry-rule-node.js +1 -0
  135. package/dist/knowledge/jsonrpc-enum.js +1 -1
  136. package/dist/knowledge/machine-risk.d.ts +0 -6
  137. package/dist/knowledge/machine-risk.js +1 -1
  138. package/dist/knowledge/order-risk.d.ts +1 -9
  139. package/dist/knowledge/order-risk.js +1 -1
  140. package/dist/knowledge/payment-risk.d.ts +0 -1
  141. package/dist/knowledge/payment-risk.js +1 -1
  142. package/dist/knowledge/permission-risk.d.ts +0 -3
  143. package/dist/knowledge/permission-risk.js +1 -1
  144. package/dist/knowledge/personal-risk.d.ts +0 -1
  145. package/dist/knowledge/personal-risk.js +1 -1
  146. package/dist/knowledge/progress-risk.d.ts +0 -2
  147. package/dist/knowledge/progress-risk.js +1 -1
  148. package/dist/knowledge/proof-risk.d.ts +0 -1
  149. package/dist/knowledge/proof-risk.js +1 -1
  150. package/dist/knowledge/puzzle-projections.d.ts +11 -0
  151. package/dist/knowledge/puzzle-projections.js +1 -0
  152. package/dist/knowledge/registrar-risk.d.ts +0 -1
  153. package/dist/knowledge/registrar-risk.js +1 -1
  154. package/dist/knowledge/repository-risk.d.ts +0 -1
  155. package/dist/knowledge/repository-risk.js +1 -1
  156. package/dist/knowledge/resource-risk.d.ts +0 -1
  157. package/dist/knowledge/resource-risk.js +1 -1
  158. package/dist/knowledge/reward-risk.d.ts +1 -5
  159. package/dist/knowledge/reward-risk.js +1 -1
  160. package/dist/knowledge/rule-node-analyzers.d.ts +43 -0
  161. package/dist/knowledge/rule-node-analyzers.js +1 -0
  162. package/dist/knowledge/rule-node-analyzers.spec.d.ts +1 -0
  163. package/dist/knowledge/rule-node-analyzers.spec.js +1 -0
  164. package/dist/knowledge/rule-outcome.d.ts +5 -0
  165. package/dist/knowledge/rule-outcome.js +1 -0
  166. package/dist/knowledge/safety-rules.js +1 -1
  167. package/dist/knowledge/scenario-topology.js +1 -1
  168. package/dist/knowledge/service-risk-node.js +1 -1
  169. package/dist/knowledge/service-risk.d.ts +0 -3
  170. package/dist/knowledge/service-risk.js +1 -1
  171. package/dist/knowledge/template-registry.js +1 -1
  172. package/dist/knowledge/tools-reference.js +1 -1
  173. package/dist/knowledge/treasury-risk.d.ts +2 -3
  174. package/dist/knowledge/treasury-risk.js +1 -1
  175. package/dist/knowledge/util-risk.d.ts +0 -1
  176. package/dist/knowledge/util-risk.js +1 -1
  177. package/dist/monitor/MonitorLoop.js +1 -1
  178. package/dist/persona/bridge.js +1 -1
  179. package/dist/persona/facet-profile.d.ts +33 -0
  180. package/dist/persona/facet-profile.js +1 -0
  181. package/dist/persona/model.d.ts +2 -1
  182. package/dist/persona/model.js +1 -1
  183. package/dist/persona/topology-focus.d.ts +2 -2
  184. package/dist/persona/topology-focus.js +1 -1
  185. package/dist/persona/types.d.ts +12 -0
  186. package/dist/playbooks/service-build/business-puzzle.js +1 -1
  187. package/dist/playbooks/service-build/facet-money.d.ts +22 -0
  188. package/dist/playbooks/service-build/facet-money.js +1 -0
  189. package/dist/playbooks/service-build/facet-money.spec.d.ts +1 -0
  190. package/dist/playbooks/service-build/facet-money.spec.js +1 -0
  191. package/dist/playbooks/service-build/machine-panorama.d.ts +3 -0
  192. package/dist/playbooks/service-build/machine-panorama.js +1 -1
  193. package/dist/playbooks/service-build/object-panorama.d.ts +27 -27
  194. package/dist/playbooks/service-build/object-panorama.js +1 -1
  195. package/dist/playbooks/service-build/pipeline-actions.d.ts +2 -2
  196. package/dist/playbooks/service-build/pipeline-actions.js +1 -1
  197. package/dist/playbooks/service-build/risk-aggregator.d.ts +2 -1
  198. package/dist/playbooks/service-build/risk-aggregator.js +1 -1
  199. package/dist/playbooks/service-build/service-panorama.d.ts +4 -9
  200. package/dist/playbooks/service-build/service-panorama.js +1 -1
  201. package/dist/playbooks/service-build/topology-evaluation.spec.d.ts +1 -0
  202. package/dist/playbooks/service-build/topology-evaluation.spec.js +1 -0
  203. package/dist/playbooks/service-build/topology-query.d.ts +13 -2
  204. package/dist/playbooks/service-build/topology-query.js +1 -1
  205. package/dist/review/arb.d.ts +0 -2
  206. package/dist/review/arb.js +1 -1
  207. package/dist/review/order.d.ts +0 -1
  208. package/dist/review/order.js +1 -1
  209. package/dist/role/profiles.js +1 -1
  210. package/dist/rules.d.ts +1 -2
  211. package/dist/rules.js +1 -1
  212. package/dist/safety/confirm-gate.js +1 -1
  213. package/dist/schema/call/base.d.ts +3372 -668
  214. package/dist/schema/call/base.js +1 -1
  215. package/dist/schema/call/handler.js +1 -1
  216. package/dist/schema/call/receipt.d.ts +28 -0
  217. package/dist/schema/call/receipt.js +1 -0
  218. package/dist/schema/call/semantic-customer-advice.spec.d.ts +1 -0
  219. package/dist/schema/call/semantic-customer-advice.spec.js +1 -0
  220. package/dist/schema/call/semantic.d.ts +5 -2
  221. package/dist/schema/call/semantic.js +1 -1
  222. package/dist/schema/call/treasury.js +1 -1
  223. package/dist/schema/common/index.js +1 -1
  224. package/dist/schema/evaluation/index.d.ts +289 -211
  225. package/dist/schema/evaluation/index.js +1 -1
  226. package/dist/schema/goal/index.d.ts +1 -1
  227. package/dist/schema/goal/planning.d.ts +2 -2
  228. package/dist/schema/index.d.ts +0 -1
  229. package/dist/schema/index.js +1 -1
  230. package/dist/schema/industry-pack/index.d.ts +1 -1
  231. package/dist/schema/keeper/index.d.ts +1 -1
  232. package/dist/schema/local/index.js +1 -1
  233. package/dist/schema/operations.d.ts +26 -10
  234. package/dist/schema/operations.js +1 -1
  235. package/dist/schema/persona/index.d.ts +24 -24
  236. package/dist/schema/query/bi.d.ts +613 -0
  237. package/dist/schema/query/bi.js +1 -1
  238. package/dist/schema/query/index.d.ts +9 -9
  239. package/dist/schema/schema-version.js +1 -1
  240. package/dist/schema/workspace/index.d.ts +2 -2
  241. package/dist/schema-query-impl/index.js +1 -1
  242. package/dist/schemas/account_operation.output.json +1 -1
  243. package/dist/schemas/bridge_operation.output.json +1 -1
  244. package/dist/schemas/evaluation_operation.output.json +691 -163
  245. package/dist/schemas/evaluation_operation.schema.json +0 -429
  246. package/dist/schemas/index.json +1 -7
  247. package/dist/schemas/keeper_operation.output.json +1 -1
  248. package/dist/schemas/local_history_operation.output.json +1 -1
  249. package/dist/schemas/local_info_operation.output.json +1 -1
  250. package/dist/schemas/local_mark_operation.output.json +1 -1
  251. package/dist/schemas/messenger_operation.output.json +1 -1
  252. package/dist/schemas/monitor_events.output.json +1 -1
  253. package/dist/schemas/monitor_subscription.output.json +1 -1
  254. package/dist/schemas/onchain_events.output.json +1 -1
  255. package/dist/schemas/onchain_operations.output.json +6357 -3724
  256. package/dist/schemas/onchain_operations.schema.json +2 -2
  257. package/dist/schemas/onchain_operations_treasury.schema.json +2 -2
  258. package/dist/schemas/onchain_table_data.output.json +61 -71
  259. package/dist/schemas/query_toolkit.output.json +841 -8
  260. package/dist/schemas/query_toolkit.schema.json +59 -1
  261. package/dist/strategy/metrics.js +1 -1
  262. package/dist/tools/handlers/bridge.js +1 -1
  263. package/dist/tools/handlers/config.js +1 -1
  264. package/dist/tools/handlers/dispatch-expectations.d.ts +3 -0
  265. package/dist/tools/handlers/dispatch-expectations.js +1 -0
  266. package/dist/tools/handlers/evaluation.js +1 -1
  267. package/dist/tools/handlers/onchain.js +1 -1
  268. package/dist/tools/handlers/query.js +1 -1
  269. package/dist/tools/index.js +1 -1
  270. package/dist/tools/registry/evaluation.d.ts +2 -0
  271. package/dist/tools/registry/evaluation.js +1 -0
  272. package/dist/tools/registry/query.js +1 -1
  273. package/dist/tools/shared.d.ts +0 -1
  274. package/dist/tools/shared.js +1 -1
  275. package/dist/tools/wrap.js +1 -1
  276. package/package.json +4 -3
  277. package/dist/customer/customer-advice.d.ts +0 -32
  278. package/dist/customer/customer-advice.js +0 -1
  279. package/dist/customer/info-puzzle.d.ts +0 -146
  280. package/dist/customer/info-puzzle.js +0 -1
  281. package/dist/customer/order-strategy.d.ts +0 -17
  282. package/dist/customer/order-strategy.js +0 -1
  283. package/dist/customer/preorder-compare.d.ts +0 -24
  284. package/dist/customer/preorder-compare.js +0 -1
  285. package/dist/customer/reminder-system.d.ts +0 -42
  286. package/dist/customer/reminder-system.js +0 -1
  287. package/dist/customer/risk-assessment.d.ts +0 -13
  288. package/dist/customer/risk-assessment.js +0 -1
  289. package/dist/evaluation/builtins/service-risk.d.ts +0 -7
  290. package/dist/evaluation/builtins/service-risk.js +0 -1
  291. package/dist/knowledge/trust-metrics.d.ts +0 -66
  292. package/dist/knowledge/trust-metrics.js +0 -1
  293. package/dist/schema/trust/index.d.ts +0 -334
  294. package/dist/schema/trust/index.js +0 -1
  295. package/dist/schemas/trust_score.output.json +0 -847
  296. package/dist/schemas/trust_score.schema.json +0 -364
  297. package/dist/tools/handlers/trust.d.ts +0 -16
  298. package/dist/tools/handlers/trust.js +0 -1
  299. package/dist/tools/registry/trust.d.ts +0 -2
  300. package/dist/tools/registry/trust.js +0 -1
@@ -1 +1 @@
1
- import{EDGE_SCHEMA_BY_ID}from'../graph/onchain/index.js';export const SCENARIO_BRIDGE_REGISTRY=[{'id':'bridge.supply_match','code':'b03','edge_refs':['demand.guard','demand.presenter'],'name':'Supply-Demand\x20Match','participants':[{'object':'Demand','role':'need\x20expression\x20(what\x20is\x20wanted)'},{'object':'Service','role':'capability\x20offering\x20(what\x20can\x20be\x20delivered)'},{'object':'Guard','role':'presentation\x20qualification\x20(who\x20may\x20present\x20what)'}],'bridge_fields':[{'object':'Demand','field':'guards:\x20vector<ServiceGuard>\x20{\x20guard,\x20service_identifier\x20}','meaning':'presenters\x20must\x20pass\x20the\x20guard;\x20service_identifier\x20resolves\x20WHICH\x20service\x20they\x20present\x20for'},{'object':'Demand','field':'present_service_with_passport(service:&Service<T>)','meaning':'a\x20Service\x20object\x20is\x20supplied\x20AT\x20the\x20presentation\x20—\x20the\x20demand\x20does\x20not\x20store\x20services;\x20suppliers\x20bring\x20them'}],'move_anchor':'demand.move\x20L124-150\x20(present_with_passport_imp:\x20result_for_guard\x20+\x20submission_get(service_identifier))','scenario':{'from':'Demand\x20scenario\x20(need\x20expression)','to':'Service\x20scenario\x20(product\x20listing)','merged':'Matchmaking\x20(discovery\x20+\x20qualification\x20+\x20choice)'},'capability_gained':'Choice\x20among\x20qualified\x20offers:\x20the\x20demander\x20compares\x20presented\x20Services\x20(acceptance_score\x20accumulates\x20per\x20presenter)\x20'+'—\x20a\x20capability\x20neither\x20a\x20bare\x20Demand\x20(no\x20offers)\x20nor\x20a\x20bare\x20Service\x20(no\x20buyer\x20context)\x20possesses.','value_flow':'No\x20funds\x20move\x20yet\x20—\x20this\x20bridge\x20prices\x20ATTENTION:\x20acceptance_score\x20on\x20the\x20presenter\x27s\x20entity\x20is\x20the\x20reputation\x20currency.','prerequisites':['Demand\x20not\x20yet\x20paused\x20(demand.move)','Presenter\x20passes\x20the\x20Demand\x27s\x20guard\x20(E_NEED_PASSPORT\x20when\x20guards\x20exist\x20and\x20no\x20passport\x20is\x20given)'],'examples':['Procurement\x20tender:\x20a\x20company\x20posts\x20a\x20Demand;\x20certified\x20suppliers\x20present\x20their\x20Services;\x20the\x20best\x20acceptance_score\x20wins\x20the\x20order.','Local\x20services\x20marketplace:\x20\x27repair\x20my\x20roof\x27\x20demand\x20meets\x20licensed\x20roofer\x20services.']},{'id':'bridge.purchase','code':'b01','edge_refs':['service.buy_guard','order.service','order.machine','order.discount','order.builder','eoa.order','service.order'],'name':'Purchase\x20(Quote\x20→\x20Order)','participants':[{'object':'Service','role':'published\x20offering\x20(sales,\x20wip,\x20price)'},{'object':'Quote','role':'buyer\x27s\x20item\x20selection\x20+\x20computed\x20total'},{'object':'Discount','role':'transferable\x20price\x20reduction\x20bound\x20to\x20the\x20service'},{'object':'Guard','role':'buy\x20qualification\x20(buy_guard)'},{'object':'Order','role':'the\x20created\x20agreement'}],'bridge_fields':[{'object':'Service','field':'buy_guard:\x20Option<address>','meaning':'who\x20may\x20buy\x20(qualification);\x20buy()\x20refuses\x20when\x20a\x20guard\x20exists\x20and\x20no\x20passport\x20proves\x20it'},{'object':'Discount','field':'service:\x20address\x20(+\x20time\x20window,\x20benchmark,\x20transferable)','meaning':'the\x20discount\x20object\x20itself\x20carries\x20WHICH\x20service\x20it\x20applies\x20to\x20—\x20it\x20travels\x20wallet-to-wallet\x20but\x20stays\x20bound\x20to\x20the\x20service'},{'object':'Order','field':'machine:\x20Option<address>\x20(copied\x20from\x20Service\x20at\x20order::new)','meaning':'the\x20fulfillment\x20workflow\x20is\x20PRE-BINDED\x20at\x20purchase\x20time\x20—\x20the\x20order\x20reserves\x20its\x20own\x20execution\x20path'}],'move_anchor':'service.move\x20L278-321\x20(buy\x20/\x20buy_with_passport\x20/\x20buy_imp\x20→\x20order::new),\x20order.move\x20L103-114','scenario':{'from':'Service\x20scenario\x20(offering)','to':'Order\x20scenario\x20(agreement\x20+\x20escrow\x20intent)','merged':'Transaction\x20(commitment\x20with\x20reserved\x20fulfillment)'},'capability_gained':'A\x20binding\x20agreement\x20that\x20reserves\x20its\x20own\x20execution\x20path:\x20the\x20Order\x20snapshot\x20copies\x20the\x20Service\x27s\x20machine\x20reference\x20'+'at\x20creation,\x20so\x20later\x20Service\x20edits\x20cannot\x20retroactively\x20change\x20how\x20THIS\x20order\x20is\x20fulfilled.','value_flow':'Amount\x20is\x20recorded\x20(order.amount)\x20but\x20coins\x20are\x20not\x20yet\x20moved\x20—\x20payment\x20happens\x20at\x20the\x20allocation\x20bridge.','prerequisites':['Service\x20published\x20(bPublished)\x20and\x20not\x20paused\x20(E_NOT_PUBLISHED\x20/\x20E_PAUSED)','Quote\x20signed\x20by\x20the\x20tx\x20digest\x20(E_INVALID_QUOTE)\x20—\x20prevents\x20quote\x20replay\x20across\x20transactions','buy_guard\x20passed\x20when\x20present\x20(E_BUY_GUARD_PASSPORT_REQUIRED)'],'examples':['Standard\x20e-commerce\x20checkout:\x20quote\x20items,\x20apply\x20a\x20transferred\x20Discount,\x20create\x20the\x20Order.','Gated\x20purchase:\x20only\x20KYC-passed\x20wallets\x20(buy_guard)\x20can\x20order\x20a\x20licensed\x20service.']},{'id':'bridge.escrow_split','code':'b05','edge_refs':['service.order_allocator_guard','order.allocation','allocation.guard','wf.forward_guard','payment.recipient','payment.from_object','payment.for_object','payment.for_guard'],'name':'Escrow\x20&\x20Split\x20(Order\x20→\x20Allocation\x20→\x20Payment)','participants':[{'object':'Service','role':'payout\x20rules\x20owner\x20(order_allocators)'},{'object':'Order','role':'escrowed\x20amount\x20+\x20single\x20allocation\x20slot'},{'object':'Allocation','role':'guard-gated\x20distributor'},{'object':'Payment','role':'the\x20actual\x20value\x20transfer\x20with\x20provenance'}],'bridge_fields':[{'object':'Service','field':'order_allocators:\x20Option<Allocators>','meaning':'who\x20may\x20run\x20the\x20split\x20and\x20under\x20which\x20guards\x20—\x20the\x20merchant\x27s\x20payout\x20policy,\x20pre-registered\x20on\x20the\x20Service'},{'object':'Order','field':'allocation:\x20Option<address>\x20(on_allocation,\x20single-shot)','meaning':'the\x20order\x20can\x20be\x20split\x20exactly\x20once\x20—\x20the\x20escrow-to-payout\x20transition\x20is\x20one-way\x20and\x20auditable'},{'object':'Payment','field':'info.for_object\x20/\x20from_object','meaning':'every\x20payout\x20carries\x20the\x20source\x20object\x20address\x20—\x20money\x20always\x20answers\x20\x27which\x20business\x20object\x20paid\x20me\x27'}],'move_anchor':'service.move\x20L291-303\x20(order_allocation:\x20E_ORDER_SERVICE_NOT_MATCH\x20→\x20allocation::new_with_coin\x20→\x20payment_info(order)),\x20allocation.move\x20L202+\x20(alloc)','scenario':{'from':'Order\x20scenario\x20(agreement\x20+\x20funds)','to':'Payment\x20scenario\x20(value\x20transfer)','merged':'Settlement\x20(escrowed\x20funds\x20split\x20by\x20declared\x20policy)'},'capability_gained':'Trustless\x20settlement:\x20the\x20buyer\x20pays\x20into\x20the\x20order\x20amount,\x20and\x20the\x20split\x20executes\x20only\x20under\x20the\x20merchant\x27s\x20'+'pre-registered\x20allocator\x20guards\x20—\x20neither\x20side\x20can\x20redirect\x20the\x20other\x27s\x20share;\x20the\x20Payment\x27s\x20from_object\x20makes\x20'+'every\x20revenue\x20line\x20item\x20auditable\x20back\x20to\x20its\x20order.','value_flow':'Buyer\x20coin\x20→\x20Allocation\x20balance\x20→\x20(guard-gated\x20alloc)\x20→\x20Payment\x20recipients\x20(Entity\x20/\x20Signer\x20/\x20GuardIdentifier).','prerequisites':['Coin\x20≥\x20order.amount\x20(E_COIN_NOT_ENOUGH),\x20excess\x20refunded\x20to\x20the\x20sender\x20in\x20the\x20same\x20tx','The\x20calling\x20Service\x20IS\x20the\x20order\x27s\x20service\x20(E_ORDER_SERVICE_NOT_MATCH)','Rate\x20shares\x20must\x20complete\x2010000\x20basis\x20points\x20unless\x20a\x20Surplus\x20entry\x20exists\x20(allocation.move\x20L173-177)'],'examples':['Multi-vendor\x20order:\x20one\x20payment\x20split\x20across\x20goods\x20supplier,\x20logistics\x20operator,\x20and\x20platform\x20surplus.','Payroll-style\x20settlement:\x20order\x20revenue\x20split\x20to\x20staff\x20entities\x20by\x20Rate\x20with\x20the\x20owner\x20taking\x20Surplus.']},{'id':'bridge.fulfillment','code':'b04','edge_refs':['service.machine','order.machine','order.progress','progress.machine','progress.task','progress.named_operator','machine.node','wf.transition','wf.forward_guard','permission.entity'],'name':'Fulfillment\x20(Order\x20×\x20Machine\x20→\x20Progress)','participants':[{'object':'Service','role':'workflow\x20owner\x20(machine\x20field)'},{'object':'Order','role':'the\x20work\x20item\x20to\x20execute'},{'object':'Machine','role':'workflow\x20template\x20(nodes\x20+\x20forwards)'},{'object':'Progress','role':'per-order\x20workflow\x20instance'},{'object':'Permission','role':'who\x20may\x20advance\x20which\x20edge'}],'bridge_fields':[{'object':'Service','field':'machine:\x20Option<address>','meaning':'the\x20workflow\x20template\x20the\x20service\x20promises\x20to\x20execute\x20—\x20locked\x20at\x20publish\x20(bPublished)'},{'object':'Progress','field':'order\x20namespace\x20+\x20order_owner_set([buyer])','meaning':'the\x20buyer\x20becomes\x20the\x20Progress\x27s\x20order-owner\x20namespace:\x20operators\x20advance\x20THEIR\x20copy,\x20the\x20buyer\x27s\x20own\x20Progress\x20view\x20aggregates'},{'object':'Machine','field':'Forward\x20{\x20namedOperator\x20|\x20permissionIndex\x20|\x20guard\x20}','meaning':'each\x20edge\x20declares\x20its\x20operator\x20—\x20internal\x20staff,\x20permission\x20entity,\x20or\x20guard-proven\x20external\x20party'}],'move_anchor':'service.move\x20L305-313\x20(order_progress:\x20E_MACHINE_NOT_MATCH\x20→\x20progress::new_imp\x20→\x20order::on_progress),\x20progress.move\x20L462+','scenario':{'from':'Order\x20scenario\x20(agreement)','to':'Machine\x20scenario\x20(process\x20template)','merged':'Execution\x20(per-order\x20workflow\x20with\x20multi-party\x20advancement)'},'capability_gained':'Coordinated\x20execution:\x20the\x20SAME\x20template\x20runs\x20independently\x20per\x20order,\x20with\x20each\x20edge\x20potentially\x20operated\x20by\x20a\x20'+'different\x20party\x20(employee\x20/\x20supplier\x20/\x20buyer)\x20under\x20permission\x20or\x20guard\x20checks\x20—\x20process\x20outsourcing\x20with\x20on-chain\x20accountability.','prerequisites':['The\x20supplied\x20machine\x20IS\x20the\x20service\x27s\x20machine\x20(E_MACHINE_NOT_MATCH)','Each\x20forward\x27s\x20weight\x20counts\x20at\x20most\x20once\x20per\x20session\x20(E_NOT_THE_HOLDER\x20on\x20re-execution)','Edge\x20guard\x20(when\x20present)\x20requires\x20submitted\x20evidence\x20—\x20retained\x20submissions\x20persist\x20into\x20the\x20session\x20history'],'examples':['Custom\x20manufacturing:\x20paid\x20→\x20machining\x20→\x20QC\x20→\x20shipped,\x20where\x20QC\x20is\x20advanced\x20by\x20an\x20independent\x20inspector\x20(namedOperator).','Multi-supplier\x20sub-orders:\x20the\x20machine\x27s\x20nodes\x20hand\x20off\x20between\x20the\x20merchant\x20and\x20subcontracted\x20suppliers.']},{'id':'bridge.dispute','code':'b06','edge_refs':['service.permission','service.arbitration','arbitration.permission','arbitration.voting_guard','arbitration.usage_guard','order.dispute','order.claimed_by','arb.order','arb.arbitration_service','arb.voter'],'name':'Dispute\x20&\x20Compensation\x20(Service\x20×\x20Arbitration\x20×\x20Order\x20→\x20Arb)','participants':[{'object':'Service','role':'pre-registered\x20arbitrations\x20+\x20compensation\x20fund'},{'object':'Arbitration','role':'voting\x20rules\x20+\x20usage\x20gate'},{'object':'Order','role':'the\x20disputed\x20agreement\x20(single\x20claim)'},{'object':'Arb','role':'the\x20case\x20(7-state\x20lifecycle)'}],'bridge_fields':[{'object':'Service','field':'arbitrations:\x20vector<address>\x20+\x20compensation_fund:\x20Balance<T>','meaning':'the\x20merchant\x20pre-commits\x20BOTH\x20who\x20judges\x20(independent\x20permission)\x20AND\x20the\x20money\x20that\x20backs\x20the\x20verdict'},{'object':'Service','field':'arbitration_add_imp\x20fairness\x20check','meaning':'E_ARBITRATION_PERMISSION_CONFLICT:\x20an\x20Arbitration\x20sharing\x20the\x20Service\x27s\x20own\x20Permission\x20is\x20REJECTED\x20—\x20fairness\x20is\x20enforced\x20as\x20a\x20RELATIONAL\x20constraint,\x20not\x20a\x20promise'},{'object':'Order','field':'dispute:\x20vector<address>\x20+\x20claimed_by:\x20Option<address>','meaning':'disputes\x20append\x20to\x20the\x20order;\x20compensation\x20claims\x20it\x20exactly\x20once\x20(E_ORDER_ALREADY_CLAIMED)\x20—\x20the\x20payout\x20is\x20single-shot\x20by\x20construction'}],'move_anchor':'arbitration.move\x20L264-276\x20(dispute\x20/\x20dispute_with_passport),\x20service.move\x20L336+\x20(compensation_claim),\x20arb.move\x20(7-state\x20lifecycle)','scenario':{'from':'Fulfillment\x20scenario\x20(execution\x20with\x20possible\x20disagreement)','to':'Arbitration\x20scenario\x20(independent\x20judgment)','merged':'Remedy\x20(wrong\x20execution\x20→\x20compensated\x20loss)'},'capability_gained':'Credible\x20remedy:\x20the\x20loser\x20of\x20a\x20bad\x20transaction\x20is\x20made\x20whole\x20from\x20a\x20fund\x20the\x20merchant\x20could\x20not\x20pre-empty,\x20'+'judged\x20by\x20parties\x20the\x20merchant\x20cannot\x20appoint\x20unilaterally\x20—\x20trustlessness\x20expressed\x20as\x20a\x20field-level\x20topology\x20constraint.','value_flow':'compensation_fund\x20(Service)\x20→\x20indemnity\x20(Arb)\x20→\x20compensation\x20claim\x20to\x20the\x20winning\x20party\x20(single\x20claim\x20per\x20order).','prerequisites':['Disputant\x20passes\x20the\x20Arbitration\x27s\x20usage_guard\x20when\x20set\x20(E_NEED_PASSPORT)','Voters\x20pass\x20voting\x20guards;\x20vote\x20weight\x20from\x20FixedValue\x20or\x20GuardIdentifier\x20submission','Voting\x20deadline\x20elapsed\x20before\x20finish;\x20objection\x20windows\x20respected\x20(arb.move\x20state\x20machine)'],'examples':['Delivery\x20dispute:\x20buyer\x20proves\x20non-delivery\x20via\x20WTS\x20evidence;\x20independent\x20arbitrators\x20vote;\x20compensation\x20pays\x20from\x20the\x20fund.','SLA\x20breach:\x20machine\x20timestamps\x20prove\x20late\x20delivery;\x20weighted\x20voters\x20set\x20the\x20indemnity.']},{'id':'bridge.data_service','code':'b02','edge_refs':['service.repository','repository.permission','repository.policy_guard'],'name':'Data\x20Service\x20(Service\x20×\x20Repository)','participants':[{'object':'Service','role':'the\x20offering\x20that\x20includes\x20data\x20deliverables'},{'object':'Repository','role':'on-chain\x20database\x20(policies,\x20rows)'},{'object':'Guard','role':'write/quote\x20qualification\x20per\x20policy'}],'bridge_fields':[{'object':'Service','field':'repositories:\x20vector<address>\x20(max\x20100)','meaning':'databases\x20the\x20service\x20commits\x20to\x20maintain\x20—\x20the\x20deliverable\x20IS\x20the\x20data'},{'object':'Repository','field':'PolicyGuard\x20{\x20id_from_submission,\x20data_from_submission\x20}','meaning':'writes\x20are\x20guard-qualified:\x20WHO\x20(row\x20key)\x20may\x20write\x20WHAT\x20(the\x20submitted\x20data\x20itself)'}],'move_anchor':'service.move\x20L182\x20(repositories\x20field),\x20repository.move\x20L83-103\x20(policy_guard)\x20/\x20L346+\x20(guarded\x20writes)','scenario':{'from':'Service\x20scenario\x20(offering)','to':'Repository\x20scenario\x20(on-chain\x20database)','merged':'Data\x20products\x20(paid,\x20qualified,\x20auditable\x20data\x20maintenance)'},'capability_gained':'Verifiable\x20data\x20work:\x20a\x20subscription\x20where\x20the\x20provider\x27s\x20every\x20write\x20is\x20qualified\x20by\x20guards\x20and\x20attributable\x20to\x20'+'the\x20paid\x20service\x20—\x20data\x20quality\x20becomes\x20an\x20enforceable\x20contract\x20term,\x20not\x20a\x20promise.','prerequisites':['Writer\x20passes\x20the\x20policy\x27s\x20write\x20guards','Row\x20key\x20resolves\x20via\x20id_from_submission\x20(or\x20PolicyRule.id_from\x20static\x20override)'],'examples':['Market-data\x20feed\x20service:\x20subscribers\x20pay;\x20the\x20provider\x20writes\x20rows\x20under\x20a\x20write\x20guard\x20proving\x20oracle\x20provenance.','Review\x20platform:\x20reviewers\x20pass\x20reputation\x20guards;\x20their\x20submissions\x20become\x20the\x20product\x20others\x20pay\x20to\x20read\x20(quote_guard).']},{'id':'bridge.qualification','code':'b10','edge_refs':['service.buy_guard','demand.guard','arbitration.voting_guard','arbitration.usage_guard','wf.forward_guard','repository.policy_guard','treasury.external_guard','guard.relies','passport.guard'],'name':'Qualification\x20(Guard\x20×\x20every\x20gated\x20scenario)','participants':[{'object':'Guard','role':'the\x20proof\x20machine'},{'object':'Passport','role':'per-tx\x20proof\x20carrier'},{'object':'gated\x20objects','role':'Service(buy)\x20/\x20Demand(present)\x20/\x20Arbitration(vote,\x20dispute)\x20/\x20Machine(forward)\x20/\x20Repository(write)\x20/\x20Treasury(external\x20flows)'}],'bridge_fields':[{'object':'gated\x20object','field':'*_guard\x20/\x20guards\x20fields\x20(buy_guard,\x20usage_guard,\x20voting_guard,\x20forward\x20guard,\x20policy\x20write\x20guards,\x20external\x20guards)','meaning':'the\x20object\x20declares\x20WHICH\x20guard\x20governs\x20its\x20gate\x20—\x20preset\x20slots\x20(guard-bindings.ts)\x20define\x20what\x20the\x20guard\x27s\x20submissions\x20MEAN\x20for\x20that\x20object'}],'move_anchor':'passport.move\x20(result_for_guard\x20/\x20submission_get),\x20guard.rs\x20(native\x20DSL:\x20Signer/Clock/Query\x20×\x20logic\x20tree)','scenario':{'from':'Proof\x20scenario\x20(evidence\x20+\x20verification)','to':'any\x20gated\x20business\x20scenario','merged':'Programmable\x20trust\x20(rules-as-code\x20participation)'},'capability_gained':'Unforgeable\x20participation\x20rules:\x20KYC,\x20stake,\x20membership,\x20time\x20windows,\x20oracle\x20facts\x20—\x20expressed\x20once\x20in\x20a\x20Guard\x20and\x20'+'reused\x20across\x20every\x20gate\x20that\x20binds\x20it;\x20the\x20same\x20guard\x20can\x20gate\x20buying,\x20presenting,\x20voting,\x20and\x20writing\x20consistently.','prerequisites':['Guard\x20DSL\x20type\x20compatibility\x20(e.g.\x20RewardIdentifier\x20needs\x20address-typed\x20submissions)','Passport\x20carries\x20the\x20guard\x27s\x20required\x20submissions\x20in\x20the\x20same\x20tx'],'examples':['One\x20KYC\x20guard\x20reused\x20by\x20five\x20services\x27\x20buy_gates\x20—\x20one\x20proof,\x20five\x20doors.','Stake-weighted\x20voting\x20guard:\x20the\x20same\x20guard\x20governs\x20both\x20arbitration\x20ballots\x20and\x20treasury\x20withdrawals.']},{'id':'bridge.communication','code':'b11','edge_refs':['service.um','machine.um','demand.um','arbitration.um','reward.um','contact.permission','eoa.contact'],'name':'Communication\x20(um:\x20Contact\x20×\x20every\x20business\x20object)','participants':[{'object':'Contact','role':'bound\x20IM\x20channel\x20(ims\x20members)'},{'object':'business\x20objects','role':'Service\x20/\x20Order\x20context\x20/\x20Demand\x20/\x20Arbitration\x20/\x20Treasury\x20/\x20Reward\x20/\x20Repository\x20/\x20Machine'}],'bridge_fields':[{'object':'business\x20object','field':'um:\x20Option<address>','meaning':'each\x20object\x20can\x20bind\x20ONE\x20Contact\x20—\x20its\x20dedicated\x20negotiation/coordination\x20channel;\x20affiliation\x20registered\x20in\x20object_linker'},{'object':'Contact','field':'ims:\x20vector<Im{at,\x20status,\x20description}>','meaning':'channel\x20membership\x20with\x20per-member\x20status\x20—\x20the\x20roster\x20of\x20who\x20talks\x20about\x20THIS\x20object\x27s\x20business'}],'move_anchor':'contact.move\x20(ims\x20/\x20im_add\x20/\x20im_remove),\x20per-object\x20um_set_imp\x20/\x20um_none_imp\x20(e.g.\x20reward.move\x20L237,\x20treasury.move\x20L85)','scenario':{'from':'Business\x20scenario\x20(any\x20object\x20lifecycle)','to':'Encrypted\x20IM\x20scenario\x20(WTS\x20evidence,\x20negotiation)','merged':'Contextual\x20communication\x20(talk\x20WITH\x20evidence\x20about\x20the\x20exact\x20business)'},'capability_gained':'Every\x20business\x20object\x20can\x20grow\x20its\x20own\x20communication\x20channel:\x20pre-order\x20negotiation,\x20in-flight\x20coordination,\x20and\x20'+'dispute\x20evidence\x20collection\x20happen\x20IN\x20the\x20context\x20of\x20the\x20exact\x20object\x20they\x20concern\x20—\x20messages\x20become\x20evidence\x20'+'(WTS)\x20tied\x20to\x20the\x20on-chain\x20thing.','prerequisites':['um\x20binding\x20is\x20single\x20(one\x20Contact\x20per\x20object;\x20um_set\x20replaces\x20with\x20affiliation_change)','IM\x20membership\x20managed\x20by\x20the\x20Contact\x20owner'],'examples':['Order-level\x20channel:\x20buyer,\x20merchant,\x20and\x20the\x20assigned\x20operator\x20coordinate\x20delivery\x20in\x20the\x20order\x27s\x20um.','Arbitration\x20evidence\x20room:\x20disputants\x20and\x20arbitrators\x20exchange\x20WTS-signed\x20evidence\x20in\x20the\x20arbitration\x27s\x20um.']},{'id':'bridge.governance','code':'b09','edge_refs':['service.permission','arbitration.permission','demand.permission','machine.permission','reward.permission','repository.permission','contact.permission','treasury.permission','permission.admin','permission.entity','eoa.permission','permission.core_binding','permission.tx_binding'],'name':'Governance\x20(permission\x20×\x20every\x20object)','participants':[{'object':'Permission','role':'owner/admins/entities\x20+\x20per-index\x20operation\x20rights'},{'object':'business\x20objects','role':'every\x20w::\x20object\x20(permission\x20field)'},{'object':'EntityPermission','role':'reverse\x20index:\x20entity\x20→\x20memberships'}],'bridge_fields':[{'object':'business\x20object','field':'permission:\x20address','meaning':'ALL\x20admin\x20operations\x20on\x20the\x20object\x20route\x20through\x20this\x20one\x20table\x20—\x20a\x20single\x20governance\x20backbone\x20across\x20the\x20whole\x20topology'},{'object':'Permission','field':'tables:\x20entity\x20→\x20perm\x20indices\x20(0..USER_DEFINED)','meaning':'fine-grained\x20operation\x20rights\x20per\x20entity;\x20object\x20functions\x20assert\x20their\x20own\x20index\x20(e.g.\x20reward\x20new=150)'}],'move_anchor':'permission.move\x20L465\x20(assert_permission_with_sender\x20per\x20index),\x20entity_permission.move\x20(0xaa8\x20reverse\x20index)','scenario':{'from':'Operation\x20scenario\x20(any\x20mutating\x20call)','to':'Permission\x20scenario\x20(roles\x20+\x20indices)','merged':'Delegated\x20administration\x20(staff\x20act\x20within\x20bounded\x20rights)'},'capability_gained':'Organizational\x20scale:\x20one\x20merchant\x20operates\x20hundreds\x20of\x20objects\x20through\x20shared\x20Permissions;\x20staff\x20gain\x20scoped\x20rights\x20'+'(per-operation\x20indices)\x20—\x20the\x20topology\x20stays\x20governable\x20as\x20it\x20grows,\x20and\x20EntityPermission\x20makes\x20any\x20address\x27s\x20'+'role\x20discoverable\x20(the\x20account-side\x20entry\x20into\x20the\x20topology).','prerequisites':['Caller\x20passes\x20assert_permission_with_sender\x20at\x20the\x20operation\x27s\x20index','Zero-index\x20entities\x20have\x20membership\x20but\x20no\x20operation\x20rights\x20(fact\x20preserved\x20by\x20design)'],'examples':['Customer\x20service\x20staff\x20hold\x20index\x20225\x20(progress\x20owner_receive)\x20without\x20any\x20treasury\x20rights.','A\x20merchant\x27s\x20entire\x20object\x20fleet\x20re-governed\x20by\x20swapping\x20one\x20Permission\x20(permission_set\x20+\x20affiliation_change).']},{'id':'bridge.incentive','code':'b07','edge_refs':['service.reward','demand.reward','repository.reward','reward.guard'],'name':'Incentive\x20(Reward\x20×\x20Guard\x20×\x20employing\x20object)','participants':[{'object':'Reward','role':'guarded\x20fund\x20pool'},{'object':'Guard','role':'claim\x20qualification\x20+\x20dynamic\x20recipient/amount'},{'object':'Service','role':'rewards:\x20vector<address>\x20—\x20marketing\x20attach\x20point'},{'object':'employee\x20entities','role':'claimants\x20(KPI-qualified)'}],'bridge_fields':[{'object':'Service','field':'rewards:\x20vector<address>\x20(max\x2020)','meaning':'marketing/incentive\x20pools\x20attached\x20to\x20the\x20offering'},{'object':'Reward','field':'RewardGuard\x20{\x20guard,\x20recipient,\x20amount,\x20expiration_time,\x20store_from_id\x20}','meaning':'claim\x20rules\x20—\x20preset\x20slots\x20read\x20payee/amount/deadline\x20from\x20guard\x20submissions\x20(see\x20guard-bindings.ts)'}],'move_anchor':'service.move\x20L193\x20(rewards),\x20reward.move\x20guard_add_imp\x20L242\x20/\x20claim\x20L147+','scenario':{'from':'Employment/operation\x20scenario\x20(work\x20done)','to':'Reward\x20scenario\x20(guarded\x20payout)','merged':'Incentive\x20alignment\x20(KPI\x20→\x20acceptance\x20→\x20reward\x20claim)'},'capability_gained':'Performance-contingent\x20compensation:\x20staff\x20claim\x20rewards\x20by\x20proving\x20work\x20(guard\x20evidence:\x20reaction\x20time,\x20node\x20'+'completion,\x20acceptance\x20records)\x20—\x20the\x20employment\x20tension\x20(fixed\x20pay\x20vs\x20outcome)\x20is\x20bridged\x20by\x20making\x20the\x20payout\x20'+'itself\x20evidence-gated.','value_flow':'Deposited\x20coins\x20→\x20balance\x20→\x20guard-gated\x20claim\x20(the\x20ONLY\x20balance\x20exit\x20—\x20R-R-7-01\x20requires\x20an\x20owner\x20escape\x20guard).','prerequisites':['Claim\x20within\x20expiration\x20window\x20(clock\x20≤\x20expiration_time)','Claim\x20amount\x20≤\x20balance;\x20recipient\x20resolved\x20by\x20the\x20guard\x20submission\x20(Entity\x20/\x20Signer\x20/\x20GuardIdentifier)'],'examples':['Staff\x20KPI\x20reward:\x20guard\x20verifies\x20node\x20reaction-time\x20submissions;\x20employee\x20claims\x20a\x20GuardU64Identifier\x20amount.','Referral\x20marketing:\x20purchasers\x20submit\x20receipt\x20proofs;\x20campaign\x20guard\x20pays\x20cashback\x20to\x20the\x20submitted\x20address.']},{'id':'bridge.evidence','code':'b12','edge_refs':['wf.forward_guard','passport.signer','passport.guard','proof.signer','proof.about'],'name':'Evidence\x20(Proof\x20/\x20retained\x20submissions\x20×\x20Progress\x20&\x20Arb)','participants':[{'object':'Proof','role':'frozen\x20signed\x20fact\x20(WTS,\x20oracle\x20attestation)'},{'object':'Machine\x20Forward','role':'retained_submission\x20requirement'},{'object':'Progress','role':'session\x20history\x20storage'},{'object':'Arb','role':'proposition/vote\x20context'}],'bridge_fields':[{'object':'Machine\x20Forward','field':'retained_submission:\x20vector<u8>','meaning':'the\x20edge\x20cannot\x20be\x20crossed\x20without\x20submitting\x20these\x20slots\x20—\x20and\x20the\x20values\x20persist\x20into\x20the\x20session\x20history'},{'object':'Order','field':'required_info:\x20Option<address>\x20(im\x20or\x20proof)','meaning':'the\x20buyer\x20attaches\x20context\x20(IM\x20thread\x20or\x20proof\x20object)\x20the\x20merchant\x20needs\x20to\x20fulfill'}],'move_anchor':'progress.move\x20L471-474\x20(submissions_get\x20→\x20session\x20history),\x20proof.move\x20(frozen,\x20signer-anchored),\x20order.move\x20L77-80','scenario':{'from':'Execution\x20scenario\x20(workflow\x20edges)','to':'Attestation\x20scenario\x20(signed\x20facts)','merged':'Accountable\x20execution\x20(every\x20step\x20provable\x20after\x20the\x20fact)'},'capability_gained':'An\x20audit-grade\x20trail\x20for\x20INTANGIBLE\x20work:\x20what\x20the\x20operator\x20submitted\x20to\x20cross\x20each\x20edge\x20is\x20on-chain\x20forever\x20—\x20'+'later\x20disputes,\x20KPI\x20assessments,\x20and\x20reputation\x20scores\x20read\x20the\x20same\x20trail,\x20so\x20execution\x20quality\x20becomes\x20evidence.','prerequisites':['retained_submission\x20ids\x20must\x20be\x20submission\x20slots\x20of\x20the\x20forward\x27s\x20guard\x20(E_RETAINED_SUBMISSION_ERROR)','Proof\x20objects\x20are\x20immutable\x20once\x20frozen\x20(create\x20→\x20freeze_object)'],'examples':['QC\x20step\x20requires\x20a\x20signed\x20inspection\x20proof;\x20the\x20proof\x20lands\x20in\x20the\x20session\x20history\x20with\x20the\x20advancing\x20tx.','Buyer\x20attaches\x20a\x20WTS\x20message\x20thread\x20as\x20order\x20required_info;\x20the\x20merchant\x20fulfills\x20against\x20it.']},{'id':'bridge.fund_object','code':'b08','edge_refs':['payment.recipient','payment.from_object','payment.for_object'],'name':'Fund-as-Object\x20(CoinWrapper\x20×\x20owner_receive\x20×\x20any\x20object)','participants':[{'object':'Payment\x20/\x20CoinWrapper<K>','role':'value\x20wrapped\x20as\x20a\x20transferable\x20object\x20(any\x20token\x20K)'},{'object':'receiving\x20objects','role':'Reward\x20/\x20Treasury\x20/\x20Service\x20/\x20Arbitration\x20/\x20Repository\x20/\x20Contact\x20...'},{'object':'Permission\x20owner','role':'the\x20extraction\x20target'}],'bridge_fields':[{'object':'receiving\x20object','field':'receive\x20(join\x20into\x20balance)\x20vs\x20owner_receive\x20(extract\x20received\x20objects\x20to\x20Permission\x20owner)','meaning':'two\x20DIFFERENT\x20doors:\x20receive\x20turns\x20an\x20arrived\x20payment\x20into\x20claimable\x20balance;\x20owner_receive\x20forwards\x20arrived\x20objects\x20(any\x20K,\x20incl.\x20NFT-like)\x20to\x20the\x20owner\x20without\x20touching\x20balance'},{'object':'CoinWrapper','field':'payment:\x20address','meaning':'the\x20wrapper\x20remembers\x20WHICH\x20payment\x20object\x20it\x20came\x20from\x20—\x20provenance\x20survives\x20the\x20transfer'}],'move_anchor':'reward.move\x20L298-316\x20(receive\x20vs\x20owner_receive_imp),\x20treasury.move\x20L346-354,\x20payment.move\x20L40-64\x20(unwrap\x20family)','scenario':{'from':'Transfer\x20scenario\x20(objects\x20move\x20between\x20wallets/objects)','to':'Accounting\x20scenario\x20(balance\x20vs\x20custody)','merged':'Universal\x20value\x20custody\x20(any\x20asset\x20class,\x20any\x20token,\x20one\x20idiom)'},'capability_gained':'Objects\x20can\x20safely\x20RECEIVE\x20value\x20they\x20were\x20not\x20typed\x20for:\x20a\x20Reward<WOW>\x20can\x20custody\x20a\x20USDT\x20CoinWrapper\x20or\x20an\x20NFT\x20'+'via\x20owner_receive\x20—\x20cross-asset\x20custody\x20with\x20a\x20single,\x20uniform\x20extraction\x20rule\x20(to\x20the\x20Permission\x20owner).','value_flow':'CoinWrapper<K>\x20→\x20object\x20custody\x20→\x20owner_receive\x20→\x20Permission\x20owner\x20(NEVER\x20into\x20the\x20object\x27s\x20own\x20balance).','prerequisites':['owner_receive\x20requires\x20the\x20object\x27s\x20Permission\x20+\x20Receiving<K>\x20argument\x20(version+digest)','unwrap_with_check\x20asserts\x20the\x20wrapper\x27s\x20payment\x20provenance\x20(EPAYMENT_NOT_MATCH)'],'examples':['A\x20customer\x20sends\x20an\x20NFT\x20coupon\x20to\x20a\x20Service;\x20the\x20merchant\x20extracts\x20it\x20via\x20service.owner_receive.','A\x20mixed-token\x20gift\x20lands\x20on\x20a\x20Reward;\x20owner_receive\x20forwards\x20it\x20without\x20polluting\x20the\x20WOW\x20claimable\x20balance.']}];for(const bridge of SCENARIO_BRIDGE_REGISTRY){for(const ref of bridge['edge_refs']){if(!EDGE_SCHEMA_BY_ID['has'](ref))throw new Error('scenario-topology:\x20bridge\x20'+bridge['id']+'\x20edge_ref\x20\x22'+ref+'\x22\x20is\x20not\x20a\x20registered\x20EdgeSchema\x20id');}}export const SCENARIO_CHAINS=[{'id':'chain.standard_ecommerce','name':'Standard\x20E-commerce','steps':[{'bridge':'bridge.qualification','note':'buy_guard\x20gates\x20who\x20may\x20purchase'},{'bridge':'bridge.purchase','note':'quote\x20+\x20discount\x20→\x20order\x20(machine\x20pre-bound)'},{'bridge':'bridge.communication','note':'um\x20channel\x20for\x20delivery\x20coordination'},{'bridge':'bridge.fulfillment','note':'progress\x20runs\x20the\x20machine;\x20evidence\x20retained\x20per\x20edge'},{'bridge':'bridge.escrow_split','note':'allocation\x20splits\x20escrow\x20to\x20suppliers\x20+\x20surplus'},{'bridge':'bridge.incentive','note':'optional:\x20staff\x20KPI\x20rewards\x20for\x20fast\x20fulfillment'}],'application_capability':'A\x20complete\x20store:\x20gated\x20checkout,\x20coordinated\x20delivery,\x20evidence-backed\x20fulfillment,\x20and\x20trustless\x20split\x20payout.','objects_touched':['Guard','Service','Discount','Order','Contact','Machine','Progress','Allocation','Payment','Reward','Permission','Passport']},{'id':'chain.procurement_tender','name':'Procurement\x20Tender','steps':[{'bridge':'bridge.supply_match','note':'demand\x20published;\x20qualified\x20services\x20present'},{'bridge':'bridge.qualification','note':'presentation\x20guards\x20filter\x20suppliers'},{'bridge':'bridge.purchase','note':'winning\x20offer\x20becomes\x20the\x20order'},{'bridge':'bridge.fulfillment','note':'multi-supplier\x20machine\x20handoffs'},{'bridge':'bridge.escrow_split','note':'allocation\x20pays\x20suppliers\x20+\x20surplus\x20to\x20demander?'},{'bridge':'bridge.dispute','note':'if\x20delivery\x20fails:\x20independent\x20arbitration\x20+\x20compensation'}],'application_capability':'A\x20full\x20tender\x20lifecycle:\x20need\x20→\x20competing\x20offers\x20→\x20award\x20→\x20delivery\x20→\x20settlement\x20with\x20credible\x20remedy.','objects_touched':['Demand','Guard','Service','Order','Machine','Progress','Allocation','Arbitration','Arb','Payment','Permission']},{'id':'chain.data_subscription','name':'Data\x20Subscription\x20Service','steps':[{'bridge':'bridge.data_service','note':'service\x20commits\x20to\x20repository\x20maintenance'},{'bridge':'bridge.qualification','note':'subscription\x20gate\x20(buy_guard)'},{'bridge':'bridge.purchase','note':'recurring\x20orders\x20or\x20one-off'},{'bridge':'bridge.escrow_split','note':'subscription\x20revenue\x20to\x20data\x20suppliers'},{'bridge':'bridge.communication','note':'um\x20for\x20data\x20requests\x20/\x20clarifications'},{'bridge':'bridge.dispute','note':'stale-data\x20compensation\x20via\x20arbitration'}],'application_capability':'Data\x20as\x20a\x20product:\x20paid,\x20guard-qualified\x20writes,\x20auditable\x20quality,\x20and\x20compensation\x20for\x20staleness.','objects_touched':['Repository','Guard','Service','Order','Allocation','Payment','Contact','Arbitration','Arb']},{'id':'chain.collaborative_operations','name':'Collaborative\x20Operations\x20(staff\x20+\x20outsourced\x20process)','steps':[{'bridge':'bridge.governance','note':'permission\x20entities\x20=\x20staff\x20with\x20scoped\x20indices'},{'bridge':'bridge.fulfillment','note':'machine\x20edges\x20operated\x20by\x20named\x20operators\x20/\x20permission\x20entities'},{'bridge':'bridge.evidence','note':'each\x20advance\x20retains\x20submissions'},{'bridge':'bridge.incentive','note':'KPI\x20guards\x20→\x20reward\x20claims'},{'bridge':'bridge.communication','note':'per-object\x20um\x20channels'}],'application_capability':'An\x20operating\x20company\x20on-chain:\x20internal\x20staff,\x20external\x20operators,\x20audited\x20execution,\x20aligned\x20pay.','objects_touched':['Permission','Machine','Progress','Guard','Reward','Contact','Proof']}];export const SCENARIO_TOPOLOGY_VERSION='1.1.0';export function getBridgeById(a){return SCENARIO_BRIDGE_REGISTRY['find'](c=>c['id']===a);}export function getBridgeByCode(a){return SCENARIO_BRIDGE_REGISTRY['find'](c=>c['code']===a);}export function getBridgesByObject(a){return SCENARIO_BRIDGE_REGISTRY['filter'](c=>c['participants']['some'](d=>d['object']===a)||c['bridge_fields']['some'](d=>d['object']===a));}export function getBridgesForEdge(a){return SCENARIO_BRIDGE_REGISTRY['filter'](c=>c['edge_refs']['includes'](a));}export function detectBridgesForEdges(a){const b=new Set(a);return SCENARIO_BRIDGE_REGISTRY['filter'](c=>c['edge_refs']['some'](d=>b['has'](d)));}export function getChainById(a){return SCENARIO_CHAINS['find'](b=>b['id']===a);}export function summarizeBridge(a){const c=a['participants']['map'](d=>d['object'])['join']('\x20×\x20');return'['+a['name']+']\x20'+c+'\x20→\x20'+a['scenario']['merged']+':\x20'+a['capability_gained']['split']('.\x20')[0x0]+'.';}export function detectBridgesForObjects(a){const b=new Set(a['map'](c=>c['toLowerCase']()));return SCENARIO_BRIDGE_REGISTRY['filter'](c=>c['bridge_fields']['some'](d=>b['has'](d['object']['toLowerCase']()))&&c['participants']['filter'](d=>b['has'](d['object']['toLowerCase']()))['length']>=0x2);}
1
+ import{EDGE_SCHEMA_BY_ID}from'../graph/onchain/index.js';export const SCENARIO_BRIDGE_REGISTRY=[{'id':'bridge.supply_match','code':'b03','edge_refs':['demand.guard','demand.presenter','demand.presenter_service'],'name':'Supply-Demand\x20Match','participants':[{'object':'Demand','role':'need\x20expression\x20(what\x20is\x20wanted)'},{'object':'Service','role':'capability\x20offering\x20(what\x20can\x20be\x20delivered)'},{'object':'Guard','role':'presentation\x20qualification\x20(who\x20may\x20present\x20what)'}],'bridge_fields':[{'object':'Demand','field':'guards:\x20vector<ServiceGuard>\x20{\x20guard,\x20service_identifier\x20}','meaning':'presenters\x20must\x20pass\x20the\x20guard;\x20service_identifier\x20resolves\x20WHICH\x20service\x20they\x20present\x20for'},{'object':'Demand','field':'present_service_with_passport(service:&Service<T>)','meaning':'a\x20Service\x20object\x20is\x20supplied\x20AT\x20the\x20presentation\x20—\x20the\x20demand\x20does\x20not\x20store\x20services;\x20suppliers\x20bring\x20them'}],'move_anchor':'demand.move\x20L124-150\x20(present_with_passport_imp:\x20result_for_guard\x20+\x20submission_get(service_identifier))','scenario':{'from':'Demand\x20scenario\x20(need\x20expression)','to':'Service\x20scenario\x20(product\x20listing)','merged':'Matchmaking\x20(discovery\x20+\x20qualification\x20+\x20choice)'},'capability_gained':'Choice\x20among\x20qualified\x20offers:\x20the\x20demander\x20compares\x20presented\x20Services\x20(acceptance_score\x20accumulates\x20per\x20presenter)\x20'+'—\x20a\x20capability\x20neither\x20a\x20bare\x20Demand\x20(no\x20offers)\x20nor\x20a\x20bare\x20Service\x20(no\x20buyer\x20context)\x20possesses.','value_flow':'No\x20funds\x20move\x20yet\x20—\x20this\x20bridge\x20prices\x20ATTENTION:\x20acceptance_score\x20on\x20the\x20presenter\x27s\x20entity\x20is\x20the\x20reputation\x20currency.','prerequisites':['Demand\x20not\x20yet\x20paused\x20(demand.move)','Presenter\x20passes\x20the\x20Demand\x27s\x20guard\x20(E_NEED_PASSPORT\x20when\x20guards\x20exist\x20and\x20no\x20passport\x20is\x20given)'],'examples':['Procurement\x20tender:\x20a\x20company\x20posts\x20a\x20Demand;\x20certified\x20suppliers\x20present\x20their\x20Services;\x20the\x20best\x20acceptance_score\x20wins\x20the\x20order.','Local\x20services\x20marketplace:\x20\x27repair\x20my\x20roof\x27\x20demand\x20meets\x20licensed\x20roofer\x20services.']},{'id':'bridge.purchase','code':'b01','edge_refs':['service.buy_guard','order.service','order.machine','order.discount','discount.service','order.builder','eoa.order','service.order'],'name':'Purchase\x20(Quote\x20→\x20Order)','participants':[{'object':'Service','role':'published\x20offering\x20(sales,\x20wip,\x20price)'},{'object':'Quote','role':'buyer\x27s\x20item\x20selection\x20+\x20computed\x20total'},{'object':'Discount','role':'transferable\x20price\x20reduction\x20bound\x20to\x20the\x20service'},{'object':'Guard','role':'buy\x20qualification\x20(buy_guard)'},{'object':'Order','role':'the\x20created\x20agreement'}],'bridge_fields':[{'object':'Service','field':'buy_guard:\x20Option<address>','meaning':'who\x20may\x20buy\x20(qualification);\x20buy()\x20refuses\x20when\x20a\x20guard\x20exists\x20and\x20no\x20passport\x20proves\x20it'},{'object':'Discount','field':'service:\x20address\x20(+\x20time\x20window,\x20benchmark,\x20transferable)','meaning':'the\x20discount\x20object\x20itself\x20carries\x20WHICH\x20service\x20it\x20applies\x20to\x20—\x20it\x20travels\x20wallet-to-wallet\x20but\x20stays\x20bound\x20to\x20the\x20service'},{'object':'Order','field':'machine:\x20Option<address>\x20(copied\x20from\x20Service\x20at\x20order::new)','meaning':'the\x20fulfillment\x20workflow\x20is\x20PRE-BINDED\x20at\x20purchase\x20time\x20—\x20the\x20order\x20reserves\x20its\x20own\x20execution\x20path'}],'move_anchor':'service.move\x20L278-321\x20(buy\x20/\x20buy_with_passport\x20/\x20buy_imp\x20→\x20order::new),\x20order.move\x20L103-114','scenario':{'from':'Service\x20scenario\x20(offering)','to':'Order\x20scenario\x20(agreement\x20+\x20escrow\x20intent)','merged':'Transaction\x20(commitment\x20with\x20reserved\x20fulfillment)'},'capability_gained':'A\x20binding\x20agreement\x20that\x20reserves\x20its\x20own\x20execution\x20path:\x20the\x20Order\x20snapshot\x20copies\x20the\x20Service\x27s\x20machine\x20reference\x20'+'at\x20creation,\x20so\x20later\x20Service\x20edits\x20cannot\x20retroactively\x20change\x20how\x20THIS\x20order\x20is\x20fulfilled.','value_flow':'Amount\x20is\x20recorded\x20(order.amount)\x20but\x20coins\x20are\x20not\x20yet\x20moved\x20—\x20payment\x20happens\x20at\x20the\x20allocation\x20bridge.','prerequisites':['Service\x20published\x20(bPublished)\x20and\x20not\x20paused\x20(E_NOT_PUBLISHED\x20/\x20E_PAUSED)','Quote\x20signed\x20by\x20the\x20tx\x20digest\x20(E_INVALID_QUOTE)\x20—\x20prevents\x20quote\x20replay\x20across\x20transactions','buy_guard\x20passed\x20when\x20present\x20(E_BUY_GUARD_PASSPORT_REQUIRED)'],'examples':['Standard\x20e-commerce\x20checkout:\x20quote\x20items,\x20apply\x20a\x20transferred\x20Discount,\x20create\x20the\x20Order.','Gated\x20purchase:\x20only\x20KYC-passed\x20wallets\x20(buy_guard)\x20can\x20order\x20a\x20licensed\x20service.']},{'id':'bridge.escrow_split','code':'b05','edge_refs':['service.order_allocator_guard','order.allocation','allocation.guard','allocation.payment','allocation.for_object','allocation.for_guard','wf.forward_guard','payment.recipient','payment.from_object','payment.for_object','payment.for_guard'],'name':'Escrow\x20&\x20Split\x20(Order\x20→\x20Allocation\x20→\x20Payment)','participants':[{'object':'Service','role':'payout\x20rules\x20owner\x20(order_allocators)'},{'object':'Order','role':'escrowed\x20amount\x20+\x20single\x20allocation\x20slot'},{'object':'Allocation','role':'guard-gated\x20distributor'},{'object':'Payment','role':'the\x20actual\x20value\x20transfer\x20with\x20provenance'}],'bridge_fields':[{'object':'Service','field':'order_allocators:\x20Option<Allocators>','meaning':'who\x20may\x20run\x20the\x20split\x20and\x20under\x20which\x20guards\x20—\x20the\x20merchant\x27s\x20payout\x20policy,\x20pre-registered\x20on\x20the\x20Service'},{'object':'Order','field':'allocation:\x20Option<address>\x20(on_allocation,\x20single-shot)','meaning':'the\x20order\x20can\x20be\x20split\x20exactly\x20once\x20—\x20the\x20escrow-to-payout\x20transition\x20is\x20one-way\x20and\x20auditable'},{'object':'Payment','field':'info.for_object\x20/\x20from_object','meaning':'every\x20payout\x20carries\x20the\x20source\x20object\x20address\x20—\x20money\x20always\x20answers\x20\x27which\x20business\x20object\x20paid\x20me\x27'}],'move_anchor':'service.move\x20L291-303\x20(order_allocation:\x20E_ORDER_SERVICE_NOT_MATCH\x20→\x20allocation::new_with_coin\x20→\x20payment_info(order)),\x20allocation.move\x20L202+\x20(alloc)','scenario':{'from':'Order\x20scenario\x20(agreement\x20+\x20funds)','to':'Payment\x20scenario\x20(value\x20transfer)','merged':'Settlement\x20(escrowed\x20funds\x20split\x20by\x20declared\x20policy)'},'capability_gained':'Trustless\x20settlement:\x20the\x20buyer\x20pays\x20into\x20the\x20order\x20amount,\x20and\x20the\x20split\x20executes\x20only\x20under\x20the\x20merchant\x27s\x20'+'pre-registered\x20allocator\x20guards\x20—\x20neither\x20side\x20can\x20redirect\x20the\x20other\x27s\x20share;\x20the\x20Payment\x27s\x20from_object\x20makes\x20'+'every\x20revenue\x20line\x20item\x20auditable\x20back\x20to\x20its\x20order.','value_flow':'Buyer\x20coin\x20→\x20Allocation\x20balance\x20→\x20(guard-gated\x20alloc)\x20→\x20Payment\x20recipients\x20(Entity\x20/\x20Signer\x20/\x20GuardIdentifier).','prerequisites':['Coin\x20≥\x20order.amount\x20(E_COIN_NOT_ENOUGH),\x20excess\x20refunded\x20to\x20the\x20sender\x20in\x20the\x20same\x20tx','The\x20calling\x20Service\x20IS\x20the\x20order\x27s\x20service\x20(E_ORDER_SERVICE_NOT_MATCH)','Rate\x20shares\x20must\x20complete\x2010000\x20basis\x20points\x20unless\x20a\x20Surplus\x20entry\x20exists\x20(allocation.move\x20L173-177)'],'examples':['Multi-vendor\x20order:\x20one\x20payment\x20split\x20across\x20goods\x20supplier,\x20logistics\x20operator,\x20and\x20platform\x20surplus.','Payroll-style\x20settlement:\x20order\x20revenue\x20split\x20to\x20staff\x20entities\x20by\x20Rate\x20with\x20the\x20owner\x20taking\x20Surplus.']},{'id':'bridge.fulfillment','code':'b04','edge_refs':['service.machine','order.machine','order.progress','progress.machine','progress.task','progress.named_operator','progress.context_repository','machine.node','wf.transition','wf.forward_guard','permission.entity'],'name':'Fulfillment\x20(Order\x20×\x20Machine\x20→\x20Progress)','participants':[{'object':'Service','role':'workflow\x20owner\x20(machine\x20field)'},{'object':'Order','role':'the\x20work\x20item\x20to\x20execute'},{'object':'Machine','role':'workflow\x20template\x20(nodes\x20+\x20forwards)'},{'object':'Progress','role':'per-order\x20workflow\x20instance'},{'object':'Permission','role':'who\x20may\x20advance\x20which\x20edge'}],'bridge_fields':[{'object':'Service','field':'machine:\x20Option<address>','meaning':'the\x20workflow\x20template\x20the\x20service\x20promises\x20to\x20execute\x20—\x20locked\x20at\x20publish\x20(bPublished)'},{'object':'Progress','field':'order\x20namespace\x20+\x20order_owner_set([buyer])','meaning':'the\x20buyer\x20becomes\x20the\x20Progress\x27s\x20order-owner\x20namespace:\x20operators\x20advance\x20THEIR\x20copy,\x20the\x20buyer\x27s\x20own\x20Progress\x20view\x20aggregates'},{'object':'Machine','field':'Forward\x20{\x20namedOperator\x20|\x20permissionIndex\x20|\x20guard\x20}','meaning':'each\x20edge\x20declares\x20its\x20operator\x20—\x20internal\x20staff,\x20permission\x20entity,\x20or\x20guard-proven\x20external\x20party'}],'move_anchor':'service.move\x20L305-313\x20(order_progress:\x20E_MACHINE_NOT_MATCH\x20→\x20progress::new_imp\x20→\x20order::on_progress),\x20progress.move\x20L462+','scenario':{'from':'Order\x20scenario\x20(agreement)','to':'Machine\x20scenario\x20(process\x20template)','merged':'Execution\x20(per-order\x20workflow\x20with\x20multi-party\x20advancement)'},'capability_gained':'Coordinated\x20execution:\x20the\x20SAME\x20template\x20runs\x20independently\x20per\x20order,\x20with\x20each\x20edge\x20potentially\x20operated\x20by\x20a\x20'+'different\x20party\x20(employee\x20/\x20supplier\x20/\x20buyer)\x20under\x20permission\x20or\x20guard\x20checks\x20—\x20process\x20outsourcing\x20with\x20on-chain\x20accountability.','prerequisites':['The\x20supplied\x20machine\x20IS\x20the\x20service\x27s\x20machine\x20(E_MACHINE_NOT_MATCH)','Each\x20forward\x27s\x20weight\x20counts\x20at\x20most\x20once\x20per\x20session\x20(E_NOT_THE_HOLDER\x20on\x20re-execution)','Edge\x20guard\x20(when\x20present)\x20requires\x20submitted\x20evidence\x20—\x20retained\x20submissions\x20persist\x20into\x20the\x20session\x20history'],'examples':['Custom\x20manufacturing:\x20paid\x20→\x20machining\x20→\x20QC\x20→\x20shipped,\x20where\x20QC\x20is\x20advanced\x20by\x20an\x20independent\x20inspector\x20(namedOperator).','Multi-supplier\x20sub-orders:\x20the\x20machine\x27s\x20nodes\x20hand\x20off\x20between\x20the\x20merchant\x20and\x20subcontracted\x20suppliers.']},{'id':'bridge.dispute','code':'b06','edge_refs':['service.permission','service.arbitration','arbitration.permission','arbitration.voting_guard','arbitration.usage_guard','order.dispute','order.claimed_by','arb.order','arb.arbitration_service','arb.voter'],'name':'Dispute\x20&\x20Compensation\x20(Service\x20×\x20Arbitration\x20×\x20Order\x20→\x20Arb)','participants':[{'object':'Service','role':'pre-registered\x20arbitrations\x20+\x20compensation\x20fund'},{'object':'Arbitration','role':'voting\x20rules\x20+\x20usage\x20gate'},{'object':'Order','role':'the\x20disputed\x20agreement\x20(single\x20claim)'},{'object':'Arb','role':'the\x20case\x20(7-state\x20lifecycle)'}],'bridge_fields':[{'object':'Service','field':'arbitrations:\x20vector<address>\x20+\x20compensation_fund:\x20Balance<T>','meaning':'the\x20merchant\x20pre-commits\x20BOTH\x20who\x20judges\x20(independent\x20permission)\x20AND\x20the\x20money\x20that\x20backs\x20the\x20verdict'},{'object':'Service','field':'arbitration_add_imp\x20fairness\x20check','meaning':'E_ARBITRATION_PERMISSION_CONFLICT:\x20an\x20Arbitration\x20sharing\x20the\x20Service\x27s\x20own\x20Permission\x20is\x20REJECTED\x20—\x20fairness\x20is\x20enforced\x20as\x20a\x20RELATIONAL\x20constraint,\x20not\x20a\x20promise'},{'object':'Order','field':'dispute:\x20vector<address>\x20+\x20claimed_by:\x20Option<address>','meaning':'disputes\x20append\x20to\x20the\x20order;\x20compensation\x20claims\x20it\x20exactly\x20once\x20(E_ORDER_ALREADY_CLAIMED)\x20—\x20the\x20payout\x20is\x20single-shot\x20by\x20construction'}],'move_anchor':'arbitration.move\x20L264-276\x20(dispute\x20/\x20dispute_with_passport),\x20service.move\x20L336+\x20(compensation_claim),\x20arb.move\x20(7-state\x20lifecycle)','scenario':{'from':'Fulfillment\x20scenario\x20(execution\x20with\x20possible\x20disagreement)','to':'Arbitration\x20scenario\x20(independent\x20judgment)','merged':'Remedy\x20(wrong\x20execution\x20→\x20compensated\x20loss)'},'capability_gained':'Credible\x20remedy:\x20the\x20loser\x20of\x20a\x20bad\x20transaction\x20is\x20made\x20whole\x20from\x20a\x20fund\x20the\x20merchant\x20could\x20not\x20pre-empty,\x20'+'judged\x20by\x20parties\x20the\x20merchant\x20cannot\x20appoint\x20unilaterally\x20—\x20trustlessness\x20expressed\x20as\x20a\x20field-level\x20topology\x20constraint.','value_flow':'compensation_fund\x20(Service)\x20→\x20indemnity\x20(Arb)\x20→\x20compensation\x20claim\x20to\x20the\x20winning\x20party\x20(single\x20claim\x20per\x20order).','prerequisites':['Disputant\x20passes\x20the\x20Arbitration\x27s\x20usage_guard\x20when\x20set\x20(E_NEED_PASSPORT)','Voters\x20pass\x20voting\x20guards;\x20vote\x20weight\x20from\x20FixedValue\x20or\x20GuardIdentifier\x20submission','Voting\x20deadline\x20elapsed\x20before\x20finish;\x20objection\x20windows\x20respected\x20(arb.move\x20state\x20machine)'],'examples':['Delivery\x20dispute:\x20buyer\x20proves\x20non-delivery\x20via\x20WTS\x20evidence;\x20independent\x20arbitrators\x20vote;\x20compensation\x20pays\x20from\x20the\x20fund.','SLA\x20breach:\x20machine\x20timestamps\x20prove\x20late\x20delivery;\x20weighted\x20voters\x20set\x20the\x20indemnity.']},{'id':'bridge.data_service','code':'b02','edge_refs':['service.repository','repository.permission','repository.policy_guard','repository.quote_guard','repository.data_about','progress.context_repository'],'name':'Data\x20Service\x20(Service\x20×\x20Repository)','participants':[{'object':'Service','role':'the\x20offering\x20that\x20includes\x20data\x20deliverables'},{'object':'Repository','role':'on-chain\x20database\x20(policies,\x20rows)'},{'object':'Guard','role':'write/quote\x20qualification\x20per\x20policy'}],'bridge_fields':[{'object':'Service','field':'repositories:\x20vector<address>\x20(max\x20100)','meaning':'databases\x20the\x20service\x20commits\x20to\x20maintain\x20—\x20the\x20deliverable\x20IS\x20the\x20data'},{'object':'Repository','field':'PolicyGuard\x20{\x20id_from_submission,\x20data_from_submission\x20}','meaning':'writes\x20are\x20guard-qualified:\x20WHO\x20(row\x20key)\x20may\x20write\x20WHAT\x20(the\x20submitted\x20data\x20itself)'}],'move_anchor':'service.move\x20L182\x20(repositories\x20field),\x20repository.move\x20L83-103\x20(policy_guard)\x20/\x20L346+\x20(guarded\x20writes)','scenario':{'from':'Service\x20scenario\x20(offering)','to':'Repository\x20scenario\x20(on-chain\x20database)','merged':'Data\x20products\x20(paid,\x20qualified,\x20auditable\x20data\x20maintenance)'},'capability_gained':'Verifiable\x20data\x20work:\x20a\x20subscription\x20where\x20the\x20provider\x27s\x20every\x20write\x20is\x20qualified\x20by\x20guards\x20and\x20attributable\x20to\x20'+'the\x20paid\x20service\x20—\x20data\x20quality\x20becomes\x20an\x20enforceable\x20contract\x20term,\x20not\x20a\x20promise.','prerequisites':['Writer\x20passes\x20the\x20policy\x27s\x20write\x20guards','Row\x20key\x20resolves\x20via\x20id_from_submission\x20(or\x20PolicyRule.id_from\x20static\x20override)'],'examples':['Market-data\x20feed\x20service:\x20subscribers\x20pay;\x20the\x20provider\x20writes\x20rows\x20under\x20a\x20write\x20guard\x20proving\x20oracle\x20provenance.','Review\x20platform:\x20reviewers\x20pass\x20reputation\x20guards;\x20their\x20submissions\x20become\x20the\x20product\x20others\x20pay\x20to\x20read\x20(quote_guard).']},{'id':'bridge.qualification','code':'b10','edge_refs':['service.buy_guard','demand.guard','arbitration.voting_guard','arbitration.usage_guard','wf.forward_guard','repository.policy_guard','repository.quote_guard','treasury.deposit_guard','treasury.withdraw_guard','guard.relies','passport.guard','passport.ticket_relies'],'name':'Qualification\x20(Guard\x20×\x20every\x20gated\x20scenario)','participants':[{'object':'Guard','role':'the\x20proof\x20machine'},{'object':'Passport','role':'per-tx\x20proof\x20carrier'},{'object':'gated\x20objects','role':'Service(buy)\x20/\x20Demand(present)\x20/\x20Arbitration(vote,\x20dispute)\x20/\x20Machine(forward)\x20/\x20Repository(write)\x20/\x20Treasury(external\x20flows)'}],'bridge_fields':[{'object':'gated\x20object','field':'*_guard\x20/\x20guards\x20fields\x20(buy_guard,\x20usage_guard,\x20voting_guard,\x20forward\x20guard,\x20policy\x20write\x20guards,\x20external\x20guards)','meaning':'the\x20object\x20declares\x20WHICH\x20guard\x20governs\x20its\x20gate\x20—\x20preset\x20slots\x20(guard-bindings.ts)\x20define\x20what\x20the\x20guard\x27s\x20submissions\x20MEAN\x20for\x20that\x20object'}],'move_anchor':'passport.move\x20(result_for_guard\x20/\x20submission_get),\x20guard.rs\x20(native\x20DSL:\x20Signer/Clock/Query\x20×\x20logic\x20tree)','scenario':{'from':'Proof\x20scenario\x20(evidence\x20+\x20verification)','to':'any\x20gated\x20business\x20scenario','merged':'Programmable\x20trust\x20(rules-as-code\x20participation)'},'capability_gained':'Unforgeable\x20participation\x20rules:\x20KYC,\x20stake,\x20membership,\x20time\x20windows,\x20oracle\x20facts\x20—\x20expressed\x20once\x20in\x20a\x20Guard\x20and\x20'+'reused\x20across\x20every\x20gate\x20that\x20binds\x20it;\x20the\x20same\x20guard\x20can\x20gate\x20buying,\x20presenting,\x20voting,\x20and\x20writing\x20consistently.','prerequisites':['Guard\x20DSL\x20type\x20compatibility\x20(e.g.\x20RewardIdentifier\x20needs\x20address-typed\x20submissions)','Passport\x20carries\x20the\x20guard\x27s\x20required\x20submissions\x20in\x20the\x20same\x20tx'],'examples':['One\x20KYC\x20guard\x20reused\x20by\x20five\x20services\x27\x20buy_gates\x20—\x20one\x20proof,\x20five\x20doors.','Stake-weighted\x20voting\x20guard:\x20the\x20same\x20guard\x20governs\x20both\x20arbitration\x20ballots\x20and\x20treasury\x20withdrawals.']},{'id':'bridge.communication','code':'b11','edge_refs':['service.um','machine.um','demand.um','arbitration.um','reward.um','repository.um','permission.um','treasury.um','contact.permission','contact.im','order.required_info','eoa.contact'],'name':'Communication\x20(um:\x20Contact\x20×\x20every\x20business\x20object)','participants':[{'object':'Contact','role':'bound\x20IM\x20channel\x20(ims\x20members)'},{'object':'business\x20objects','role':'Service\x20/\x20Order\x20context\x20/\x20Demand\x20/\x20Arbitration\x20/\x20Treasury\x20/\x20Reward\x20/\x20Repository\x20/\x20Machine'}],'bridge_fields':[{'object':'business\x20object','field':'um:\x20Option<address>','meaning':'each\x20object\x20can\x20bind\x20ONE\x20Contact\x20—\x20its\x20dedicated\x20negotiation/coordination\x20channel;\x20affiliation\x20registered\x20in\x20object_linker'},{'object':'Contact','field':'ims:\x20vector<Im{at,\x20status,\x20description}>','meaning':'channel\x20membership\x20with\x20per-member\x20status\x20—\x20the\x20roster\x20of\x20who\x20talks\x20about\x20THIS\x20object\x27s\x20business'}],'move_anchor':'contact.move\x20(ims\x20/\x20im_add\x20/\x20im_remove),\x20per-object\x20um_set_imp\x20/\x20um_none_imp\x20(e.g.\x20reward.move\x20L237,\x20treasury.move\x20L85)','scenario':{'from':'Business\x20scenario\x20(any\x20object\x20lifecycle)','to':'Encrypted\x20IM\x20scenario\x20(WTS\x20evidence,\x20negotiation)','merged':'Contextual\x20communication\x20(talk\x20WITH\x20evidence\x20about\x20the\x20exact\x20business)'},'capability_gained':'Every\x20business\x20object\x20can\x20grow\x20its\x20own\x20communication\x20channel:\x20pre-order\x20negotiation,\x20in-flight\x20coordination,\x20and\x20'+'dispute\x20evidence\x20collection\x20happen\x20IN\x20the\x20context\x20of\x20the\x20exact\x20object\x20they\x20concern\x20—\x20messages\x20become\x20evidence\x20'+'(WTS)\x20tied\x20to\x20the\x20on-chain\x20thing.','prerequisites':['um\x20binding\x20is\x20single\x20(one\x20Contact\x20per\x20object;\x20um_set\x20replaces\x20with\x20affiliation_change)','IM\x20membership\x20managed\x20by\x20the\x20Contact\x20owner'],'examples':['Order-level\x20channel:\x20buyer,\x20merchant,\x20and\x20the\x20assigned\x20operator\x20coordinate\x20delivery\x20in\x20the\x20order\x27s\x20um.','Arbitration\x20evidence\x20room:\x20disputants\x20and\x20arbitrators\x20exchange\x20WTS-signed\x20evidence\x20in\x20the\x20arbitration\x27s\x20um.']},{'id':'bridge.governance','code':'b09','edge_refs':['service.permission','arbitration.permission','demand.permission','machine.permission','reward.permission','repository.permission','contact.permission','treasury.permission','permission.admin','permission.owner','permission.entity','eoa.permission','permission.core_binding','permission.tx_binding'],'name':'Governance\x20(permission\x20×\x20every\x20object)','participants':[{'object':'Permission','role':'owner/admins/entities\x20+\x20per-index\x20operation\x20rights'},{'object':'business\x20objects','role':'every\x20w::\x20object\x20(permission\x20field)'},{'object':'EntityPermission','role':'reverse\x20index:\x20entity\x20→\x20memberships'}],'bridge_fields':[{'object':'business\x20object','field':'permission:\x20address','meaning':'ALL\x20admin\x20operations\x20on\x20the\x20object\x20route\x20through\x20this\x20one\x20table\x20—\x20a\x20single\x20governance\x20backbone\x20across\x20the\x20whole\x20topology'},{'object':'Permission','field':'tables:\x20entity\x20→\x20perm\x20indices\x20(0..USER_DEFINED)','meaning':'fine-grained\x20operation\x20rights\x20per\x20entity;\x20object\x20functions\x20assert\x20their\x20own\x20index\x20(e.g.\x20reward\x20new=150)'}],'move_anchor':'permission.move\x20L465\x20(assert_permission_with_sender\x20per\x20index),\x20entity_permission.move\x20(0xaa8\x20reverse\x20index)','scenario':{'from':'Operation\x20scenario\x20(any\x20mutating\x20call)','to':'Permission\x20scenario\x20(roles\x20+\x20indices)','merged':'Delegated\x20administration\x20(staff\x20act\x20within\x20bounded\x20rights)'},'capability_gained':'Organizational\x20scale:\x20one\x20merchant\x20operates\x20hundreds\x20of\x20objects\x20through\x20shared\x20Permissions;\x20staff\x20gain\x20scoped\x20rights\x20'+'(per-operation\x20indices)\x20—\x20the\x20topology\x20stays\x20governable\x20as\x20it\x20grows,\x20and\x20EntityPermission\x20makes\x20any\x20address\x27s\x20'+'role\x20discoverable\x20(the\x20account-side\x20entry\x20into\x20the\x20topology).','prerequisites':['Caller\x20passes\x20assert_permission_with_sender\x20at\x20the\x20operation\x27s\x20index','Zero-index\x20entities\x20have\x20membership\x20but\x20no\x20operation\x20rights\x20(fact\x20preserved\x20by\x20design)'],'examples':['Customer\x20service\x20staff\x20hold\x20index\x20225\x20(progress\x20owner_receive)\x20without\x20any\x20treasury\x20rights.','A\x20merchant\x27s\x20entire\x20object\x20fleet\x20re-governed\x20by\x20swapping\x20one\x20Permission\x20(permission_set\x20+\x20affiliation_change).']},{'id':'bridge.incentive','code':'b07','edge_refs':['service.reward','demand.reward','repository.reward','reward.guard','reward.claim'],'name':'Incentive\x20(Reward\x20×\x20Guard\x20×\x20employing\x20object)','participants':[{'object':'Reward','role':'guarded\x20fund\x20pool'},{'object':'Guard','role':'claim\x20qualification\x20+\x20dynamic\x20recipient/amount'},{'object':'Service','role':'rewards:\x20vector<address>\x20—\x20marketing\x20attach\x20point'},{'object':'employee\x20entities','role':'claimants\x20(KPI-qualified)'}],'bridge_fields':[{'object':'Service','field':'rewards:\x20vector<address>\x20(max\x2020)','meaning':'marketing/incentive\x20pools\x20attached\x20to\x20the\x20offering'},{'object':'Reward','field':'RewardGuard\x20{\x20guard,\x20recipient,\x20amount,\x20expiration_time,\x20store_from_id\x20}','meaning':'claim\x20rules\x20—\x20preset\x20slots\x20read\x20payee/amount/deadline\x20from\x20guard\x20submissions\x20(see\x20guard-bindings.ts)'}],'move_anchor':'service.move\x20L193\x20(rewards),\x20reward.move\x20guard_add_imp\x20L242\x20/\x20claim\x20L147+','scenario':{'from':'Employment/operation\x20scenario\x20(work\x20done)','to':'Reward\x20scenario\x20(guarded\x20payout)','merged':'Incentive\x20alignment\x20(KPI\x20→\x20acceptance\x20→\x20reward\x20claim)'},'capability_gained':'Performance-contingent\x20compensation:\x20staff\x20claim\x20rewards\x20by\x20proving\x20work\x20(guard\x20evidence:\x20reaction\x20time,\x20node\x20'+'completion,\x20acceptance\x20records)\x20—\x20the\x20employment\x20tension\x20(fixed\x20pay\x20vs\x20outcome)\x20is\x20bridged\x20by\x20making\x20the\x20payout\x20'+'itself\x20evidence-gated.','value_flow':'Deposited\x20coins\x20→\x20balance\x20→\x20guard-gated\x20claim\x20(the\x20ONLY\x20balance\x20exit\x20—\x20R-R-7-01\x20requires\x20an\x20owner\x20escape\x20guard).','prerequisites':['Claim\x20within\x20expiration\x20window\x20(clock\x20≤\x20expiration_time)','Claim\x20amount\x20≤\x20balance;\x20recipient\x20resolved\x20by\x20the\x20guard\x20submission\x20(Entity\x20/\x20Signer\x20/\x20GuardIdentifier)'],'examples':['Staff\x20KPI\x20reward:\x20guard\x20verifies\x20node\x20reaction-time\x20submissions;\x20employee\x20claims\x20a\x20GuardU64Identifier\x20amount.','Referral\x20marketing:\x20purchasers\x20submit\x20receipt\x20proofs;\x20campaign\x20guard\x20pays\x20cashback\x20to\x20the\x20submitted\x20address.']},{'id':'bridge.evidence','code':'b12','edge_refs':['wf.forward_guard','passport.signer','passport.guard','passport.ticket_relies','passport.impack','order.required_info','proof.signer','proof.about'],'name':'Evidence\x20(Proof\x20/\x20retained\x20submissions\x20×\x20Progress\x20&\x20Arb)','participants':[{'object':'Proof','role':'frozen\x20signed\x20fact\x20(WTS,\x20oracle\x20attestation)'},{'object':'Machine\x20Forward','role':'retained_submission\x20requirement'},{'object':'Progress','role':'session\x20history\x20storage'},{'object':'Arb','role':'proposition/vote\x20context'}],'bridge_fields':[{'object':'Machine\x20Forward','field':'retained_submission:\x20vector<u8>','meaning':'the\x20edge\x20cannot\x20be\x20crossed\x20without\x20submitting\x20these\x20slots\x20—\x20and\x20the\x20values\x20persist\x20into\x20the\x20session\x20history'},{'object':'Order','field':'required_info:\x20Option<address>\x20(im\x20or\x20proof)','meaning':'the\x20buyer\x20attaches\x20context\x20(IM\x20thread\x20or\x20proof\x20object)\x20the\x20merchant\x20needs\x20to\x20fulfill'}],'move_anchor':'progress.move\x20L471-474\x20(submissions_get\x20→\x20session\x20history),\x20proof.move\x20(frozen,\x20signer-anchored),\x20order.move\x20L77-80','scenario':{'from':'Execution\x20scenario\x20(workflow\x20edges)','to':'Attestation\x20scenario\x20(signed\x20facts)','merged':'Accountable\x20execution\x20(every\x20step\x20provable\x20after\x20the\x20fact)'},'capability_gained':'An\x20audit-grade\x20trail\x20for\x20INTANGIBLE\x20work:\x20what\x20the\x20operator\x20submitted\x20to\x20cross\x20each\x20edge\x20is\x20on-chain\x20forever\x20—\x20'+'later\x20disputes,\x20KPI\x20assessments,\x20and\x20reputation\x20scores\x20read\x20the\x20same\x20trail,\x20so\x20execution\x20quality\x20becomes\x20evidence.','prerequisites':['retained_submission\x20ids\x20must\x20be\x20submission\x20slots\x20of\x20the\x20forward\x27s\x20guard\x20(E_RETAINED_SUBMISSION_ERROR)','Proof\x20objects\x20are\x20immutable\x20once\x20frozen\x20(create\x20→\x20freeze_object)'],'examples':['QC\x20step\x20requires\x20a\x20signed\x20inspection\x20proof;\x20the\x20proof\x20lands\x20in\x20the\x20session\x20history\x20with\x20the\x20advancing\x20tx.','Buyer\x20attaches\x20a\x20WTS\x20message\x20thread\x20as\x20order\x20required_info;\x20the\x20merchant\x20fulfills\x20against\x20it.']},{'id':'bridge.fund_object','code':'b08','edge_refs':['payment.recipient','payment.from_object','payment.for_object','allocation.payment','allocation.for_object','allocation.for_guard','payment.signer','treasury.record'],'name':'Fund-as-Object\x20(CoinWrapper\x20×\x20owner_receive\x20×\x20any\x20object)','participants':[{'object':'Payment\x20/\x20CoinWrapper<K>','role':'value\x20wrapped\x20as\x20a\x20transferable\x20object\x20(any\x20token\x20K)'},{'object':'receiving\x20objects','role':'Reward\x20/\x20Treasury\x20/\x20Service\x20/\x20Arbitration\x20/\x20Repository\x20/\x20Contact\x20...'},{'object':'Permission\x20owner','role':'the\x20extraction\x20target'}],'bridge_fields':[{'object':'receiving\x20object','field':'receive\x20(join\x20into\x20balance)\x20vs\x20owner_receive\x20(extract\x20received\x20objects\x20to\x20Permission\x20owner)','meaning':'two\x20DIFFERENT\x20doors:\x20receive\x20turns\x20an\x20arrived\x20payment\x20into\x20claimable\x20balance;\x20owner_receive\x20forwards\x20arrived\x20objects\x20(any\x20K,\x20incl.\x20NFT-like)\x20to\x20the\x20owner\x20without\x20touching\x20balance'},{'object':'CoinWrapper','field':'payment:\x20address','meaning':'the\x20wrapper\x20remembers\x20WHICH\x20payment\x20object\x20it\x20came\x20from\x20—\x20provenance\x20survives\x20the\x20transfer'}],'move_anchor':'reward.move\x20L298-316\x20(receive\x20vs\x20owner_receive_imp),\x20treasury.move\x20L346-354,\x20payment.move\x20L40-64\x20(unwrap\x20family)','scenario':{'from':'Transfer\x20scenario\x20(objects\x20move\x20between\x20wallets/objects)','to':'Accounting\x20scenario\x20(balance\x20vs\x20custody)','merged':'Universal\x20value\x20custody\x20(any\x20asset\x20class,\x20any\x20token,\x20one\x20idiom)'},'capability_gained':'Objects\x20can\x20safely\x20RECEIVE\x20value\x20they\x20were\x20not\x20typed\x20for:\x20a\x20Reward<WOW>\x20can\x20custody\x20a\x20USDT\x20CoinWrapper\x20or\x20an\x20NFT\x20'+'via\x20owner_receive\x20—\x20cross-asset\x20custody\x20with\x20a\x20single,\x20uniform\x20extraction\x20rule\x20(to\x20the\x20Permission\x20owner).','value_flow':'CoinWrapper<K>\x20→\x20object\x20custody\x20→\x20owner_receive\x20→\x20Permission\x20owner\x20(NEVER\x20into\x20the\x20object\x27s\x20own\x20balance).','prerequisites':['owner_receive\x20requires\x20the\x20object\x27s\x20Permission\x20+\x20Receiving<K>\x20argument\x20(version+digest)','unwrap_with_check\x20asserts\x20the\x20wrapper\x27s\x20payment\x20provenance\x20(EPAYMENT_NOT_MATCH)'],'examples':['A\x20customer\x20sends\x20an\x20NFT\x20coupon\x20to\x20a\x20Service;\x20the\x20merchant\x20extracts\x20it\x20via\x20service.owner_receive.','A\x20mixed-token\x20gift\x20lands\x20on\x20a\x20Reward;\x20owner_receive\x20forwards\x20it\x20without\x20polluting\x20the\x20WOW\x20claimable\x20balance.']}];for(const bridge of SCENARIO_BRIDGE_REGISTRY){for(const ref of bridge['edge_refs']){if(!EDGE_SCHEMA_BY_ID['has'](ref))throw new Error('scenario-topology:\x20bridge\x20'+bridge['id']+'\x20edge_ref\x20\x22'+ref+'\x22\x20is\x20not\x20a\x20registered\x20EdgeSchema\x20id');}}export const SCENARIO_CHAINS=[{'id':'chain.standard_ecommerce','name':'Standard\x20E-commerce','steps':[{'bridge':'bridge.qualification','note':'buy_guard\x20gates\x20who\x20may\x20purchase'},{'bridge':'bridge.purchase','note':'quote\x20+\x20discount\x20→\x20order\x20(machine\x20pre-bound)'},{'bridge':'bridge.communication','note':'um\x20channel\x20for\x20delivery\x20coordination'},{'bridge':'bridge.fulfillment','note':'progress\x20runs\x20the\x20machine;\x20evidence\x20retained\x20per\x20edge'},{'bridge':'bridge.escrow_split','note':'allocation\x20splits\x20escrow\x20to\x20suppliers\x20+\x20surplus'},{'bridge':'bridge.incentive','note':'optional:\x20staff\x20KPI\x20rewards\x20for\x20fast\x20fulfillment'}],'application_capability':'A\x20complete\x20store:\x20gated\x20checkout,\x20coordinated\x20delivery,\x20evidence-backed\x20fulfillment,\x20and\x20trustless\x20split\x20payout.','objects_touched':['Guard','Service','Discount','Order','Contact','Machine','Progress','Allocation','Payment','Reward','Permission','Passport']},{'id':'chain.procurement_tender','name':'Procurement\x20Tender','steps':[{'bridge':'bridge.supply_match','note':'demand\x20published;\x20qualified\x20services\x20present'},{'bridge':'bridge.qualification','note':'presentation\x20guards\x20filter\x20suppliers'},{'bridge':'bridge.purchase','note':'winning\x20offer\x20becomes\x20the\x20order'},{'bridge':'bridge.fulfillment','note':'multi-supplier\x20machine\x20handoffs'},{'bridge':'bridge.escrow_split','note':'allocation\x20pays\x20suppliers\x20+\x20surplus\x20to\x20demander?'},{'bridge':'bridge.dispute','note':'if\x20delivery\x20fails:\x20independent\x20arbitration\x20+\x20compensation'}],'application_capability':'A\x20full\x20tender\x20lifecycle:\x20need\x20→\x20competing\x20offers\x20→\x20award\x20→\x20delivery\x20→\x20settlement\x20with\x20credible\x20remedy.','objects_touched':['Demand','Guard','Service','Order','Machine','Progress','Allocation','Arbitration','Arb','Payment','Permission']},{'id':'chain.data_subscription','name':'Data\x20Subscription\x20Service','steps':[{'bridge':'bridge.data_service','note':'service\x20commits\x20to\x20repository\x20maintenance'},{'bridge':'bridge.qualification','note':'subscription\x20gate\x20(buy_guard)'},{'bridge':'bridge.purchase','note':'recurring\x20orders\x20or\x20one-off'},{'bridge':'bridge.escrow_split','note':'subscription\x20revenue\x20to\x20data\x20suppliers'},{'bridge':'bridge.communication','note':'um\x20for\x20data\x20requests\x20/\x20clarifications'},{'bridge':'bridge.dispute','note':'stale-data\x20compensation\x20via\x20arbitration'}],'application_capability':'Data\x20as\x20a\x20product:\x20paid,\x20guard-qualified\x20writes,\x20auditable\x20quality,\x20and\x20compensation\x20for\x20staleness.','objects_touched':['Repository','Guard','Service','Order','Allocation','Payment','Contact','Arbitration','Arb']},{'id':'chain.collaborative_operations','name':'Collaborative\x20Operations\x20(staff\x20+\x20outsourced\x20process)','steps':[{'bridge':'bridge.governance','note':'permission\x20entities\x20=\x20staff\x20with\x20scoped\x20indices'},{'bridge':'bridge.fulfillment','note':'machine\x20edges\x20operated\x20by\x20named\x20operators\x20/\x20permission\x20entities'},{'bridge':'bridge.evidence','note':'each\x20advance\x20retains\x20submissions'},{'bridge':'bridge.incentive','note':'KPI\x20guards\x20→\x20reward\x20claims'},{'bridge':'bridge.communication','note':'per-object\x20um\x20channels'}],'application_capability':'An\x20operating\x20company\x20on-chain:\x20internal\x20staff,\x20external\x20operators,\x20audited\x20execution,\x20aligned\x20pay.','objects_touched':['Permission','Machine','Progress','Guard','Reward','Contact','Proof']}];export const SCENARIO_TOPOLOGY_VERSION='1.1.0';export function getBridgeById(a){return SCENARIO_BRIDGE_REGISTRY['find'](c=>c['id']===a);}export function getBridgeByCode(a){return SCENARIO_BRIDGE_REGISTRY['find'](c=>c['code']===a);}export function getBridgesByObject(a){return SCENARIO_BRIDGE_REGISTRY['filter'](c=>c['participants']['some'](d=>d['object']===a)||c['bridge_fields']['some'](d=>d['object']===a));}export function getBridgesForEdge(a){return SCENARIO_BRIDGE_REGISTRY['filter'](c=>c['edge_refs']['includes'](a));}export function detectBridgesForEdges(a){const b=new Set(a);return SCENARIO_BRIDGE_REGISTRY['filter'](c=>c['edge_refs']['some'](d=>b['has'](d)));}export function getChainById(a){return SCENARIO_CHAINS['find'](b=>b['id']===a);}export function summarizeBridge(a){const c=a['participants']['map'](d=>d['object'])['join']('\x20×\x20');return'['+a['name']+']\x20'+c+'\x20→\x20'+a['scenario']['merged']+':\x20'+a['capability_gained']['split']('.\x20')[0x0]+'.';}export function detectBridgesForObjects(a){const b=new Set(a['map'](c=>c['toLowerCase']()));return SCENARIO_BRIDGE_REGISTRY['filter'](c=>c['bridge_fields']['some'](d=>b['has'](d['object']['toLowerCase']()))&&c['participants']['filter'](d=>b['has'](d['object']['toLowerCase']()))['length']>=0x2);}
@@ -1 +1 @@
1
- import{adaptNodeAnalyzer}from'../graph/onchain/index.js';import{assessServiceStateRisks}from'./service-risk.js';export const SERVICE_RISK_NODE_ANALYZER_ID='SR1';const STAKEHOLDER_ROLE={'owner':'merchant','provider':'merchant','customer':'buyer','arbitrator':'arbitrator','system':'system'},COPY={'R-S-4-05':{'title':()=>'Fulfillment\x20state:\x20Service\x20is\x20paused\x20(bPaused=true);\x20no\x20new\x20orders\x20can\x20be\x20placed\x20while\x20paused','detail':a=>'Shop\x20'+a+'\x20currently\x20has\x20bPaused=true:\x20the\x20merchant\x20paused\x20operations\x20voluntarily;\x20new\x20orders\x20cannot\x20be\x20submitted\x20until\x20it\x20resumes\x20(rule\x20R-S-4-05,\x20evidence\x20bPaused=true).','suggestion':'Ask\x20the\x20merchant\x20via\x20Messenger\x20when\x20operations\x20resume;\x20do\x20not\x20pay\x20for\x20orders\x20while\x20paused.'},'R-S-4-06':{'title':()=>'Fulfillment\x20state:\x20Service\x20is\x20unpublished\x20(draft),\x20invisible\x20to\x20the\x20market\x20and\x20order_new\x20will\x20fail','detail':a=>'Shop\x20'+a+'\x20currently\x20has\x20bPublished=false:\x20the\x20object\x20is\x20still\x20a\x20draft,\x20invisible\x20to\x20the\x20market,\x20and\x20any\x20order\x20attempt\x20fails\x20(rule\x20R-S-4-06,\x20evidence\x20bPublished=false).','suggestion':'Wait\x20for\x20the\x20merchant\x27s\x20official\x20publish\x20(publishing\x20is\x20irreversible\x20and\x20locks\x20the\x20config)\x20before\x20ordering;\x20a\x20draft\x20link\x20is\x20not\x20an\x20on-sale\x20promise.'},'R-S-5-05':{'title':()=>'Missing\x20payout\x20path:\x20compensation_fund\x20has\x20a\x20balance\x20but\x20no\x20Arbitration\x20is\x20bound','detail':(a,b)=>'Shop\x20'+a+'\x20has\x20compensation_fund\x20balance\x20but\x20empty\x20arbitrations:\x20payouts\x20require\x20dispute\x20->\x20ruling\x20->\x20arb_withdraw\x20to\x20claim,\x20'+('and\x20without\x20an\x20arbitration\x20binding\x20this\x20money\x20has\x20no\x20executable\x20claim\x20path\x20(rule\x20R-S-5-05,\x20evidence\x20'+(b['evidence']??'')+').'),'suggestion':'Require\x20the\x20merchant\x20to\x20bind\x20at\x20least\x20one\x20Arbitration\x20in\x20a\x20different\x20group\x20than\x20the\x20shop\x20Permission\x20before\x20ordering;\x20payout\x20promises\x20without\x20a\x20dispute\x20path\x20are\x20unenforceable.'}};export const serviceRiskNodeAnalyzer=adaptNodeAnalyzer({'id':SERVICE_RISK_NODE_ANALYZER_ID,'kind':'risk','objectType':'Service','inspect'(a){const b=a['raw'],c=b?.['data']??b;if(!c)return[];const e={};if(typeof c['bPaused']==='boolean')e['current_bPaused']=c['bPaused'];if(typeof c['bPublished']==='boolean')e['current_bPublished']=c['bPublished'];if(c['compensation_fund']!=null)e['current_compensation_fund_balance']=String(c['compensation_fund']);if(Array['isArray'](c['arbitrations']))e['current_arbitrations_count']=c['arbitrations']['length'];return assessServiceStateRisks(e)['map'](f=>{const g=COPY[f['id']];return{'severity':f['level']==='CRITICAL'||f['level']==='HIGH'?'high':f['level']==='MEDIUM'?'medium':'low','title':g['title'](a['id'],f),'detail':g['detail'](a['id'],f),'suggestion':g['suggestion'],'roles':[...new Set(f['affected_stakeholders']['map'](h=>STAKEHOLDER_ROLE[h]))]};});}});
1
+ import{adaptNodeAnalyzer}from'../graph/onchain/index.js';import{assessServiceRisks,assessServiceStateRisks}from'./service-risk.js';import{puzzlePayloadOf,riskToOutcome,safeRunPack}from'./rule-outcome.js';import{projectServicePuzzle}from'./puzzle-projections.js';export const SERVICE_RISK_NODE_ANALYZER_ID='SR1';const STAKEHOLDER_ROLE={'owner':'merchant','provider':'merchant','customer':'buyer','arbitrator':'arbitrator','system':'system'},COPY={'R-S-4-05':{'title':()=>'Fulfillment\x20state:\x20Service\x20is\x20paused\x20(bPaused=true);\x20no\x20new\x20orders\x20can\x20be\x20placed\x20while\x20paused','detail':a=>'Shop\x20'+a+'\x20currently\x20has\x20bPaused=true:\x20the\x20merchant\x20paused\x20operations\x20voluntarily;\x20new\x20orders\x20cannot\x20be\x20submitted\x20until\x20it\x20resumes\x20(rule\x20R-S-4-05,\x20evidence\x20bPaused=true).','suggestion':'Ask\x20the\x20merchant\x20via\x20Messenger\x20when\x20operations\x20resume;\x20do\x20not\x20pay\x20for\x20orders\x20while\x20paused.'},'R-S-4-06':{'title':()=>'Fulfillment\x20state:\x20Service\x20is\x20unpublished\x20(draft),\x20invisible\x20to\x20the\x20market\x20and\x20order_new\x20will\x20fail','detail':a=>'Shop\x20'+a+'\x20currently\x20has\x20bPublished=false:\x20the\x20object\x20is\x20still\x20a\x20draft,\x20invisible\x20to\x20the\x20market,\x20and\x20any\x20order\x20attempt\x20fails\x20(rule\x20R-S-4-06,\x20evidence\x20bPublished=false).','suggestion':'Wait\x20for\x20the\x20merchant\x27s\x20official\x20publish\x20(publishing\x20is\x20irreversible\x20and\x20locks\x20the\x20config)\x20before\x20ordering;\x20a\x20draft\x20link\x20is\x20not\x20an\x20on-sale\x20promise.'},'R-S-5-05':{'title':()=>'Missing\x20payout\x20path:\x20compensation_fund\x20has\x20a\x20balance\x20but\x20no\x20Arbitration\x20is\x20bound','detail':(a,b)=>'Shop\x20'+a+'\x20has\x20compensation_fund\x20balance\x20but\x20empty\x20arbitrations:\x20payouts\x20require\x20dispute\x20->\x20ruling\x20->\x20arb_withdraw\x20to\x20claim,\x20'+('and\x20without\x20an\x20arbitration\x20binding\x20this\x20money\x20has\x20no\x20executable\x20claim\x20path\x20(rule\x20R-S-5-05,\x20evidence\x20'+(b['evidence']??'')+').'),'suggestion':'Require\x20the\x20merchant\x20to\x20bind\x20at\x20least\x20one\x20Arbitration\x20in\x20a\x20different\x20group\x20than\x20the\x20shop\x20Permission\x20before\x20ordering;\x20payout\x20promises\x20without\x20a\x20dispute\x20path\x20are\x20unenforceable.'}};export const serviceRiskNodeAnalyzer=adaptNodeAnalyzer({'id':SERVICE_RISK_NODE_ANALYZER_ID,'kind':'risk','objectType':'Service','inspect'(a){const b=puzzlePayloadOf(a);if(b){const g=projectServicePuzzle(b);return safeRunPack(h=>assessServiceRisks(h),g)['map'](h=>riskToOutcome(h,'derived'));}const c=a['raw'],e=c?.['data']??c;if(!e)return[];const f={};if(typeof e['bPaused']==='boolean')f['current_bPaused']=e['bPaused'];if(typeof e['bPublished']==='boolean')f['current_bPublished']=e['bPublished'];if(e['compensation_fund']!=null)f['current_compensation_fund_balance']=String(e['compensation_fund']);if(Array['isArray'](e['arbitrations']))f['current_arbitrations_count']=e['arbitrations']['length'];return assessServiceStateRisks(f)['map'](h=>{const i=COPY[h['id']];return{'severity':h['level']==='CRITICAL'||h['level']==='HIGH'?'high':h['level']==='MEDIUM'?'medium':'low','title':i['title'](a['id'],h),'detail':i['detail'](a['id'],h),'suggestion':i['suggestion'],'roles':[...new Set(h['affected_stakeholders']['map'](j=>STAKEHOLDER_ROLE[j]))]};});}});
@@ -93,11 +93,8 @@ export interface ServiceRiskCheckContext {
93
93
  target_objects_types?: string[];
94
94
  }
95
95
  export declare const SERVICE_RISK_VERSION = "1.1.0";
96
- export declare const SERVICE_STATE_RULE_IDS: readonly ["R-S-4-05", "R-S-4-06", "R-S-5-05"];
97
96
  export declare function assessServiceStateRisks(ctx: ServiceRiskCheckContext): ServiceRisk[];
98
97
  export declare function getAllServiceRiskRules(): ServiceRiskRule[];
99
- export declare function getServiceRiskRulesCount(): number;
100
- export declare function getServiceRiskRulesByCategory(category: ServiceRiskCategory): ServiceRiskRule[];
101
98
  export interface ServiceRiskAssessment {
102
99
  summary: string;
103
100
  scene?: ServiceScene;
@@ -1 +1 @@
1
- import{MAX_SALE_COUNT,MAX_REPOSITORY_COUNT,MAX_ARBITRATION_COUNT,MAX_DISCOUNT_TOTAL_COUNT,MAX_WIP_LENGTH,MAX_WIP_HASH_LENGTH}from'@wowok/wowok';const R_S_1_01={'id':'R-S-1-01','category':'structural','trigger':'sales\x20count\x20exceeds\x20MAX_SALE_COUNT\x20(50)','check':a=>{const b=a['current_sales_count']??0x0;if(a['sales']&&(a['sales']['op']==='add'||a['sales']['op']==='set')){const c=a['sales']['op']==='set'?a['sales']['sales']['length']:b+a['sales']['sales']['length'];if(c>MAX_SALE_COUNT)return{'id':'R-S-1-01','level':'HIGH','category':'structural','title':'Sales\x20count\x20exceeds\x20limit','description':'Service\x20would\x20have\x20'+c+'\x20sales\x20items,\x20exceeds\x20MAX_SALE_COUNT\x20'+MAX_SALE_COUNT,'affected_stakeholders':['owner','system'],'scenario':'Adding\x20too\x20many\x20product\x20SKUs','mitigation':'Split\x20into\x20multiple\x20Service\x20objects\x20or\x20remove\x20discontinued\x20items','evidence':'sales_count='+c};}return null;}},R_S_1_02={'id':'R-S-1-02','category':'structural','trigger':'repositories\x20count\x20exceeds\x20MAX_REPOSITORY_COUNT\x20(100)','check':a=>{const b=a['current_repositories_count']??0x0;if(a['repositories']&&(a['repositories']['op']==='add'||a['repositories']['op']==='set')){const c=a['repositories']['op']==='set'?a['repositories']['objects']['length']:b+a['repositories']['objects']['length'];if(c>MAX_REPOSITORY_COUNT)return{'id':'R-S-1-02','level':'MEDIUM','category':'structural','title':'Repositories\x20count\x20exceeds\x20limit','description':'Service\x20would\x20have\x20'+c+'\x20repositories,\x20exceeds\x20MAX_REPOSITORY_COUNT\x20'+MAX_REPOSITORY_COUNT,'affected_stakeholders':['owner'],'scenario':'Binding\x20too\x20many\x20data\x20repositories','mitigation':'Consolidate\x20repositories\x20or\x20remove\x20inactive\x20ones','evidence':'repositories_count='+c};}return null;}},R_S_1_03={'id':'R-S-1-03','category':'structural','trigger':'arbitrations\x20count\x20exceeds\x20MAX_ARBITRATION_COUNT\x20(20)','check':a=>{const b=a['current_arbitrations_count']??0x0;if(a['arbitrations']&&(a['arbitrations']['op']==='add'||a['arbitrations']['op']==='set')){const c=a['arbitrations']['op']==='set'?a['arbitrations']['objects']['length']:b+a['arbitrations']['objects']['length'];if(c>MAX_ARBITRATION_COUNT)return{'id':'R-S-1-03','level':'HIGH','category':'structural','title':'Arbitrations\x20count\x20exceeds\x20limit','description':'Service\x20would\x20have\x20'+c+'\x20arbitrations,\x20exceeds\x20MAX_ARBITRATION_COUNT\x20'+MAX_ARBITRATION_COUNT,'affected_stakeholders':['owner','arbitrator'],'scenario':'Binding\x20too\x20many\x20Arbitration\x20objects','mitigation':'Use\x201-3\x20Arbitration\x20objects\x20covering\x20different\x20dispute\x20scopes','evidence':'arbitrations_count='+c};}return null;}},R_S_1_04={'id':'R-S-1-04','category':'structural','trigger':'WIP\x20hash\x20length\x20exceeds\x20MAX_WIP_HASH_LENGTH\x20(64)\x20or\x20URL\x20exceeds\x20MAX_WIP_LENGTH\x20(1024)','check':a=>{if(a['sales']&&(a['sales']['op']==='add'||a['sales']['op']==='set'))for(const b of a['sales']['sales']){if(b['wip_hash']&&b['wip_hash']['length']>MAX_WIP_HASH_LENGTH)return{'id':'R-S-1-04','level':'HIGH','category':'structural','title':'WIP\x20hash\x20length\x20exceeds\x20limit','description':'Sale\x20\x22'+b['name']+'\x22\x20wip_hash\x20length\x20'+b['wip_hash']['length']+'\x20>\x20MAX_WIP_HASH_LENGTH\x20'+MAX_WIP_HASH_LENGTH,'affected_stakeholders':['owner','customer'],'scenario':'Malformed\x20WIP\x20hash\x20(should\x20be\x20sha256\x20hex,\x2064\x20chars)','mitigation':'Use\x20sha256\x20hex\x20hash\x20(64\x20characters,\x20no\x20prefix)','evidence':'wip_hash_length='+b['wip_hash']['length']};if(b['wip']&&b['wip']['length']>MAX_WIP_LENGTH)return{'id':'R-S-1-04','level':'HIGH','category':'structural','title':'WIP\x20URL\x20length\x20exceeds\x20limit','description':'Sale\x20\x22'+b['name']+'\x22\x20wip\x20URL\x20length\x20'+b['wip']['length']+'\x20>\x20MAX_WIP_LENGTH\x20'+MAX_WIP_LENGTH,'affected_stakeholders':['owner'],'scenario':'WIP\x20URL\x20too\x20long\x20(use\x20IPFS\x20or\x20short\x20HTTPS\x20URL)','mitigation':'Use\x20IPFS\x20CID\x20or\x20shorter\x20URL','evidence':'wip_url_length='+b['wip']['length']};}return null;}},R_S_1_05={'id':'R-S-1-05','category':'structural','trigger':'sale.wip\x20is\x20a\x20local\x20path\x20/\x20localhost\x20/\x20LAN\x20URL\x20(not\x20network-deployable)\x20—\x20every\x20customer\x20order\x20fails','check':a=>{if(a['sales']&&(a['sales']['op']==='add'||a['sales']['op']==='set'))for(const b of a['sales']['sales']){if(b['wip']&&b['wip']!==''){let c=null;const d=b['wip'];if(/^[A-Za-z]:[\\/]/['test'](d)||d['startsWith']('/')||d['startsWith']('./')||d['startsWith']('../'))c='local\x20filesystem\x20path';else{if(/^https?:\/\/(localhost|127\.0\.0\.1|\[::1\]|0\.0\.0\.0)([:/]|$)/i['test'](d))c='localhost/loopback\x20URL';else{if(/^https?:\/\/(10\.\d{1,3}\.\d{1,3}\.\d{1,3}|172\.(1[6-9]|2\d|3[01])\.\d{1,3}\.\d{1,3}|192\.168\.\d{1,3}\.\d{1,3})([:/]|$)/i['test'](d))c='LAN\x20(private\x20IP)\x20URL';else!/^https?:\/\//i['test'](d)&&!d['startsWith']('ipfs://')&&!d['startsWith']('data:')&&(c='unrecognized\x20format\x20(not\x20a\x20network\x20URL)');}}if(c)return{'id':'R-S-1-05','level':'CRITICAL','category':'structural','title':'WIP\x20is\x20not\x20network-deployed\x20—\x20every\x20customer\x20order\x20will\x20fail','description':'Sale\x20\x22'+b['name']+'\x22\x20wip\x20\x22'+b['wip']+'\x22\x20is\x20a\x20'+c+'.\x20It\x20passes\x20set-time\x20verification\x20'+'on\x20the\x20merchant\x27s\x20own\x20machine\x20but\x20is\x20unreachable\x20by\x20customers\x20on\x20other\x20machines\x20—\x20'+'order_new\x20aborts\x20100%\x20when\x20a\x20customer\x20tries\x20to\x20buy.','affected_stakeholders':['owner','customer'],'scenario':'Merchant\x20sets\x20wip\x20to\x20a\x20local\x20file\x20path\x20/\x20localhost\x20/\x20LAN\x20URL\x20and\x20publishes\x20the\x20Service;\x20'+'the\x20on-chain\x20wip\x20points\x20at\x20the\x20merchant\x27s\x20machine;\x20customers\x20cannot\x20fetch\x20it.','mitigation':'Deploy\x20the\x20.wip\x20file\x20to\x20a\x20public\x20host\x20(GitHub\x20Pages,\x20IPFS,\x20or\x20your\x20own\x20website)\x20and\x20set\x20'+'sale.wip\x20to\x20the\x20public\x20URL.\x20Or\x20leave\x20sale.wip\x20empty\x20(\x22\x22)\x20to\x20skip\x20WIP\x20verification\x20'+'(TESTING\x20ONLY\x20—\x20not\x20recommended\x20for\x20production).','evidence':'sale='+b['name']+',\x20wip='+b['wip']};}}return null;}},R_S_2_01={'id':'R-S-2-01','category':'semantic','trigger':'WIP\x20hash\x20tampering\x20risk\x20—\x20owner\x20updates\x20WIP\x20file\x20without\x20updating\x20wip_hash','check':a=>{if(a['sales']&&(a['sales']['op']==='add'||a['sales']['op']==='set'))for(const b of a['sales']['sales']){if(b['wip']&&!b['wip_hash'])return{'id':'R-S-2-01','level':'CRITICAL','category':'semantic','title':'WIP\x20hash\x20missing\x20—\x20tampering\x20risk','description':'Sale\x20\x22'+b['name']+'\x22\x20has\x20wip\x20URL\x20but\x20no\x20wip_hash.\x20Owner\x20could\x20replace\x20the\x20WIP\x20file\x20without\x20customers\x20noticing.','affected_stakeholders':['customer','owner'],'scenario':'Owner\x20sets\x20wip\x20without\x20hash,\x20then\x20changes\x20file\x20content\x20later','mitigation':'Always\x20compute\x20sha256(wip_file_content)\x20and\x20set\x20as\x20wip_hash.\x20SDK\x20auto-derives\x20if\x20omitted,\x20but\x20explicit\x20hash\x20is\x20safer.','evidence':'sale='+b['name']};}return null;}},R_S_2_02={'id':'R-S-2-02','category':'semantic','trigger':'compensation_fund\x20confused\x20with\x20Service\x20balance\x20(internal\x20Balance<T>)','check':a=>{if(a['compensation_fund_add'])return{'id':'R-S-2-02','level':'HIGH','category':'semantic','title':'compensation_fund\x20is\x20internal\x20Balance<T>,\x20NOT\x20Service-owned\x20Treasury','description':'Depositing\x20'+a['compensation_fund_add']['balance']+'\x20to\x20compensation_fund.\x20This\x20balance\x20is\x20internal\x20to\x20Service<T>\x20and\x20is\x20consumed\x20by\x20arbitration::compensation_claim,\x20not\x20by\x20owner\x20withdrawals.\x20Owner\x20can\x20only\x20withdraw\x20via\x20compensation_fund_withdraw\x20(requires\x20bPaused=true\x20+\x20lock_duration\x20expired).','affected_stakeholders':['owner','arbitrator','customer'],'scenario':'Owner\x20confuses\x20compensation_fund\x20with\x20general\x20Treasury','mitigation':'Use\x20external\x20Treasury\x20(referenced\x20via\x20order_allocators.sharing.who=Entity)\x20for\x20general\x20funds.\x20Use\x20compensation_fund\x20only\x20for\x20arbitration\x20payouts.','evidence':'deposit='+a['compensation_fund_add']['balance']};return null;}},R_S_2_03={'id':'R-S-2-03','category':'semantic','trigger':'quote\x20side\x20effect\x20—\x20stock\x20deduction\x20not\x20rolled\x20back\x20on\x20later\x20failure','check':a=>{if(a['order_new']&&a['order_new']['buy']['items']['length']>0x0)return{'id':'R-S-2-03','level':'HIGH','category':'semantic','title':'Order\x20flow:\x20stock\x20deducted\x20at\x20quote\x20stage\x20—\x20NOT\x20rolled\x20back\x20on\x20failure','description':'Order\x20will\x20deduct\x20stock\x20at\x20Stage\x203\x20(quote).\x20If\x20Stages\x204-7\x20fail,\x20stock\x20remains\x20deducted.\x20Customer\x20must\x20manually\x20re-add\x20stock\x20or\x20accept\x20the\x20loss.','affected_stakeholders':['owner','customer'],'scenario':'Customer\x27s\x20transaction\x20fails\x20after\x20quote\x20but\x20stock\x20is\x20gone','mitigation':'1)\x20Monitor\x20failed\x20transactions\x20and\x20re-add\x20stock\x20via\x20stock_add.\x202)\x20Set\x20sales\x20suspension\x20during\x20high-failure\x20periods.\x203)\x20Use\x20small\x20batch\x20orders\x20to\x20limit\x20blast\x20radius.','evidence':'items='+a['order_new']['buy']['items']['length']};return null;}},R_S_2_04={'id':'R-S-2-04','category':'semantic','trigger':'Discount\x20issuance\x20—\x20verify\x20type\x20and\x20total\x20count\x20semantics','check':a=>{if(a['discount']){const b=a['discount']['count'];if(b>MAX_DISCOUNT_TOTAL_COUNT)return{'id':'R-S-2-04','level':'MEDIUM','category':'semantic','title':'Discount\x20count\x20exceeds\x20total\x20cap','description':'Issuing\x20'+b+'\x20discounts\x20exceeds\x20MAX_DISCOUNT_TOTAL_COUNT\x20'+MAX_DISCOUNT_TOTAL_COUNT,'affected_stakeholders':['owner'],'scenario':'Bulk\x20discount\x20issuance','mitigation':'Issue\x20in\x20batches\x20of\x20<=\x201000\x20(MAX_DISCOUNT_COUNT_ONCE)\x20and\x20keep\x20total\x20<=\x20'+MAX_DISCOUNT_TOTAL_COUNT,'evidence':'count='+b};}return null;}},R_S_2_05={'id':'R-S-2-05','category':'semantic','trigger':'Order\x20placed\x20without\x20verifying\x20WIP\x20hash\x20—\x20buyer\x20passes\x20empty\x20wip_hash','check':a=>{if(a['order_new']){const b=a['order_new']['buy']['items']['filter'](c=>c['wip_hash']==='');if(b['length']>0x0)return{'id':'R-S-2-05','level':'MEDIUM','category':'semantic','title':'Order\x20with\x20empty\x20wip_hash\x20—\x20SDK\x20auto-fills\x20from\x20sale','description':b['length']+'\x20item(s)\x20have\x20empty\x20wip_hash.\x20SDK\x20will\x20auto-fill\x20from\x20sale.wip_hash\x20at\x20order\x20time.\x20If\x20owner\x20updates\x20the\x20WIP\x20file\x20between\x20viewing\x20and\x20ordering,\x20buyer\x20receives\x20the\x20new\x20(potentially\x20different)\x20content.','affected_stakeholders':['customer'],'scenario':'Time-of-check\x20to\x20time-of-use\x20WIP\x20mismatch','mitigation':'Buyer\x20should\x20explicitly\x20pass\x20the\x20wip_hash\x20they\x20saw\x20when\x20viewing\x20the\x20product.\x20Empty\x20string\x20is\x20convenience\x20but\x20riskier.','evidence':'empty_hash_items='+b['length']};}return null;}},R_S_3_01={'id':'R-S-3-01','category':'authority','trigger':'publish\x20operation\x20—\x20requires\x20SERVICE_PUBLISH\x20(311)\x20+\x20prerequisites','check':a=>{if(!a['publish'])return null;const b=[];if(!a['current_order_allocators_set'])b['push']('order_allocators\x20not\x20set\x20(F-S-18,\x20E_NO_ALLOCATOR)');const c=a['current_compensation_fund_balance']??'0';BigInt(c)>0x0n&&(a['current_arbitrations_count']??0x0)===0x0&&b['push']('compensation_fund\x20>\x200\x20but\x20no\x20arbitrations\x20(F-S-19,\x20E_ARBITRATION_NOT_SET_WITH_COMPENSATION_FUND)');if(b['length']>0x0)return{'id':'R-S-3-01','level':'CRITICAL','category':'authority','title':'Publish\x20blocked\x20—\x20prerequisites\x20not\x20met','description':'Cannot\x20publish:\x20'+b['join'](';\x20'),'affected_stakeholders':['owner'],'scenario':'Owner\x20attempts\x20publish\x20without\x20configuring\x20prerequisites','mitigation':'Configure\x20order_allocators\x20(and\x20arbitrations\x20if\x20compensation_fund\x20>\x200)\x20before\x20publish','evidence':'blockers='+b['length']};return null;}},R_S_3_02={'id':'R-S-3-02','category':'authority','trigger':'pause\x20operation\x20—\x20affects\x20new\x20orders\x20but\x20not\x20existing\x20Progress','check':a=>{if(a['pause']===undefined)return null;return{'id':'R-S-3-02','level':'MEDIUM','category':'authority','title':a['pause']?'Pausing\x20Service\x20—\x20new\x20orders\x20blocked,\x20existing\x20Progress\x20continues':'Resuming\x20Service\x20—\x20new\x20orders\x20accepted','description':a['pause']?'Service.bPaused\x20=\x20true\x20will\x20reject\x20new\x20orders\x20(E_PAUSED,\x20service:19).\x20Existing\x20orders\x27\x20Progress\x20continues\x20normally.':'Service.bPaused\x20=\x20false\x20will\x20allow\x20new\x20orders\x20again.','affected_stakeholders':['owner','customer'],'scenario':a['pause']?'Owner\x20pauses\x20for\x20maintenance/stockout':'Owner\x20resumes\x20after\x20maintenance','mitigation':a['pause']?'Communicate\x20pause\x20to\x20customers.\x20Use\x20compensation_fund_withdraw\x20only\x20when\x20paused.':'Verify\x20stock\x20levels\x20before\x20resuming.','evidence':'pause='+a['pause']};}},R_S_3_03={'id':'R-S-3-03','category':'authority','trigger':'buy_guard\x20change\x20—\x20post-publish\x20mutable\x20(unusual\x20exception)','check':a=>{if(a['buy_guard']===undefined)return null;if(a['current_bPublished'])return{'id':'R-S-3-03','level':'MEDIUM','category':'authority','title':'buy_guard\x20change\x20post-publish\x20—\x20unusual\x20mutability','description':'buy_guard\x20is\x20the\x20ONLY\x20publish-locked-field\x20exception:\x20it\x20remains\x20mutable\x20post-publish.\x20Other\x20fields\x20(machine/arbitrations/order_allocators)\x20are\x20immutable.','affected_stakeholders':['owner','customer'],'scenario':'Owner\x20changes\x20buy_guard\x20strategy\x20after\x20publish\x20(e.g.\x20whitelist\x20→\x20public)','mitigation':'Document\x20buy_guard\x20changes\x20for\x20transparency.\x20Customers\x20should\x20re-verify\x20buy_guard\x20before\x20ordering.','evidence':'buy_guard='+(a['buy_guard']??'(cleared)')};return null;}},R_S_3_04={'id':'R-S-3-04','category':'authority','trigger':'Ownership\x20transfer\x20(builder\x20field)\x20—\x20irreversible','check':a=>{if(!a['builder'])return null;return{'id':'R-S-3-04','level':'HIGH','category':'authority','title':'Service\x20ownership\x20transfer\x20—\x20IRREVERSIBLE','description':'Transferring\x20Service\x20to\x20'+a['builder']+'.\x20Original\x20owner\x20loses\x20ALL\x20control.\x20New\x20owner\x20inherits\x20permission\x20+\x20compensation_fund\x20+\x20all\x20bindings.','affected_stakeholders':['owner'],'scenario':'Owner\x20transfers\x20Service\x20to\x20new\x20address','mitigation':'1)\x20Verify\x20new\x20owner\x20address\x20twice.\x202)\x20Withdraw\x20compensation_fund\x20first\x20(if\x20applicable).\x203)\x20Export\x20Service\x20JSON\x20before\x20transfer.','evidence':'new_owner='+a['builder']};}},R_S_4_01={'id':'R-S-4-01','category':'lifecycle','trigger':'publish\x20is\x20irreversible\x20—\x20bPublished\x20cannot\x20be\x20reset\x20to\x20false','check':a=>{if(!a['publish'])return null;if(a['current_bPublished'])return{'id':'R-S-4-01','level':'HIGH','category':'lifecycle','title':'Service\x20already\x20published\x20—\x20publish\x20is\x20no-op','description':'Service.bPublished\x20is\x20already\x20true.\x20Subsequent\x20publish\x20calls\x20have\x20no\x20effect\x20(bPublished\x20is\x20one-shot,\x20cannot\x20revert).','affected_stakeholders':['owner'],'scenario':'Owner\x20calls\x20publish\x20again\x20on\x20already-published\x20Service','mitigation':'Skip\x20publish\x20if\x20already\x20published.\x20To\x20\x27reset\x27\x20a\x20Service,\x20create\x20a\x20new\x20one.','evidence':'bPublished=true'};return{'id':'R-S-4-01','level':'HIGH','category':'lifecycle','title':'Publish\x20is\x20IRREVERSIBLE\x20—\x203\x20fields\x20will\x20be\x20locked\x20forever','description':'Once\x20published:\x20machine\x20(306),\x20arbitrations\x20(308),\x20order_allocators\x20(313)\x20become\x20permanently\x20immutable.\x20bPublished\x20cannot\x20be\x20reset\x20to\x20false.\x20Clone\x20Service\x20to\x20make\x20changes.','affected_stakeholders':['owner','customer'],'scenario':'Owner\x20publishes\x20Service\x20for\x20the\x20first\x20time','mitigation':'Verify\x20all\x20configurations\x20before\x20publish.\x20Run\x20pre-publish\x20checklist\x20(confirm-gate.ts).','evidence':'bPublished=false→true'};}},R_S_4_02={'id':'R-S-4-02','category':'lifecycle','trigger':'setting_lock_duration\x20add\x20—\x20only-increase\x20mechanism','check':a=>{if(a['setting_lock_duration_add']===undefined)return null;return{'id':'R-S-4-02','level':'MEDIUM','category':'lifecycle','title':'setting_lock_duration\x20can\x20only\x20INCREASE','description':'Adding\x20'+a['setting_lock_duration_add']+'\x20ms\x20to\x20setting_lock_duration.\x20New\x20value\x20=\x20old\x20+\x20input\x20(safe_add).\x20Cannot\x20be\x20decreased\x20—\x20protects\x20customers\x20from\x20owner\x20reducing\x20lock\x20to\x20withdraw\x20compensation_fund\x20faster.','affected_stakeholders':['owner','customer'],'scenario':'Owner\x20extends\x20lock\x20period\x20to\x20build\x20trust','mitigation':'Ensure\x20extension\x20is\x20intentional.\x20Lock\x20affects\x20rewards/compensation_fund_withdraw/compensation_fund_receive.','evidence':'add_ms='+a['setting_lock_duration_add']};}},R_S_4_03={'id':'R-S-4-03','category':'lifecycle','trigger':'machine/arbitrations/order_allocators\x20modification\x20after\x20publish\x20—\x20SDK\x20blocks','check':a=>{if(!a['current_bPublished'])return null;const b=[];if(a['machine']!==undefined)b['push']('machine\x20(306)');if(a['arbitrations']!==undefined)b['push']('arbitrations\x20(308)');if(a['order_allocators']!==undefined)b['push']('order_allocators\x20(313)');if(b['length']>0x0)return{'id':'R-S-4-03','level':'HIGH','category':'lifecycle','title':'Post-publish\x20modification\x20blocked\x20by\x20SDK','description':'Service\x20is\x20published.\x20Cannot\x20modify:\x20'+b['join'](',\x20')+'.\x20SDK\x20checkNotPublished()\x20will\x20abort.\x20To\x20change\x20these\x20fields,\x20clone\x20the\x20Service.','affected_stakeholders':['owner'],'scenario':'Owner\x20attempts\x20to\x20change\x20locked\x20field\x20post-publish','mitigation':'Create\x20a\x20new\x20Service\x20with\x20the\x20desired\x20configuration.\x20Migrate\x20active\x20orders\x20if\x20needed.','evidence':'blocked='+b['join'](',')};return null;}},R_S_4_04={'id':'R-S-4-04','category':'lifecycle','trigger':'sales\x20modification\x20—\x20stock/price\x20changes\x20affect\x20future\x20orders\x20only','check':a=>{if(!a['sales'])return null;return{'id':'R-S-4-04','level':'LOW','category':'lifecycle','title':'Sales\x20modification\x20affects\x20future\x20orders\x20only','description':'Sales\x20add/set/remove/clear\x20changes\x20do\x20NOT\x20affect\x20already-created\x20Orders.\x20Existing\x20Orders\x27\x20Progress\x20continues\x20with\x20the\x20original\x20sale\x20parameters.','affected_stakeholders':['owner','customer'],'scenario':'Owner\x20updates\x20prices\x20mid-campaign','mitigation':'Communicate\x20price/stock\x20changes\x20to\x20customers.\x20Existing\x20orders\x20are\x20unaffected.','evidence':'sales_op='+a['sales']['op']};}},R_S_4_05={'id':'R-S-4-05','category':'lifecycle','trigger':'Service\x20paused\x20(state-only\x20buyer\x20rule)\x20—\x20new\x20orders\x20are\x20suspended','check':a=>{if(!a['current_bPaused'])return null;return{'id':'R-S-4-05','level':'HIGH','category':'lifecycle','title':'Service\x20is\x20paused\x20—\x20ordering\x20suspended','description':'Service.bPaused\x20is\x20true.\x20The\x20merchant\x20has\x20actively\x20paused\x20the\x20Service;\x20new\x20orders\x20cannot\x20be\x20placed\x20until\x20it\x20resumes.','affected_stakeholders':['customer'],'scenario':'Buyer\x20performs\x20due\x20diligence\x20on\x20a\x20paused\x20Service','mitigation':'Confirm\x20with\x20the\x20merchant\x20(via\x20Messenger)\x20when\x20the\x20Service\x20will\x20resume\x20before\x20ordering.','evidence':'bPaused=true'};}},R_S_4_06={'id':'R-S-4-06','category':'lifecycle','trigger':'Service\x20not\x20published\x20(state-only\x20buyer\x20rule)\x20—\x20cannot\x20be\x20ordered','check':a=>{if(a['current_bPublished']!==![])return null;return{'id':'R-S-4-06','level':'HIGH','category':'lifecycle','title':'Service\x20is\x20not\x20published\x20—\x20cannot\x20be\x20ordered','description':'Service.bPublished\x20is\x20false.\x20The\x20Service\x20is\x20still\x20a\x20draft:\x20it\x20is\x20not\x20visible\x20on\x20the\x20market\x20and\x20order_new\x20will\x20fail.','affected_stakeholders':['customer'],'scenario':'Buyer\x20evaluates\x20a\x20draft\x20Service\x20shared\x20out-of-band','mitigation':'Wait\x20until\x20the\x20merchant\x20publishes\x20the\x20Service\x20(publish\x20is\x20irreversible\x20—\x20configuration\x20is\x20locked\x20at\x20that\x20point).','evidence':'bPublished=false'};}},R_S_5_01={'id':'R-S-5-01','category':'cross_object','trigger':'Machine\x20binding\x20—\x20post-publish\x20immutable,\x20Progress\x20inherits','check':a=>{if(a['machine']===undefined)return null;if(a['current_bPublished'])return{'id':'R-S-5-01','level':'HIGH','category':'cross_object','title':'Machine\x20binding\x20immutable\x20post-publish','description':'Service\x20is\x20published;\x20machine\x20cannot\x20be\x20changed.\x20All\x20future\x20Progress\x20objects\x20will\x20use\x20the\x20bound\x20Machine.','affected_stakeholders':['owner'],'scenario':'Owner\x20wants\x20to\x20upgrade\x20workflow\x20post-publish','mitigation':'Create\x20new\x20Service\x20with\x20new\x20Machine.\x20Migrate\x20customers\x20via\x20discounts.','evidence':'machine='+(a['machine']??'(cleared)')};return{'id':'R-S-5-01','level':'MEDIUM','category':'cross_object','title':'Machine\x20binding\x20—\x20verify\x20Machine\x20is\x20published','description':'Binding\x20Machine\x20'+a['machine']+'.\x20Ensure\x20Machine\x20is\x20published\x20(machine::publish)\x20—\x20Service\x20cannot\x20bind\x20unpublished\x20Machine.','affected_stakeholders':['owner'],'scenario':'Owner\x20binds\x20Machine\x20before\x20publishing\x20Service','mitigation':'Verify\x20Machine.bPublished\x20=\x20true\x20before\x20binding.','evidence':'machine='+a['machine']};}},R_S_5_02={'id':'R-S-5-02','category':'cross_object','trigger':'Arbitration\x20binding\x20—\x20required\x20when\x20compensation_fund\x20>\x200','check':a=>{if(!a['arbitrations'])return null;const b=a['current_compensation_fund_balance']??'0';if(BigInt(b)>0x0n&&(a['current_arbitrations_count']??0x0)===0x0)return{'id':'R-S-5-02','level':'HIGH','category':'cross_object','title':'Arbitration\x20required\x20—\x20compensation_fund\x20has\x20balance','description':'compensation_fund\x20balance\x20is\x20'+b+'.\x20Publish\x20will\x20fail\x20(E_ARBITRATION_NOT_SET_WITH_COMPENSATION_FUND)\x20until\x20arbitrations\x20is\x20non-empty.','affected_stakeholders':['owner'],'scenario':'Owner\x20deposits\x20compensation_fund\x20without\x20configuring\x20arbitrations','mitigation':'Add\x20at\x20least\x201\x20Arbitration\x20object\x20before\x20publish.','evidence':'compensation_fund='+b};return null;}},R_S_5_03={'id':'R-S-5-03','category':'cross_object','trigger':'order_allocators\x20binding\x20—\x20publish\x20prerequisite,\x20post-publish\x20immutable','check':a=>{if(a['order_allocators']===undefined)return null;if(a['current_bPublished'])return{'id':'R-S-5-03','level':'HIGH','category':'cross_object','title':'order_allocators\x20immutable\x20post-publish','description':'Service\x20is\x20published;\x20order_allocators\x20cannot\x20be\x20changed.\x20Fund\x20distribution\x20strategy\x20is\x20permanently\x20locked.','affected_stakeholders':['owner'],'scenario':'Owner\x20wants\x20to\x20adjust\x20fee\x20split\x20post-publish','mitigation':'Create\x20new\x20Service\x20with\x20new\x20allocators.\x20Cannot\x20migrate\x20existing\x20Orders.','evidence':'order_allocators='+(a['order_allocators']?'(set)':'(cleared)')};if(a['publish']&&!a['order_allocators'])return{'id':'R-S-5-03','level':'CRITICAL','category':'cross_object','title':'Publish\x20without\x20order_allocators\x20—\x20will\x20fail','description':'Publish\x20will\x20abort\x20with\x20E_NO_ALLOCATOR.\x20order_allocators\x20is\x20a\x20mandatory\x20publish\x20prerequisite.','affected_stakeholders':['owner'],'scenario':'Owner\x20attempts\x20publish\x20without\x20configuring\x20allocators','mitigation':'Set\x20order_allocators\x20before\x20publish.','evidence':'order_allocators=null'};return null;}},R_S_5_04={'id':'R-S-5-04','category':'cross_object','trigger':'Repository/Reward\x20binding\x20—\x20verify\x20object\x20types\x20before\x20adding','check':a=>{if(a['repositories']&&(a['repositories']['op']==='add'||a['repositories']['op']==='set'))return{'id':'R-S-5-04','level':'LOW','category':'cross_object','title':'Repository\x20binding\x20—\x20verify\x20object\x20types','description':'Adding\x20'+a['repositories']['objects']['length']+'\x20repositories.\x20SDK\x20uses\x20queryObjectsWithType\x20to\x20validate\x20each\x20is\x20ObjectType.Repository\x20before\x20binding.','affected_stakeholders':['owner'],'scenario':'Owner\x20adds\x20non-Repository\x20object\x20by\x20mistake','mitigation':'Use\x20LocalMark\x20names\x20or\x20addresses\x20that\x20are\x20confirmed\x20Repository\x20objects.','evidence':'objects='+a['repositories']['objects']['length']};if(a['rewards']&&(a['rewards']['op']==='add'||a['rewards']['op']==='set'))return{'id':'R-S-5-04','level':'LOW','category':'cross_object','title':'Reward\x20binding\x20—\x20verify\x20object\x20types','description':'Adding\x20'+a['rewards']['objects']['length']+'\x20rewards.\x20SDK\x20validates\x20ObjectType.Reward.\x20add\x20is\x20always\x20allowed;\x20only\x20remove/clear\x20are\x20time-locked\x20after\x20publish.','affected_stakeholders':['owner'],'scenario':'Owner\x20adds\x20Reward\x20objects','mitigation':'Verify\x20Reward\x20objects\x20exist\x20and\x20are\x20active.\x20Remember\x20that\x20removing\x20them\x20later\x20requires\x20pause\x20+\x20setting_lock_duration\x20elapsed.','evidence':'objects='+a['rewards']['objects']['length']};return null;}},R_S_5_05={'id':'R-S-5-05','category':'cross_object','trigger':'compensation_fund\x20has\x20balance\x20but\x20no\x20Arbitration\x20bound\x20(state-only\x20buyer\x20rule)','check':a=>{const b=a['current_compensation_fund_balance'];if(b===undefined)return null;let c;try{c=BigInt(b);}catch{return null;}if(c>0x0n&&(a['current_arbitrations_count']??0x0)===0x0)return{'id':'R-S-5-05','level':'HIGH','category':'cross_object','title':'Compensation\x20fund\x20without\x20Arbitration\x20—\x20fund\x20is\x20unclaimable','description':'compensation_fund\x20balance\x20is\x20'+b+'\x20but\x20no\x20Arbitration\x20object\x20is\x20bound.\x20Compensation\x20is\x20claimed\x20via\x20dispute\x20→\x20arbitration()\x20ruling\x20with\x20indemnity\x20→\x20arb_withdraw;\x20without\x20an\x20Arbitration\x20binding\x20there\x20is\x20no\x20dispute\x20path\x20to\x20trigger\x20a\x20payout.','affected_stakeholders':['customer','owner'],'scenario':'Buyer\x20sees\x20a\x20compensation\x20fund\x20but\x20no\x20dispute\x20path\x20to\x20claim\x20it','mitigation':'Require\x20the\x20merchant\x20to\x20bind\x20at\x20least\x20one\x20Arbitration\x20object\x20before\x20ordering.','evidence':'compensation_fund='+b+',\x20arbitrations=0'};return null;}},ALL_RULES=[R_S_1_01,R_S_1_02,R_S_1_03,R_S_1_04,R_S_1_05,R_S_2_01,R_S_2_02,R_S_2_03,R_S_2_04,R_S_2_05,R_S_3_01,R_S_3_02,R_S_3_03,R_S_3_04,R_S_4_01,R_S_4_02,R_S_4_03,R_S_4_04,R_S_4_05,R_S_4_06,R_S_5_01,R_S_5_02,R_S_5_03,R_S_5_04,R_S_5_05];export const SERVICE_RISK_VERSION='1.1.0';export const SERVICE_STATE_RULE_IDS=['R-S-4-05','R-S-4-06','R-S-5-05'];export function assessServiceStateRisks(a){const b=new Set(SERVICE_STATE_RULE_IDS),c=[];for(const d of ALL_RULES){if(!b['has'](d['id']))continue;const e=d['check'](a);if(e)c['push'](e);}return c;}export function getAllServiceRiskRules(){return[...ALL_RULES];}export function getServiceRiskRulesCount(){return ALL_RULES['length'];}export function getServiceRiskRulesByCategory(a){return ALL_RULES['filter'](b=>b['category']===a);}export function assessServiceRisks(a){const b=[];for(const f of ALL_RULES){const g=f['check'](a);if(g)b['push'](g);}const c=b['length']===0x0?'LOW':b['some'](h=>h['level']==='CRITICAL')?'CRITICAL':b['some'](h=>h['level']==='HIGH')?'HIGH':b['some'](h=>h['level']==='MEDIUM')?'MEDIUM':'LOW',d={};for(const h of b){d[h['category']]=(d[h['category']]??0x0)+0x1;}const e={};for(const i of b){for(const j of i['affected_stakeholders']){if(!e[j])e[j]=[];e[j]['push'](i['id']+':\x20'+i['mitigation']);}}return{'summary':'Assessed\x20'+b['length']+'\x20risk(s)\x20across\x20'+Object['keys'](d)['length']+'\x20categories','risks':b,'overall_risk':c,'risks_by_category':d,'stakeholder_advice':e,'needs_human_review':b['some'](k=>k['level']==='CRITICAL'||k['level']==='HIGH')};}
1
+ import{MAX_SALE_COUNT,MAX_REPOSITORY_COUNT,MAX_ARBITRATION_COUNT,MAX_DISCOUNT_TOTAL_COUNT,MAX_WIP_LENGTH,MAX_WIP_HASH_LENGTH}from'@wowok/wowok';const R_S_1_01={'id':'R-S-1-01','category':'structural','trigger':'sales\x20count\x20exceeds\x20MAX_SALE_COUNT\x20(50)','check':a=>{const b=a['current_sales_count']??0x0;if(a['sales']&&(a['sales']['op']==='add'||a['sales']['op']==='set')){const c=a['sales']['op']==='set'?a['sales']['sales']['length']:b+a['sales']['sales']['length'];if(c>MAX_SALE_COUNT)return{'id':'R-S-1-01','level':'HIGH','category':'structural','title':'Sales\x20count\x20exceeds\x20limit','description':'Service\x20would\x20have\x20'+c+'\x20sales\x20items,\x20exceeds\x20MAX_SALE_COUNT\x20'+MAX_SALE_COUNT,'affected_stakeholders':['owner','system'],'scenario':'Adding\x20too\x20many\x20product\x20SKUs','mitigation':'Split\x20into\x20multiple\x20Service\x20objects\x20or\x20remove\x20discontinued\x20items','evidence':'sales_count='+c};}return null;}},R_S_1_02={'id':'R-S-1-02','category':'structural','trigger':'repositories\x20count\x20exceeds\x20MAX_REPOSITORY_COUNT\x20(100)','check':a=>{const b=a['current_repositories_count']??0x0;if(a['repositories']&&(a['repositories']['op']==='add'||a['repositories']['op']==='set')){const c=a['repositories']['op']==='set'?a['repositories']['objects']['length']:b+a['repositories']['objects']['length'];if(c>MAX_REPOSITORY_COUNT)return{'id':'R-S-1-02','level':'MEDIUM','category':'structural','title':'Repositories\x20count\x20exceeds\x20limit','description':'Service\x20would\x20have\x20'+c+'\x20repositories,\x20exceeds\x20MAX_REPOSITORY_COUNT\x20'+MAX_REPOSITORY_COUNT,'affected_stakeholders':['owner'],'scenario':'Binding\x20too\x20many\x20data\x20repositories','mitigation':'Consolidate\x20repositories\x20or\x20remove\x20inactive\x20ones','evidence':'repositories_count='+c};}return null;}},R_S_1_03={'id':'R-S-1-03','category':'structural','trigger':'arbitrations\x20count\x20exceeds\x20MAX_ARBITRATION_COUNT\x20(20)','check':a=>{const b=a['current_arbitrations_count']??0x0;if(a['arbitrations']&&(a['arbitrations']['op']==='add'||a['arbitrations']['op']==='set')){const c=a['arbitrations']['op']==='set'?a['arbitrations']['objects']['length']:b+a['arbitrations']['objects']['length'];if(c>MAX_ARBITRATION_COUNT)return{'id':'R-S-1-03','level':'HIGH','category':'structural','title':'Arbitrations\x20count\x20exceeds\x20limit','description':'Service\x20would\x20have\x20'+c+'\x20arbitrations,\x20exceeds\x20MAX_ARBITRATION_COUNT\x20'+MAX_ARBITRATION_COUNT,'affected_stakeholders':['owner','arbitrator'],'scenario':'Binding\x20too\x20many\x20Arbitration\x20objects','mitigation':'Use\x201-3\x20Arbitration\x20objects\x20covering\x20different\x20dispute\x20scopes','evidence':'arbitrations_count='+c};}return null;}},R_S_1_04={'id':'R-S-1-04','category':'structural','trigger':'WIP\x20hash\x20length\x20exceeds\x20MAX_WIP_HASH_LENGTH\x20(64)\x20or\x20URL\x20exceeds\x20MAX_WIP_LENGTH\x20(1024)','check':a=>{if(a['sales']&&(a['sales']['op']==='add'||a['sales']['op']==='set'))for(const b of a['sales']['sales']){if(b['wip_hash']&&b['wip_hash']['length']>MAX_WIP_HASH_LENGTH)return{'id':'R-S-1-04','level':'HIGH','category':'structural','title':'WIP\x20hash\x20length\x20exceeds\x20limit','description':'Sale\x20\x22'+b['name']+'\x22\x20wip_hash\x20length\x20'+b['wip_hash']['length']+'\x20>\x20MAX_WIP_HASH_LENGTH\x20'+MAX_WIP_HASH_LENGTH,'affected_stakeholders':['owner','customer'],'scenario':'Malformed\x20WIP\x20hash\x20(should\x20be\x20sha256\x20hex,\x2064\x20chars)','mitigation':'Use\x20sha256\x20hex\x20hash\x20(64\x20characters,\x20no\x20prefix)','evidence':'wip_hash_length='+b['wip_hash']['length']};if(b['wip']&&b['wip']['length']>MAX_WIP_LENGTH)return{'id':'R-S-1-04','level':'HIGH','category':'structural','title':'WIP\x20URL\x20length\x20exceeds\x20limit','description':'Sale\x20\x22'+b['name']+'\x22\x20wip\x20URL\x20length\x20'+b['wip']['length']+'\x20>\x20MAX_WIP_LENGTH\x20'+MAX_WIP_LENGTH,'affected_stakeholders':['owner'],'scenario':'WIP\x20URL\x20too\x20long\x20(use\x20IPFS\x20or\x20short\x20HTTPS\x20URL)','mitigation':'Use\x20IPFS\x20CID\x20or\x20shorter\x20URL','evidence':'wip_url_length='+b['wip']['length']};}return null;}},R_S_1_05={'id':'R-S-1-05','category':'structural','trigger':'sale.wip\x20is\x20a\x20local\x20path\x20/\x20localhost\x20/\x20LAN\x20URL\x20(not\x20network-deployable)\x20—\x20every\x20customer\x20order\x20fails','check':a=>{if(a['sales']&&(a['sales']['op']==='add'||a['sales']['op']==='set'))for(const b of a['sales']['sales']){if(b['wip']&&b['wip']!==''){let c=null;const d=b['wip'];if(/^[A-Za-z]:[\\/]/['test'](d)||d['startsWith']('/')||d['startsWith']('./')||d['startsWith']('../'))c='local\x20filesystem\x20path';else{if(/^https?:\/\/(localhost|127\.0\.0\.1|\[::1\]|0\.0\.0\.0)([:/]|$)/i['test'](d))c='localhost/loopback\x20URL';else{if(/^https?:\/\/(10\.\d{1,3}\.\d{1,3}\.\d{1,3}|172\.(1[6-9]|2\d|3[01])\.\d{1,3}\.\d{1,3}|192\.168\.\d{1,3}\.\d{1,3})([:/]|$)/i['test'](d))c='LAN\x20(private\x20IP)\x20URL';else!/^https?:\/\//i['test'](d)&&!d['startsWith']('ipfs://')&&!d['startsWith']('data:')&&(c='unrecognized\x20format\x20(not\x20a\x20network\x20URL)');}}if(c)return{'id':'R-S-1-05','level':'CRITICAL','category':'structural','title':'WIP\x20is\x20not\x20network-deployed\x20—\x20every\x20customer\x20order\x20will\x20fail','description':'Sale\x20\x22'+b['name']+'\x22\x20wip\x20\x22'+b['wip']+'\x22\x20is\x20a\x20'+c+'.\x20It\x20passes\x20set-time\x20verification\x20'+'on\x20the\x20merchant\x27s\x20own\x20machine\x20but\x20is\x20unreachable\x20by\x20customers\x20on\x20other\x20machines\x20—\x20'+'order_new\x20aborts\x20100%\x20when\x20a\x20customer\x20tries\x20to\x20buy.','affected_stakeholders':['owner','customer'],'scenario':'Merchant\x20sets\x20wip\x20to\x20a\x20local\x20file\x20path\x20/\x20localhost\x20/\x20LAN\x20URL\x20and\x20publishes\x20the\x20Service;\x20'+'the\x20on-chain\x20wip\x20points\x20at\x20the\x20merchant\x27s\x20machine;\x20customers\x20cannot\x20fetch\x20it.','mitigation':'Deploy\x20the\x20.wip\x20file\x20to\x20a\x20public\x20host\x20(GitHub\x20Pages,\x20IPFS,\x20or\x20your\x20own\x20website)\x20and\x20set\x20'+'sale.wip\x20to\x20the\x20public\x20URL.\x20Or\x20leave\x20sale.wip\x20empty\x20(\x22\x22)\x20to\x20skip\x20WIP\x20verification\x20'+'(TESTING\x20ONLY\x20—\x20not\x20recommended\x20for\x20production).','evidence':'sale='+b['name']+',\x20wip='+b['wip']};}}return null;}},R_S_2_01={'id':'R-S-2-01','category':'semantic','trigger':'WIP\x20hash\x20tampering\x20risk\x20—\x20owner\x20updates\x20WIP\x20file\x20without\x20updating\x20wip_hash','check':a=>{if(a['sales']&&(a['sales']['op']==='add'||a['sales']['op']==='set'))for(const b of a['sales']['sales']){if(b['wip']&&!b['wip_hash'])return{'id':'R-S-2-01','level':'CRITICAL','category':'semantic','title':'WIP\x20hash\x20missing\x20—\x20tampering\x20risk','description':'Sale\x20\x22'+b['name']+'\x22\x20has\x20wip\x20URL\x20but\x20no\x20wip_hash.\x20Owner\x20could\x20replace\x20the\x20WIP\x20file\x20without\x20customers\x20noticing.','affected_stakeholders':['customer','owner'],'scenario':'Owner\x20sets\x20wip\x20without\x20hash,\x20then\x20changes\x20file\x20content\x20later','mitigation':'Always\x20compute\x20sha256(wip_file_content)\x20and\x20set\x20as\x20wip_hash.\x20SDK\x20auto-derives\x20if\x20omitted,\x20but\x20explicit\x20hash\x20is\x20safer.','evidence':'sale='+b['name']};}return null;}},R_S_2_02={'id':'R-S-2-02','category':'semantic','trigger':'compensation_fund\x20confused\x20with\x20Service\x20balance\x20(internal\x20Balance<T>)','check':a=>{if(a['compensation_fund_add'])return{'id':'R-S-2-02','level':'HIGH','category':'semantic','title':'compensation_fund\x20is\x20internal\x20Balance<T>,\x20NOT\x20Service-owned\x20Treasury','description':'Depositing\x20'+a['compensation_fund_add']['balance']+'\x20to\x20compensation_fund.\x20This\x20balance\x20is\x20internal\x20to\x20Service<T>\x20and\x20is\x20consumed\x20by\x20arbitration::compensation_claim,\x20not\x20by\x20owner\x20withdrawals.\x20Owner\x20can\x20only\x20withdraw\x20via\x20compensation_fund_withdraw\x20(requires\x20bPaused=true\x20+\x20lock_duration\x20expired).','affected_stakeholders':['owner','arbitrator','customer'],'scenario':'Owner\x20confuses\x20compensation_fund\x20with\x20general\x20Treasury','mitigation':'Use\x20external\x20Treasury\x20(referenced\x20via\x20order_allocators.sharing.who=Entity)\x20for\x20general\x20funds.\x20Use\x20compensation_fund\x20only\x20for\x20arbitration\x20payouts.','evidence':'deposit='+a['compensation_fund_add']['balance']};return null;}},R_S_2_03={'id':'R-S-2-03','category':'semantic','trigger':'quote\x20side\x20effect\x20—\x20stock\x20deduction\x20not\x20rolled\x20back\x20on\x20later\x20failure','check':a=>{if(a['order_new']&&a['order_new']['buy']['items']['length']>0x0)return{'id':'R-S-2-03','level':'HIGH','category':'semantic','title':'Order\x20flow:\x20stock\x20deducted\x20at\x20quote\x20stage\x20—\x20NOT\x20rolled\x20back\x20on\x20failure','description':'Order\x20will\x20deduct\x20stock\x20at\x20Stage\x203\x20(quote).\x20If\x20Stages\x204-7\x20fail,\x20stock\x20remains\x20deducted.\x20Customer\x20must\x20manually\x20re-add\x20stock\x20or\x20accept\x20the\x20loss.','affected_stakeholders':['owner','customer'],'scenario':'Customer\x27s\x20transaction\x20fails\x20after\x20quote\x20but\x20stock\x20is\x20gone','mitigation':'1)\x20Monitor\x20failed\x20transactions\x20and\x20re-add\x20stock\x20via\x20stock_add.\x202)\x20Set\x20sales\x20suspension\x20during\x20high-failure\x20periods.\x203)\x20Use\x20small\x20batch\x20orders\x20to\x20limit\x20blast\x20radius.','evidence':'items='+a['order_new']['buy']['items']['length']};return null;}},R_S_2_04={'id':'R-S-2-04','category':'semantic','trigger':'Discount\x20issuance\x20—\x20verify\x20type\x20and\x20total\x20count\x20semantics','check':a=>{if(a['discount']){const b=a['discount']['count'];if(b>MAX_DISCOUNT_TOTAL_COUNT)return{'id':'R-S-2-04','level':'MEDIUM','category':'semantic','title':'Discount\x20count\x20exceeds\x20total\x20cap','description':'Issuing\x20'+b+'\x20discounts\x20exceeds\x20MAX_DISCOUNT_TOTAL_COUNT\x20'+MAX_DISCOUNT_TOTAL_COUNT,'affected_stakeholders':['owner'],'scenario':'Bulk\x20discount\x20issuance','mitigation':'Issue\x20in\x20batches\x20of\x20<=\x201000\x20(MAX_DISCOUNT_COUNT_ONCE)\x20and\x20keep\x20total\x20<=\x20'+MAX_DISCOUNT_TOTAL_COUNT,'evidence':'count='+b};}return null;}},R_S_2_05={'id':'R-S-2-05','category':'semantic','trigger':'Order\x20placed\x20without\x20verifying\x20WIP\x20hash\x20—\x20buyer\x20passes\x20empty\x20wip_hash','check':a=>{if(a['order_new']){const b=a['order_new']['buy']['items']['filter'](c=>c['wip_hash']==='');if(b['length']>0x0)return{'id':'R-S-2-05','level':'MEDIUM','category':'semantic','title':'Order\x20with\x20empty\x20wip_hash\x20—\x20SDK\x20auto-fills\x20from\x20sale','description':b['length']+'\x20item(s)\x20have\x20empty\x20wip_hash.\x20SDK\x20will\x20auto-fill\x20from\x20sale.wip_hash\x20at\x20order\x20time.\x20If\x20owner\x20updates\x20the\x20WIP\x20file\x20between\x20viewing\x20and\x20ordering,\x20buyer\x20receives\x20the\x20new\x20(potentially\x20different)\x20content.','affected_stakeholders':['customer'],'scenario':'Time-of-check\x20to\x20time-of-use\x20WIP\x20mismatch','mitigation':'Buyer\x20should\x20explicitly\x20pass\x20the\x20wip_hash\x20they\x20saw\x20when\x20viewing\x20the\x20product.\x20Empty\x20string\x20is\x20convenience\x20but\x20riskier.','evidence':'empty_hash_items='+b['length']};}return null;}},R_S_3_01={'id':'R-S-3-01','category':'authority','trigger':'publish\x20operation\x20—\x20requires\x20SERVICE_PUBLISH\x20(311)\x20+\x20prerequisites','check':a=>{if(!a['publish'])return null;const b=[];if(!a['current_order_allocators_set'])b['push']('order_allocators\x20not\x20set\x20(F-S-18,\x20E_NO_ALLOCATOR)');const c=a['current_compensation_fund_balance']??'0';BigInt(c)>0x0n&&(a['current_arbitrations_count']??0x0)===0x0&&b['push']('compensation_fund\x20>\x200\x20but\x20no\x20arbitrations\x20(F-S-19,\x20E_ARBITRATION_NOT_SET_WITH_COMPENSATION_FUND)');if(b['length']>0x0)return{'id':'R-S-3-01','level':'CRITICAL','category':'authority','title':'Publish\x20blocked\x20—\x20prerequisites\x20not\x20met','description':'Cannot\x20publish:\x20'+b['join'](';\x20'),'affected_stakeholders':['owner'],'scenario':'Owner\x20attempts\x20publish\x20without\x20configuring\x20prerequisites','mitigation':'Configure\x20order_allocators\x20(and\x20arbitrations\x20if\x20compensation_fund\x20>\x200)\x20before\x20publish','evidence':'blockers='+b['length']};return null;}},R_S_3_02={'id':'R-S-3-02','category':'authority','trigger':'pause\x20operation\x20—\x20affects\x20new\x20orders\x20but\x20not\x20existing\x20Progress','check':a=>{if(a['pause']===undefined)return null;return{'id':'R-S-3-02','level':'MEDIUM','category':'authority','title':a['pause']?'Pausing\x20Service\x20—\x20new\x20orders\x20blocked,\x20existing\x20Progress\x20continues':'Resuming\x20Service\x20—\x20new\x20orders\x20accepted','description':a['pause']?'Service.bPaused\x20=\x20true\x20will\x20reject\x20new\x20orders\x20(E_PAUSED,\x20service:19).\x20Existing\x20orders\x27\x20Progress\x20continues\x20normally.':'Service.bPaused\x20=\x20false\x20will\x20allow\x20new\x20orders\x20again.','affected_stakeholders':['owner','customer'],'scenario':a['pause']?'Owner\x20pauses\x20for\x20maintenance/stockout':'Owner\x20resumes\x20after\x20maintenance','mitigation':a['pause']?'Communicate\x20pause\x20to\x20customers.\x20Use\x20compensation_fund_withdraw\x20only\x20when\x20paused.':'Verify\x20stock\x20levels\x20before\x20resuming.','evidence':'pause='+a['pause']};}},R_S_3_03={'id':'R-S-3-03','category':'authority','trigger':'buy_guard\x20change\x20—\x20post-publish\x20mutable\x20(unusual\x20exception)','check':a=>{if(a['buy_guard']===undefined)return null;if(a['current_bPublished'])return{'id':'R-S-3-03','level':'MEDIUM','category':'authority','title':'buy_guard\x20change\x20post-publish\x20—\x20unusual\x20mutability','description':'buy_guard\x20is\x20the\x20ONLY\x20publish-locked-field\x20exception:\x20it\x20remains\x20mutable\x20post-publish.\x20Other\x20fields\x20(machine/arbitrations/order_allocators)\x20are\x20immutable.','affected_stakeholders':['owner','customer'],'scenario':'Owner\x20changes\x20buy_guard\x20strategy\x20after\x20publish\x20(e.g.\x20whitelist\x20→\x20public)','mitigation':'Document\x20buy_guard\x20changes\x20for\x20transparency.\x20Customers\x20should\x20re-verify\x20buy_guard\x20before\x20ordering.','evidence':'buy_guard='+(a['buy_guard']??'(cleared)')};return null;}},R_S_3_04={'id':'R-S-3-04','category':'authority','trigger':'Ownership\x20transfer\x20(builder\x20field)\x20—\x20irreversible','check':a=>{if(!a['builder'])return null;return{'id':'R-S-3-04','level':'HIGH','category':'authority','title':'Service\x20ownership\x20transfer\x20—\x20IRREVERSIBLE','description':'Transferring\x20Service\x20to\x20'+a['builder']+'.\x20Original\x20owner\x20loses\x20ALL\x20control.\x20New\x20owner\x20inherits\x20permission\x20+\x20compensation_fund\x20+\x20all\x20bindings.','affected_stakeholders':['owner'],'scenario':'Owner\x20transfers\x20Service\x20to\x20new\x20address','mitigation':'1)\x20Verify\x20new\x20owner\x20address\x20twice.\x202)\x20Withdraw\x20compensation_fund\x20first\x20(if\x20applicable).\x203)\x20Export\x20Service\x20JSON\x20before\x20transfer.','evidence':'new_owner='+a['builder']};}},R_S_4_01={'id':'R-S-4-01','category':'lifecycle','trigger':'publish\x20is\x20irreversible\x20—\x20bPublished\x20cannot\x20be\x20reset\x20to\x20false','check':a=>{if(!a['publish'])return null;if(a['current_bPublished'])return{'id':'R-S-4-01','level':'HIGH','category':'lifecycle','title':'Service\x20already\x20published\x20—\x20publish\x20is\x20no-op','description':'Service.bPublished\x20is\x20already\x20true.\x20Subsequent\x20publish\x20calls\x20have\x20no\x20effect\x20(bPublished\x20is\x20one-shot,\x20cannot\x20revert).','affected_stakeholders':['owner'],'scenario':'Owner\x20calls\x20publish\x20again\x20on\x20already-published\x20Service','mitigation':'Skip\x20publish\x20if\x20already\x20published.\x20To\x20\x27reset\x27\x20a\x20Service,\x20create\x20a\x20new\x20one.','evidence':'bPublished=true'};return{'id':'R-S-4-01','level':'HIGH','category':'lifecycle','title':'Publish\x20is\x20IRREVERSIBLE\x20—\x203\x20fields\x20will\x20be\x20locked\x20forever','description':'Once\x20published:\x20machine\x20(306),\x20arbitrations\x20(308),\x20order_allocators\x20(313)\x20become\x20permanently\x20immutable.\x20bPublished\x20cannot\x20be\x20reset\x20to\x20false.\x20Clone\x20Service\x20to\x20make\x20changes.','affected_stakeholders':['owner','customer'],'scenario':'Owner\x20publishes\x20Service\x20for\x20the\x20first\x20time','mitigation':'Verify\x20all\x20configurations\x20before\x20publish.\x20Run\x20pre-publish\x20checklist\x20(confirm-gate.ts).','evidence':'bPublished=false→true'};}},R_S_4_02={'id':'R-S-4-02','category':'lifecycle','trigger':'setting_lock_duration\x20add\x20—\x20only-increase\x20mechanism','check':a=>{if(a['setting_lock_duration_add']===undefined)return null;return{'id':'R-S-4-02','level':'MEDIUM','category':'lifecycle','title':'setting_lock_duration\x20can\x20only\x20INCREASE','description':'Adding\x20'+a['setting_lock_duration_add']+'\x20ms\x20to\x20setting_lock_duration.\x20New\x20value\x20=\x20old\x20+\x20input\x20(safe_add).\x20Cannot\x20be\x20decreased\x20—\x20protects\x20customers\x20from\x20owner\x20reducing\x20lock\x20to\x20withdraw\x20compensation_fund\x20faster.','affected_stakeholders':['owner','customer'],'scenario':'Owner\x20extends\x20lock\x20period\x20to\x20build\x20trust','mitigation':'Ensure\x20extension\x20is\x20intentional.\x20Lock\x20affects\x20rewards/compensation_fund_withdraw/compensation_fund_receive.','evidence':'add_ms='+a['setting_lock_duration_add']};}},R_S_4_03={'id':'R-S-4-03','category':'lifecycle','trigger':'machine/arbitrations/order_allocators\x20modification\x20after\x20publish\x20—\x20SDK\x20blocks','check':a=>{if(!a['current_bPublished'])return null;const b=[];if(a['machine']!==undefined)b['push']('machine\x20(306)');if(a['arbitrations']!==undefined)b['push']('arbitrations\x20(308)');if(a['order_allocators']!==undefined)b['push']('order_allocators\x20(313)');if(b['length']>0x0)return{'id':'R-S-4-03','level':'HIGH','category':'lifecycle','title':'Post-publish\x20modification\x20blocked\x20by\x20SDK','description':'Service\x20is\x20published.\x20Cannot\x20modify:\x20'+b['join'](',\x20')+'.\x20SDK\x20checkNotPublished()\x20will\x20abort.\x20To\x20change\x20these\x20fields,\x20clone\x20the\x20Service.','affected_stakeholders':['owner'],'scenario':'Owner\x20attempts\x20to\x20change\x20locked\x20field\x20post-publish','mitigation':'Create\x20a\x20new\x20Service\x20with\x20the\x20desired\x20configuration.\x20Migrate\x20active\x20orders\x20if\x20needed.','evidence':'blocked='+b['join'](',')};return null;}},R_S_4_04={'id':'R-S-4-04','category':'lifecycle','trigger':'sales\x20modification\x20—\x20stock/price\x20changes\x20affect\x20future\x20orders\x20only','check':a=>{if(!a['sales'])return null;return{'id':'R-S-4-04','level':'LOW','category':'lifecycle','title':'Sales\x20modification\x20affects\x20future\x20orders\x20only','description':'Sales\x20add/set/remove/clear\x20changes\x20do\x20NOT\x20affect\x20already-created\x20Orders.\x20Existing\x20Orders\x27\x20Progress\x20continues\x20with\x20the\x20original\x20sale\x20parameters.','affected_stakeholders':['owner','customer'],'scenario':'Owner\x20updates\x20prices\x20mid-campaign','mitigation':'Communicate\x20price/stock\x20changes\x20to\x20customers.\x20Existing\x20orders\x20are\x20unaffected.','evidence':'sales_op='+a['sales']['op']};}},R_S_4_05={'id':'R-S-4-05','category':'lifecycle','trigger':'Service\x20paused\x20(state-only\x20buyer\x20rule)\x20—\x20new\x20orders\x20are\x20suspended','check':a=>{if(!a['current_bPaused'])return null;return{'id':'R-S-4-05','level':'HIGH','category':'lifecycle','title':'Service\x20is\x20paused\x20—\x20ordering\x20suspended','description':'Service.bPaused\x20is\x20true.\x20The\x20merchant\x20has\x20actively\x20paused\x20the\x20Service;\x20new\x20orders\x20cannot\x20be\x20placed\x20until\x20it\x20resumes.','affected_stakeholders':['customer'],'scenario':'Buyer\x20performs\x20due\x20diligence\x20on\x20a\x20paused\x20Service','mitigation':'Confirm\x20with\x20the\x20merchant\x20(via\x20Messenger)\x20when\x20the\x20Service\x20will\x20resume\x20before\x20ordering.','evidence':'bPaused=true'};}},R_S_4_06={'id':'R-S-4-06','category':'lifecycle','trigger':'Service\x20not\x20published\x20(state-only\x20buyer\x20rule)\x20—\x20cannot\x20be\x20ordered','check':a=>{if(a['current_bPublished']!==![])return null;return{'id':'R-S-4-06','level':'HIGH','category':'lifecycle','title':'Service\x20is\x20not\x20published\x20—\x20cannot\x20be\x20ordered','description':'Service.bPublished\x20is\x20false.\x20The\x20Service\x20is\x20still\x20a\x20draft:\x20it\x20is\x20not\x20visible\x20on\x20the\x20market\x20and\x20order_new\x20will\x20fail.','affected_stakeholders':['customer'],'scenario':'Buyer\x20evaluates\x20a\x20draft\x20Service\x20shared\x20out-of-band','mitigation':'Wait\x20until\x20the\x20merchant\x20publishes\x20the\x20Service\x20(publish\x20is\x20irreversible\x20—\x20configuration\x20is\x20locked\x20at\x20that\x20point).','evidence':'bPublished=false'};}},R_S_5_01={'id':'R-S-5-01','category':'cross_object','trigger':'Machine\x20binding\x20—\x20post-publish\x20immutable,\x20Progress\x20inherits','check':a=>{if(a['machine']===undefined)return null;if(a['current_bPublished'])return{'id':'R-S-5-01','level':'HIGH','category':'cross_object','title':'Machine\x20binding\x20immutable\x20post-publish','description':'Service\x20is\x20published;\x20machine\x20cannot\x20be\x20changed.\x20All\x20future\x20Progress\x20objects\x20will\x20use\x20the\x20bound\x20Machine.','affected_stakeholders':['owner'],'scenario':'Owner\x20wants\x20to\x20upgrade\x20workflow\x20post-publish','mitigation':'Create\x20new\x20Service\x20with\x20new\x20Machine.\x20Migrate\x20customers\x20via\x20discounts.','evidence':'machine='+(a['machine']??'(cleared)')};return{'id':'R-S-5-01','level':'MEDIUM','category':'cross_object','title':'Machine\x20binding\x20—\x20verify\x20Machine\x20is\x20published','description':'Binding\x20Machine\x20'+a['machine']+'.\x20Ensure\x20Machine\x20is\x20published\x20(machine::publish)\x20—\x20Service\x20cannot\x20bind\x20unpublished\x20Machine.','affected_stakeholders':['owner'],'scenario':'Owner\x20binds\x20Machine\x20before\x20publishing\x20Service','mitigation':'Verify\x20Machine.bPublished\x20=\x20true\x20before\x20binding.','evidence':'machine='+a['machine']};}},R_S_5_02={'id':'R-S-5-02','category':'cross_object','trigger':'Arbitration\x20binding\x20—\x20required\x20when\x20compensation_fund\x20>\x200','check':a=>{if(!a['arbitrations'])return null;const b=a['current_compensation_fund_balance']??'0';if(BigInt(b)>0x0n&&(a['current_arbitrations_count']??0x0)===0x0)return{'id':'R-S-5-02','level':'HIGH','category':'cross_object','title':'Arbitration\x20required\x20—\x20compensation_fund\x20has\x20balance','description':'compensation_fund\x20balance\x20is\x20'+b+'.\x20Publish\x20will\x20fail\x20(E_ARBITRATION_NOT_SET_WITH_COMPENSATION_FUND)\x20until\x20arbitrations\x20is\x20non-empty.','affected_stakeholders':['owner'],'scenario':'Owner\x20deposits\x20compensation_fund\x20without\x20configuring\x20arbitrations','mitigation':'Add\x20at\x20least\x201\x20Arbitration\x20object\x20before\x20publish.','evidence':'compensation_fund='+b};return null;}},R_S_5_03={'id':'R-S-5-03','category':'cross_object','trigger':'order_allocators\x20binding\x20—\x20publish\x20prerequisite,\x20post-publish\x20immutable','check':a=>{if(a['order_allocators']===undefined)return null;if(a['current_bPublished'])return{'id':'R-S-5-03','level':'HIGH','category':'cross_object','title':'order_allocators\x20immutable\x20post-publish','description':'Service\x20is\x20published;\x20order_allocators\x20cannot\x20be\x20changed.\x20Fund\x20distribution\x20strategy\x20is\x20permanently\x20locked.','affected_stakeholders':['owner'],'scenario':'Owner\x20wants\x20to\x20adjust\x20fee\x20split\x20post-publish','mitigation':'Create\x20new\x20Service\x20with\x20new\x20allocators.\x20Cannot\x20migrate\x20existing\x20Orders.','evidence':'order_allocators='+(a['order_allocators']?'(set)':'(cleared)')};if(a['publish']&&!a['order_allocators'])return{'id':'R-S-5-03','level':'CRITICAL','category':'cross_object','title':'Publish\x20without\x20order_allocators\x20—\x20will\x20fail','description':'Publish\x20will\x20abort\x20with\x20E_NO_ALLOCATOR.\x20order_allocators\x20is\x20a\x20mandatory\x20publish\x20prerequisite.','affected_stakeholders':['owner'],'scenario':'Owner\x20attempts\x20publish\x20without\x20configuring\x20allocators','mitigation':'Set\x20order_allocators\x20before\x20publish.','evidence':'order_allocators=null'};return null;}},R_S_5_04={'id':'R-S-5-04','category':'cross_object','trigger':'Repository/Reward\x20binding\x20—\x20verify\x20object\x20types\x20before\x20adding','check':a=>{if(a['repositories']&&(a['repositories']['op']==='add'||a['repositories']['op']==='set'))return{'id':'R-S-5-04','level':'LOW','category':'cross_object','title':'Repository\x20binding\x20—\x20verify\x20object\x20types','description':'Adding\x20'+a['repositories']['objects']['length']+'\x20repositories.\x20SDK\x20uses\x20queryObjectsWithType\x20to\x20validate\x20each\x20is\x20ObjectType.Repository\x20before\x20binding.','affected_stakeholders':['owner'],'scenario':'Owner\x20adds\x20non-Repository\x20object\x20by\x20mistake','mitigation':'Use\x20LocalMark\x20names\x20or\x20addresses\x20that\x20are\x20confirmed\x20Repository\x20objects.','evidence':'objects='+a['repositories']['objects']['length']};if(a['rewards']&&(a['rewards']['op']==='add'||a['rewards']['op']==='set'))return{'id':'R-S-5-04','level':'LOW','category':'cross_object','title':'Reward\x20binding\x20—\x20verify\x20object\x20types','description':'Adding\x20'+a['rewards']['objects']['length']+'\x20rewards.\x20SDK\x20validates\x20ObjectType.Reward.\x20add\x20is\x20always\x20allowed;\x20only\x20remove/clear\x20are\x20time-locked\x20after\x20publish.','affected_stakeholders':['owner'],'scenario':'Owner\x20adds\x20Reward\x20objects','mitigation':'Verify\x20Reward\x20objects\x20exist\x20and\x20are\x20active.\x20Remember\x20that\x20removing\x20them\x20later\x20requires\x20pause\x20+\x20setting_lock_duration\x20elapsed.','evidence':'objects='+a['rewards']['objects']['length']};return null;}},R_S_5_05={'id':'R-S-5-05','category':'cross_object','trigger':'compensation_fund\x20has\x20balance\x20but\x20no\x20Arbitration\x20bound\x20(state-only\x20buyer\x20rule)','check':a=>{const b=a['current_compensation_fund_balance'];if(b===undefined)return null;let c;try{c=BigInt(b);}catch{return null;}if(c>0x0n&&(a['current_arbitrations_count']??0x0)===0x0)return{'id':'R-S-5-05','level':'HIGH','category':'cross_object','title':'Compensation\x20fund\x20without\x20Arbitration\x20—\x20fund\x20is\x20unclaimable','description':'compensation_fund\x20balance\x20is\x20'+b+'\x20but\x20no\x20Arbitration\x20object\x20is\x20bound.\x20Compensation\x20is\x20claimed\x20via\x20dispute\x20→\x20arbitration()\x20ruling\x20with\x20indemnity\x20→\x20arb_withdraw;\x20without\x20an\x20Arbitration\x20binding\x20there\x20is\x20no\x20dispute\x20path\x20to\x20trigger\x20a\x20payout.','affected_stakeholders':['customer','owner'],'scenario':'Buyer\x20sees\x20a\x20compensation\x20fund\x20but\x20no\x20dispute\x20path\x20to\x20claim\x20it','mitigation':'Require\x20the\x20merchant\x20to\x20bind\x20at\x20least\x20one\x20Arbitration\x20object\x20before\x20ordering.','evidence':'compensation_fund='+b+',\x20arbitrations=0'};return null;}},ALL_RULES=[R_S_1_01,R_S_1_02,R_S_1_03,R_S_1_04,R_S_1_05,R_S_2_01,R_S_2_02,R_S_2_03,R_S_2_04,R_S_2_05,R_S_3_01,R_S_3_02,R_S_3_03,R_S_3_04,R_S_4_01,R_S_4_02,R_S_4_03,R_S_4_04,R_S_4_05,R_S_4_06,R_S_5_01,R_S_5_02,R_S_5_03,R_S_5_04,R_S_5_05];export const SERVICE_RISK_VERSION='1.1.0';const SERVICE_STATE_RULE_IDS=['R-S-4-05','R-S-4-06','R-S-5-05'];export function assessServiceStateRisks(a){const b=new Set(SERVICE_STATE_RULE_IDS),c=[];for(const d of ALL_RULES){if(!b['has'](d['id']))continue;const e=d['check'](a);if(e)c['push'](e);}return c;}export function getAllServiceRiskRules(){return[...ALL_RULES];}export function assessServiceRisks(a){const b=[];for(const f of ALL_RULES){const g=f['check'](a);if(g)b['push'](g);}const c=b['length']===0x0?'LOW':b['some'](h=>h['level']==='CRITICAL')?'CRITICAL':b['some'](h=>h['level']==='HIGH')?'HIGH':b['some'](h=>h['level']==='MEDIUM')?'MEDIUM':'LOW',d={};for(const h of b){d[h['category']]=(d[h['category']]??0x0)+0x1;}const e={};for(const i of b){for(const j of i['affected_stakeholders']){if(!e[j])e[j]=[];e[j]['push'](i['id']+':\x20'+i['mitigation']);}}return{'summary':'Assessed\x20'+b['length']+'\x20risk(s)\x20across\x20'+Object['keys'](d)['length']+'\x20categories','risks':b,'overall_risk':c,'risks_by_category':d,'stakeholder_advice':e,'needs_human_review':b['some'](k=>k['level']==='CRITICAL'||k['level']==='HIGH')};}
@@ -1 +1 @@
1
- import{GUARD_TEMPLATES,fillGuardTemplate}from'./guard-templates.js';import{MACHINE_TEMPLATES,fillTemplate as a195a}from'./machine-templates.js';import{SERVICE_TEMPLATES,fillServiceTemplate}from'./service-templates.js';import{ORDER_TEMPLATES,fillTemplate as a195b}from'./order-templates.js';import{PROGRESS_TEMPLATES,fillProgressTemplate}from'./progress-templates.js';import{ARBITRATION_TEMPLATES,fillTemplate as a195c}from'./arbitration-templates.js';import{TREASURY_TEMPLATES,fillTemplate as a195d}from'./treasury-templates.js';import{PERMISSION_TEMPLATES,fillTemplate as a195e}from'./permission-templates.js';import{PASSPORT_TEMPLATES,fillTemplate as a195f}from'./passport-templates.js';import{ALLOCATION_TEMPLATES,fillTemplate as a195g}from'./allocation-templates.js';import{CONTACT_TEMPLATES,fillTemplate as a195h}from'./contact-templates.js';import{REWARD_TEMPLATES}from'./reward-templates.js';export const TEMPLATE_REGISTRY_VERSION=0x1;export const TEMPLATE_OBJECT_TYPES=['guard','machine','service','order','progress','arbitration','treasury','permission','passport','allocation','reward','contact'];function normalizeParam(a){return{'name':a['name'],'type':a['type'],'description':a['description']??'','required':a['required'],...a['default']!==undefined?{'default':a['default']}:{},...a['constraint']!==undefined?{'constraint':a['constraint']}:{}};}function guardMeta(a){return{'id':a['id'],'object_type':'guard','name':a['name'],'description':a['description'],'scenes':[a['scene_id']],'industries':a['applicable_industries'],'instantiable':!![],'parameters':a['parameters']['map'](b=>normalizeParam(b))};}function machineMeta(a){return{'id':a['id'],'object_type':'machine','name':a['name'],'description':a['description'],'scenes':[a['scene_id']],'industries':a['applicable_industries'],'instantiable':!![],'parameters':a['parameters']['map'](b=>normalizeParam(b))};}function bodyMeta(a,b,c,d){return{'id':a['id'],'object_type':b,'name':a['name'],'description':a['description'],'scenes':c,'industries':d,'instantiable':!![],'parameters':a['params']['map'](e=>normalizeParam(e))};}function rewardMeta(a){return{'id':a['type'],'object_type':'reward','name':a['name'],'description':a['description'],'scenes':[],'industries':[],'instantiable':![],'parameters':a['parameters']['map'](b=>normalizeParam(b))};}let REGISTRY=null,ID_COLLISIONS=[];function buildRegistry(){const a=new Map(),b=[],c=d=>{if(a['has'](d['meta']['id'])){b['push'](d['meta']['id']);return;}a['set'](d['meta']['id'],d);};for(const d of GUARD_TEMPLATES){c({'meta':guardMeta(d),'raw':d,'notes':d['creation_notes']});}for(const e of MACHINE_TEMPLATES){c({'meta':machineMeta(e),'raw':e,'notes':e['creation_notes']});}for(const f of SERVICE_TEMPLATES){c({'meta':bodyMeta(f,'service',f['applicable_scenes'],f['industry_tags']),'raw':f,'notes':f['notes']});}for(const g of ORDER_TEMPLATES){c({'meta':bodyMeta(g,'order',g['applicable_scenes'],g['industry_tags']),'raw':g,'notes':g['notes']});}for(const h of PROGRESS_TEMPLATES){c({'meta':bodyMeta(h,'progress',h['applicable_scenes'],h['industry_tags']),'raw':h,'notes':h['notes']});}for(const i of ARBITRATION_TEMPLATES){c({'meta':bodyMeta(i,'arbitration',i['applicable_scenes'],i['industry_tags']),'raw':i,'notes':i['notes']});}for(const j of TREASURY_TEMPLATES){c({'meta':bodyMeta(j,'treasury',j['applicable_scenes'],j['industry_tags']),'raw':j,'notes':j['notes']});}for(const k of PERMISSION_TEMPLATES){c({'meta':bodyMeta(k,'permission',k['applicable_scenes'],k['industry_tags']),'raw':k,'notes':k['notes']});}for(const l of PASSPORT_TEMPLATES){c({'meta':bodyMeta(l,'passport',l['applicable_scenarios'],l['industry_tags']),'raw':l,'notes':l['notes']});}for(const m of ALLOCATION_TEMPLATES){c({'meta':bodyMeta(m,'allocation',m['applicable_scenes'],m['industry_tags']),'raw':m,'notes':m['notes']});}for(const n of REWARD_TEMPLATES){c({'meta':rewardMeta(n),'raw':n,'guidance':{'guardCondition':n['guardCondition'],'amountRange':n['amountRange'],'allocationStrategy':n['allocationStrategy'],'example':n['example'],'relevantGuardOps':n['relevantGuardOps']}});}for(const o of CONTACT_TEMPLATES){c({'meta':bodyMeta(o,'contact',o['applicable_scenes'],o['industry_tags']),'raw':o,'notes':o['notes']});}return ID_COLLISIONS=b,a;}function registry(){return!REGISTRY&&(REGISTRY=buildRegistry()),REGISTRY;}export function getTemplateIdCollisions(){return registry(),ID_COLLISIONS;}export function getTemplateCounts(){const a=Object['fromEntries'](TEMPLATE_OBJECT_TYPES['map'](b=>[b,0x0]));for(const b of registry()['values']()){a[b['meta']['object_type']]+=0x1;}return a;}export function listTemplates(a){const b=[...registry()['values']()]['map'](c=>c['meta']);return a?b['filter'](c=>c['object_type']===a):b;}export function getTemplateDetail(a){const b=registry()['get'](a);if(!b)return null;return{...b['meta'],'raw':b['raw'],...b['notes']?{'notes':b['notes']}:{},...b['guidance']?{'guidance':b['guidance']}:{}};}export function findTemplateObjectType(a){return registry()['get'](a)?.['meta']['object_type']??null;}export function instantiateTemplate(a,b){const c=registry()['get'](a);if(!c)return{'ok':![],'object_type':null,'template_id':a,'error':'Template\x20not\x20found:\x20'+a+'.\x20Use\x20get_templates\x20without\x20\x27template\x27\x20to\x20list\x20all\x20template\x20ids.'};const d=c['meta']['object_type'];if(!c['meta']['instantiable'])return{'ok':![],'object_type':d,'template_id':a,'error':'Reward\x20templates\x20are\x20guidance-only\x20(prose\x20guard\x20conditions)\x20and\x20cannot\x20be\x20'+'instantiated\x20into\x20executable\x20JSON.\x20Use\x20the\x20guidance\x20payload\x20to\x20design\x20the\x20'+'Reward\x20+\x20Guard\x20manually.','guidance':c['guidance']};switch(d){case'guard':{const e=fillGuardTemplate(a,b);if(!e['ok'])return{'ok':![],'object_type':d,'template_id':a,'error':e['error'],...e['missing']?{'missing_params':e['missing']}:{}};return{'ok':!![],'object_type':d,'template_id':a,'body':{'table':e['table'],'root':e['root']},...c['notes']?{'notes':c['notes']}:{}};}case'machine':{const f=a195a(a,b);if(!f['success'])return{'ok':![],'object_type':d,'template_id':a,'error':f['validation_errors']?.['join'](';\x20')??'Machine\x20template\x20fill\x20failed',...f['missing_params']?{'missing_params':f['missing_params']}:{}};return{'ok':!![],'object_type':d,'template_id':a,'body':{'nodes':f['filled_nodes'],'pairs':f['filled_pairs']},...c['notes']?{'notes':c['notes']}:{}};}case'service':{const g=fillServiceTemplate(a,b);if(!g['ok'])return{'ok':![],'object_type':d,'template_id':a,'error':g['error']??'Service\x20template\x20fill\x20failed',...g['missing_required']?{'missing_params':g['missing_required']}:{}};return{'ok':!![],'object_type':d,'template_id':a,'body':g['body'],...c['notes']?{'notes':c['notes']}:{}};}case'order':case'arbitration':case'treasury':case'permission':case'passport':case'allocation':case'progress':case'contact':{const h=fillBodyTemplate(d,a,b);if(!h['ok'])return{'ok':![],'object_type':d,'template_id':a,'error':h['error']};return{'ok':!![],'object_type':d,'template_id':a,'body':h['body'],...c['notes']?{'notes':c['notes']}:{}};}default:return{'ok':![],'object_type':d,'template_id':a,'error':'Instantiation\x20not\x20supported\x20for\x20object_type\x20\x27'+d+'\x27'};}}function fillBodyTemplate(a,b,c){switch(a){case'order':return a195b(b,c);case'arbitration':return a195c(b,c);case'treasury':return a195d(b,c);case'permission':return a195e(b,c);case'passport':return a195f(b,c);case'allocation':return a195g(b,c);case'progress':return fillProgressTemplate(b,c);case'contact':return a195h(b,c);default:return{'ok':![],'error':'No\x20body-template\x20fill\x20for\x20\x27'+a+'\x27'};}}
1
+ import{GUARD_TEMPLATES,fillGuardTemplate}from'./guard-templates.js';import{MACHINE_TEMPLATES,fillTemplate as a224a}from'./machine-templates.js';import{SERVICE_TEMPLATES,fillServiceTemplate}from'./service-templates.js';import{ORDER_TEMPLATES,fillTemplate as a224b}from'./order-templates.js';import{PROGRESS_TEMPLATES,fillProgressTemplate}from'./progress-templates.js';import{ARBITRATION_TEMPLATES,fillTemplate as a224c}from'./arbitration-templates.js';import{TREASURY_TEMPLATES,fillTemplate as a224d}from'./treasury-templates.js';import{PERMISSION_TEMPLATES,fillTemplate as a224e}from'./permission-templates.js';import{PASSPORT_TEMPLATES,fillTemplate as a224f}from'./passport-templates.js';import{ALLOCATION_TEMPLATES,fillTemplate as a224g}from'./allocation-templates.js';import{CONTACT_TEMPLATES,fillTemplate as a224h}from'./contact-templates.js';import{REWARD_TEMPLATES}from'./reward-templates.js';export const TEMPLATE_REGISTRY_VERSION=0x1;export const TEMPLATE_OBJECT_TYPES=['guard','machine','service','order','progress','arbitration','treasury','permission','passport','allocation','reward','contact'];function normalizeParam(a){return{'name':a['name'],'type':a['type'],'description':a['description']??'','required':a['required'],...a['default']!==undefined?{'default':a['default']}:{},...a['constraint']!==undefined?{'constraint':a['constraint']}:{}};}function guardMeta(a){return{'id':a['id'],'object_type':'guard','name':a['name'],'description':a['description'],'scenes':[a['scene_id']],'industries':a['applicable_industries'],'instantiable':!![],'parameters':a['parameters']['map'](b=>normalizeParam(b))};}function machineMeta(a){return{'id':a['id'],'object_type':'machine','name':a['name'],'description':a['description'],'scenes':[a['scene_id']],'industries':a['applicable_industries'],'instantiable':!![],'parameters':a['parameters']['map'](b=>normalizeParam(b))};}function bodyMeta(a,b,c,d){return{'id':a['id'],'object_type':b,'name':a['name'],'description':a['description'],'scenes':c,'industries':d,'instantiable':!![],'parameters':a['params']['map'](e=>normalizeParam(e))};}function rewardMeta(a){return{'id':a['type'],'object_type':'reward','name':a['name'],'description':a['description'],'scenes':[],'industries':[],'instantiable':![],'parameters':a['parameters']['map'](b=>normalizeParam(b))};}let REGISTRY=null,ID_COLLISIONS=[];function buildRegistry(){const a=new Map(),b=[],c=d=>{if(a['has'](d['meta']['id'])){b['push'](d['meta']['id']);return;}a['set'](d['meta']['id'],d);};for(const d of GUARD_TEMPLATES){c({'meta':guardMeta(d),'raw':d,'notes':d['creation_notes']});}for(const e of MACHINE_TEMPLATES){c({'meta':machineMeta(e),'raw':e,'notes':e['creation_notes']});}for(const f of SERVICE_TEMPLATES){c({'meta':bodyMeta(f,'service',f['applicable_scenes'],f['industry_tags']),'raw':f,'notes':f['notes']});}for(const g of ORDER_TEMPLATES){c({'meta':bodyMeta(g,'order',g['applicable_scenes'],g['industry_tags']),'raw':g,'notes':g['notes']});}for(const h of PROGRESS_TEMPLATES){c({'meta':bodyMeta(h,'progress',h['applicable_scenes'],h['industry_tags']),'raw':h,'notes':h['notes']});}for(const i of ARBITRATION_TEMPLATES){c({'meta':bodyMeta(i,'arbitration',i['applicable_scenes'],i['industry_tags']),'raw':i,'notes':i['notes']});}for(const j of TREASURY_TEMPLATES){c({'meta':bodyMeta(j,'treasury',j['applicable_scenes'],j['industry_tags']),'raw':j,'notes':j['notes']});}for(const k of PERMISSION_TEMPLATES){c({'meta':bodyMeta(k,'permission',k['applicable_scenes'],k['industry_tags']),'raw':k,'notes':k['notes']});}for(const l of PASSPORT_TEMPLATES){c({'meta':bodyMeta(l,'passport',l['applicable_scenarios'],l['industry_tags']),'raw':l,'notes':l['notes']});}for(const m of ALLOCATION_TEMPLATES){c({'meta':bodyMeta(m,'allocation',m['applicable_scenes'],m['industry_tags']),'raw':m,'notes':m['notes']});}for(const n of REWARD_TEMPLATES){c({'meta':rewardMeta(n),'raw':n,'guidance':{'guardCondition':n['guardCondition'],'amountRange':n['amountRange'],'allocationStrategy':n['allocationStrategy'],'example':n['example'],'relevantGuardOps':n['relevantGuardOps']}});}for(const o of CONTACT_TEMPLATES){c({'meta':bodyMeta(o,'contact',o['applicable_scenes'],o['industry_tags']),'raw':o,'notes':o['notes']});}return ID_COLLISIONS=b,a;}function registry(){return!REGISTRY&&(REGISTRY=buildRegistry()),REGISTRY;}export function getTemplateIdCollisions(){return registry(),ID_COLLISIONS;}export function getTemplateCounts(){const a=Object['fromEntries'](TEMPLATE_OBJECT_TYPES['map'](b=>[b,0x0]));for(const b of registry()['values']()){a[b['meta']['object_type']]+=0x1;}return a;}export function listTemplates(a){const b=[...registry()['values']()]['map'](c=>c['meta']);return a?b['filter'](c=>c['object_type']===a):b;}export function getTemplateDetail(a){const b=registry()['get'](a);if(!b)return null;return{...b['meta'],'raw':b['raw'],...b['notes']?{'notes':b['notes']}:{},...b['guidance']?{'guidance':b['guidance']}:{}};}export function findTemplateObjectType(a){return registry()['get'](a)?.['meta']['object_type']??null;}export function instantiateTemplate(a,b){const c=registry()['get'](a);if(!c)return{'ok':![],'object_type':null,'template_id':a,'error':'Template\x20not\x20found:\x20'+a+'.\x20Use\x20get_templates\x20without\x20\x27template\x27\x20to\x20list\x20all\x20template\x20ids.'};const d=c['meta']['object_type'];if(!c['meta']['instantiable'])return{'ok':![],'object_type':d,'template_id':a,'error':'Reward\x20templates\x20are\x20guidance-only\x20(prose\x20guard\x20conditions)\x20and\x20cannot\x20be\x20'+'instantiated\x20into\x20executable\x20JSON.\x20Use\x20the\x20guidance\x20payload\x20to\x20design\x20the\x20'+'Reward\x20+\x20Guard\x20manually.','guidance':c['guidance']};switch(d){case'guard':{const e=fillGuardTemplate(a,b);if(!e['ok'])return{'ok':![],'object_type':d,'template_id':a,'error':e['error'],...e['missing']?{'missing_params':e['missing']}:{}};return{'ok':!![],'object_type':d,'template_id':a,'body':{'table':e['table'],'root':e['root']},...c['notes']?{'notes':c['notes']}:{}};}case'machine':{const f=a224a(a,b);if(!f['success'])return{'ok':![],'object_type':d,'template_id':a,'error':f['validation_errors']?.['join'](';\x20')??'Machine\x20template\x20fill\x20failed',...f['missing_params']?{'missing_params':f['missing_params']}:{}};return{'ok':!![],'object_type':d,'template_id':a,'body':{'nodes':f['filled_nodes'],'pairs':f['filled_pairs']},...c['notes']?{'notes':c['notes']}:{}};}case'service':{const g=fillServiceTemplate(a,b);if(!g['ok'])return{'ok':![],'object_type':d,'template_id':a,'error':g['error']??'Service\x20template\x20fill\x20failed',...g['missing_required']?{'missing_params':g['missing_required']}:{}};return{'ok':!![],'object_type':d,'template_id':a,'body':g['body'],...c['notes']?{'notes':c['notes']}:{}};}case'order':case'arbitration':case'treasury':case'permission':case'passport':case'allocation':case'progress':case'contact':{const h=fillBodyTemplate(d,a,b);if(!h['ok'])return{'ok':![],'object_type':d,'template_id':a,'error':h['error']};return{'ok':!![],'object_type':d,'template_id':a,'body':h['body'],...c['notes']?{'notes':c['notes']}:{}};}default:return{'ok':![],'object_type':d,'template_id':a,'error':'Instantiation\x20not\x20supported\x20for\x20object_type\x20\x27'+d+'\x27'};}}function fillBodyTemplate(a,b,c){switch(a){case'order':return a224b(b,c);case'arbitration':return a224c(b,c);case'treasury':return a224d(b,c);case'permission':return a224e(b,c);case'passport':return a224f(b,c);case'allocation':return a224g(b,c);case'progress':return fillProgressTemplate(b,c);case'contact':return a224h(b,c);default:return{'ok':![],'error':'No\x20body-template\x20fill\x20for\x20\x27'+a+'\x27'};}}