@wowok/agent-mcp 3.4.1 → 3.4.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 (323) hide show
  1. package/dist/.build-stamp.json +5 -0
  2. package/dist/chain-semantics/composition-truth.js +1 -1
  3. package/dist/chain-semantics/eval-order.js +1 -1
  4. package/dist/chain-semantics/field-capability.js +1 -1
  5. package/dist/chain-semantics/freeze-map.js +1 -1
  6. package/dist/chain-semantics/fund-flow.js +1 -1
  7. package/dist/chain-semantics/guard-verbs.js +1 -1
  8. package/dist/chain-semantics/object-graph.js +1 -1
  9. package/dist/composition/audit.js +1 -1
  10. package/dist/composition/compile.d.ts +10 -3
  11. package/dist/composition/compile.js +1 -1
  12. package/dist/composition/emit-phases.d.ts +30 -2
  13. package/dist/composition/emit-phases.js +1 -1
  14. package/dist/composition/guard-fill.d.ts +8 -0
  15. package/dist/composition/guard-fill.js +1 -1
  16. package/dist/composition/inflight.js +1 -1
  17. package/dist/composition/input-normalize.js +1 -1
  18. package/dist/composition/materialize.d.ts +2 -0
  19. package/dist/composition/materialize.js +1 -1
  20. package/dist/composition/mode-gates.js +1 -1
  21. package/dist/composition/param-disclosure.js +1 -1
  22. package/dist/composition/plan-retry-ledger.d.ts +16 -0
  23. package/dist/composition/plan-retry-ledger.js +1 -1
  24. package/dist/composition/plan.d.ts +15 -1
  25. package/dist/composition/plan.js +1 -1
  26. package/dist/config/config-audit.spec.js +1 -1
  27. package/dist/config/judgment.d.ts +5 -0
  28. package/dist/config/judgment.js +1 -1
  29. package/dist/evaluation/builtins/arbitration-score.d.ts +1 -0
  30. package/dist/evaluation/builtins/arbitration-score.js +1 -1
  31. package/dist/evaluation/builtins/demand-match.js +1 -1
  32. package/dist/evaluation/builtins/graph-service.d.ts +8 -0
  33. package/dist/evaluation/builtins/graph-service.js +1 -1
  34. package/dist/evaluation/capability.d.ts +9 -0
  35. package/dist/evaluation/engine.js +1 -1
  36. package/dist/evaluation/extract.d.ts +9 -1
  37. package/dist/evaluation/extract.js +1 -1
  38. package/dist/evaluation/match-operation.js +1 -1
  39. package/dist/evaluation/match-policy.d.ts +5 -3
  40. package/dist/evaluation/match-policy.js +1 -1
  41. package/dist/evaluation/standards.d.ts +1 -0
  42. package/dist/evaluation/standards.js +1 -1
  43. package/dist/evaluation/structured-lines.js +1 -1
  44. package/dist/evaluation/types.d.ts +1 -0
  45. package/dist/extensions/capability.js +1 -1
  46. package/dist/extensions/industry-pack.js +1 -1
  47. package/dist/extensions/modes.js +1 -1
  48. package/dist/harness/recover.js +1 -1
  49. package/dist/index.js +1 -1
  50. package/dist/intent/types.d.ts +1 -1
  51. package/dist/intent/types.js +1 -1
  52. package/dist/knowledge/allocation-ledger.js +1 -1
  53. package/dist/knowledge/allocator-rail-verifier.d.ts +17 -1
  54. package/dist/knowledge/allocator-rail-verifier.js +1 -1
  55. package/dist/knowledge/arb-fund-facts.d.ts +7 -0
  56. package/dist/knowledge/arb-fund-facts.js +1 -1
  57. package/dist/knowledge/arbitration-rail-verifier.d.ts +35 -0
  58. package/dist/knowledge/arbitration-rail-verifier.js +1 -0
  59. package/dist/knowledge/arbitration-templates.js +1 -1
  60. package/dist/knowledge/audit-rules.d.ts +13 -1
  61. package/dist/knowledge/audit-rules.js +1 -1
  62. package/dist/knowledge/baselines/judgment-baselines.json +1 -0
  63. package/dist/knowledge/baselines/rules/guard.json +7 -6
  64. package/dist/knowledge/baselines/rules/progress.json +4 -4
  65. package/dist/knowledge/baselines/rules/reward.json +118 -3
  66. package/dist/knowledge/builtin-templates.d.ts +19 -2
  67. package/dist/knowledge/builtin-templates.js +1 -1
  68. package/dist/knowledge/chain-query-registry.d.ts +14 -0
  69. package/dist/knowledge/chain-query-registry.js +1 -0
  70. package/dist/knowledge/event-semantics.js +1 -1
  71. package/dist/knowledge/fee-param-bindings.d.ts +2 -0
  72. package/dist/knowledge/fee-param-bindings.js +1 -1
  73. package/dist/knowledge/getting-started.js +1 -1
  74. package/dist/knowledge/guard-binding-table.js +1 -1
  75. package/dist/knowledge/guard-binding-verifier.d.ts +7 -0
  76. package/dist/knowledge/guard-binding-verifier.js +1 -1
  77. package/dist/knowledge/guard-bindings.js +1 -1
  78. package/dist/knowledge/guard-design-patterns.d.ts +1 -1
  79. package/dist/knowledge/guard-design-patterns.js +1 -1
  80. package/dist/knowledge/guard-field-cognition.js +1 -1
  81. package/dist/knowledge/guard-host-context.js +1 -1
  82. package/dist/knowledge/guard-lint.js +1 -1
  83. package/dist/knowledge/guard-node-gates.d.ts +3 -1
  84. package/dist/knowledge/guard-node-gates.js +1 -1
  85. package/dist/knowledge/guard-puzzle.js +1 -1
  86. package/dist/knowledge/guard-render.js +1 -1
  87. package/dist/knowledge/guard-risk.js +1 -1
  88. package/dist/knowledge/guard-templates.d.ts +2 -1
  89. package/dist/knowledge/guard-templates.js +1 -1
  90. package/dist/knowledge/guard-translation.js +1 -1
  91. package/dist/knowledge/index.d.ts +2 -0
  92. package/dist/knowledge/index.js +1 -1
  93. package/dist/knowledge/industry-registry.js +1 -1
  94. package/dist/knowledge/jsonrpc-enum.js +1 -1
  95. package/dist/knowledge/knob-docs.js +1 -1
  96. package/dist/knowledge/param-schema.d.ts +1 -1
  97. package/dist/knowledge/param-schema.js +1 -1
  98. package/dist/knowledge/param-tiers.d.ts +2 -0
  99. package/dist/knowledge/param-tiers.js +1 -1
  100. package/dist/knowledge/path-oracle/products/food-delivery.js +1 -1
  101. package/dist/knowledge/pattern-resolutions.d.ts +2 -0
  102. package/dist/knowledge/pattern-resolutions.js +1 -1
  103. package/dist/knowledge/product-detail-source.d.ts +37 -0
  104. package/dist/knowledge/product-detail-source.js +1 -0
  105. package/dist/knowledge/product-doc-b5.d.ts +16 -0
  106. package/dist/knowledge/product-doc-b5.js +1 -0
  107. package/dist/knowledge/progress-ledger.js +1 -1
  108. package/dist/knowledge/projection.spec.js +1 -1
  109. package/dist/knowledge/publish-gate.d.ts +20 -0
  110. package/dist/knowledge/publish-gate.js +1 -0
  111. package/dist/knowledge/publish-readiness.d.ts +25 -0
  112. package/dist/knowledge/publish-readiness.js +1 -0
  113. package/dist/knowledge/publish-surface-contract.d.ts +16 -0
  114. package/dist/knowledge/publish-surface-contract.js +1 -0
  115. package/dist/knowledge/rail-exit-satisfiability.d.ts +25 -0
  116. package/dist/knowledge/rail-exit-satisfiability.js +1 -0
  117. package/dist/knowledge/reward-ledger.d.ts +1 -1
  118. package/dist/knowledge/reward-ledger.js +1 -1
  119. package/dist/knowledge/reward-risk.d.ts +1 -1
  120. package/dist/knowledge/reward-risk.js +1 -1
  121. package/dist/knowledge/scenario-modes.js +1 -1
  122. package/dist/knowledge/service-ledger.d.ts +3 -1
  123. package/dist/knowledge/service-ledger.js +1 -1
  124. package/dist/knowledge/template-loader.d.ts +41 -2
  125. package/dist/knowledge/template-loader.js +1 -1
  126. package/dist/knowledge/template-registry.js +1 -1
  127. package/dist/knowledge/template-scanner.d.ts +17 -0
  128. package/dist/knowledge/template-scanner.js +1 -1
  129. package/dist/knowledge/template-test-profiles.js +1 -1
  130. package/dist/knowledge/workflow-guidance.d.ts +4 -0
  131. package/dist/knowledge/workflow-guidance.js +1 -1
  132. package/dist/monitor/MonitorLoop.js +1 -1
  133. package/dist/monitor/normalize.d.ts +1 -1
  134. package/dist/monitor/normalize.js +1 -1
  135. package/dist/monitor/types.js +1 -1
  136. package/dist/participation/customer-interest.d.ts +4 -0
  137. package/dist/participation/customer-interest.js +1 -1
  138. package/dist/participation/game-context.js +1 -1
  139. package/dist/participation/node-action-advisor.d.ts +4 -0
  140. package/dist/participation/node-action-advisor.js +1 -1
  141. package/dist/participation/radar-core.js +1 -1
  142. package/dist/participation/time-window.d.ts +11 -0
  143. package/dist/participation/time-window.js +1 -1
  144. package/dist/playbooks/service-build/business-puzzle.js +1 -1
  145. package/dist/playbooks/service-build/machine-panorama.js +1 -1
  146. package/dist/playbooks/service-build/merchant-guide.d.ts +28 -3
  147. package/dist/playbooks/service-build/merchant-guide.js +1 -1
  148. package/dist/playbooks/service-build/object-panorama.d.ts +4 -0
  149. package/dist/playbooks/service-build/object-panorama.js +1 -1
  150. package/dist/playbooks/service-build/participation-radar.js +1 -1
  151. package/dist/playbooks/service-build/relationship-profile.js +1 -1
  152. package/dist/playbooks/service-build/service-panorama.js +1 -1
  153. package/dist/playbooks/service-build/service-quote.js +1 -1
  154. package/dist/review/index.js +1 -1
  155. package/dist/review/order.js +1 -1
  156. package/dist/safety/confirm-gate.js +1 -1
  157. package/dist/schema/benchmark-migration/index.d.ts +24 -0
  158. package/dist/schema/benchmark-migration/index.js +1 -1
  159. package/dist/schema/call/allocation.d.ts +11 -7
  160. package/dist/schema/call/allocation.js +1 -1
  161. package/dist/schema/call/arbitration.d.ts +4 -0
  162. package/dist/schema/call/arbitration.js +1 -1
  163. package/dist/schema/call/base.d.ts +28 -0
  164. package/dist/schema/call/base.js +1 -1
  165. package/dist/schema/call/bridge.d.ts +21 -0
  166. package/dist/schema/call/contact.d.ts +4 -0
  167. package/dist/schema/call/demand.d.ts +4 -0
  168. package/dist/schema/call/guard.d.ts +12 -0
  169. package/dist/schema/call/handler.d.ts +1 -0
  170. package/dist/schema/call/handler.js +1 -1
  171. package/dist/schema/call/machine.d.ts +16 -8
  172. package/dist/schema/call/normalize-error.d.ts +1 -0
  173. package/dist/schema/call/normalize-error.js +1 -0
  174. package/dist/schema/call/order.d.ts +7 -3
  175. package/dist/schema/call/order.js +1 -1
  176. package/dist/schema/call/payment.d.ts +7 -3
  177. package/dist/schema/call/permission.d.ts +4 -0
  178. package/dist/schema/call/personal.d.ts +4 -0
  179. package/dist/schema/call/progress.d.ts +4 -0
  180. package/dist/schema/call/progress.js +1 -1
  181. package/dist/schema/call/proof.d.ts +8 -0
  182. package/dist/schema/call/proof.js +1 -1
  183. package/dist/schema/call/receipt.js +1 -1
  184. package/dist/schema/call/repository.d.ts +4 -0
  185. package/dist/schema/call/reward.d.ts +6 -2
  186. package/dist/schema/call/reward.js +1 -1
  187. package/dist/schema/call/semantic.d.ts +2 -2
  188. package/dist/schema/call/semantic.js +1 -1
  189. package/dist/schema/call/service.d.ts +21 -7
  190. package/dist/schema/call/service.js +1 -1
  191. package/dist/schema/call/treasury.d.ts +10 -6
  192. package/dist/schema/common/index.js +1 -1
  193. package/dist/schema/envelope-unify.d.ts +1 -0
  194. package/dist/schema/envelope-unify.js +1 -1
  195. package/dist/schema/evaluation/index.d.ts +43 -0
  196. package/dist/schema/evaluation/index.js +1 -1
  197. package/dist/schema/goal/index.d.ts +14 -2
  198. package/dist/schema/goal/planning.d.ts +18 -0
  199. package/dist/schema/goal/planning.js +1 -1
  200. package/dist/schema/intent-radar/index.d.ts +12 -0
  201. package/dist/schema/intent-radar/index.js +1 -1
  202. package/dist/schema/keeper/index.d.ts +1 -0
  203. package/dist/schema/local/index.d.ts +10 -0
  204. package/dist/schema/local/index.js +1 -1
  205. package/dist/schema/local/wip.js +1 -1
  206. package/dist/schema/messenger/index.d.ts +1 -0
  207. package/dist/schema/messenger/index.js +1 -1
  208. package/dist/schema/operations.d.ts +98 -13
  209. package/dist/schema/operations.js +1 -1
  210. package/dist/schema/persona/index.d.ts +22 -0
  211. package/dist/schema/query/bi.d.ts +28 -2
  212. package/dist/schema/query/bi.js +1 -1
  213. package/dist/schema/query/index.d.ts +67 -61
  214. package/dist/schema/query/index.js +1 -1
  215. package/dist/schema/schema-version.js +1 -1
  216. package/dist/schema/workflow/index.js +1 -1
  217. package/dist/schema-query-impl/index.d.ts +1 -0
  218. package/dist/schema-query-impl/index.js +1 -1
  219. package/dist/schemas/account_operation.output.json +2 -1
  220. package/dist/schemas/benchmark_migration_operation.output.json +74 -0
  221. package/dist/schemas/benchmark_migration_operation.schema.json +33 -1
  222. package/dist/schemas/bridge_operation.output.json +2 -1
  223. package/dist/schemas/bridge_operation.schema.json +40 -0
  224. package/dist/schemas/evaluation_operation.output.json +96 -0
  225. package/dist/schemas/evaluation_operation.schema.json +39 -0
  226. package/dist/schemas/goal_operation.schema.json +32 -0
  227. package/dist/schemas/guard2file.schema.json +8 -0
  228. package/dist/schemas/index.json +1 -1
  229. package/dist/schemas/intent_radar.output.json +10 -2
  230. package/dist/schemas/intent_radar.schema.json +5 -1
  231. package/dist/schemas/keeper_operation.output.json +2 -1
  232. package/dist/schemas/local_cache_operation.output.json +2 -1
  233. package/dist/schemas/local_history_operation.output.json +2 -1
  234. package/dist/schemas/local_info_operation.output.json +2 -1
  235. package/dist/schemas/local_mark_operation.output.json +2 -1
  236. package/dist/schemas/local_mark_operation.schema.json +10 -1
  237. package/dist/schemas/machineNode2file.schema.json +8 -0
  238. package/dist/schemas/messenger_operation.output.json +2 -1
  239. package/dist/schemas/messenger_operation.schema.json +2 -1
  240. package/dist/schemas/monitor_events.output.json +2 -1
  241. package/dist/schemas/monitor_subscription.output.json +2 -1
  242. package/dist/schemas/onchain_events.output.json +206 -13
  243. package/dist/schemas/onchain_events.schema.json +16 -0
  244. package/dist/schemas/onchain_operations.output.json +22 -3
  245. package/dist/schemas/onchain_operations.schema.json +982 -327
  246. package/dist/schemas/onchain_operations_allocation.schema.json +20 -13
  247. package/dist/schemas/onchain_operations_arbitration.schema.json +9 -1
  248. package/dist/schemas/onchain_operations_contact.schema.json +8 -0
  249. package/dist/schemas/onchain_operations_demand.schema.json +8 -0
  250. package/dist/schemas/onchain_operations_gen_passport.schema.json +8 -0
  251. package/dist/schemas/onchain_operations_gen_proof.schema.json +8 -0
  252. package/dist/schemas/onchain_operations_guard.schema.json +655 -115
  253. package/dist/schemas/onchain_operations_machine.schema.json +11 -3
  254. package/dist/schemas/onchain_operations_order.schema.json +14 -11
  255. package/dist/schemas/onchain_operations_payment.schema.json +12 -9
  256. package/dist/schemas/onchain_operations_permission.schema.json +8 -0
  257. package/dist/schemas/onchain_operations_personal.schema.json +8 -0
  258. package/dist/schemas/onchain_operations_progress.schema.json +9 -1
  259. package/dist/schemas/onchain_operations_proof.schema.json +9 -1
  260. package/dist/schemas/onchain_operations_repository.schema.json +8 -0
  261. package/dist/schemas/onchain_operations_reward.schema.json +14 -11
  262. package/dist/schemas/onchain_operations_service.schema.json +25 -12
  263. package/dist/schemas/onchain_operations_treasury.schema.json +17 -19
  264. package/dist/schemas/onchain_table_data.output.json +52 -10
  265. package/dist/schemas/persona_operation.output.json +57 -0
  266. package/dist/schemas/persona_operation.schema.json +9 -0
  267. package/dist/schemas/query_toolkit.output.json +326 -23
  268. package/dist/schemas/query_toolkit.schema.json +18 -5
  269. package/dist/schemas/wip_file.output.json +2 -2
  270. package/dist/schemas/wip_file.schema.json +2 -2
  271. package/dist/schemas/workflow_operation.schema.json +1 -1
  272. package/dist/tools/error-catalog.d.ts +17 -0
  273. package/dist/tools/error-catalog.js +1 -0
  274. package/dist/tools/handlers/benchmark-migration.d.ts +29 -8
  275. package/dist/tools/handlers/benchmark-migration.js +1 -1
  276. package/dist/tools/handlers/config.js +1 -1
  277. package/dist/tools/handlers/entry-edge-recipe.d.ts +101 -0
  278. package/dist/tools/handlers/entry-edge-recipe.js +1 -0
  279. package/dist/tools/handlers/escrow-deficit.d.ts +10 -0
  280. package/dist/tools/handlers/escrow-deficit.js +1 -0
  281. package/dist/tools/handlers/evaluation.js +1 -1
  282. package/dist/tools/handlers/fund-rail-recipe.d.ts +10 -0
  283. package/dist/tools/handlers/fund-rail-recipe.js +1 -0
  284. package/dist/tools/handlers/intent-radar.js +1 -1
  285. package/dist/tools/handlers/local.js +1 -1
  286. package/dist/tools/handlers/mark-namespace.d.ts +30 -0
  287. package/dist/tools/handlers/mark-namespace.js +1 -0
  288. package/dist/tools/handlers/messenger.js +1 -1
  289. package/dist/tools/handlers/onchain-name-registration.d.ts +1 -0
  290. package/dist/tools/handlers/onchain-name-registration.js +1 -1
  291. package/dist/tools/handlers/onchain-name-registration.spec.js +1 -1
  292. package/dist/tools/handlers/onchain.d.ts +40 -1
  293. package/dist/tools/handlers/onchain.js +1 -1
  294. package/dist/tools/handlers/publish-binding-echo.d.ts +22 -0
  295. package/dist/tools/handlers/publish-binding-echo.js +1 -0
  296. package/dist/tools/handlers/query.d.ts +1 -1
  297. package/dist/tools/handlers/query.js +1 -1
  298. package/dist/tools/handlers/review-chain.d.ts +1 -0
  299. package/dist/tools/handlers/review-chain.js +1 -1
  300. package/dist/tools/handlers/schema-query.js +1 -1
  301. package/dist/tools/handlers/stale-build-check.d.ts +9 -0
  302. package/dist/tools/handlers/stale-build-check.js +1 -0
  303. package/dist/tools/handlers/submission-assembly.d.ts +55 -0
  304. package/dist/tools/handlers/submission-assembly.js +1 -0
  305. package/dist/tools/handlers/wip.js +1 -1
  306. package/dist/tools/index.d.ts +1 -0
  307. package/dist/tools/index.js +1 -1
  308. package/dist/tools/move-fn-index.gen.js +1 -1
  309. package/dist/tools/publish-gate-state.d.ts +5 -0
  310. package/dist/tools/publish-gate-state.js +1 -0
  311. package/dist/tools/registry/business.js +1 -1
  312. package/dist/tools/registry/onchain.js +1 -1
  313. package/dist/tools/registry/query.js +1 -1
  314. package/dist/tools/retry.js +1 -1
  315. package/dist/tools/runtime-health.js +1 -1
  316. package/dist/tools/shared.js +1 -1
  317. package/dist/tools/upgrade-check.d.ts +1 -0
  318. package/dist/tools/upgrade-check.js +1 -1
  319. package/dist/tools/wip-verify-ledger.d.ts +2 -0
  320. package/dist/tools/wip-verify-ledger.js +1 -1
  321. package/dist/tools/wrap.d.ts +15 -1
  322. package/dist/tools/wrap.js +1 -1
  323. package/package.json +5 -3
