@wowok/agent-mcp 3.2.1 → 3.2.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 (176) hide show
  1. package/dist/chain-semantics/field-capability.d.ts +11 -0
  2. package/dist/chain-semantics/field-capability.js +1 -0
  3. package/dist/chain-semantics/freeze-map.d.ts +11 -0
  4. package/dist/chain-semantics/freeze-map.js +1 -0
  5. package/dist/chain-semantics/fund-flow.d.ts +10 -0
  6. package/dist/chain-semantics/fund-flow.js +1 -0
  7. package/dist/chain-semantics/guard-verbs.d.ts +22 -0
  8. package/dist/chain-semantics/guard-verbs.js +1 -0
  9. package/dist/chain-semantics/index.d.ts +10 -0
  10. package/dist/chain-semantics/index.js +1 -0
  11. package/dist/chain-semantics/object-graph.d.ts +18 -0
  12. package/dist/chain-semantics/object-graph.js +1 -0
  13. package/dist/communication/wts-attestation.d.ts +34 -0
  14. package/dist/communication/wts-attestation.js +1 -0
  15. package/dist/composition/audit.d.ts +10 -0
  16. package/dist/composition/audit.js +1 -0
  17. package/dist/composition/compile.d.ts +38 -0
  18. package/dist/composition/compile.js +1 -0
  19. package/dist/composition/materialize.d.ts +64 -0
  20. package/dist/composition/materialize.js +1 -0
  21. package/dist/composition/plan.d.ts +92 -0
  22. package/dist/composition/plan.js +1 -0
  23. package/dist/composition/reflux.d.ts +28 -0
  24. package/dist/composition/reflux.js +1 -0
  25. package/dist/config/judgment.d.ts +25 -0
  26. package/dist/config/rule-engine.d.ts +10 -0
  27. package/dist/config/rule-engine.js +1 -1
  28. package/dist/evaluation/builtins/graph-service.spec.js +1 -1
  29. package/dist/evaluation/engine.js +1 -1
  30. package/dist/experience/realtime-feedback.js +1 -1
  31. package/dist/extensions/business-modules.js +1 -1
  32. package/dist/extensions/industry-pack.js +1 -1
  33. package/dist/extensions/modes.js +1 -1
  34. package/dist/graph/onchain/expand.js +1 -1
  35. package/dist/graph/onchain/exposure.js +1 -1
  36. package/dist/graph/onchain/facts.js +1 -1
  37. package/dist/keeper/detectors.d.ts +7 -0
  38. package/dist/keeper/detectors.js +1 -1
  39. package/dist/keeper/types.d.ts +1 -1
  40. package/dist/keeper/types.js +1 -1
  41. package/dist/knowledge/allocation-ledger.js +1 -1
  42. package/dist/knowledge/allocation-puzzle.js +1 -1
  43. package/dist/knowledge/allocation-risk.d.ts +2 -1
  44. package/dist/knowledge/allocation-risk.js +1 -1
  45. package/dist/knowledge/allocation-templates.js +1 -1
  46. package/dist/knowledge/arb-fund-facts.d.ts +31 -0
  47. package/dist/knowledge/arb-fund-facts.js +1 -0
  48. package/dist/knowledge/audit-rules.js +1 -1
  49. package/dist/knowledge/baselines/rules/allocation.json +75 -16
  50. package/dist/knowledge/baselines/rules/guard.json +27 -8
  51. package/dist/knowledge/baselines/rules/plan.json +161 -0
  52. package/dist/knowledge/baselines/semantic-facts.d.ts +12 -0
  53. package/dist/knowledge/baselines/semantic-facts.js +1 -0
  54. package/dist/knowledge/builtin-templates.d.ts +3 -1
  55. package/dist/knowledge/builtin-templates.js +1 -1
  56. package/dist/knowledge/entity-recipient-guard.d.ts +21 -0
  57. package/dist/knowledge/entity-recipient-guard.js +1 -0
  58. package/dist/knowledge/getting-started.js +1 -1
  59. package/dist/knowledge/guard-design-patterns.js +1 -1
  60. package/dist/knowledge/guard-ledger.js +1 -1
  61. package/dist/knowledge/guard-risk.js +1 -1
  62. package/dist/knowledge/guard-templates.js +1 -1
  63. package/dist/knowledge/index.js +1 -1
  64. package/dist/knowledge/industry-registry.js +1 -1
  65. package/dist/knowledge/jsonrpc-enum.js +1 -1
  66. package/dist/knowledge/machine-topology.d.ts +34 -0
  67. package/dist/knowledge/machine-topology.js +1 -1
  68. package/dist/knowledge/onchain-constants.d.ts +2 -2
  69. package/dist/knowledge/onchain-constants.js +1 -1
  70. package/dist/knowledge/scenario-modes.d.ts +13 -0
  71. package/dist/knowledge/scenario-modes.js +1 -1
  72. package/dist/knowledge/service-allocation-semantics.js +1 -1
  73. package/dist/knowledge/service-ledger.js +1 -1
  74. package/dist/knowledge/service-templates.js +1 -1
  75. package/dist/knowledge/strategy-manuals.js +1 -1
  76. package/dist/knowledge/template-loader.d.ts +37 -1
  77. package/dist/knowledge/template-loader.js +1 -1
  78. package/dist/knowledge/template-registry.js +1 -1
  79. package/dist/knowledge/template-scanner.js +1 -1
  80. package/dist/knowledge/tool-constraints.js +1 -1
  81. package/dist/knowledge/tools-reference.js +1 -1
  82. package/dist/knowledge/workflow-guidance.d.ts +4 -0
  83. package/dist/knowledge/workflow-guidance.js +1 -1
  84. package/dist/monitor/MonitorLoop.js +1 -1
  85. package/dist/participation/radar-core.d.ts +6 -0
  86. package/dist/participation/radar-core.js +1 -1
  87. package/dist/playbooks/service-build/business-puzzle.js +1 -1
  88. package/dist/playbooks/service-build/index.d.ts +1 -0
  89. package/dist/playbooks/service-build/intent-analyzer.d.ts +1 -0
  90. package/dist/playbooks/service-build/intent-analyzer.js +1 -1
  91. package/dist/playbooks/service-build/machine-nodes.d.ts +1 -1
  92. package/dist/playbooks/service-build/machine-nodes.js +1 -1
  93. package/dist/playbooks/service-build/machine-panorama.js +1 -1
  94. package/dist/playbooks/service-build/merchant-guide.js +1 -1
  95. package/dist/playbooks/service-build/migration-planner.js +1 -1
  96. package/dist/playbooks/service-build/object-panorama.d.ts +27 -1
  97. package/dist/playbooks/service-build/object-panorama.js +1 -1
  98. package/dist/playbooks/service-build/participation-radar.js +1 -1
  99. package/dist/playbooks/service-build/pipeline-actions.d.ts +4 -0
  100. package/dist/playbooks/service-build/pipeline-actions.js +1 -1
  101. package/dist/playbooks/service-build/relationship-profile.js +1 -1
  102. package/dist/playbooks/service-build/semantic-graph.d.ts +1 -0
  103. package/dist/playbooks/service-build/semantic-graph.js +1 -1
  104. package/dist/playbooks/service-build/service-panorama.js +1 -1
  105. package/dist/playbooks/service-build/service-quote.js +1 -1
  106. package/dist/review/index.js +1 -1
  107. package/dist/safety/confirm-gate.js +1 -1
  108. package/dist/schema/call/machine.d.ts +1 -0
  109. package/dist/schema/call/machine.js +1 -1
  110. package/dist/schema/call/order.d.ts +60 -0
  111. package/dist/schema/call/order.js +1 -1
  112. package/dist/schema/call/semantic.js +1 -1
  113. package/dist/schema/call/service.d.ts +56 -0
  114. package/dist/schema/call/service.js +1 -1
  115. package/dist/schema/common/index.js +1 -1
  116. package/dist/schema/goal/planning.d.ts +7 -0
  117. package/dist/schema/goal/planning.js +1 -1
  118. package/dist/schema/index.d.ts +1 -0
  119. package/dist/schema/index.js +1 -1
  120. package/dist/schema/industry-pack/index.d.ts +26 -0
  121. package/dist/schema/industry-pack/index.js +1 -1
  122. package/dist/schema/local/index.js +1 -1
  123. package/dist/schema/messenger/index.d.ts +20 -0
  124. package/dist/schema/messenger/index.js +1 -1
  125. package/dist/schema/operations.d.ts +50 -0
  126. package/dist/schema/persona/index.d.ts +110 -0
  127. package/dist/schema/query/bi.d.ts +2 -0
  128. package/dist/schema/query/bi.js +1 -1
  129. package/dist/schema/query/index.js +1 -1
  130. package/dist/schema/schema-version.js +1 -1
  131. package/dist/schema/service-clone/index.d.ts +46 -0
  132. package/dist/schema/service-clone/index.js +1 -0
  133. package/dist/schema/utils/node-parser.js +1 -1
  134. package/dist/schema-query-impl/index.js +1 -1
  135. package/dist/schemas/index.json +7 -1
  136. package/dist/schemas/industry_pack_operation.output.json +113 -0
  137. package/dist/schemas/industry_pack_operation.schema.json +7 -1
  138. package/dist/schemas/messenger_operation.output.json +42 -4
  139. package/dist/schemas/onchain_operations.output.json +1 -1
  140. package/dist/schemas/onchain_operations.schema.json +409 -98
  141. package/dist/schemas/onchain_operations_allocation.schema.json +5 -5
  142. package/dist/schemas/onchain_operations_arbitration.schema.json +2 -2
  143. package/dist/schemas/onchain_operations_contact.schema.json +1 -1
  144. package/dist/schemas/onchain_operations_demand.schema.json +3 -3
  145. package/dist/schemas/onchain_operations_gen_passport.schema.json +1 -1
  146. package/dist/schemas/onchain_operations_guard.schema.json +59 -59
  147. package/dist/schemas/onchain_operations_machine.schema.json +3 -3
  148. package/dist/schemas/onchain_operations_order.schema.json +133 -1
  149. package/dist/schemas/onchain_operations_progress.schema.json +1 -1
  150. package/dist/schemas/onchain_operations_proof.schema.json +1 -1
  151. package/dist/schemas/onchain_operations_repository.schema.json +1 -1
  152. package/dist/schemas/onchain_operations_reward.schema.json +4 -4
  153. package/dist/schemas/onchain_operations_service.schema.json +188 -9
  154. package/dist/schemas/onchain_operations_treasury.schema.json +7 -7
  155. package/dist/schemas/onchain_table_data.output.json +5 -1
  156. package/dist/schemas/persona_operation.output.json +266 -0
  157. package/dist/schemas/persona_operation.schema.json +42 -0
  158. package/dist/schemas/query_toolkit.output.json +46 -46
  159. package/dist/schemas/query_toolkit.schema.json +5 -1
  160. package/dist/schemas/service_clone_operation.output.json +168 -0
  161. package/dist/schemas/service_clone_operation.schema.json +49 -0
  162. package/dist/schemas/workflow_operation.schema.json +1 -1
  163. package/dist/tools/handlers/benchmark-migration.d.ts +17 -0
  164. package/dist/tools/handlers/benchmark-migration.js +1 -1
  165. package/dist/tools/handlers/config.js +1 -1
  166. package/dist/tools/handlers/industry-pack.js +1 -1
  167. package/dist/tools/handlers/messenger.js +1 -1
  168. package/dist/tools/handlers/onchain.js +1 -1
  169. package/dist/tools/handlers/query.js +1 -1
  170. package/dist/tools/handlers/service-clone.d.ts +2 -0
  171. package/dist/tools/handlers/service-clone.js +1 -0
  172. package/dist/tools/index.js +1 -1
  173. package/dist/tools/registry/business.js +1 -1
  174. package/dist/tools/wrap.d.ts +6 -1
  175. package/dist/tools/wrap.js +1 -1
  176. package/package.json +4 -3
@@ -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':![]},'machine_shape':[{'name':'paid','role':'Entry:\x20order\x20created\x20and\x20paid\x20via\x20Service.buy();\x20Machine\x20starts\x20here'},{'name':'kickoff','role':'Scope\x20confirmed;\x20WTS\x20change-request\x20channel\x20opened\x20(scope-creep\x20ledger)'},{'name':'milestone_1_delivering','role':'Provider\x20works\x20on\x20milestone\x201'},{'name':'milestone_1_delivered','role':'Milestone\x201\x20deliverable\x20submitted\x20(WIP\x20hash\x20mandatory)'},{'name':'milestone_1_accepted','role':'Customer\x20signs\x20milestone\x201\x20acceptance\x20—\x20M1\x20funds\x20releasable','operator':'order_payer'},{'name':'milestone_2_delivering','role':'Provider\x20works\x20on\x20milestone\x202'},{'name':'milestone_2_delivered','role':'Milestone\x202\x20deliverable\x20submitted\x20(WIP\x20hash\x20mandatory)'},{'name':'milestone_2_accepted','role':'Customer\x20signs\x20milestone\x202\x20acceptance\x20—\x20M2\x20funds\x20releasable','operator':'order_payer'},{'name':'final_delivering','role':'Provider\x20finalizes\x20remaining\x20scope'},{'name':'final_delivered','role':'Final\x20deliverable\x20submitted\x20(WIP\x20hash\x20mandatory)'},{'name':'completed','role':'Final\x20acceptance\x20signed\x20—\x20remaining\x20escrow\x20released\x20to\x20provider','operator':'order_payer'},{'name':'closed_cancel','role':'Pre-delivery\x20cancellation\x20—\x20triggers\x20refund\x20Allocator\x20(unearned\x20portion)','operator':'order_payer'}],'guards':[{'template_id':'pattern.buy_guard_blocklist','host':'service','purpose':'Customer\x20identity\x20check\x20on\x20purchase'},{'template_id':'pattern.identity_check_order_holder','host':'machine','purpose':'Both\x20parties\x20confirm\x20scope\x20at\x20kickoff\x20(WTS\x20change-request\x20channel)'},{'template_id':'pattern.repository_data_check','host':'machine','purpose':'Provider\x20must\x20submit\x20WIP\x20hash\x20for\x20every\x20milestone\x20deliverable'},{'template_id':'pattern.identity_check_order_holder','host':'machine','purpose':'Only\x20customer\x20can\x20sign\x20milestone/final\x20acceptance'},{'template_id':'pattern.identity_check_service_provider_dynamic','host':'machine','purpose':'Only\x20provider\x20can\x20withdraw\x20after\x20each\x20accepted\x20milestone'},{'template_id':'pattern.identity_check_order_holder','host':'machine','purpose':'Only\x20customer\x20can\x20initiate\x20pre-delivery\x20cancellation'},{'template_id':'tpl_payment_exception_compensation','host':'machine','purpose':'Delivery\x20delay\x20exception\x20compensation\x20via\x20scene-bound\x20Payment\x20(§2.13)'}],'allocator':{'recipient':'signer','count':0x2,'mode':'amount','description':'Per-milestone\x20release:\x20each\x20accepted\x20milestone\x20releases\x20its\x20escrowed\x20amount\x20to\x20provider;\x20final\x20acceptance\x20releases\x20the\x20remainder\x20on\x20completed;\x20pre-delivery\x20cancellation\x20refunds\x20the\x20unearned\x20portion\x20to\x20customer\x20via\x20Allocator\x20(off-Machine\x20fund\x20routing\x20per\x20R-M1-11)'},'key_risk':'Customer\x20never\x20accepts\x20delivery\x20—\x20provider\x20cannot\x20get\x20paid','build_notes':['Use\x20Service\x20`setting_locked_time`\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)','Upwork\x20Project\x20Catalog\x20orders\x20have\x20NO\x20milestones\x20(single\x20funded\x20order\x20+\x20steps\x20timeline);\x20milestones\x20here\x20model\x20Upwork\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\x20Upwork\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':![]},'machine_shape':[{'name':'deposit_paid','role':'Entry:\x20deposit\x20+\x20rent\x20paid\x20via\x20Service.buy();\x20Machine\x20starts\x20here'},{'name':'booking_confirmed','role':'Owner\x20confirms\x20availability\x20and\x20handover\x20schedule'},{'name':'handover_out','role':'Owner\x20hands\x20over\x20item,\x20records\x20pre-rental\x20WIP\x20(condition\x20photos)'},{'name':'in_use','role':'Rental\x20period\x20active'},{'name':'overdue','role':'Past\x20due\x20date\x20without\x20return\x20—\x20time-lock\x20Guard\x20(clock)\x20gates\x20late\x20fees'},{'name':'return_requested','role':'Customer\x20initiates\x20return','operator':'order_payer'},{'name':'returned','role':'Item\x20physically\x20returned;\x20post-rental\x20WIP\x20recorded','operator':'order_payer'},{'name':'inspected','role':'Owner\x20inspects\x20returned\x20item\x20(pre+post\x20WIP\x20comparison)'},{'name':'return_approved','role':'No\x20damage\x20—\x20triggers\x20deposit\x20refund\x20Allocator\x20(100%\x20to\x20customer)'},{'name':'damage_confirmed','role':'Damage\x20confirmed\x20via\x20pre+post\x20WIP\x20diff\x20—\x20triggers\x20deposit\x20deduction\x20Allocator'},{'name':'completed','role':'Rental\x20finalized\x20—\x20triggers\x20rent\x20Allocator\x20(rent\x20to\x20owner)'},{'name':'closed_cancel','role':'Pre-handover\x20cancellation\x20—\x20triggers\x20full\x20refund\x20Allocator','operator':'order_payer'}],'guards':[{'template_id':'pattern.verifier_evidence_philosophy','host':'service','purpose':'Verify\x20deposit\x20amount\x20matches\x20listing'},{'template_id':'pattern.identity_check_service_provider_dynamic','host':'machine','purpose':'Owner\x20confirms\x20availability\x20and\x20handover\x20schedule'},{'template_id':'pattern.repository_data_check','host':'machine','purpose':'Handover\x20must\x20record\x20pre-rental\x20WIP\x20(condition\x20photos)'},{'template_id':'pattern.time_lock_progress','host':'machine','purpose':'Overdue\x20state\x20gated\x20by\x20clock\x20time-lock\x20(convert_witness/clock)'},{'template_id':'pattern.repository_data_check','host':'machine','purpose':'Return\x20must\x20include\x20post-rental\x20WIP'},{'template_id':'pattern.identity_check_service_provider_dynamic','host':'machine','purpose':'Only\x20owner\x20can\x20submit\x20inspection\x20result'},{'template_id':'damage_guard_wip','host':'machine','purpose':'Damage\x20claim\x20requires\x20pre+post\x20WIP\x20comparison'},{'template_id':'pattern.identity_check_service_provider_dynamic','host':'machine','purpose':'Cancellation\x20refund\x20requires\x20owner\x20permission\x20OR\x20arbiter'},{'template_id':'tpl_payment_exception_compensation','host':'machine','purpose':'Return\x20delay/damage\x20exception\x20compensation\x20via\x20scene-bound\x20Payment\x20(§2.13)'},{'template_id':'tpl_repository_quote_guard_subscription','host':'repository','purpose':'Weather/usage\x20data\x20oracle\x20subscription\x20(§2.11)'}],'allocator':{'recipient':'entity','count':0x4,'mode':'amount','description':'Rent\x20to\x20owner\x20on\x20completed;\x20deposit\x20refund\x20to\x20customer\x20on\x20return_approved;\x20deposit\x20deduction\x20to\x20owner\x20on\x20damage_confirmed;\x20full\x20deposit+rent\x20refund\x20to\x20customer\x20on\x20cancelled\x20(fund\x20routing\x20via\x20Allocator\x20per\x20R-M1-11)'},'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—\x20the\x20Machine\x20stays\x20a\x20DAG','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':![]},'machine_shape':[{'name':'paid','role':'Entry:\x20enrollment\x20and\x20tuition\x20paid\x20via\x20Service.buy();\x20Machine\x20starts\x20here'},{'name':'enrolled','role':'Institution\x20confirms\x20enrollment;\x20class\x20Repository\x20record\x20created'},{'name':'session_1','role':'Session\x201\x20delivered\x20—\x20attendance\x20evidence\x20recorded\x20(Repository)'},{'name':'session_2','role':'Session\x202\x20delivered\x20—\x20attendance\x20evidence\x20recorded'},{'name':'session_3','role':'Session\x203\x20delivered\x20(representative;\x20configure\x20N\x20sessions\x20at\x20build\x20time)'},{'name':'assessed','role':'Final\x20assessment\x20/\x20exam\x20submitted\x20(WIP)'},{'name':'certificate_issued','role':'Certificate\x20issued\x20as\x20WIP/Proof\x20deliverable'},{'name':'completed','role':'All\x20sessions\x20delivered\x20and\x20certified\x20—\x20tuition\x20fully\x20released'},{'name':'paused','role':'Student\x20on\x20leave\x20—\x20terminal;\x20resume\x20via\x20a\x20new\x20sub-order\x20(REUSE\x20pattern,\x20keeps\x20the\x20Machine\x20a\x20DAG)'},{'name':'withdrawn','role':'Enrollment\x20cancelled\x20mid-course\x20—\x20triggers\x20unearned-tuition\x20refund\x20Allocator','operator':'order_payer'}],'guards':[{'template_id':'pattern.identity_check_service_provider_dynamic','host':'machine','purpose':'Institution\x20confirms\x20enrollment\x20and\x20creates\x20class\x20Repository\x20record'},{'template_id':'pattern.identity_check_order_holder','host':'machine','purpose':'Per-session\x20student\x20attendance\x20signature\x20with\x20session\x20evidence'},{'template_id':'pattern.repository_data_check','host':'machine','purpose':'Assessment\x20submission\x20requires\x20WIP\x20commitment'},{'template_id':'pattern.repository_data_check','host':'machine','purpose':'Certificate\x20issuance\x20requires\x20WIP/Proof\x20deliverable'},{'template_id':'pattern.identity_check_service_provider_dynamic','host':'machine','purpose':'Institution\x20approval\x20OR\x20arbiter\x20for\x20withdrawal\x20refund'},{'template_id':'tpl_buy_guard_order_holder','host':'service','purpose':'Course\x20module\x20progressive\x20unlock\x20via\x20supply\x20chain\x20sub-orders\x20(§2.12)'}],'allocator':{'recipient':'entity','count':0x2,'mode':'amount','description':'1/N\x20of\x20tuition\x20released\x20per\x20session\x20attendance\x20(per-session\x20release\x20to\x20institution/instructor);\x20unearned\x20portion\x20refunded\x20to\x20student\x20via\x20Allocator\x20on\x20withdrawn\x20(per\x20R-M1-11)'},'key_risk':'Tutoring\x20institutions\x20run\x20away\x20with\x20prepaid\x20tuition','build_notes':['Use\x20Service\x20`setting_locked_time`\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(Machine\x20must\x20stay\x20a\x20DAG)','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':!![]},'machine_shape':[{'name':'paid','role':'Entry:\x20tour\x20booked\x20and\x20paid\x20(deposit\x20+\x20final)\x20via\x20Service.buy();\x20Machine\x20starts\x20here'},{'name':'pre_trip','role':'Itinerary\x20confirmed;\x20supplier\x20sub-orders\x20placed\x20(hotel/guide/driver)'},{'name':'segment_D1','role':'Segment\x201\x20(e.g.,\x20hotel\x20check-in)\x20—\x20arrival\x20WIP'},{'name':'segment_D2','role':'Segment\x202\x20(e.g.,\x20guided\x20tour)\x20—\x20arrival\x20WIP'},{'name':'segment_D3','role':'Segment\x203\x20(representative;\x20configure\x20per-day/per-activity\x20nodes\x20at\x20build\x20time)'},{'name':'rescheduled','role':'Weather/force-majeure\x20branch\x20—\x20segment\x20moved\x20to\x20a\x20new\x20date\x20(terminal;\x20new\x20segment\x20via\x20sub-order)'},{'name':'returned','role':'Trip\x20completed,\x20customer\x20returns','operator':'order_payer'},{'name':'completed','role':'All\x20segments\x20delivered,\x20funds\x20released\x20per\x20segment'},{'name':'interrupted','role':'Trip\x20interrupted\x20—\x20triggers\x20refund\x20Allocator\x20(undelivered\x20segments)\x20or\x20Arbitration'}],'guards':[{'template_id':'pattern.identity_check_service_provider_dynamic','host':'machine','purpose':'Agency\x20confirms\x20itinerary\x20and\x20supplier\x20sub-order\x20placement'},{'template_id':'pattern.repository_data_check','host':'machine','purpose':'Per-segment\x20arrival\x20WIP\x20(hotel\x20check-in,\x20transport,\x20activity)'},{'template_id':'pattern.repository_data_check','host':'machine','purpose':'Weather/force-majeure\x20witness\x20(Repository\x20query\x20or\x20convert_witness)\x20gates\x20reschedule\x20branch'},{'template_id':'pattern.identity_check_service_provider_dynamic','host':'machine','purpose':'Agency\x20approval\x20OR\x20arbiter\x20for\x20trip\x20interruption'},{'template_id':'tpl_buy_guard_order_holder','host':'service','purpose':'Supply\x20chain\x20sub-orders\x20for\x20tour\x20package\x20segments\x20(§2.12)'},{'template_id':'tpl_payment_exception_compensation','host':'machine','purpose':'Trip\x20delay/segment\x20change\x20exception\x20compensation\x20(§2.13)'},{'template_id':'tpl_repository_quote_guard_subscription','host':'repository','purpose':'Weather/travel\x20data\x20oracle\x20subscription\x20(§2.11)'}],'allocator':{'recipient':'entity','count':0x3,'mode':'amount','description':'Deposit\x2020%\x20to\x20agency,\x20final\x2080%\x20to\x20agency,\x20then\x20agency-side\x20Allocation\x20splits\x20to\x20hotel/guide/driver\x20per\x20segment\x20(per-day\x20release);\x20undelivered\x20segments\x20refunded\x20to\x20customer\x20via\x20Allocator\x20on\x20interrupted\x20(per\x20R-M1-11)'},'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(Machine\x20must\x20stay\x20a\x20DAG)','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':![]},'machine_shape':[{'name':'paid','role':'Entry:\x20subscription\x20paid\x20and\x20active\x20via\x20Service.buy();\x20Machine\x20starts\x20here'},{'name':'active','role':'Subscription\x20active\x20—\x20member\x20access\x20granted'},{'name':'period_1_delivered','role':'Period\x201\x20content\x20delivered\x20(WIP\x20hash)'},{'name':'period_2_delivered','role':'Period\x202\x20content\x20delivered\x20(representative;\x20per-period\x20nodes\x20at\x20build\x20time)'},{'name':'renew_confirmed','role':'Explicit\x20renewal\x20—\x20subscriber\x20confirms\x20next-period\x20charge\x20(no\x20silent\x20auto-renew)','operator':'order_payer'},{'name':'closed_cancel','role':'Subscriber\x20cancels\x20—\x20takes\x20effect\x20next\x20period;\x20pro-rata\x20refund\x20Allocator','operator':'order_payer'},{'name':'expired','role':'Subscription\x20term\x20ends'}],'guards':[{'template_id':'pattern.identity_check_order_holder','host':'machine','purpose':'User\x20confirms\x20each\x20charge\x20—\x20no\x20auto-renew\x20trap'},{'template_id':'pattern.repository_data_check','host':'machine','purpose':'Creator\x20WIP\x20hash\x20per\x20period\x20—\x20prevents\x20content\x20abandonment'},{'template_id':'pattern.identity_check_order_holder','host':'machine','purpose':'Renewal\x20requires\x20explicit\x20subscriber\x20confirmation\x20(WTS\x20notice)'},{'template_id':'cancel_guard_signer','host':'machine','purpose':'User\x20cancels\x20anytime,\x20next-period\x20effective'},{'template_id':'tpl_repository_quote_guard_subscription','host':'repository','purpose':'Creator\x20publishes\x20paid\x20data\x20(analytics,\x20market\x20data)\x20with\x20quote_guard\x20subscription\x20(§2.11)'}],'allocator':{'recipient':'entity','count':0x1,'mode':'amount','description':'Each\x20confirmed\x20charge\x20→\x20100%\x20to\x20creator;\x20unearned\x20periods\x20→\x20pro-rata\x20refund\x20to\x20subscriber\x20on\x20cancelled\x20(via\x20Allocator\x20per\x20R-M1-11)'},'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':![]},'machine_shape':[{'name':'paid','role':'Entry:\x20order\x20created\x20and\x20paid\x20via\x20the\x20on-chain\x20buy\x20flow;\x20Machine\x20starts\x20here'},{'name':'processing','role':'Merchant\x20prepares\x20order\x20(picking/packing);\x20required_info\x20(shipping\x20address)\x20collected\x20via\x20Messenger'},{'name':'shipped','role':'Merchant\x20ships\x20goods,\x20records\x20shipping\x20WIP\x20(tracking\x20number)'},{'name':'in_transit','role':'Logistics\x20leg\x20active\x20—\x20tracking\x20WIP\x20updates'},{'name':'delivered','role':'Goods\x20delivered\x20to\x20buyer'},{'name':'confirmed','role':'Buyer\x20confirms\x20receipt\x20(confirm\x20gate:\x20only\x20buyer\x20can\x20confirm)','operator':'order_payer'},{'name':'completed','role':'Funds\x20released\x20to\x20merchant'},{'name':'return_requested','role':'Buyer\x20requests\x20return\x20within\x20refund_window\x20(>=7d)','operator':'order_payer'},{'name':'returned','role':'Buyer\x20ships\x20goods\x20back\x20(return\x20WIP:\x20tracking\x20number)\x20—\x20triggers\x20refund\x20Allocator\x20(R-M1-11\x20compliant)','operator':'order_payer'},{'name':'closed_cancel','role':'Pre-ship\x20cancellation\x20—\x20triggers\x20refund\x20Allocator','operator':'order_payer'}],'guards':[{'template_id':'pattern.verifier_evidence_philosophy','host':'service','purpose':'Verify\x20inventory\x20and\x20buyer\x20address\x20on\x20purchase'},{'template_id':'ship_guard_wip','host':'machine','purpose':'Shipping\x20evidence\x20WIP\x20(logistics\x20tracking\x20number)'},{'template_id':'pattern.identity_check_order_holder','host':'machine','purpose':'Only\x20buyer\x20can\x20confirm\x20receipt'},{'template_id':'pattern.time_lock_progress','host':'machine','purpose':'Return\x20request\x20gated\x20by\x20refund_window\x20time-lock\x20(clock)'},{'template_id':'pattern.identity_check_service_provider_dynamic','host':'machine','purpose':'Return\x20&\x20refund\x20requires\x20merchant\x20permission\x20OR\x20arbiter'},{'template_id':'tpl_payment_exception_compensation','host':'machine','purpose':'Logistics\x20delay\x20exception\x20compensation\x20(§2.13)'}],'allocator':{'recipient':'entity','count':0x3,'mode':'rate','description':'Platform\x2010%\x20+\x20Merchant\x2090%\x20(rate-based\x20split)\x20on\x20completed;\x20full\x20refund\x20to\x20buyer\x20on\x20returned/cancelled\x20via\x20refund\x20Allocator'},'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':'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':![]},'machine_shape':[],'guards':[],'allocator':{'recipient':'signer','count':0x0,'mode':'amount','description':'User-defined\x20—\x20no\x20defaults'},'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']};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=0x6;
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':![]},'machine_shape':[{'name':'paid','role':'Entry:\x20order\x20created\x20and\x20paid\x20via\x20Service.buy();\x20Machine\x20starts\x20here'},{'name':'kickoff','role':'Scope\x20confirmed;\x20WTS\x20change-request\x20channel\x20opened\x20(scope-creep\x20ledger)'},{'name':'milestone_1_delivering','role':'Provider\x20works\x20on\x20milestone\x201'},{'name':'milestone_1_delivered','role':'Milestone\x201\x20deliverable\x20submitted\x20(WIP\x20hash\x20mandatory)'},{'name':'milestone_1_accepted','role':'Customer\x20signs\x20milestone\x201\x20acceptance\x20—\x20M1\x20funds\x20releasable','operator':'order_payer'},{'name':'milestone_2_delivering','role':'Provider\x20works\x20on\x20milestone\x202'},{'name':'milestone_2_delivered','role':'Milestone\x202\x20deliverable\x20submitted\x20(WIP\x20hash\x20mandatory)'},{'name':'milestone_2_accepted','role':'Customer\x20signs\x20milestone\x202\x20acceptance\x20—\x20M2\x20funds\x20releasable','operator':'order_payer'},{'name':'final_delivering','role':'Provider\x20finalizes\x20remaining\x20scope'},{'name':'final_delivered','role':'Final\x20deliverable\x20submitted\x20(WIP\x20hash\x20mandatory)'},{'name':'completed','role':'Final\x20acceptance\x20signed\x20—\x20remaining\x20escrow\x20released\x20to\x20provider','operator':'order_payer'},{'name':'closed_cancel','role':'Pre-delivery\x20cancellation\x20—\x20triggers\x20refund\x20Allocator\x20(unearned\x20portion)','operator':'order_payer'}],'guards':[{'template_id':'pattern.buy_guard_blocklist','host':'service','purpose':'Customer\x20identity\x20check\x20on\x20purchase'},{'template_id':'pattern.identity_check_order_holder','host':'machine','purpose':'Both\x20parties\x20confirm\x20scope\x20at\x20kickoff\x20(WTS\x20change-request\x20channel)'},{'template_id':'pattern.repository_data_check','host':'machine','purpose':'Provider\x20must\x20submit\x20WIP\x20hash\x20for\x20every\x20milestone\x20deliverable'},{'template_id':'pattern.identity_check_order_holder','host':'machine','purpose':'Only\x20customer\x20can\x20sign\x20milestone/final\x20acceptance'},{'template_id':'pattern.identity_check_service_provider_dynamic','host':'machine','purpose':'Only\x20provider\x20can\x20withdraw\x20after\x20each\x20accepted\x20milestone'},{'template_id':'pattern.identity_check_order_holder','host':'machine','purpose':'Only\x20customer\x20can\x20initiate\x20pre-delivery\x20cancellation'},{'template_id':'tpl_payment_exception_compensation','host':'machine','purpose':'Delivery\x20delay\x20exception\x20compensation\x20via\x20scene-bound\x20Payment\x20(§2.13)'}],'allocator':{'recipient':'signer','count':0x2,'mode':'amount','description':'Per-milestone\x20release:\x20each\x20accepted\x20milestone\x20releases\x20its\x20escrowed\x20amount\x20to\x20provider;\x20final\x20acceptance\x20releases\x20the\x20remainder\x20on\x20completed;\x20pre-delivery\x20cancellation\x20refunds\x20the\x20unearned\x20portion\x20to\x20customer\x20via\x20Allocator\x20(off-Machine\x20fund\x20routing\x20per\x20R-M1-11)'},'key_risk':'Customer\x20never\x20accepts\x20delivery\x20—\x20provider\x20cannot\x20get\x20paid','build_notes':['Use\x20Service\x20`setting_locked_time`\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':![]},'machine_shape':[{'name':'deposit_paid','role':'Entry:\x20deposit\x20+\x20rent\x20paid\x20via\x20Service.buy();\x20Machine\x20starts\x20here'},{'name':'booking_confirmed','role':'Owner\x20confirms\x20availability\x20and\x20handover\x20schedule'},{'name':'handover_out','role':'Owner\x20hands\x20over\x20item,\x20records\x20pre-rental\x20WIP\x20(condition\x20photos)'},{'name':'in_use','role':'Rental\x20period\x20active'},{'name':'overdue','role':'Past\x20due\x20date\x20without\x20return\x20—\x20time-lock\x20Guard\x20(clock)\x20gates\x20late\x20fees'},{'name':'return_requested','role':'Customer\x20initiates\x20return','operator':'order_payer'},{'name':'returned','role':'Item\x20physically\x20returned;\x20post-rental\x20WIP\x20recorded','operator':'order_payer'},{'name':'inspected','role':'Owner\x20inspects\x20returned\x20item\x20(pre+post\x20WIP\x20comparison)'},{'name':'return_approved','role':'No\x20damage\x20—\x20triggers\x20deposit\x20refund\x20Allocator\x20(100%\x20to\x20customer)'},{'name':'damage_confirmed','role':'Damage\x20confirmed\x20via\x20pre+post\x20WIP\x20diff\x20—\x20triggers\x20deposit\x20deduction\x20Allocator'},{'name':'completed','role':'Rental\x20finalized\x20—\x20triggers\x20rent\x20Allocator\x20(rent\x20to\x20owner)'},{'name':'closed_cancel','role':'Pre-handover\x20cancellation\x20—\x20triggers\x20full\x20refund\x20Allocator','operator':'order_payer'}],'guards':[{'template_id':'pattern.verifier_evidence_philosophy','host':'service','purpose':'Verify\x20deposit\x20amount\x20matches\x20listing'},{'template_id':'pattern.identity_check_service_provider_dynamic','host':'machine','purpose':'Owner\x20confirms\x20availability\x20and\x20handover\x20schedule'},{'template_id':'pattern.repository_data_check','host':'machine','purpose':'Handover\x20must\x20record\x20pre-rental\x20WIP\x20(condition\x20photos)'},{'template_id':'pattern.time_lock_progress','host':'machine','purpose':'Overdue\x20state\x20gated\x20by\x20clock\x20time-lock\x20(convert_witness/clock)'},{'template_id':'pattern.repository_data_check','host':'machine','purpose':'Return\x20must\x20include\x20post-rental\x20WIP'},{'template_id':'pattern.identity_check_service_provider_dynamic','host':'machine','purpose':'Only\x20owner\x20can\x20submit\x20inspection\x20result'},{'template_id':'damage_guard_wip','host':'machine','purpose':'Damage\x20claim\x20requires\x20pre+post\x20WIP\x20comparison'},{'template_id':'pattern.identity_check_service_provider_dynamic','host':'machine','purpose':'Cancellation\x20refund\x20requires\x20owner\x20permission\x20OR\x20arbiter'},{'template_id':'tpl_payment_exception_compensation','host':'machine','purpose':'Return\x20delay/damage\x20exception\x20compensation\x20via\x20scene-bound\x20Payment\x20(§2.13)'},{'template_id':'tpl_repository_quote_guard_subscription','host':'repository','purpose':'Weather/usage\x20data\x20oracle\x20subscription\x20(§2.11)'}],'allocator':{'recipient':'entity','count':0x4,'mode':'amount','description':'Rent\x20to\x20owner\x20on\x20completed;\x20deposit\x20refund\x20to\x20customer\x20on\x20return_approved;\x20deposit\x20deduction\x20to\x20owner\x20on\x20damage_confirmed;\x20full\x20deposit+rent\x20refund\x20to\x20customer\x20on\x20cancelled\x20(fund\x20routing\x20via\x20Allocator\x20per\x20R-M1-11)'},'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—\x20the\x20Machine\x20stays\x20a\x20DAG','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':![]},'machine_shape':[{'name':'paid','role':'Entry:\x20enrollment\x20and\x20tuition\x20paid\x20via\x20Service.buy();\x20Machine\x20starts\x20here'},{'name':'enrolled','role':'Institution\x20confirms\x20enrollment;\x20class\x20Repository\x20record\x20created'},{'name':'session_1','role':'Session\x201\x20delivered\x20—\x20attendance\x20evidence\x20recorded\x20(Repository)'},{'name':'session_2','role':'Session\x202\x20delivered\x20—\x20attendance\x20evidence\x20recorded'},{'name':'session_3','role':'Session\x203\x20delivered\x20(representative;\x20configure\x20N\x20sessions\x20at\x20build\x20time)'},{'name':'assessed','role':'Final\x20assessment\x20/\x20exam\x20submitted\x20(WIP)'},{'name':'certificate_issued','role':'Certificate\x20issued\x20as\x20WIP/Proof\x20deliverable'},{'name':'completed','role':'All\x20sessions\x20delivered\x20and\x20certified\x20—\x20tuition\x20fully\x20released'},{'name':'paused','role':'Student\x20on\x20leave\x20—\x20terminal;\x20resume\x20via\x20a\x20new\x20sub-order\x20(REUSE\x20pattern,\x20keeps\x20the\x20Machine\x20a\x20DAG)'},{'name':'withdrawn','role':'Enrollment\x20cancelled\x20mid-course\x20—\x20triggers\x20unearned-tuition\x20refund\x20Allocator','operator':'order_payer'}],'guards':[{'template_id':'pattern.identity_check_service_provider_dynamic','host':'machine','purpose':'Institution\x20confirms\x20enrollment\x20and\x20creates\x20class\x20Repository\x20record'},{'template_id':'pattern.identity_check_order_holder','host':'machine','purpose':'Per-session\x20student\x20attendance\x20signature\x20with\x20session\x20evidence'},{'template_id':'pattern.repository_data_check','host':'machine','purpose':'Assessment\x20submission\x20requires\x20WIP\x20commitment'},{'template_id':'pattern.repository_data_check','host':'machine','purpose':'Certificate\x20issuance\x20requires\x20WIP/Proof\x20deliverable'},{'template_id':'pattern.identity_check_service_provider_dynamic','host':'machine','purpose':'Institution\x20approval\x20OR\x20arbiter\x20for\x20withdrawal\x20refund'},{'template_id':'tpl_buy_guard_order_holder','host':'service','purpose':'Course\x20module\x20progressive\x20unlock\x20via\x20supply\x20chain\x20sub-orders\x20(§2.12)'}],'allocator':{'recipient':'entity','count':0x2,'mode':'amount','description':'1/N\x20of\x20tuition\x20released\x20per\x20session\x20attendance\x20(per-session\x20release\x20to\x20institution/instructor);\x20unearned\x20portion\x20refunded\x20to\x20student\x20via\x20Allocator\x20on\x20withdrawn\x20(per\x20R-M1-11)'},'key_risk':'Tutoring\x20institutions\x20run\x20away\x20with\x20prepaid\x20tuition','build_notes':['Use\x20Service\x20`setting_locked_time`\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(Machine\x20must\x20stay\x20a\x20DAG)','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':!![]},'machine_shape':[{'name':'paid','role':'Entry:\x20tour\x20booked\x20and\x20paid\x20(deposit\x20+\x20final)\x20via\x20Service.buy();\x20Machine\x20starts\x20here'},{'name':'pre_trip','role':'Itinerary\x20confirmed;\x20supplier\x20sub-orders\x20placed\x20(hotel/guide/driver)'},{'name':'segment_D1','role':'Segment\x201\x20(e.g.,\x20hotel\x20check-in)\x20—\x20arrival\x20WIP'},{'name':'segment_D2','role':'Segment\x202\x20(e.g.,\x20guided\x20tour)\x20—\x20arrival\x20WIP'},{'name':'segment_D3','role':'Segment\x203\x20(representative;\x20configure\x20per-day/per-activity\x20nodes\x20at\x20build\x20time)'},{'name':'rescheduled','role':'Weather/force-majeure\x20branch\x20—\x20segment\x20moved\x20to\x20a\x20new\x20date\x20(terminal;\x20new\x20segment\x20via\x20sub-order)'},{'name':'returned','role':'Trip\x20completed,\x20customer\x20returns','operator':'order_payer'},{'name':'completed','role':'All\x20segments\x20delivered,\x20funds\x20released\x20per\x20segment'},{'name':'interrupted','role':'Trip\x20interrupted\x20—\x20triggers\x20refund\x20Allocator\x20(undelivered\x20segments)\x20or\x20Arbitration'}],'guards':[{'template_id':'pattern.identity_check_service_provider_dynamic','host':'machine','purpose':'Agency\x20confirms\x20itinerary\x20and\x20supplier\x20sub-order\x20placement'},{'template_id':'pattern.repository_data_check','host':'machine','purpose':'Per-segment\x20arrival\x20WIP\x20(hotel\x20check-in,\x20transport,\x20activity)'},{'template_id':'pattern.repository_data_check','host':'machine','purpose':'Weather/force-majeure\x20witness\x20(Repository\x20query\x20or\x20convert_witness)\x20gates\x20reschedule\x20branch'},{'template_id':'pattern.identity_check_service_provider_dynamic','host':'machine','purpose':'Agency\x20approval\x20OR\x20arbiter\x20for\x20trip\x20interruption'},{'template_id':'tpl_buy_guard_order_holder','host':'service','purpose':'Supply\x20chain\x20sub-orders\x20for\x20tour\x20package\x20segments\x20(§2.12)'},{'template_id':'tpl_payment_exception_compensation','host':'machine','purpose':'Trip\x20delay/segment\x20change\x20exception\x20compensation\x20(§2.13)'},{'template_id':'tpl_repository_quote_guard_subscription','host':'repository','purpose':'Weather/travel\x20data\x20oracle\x20subscription\x20(§2.11)'}],'allocator':{'recipient':'entity','count':0x3,'mode':'amount','description':'Deposit\x2020%\x20to\x20agency,\x20final\x2080%\x20to\x20agency,\x20then\x20agency-side\x20Allocation\x20splits\x20to\x20hotel/guide/driver\x20per\x20segment\x20(per-day\x20release);\x20undelivered\x20segments\x20refunded\x20to\x20customer\x20via\x20Allocator\x20on\x20interrupted\x20(per\x20R-M1-11)'},'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(Machine\x20must\x20stay\x20a\x20DAG)','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':![]},'machine_shape':[{'name':'paid','role':'Entry:\x20subscription\x20paid\x20and\x20active\x20via\x20Service.buy();\x20Machine\x20starts\x20here'},{'name':'active','role':'Subscription\x20active\x20—\x20member\x20access\x20granted'},{'name':'period_1_delivered','role':'Period\x201\x20content\x20delivered\x20(WIP\x20hash)'},{'name':'period_2_delivered','role':'Period\x202\x20content\x20delivered\x20(representative;\x20per-period\x20nodes\x20at\x20build\x20time)'},{'name':'renew_confirmed','role':'Explicit\x20renewal\x20—\x20subscriber\x20confirms\x20next-period\x20charge\x20(no\x20silent\x20auto-renew)','operator':'order_payer'},{'name':'closed_cancel','role':'Subscriber\x20cancels\x20—\x20takes\x20effect\x20next\x20period;\x20pro-rata\x20refund\x20Allocator','operator':'order_payer'},{'name':'expired','role':'Subscription\x20term\x20ends'}],'guards':[{'template_id':'pattern.identity_check_order_holder','host':'machine','purpose':'User\x20confirms\x20each\x20charge\x20—\x20no\x20auto-renew\x20trap'},{'template_id':'pattern.repository_data_check','host':'machine','purpose':'Creator\x20WIP\x20hash\x20per\x20period\x20—\x20prevents\x20content\x20abandonment'},{'template_id':'pattern.identity_check_order_holder','host':'machine','purpose':'Renewal\x20requires\x20explicit\x20subscriber\x20confirmation\x20(WTS\x20notice)'},{'template_id':'cancel_guard_signer','host':'machine','purpose':'User\x20cancels\x20anytime,\x20next-period\x20effective'},{'template_id':'tpl_repository_quote_guard_subscription','host':'repository','purpose':'Creator\x20publishes\x20paid\x20data\x20(analytics,\x20market\x20data)\x20with\x20quote_guard\x20subscription\x20(§2.11)'}],'allocator':{'recipient':'entity','count':0x1,'mode':'amount','description':'Each\x20confirmed\x20charge\x20→\x20100%\x20to\x20creator;\x20unearned\x20periods\x20→\x20pro-rata\x20refund\x20to\x20subscriber\x20on\x20cancelled\x20(via\x20Allocator\x20per\x20R-M1-11)'},'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':![]},'machine_shape':[{'name':'paid','role':'Entry:\x20order\x20created\x20and\x20paid\x20via\x20the\x20on-chain\x20buy\x20flow;\x20Machine\x20starts\x20here'},{'name':'processing','role':'Merchant\x20prepares\x20order\x20(picking/packing);\x20required_info\x20(shipping\x20address)\x20collected\x20via\x20Messenger'},{'name':'shipped','role':'Merchant\x20ships\x20goods,\x20records\x20shipping\x20WIP\x20(tracking\x20number)'},{'name':'in_transit','role':'Logistics\x20leg\x20active\x20—\x20tracking\x20WIP\x20updates'},{'name':'delivered','role':'Goods\x20delivered\x20to\x20buyer'},{'name':'confirmed','role':'Buyer\x20confirms\x20receipt\x20(confirm\x20gate:\x20only\x20buyer\x20can\x20confirm)','operator':'order_payer'},{'name':'completed','role':'Funds\x20released\x20to\x20merchant'},{'name':'return_requested','role':'Buyer\x20requests\x20return\x20within\x20refund_window\x20(>=7d)','operator':'order_payer'},{'name':'returned','role':'Buyer\x20ships\x20goods\x20back\x20(return\x20WIP:\x20tracking\x20number)\x20—\x20triggers\x20refund\x20Allocator\x20(R-M1-11\x20compliant)','operator':'order_payer'},{'name':'closed_cancel','role':'Pre-ship\x20cancellation\x20—\x20triggers\x20refund\x20Allocator','operator':'order_payer'}],'guards':[{'template_id':'pattern.verifier_evidence_philosophy','host':'service','purpose':'Verify\x20inventory\x20and\x20buyer\x20address\x20on\x20purchase'},{'template_id':'ship_guard_wip','host':'machine','purpose':'Shipping\x20evidence\x20WIP\x20(logistics\x20tracking\x20number)'},{'template_id':'pattern.identity_check_order_holder','host':'machine','purpose':'Only\x20buyer\x20can\x20confirm\x20receipt'},{'template_id':'pattern.time_lock_progress','host':'machine','purpose':'Return\x20request\x20gated\x20by\x20refund_window\x20time-lock\x20(clock)'},{'template_id':'pattern.identity_check_service_provider_dynamic','host':'machine','purpose':'Return\x20&\x20refund\x20requires\x20merchant\x20permission\x20OR\x20arbiter'},{'template_id':'tpl_payment_exception_compensation','host':'machine','purpose':'Logistics\x20delay\x20exception\x20compensation\x20(§2.13)'}],'allocator':{'recipient':'entity','count':0x3,'mode':'rate','description':'Platform\x2010%\x20+\x20Merchant\x2090%\x20(rate-based\x20split)\x20on\x20completed;\x20full\x20refund\x20to\x20buyer\x20on\x20returned/cancelled\x20via\x20refund\x20Allocator'},'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':'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':![]},'machine_shape':[],'guards':[],'allocator':{'recipient':'signer','count':0x0,'mode':'amount','description':'User-defined\x20—\x20no\x20defaults'},'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']};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=0x6;
@@ -1 +1 @@
1
- import{resolveInViewport}from'./repository-write-semantics.js';export const SERVICE_ALLOCATION_SEMANTICS_ANALYZER_ID='SA1';export const ALLOCATION_SEMANTICS_ANALYZER_ID='SA2';function asRecord(a){return a!=null&&typeof a==='object'&&!Array['isArray'](a)?a:undefined;}function recipientOf(a){if(typeof a==='string')return'entity:'+a['toLowerCase']();const b=asRecord(a);if(b){if(b['signer']!=null)return'signer';const c=b['guard_identifier']??b['guardIdentifier']??b['identifier'];if(c!=null)return'guard_identifier:'+String(c);const d=b['address']??b['entity'];if(typeof d==='string')return'entity:'+d['toLowerCase']();}if(typeof a==='number')return'guard_identifier:'+a;return'(unknown\x20recipient)';}function modeOf(a){const b=typeof a==='number'?a:typeof a==='string'?Number(a):NaN;return Number['isNaN'](b)?undefined:b;}function normalizeSharing(a){if(!Array['isArray'](a))return[];return a['map'](b=>{const c=b??{};return{'who':recipientOf(c['who']??c['recipient']),...c['sharing']!=null?{'value':String(c['sharing'])}:{},...modeOf(c['mode'])!==undefined?{'mode':modeOf(c['mode'])}:{}};});}function normalizeAllocators(a){if(!Array['isArray'](a))return[];return a['map'](b=>{const c=b??{},d=normalizeSharing(c['sharing']),e=modeOf(c['mode']),f=e!==undefined?d['map'](g=>g['mode']===undefined?{...g,'mode':e}:g):d;return{...typeof c['guard']==='string'&&c['guard']?{'guard':c['guard']['toLowerCase']()}:{},'sharing':f,...c['fix']!=null?{'fix':String(c['fix'])}:{},...c['max']!=null&&c['max']!==null?{'max':String(c['max'])}:{}};});}export function serviceAllocatorsOf(a){const b=asRecord(a['order_allocators']);if(!b)return[];return normalizeAllocators(b['allocators']);}export function allocationInstanceFactsOf(a){const b=asRecord(a['allocators']),c=asRecord(a['payment_info']),d=e=>typeof e==='string'&&e['length']>0x0?e['toLowerCase']():undefined;return{'allocators':normalizeAllocators(b?.['allocators']),...b&&b['threshold']!=null?{'threshold':String(b['threshold'])}:{},...c&&d(c['for_object'])?{'forObject':d(c['for_object'])}:{},...c&&d(c['for_guard'])?{'forGuard':d(c['for_guard'])}:{}};}const MODE_NAME={0x0:'amount',0x1:'rate',0x2:'surplus',0x3:'rate-gross'};function modeSemantics(a,b){switch(a){case 0x0:return'fixed-amount\x20mode:\x20the\x20allocator\x20moves\x20its\x20configured\x20total'+(b['fix']?'\x20(fix\x20'+b['fix']+')':'')+(b['max']?'\x20capped\x20at\x20'+b['max']:'')+';\x20a\x20run\x20with\x20insufficient\x20balance\x20aborts\x20the\x20whole\x20allocation';case 0x1:return'net\x20rate\x20mode:\x20each\x20row\x20moves\x20share/10000\x20of\x20the\x20EXECUTION-TIME\x20surplus\x20(balance\x20minus\x20the\x20fixed\x20part)\x20—\x20recipient\x20amounts\x20float\x20with\x20the\x20balance\x20at\x20unlock\x20time';case 0x2:return'surplus\x20mode:\x20the\x20row\x20receives\x20whatever\x20remains\x20after\x20the\x20fixed\x20and\x20rated\x20rows\x20are\x20served';case 0x3:return'rate-gross\x20mode:\x20each\x20row\x20moves\x20share/10000\x20of\x20the\x20FULL\x20pool\x20(or\x20the\x20max\x20cap\x20when\x20set)\x20with\x20the\x20fixed\x20part\x20NOT\x20removed\x20—\x20lets\x20fixed\x20Amount\x20rows\x20and\x20percentage-of-total\x20rows\x20coexist\x20exactly';default:return'mode\x20value\x20out\x20of\x20the\x20on-chain\x20range\x20(0/1/2/3)\x20—\x20the\x20configuration\x20cannot\x20exist\x20on-chain';}}function classificationRisks(a,b,c){const d=[];a['forEach']((e,f)=>{const g=[...new Set(e['sharing']['map'](j=>j['mode']??0x0))],h=g['length']===0x1?g[0x0]:undefined;d['push']({'id':'R-ALC-S-01','level':'info','title':'Allocator\x20#'+f+'\x20of\x20'+c+':\x20'+(h!==undefined?MODE_NAME[h]??'mode\x20'+h:'mixed-mode')+'\x20allocation','description':'Unlocking\x20guard\x20'+(e['guard']??'(proposal\x20guard)')+'\x20triggers\x20this\x20allocator\x20—\x20'+modeSemantics(h,e)+'.\x20'+(e['sharing']['length']+'\x20recipient\x20row(s):\x20'+e['sharing']['map'](j=>''+j['who']+(j['value']?'='+j['value']:''))['join'](',\x20')+'.')+(b&&b!=='0'?'\x20The\x20allocation\x20template\x20enforces\x20a\x20minimum\x20run\x20amount\x20of\x20'+b+'.':''),'evidence':'allocator='+f+'\x20guard='+(e['guard']??'?')+'\x20sharing_rows='+e['sharing']['length'],'affected_stakeholders':['owner','buyer'],'confidence':'exact'});});for(let e=0x0;e<a['length'];e++){const f=a[e]['sharing']['filter'](h=>h['mode']===0x1);if(f['length']===0x0)continue;const g=f['reduce']((h,j)=>h+Number(j['value']??0x0),0x0);g!==0x2710&&d['push']({'id':'R-ALC-S-05','level':'info','title':'Allocator\x20#'+e+'\x20of\x20'+c+':\x20rated\x20rows\x20sum\x20to\x20'+g+'/10000','description':'Rate\x20rows\x20are\x20fractions\x20of\x20the\x20execution-time\x20surplus\x20(basis\x2010000).\x20A\x20sum\x20of\x20'+g+'\x20leaves\x20'+(0x2710-g)+'/10000\x20of\x20the\x20surplus\x20unmoved\x20by\x20this\x20allocator\x20per\x20run\x20—\x20intentional\x20residue\x20or\x20a\x20configuration\x20slip?','evidence':'allocator='+e+'\x20rate_sum='+g,'affected_stakeholders':['owner','buyer'],'confidence':'exact'});}return d;}function duplicateGuardRisks(a,b){const c=new Map(),d=[];return a['forEach']((e,f)=>{if(!e['guard'])return;const g=c['get'](e['guard']);g!==undefined?d['push']({'id':'R-ALC-S-04','level':'high','title':'Allocator\x20#'+f+'\x20of\x20'+b+'\x20can\x20never\x20run\x20(duplicate\x20guard)','description':'Guard\x20'+e['guard']+'\x20already\x20drives\x20allocator\x20#'+g+';\x20allocation\x20matches\x20the\x20FIRST\x20allocator\x20whose\x20guard\x20equals\x20the\x20unlocking\x20guard,\x20so\x20this\x20entry\x20is\x20dead\x20configuration\x20—\x20its\x20recipients\x20are\x20silently\x20unreachable.\x20Remove\x20it\x20or\x20give\x20it\x20a\x20distinct\x20guard.','evidence':'guard='+e['guard']+'\x20first='+g+'\x20duplicate='+f,'affected_stakeholders':['owner','buyer'],'confidence':'exact'}):c['set'](e['guard'],f);}),d;}function resolutionRisks(b,c,d){const f=[],g=new Set();for(const h of b){if(!h['guard'])continue;const i=resolveInViewport(h['guard'],d);if(i['status']!=='fetched'){if(g['has'](h['guard']))continue;g['add'](h['guard']);const j=i['status']==='masked'?'present\x20in\x20the\x20graph\x20but\x20ACCESS-GATED\x20for\x20the\x20current\x20viewer':i['status']==='unfetched'?'in\x20the\x20graph\x20but\x20its\x20state\x20is\x20\x22'+i['state']+'\x22':'OUTSIDE\x20the\x20witnessed\x20topology';f['push']({'id':'R-ALC-S-02','level':'medium','title':'Allocator\x20guard\x20unresolved\x20—\x20allocation\x20semantics\x20incomplete','description':'Guard\x20'+h['guard']+'\x20of\x20'+c+'\x20is\x20'+j+':\x20what\x20unlocks\x20this\x20allocator,\x20and\x20therefore\x20when\x20money\x20moves,\x20cannot\x20be\x20assessed.\x20'+(i['status']==='absent'&&i['depthCapped']?'The\x20expansion\x20depth\x20budget\x20was\x20exhausted\x20(default\x20depth\x20is\x204);\x20request\x20a\x20deeper\x20topology\x20read.':i['status']==='absent'?'Request\x20a\x20deeper\x20or\x20wider\x20topology\x20read\x20(raise\x20the\x20exploration\x20depth\x20beyond\x20the\x20default\x204,\x20or\x20widen\x20the\x20expanded\x20edge\x20set).':i['status']==='masked'?'Widen\x20viewer\x20access\x20and\x20re-analyze.':'Retry\x20once\x20the\x20object\x20fetch\x20succeeds.'),'evidence':'guard='+h['guard']+'\x20resolution='+i['status'],'affected_stakeholders':['owner','buyer'],'confidence':'bounded'});continue;}for(const k of d['graph']['out']['get'](h['guard'])??[]){if(k['schema']!=='guard.relies')continue;const l=resolveInViewport(k['to'],d);if(l['status']==='fetched')continue;f['push']({'id':'R-ALC-S-03','level':'medium','title':'Sub-guard\x20of\x20an\x20allocator\x20guard\x20unresolved\x20—\x20condition\x20semantics\x20incomplete','description':'The\x20allocator\x20guard\x20'+h['guard']+'\x20of\x20'+c+'\x20relies\x20on\x20sub-guard\x20'+k['to']+',\x20which\x20is\x20not\x20witnessed\x20as\x20fetched:\x20part\x20of\x20the\x20unlock\x20condition\x20is\x20invisible,\x20so\x20sufficiency\x20of\x20the\x20allocation\x20conditions\x20cannot\x20be\x20confirmed.','evidence':'guard='+h['guard']+'\x20relies='+k['to']+'\x20resolution='+l['status'],'affected_stakeholders':['owner','buyer'],'confidence':'bounded'});}}return f;}function anchoringRisks(a,b){if(a['forObject']||a['forGuard'])return[];return[{'id':'R-ALC-S-06','level':'info','title':b+'\x20is\x20not\x20anchored\x20to\x20a\x20business\x20object','description':'No\x20for_object/for_guard\x20anchoring\x20is\x20configured:\x20ANY\x20payment\x20routed\x20to\x20this\x20allocation\x20(from\x20any\x20source\x20that\x20learns\x20its\x20address)\x20unlocks\x20the\x20allocation\x20guards\x20—\x20the\x20split\x20runs\x20regardless\x20of\x20business\x20context.\x20Anchoring\x20is\x20enforced\x20ONLY\x20when\x20set;\x20leave\x20unanchored\x20only\x20when\x20open\x20routing\x20is\x20intended.','evidence':'for_object=none\x20for_guard=none','affected_stakeholders':['owner','buyer'],'confidence':'exact'}];}function analyzeAllocationSemantics(a,b,c,d){const e=[];if(a['length']===0x0)return e['push']({'id':'R-ALC-S-01','level':'info','title':b['subject']+'\x20has\x20no\x20allocators','description':'No\x20allocator\x20is\x20configured\x20—\x20no\x20split\x20runs\x20when\x20payments\x20settle;\x20funds\x20stay\x20in\x20the\x20host\x20object.\x20Configure\x20allocators\x20if\x20proceeds\x20must\x20be\x20distributed.','evidence':'allocators=0','affected_stakeholders':['owner'],'confidence':'exact'}),e;return e['push'](...classificationRisks(a,b['threshold'],b['subject'])),e['push'](...duplicateGuardRisks(a,b['subject'])),e['push'](...resolutionRisks(a,b['subject'],d)),b['anchored']===![]&&e['push'](...anchoringRisks({'allocators':a},b['subject'])),e;}export function analyzeServiceAllocationSemantics(a,b,c){return analyzeAllocationSemantics(serviceAllocatorsOf(a),{'subject':'service\x20'+b['id']+'\x20order_allocators'},b,c);}export function analyzeAllocationInstanceSemantics(a,b,c){const d=allocationInstanceFactsOf(a);return analyzeAllocationSemantics(d['allocators'],{'subject':'allocation\x20'+b['id'],...d['threshold']?{'threshold':d['threshold']}:{},'anchored':d['forObject']===undefined&&d['forGuard']===undefined?![]:!![]},b,c);}
1
+ import{resolveInViewport}from'./repository-write-semantics.js';export const SERVICE_ALLOCATION_SEMANTICS_ANALYZER_ID='SA1';export const ALLOCATION_SEMANTICS_ANALYZER_ID='SA2';function asRecord(a){return a!=null&&typeof a==='object'&&!Array['isArray'](a)?a:undefined;}function recipientOf(a){if(typeof a==='string')return'entity:'+a['toLowerCase']();const b=asRecord(a);if(b){if(b['signer']!=null)return'signer';const c=b['guard_identifier']??b['guardIdentifier']??b['identifier'];if(c!=null)return'guard_identifier:'+String(c);const d=b['address']??b['entity'];if(typeof d==='string')return'entity:'+d['toLowerCase']();}if(typeof a==='number')return'guard_identifier:'+a;return'(unknown\x20recipient)';}function modeOf(a){const b=typeof a==='number'?a:typeof a==='string'?Number(a):NaN;return Number['isNaN'](b)?undefined:b;}function normalizeSharing(a){if(!Array['isArray'](a))return[];return a['map'](b=>{const c=b??{};return{'who':recipientOf(c['who']??c['recipient']),...c['sharing']!=null?{'value':String(c['sharing'])}:{},...modeOf(c['mode'])!==undefined?{'mode':modeOf(c['mode'])}:{}};});}function normalizeAllocators(a){if(!Array['isArray'](a))return[];return a['map'](b=>{const c=b??{},d=normalizeSharing(c['sharing']),e=modeOf(c['mode']),f=e!==undefined?d['map'](g=>g['mode']===undefined?{...g,'mode':e}:g):d;return{...typeof c['guard']==='string'&&c['guard']?{'guard':c['guard']['toLowerCase']()}:{},'sharing':f,...c['fix']!=null?{'fix':String(c['fix'])}:{},...c['max']!=null&&c['max']!==null?{'max':String(c['max'])}:{}};});}export function serviceAllocatorsOf(a){const b=asRecord(a['order_allocators']);if(!b)return[];return normalizeAllocators(b['allocators']);}export function allocationInstanceFactsOf(a){const b=asRecord(a['allocators']),c=asRecord(a['payment_info']),d=e=>typeof e==='string'&&e['length']>0x0?e['toLowerCase']():undefined;return{'allocators':normalizeAllocators(b?.['allocators']),...b&&b['threshold']!=null?{'threshold':String(b['threshold'])}:{},...c&&d(c['for_object'])?{'forObject':d(c['for_object'])}:{},...c&&d(c['for_guard'])?{'forGuard':d(c['for_guard'])}:{}};}const MODE_NAME={0x0:'amount',0x1:'rate',0x2:'surplus',0x3:'rate-gross'};function modeSemantics(a,b){switch(a){case 0x0:return'fixed-amount\x20mode:\x20the\x20allocator\x20moves\x20its\x20configured\x20total'+(b['fix']?'\x20(fix\x20'+b['fix']+')':'')+(b['max']?'\x20capped\x20at\x20'+b['max']:'')+';\x20a\x20run\x20with\x20insufficient\x20balance\x20aborts\x20the\x20whole\x20allocation';case 0x1:return'net\x20rate\x20mode:\x20each\x20row\x20moves\x20share/10000\x20of\x20the\x20EXECUTION-TIME\x20surplus\x20(balance\x20minus\x20the\x20fixed\x20part)\x20—\x20recipient\x20amounts\x20float\x20with\x20the\x20balance\x20at\x20unlock\x20time';case 0x2:return'surplus\x20mode:\x20the\x20row\x20receives\x20whatever\x20remains\x20after\x20the\x20fixed\x20and\x20rated\x20rows\x20are\x20served';case 0x3:return'rate-gross\x20mode:\x20each\x20row\x20moves\x20share/10000\x20of\x20the\x20FULL\x20pool\x20(or\x20the\x20max\x20cap\x20when\x20set)\x20with\x20the\x20fixed\x20part\x20NOT\x20removed\x20—\x20lets\x20fixed\x20Amount\x20rows\x20and\x20percentage-of-total\x20rows\x20coexist\x20exactly';default:return'mode\x20value\x20out\x20of\x20the\x20on-chain\x20range\x20(0/1/2/3)\x20—\x20the\x20configuration\x20cannot\x20exist\x20on-chain';}}function classificationRisks(a,b,c){const d=[];a['forEach']((e,f)=>{const g=[...new Set(e['sharing']['map'](j=>j['mode']??0x0))],h=g['length']===0x1?g[0x0]:undefined;d['push']({'id':'R-ALC-S-01','level':'info','title':'Allocator\x20#'+f+'\x20of\x20'+c+':\x20'+(h!==undefined?MODE_NAME[h]??'mode\x20'+h:'mixed-mode')+'\x20allocation','description':'Unlocking\x20guard\x20'+(e['guard']??'(proposal\x20guard)')+'\x20triggers\x20this\x20allocator\x20—\x20'+modeSemantics(h,e)+'.\x20'+(e['sharing']['length']+'\x20recipient\x20row(s):\x20'+e['sharing']['map'](j=>''+j['who']+(j['value']?'='+j['value']:''))['join'](',\x20')+'.')+(b&&b!=='0'?'\x20The\x20allocation\x20template\x20enforces\x20a\x20minimum\x20run\x20amount\x20of\x20'+b+'.':''),'evidence':'allocator='+f+'\x20guard='+(e['guard']??'?')+'\x20sharing_rows='+e['sharing']['length'],'affected_stakeholders':['owner','buyer'],'confidence':'exact'});});for(let e=0x0;e<a['length'];e++){const f=a[e]['sharing']['filter'](h=>h['mode']===0x1);if(f['length']===0x0)continue;const g=f['reduce']((h,j)=>h+Number(j['value']??0x0),0x0);g!==0x2710&&d['push']({'id':'R-ALC-S-05','level':'info','title':'Allocator\x20#'+e+'\x20of\x20'+c+':\x20rated\x20rows\x20sum\x20to\x20'+g+'/10000','description':'Rate\x20rows\x20are\x20fractions\x20of\x20the\x20execution-time\x20surplus\x20(basis\x2010000).\x20A\x20sum\x20of\x20'+g+'\x20leaves\x20'+(0x2710-g)+'/10000\x20of\x20the\x20surplus\x20unmoved\x20by\x20this\x20allocator\x20per\x20run\x20—\x20intentional\x20residue\x20or\x20a\x20configuration\x20slip?','evidence':'allocator='+e+'\x20rate_sum='+g,'affected_stakeholders':['owner','buyer'],'confidence':'exact'});}return d;}function duplicateGuardRisks(a,b){const c=new Map(),d=[];return a['forEach']((e,f)=>{if(!e['guard'])return;const g=c['get'](e['guard']);g!==undefined?d['push']({'id':'R-ALC-S-04','level':'high','title':'Allocator\x20#'+f+'\x20of\x20'+b+'\x20can\x20never\x20run\x20(duplicate\x20guard)','description':'Guard\x20'+e['guard']+'\x20already\x20drives\x20allocator\x20#'+g+';\x20allocation\x20fires\x20EVERY\x20allocator\x20whose\x20guard\x20equals\x20the\x20unlocking\x20guard\x20(allocation.move:366-368),\x20so\x20this\x20entry\x20STACKS\x20with\x20#'+g+'\x20on\x20the\x20same\x20call\x20—\x20each\x20fires\x20in\x20vector\x20order\x20against\x20the\x20shrinking\x20pool.\x20If\x20they\x20were\x20meant\x20as\x20alternative\x20paths,\x20give\x20this\x20entry\x20a\x20distinct\x20guard;\x20if\x20a\x20waterfall\x20was\x20intended,\x20verify\x20the\x20order\x20matches\x20the\x20payout\x20sequence.','evidence':'guard='+e['guard']+'\x20first='+g+'\x20duplicate='+f,'affected_stakeholders':['owner','buyer'],'confidence':'exact'}):c['set'](e['guard'],f);}),d;}function resolutionRisks(b,c,d){const f=[],g=new Set();for(const h of b){if(!h['guard'])continue;const i=resolveInViewport(h['guard'],d);if(i['status']!=='fetched'){if(g['has'](h['guard']))continue;g['add'](h['guard']);const j=i['status']==='masked'?'present\x20in\x20the\x20graph\x20but\x20ACCESS-GATED\x20for\x20the\x20current\x20viewer':i['status']==='unfetched'?'in\x20the\x20graph\x20but\x20its\x20state\x20is\x20\x22'+i['state']+'\x22':'OUTSIDE\x20the\x20witnessed\x20topology';f['push']({'id':'R-ALC-S-02','level':'medium','title':'Allocator\x20guard\x20unresolved\x20—\x20allocation\x20semantics\x20incomplete','description':'Guard\x20'+h['guard']+'\x20of\x20'+c+'\x20is\x20'+j+':\x20what\x20unlocks\x20this\x20allocator,\x20and\x20therefore\x20when\x20money\x20moves,\x20cannot\x20be\x20assessed.\x20'+(i['status']==='absent'&&i['depthCapped']?'The\x20expansion\x20depth\x20budget\x20was\x20exhausted\x20(default\x20depth\x20is\x204);\x20request\x20a\x20deeper\x20topology\x20read.':i['status']==='absent'?'Request\x20a\x20deeper\x20or\x20wider\x20topology\x20read\x20(raise\x20the\x20exploration\x20depth\x20beyond\x20the\x20default\x204,\x20or\x20widen\x20the\x20expanded\x20edge\x20set).':i['status']==='masked'?'Widen\x20viewer\x20access\x20and\x20re-analyze.':'Retry\x20once\x20the\x20object\x20fetch\x20succeeds.'),'evidence':'guard='+h['guard']+'\x20resolution='+i['status'],'affected_stakeholders':['owner','buyer'],'confidence':'bounded'});continue;}for(const k of d['graph']['out']['get'](h['guard'])??[]){if(k['schema']!=='guard.relies')continue;const l=resolveInViewport(k['to'],d);if(l['status']==='fetched')continue;f['push']({'id':'R-ALC-S-03','level':'medium','title':'Sub-guard\x20of\x20an\x20allocator\x20guard\x20unresolved\x20—\x20condition\x20semantics\x20incomplete','description':'The\x20allocator\x20guard\x20'+h['guard']+'\x20of\x20'+c+'\x20relies\x20on\x20sub-guard\x20'+k['to']+',\x20which\x20is\x20not\x20witnessed\x20as\x20fetched:\x20part\x20of\x20the\x20unlock\x20condition\x20is\x20invisible,\x20so\x20sufficiency\x20of\x20the\x20allocation\x20conditions\x20cannot\x20be\x20confirmed.','evidence':'guard='+h['guard']+'\x20relies='+k['to']+'\x20resolution='+l['status'],'affected_stakeholders':['owner','buyer'],'confidence':'bounded'});}}return f;}function anchoringRisks(a,b){if(a['forObject']||a['forGuard'])return[];return[{'id':'R-ALC-S-06','level':'info','title':b+'\x20is\x20not\x20anchored\x20to\x20a\x20business\x20object','description':'No\x20for_object/for_guard\x20anchoring\x20is\x20configured:\x20ANY\x20payment\x20routed\x20to\x20this\x20allocation\x20(from\x20any\x20source\x20that\x20learns\x20its\x20address)\x20unlocks\x20the\x20allocation\x20guards\x20—\x20the\x20split\x20runs\x20regardless\x20of\x20business\x20context.\x20Anchoring\x20is\x20enforced\x20ONLY\x20when\x20set;\x20leave\x20unanchored\x20only\x20when\x20open\x20routing\x20is\x20intended.','evidence':'for_object=none\x20for_guard=none','affected_stakeholders':['owner','buyer'],'confidence':'exact'}];}function analyzeAllocationSemantics(a,b,c,d){const e=[];if(a['length']===0x0)return e['push']({'id':'R-ALC-S-01','level':'info','title':b['subject']+'\x20has\x20no\x20allocators','description':'No\x20allocator\x20is\x20configured\x20—\x20no\x20split\x20runs\x20when\x20payments\x20settle;\x20funds\x20stay\x20in\x20the\x20host\x20object.\x20Configure\x20allocators\x20if\x20proceeds\x20must\x20be\x20distributed.','evidence':'allocators=0','affected_stakeholders':['owner'],'confidence':'exact'}),e;return e['push'](...classificationRisks(a,b['threshold'],b['subject'])),e['push'](...duplicateGuardRisks(a,b['subject'])),e['push'](...resolutionRisks(a,b['subject'],d)),b['anchored']===![]&&e['push'](...anchoringRisks({'allocators':a},b['subject'])),e;}export function analyzeServiceAllocationSemantics(a,b,c){return analyzeAllocationSemantics(serviceAllocatorsOf(a),{'subject':'service\x20'+b['id']+'\x20order_allocators'},b,c);}export function analyzeAllocationInstanceSemantics(a,b,c){const d=allocationInstanceFactsOf(a);return analyzeAllocationSemantics(d['allocators'],{'subject':'allocation\x20'+b['id'],...d['threshold']?{'threshold':d['threshold']}:{},'anchored':d['forObject']===undefined&&d['forGuard']===undefined?![]:!![]},b,c);}
@@ -1 +1 @@
1
- export const SERVICE_PERMISSIONS=[{'index':0x12c,'name':'SERVICE_NEW','description':'Create\x20new\x20Service','governed_operation':'create\x20a\x20new\x20Service','post_publish_mutability':'na'},{'index':0x12d,'name':'SERVICE_DESCRIPTION','description':'Modify\x20Service\x20description','governed_operation':'modify\x20the\x20Service\x20description','post_publish_mutability':'mutable'},{'index':0x12f,'name':'SERVICE_LOCATION','description':'Set\x20Service\x20location/URL','governed_operation':'set\x20the\x20Service\x20location/URL','post_publish_mutability':'mutable'},{'index':0x130,'name':'SERVICE_REPOSITORY','description':'Add/remove\x20Repository\x20references','governed_operation':'add/remove/clear\x20Repository\x20references','post_publish_mutability':'mutable'},{'index':0x131,'name':'SERVICE_SALES','description':'Add/set/remove/clear\x20sales\x20items','governed_operation':'add/set/remove/clear\x20sales\x20items','post_publish_mutability':'mutable'},{'index':0x132,'name':'SERVICE_MACHINE','description':'Bind/unbind\x20Machine\x20workflow\x20template','governed_operation':'bind/unbind\x20the\x20Machine\x20workflow\x20template','post_publish_mutability':'immutable'},{'index':0x133,'name':'SERVICE_BUY_GUARD','description':'Set/clear\x20buy\x20Guard\x20(post-publish\x20mutable)','governed_operation':'set/clear\x20the\x20buy_guard\x20check','post_publish_mutability':'mutable'},{'index':0x134,'name':'SERVICE_ARBITRATION','description':'Add/remove\x20Arbitration\x20references','governed_operation':'add/remove/clear\x20Arbitration\x20references','post_publish_mutability':'immutable'},{'index':0x135,'name':'SERVICE_CUSTOMER_INFO_REQUIRED','description':'Set\x20customer\x20required\x20info\x20fields','governed_operation':'set\x20customer\x20required\x20info\x20fields','post_publish_mutability':'mutable'},{'index':0x136,'name':'SERVICE_PAUSE','description':'Pause/resume\x20Service\x20(block\x20new\x20orders)','governed_operation':'pause/resume\x20the\x20Service','post_publish_mutability':'mutable'},{'index':0x137,'name':'SERVICE_PUBLISH','description':'Publish\x20Service\x20(IRREVERSIBLE)','governed_operation':'publish\x20the\x20Service\x20(irreversible)','post_publish_mutability':'one_shot'},{'index':0x138,'name':'SERVICE_DISCOUNT','description':'Issue/discount_destroy\x20discount\x20coupons','governed_operation':'issue/destroy\x20discount\x20coupons','post_publish_mutability':'mutable'},{'index':0x139,'name':'SERVICE_ORDER_ALLOCATOR','description':'Set\x20order\x20allocator\x20strategy','governed_operation':'set\x20the\x20order_allocators\x20strategy','post_publish_mutability':'immutable'},{'index':0x13a,'name':'SERVICE_COMPENSATION_FUND_WITHDRAW','description':'Withdraw\x20compensation\x20fund\x20(time-locked)','governed_operation':'withdraw\x20from\x20the\x20compensation_fund\x20(time-locked)','post_publish_mutability':'locked_by_duration'},{'index':0x13b,'name':'SERVICE_COMPENSATION_FUND_DEPOSIT','description':'Deposit\x20to\x20compensation\x20fund','governed_operation':'deposit\x20to\x20the\x20compensation_fund','post_publish_mutability':'mutable'},{'index':0x13c,'name':'SERVICE_COMPENSATION_FUND_RECEIVE','description':'Receive\x20compensation\x20fund\x20(arbitration\x20payout)','governed_operation':'receive\x20the\x20compensation_fund\x20payout\x20(arbitration\x20payout)','post_publish_mutability':'mutable'},{'index':0x13d,'name':'SERVICE_COMPENSATION_LOCK_DURATION_ADD','description':'Extend\x20setting_lock_duration\x20(only-increase)','governed_operation':'extend\x20setting_lock_duration\x20(only-increase)','post_publish_mutability':'mutable'},{'index':0x13e,'name':'SERVICE_REWARD','description':'Add/remove\x20Reward\x20references\x20(remove/clear\x20time-locked)','governed_operation':'add/remove/clear\x20Reward\x20references','post_publish_mutability':'locked_by_duration'},{'index':0x13f,'name':'SERVICE_OWNER_RECEIVE','description':'Receive\x20Payment/objects\x20to\x20owner','governed_operation':'receive\x20Payments/objects\x20to\x20owner','post_publish_mutability':'mutable'},{'index':0x140,'name':'SERVICE_UM','description':'Bind/unbind\x20Contact\x20as\x20UM','governed_operation':'bind/unbind\x20Contact\x20as\x20UM','post_publish_mutability':'mutable'},{'index':0x141,'name':'SERVICE_ARB_STATEMENT','description':'Append\x20seller\x20statement\x20to\x20an\x20Arb\x20case\x20(event-only)','governed_operation':'append\x20seller\x20text\x20to\x20a\x20case\x20against\x20an\x20order\x20of\x20this\x20service\x20(ArbStatementEvent;\x20no\x20Arb\x20state\x20change)','post_publish_mutability':'mutable'}];export const SERVICE_ORDER_FLOW_STAGES=[{'stage':0x1,'name':'pre_check','preconditions':['Service.bPublished\x20==\x20true\x20(else\x20E_NOT_PUBLISHED,\x20service:7)','Service.bPaused\x20==\x20false\x20(else\x20E_PAUSED,\x20service:19)','buy_guard\x20(if\x20set)\x20added\x20to\x20guards[]\x20list\x20for\x20verification'],'side_effects':[],'always_executed':!![]},{'stage':0x2,'name':'wip_verify','preconditions':['buy.items\x20non-empty','Each\x20item.name\x20matches\x20a\x20sale\x20in\x20Service.sales\x20(else\x20E_SALE_ITEM_NOT_FOUND,\x20service:32)','sale.suspension\x20==\x20false\x20(else\x20E_SALE_SUSPENDED)'],'side_effects':['If\x20buyer\x20passes\x20empty\x20wip_hash,\x20SDK\x20auto-fills\x20with\x20sale.wip_hash','verifiedWipUrls\x20Set\x20avoids\x20re-verifying\x20same\x20WIP\x20URL\x20across\x20items','verify_wip()\x20fetches\x20WIP\x20file\x20and\x20compares\x20hash\x20(else\x20E_WIP_HASH_NOT_MATCH)'],'always_executed':!![]},{'stage':0x3,'name':'quote','preconditions':['All\x20items\x20have\x20valid\x20sale\x20+\x20wip_hash\x20match','stock\x20>=\x20purchase\x20quantity\x20(else\x20E_STOCK_NOT_ENOUGH,\x20service:16)','discount\x20object\x20(if\x20used)\x20is\x20valid\x20and\x20within\x20its\x20[time_start,\x20time_end]\x20window\x20(else\x20E_DISCOUNT_TIME_INVALID)'],'side_effects':['The\x20quote\x20step\x20computes\x20the\x20total\x20price\x20(with\x20discount\x20if\x20applicable)','⚠️\x20Stock\x20is\x20deducted\x20(split)\x20—\x20side\x20effect\x20is\x20NOT\x20auto-rolled-back\x20on\x20later\x20failure','The\x20on-chain\x20quote\x20call\x20executes\x20(the\x20discount\x20path\x20validates\x20the\x20Clock\x20time-window\x20check)'],'always_executed':!![]},{'stage':0x4,'name':'create_order','preconditions':['Quote\x20object\x20from\x20stage\x203','Registrar\x20+\x20Clock\x20objects\x20available'],'side_effects':['The\x20atomic\x20on-chain\x20buy\x20call\x20executes\x20(passport-gated\x20variant\x20supported)','Order\x20object\x20created\x20(builder=customer,\x20service=Service.id)','Order.id\x20recorded\x20for\x20stages\x205-7'],'always_executed':!![]},{'stage':0x5,'name':'create_allocation','preconditions':['Service.order_allocators\x20is\x20Some\x20(configured)','Order\x20from\x20stage\x204','CoinParam\x20for\x20total_pay\x20matches\x20Service<T>\x20type'],'side_effects':['The\x20on-chain\x20allocation\x20call\x20executes','Allocation\x20object\x20created\x20(first-match-wins\x20fund\x20distribution)','Order.allocation\x20=\x20Allocation\x20address'],'always_executed':!![]},{'stage':0x6,'name':'create_progress','preconditions':['Service.machine\x20is\x20Some\x20(machine\x20bound)','Order\x20from\x20stage\x204','Machine\x20from\x20Service.machine'],'side_effects':['The\x20on-chain\x20progress-creation\x20call\x20executes','Progress\x20object\x20created\x20(Progress.machine\x20=\x20Service.machine,\x20Progress.task\x20=\x20Order.id)'],'always_executed':![]},{'stage':0x7,'name':'post_actions','preconditions':['Order/Allocation/Progress\x20objects\x20from\x20stages\x204-6'],'side_effects':['Attach\x20agents\x20to\x20the\x20order\x20(if\x20order_new.agents\x20provided)','order_required_info_update\x20(if\x20order_required_info\x20provided)','Transfer\x20Order\x20ownership\x20(if\x20transfer\x20provided\x20—\x20sets\x20new\x20Order\x20owner)','namedNewOrder\x20/\x20namedNewAllocation\x20/\x20namedNewProgress\x20(local\x20naming)'],'always_executed':![]},{'stage':0x8,'name':'return_result','preconditions':['All\x20preceding\x20stages\x20succeeded'],'side_effects':['Returns\x20BuyResult\x20{\x20order,\x20allocation?,\x20progress?\x20}','Caller\x20proceeds\x20to\x20sign\x20+\x20submit\x20transaction'],'always_executed':!![]}];export const SERVICE_CROSS_OBJECT_BINDINGS=[{'object':'Machine','field':'machine','required':![],'locked_after_publish':!![],'notes':'Workflow\x20template;\x20post-publish\x20immutable\x20(F-S-20).\x20Progress.machine\x20inherits\x20this\x20value.'},{'object':'Guard','field':'buy_guard','required':![],'locked_after_publish':![],'notes':'Buyer\x20eligibility\x20guard;\x20post-publish\x20STILL\x20MUTABLE\x20(unusual\x20—\x20see\x20F-S-26)'},{'object':'Allocation','field':'order_allocators','required':!![],'locked_after_publish':!![],'notes':'Order\x20fund\x20distribution\x20strategy;\x20publish\x20prerequisite\x20(F-S-18).\x20Post-publish\x20immutable\x20(F-S-22).'},{'object':'Arbitration','field':'arbitrations','required':![],'locked_after_publish':![],'notes':'Dispute\x20handlers;\x20required\x20if\x20compensation_fund\x20>\x200\x20(F-S-19).\x20add\x20always\x20mutable;\x20remove/clear\x20time-locked\x20after\x20publish\x20(F-S-21).'},{'object':'Repository','field':'repositories','required':![],'locked_after_publish':![],'notes':'Shared\x20data\x20stores;\x20mutable\x20post-publish'},{'object':'Reward','field':'rewards','required':![],'locked_after_publish':![],'notes':'Marketing\x20incentives;\x20add\x20always\x20mutable;\x20remove/clear\x20time-locked\x20after\x20publish\x20(F-S-24)'},{'object':'Contact','field':'um','required':![],'locked_after_publish':![],'notes':'User\x20Manager\x20(Contact\x20object);\x20mutable\x20post-publish'},{'object':'Treasury','field':'(indirect\x20via\x20order_allocators.sharing.who=Entity)','required':![],'locked_after_publish':![],'notes':'Treasury\x20is\x20referenced\x20by\x20Allocation.sharing.who,\x20not\x20by\x20Service\x20directly'}];export const SERVICE_SCENES=[{'id':'service_retail','name':'Retail\x20e-commerce\x20Service','category':'retail','permission_index_range':'300-320','builtin_indexes':SERVICE_PERMISSIONS,'cross_object_bindings':SERVICE_CROSS_OBJECT_BINDINGS,'order_flow_stages':SERVICE_ORDER_FLOW_STAGES,'owner_operations':['bind/unbind\x20the\x20UM\x20Contact','builder\x20(transfer)'],'admin_operations':['update\x20the\x20description','set\x20the\x20location/URL','set\x20customer\x20required\x20info\x20fields'],'permission_index_operations':['publish\x20the\x20Service\x20(311)','pause/resume\x20the\x20Service\x20(310)','add/set/remove/clear\x20sales\x20items\x20(305)','set\x20the\x20order_allocators\x20strategy\x20(313)','set/clear\x20the\x20buy_guard\x20check\x20(307)','issue/destroy\x20discount\x20coupons\x20(312)'],'mutable_after_publish':{'machine':![],'arbitrations':![],'order_allocators':![],'buy_guard':!![],'rewards':'locked_by_duration','compensation_fund_withdraw':'locked_by_duration','compensation_fund_receive':'mutable','sales':!![],'description':!![],'location':!![],'repositories':!![],'customer_required':!![],'discount':!![],'um':!![],'pause':!![]},'publish_prerequisites':['order_allocators\x20must\x20be\x20set\x20(F-S-18,\x20E_NO_ALLOCATOR)','If\x20compensation_fund\x20>\x200,\x20arbitrations\x20must\x20be\x20non-empty\x20(F-S-19)'],'common_patterns':['Multi-tier\x20pricing\x20via\x20sales[]\x20(Standard/Premium/Enterprise)','WIP\x20hash\x20per\x20sale\x20item\x20for\x20tamper-proof\x20product\x20info','buy_guard\x20for\x20KYC\x20whitelist\x20during\x20pre-sale,\x20then\x20null\x20for\x20public\x20sale','compensation_fund\x20deposited\x20before\x20publish\x20+\x20arbitrations\x20configured'],'recommended_templates':['T-S-01','T-S-06']},{'id':'service_rental','name':'Rental\x20Service\x20(short/long-term)','category':'rental','permission_index_range':'300-320','builtin_indexes':SERVICE_PERMISSIONS,'cross_object_bindings':SERVICE_CROSS_OBJECT_BINDINGS,'order_flow_stages':SERVICE_ORDER_FLOW_STAGES,'owner_operations':['bind/unbind\x20the\x20UM\x20Contact','builder\x20(transfer)'],'admin_operations':['update\x20the\x20description','set\x20the\x20location/URL'],'permission_index_operations':['publish\x20the\x20Service\x20(311)','add/set\x20sales\x20items\x20(305)','bind\x20the\x20Machine\x20workflow\x20(306)\x20—\x20for\x20rental\x20workflow','add\x20Arbitration\x20references\x20(308)\x20—\x20for\x20deposit\x20disputes'],'mutable_after_publish':{'machine':![],'arbitrations':![],'order_allocators':![],'buy_guard':!![],'rewards':'locked_by_duration','compensation_fund_withdraw':'locked_by_duration','compensation_fund_receive':'mutable','sales':!![],'description':!![],'location':!![],'repositories':!![],'customer_required':!![],'discount':!![],'um':!![],'pause':!![]},'publish_prerequisites':['order_allocators\x20must\x20be\x20set','machine\x20recommended\x20(rental\x20workflow\x20with\x20deposit/return\x20stages)','arbitrations\x20recommended\x20(deposit\x20refund\x20disputes)'],'common_patterns':['Machine\x20workflow\x20with\x20\x27Deposit\x20→\x20Use\x20→\x20Return\x20→\x20Refund\x27\x20nodes','compensation_fund\x20holds\x20deposit\x20guarantees','buy_guard\x20verifies\x20renter\x20identity/KYC','stock=1\x20per\x20rental\x20item\x20(unique\x20items)'],'recommended_templates':['T-S-02','T-S-04']},{'id':'service_subscription','name':'Subscription\x20Service\x20(recurring)','category':'subscription','permission_index_range':'300-320','builtin_indexes':SERVICE_PERMISSIONS,'cross_object_bindings':SERVICE_CROSS_OBJECT_BINDINGS,'order_flow_stages':SERVICE_ORDER_FLOW_STAGES,'owner_operations':['bind/unbind\x20the\x20UM\x20Contact','builder\x20(transfer)'],'admin_operations':['update\x20the\x20description','set\x20the\x20location/URL'],'permission_index_operations':['publish\x20the\x20Service\x20(311)','add/set\x20sales\x20items\x20(305)','issue\x20discount\x20coupons\x20(312)\x20—\x20promotional\x20rates','add\x20Reward\x20references\x20(318)\x20—\x20loyalty\x20rewards'],'mutable_after_publish':{'machine':![],'arbitrations':![],'order_allocators':![],'buy_guard':!![],'rewards':'locked_by_duration','compensation_fund_withdraw':'locked_by_duration','compensation_fund_receive':'mutable','sales':!![],'description':!![],'location':!![],'repositories':!![],'customer_required':!![],'discount':!![],'um':!![],'pause':!![]},'publish_prerequisites':['order_allocators\x20must\x20be\x20set'],'common_patterns':['Tiered\x20plans\x20(Free/Pro/Enterprise)\x20as\x20sales[]','Discount\x20coupons\x20for\x20trial\x20periods','Rewards\x20for\x20long-term\x20subscribers','Renewal\x20handled\x20by\x20repeat\x20orders\x20(no\x20native\x20recurring\x20billing)'],'recommended_templates':['T-S-03']},{'id':'service_workflow','name':'Workflow-bound\x20Service\x20(machine-bound)','category':'workflow','permission_index_range':'300-320','builtin_indexes':SERVICE_PERMISSIONS,'cross_object_bindings':SERVICE_CROSS_OBJECT_BINDINGS,'order_flow_stages':SERVICE_ORDER_FLOW_STAGES,'owner_operations':['bind/unbind\x20the\x20UM\x20Contact','builder\x20(transfer)'],'admin_operations':['update\x20the\x20description','set\x20the\x20location/URL'],'permission_index_operations':['bind\x20the\x20Machine\x20workflow\x20(306)','publish\x20the\x20Service\x20(311)','set\x20the\x20order_allocators\x20strategy\x20(313)'],'mutable_after_publish':{'machine':![],'arbitrations':![],'order_allocators':![],'buy_guard':!![],'rewards':'locked_by_duration','compensation_fund_withdraw':'locked_by_duration','compensation_fund_receive':'mutable','sales':!![],'description':!![],'location':!![],'repositories':!![],'customer_required':!![],'discount':!![],'um':!![],'pause':!![]},'publish_prerequisites':['order_allocators\x20must\x20be\x20set','machine\x20must\x20be\x20published\x20before\x20binding','machine\x20recommended\x20for\x20any\x20multi-stage\x20service\x20delivery'],'common_patterns':['Machine\x20defines\x20Pay\x20→\x20Confirm\x20→\x20Deliver\x20→\x20Sign-off\x20nodes','Progress\x20created\x20per\x20order\x20(stage\x206\x20of\x20buy\x20flow)','Named\x20operators\x20assigned\x20per\x20Forward\x20in\x20Machine','Service.paused\x20does\x20NOT\x20affect\x20already-created\x20Progress\x20(existing\x20orders\x20continue)'],'recommended_templates':['T-S-04']},{'id':'service_arbitration','name':'Arbitration-bound\x20Service\x20(dispute-ready)','category':'arbitration','permission_index_range':'300-320','builtin_indexes':SERVICE_PERMISSIONS,'cross_object_bindings':SERVICE_CROSS_OBJECT_BINDINGS,'order_flow_stages':SERVICE_ORDER_FLOW_STAGES,'owner_operations':['bind/unbind\x20the\x20UM\x20Contact','builder\x20(transfer)'],'admin_operations':['update\x20the\x20description'],'permission_index_operations':['add\x20Arbitration\x20references\x20(308)','deposit\x20to\x20the\x20compensation_fund\x20(315)','extend\x20setting_lock_duration\x20(317)','publish\x20the\x20Service\x20(311)'],'mutable_after_publish':{'machine':![],'arbitrations':![],'order_allocators':![],'buy_guard':!![],'rewards':'locked_by_duration','compensation_fund_withdraw':'locked_by_duration','compensation_fund_receive':'mutable','sales':!![],'description':!![],'location':!![],'repositories':!![],'customer_required':!![],'discount':!![],'um':!![],'pause':!![]},'publish_prerequisites':['If\x20compensation_fund\x20>\x200,\x20arbitrations\x20must\x20be\x20non-empty\x20(F-S-19)','Arbitration\x20objects\x20must\x20be\x20created\x20before\x20binding','compensation_fund_add\x20before\x20publish\x20recommended\x20(else\x20post-publish\x20deposit\x20still\x20possible)'],'common_patterns':['2-3\x20Arbitration\x20objects\x20(different\x20arb\x20committees\x20for\x20different\x20dispute\x20types)','compensation_fund\x20deposited\x20as\x20%\x20of\x20expected\x20order\x20volume','setting_lock_duration\x20extended\x20by\x20owner\x20to\x20build\x20customer\x20trust','Arbitration\x20compensation\x20payout\x20triggered\x20by\x20the\x20arbitration\x20result\x20(not\x20by\x20Service\x20directly)'],'recommended_templates':['T-S-05','T-S-06']},{'id':'service_compensation_fund','name':'Compensation\x20Fund\x20Service\x20(embedded\x20balance)','category':'compensation_fund','permission_index_range':'300-320','builtin_indexes':SERVICE_PERMISSIONS,'cross_object_bindings':SERVICE_CROSS_OBJECT_BINDINGS,'order_flow_stages':SERVICE_ORDER_FLOW_STAGES,'owner_operations':['bind/unbind\x20the\x20UM\x20Contact','builder\x20(transfer)'],'admin_operations':['update\x20the\x20description'],'permission_index_operations':['deposit\x20to\x20the\x20compensation_fund\x20(315)','withdraw\x20from\x20the\x20compensation_fund\x20(314)\x20—\x20time-locked\x20after\x20publish','receive\x20the\x20compensation_fund\x20payout\x20(316)\x20—\x20arbitration\x20payout\x20(always\x20mutable)','extend\x20setting_lock_duration\x20(317)\x20—\x20extend\x20lock'],'mutable_after_publish':{'machine':![],'arbitrations':![],'order_allocators':![],'buy_guard':!![],'rewards':'locked_by_duration','compensation_fund_withdraw':'locked_by_duration','compensation_fund_receive':'mutable','sales':!![],'description':!![],'location':!![],'repositories':!![],'customer_required':!![],'discount':!![],'um':!![],'pause':!![]},'publish_prerequisites':['compensation_fund\x20>\x200\x20→\x20arbitrations\x20non-empty\x20(F-S-19)','compensation_fund\x20coin\x20type\x20must\x20match\x20Service<T>\x20type\x20parameter'],'common_patterns':['Fund\x20inflow:\x20compensation_fund_add\x20(315)\x20—\x20always\x20mutable','Fund\x20outflow:\x20compensation_fund_withdraw\x20(314)\x20—\x20requires\x20bPaused\x20+\x20lock_duration\x20expired','Fund\x20receive:\x20compensation_fund_receive\x20(316)\x20—\x20arbitration\x20payout,\x20always\x20mutable','Fund\x20consumer:\x20arbitration\x20compensation\x20payout\x20(driven\x20by\x20arb\x20result)','Distinct\x20from\x20Treasury:\x20Service-internal,\x20arbitration-bound,\x20lock-protected'],'recommended_templates':['T-S-06']},{'id':'service_reward','name':'Reward-attached\x20Service\x20(marketing)','category':'reward','permission_index_range':'300-320','builtin_indexes':SERVICE_PERMISSIONS,'cross_object_bindings':SERVICE_CROSS_OBJECT_BINDINGS,'order_flow_stages':SERVICE_ORDER_FLOW_STAGES,'owner_operations':['bind/unbind\x20the\x20UM\x20Contact','builder\x20(transfer)'],'admin_operations':['update\x20the\x20description'],'permission_index_operations':['add/remove/clear\x20Reward\x20references\x20(318)\x20—\x20add\x20always\x20mutable;\x20remove/clear\x20time-locked\x20after\x20publish','issue/destroy\x20discount\x20coupons\x20(312)','publish\x20the\x20Service\x20(311)'],'mutable_after_publish':{'machine':![],'arbitrations':![],'order_allocators':![],'buy_guard':!![],'rewards':'locked_by_duration','compensation_fund_withdraw':'locked_by_duration','compensation_fund_receive':'mutable','sales':!![],'description':!![],'location':!![],'repositories':!![],'customer_required':!![],'discount':!![],'um':!![],'pause':!![]},'publish_prerequisites':['order_allocators\x20must\x20be\x20set'],'common_patterns':['Rewards\x20added\x20post-publish\x20(always\x20allowed;\x20remove/clear\x20is\x20time-locked\x20after\x20publish)','Reward\x20objects\x20must\x20exist\x20before\x20binding\x20(queryObjectsWithType\x20validation)','MAX_REWARD_COUNT\x20=\x2020\x20per\x20Service','Reward\x20remove/clear\x20requires\x20Service\x20paused\x20+\x20setting_lock_duration\x20elapsed\x20(protects\x20customer\x20expectations)'],'recommended_templates':['T-S-08']},{'id':'service_arbitration_binding','name':'Arbitration\x20Binding\x20Service\x20(post-publish\x20immutable)','category':'arbitration','permission_index_range':'300-320','builtin_indexes':SERVICE_PERMISSIONS,'cross_object_bindings':SERVICE_CROSS_OBJECT_BINDINGS,'order_flow_stages':SERVICE_ORDER_FLOW_STAGES,'owner_operations':['bind/unbind\x20the\x20UM\x20Contact','builder\x20(transfer)'],'admin_operations':['update\x20the\x20description'],'permission_index_operations':['add\x20Arbitration\x20references\x20(308)\x20—\x20pre-publish\x20only','remove\x20an\x20Arbitration\x20reference\x20(308)\x20—\x20pre-publish\x20only','clear\x20Arbitration\x20references\x20(308)\x20—\x20pre-publish\x20only','publish\x20the\x20Service\x20(311)'],'mutable_after_publish':{'machine':![],'arbitrations':![],'order_allocators':![],'buy_guard':!![],'rewards':'locked_by_duration','compensation_fund_withdraw':'locked_by_duration','compensation_fund_receive':'mutable','sales':!![],'description':!![],'location':!![],'repositories':!![],'customer_required':!![],'discount':!![],'um':!![],'pause':!![]},'publish_prerequisites':['MAX_ARBITRATION_COUNT\x20=\x2020\x20per\x20Service\x20(F-S-04)','Each\x20Arbitration\x20object\x20must\x20be\x20valid\x20(queryObjectsWithType\x20validation)','Arbitration\x20bound\x20=\x20locked\x20post-publish\x20(F-S-21).\x20To\x20change:\x20create\x20new\x20Service.'],'common_patterns':['Pre-publish:\x20set\x201-3\x20Arbitration\x20objects\x20for\x20different\x20dispute\x20scopes','Post-publish:\x20immutable\x20—\x20clone\x20Service\x20if\x20change\x20needed','⚠️\x20Data\x20inconsistency:\x20dynamic-pricing.ts\x20marks\x20arbitrations\x20as\x20mutable,\x20but\x20SDK\x20blocks\x20it\x20(F-S-21)'],'recommended_templates':['T-S-05']},{'id':'service_buy_guard','name':'Buy\x20Guard\x20Service\x20(post-publish\x20mutable\x20guard)','category':'buy_guard','permission_index_range':'300-320','builtin_indexes':SERVICE_PERMISSIONS,'cross_object_bindings':SERVICE_CROSS_OBJECT_BINDINGS,'order_flow_stages':SERVICE_ORDER_FLOW_STAGES,'owner_operations':['bind/unbind\x20the\x20UM\x20Contact','builder\x20(transfer)'],'admin_operations':['update\x20the\x20description'],'permission_index_operations':['bind\x20the\x20buy_guard\x20Guard\x20(307)','clear\x20the\x20buy_guard\x20Guard\x20(307)','publish\x20the\x20Service\x20(311)'],'mutable_after_publish':{'machine':![],'arbitrations':![],'order_allocators':![],'buy_guard':!![],'rewards':'locked_by_duration','compensation_fund_withdraw':'locked_by_duration','compensation_fund_receive':'mutable','sales':!![],'description':!![],'location':!![],'repositories':!![],'customer_required':!![],'discount':!![],'um':!![],'pause':!![]},'publish_prerequisites':['order_allocators\x20must\x20be\x20set'],'common_patterns':['Pre-sale\x20phase:\x20buy_guard\x20=\x20whitelist\x20Guard\x20(KYC\x20verified\x20buyers\x20only)','Public\x20sale:\x20buy_guard\x20=\x20null\x20(anyone\x20can\x20buy)','Restricted\x20phase:\x20buy_guard\x20=\x20KYC\x20Guard\x20(compliance)','⚠️\x20buy_guard\x20is\x20the\x20ONLY\x20publish-locked-field\x20exception\x20—\x20still\x20mutable\x20post-publish','buy_guard\x20verification\x20happens\x20at\x20Stage\x201\x20of\x20buy\x20flow\x20(pre_check)'],'recommended_templates':['T-S-01']},{'id':'service_order_allocator','name':'Order\x20Allocator\x20Service\x20(fund\x20distribution\x20config)','category':'order_allocator','permission_index_range':'300-320','builtin_indexes':SERVICE_PERMISSIONS,'cross_object_bindings':SERVICE_CROSS_OBJECT_BINDINGS,'order_flow_stages':SERVICE_ORDER_FLOW_STAGES,'owner_operations':['bind/unbind\x20the\x20UM\x20Contact','builder\x20(transfer)'],'admin_operations':['update\x20the\x20description'],'permission_index_operations':['set\x20the\x20order_allocators\x20strategy\x20(313)\x20—\x20pre-publish\x20only','publish\x20the\x20Service\x20(311)\x20—\x20requires\x20order_allocators\x20(F-S-18)'],'mutable_after_publish':{'machine':![],'arbitrations':![],'order_allocators':![],'buy_guard':!![],'rewards':'locked_by_duration','compensation_fund_withdraw':'locked_by_duration','compensation_fund_receive':'mutable','sales':!![],'description':!![],'location':!![],'repositories':!![],'customer_required':!![],'discount':!![],'um':!![],'pause':!![]},'publish_prerequisites':['order_allocators\x20MUST\x20be\x20set\x20(F-S-18,\x20E_NO_ALLOCATOR)','Allocators.sharing.who\x20can\x20reference\x20Treasury\x20addresses\x20(indirect\x20Treasury\x20binding)','MAX_SHARING_COUNT\x20=\x20100\x20per\x20allocator'],'common_patterns':['Multi-party\x20split:\x20merchant\x2080%\x20/\x20platform\x2010%\x20/\x20logistics\x2010%','Threshold-based:\x20different\x20allocators\x20for\x20different\x20order\x20sizes','Guard-bound\x20allocator:\x20allocation\x20execution\x20requires\x20Guard\x20verification','Post-publish\x20immutable\x20—\x20clone\x20Service\x20to\x20change\x20allocation\x20strategy'],'recommended_templates':['T-S-08']},{'id':'service_dynamic_pricing','name':'Dynamic\x20Pricing\x20Service\x20(discount-driven)','category':'dynamic_pricing','permission_index_range':'300-320','builtin_indexes':SERVICE_PERMISSIONS,'cross_object_bindings':SERVICE_CROSS_OBJECT_BINDINGS,'order_flow_stages':SERVICE_ORDER_FLOW_STAGES,'owner_operations':['bind/unbind\x20the\x20UM\x20Contact','builder\x20(transfer)'],'admin_operations':['update\x20the\x20description'],'permission_index_operations':['issue\x20discount\x20coupons\x20(312)','add/set\x20sales\x20items\x20(305)\x20—\x20adjust\x20base\x20prices','remove\x20sales\x20items\x20(305)\x20—\x20remove\x20deprecated\x20SKUs'],'mutable_after_publish':{'machine':![],'arbitrations':![],'order_allocators':![],'buy_guard':!![],'rewards':'locked_by_duration','compensation_fund_withdraw':'locked_by_duration','compensation_fund_receive':'mutable','sales':!![],'description':!![],'location':!![],'repositories':!![],'customer_required':!![],'discount':!![],'um':!![],'pause':!![]},'publish_prerequisites':['order_allocators\x20must\x20be\x20set'],'common_patterns':['Discount\x20types:\x200=rates\x20(basis\x20points,\x20per\x2010000),\x201=minus\x20(direct\x20deduction)','MAX_DISCOUNT_COUNT_ONCE\x20=\x201000\x20per\x20issue\x20call','MAX_DISCOUNT_RECEIVER_ONCE\x20=\x201000\x20receivers\x20per\x20call','MAX_DISCOUNT_TOTAL_COUNT\x20=\x2020000\x20total\x20coupons','discount_destroy:\x20holder-only\x20(no\x20SERVICE_DISCOUNT\x20permission\x20needed)'],'recommended_templates':['T-S-07']},{'id':'service_multi_allocator','name':'Multi-Allocator\x20Service\x20(tiered\x20fund\x20distribution)','category':'multi_allocator','permission_index_range':'300-320','builtin_indexes':SERVICE_PERMISSIONS,'cross_object_bindings':SERVICE_CROSS_OBJECT_BINDINGS,'order_flow_stages':SERVICE_ORDER_FLOW_STAGES,'owner_operations':['bind/unbind\x20the\x20UM\x20Contact','builder\x20(transfer)'],'admin_operations':['update\x20the\x20description'],'permission_index_operations':['set\x20the\x20order_allocators\x20strategy\x20(313)\x20—\x20pre-publish\x20only','publish\x20the\x20Service\x20(311)'],'mutable_after_publish':{'machine':![],'arbitrations':![],'order_allocators':![],'buy_guard':!![],'rewards':'locked_by_duration','compensation_fund_withdraw':'locked_by_duration','compensation_fund_receive':'mutable','sales':!![],'description':!![],'location':!![],'repositories':!![],'customer_required':!![],'discount':!![],'um':!![],'pause':!![]},'publish_prerequisites':['order_allocators\x20MUST\x20be\x20set','Each\x20allocator\x20has\x20its\x20own\x20Guard\x20+\x20sharing\x20+\x20threshold','First-match-wins:\x20first\x20allocator\x20whose\x20threshold\x20is\x20met\x20handles\x20the\x20order'],'common_patterns':['Tier\x201\x20(small\x20orders):\x20single-recipient\x20allocator\x20(low\x20fee)','Tier\x202\x20(medium\x20orders):\x20two-recipient\x20split\x20(merchant\x20+\x20platform)','Tier\x203\x20(large\x20orders):\x20three-recipient\x20split\x20(merchant\x20+\x20platform\x20+\x20logistics)','Each\x20tier\x20can\x20have\x20its\x20own\x20Guard\x20for\x20execution\x20authorization'],'recommended_templates':['T-S-08']}];export const SERVICE_LEDGER_VERSION='1.0.0';export function getScenesByCategory(a){return SERVICE_SCENES['filter'](b=>b['category']===a);}export function findSceneById(a){return SERVICE_SCENES['find'](b=>b['id']===a);}export function getServicePermissionByIndex(a){return SERVICE_PERMISSIONS['find'](b=>b['index']===a);}export function isServicePermission(a){return getServicePermissionByIndex(a)!==undefined;}export function getPermissionsByMutability(a){return SERVICE_PERMISSIONS['filter'](b=>b['post_publish_mutability']===a);}export function getImmutablePostPublishPermissions(){return SERVICE_PERMISSIONS['filter'](a=>a['post_publish_mutability']==='immutable'||a['post_publish_mutability']==='one_shot');}export function getLockedByDurationPermissions(){return SERVICE_PERMISSIONS['filter'](a=>a['post_publish_mutability']==='locked_by_duration');}export function inferSceneFromIntent(a){const b=a['toLowerCase'](),c=[['retail','retail'],['ecommerce','retail'],['rental','rental'],['rent','rental'],['short-term\x20rental','rental'],['long-term\x20rental','rental'],['subscription','subscription'],['subscribe','subscription'],['workflow','workflow'],['machine-bound','workflow'],['arbitration','arbitration'],['dispute','arbitration'],['compensation','compensation_fund'],['compensation_fund','compensation_fund'],['reward','reward'],['marketing','reward'],['buy_guard','buy_guard'],['kyc','buy_guard'],['whitelist','buy_guard'],['allocator','order_allocator'],['discount','dynamic_pricing'],['coupon','dynamic_pricing'],['multi-allocator','multi_allocator'],['tiered','multi_allocator']];for(const [d,e]of c){if(b['includes'](d)){const f=getScenesByCategory(e);if(f['length']>0x0)return f[0x0];}}if(b['includes']('service'))return findSceneById('service_retail');return undefined;}export function getAllServiceScenes(){return[...SERVICE_SCENES];}export function getServiceScenesCount(){return SERVICE_SCENES['length'];}export function getServicePermissionsCount(){return SERVICE_PERMISSIONS['length'];}export function getOrderFlowStage(a){return SERVICE_ORDER_FLOW_STAGES['find'](b=>b['stage']===a);}export function getCrossObjectBindings(){return[...SERVICE_CROSS_OBJECT_BINDINGS];}
1
+ export const SERVICE_PERMISSIONS=[{'index':0x12c,'name':'SERVICE_NEW','description':'Create\x20new\x20Service','governed_operation':'create\x20a\x20new\x20Service','post_publish_mutability':'na'},{'index':0x12d,'name':'SERVICE_DESCRIPTION','description':'Modify\x20Service\x20description','governed_operation':'modify\x20the\x20Service\x20description','post_publish_mutability':'mutable'},{'index':0x12f,'name':'SERVICE_LOCATION','description':'Set\x20Service\x20location/URL','governed_operation':'set\x20the\x20Service\x20location/URL','post_publish_mutability':'mutable'},{'index':0x130,'name':'SERVICE_REPOSITORY','description':'Add/remove\x20Repository\x20references','governed_operation':'add/remove/clear\x20Repository\x20references','post_publish_mutability':'mutable'},{'index':0x131,'name':'SERVICE_SALES','description':'Add/set/remove/clear\x20sales\x20items','governed_operation':'add/set/remove/clear\x20sales\x20items','post_publish_mutability':'mutable'},{'index':0x132,'name':'SERVICE_MACHINE','description':'Bind/unbind\x20Machine\x20workflow\x20template','governed_operation':'bind/unbind\x20the\x20Machine\x20workflow\x20template','post_publish_mutability':'immutable'},{'index':0x133,'name':'SERVICE_BUY_GUARD','description':'Set/clear\x20buy\x20Guard\x20(post-publish\x20mutable)','governed_operation':'set/clear\x20the\x20buy_guard\x20check','post_publish_mutability':'mutable'},{'index':0x134,'name':'SERVICE_ARBITRATION','description':'Add/remove\x20Arbitration\x20references','governed_operation':'add/remove/clear\x20Arbitration\x20references','post_publish_mutability':'immutable'},{'index':0x135,'name':'SERVICE_CUSTOMER_INFO_REQUIRED','description':'Set\x20customer\x20required\x20info\x20fields','governed_operation':'set\x20customer\x20required\x20info\x20fields','post_publish_mutability':'mutable'},{'index':0x136,'name':'SERVICE_PAUSE','description':'Pause/resume\x20Service\x20(block\x20new\x20orders)','governed_operation':'pause/resume\x20the\x20Service','post_publish_mutability':'mutable'},{'index':0x137,'name':'SERVICE_PUBLISH','description':'Publish\x20Service\x20(IRREVERSIBLE)','governed_operation':'publish\x20the\x20Service\x20(irreversible)','post_publish_mutability':'one_shot'},{'index':0x138,'name':'SERVICE_DISCOUNT','description':'Issue/discount_destroy\x20discount\x20coupons','governed_operation':'issue/destroy\x20discount\x20coupons','post_publish_mutability':'mutable'},{'index':0x139,'name':'SERVICE_ORDER_ALLOCATOR','description':'Set\x20order\x20allocator\x20strategy','governed_operation':'set\x20the\x20order_allocators\x20strategy','post_publish_mutability':'immutable'},{'index':0x13a,'name':'SERVICE_COMPENSATION_FUND_WITHDRAW','description':'Withdraw\x20compensation\x20fund\x20(time-locked)','governed_operation':'withdraw\x20from\x20the\x20compensation_fund\x20(time-locked)','post_publish_mutability':'locked_by_duration'},{'index':0x13b,'name':'SERVICE_COMPENSATION_FUND_DEPOSIT','description':'Deposit\x20to\x20compensation\x20fund','governed_operation':'deposit\x20to\x20the\x20compensation_fund','post_publish_mutability':'mutable'},{'index':0x13c,'name':'SERVICE_COMPENSATION_FUND_RECEIVE','description':'Receive\x20compensation\x20fund\x20(arbitration\x20payout)','governed_operation':'receive\x20the\x20compensation_fund\x20payout\x20(arbitration\x20payout)','post_publish_mutability':'mutable'},{'index':0x13d,'name':'SERVICE_COMPENSATION_LOCK_DURATION_ADD','description':'Extend\x20setting_lock_duration\x20(only-increase)','governed_operation':'extend\x20setting_lock_duration\x20(only-increase)','post_publish_mutability':'mutable'},{'index':0x13e,'name':'SERVICE_REWARD','description':'Add/remove\x20Reward\x20references\x20(remove/clear\x20time-locked)','governed_operation':'add/remove/clear\x20Reward\x20references','post_publish_mutability':'locked_by_duration'},{'index':0x13f,'name':'SERVICE_OWNER_RECEIVE','description':'Receive\x20Payment/objects\x20to\x20owner','governed_operation':'receive\x20Payments/objects\x20to\x20owner','post_publish_mutability':'mutable'},{'index':0x140,'name':'SERVICE_UM','description':'Bind/unbind\x20Contact\x20as\x20UM','governed_operation':'bind/unbind\x20Contact\x20as\x20UM','post_publish_mutability':'mutable'},{'index':0x141,'name':'SERVICE_ARB_STATEMENT','description':'Append\x20seller\x20statement\x20to\x20an\x20Arb\x20case\x20(event-only)','governed_operation':'append\x20seller\x20text\x20to\x20a\x20case\x20against\x20an\x20order\x20of\x20this\x20service\x20(ArbStatementEvent;\x20no\x20Arb\x20state\x20change)','post_publish_mutability':'mutable'}];export const SERVICE_ORDER_FLOW_STAGES=[{'stage':0x1,'name':'pre_check','preconditions':['Service.bPublished\x20==\x20true\x20(else\x20E_NOT_PUBLISHED,\x20service:7)','Service.bPaused\x20==\x20false\x20(else\x20E_PAUSED,\x20service:19)','buy_guard\x20(if\x20set)\x20added\x20to\x20guards[]\x20list\x20for\x20verification'],'side_effects':[],'always_executed':!![]},{'stage':0x2,'name':'wip_verify','preconditions':['buy.items\x20non-empty','Each\x20item.name\x20matches\x20a\x20sale\x20in\x20Service.sales\x20(else\x20E_SALE_ITEM_NOT_FOUND,\x20service:32)','sale.suspension\x20==\x20false\x20(else\x20E_SALE_SUSPENDED)'],'side_effects':['If\x20buyer\x20passes\x20empty\x20wip_hash,\x20SDK\x20auto-fills\x20with\x20sale.wip_hash','verifiedWipUrls\x20Set\x20avoids\x20re-verifying\x20same\x20WIP\x20URL\x20across\x20items','verify_wip()\x20fetches\x20WIP\x20file\x20and\x20compares\x20hash\x20(else\x20E_WIP_HASH_NOT_MATCH)'],'always_executed':!![]},{'stage':0x3,'name':'quote','preconditions':['All\x20items\x20have\x20valid\x20sale\x20+\x20wip_hash\x20match','stock\x20>=\x20purchase\x20quantity\x20(else\x20E_STOCK_NOT_ENOUGH,\x20service:16)','discount\x20object\x20(if\x20used)\x20is\x20valid\x20and\x20within\x20its\x20[time_start,\x20time_end]\x20window\x20(else\x20E_DISCOUNT_TIME_INVALID)'],'side_effects':['The\x20quote\x20step\x20computes\x20the\x20total\x20price\x20(with\x20discount\x20if\x20applicable)','⚠️\x20Stock\x20is\x20deducted\x20(split)\x20—\x20side\x20effect\x20is\x20NOT\x20auto-rolled-back\x20on\x20later\x20failure','The\x20on-chain\x20quote\x20call\x20executes\x20(the\x20discount\x20path\x20validates\x20the\x20Clock\x20time-window\x20check)'],'always_executed':!![]},{'stage':0x4,'name':'create_order','preconditions':['Quote\x20object\x20from\x20stage\x203','Registrar\x20+\x20Clock\x20objects\x20available'],'side_effects':['The\x20atomic\x20on-chain\x20buy\x20call\x20executes\x20(passport-gated\x20variant\x20supported)','Order\x20object\x20created\x20(builder=customer,\x20service=Service.id)','Order.id\x20recorded\x20for\x20stages\x205-7'],'always_executed':!![]},{'stage':0x5,'name':'create_allocation','preconditions':['Service.order_allocators\x20is\x20Some\x20(configured)','Order\x20from\x20stage\x204','CoinParam\x20for\x20total_pay\x20matches\x20Service<T>\x20type'],'side_effects':['The\x20on-chain\x20allocation\x20call\x20executes','Allocation\x20object\x20created\x20(guard-selected\x20fund\x20distribution)','Order.allocation\x20=\x20Allocation\x20address'],'always_executed':!![]},{'stage':0x6,'name':'create_progress','preconditions':['Service.machine\x20is\x20Some\x20(machine\x20bound)','Order\x20from\x20stage\x204','Machine\x20from\x20Service.machine'],'side_effects':['The\x20on-chain\x20progress-creation\x20call\x20executes','Progress\x20object\x20created\x20(Progress.machine\x20=\x20Service.machine,\x20Progress.task\x20=\x20Order.id)'],'always_executed':![]},{'stage':0x7,'name':'post_actions','preconditions':['Order/Allocation/Progress\x20objects\x20from\x20stages\x204-6'],'side_effects':['Attach\x20agents\x20to\x20the\x20order\x20(if\x20order_new.agents\x20provided)','order_required_info_update\x20(if\x20order_required_info\x20provided)','Transfer\x20Order\x20ownership\x20(if\x20transfer\x20provided\x20—\x20sets\x20new\x20Order\x20owner)','namedNewOrder\x20/\x20namedNewAllocation\x20/\x20namedNewProgress\x20(local\x20naming)'],'always_executed':![]},{'stage':0x8,'name':'return_result','preconditions':['All\x20preceding\x20stages\x20succeeded'],'side_effects':['Returns\x20BuyResult\x20{\x20order,\x20allocation?,\x20progress?\x20}','Caller\x20proceeds\x20to\x20sign\x20+\x20submit\x20transaction'],'always_executed':!![]}];export const SERVICE_CROSS_OBJECT_BINDINGS=[{'object':'Machine','field':'machine','required':![],'locked_after_publish':!![],'notes':'Workflow\x20template;\x20post-publish\x20immutable\x20(F-S-20).\x20Progress.machine\x20inherits\x20this\x20value.'},{'object':'Guard','field':'buy_guard','required':![],'locked_after_publish':![],'notes':'Buyer\x20eligibility\x20guard;\x20post-publish\x20STILL\x20MUTABLE\x20(unusual\x20—\x20see\x20F-S-26)'},{'object':'Allocation','field':'order_allocators','required':!![],'locked_after_publish':!![],'notes':'Order\x20fund\x20distribution\x20strategy;\x20publish\x20prerequisite\x20(F-S-18).\x20Post-publish\x20immutable\x20(F-S-22).'},{'object':'Arbitration','field':'arbitrations','required':![],'locked_after_publish':![],'notes':'Dispute\x20handlers;\x20required\x20if\x20compensation_fund\x20>\x200\x20(F-S-19).\x20add\x20always\x20mutable;\x20remove/clear\x20time-locked\x20after\x20publish\x20(F-S-21).'},{'object':'Repository','field':'repositories','required':![],'locked_after_publish':![],'notes':'Shared\x20data\x20stores;\x20mutable\x20post-publish'},{'object':'Reward','field':'rewards','required':![],'locked_after_publish':![],'notes':'Marketing\x20incentives;\x20add\x20always\x20mutable;\x20remove/clear\x20time-locked\x20after\x20publish\x20(F-S-24)'},{'object':'Contact','field':'um','required':![],'locked_after_publish':![],'notes':'User\x20Manager\x20(Contact\x20object);\x20mutable\x20post-publish'},{'object':'Treasury','field':'(indirect\x20via\x20order_allocators.sharing.who=Entity)','required':![],'locked_after_publish':![],'notes':'Treasury\x20is\x20referenced\x20by\x20Allocation.sharing.who,\x20not\x20by\x20Service\x20directly'}];export const SERVICE_SCENES=[{'id':'service_retail','name':'Retail\x20e-commerce\x20Service','category':'retail','permission_index_range':'300-320','builtin_indexes':SERVICE_PERMISSIONS,'cross_object_bindings':SERVICE_CROSS_OBJECT_BINDINGS,'order_flow_stages':SERVICE_ORDER_FLOW_STAGES,'owner_operations':['bind/unbind\x20the\x20UM\x20Contact','builder\x20(transfer)'],'admin_operations':['update\x20the\x20description','set\x20the\x20location/URL','set\x20customer\x20required\x20info\x20fields'],'permission_index_operations':['publish\x20the\x20Service\x20(311)','pause/resume\x20the\x20Service\x20(310)','add/set/remove/clear\x20sales\x20items\x20(305)','set\x20the\x20order_allocators\x20strategy\x20(313)','set/clear\x20the\x20buy_guard\x20check\x20(307)','issue/destroy\x20discount\x20coupons\x20(312)'],'mutable_after_publish':{'machine':![],'arbitrations':![],'order_allocators':![],'buy_guard':!![],'rewards':'locked_by_duration','compensation_fund_withdraw':'locked_by_duration','compensation_fund_receive':'mutable','sales':!![],'description':!![],'location':!![],'repositories':!![],'customer_required':!![],'discount':!![],'um':!![],'pause':!![]},'publish_prerequisites':['order_allocators\x20must\x20be\x20set\x20(F-S-18,\x20E_NO_ALLOCATOR)','If\x20compensation_fund\x20>\x200,\x20arbitrations\x20must\x20be\x20non-empty\x20(F-S-19)'],'common_patterns':['Multi-tier\x20pricing\x20via\x20sales[]\x20(Standard/Premium/Enterprise)','WIP\x20hash\x20per\x20sale\x20item\x20for\x20tamper-proof\x20product\x20info','buy_guard\x20for\x20KYC\x20whitelist\x20during\x20pre-sale,\x20then\x20null\x20for\x20public\x20sale','compensation_fund\x20deposited\x20before\x20publish\x20+\x20arbitrations\x20configured'],'recommended_templates':['T-S-01','T-S-06']},{'id':'service_rental','name':'Rental\x20Service\x20(short/long-term)','category':'rental','permission_index_range':'300-320','builtin_indexes':SERVICE_PERMISSIONS,'cross_object_bindings':SERVICE_CROSS_OBJECT_BINDINGS,'order_flow_stages':SERVICE_ORDER_FLOW_STAGES,'owner_operations':['bind/unbind\x20the\x20UM\x20Contact','builder\x20(transfer)'],'admin_operations':['update\x20the\x20description','set\x20the\x20location/URL'],'permission_index_operations':['publish\x20the\x20Service\x20(311)','add/set\x20sales\x20items\x20(305)','bind\x20the\x20Machine\x20workflow\x20(306)\x20—\x20for\x20rental\x20workflow','add\x20Arbitration\x20references\x20(308)\x20—\x20for\x20deposit\x20disputes'],'mutable_after_publish':{'machine':![],'arbitrations':![],'order_allocators':![],'buy_guard':!![],'rewards':'locked_by_duration','compensation_fund_withdraw':'locked_by_duration','compensation_fund_receive':'mutable','sales':!![],'description':!![],'location':!![],'repositories':!![],'customer_required':!![],'discount':!![],'um':!![],'pause':!![]},'publish_prerequisites':['order_allocators\x20must\x20be\x20set','machine\x20recommended\x20(rental\x20workflow\x20with\x20deposit/return\x20stages)','arbitrations\x20recommended\x20(deposit\x20refund\x20disputes)'],'common_patterns':['Machine\x20workflow\x20with\x20\x27Deposit\x20→\x20Use\x20→\x20Return\x20→\x20Refund\x27\x20nodes','compensation_fund\x20holds\x20deposit\x20guarantees','buy_guard\x20verifies\x20renter\x20identity/KYC','stock=1\x20per\x20rental\x20item\x20(unique\x20items)'],'recommended_templates':['T-S-02','T-S-04']},{'id':'service_subscription','name':'Subscription\x20Service\x20(recurring)','category':'subscription','permission_index_range':'300-320','builtin_indexes':SERVICE_PERMISSIONS,'cross_object_bindings':SERVICE_CROSS_OBJECT_BINDINGS,'order_flow_stages':SERVICE_ORDER_FLOW_STAGES,'owner_operations':['bind/unbind\x20the\x20UM\x20Contact','builder\x20(transfer)'],'admin_operations':['update\x20the\x20description','set\x20the\x20location/URL'],'permission_index_operations':['publish\x20the\x20Service\x20(311)','add/set\x20sales\x20items\x20(305)','issue\x20discount\x20coupons\x20(312)\x20—\x20promotional\x20rates','add\x20Reward\x20references\x20(318)\x20—\x20loyalty\x20rewards'],'mutable_after_publish':{'machine':![],'arbitrations':![],'order_allocators':![],'buy_guard':!![],'rewards':'locked_by_duration','compensation_fund_withdraw':'locked_by_duration','compensation_fund_receive':'mutable','sales':!![],'description':!![],'location':!![],'repositories':!![],'customer_required':!![],'discount':!![],'um':!![],'pause':!![]},'publish_prerequisites':['order_allocators\x20must\x20be\x20set'],'common_patterns':['Tiered\x20plans\x20(Free/Pro/Enterprise)\x20as\x20sales[]','Discount\x20coupons\x20for\x20trial\x20periods','Rewards\x20for\x20long-term\x20subscribers','Renewal\x20handled\x20by\x20repeat\x20orders\x20(no\x20native\x20recurring\x20billing)'],'recommended_templates':['T-S-03']},{'id':'service_workflow','name':'Workflow-bound\x20Service\x20(machine-bound)','category':'workflow','permission_index_range':'300-320','builtin_indexes':SERVICE_PERMISSIONS,'cross_object_bindings':SERVICE_CROSS_OBJECT_BINDINGS,'order_flow_stages':SERVICE_ORDER_FLOW_STAGES,'owner_operations':['bind/unbind\x20the\x20UM\x20Contact','builder\x20(transfer)'],'admin_operations':['update\x20the\x20description','set\x20the\x20location/URL'],'permission_index_operations':['bind\x20the\x20Machine\x20workflow\x20(306)','publish\x20the\x20Service\x20(311)','set\x20the\x20order_allocators\x20strategy\x20(313)'],'mutable_after_publish':{'machine':![],'arbitrations':![],'order_allocators':![],'buy_guard':!![],'rewards':'locked_by_duration','compensation_fund_withdraw':'locked_by_duration','compensation_fund_receive':'mutable','sales':!![],'description':!![],'location':!![],'repositories':!![],'customer_required':!![],'discount':!![],'um':!![],'pause':!![]},'publish_prerequisites':['order_allocators\x20must\x20be\x20set','machine\x20must\x20be\x20published\x20before\x20binding','machine\x20recommended\x20for\x20any\x20multi-stage\x20service\x20delivery'],'common_patterns':['Machine\x20defines\x20Pay\x20→\x20Confirm\x20→\x20Deliver\x20→\x20Sign-off\x20nodes','Progress\x20created\x20per\x20order\x20(stage\x206\x20of\x20buy\x20flow)','Named\x20operators\x20assigned\x20per\x20Forward\x20in\x20Machine','Service.paused\x20does\x20NOT\x20affect\x20already-created\x20Progress\x20(existing\x20orders\x20continue)'],'recommended_templates':['T-S-04']},{'id':'service_arbitration','name':'Arbitration-bound\x20Service\x20(dispute-ready)','category':'arbitration','permission_index_range':'300-320','builtin_indexes':SERVICE_PERMISSIONS,'cross_object_bindings':SERVICE_CROSS_OBJECT_BINDINGS,'order_flow_stages':SERVICE_ORDER_FLOW_STAGES,'owner_operations':['bind/unbind\x20the\x20UM\x20Contact','builder\x20(transfer)'],'admin_operations':['update\x20the\x20description'],'permission_index_operations':['add\x20Arbitration\x20references\x20(308)','deposit\x20to\x20the\x20compensation_fund\x20(315)','extend\x20setting_lock_duration\x20(317)','publish\x20the\x20Service\x20(311)'],'mutable_after_publish':{'machine':![],'arbitrations':![],'order_allocators':![],'buy_guard':!![],'rewards':'locked_by_duration','compensation_fund_withdraw':'locked_by_duration','compensation_fund_receive':'mutable','sales':!![],'description':!![],'location':!![],'repositories':!![],'customer_required':!![],'discount':!![],'um':!![],'pause':!![]},'publish_prerequisites':['If\x20compensation_fund\x20>\x200,\x20arbitrations\x20must\x20be\x20non-empty\x20(F-S-19)','Arbitration\x20objects\x20must\x20be\x20created\x20before\x20binding','compensation_fund_add\x20before\x20publish\x20recommended\x20(else\x20post-publish\x20deposit\x20still\x20possible)'],'common_patterns':['2-3\x20Arbitration\x20objects\x20(different\x20arb\x20committees\x20for\x20different\x20dispute\x20types)','compensation_fund\x20deposited\x20as\x20%\x20of\x20expected\x20order\x20volume','setting_lock_duration\x20extended\x20by\x20owner\x20to\x20build\x20customer\x20trust','Arbitration\x20compensation\x20payout\x20triggered\x20by\x20the\x20arbitration\x20result\x20(not\x20by\x20Service\x20directly)'],'recommended_templates':['T-S-05','T-S-06']},{'id':'service_compensation_fund','name':'Compensation\x20Fund\x20Service\x20(embedded\x20balance)','category':'compensation_fund','permission_index_range':'300-320','builtin_indexes':SERVICE_PERMISSIONS,'cross_object_bindings':SERVICE_CROSS_OBJECT_BINDINGS,'order_flow_stages':SERVICE_ORDER_FLOW_STAGES,'owner_operations':['bind/unbind\x20the\x20UM\x20Contact','builder\x20(transfer)'],'admin_operations':['update\x20the\x20description'],'permission_index_operations':['deposit\x20to\x20the\x20compensation_fund\x20(315)','withdraw\x20from\x20the\x20compensation_fund\x20(314)\x20—\x20time-locked\x20after\x20publish','receive\x20the\x20compensation_fund\x20payout\x20(316)\x20—\x20arbitration\x20payout\x20(always\x20mutable)','extend\x20setting_lock_duration\x20(317)\x20—\x20extend\x20lock'],'mutable_after_publish':{'machine':![],'arbitrations':![],'order_allocators':![],'buy_guard':!![],'rewards':'locked_by_duration','compensation_fund_withdraw':'locked_by_duration','compensation_fund_receive':'mutable','sales':!![],'description':!![],'location':!![],'repositories':!![],'customer_required':!![],'discount':!![],'um':!![],'pause':!![]},'publish_prerequisites':['compensation_fund\x20>\x200\x20→\x20arbitrations\x20non-empty\x20(F-S-19)','compensation_fund\x20coin\x20type\x20must\x20match\x20Service<T>\x20type\x20parameter'],'common_patterns':['Fund\x20inflow:\x20compensation_fund_add\x20(315)\x20—\x20always\x20mutable','Fund\x20outflow:\x20compensation_fund_withdraw\x20(314)\x20—\x20requires\x20bPaused\x20+\x20lock_duration\x20expired','Fund\x20receive:\x20compensation_fund_receive\x20(316)\x20—\x20arbitration\x20payout,\x20always\x20mutable','Fund\x20consumer:\x20arbitration\x20compensation\x20payout\x20(driven\x20by\x20arb\x20result)','Distinct\x20from\x20Treasury:\x20Service-internal,\x20arbitration-bound,\x20lock-protected'],'recommended_templates':['T-S-06']},{'id':'service_reward','name':'Reward-attached\x20Service\x20(marketing)','category':'reward','permission_index_range':'300-320','builtin_indexes':SERVICE_PERMISSIONS,'cross_object_bindings':SERVICE_CROSS_OBJECT_BINDINGS,'order_flow_stages':SERVICE_ORDER_FLOW_STAGES,'owner_operations':['bind/unbind\x20the\x20UM\x20Contact','builder\x20(transfer)'],'admin_operations':['update\x20the\x20description'],'permission_index_operations':['add/remove/clear\x20Reward\x20references\x20(318)\x20—\x20add\x20always\x20mutable;\x20remove/clear\x20time-locked\x20after\x20publish','issue/destroy\x20discount\x20coupons\x20(312)','publish\x20the\x20Service\x20(311)'],'mutable_after_publish':{'machine':![],'arbitrations':![],'order_allocators':![],'buy_guard':!![],'rewards':'locked_by_duration','compensation_fund_withdraw':'locked_by_duration','compensation_fund_receive':'mutable','sales':!![],'description':!![],'location':!![],'repositories':!![],'customer_required':!![],'discount':!![],'um':!![],'pause':!![]},'publish_prerequisites':['order_allocators\x20must\x20be\x20set'],'common_patterns':['Rewards\x20added\x20post-publish\x20(always\x20allowed;\x20remove/clear\x20is\x20time-locked\x20after\x20publish)','Reward\x20objects\x20must\x20exist\x20before\x20binding\x20(queryObjectsWithType\x20validation)','MAX_REWARD_COUNT\x20=\x2020\x20per\x20Service','Reward\x20remove/clear\x20requires\x20Service\x20paused\x20+\x20setting_lock_duration\x20elapsed\x20(protects\x20customer\x20expectations)'],'recommended_templates':['T-S-08']},{'id':'service_arbitration_binding','name':'Arbitration\x20Binding\x20Service\x20(post-publish\x20immutable)','category':'arbitration','permission_index_range':'300-320','builtin_indexes':SERVICE_PERMISSIONS,'cross_object_bindings':SERVICE_CROSS_OBJECT_BINDINGS,'order_flow_stages':SERVICE_ORDER_FLOW_STAGES,'owner_operations':['bind/unbind\x20the\x20UM\x20Contact','builder\x20(transfer)'],'admin_operations':['update\x20the\x20description'],'permission_index_operations':['add\x20Arbitration\x20references\x20(308)\x20—\x20pre-publish\x20only','remove\x20an\x20Arbitration\x20reference\x20(308)\x20—\x20pre-publish\x20only','clear\x20Arbitration\x20references\x20(308)\x20—\x20pre-publish\x20only','publish\x20the\x20Service\x20(311)'],'mutable_after_publish':{'machine':![],'arbitrations':![],'order_allocators':![],'buy_guard':!![],'rewards':'locked_by_duration','compensation_fund_withdraw':'locked_by_duration','compensation_fund_receive':'mutable','sales':!![],'description':!![],'location':!![],'repositories':!![],'customer_required':!![],'discount':!![],'um':!![],'pause':!![]},'publish_prerequisites':['MAX_ARBITRATION_COUNT\x20=\x2020\x20per\x20Service\x20(F-S-04)','Each\x20Arbitration\x20object\x20must\x20be\x20valid\x20(queryObjectsWithType\x20validation)','Arbitration\x20bound\x20=\x20locked\x20post-publish\x20(F-S-21).\x20To\x20change:\x20create\x20new\x20Service.'],'common_patterns':['Pre-publish:\x20set\x201-3\x20Arbitration\x20objects\x20for\x20different\x20dispute\x20scopes','Post-publish:\x20immutable\x20—\x20clone\x20Service\x20if\x20change\x20needed','⚠️\x20Data\x20inconsistency:\x20dynamic-pricing.ts\x20marks\x20arbitrations\x20as\x20mutable,\x20but\x20SDK\x20blocks\x20it\x20(F-S-21)'],'recommended_templates':['T-S-05']},{'id':'service_buy_guard','name':'Buy\x20Guard\x20Service\x20(post-publish\x20mutable\x20guard)','category':'buy_guard','permission_index_range':'300-320','builtin_indexes':SERVICE_PERMISSIONS,'cross_object_bindings':SERVICE_CROSS_OBJECT_BINDINGS,'order_flow_stages':SERVICE_ORDER_FLOW_STAGES,'owner_operations':['bind/unbind\x20the\x20UM\x20Contact','builder\x20(transfer)'],'admin_operations':['update\x20the\x20description'],'permission_index_operations':['bind\x20the\x20buy_guard\x20Guard\x20(307)','clear\x20the\x20buy_guard\x20Guard\x20(307)','publish\x20the\x20Service\x20(311)'],'mutable_after_publish':{'machine':![],'arbitrations':![],'order_allocators':![],'buy_guard':!![],'rewards':'locked_by_duration','compensation_fund_withdraw':'locked_by_duration','compensation_fund_receive':'mutable','sales':!![],'description':!![],'location':!![],'repositories':!![],'customer_required':!![],'discount':!![],'um':!![],'pause':!![]},'publish_prerequisites':['order_allocators\x20must\x20be\x20set'],'common_patterns':['Pre-sale\x20phase:\x20buy_guard\x20=\x20whitelist\x20Guard\x20(KYC\x20verified\x20buyers\x20only)','Public\x20sale:\x20buy_guard\x20=\x20null\x20(anyone\x20can\x20buy)','Restricted\x20phase:\x20buy_guard\x20=\x20KYC\x20Guard\x20(compliance)','⚠️\x20buy_guard\x20is\x20the\x20ONLY\x20publish-locked-field\x20exception\x20—\x20still\x20mutable\x20post-publish','buy_guard\x20verification\x20happens\x20at\x20Stage\x201\x20of\x20buy\x20flow\x20(pre_check)'],'recommended_templates':['T-S-01']},{'id':'service_order_allocator','name':'Order\x20Allocator\x20Service\x20(fund\x20distribution\x20config)','category':'order_allocator','permission_index_range':'300-320','builtin_indexes':SERVICE_PERMISSIONS,'cross_object_bindings':SERVICE_CROSS_OBJECT_BINDINGS,'order_flow_stages':SERVICE_ORDER_FLOW_STAGES,'owner_operations':['bind/unbind\x20the\x20UM\x20Contact','builder\x20(transfer)'],'admin_operations':['update\x20the\x20description'],'permission_index_operations':['set\x20the\x20order_allocators\x20strategy\x20(313)\x20—\x20pre-publish\x20only','publish\x20the\x20Service\x20(311)\x20—\x20requires\x20order_allocators\x20(F-S-18)'],'mutable_after_publish':{'machine':![],'arbitrations':![],'order_allocators':![],'buy_guard':!![],'rewards':'locked_by_duration','compensation_fund_withdraw':'locked_by_duration','compensation_fund_receive':'mutable','sales':!![],'description':!![],'location':!![],'repositories':!![],'customer_required':!![],'discount':!![],'um':!![],'pause':!![]},'publish_prerequisites':['order_allocators\x20MUST\x20be\x20set\x20(F-S-18,\x20E_NO_ALLOCATOR)','Allocators.sharing.who\x20can\x20reference\x20Treasury\x20addresses\x20(indirect\x20Treasury\x20binding)','MAX_SHARING_COUNT\x20=\x20100\x20per\x20allocator'],'common_patterns':['Multi-party\x20split:\x20merchant\x2080%\x20/\x20platform\x2010%\x20/\x20logistics\x2010%','Threshold-based:\x20different\x20allocators\x20for\x20different\x20order\x20sizes','Guard-bound\x20allocator:\x20allocation\x20execution\x20requires\x20Guard\x20verification','Post-publish\x20immutable\x20—\x20clone\x20Service\x20to\x20change\x20allocation\x20strategy'],'recommended_templates':['T-S-08']},{'id':'service_dynamic_pricing','name':'Dynamic\x20Pricing\x20Service\x20(discount-driven)','category':'dynamic_pricing','permission_index_range':'300-320','builtin_indexes':SERVICE_PERMISSIONS,'cross_object_bindings':SERVICE_CROSS_OBJECT_BINDINGS,'order_flow_stages':SERVICE_ORDER_FLOW_STAGES,'owner_operations':['bind/unbind\x20the\x20UM\x20Contact','builder\x20(transfer)'],'admin_operations':['update\x20the\x20description'],'permission_index_operations':['issue\x20discount\x20coupons\x20(312)','add/set\x20sales\x20items\x20(305)\x20—\x20adjust\x20base\x20prices','remove\x20sales\x20items\x20(305)\x20—\x20remove\x20deprecated\x20SKUs'],'mutable_after_publish':{'machine':![],'arbitrations':![],'order_allocators':![],'buy_guard':!![],'rewards':'locked_by_duration','compensation_fund_withdraw':'locked_by_duration','compensation_fund_receive':'mutable','sales':!![],'description':!![],'location':!![],'repositories':!![],'customer_required':!![],'discount':!![],'um':!![],'pause':!![]},'publish_prerequisites':['order_allocators\x20must\x20be\x20set'],'common_patterns':['Discount\x20types:\x200=rates\x20(basis\x20points,\x20per\x2010000),\x201=minus\x20(direct\x20deduction)','MAX_DISCOUNT_COUNT_ONCE\x20=\x201000\x20per\x20issue\x20call','MAX_DISCOUNT_RECEIVER_ONCE\x20=\x201000\x20receivers\x20per\x20call','MAX_DISCOUNT_TOTAL_COUNT\x20=\x2020000\x20total\x20coupons','discount_destroy:\x20holder-only\x20(no\x20SERVICE_DISCOUNT\x20permission\x20needed)'],'recommended_templates':['T-S-07']},{'id':'service_multi_allocator','name':'Multi-Allocator\x20Service\x20(tiered\x20fund\x20distribution)','category':'multi_allocator','permission_index_range':'300-320','builtin_indexes':SERVICE_PERMISSIONS,'cross_object_bindings':SERVICE_CROSS_OBJECT_BINDINGS,'order_flow_stages':SERVICE_ORDER_FLOW_STAGES,'owner_operations':['bind/unbind\x20the\x20UM\x20Contact','builder\x20(transfer)'],'admin_operations':['update\x20the\x20description'],'permission_index_operations':['set\x20the\x20order_allocators\x20strategy\x20(313)\x20—\x20pre-publish\x20only','publish\x20the\x20Service\x20(311)'],'mutable_after_publish':{'machine':![],'arbitrations':![],'order_allocators':![],'buy_guard':!![],'rewards':'locked_by_duration','compensation_fund_withdraw':'locked_by_duration','compensation_fund_receive':'mutable','sales':!![],'description':!![],'location':!![],'repositories':!![],'customer_required':!![],'discount':!![],'um':!![],'pause':!![]},'publish_prerequisites':['order_allocators\x20MUST\x20be\x20set','Each\x20allocator\x20has\x20its\x20own\x20Guard\x20+\x20sharing\x20+\x20threshold','Each\x20allocator\x20is\x20bound\x20to\x20a\x20DIFFERENT\x20guard\x20—\x20the\x20caller\x27s\x20submitted\x20guard\x20selects\x20which\x20path\x20fires'],'common_patterns':['Tier\x201\x20(small\x20orders):\x20single-recipient\x20allocator\x20(low\x20fee)','Tier\x202\x20(medium\x20orders):\x20two-recipient\x20split\x20(merchant\x20+\x20platform)','Tier\x203\x20(large\x20orders):\x20three-recipient\x20split\x20(merchant\x20+\x20platform\x20+\x20logistics)','Each\x20tier\x20can\x20have\x20its\x20own\x20Guard\x20for\x20execution\x20authorization'],'recommended_templates':['T-S-08']}];export const SERVICE_LEDGER_VERSION='1.0.0';export function getScenesByCategory(a){return SERVICE_SCENES['filter'](b=>b['category']===a);}export function findSceneById(a){return SERVICE_SCENES['find'](b=>b['id']===a);}export function getServicePermissionByIndex(a){return SERVICE_PERMISSIONS['find'](b=>b['index']===a);}export function isServicePermission(a){return getServicePermissionByIndex(a)!==undefined;}export function getPermissionsByMutability(a){return SERVICE_PERMISSIONS['filter'](b=>b['post_publish_mutability']===a);}export function getImmutablePostPublishPermissions(){return SERVICE_PERMISSIONS['filter'](a=>a['post_publish_mutability']==='immutable'||a['post_publish_mutability']==='one_shot');}export function getLockedByDurationPermissions(){return SERVICE_PERMISSIONS['filter'](a=>a['post_publish_mutability']==='locked_by_duration');}export function inferSceneFromIntent(a){const b=a['toLowerCase'](),c=[['retail','retail'],['ecommerce','retail'],['rental','rental'],['rent','rental'],['short-term\x20rental','rental'],['long-term\x20rental','rental'],['subscription','subscription'],['subscribe','subscription'],['workflow','workflow'],['machine-bound','workflow'],['arbitration','arbitration'],['dispute','arbitration'],['compensation','compensation_fund'],['compensation_fund','compensation_fund'],['reward','reward'],['marketing','reward'],['buy_guard','buy_guard'],['kyc','buy_guard'],['whitelist','buy_guard'],['allocator','order_allocator'],['discount','dynamic_pricing'],['coupon','dynamic_pricing'],['multi-allocator','multi_allocator'],['tiered','multi_allocator']];for(const [d,e]of c){if(b['includes'](d)){const f=getScenesByCategory(e);if(f['length']>0x0)return f[0x0];}}if(b['includes']('service'))return findSceneById('service_retail');return undefined;}export function getAllServiceScenes(){return[...SERVICE_SCENES];}export function getServiceScenesCount(){return SERVICE_SCENES['length'];}export function getServicePermissionsCount(){return SERVICE_PERMISSIONS['length'];}export function getOrderFlowStage(a){return SERVICE_ORDER_FLOW_STAGES['find'](b=>b['stage']===a);}export function getCrossObjectBindings(){return[...SERVICE_CROSS_OBJECT_BINDINGS];}