@@ -0,0 +1 @@
1
+ export const PUBLISH_SURFACE_CONTRACT_VERSION='1.3.0';export const PUBLISH_SURFACE_CONTRACT=[{'id':'MC-TOPOLOGY-01','gate':'auditMachineNodes','faces':['machine_publish'],'enforcement':'always','defect_class':'R-M1-11\x20dispute\x20nodes\x20on-Machine\x20/\x20MC-C-04\x20missing\x20entry\x20pair\x20/\x20operator\x20sanity\x20on\x20effective\x20node\x20set\x20(inline\x20AND\x20by-reference)','origin':'R-M1-11,\x20MC-C-04;\x20F-001\x20effective-state\x20fix','wired_in':'wrap'},{'id':'MC-CLOSURE-01','gate':'closureFindings','faces':['machine_publish'],'enforcement':'always','defect_class':'publish\x20closure\x20findings\x20on\x20machine\x20graph\x20(unreachable/terminal\x20anomalies)','origin':'PG-CLOSURE-01\x20(gf32)','wired_in':'wrap'},{'id':'MC-TASKBIND-01','gate':'lintForwardGuardsTaskBinding','faces':['machine_publish'],'enforcement':'always','defect_class':'forward\x20guards\x20with\x20task-row\x20binding\x20gaps\x20—\x20unauthorized\x20dual-rail\x20advance','origin':'gfm31\x20P05\x20(1000/1002\x20unauthorized\x20dual-track,\x20chain-rejected\x20within\x20minutes)','wired_in':'wrap'},{'id':'MC-REVIEWLOCK-01','gate':'lintForwardReviewLocks','faces':['machine_publish'],'enforcement':'always','defect_class':'review-window\x20forward\x20locks\x20missing/mispinned','origin':'proactive\x20consolidation','wired_in':'wrap'},{'id':'MC-ARBRAIL-01','gate':'lintForwardArbRulingRails','faces':['machine_publish'],'enforcement':'always','defect_class':'an\x20arbitration\x20OUTCOME\x20that\x20cannot\x20move\x20the\x20order,\x20judged\x20on\x20the\x20frozen\x20graph\x20by\x20QUERY\x20SEMANTICS\x20(never\x20template_id\x20or\x20node\x20name):\x20ARB_RULING_PRESENCE_ONLY\x20/\x20ARB_RULING_STATUS_GATE\x20block;\x20ARB_RULING_VENUE_UNBOUND\x20/\x20ARB_RULING_ZERO_EXIT\x20warn;\x20ARB_RULING_ONE_SIDED\x20discloses','origin':'publish-face\x20twin\x20of\x20the\x20scan-only\x20R-DIR-01/02\x20+\x20R-ARB-ZERO-EXIT,\x20which\x20classify\x20by\x20template_id\x20and\x20semantic_role\x20—\x20neither\x20survives\x20to\x20the\x20chain,\x20so\x20a\x20hand-composed\x20store\x20never\x20saw\x20them\x20(the\x20same\x20gap\x20that\x20made\x20SV-RAILPAIR-01\x20unconditional).\x20Severity\x20per\x20measurement\x20over\x20v170:\x20presence-only\x20and\x20arb.status\x20are\x200/16\x20arbitration\x20archetypes\x20(blockable);\x20won-only\x20is\x208/16\x20and\x20the\x20only\x202\x20ruling-only\x20waypoints\x20are\x20declared-final\x20post-settlement\x20re-routers\x20whose\x20drained-escrow\x20exemption\x20is\x20NOT\x20statically\x20decidable\x20at\x20publish\x20(disclose/warn\x20only)','wired_in':'wrap'},{'id':'MC-TIMEPROFILE-01','gate':'lintForwardGuardsTimeProfile','faces':['machine_publish'],'enforcement':'always','defect_class':'forward\x20guard\x20time-profile\x20contradictions\x20(timeout\x20vs\x20window).\x20NAMED\x20DEGRADE\x20(N8\x20ktt6\x20F-14\x20re-carving\x202026-11-04):\x20env.window_profile=\x27test\x27\x20downgrades\x20the\x20numeric\x20violations\x20to\x20loud\x20disclosures\x20for\x20a\x20DISPOSABLE\x20trial\x20run\x20—\x20but\x20a\x20test-profile\x20publish\x20on\x20an\x20explicit\x20real\x20network\x20(testnet/mainnet)\x20is\x20BLOCKED\x20on\x20every\x20face\x20in\x20the\x20harness\x20pre-publish\x20hook','origin':'R7-01\x20family','wired_in':'wrap'},{'id':'MC-SVCCONST-01','gate':'lintForwardGuardServiceConstants','faces':['machine_publish'],'enforcement':'always','defect_class':'guard\x20pinned\x20to\x20wrong-shop\x20Service\x20constant\x20slot\x20—\x20order\x20strands\x20(guard\x20creation\x20module\x20conflict\x20on-chain)','origin':'P0-3\x20mtb-tn-261030','wired_in':'wrap'},{'id':'MC-BINDSEM-01','gate':'lintGuardBindingSemantics','faces':['machine_publish','service_publish','guard_binding'],'enforcement':'always','defect_class':'per-host\x20guard\x20binding\x20semantics\x20—\x20drain\x20surface\x20/\x20T10\x20hijack\x20binds\x20(MF_SLOT_IDENTITY_ANCHOR\x20family)','origin':'ruling\x202026-10-31\x20(G2)','wired_in':'wrap'},{'id':'MC-TASKBIND-PRE-01','gate':'lintMachineTaskBindingPreflight','faces':['machine_publish'],'enforcement':'always','defect_class':'machine-side\x20task\x20binding\x20preflight\x20(order/task\x20row\x20anchors\x20resolvable)','origin':'K4R\x20claimed_by\x20ordering\x20leg\x20batch','wired_in':'wrap'},{'id':'MC-SVCCONST-REF-01','gate':'lintMachineGuardServiceConstants','faces':['machine_publish','service_publish'],'enforcement':'always','defect_class':'by-reference\x20machine\x20publish:\x20guard\x20constants\x20pinned\x20to\x20foreign\x20Service','origin':'P0-3\x20residual\x20(machine\x20ref\x20publish\x20face)','wired_in':'wrap'},{'id':'MC-EVIDENCE-01','gate':'lintForwardGuardEvidenceMarkers','faces':['machine_publish'],'enforcement':'always','defect_class':'forward\x20guard\x20evidence\x20markers\x20(proof/event\x20anchors)\x20malformed','origin':'proactive\x20consolidation','wired_in':'wrap'},{'id':'SV-PERMAUTH-01','gate':'checkPermissionAuthorization','faces':['service_publish'],'enforcement':'strict_audit_only','defect_class':'IMMUT-002\x20—\x20custom\x20permission\x20index\x20grants\x20unauthorized\x20writers\x20(immutable\x20after\x20publish)','origin':'IMMUT-002\x20(OUTAGE\x20vs\x20EVIDENCE\x20degrade)','wired_in':'wrap'},{'id':'SV-WIPBIND-01','gate':'lintSalesWipBindings','faces':['service_publish'],'enforcement':'always','defect_class':'sales\x20payload\x20WIP\x20bindings\x20dangling\x20(price/stock\x20refs\x20unresolvable)','origin':'TPL-P1-04/05\x20family','wired_in':'wrap'},{'id':'SV-ALLOCGUARD-01','gate':'lintAllocatorGuards','faces':['service_publish'],'enforcement':'always','defect_class':'allocator-bound\x20guard\x20roots\x20unresolvable\x20/\x20fund-safety\x20contradiction\x20(chain-grounded).\x20Its\x20R-TIME-PROFILE\x20leg\x20shares\x20the\x20MC-TIMEPROFILE-01\x20named\x20degrade\x20(env.window_profile=\x27test\x27;\x20real-network\x20formal\x20publish\x20still\x20BLOCKS)','origin':'allocator-rail-verifier\x20publish\x20face\x20(ledger\x20rule\x208\x20authority)','wired_in':'wrap'},{'id':'SV-ESCROWEXIT-01','gate':'lintServiceEscrowExitCoverage','faces':['service_publish'],'enforcement':'always','defect_class':'R-ESCROW-LEAF\x20—\x20terminal\x20node\x20with\x20NO\x20drain\x20entry\x20exists\x20→\x20escrow\x20strands\x20(1.0\x20WOW实证)','origin':'R-ESCROW-LEAF\x20(4R-05)','wired_in':'wrap'},{'id':'SV-RAILEXIT-01','gate':'verifyRailExitSatisfiability','faces':['service_publish'],'enforcement':'always','defect_class':'the\x20SATISFIABILITY\x20half\x20of\x20R-ESCROW-LEAF\x20—\x20a\x20terminal\x20whose\x20rails\x20all\x20pin\x20the\x20right\x20node\x20yet\x20none\x20can\x20ever\x20FIRE,\x20so\x20the\x20escrow\x20strands\x20while\x20SV-ESCROWEXIT-01\x20reports\x20green:\x20RAIL_EXIT_WINDOW_CLOSED\x20(a\x20monotone-closing\x20clock\x20leg\x20in\x20an\x20unavoidable\x20position\x20—\x20draining\x20escrow\x20through\x20a\x20rail\x20is\x20an\x20explicit\x20call\x20needing\x20a\x20same-tx\x20passport,\x20so\x20once\x20the\x20window\x20shuts\x20no\x20signer\x20can\x20produce\x20one,\x20and\x20the\x20pool\x20is\x20append-only\x20with\x20no\x20drain\x20backdoor)\x20/\x20RAIL_EXIT_ARB_GATED\x20(an\x20unavoidable\x20arb.*\x20read,\x20which\x20returns\x20W_OBJECT_NOT_FOUND\x20and\x20ABORTS\x20the\x20whole\x20tx\x20rather\x20than\x20evaluating\x20false,\x20so\x20the\x20never-disputed\x20majority\x20has\x20no\x20exit)','origin':'R-ESCROW-LEAF\x20upgrade\x20(task\x20③,\x202026-11-04).\x20Severity\x20per\x20two-layer\x20measurement\x20over\x20v170:\x20LAYER\x20A\x20—\x20of\x20127\x20declared\x20rail\x20keys,\x2078\x20resolve\x20to\x20a\x20concrete\x20body\x20through\x20the\x20compiler\x27s\x20own\x20default-resolution\x20chain\x20and\x20ZERO\x20trips\x20either\x20code;\x20LAYER\x20B\x20is\x20resolution-independent\x20and\x20carries\x20the\x20argument\x20—\x20pattern.time_window_upper_bound\x20(the\x20closing\x20design)\x20is\x20bound\x20to\x20machine_forward\x20ONLY\x20across\x20all\x2030\x20archetypes,\x20exactly\x20as\x20its\x20own\x20`host`\x20field\x20declares,\x20and\x20no\x20arb-reading\x20tpl_*\x20is\x20bound\x20to\x20any\x20rail.\x20A\x20hit\x20therefore\x20means\x20the\x20payload\x20diverged\x20from\x20every\x20shipped\x20archetype.\x20Doctrine\x20source:\x20pattern.time_window_upper_bound\x27s\x20EXPIRY\x20SEMANTICS\x20note\x20—\x20\x27an\x20expired\x20window\x20only\x20fails\x20the\x20FORWARD\x20it\x20gates\x20…\x20pair\x20with\x20a\x20machine\x20expiry\x20node\x20or\x20an\x20allocator\x20recover\x20rail\x20for\x20the\x20post-window\x20fund\x20path\x27;\x20a\x20closing\x20leg\x20ON\x20the\x20fund\x20rail\x20is\x20that\x20pairing\x20inverted','wired_in':'wrap'},{'id':'SV-ARBNEUTRAL-01','gate':'checkArbitrationNeutrality','faces':['service_publish'],'enforcement':'strict_audit_only','defect_class':'R2-04\x20—\x20arbitrator-neutral\x20object\x20bound\x20as\x20merchant-biased\x20referee\x20(degraded\x20read\x20degrades\x20verdict)','origin':'R2-04\x20(OUTAGE\x20vs\x20EVIDENCE\x20degrade)','wired_in':'wrap'},{'id':'SV-RAILPAIR-01','gate':'lintAllocatorRailPairing','faces':['service_publish'],'enforcement':'always','defect_class':'H1B-03\x20—\x20symbolic\x20rail\x20verification\x20over\x20the\x20allocator\x20guards\x20(RAIL_TERMINAL_UNCOVERED\x20/\x20RAIL_AWARD_EXIT_MISSING\x20/\x20RAIL_CLAIMED_BY_LEG\x20/\x20RAIL_NO_CALLER_IDENTITY_BOUND\x20/\x20RAIL_DEAD_LITERAL).\x20UNCONDITIONAL\x20since\x202026-11-04\x20(was\x20arbitration-scoped),\x20fed\x20a\x20TOPOLOGY-DERIVED\x20node\x20matrix\x20via\x20chainNodeRailMatrix\x20—\x20the\x20chain\x20stores\x20no\x20semantic\x20role,\x20so\x20the\x20former\x20bare\x20{name}\x20rows\x20left\x20`terminals`\x20empty\x20and\x20RAIL_TERMINAL_UNCOVERED\x20could\x20never\x20fire\x20on\x20a\x20publish\x20payload\x20—\x20and,\x20from\x20the\x20same\x20day,\x20fed\x20the\x20SERVICE\x27S\x20EFFECTIVE\x20ON-CHAIN\x20BINDING:\x20a\x20publish-by-reference\x20(staged)\x20call\x20carries\x20neither\x20allocators\x20nor\x20a\x20machine\x20because\x20both\x20were\x20bound\x20in\x20earlier\x20calls,\x20so\x20the\x20payload-only\x20read\x20returned\x20silent\x20on\x20exactly\x20the\x20hand-compose\x20flow\x20this\x20incident\x20class\x20lives\x20in.\x20`serviceRef`\x20now\x20resolves\x20the\x20Service\x20object\x20once\x20and\x20its\x20`order_allocators`/`machine`\x20backfill\x20both\x20gaps\x20(same\x20move\x20as\x20the\x20R-ESCROW-LEAF\x20cure);\x20an\x20unresolvable\x20ref\x20is\x20graded\x20by\x20face\x20—\x20a\x20FAILED\x20read\x20blocks\x20only\x20the\x20strict\x20dry_run\x20audit\x20and\x20warns\x20on\x20the\x20formal\x20publish\x20(OUTAGE\x20vs\x20EVIDENCE),\x20a\x20read\x20that\x20resolved\x20NO\x20Service\x20object\x20warns\x20on\x20both','origin':'H1B-03\x20(1.0\x20WOW\x20stranded);\x20scope+matrix\x20cure\x202026-11-04\x20(publish\x20face\x20was\x20strictly\x20weaker\x20than\x20the\x20compile\x20face,\x20which\x20runs\x20the\x20same\x20verifier\x20on\x20every\x20archetype);\x20staged-binding\x20cure\x202026-11-04\x20(the\x20\x27UNCONDITIONAL\x27\x20claim\x20was\x20false\x20for\x20publish-by-reference\x20until\x20the\x20on-chain\x20binding\x20became\x20the\x20fallback\x20source)\x20—\x20landing\x20risk\x20measured\x20over\x20the\x20catalog\x20before\x20enabling:\x2030\x20archetypes\x20/\x20119\x20resolved\x20rails\x20/\x200\x20publish-face\x20criticals,\x2083\x20info\x20receipts\x20(builtin-allocator-rails.spec.ts\x20invariant\x20(d)),\x20plus\x20the\x20matrix\x20half\x20in\x20publish-rail-matrix.spec.ts','wired_in':'wrap'},{'id':'SV-ECHO-01','gate':'echoServicePublishBindings','faces':['service_publish'],'enforcement':'always','defect_class':'et21\x20ISS-015\x20—\x20last-chance\x20binding\x20echo:\x20every\x20named\x20binding\x20this\x20payload\x20will\x20freeze\x20(machine\x20/\x20order_allocators\x20guards\x20+\x20Entity\x20recipients\x20/\x20order_allocators_append\x20/\x20arbitrations\x20/\x20rewards\x20/\x20object.permission)\x20is\x20resolved\x20name\x20→\x20address\x20→\x20on-chain\x20object\x20type\x20through\x20the\x20namespace-aware\x20LocalMark\x20resolver.\x20An\x20UNRESOLVABLE\x20local\x20name\x20or\x20a\x20resolved\x20type\x20that\x20does\x20not\x20match\x20the\x20slot\x20(expected\x20Entity\x20payee\x20resolving\x20to\x20a\x20Guard)\x20BLOCKS\x20the\x20FORMAL\x20publish\x20—\x20order_allocators\x20is\x20append-only\x20after\x20publish\x20(the\x20allocator\x20table\x20can\x20never\x20be\x20edited\x20once\x20the\x20service\x20is\x20live),\x20so\x20a\x20mis-bound\x20payee\x20is\x20permanently\x20wrong;\x20the\x20dry_run\x20strict\x20audit\x20echoes\x20WITHOUT\x20blocking\x20(the\x20formal\x20dispatch\x20is\x20the\x20irreversible\x20step).\x20Cross-build\x20bare-name\x20collision\x20advisories\x20ride\x20the\x20same\x20resolver\x20(LocalMark\x20write-path\x20namespace,\x20same\x20slice)','origin':'et21\x20ISS-015\x20(publish-face\x20audit\x20ledger\x20P0#4;\x20binding-manifest\x20echo\x20first\x20slice,\x202026-11-04)','wired_in':'wrap'},{'id':'AUTH-COMPILE-01','gate':'checkAllocatorRails','faces':['service_publish','machine_publish'],'enforcement':'always','defect_class':'compile.ts\x20rail\x20blockers\x20—\x20RAIL_TERMINAL_UNCOVERED\x20/\x20RAIL_CLAIMED_BY_LEG\x20/\x20RAIL_NO_CALLER_IDENTITY_BOUND\x20/\x20REFUND_GATE_POLARITY_MIX\x20(template/DSL\x20path)','origin':'allocator-rail-verifier\x20(compile-time\x20authority)','wired_in':'compile'},{'id':'AUTH-AUDITRULES-01','gate':'audit_machine_bound','faces':['service_publish'],'enforcement':'advisory','defect_class':'audit-rules\x20catalog\x20—\x20machine\x20bound\x20/\x20dangling\x20deps\x20/\x20repo\x20integrity\x20caller\x20legs\x20(aggregate_risks\x20face,\x20wowok-auditor\x20consumer)','origin':'audit-rules.ts\x20catalog','wired_in':'audit-rules'},{'id':'SV-REFUNDSAT-01','gate':'checkRefundRecipientSatisfiability','faces':['service_publish'],'enforcement':'always','defect_class':'T10-10\x20—\x20a\x20refund\x20guard\x20pinning\x20its\x20recipient\x20identifier\x20to\x20context(Signer)\x20is\x20unsatisfiable\x20against\x20the\x20order-anchored\x20escrow,\x20so\x20order\x20funds\x20strand\x20permanently\x20once\x20the\x20allocators\x20lock\x20(fail-soft\x20to\x20advisory\x20on\x20fetch\x20error)','origin':'T10-10\x20(GuardIdentifier\x20x\x20for_object\x20x\x20Guard-equality\x20triple)','wired_in':'onchain'},{'id':'SV-ARBDECOR-01','gate':'checkArbitrationsBeforePublish','faces':['service_publish'],'enforcement':'always','defect_class':'decorative\x20dispute\x20path\x20—\x20a\x20bound\x20Arbitration\x20whose\x20voting_guard\x20roster\x20leaves\x20the\x20arb-side\x20admin\x20as\x20the\x20only\x20voter\x20AND\x20the\x20judge\x20(R-ARB-VOTE-LOCK\x20concentration);\x20fail-soft\x20to\x20advisory\x20on\x20resolution/query\x20error','origin':'R-ARB-VOTE-LOCK','wired_in':'onchain'},{'id':'SV-RECIPIENT-01','gate':'checkEntityRecipientGate','faces':['service_publish'],'enforcement':'always','defect_class':'R-RECIPIENT-03\x20—\x20a\x20blank/omitted\x20allocator\x20recipient\x20resolves\x20to\x20the\x20DEFAULT\x20LOCAL\x20ACCOUNT,\x20silently\x20routing\x20customer\x20escrow\x20to\x20the\x20builder;\x20blocks\x20rather\x20than\x20warns\x20because\x20order_allocators\x20is\x20L1-immutable\x20after\x20publish\x20(the\x20same\x20gate\x20also\x20covers\x20allocation.allocators)','origin':'R-RECIPIENT-03\x20(direct-sales\x20Entity\x20recipient)','wired_in':'onchain'},{'id':'SV-ALLOCPLAN-01','gate':'checkOrderAllocatorsPrePublish','faces':['service_publish'],'enforcement':'always','defect_class':'R-A-1\x20allocator-plan\x20structural\x20family\x20+\x20R-A-2-03\x20duplicate\x20guards\x20—\x20the\x20subset\x20decidable\x20without\x20Guard\x20table/root\x20evidence\x20blocks;\x20everything\x20else\x20degrades\x20to\x20a\x20warning,\x20and\x20an\x20internal\x20error\x20never\x20blocks\x20(the\x20gate\x20must\x20not\x20become\x20a\x20new\x20failure\x20mode)','origin':'R-A-1\x20/\x20R-A-2-03','wired_in':'onchain'},{'id':'SV-WIPNET-01','gate':'checkSalesWipNetworkDeployment','faces':['service_publish'],'enforcement':'always','defect_class':'a\x20localnet-only\x20WIP\x20is\x20unreachable\x20from\x20testnet/mainnet\x20machines,\x20so\x20every\x20order\x20fails\x20100%\x20—\x20hard-blocked\x20on\x20those\x20networks,\x20advisory\x20on\x20localnet','origin':'WIP-B\x20network\x20calibration','wired_in':'onchain'},{'id':'SV-ZEROPRICE-01','gate':'checkSalesZeroPrice','faces':['service_publish'],'enforcement':'always','defect_class':'F-BS-76\x20—\x20sale()\x20has\x20no\x20price\x20floor\x20so\x20price\x200\x20lists\x20fine,\x20then\x20NOBODY\x20can\x20ever\x20buy\x20it\x20(client\x20zero-total\x20gate\x20and\x20the\x20on-chain\x20zero-total\x20abort\x20both\x20refuse);\x20discovery\x20cost\x20one\x20run\x201\x20679\x20440\x20gas\x20to\x20add\x20and\x20787\x20124\x20to\x20remove','origin':'F-BS-76\x20(bs-mn-261022)','wired_in':'onchain'},{'id':'SV-UMIMS-01','gate':'checkUmContactHasIm','faces':['service_publish'],'enforcement':'always','defect_class':'an\x20empty\x20Contact\x20ims\x20vector\x20leaves\x20pre-order\x20negotiation,\x20customer_required\x20private-info\x20delivery\x20and\x20post-sale\x20support\x20with\x20NO\x20channel\x20—\x20Messenger\x20routes\x20to\x20ims\x20members,\x20so\x20the\x20store\x20publishes\x20unreachable','origin':'on-chain\x20contact\x20ims\x20routing','wired_in':'onchain'},{'id':'SV-AUDITCAT-01','gate':'auditService','faces':['service_publish'],'enforcement':'advisory','defect_class':'audit-rules\x20service\x20catalog\x20(SKIP_RULES-filtered)\x20—\x20NOTE:\x20an\x20`error`-severity\x20finding\x20is\x20pushed\x20as\x20an\x20[AUDIT\x20ERROR]\x20constraintWarning\x20and\x20does\x20NOT\x20block,\x20so\x20the\x20catalog\x27s\x20own\x20severity\x20scale\x20is\x20cosmetic\x20on\x20this\x20face','origin':'audit-rules.ts\x20catalog','wired_in':'onchain'},{'id':'MC-PERMISS-01','gate':'checkMachinePermissionBeforePublish','faces':['machine_publish'],'enforcement':'advisory','defect_class':'a\x20forward\x27s\x20permissionIndex\x20with\x20no\x20entity\x20granted\x20on\x20the\x20bound\x20Permission\x20—\x20the\x20edge\x20is\x20unadvanceable\x20by\x20anyone\x20(advisory\x20because\x20a\x20new\x20Permission\x20may\x20be\x20granted\x20after\x20publish)','origin':'permission-index\x20grant\x20coverage','wired_in':'onchain'},{'id':'MC-ORPHANGUARD-01','gate':'lintMachineGuardBindings','faces':['machine_publish'],'enforcement':'advisory','defect_class':'F-29\x20—\x20the\x20session\x20created\x20Guard\x20object(s)\x20but\x20the\x20publishable\x20graph\x20binds\x20ZERO\x20of\x20them\x20on\x20any\x20forward\x20(the\x20silent-drop\x20shape:\x20$ref\x20pre-evaluated\x20to\x20undefined,\x20JSON.stringify\x20drops\x20the\x20key,\x20publish\x20succeeds,\x20edges\x20freeze\x20unguarded)','origin':'F-29\x20(tv8-tn-261030)','wired_in':'onchain'},{'id':'MC-ANCHORREACH-01','gate':'checkGuardAnchorReachability','faces':['machine_publish'],'enforcement':'advisory','defect_class':'a\x20guard\x20time-anchor\x20that\x20no\x20reachable\x20node\x20ever\x20establishes\x20makes\x20its\x20window\x20unsatisfiable\x20—\x20the\x20guard\x20can\x20never\x20pass,\x20so\x20the\x20rail\x20it\x20gates\x20is\x20dead\x20(Dijkstra\x20over\x20the\x20anchor\x20x\x20node\x20profile)','origin':'guard-anchor-reach.ts','wired_in':'onchain'},{'id':'GD-NODEGATE-01','gate':'lintGuardNodeGates','faces':['guard_binding'],'enforcement':'advisory','defect_class':'guard\x20node-gate\x20advisory\x20on\x20the\x20guard\x20create/update\x20face\x20—\x20a\x20node\x20pin\x20that\x20the\x20intended\x20host\x20machine\x20never\x20enters','origin':'guard\x20node-gate\x20parse\x20(parseGuardNodeGates)','wired_in':'onchain'},{'id':'GD-REWARDONCE-01','gate':'checkRewardOnceArming','faces':['guard_binding'],'enforcement':'advisory','defect_class':'a\x20funded\x20Reward\x20pool\x20whose\x20mounted\x20guard\x20carries\x20no\x20once-stamp\x20is\x20replayable,\x20and\x20the\x20bsw4\x20F-11\x20window-delay\x20advisory\x20rides\x20the\x20same\x20sweep;\x20reward\x20guard_add\x20is\x20a\x20bind\x20face\x20per\x20isGuardBindingOperation','origin':'bsw4\x20F-11\x20/\x20reward\x20replay\x20stamp','wired_in':'onchain'},{'id':'GD-REWARDEVID-01','gate':'verifyRewardEvidenceBindings','faces':['guard_binding'],'enforcement':'advisory','defect_class':'reward\x20evidence\x20bindings\x20that\x20the\x20deployed\x20package\x20drops\x20on\x20read-back\x20—\x20fail-soft,\x20never\x20masks\x20the\x20operation\x27s\x20own\x20outcome','origin':'reward\x20evidence\x20read-back','wired_in':'onchain'}];export const PUBLISH_SURFACE_EXEMPT_GATES={'checkAllocatorRails':'compile-face\x20authority\x20(template\x20path);\x20invoked\x20by\x20the\x20compile\x20pipeline,\x20registered\x20as\x20AUTH-COMPILE-01','auditRepoIntegrityAndCallerLegs':'plan-level\x20repo\x20integrity\x20(plan\x20build\x20face,\x20not\x20the\x20dispatch\x20publish\x20gate)','checkForeignServicePins':'plan-level\x20foreign\x20pin\x20disclosure\x20(plan\x20build\x20face)','checkDaysUnitSlots':'compile\x20normalization\x20check\x20(plan\x20build\x20face)','checkWindowTruncation':'compile\x20normalization\x20check\x20(plan\x20build\x20face)','dropEmptyVecGuards':'compile\x20normalization\x20step\x20(not\x20a\x20gate)','checkProjectStage':'project\x20tool\x20stage\x20hint\x20(wip_file/project\x20face,\x20not\x20publish)','lintAllocatorGuardSet':'internal\x20helper\x20behind\x20lintAllocatorGuards\x20and\x20the\x20pre-buy\x20screening\x20gate','lintTaskBindingAdvisories':'internal\x20helper\x20behind\x20the\x20task-binding\x20advisory\x20family\x20(protocol\x20254)','lintGuard':'guard-lint\x20module\x20entry\x20invoked\x20INSIDE\x20composing\x20lints,\x20not\x20a\x20publish\x20gate\x20itself','lintReviewLockedTerminals':'internal\x20helper\x20behind\x20lintForwardReviewLocks','verifyAllocatorRails':'internal\x20helper\x20behind\x20lintAllocatorRailPairing\x20(single-source\x20verifier\x20core)','verifyArbitrationRulingRails':'internal\x20helper\x20behind\x20lintForwardArbRulingRails\x20(single-source\x20ruling-rail\x20verifier\x20core)','verifyCollectedGuardBindings':'internal\x20helper\x20behind\x20lintGuardBindingSemantics\x20(batch\x20collection)','verifyGuardBinding':'internal\x20helper\x20behind\x20verifyCollectedGuardBindings\x20(single\x20host)','auditGuardRelies':'internal\x20helper\x20inside\x20verifyCollectedGuardBindings\x20(guard-relies\x20audit)','checkEntityRecipients':'internal\x20helper\x20behind\x20checkEntityRecipientGate\x20(registered\x20as\x20SV-RECIPIENT-01)','checkArbitrationVenueOrder':'Arbitration\x20CREATION\x20face\x20(venue\x20ordering\x20findings\x20at\x20arb\x20build),\x20not\x20a\x20Service/Machine\x20publish\x20gate','checkClientSchemaCompatibility':'client\x20schema-version\x20negotiation\x20(schema\x20layer),\x20not\x20a\x20publish\x20gate','checkDiscountFloorBeforeIssue':'discount\x20ISSUANCE\x20face\x20—\x20judged\x20when\x20a\x20discount\x20is\x20created,\x20not\x20at\x20publish','checkDiscountThresholdBeforeBuy':'BUY\x20face\x20—\x20the\x20pre_buy\x20gate\x20(wrap.ts\x20runPreBuyChecks)\x20owns\x20purchase-time\x20screening','verifyGuardFailureLegs':'runtime\x20E_VERIFY_FAILED\x20diagnosis\x20(leg-by-leg\x20replay\x20of\x20a\x20FAILED\x20guard\x20submission),\x20not\x20a\x20pre-publish\x20gate','verifyOrderNewLanded':'post-transaction\x20read-back\x20of\x20an\x20order_new\x20landing,\x20not\x20a\x20pre-publish\x20gate'};export function gatesForFace(a){return PUBLISH_SURFACE_CONTRACT['filter'](b=>b['faces']['includes'](a));}export function blockingGatesForFace(a){return gatesForFace(a)['filter'](b=>b['enforcement']==='always');}
@@ -0,0 +1,25 @@
1
+ import { type GuardTableRow, type GuardTreeNode } from "./allocator-rail-verifier.js";
2
+ export declare function classifyTimeComparison(node: GuardTreeNode | undefined, table: GuardTableRow[]): "closing" | "opening" | "neutral";
3
+ export declare function closingWindowUnavoidable(root: unknown, table: GuardTableRow[]): boolean;
4
+ export declare function arbReadUnavoidable(root: unknown): boolean;
5
+ export type RailExitFindingCode = "RAIL_EXIT_WINDOW_CLOSED" | "RAIL_EXIT_ARB_GATED";
6
+ export type RailExitFindingLevel = "critical" | "info";
7
+ export interface RailExitFinding {
8
+ code: RailExitFindingCode;
9
+ level: RailExitFindingLevel;
10
+ detail: string;
11
+ node: string;
12
+ refs: string[];
13
+ }
14
+ export interface RailExitInput {
15
+ ref: string;
16
+ root: unknown;
17
+ table?: GuardTableRow[];
18
+ pos: Set<string>;
19
+ neg: Set<string>;
20
+ }
21
+ export interface RailExitVerifyInput {
22
+ rails: RailExitInput[];
23
+ terminals: string[];
24
+ }
25
+ export declare function verifyRailExitSatisfiability(input: RailExitVerifyInput): RailExitFinding[];
@@ -0,0 +1 @@
1
+ import{ObjectType}from'@wowok/wowok';import{getGuardQueryByIdOrName}from'../schema/utils/guard-query-utils.js';import{resolveValue}from'./allocator-rail-verifier.js';const CMP_GREATER='logic_as_u256_greater',CMP_LESSER='logic_as_u256_lesser',CMP_GREATER_EQ='logic_as_u256_greater_or_equal',CMP_LESSER_EQ='logic_as_u256_lesser_or_equal',COMPARISONS=new Set([CMP_GREATER,CMP_LESSER,CMP_GREATER_EQ,CMP_LESSER_EQ]);function asNode(a){if(typeof a!=='object'||a===null)return undefined;const b=a['type'];return typeof b==='string'?a:undefined;}function childrenOf(a){const b=[];if(Array['isArray'](a['nodes']))for(const e of a['nodes']){const f=asNode(e);if(f)b['push'](f);}const d=asNode(a['node']);if(d)b['push'](d);for(const g of['left','right','nodeLeft','nodeRight']){const h=asNode(a[g]);if(h)b['push'](h);}return b;}function typeOf(a){const b=asNode(a);return b===undefined?'':String(b['type']??'');}function timeSourceOf(a){const b=asNode(a);if(!b)return undefined;if(b['type']==='time_until')return'time_until';if(b['type']==='context'&&String(b['context']??'')['toLowerCase']()==='clock')return'clock';for(const d of childrenOf(b)){const e=timeSourceOf(d);if(e)return e;}return undefined;}function numericOf(a,b){if(!b)return undefined;if(b['type']==='constant'){const e=b['value'];if(typeof e==='number'&&Number['isFinite'](e))return e;if(typeof e==='string'&&e['trim']()!==''&&Number['isFinite'](Number(e)))return Number(e);}const c=resolveValue(a,b);if(!c['known'])return undefined;const d=c['value'];if(typeof d==='number'&&Number['isFinite'](d))return d;if(typeof d==='bigint')return Number(d);if(typeof d==='string'&&d['trim']()!==''&&Number['isFinite'](Number(d)))return Number(d);return undefined;}function flip(a){if(a===CMP_GREATER)return CMP_LESSER;if(a===CMP_LESSER)return CMP_GREATER;if(a===CMP_GREATER_EQ)return CMP_LESSER_EQ;if(a===CMP_LESSER_EQ)return CMP_GREATER_EQ;return a;}export function classifyTimeComparison(a,b){if(!a||!COMPARISONS['has'](String(a['type']??'')))return'neutral';const c=Array['isArray'](a['nodes'])?a['nodes']['map'](asNode):[];if(c['length']<0x2)return'neutral';const [d,e]=c,f=timeSourceOf(d),g=timeSourceOf(e);if(f&&g)return'neutral';const h=f??g;if(!h)return'neutral';const i=f?e:d;if(timeSourceOf(i))return'neutral';const j=f?String(a['type']):flip(String(a['type'])),l=numericOf(b,i);if(h==='clock')return j===CMP_GREATER||j===CMP_GREATER_EQ?'opening':'closing';if(j===CMP_GREATER)return l!==undefined&&l>=0x0?'closing':'neutral';if(j===CMP_GREATER_EQ)return l!==undefined&&l>0x0?'closing':'neutral';return'opening';}function containsClosingComparison(a,b){const c=asNode(a);if(!c)return![];if(classifyTimeComparison(c,b)==='closing')return!![];return childrenOf(c)['some'](d=>containsClosingComparison(d,b));}function isArbQueryLeaf(a){const b=asNode(a);if(!b||b['type']!=='query')return![];const c=b['query'];if(typeof c!=='number'&&typeof c!=='string')return![];return getGuardQueryByIdOrName(c)?.['objectType']===ObjectType['Arb'];}function containsArbQuery(a){const b=asNode(a);if(!b)return![];if(isArbQueryLeaf(b))return!![];return childrenOf(b)['some'](d=>containsArbQuery(d));}export function closingWindowUnavoidable(a,b){const c=asNode(a);if(!c)return![];const d=childrenOf(c);switch(String(c['type']??'')){case'logic_and':return d['some'](e=>closingWindowUnavoidable(e,b));case'logic_or':return d['length']>0x0&&d['every'](e=>closingWindowUnavoidable(e,b));case'logic_not':return![];default:return containsClosingComparison(c,b);}}export function arbReadUnavoidable(a){const b=asNode(a);if(!b)return![];const c=String(b['type']??''),d=childrenOf(b);switch(c){case'logic_and':return d['some'](e=>arbReadUnavoidable(e));case'logic_or':return d['length']>0x0&&d['every'](e=>arbReadUnavoidable(e));case'logic_not':return d['some'](e=>arbReadUnavoidable(e));default:return containsArbQuery(b);}}function covers(a,b){return a['pos']['size']>0x0?a['pos']['has'](b):!a['neg']['has'](b);}export function verifyRailExitSatisfiability(a){const b=[],{rails:c,terminals:d}=a;if(c['length']===0x0||d['length']===0x0)return b;const e=c['map'](f=>({'rail':f,'closed':closingWindowUnavoidable(f['root'],f['table']??[]),'arbGated':arbReadUnavoidable(f['root'])}));for(const f of d){const g=e['filter'](i=>covers(i['rail'],f));if(g['length']===0x0)continue;const h=g['map'](i=>i['rail']['ref']);g['every'](i=>i['closed'])&&b['push']({'code':'RAIL_EXIT_WINDOW_CLOSED','level':'critical','node':f,'refs':h,'detail':'terminal\x20\x22'+f+'\x22\x20has\x20'+g['length']+'\x20allocator\x20rail(s)\x20('+h['join'](',\x20')+')\x20and\x20EVERY\x20one\x20of\x20them\x20'+'carries\x20a\x20monotone-CLOSING\x20clock\x20leg\x20in\x20an\x20unavoidable\x20position\x20—\x20a\x20comparison\x20that\x20becomes\x20permanently\x20'+'false\x20once\x20wall-clock\x20passes\x20its\x20bound.\x20The\x20on-chain\x20clock\x20only\x20ever\x20advances,\x20the\x20remaining-time\x20helper\x20'+'saturates\x20to\x20zero\x20forever\x20past\x20its\x20target,\x20and\x20the\x20anchors\x20these\x20legs\x20are\x20compared\x20against\x20are\x20immutable\x20'+'once\x20written;\x20an\x20order\x20rests\x20at\x20a\x20terminal\x20indefinitely,\x20so\x20the\x20window\x20is\x20guaranteed\x20to\x20close\x20while\x20it\x20is\x20'+'still\x20sitting\x20there.\x0a'+'Consequence:\x20draining\x20escrow\x20through\x20an\x20allocator\x20rail\x20is\x20an\x20EXPLICIT\x20call\x20that\x20the\x20chain\x20honours\x20only\x20'+'when\x20the\x20caller\x20presents\x20a\x20passport\x20proving\x20this\x20very\x20root\x20evaluated\x20true\x20inside\x20the\x20same\x20transaction\x20—\x20'+'no\x20state\x20transition\x20fires\x20it\x20for\x20you.\x20Once\x20the\x20window\x20closes,\x20NO\x20signer\x20can\x20produce\x20that\x20passport,\x20so\x20the\x20'+'terminal\x27s\x20escrow\x20has\x20no\x20exit\x20at\x20all.\x20The\x20allocation\x20pool\x20is\x20append-only\x20with\x20no\x20drain\x20backdoor\x20'+'(F-BS-32:\x20mainnet\x20pool\x200x1dcf3f3a\x20is\x20permanently\x20frozen\x20exactly\x20this\x20way),\x20and\x20rails\x20are\x20immutable\x20after\x20'+'publish\x20(IMMUT-002),\x20so\x20this\x20is\x20unrecoverable\x20on\x20chain.\x0a'+'This\x20is\x20the\x20sanctioned\x20pairing\x20inverted:\x20closing\x20windows\x20belong\x20on\x20a\x20machine\x20FORWARD\x20'+'(pattern.time_window_upper_bound,\x20host:\x20\x22machine_forward\x22),\x20whose\x20own\x20note\x20says\x20\x22an\x20expired\x20window\x20only\x20'+'fails\x20the\x20FORWARD\x20it\x20gates\x20—\x20it\x20does\x20not\x20refund\x20or\x20cancel\x20by\x20itself;\x20pair\x20with\x20a\x20machine\x20expiry\x20node\x20or\x20an\x20'+'allocator\x20recover\x20rail\x20for\x20the\x20post-window\x20fund\x20path\x22.\x20Here\x20the\x20post-window\x20fund\x20path\x20IS\x20what\x20closed.\x0a'+'Fix\x20before\x20publish:\x20keep\x20the\x20closing\x20window\x20on\x20the\x20forward\x20that\x20leaves\x20the\x20pre-terminal\x20node,\x20and\x20give\x20the\x20'+'terminal\x20an\x20OPENING\x20fund\x20rail\x20—\x20pattern.time_lock_progress\x20(Clock\x20>=\x20anchor\x20+\x20lock,\x20permanently\x20true\x20'+'afterwards)\x20or\x20no\x20time\x20leg\x20at\x20all\x20—\x20so\x20money\x20can\x20always\x20leave.\x20A\x20zero-value\x20anchor\x20row\x20on\x20the\x20terminal\x20rail\x20'+'is\x20the\x20sanctioned\x20shape\x20when\x20the\x20pool\x20legitimately\x20drained\x20earlier.'}),g['every'](i=>i['arbGated'])&&b['push']({'code':'RAIL_EXIT_ARB_GATED','level':'critical','node':f,'refs':h,'detail':'terminal\x20\x22'+f+'\x22\x20has\x20'+g['length']+'\x20allocator\x20rail(s)\x20('+h['join'](',\x20')+')\x20and\x20EVERY\x20one\x20of\x20them\x20'+'unavoidably\x20reads\x20an\x20Arb-object\x20query\x20(arb.*).\x20An\x20arb.*\x20leg\x20resolves\x20against\x20an\x20Arb\x20object\x20taken\x20from\x20the\x20'+'guard\x27s\x20constant\x20table\x20or\x20a\x20caller-supplied\x20submission\x20slot;\x20when\x20that\x20object\x20does\x20not\x20exist\x20the\x20read\x20'+'returns\x20W_OBJECT_NOT_FOUND,\x20which\x20PROPAGATES\x20and\x20ABORTS\x20THE\x20WHOLE\x20TRANSACTION\x20—\x20it\x20does\x20not\x20evaluate\x20to\x20'+'false.\x0a'+'Consequence:\x20the\x20majority\x20of\x20orders\x20never\x20open\x20a\x20dispute,\x20so\x20for\x20them\x20there\x20is\x20no\x20Arb\x20object\x20to\x20read\x20and\x20'+'every\x20attempt\x20to\x20drain\x20this\x20terminal\x20aborts.\x20The\x20escrow\x20has\x20no\x20exit\x20for\x20the\x20common\x20case,\x20and\x20rails\x20are\x20'+'immutable\x20after\x20publish\x20(IMMUT-002).\x20A\x20static\x20Arb\x20constant\x20is\x20worse,\x20not\x20better:\x20it\x20pins\x20ONE\x20case,\x20so\x20every\x20'+'other\x20order\x20reads\x20someone\x20else\x27s\x20dispute.\x0a'+'Fix\x20before\x20publish:\x20express\x20the\x20dispute\x20condition\x20on\x20the\x20ORDER,\x20which\x20always\x20exists\x20—\x20order.dispute\x20has\x20'+'(1565)\x20/\x20order.dispute.open\x20(1576)\x20/\x20order.arb.concluded\x20has\x20(1577)\x20/\x20order.dispute.unstamped\x20(1578)\x20/\x20'+'order.principal_refunded\x20(1579)\x20—\x20and\x20keep\x20the\x20arb.*\x20reads\x20(arb.indemnity.amount\x201415\x20and\x20the\x20F-54\x20floor)\x20'+'on\x20the\x20machine\x20FORWARD\x20that\x20the\x20ruling\x20actually\x20drives,\x20or\x20on\x20a\x20SECOND\x20rail\x20so\x20the\x20terminal\x20keeps\x20an\x20'+'arb-free\x20exit.\x20An\x20award\x20rail\x20reading\x20arb.*\x20alongside\x20a\x20node-gated\x20settlement\x20rail\x20is\x20the\x20correct\x20shape\x20and\x20'+'does\x20not\x20trip\x20this\x20gate.'});}return b;}
@@ -69,7 +69,7 @@ export interface RewardErrorCodeEntry {
69
69
  }
70
70
  export declare const REWARD_ERROR_CODES: RewardErrorCodeEntry[];
71
71
  export declare const REWARD_SCENES: RewardScene[];
72
- export declare const REWARD_LEDGER_VERSION = "1.0.0";
72
+ export declare const REWARD_LEDGER_VERSION = "1.1.0";
73
73
  export declare function getScenesByPhase(phase: RewardPhase): RewardScene[];
74
74
  export declare function findSceneById(id: string): RewardScene | undefined;
75
75
  export declare function getScenesByIndustry(industry: string): RewardScene[];
@@ -1 +1 @@
1
- import{MAX_GUARD_COUNT_REWARD,MAX_RECORD_COUNT_REWARD}from'./onchain-constants.js';export{MAX_GUARD_COUNT_REWARD,MAX_RECORD_COUNT_REWARD};export const REWARD_NEW={'index':0x96,'name':'REWARD_NEW','description':'Create\x20new\x20Reward<T>','governed_operations':['create\x20a\x20new\x20Reward\x20pool'],'sdk_exposed':!![]};export const REWARD_DESCRIPTION={'index':0x97,'name':'REWARD_DESCRIPTION','description':'Update\x20description','governed_operations':['update\x20the\x20Reward\x20description'],'sdk_exposed':!![]};export const REWARD_GUARD={'index':0x98,'name':'REWARD_GUARD','description':'Add\x20/\x20remove\x20expired\x20guards\x20(≤\x20MAX_GUARD_COUNT_REWARD=200)','governed_operations':['add\x20a\x20claim\x20guard\x20to\x20the\x20Reward','remove\x20expired\x20claim\x20guards'],'sdk_exposed':!![]};export const REWARD_COIN_ADD={'index':0x99,'name':'REWARD_COIN_ADD','description':'Deposit\x20Coin<T>\x20directly\x20into\x20Reward\x20balance\x20(joins\x20Balance<T>)','governed_operations':['deposit\x20Coin<T>\x20into\x20the\x20Reward\x20balance'],'sdk_exposed':!![]};export const REWARD_RECEIVE={'index':0x9a,'name':'REWARD_RECEIVE','description':'Receive\x20CoinWrapper<T>\x20into\x20the\x20balance\x20(unwrapped\x20with\x20balance\x20check)','governed_operations':['receive\x20a\x20CoinWrapper<T>\x20payment\x20into\x20the\x20balance'],'sdk_exposed':!![]};export const REWARD_GUARD_EXPIRATION_TIME_ADD={'index':0x9b,'name':'REWARD_GUARD_EXPIRATION_TIME_ADD','description':'Set\x20/\x20cancel\x20guard_not_added_expiration_time\x20(time-lock\x20on\x20new\x20guard\x20additions)','governed_operations':['set\x20or\x20cancel\x20the\x20time-lock\x20on\x20adding\x20new\x20guards'],'sdk_exposed':!![]};export const REWARD_OWNER_RECEIVE={'index':0x9c,'name':'REWARD_OWNER_RECEIVE','description':'Owner\x20receives\x20Receiving<K>\x20/\x20CoinWrapper<K>\x20at\x20terminal\x20state\x20(unwrap\x20→\x20owner)','governed_operations':['owner\x20receipt\x20of\x20payments\x20at\x20terminal\x20state\x20(unwrapped\x20to\x20the\x20owner)','owner\x20receipt\x20of\x20whole\x20objects\x20at\x20terminal\x20state'],'sdk_exposed':!![]};export const REWARD_UM={'index':0x9d,'name':'REWARD_UM','description':'Bind\x20/\x20unbind\x20Contact\x20(UM)\x20for\x20off-chain\x20coordination','governed_operations':['bind\x20a\x20Contact\x20as\x20the\x20UM\x20coordinator','unbind\x20the\x20UM\x20Contact'],'sdk_exposed':!![]};export const REWARD_WITHDRAW={'index':0x9e,'name':'REWARD_WITHDRAW','description':'Withdraw\x20balance\x20from\x20the\x20Reward\x20to\x20the\x20tx\x20sender\x20inside\x20a\x20Payment\x20object\x20receipt\x20(ETS-B,\x20the\x20only\x20non-claim\x20exit;\x20blocked\x20while\x20the\x20declared\x20no-guard\x20window\x20guard_not_added_expiration_time\x20is\x20in\x20the\x20future)','governed_operations':['withdraw\x20an\x20amount\x20from\x20the\x20Reward\x20balance,\x20delivered\x20to\x20the\x20executing\x20account\x20inside\x20a\x20Payment\x20object\x20(the\x20on-chain\x20receipt;\x20unwrap\x20mode\x20pays\x20the\x20coin\x20out\x20in\x20the\x20same\x20transaction)\x20(fails\x20with\x20E_GUARD_LOCKED_TIME\x20while\x20guard_not_added_expiration_time\x20is\x20in\x20the\x20future)'],'sdk_exposed':!![]};export const REWARD_PERMISSIONS=[REWARD_NEW,REWARD_DESCRIPTION,REWARD_GUARD,REWARD_COIN_ADD,REWARD_RECEIVE,REWARD_GUARD_EXPIRATION_TIME_ADD,REWARD_OWNER_RECEIVE,REWARD_UM,REWARD_WITHDRAW];export const REWARD_FIELDS=[{'name':'id','move_type':'UID','mutability':'immutable','set_at_creation':!![],'constraint':'Object\x20UID;\x20assigned\x20at\x20creation.\x20Never\x20changes.'},{'name':'description','move_type':'String','mutability':'admin_mutable','set_at_creation':!![],'permission_index':0x97,'constraint':'Must\x20satisfy\x20common::DESCRIPTION.\x20Updated\x20via\x20permission\x20151.'},{'name':'guards','move_type':'vector<RewardGuard>','mutability':'admin_mutable','set_at_creation':!![],'permission_index':0x98,'constraint':'vector::length\x20<\x20MAX_GUARD_COUNT\x20(200);\x20E_GUARD_COUNT_EXCEEDED\x20on\x20overflow.','related_errors':['E_GUARD_COUNT_EXCEEDED']},{'name':'balance','move_type':'Balance<T>','mutability':'runtime','set_at_creation':!![],'constraint':'Zero\x20at\x20creation\x20(balance::zero());\x20grows\x20via\x20coin_add/receive;\x20shrinks\x20via\x20claim\x20(split)\x20and\x20via\x20withdraw\x20(ETS-B,\x20funds\x20leave\x20inside\x20a\x20Payment\x20object\x20receipt,\x20only\x20when\x20the\x20no-guard\x20window\x20has\x20elapsed).','related_errors':['E_INSUFFICIENT_BALANCE','E_GUARD_LOCKED_TIME']},{'name':'guard_not_added_expiration_time','move_type':'Option<u64>','mutability':'admin_mutable','set_at_creation':!![],'permission_index':0x9b,'constraint':'Option<timestamp_ms>.\x20When\x20Some(t):\x20guard_add\x20AND\x20withdraw\x20require\x20clock\x20>\x20t\x20(E_GUARD_LOCKED_TIME).\x20When\x20None\x20or\x20t\x20<\x20now:\x20guards\x20can\x20be\x20added\x20and\x20balance\x20withdrawn.','related_errors':['E_GUARD_LOCKED_TIME','E_GUARD_LOCKED_TIME_NOT_INCREASING','E_GUARD_LOCKED_TIME_INVALID']},{'name':'record','move_type':'ParentTable<address,\x20RecipientRecord>','mutability':'runtime','set_at_creation':!![],'constraint':'Per-recipient\x20claim\x20history.\x20Each\x20RecipientRecord.amount\x20vector\x20has\x20length\x20<\x20MAX_RECORD_COUNT\x20(5200);\x20E_RECORD_COUNT_EXCEEDED\x20on\x20overflow.','related_errors':['E_RECORD_COUNT_EXCEEDED']},{'name':'um','move_type':'Option<address>','mutability':'admin_mutable','set_at_creation':!![],'permission_index':0x9d,'constraint':'Option<Contact\x20address>.\x20Binding\x20creates\x20an\x20object-linker\x20core\x20binding;\x20unbinding\x20disaffiliates.'},{'name':'permission','move_type':'address','mutability':'admin_mutable','set_at_creation':!![],'constraint':'Permission\x20object\x20address.\x20Updated\x20owner-only\x20(asserts\x20old.owner\x20==\x20sender);\x20the\x20change\x20is\x20registered\x20as\x20an\x20object-linker\x20affiliation\x20change.'}];export const REWARD_GUARD_CONSTRUCTORS=[{'constructor':'dynamic_recipient_dynamic_amount','recipient_type':'GuardIdentifier','amount_type':'GuardU64Identifier','params':{'recipient_param':'u8','amount_param':'u8','expiration_time':'Option<u64>','store_from_id':'Option<u8>'},'construction_checks':['recipient\x20identifier\x20must\x20resolve\x20to\x20an\x20address\x20in\x20the\x20Passport\x20table\x20—\x20E_RECIPIENT_IDENTIFIER_NOT_ADDRESS\x20(4)','amount\x20identifier\x20must\x20resolve\x20to\x20a\x20u64\x20Passport\x20value\x20—\x20E_AMOUNT_NOT_U64\x20(5)','if\x20store_from_id\x20is\x20Some:\x20its\x20identifier\x20must\x20be\x20number/address\x20compatible\x20—\x20E_STORE_FROM_ID_NOT_COMPATIBLE\x20(12)'],'typical_use':'Dynamic\x20recipient\x20+\x20dynamic\x20amount\x20—\x20both\x20extracted\x20from\x20Passport\x20at\x20claim\x20time\x20(e.g.\x20referral\x20rewards\x20where\x20referrer\x20and\x20amount\x20vary\x20per\x20claim).'},{'constructor':'dynamic_recipient_fixed_amount','recipient_type':'GuardIdentifier','amount_type':'Fixed','params':{'recipient_param':'u8','amount_param':'u64','expiration_time':'Option<u64>','store_from_id':'Option<u8>'},'construction_checks':['recipient\x20identifier\x20must\x20resolve\x20to\x20an\x20address\x20in\x20the\x20Passport\x20table\x20—\x20E_RECIPIENT_IDENTIFIER_NOT_ADDRESS\x20(4)','if\x20store_from_id\x20is\x20Some:\x20its\x20identifier\x20must\x20be\x20number/address\x20compatible\x20—\x20E_STORE_FROM_ID_NOT_COMPATIBLE\x20(12)'],'typical_use':'Dynamic\x20recipient\x20+\x20fixed\x20amount\x20—\x20e.g.\x20first-order\x20reward\x20where\x20any\x20new\x20customer\x20claims\x20a\x20fixed\x201\x20WOW.'},{'constructor':'entity_recipient_dynamic_amount','recipient_type':'Entity','amount_type':'GuardU64Identifier','params':{'recipient_param':'address','amount_param':'u8','expiration_time':'Option<u64>','store_from_id':'Option<u8>'},'construction_checks':['amount\x20identifier\x20must\x20resolve\x20to\x20a\x20u64\x20Passport\x20value\x20—\x20E_AMOUNT_NOT_U64\x20(5)','if\x20store_from_id\x20is\x20Some:\x20its\x20identifier\x20must\x20be\x20number/address\x20compatible\x20—\x20E_STORE_FROM_ID_NOT_COMPATIBLE\x20(12)'],'typical_use':'Fixed\x20recipient\x20+\x20dynamic\x20amount\x20—\x20e.g.\x20tiered\x20loyalty\x20reward\x20where\x20amount\x20depends\x20on\x20Passport\x20submission\x20(tier\x20level).'},{'constructor':'entity_recipient_fixed_amount','recipient_type':'Entity','amount_type':'Fixed','params':{'recipient_param':'address','amount_param':'u64','expiration_time':'Option<u64>','store_from_id':'Option<u8>'},'construction_checks':['if\x20store_from_id\x20is\x20Some:\x20its\x20identifier\x20must\x20be\x20number/address\x20compatible\x20—\x20E_STORE_FROM_ID_NOT_COMPATIBLE\x20(12)'],'typical_use':'Fully\x20fixed\x20recipient\x20+\x20amount\x20—\x20simplest\x20configuration\x20(e.g.\x20specific\x20partner\x20bounty).'},{'constructor':'caller_recipient_dynamic_amount','recipient_type':'Signer','amount_type':'GuardU64Identifier','params':{'amount_param':'u8','expiration_time':'Option<u64>','store_from_id':'Option<u8>'},'construction_checks':['amount\x20identifier\x20must\x20resolve\x20to\x20a\x20u64\x20Passport\x20value\x20—\x20E_AMOUNT_NOT_U64\x20(5)','if\x20store_from_id\x20is\x20Some:\x20its\x20identifier\x20must\x20be\x20number/address\x20compatible\x20—\x20E_STORE_FROM_ID_NOT_COMPATIBLE\x20(12)'],'typical_use':'Caller\x20is\x20recipient\x20+\x20dynamic\x20amount\x20—\x20e.g.\x20self-service\x20claim\x20where\x20amount\x20depends\x20on\x20Passport\x20submission\x20(e.g.\x20cashback\x20rate).'},{'constructor':'caller_recipient_fixed_amount','recipient_type':'Signer','amount_type':'Fixed','params':{'amount_param':'u64','expiration_time':'Option<u64>','store_from_id':'Option<u8>'},'construction_checks':['if\x20store_from_id\x20is\x20Some:\x20its\x20identifier\x20must\x20be\x20number/address\x20compatible\x20—\x20E_STORE_FROM_ID_NOT_COMPATIBLE\x20(12)'],'typical_use':'Caller\x20is\x20recipient\x20+\x20fixed\x20amount\x20—\x20e.g.\x20flash\x20sale\x20where\x20any\x20eligible\x20caller\x20claims\x20a\x20fixed\x20reward.'}];export const REWARD_ERROR_CODES=[{'code':0x1,'name':'E_GUARD_LOCKED_TIME_NOT_INCREASING','description':'guard-lock\x20time\x20update:\x20new\x20time\x20<\x20current\x20clock\x20(must\x20be\x20≥\x20now)','trigger_operation':'guard-lock\x20time\x20update\x20(155)'},{'code':0x2,'name':'E_GUARD_EXPIRED','description':'guard_add\x20on\x20guard\x20with\x20expiration_time\x20<\x20now,\x20OR\x20claim\x20on\x20guard\x20with\x20expiration_time\x20<\x20now','trigger_operation':'guard_add\x20/\x20claim'},{'code':0x3,'name':'E_GUARD_COUNT_EXCEEDED','description':'guard_add\x20would\x20exceed\x20MAX_GUARD_COUNT=200\x20(only\x20on\x20NEW\x20guard,\x20not\x20on\x20update\x20of\x20existing)','trigger_operation':'guard_add'},{'code':0x4,'name':'E_RECIPIENT_IDENTIFIER_NOT_ADDRESS','description':'RewardGuard\x20constructor:\x20recipient\x20identifier\x20type\x20is\x20not\x20address\x20(GuardIdentifier\x20variant\x20only)','trigger_operation':'claim-guard\x20construction'},{'code':0x5,'name':'E_AMOUNT_NOT_U64','description':'RewardGuard\x20constructor:\x20amount\x20identifier\x20type\x20is\x20not\x20u64\x20(GuardU64Identifier\x20variant\x20only)','trigger_operation':'claim-guard\x20construction'},{'code':0x6,'name':'E_INSUFFICIENT_BALANCE','description':'claim:\x20balance\x20<\x20amount\x20(cannot\x20split\x20more\x20than\x20held)','trigger_operation':'claim'},{'code':0x7,'name':'E_GUARD_NOT_FOUND','description':'claim:\x20no\x20guard\x20in\x20self.guards\x20matches\x20the\x20supplied\x20guard\x20address','trigger_operation':'claim'},{'code':0x8,'name':'E_RECORD_COUNT_EXCEEDED','description':'claim:\x20recipient\x20already\x20has\x20MAX_RECORD_COUNT=5200\x20entries\x20(E_RECORD_COUNT_EXCEEDED)','trigger_operation':'claim'},{'code':0xa,'name':'E_GUARD_LOCKED_TIME','description':'guard_add\x20/\x20withdraw\x20while\x20guard_not_added_expiration_time\x20is\x20Some\x20and\x20clock\x20≤\x20expiration_time','trigger_operation':'guard_add\x20/\x20withdraw'},{'code':0xb,'name':'E_GUARD_LOCKED_TIME_INVALID','description':'guard-lock\x20time\x20update:\x20new\x20Some(t)\x20where\x20t\x20≤\x20now\x20(must\x20be\x20future)','trigger_operation':'guard-lock\x20time\x20update\x20(155)'},{'code':0xc,'name':'E_STORE_FROM_ID_NOT_COMPATIBLE','description':'RewardGuard\x20constructor:\x20store_from_id\x20identifier\x20type\x20is\x20not\x20number\x20or\x20address','trigger_operation':'claim-guard\x20construction'},{'code':0xd,'name':'E_CLAIM_ALREADY_MADE','description':'claim:\x20the\x20once-slot\x20for\x20this\x20(guard,\x20store_from\x20value)\x20was\x20already\x20claimed\x20by\x20any\x20signer\x20—\x20first\x20come,\x20first\x20served\x20(MOV-PROTOCOL-1212\x20F-01\x20fix\x20—\x20replay\x20aborts,\x20the\x20pool\x20keeps\x20its\x20balance;\x20P155-08\x20v139:\x20a\x20stamped\x20slot\x20pins\x20the\x20key\x27s\x20recipient\x20axis\x20to\x20the\x20@0x0\x20sentinel,\x20so\x20the\x20once\x20domain\x20is\x20(guard,\x20store_from),\x20not\x20per-recipient).\x20Empty\x20store_from\x20slot\x20=\x20once\x20per\x20(recipient,\x20guard),\x20unchanged','trigger_operation':'claim'},{'code':0xe,'name':'E_CLAIM_RECIPIENT_NOT_SIGNER','description':'claim:\x20the\x20resolved\x20recipient\x20(from\x20guard\x20submissions\x20or\x20the\x20Entity\x20binding)\x20is\x20not\x20the\x20transaction\x20sender\x20(MOV-PROTOCOL-1212\x20B5\x20fix\x20—\x20an\x20attacker\x20cannot\x20route\x20a\x20reward\x20to\x20a\x20third\x20address).\x20Entity\x20flows\x20pass\x20because\x20the\x20SDK\x20replaces\x20the\x20sender\x20with\x20the\x20entity\x20account','trigger_operation':'claim'}];export const REWARD_SCENES=[{'id':'reward_first_order','name':'First-order\x20reward','industry':['universal','ecommerce','service','freelance'],'scenario':'New\x20customers\x20receive\x20a\x20fixed\x20reward\x20after\x20their\x20first\x20order.\x20Guard\x20verifies\x20order\x20ownership\x20+\x20first-time\x20status;\x20'+'Recipient=Signer\x20(caller\x20is\x20the\x20new\x20customer);\x20Amount=Fixed\x20(e.g.\x201\x20WOW).','phases':['creation','guard_addition','funds_replenish','claim'],'coin_type_note':'T\x20=\x20project\x20reward\x20coin\x20(e.g.\x200x2::wow::WOW\x20or\x20a\x20custom\x20token)','typical_guard_count':0x1,'recipient_types_used':['Signer'],'amount_types_used':['Fixed'],'uses_expiration_time':!![],'uses_store_from_id':![],'builtin_indexes_consumed':[REWARD_NEW,REWARD_GUARD,REWARD_COIN_ADD],'common_patterns':['Signer\x20recipient\x20+\x20Fixed\x20amount\x20—\x20caller\x20claims\x20a\x20fixed\x20amount\x20(e.g.\x201\x20WOW)','Guard\x20verifies:\x20order_address.holder\x20==\x20signer\x20AND\x20order\x20is\x20the\x20first\x20order\x20(Repository\x20query)','expiration_time\x20bounds\x20the\x20campaign\x20window\x20(e.g.\x2030\x20days)','coin_add\x20deposits\x20the\x20campaign\x20budget\x20upfront\x20(e.g.\x20100\x20WOW\x20for\x20100\x20claims)'],'recommended_templates':['first_order']},{'id':'reward_referral','name':'Referral\x20viral\x20reward','industry':['universal','ecommerce','service','content'],'scenario':'Both\x20referrer\x20and\x20referee\x20receive\x20a\x20reward\x20when\x20the\x20referee\x20completes\x20a\x20first\x20order.\x20Two\x20guards:\x20one\x20for\x20referrer\x20(Entity),\x20one\x20for\x20referee\x20(Signer).','phases':['creation','guard_addition','funds_replenish','claim'],'coin_type_note':'T\x20=\x20project\x20reward\x20coin','typical_guard_count':0x2,'recipient_types_used':['Entity','Signer'],'amount_types_used':['Fixed'],'uses_expiration_time':!![],'uses_store_from_id':!![],'builtin_indexes_consumed':[REWARD_NEW,REWARD_GUARD,REWARD_COIN_ADD],'common_patterns':['Entity\x20recipient\x20+\x20Fixed\x20amount\x20for\x20the\x20referrer\x20(recipient\x20=\x20referrer\x20address)','Signer\x20recipient\x20+\x20Fixed\x20amount\x20for\x20the\x20referee\x20(caller\x20is\x20recipient)','Guard\x20verifies:\x20referrer\x20marked\x20in\x20Repository\x20AND\x20referee\x27s\x20order\x20completed','store_from_id\x20may\x20record\x20the\x20order\x20address\x20for\x20audit\x20trail'],'recommended_templates':['referral']},{'id':'reward_loyalty','name':'Loyalty\x20tiered\x20reward','industry':['universal','ecommerce','subscription','content'],'scenario':'Customers\x20unlock\x20higher\x20rewards\x20after\x20reaching\x20cumulative\x20spending\x20tiers.\x20Recipient=Signer;\x20Amount=GuardU64Identifier\x20(tier-dependent\x20amount\x20extracted\x20from\x20Passport).','phases':['creation','guard_addition','funds_replenish','claim'],'coin_type_note':'T\x20=\x20project\x20reward\x20coin','typical_guard_count':0x1,'recipient_types_used':['Signer'],'amount_types_used':['GuardU64Identifier'],'uses_expiration_time':![],'uses_store_from_id':![],'builtin_indexes_consumed':[REWARD_NEW,REWARD_GUARD,REWARD_COIN_ADD],'common_patterns':['Signer\x20recipient\x20+\x20identifier\x20amount\x20—\x20amount\x20is\x20dynamic,\x20extracted\x20from\x20Passport\x20submission\x20(tier\x20level\x20→\x20reward\x20amount)','Guard\x20verifies:\x20cumulative\x20spend\x20≥\x20tier\x20threshold\x20(Repository\x20query)','No\x20expiration_time\x20—\x20loyalty\x20is\x20perpetual\x20(until\x20deactivated\x20via\x20guard_remove)','Guard\x20submission\x20value\x20type\x20MUST\x20be\x20u64\x20(E_AMOUNT_NOT_U64\x20otherwise)'],'recommended_templates':['loyalty']},{'id':'reward_flash_sale','name':'Limited-time\x20flash\x20sale\x20reward','industry':['universal','ecommerce','retail'],'scenario':'Time-bounded\x20reward\x20for\x20the\x20first\x20N\x20callers.\x20Recipient=Signer;\x20Amount=Fixed.\x20Guard\x20verifies\x20time\x20window\x20+\x20claim\x20count.','phases':['creation','guard_addition','funds_replenish','claim','guard_lock_mgmt'],'coin_type_note':'T\x20=\x20project\x20reward\x20coin','typical_guard_count':0x1,'recipient_types_used':['Signer'],'amount_types_used':['Fixed'],'uses_expiration_time':!![],'uses_store_from_id':![],'builtin_indexes_consumed':[REWARD_NEW,REWARD_GUARD,REWARD_COIN_ADD,REWARD_GUARD_EXPIRATION_TIME_ADD],'common_patterns':['Signer\x20recipient\x20+\x20Fixed\x20amount\x20—\x20fixed\x20amount\x20per\x20claim\x20(e.g.\x202\x20WOW)','expiration_time\x20bounds\x20the\x20flash\x20sale\x20window\x20(e.g.\x2048\x20hours)','the\x20guard-addition\x20time-lock\x20(155)\x20may\x20lock\x20further\x20guard\x20additions\x20during\x20the\x20sale','Budget\x20=\x20max_claims\x20×\x20amount;\x20coin_add\x20deposits\x20this\x20upfront'],'recommended_templates':['flash_sale']},{'id':'reward_bulk_discount','name':'Bulk\x20discount\x20/\x20cashback\x20reward','industry':['universal','ecommerce','wholesale','service'],'scenario':'Customer\x20receives\x20cashback\x20proportional\x20to\x20order\x20size.\x20Recipient=Signer\x20or\x20Entity\x20(order\x20holder);\x20Amount=GuardU64Identifier\x20(cashback\x20rate\x20from\x20Passport).','phases':['creation','guard_addition','funds_replenish','claim'],'coin_type_note':'T\x20=\x20payment\x20coin\x20type\x20(must\x20match\x20order\x20payment\x20for\x20clean\x20cashback)','typical_guard_count':0x1,'recipient_types_used':['Signer','Entity'],'amount_types_used':['GuardU64Identifier'],'uses_expiration_time':![],'uses_store_from_id':!![],'builtin_indexes_consumed':[REWARD_NEW,REWARD_GUARD,REWARD_COIN_ADD,REWARD_RECEIVE],'common_patterns':['Signer\x20recipient\x20+\x20identifier\x20amount\x20—\x20caller\x20claims\x20dynamic\x20amount\x20(cashback\x20=\x20order_amount\x20×\x20rate)','store_from_id\x20records\x20the\x20order\x20address\x20for\x20cross-reference\x20(audit\x20trail)','receive\x20(154)\x20may\x20be\x20used\x20to\x20accept\x20CoinWrapper<T>\x20refunds\x20that\x20replenish\x20the\x20balance','Guard\x20verifies:\x20order.completed\x20AND\x20order.service\x20==\x20this\x20Service'],'recommended_templates':['cashback']},{'id':'reward_milestone','name':'Service\x20milestone\x20reward','industry':['universal','ecommerce','content','subscription'],'scenario':'When\x20a\x20Service\x20reaches\x20a\x20milestone\x20(e.g.\x20100\x20orders),\x20early\x20supporters\x20receive\x20extra\x20rewards.\x20Recipient=Entity\x20(early\x20customer);\x20Amount=Fixed.','phases':['creation','guard_addition','funds_replenish','claim','guard_lock_mgmt'],'coin_type_note':'T\x20=\x20project\x20reward\x20coin','typical_guard_count':0x32,'recipient_types_used':['Entity'],'amount_types_used':['Fixed'],'uses_expiration_time':!![],'uses_store_from_id':![],'builtin_indexes_consumed':[REWARD_NEW,REWARD_GUARD,REWARD_COIN_ADD,REWARD_GUARD_EXPIRATION_TIME_ADD],'common_patterns':['Entity\x20recipient\x20+\x20Fixed\x20amount\x20for\x20each\x20early\x20customer\x20(recipient\x20=\x20customer\x20address)','Multiple\x20guards\x20(up\x20to\x2050\x20for\x2050\x20early\x20supporters)\x20—\x20well\x20within\x20MAX_GUARD_COUNT=200','Guard\x20verifies:\x20Service\x20order_count\x20>=\x20milestone\x20AND\x20claimer\x20is\x20in\x20early-customer\x20list','the\x20guard-addition\x20time-lock\x20(155)\x20may\x20lock\x20the\x20guard\x20list\x20after\x20milestone\x20setup'],'recommended_templates':['milestone']}];export const REWARD_LEDGER_VERSION='1.0.0';export function getScenesByPhase(a){return REWARD_SCENES['filter'](b=>b['phases']['includes'](a));}export function findSceneById(a){return REWARD_SCENES['find'](b=>b['id']===a);}export function getScenesByIndustry(a){return REWARD_SCENES['filter'](b=>b['industry']['includes'](a)||b['industry']['includes']('universal'));}export function getBuiltinPermissionByIndex(a){return REWARD_PERMISSIONS['find'](b=>b['index']===a);}export function isRewardBuiltinPermission(a){return getBuiltinPermissionByIndex(a)!==undefined;}export function getAllBuiltinPermissions(){return[...REWARD_PERMISSIONS];}export function getRewardScenesCount(){return REWARD_SCENES['length'];}export function getGuardConstructorSpec(a){return REWARD_GUARD_CONSTRUCTORS['find'](b=>b['constructor']===a);}export function resolveGuardConstructor(a,b){const c={'GuardIdentifier|GuardU64Identifier':'dynamic_recipient_dynamic_amount','GuardIdentifier|Fixed':'dynamic_recipient_fixed_amount','Entity|GuardU64Identifier':'entity_recipient_dynamic_amount','Entity|Fixed':'entity_recipient_fixed_amount','Signer|GuardU64Identifier':'caller_recipient_dynamic_amount','Signer|Fixed':'caller_recipient_fixed_amount'};return c[a+'|'+b];}export function getRewardErrorByCode(a){return REWARD_ERROR_CODES['find'](b=>b['code']===a);}export function getRewardErrorByName(a){return REWARD_ERROR_CODES['find'](b=>b['name']===a);}export function validateGuardCount(a){if(a>=MAX_GUARD_COUNT_REWARD)return{'ok':![],'violation':'Guard\x20count\x20'+a+'\x20would\x20exceed\x20MAX_GUARD_COUNT_REWARD\x20'+MAX_GUARD_COUNT_REWARD};return{'ok':!![]};}export function validateRecordCount(a){if(a>=MAX_RECORD_COUNT_REWARD)return{'ok':![],'violation':'Record\x20count\x20'+a+'\x20would\x20exceed\x20MAX_RECORD_COUNT_REWARD\x20'+MAX_RECORD_COUNT_REWARD+'\x20—\x20recipient\x20can\x20no\x20longer\x20claim'};return{'ok':!![]};}export function inferSceneFromIntent(a){const b=a['toLowerCase'](),c=[['flash\x20sale','reward_flash_sale'],['flash_sale','reward_flash_sale'],['limited-time','reward_flash_sale'],['limited\x20time','reward_flash_sale'],['referral','reward_referral'],['viral','reward_referral'],['refer\x20a\x20friend','reward_referral'],['invite','reward_referral'],['loyalty','reward_loyalty'],['tiered','reward_loyalty'],['tier','reward_loyalty'],['repeat','reward_loyalty'],['cashback','reward_bulk_discount'],['bulk\x20discount','reward_bulk_discount'],['bulk_discount','reward_bulk_discount'],['wholesale','reward_bulk_discount'],['milestone','reward_milestone'],['early\x20supporter','reward_milestone'],['early\x20customer','reward_milestone'],['first\x20order','reward_first_order'],['first_order','reward_first_order'],['new\x20customer','reward_first_order'],['first-time','reward_first_order']];for(const [d,e]of c){if(b['includes'](d)){const f=findSceneById(e);if(f)return f;}}return undefined;}export const REWARD_CROSS_OBJECT_REFS=[{'object':'Permission','phase':'universal','relationship':'Reward.permission\x20(address;\x20borrowed\x20for\x20all\x20150-157\x20assertions)'},{'object':'Permission','phase':'permission_update','relationship':'permission\x20update:\x20owner-only\x20(asserts\x20old.owner\x20==\x20sender);\x20registered\x20as\x20an\x20object-linker\x20affiliation\x20change'},{'object':'Guard','phase':'guard_addition','relationship':'RewardGuard.guard\x20=\x20guard.id_address\x20(each\x20guard\x20registered\x20via\x20object-linker\x20core\x20binding)'},{'object':'Guard','phase':'claim','relationship':'claim:\x20iterates\x20self.guards\x20looking\x20for\x20guard.id_address\x20match;\x20E_GUARD_NOT_FOUND\x20if\x20no\x20match'},{'object':'Guard','phase':'claim','relationship':'claim:\x20the\x20guard\x20verification\x20result\x20validates\x20the\x20Passport\x20submission\x20data'},{'object':'Passport','phase':'claim','relationship':'claim:\x20the\x20claimant\x27s\x20Passport\x20submission\x20supplies\x20the\x20recipient\x20(address)\x20and/or\x20amount\x20(u64)\x20per\x20RewardGuard\x20variant'},{'object':'Passport','phase':'claim','relationship':'claim:\x20if\x20store_from_id\x20is\x20Some,\x20extracts\x20store-from\x20address\x20from\x20Passport\x20submission'},{'object':'Payment','phase':'funds_replenish','relationship':'receive\x20(154):\x20unwraps\x20Coin<T>\x20from\x20CoinWrapper<T>\x20(with\x20check)\x20and\x20joins\x20the\x20balance'},{'object':'Payment','phase':'owner_receive','relationship':'owner\x20receipt\x20(156):\x20unwraps\x20CoinWrapper<K>\x20and\x20forwards\x20it\x20to\x20the\x20Permission\x20owner'},{'object':'Repository','phase':'claim','relationship':'Guard\x20may\x20query\x20Repository\x20(e.g.\x20order\x20history\x20for\x20first-order\x20/\x20loyalty\x20verification)'},{'object':'Service','phase':'claim','relationship':'Guard\x20may\x20verify\x20order.service\x20==\x20this\x20Service\x20(cashback\x20/\x20first-order\x20scenarios)'},{'object':'Demand','phase':'guard_addition','relationship':'Guard\x20may\x20be\x20shared\x20with\x20Demand\x20(recommendation\x20filtering);\x20same\x20Guard\x20object\x20address\x20space'},{'object':'Allocation','phase':'owner_receive','relationship':'Terminal\x20Allocation\x20alloc\x20may\x20route\x20funds\x20back\x20to\x20Reward\x20(replenishment\x20loop)'},{'object':'Contact','phase':'um_mgmt','relationship':'UM\x20binding\x20(157):\x20binds\x20Contact\x20(UM)\x20for\x20off-chain\x20coordination;\x20creates\x20object-linker\x20core\x20binding'},{'object':'Coin','phase':'universal','relationship':'Reward<phantom\x20T>:\x20T\x20is\x20the\x20coin\x20type;\x20balance:\x20Balance<T>;\x20coin_add\x20expects\x20Coin<T>'}];
1
+ import{MAX_GUARD_COUNT_REWARD,MAX_RECORD_COUNT_REWARD}from'./onchain-constants.js';export{MAX_GUARD_COUNT_REWARD,MAX_RECORD_COUNT_REWARD};export const REWARD_NEW={'index':0x96,'name':'REWARD_NEW','description':'Create\x20new\x20Reward<T>','governed_operations':['create\x20a\x20new\x20Reward\x20pool'],'sdk_exposed':!![]};export const REWARD_DESCRIPTION={'index':0x97,'name':'REWARD_DESCRIPTION','description':'Update\x20description','governed_operations':['update\x20the\x20Reward\x20description'],'sdk_exposed':!![]};export const REWARD_GUARD={'index':0x98,'name':'REWARD_GUARD','description':'Add\x20/\x20remove\x20expired\x20guards\x20(≤\x20MAX_GUARD_COUNT_REWARD=200)','governed_operations':['add\x20a\x20claim\x20guard\x20to\x20the\x20Reward','remove\x20expired\x20claim\x20guards'],'sdk_exposed':!![]};export const REWARD_COIN_ADD={'index':0x99,'name':'REWARD_COIN_ADD','description':'Deposit\x20Coin<T>\x20directly\x20into\x20Reward\x20balance\x20(joins\x20Balance<T>)','governed_operations':['deposit\x20Coin<T>\x20into\x20the\x20Reward\x20balance'],'sdk_exposed':!![]};export const REWARD_RECEIVE={'index':0x9a,'name':'REWARD_RECEIVE','description':'Receive\x20CoinWrapper<T>\x20into\x20the\x20balance\x20(unwrapped\x20with\x20balance\x20check)','governed_operations':['receive\x20a\x20CoinWrapper<T>\x20payment\x20into\x20the\x20balance'],'sdk_exposed':!![]};export const REWARD_GUARD_EXPIRATION_TIME_ADD={'index':0x9b,'name':'REWARD_GUARD_EXPIRATION_TIME_ADD','description':'Set\x20/\x20cancel\x20guard_not_added_expiration_time\x20(time-lock\x20on\x20new\x20guard\x20additions)','governed_operations':['set\x20or\x20cancel\x20the\x20time-lock\x20on\x20adding\x20new\x20guards'],'sdk_exposed':!![]};export const REWARD_OWNER_RECEIVE={'index':0x9c,'name':'REWARD_OWNER_RECEIVE','description':'Owner\x20receives\x20Receiving<K>\x20/\x20CoinWrapper<K>\x20at\x20terminal\x20state\x20(unwrap\x20→\x20owner)','governed_operations':['owner\x20receipt\x20of\x20payments\x20at\x20terminal\x20state\x20(unwrapped\x20to\x20the\x20owner)','owner\x20receipt\x20of\x20whole\x20objects\x20at\x20terminal\x20state'],'sdk_exposed':!![]};export const REWARD_UM={'index':0x9d,'name':'REWARD_UM','description':'Bind\x20/\x20unbind\x20Contact\x20(UM)\x20for\x20off-chain\x20coordination','governed_operations':['bind\x20a\x20Contact\x20as\x20the\x20UM\x20coordinator','unbind\x20the\x20UM\x20Contact'],'sdk_exposed':!![]};export const REWARD_WITHDRAW={'index':0x9e,'name':'REWARD_WITHDRAW','description':'Withdraw\x20balance\x20from\x20the\x20Reward\x20to\x20the\x20tx\x20sender\x20inside\x20a\x20Payment\x20object\x20receipt\x20(ETS-B,\x20the\x20only\x20non-claim\x20exit;\x20blocked\x20while\x20the\x20declared\x20no-guard\x20window\x20guard_not_added_expiration_time\x20is\x20in\x20the\x20future)','governed_operations':['withdraw\x20an\x20amount\x20from\x20the\x20Reward\x20balance,\x20delivered\x20to\x20the\x20executing\x20account\x20inside\x20a\x20Payment\x20object\x20(the\x20on-chain\x20receipt;\x20unwrap\x20mode\x20pays\x20the\x20coin\x20out\x20in\x20the\x20same\x20transaction)\x20(fails\x20with\x20E_GUARD_LOCKED_TIME\x20while\x20guard_not_added_expiration_time\x20is\x20in\x20the\x20future)'],'sdk_exposed':!![]};export const REWARD_PERMISSIONS=[REWARD_NEW,REWARD_DESCRIPTION,REWARD_GUARD,REWARD_COIN_ADD,REWARD_RECEIVE,REWARD_GUARD_EXPIRATION_TIME_ADD,REWARD_OWNER_RECEIVE,REWARD_UM,REWARD_WITHDRAW];export const REWARD_FIELDS=[{'name':'id','move_type':'UID','mutability':'immutable','set_at_creation':!![],'constraint':'Object\x20UID;\x20assigned\x20at\x20creation.\x20Never\x20changes.'},{'name':'description','move_type':'String','mutability':'admin_mutable','set_at_creation':!![],'permission_index':0x97,'constraint':'Must\x20satisfy\x20common::DESCRIPTION.\x20Updated\x20via\x20permission\x20151.'},{'name':'guards','move_type':'vector<RewardGuard>','mutability':'admin_mutable','set_at_creation':!![],'permission_index':0x98,'constraint':'vector::length\x20<\x20MAX_GUARD_COUNT\x20(200);\x20E_GUARD_COUNT_EXCEEDED\x20on\x20overflow.','related_errors':['E_GUARD_COUNT_EXCEEDED']},{'name':'balance','move_type':'Balance<T>','mutability':'runtime','set_at_creation':!![],'constraint':'Zero\x20at\x20creation\x20(balance::zero());\x20grows\x20via\x20coin_add/receive;\x20shrinks\x20via\x20claim\x20(split)\x20and\x20via\x20withdraw\x20(ETS-B,\x20funds\x20leave\x20inside\x20a\x20Payment\x20object\x20receipt,\x20only\x20when\x20the\x20no-guard\x20window\x20has\x20elapsed).','related_errors':['E_INSUFFICIENT_BALANCE','E_GUARD_LOCKED_TIME']},{'name':'guard_not_added_expiration_time','move_type':'Option<u64>','mutability':'admin_mutable','set_at_creation':!![],'permission_index':0x9b,'constraint':'Option<timestamp_ms>.\x20When\x20Some(t):\x20guard_add\x20AND\x20withdraw\x20require\x20clock\x20>\x20t\x20(E_GUARD_LOCKED_TIME).\x20When\x20None\x20or\x20t\x20<\x20now:\x20guards\x20can\x20be\x20added\x20and\x20balance\x20withdrawn.','related_errors':['E_GUARD_LOCKED_TIME','E_GUARD_LOCKED_TIME_NOT_INCREASING','E_GUARD_LOCKED_TIME_INVALID']},{'name':'record','move_type':'ParentTable<address,\x20RecipientRecord>','mutability':'runtime','set_at_creation':!![],'constraint':'Per-recipient\x20claim\x20history.\x20Each\x20RecipientRecord.amount\x20vector\x20has\x20length\x20<\x20MAX_RECORD_COUNT\x20(5200);\x20E_RECORD_COUNT_EXCEEDED\x20on\x20overflow.','related_errors':['E_RECORD_COUNT_EXCEEDED']},{'name':'um','move_type':'Option<address>','mutability':'admin_mutable','set_at_creation':!![],'permission_index':0x9d,'constraint':'Option<Contact\x20address>.\x20Binding\x20creates\x20an\x20object-linker\x20core\x20binding;\x20unbinding\x20disaffiliates.'},{'name':'permission','move_type':'address','mutability':'admin_mutable','set_at_creation':!![],'constraint':'Permission\x20object\x20address.\x20Updated\x20owner-only\x20(asserts\x20old.owner\x20==\x20sender);\x20the\x20change\x20is\x20registered\x20as\x20an\x20object-linker\x20affiliation\x20change.'}];export const REWARD_GUARD_CONSTRUCTORS=[{'constructor':'dynamic_recipient_dynamic_amount','recipient_type':'GuardIdentifier','amount_type':'GuardU64Identifier','params':{'recipient_param':'u8','amount_param':'u8','expiration_time':'Option<u64>','store_from_id':'Option<u8>'},'construction_checks':['recipient\x20identifier\x20must\x20resolve\x20to\x20an\x20address\x20in\x20the\x20Passport\x20table\x20—\x20E_RECIPIENT_IDENTIFIER_NOT_ADDRESS\x20(4)','amount\x20identifier\x20must\x20resolve\x20to\x20a\x20u64\x20Passport\x20value\x20—\x20E_AMOUNT_NOT_U64\x20(5)','if\x20store_from_id\x20is\x20Some:\x20its\x20identifier\x20must\x20be\x20number/address\x20compatible\x20—\x20E_STORE_FROM_ID_NOT_COMPATIBLE\x20(12)'],'typical_use':'Dynamic\x20recipient\x20+\x20dynamic\x20amount\x20—\x20both\x20extracted\x20from\x20Passport\x20at\x20claim\x20time\x20(e.g.\x20referral\x20rewards\x20where\x20referrer\x20and\x20amount\x20vary\x20per\x20claim).'},{'constructor':'dynamic_recipient_fixed_amount','recipient_type':'GuardIdentifier','amount_type':'Fixed','params':{'recipient_param':'u8','amount_param':'u64','expiration_time':'Option<u64>','store_from_id':'Option<u8>'},'construction_checks':['recipient\x20identifier\x20must\x20resolve\x20to\x20an\x20address\x20in\x20the\x20Passport\x20table\x20—\x20E_RECIPIENT_IDENTIFIER_NOT_ADDRESS\x20(4)','if\x20store_from_id\x20is\x20Some:\x20its\x20identifier\x20must\x20be\x20number/address\x20compatible\x20—\x20E_STORE_FROM_ID_NOT_COMPATIBLE\x20(12)'],'typical_use':'Dynamic\x20recipient\x20+\x20fixed\x20amount\x20—\x20e.g.\x20first-order\x20reward\x20where\x20any\x20new\x20customer\x20claims\x20a\x20fixed\x201\x20WOW.'},{'constructor':'entity_recipient_dynamic_amount','recipient_type':'Entity','amount_type':'GuardU64Identifier','params':{'recipient_param':'address','amount_param':'u8','expiration_time':'Option<u64>','store_from_id':'Option<u8>'},'construction_checks':['amount\x20identifier\x20must\x20resolve\x20to\x20a\x20u64\x20Passport\x20value\x20—\x20E_AMOUNT_NOT_U64\x20(5)','if\x20store_from_id\x20is\x20Some:\x20its\x20identifier\x20must\x20be\x20number/address\x20compatible\x20—\x20E_STORE_FROM_ID_NOT_COMPATIBLE\x20(12)'],'typical_use':'Fixed\x20recipient\x20+\x20dynamic\x20amount\x20—\x20e.g.\x20tiered\x20loyalty\x20reward\x20where\x20amount\x20depends\x20on\x20Passport\x20submission\x20(tier\x20level).'},{'constructor':'entity_recipient_fixed_amount','recipient_type':'Entity','amount_type':'Fixed','params':{'recipient_param':'address','amount_param':'u64','expiration_time':'Option<u64>','store_from_id':'Option<u8>'},'construction_checks':['if\x20store_from_id\x20is\x20Some:\x20its\x20identifier\x20must\x20be\x20number/address\x20compatible\x20—\x20E_STORE_FROM_ID_NOT_COMPATIBLE\x20(12)'],'typical_use':'Fully\x20fixed\x20recipient\x20+\x20amount\x20—\x20simplest\x20configuration\x20(e.g.\x20specific\x20partner\x20bounty).'},{'constructor':'caller_recipient_dynamic_amount','recipient_type':'Signer','amount_type':'GuardU64Identifier','params':{'amount_param':'u8','expiration_time':'Option<u64>','store_from_id':'Option<u8>'},'construction_checks':['amount\x20identifier\x20must\x20resolve\x20to\x20a\x20u64\x20Passport\x20value\x20—\x20E_AMOUNT_NOT_U64\x20(5)','if\x20store_from_id\x20is\x20Some:\x20its\x20identifier\x20must\x20be\x20number/address\x20compatible\x20—\x20E_STORE_FROM_ID_NOT_COMPATIBLE\x20(12)'],'typical_use':'Caller\x20is\x20recipient\x20+\x20dynamic\x20amount\x20—\x20e.g.\x20self-service\x20claim\x20where\x20amount\x20depends\x20on\x20Passport\x20submission\x20(e.g.\x20cashback\x20rate).'},{'constructor':'caller_recipient_fixed_amount','recipient_type':'Signer','amount_type':'Fixed','params':{'amount_param':'u64','expiration_time':'Option<u64>','store_from_id':'Option<u8>'},'construction_checks':['if\x20store_from_id\x20is\x20Some:\x20its\x20identifier\x20must\x20be\x20number/address\x20compatible\x20—\x20E_STORE_FROM_ID_NOT_COMPATIBLE\x20(12)'],'typical_use':'Caller\x20is\x20recipient\x20+\x20fixed\x20amount\x20—\x20e.g.\x20flash\x20sale\x20where\x20any\x20eligible\x20caller\x20claims\x20a\x20fixed\x20reward.'}];export const REWARD_ERROR_CODES=[{'code':0x1,'name':'E_GUARD_LOCKED_TIME_NOT_INCREASING','description':'guard-lock\x20time\x20update:\x20new\x20time\x20<\x20current\x20clock\x20(must\x20be\x20≥\x20now)','trigger_operation':'guard-lock\x20time\x20update\x20(155)'},{'code':0x2,'name':'E_GUARD_EXPIRED','description':'guard_add\x20on\x20guard\x20with\x20expiration_time\x20<\x20now,\x20OR\x20claim\x20on\x20guard\x20with\x20expiration_time\x20<\x20now','trigger_operation':'guard_add\x20/\x20claim'},{'code':0x3,'name':'E_GUARD_COUNT_EXCEEDED','description':'guard_add\x20would\x20exceed\x20MAX_GUARD_COUNT=200\x20(only\x20on\x20NEW\x20guard,\x20not\x20on\x20update\x20of\x20existing)','trigger_operation':'guard_add'},{'code':0x4,'name':'E_RECIPIENT_IDENTIFIER_NOT_ADDRESS','description':'RewardGuard\x20constructor:\x20recipient\x20identifier\x20type\x20is\x20not\x20address\x20(GuardIdentifier\x20variant\x20only)','trigger_operation':'claim-guard\x20construction'},{'code':0x5,'name':'E_AMOUNT_NOT_U64','description':'RewardGuard\x20constructor:\x20amount\x20identifier\x20type\x20is\x20not\x20u64\x20(GuardU64Identifier\x20variant\x20only)','trigger_operation':'claim-guard\x20construction'},{'code':0x6,'name':'E_INSUFFICIENT_BALANCE','description':'claim:\x20balance\x20<\x20amount\x20(cannot\x20split\x20more\x20than\x20held)','trigger_operation':'claim'},{'code':0x7,'name':'E_GUARD_NOT_FOUND','description':'claim:\x20no\x20guard\x20in\x20self.guards\x20matches\x20the\x20supplied\x20guard\x20address','trigger_operation':'claim'},{'code':0x8,'name':'E_RECORD_COUNT_EXCEEDED','description':'claim:\x20recipient\x20already\x20has\x20MAX_RECORD_COUNT=5200\x20entries\x20(E_RECORD_COUNT_EXCEEDED)','trigger_operation':'claim'},{'code':0xa,'name':'E_GUARD_LOCKED_TIME','description':'guard_add\x20/\x20withdraw\x20while\x20guard_not_added_expiration_time\x20is\x20Some\x20and\x20clock\x20≤\x20expiration_time','trigger_operation':'guard_add\x20/\x20withdraw'},{'code':0xb,'name':'E_GUARD_LOCKED_TIME_INVALID','description':'guard-lock\x20time\x20update:\x20new\x20Some(t)\x20where\x20t\x20≤\x20now\x20(must\x20be\x20future)','trigger_operation':'guard-lock\x20time\x20update\x20(155)'},{'code':0xc,'name':'E_STORE_FROM_ID_NOT_COMPATIBLE','description':'RewardGuard\x20constructor:\x20store_from_id\x20identifier\x20type\x20is\x20not\x20number\x20or\x20address','trigger_operation':'claim-guard\x20construction'},{'code':0xd,'name':'E_CLAIM_ALREADY_MADE','description':'claim:\x20the\x20once-slot\x20for\x20this\x20(guard,\x20store_from\x20value)\x20was\x20already\x20claimed\x20by\x20any\x20signer\x20—\x20first\x20come,\x20first\x20served\x20(MOV-PROTOCOL-1212\x20F-01\x20fix\x20—\x20replay\x20aborts,\x20the\x20pool\x20keeps\x20its\x20balance;\x20P155-08\x20v139:\x20a\x20stamped\x20slot\x20pins\x20the\x20key\x27s\x20recipient\x20axis\x20to\x20the\x20@0x0\x20sentinel,\x20so\x20the\x20once\x20domain\x20is\x20(guard,\x20store_from),\x20not\x20per-recipient).\x20Empty\x20store_from\x20slot\x20=\x20once\x20per\x20(recipient,\x20guard),\x20unchanged','trigger_operation':'claim'},{'code':0xe,'name':'E_CLAIM_RECIPIENT_NOT_SIGNER','description':'claim:\x20the\x20resolved\x20recipient\x20(from\x20guard\x20submissions\x20or\x20the\x20Entity\x20binding)\x20is\x20not\x20the\x20transaction\x20sender\x20(MOV-PROTOCOL-1212\x20B5\x20fix\x20—\x20an\x20attacker\x20cannot\x20route\x20a\x20reward\x20to\x20a\x20third\x20address).\x20Entity\x20flows\x20pass\x20because\x20the\x20SDK\x20replaces\x20the\x20sender\x20with\x20the\x20entity\x20account','trigger_operation':'claim'}];export const REWARD_SCENES=[{'id':'reward_first_order','name':'First-order\x20reward','industry':['universal','ecommerce','service','freelance'],'scenario':'New\x20customers\x20receive\x20a\x20fixed\x20reward\x20after\x20their\x20first\x20order.\x20Guard\x20verifies\x20order\x20ownership\x20+\x20first-time\x20status;\x20'+'Recipient=Signer\x20(caller\x20is\x20the\x20new\x20customer);\x20Amount=Fixed\x20(e.g.\x201\x20WOW).','phases':['creation','guard_addition','funds_replenish','claim'],'coin_type_note':'T\x20=\x20project\x20reward\x20coin\x20(e.g.\x200x2::wow::WOW\x20or\x20a\x20custom\x20token)','typical_guard_count':0x1,'recipient_types_used':['Signer'],'amount_types_used':['Fixed'],'uses_expiration_time':!![],'uses_store_from_id':![],'builtin_indexes_consumed':[REWARD_NEW,REWARD_GUARD,REWARD_COIN_ADD],'common_patterns':['Signer\x20recipient\x20+\x20Fixed\x20amount\x20—\x20caller\x20claims\x20a\x20fixed\x20amount\x20(e.g.\x201\x20WOW)','Guard\x20verifies:\x20order_address.holder\x20==\x20signer\x20AND\x20order\x20is\x20the\x20first\x20order\x20(Repository\x20query)','expiration_time\x20bounds\x20the\x20campaign\x20window\x20(e.g.\x2030\x20days)','coin_add\x20deposits\x20the\x20campaign\x20budget\x20upfront\x20(e.g.\x20100\x20WOW\x20for\x20100\x20claims)'],'recommended_templates':['first_order']},{'id':'reward_referral','name':'Referral\x20viral\x20reward','industry':['universal','ecommerce','service','content'],'scenario':'Both\x20referrer\x20and\x20referee\x20receive\x20a\x20reward\x20when\x20the\x20referee\x20completes\x20a\x20first\x20order.\x20Two\x20guards:\x20one\x20for\x20referrer\x20(Entity),\x20one\x20for\x20referee\x20(Signer).','phases':['creation','guard_addition','funds_replenish','claim'],'coin_type_note':'T\x20=\x20project\x20reward\x20coin','typical_guard_count':0x2,'recipient_types_used':['Entity','Signer'],'amount_types_used':['Fixed'],'uses_expiration_time':!![],'uses_store_from_id':!![],'builtin_indexes_consumed':[REWARD_NEW,REWARD_GUARD,REWARD_COIN_ADD],'common_patterns':['Entity\x20recipient\x20+\x20Fixed\x20amount\x20for\x20the\x20referrer\x20(recipient\x20=\x20referrer\x20address)','Signer\x20recipient\x20+\x20Fixed\x20amount\x20for\x20the\x20referee\x20(caller\x20is\x20recipient)','Guard\x20verifies:\x20referrer\x20marked\x20in\x20Repository\x20AND\x20referee\x27s\x20order\x20completed','store_from_id\x20may\x20record\x20the\x20order\x20address\x20for\x20audit\x20trail'],'recommended_templates':['referral']},{'id':'reward_loyalty','name':'Loyalty\x20tiered\x20reward','industry':['universal','ecommerce','subscription','content'],'scenario':'Customers\x20unlock\x20higher\x20rewards\x20after\x20reaching\x20cumulative\x20spending\x20tiers.\x20Recipient=Signer;\x20Amount=GuardU64Identifier\x20(tier-dependent\x20amount\x20extracted\x20from\x20Passport).','phases':['creation','guard_addition','funds_replenish','claim'],'coin_type_note':'T\x20=\x20project\x20reward\x20coin','typical_guard_count':0x1,'recipient_types_used':['Signer'],'amount_types_used':['GuardU64Identifier'],'uses_expiration_time':![],'uses_store_from_id':![],'builtin_indexes_consumed':[REWARD_NEW,REWARD_GUARD,REWARD_COIN_ADD],'common_patterns':['Signer\x20recipient\x20+\x20identifier\x20amount\x20—\x20amount\x20is\x20dynamic,\x20extracted\x20from\x20Passport\x20submission\x20(tier\x20level\x20→\x20reward\x20amount)','Guard\x20verifies:\x20cumulative\x20spend\x20≥\x20tier\x20threshold\x20(Repository\x20query)','No\x20expiration_time\x20—\x20loyalty\x20is\x20perpetual\x20(until\x20deactivated\x20via\x20guard_remove)','Guard\x20submission\x20value\x20type\x20MUST\x20be\x20u64\x20(E_AMOUNT_NOT_U64\x20otherwise)'],'recommended_templates':['loyalty']},{'id':'reward_flash_sale','name':'Limited-time\x20flash\x20sale\x20reward','industry':['universal','ecommerce','retail'],'scenario':'Time-bounded\x20reward\x20for\x20the\x20first\x20N\x20callers.\x20Recipient=Signer;\x20Amount=Fixed.\x20Guard\x20verifies\x20time\x20window\x20+\x20claim\x20count.','phases':['creation','guard_addition','funds_replenish','claim','guard_lock_mgmt'],'coin_type_note':'T\x20=\x20project\x20reward\x20coin','typical_guard_count':0x1,'recipient_types_used':['Signer'],'amount_types_used':['Fixed'],'uses_expiration_time':!![],'uses_store_from_id':![],'builtin_indexes_consumed':[REWARD_NEW,REWARD_GUARD,REWARD_COIN_ADD,REWARD_GUARD_EXPIRATION_TIME_ADD],'common_patterns':['Signer\x20recipient\x20+\x20Fixed\x20amount\x20—\x20fixed\x20amount\x20per\x20claim\x20(e.g.\x202\x20WOW)','expiration_time\x20bounds\x20the\x20flash\x20sale\x20window\x20(e.g.\x2048\x20hours)','the\x20guard-addition\x20time-lock\x20(155)\x20may\x20lock\x20further\x20guard\x20additions\x20during\x20the\x20sale','Budget\x20=\x20max_claims\x20×\x20amount;\x20coin_add\x20deposits\x20this\x20upfront'],'recommended_templates':['flash_sale']},{'id':'reward_bulk_discount','name':'Bulk\x20discount\x20/\x20cashback\x20reward','industry':['universal','ecommerce','wholesale','service'],'scenario':'Customer\x20receives\x20cashback\x20proportional\x20to\x20order\x20size.\x20Recipient=Signer\x20or\x20Entity\x20(order\x20holder);\x20Amount=GuardU64Identifier\x20(cashback\x20rate\x20from\x20Passport).','phases':['creation','guard_addition','funds_replenish','claim'],'coin_type_note':'T\x20=\x20payment\x20coin\x20type\x20(must\x20match\x20order\x20payment\x20for\x20clean\x20cashback)','typical_guard_count':0x1,'recipient_types_used':['Signer','Entity'],'amount_types_used':['GuardU64Identifier'],'uses_expiration_time':![],'uses_store_from_id':!![],'builtin_indexes_consumed':[REWARD_NEW,REWARD_GUARD,REWARD_COIN_ADD,REWARD_RECEIVE],'common_patterns':['Signer\x20recipient\x20+\x20identifier\x20amount\x20—\x20caller\x20claims\x20dynamic\x20amount\x20(cashback\x20=\x20order_amount\x20×\x20rate)','store_from_id\x20records\x20the\x20order\x20address\x20for\x20cross-reference\x20(audit\x20trail)','receive\x20(154)\x20may\x20be\x20used\x20to\x20accept\x20CoinWrapper<T>\x20refunds\x20that\x20replenish\x20the\x20balance','Guard\x20verifies:\x20order.completed\x20AND\x20order.service\x20==\x20this\x20Service'],'recommended_templates':['cashback']},{'id':'reward_milestone','name':'Service\x20milestone\x20reward','industry':['universal','ecommerce','content','subscription'],'scenario':'When\x20a\x20Service\x20reaches\x20a\x20milestone\x20(e.g.\x20100\x20orders),\x20early\x20supporters\x20receive\x20extra\x20rewards.\x20Recipient=Entity\x20(early\x20customer);\x20Amount=Fixed.','phases':['creation','guard_addition','funds_replenish','claim','guard_lock_mgmt'],'coin_type_note':'T\x20=\x20project\x20reward\x20coin','typical_guard_count':0x32,'recipient_types_used':['Entity'],'amount_types_used':['Fixed'],'uses_expiration_time':!![],'uses_store_from_id':![],'builtin_indexes_consumed':[REWARD_NEW,REWARD_GUARD,REWARD_COIN_ADD,REWARD_GUARD_EXPIRATION_TIME_ADD],'common_patterns':['Entity\x20recipient\x20+\x20Fixed\x20amount\x20for\x20each\x20early\x20customer\x20(recipient\x20=\x20customer\x20address)','Multiple\x20guards\x20(up\x20to\x2050\x20for\x2050\x20early\x20supporters)\x20—\x20well\x20within\x20MAX_GUARD_COUNT=200','Guard\x20verifies:\x20Service\x20order_count\x20>=\x20milestone\x20AND\x20claimer\x20is\x20in\x20early-customer\x20list','the\x20guard-addition\x20time-lock\x20(155)\x20may\x20lock\x20the\x20guard\x20list\x20after\x20milestone\x20setup'],'recommended_templates':['milestone']},{'id':'reward_delay_compensation','name':'Delayed-delivery\x20compensation\x20(late\x20payout)','industry':['universal','ecommerce','retail','travel','service'],'scenario':'The\x20merchant\x20PRE-FUNDS\x20a\x20compensation\x20pool\x20for\x20LATE\x20delivery\x20(C-11\x20decision:\x20experience\x20compensation\x20is\x20carried\x20by\x20the\x20'+'Reward\x20object,\x20never\x20by\x20settlement-edge\x20guards\x20—\x20an\x20escrow-pinned\x20late-penalty\x20guard\x20deadlocks\x20the\x20claim\x20window).\x20A\x20buyer\x20'+'whose\x20order\x20finished\x20after\x20the\x20promised\x20time\x20claims\x20from\x20the\x20pool:\x20Recipient=Signer\x20(canonical\x20—\x20the\x20chain\x20asserts\x20the\x20'+'resolved\x20recipient\x20equals\x20the\x20tx\x20sender,\x20abort\x20E_CLAIM_RECIPIENT_NOT_SIGNER,\x20so\x20the\x20money\x20reaches\x20the\x20claimer);\x20Amount=Fixed\x20tiers\x20by\x20default,\x20with\x20an\x20'+'optional\x20GuardU64Identifier\x20variant\x20resolved\x20from\x20the\x20claimer\x27s\x20Passport\x20submission\x20at\x20claim\x20time.','phases':['creation','guard_addition','funds_replenish','claim','guard_lock_mgmt'],'coin_type_note':'T\x20=\x20payment\x20coin\x20type\x20(compensation\x20repays\x20the\x20buyer\x20in\x20the\x20coin\x20they\x20paid\x20with)','typical_guard_count':0x1,'recipient_types_used':['Signer'],'amount_types_used':['Fixed','GuardU64Identifier'],'uses_expiration_time':!![],'uses_store_from_id':!![],'builtin_indexes_consumed':[REWARD_NEW,REWARD_GUARD,REWARD_COIN_ADD,REWARD_GUARD_EXPIRATION_TIME_ADD,REWARD_WITHDRAW],'common_patterns':['Signer\x20recipient\x20is\x20the\x20CANONICAL\x20form\x20—\x20the\x20payout\x20lands\x20on\x20the\x20claimer\x27s\x20own\x20account\x20(claim\x20asserts\x20recipient\x20==\x20tx\x20sender,\x20abort\x20E_CLAIM_RECIPIENT_NOT_SIGNER;\x20a\x20GuardIdentifier\x20recipient\x20is\x20structurally\x20unpayable\x20on\x20this\x20rail)','Amount\x20defaults\x20to\x20the\x20Fixed\x20tier\x20ladder\x20aligned\x20to\x20a\x20real\x20product\x27s\x20late\x20tiers\x20(e.g.\x2015/30/60\x20min\x20late\x20→\x20distinct\x20fixed\x20amounts);\x20the\x20GuardU64Identifier\x20VARIANT\x20resolves\x20the\x20amount\x20from\x20the\x20claimer\x27s\x20Passport\x20submission\x20at\x20claim\x20time\x20—\x20the\x20amount\x20is\x20computed\x20by\x20the\x20submitting\x20party\x20and\x20is\x20NOT\x20clamped\x20on-chain,\x20so\x20the\x20tier\x20computation\x20rule\x20MUST\x20be\x20disclosed\x20in\x20the\x20listing\x20(disclosure\x20duty)','Claim\x20window\x20design:\x20the\x20guard\x20opens\x20AFTER\x20the\x20fulfillment\x20terminal\x20+\x20grace\x20and\x20closes\x20bounded\x20via\x20expiration_time;\x20the\x20guard\x27s\x20pass\x20condition\x20must\x20cover\x20EVERY\x20terminal\x20state\x20that\x20may\x20legitimately\x20hold\x20at\x20claim\x20time\x20(completed\x20OR\x20settled\x20—\x20a\x20completed-only\x20root\x20closes\x20forever\x20at\x20settlement,\x20rqd3-tn-261030\x20F-02)','Refund-window\x20offset\x20(tbs7\x20F-04\x20claim-and-return\x20precedent):\x20the\x20compensation\x20guard\x20accepts\x20completed/settled\x20terminals\x20ONLY\x20—\x20a\x20refunded\x20order\x20can\x20never\x20pass,\x20so\x20a\x20buyer\x20cannot\x20claim\x20compensation\x20AND\x20take\x20the\x20refund;\x20where\x20a\x20separate\x20refund\x20rail\x20exists,\x20keep\x20the\x20compensation\x20claim\x20window\x20opening\x20after\x20the\x20refund\x20window\x20lapses','Optional\x20evidence\x20pin:\x20guard_add\x20evidence\x20{repo,key,predicate}\x20ties\x20the\x20claim\x20to\x20a\x20claim-time\x20repository\x20attestation\x20row\x20of\x20THIS\x20claim\x27s\x20own\x20store_from\x20order\x20(requires\x20store_from_id\x20on\x20the\x20same\x20guard;\x20aborts\x2015/16\x20otherwise)','Funding\x20requirement:\x20coin_add\x20the\x20tier\x20budget\x20UPFRONT\x20(expected\x20claims\x20×\x20worst\x20tier);\x20a\x20claim\x20larger\x20than\x20the\x20balance\x20aborts\x20E_INSUFFICIENT_BALANCE\x20(6)\x20—\x20the\x20pool\x20is\x20NOT\x20per-order\x20escrow,\x20there\x20is\x20no\x20per-claim\x20isolation,\x20so\x20the\x20balance\x20must\x20cover\x20the\x20worst-case\x20claim\x20wave','Withdraw\x20discipline\x20(permission\x20158):\x20withdraw\x20is\x20the\x20only\x20non-claim\x20exit\x20and\x20is\x20blocked\x20while\x20guard_expiration_time\x20stands\x20—\x20setting\x20the\x20no-guard\x20window\x20IS\x20the\x20public\x20funding\x20commitment;\x20the\x20right\x20to\x20withdraw\x20the\x20unclaimed\x20remainder\x20after\x20it\x20lapses\x20must\x20be\x20disclosed\x20(reversibility)'],'recommended_templates':[]},{'id':'reward_experience_compensation','name':'Service\x20experience\x20compensation\x20(generic)','industry':['universal','service','freelance','education','rental','subscription'],'scenario':'Generic\x20goodwill\x20pool\x20for\x20service-quality\x20failures\x20(attitude,\x20rework,\x20minor\x20SLA\x20misses\x20—\x20anything\x20short\x20of\x20a\x20payable\x20'+'arbitration\x20indemnity).\x20The\x20merchant\x20pre-funds\x20the\x20pool\x20and\x20lets\x20affected\x20buyers\x20self-claim.\x20Same\x20canonical\x20shape\x20as\x20the\x20'+'delay\x20scene:\x20Recipient=Signer,\x20Amount=Fixed\x20tiers\x20(GuardU64Identifier\x20variant\x20optional\x20with\x20disclosure).\x20This\x20Reward\x20is\x20the\x20'+'MERCHANT\x27S\x20OWN\x20goodwill\x20rail\x20—\x20it\x20is\x20a\x20different\x20object\x20from\x20the\x20Service.compensation_fund\x20arbitration\x20indemnity\x20and\x20never\x20'+'replaces\x20it.','phases':['creation','guard_addition','funds_replenish','claim','guard_lock_mgmt'],'coin_type_note':'T\x20=\x20payment\x20coin\x20type','typical_guard_count':0x1,'recipient_types_used':['Signer'],'amount_types_used':['Fixed','GuardU64Identifier'],'uses_expiration_time':!![],'uses_store_from_id':![],'builtin_indexes_consumed':[REWARD_NEW,REWARD_GUARD,REWARD_COIN_ADD,REWARD_GUARD_EXPIRATION_TIME_ADD,REWARD_WITHDRAW],'common_patterns':['Signer\x20recipient\x20+\x20Fixed\x20amount\x20(canonical)\x20—\x20e.g.\x20a\x20fixed\x20goodwill\x20credit\x20per\x20incident;\x20the\x20Guard\x20predicate\x20binds\x20the\x20claim\x20to\x20THIS\x20service\x27s\x20order\x20context\x20(order.service\x20==\x20this\x20Service)','GuardU64Identifier\x20VARIANT:\x20amount\x20scales\x20with\x20a\x20submission\x20slot\x20(incident\x20severity\x20tier)\x20—\x20computed\x20by\x20the\x20submitting\x20party,\x20NOT\x20clamped\x20on-chain;\x20disclose\x20the\x20tier\x20rule','Scope\x20boundary:\x20this\x20is\x20GOODWILL,\x20not\x20dispute\x20remedy\x20—\x20binding\x20arbitration\x20and\x20its\x20compensation_fund\x20remain\x20the\x20enforceable\x20path;\x20the\x20compensation\x20Reward\x20never\x20pays\x20what\x20a\x20ruling\x20would,\x20and\x20claiming\x20it\x20does\x20not\x20waive\x20the\x20refund/arbitration\x20rails\x20(windows\x20should\x20be\x20staggered,\x20see\x20reward_delay_compensation)','Claim\x20window:\x20opens\x20after\x20the\x20failure\x20is\x20on-record\x20(the\x20guard\x27s\x20evidence/progress\x20condition)\x20and\x20closes\x20bounded\x20via\x20expiration_time','Funding\x20requirement:\x20coin_add\x20upfront\x20sized\x20to\x20the\x20incident\x20wave\x20(balance\x20shortfall\x20aborts\x20E_INSUFFICIENT_BALANCE\x20(6)\x20at\x20claim\x20time\x20—\x20non-escrow\x20pool,\x20no\x20per-claim\x20isolation)','Withdraw\x20discipline\x20(permission\x20158):\x20unclaimed\x20remainder\x20is\x20withdrawable\x20once\x20the\x20no-guard\x20window\x20(guard_expiration_time)\x20lapses\x20—\x20disclose\x20the\x20withdrawal\x20right\x20as\x20the\x20reversibility\x20boundary\x20of\x20the\x20promise'],'recommended_templates':[]}];export const REWARD_LEDGER_VERSION='1.1.0';export function getScenesByPhase(a){return REWARD_SCENES['filter'](b=>b['phases']['includes'](a));}export function findSceneById(a){return REWARD_SCENES['find'](b=>b['id']===a);}export function getScenesByIndustry(a){return REWARD_SCENES['filter'](b=>b['industry']['includes'](a)||b['industry']['includes']('universal'));}export function getBuiltinPermissionByIndex(a){return REWARD_PERMISSIONS['find'](b=>b['index']===a);}export function isRewardBuiltinPermission(a){return getBuiltinPermissionByIndex(a)!==undefined;}export function getAllBuiltinPermissions(){return[...REWARD_PERMISSIONS];}export function getRewardScenesCount(){return REWARD_SCENES['length'];}export function getGuardConstructorSpec(a){return REWARD_GUARD_CONSTRUCTORS['find'](b=>b['constructor']===a);}export function resolveGuardConstructor(a,b){const c={'GuardIdentifier|GuardU64Identifier':'dynamic_recipient_dynamic_amount','GuardIdentifier|Fixed':'dynamic_recipient_fixed_amount','Entity|GuardU64Identifier':'entity_recipient_dynamic_amount','Entity|Fixed':'entity_recipient_fixed_amount','Signer|GuardU64Identifier':'caller_recipient_dynamic_amount','Signer|Fixed':'caller_recipient_fixed_amount'};return c[a+'|'+b];}export function getRewardErrorByCode(a){return REWARD_ERROR_CODES['find'](b=>b['code']===a);}export function getRewardErrorByName(a){return REWARD_ERROR_CODES['find'](b=>b['name']===a);}export function validateGuardCount(a){if(a>=MAX_GUARD_COUNT_REWARD)return{'ok':![],'violation':'Guard\x20count\x20'+a+'\x20would\x20exceed\x20MAX_GUARD_COUNT_REWARD\x20'+MAX_GUARD_COUNT_REWARD};return{'ok':!![]};}export function validateRecordCount(a){if(a>=MAX_RECORD_COUNT_REWARD)return{'ok':![],'violation':'Record\x20count\x20'+a+'\x20would\x20exceed\x20MAX_RECORD_COUNT_REWARD\x20'+MAX_RECORD_COUNT_REWARD+'\x20—\x20recipient\x20can\x20no\x20longer\x20claim'};return{'ok':!![]};}export function inferSceneFromIntent(a){const b=a['toLowerCase'](),c=[['flash\x20sale','reward_flash_sale'],['flash_sale','reward_flash_sale'],['limited-time','reward_flash_sale'],['limited\x20time','reward_flash_sale'],['referral','reward_referral'],['viral','reward_referral'],['refer\x20a\x20friend','reward_referral'],['invite','reward_referral'],['loyalty','reward_loyalty'],['tiered','reward_loyalty'],['tier','reward_loyalty'],['repeat','reward_loyalty'],['cashback','reward_bulk_discount'],['bulk\x20discount','reward_bulk_discount'],['bulk_discount','reward_bulk_discount'],['wholesale','reward_bulk_discount'],['milestone','reward_milestone'],['early\x20supporter','reward_milestone'],['early\x20customer','reward_milestone'],['first\x20order','reward_first_order'],['first_order','reward_first_order'],['new\x20customer','reward_first_order'],['first-time','reward_first_order'],['late\x20delivery','reward_delay_compensation'],['delay\x20compensation','reward_delay_compensation'],['late\x20compensation','reward_delay_compensation'],['lateness','reward_delay_compensation'],['experience\x20compensation','reward_experience_compensation'],['goodwill','reward_experience_compensation']];for(const [d,e]of c){if(b['includes'](d)){const f=findSceneById(e);if(f)return f;}}return undefined;}export const REWARD_CROSS_OBJECT_REFS=[{'object':'Permission','phase':'universal','relationship':'Reward.permission\x20(address;\x20borrowed\x20for\x20all\x20150-157\x20assertions)'},{'object':'Permission','phase':'permission_update','relationship':'permission\x20update:\x20owner-only\x20(asserts\x20old.owner\x20==\x20sender);\x20registered\x20as\x20an\x20object-linker\x20affiliation\x20change'},{'object':'Guard','phase':'guard_addition','relationship':'RewardGuard.guard\x20=\x20guard.id_address\x20(each\x20guard\x20registered\x20via\x20object-linker\x20core\x20binding)'},{'object':'Guard','phase':'claim','relationship':'claim:\x20iterates\x20self.guards\x20looking\x20for\x20guard.id_address\x20match;\x20E_GUARD_NOT_FOUND\x20if\x20no\x20match'},{'object':'Guard','phase':'claim','relationship':'claim:\x20the\x20guard\x20verification\x20result\x20validates\x20the\x20Passport\x20submission\x20data'},{'object':'Passport','phase':'claim','relationship':'claim:\x20the\x20claimant\x27s\x20Passport\x20submission\x20supplies\x20the\x20recipient\x20(address)\x20and/or\x20amount\x20(u64)\x20per\x20RewardGuard\x20variant'},{'object':'Passport','phase':'claim','relationship':'claim:\x20if\x20store_from_id\x20is\x20Some,\x20extracts\x20store-from\x20address\x20from\x20Passport\x20submission'},{'object':'Payment','phase':'funds_replenish','relationship':'receive\x20(154):\x20unwraps\x20Coin<T>\x20from\x20CoinWrapper<T>\x20(with\x20check)\x20and\x20joins\x20the\x20balance'},{'object':'Payment','phase':'owner_receive','relationship':'owner\x20receipt\x20(156):\x20unwraps\x20CoinWrapper<K>\x20and\x20forwards\x20it\x20to\x20the\x20Permission\x20owner'},{'object':'Repository','phase':'claim','relationship':'Guard\x20may\x20query\x20Repository\x20(e.g.\x20order\x20history\x20for\x20first-order\x20/\x20loyalty\x20verification)'},{'object':'Service','phase':'claim','relationship':'Guard\x20may\x20verify\x20order.service\x20==\x20this\x20Service\x20(cashback\x20/\x20first-order\x20scenarios)'},{'object':'Demand','phase':'guard_addition','relationship':'Guard\x20may\x20be\x20shared\x20with\x20Demand\x20(recommendation\x20filtering);\x20same\x20Guard\x20object\x20address\x20space'},{'object':'Allocation','phase':'owner_receive','relationship':'Terminal\x20Allocation\x20alloc\x20may\x20route\x20funds\x20back\x20to\x20Reward\x20(replenishment\x20loop)'},{'object':'Contact','phase':'um_mgmt','relationship':'UM\x20binding\x20(157):\x20binds\x20Contact\x20(UM)\x20for\x20off-chain\x20coordination;\x20creates\x20object-linker\x20core\x20binding'},{'object':'Coin','phase':'universal','relationship':'Reward<phantom\x20T>:\x20T\x20is\x20the\x20coin\x20type;\x20balance:\x20Balance<T>;\x20coin_add\x20expects\x20Coin<T>'}];
@@ -72,7 +72,7 @@ export interface RewardRiskCheckContext {
72
72
  machine_has_wonder_node?: boolean;
73
73
  }
74
74
  export declare function rewardRiskFacts(ctx: RewardRiskCheckContext): Facts;
75
- export declare const REWARD_RISK_VERSION = "1.1.0";
75
+ export declare const REWARD_RISK_VERSION = "1.2.0";
76
76
  export declare function getAllRewardRiskRules(): RewardRiskRule[];
77
77
  export interface RewardRiskAssessment {
78
78
  summary: string;
@@ -1 +1 @@
1
- import{getJudgmentDoc,factoryRulePack}from'../config/judgment.js';import{evaluateRuleBook}from'../config/rule-engine.js';import{MAX_GUARD_COUNT_REWARD,MAX_RECORD_COUNT_REWARD}from'./onchain-constants.js';import{resolveGuardConstructor}from'./reward-ledger.js';const AUTO_FIXABLE=new Set(['R-R-1-03','R-R-2-03','R-R-4-04']),RELATED_MOVE_ERROR={'R-R-1-01':'E_GUARD_COUNT_EXCEEDED\x20(3)','R-R-1-02':'E_RECORD_COUNT_EXCEEDED\x20(8)','R-R-2-01':'E_RECIPIENT_IDENTIFIER_NOT_ADDRESS\x20(4)','R-R-2-02':'E_AMOUNT_NOT_U64\x20(5)','R-R-2-03':'E_STORE_FROM_ID_NOT_COMPATIBLE\x20(12)','R-R-4-02':'E_INSUFFICIENT_BALANCE\x20(6)','R-R-4-03':'E_GUARD_LOCKED_TIME\x20(10)','R-R-4-04':'E_GUARD_LOCKED_TIME_INVALID\x20(11)','R-R-5-01':'E_GUARD_NOT_FOUND\x20(7)'},PRAISE_KEYWORDS=['praise','wonder','thumbs_up','positive\x20review','satisfaction\x20reward','praise\x20reward'],ONE_YEAR_MS=0x16d*0x18*0x3c*0x3c*0x3e8;export function rewardRiskFacts(a){const b=a['guard_add']??[],c=a['current_guard_count']??0x0,d=b['length']>0x0?c+b['length']:undefined;let e,f,h,j,k,l,m,n,o,p,q;const r=[],s={'GuardIdentifier':'GuardIdentifier','Entity':'Entity','Signer':'Signer'};for(let C=0x0;C<b['length'];C++){const D=b[C];if(!D||typeof D!=='object')continue;const E=D['recipient'],F=!!E&&typeof E==='object'&&!Array['isArray'](E);F&&'GuardIdentifier'in E&&r['push'](D['guard']);e===undefined&&F&&'GuardIdentifier'in E&&a['passport_identifier_is_address']&&a['passport_identifier_is_address'][E['GuardIdentifier']]===![]&&(e=C,f=E['GuardIdentifier']);const G=D['amount'],H=String(G?.['type'])['toUpperCase']();h===undefined&&(H==='GUARDU64IDENTIFIER'||H==='GUARD_U64_IDENTIFIER')&&typeof G?.['value']==='number'&&a['passport_submission_value_types']&&a['passport_submission_value_types'][G['value']]!=='u64'&&(h=C,j=G['value'],k=a['passport_submission_value_types'][G['value']]??'unknown');l===undefined&&D['store_from_id']!=null&&a['guard_store_from_id_compatible']&&a['guard_store_from_id_compatible'][D['guard']]===![]&&(l=C,m=D['guard'],n=D['store_from_id']);if(o===undefined&&F&&D['amount']!=null&&typeof D['amount']==='object'){const I=Object['keys'](E)[0x0],J=s[I],K=H==='FIXED'?'Fixed':'GuardU64Identifier';!resolveGuardConstructor(J,K)&&(o=C,p=String(J),q=String(K));}}let t=![];if(a['current_balance']!==undefined&&a['current_guard_count']!==undefined)try{t=BigInt(a['current_balance'])===0x0n;}catch{t=![];}const u=a['current_guard_not_added_expiration_time'],v=a['current_clock_ms'],w=a['target_guard_addresses']!=null?a['target_guard_addresses']['join'](','):'',x=(a['user_intent_phrases']??[])['join']('\x20')['toLowerCase'](),y=PRAISE_KEYWORDS['some'](L=>x['includes'](L['toLowerCase']())),z=a['guard_expected_progress_state'],A=!!(a['coin_add']||a['receive']),B=b['some'](L=>{const M=L;if(!M||typeof M!=='object')return![];const N=M['recipient'],O=!!N&&typeof N==='object'&&'Signer'in N,P=String(M['amount']?.['type'])==='GuardU64Identifier';return O&&P;});return{'claim':a['claim'],'guard_add_count':b['length'],'guard_current':c,'guard_total':d,'guard_count_would_exceed':b['length']>0x0&&c+b['length']>MAX_GUARD_COUNT_REWARD,'guard_batch_over_limit':b['length']>MAX_GUARD_COUNT_REWARD,'max_guard_count':MAX_GUARD_COUNT_REWARD,'record_count':a['current_record_count_for_recipient']??0x0,'record_count_at_limit':(a['current_record_count_for_recipient']??0x0)>=MAX_RECORD_COUNT_REWARD,'max_record_count':MAX_RECORD_COUNT_REWARD,...e===undefined?{}:{'first_non_address_identifier_index':e,'first_non_address_identifier_id':f},...h===undefined?{}:{'first_non_u64_amount_index':h,'first_non_u64_amount_id':j,'first_non_u64_amount_value_type':k},...l===undefined?{}:{'first_incompatible_store_from_id_index':l,'first_incompatible_store_from_id_guard':m,'first_incompatible_store_from_id_value':n},...o===undefined?{}:{'first_invalid_pairing_index':o,'first_invalid_pairing_recipient':p,'first_invalid_pairing_amount':q},'guard_identifier_recipients_display':r['join'](',\x20'),'owner_receive_set':a['owner_receive']!=null,...a['guard_expiration_time']===undefined?{}:{'new_lock_time':a['guard_expiration_time']},...v===undefined?{}:{'current_clock':v},'guard_lock_exceeds_year':a['guard_expiration_time']!=null&&v!==undefined&&a['guard_expiration_time']-v>ONE_YEAR_MS,'balance_is_zero':t,...u==null?{}:{'lock_until':u},'guard_add_blocked_by_lock':b['length']>0x0&&u!=null&&v!==undefined&&v<=u,'lock_time_in_past':a['guard_expiration_time']!=null&&v!==undefined&&a['guard_expiration_time']<=v,'known_guards_display':w,'claim_guard_not_in_targets':!!a['claim']&&a['target_guard_addresses']!=null&&!a['target_guard_addresses']['includes'](a['claim']),'reward_type':a['reward_type'],'coin_type':a['coin_add']?.['coin_type'],'coin_type_mismatch':!!a['coin_add']&&!!a['reward_type']&&a['coin_add']['coin_type']!==a['reward_type'],'payment_token_type':a['receive']?.['token_type'],'payment_token_mismatch':!!a['receive']&&!!a['reward_type']&&a['receive']['token_type']!==a['reward_type'],...a['user_intent_phrases']?.['length']?{'intent_display':x}:{},'expected_progress_state':z,'praise_intent_wrong_node':(a['user_intent_phrases']?.['length']??0x0)>0x0&&!!z&&y&&a['machine_has_wonder_node']!==![]&&z!=='wonder','wonder_node_without_praise_intent':(a['user_intent_phrases']?.['length']??0x0)>0x0&&z==='wonder'&&!y,'has_deposit':A,'recovery_gap_present':(A||b['length']>0x0)&&!B,'always_true':!![]};}function rewardRuleBook(){const a=getJudgmentDoc()['rules']['domains']['reward'];if(!a)throw new Error('factory\x20rule\x20pack\x20\x27reward\x27\x20missing\x20—\x20broken\x20installation');return a['rules'];}function findingToRewardRisk(a){const b=RELATED_MOVE_ERROR[a['rule_id']];return{'id':a['rule_id'],'level':a['level'],'category':a['dimension']??'semantic','title':a['title'],'description':a['description'],'affected_stakeholders':a['stakeholders']??[],'scenario':a['scenario']??'','mitigation':a['mitigation']??'','evidence':a['evidence'],...b===undefined?{}:{'related_move_error':b},'auto_fixable':AUTO_FIXABLE['has'](a['rule_id']),...a['exposure']!=null?{'exposure':a['exposure']}:{}};}export const REWARD_RISK_VERSION='1.1.0';export function getAllRewardRiskRules(){const a=factoryRulePack('reward');if(!a)return[];return a['rules']['map'](b=>({'id':b['rule_id'],'category':b['dimension']??'semantic','trigger':b['trigger']??'','check':c=>{const d=rewardRuleBook()['find'](f=>f['rule_id']===b['rule_id']);if(!d)return null;const {findings:e}=evaluateRuleBook([d],rewardRiskFacts(c));return e['length']>0x0?findingToRewardRisk(e[0x0]):null;}}));}export function assessRewardRisks(a){const {findings:b}=evaluateRuleBook(rewardRuleBook(),rewardRiskFacts(a)),c=b['map'](findingToRewardRisk),d=c['length']===0x0?'low':c['some'](g=>g['level']==='critical')?'critical':c['some'](g=>g['level']==='high')?'high':c['some'](g=>g['level']==='medium')?'medium':'low',e={};for(const g of c){e[g['category']]=(e[g['category']]??0x0)+0x1;}const f={};for(const h of c){for(const i of h['affected_stakeholders']){if(!f[i])f[i]=[];f[i]['push'](h['id']+':\x20'+h['mitigation']);}}return{'summary':'Assessed\x20'+c['length']+'\x20risk(s)\x20across\x20'+Object['keys'](e)['length']+'\x20categories','risks':c,'overall_risk':d,'risks_by_category':e,'stakeholder_advice':f,'needs_human_review':c['some'](j=>j['level']==='critical'||j['level']==='high')};}
1
+ import{getJudgmentDoc,factoryRulePack}from'../config/judgment.js';import{evaluateRuleBook}from'../config/rule-engine.js';import{MAX_GUARD_COUNT_REWARD,MAX_RECORD_COUNT_REWARD}from'./onchain-constants.js';import{resolveGuardConstructor}from'./reward-ledger.js';const AUTO_FIXABLE=new Set(['R-R-1-03','R-R-2-03','R-R-4-04']),RELATED_MOVE_ERROR={'R-R-1-01':'E_GUARD_COUNT_EXCEEDED\x20(3)','R-R-1-02':'E_RECORD_COUNT_EXCEEDED\x20(8)','R-R-2-01':'E_RECIPIENT_IDENTIFIER_NOT_ADDRESS\x20(4)','R-R-2-02':'E_AMOUNT_NOT_U64\x20(5)','R-R-2-03':'E_STORE_FROM_ID_NOT_COMPATIBLE\x20(12)','R-R-4-02':'E_INSUFFICIENT_BALANCE\x20(6)','R-R-4-03':'E_GUARD_LOCKED_TIME\x20(10)','R-R-4-04':'E_GUARD_LOCKED_TIME_INVALID\x20(11)','R-R-5-01':'E_GUARD_NOT_FOUND\x20(7)','R-R-8-01':'E_INSUFFICIENT_BALANCE\x20(6)'},PRAISE_KEYWORDS=['praise','wonder','thumbs_up','positive\x20review','satisfaction\x20reward','praise\x20reward'],COMPENSATION_KEYWORDS=['late\x20delivery','delay\x20compensation','late\x20compensation','lateness','compensation\x20pool','experience\x20compensation','goodwill','compensation\x20reward','体验补偿','迟到','延时赔付'],ONE_YEAR_MS=0x16d*0x18*0x3c*0x3c*0x3e8;export function rewardRiskFacts(a){const b=a['guard_add']??[],c=a['current_guard_count']??0x0,d=b['length']>0x0?c+b['length']:undefined;let e,f,h,j,k,l,m,n,o,p,q;const r=[],s={'GuardIdentifier':'GuardIdentifier','Entity':'Entity','Signer':'Signer'};for(let E=0x0;E<b['length'];E++){const F=b[E];if(!F||typeof F!=='object')continue;const G=F['recipient'],H=!!G&&typeof G==='object'&&!Array['isArray'](G);H&&'GuardIdentifier'in G&&r['push'](F['guard']);e===undefined&&H&&'GuardIdentifier'in G&&a['passport_identifier_is_address']&&a['passport_identifier_is_address'][G['GuardIdentifier']]===![]&&(e=E,f=G['GuardIdentifier']);const I=F['amount'],J=String(I?.['type'])['toUpperCase']();h===undefined&&(J==='GUARDU64IDENTIFIER'||J==='GUARD_U64_IDENTIFIER')&&typeof I?.['value']==='number'&&a['passport_submission_value_types']&&a['passport_submission_value_types'][I['value']]!=='u64'&&(h=E,j=I['value'],k=a['passport_submission_value_types'][I['value']]??'unknown');l===undefined&&F['store_from_id']!=null&&a['guard_store_from_id_compatible']&&a['guard_store_from_id_compatible'][F['guard']]===![]&&(l=E,m=F['guard'],n=F['store_from_id']);if(o===undefined&&H&&F['amount']!=null&&typeof F['amount']==='object'){const K=Object['keys'](G)[0x0],L=s[K],M=J==='FIXED'?'Fixed':'GuardU64Identifier';!resolveGuardConstructor(L,M)&&(o=E,p=String(L),q=String(M));}}let t=![];if(a['current_balance']!==undefined&&a['current_guard_count']!==undefined)try{t=BigInt(a['current_balance'])===0x0n;}catch{t=![];}const u=a['current_guard_not_added_expiration_time'],v=a['current_clock_ms'],w=a['target_guard_addresses']!=null?a['target_guard_addresses']['join'](','):'',x=(a['user_intent_phrases']??[])['join']('\x20')['toLowerCase'](),y=PRAISE_KEYWORDS['some'](N=>x['includes'](N['toLowerCase']())),z=COMPENSATION_KEYWORDS['some'](N=>x['includes'](N['toLowerCase']())),A=a['guard_expected_progress_state'],B=!!(a['coin_add']||a['receive']),C=b['some'](N=>{const O=N;if(!O||typeof O!=='object')return![];return String(O['amount']?.['type'])==='GuardU64Identifier';}),D=b['some'](N=>{const O=N;if(!O||typeof O!=='object')return![];const P=O['recipient'],Q=!!P&&typeof P==='object'&&'Signer'in P,R=String(O['amount']?.['type'])==='GuardU64Identifier';return Q&&R;});return{'claim':a['claim'],'guard_add_count':b['length'],'guard_current':c,'guard_total':d,'guard_count_would_exceed':b['length']>0x0&&c+b['length']>MAX_GUARD_COUNT_REWARD,'guard_batch_over_limit':b['length']>MAX_GUARD_COUNT_REWARD,'max_guard_count':MAX_GUARD_COUNT_REWARD,'record_count':a['current_record_count_for_recipient']??0x0,'record_count_at_limit':(a['current_record_count_for_recipient']??0x0)>=MAX_RECORD_COUNT_REWARD,'max_record_count':MAX_RECORD_COUNT_REWARD,...e===undefined?{}:{'first_non_address_identifier_index':e,'first_non_address_identifier_id':f},...h===undefined?{}:{'first_non_u64_amount_index':h,'first_non_u64_amount_id':j,'first_non_u64_amount_value_type':k},...l===undefined?{}:{'first_incompatible_store_from_id_index':l,'first_incompatible_store_from_id_guard':m,'first_incompatible_store_from_id_value':n},...o===undefined?{}:{'first_invalid_pairing_index':o,'first_invalid_pairing_recipient':p,'first_invalid_pairing_amount':q},'guard_identifier_recipients_display':r['join'](',\x20'),'owner_receive_set':a['owner_receive']!=null,...a['guard_expiration_time']===undefined?{}:{'new_lock_time':a['guard_expiration_time']},...v===undefined?{}:{'current_clock':v},'guard_lock_exceeds_year':a['guard_expiration_time']!=null&&v!==undefined&&a['guard_expiration_time']-v>ONE_YEAR_MS,'balance_is_zero':t,...u==null?{}:{'lock_until':u},'guard_add_blocked_by_lock':b['length']>0x0&&u!=null&&v!==undefined&&v<=u,'lock_time_in_past':a['guard_expiration_time']!=null&&v!==undefined&&a['guard_expiration_time']<=v,'known_guards_display':w,'claim_guard_not_in_targets':!!a['claim']&&a['target_guard_addresses']!=null&&!a['target_guard_addresses']['includes'](a['claim']),'reward_type':a['reward_type'],'coin_type':a['coin_add']?.['coin_type'],'coin_type_mismatch':!!a['coin_add']&&!!a['reward_type']&&a['coin_add']['coin_type']!==a['reward_type'],'payment_token_type':a['receive']?.['token_type'],'payment_token_mismatch':!!a['receive']&&!!a['reward_type']&&a['receive']['token_type']!==a['reward_type'],...a['user_intent_phrases']?.['length']?{'intent_display':x}:{},'expected_progress_state':A,'praise_intent_wrong_node':(a['user_intent_phrases']?.['length']??0x0)>0x0&&!!A&&y&&a['machine_has_wonder_node']!==![]&&A!=='wonder','wonder_node_without_praise_intent':(a['user_intent_phrases']?.['length']??0x0)>0x0&&A==='wonder'&&!y,'compensation_intent':z,'has_deposit':B,'has_identifier_amount':C,'recovery_gap_present':(B||b['length']>0x0)&&!D,'always_true':!![]};}function rewardRuleBook(){const a=getJudgmentDoc()['rules']['domains']['reward'];if(!a)throw new Error('factory\x20rule\x20pack\x20\x27reward\x27\x20missing\x20—\x20broken\x20installation');return a['rules'];}function findingToRewardRisk(a){const b=RELATED_MOVE_ERROR[a['rule_id']];return{'id':a['rule_id'],'level':a['level'],'category':a['dimension']??'semantic','title':a['title'],'description':a['description'],'affected_stakeholders':a['stakeholders']??[],'scenario':a['scenario']??'','mitigation':a['mitigation']??'','evidence':a['evidence'],...b===undefined?{}:{'related_move_error':b},'auto_fixable':AUTO_FIXABLE['has'](a['rule_id']),...a['exposure']!=null?{'exposure':a['exposure']}:{}};}export const REWARD_RISK_VERSION='1.2.0';export function getAllRewardRiskRules(){const a=factoryRulePack('reward');if(!a)return[];return a['rules']['map'](b=>({'id':b['rule_id'],'category':b['dimension']??'semantic','trigger':b['trigger']??'','check':c=>{const d=rewardRuleBook()['find'](f=>f['rule_id']===b['rule_id']);if(!d)return null;const {findings:e}=evaluateRuleBook([d],rewardRiskFacts(c));return e['length']>0x0?findingToRewardRisk(e[0x0]):null;}}));}export function assessRewardRisks(a){const {findings:b}=evaluateRuleBook(rewardRuleBook(),rewardRiskFacts(a)),c=b['map'](findingToRewardRisk),d=c['length']===0x0?'low':c['some'](g=>g['level']==='critical')?'critical':c['some'](g=>g['level']==='high')?'high':c['some'](g=>g['level']==='medium')?'medium':'low',e={};for(const g of c){e[g['category']]=(e[g['category']]??0x0)+0x1;}const f={};for(const h of c){for(const i of h['affected_stakeholders']){if(!f[i])f[i]=[];f[i]['push'](h['id']+':\x20'+h['mitigation']);}}return{'summary':'Assessed\x20'+c['length']+'\x20risk(s)\x20across\x20'+Object['keys'](e)['length']+'\x20categories','risks':c,'overall_risk':d,'risks_by_category':e,'stakeholder_advice':f,'needs_human_review':c['some'](j=>j['level']==='critical'||j['level']==='high')};}
@@ -1 +1 @@
1
- export const BUYER_ACTION_NODE_RE=/^(reviewed|return_requested|guest_cancelled|withdrawn|charging|cancelled|closed_cancel)$/i;export function unannotatedBuyerActionNodes(a){return a['filter'](b=>!b['operator']&&BUYER_ACTION_NODE_RE['test'](b['name']))['map'](b=>b['name']);}export const SCENARIO_MODES=[{'name':'freelance','phase':0x1,'industry':'Design\x20/\x20dev\x20/\x20consulting\x20/\x20writing','trust_pattern':'Milestone\x20allocation,\x20acceptance\x20gate','traits':{'has_logistics':![],'communication_heavy':!![],'pure_digital':!![],'long_cycle':!![],'deposit_required':![],'multi_tier_allocation':![]},'default_template':'freelance/enterprise-talent-market','key_risk':'Customer\x20never\x20accepts\x20delivery\x20—\x20provider\x20cannot\x20get\x20paid','build_notes':['Use\x20Service\x20`setting_lock_duration`\x20to\x20lock\x20rules\x20for\x20the\x20engagement\x20duration','WIP\x20hash\x20on\x20every\x20milestone\x20deliverable\x20is\x20mandatory\x20—\x20protects\x20provider\x20in\x20disputes','Acceptance\x20gate\x20is\x20the\x20trust\x20pivot\x20—\x20both\x20parties\x20must\x20agree\x20on\x20criteria\x20per\x20milestone','Milestones\x20map\x20to\x20deliverable-Guarded\x20forwards;\x20each\x20accepted\x20milestone\x20releases\x20its\x20escrowed\x20slice\x20(allocation.distribute_milestone)','Scope\x20changes\x20are\x20recorded\x20as\x20WTS\x20change-requests\x20at\x20kickoff/throughout\x20—\x20never\x20silent','R-M1-11:\x20no\x20\x27refunded\x27/\x27disputed\x27/\x27arb\x27/\x27cancelled\x27\x20nodes\x20—\x20refunds\x20route\x20via\x20Allocator\x20(to\x20OrderHolder)\x20triggered\x20by\x20\x27closed_cancel\x27,\x20disputes\x20via\x20Arbitration','Payment\x20exception\x20compensation\x20for\x20delivery\x20delays\x20—\x20provider\x20Treasury\x20auto-compensates\x20customer\x20(§2.13)','Project-Catalog\x20orders\x20have\x20NO\x20milestones\x20(single\x20funded\x20order\x20+\x20steps\x20timeline);\x20milestones\x20here\x20model\x20fixed-price\x20CONTRACTS.\x20For\x20catalog-style\x20listings\x20(tiered\x20pricing\x20+\x20add-ons\x20+\x20buyer\x20requirements)\x20use\x20the\x20freelance/catalog-tiers\x20template\x20instead','Time-bound\x20catalog\x20rules\x20(24h\x20instant\x20cancel,\x2048h\x20requirements\x20timeout,\x2014-day\x20auto-accept)\x20need\x20a\x20time\x20Guard\x20PLUS\x20an\x20off-chain\x20keeper\x20per\x20window\x20-\x20Guards\x20take\x20an\x20immutable\x20duration\x20constant']},{'name':'rental','phase':0x1,'industry':'Equipment\x20/\x20vehicle\x20/\x20property\x20rental','trust_pattern':'Deposit\x20escrow,\x20return\x20inspection','traits':{'has_logistics':!![],'communication_heavy':!![],'pure_digital':![],'long_cycle':![],'deposit_required':!![],'multi_tier_allocation':![]},'default_template':'rental/institutional-longstay','key_risk':'Owner\x20claims\x20damage\x20without\x20pre-rental\x20WIP\x20—\x20customer\x20loses\x20deposit\x20unfairly','build_notes':['Pre-rental\x20WIP\x20is\x20non-negotiable\x20—\x20without\x20it,\x20damage\x20claims\x20fail','Deposit\x20must\x20be\x20escrowed,\x20not\x20direct-transferred\x20—\x20enables\x20fair\x20deduction','Inspection\x20gate\x20prevents\x20customer\x20from\x20denying\x20damage','Overdue\x20handling\x20uses\x20a\x20time-lock\x20Guard\x20(clock)\x20—\x20the\x20Guard\x20only\x20ALLOWS\x20the\x20overdue\x20transition;\x20automatic\x20advancement\x20needs\x20an\x20off-chain\x20keeper\x20(see\x20DESIGN-REVIEW\x20C-3)','Extensions\x20are\x20modeled\x20as\x20separate\x20sub-orders\x20(REUSE\x20pattern),\x20not\x20as\x20machine\x20cycles\x20—\x20an\x20in-order\x20loop\x20replays\x20its\x20forwards\x27\x20fund\x20rails\x20every\x20lap','R-M1-11:\x20no\x20\x27deposit_refunded\x27/\x27deposit_deducted\x27/\x27refunded\x27\x20nodes\x20—\x20deposit\x20refund/deduction\x20flows\x20through\x20Allocator\x20triggered\x20by\x20return_approved/damage_confirmed\x20business\x20states','Payment\x20exception\x20compensation\x20for\x20return\x20delays\x20—\x20Treasury\x20withdraws\x20scene-bound\x20Payment\x20(§2.13)','Repository\x20quote_guard\x20for\x20weather/usage\x20data\x20subscription\x20revenue\x20(§2.11)']},{'name':'education','phase':0x2,'industry':'Courses\x20/\x20training\x20/\x20tutoring','trust_pattern':'Periodic\x20release\x20per\x20session,\x20attendance\x20Guard','traits':{'has_logistics':![],'communication_heavy':!![],'pure_digital':![],'long_cycle':!![],'deposit_required':!![],'multi_tier_allocation':![]},'default_template':'education/live-class-cohort','key_risk':'Tutoring\x20institutions\x20run\x20away\x20with\x20prepaid\x20tuition','build_notes':['Use\x20Service\x20`setting_lock_duration`\x20to\x20lock\x20rules\x20for\x20the\x20entire\x20term\x20(regulatory\x20compliance,\x20>=90d)','Attendance\x20Guard\x20needs\x20WIP\x20hash\x20for\x20session\x20content\x20commitment;\x20attendance\x20evidence\x20lives\x20in\x20the\x20class\x20Repository','Per-session\x20release\x20requires\x20threshold-based\x20trigger\x20—\x20each\x20attended\x20session\x20releases\x201/N','session_1..session_3\x20are\x20representative\x20—\x20configure\x20the\x20real\x20session\x20count\x20(session_N)\x20at\x20build\x20time;\x20each\x20session\x20=\x20one\x20attendance-Guarded\x20forward','Pause/deferral\x20is\x20a\x20terminal\x20node\x20+\x20new\x20sub-order\x20(REUSE\x20pattern)\x20—\x20never\x20a\x20loop\x20back\x20into\x20the\x20session\x20chain\x20(a\x20loop\x20replays\x20the\x20session\x20forwards\x27\x20fund\x20rails\x20every\x20lap;\x20if\x20a\x20loop\x20is\x20unavoidable\x20it\x20must\x20keep\x20a\x20cycle-breaking\x20exit)','Supply\x20chain\x20sub-orders\x20for\x20course\x20module\x20progressive\x20unlock\x20—\x20each\x20module\x20=\x20sub-service\x20with\x20buy_guard\x20verifying\x20previous\x20module\x20completion\x20(§2.12)','Repository\x20for\x20learning\x20progress\x20collaboration\x20data\x20—\x20progress\x20as\x20key,\x20session\x20data\x20as\x20value\x20(§2.10)']},{'name':'travel','phase':0x2,'industry':'Custom\x20tours\x20/\x20multi-segment\x20trips','trust_pattern':'Multi-tier\x20allocation\x20per\x20segment','traits':{'has_logistics':![],'communication_heavy':!![],'pure_digital':![],'long_cycle':!![],'deposit_required':!![],'multi_tier_allocation':!![]},'default_template':'travel/destination-experience','key_risk':'Paid\x20in\x20full\x20then\x20service\x20shrinks\x20—\x20multi-tier\x20transparency\x20prevents\x20this','build_notes':['Multi-tier\x20Allocation\x20is\x20WoWok\x27s\x20unique\x20advantage\x20over\x20traditional\x20travel\x20platforms','segment_guard\x20needs\x20standardized\x20WIP\x20templates\x20per\x20segment\x20type\x20(hotel,\x20transport,\x20activity)','Multi-tier\x20waterfall\x20needs\x20guard\x20chaining\x20validation','Weather/force-majeure\x20branches\x20enter\x20reschedule\x20(terminal)\x20or\x20partial-refund\x20interrupted\x20terminal\x20—\x20never\x20loop\x20back\x20into\x20the\x20segment\x20chain\x20(a\x20loop\x20replays\x20the\x20segment\x20forwards\x27\x20fund\x20rails\x20every\x20lap;\x20if\x20a\x20loop\x20is\x20unavoidable\x20it\x20must\x20keep\x20a\x20cycle-breaking\x20exit)','Supplier\x20sub-orders\x20each\x20carry\x20their\x20own\x20machine\x20—\x20hotel/guide/driver\x20fulfill\x20independently\x20(§2.12)','Supply\x20chain\x20sub-orders\x20—\x20each\x20tour\x20segment\x20=\x20sub-service\x20with\x20buy_guard\x20verifying\x20main\x20tour\x20order\x20(§2.12)','Payment\x20exception\x20compensation\x20for\x20flight/segment\x20delays\x20(§2.13)','Repository\x20quote_guard\x20for\x20weather/travel\x20data\x20subscription\x20revenue\x20(§2.11)']},{'name':'subscription','phase':0x3,'industry':'SaaS\x20/\x20content\x20membership\x20/\x20periodic\x20service','trust_pattern':'Periodic\x20charge,\x20cancel\x20Guard','traits':{'has_logistics':![],'communication_heavy':![],'pure_digital':!![],'long_cycle':!![],'deposit_required':![],'multi_tier_allocation':![]},'default_template':'subscription/creator-membership','key_risk':'Auto-renew\x20trap\x20and\x20platform-takes-30%\x20—\x20WoWok\x20native\x20solution','build_notes':['Pure\x20digital\x20—\x20native\x20WoWok\x20soil','charge_guard\x20needs\x20periodic\x20trigger\x20(off-chain\x20scheduler\x20+\x20on-chain\x20Guard)','Renewal\x20is\x20an\x20explicit\x20buyer-side\x20forward\x20(or\x20a\x20Guard-gated\x20auto-renew\x20WITH\x20WTS\x20notice)\x20—\x20never\x20silent','Cancellation\x20is\x20frictionless\x20and\x20next-period\x20effective;\x20pro-rata\x20refund\x20for\x20unearned\x20periods','Forbid\x20dead-end\x20nodes\x20(prevent\x20lock-in);\x20every\x20state\x20must\x20have\x20a\x20forward\x20or\x20be\x20an\x20intended\x20terminal','Targets\x20indie\x20creators,\x20niche\x20SaaS,\x20paid\x20newsletters','Repository\x20quote_guard\x20for\x20creator\x20data\x20subscription\x20revenue\x20—\x20creators\x20publish\x20paid\x20data,\x20users\x20pay\x20to\x20access\x20(§2.11)']},{'name':'retail','phase':0x1,'industry':'Goods\x20retail\x20/\x20marketplace\x20/\x20e-commerce','trust_pattern':'Escrow\x20+\x20confirm-on-receipt\x20release','traits':{'has_logistics':!![],'communication_heavy':![],'pure_digital':![],'long_cycle':![],'deposit_required':![],'multi_tier_allocation':![]},'default_template':'retail/scale-marketplace','key_risk':'Products\x20don\x27t\x20match\x20description\x20—\x20no\x20refund\x20path\x20for\x20returns','build_notes':['Logistics\x20WIP\x20(tracking\x20number)\x20is\x20essential\x20—\x20shipping\x20evidence\x20protects\x20both\x20parties\x20in\x20return\x20disputes','Confirm\x20gate\x20prevents\x20merchant\x20from\x20self-confirming\x20receipt','Refund\x20path\x20must\x20support\x20return-and-exchange\x20flow;\x20refund_window\x20>=\x207d','Return\x20request\x20is\x20time-lock\x20gated\x20—\x20after\x20the\x20window\x20closes,\x20returns\x20need\x20merchant\x20permission\x20or\x20arbitration','Compensation\x20fund\x20covers\x20return/exchange\x20disputes','R-M1-11:\x20no\x20\x27refunded\x27\x20node\x20—\x20refunds\x20route\x20via\x20Allocator\x20triggered\x20by\x20returned/cancelled\x20business\x20states;\x20disputes\x20go\x20to\x20Arbitration']},{'name':'licensing','phase':0x1,'industry':'IP\x20/\x20royalty\x20licensing\x20/\x20metered\x20asset\x20licenses','trust_pattern':'Terms\x20hash-anchored,\x20on-chain\x20royalty\x20split,\x20territory/term\x20Guard','traits':{'has_logistics':![],'communication_heavy':![],'pure_digital':!![],'long_cycle':!![],'deposit_required':![],'multi_tier_allocation':!![]},'default_template':'licensing/royalty-stream-auction','key_risk':'Buyer\x20trusts\x20the\x20seller\x27s\x20royalty/usage\x20reporting\x20—\x20without\x20an\x20on-chain\x20meter\x20the\x20accounting\x20honesty\x20is\x20only\x20as\x20good\x20as\x20the\x20attestation\x20and\x20the\x20compensation\x20backstop','build_notes':['Anchor\x20the\x20license\x20terms\x20(territory,\x20term,\x20media,\x20caps,\x20exclusivity)\x20as\x20a\x20WIP\x20hash\x20—\x20the\x20granted\x20rights\x20must\x20be\x20provable\x20in\x20a\x20dispute,\x20not\x20prose','Royalty\x20/\x20purchase-proceeds\x20split\x20is\x20an\x20Allocation\x20Rate\x20plan\x20(bps\x20summing\x20to\x2010000\x20across\x20rights-holders\x20+\x20platform);\x20the\x20split\x20is\x20frozen\x20at\x20publish\x20and\x20auditable\x20by\x20every\x20recipient','Recurring\x20royalty:\x20the\x20Allocation\x20pool\x20is\x20re-fillable\x20(order_renew\x20top-ups)\x20and\x20a\x20guard-keyed\x20periodic\x20alloc\x20with\x20a\x20period-N\x20once-key\x20(identifier\x20255)\x20releases\x20each\x20period\x20—\x20payroll-style\x20repeat\x20runs\x20stay\x20possible\x20without\x20the\x20once-slot','Territory\x20is\x20enforced\x20by\x20a\x20Service\x20buy_guard\x20running\x20pattern.identity_check_allowlist\x20(allowlist\x20as\x20an\x20Address-vector\x20table\x20constant);\x20term\x20/\x20inspection\x20window\x20is\x20a\x20tpl_time_lock_progress\x20forward\x20guard\x20(Clock\x20>=\x20entry_time\x20+\x20duration)','Time-lock\x20duration\x20is\x20an\x20IMMUTABLE\x20table\x20constant\x20fixed\x20at\x20publish\x20—\x20an\x20expired\x20window\x20only\x20BLOCKS\x20the\x20forward,\x20it\x20never\x20auto-refunds;\x20automatic\x20advancement\x20on\x20timeout\x20needs\x20an\x20off-chain\x20keeper','🔴\x20AUCTION\x20GAP:\x20there\x20is\x20NO\x20on-chain\x20ascending-auction\x20/\x20bid-ledger\x20/\x20highest-bidder\x20primitive.\x20Model\x20a\x20competitive\x20sale\x20as:\x20winner\x20resolved\x20OFF-CHAIN\x20(prose),\x20then\x20the\x20winner\x20calls\x20buy\x20like\x20any\x20buyer\x20—\x20optionally\x20gate\x20buy\x20with\x20an\x20allowlist\x20guard\x20carrying\x20the\x20attested\x20winner\x20address.\x20Never\x20claim\x20the\x20chain\x20runs\x20the\x20auction','🔴\x20METERED-CAPS\x20GAP:\x20there\x20is\x20NO\x20usage\x20oracle/meter.\x20A\x20\x27limited\x20to\x20N\x20streams/sales\x27\x20cap\x20can\x20only\x20be\x20an\x20ATTESTED\x20Repository\x20counter\x20that\x20a\x20forward\x20guard\x20reads\x20via\x20the\x20repository.data\x20count-where\x20query\x20—\x20the\x20count\x20is\x20only\x20as\x20trustworthy\x20as\x20its\x20write-guard\x20(self/attested),\x20never\x20an\x20oracle\x20feed.\x20Disclose\x20this\x20honestly;\x20never\x20present\x20a\x20cap\x20as\x20chain-enforced\x20metering','R-M1-11:\x20no\x20\x27refunded\x27/\x27cancelled\x27\x20fund\x20terminals\x20—\x20refunds\x20route\x20via\x20the\x20Allocator\x20triggered\x20by\x20a\x20business\x20state\x20(e.g.\x20inspection_failed);\x20disputes\x20go\x20to\x20Arbitration']},{'name':'crowdfunding','phase':0x1,'industry':'All-or-nothing\x20threshold\x20campaigns\x20/\x20flexible\x20keep-it-all\x20fundraising','trust_pattern':'Per-contributor\x20escrow\x20(unpooled)\x20+\x20on-chain\x20aggregate\x20threshold\x20+\x20deadline\x20two-leg\x20release/refund','traits':{'has_logistics':![],'communication_heavy':!![],'pure_digital':!![],'long_cycle':!![],'deposit_required':!![],'multi_tier_allocation':!![]},'default_template':'crowdfunding/all-or-nothing-threshold','key_risk':'The\x20funding\x20threshold\x20is\x20an\x20aggregate\x20read\x20over\x20a\x20shared\x20campaign\x20ledger\x20—\x20each\x20contribution\x20row\x20is\x20writer-bound\x20to\x20its\x20funder,\x20but\x20the\x20aggregate\x20is\x20a\x20read-only\x20sum\x20of\x20declared\x20rows,\x20not\x20an\x20independent\x20re-computation\x20of\x20every\x20escrow;\x20roster\x20completeness\x20is\x20keeper-attested.\x20Funders\x20also\x20trust\x20eventual\x20project\x20delivery,\x20backed\x20only\x20by\x20compensation_fund\x20+\x20arbitration','build_notes':['Per-contributor\x20escrow,\x20NEVER\x20pooled:\x20each\x20funder\x27s\x20Order\x20holds\x20its\x20OWN\x20Allocation\x20with\x20payment_info.for_object\x20bound\x20to\x20that\x20Order\x20—\x20because\x20the\x20money\x20is\x20never\x20balance::join-ed\x20into\x20one\x20pot,\x20attribution\x20survives\x20and\x20each\x20contribution\x20is\x20refundable\x20to\x20its\x20own\x20funder','Threshold\x20gate\x20=\x20an\x20on-chain\x20aggregate:\x20a\x20shared\x20campaign\x20Repository\x20holds\x20one\x20numeric\x20row\x20per\x20contribution\x20(keyed\x20by\x20the\x20contribution,\x20tagged\x20with\x20a\x20campaign\x20id);\x20the\x20settlement\x20Guard\x20reads\x20it\x20back\x20with\x20the\x20repository.data\x20sum-where\x20query\x20(1174\x20→\x20U256,\x20overflow-safe)\x20and\x20compares\x20against\x20the\x20threshold\x20constant','Write-side\x20binding\x20is\x20MANDATORY:\x20contribution\x20rows\x20are\x20written\x20under\x20pattern.repository_write_authorization\x20with\x20an\x20identity\x20leaf\x20(order.owner\x20==\x20Signer\x20/\x20order.agent\x20has\x20Signer)\x20so\x20a\x20funder\x20can\x20only\x20record\x20their\x20OWN\x20contribution\x20—\x20existence-is-not-trust\x20(R-X1-17),\x20an\x20unbound\x20write_guard\x20makes\x20the\x20aggregate\x20forgeable','Deadline\x20=\x20a\x20time-lock:\x20both\x20settlement\x20legs\x20require\x20Clock\x20>=\x20deadline\x20via\x20pattern.time_lock_progress\x20(query\x201280,\x20node-ENTRY\x20anchored);\x20BEFORE\x20the\x20deadline\x20a\x20funder\x20may\x20withdraw\x20(buyer-self-service\x20withdrawn\x20rail:\x20removes\x20their\x20writer-bound\x20row\x20+\x20full\x20refund\x20—\x20A12\x20fix,\x20was\x20wrongly\x20\x27no\x20early\x20withdrawal\x27);\x20AFTER\x20the\x20deadline\x20funds\x20are\x20committed\x20to\x20the\x20threshold\x20outcome','Two-leg\x20escrow\x20exit\x20(D-BUG-2\x20polarity):\x20release\x20leg\x20(→\x20project\x20Entity)\x20gated\x20logic_and[sum_where\x20>=\x20threshold,\x20clock\x20>=\x20deadline];\x20refund\x20leg\x20(→\x20for_object,\x20the\x20funder\x27s\x20own\x20Order)\x20gated\x20logic_and[sum_where\x20<\x20threshold,\x20clock\x20>=\x20deadline]\x20—\x20mutually\x20exclusive\x20on\x20the\x20aggregate\x20comparison,\x20so\x20exactly\x20one\x20is\x20satisfiable\x20once\x20the\x20deadline\x20passes','Keeper\x20batch\x20settlement:\x20on\x20a\x20missed\x20campaign\x20a\x20keeper\x20enumerates\x20every\x20contributor\x20via\x20repository.data\x20find-where\x20(1176\x20→\x20VectorAddress)\x20/\x20keys-where\x20(1177\x20→\x20VectorString)\x20and\x20advances\x20each\x20funder\x27s\x20refund\x20leg\x20in\x20one\x20PTB\x20(or\x20N\x20PTBs)\x20—\x20an\x20ops\x20efficiency,\x20not\x20a\x20chain\x20capability','🔴\x20AGGREGATE\x20TRUST\x20BOUNDARY:\x20the\x20sum\x20is\x20only\x20as\x20honest\x20as\x20the\x20writer-bound\x20rows;\x20it\x20is\x20NOT\x20independently\x20re-derivable\x20on-chain\x20without\x20reading\x20every\x20escrow\x20balance.\x20Disclose\x20this\x20honestly\x20(L-04);\x20never\x20present\x20the\x20threshold\x20as\x20a\x20chain-verified\x20total-custody\x20proof','🔴\x20L-01\x20NON-INVESTMENT:\x20crowdfunding\x20copy\x20must\x20never\x20promise\x20investment\x20returns,\x20yield,\x20or\x20token-price\x20appreciation\x20—\x20it\x20is\x20a\x20threshold\x20purchase/preorder/donation,\x20not\x20a\x20security','🔴\x20L-05\x20KYC/AML:\x20pooled\x20fundraising\x20is\x20high\x20regulatory\x20intensity\x20—\x20cross-border\x20funds\x20and\x20reward\x20tiers\x20may\x20trigger\x20securities/money-transmission\x20rules;\x20flag\x20for\x20compliance,\x20do\x20not\x20automate\x20around\x20them','R-M1-11:\x20no\x20\x27refunded\x27/\x27cancelled\x27\x20fund\x20terminals\x20—\x20the\x20refund\x20leg\x20routes\x20via\x20the\x20Allocator\x20triggered\x20by\x20the\x20missed-threshold\x20business\x20state\x20at\x20deadline;\x20disputes\x20go\x20to\x20Arbitration']},{'name':'delivery','phase':0x1,'industry':'Restaurant\x20food-delivery\x20/\x20on-demand\x20errand\x20(local\x20fulfillment)','trust_pattern':'Escrow-through-delivery\x20+\x20roster-authorized\x20per-order\x20rider\x20+\x20serial\x20claim\x20window','traits':{'has_logistics':!![],'communication_heavy':!![],'pure_digital':![],'long_cycle':![],'deposit_required':![],'multi_tier_allocation':![]},'default_template':'delivery/restaurant-marketplace','key_risk':'Per-order\x20dispatched\x20riders\x20have\x20no\x20on-chain\x20identity\x20—\x20the\x20named-operator\x20roster\x20is\x20their\x20ONLY\x20authorized\x20forward\x20and\x20the\x20roster\x20writer\x20is\x20the\x20de-facto\x20rider\x20admitter\x20(undisclosed,\x20a\x20silent\x20centralization);\x20handover\x20records\x20are\x20unwitnessable\x20by\x20the\x20buyer;\x20rider\x20pay\x20is\x20the\x20platform\x27s\x20off-chain\x20payroll\x20BY\x20DESIGN\x20(T-06\x20correction,\x20sso-tn-261027-7f3a91:\x20a\x20Signer\x20allocator\x20leg\x20CAN\x20pay\x20a\x20per-order\x20rider\x20directly\x20—\x20the\x20on-chain\x20Signer\x20leg\x20bypasses\x20the\x20for_object\x20lock\x20that\x20binds\x20only\x20GuardIdentifier\x20submissions)','build_notes':['Hours-scale\x20windows,\x20not\x20retail\x20DAYS:\x20auto-confirm\x201-2h,\x20claim\x20window\x2024h,\x20settlement\x2024h\x20—\x20food\x20is\x20perishable;\x20anchor\x20every\x20relative\x20gate\x20on\x20progress.history.time\x20(query\x201280,\x20find=last),\x20never\x201272\x20current_time','Dispatch\x20is\x20OFF-CHAIN\x20(K-4):\x20the\x20chain\x20has\x20no\x20dispatch/scheduling\x20primitive\x20—\x20the\x20rider\x27s\x20only\x20chain\x20footprint\x20is\x20the\x20per-order\x20namedOperator\x20roster\x20(permission\x20index\x20221);\x20the\x20roster\x27s\x20write\x20power\x20is\x20the\x20rider-admission\x20power\x20and\x20MUST\x20be\x20disclosed\x20(NAMED_OPERATOR_ROSTER_UNDISCLOSED)','Riders\x20are\x20paid\x20by\x20the\x20platform\x20in\x20this\x20shape\x20(T-06\x20correction,\x20sso-tn-261027-7f3a91):\x20a\x20GuardIdentifier\x20leg\x20pays\x20the\x20order\x27s\x20own\x20CoinWrapper\x20(the\x20on-chain\x20for_object\x20lock),\x20so\x20a\x20slot\x20leg\x20is\x20unfundable\x20for\x20a\x20person\x20—\x20but\x20a\x20Signer\x20leg\x20IS\x20an\x20on-chain\x20payee\x20shape\x20for\x20the\x20rostered\x20rider\x20(the\x20on-chain\x20Signer\x20leg,\x20proven\x20live);\x20the\x20shipped\x20default\x20routes\x20pay\x20through\x20the\x20commission\x20leg\x20as\x20off-chain\x20payroll\x20instead','Serial\x20claim\x20window\x20(TPL-09):\x20settlement\x20departs\x20a\x20mandatory\x20claim_window\x20node\x20so\x20no\x20release\x20can\x20fire\x20while\x20a\x20dispute\x20could\x20still\x20be\x20filed\x20(FACT-ALLOC-03);\x20assert\x20settle_hours\x20>=\x20claim_window_hours\x20at\x20generation','Fee-graded\x20cancellation:\x20a\x20pre-acceptance\x20cancel\x20refunds\x20in\x20full,\x20a\x20post-acceptance\x20kill\x20pays\x20a\x20prep\x20fee\x20—\x20distinct\x20closed_cancel\x20/\x20closed_kill\x20terminals\x20so\x20fee\x20and\x20full\x20refund\x20never\x20share\x20a\x20rail','Transit\x20loss\x20has\x20a\x20buyer\x20rail:\x20an\x20identity-only\x20ReportTransitLoss\x20declaration\x20into\x20the\x20dispute\x20waypoint\x20(no\x20window\x20mid-transit\x20—\x20the\x20anchor\x20row\x20does\x20not\x20exist\x20yet,\x20F-TPL-01\x20trap);\x20the\x20remedy\x20route\x20is\x20arbitration\x20into\x20the\x20full-refund\x20rail,\x20disclosed']},{'name':'group_buy','phase':0x1,'industry':'Community\x20group-buying\x20(leader\x20consolidation\x20+\x20neighborhood\x20pickup)','trust_pattern':'Shared\x20ABSOLUTE\x20batch\x20cutoff\x20+\x20batch\x20consolidation\x20+\x20threshold-gated\x20release\x20(challenger:\x20per-backer\x20unpooled\x20escrow)','traits':{'has_logistics':!![],'communication_heavy':!![],'pure_digital':![],'long_cycle':![],'deposit_required':!![],'multi_tier_allocation':!![]},'default_template':'group_buy/platform-supplied-pickup','key_risk':'The\x20buyer\x20pre-pays\x20against\x20a\x20batch\x20that\x20may\x20never\x20form,\x20and\x20the\x20challenger\x27s\x20supply\x20chain\x20is\x20OFF-CHAIN\x20(undiligence-able\x20before\x20purchase\x20—\x20the\x20trust\x20gap\x20and\x20the\x20main\x20arbitration\x20evidence\x20source);\x20the\x20batch\x20cutoff\x20must\x20be\x20ONE\x20shared\x20absolute\x20timestamp\x20(keeper-written\x20Repository\x20row),\x20never\x20a\x20per-order\x20entry+duration\x20lock;\x20multi-level\x20commission\x20schemes\x20are\x20NOT\x20expressible\x20(single-layer\x20commission\x20only)','build_notes':['The\x20batch\x20cutoff\x20is\x20a\x20SHARED\x20ABSOLUTE\x20timestamp\x20(pattern.time_lock_absolute):\x20one\x20clock\x20for\x20every\x20buyer\x20in\x20the\x20batch,\x20keeper-written\x20per\x20batch\x20into\x20a\x20Repository\x20row\x20—\x20chain\x20Clock\x20is\x20block-driven,\x20so\x20a\x20real-world\x20calendar\x20cutoff\x20(23:00\x20daily)\x20needs\x20pattern.time_source_repository_oracle;\x20a\x20per-order\x20entry+duration\x20lock\x20gives\x20every\x20buyer\x20a\x20DIFFERENT\x20cutoff\x20and\x20is\x20not\x20a\x20batch','Supply-chain\x20suborder\x20commitment\x20(leader):\x20the\x20supplier\x27s\x20sub-service\x20address\x20is\x20a\x20FIXED\x20promise\x20in\x20the\x20ConsolidateBatch\x20guard\x20table\x20(b_submission\x20false,\x20value_type\x20Address)\x20—\x20the\x20whole\x20procurement\x20graph\x20is\x20enumerable\x20and\x20diligence-able\x20BEFORE\x20any\x20buyer\x20pays\x20(the\x20structural\x20trust\x20advantage);\x20the\x20challenger\x20(leader-sourced)\x20has\x20NO\x20such\x20commitment\x20—\x20disclose\x20it\x20as\x20the\x20structural\x20trust\x20gap','Threshold\x20mode\x20reuses\x20the\x20crowdfunding\x20construction\x20wholesale:\x20unpooled\x20per-backer\x20escrow\x20(for_object\x20=\x20the\x20backer\x27s\x20own\x20order),\x20ORDER-keyed\x20contribution\x20rows,\x20the\x20escrow-bound\x20aggregate\x20(per-row\x20min(row,\x20order.amount,\x20live\x20allocation.balance\x20—\x20v139\x20live\x20cap))\x20and\x20the\x20live-escrow\x20+\x20claimed_by-false\x20legs\x20—\x20the\x20three\x20CROWDFUNDING_*\x20blockers\x20apply\x20automatically','Pickup-point\x20topology:\x20staffed\x20points\x20ride\x20the\x20named-operator\x20leader\x20rail\x20(ShelveAtPoint\x20+\x20HandOverByPoint);\x20AUTOMATED\x20lockers\x20drop\x20both\x20(a\x20locker\x20cannot\x20sign\x20—\x20the\x20buyer\x27s\x20own\x20Collect\x20signature\x20is\x20the\x20stronger\x20handover\x20proof);\x20the\x20unclaimed-goods\x20exit\x20window\x20is\x20mandatory\x20(goods\x20never\x20picked\x20up\x20must\x20refund\x20at\x20a\x20bounded\x20deadline)','Leader\x20commission\x20is\x20a\x20single-layer\x20rate\x20leg\x20paid\x20to\x20the\x20platform\x20Entity\x20with\x20OFF-CHAIN\x20pass-through\x20(a\x20per-order\x20third\x20party\x20has\x20no\x20on-chain\x20payee\x20shape\x20—\x20the\x20for_object\x20lock);\x20multi-level/regional\x20commission\x20is\x20NOT\x20expressible\x20—\x20disclose','Delay\x20compensation\x20pays\x20from\x20the\x20compensation_fund,\x20NEVER\x20from\x20the\x20buyer\x27s\x20escrow\x20(Order\x20binds\x20<=\x201\x20allocator);\x20the\x20fund\x20must\x20be\x20pre-locked\x20to\x203x\x20the\x20largest\x20order\x20(B2)\x20or\x20higher\x20tiers\x20are\x20silently\x20unsellable']},{'name':'general','phase':0x1,'industry':'Anything\x20not\x20covered\x20/\x20hybrid','trust_pattern':'User-defined\x20from\x20scratch','traits':{'has_logistics':![],'communication_heavy':![],'pure_digital':![],'long_cycle':![],'deposit_required':![],'multi_tier_allocation':![]},'default_template':null,'key_risk':'No\x20safety\x20net\x20—\x20user\x20must\x20design\x20all\x20trust\x20mechanisms\x20manually','build_notes':['Escape\x20hatch:\x20any\x20user\x20can\x20switch\x20to\x20general\x20mode\x20at\x20any\x20time','Already-created\x20objects\x20under\x20a\x20previous\x20mode\x20remain\x20on-chain\x20(REUSE\x20pattern)','wowok-machine\x20/\x20wowok-guard\x20/\x20wowok-provider\x20become\x20primary\x20references']}];export function matchScenarioMode(a){const b=a['toLowerCase'](),c=inferScenarioTraits(a),e=SCENARIO_MODES['map'](h=>{let i=0x0,j=0x0;for(const k of Object['keys'](c)){j+=0x1;if(h['traits'][k]===c[k])i+=0x1;}if(h['name']!=='general'){const l=MODE_KEYWORDS[h['name']]??[];for(const m of l){if(b['includes'](m))i+=0.5;}}return{'mode':h,'score':i,'total':j};});let f=e[0x0];for(const h of e){if(h['score']>f['score'])f=h;}const g=f['total']>0x0?Math['min'](0x1,f['score']/f['total']):0x0;return{'mode':f['mode'],'confidence':g};}const MODE_KEYWORDS={'freelance':['freelance','design','develop','consult','write','consulting'],'rental':['rent','rental','lease','borrow','equipment','vehicle','property'],'education':['course','training','tutor','teach','education','class'],'travel':['tour','travel','trip','itinerary','vacation'],'subscription':['subscribe','subscription','membership','saas','newsletter','recurring'],'retail':['retail','shop','store','marketplace','sell\x20goods','ecommerce','e-commerce'],'licensing':['license','licensing','royalty','royalties','ip','intellectual\x20property','music\x20rights','sync','beat','franchise','rights'],'crowdfunding':['crowdfunding','crowdfund','fundraising','pledge','backer','kickstarter','campaign','all-or-nothing','threshold\x20goal','presale\x20campaign','raise\x20funds'],'delivery':['delivery','food\x20delivery','takeout','takeaway','errand','on-demand','rider','courier\x20delivery','waimai','last\x20mile'],'group_buy':['group\x20buy','group-buy','groupbuy','community\x20group','team\x20purchase','batch\x20cutoff','neighborhood\x20pickup','pickup\x20point','tuangou']};export function inferScenarioTraits(a){const b=a['toLowerCase']();return{'has_logistics':/ship|delivery|equipment|vehicle|physical|goods/['test'](b),'communication_heavy':/consult|discuss|back-and-forth|custom|bespoke|negotiate/['test'](b),'pure_digital':/digital|file|download|online|software|code|design|content/['test'](b),'long_cycle':/month|long-term|engagement|project|semester|period/['test'](b),'deposit_required':/deposit|escrow|prepay|tuition|reserve/['test'](b),'multi_tier_allocation':/tier|segment|multi-|agency|hotel|guide|driver/['test'](b)};}export const MODE_COMPOSITIONS=[{'modes':['freelance','subscription'],'use_case':'Retainer\x20consulting\x20(monthly\x20+\x20milestone)','conflict_resolution':'Allocator:\x20split\x20into\x20retainer\x20(subscription)\x20+\x20milestone\x20(freelance)'},{'modes':['rental','education'],'use_case':'Equipment\x20training\x20rental','conflict_resolution':'Machine:\x20extend\x20rental\x20nodes\x20with\x20attendance\x20gates'},{'modes':['travel','rental'],'use_case':'Tour\x20with\x20equipment','conflict_resolution':'Allocator:\x20segment\x20allocation\x20+\x20deposit\x20escrow\x20side-by-side'}];export function getScenarioMode(a){return SCENARIO_MODES['find'](b=>b['name']===a);}export function listScenarioModes(){return SCENARIO_MODES;}export function getShippedModes(){return SCENARIO_MODES['filter'](a=>a['phase']===0x1);}export function getModeCompositions(a){return MODE_COMPOSITIONS['filter'](b=>b['modes']['includes'](a));}export const SCENARIO_MODES_VERSION=0xa;
1
+ export const BUYER_ACTION_NODE_RE=/^(reviewed|return_requested|guest_cancelled|withdrawn|charging|cancelled|closed_cancel)$/i;export function unannotatedBuyerActionNodes(a){return a['filter'](b=>!b['operator']&&BUYER_ACTION_NODE_RE['test'](b['name']))['map'](b=>b['name']);}export const SCENARIO_MODES=[{'name':'freelance','phase':0x1,'industry':'Design\x20/\x20dev\x20/\x20consulting\x20/\x20writing','trust_pattern':'Milestone\x20allocation,\x20acceptance\x20gate','traits':{'has_logistics':![],'communication_heavy':!![],'pure_digital':!![],'long_cycle':!![],'deposit_required':![],'multi_tier_allocation':![]},'default_template':'freelance/enterprise-talent-market','key_risk':'Customer\x20never\x20accepts\x20delivery\x20—\x20provider\x20cannot\x20get\x20paid','build_notes':['Use\x20Service\x20`setting_lock_duration`\x20to\x20lock\x20rules\x20for\x20the\x20engagement\x20duration','WIP\x20hash\x20on\x20every\x20milestone\x20deliverable\x20is\x20mandatory\x20—\x20protects\x20provider\x20in\x20disputes','Acceptance\x20gate\x20is\x20the\x20trust\x20pivot\x20—\x20both\x20parties\x20must\x20agree\x20on\x20criteria\x20per\x20milestone','Milestones\x20map\x20to\x20deliverable-Guarded\x20forwards;\x20each\x20accepted\x20milestone\x20releases\x20its\x20escrowed\x20slice\x20(allocation.distribute_milestone)','Scope\x20changes\x20are\x20recorded\x20as\x20WTS\x20change-requests\x20at\x20kickoff/throughout\x20—\x20never\x20silent','R-M1-11:\x20no\x20\x27refunded\x27/\x27disputed\x27/\x27arb\x27/\x27cancelled\x27\x20nodes\x20—\x20refunds\x20route\x20via\x20Allocator\x20(to\x20OrderHolder)\x20triggered\x20by\x20\x27closed_cancel\x27,\x20disputes\x20via\x20Arbitration','Payment\x20exception\x20compensation\x20for\x20delivery\x20delays\x20—\x20provider\x20Treasury\x20auto-compensates\x20customer\x20(§2.13)','Project-Catalog\x20orders\x20have\x20NO\x20milestones\x20(single\x20funded\x20order\x20+\x20steps\x20timeline);\x20milestones\x20here\x20model\x20fixed-price\x20CONTRACTS.\x20For\x20catalog-style\x20listings\x20(tiered\x20pricing\x20+\x20add-ons\x20+\x20buyer\x20requirements)\x20use\x20the\x20freelance/catalog-tiers\x20template\x20instead','Time-bound\x20catalog\x20rules\x20(24h\x20instant\x20cancel,\x2048h\x20requirements\x20timeout,\x2014-day\x20auto-accept)\x20need\x20a\x20time\x20Guard\x20PLUS\x20an\x20off-chain\x20keeper\x20per\x20window\x20-\x20Guards\x20take\x20an\x20immutable\x20duration\x20constant']},{'name':'rental','phase':0x1,'industry':'Equipment\x20/\x20vehicle\x20/\x20property\x20rental','trust_pattern':'Deposit\x20escrow,\x20return\x20inspection','traits':{'has_logistics':!![],'communication_heavy':!![],'pure_digital':![],'long_cycle':![],'deposit_required':!![],'multi_tier_allocation':![]},'default_template':'rental/institutional-longstay','key_risk':'Owner\x20claims\x20damage\x20without\x20pre-rental\x20WIP\x20—\x20customer\x20loses\x20deposit\x20unfairly','build_notes':['Pre-rental\x20WIP\x20is\x20non-negotiable\x20—\x20without\x20it,\x20damage\x20claims\x20fail','Deposit\x20must\x20be\x20escrowed,\x20not\x20direct-transferred\x20—\x20enables\x20fair\x20deduction','Inspection\x20gate\x20prevents\x20customer\x20from\x20denying\x20damage','Overdue\x20handling\x20uses\x20a\x20time-lock\x20Guard\x20(clock)\x20—\x20the\x20Guard\x20only\x20ALLOWS\x20the\x20overdue\x20transition;\x20automatic\x20advancement\x20needs\x20an\x20off-chain\x20keeper\x20(see\x20DESIGN-REVIEW\x20C-3)','Extensions\x20are\x20modeled\x20as\x20separate\x20sub-orders\x20(REUSE\x20pattern),\x20not\x20as\x20machine\x20cycles\x20—\x20an\x20in-order\x20loop\x20replays\x20its\x20forwards\x27\x20fund\x20rails\x20every\x20lap','R-M1-11:\x20no\x20\x27deposit_refunded\x27/\x27deposit_deducted\x27/\x27refunded\x27\x20nodes\x20—\x20deposit\x20refund/deduction\x20flows\x20through\x20Allocator\x20triggered\x20by\x20return_approved/damage_confirmed\x20business\x20states','Payment\x20exception\x20compensation\x20for\x20return\x20delays\x20—\x20Treasury\x20withdraws\x20scene-bound\x20Payment\x20(§2.13)','Repository\x20quote_guard\x20for\x20weather/usage\x20data\x20subscription\x20revenue\x20(§2.11)']},{'name':'education','phase':0x2,'industry':'Courses\x20/\x20training\x20/\x20tutoring','trust_pattern':'Periodic\x20release\x20per\x20session,\x20attendance\x20Guard','traits':{'has_logistics':![],'communication_heavy':!![],'pure_digital':![],'long_cycle':!![],'deposit_required':!![],'multi_tier_allocation':![]},'default_template':'education/live-class-cohort','key_risk':'Tutoring\x20institutions\x20run\x20away\x20with\x20prepaid\x20tuition','build_notes':['Use\x20Service\x20`setting_lock_duration`\x20to\x20lock\x20rules\x20for\x20the\x20entire\x20term\x20(regulatory\x20compliance,\x20>=90d)','Attendance\x20Guard\x20needs\x20WIP\x20hash\x20for\x20session\x20content\x20commitment;\x20attendance\x20evidence\x20lives\x20in\x20the\x20class\x20Repository','Per-session\x20release\x20requires\x20threshold-based\x20trigger\x20—\x20each\x20attended\x20session\x20releases\x201/N','session_1..session_3\x20are\x20representative\x20—\x20configure\x20the\x20real\x20session\x20count\x20(session_N)\x20at\x20build\x20time;\x20each\x20session\x20=\x20one\x20attendance-Guarded\x20forward','Pause/deferral\x20is\x20a\x20terminal\x20node\x20+\x20new\x20sub-order\x20(REUSE\x20pattern)\x20—\x20never\x20a\x20loop\x20back\x20into\x20the\x20session\x20chain\x20(a\x20loop\x20replays\x20the\x20session\x20forwards\x27\x20fund\x20rails\x20every\x20lap;\x20if\x20a\x20loop\x20is\x20unavoidable\x20it\x20must\x20keep\x20a\x20cycle-breaking\x20exit)','Supply\x20chain\x20sub-orders\x20for\x20course\x20module\x20progressive\x20unlock\x20—\x20each\x20module\x20=\x20sub-service\x20with\x20buy_guard\x20verifying\x20previous\x20module\x20completion\x20(§2.12)','Repository\x20for\x20learning\x20progress\x20collaboration\x20data\x20—\x20progress\x20as\x20key,\x20session\x20data\x20as\x20value\x20(§2.10)']},{'name':'travel','phase':0x2,'industry':'Custom\x20tours\x20/\x20multi-segment\x20trips','trust_pattern':'Multi-tier\x20allocation\x20per\x20segment','traits':{'has_logistics':![],'communication_heavy':!![],'pure_digital':![],'long_cycle':!![],'deposit_required':!![],'multi_tier_allocation':!![]},'default_template':'travel/destination-experience','key_risk':'Paid\x20in\x20full\x20then\x20service\x20shrinks\x20—\x20multi-tier\x20transparency\x20prevents\x20this','build_notes':['Multi-tier\x20Allocation\x20is\x20WoWok\x27s\x20unique\x20advantage\x20over\x20traditional\x20travel\x20platforms','segment_guard\x20needs\x20standardized\x20WIP\x20templates\x20per\x20segment\x20type\x20(hotel,\x20transport,\x20activity)','Multi-tier\x20waterfall\x20needs\x20guard\x20chaining\x20validation','Weather/force-majeure\x20branches\x20enter\x20reschedule\x20(terminal)\x20or\x20partial-refund\x20interrupted\x20terminal\x20—\x20never\x20loop\x20back\x20into\x20the\x20segment\x20chain\x20(a\x20loop\x20replays\x20the\x20segment\x20forwards\x27\x20fund\x20rails\x20every\x20lap;\x20if\x20a\x20loop\x20is\x20unavoidable\x20it\x20must\x20keep\x20a\x20cycle-breaking\x20exit)','Supplier\x20sub-orders\x20each\x20carry\x20their\x20own\x20machine\x20—\x20hotel/guide/driver\x20fulfill\x20independently\x20(§2.12)','Supply\x20chain\x20sub-orders\x20—\x20each\x20tour\x20segment\x20=\x20sub-service\x20with\x20buy_guard\x20verifying\x20main\x20tour\x20order\x20(§2.12)','Payment\x20exception\x20compensation\x20for\x20flight/segment\x20delays\x20(§2.13)','Repository\x20quote_guard\x20for\x20weather/travel\x20data\x20subscription\x20revenue\x20(§2.11)']},{'name':'subscription','phase':0x3,'industry':'SaaS\x20/\x20content\x20membership\x20/\x20periodic\x20service','trust_pattern':'Periodic\x20charge,\x20cancel\x20Guard','traits':{'has_logistics':![],'communication_heavy':![],'pure_digital':!![],'long_cycle':!![],'deposit_required':![],'multi_tier_allocation':![]},'default_template':'subscription/creator-membership','key_risk':'Auto-renew\x20trap\x20and\x20platform-takes-30%\x20—\x20WoWok\x20native\x20solution','build_notes':['Pure\x20digital\x20—\x20native\x20WoWok\x20soil','charge_guard\x20needs\x20periodic\x20trigger\x20(off-chain\x20scheduler\x20+\x20on-chain\x20Guard)','Renewal\x20is\x20an\x20explicit\x20buyer-side\x20forward\x20(or\x20a\x20Guard-gated\x20auto-renew\x20WITH\x20WTS\x20notice)\x20—\x20never\x20silent','Cancellation\x20is\x20frictionless\x20and\x20next-period\x20effective;\x20pro-rata\x20refund\x20for\x20unearned\x20periods','Forbid\x20dead-end\x20nodes\x20(prevent\x20lock-in);\x20every\x20state\x20must\x20have\x20a\x20forward\x20or\x20be\x20an\x20intended\x20terminal','Targets\x20indie\x20creators,\x20niche\x20SaaS,\x20paid\x20newsletters','Repository\x20quote_guard\x20for\x20creator\x20data\x20subscription\x20revenue\x20—\x20creators\x20publish\x20paid\x20data,\x20users\x20pay\x20to\x20access\x20(§2.11)']},{'name':'retail','phase':0x1,'industry':'Goods\x20retail\x20/\x20marketplace\x20/\x20e-commerce','trust_pattern':'Escrow\x20+\x20confirm-on-receipt\x20release','traits':{'has_logistics':!![],'communication_heavy':![],'pure_digital':![],'long_cycle':![],'deposit_required':![],'multi_tier_allocation':![]},'default_template':'retail/scale-marketplace','key_risk':'Products\x20don\x27t\x20match\x20description\x20—\x20no\x20refund\x20path\x20for\x20returns','build_notes':['Logistics\x20WIP\x20(tracking\x20number)\x20is\x20essential\x20—\x20shipping\x20evidence\x20protects\x20both\x20parties\x20in\x20return\x20disputes','Confirm\x20gate\x20prevents\x20merchant\x20from\x20self-confirming\x20receipt','Refund\x20path\x20must\x20support\x20return-and-exchange\x20flow;\x20refund_window\x20>=\x207d','Return\x20request\x20is\x20time-lock\x20gated\x20—\x20after\x20the\x20window\x20closes,\x20returns\x20need\x20merchant\x20permission\x20or\x20arbitration','Compensation\x20fund\x20covers\x20return/exchange\x20disputes','R-M1-11:\x20no\x20\x27refunded\x27\x20node\x20—\x20refunds\x20route\x20via\x20Allocator\x20triggered\x20by\x20returned/cancelled\x20business\x20states;\x20disputes\x20go\x20to\x20Arbitration']},{'name':'licensing','phase':0x1,'industry':'IP\x20/\x20royalty\x20licensing\x20/\x20metered\x20asset\x20licenses','trust_pattern':'Terms\x20hash-anchored,\x20on-chain\x20royalty\x20split,\x20territory/term\x20Guard','traits':{'has_logistics':![],'communication_heavy':![],'pure_digital':!![],'long_cycle':!![],'deposit_required':![],'multi_tier_allocation':!![]},'default_template':'licensing/royalty-stream-auction','key_risk':'Buyer\x20trusts\x20the\x20seller\x27s\x20royalty/usage\x20reporting\x20—\x20without\x20an\x20on-chain\x20meter\x20the\x20accounting\x20honesty\x20is\x20only\x20as\x20good\x20as\x20the\x20attestation\x20and\x20the\x20compensation\x20backstop','build_notes':['Anchor\x20the\x20license\x20terms\x20(territory,\x20term,\x20media,\x20caps,\x20exclusivity)\x20as\x20a\x20WIP\x20hash\x20—\x20the\x20granted\x20rights\x20must\x20be\x20provable\x20in\x20a\x20dispute,\x20not\x20prose','Royalty\x20/\x20purchase-proceeds\x20split\x20is\x20an\x20Allocation\x20Rate\x20plan\x20(bps\x20summing\x20to\x2010000\x20across\x20rights-holders\x20+\x20platform);\x20the\x20split\x20is\x20frozen\x20at\x20publish\x20and\x20auditable\x20by\x20every\x20recipient','Recurring\x20royalty:\x20the\x20Allocation\x20pool\x20is\x20re-fillable\x20(order_renew\x20top-ups)\x20and\x20a\x20guard-keyed\x20periodic\x20alloc\x20with\x20a\x20period-N\x20once-key\x20(identifier\x20255)\x20releases\x20each\x20period\x20—\x20payroll-style\x20repeat\x20runs\x20stay\x20possible\x20without\x20the\x20once-slot','Territory\x20is\x20enforced\x20by\x20a\x20Service\x20buy_guard\x20running\x20pattern.identity_check_allowlist\x20(allowlist\x20as\x20an\x20Address-vector\x20table\x20constant);\x20term\x20/\x20inspection\x20window\x20is\x20a\x20tpl_time_lock_progress\x20forward\x20guard\x20(Clock\x20>=\x20entry_time\x20+\x20duration)','Time-lock\x20duration\x20is\x20an\x20IMMUTABLE\x20table\x20constant\x20fixed\x20at\x20publish\x20—\x20an\x20expired\x20window\x20only\x20BLOCKS\x20the\x20forward,\x20it\x20never\x20auto-refunds;\x20automatic\x20advancement\x20on\x20timeout\x20needs\x20an\x20off-chain\x20keeper','🔴\x20AUCTION\x20GAP:\x20there\x20is\x20NO\x20on-chain\x20ascending-auction\x20/\x20bid-ledger\x20/\x20highest-bidder\x20primitive.\x20Model\x20a\x20competitive\x20sale\x20as:\x20winner\x20resolved\x20OFF-CHAIN\x20(prose),\x20then\x20the\x20winner\x20calls\x20buy\x20like\x20any\x20buyer\x20—\x20optionally\x20gate\x20buy\x20with\x20an\x20allowlist\x20guard\x20carrying\x20the\x20attested\x20winner\x20address.\x20Never\x20claim\x20the\x20chain\x20runs\x20the\x20auction','🔴\x20METERED-CAPS\x20GAP:\x20there\x20is\x20NO\x20usage\x20oracle/meter.\x20A\x20\x27limited\x20to\x20N\x20streams/sales\x27\x20cap\x20can\x20only\x20be\x20an\x20ATTESTED\x20Repository\x20counter\x20that\x20a\x20forward\x20guard\x20reads\x20via\x20the\x20repository.data\x20count-where\x20query\x20—\x20the\x20count\x20is\x20only\x20as\x20trustworthy\x20as\x20its\x20write-guard\x20(self/attested),\x20never\x20an\x20oracle\x20feed.\x20Disclose\x20this\x20honestly;\x20never\x20present\x20a\x20cap\x20as\x20chain-enforced\x20metering','R-M1-11:\x20no\x20\x27refunded\x27/\x27cancelled\x27\x20fund\x20terminals\x20—\x20refunds\x20route\x20via\x20the\x20Allocator\x20triggered\x20by\x20a\x20business\x20state\x20(e.g.\x20inspection_failed);\x20disputes\x20go\x20to\x20Arbitration']},{'name':'crowdfunding','phase':0x1,'industry':'All-or-nothing\x20threshold\x20campaigns\x20/\x20flexible\x20keep-it-all\x20fundraising','trust_pattern':'Per-contributor\x20escrow\x20(unpooled)\x20+\x20on-chain\x20aggregate\x20threshold\x20+\x20deadline\x20two-leg\x20release/refund','traits':{'has_logistics':![],'communication_heavy':!![],'pure_digital':!![],'long_cycle':!![],'deposit_required':!![],'multi_tier_allocation':!![]},'default_template':'crowdfunding/all-or-nothing-threshold','key_risk':'The\x20funding\x20threshold\x20is\x20an\x20aggregate\x20read\x20over\x20a\x20shared\x20campaign\x20ledger\x20—\x20each\x20contribution\x20row\x20is\x20writer-bound\x20to\x20its\x20funder,\x20but\x20the\x20aggregate\x20is\x20a\x20read-only\x20sum\x20of\x20declared\x20rows,\x20not\x20an\x20independent\x20re-computation\x20of\x20every\x20escrow;\x20roster\x20completeness\x20is\x20keeper-attested.\x20Funders\x20also\x20trust\x20eventual\x20project\x20delivery,\x20backed\x20only\x20by\x20compensation_fund\x20+\x20arbitration','build_notes':['Per-contributor\x20escrow,\x20NEVER\x20pooled:\x20each\x20funder\x27s\x20Order\x20holds\x20its\x20OWN\x20Allocation\x20with\x20payment_info.for_object\x20bound\x20to\x20that\x20Order\x20—\x20because\x20the\x20money\x20is\x20never\x20balance::join-ed\x20into\x20one\x20pot,\x20attribution\x20survives\x20and\x20each\x20contribution\x20is\x20refundable\x20to\x20its\x20own\x20funder','Threshold\x20gate\x20=\x20an\x20on-chain\x20aggregate:\x20a\x20shared\x20campaign\x20Repository\x20holds\x20one\x20numeric\x20row\x20per\x20contribution\x20(keyed\x20by\x20the\x20contribution,\x20tagged\x20with\x20a\x20campaign\x20id);\x20the\x20settlement\x20Guard\x20reads\x20it\x20back\x20with\x20the\x20repository.data\x20sum-where\x20query\x20(1174\x20→\x20U256,\x20overflow-safe)\x20and\x20compares\x20against\x20the\x20threshold\x20constant','Write-side\x20binding\x20is\x20MANDATORY:\x20contribution\x20rows\x20are\x20written\x20under\x20pattern.repository_write_authorization\x20with\x20an\x20identity\x20leaf\x20(order.owner\x20==\x20Signer\x20/\x20order.agent\x20has\x20Signer)\x20so\x20a\x20funder\x20can\x20only\x20record\x20their\x20OWN\x20contribution\x20—\x20existence-is-not-trust\x20(R-X1-17),\x20an\x20unbound\x20write_guard\x20makes\x20the\x20aggregate\x20forgeable','Deadline\x20=\x20a\x20time-lock:\x20both\x20settlement\x20legs\x20require\x20Clock\x20>=\x20deadline\x20via\x20pattern.time_lock_progress\x20(query\x201280,\x20node-ENTRY\x20anchored);\x20BEFORE\x20the\x20deadline\x20a\x20funder\x20may\x20withdraw\x20(buyer-self-service\x20withdrawn\x20rail:\x20removes\x20their\x20writer-bound\x20row\x20+\x20full\x20refund\x20—\x20A12\x20fix,\x20was\x20wrongly\x20\x27no\x20early\x20withdrawal\x27);\x20AFTER\x20the\x20deadline\x20funds\x20are\x20committed\x20to\x20the\x20threshold\x20outcome','Two-leg\x20escrow\x20exit\x20(D-BUG-2\x20polarity):\x20release\x20leg\x20(→\x20project\x20Entity)\x20gated\x20logic_and[sum_where\x20>=\x20threshold,\x20clock\x20>=\x20deadline];\x20refund\x20leg\x20(→\x20for_object,\x20the\x20funder\x27s\x20own\x20Order)\x20gated\x20logic_and[sum_where\x20<\x20threshold,\x20clock\x20>=\x20deadline]\x20—\x20mutually\x20exclusive\x20on\x20the\x20aggregate\x20comparison,\x20so\x20exactly\x20one\x20is\x20satisfiable\x20once\x20the\x20deadline\x20passes','Keeper\x20batch\x20settlement:\x20on\x20a\x20missed\x20campaign\x20a\x20keeper\x20enumerates\x20every\x20contributor\x20via\x20repository.data\x20find-where\x20(1176\x20→\x20VectorAddress)\x20/\x20keys-where\x20(1177\x20→\x20VectorString)\x20and\x20advances\x20each\x20funder\x27s\x20refund\x20leg\x20in\x20one\x20PTB\x20(or\x20N\x20PTBs)\x20—\x20an\x20ops\x20efficiency,\x20not\x20a\x20chain\x20capability','🔴\x20AGGREGATE\x20TRUST\x20BOUNDARY:\x20the\x20sum\x20is\x20only\x20as\x20honest\x20as\x20the\x20writer-bound\x20rows;\x20it\x20is\x20NOT\x20independently\x20re-derivable\x20on-chain\x20without\x20reading\x20every\x20escrow\x20balance.\x20Disclose\x20this\x20honestly\x20(L-04);\x20never\x20present\x20the\x20threshold\x20as\x20a\x20chain-verified\x20total-custody\x20proof','🔴\x20L-01\x20NON-INVESTMENT:\x20crowdfunding\x20copy\x20must\x20never\x20promise\x20investment\x20returns,\x20yield,\x20or\x20token-price\x20appreciation\x20—\x20it\x20is\x20a\x20threshold\x20purchase/preorder/donation,\x20not\x20a\x20security','🔴\x20L-05\x20KYC/AML:\x20pooled\x20fundraising\x20is\x20high\x20regulatory\x20intensity\x20—\x20cross-border\x20funds\x20and\x20reward\x20tiers\x20may\x20trigger\x20securities/money-transmission\x20rules;\x20flag\x20for\x20compliance,\x20do\x20not\x20automate\x20around\x20them','R-M1-11:\x20no\x20\x27refunded\x27/\x27cancelled\x27\x20fund\x20terminals\x20—\x20the\x20refund\x20leg\x20routes\x20via\x20the\x20Allocator\x20triggered\x20by\x20the\x20missed-threshold\x20business\x20state\x20at\x20deadline;\x20disputes\x20go\x20to\x20Arbitration']},{'name':'delivery','phase':0x1,'industry':'Restaurant\x20food-delivery\x20/\x20on-demand\x20errand\x20(local\x20fulfillment)','trust_pattern':'Escrow-through-delivery\x20+\x20roster-authorized\x20per-order\x20rider\x20+\x20serial\x20claim\x20window','traits':{'has_logistics':!![],'communication_heavy':!![],'pure_digital':![],'long_cycle':![],'deposit_required':![],'multi_tier_allocation':![]},'default_template':'delivery/restaurant-marketplace','key_risk':'Per-order\x20dispatched\x20riders\x20have\x20no\x20on-chain\x20identity\x20—\x20the\x20named-operator\x20roster\x20is\x20their\x20ONLY\x20authorized\x20forward\x20and\x20the\x20roster\x20writer\x20is\x20the\x20de-facto\x20rider\x20admitter\x20(undisclosed,\x20a\x20silent\x20centralization);\x20handover\x20records\x20are\x20unwitnessable\x20by\x20the\x20buyer;\x20rider\x20pay\x20is\x20the\x20platform\x27s\x20off-chain\x20payroll\x20BY\x20DESIGN\x20(T-06\x20correction,\x20sso-tn-261027-7f3a91:\x20a\x20Signer\x20allocator\x20leg\x20CAN\x20pay\x20a\x20per-order\x20rider\x20directly\x20—\x20the\x20on-chain\x20Signer\x20leg\x20bypasses\x20the\x20for_object\x20lock\x20that\x20binds\x20only\x20GuardIdentifier\x20submissions)','build_notes':['Hours-scale\x20windows,\x20not\x20retail\x20DAYS:\x20auto-confirm\x201-2h,\x20claim\x20window\x2024h,\x20settlement\x2024h\x20—\x20food\x20is\x20perishable;\x20anchor\x20every\x20relative\x20gate\x20on\x20progress.history.time\x20(query\x201280,\x20find=last),\x20never\x201272\x20current_time','Dispatch\x20is\x20OFF-CHAIN\x20(K-4):\x20the\x20chain\x20has\x20no\x20dispatch/scheduling\x20primitive\x20—\x20the\x20rider\x27s\x20only\x20chain\x20footprint\x20is\x20the\x20per-order\x20namedOperator\x20roster\x20(permission\x20index\x20221);\x20the\x20roster\x27s\x20write\x20power\x20is\x20the\x20rider-admission\x20power\x20and\x20MUST\x20be\x20disclosed\x20(NAMED_OPERATOR_ROSTER_UNDISCLOSED)','Riders\x20are\x20paid\x20by\x20the\x20platform\x20in\x20this\x20shape\x20(T-06\x20correction,\x20sso-tn-261027-7f3a91):\x20a\x20GuardIdentifier\x20leg\x20pays\x20the\x20order\x27s\x20own\x20CoinWrapper\x20(the\x20on-chain\x20for_object\x20lock),\x20so\x20a\x20slot\x20leg\x20is\x20unfundable\x20for\x20a\x20person\x20—\x20but\x20a\x20Signer\x20leg\x20IS\x20an\x20on-chain\x20payee\x20shape\x20for\x20the\x20rostered\x20rider\x20(the\x20on-chain\x20Signer\x20leg,\x20proven\x20live);\x20the\x20shipped\x20default\x20routes\x20pay\x20through\x20the\x20commission\x20leg\x20as\x20off-chain\x20payroll\x20instead','Serial\x20claim\x20window\x20(TPL-09):\x20settlement\x20departs\x20a\x20mandatory\x20claim_window\x20node\x20so\x20no\x20release\x20can\x20fire\x20while\x20a\x20dispute\x20could\x20still\x20be\x20filed\x20(FACT-ALLOC-03);\x20assert\x20settle_hours\x20>=\x20claim_window_hours\x20at\x20generation','Fee-graded\x20cancellation:\x20a\x20pre-acceptance\x20cancel\x20refunds\x20in\x20full,\x20a\x20post-acceptance\x20kill\x20pays\x20a\x20prep\x20fee\x20—\x20distinct\x20closed_cancel\x20/\x20closed_kill\x20terminals\x20so\x20fee\x20and\x20full\x20refund\x20never\x20share\x20a\x20rail','Transit\x20loss\x20has\x20a\x20buyer\x20rail:\x20an\x20identity-only\x20ReportTransitLoss\x20declaration\x20into\x20the\x20dispute\x20waypoint\x20(no\x20window\x20mid-transit\x20—\x20the\x20anchor\x20row\x20does\x20not\x20exist\x20yet,\x20F-TPL-01\x20trap);\x20the\x20remedy\x20route\x20is\x20arbitration\x20into\x20the\x20full-refund\x20rail,\x20disclosed']},{'name':'group_buy','phase':0x1,'industry':'Community\x20group-buying\x20(leader\x20consolidation\x20+\x20neighborhood\x20pickup)','trust_pattern':'Shared\x20ABSOLUTE\x20batch\x20cutoff\x20+\x20batch\x20consolidation\x20+\x20threshold-gated\x20release\x20(challenger:\x20per-backer\x20unpooled\x20escrow)','traits':{'has_logistics':!![],'communication_heavy':!![],'pure_digital':![],'long_cycle':![],'deposit_required':!![],'multi_tier_allocation':!![]},'default_template':'group_buy/platform-supplied-pickup','key_risk':'The\x20buyer\x20pre-pays\x20against\x20a\x20batch\x20that\x20may\x20never\x20form,\x20and\x20the\x20challenger\x27s\x20supply\x20chain\x20is\x20OFF-CHAIN\x20(undiligence-able\x20before\x20purchase\x20—\x20the\x20trust\x20gap\x20and\x20the\x20main\x20arbitration\x20evidence\x20source);\x20the\x20batch\x20cutoff\x20must\x20be\x20ONE\x20shared\x20absolute\x20timestamp\x20(keeper-written\x20Repository\x20row),\x20never\x20a\x20per-order\x20entry+duration\x20lock;\x20multi-level\x20commission\x20schemes\x20are\x20NOT\x20expressible\x20(single-layer\x20commission\x20only)','build_notes':['The\x20batch\x20cutoff\x20is\x20a\x20SHARED\x20ABSOLUTE\x20timestamp\x20(pattern.time_lock_absolute):\x20one\x20clock\x20for\x20every\x20buyer\x20in\x20the\x20batch,\x20keeper-written\x20per\x20batch\x20into\x20a\x20Repository\x20row\x20—\x20chain\x20Clock\x20is\x20block-driven,\x20so\x20a\x20real-world\x20calendar\x20cutoff\x20(23:00\x20daily)\x20needs\x20pattern.time_source_repository_oracle;\x20a\x20per-order\x20entry+duration\x20lock\x20gives\x20every\x20buyer\x20a\x20DIFFERENT\x20cutoff\x20and\x20is\x20not\x20a\x20batch','Supply-chain\x20suborder\x20commitment\x20(leader):\x20the\x20supplier\x27s\x20sub-service\x20address\x20is\x20a\x20FIXED\x20promise\x20in\x20the\x20ConsolidateBatch\x20guard\x20table\x20(b_submission\x20false,\x20value_type\x20Address)\x20—\x20the\x20whole\x20procurement\x20graph\x20is\x20enumerable\x20and\x20diligence-able\x20BEFORE\x20any\x20buyer\x20pays\x20(the\x20structural\x20trust\x20advantage);\x20the\x20challenger\x20(leader-sourced)\x20has\x20NO\x20such\x20commitment\x20—\x20disclose\x20it\x20as\x20the\x20structural\x20trust\x20gap','Threshold\x20mode\x20reuses\x20the\x20crowdfunding\x20construction\x20wholesale:\x20unpooled\x20per-backer\x20escrow\x20(for_object\x20=\x20the\x20backer\x27s\x20own\x20order),\x20ORDER-keyed\x20contribution\x20rows,\x20the\x20escrow-bound\x20aggregate\x20(per-row\x20min(row,\x20order.amount,\x20live\x20allocation.balance\x20—\x20v140\x20live\x20cap))\x20and\x20the\x20live-escrow\x20+\x20claimed_by-false\x20legs\x20—\x20the\x20three\x20CROWDFUNDING_*\x20blockers\x20apply\x20automatically','Pickup-point\x20topology:\x20staffed\x20points\x20ride\x20the\x20named-operator\x20leader\x20rail\x20(ShelveAtPoint\x20+\x20HandOverByPoint);\x20AUTOMATED\x20lockers\x20drop\x20both\x20(a\x20locker\x20cannot\x20sign\x20—\x20the\x20buyer\x27s\x20own\x20Collect\x20signature\x20is\x20the\x20stronger\x20handover\x20proof);\x20the\x20unclaimed-goods\x20exit\x20window\x20is\x20mandatory\x20(goods\x20never\x20picked\x20up\x20must\x20refund\x20at\x20a\x20bounded\x20deadline)','Leader\x20commission\x20is\x20a\x20single-layer\x20rate\x20leg\x20paid\x20to\x20the\x20platform\x20Entity\x20with\x20OFF-CHAIN\x20pass-through\x20(a\x20per-order\x20third\x20party\x20has\x20no\x20on-chain\x20payee\x20shape\x20—\x20the\x20for_object\x20lock);\x20multi-level/regional\x20commission\x20is\x20NOT\x20expressible\x20—\x20disclose','Delay\x20compensation\x20pays\x20from\x20the\x20compensation_fund,\x20NEVER\x20from\x20the\x20buyer\x27s\x20escrow\x20(Order\x20binds\x20<=\x201\x20allocator);\x20the\x20fund\x20must\x20be\x20pre-locked\x20to\x203x\x20the\x20largest\x20order\x20(B2)\x20or\x20higher\x20tiers\x20are\x20silently\x20unsellable']},{'name':'general','phase':0x1,'industry':'Anything\x20not\x20covered\x20/\x20hybrid','trust_pattern':'User-defined\x20from\x20scratch','traits':{'has_logistics':![],'communication_heavy':![],'pure_digital':![],'long_cycle':![],'deposit_required':![],'multi_tier_allocation':![]},'default_template':null,'key_risk':'No\x20safety\x20net\x20—\x20user\x20must\x20design\x20all\x20trust\x20mechanisms\x20manually','build_notes':['Escape\x20hatch:\x20any\x20user\x20can\x20switch\x20to\x20general\x20mode\x20at\x20any\x20time','Already-created\x20objects\x20under\x20a\x20previous\x20mode\x20remain\x20on-chain\x20(REUSE\x20pattern)','wowok-machine\x20/\x20wowok-guard\x20/\x20wowok-provider\x20become\x20primary\x20references']}];export function matchScenarioMode(a){const b=a['toLowerCase'](),c=inferScenarioTraits(a),e=SCENARIO_MODES['map'](h=>{let i=0x0,j=0x0;for(const k of Object['keys'](c)){j+=0x1;if(h['traits'][k]===c[k])i+=0x1;}if(h['name']!=='general'){const l=MODE_KEYWORDS[h['name']]??[];for(const m of l){if(b['includes'](m))i+=0.5;}}return{'mode':h,'score':i,'total':j};});let f=e[0x0];for(const h of e){if(h['score']>f['score'])f=h;}const g=f['total']>0x0?Math['min'](0x1,f['score']/f['total']):0x0;return{'mode':f['mode'],'confidence':g};}const MODE_KEYWORDS={'freelance':['freelance','design','develop','consult','write','consulting'],'rental':['rent','rental','lease','borrow','equipment','vehicle','property'],'education':['course','training','tutor','teach','education','class'],'travel':['tour','travel','trip','itinerary','vacation'],'subscription':['subscribe','subscription','membership','saas','newsletter','recurring'],'retail':['retail','shop','store','marketplace','sell\x20goods','ecommerce','e-commerce'],'licensing':['license','licensing','royalty','royalties','ip','intellectual\x20property','music\x20rights','sync','beat','franchise','rights'],'crowdfunding':['crowdfunding','crowdfund','fundraising','pledge','backer','kickstarter','campaign','all-or-nothing','threshold\x20goal','presale\x20campaign','raise\x20funds'],'delivery':['delivery','food\x20delivery','takeout','takeaway','errand','on-demand','rider','courier\x20delivery','waimai','last\x20mile'],'group_buy':['group\x20buy','group-buy','groupbuy','community\x20group','team\x20purchase','batch\x20cutoff','neighborhood\x20pickup','pickup\x20point','tuangou']};export function inferScenarioTraits(a){const b=a['toLowerCase']();return{'has_logistics':/ship|delivery|equipment|vehicle|physical|goods/['test'](b),'communication_heavy':/consult|discuss|back-and-forth|custom|bespoke|negotiate/['test'](b),'pure_digital':/digital|file|download|online|software|code|design|content/['test'](b),'long_cycle':/month|long-term|engagement|project|semester|period/['test'](b),'deposit_required':/deposit|escrow|prepay|tuition|reserve/['test'](b),'multi_tier_allocation':/tier|segment|multi-|agency|hotel|guide|driver/['test'](b)};}export const MODE_COMPOSITIONS=[{'modes':['freelance','subscription'],'use_case':'Retainer\x20consulting\x20(monthly\x20+\x20milestone)','conflict_resolution':'Allocator:\x20split\x20into\x20retainer\x20(subscription)\x20+\x20milestone\x20(freelance)'},{'modes':['rental','education'],'use_case':'Equipment\x20training\x20rental','conflict_resolution':'Machine:\x20extend\x20rental\x20nodes\x20with\x20attendance\x20gates'},{'modes':['travel','rental'],'use_case':'Tour\x20with\x20equipment','conflict_resolution':'Allocator:\x20segment\x20allocation\x20+\x20deposit\x20escrow\x20side-by-side'}];export function getScenarioMode(a){return SCENARIO_MODES['find'](b=>b['name']===a);}export function listScenarioModes(){return SCENARIO_MODES;}export function getShippedModes(){return SCENARIO_MODES['filter'](a=>a['phase']===0x1);}export function getModeCompositions(a){return MODE_COMPOSITIONS['filter'](b=>b['modes']['includes'](a));}export const SCENARIO_MODES_VERSION=0xa;
@@ -68,8 +68,10 @@ export declare const SERVICE_LISTING_REFUND_GATES: {
68
68
  };
69
69
  export declare const SERVICE_ORDER_FLOW_STAGES: ServiceOrderFlowStage[];
70
70
  export declare const SERVICE_CROSS_OBJECT_BINDINGS: ServiceCrossObjectBinding[];
71
+ export declare const SERVICE_REWARDS_BUYER_DD: string;
72
+ export declare const SUBSERVICE_ACCOUNT_ALIGNMENT: string;
71
73
  export declare const SERVICE_SCENES: ServiceScene[];
72
- export declare const SERVICE_LEDGER_VERSION = "1.0.0";
74
+ export declare const SERVICE_LEDGER_VERSION = "1.1.0";
73
75
  export declare function getScenesByCategory(category: ServiceScene["category"]): ServiceScene[];
74
76
  export declare function findSceneById(id: string): ServiceScene | undefined;
75
77
  export declare function getServicePermissionByIndex(index: number): ServicePermissionEntry | undefined;