@wowok/agent-mcp 3.3.6 → 3.3.8

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 (220) hide show
  1. package/dist/chain-semantics/eval-order.js +1 -1
  2. package/dist/chain-semantics/field-capability.js +1 -1
  3. package/dist/chain-semantics/fund-flow.js +1 -1
  4. package/dist/chain-semantics/guard-verbs.js +1 -1
  5. package/dist/chain-semantics/object-graph.js +1 -1
  6. package/dist/communication/message-cursors.d.ts +35 -0
  7. package/dist/communication/message-cursors.js +1 -0
  8. package/dist/communication/wts-attestation.d.ts +5 -0
  9. package/dist/communication/wts-attestation.js +1 -1
  10. package/dist/composition/audit.js +1 -1
  11. package/dist/composition/compile.d.ts +3 -2
  12. package/dist/composition/compile.js +1 -1
  13. package/dist/composition/inflight.d.ts +7 -0
  14. package/dist/composition/inflight.js +1 -1
  15. package/dist/composition/materialize.d.ts +4 -1
  16. package/dist/composition/materialize.js +1 -1
  17. package/dist/config/index.d.ts +1 -0
  18. package/dist/config/index.js +1 -1
  19. package/dist/config/store-policy.d.ts +14 -0
  20. package/dist/config/store-policy.js +1 -0
  21. package/dist/config/store-policy.spec.d.ts +1 -0
  22. package/dist/config/store-policy.spec.js +1 -0
  23. package/dist/customer/industry-risks.js +1 -1
  24. package/dist/customer/user-preferences.js +1 -1
  25. package/dist/data/projection/facets.spec.js +1 -1
  26. package/dist/evaluation/builtins/graph-service.spec.js +1 -1
  27. package/dist/evaluation/engine.js +1 -1
  28. package/dist/evaluation/match-policy.d.ts +30 -6
  29. package/dist/evaluation/match-policy.js +1 -1
  30. package/dist/evaluation/match-policy.spec.js +1 -1
  31. package/dist/experience/realtime-feedback.js +1 -1
  32. package/dist/extensions/business-modules.d.ts +1 -1
  33. package/dist/extensions/business-modules.js +1 -1
  34. package/dist/extensions/industry-pack.js +1 -1
  35. package/dist/extensions/modes.js +1 -1
  36. package/dist/graph/onchain/analyze.js +1 -1
  37. package/dist/graph/onchain/expand.js +1 -1
  38. package/dist/graph/onchain/exposure.js +1 -1
  39. package/dist/graph/onchain/facts.d.ts +1 -0
  40. package/dist/graph/onchain/facts.js +1 -1
  41. package/dist/graph/onchain/facts.spec.js +1 -1
  42. package/dist/harness/recover.js +1 -1
  43. package/dist/intent/types.d.ts +1 -1
  44. package/dist/intent/types.js +1 -1
  45. package/dist/keeper/detectors.d.ts +3 -0
  46. package/dist/keeper/detectors.js +1 -1
  47. package/dist/keeper/keeper.spec.js +1 -1
  48. package/dist/knowledge/acquisition-flywheel.js +1 -1
  49. package/dist/knowledge/allocation-ledger.d.ts +1 -0
  50. package/dist/knowledge/allocation-ledger.js +1 -1
  51. package/dist/knowledge/allocator-rail-verifier.d.ts +6 -2
  52. package/dist/knowledge/allocator-rail-verifier.js +1 -1
  53. package/dist/knowledge/arbitration-ledger.js +1 -1
  54. package/dist/knowledge/audit-rules.d.ts +37 -0
  55. package/dist/knowledge/audit-rules.js +1 -1
  56. package/dist/knowledge/baselines/rules/plan.json +128 -3
  57. package/dist/knowledge/builtin-templates.d.ts +18 -1
  58. package/dist/knowledge/builtin-templates.js +1 -1
  59. package/dist/knowledge/commission-landing.d.ts +26 -0
  60. package/dist/knowledge/commission-landing.js +1 -0
  61. package/dist/knowledge/discount-threshold.js +1 -1
  62. package/dist/knowledge/event-semantics.js +1 -1
  63. package/dist/knowledge/fund-layer.d.ts +7 -0
  64. package/dist/knowledge/fund-layer.js +1 -1
  65. package/dist/knowledge/getting-started.js +1 -1
  66. package/dist/knowledge/guard-design-patterns.d.ts +1 -1
  67. package/dist/knowledge/guard-design-patterns.js +1 -1
  68. package/dist/knowledge/guard-puzzle.js +1 -1
  69. package/dist/knowledge/guard-render.d.ts +7 -0
  70. package/dist/knowledge/guard-render.js +1 -1
  71. package/dist/knowledge/guard-risk.js +1 -1
  72. package/dist/knowledge/guard-templates.d.ts +1 -1
  73. package/dist/knowledge/guard-templates.js +1 -1
  74. package/dist/knowledge/guard-translation.js +1 -1
  75. package/dist/knowledge/index.js +1 -1
  76. package/dist/knowledge/industry-generalizer.d.ts +4 -0
  77. package/dist/knowledge/industry-generalizer.js +1 -1
  78. package/dist/knowledge/industry-registry.d.ts +1 -1
  79. package/dist/knowledge/industry-registry.js +1 -1
  80. package/dist/knowledge/industry-strategy.js +1 -1
  81. package/dist/knowledge/jsonrpc-enum.js +1 -1
  82. package/dist/knowledge/machine-fork-watch.d.ts +9 -0
  83. package/dist/knowledge/machine-fork-watch.js +1 -0
  84. package/dist/knowledge/migration-preflight.js +1 -1
  85. package/dist/knowledge/projection.spec.js +1 -1
  86. package/dist/knowledge/scenario-modes.d.ts +8 -2
  87. package/dist/knowledge/scenario-modes.js +1 -1
  88. package/dist/knowledge/semantic-ir.d.ts +132 -0
  89. package/dist/knowledge/semantic-ir.js +1 -0
  90. package/dist/knowledge/service-ledger.js +1 -1
  91. package/dist/knowledge/strategy-manuals.js +1 -1
  92. package/dist/knowledge/template-index.js +1 -1
  93. package/dist/knowledge/template-loader.d.ts +45 -0
  94. package/dist/knowledge/template-loader.js +1 -1
  95. package/dist/knowledge/template-prose.d.ts +50 -0
  96. package/dist/knowledge/template-prose.js +1 -0
  97. package/dist/knowledge/template-registry.js +1 -1
  98. package/dist/knowledge/template-scanner.d.ts +5 -3
  99. package/dist/knowledge/template-scanner.js +1 -1
  100. package/dist/knowledge/template-validation.js +1 -1
  101. package/dist/knowledge/tools-reference.js +1 -1
  102. package/dist/monitor/MonitorLoop.js +1 -1
  103. package/dist/monitor/normalize.d.ts +1 -1
  104. package/dist/monitor/normalize.js +1 -1
  105. package/dist/monitor/types.js +1 -1
  106. package/dist/playbooks/service-build/business-puzzle.js +1 -1
  107. package/dist/playbooks/service-build/machine-panorama.js +1 -1
  108. package/dist/playbooks/service-build/merchant-guide.d.ts +16 -6
  109. package/dist/playbooks/service-build/merchant-guide.js +1 -1
  110. package/dist/playbooks/service-build/migration-planner.d.ts +11 -2
  111. package/dist/playbooks/service-build/migration-planner.js +1 -1
  112. package/dist/playbooks/service-build/mode-actions.d.ts +8 -0
  113. package/dist/playbooks/service-build/mode-actions.js +1 -1
  114. package/dist/playbooks/service-build/object-panorama.d.ts +22 -1
  115. package/dist/playbooks/service-build/object-panorama.js +1 -1
  116. package/dist/playbooks/service-build/participation-radar.js +1 -1
  117. package/dist/playbooks/service-build/relationship-profile.js +1 -1
  118. package/dist/playbooks/service-build/reverse-mapping-nk4.spec.js +1 -1
  119. package/dist/playbooks/service-build/reverse-mapping.d.ts +1 -0
  120. package/dist/playbooks/service-build/reverse-mapping.js +1 -1
  121. package/dist/playbooks/service-build/service-panorama.js +1 -1
  122. package/dist/playbooks/service-build/service-quote.js +1 -1
  123. package/dist/playbooks/service-build/service-quote.spec.js +1 -1
  124. package/dist/review/index.js +1 -1
  125. package/dist/safety/confirm-gate.js +1 -1
  126. package/dist/schema/benchmark-migration/index.d.ts +135 -10
  127. package/dist/schema/benchmark-migration/index.js +1 -1
  128. package/dist/schema/call/allocation.d.ts +3 -0
  129. package/dist/schema/call/allocation.js +1 -1
  130. package/dist/schema/call/arbitration.js +1 -1
  131. package/dist/schema/call/base.d.ts +32 -0
  132. package/dist/schema/call/bridge.d.ts +8 -0
  133. package/dist/schema/call/error-codes.d.ts +1 -1
  134. package/dist/schema/call/error-codes.js +1 -1
  135. package/dist/schema/call/order.js +1 -1
  136. package/dist/schema/call/reward.d.ts +10 -0
  137. package/dist/schema/call/reward.js +1 -1
  138. package/dist/schema/call/semantic.js +1 -1
  139. package/dist/schema/call/service.js +1 -1
  140. package/dist/schema/common/index.js +1 -1
  141. package/dist/schema/config/index.d.ts +24 -0
  142. package/dist/schema/config/index.js +1 -1
  143. package/dist/schema/evaluation/index.d.ts +152 -0
  144. package/dist/schema/evaluation/index.js +1 -1
  145. package/dist/schema/goal/index.d.ts +16 -0
  146. package/dist/schema/goal/planning.d.ts +29 -0
  147. package/dist/schema/goal/planning.js +1 -1
  148. package/dist/schema/industry-pack/index.d.ts +70 -0
  149. package/dist/schema/industry-pack/modes.d.ts +70 -0
  150. package/dist/schema/industry-pack/modes.js +1 -1
  151. package/dist/schema/intent-radar/index.d.ts +3 -0
  152. package/dist/schema/intent-radar/index.js +1 -1
  153. package/dist/schema/local/index.d.ts +80 -0
  154. package/dist/schema/local/index.js +1 -1
  155. package/dist/schema/messenger/index.d.ts +278 -1
  156. package/dist/schema/messenger/index.js +1 -1
  157. package/dist/schema/operations.d.ts +6 -0
  158. package/dist/schema/query/bi.d.ts +38 -0
  159. package/dist/schema/query/bi.js +1 -1
  160. package/dist/schema/query/index.d.ts +148 -47
  161. package/dist/schema/query/index.js +1 -1
  162. package/dist/schema/schema-version.js +1 -1
  163. package/dist/schema/service-clone/index.d.ts +17 -0
  164. package/dist/schema/service-clone/index.js +1 -1
  165. package/dist/schema-query-impl/index.js +1 -1
  166. package/dist/schemas/account_operation.output.json +8 -0
  167. package/dist/schemas/benchmark_migration_operation.output.json +296 -2
  168. package/dist/schemas/benchmark_migration_operation.schema.json +292 -7
  169. package/dist/schemas/bridge_operation.output.json +8 -0
  170. package/dist/schemas/config_operation.output.json +95 -0
  171. package/dist/schemas/config_operation.schema.json +16 -1
  172. package/dist/schemas/evaluation_operation.output.json +240 -0
  173. package/dist/schemas/evaluation_operation.schema.json +397 -1
  174. package/dist/schemas/goal_operation.schema.json +40 -10
  175. package/dist/schemas/index.json +1 -1
  176. package/dist/schemas/industry_pack_operation.output.json +90 -2
  177. package/dist/schemas/industry_pack_operation.schema.json +236 -0
  178. package/dist/schemas/intent_radar.output.json +2 -0
  179. package/dist/schemas/intent_radar.schema.json +1 -0
  180. package/dist/schemas/local_cache_operation.output.json +8 -0
  181. package/dist/schemas/local_history_operation.output.json +8 -0
  182. package/dist/schemas/local_info_operation.output.json +8 -0
  183. package/dist/schemas/local_mark_operation.output.json +8 -0
  184. package/dist/schemas/messenger_operation.output.json +609 -1
  185. package/dist/schemas/messenger_operation.schema.json +96 -1
  186. package/dist/schemas/onchain_events.output.json +281 -11
  187. package/dist/schemas/onchain_events.schema.json +5 -1
  188. package/dist/schemas/onchain_operations.output.json +8 -0
  189. package/dist/schemas/onchain_operations.schema.json +371 -10
  190. package/dist/schemas/onchain_operations_allocation.schema.json +10 -1
  191. package/dist/schemas/onchain_operations_arbitration.schema.json +1 -1
  192. package/dist/schemas/onchain_operations_guard.schema.json +318 -0
  193. package/dist/schemas/onchain_operations_order.schema.json +1 -1
  194. package/dist/schemas/onchain_operations_reward.schema.json +35 -1
  195. package/dist/schemas/onchain_operations_service.schema.json +6 -6
  196. package/dist/schemas/query_toolkit.output.json +305 -8
  197. package/dist/schemas/service_clone_operation.output.json +79 -0
  198. package/dist/tools/handlers/benchmark-migration.d.ts +15 -0
  199. package/dist/tools/handlers/benchmark-migration.js +1 -1
  200. package/dist/tools/handlers/config.js +1 -1
  201. package/dist/tools/handlers/evaluation.js +1 -1
  202. package/dist/tools/handlers/evaluation.spec.js +1 -1
  203. package/dist/tools/handlers/intent-radar.js +1 -1
  204. package/dist/tools/handlers/messenger.d.ts +1 -0
  205. package/dist/tools/handlers/messenger.js +1 -1
  206. package/dist/tools/handlers/onchain.d.ts +20 -1
  207. package/dist/tools/handlers/onchain.js +1 -1
  208. package/dist/tools/handlers/query.d.ts +1 -0
  209. package/dist/tools/handlers/query.js +1 -1
  210. package/dist/tools/handlers/service-clone.d.ts +18 -0
  211. package/dist/tools/handlers/service-clone.js +1 -1
  212. package/dist/tools/handlers/wip.js +1 -1
  213. package/dist/tools/registry/agent.js +1 -1
  214. package/dist/tools/registry/business.js +1 -1
  215. package/dist/tools/registry/query.js +1 -1
  216. package/dist/tools/wip-verify-ledger.d.ts +14 -0
  217. package/dist/tools/wip-verify-ledger.js +1 -0
  218. package/dist/tools/wrap.d.ts +4 -0
  219. package/dist/tools/wrap.js +1 -1
  220. package/package.json +2 -2
@@ -1 +1 @@
1
- import{createHash}from'node:crypto';export const POLICY_WEIGHT_RULE_IDS=['region','industry','price','trust','capabilities','tags','acceptance'];export const PRESET_MATCH_POLICIES={'default':{'policy_id':'default','version':0x1,'unknown_policy':'neutral_score'},'retail':{'policy_id':'retail','version':0x1,'unknown_policy':'neutral_score','gates':[{'dim':'live','op':'eq','value':!![]}],'weights':{'region':0xa,'industry':0xf,'price':0x19,'trust':0xf,'capabilities':0x1e,'tags':0x5}},'life_service':{'policy_id':'life_service','version':0x1,'unknown_policy':'neutral_score','gates':[{'dim':'live','op':'eq','value':!![]}],'weights':{'region':0x14,'industry':0xf,'price':0xa,'trust':0x19,'capabilities':0x19,'tags':0x5}},'trust_first':{'policy_id':'trust_first','version':0x1,'unknown_policy':'drop','gates':[{'dim':'live','op':'eq','value':!![]},{'dim':'arb','op':'gte','value':0x1}],'weights':{'trust':0x1e,'capabilities':0x19,'region':0xa,'industry':0xa,'price':0xa,'tags':0x5}},'cross_border':{'policy_id':'cross_border','version':0x1,'unknown_policy':'neutral_score','gates':[{'dim':'live','op':'eq','value':!![]},{'dim':'wip_verify','op':'eq','value':!![]}],'weights':{'capabilities':0x19,'trust':0x14,'industry':0x14,'tags':0xf,'price':0xf,'region':0x5}},'cheap_and_fast':{'policy_id':'cheap_and_fast','version':0x1,'unknown_policy':'drop','gates':[{'dim':'price','op':'lte','params':{'from_budget':!![],'hard':!![]}}],'weights':{'price':0x23,'trust':0xf,'capabilities':0xf,'region':0xa,'industry':0xa,'tags':0x5}},'enterprise':{'policy_id':'enterprise','version':0x1,'unknown_policy':'drop','gates':[{'dim':'live','op':'eq','value':!![]},{'dim':'machine','op':'eq','value':!![]},{'dim':'buy_guard','op':'eq','value':!![]}],'weights':{'capabilities':0x1e,'trust':0x19,'industry':0xf,'acceptance':0xa,'price':0xa,'region':0x5,'tags':0x5}},'supplier_hunting':{'policy_id':'supplier_hunting','version':0x1,'direction':'supply_to_demand','unknown_policy':'neutral_score'}};function normalizePresetId(a){return a['trim']()['toLowerCase']()['replace'](/-/g,'_');}export function resolveMatchPolicy(a,b){if(a===undefined)return undefined;let c;if(typeof a==='string'){const e=PRESET_MATCH_POLICIES[normalizePresetId(a)];if(!e)throw new Error('unknown\x20match_policy\x20preset\x20\x27'+a+'\x27\x20—\x20available:\x20'+Object['keys'](PRESET_MATCH_POLICIES)['join'](',\x20')+'\x20(or\x20pass\x20an\x20inline\x20policy\x20object)');c=e;}else{if(typeof a!=='object'||a===null||typeof a['policy_id']!=='string'||a['policy_id']['length']===0x0)throw new Error('inline\x20match_policy\x20must\x20be\x20an\x20object\x20with\x20a\x20non-empty\x20string\x20policy_id');c=a;}const d=c['direction']??'demand_to_supply';if(d!==b)throw new Error('match_policy\x20\x27'+c['policy_id']+'\x27\x20has\x20direction\x20\x27'+d+'\x27\x20and\x20cannot\x20drive\x20a\x20\x27'+b+'\x27\x20query');return c;}function bigIntValue(a){if(typeof a==='bigint')return a;if(typeof a==='number'&&Number['isInteger'](a))return BigInt(a);if(typeof a==='string'&&/^-?\d+$/['test'](a['trim']()))return BigInt(a['trim']());return undefined;}function asStringArray(a){if(Array['isArray'](a))return a['map'](String);if(typeof a==='string')return[a];return undefined;}function minSalePrice(a){if(!a['sales']||a['sales']['length']===0x0)return undefined;let b;for(const c of a['sales']){const d=bigIntValue(c['price']);if(d===undefined)continue;if(b===undefined||d<b)b=d;}return b;}function evalGate(a,b,c){const d=a['op']??'eq';switch(a['dim']){case'live':{const e=a['value']===undefined?!![]:Boolean(a['value']);if(b['bPublished']===undefined&&b['bPaused']===undefined)return{'dim':a['dim'],'status':'unknown','reason':'published/paused\x20flags\x20absent\x20from\x20candidate\x20payload'};const f=(b['bPublished']??![])&&!(b['bPaused']??![]);return f===e?{'dim':a['dim'],'status':'satisfied','reason':'live='+f}:{'dim':a['dim'],'status':'violated','reason':'live='+f+',\x20gate\x20requires\x20'+e};}case'price':{if(d!=='lte'&&d!=='gte')return null;let g=bigIntValue(a['value']);if(g===undefined&&a['params']?.['from_budget']===!![])g=c['budgetWei'];if(g===undefined)return{'dim':a['dim'],'status':'unknown','reason':'no\x20gate\x20value\x20and\x20no\x20request\x20budget\x20to\x20bind\x20from_budget'};const h=minSalePrice(b);if(h===undefined)return{'dim':a['dim'],'status':'unknown','reason':'candidate\x20exposes\x20no\x20sale\x20price'};const i=d==='lte'?h<=g:h>=g;return i?{'dim':a['dim'],'status':'satisfied','reason':'price_min\x20'+h+'\x20'+d+'\x20'+g}:{'dim':a['dim'],'status':'violated','reason':'price_min\x20'+h+'\x20fails\x20'+d+'\x20'+g};}case'arb':{if(d!=='gte')return null;const j=bigIntValue(a['value']);if(j===undefined)return null;if(!b['arbitrations'])return{'dim':a['dim'],'status':'unknown','reason':'arbitration\x20list\x20absent\x20from\x20candidate\x20payload'};const k=BigInt(b['arbitrations']['length'])>=j;return k?{'dim':a['dim'],'status':'satisfied','reason':'arb_count\x20'+b['arbitrations']['length']+'\x20>=\x20'+j}:{'dim':a['dim'],'status':'violated','reason':'arb_count\x20'+b['arbitrations']['length']+'\x20<\x20'+j};}case'compensation':{if(d!=='gte')return null;const l=bigIntValue(a['value']);if(l===undefined)return null;const m=bigIntValue(b['compensation_fund']);if(m===undefined)return{'dim':a['dim'],'status':'unknown','reason':'compensation_fund\x20absent\x20from\x20candidate\x20payload'};return m>=l?{'dim':a['dim'],'status':'satisfied','reason':'compensation_fund\x20'+m+'\x20>=\x20'+l}:{'dim':a['dim'],'status':'violated','reason':'compensation_fund\x20'+m+'\x20<\x20'+l};}case'machine':case'messenger':case'buy_guard':{const n=a['value']===undefined?!![]:Boolean(a['value']),o=a['dim']==='machine'?b['machine']:a['dim']==='messenger'?b['um']:b['buy_guard'];if(o===undefined)return{'dim':a['dim'],'status':'unknown','reason':a['dim']+'\x20binding\x20absent\x20from\x20candidate\x20payload'};const p=o!==null;return p===n?{'dim':a['dim'],'status':'satisfied','reason':a['dim']+'\x20bound='+p}:{'dim':a['dim'],'status':'violated','reason':a['dim']+'\x20bound='+p+',\x20gate\x20requires\x20'+n};}case'wip_verify':{const q=a['value']===undefined?!![]:Boolean(a['value']);if(!b['sales'])return{'dim':a['dim'],'status':'unknown','reason':'sales\x20absent\x20from\x20candidate\x20payload'};const r=b['sales']['some'](t=>typeof t['wip_hash']==='string'&&t['wip_hash']['length']>0x0);return r===q?{'dim':a['dim'],'status':'satisfied','reason':'has_wip_verification='+r}:{'dim':a['dim'],'status':'violated','reason':'has_wip_verification='+r+',\x20gate\x20requires\x20'+q};}case'text':{if(d!=='must_contain'&&d!=='must_not_contain')return null;const t=asStringArray(a['value']);if(!t||t['length']===0x0)return null;const u=[b['description']??'',...(b['sales']??[])['map'](w=>w['name']??'')]['join']('\x20')['toLowerCase']();if(u['trim']()['length']===0x0)return{'dim':a['dim'],'status':'unknown','reason':'candidate\x20carries\x20no\x20text\x20to\x20match'};if(d==='must_contain'){const w=t['filter'](x=>!u['includes'](x['toLowerCase']()));return w['length']===0x0?{'dim':a['dim'],'status':'satisfied','reason':'all\x20'+t['length']+'\x20term(s)\x20present'}:{'dim':a['dim'],'status':'violated','reason':'missing\x20term(s):\x20'+w['join'](',\x20')};}const v=t['filter'](x=>u['includes'](x['toLowerCase']()));return v['length']===0x0?{'dim':a['dim'],'status':'satisfied','reason':'no\x20forbidden\x20term\x20present'}:{'dim':a['dim'],'status':'violated','reason':'forbidden\x20term(s)\x20present:\x20'+v['join'](',\x20')};}case'owner':{if(d!=='in'&&d!=='not_in')return null;const x=asStringArray(a['value']);if(!x)return null;if(b['owner']===undefined)return{'dim':a['dim'],'status':'unknown','reason':'owner\x20absent\x20from\x20candidate\x20payload'};const y=x['includes'](b['owner']),z=d==='in'?y:!y;return z?{'dim':a['dim'],'status':'satisfied','reason':'owner\x20'+d+'\x20list'}:{'dim':a['dim'],'status':'violated','reason':'owner\x20fails\x20'+d+'\x20list'};}default:return null;}}export function applyPolicyGates(a,b,d={}){const e=a['unknown_policy']??'neutral_score',f=new Set(),g=[],h=[],i=[],j={'object':'','description':'','location':''};for(const m of a['gates']??[]){evalGate(m,j,d)===null&&f['add']('gate\x20dim\x20\x27'+m['dim']+'\x27\x20(op\x20\x27'+(m['op']??'eq')+'\x27)\x20not\x20enforceable\x20client-side');}const k=new Set(),l=new Set();for(const n of a['excludes']??[]){if(n['dim']==='blacklist'){for(const p of n['objects']??[])k['add'](p);for(const q of n['owners']??[])l['add'](q);}else f['add']('exclude\x20dim\x20\x27'+n['dim']+'\x27\x20not\x20enforceable\x20client-side\x20(no\x20local\x20facet)');}for(const r of b){if(k['has'](r['object'])){h['push']({'object':r['object'],'reason':'excluded:\x20blacklisted\x20object'});continue;}if(r['owner']!==undefined&&l['has'](r['owner'])){h['push']({'object':r['object'],'reason':'excluded:\x20blacklisted\x20owner'});continue;}let s=!![];for(const t of a['gates']??[]){const u=evalGate(t,r,d);if(u===null){f['add']('gate\x20dim\x20\x27'+t['dim']+'\x27\x20(op\x20\x27'+(t['op']??'eq')+'\x27)\x20not\x20enforceable\x20client-side');continue;}if(u['status']==='violated'){h['push']({'object':r['object'],'reason':'gate\x20'+u['dim']+':\x20'+u['reason']}),s=![];break;}if(u['status']==='unknown'){if(e==='drop'){h['push']({'object':r['object'],'reason':'gate\x20'+u['dim']+'\x20unknown\x20('+u['reason']+')\x20and\x20unknown_policy=drop'}),s=![];break;}i['push']({'object':r['object'],'dim':u['dim'],'reason':u['reason']});}}if(s)g['push'](r);}return{'passed':g,'dropped':h,'unknown_notes':i,'ignored':[...f]['sort']()};}export function policyToInjection(a){const b={},c=[],d=new Set(POLICY_WEIGHT_RULE_IDS);for(const [e,f]of Object['entries'](a['weights']??{})){if(d['has'](e))b[e]=f;else c['push']('weight\x20on\x20unregistered\x20rule\x20\x27'+e+'\x27\x20ignored\x20(client\x20engine\x20has:\x20'+POLICY_WEIGHT_RULE_IDS['join'](',\x20')+')');}return{'injection':{'overrides':{'rules':Object['fromEntries'](Object['entries'](b)['map'](([g,h])=>[g,{'weight':h}]))}},'applied':b,'ignored':c['sort']()};}export function applyPolicyRerank(a,b){const c=[],d=[...a]['sort']((k,l)=>l['result']['total']-k['result']['total']||k['service']['object']['localeCompare'](l['service']['object']));let e=d,f=![],g=0x0;const h=b['rerank']?.['diversity'];if(h){if(h['by']==='permission')c['push']('rerank.diversity\x20by\x20\x27permission\x27\x20not\x20enforceable\x20client-side\x20(no\x20permission\x20facet\x20on\x20candidates);\x20use\x20\x27owner\x27');else{const k=new Map(),l=[],n=[];for(const o of e){const p=o['service']['owner'];if(p===undefined){l['push'](o);continue;}const q=k['get'](p)??0x0;q<h['max_per_group']?(k['set'](p,q+0x1),l['push'](o)):n['push'](o);}e=[...l,...n],f=!![],g=n['length'];}}if(b['rerank']?.['explore']!==undefined)c['push']('rerank.explore\x20not\x20enforceable\x20in\x20this\x20build\x20(no\x20local\x20bandit\x20state)');if(b['rerank']?.['llm']!==undefined)c['push']('rerank.llm\x20not\x20enforceable\x20in\x20this\x20build\x20(deterministic\x20kernel\x20only)');if(b['rerank']?.['fairness']!==undefined)c['push']('rerank.fairness\x20not\x20enforceable\x20in\x20this\x20build\x20(no\x20exposure\x20accounting)');const i=b['output']?.['top_n'],j=i!==undefined?e['slice'](0x0,i):e;return{'matches':j,'order':'total\x20DESC,\x20object_id\x20ASC'+(f?',\x20diversity(owner)<='+h['max_per_group']:''),'diversity_applied':f,'deferred':g,'ignored':c['sort']()};}function canonicalize(a){if(Array['isArray'](a))return a['map'](canonicalize);if(a&&typeof a==='object'){const b={};for(const c of Object['keys'](a)['sort']()){b[c]=canonicalize(a[c]);}return b;}return a;}export function policyHash(a){return createHash('sha256')['update'](JSON['stringify'](canonicalize(a)))['digest']('hex');}export function buildPolicyEffect(a,b,c,d,e=[]){const f=[...new Set([...b['ignored'],...c['ignored'],...d['ignored'],...e])]['sort']();if(a['recall']!==undefined)f['push']('section\x20\x27recall\x27\x20is\x20a\x20server-side\x20directive\x20—\x20not\x20sent\x20upstream\x20from\x20a\x20private\x20policy;\x20recall\x20stays\x20on\x20the\x20route\x20in\x20effect');if(a['verify']!==undefined)f['push']('section\x20\x27verify\x27\x20not\x20enforceable\x20client-side\x20in\x20this\x20build');return{'policy_id':a['policy_id'],'version':a['version'],'direction':a['direction']??'demand_to_supply','policy_hash':policyHash(a),'unknown_policy':a['unknown_policy']??'neutral_score','dropped':b['dropped'],'unknown_kept':b['unknown_notes'],'weights_applied':c['applied'],'rerank':d['order'],'deferred_by_diversity':d['deferred'],'ignored':f['sort'](),'privacy':'client_side_only\x20—\x20the\x20policy\x20and\x20its\x20hash\x20never\x20leave\x20this\x20device'};}
1
+ import{createHash}from'node:crypto';export const POLICY_WEIGHT_RULE_IDS=['region','industry','price','trust','capabilities','tags','acceptance'];export const PRESET_MATCH_POLICIES={'default':{'policy_id':'default','version':0x1,'unknown_policy':'neutral_score'},'retail':{'policy_id':'retail','version':0x1,'unknown_policy':'neutral_score','gates':[{'dim':'live','op':'eq','value':!![]}],'weights':{'region':0xa,'industry':0xf,'price':0x19,'trust':0xf,'capabilities':0x1e,'tags':0x5}},'life_service':{'policy_id':'life_service','version':0x1,'unknown_policy':'neutral_score','gates':[{'dim':'live','op':'eq','value':!![]}],'weights':{'region':0x14,'industry':0xf,'price':0xa,'trust':0x19,'capabilities':0x19,'tags':0x5}},'trust_first':{'policy_id':'trust_first','version':0x1,'unknown_policy':'drop','gates':[{'dim':'live','op':'eq','value':!![]},{'dim':'arb','op':'gte','value':0x1}],'weights':{'trust':0x1e,'capabilities':0x19,'region':0xa,'industry':0xa,'price':0xa,'tags':0x5}},'cross_border':{'policy_id':'cross_border','version':0x1,'unknown_policy':'neutral_score','gates':[{'dim':'live','op':'eq','value':!![]},{'dim':'wip_verify','op':'eq','value':!![]}],'weights':{'capabilities':0x19,'trust':0x14,'industry':0x14,'tags':0xf,'price':0xf,'region':0x5}},'cheap_and_fast':{'policy_id':'cheap_and_fast','version':0x1,'unknown_policy':'drop','gates':[{'dim':'price','op':'lte','params':{'from_budget':!![],'hard':!![]}}],'weights':{'price':0x23,'trust':0xf,'capabilities':0xf,'region':0xa,'industry':0xa,'tags':0x5}},'enterprise':{'policy_id':'enterprise','version':0x1,'unknown_policy':'drop','gates':[{'dim':'live','op':'eq','value':!![]},{'dim':'machine','op':'eq','value':!![]},{'dim':'buy_guard','op':'eq','value':!![]}],'weights':{'capabilities':0x1e,'trust':0x19,'industry':0xf,'acceptance':0xa,'price':0xa,'region':0x5,'tags':0x5}},'supplier_hunting':{'policy_id':'supplier_hunting','version':0x1,'direction':'supply_to_demand','unknown_policy':'neutral_score'}};function normalizePresetId(a){return a['trim']()['toLowerCase']()['replace'](/-/g,'_');}export function resolveMatchPolicy(a,b){if(a===undefined)return undefined;let c;if(typeof a==='string'){const e=PRESET_MATCH_POLICIES[normalizePresetId(a)];if(!e)throw new Error('unknown\x20match_policy\x20preset\x20\x27'+a+'\x27\x20—\x20available:\x20'+Object['keys'](PRESET_MATCH_POLICIES)['join'](',\x20')+'\x20(or\x20pass\x20an\x20inline\x20policy\x20object)');c=e;}else{if(typeof a!=='object'||a===null||typeof a['policy_id']!=='string'||a['policy_id']['length']===0x0)throw new Error('inline\x20match_policy\x20must\x20be\x20an\x20object\x20with\x20a\x20non-empty\x20string\x20policy_id');c=a;}const d=c['direction']??'demand_to_supply';if(d!==b)throw new Error('match_policy\x20\x27'+c['policy_id']+'\x27\x20has\x20direction\x20\x27'+d+'\x27\x20and\x20cannot\x20drive\x20a\x20\x27'+b+'\x27\x20query');return c;}function bigIntValue(a){if(typeof a==='bigint')return a;if(typeof a==='number'&&Number['isInteger'](a))return BigInt(a);if(typeof a==='string'&&/^-?\d+$/['test'](a['trim']()))return BigInt(a['trim']());return undefined;}function asStringArray(a){if(Array['isArray'](a))return a['map'](String);if(typeof a==='string')return[a];return undefined;}function minSalePrice(a){if(!a['sales']||a['sales']['length']===0x0)return undefined;let b;for(const c of a['sales']){const d=bigIntValue(c['price']);if(d===undefined)continue;if(b===undefined||d<b)b=d;}return b;}function evalGate(a,b,c){const d=a['op']??'eq';switch(a['dim']){case'live':{const e=a['value']===undefined?!![]:Boolean(a['value']);if(b['bPublished']===undefined&&b['bPaused']===undefined)return{'dim':a['dim'],'status':'unknown','reason':'published/paused\x20flags\x20absent\x20from\x20candidate\x20payload'};const f=(b['bPublished']??![])&&!(b['bPaused']??![]);return f===e?{'dim':a['dim'],'status':'satisfied','reason':'live='+f}:{'dim':a['dim'],'status':'violated','reason':'live='+f+',\x20gate\x20requires\x20'+e};}case'price':{if(d!=='lte'&&d!=='gte')return null;let g=bigIntValue(a['value']);if(g===undefined&&a['params']?.['from_budget']===!![])g=c['budgetWei'];if(g===undefined)return{'dim':a['dim'],'status':'unknown','reason':'no\x20gate\x20value\x20and\x20no\x20request\x20budget\x20to\x20bind\x20from_budget'};const h=minSalePrice(b);if(h===undefined)return{'dim':a['dim'],'status':'unknown','reason':'candidate\x20exposes\x20no\x20sale\x20price'};const i=d==='lte'?h<=g:h>=g;return i?{'dim':a['dim'],'status':'satisfied','reason':'price_min\x20'+h+'\x20'+d+'\x20'+g}:{'dim':a['dim'],'status':'violated','reason':'price_min\x20'+h+'\x20fails\x20'+d+'\x20'+g};}case'arb':{if(d!=='gte')return null;const j=bigIntValue(a['value']);if(j===undefined)return null;if(!b['arbitrations'])return{'dim':a['dim'],'status':'unknown','reason':'arbitration\x20list\x20absent\x20from\x20candidate\x20payload'};const k=BigInt(b['arbitrations']['length'])>=j;return k?{'dim':a['dim'],'status':'satisfied','reason':'arb_count\x20'+b['arbitrations']['length']+'\x20>=\x20'+j}:{'dim':a['dim'],'status':'violated','reason':'arb_count\x20'+b['arbitrations']['length']+'\x20<\x20'+j};}case'compensation':{if(d!=='gte')return null;const l=bigIntValue(a['value']);if(l===undefined)return null;const m=bigIntValue(b['compensation_fund']);if(m===undefined)return{'dim':a['dim'],'status':'unknown','reason':'compensation_fund\x20absent\x20from\x20candidate\x20payload'};return m>=l?{'dim':a['dim'],'status':'satisfied','reason':'compensation_fund\x20'+m+'\x20>=\x20'+l}:{'dim':a['dim'],'status':'violated','reason':'compensation_fund\x20'+m+'\x20<\x20'+l};}case'machine':case'messenger':case'buy_guard':{const n=a['value']===undefined?!![]:Boolean(a['value']),o=a['dim']==='machine'?b['machine']:a['dim']==='messenger'?b['um']:b['buy_guard'];if(o===undefined)return{'dim':a['dim'],'status':'unknown','reason':a['dim']+'\x20binding\x20absent\x20from\x20candidate\x20payload'};const p=o!==null;return p===n?{'dim':a['dim'],'status':'satisfied','reason':a['dim']+'\x20bound='+p}:{'dim':a['dim'],'status':'violated','reason':a['dim']+'\x20bound='+p+',\x20gate\x20requires\x20'+n};}case'wip_verify':{const q=a['value']===undefined?!![]:Boolean(a['value']);if(!b['sales'])return{'dim':a['dim'],'status':'unknown','reason':'sales\x20absent\x20from\x20candidate\x20payload'};const r=b['sales']['some'](t=>typeof t['wip_hash']==='string'&&t['wip_hash']['length']>0x0);return r===q?{'dim':a['dim'],'status':'satisfied','reason':'has_wip_verification='+r}:{'dim':a['dim'],'status':'violated','reason':'has_wip_verification='+r+',\x20gate\x20requires\x20'+q};}case'text':{if(d!=='must_contain'&&d!=='must_not_contain')return null;const t=asStringArray(a['value']);if(!t||t['length']===0x0)return null;const u=[b['description']??'',...(b['sales']??[])['map'](w=>w['name']??'')]['join']('\x20')['toLowerCase']();if(u['trim']()['length']===0x0)return{'dim':a['dim'],'status':'unknown','reason':'candidate\x20carries\x20no\x20text\x20to\x20match'};if(d==='must_contain'){const w=t['filter'](x=>!u['includes'](x['toLowerCase']()));return w['length']===0x0?{'dim':a['dim'],'status':'satisfied','reason':'all\x20'+t['length']+'\x20term(s)\x20present'}:{'dim':a['dim'],'status':'violated','reason':'missing\x20term(s):\x20'+w['join'](',\x20')};}const v=t['filter'](x=>u['includes'](x['toLowerCase']()));return v['length']===0x0?{'dim':a['dim'],'status':'satisfied','reason':'no\x20forbidden\x20term\x20present'}:{'dim':a['dim'],'status':'violated','reason':'forbidden\x20term(s)\x20present:\x20'+v['join'](',\x20')};}case'owner':{if(d!=='in'&&d!=='not_in')return null;const x=asStringArray(a['value']);if(!x)return null;if(b['owner']===undefined)return{'dim':a['dim'],'status':'unknown','reason':'owner\x20absent\x20from\x20candidate\x20payload'};const y=x['includes'](b['owner']),z=d==='in'?y:!y;return z?{'dim':a['dim'],'status':'satisfied','reason':'owner\x20'+d+'\x20list'}:{'dim':a['dim'],'status':'violated','reason':'owner\x20fails\x20'+d+'\x20list'};}default:return null;}}function applyGates(a,b,d,e){const f=a['unknown_policy']??'neutral_score',g=new Set(),h=[],i=[],j=[];for(const m of a['gates']??[]){d(m,e)===null&&g['add']('gate\x20dim\x20\x27'+m['dim']+'\x27\x20(op\x20\x27'+(m['op']??'eq')+'\x27)\x20not\x20enforceable\x20client-side');}const k=new Set(),l=new Set();for(const n of a['excludes']??[]){if(n['dim']==='blacklist'){for(const p of n['objects']??[])k['add'](p);for(const q of n['owners']??[])l['add'](q);}else g['add']('exclude\x20dim\x20\x27'+n['dim']+'\x27\x20not\x20enforceable\x20client-side\x20(no\x20local\x20facet)');}for(const r of b){if(k['has'](r['object'])){i['push']({'object':r['object'],'reason':'excluded:\x20blacklisted\x20object'});continue;}const s=r['owner'];if(s!==undefined&&l['has'](s)){i['push']({'object':r['object'],'reason':'excluded:\x20blacklisted\x20owner'});continue;}let t=!![];for(const u of a['gates']??[]){const v=d(u,r);if(v===null){g['add']('gate\x20dim\x20\x27'+u['dim']+'\x27\x20(op\x20\x27'+(u['op']??'eq')+'\x27)\x20not\x20enforceable\x20client-side');continue;}if(v['status']==='violated'){i['push']({'object':r['object'],'reason':'gate\x20'+v['dim']+':\x20'+v['reason']}),t=![];break;}if(v['status']==='unknown'){if(f==='drop'){i['push']({'object':r['object'],'reason':'gate\x20'+v['dim']+'\x20unknown\x20('+v['reason']+')\x20and\x20unknown_policy=drop'}),t=![];break;}j['push']({'object':r['object'],'dim':v['dim'],'reason':v['reason']});}}if(t)h['push'](r);}return{'passed':h,'dropped':i,'unknown_notes':j,'ignored':[...g]['sort']()};}export function applyPolicyGates(a,b,c={}){return applyGates(a,b,(d,e)=>evalGate(d,e,c),{'object':'','description':'','location':''});}function evalDemandGate(a,b){const c=a['op']??'eq';switch(a['dim']){case'text':{if(c!=='must_contain'&&c!=='must_not_contain')return null;const e=asStringArray(a['value']);if(!e||e['length']===0x0)return null;const f=(b['description']??'')['toLowerCase']();if(f['trim']()['length']===0x0)return{'dim':a['dim'],'status':'unknown','reason':'demand\x20carries\x20no\x20description\x20text'};if(c==='must_contain'){const h=e['filter'](i=>!f['includes'](i['toLowerCase']()));return h['length']===0x0?{'dim':a['dim'],'status':'satisfied','reason':'all\x20'+e['length']+'\x20term(s)\x20present'}:{'dim':a['dim'],'status':'violated','reason':'missing\x20term(s):\x20'+h['join'](',\x20')};}const g=e['filter'](i=>f['includes'](i['toLowerCase']()));return g['length']===0x0?{'dim':a['dim'],'status':'satisfied','reason':'no\x20forbidden\x20term\x20present'}:{'dim':a['dim'],'status':'violated','reason':'forbidden\x20term(s)\x20present:\x20'+g['join'](',\x20')};}case'location':{if(c!=='must_contain'&&c!=='must_not_contain')return null;const i=asStringArray(a['value']);if(!i||i['length']===0x0)return null;const j=(b['location']??'')['toLowerCase']();if(j['trim']()['length']===0x0)return{'dim':a['dim'],'status':'unknown','reason':'demand\x20carries\x20no\x20location'};if(c==='must_contain'){const l=i['filter'](m=>!j['includes'](m['toLowerCase']()));return l['length']===0x0?{'dim':a['dim'],'status':'satisfied','reason':'all\x20'+i['length']+'\x20term(s)\x20present\x20in\x20location'}:{'dim':a['dim'],'status':'violated','reason':'location\x20missing\x20term(s):\x20'+l['join'](',\x20')};}const k=i['filter'](m=>j['includes'](m['toLowerCase']()));return k['length']===0x0?{'dim':a['dim'],'status':'satisfied','reason':'no\x20forbidden\x20term\x20in\x20location'}:{'dim':a['dim'],'status':'violated','reason':'forbidden\x20term(s)\x20in\x20location:\x20'+k['join'](',\x20')};}case'reward':{if(c!=='gte'&&c!=='lte')return null;const m=bigIntValue(a['value']);if(m===undefined)return null;if(b['rewards']===undefined)return{'dim':a['dim'],'status':'unknown','reason':'reward\x20list\x20absent\x20from\x20demand\x20payload'};const n=BigInt(b['rewards']['length']),o=c==='gte'?n>=m:n<=m;return o?{'dim':a['dim'],'status':'satisfied','reason':'reward_count\x20'+n+'\x20'+c+'\x20'+m}:{'dim':a['dim'],'status':'violated','reason':'reward_count\x20'+n+'\x20fails\x20'+c+'\x20'+m};}case'messenger':{const p=a['value']===undefined?!![]:Boolean(a['value']);if(b['um']===undefined)return{'dim':a['dim'],'status':'unknown','reason':'messenger\x20binding\x20absent\x20from\x20demand\x20payload'};const q=b['um']!==null;return q===p?{'dim':a['dim'],'status':'satisfied','reason':'messenger\x20bound='+q}:{'dim':a['dim'],'status':'violated','reason':'messenger\x20bound='+q+',\x20gate\x20requires\x20'+p};}case'guard':{const r=a['value']===undefined?!![]:Boolean(a['value']);if(b['guards']===undefined)return{'dim':a['dim'],'status':'unknown','reason':'guard\x20list\x20absent\x20from\x20demand\x20payload'};const s=b['guards']['length']>0x0;return s===r?{'dim':a['dim'],'status':'satisfied','reason':'guarded='+s}:{'dim':a['dim'],'status':'violated','reason':'guarded='+s+',\x20gate\x20requires\x20'+r};}case'presenters':{if(c!=='gte'&&c!=='lte')return null;const t=bigIntValue(a['value']);if(t===undefined)return null;if(b['presenters_count']===undefined)return{'dim':a['dim'],'status':'unknown','reason':'presenters_count\x20absent\x20from\x20demand\x20payload'};const u=BigInt(b['presenters_count']),v=c==='gte'?u>=t:u<=t;return v?{'dim':a['dim'],'status':'satisfied','reason':'presenters_count\x20'+u+'\x20'+c+'\x20'+t}:{'dim':a['dim'],'status':'violated','reason':'presenters_count\x20'+u+'\x20fails\x20'+c+'\x20'+t};}case'owner':{if(c!=='in'&&c!=='not_in')return null;const w=asStringArray(a['value']);if(!w)return null;if(b['owner']===undefined)return{'dim':a['dim'],'status':'unknown','reason':'owner\x20absent\x20from\x20demand\x20payload'};const x=w['includes'](b['owner']),y=c==='in'?x:!x;return y?{'dim':a['dim'],'status':'satisfied','reason':'owner\x20'+c+'\x20list'}:{'dim':a['dim'],'status':'violated','reason':'owner\x20fails\x20'+c+'\x20list'};}default:return null;}}export function applyDemandPolicyGates(a,b){return applyGates(a,b,evalDemandGate,{'object':'','description':'','location':''});}export function policyToInjection(a){const b={},c=[],d=new Set(POLICY_WEIGHT_RULE_IDS);for(const [e,f]of Object['entries'](a['weights']??{})){if(d['has'](e))b[e]=f;else c['push']('weight\x20on\x20unregistered\x20rule\x20\x27'+e+'\x27\x20ignored\x20(client\x20engine\x20has:\x20'+POLICY_WEIGHT_RULE_IDS['join'](',\x20')+')');}return{'injection':{'overrides':{'rules':Object['fromEntries'](Object['entries'](b)['map'](([g,h])=>[g,{'weight':h}]))}},'applied':b,'ignored':c['sort']()};}export function applyPolicyRerank(a,b){const c=[],d=[...a]['sort']((k,l)=>l['result']['total']-k['result']['total']||k['service']['object']['localeCompare'](l['service']['object']));let e=d,f=![],g=0x0;const h=b['rerank']?.['diversity'];if(h){if(h['by']==='permission')c['push']('rerank.diversity\x20by\x20\x27permission\x27\x20not\x20enforceable\x20client-side\x20(no\x20permission\x20facet\x20on\x20candidates);\x20use\x20\x27owner\x27');else{const k=new Map(),l=[],n=[];for(const o of e){const p=o['service']['owner'];if(p===undefined){l['push'](o);continue;}const q=k['get'](p)??0x0;q<h['max_per_group']?(k['set'](p,q+0x1),l['push'](o)):n['push'](o);}e=[...l,...n],f=!![],g=n['length'];}}if(b['rerank']?.['explore']!==undefined)c['push']('rerank.explore\x20not\x20enforceable\x20in\x20this\x20build\x20(no\x20local\x20bandit\x20state)');if(b['rerank']?.['llm']!==undefined)c['push']('rerank.llm\x20not\x20enforceable\x20in\x20this\x20build\x20(deterministic\x20kernel\x20only)');if(b['rerank']?.['fairness']!==undefined)c['push']('rerank.fairness\x20not\x20enforceable\x20in\x20this\x20build\x20(no\x20exposure\x20accounting)');const i=b['output']?.['top_n'],j=i!==undefined?e['slice'](0x0,i):e;return{'matches':j,'order':'total\x20DESC,\x20object_id\x20ASC'+(f?',\x20diversity(owner)<='+h['max_per_group']:''),'diversity_applied':f,'deferred':g,'ignored':c['sort']()};}export function rerankDemandMatches(a,b){const c=applyPolicyRerank(a['map'](e=>({'service':{'object':e['demand']['object'],...e['demand']['owner']!==undefined?{'owner':e['demand']['owner']}:{}},'result':e['result']})),b),d=new Map(a['map'](e=>[e['demand']['object'],e]));return{...c,'matches':c['matches']['map'](e=>d['get'](e['service']['object']))};}function canonicalize(a){if(Array['isArray'](a))return a['map'](canonicalize);if(a&&typeof a==='object'){const b={};for(const c of Object['keys'](a)['sort']()){b[c]=canonicalize(a[c]);}return b;}return a;}export function policyHash(a){return createHash('sha256')['update'](JSON['stringify'](canonicalize(a)))['digest']('hex');}export function buildPolicyEffect(a,b,c,d,e=[]){const f=[...new Set([...b['ignored'],...c['ignored'],...d['ignored'],...e])]['sort']();if(a['recall']!==undefined)f['push']('section\x20\x27recall\x27\x20is\x20a\x20server-side\x20directive\x20—\x20not\x20sent\x20upstream\x20from\x20a\x20private\x20policy;\x20recall\x20stays\x20on\x20the\x20route\x20in\x20effect');if(a['verify']!==undefined)f['push']('section\x20\x27verify\x27\x20not\x20enforceable\x20client-side\x20in\x20this\x20build');return{'policy_id':a['policy_id'],'version':a['version'],'direction':a['direction']??'demand_to_supply','policy_hash':policyHash(a),'unknown_policy':a['unknown_policy']??'neutral_score','dropped':b['dropped'],'unknown_kept':b['unknown_notes'],'weights_applied':c['applied'],'rerank':d['order'],'deferred_by_diversity':d['deferred'],'ignored':f['sort'](),'privacy':'client_side_only\x20—\x20the\x20policy\x20and\x20its\x20hash\x20never\x20leave\x20this\x20device'};}
@@ -1 +1 @@
1
- import{describe,expect,it}from'vitest';import{PRESET_MATCH_POLICIES,applyPolicyGates,applyPolicyRerank,buildPolicyEffect,policyHash,policyToInjection,resolveMatchPolicy}from'./match-policy.js';import{MatchPolicySchema}from'../schema/evaluation/index.js';function svc(a,b={}){return{'object':a,'description':'freelance\x20logo\x20design','location':'Shanghai','sales':[{'name':'logo','price':'100','wip_hash':'abc'}],'arbitrations':[],'bPublished':!![],'bPaused':![],...b};}describe('resolveMatchPolicy',()=>{it('resolves\x20preset\x20ids\x20case-insensitively\x20with\x20dash/underscore\x20tolerance',()=>{expect(resolveMatchPolicy('trust-first','demand_to_supply')?.['policy_id'])['toBe']('trust_first'),expect(resolveMatchPolicy('Cheap_And_Fast','demand_to_supply')?.['policy_id'])['toBe']('cheap_and_fast'),expect(resolveMatchPolicy(undefined,'demand_to_supply'))['toBeUndefined']();}),it('rejects\x20unknown\x20preset\x20ids\x20with\x20the\x20available\x20list',()=>{expect(()=>resolveMatchPolicy('nope','demand_to_supply'))['toThrow'](/available:.*default/);}),it('rejects\x20a\x20supply_to_demand\x20policy\x20on\x20a\x20demand_to_supply\x20query',()=>{expect(()=>resolveMatchPolicy('supplier_hunting','demand_to_supply'))['toThrow'](/direction/),expect(resolveMatchPolicy('supplier_hunting','supply_to_demand')?.['policy_id'])['toBe']('supplier_hunting');}),it('every\x20preset\x20passes\x20the\x20public\x20schema',()=>{for(const [a,b]of Object['entries'](PRESET_MATCH_POLICIES)){expect(MatchPolicySchema['safeParse'](b)['success'],a)['toBe'](!![]);}}),it('accepts\x20the\x20K5-05\x20§4.1\x20JSON\x20shape\x20including\x20not-yet-enforceable\x20sections',()=>{const a={'policy_id':'cross-border-retail-v1','version':0x3,'direction':'demand_to_supply','unknown_policy':'neutral_score','gates':[{'dim':'live','op':'eq','value':!![]},{'dim':'geo','op':'relation_in','value':['exact','contains'],'params':{'sensitivity':'logistics'}},{'dim':'price','op':'lte','value':'500','params':{'hard':!![]}},{'dim':'reputation','op':'custom','params':{'min_delivered':0x3}}],'excludes':[{'dim':'anti_cheat','flags':['self_buy']},{'dim':'blacklist','objects':['0xbad']}],'recall':{'text':{'mode':'hybrid'}},'weights':{'region':0xa,'price':0x19,'process_fit':0xf},'rerank':{'diversity':{'by':'owner','max_per_group':0x2},'explore':{'strategy':'epsilon_greedy'}},'verify':{'sampling_rate':0.01},'output':{'top_n':0x14}};expect(MatchPolicySchema['safeParse'](a)['success'])['toBe'](!![]);});}),describe('applyPolicyGates',()=>{const a={'budgetWei':0x96n};it('live\x20gate\x20drops\x20paused\x20candidates',()=>{const b={'policy_id':'t','gates':[{'dim':'live','op':'eq','value':!![]}]},c=applyPolicyGates(b,[svc('0xa'),svc('0xb',{'bPaused':!![]})]);expect(c['passed']['map'](d=>d['object']))['toEqual'](['0xa']),expect(c['dropped'][0x0])['toMatchObject']({'object':'0xb'}),expect(c['dropped'][0x0]['reason'])['toContain']('live=false');}),it('price\x20gate\x20binds\x20from\x20the\x20request\x20budget\x20via\x20from_budget',()=>{const b={'policy_id':'t','gates':[{'dim':'price','op':'lte','params':{'from_budget':!![],'hard':!![]}}]},c=applyPolicyGates(b,[svc('0xok'),svc('0xrich',{'sales':[{'price':'900'}]})],a);expect(c['passed']['map'](d=>d['object']))['toEqual'](['0xok']),expect(c['dropped'][0x0]['reason'])['toContain']('fails\x20lte\x20150');}),it('missing\x20input\x20is\x20unknown,\x20never\x20violated\x20(axiom\x203):\x20neutral_score\x20keeps\x20+\x20notes,\x20drop\x20eliminates',()=>{const b=svc('0xnp',{'sales':[]}),c={'dim':'price','op':'lte','value':'150'},d=applyPolicyGates({'policy_id':'t','gates':[c]},[b]);expect(d['passed'])['toHaveLength'](0x1),expect(d['unknown_notes'][0x0])['toMatchObject']({'object':'0xnp','dim':'price'});const e=applyPolicyGates({'policy_id':'t','unknown_policy':'drop','gates':[c]},[b]);expect(e['passed'])['toHaveLength'](0x0),expect(e['dropped'][0x0]['reason'])['toContain']('unknown_policy=drop');}),it('text\x20gates:\x20must_contain\x20/\x20must_not_contain\x20over\x20description\x20+\x20sale\x20names',()=>{const b={'policy_id':'t','gates':[{'dim':'text','op':'must_contain','value':'LOGO'},{'dim':'text','op':'must_not_contain','value':['mural']}]},c=applyPolicyGates(b,[svc('0xa'),svc('0xb',{'description':'mural\x20painting'})]);expect(c['passed']['map'](d=>d['object']))['toEqual'](['0xa']),expect(c['dropped'][0x0]['reason'])['toContain']('forbidden\x20term(s)\x20present:\x20mural');}),it('arb\x20+\x20machine\x20+\x20wip_verify\x20gates',()=>{const b={'policy_id':'t','gates':[{'dim':'arb','op':'gte','value':0x1},{'dim':'machine','op':'eq','value':!![]},{'dim':'wip_verify','op':'eq','value':!![]}]},c=applyPolicyGates(b,[svc('0xgood',{'arbitrations':['0xarb'],'machine':'0xm'}),svc('0xnoarb',{'machine':'0xm'}),svc('0xnowip',{'arbitrations':['0xarb'],'machine':'0xm','sales':[{'price':'5'}]})]);expect(c['passed']['map'](d=>d['object']))['toEqual'](['0xgood']),expect(c['dropped']['map'](e=>e['object']))['toEqual'](['0xnoarb','0xnowip']);}),it('blacklist\x20excludes\x20by\x20object\x20and\x20by\x20owner',()=>{const b={'policy_id':'t','excludes':[{'dim':'blacklist','objects':['0xbad'],'owners':['0xevilowner']}]},c=applyPolicyGates(b,[svc('0xa'),svc('0xbad'),svc('0xc',{'owner':'0xevilowner'})]);expect(c['passed']['map'](d=>d['object']))['toEqual'](['0xa']),expect(c['dropped']['map'](e=>e['reason']))['toEqual'](['excluded:\x20blacklisted\x20object','excluded:\x20blacklisted\x20owner']);}),it('non-enforceable\x20dims\x20are\x20reported\x20ignored\x20and\x20never\x20eliminate',()=>{const b={'policy_id':'t','gates':[{'dim':'geo','op':'relation_in','value':['exact']},{'dim':'reputation','op':'custom'}],'excludes':[{'dim':'anti_cheat','flags':['self_buy']}]},c=applyPolicyGates(b,[svc('0xa')]);expect(c['passed'])['toHaveLength'](0x1),expect(c['ignored']['join']('|'))['toContain']('geo'),expect(c['ignored']['join']('|'))['toContain']('reputation'),expect(c['ignored']['join']('|'))['toContain']('anti_cheat');});}),describe('policyToInjection',()=>{it('maps\x20registered\x20weights\x20to\x20rule\x20overrides\x20and\x20reports\x20unregistered\x20ids',()=>{const a=policyToInjection({'policy_id':'t','weights':{'price':0x19,'trust':0x14,'process_fit':0xf,'arb_guarantee':0x14}});expect(a['applied'])['toEqual']({'price':0x19,'trust':0x14}),expect(a['injection']['overrides']?.['rules'])['toEqual']({'price':{'weight':0x19},'trust':{'weight':0x14}}),expect(a['ignored']['join']('|'))['toContain']('process_fit'),expect(a['ignored']['join']('|'))['toContain']('arb_guarantee');});}),describe('applyPolicyRerank',()=>{const a=(b,c,d)=>({'service':{'object':b,'owner':d},'result':{'total':c},'location':{'relation':'exact','satisfied':!![],'score':0x1,'reason':''}});it('final\x20private\x20order:\x20total\x20DESC\x20then\x20object\x20ASC\x20(K5-A10)',()=>{const b=applyPolicyRerank([a('0xb',0x32),a('0xa',0x46),a('0xc',0x46)],{'policy_id':'t'});expect(b['matches']['map'](c=>c['service']['object']))['toEqual'](['0xa','0xc','0xb']),expect(b['order'])['toContain']('total\x20DESC,\x20object_id\x20ASC');}),it('diversity\x20cap\x20defers\x20overflow\x20candidates\x20to\x20the\x20tail,\x20deterministically',()=>{const b=applyPolicyRerank([a('0xa1',0x5a,'0xshop'),a('0xa2',0x50,'0xshop'),a('0xa3',0x46,'0xshop'),a('0xb1',0x3c,'0xother')],{'policy_id':'t','rerank':{'diversity':{'by':'owner','max_per_group':0x2}}});expect(b['matches']['map'](c=>c['service']['object']))['toEqual'](['0xa1','0xa2','0xb1','0xa3']),expect(b['diversity_applied'])['toBe'](!![]),expect(b['deferred'])['toBe'](0x1);}),it('output.top_n\x20slices\x20after\x20ordering',()=>{const b=applyPolicyRerank([a('0xa',0xa),a('0xb',0x5a),a('0xc',0x32)],{'policy_id':'t','output':{'top_n':0x2}});expect(b['matches']['map'](c=>c['service']['object']))['toEqual'](['0xb','0xc']);}),it('reports\x20non-enforceable\x20rerank\x20sections\x20instead\x20of\x20silently\x20ignoring',()=>{const b=applyPolicyRerank([a('0xa',0xa)],{'policy_id':'t','rerank':{'diversity':{'by':'permission','max_per_group':0x1},'llm':{'enabled':!![]}}});expect(b['diversity_applied'])['toBe'](![]),expect(b['ignored']['join']('|'))['toContain']('permission'),expect(b['ignored']['join']('|'))['toContain']('llm');});}),describe('policyHash\x20+\x20buildPolicyEffect',()=>{it('hash\x20is\x20deterministic\x20and\x20key-order\x20independent',()=>{const c={'policy_id':'p','weights':{'price':0x19,'trust':0x14},'unknown_policy':'drop'},d={'unknown_policy':'drop','weights':{'trust':0x14,'price':0x19},'policy_id':'p'};expect(policyHash(c))['toBe'](policyHash(d)),expect(policyHash({...c,'policy_id':'q'}))['not']['toBe'](policyHash(c));}),it('effect\x20report\x20carries\x20drops,\x20unknowns,\x20weights,\x20ignored\x20and\x20the\x20privacy\x20note',()=>{const a={'policy_id':'t','version':0x2,'gates':[{'dim':'arb','op':'gte','value':0x1},{'dim':'stake','op':'gte','value':0x3e8}],'weights':{'trust':0x1e},'recall':{'text':{'mode':'hybrid'}}},b=applyPolicyGates(a,[svc('0xnoarb')]),c=policyToInjection(a),d=applyPolicyRerank([],a),e=buildPolicyEffect(a,b,c,d);expect(e['policy_id'])['toBe']('t'),expect(e['version'])['toBe'](0x2),expect(e['dropped'][0x0]['object'])['toBe']('0xnoarb'),expect(e['weights_applied'])['toEqual']({'trust':0x1e}),expect(e['ignored']['join']('|'))['toContain']('stake'),expect(e['ignored']['join']('|'))['toContain']('recall'),expect(e['privacy'])['toContain']('never\x20leave\x20this\x20device');});});
1
+ import{describe,expect,it}from'vitest';import{PRESET_MATCH_POLICIES,applyDemandPolicyGates,applyPolicyGates,applyPolicyRerank,buildPolicyEffect,policyHash,policyToInjection,rerankDemandMatches,resolveMatchPolicy}from'./match-policy.js';import{MatchPolicySchema}from'../schema/evaluation/index.js';function svc(a,b={}){return{'object':a,'description':'freelance\x20logo\x20design','location':'Shanghai','sales':[{'name':'logo','price':'100','wip_hash':'abc'}],'arbitrations':[],'bPublished':!![],'bPaused':![],...b};}describe('resolveMatchPolicy',()=>{it('resolves\x20preset\x20ids\x20case-insensitively\x20with\x20dash/underscore\x20tolerance',()=>{expect(resolveMatchPolicy('trust-first','demand_to_supply')?.['policy_id'])['toBe']('trust_first'),expect(resolveMatchPolicy('Cheap_And_Fast','demand_to_supply')?.['policy_id'])['toBe']('cheap_and_fast'),expect(resolveMatchPolicy(undefined,'demand_to_supply'))['toBeUndefined']();}),it('rejects\x20unknown\x20preset\x20ids\x20with\x20the\x20available\x20list',()=>{expect(()=>resolveMatchPolicy('nope','demand_to_supply'))['toThrow'](/available:.*default/);}),it('rejects\x20a\x20supply_to_demand\x20policy\x20on\x20a\x20demand_to_supply\x20query',()=>{expect(()=>resolveMatchPolicy('supplier_hunting','demand_to_supply'))['toThrow'](/direction/),expect(resolveMatchPolicy('supplier_hunting','supply_to_demand')?.['policy_id'])['toBe']('supplier_hunting');}),it('every\x20preset\x20passes\x20the\x20public\x20schema',()=>{for(const [a,b]of Object['entries'](PRESET_MATCH_POLICIES)){expect(MatchPolicySchema['safeParse'](b)['success'],a)['toBe'](!![]);}}),it('accepts\x20the\x20K5-05\x20§4.1\x20JSON\x20shape\x20including\x20not-yet-enforceable\x20sections',()=>{const a={'policy_id':'cross-border-retail-v1','version':0x3,'direction':'demand_to_supply','unknown_policy':'neutral_score','gates':[{'dim':'live','op':'eq','value':!![]},{'dim':'geo','op':'relation_in','value':['exact','contains'],'params':{'sensitivity':'logistics'}},{'dim':'price','op':'lte','value':'500','params':{'hard':!![]}},{'dim':'reputation','op':'custom','params':{'min_delivered':0x3}}],'excludes':[{'dim':'anti_cheat','flags':['self_buy']},{'dim':'blacklist','objects':['0xbad']}],'recall':{'text':{'mode':'hybrid'}},'weights':{'region':0xa,'price':0x19,'process_fit':0xf},'rerank':{'diversity':{'by':'owner','max_per_group':0x2},'explore':{'strategy':'epsilon_greedy'}},'verify':{'sampling_rate':0.01},'output':{'top_n':0x14}};expect(MatchPolicySchema['safeParse'](a)['success'])['toBe'](!![]);});}),describe('applyPolicyGates',()=>{const a={'budgetWei':0x96n};it('live\x20gate\x20drops\x20paused\x20candidates',()=>{const b={'policy_id':'t','gates':[{'dim':'live','op':'eq','value':!![]}]},c=applyPolicyGates(b,[svc('0xa'),svc('0xb',{'bPaused':!![]})]);expect(c['passed']['map'](d=>d['object']))['toEqual'](['0xa']),expect(c['dropped'][0x0])['toMatchObject']({'object':'0xb'}),expect(c['dropped'][0x0]['reason'])['toContain']('live=false');}),it('price\x20gate\x20binds\x20from\x20the\x20request\x20budget\x20via\x20from_budget',()=>{const b={'policy_id':'t','gates':[{'dim':'price','op':'lte','params':{'from_budget':!![],'hard':!![]}}]},c=applyPolicyGates(b,[svc('0xok'),svc('0xrich',{'sales':[{'price':'900'}]})],a);expect(c['passed']['map'](d=>d['object']))['toEqual'](['0xok']),expect(c['dropped'][0x0]['reason'])['toContain']('fails\x20lte\x20150');}),it('missing\x20input\x20is\x20unknown,\x20never\x20violated\x20(axiom\x203):\x20neutral_score\x20keeps\x20+\x20notes,\x20drop\x20eliminates',()=>{const b=svc('0xnp',{'sales':[]}),c={'dim':'price','op':'lte','value':'150'},d=applyPolicyGates({'policy_id':'t','gates':[c]},[b]);expect(d['passed'])['toHaveLength'](0x1),expect(d['unknown_notes'][0x0])['toMatchObject']({'object':'0xnp','dim':'price'});const e=applyPolicyGates({'policy_id':'t','unknown_policy':'drop','gates':[c]},[b]);expect(e['passed'])['toHaveLength'](0x0),expect(e['dropped'][0x0]['reason'])['toContain']('unknown_policy=drop');}),it('text\x20gates:\x20must_contain\x20/\x20must_not_contain\x20over\x20description\x20+\x20sale\x20names',()=>{const b={'policy_id':'t','gates':[{'dim':'text','op':'must_contain','value':'LOGO'},{'dim':'text','op':'must_not_contain','value':['mural']}]},c=applyPolicyGates(b,[svc('0xa'),svc('0xb',{'description':'mural\x20painting'})]);expect(c['passed']['map'](d=>d['object']))['toEqual'](['0xa']),expect(c['dropped'][0x0]['reason'])['toContain']('forbidden\x20term(s)\x20present:\x20mural');}),it('arb\x20+\x20machine\x20+\x20wip_verify\x20gates',()=>{const b={'policy_id':'t','gates':[{'dim':'arb','op':'gte','value':0x1},{'dim':'machine','op':'eq','value':!![]},{'dim':'wip_verify','op':'eq','value':!![]}]},c=applyPolicyGates(b,[svc('0xgood',{'arbitrations':['0xarb'],'machine':'0xm'}),svc('0xnoarb',{'machine':'0xm'}),svc('0xnowip',{'arbitrations':['0xarb'],'machine':'0xm','sales':[{'price':'5'}]})]);expect(c['passed']['map'](d=>d['object']))['toEqual'](['0xgood']),expect(c['dropped']['map'](e=>e['object']))['toEqual'](['0xnoarb','0xnowip']);}),it('blacklist\x20excludes\x20by\x20object\x20and\x20by\x20owner',()=>{const b={'policy_id':'t','excludes':[{'dim':'blacklist','objects':['0xbad'],'owners':['0xevilowner']}]},c=applyPolicyGates(b,[svc('0xa'),svc('0xbad'),svc('0xc',{'owner':'0xevilowner'})]);expect(c['passed']['map'](d=>d['object']))['toEqual'](['0xa']),expect(c['dropped']['map'](e=>e['reason']))['toEqual'](['excluded:\x20blacklisted\x20object','excluded:\x20blacklisted\x20owner']);}),it('non-enforceable\x20dims\x20are\x20reported\x20ignored\x20and\x20never\x20eliminate',()=>{const b={'policy_id':'t','gates':[{'dim':'geo','op':'relation_in','value':['exact']},{'dim':'reputation','op':'custom'}],'excludes':[{'dim':'anti_cheat','flags':['self_buy']}]},c=applyPolicyGates(b,[svc('0xa')]);expect(c['passed'])['toHaveLength'](0x1),expect(c['ignored']['join']('|'))['toContain']('geo'),expect(c['ignored']['join']('|'))['toContain']('reputation'),expect(c['ignored']['join']('|'))['toContain']('anti_cheat');});}),describe('policyToInjection',()=>{it('maps\x20registered\x20weights\x20to\x20rule\x20overrides\x20and\x20reports\x20unregistered\x20ids',()=>{const a=policyToInjection({'policy_id':'t','weights':{'price':0x19,'trust':0x14,'process_fit':0xf,'arb_guarantee':0x14}});expect(a['applied'])['toEqual']({'price':0x19,'trust':0x14}),expect(a['injection']['overrides']?.['rules'])['toEqual']({'price':{'weight':0x19},'trust':{'weight':0x14}}),expect(a['ignored']['join']('|'))['toContain']('process_fit'),expect(a['ignored']['join']('|'))['toContain']('arb_guarantee');});}),describe('applyPolicyRerank',()=>{const a=(b,c,d)=>({'service':{'object':b,'owner':d},'result':{'total':c},'location':{'relation':'exact','satisfied':!![],'score':0x1,'reason':''}});it('final\x20private\x20order:\x20total\x20DESC\x20then\x20object\x20ASC\x20(K5-A10)',()=>{const b=applyPolicyRerank([a('0xb',0x32),a('0xa',0x46),a('0xc',0x46)],{'policy_id':'t'});expect(b['matches']['map'](c=>c['service']['object']))['toEqual'](['0xa','0xc','0xb']),expect(b['order'])['toContain']('total\x20DESC,\x20object_id\x20ASC');}),it('diversity\x20cap\x20defers\x20overflow\x20candidates\x20to\x20the\x20tail,\x20deterministically',()=>{const b=applyPolicyRerank([a('0xa1',0x5a,'0xshop'),a('0xa2',0x50,'0xshop'),a('0xa3',0x46,'0xshop'),a('0xb1',0x3c,'0xother')],{'policy_id':'t','rerank':{'diversity':{'by':'owner','max_per_group':0x2}}});expect(b['matches']['map'](c=>c['service']['object']))['toEqual'](['0xa1','0xa2','0xb1','0xa3']),expect(b['diversity_applied'])['toBe'](!![]),expect(b['deferred'])['toBe'](0x1);}),it('output.top_n\x20slices\x20after\x20ordering',()=>{const b=applyPolicyRerank([a('0xa',0xa),a('0xb',0x5a),a('0xc',0x32)],{'policy_id':'t','output':{'top_n':0x2}});expect(b['matches']['map'](c=>c['service']['object']))['toEqual'](['0xb','0xc']);}),it('reports\x20non-enforceable\x20rerank\x20sections\x20instead\x20of\x20silently\x20ignoring',()=>{const b=applyPolicyRerank([a('0xa',0xa)],{'policy_id':'t','rerank':{'diversity':{'by':'permission','max_per_group':0x1},'llm':{'enabled':!![]}}});expect(b['diversity_applied'])['toBe'](![]),expect(b['ignored']['join']('|'))['toContain']('permission'),expect(b['ignored']['join']('|'))['toContain']('llm');});}),describe('applyDemandPolicyGates\x20(supply→demand,\x20K5-05\x20§4)',()=>{function a(b,c={}){return{'object':b,'description':'need\x20a\x20freelance\x20logo\x20redesign','location':'Shanghai','rewards':['0xr1'],'um':'0xum','guards':[],'presenters_count':0x0,...c};}it('text\x20+\x20location\x20gates\x20judge\x20the\x20demand\x20description/location',()=>{const b=applyDemandPolicyGates({'policy_id':'t','gates':[{'dim':'text','op':'must_contain','value':'logo'}]},[a('0xa'),a('0xc',{'description':'kitchen\x20remodel'})]);expect(b['passed']['map'](d=>d['object']))['toEqual'](['0xa']),expect(b['dropped'][0x0]['reason'])['toContain']('missing\x20term(s):\x20logo');const c=applyDemandPolicyGates({'policy_id':'t','gates':[{'dim':'location','op':'must_not_contain','value':['shenzhen']}]},[a('0xa'),a('0xb',{'location':'Shenzhen\x20bay'})]);expect(c['passed']['map'](d=>d['object']))['toEqual'](['0xa']),expect(c['dropped'][0x0]['reason'])['toContain']('forbidden\x20term(s)\x20in\x20location:\x20shenzhen');}),it('reward\x20/\x20messenger\x20/\x20guard\x20/\x20presenters\x20gates',()=>{const b={'policy_id':'t','gates':[{'dim':'reward','op':'gte','value':0x2},{'dim':'messenger','op':'eq','value':!![]},{'dim':'guard','op':'eq','value':![]},{'dim':'presenters','op':'lte','value':0x3}]},c=applyDemandPolicyGates(b,[a('0xok',{'rewards':['0xr1','0xr2']}),a('0xfew',{'um':null}),a('0xguarded',{'rewards':['0xr1','0xr2','0xr3'],'guards':[{'guard':'0xg'}]}),a('0xcrowded',{'rewards':['0xr1','0xr2'],'presenters_count':0x5})]);expect(c['passed']['map'](d=>d['object']))['toEqual'](['0xok']);}),it('missing\x20demand\x20input\x20is\x20unknown,\x20never\x20violated\x20(axiom\x203)',()=>{const b={'dim':'reward','op':'gte','value':0x2},c=applyDemandPolicyGates({'policy_id':'t','gates':[b]},[a('0xnorewards',{'rewards':undefined})]);expect(c['passed'])['toHaveLength'](0x1),expect(c['unknown_notes'][0x0])['toMatchObject']({'object':'0xnorewards','dim':'reward'});const d=applyDemandPolicyGates({'policy_id':'t','unknown_policy':'drop','gates':[b]},[a('0xnorewards',{'rewards':undefined})]);expect(d['passed'])['toHaveLength'](0x0),expect(d['dropped'][0x0]['reason'])['toContain']('unknown_policy=drop');}),it('a\x20price\x20gate\x20is\x20reported\x20ignored\x20on\x20the\x20demand\x20side\x20(budget\x20lives\x20in\x20unreadable\x20Reward\x20guards)',()=>{const b={'policy_id':'t','gates':[{'dim':'price','op':'lte','value':'100'}]},c=applyDemandPolicyGates(b,[a('0xa')]);expect(c['passed'])['toHaveLength'](0x1),expect(c['ignored']['join']('|'))['toContain']('price');}),it('blacklist\x20excludes\x20apply\x20to\x20demands\x20by\x20object\x20and\x20owner',()=>{const b={'policy_id':'t','excludes':[{'dim':'blacklist','objects':['0xbad'],'owners':['0xevil']}]},c=applyDemandPolicyGates(b,[a('0xa'),a('0xbad'),a('0xc',{'owner':'0xevil'})]);expect(c['passed']['map'](d=>d['object']))['toEqual'](['0xa']);});}),describe('rerankDemandMatches\x20(supply→demand\x20final\x20ordering)',()=>{const a=(b,c,d)=>({'demand':{'object':b,'owner':d},'result':{'total':c},'next':{'operation':'demand.present'}});it('orders\x20by\x20total\x20DESC\x20then\x20object\x20ASC,\x20keeps\x20the\x20original\x20match\x20objects',()=>{const c=a('0xb',0x32),d=a('0xa',0x46),e=rerankDemandMatches([c,d],{'policy_id':'t'});expect(e['matches']['map'](f=>f['demand']['object']))['toEqual'](['0xa','0xb']),expect(e['matches'][0x0])['toBe'](d),expect(e['order'])['toContain']('total\x20DESC,\x20object_id\x20ASC');}),it('output.top_n\x20slices\x20after\x20ordering',()=>{const b=rerankDemandMatches([a('0xa',0xa),a('0xb',0x5a),a('0xc',0x32)],{'policy_id':'t','output':{'top_n':0x2}});expect(b['matches']['map'](c=>c['demand']['object']))['toEqual'](['0xb','0xc']);});}),describe('policyHash\x20+\x20buildPolicyEffect',()=>{it('hash\x20is\x20deterministic\x20and\x20key-order\x20independent',()=>{const c={'policy_id':'p','weights':{'price':0x19,'trust':0x14},'unknown_policy':'drop'},d={'unknown_policy':'drop','weights':{'trust':0x14,'price':0x19},'policy_id':'p'};expect(policyHash(c))['toBe'](policyHash(d)),expect(policyHash({...c,'policy_id':'q'}))['not']['toBe'](policyHash(c));}),it('effect\x20report\x20carries\x20drops,\x20unknowns,\x20weights,\x20ignored\x20and\x20the\x20privacy\x20note',()=>{const a={'policy_id':'t','version':0x2,'gates':[{'dim':'arb','op':'gte','value':0x1},{'dim':'stake','op':'gte','value':0x3e8}],'weights':{'trust':0x1e},'recall':{'text':{'mode':'hybrid'}}},b=applyPolicyGates(a,[svc('0xnoarb')]),c=policyToInjection(a),d=applyPolicyRerank([],a),e=buildPolicyEffect(a,b,c,d);expect(e['policy_id'])['toBe']('t'),expect(e['version'])['toBe'](0x2),expect(e['dropped'][0x0]['object'])['toBe']('0xnoarb'),expect(e['weights_applied'])['toEqual']({'trust':0x1e}),expect(e['ignored']['join']('|'))['toContain']('stake'),expect(e['ignored']['join']('|'))['toContain']('recall'),expect(e['privacy'])['toContain']('never\x20leave\x20this\x20device');});});
@@ -1 +1 @@
1
- import{distillIntent,extractSignals}from'./intent-distill.js';import{getProfile,updateFromOperation}from'./user-profile.js';import{findMatches,recordSignature}from'./experience-reuse.js';import{EXPERIENCE_LAYER_VERSION}from'./types.js';import{isEnabled as a100a}from'../config/index.js';import{recordIndustrySignal}from'../knowledge/flywheel-loop.js';export{EXPERIENCE_LAYER_VERSION};export function getExperienceFeedback(a,b,c){try{const d=distillIntent(a,b,c),e=findMatches(d['primary_intent'],a,b,0x3);if(e['length']===0x0)return undefined;const f=e[0x0],g=getProfile();return formatFeedback(f,e,d['scenario'],g);}catch{return undefined;}}export function recordOperationOutcome(a,b,c,d,e,f=[]){try{const g=distillIntent(a,b,c),h=extractSignals(a,b);recordSignature({'intent':g['primary_intent'],'scenario':g['scenario'],'signals':h,'timestamp':Date['now'](),'outcome':d,'error_code':e}),updateFromOperation(g['primary_intent'],g['scenario'],d,e,f);try{if(a100a('industry_evolution')){const i=typeof b?.['industry']==='string'&&b['industry']['trim']()?b['industry']['trim']():undefined;if(i){const j=d==='success'?{'success':!![]}:{'success':![],'error_code':e};recordIndustrySignal(i,{'type':a,'data':b},j);}}}catch{}}catch{}}function formatFeedback(a,b,c,d){const e=buildAdviceText(a,b,d),f=collectAvoidList(b,d),g=a['relevance'],h=c??a['signature']['scenario'],i={};if(e)i['advice']=e;if(f['length']>0x0)i['avoid']=f;if(g>0x0)i['relevance']=Math['round'](g*0x64)/0x64;if(h)i['matched_scenario']=h;return i;}function buildAdviceText(a,b,c){const d=[];if(a['signature']['outcome']==='success')d['push']('Historically,\x20'+a['signature']['intent']+'\x20operation\x20succeeded');else a['signature']['outcome']==='failed'&&d['push']('Historically,\x20'+a['signature']['intent']+'\x20operation\x20failed\x20('+(a['signature']['error_code']??'unknown\x20error')+'),\x20pay\x20special\x20attention\x20to\x20parameters');return c['expertise_tier']==='novice'&&b['length']>0x0&&d['push']('It\x20is\x20recommended\x20to\x20carefully\x20check\x20parameters\x20before\x20executing'),d['join'](';\x20')||a['advice'];}function collectAvoidList(b,c){const d=new Set();for(const e of b){for(const f of e['avoid']){d['add'](f);}}for(const g of c['frequent_pitfalls']){d['add']('You\x20often\x20make\x20mistakes\x20at\x20the\x20'+g+'\x20step,\x20please\x20be\x20especially\x20careful');}return Array['from'](d)['slice'](0x0,0x5);}
1
+ import{distillIntent,extractSignals}from'./intent-distill.js';import{getProfile,updateFromOperation}from'./user-profile.js';import{findMatches,recordSignature}from'./experience-reuse.js';import{EXPERIENCE_LAYER_VERSION}from'./types.js';import{isEnabled as a103a}from'../config/index.js';import{recordIndustrySignal}from'../knowledge/flywheel-loop.js';export{EXPERIENCE_LAYER_VERSION};export function getExperienceFeedback(a,b,c){try{const d=distillIntent(a,b,c),e=findMatches(d['primary_intent'],a,b,0x3);if(e['length']===0x0)return undefined;const f=e[0x0],g=getProfile();return formatFeedback(f,e,d['scenario'],g);}catch{return undefined;}}export function recordOperationOutcome(a,b,c,d,e,f=[]){try{const g=distillIntent(a,b,c),h=extractSignals(a,b);recordSignature({'intent':g['primary_intent'],'scenario':g['scenario'],'signals':h,'timestamp':Date['now'](),'outcome':d,'error_code':e}),updateFromOperation(g['primary_intent'],g['scenario'],d,e,f);try{if(a103a('industry_evolution')){const i=typeof b?.['industry']==='string'&&b['industry']['trim']()?b['industry']['trim']():undefined;if(i){const j=d==='success'?{'success':!![]}:{'success':![],'error_code':e};recordIndustrySignal(i,{'type':a,'data':b},j);}}}catch{}}catch{}}function formatFeedback(a,b,c,d){const e=buildAdviceText(a,b,d),f=collectAvoidList(b,d),g=a['relevance'],h=c??a['signature']['scenario'],i={};if(e)i['advice']=e;if(f['length']>0x0)i['avoid']=f;if(g>0x0)i['relevance']=Math['round'](g*0x64)/0x64;if(h)i['matched_scenario']=h;return i;}function buildAdviceText(a,b,c){const d=[];if(a['signature']['outcome']==='success')d['push']('Historically,\x20'+a['signature']['intent']+'\x20operation\x20succeeded');else a['signature']['outcome']==='failed'&&d['push']('Historically,\x20'+a['signature']['intent']+'\x20operation\x20failed\x20('+(a['signature']['error_code']??'unknown\x20error')+'),\x20pay\x20special\x20attention\x20to\x20parameters');return c['expertise_tier']==='novice'&&b['length']>0x0&&d['push']('It\x20is\x20recommended\x20to\x20carefully\x20check\x20parameters\x20before\x20executing'),d['join'](';\x20')||a['advice'];}function collectAvoidList(b,c){const d=new Set();for(const e of b){for(const f of e['avoid']){d['add'](f);}}for(const g of c['frequent_pitfalls']){d['add']('You\x20often\x20make\x20mistakes\x20at\x20the\x20'+g+'\x20step,\x20please\x20be\x20especially\x20careful');}return Array['from'](d)['slice'](0x0,0x5);}
@@ -1,5 +1,5 @@
1
1
  import type { ProjectObjectType } from "../playbooks/service-build/namespace.js";
2
- export type BusinessModuleId = "milestone_escrow" | "independent_arbitration" | "wip_provenance" | "multi_tier_allocation" | "subscription_with_proof" | "accept_timeout_protection" | "refund_guarantee" | "reputation_on_chain" | "supplier_collaboration" | "damage_attestation" | "discount_lifecycle" | "praise_incentive" | "after_sales_guarantee" | "acceptance_judging" | "installment_deposit" | "affiliate_commission" | "crowdfunding";
2
+ export type BusinessModuleId = "milestone_escrow" | "independent_arbitration" | "wip_provenance" | "multi_tier_allocation" | "subscription_with_proof" | "accept_timeout_protection" | "refund_guarantee" | "reputation_on_chain" | "supplier_collaboration" | "damage_attestation" | "discount_lifecycle" | "praise_incentive" | "after_sales_guarantee" | "acceptance_judging" | "installment_deposit" | "affiliate_commission" | "crowdfunding" | "logistics_fulfillment";
3
3
  export interface ModuleEvaluationImpact {
4
4
  dimension: string;
5
5
  effect: "boost" | "required" | "optional";
@@ -1 +1 @@
1
- export const CORE_BUSINESS_MODULES=[{'id':'milestone_escrow','name':'Milestone\x20Escrow','description':'Funds\x20held\x20in\x20Order\x20and\x20released\x20per\x20milestone\x20completion.\x20Protects\x20both\x20merchant\x20and\x20user.','objectTypes':['service','machine','order','allocation'],'templateRefs':[{'template_id':'freelance-machine','object_type':'machine','purpose':'Milestone\x20workflow\x20with\x20accept/reject\x20nodes'},{'template_id':'milestone-allocation','object_type':'allocation','purpose':'Per-milestone\x20fund\x20release'}],'requiredConstraints':[{'constraint_id':'order_allocators_bound','description':'Order\x20must\x20have\x20allocators\x20bound\x20before\x20publish','level':'hard','blocking':!![]},{'constraint_id':'machine_published','description':'Machine\x20must\x20be\x20published\x20and\x20bound\x20to\x20Service','level':'hard','blocking':!![]},{'constraint_id':'milestone_forward_guarded','description':'Each\x20milestone\x20forward\x20must\x20have\x20a\x20guard','level':'soft','blocking':![]}],'evaluationImpact':[{'dimension':'fund_safety','effect':'boost','description':'Escrow\x20ensures\x20funds\x20not\x20released\x20until\x20verification'},{'dimension':'escrow_quality','effect':'required','description':'Module\x20requires\x20proper\x20escrow\x20configuration'},{'dimension':'operational_risk','effect':'boost','description':'Milestones\x20reduce\x20single-point\x20delivery\x20risk'}],'industryFit':{'freelance':0x5f,'education':0x50,'rental':0x3c,'retail':0x28,'subscription':0x1e,'travel':0x32,'licensing':0x55,'crowdfunding':0x55,'general':0x46},'addressesPainPoints':['Client\x20never\x20approves\x20deliverables','Merchant\x20delivers\x20but\x20cannot\x20get\x20paid','Full\x20upfront\x20payment\x20with\x20no\x20delivery\x20guarantee'],'intentSignals':[/milestone/i,/escrow/i,/pay(ment)? (per|on|at|upon) (each )?(milestone|stage|delivery|approval)/i,/staged? (payment|release)/i,/progress payment/i,/hold funds until/i],'userProtections':['Funds\x20held\x20in\x20escrow\x20until\x20milestone\x20verified','Can\x20reject\x20substandard\x20deliverables','Refund\x20for\x20unstarted\x20milestones'],'merchantObligations':['Must\x20deliver\x20each\x20milestone\x20to\x20defined\x20acceptance\x20criteria','Must\x20configure\x20Machine\x20with\x20proper\x20forward\x20guards'],'requiresKeeper':!![],'keeperHint':'Keeper\x20must\x20monitor\x20Machine\x20node\x20timeouts\x20and\x20trigger\x20adminUnhold\x20if\x20user\x20does\x20not\x20respond'},{'id':'independent_arbitration','name':'Independent\x20Arbitration','description':'Third-party\x20arbitration\x20with\x20Guard-weighted\x20voting.\x20Arbitration\x20Permission\x20MUST\x20differ\x20from\x20Service\x20Permission\x20(contract-enforced).','objectTypes':['arb','permission','guard'],'templateRefs':[{'template_id':'arbitration-3-voters','object_type':'arb','purpose':'3-voter\x20arbitration\x20with\x20weighted\x20voting'},{'template_id':'voting-guard-weighted','object_type':'guard','purpose':'Vote\x20weight\x20from\x20Guard\x20config'}],'requiredConstraints':[{'constraint_id':'arbitration_permission_independent','description':'Arbitration.permission\x20!=\x20Service.permission','level':'hard','blocking':!![]},{'constraint_id':'voting_guard_configured','description':'At\x20least\x20one\x20voting_guard\x20must\x20be\x20configured','level':'soft','blocking':![]},{'constraint_id':'arbitration_bound_to_service','description':'Arbitration\x20must\x20be\x20in\x20Service.arbitrations\x20list','level':'hard','blocking':!![]}],'evaluationImpact':[{'dimension':'arbitration_coverage','effect':'required','description':'Module\x20requires\x20arbitration\x20configuration'},{'dimension':'arbitration_fairness','effect':'required','description':'Independent\x20permission\x20ensures\x20neutrality'},{'dimension':'governance_risk','effect':'boost','description':'Reduces\x20platform-as-judge\x20risk'}],'industryFit':{'freelance':0x5a,'education':0x4b,'rental':0x55,'retail':0x4b,'subscription':0x3c,'travel':0x50,'licensing':0x5a,'crowdfunding':0x50,'general':0x46},'addressesPainPoints':['Platform\x20acts\x20as\x20both\x20judge\x20and\x20party','Arbitration\x20fees\x20too\x20high\x20for\x20small\x20claims','No\x20binding\x20dispute\x20resolution'],'intentSignals':[/arbitrat/i,/dispute/i,/mediat/i,/third[ -]?party (resolution|judgement|judgment|venue)/i,/voting/i,/ruling/i,/appeal/i],'userProtections':['Independent\x20arbitrators\x20(not\x20merchant\x20or\x20platform)','Guard-weighted\x20voting\x20prevents\x20Sybil\x20attacks','Micro-arbitration:\x20no\x20per-case\x20fees'],'merchantObligations':['Must\x20accept\x20arbitration\x20verdict','Must\x20maintain\x20compensation_fund\x20for\x20indemnities'],'requiresKeeper':![]},{'id':'wip_provenance','name':'WIP\x20Provenance','description':'Work-in-progress\x20hash\x20commitments\x20on-chain\x20via\x20Repository.\x20Prevents\x20tampering\x20of\x20delivery\x20evidence.','objectTypes':['repository','guard','proof'],'templateRefs':[{'template_id':'wip-hash-guard','object_type':'guard','purpose':'Verify\x20WIP\x20hash\x20matches\x20commitment'},{'template_id':'delivery-proof','object_type':'proof','purpose':'On-chain\x20delivery\x20confirmation'}],'requiredConstraints':[{'constraint_id':'repository_published','description':'Repository\x20must\x20be\x20published','level':'hard','blocking':!![]},{'constraint_id':'wip_hash_before_delivery','description':'WIP\x20hash\x20must\x20be\x20committed\x20before\x20delivery','level':'soft','blocking':![]}],'evaluationImpact':[{'dimension':'proof_integrity','effect':'required','description':'WIP\x20hash\x20provides\x20tamper-proof\x20evidence'},{'dimension':'transparency','effect':'boost','description':'On-chain\x20commitment\x20is\x20publicly\x20verifiable'}],'industryFit':{'freelance':0x5a,'education':0x55,'rental':0x5f,'retail':0x46,'subscription':0x3c,'travel':0x46,'licensing':0x5f,'crowdfunding':0x55,'general':0x4b},'addressesPainPoints':['Evidence\x20stored\x20on\x20platform\x20servers\x20can\x20be\x20tampered','No\x20proof\x20of\x20pre-delivery\x20state\x20(e.g.\x20rental\x20condition)','Dispute\x20resolution\x20relies\x20on\x20trust\x20in\x20platform'],'intentSignals':[/\bwip\b/i,/work[ -]?in[ -]?progress/i,/\bhash\b/i,/evidence/i,/tamper/i,/proof of (work|progress|delivery)/i],'userProtections':['WIP\x20hash\x20commitment\x20is\x20immutable\x20on-chain','Guard\x20automatically\x20verifies\x20hash\x20match','Repository\x20history\x20is\x20auditable'],'merchantObligations':['Must\x20commit\x20WIP\x20hash\x20at\x20defined\x20checkpoints','Must\x20use\x20Repository\x20for\x20evidence\x20storage'],'requiresKeeper':![]},{'id':'multi_tier_allocation','name':'Multi-Tier\x20Allocation','description':'Order\x20funds\x20automatically\x20split\x20among\x20multiple\x20recipients.\x20Fully\x20transparent\x20on-chain.','objectTypes':['allocation','treasury','payment'],'templateRefs':[{'template_id':'multi-tier-allocation','object_type':'allocation','purpose':'Waterfall\x20fund\x20distribution'},{'template_id':'supplier-waterfall','object_type':'allocation','purpose':'Supplier\x20payment\x20tiers'}],'requiredConstraints':[{'constraint_id':'allocators_configured','description':'Allocators\x20must\x20be\x20configured\x20with\x20recipients','level':'hard','blocking':!![]},{'constraint_id':'sharing_sum_100','description':'Allocation\x20percentages\x20must\x20sum\x20to\x20100%','level':'hard','blocking':!![]},{'constraint_id':'platform_fee_zero','description':'Platform\x20fee\x20should\x20be\x200\x20or\x20user-defined','level':'soft','blocking':![]}],'evaluationImpact':[{'dimension':'fee_transparency','effect':'required','description':'All\x20allocations\x20visible\x20on-chain'},{'dimension':'supplier_visibility','effect':'boost','description':'Supplier\x20payments\x20are\x20auditable'}],'industryFit':{'freelance':0x3c,'education':0x32,'rental':0x28,'retail':0x50,'subscription':0x46,'travel':0x5f,'licensing':0x62,'crowdfunding':0x50,'general':0x46},'addressesPainPoints':['Multi-layer\x20commission\x20hidden\x20from\x20users','Suppliers\x20paid\x20opaquely','Platform\x20takes\x20undisclosed\x20FX\x20spread'],'intentSignals':[/multi[ -]?tier/i,/waterfall/i,/\bsplit/i,/divide/i,/distribut/i,/tiered payout/i],'userProtections':['Full\x20allocation\x20waterfall\x20visible\x20on-chain','No\x20hidden\x20fees','Can\x20verify\x20supplier\x20payments'],'merchantObligations':['Must\x20declare\x20all\x20allocation\x20recipients\x20upfront','Cannot\x20change\x20allocation\x20after\x20publish'],'requiresKeeper':![]},{'id':'subscription_with_proof','name':'Subscription\x20with\x20Delivery\x20Proof','description':'Each\x20billing\x20cycle\x20requires\x20proof\x20of\x20content\x20delivery\x20before\x20charging.\x20Prevents\x20creator\x20abandonment.','objectTypes':['service','guard','repository','progress'],'templateRefs':[{'template_id':'subscription-machine','object_type':'machine','purpose':'Cycle-based\x20workflow'},{'template_id':'delivery-guard-cycle','object_type':'guard','purpose':'Verify\x20content\x20delivery\x20per\x20cycle'}],'requiredConstraints':[{'constraint_id':'delivery_guard_per_cycle','description':'Each\x20cycle\x20must\x20have\x20a\x20delivery\x20guard','level':'hard','blocking':!![]},{'constraint_id':'repository_updated','description':'Repository\x20must\x20be\x20updated\x20with\x20cycle\x20content\x20hash','level':'soft','blocking':![]}],'evaluationImpact':[{'dimension':'content_commitment','effect':'required','description':'Delivery\x20proof\x20required\x20before\x20each\x20charge'},{'dimension':'timeout_protection','effect':'boost','description':'Cycles\x20enforce\x20regular\x20delivery'}],'industryFit':{'freelance':0x28,'education':0x55,'rental':0x1e,'retail':0x14,'subscription':0x62,'travel':0x1e,'licensing':0x28,'crowdfunding':0x19,'general':0x32},'addressesPainPoints':['Creator\x20abandons\x20after\x20collecting\x20subscriptions','Silent\x20auto-renewal\x20with\x20no\x20delivery\x20proof','No\x20mechanism\x20to\x20hold\x20creators\x20accountable'],'intentSignals':[/subscri/i,/recurring/i,/billing cycle/i,/auto[ -]?renew/i,/renewal/i,/membership/i],'userProtections':['Payment\x20only\x20after\x20delivery\x20proof\x20verified','Can\x20cancel\x20if\x20delivery\x20guard\x20fails','Cycle\x20history\x20on-chain'],'merchantObligations':['Must\x20deliver\x20content\x20and\x20commit\x20hash\x20each\x20cycle','Must\x20configure\x20delivery_guard\x20per\x20cycle'],'requiresKeeper':!![],'keeperHint':'Keeper\x20triggers\x20cycle\x20transitions\x20and\x20verifies\x20delivery_guard\x20conditions'},{'id':'accept_timeout_protection','name':'Accept\x20Timeout\x20Protection','description':'If\x20user\x20does\x20not\x20accept/reject\x20within\x20N\x20days,\x20auto-accept\x20advances\x20the\x20Machine.\x20Protects\x20merchant\x20from\x20indefinite\x20stalls.','objectTypes':['machine','guard'],'templateRefs':[{'template_id':'timeout-forward','object_type':'machine','purpose':'Forward\x20with\x20time_guard\x20+\x20adminUnhold\x20fallback'}],'requiredConstraints':[{'constraint_id':'time_guard_configured','description':'time_guard\x20must\x20be\x20set\x20on\x20accept\x20forward','level':'hard','blocking':!![]},{'constraint_id':'adminUnhold_permission','description':'Admin\x20must\x20have\x20PROGRESS_UNHOLD\x20(224)\x20permission','level':'soft','blocking':![]}],'evaluationImpact':[{'dimension':'timeout_protection','effect':'required','description':'Auto-advance\x20prevents\x20indefinite\x20user\x20stalls'},{'dimension':'operational_risk','effect':'boost','description':'Reduces\x20delivery\x20timeline\x20uncertainty'}],'industryFit':{'freelance':0x5f,'education':0x46,'rental':0x50,'retail':0x3c,'subscription':0x28,'travel':0x3c,'licensing':0x55,'crowdfunding':0x46,'general':0x4b},'addressesPainPoints':['Buyer\x20never\x20approves\x20deliverables\x20(common\x20on\x20incumbent\x20talent\x20marketplaces)','Merchant\x20cash\x20flow\x20blocked\x20by\x20inactive\x20buyer','Infinite\x20revision\x20loops\x20without\x20resolution'],'intentSignals':[/timeout/i,/time[ -]?out/i,/auto[ -]?accept/i,/never (approves?|responds?|accepts?)/i,/unresponsive/i,/inactive (buyer|client)/i,/\bstall/i,/\bdeadline\b/i],'userProtections':['Still\x20has\x20full\x20N\x20days\x20to\x20review\x20and\x20reject','Rejection\x20triggers\x20arbitration\x20if\x20configured'],'merchantObligations':['Must\x20configure\x20time_guard\x20on\x20forward','Timeout\x20value\x20comes\x20from\x20the\x20template\x27s\x20window\x20fee_params\x20(e.g.\x20escrow_release_days;\x20override\x20per\x20build\x20via\x20fee_overrides)\x20—\x20never\x20a\x20hardcoded\x20number'],'requiresKeeper':!![],'keeperHint':'Keeper\x20monitors\x20time_guard\x20deadlines\x20and\x20advances\x20the\x20timeout\x20forward\x20when\x20the\x20window\x20elapses\x20(adminUnhold\x20is\x20only\x20the\x20hold-release\x20escape\x20hatch,\x20never\x20the\x20timeout\x20path)'},{'id':'refund_guarantee','name':'Refund\x20Guarantee','description':'Service\x20maintains\x20compensation_fund\x20for\x20refunds.\x20Refund_guard\x20validates\x20eligibility\x20and\x20transfers\x20funds\x20back\x20to\x20Order.','objectTypes':['service','guard','order'],'templateRefs':[{'template_id':'refund-guard','object_type':'guard','purpose':'Validate\x20refund\x20eligibility'}],'requiredConstraints':[{'constraint_id':'compensation_fund_positive','description':'compensation_fund_add\x20>\x200','level':'hard','blocking':!![]},{'constraint_id':'refund_guard_configured','description':'Service\x20must\x20have\x20refund_guard','level':'soft','blocking':![]}],'evaluationImpact':[{'dimension':'fund_safety','effect':'boost','description':'Compensation\x20fund\x20backs\x20refund\x20promise'},{'dimension':'consumer_diligence','effect':'boost','description':'Shows\x20merchant\x20confidence\x20in\x20service\x20quality'}],'industryFit':{'freelance':0x46,'education':0x55,'rental':0x5a,'retail':0x5f,'subscription':0x50,'travel':0x55,'licensing':0x4b,'crowdfunding':0x5f,'general':0x50},'addressesPainPoints':['Refund\x20trapped\x20in\x20incumbent\x20platform\x20balance','No\x20refund\x20mechanism\x20for\x20service\x20failure','Refund\x20decision\x20centralized\x20at\x20platform'],'intentSignals':[/refund/i,/money[ -]?back/i,/guarantee/i],'userProtections':['Refund\x20goes\x20back\x20to\x20Order\x20(not\x20platform\x20balance)','Guard\x20validates\x20eligibility\x20(not\x20platform\x20discretion)','Compensation\x20fund\x20guarantees\x20liquidity'],'merchantObligations':['Must\x20maintain\x20compensation_fund\x20>\x200','Must\x20configure\x20refund_guard\x20rules'],'requiresKeeper':![]},{'id':'reputation_on_chain','name':'On-Chain\x20Reputation','description':'Merchant\x20and\x20user\x20behavior\x20permanently\x20recorded\x20on\x20Registrar.\x20Evaluations,\x20completions,\x20and\x20disputes\x20contribute\x20to\x20reputation\x20score.','objectTypes':['service','order','arb'],'templateRefs':[],'requiredConstraints':[{'constraint_id':'service_published','description':'Service\x20must\x20be\x20published\x20to\x20accumulate\x20reputation','level':'soft','blocking':![]}],'evaluationImpact':[{'dimension':'reputation_verifiability','effect':'required','description':'On-chain\x20history\x20is\x20tamper-proof'},{'dimension':'trust','effect':'boost','description':'Reputation\x20signals\x20reduce\x20information\x20asymmetry'}],'industryFit':{'freelance':0x5a,'education':0x50,'rental':0x55,'retail':0x5a,'subscription':0x55,'travel':0x50,'licensing':0x50,'crowdfunding':0x41,'general':0x55},'addressesPainPoints':['Fake\x20reviews\x20and\x20rating\x20manipulation','No\x20cross-platform\x20reputation\x20portability','Platform\x20can\x20delete\x20negative\x20reviews'],'intentSignals':[/reputation/i,/\breviews?\b/i,/\brating/i,/track record/i,/feedback/i],'userProtections':['Reputation\x20is\x20on-chain\x20and\x20immutable','Can\x20verify\x20merchant\x27s\x20complete\x20transaction\x20history','Dispute\x20outcomes\x20affect\x20reputation\x20permanently'],'merchantObligations':['All\x20service\x20interactions\x20become\x20part\x20of\x20permanent\x20record','Cannot\x20hide\x20negative\x20outcomes'],'requiresKeeper':![]},{'id':'supplier_collaboration','name':'Supplier\x20Collaboration','description':'Enable\x20merchant\x20to\x20delegate\x20sub-services\x20to\x20suppliers\x20with\x20transparent\x20payment\x20splitting.\x20No\x20platform\x20intermediary.','objectTypes':['service','allocation','demand'],'templateRefs':[{'template_id':'supplier-demand','object_type':'demand','purpose':'Create\x20sub-service\x20demand\x20for\x20suppliers'},{'template_id':'supplier-allocation','object_type':'allocation','purpose':'Split\x20order\x20payment\x20with\x20suppliers'}],'requiredConstraints':[{'constraint_id':'demand_configured','description':'Demand\x20must\x20reference\x20main\x20Service','level':'soft','blocking':![]},{'constraint_id':'allocation_sharing_configured','description':'Allocation\x20sharing\x20must\x20include\x20suppliers','level':'hard','blocking':!![]}],'evaluationImpact':[{'dimension':'supplier_visibility','effect':'required','description':'Supplier\x20payments\x20transparent\x20on-chain'},{'dimension':'governance_risk','effect':'boost','description':'No\x20platform\x20controls\x20supplier\x20relationships'}],'industryFit':{'freelance':0x3c,'education':0x46,'rental':0x28,'retail':0x55,'subscription':0x32,'travel':0x5a,'licensing':0x41,'crowdfunding':0x1e,'general':0x3c},'addressesPainPoints':['Supplier\x20payments\x20opaque\x20to\x20end\x20user','Platform\x20controls\x20supplier\x20relationships','No\x20direct\x20merchant-supplier\x20collaboration'],'intentSignals':[/supplier/i,/subcontract/i,/outsourc/i,/vendor/i,/sub[ -]?service/i,/delegate to/i],'userProtections':['Can\x20see\x20all\x20suppliers\x20involved\x20in\x20service','Supplier\x20payments\x20are\x20on-chain\x20auditable','Merchant\x20remains\x20accountable\x20for\x20supplier\x20quality'],'merchantObligations':['Must\x20declare\x20all\x20suppliers\x20upfront','Must\x20ensure\x20supplier\x20deliverables\x20meet\x20criteria'],'requiresKeeper':![]},{'id':'damage_attestation','name':'Damage\x20Attestation','description':'Rental-specific:\x20pre/post\x20condition\x20photos\x20hashed\x20to\x20Repository.\x20Guard\x20compares\x20hashes\x20to\x20automatically\x20enforce\x20damage\x20deductions.','objectTypes':['repository','guard','service'],'templateRefs':[{'template_id':'rental-condition-guard','object_type':'guard','purpose':'Compare\x20pre/post\x20rental\x20condition\x20hashes'},{'template_id':'condition-repository','object_type':'repository','purpose':'Store\x20rental\x20condition\x20evidence'}],'requiredConstraints':[{'constraint_id':'pre_rental_hash','description':'Pre-rental\x20condition\x20hash\x20must\x20be\x20committed','level':'hard','blocking':!![]},{'constraint_id':'post_rental_hash','description':'Post-rental\x20condition\x20hash\x20must\x20be\x20committed','level':'hard','blocking':!![]}],'evaluationImpact':[{'dimension':'proof_integrity','effect':'required','description':'Condition\x20hashes\x20prevent\x20tampering'},{'dimension':'arbitration_fairness','effect':'boost','description':'Objective\x20evidence\x20reduces\x20dispute\x20bias'}],'industryFit':{'freelance':0x14,'education':0x1e,'rental':0x62,'retail':0x28,'subscription':0x14,'travel':0x3c,'licensing':0x19,'crowdfunding':0x14,'general':0x28},'addressesPainPoints':['Landlord\x20claims\x20damage\x20without\x20proof\x20(common\x20on\x20incumbent\x20short-stay\x20platforms)','No\x20mandatory\x20pre-rental\x20photo\x20(vehicle-rental\x20damage\x20claims\x20denied)','Platform\x20arbitrates\x20damage\x20disputes\x20opaquely'],'intentSignals':[/damage/i,/condition (photo|report|check|record)/i,/pre[ -]?rental/i,/post[ -]?rental/i,/attest/i,/wear and tear/i],'userProtections':['Pre-rental\x20hash\x20commits\x20baseline\x20condition','Guard\x20automatically\x20compares\x20post-rental\x20state','Cannot\x20be\x20charged\x20for\x20pre-existing\x20damage'],'merchantObligations':['Must\x20commit\x20pre-rental\x20condition\x20hash','Must\x20commit\x20post-rental\x20condition\x20hash','Must\x20use\x20Repository\x20for\x20evidence\x20storage'],'requiresKeeper':!![],'keeperHint':'Keeper\x20triggers\x20post-rental\x20hash\x20collection\x20and\x20initiates\x20damage\x20Guard\x20comparison'},{'id':'discount_lifecycle','name':'Discount\x20Lifecycle','description':'Coupon\x20promotions\x20bound\x20to\x20a\x20Service\x20(percentage\x20or\x20fixed-amount\x20off):\x20minted\x20to\x20recipients,\x20redeemed\x20automatically\x20at\x20buy,\x20burned\x20on\x20use.\x20Chain\x20truth:\x20a\x20redeemed\x20coupon\x27s\x20balance\x20decrements\x20PERMANENTLY\x20(no\x20restock,\x20no\x20revert),\x20and\x20standing\x20renewal\x20discounts\x20are\x20NOT\x20constructible\x20(the\x20renew\x20path\x20has\x20no\x20discount\x20hook\x20—\x20every\x20renewal\x20re-prices\x20from\x20the\x20SKU\x20price).','objectTypes':['service'],'templateRefs':[],'requiredConstraints':[{'constraint_id':'discount_budget_planned','description':'Total\x20discount\x20budget\x20(max_uses\x20x\x20discount_value)\x20planned\x20before\x20minting\x20—\x20the\x20burn\x20is\x20irreversible','level':'hard','blocking':!![]},{'constraint_id':'discount_burn_disclosed','description':'Burn-on-use\x20semantics\x20(permanent\x20decrement,\x20no\x20revert)\x20disclosed\x20in\x20the\x20promotion\x20terms','level':'hard','blocking':!![]},{'constraint_id':'discount_renewal_disclosed','description':'\x27First\x20period\x20X%\x20off,\x20then\x20standard\x27\x20disclosed\x20in\x20the\x20listing/WIP\x20BEFORE\x20purchase\x20(renewals\x20re-price\x20from\x20the\x20SKU\x20price\x20—\x20anti-dark-pattern)','level':'soft','blocking':![]}],'evaluationImpact':[{'dimension':'promotion_integrity','effect':'required','description':'Coupon\x20budget\x20and\x20burn\x20semantics\x20are\x20planned\x20and\x20disclosed,\x20never\x20improvised'},{'dimension':'fee_transparency','effect':'boost','description':'The\x20discounted\x20price\x20at\x20redemption\x20is\x20computed\x20by\x20the\x20chain,\x20not\x20asserted\x20by\x20prose'}],'industryFit':{'freelance':0x2d,'education':0x46,'rental':0x32,'retail':0x5f,'subscription':0x55,'travel':0x50,'licensing':0x3c,'crowdfunding':0x37,'general':0x46},'addressesPainPoints':['Coupon\x20systems\x20locked\x20inside\x20incumbent\x20platforms','Promotions\x20improvised\x20after\x20publish\x20with\x20no\x20budget\x20plan','Discount\x20promises\x20that\x20silently\x20change\x20at\x20renewal'],'intentSignals':[/coupon/i,/discount/i,/\bpromo/i,/voucher/i,/percentage off/i,/first[ -]?period off/i],'userProtections':['Redemption\x20is\x20computed\x20on-chain\x20at\x20buy\x20(no\x20manual\x20discount\x20approval)','Renewal\x20price\x20is\x20the\x20SKU\x20price\x20—\x20a\x20first-period\x20coupon\x20cannot\x20silently\x20renew\x20at\x20the\x20discounted\x20price','Expired\x20coupons\x20cannot\x20redeem'],'merchantObligations':['Plan\x20the\x20total\x20discount\x20budget\x20(max_uses\x20x\x20value)\x20before\x20minting','Disclose\x20burn-on-use\x20and\x20renewal\x20re-pricing\x20in\x20the\x20promotion\x20terms','Never\x20promise\x20a\x20standing\x20renewal\x20discount\x20(not\x20constructible\x20on-chain)'],'requiresKeeper':![]},{'id':'praise_incentive','name':'Review\x20Praise\x20Incentive','description':'Sale-time-planned\x20claim\x20Reward\x20for\x20buyer\x20reviews\x20(template\x20review_mode\x20\x27review_reward\x27):\x20the\x20build\x20emits\x20the\x20Reward\x20object,\x20attaches\x20the\x20replay-armed\x20claim\x20guard,\x20binds\x20it\x20to\x20the\x20Service,\x20and\x20funds\x20it\x20via\x20the\x20reward_funding\x20input\x20—\x20so\x20the\x20incentive\x20is\x20perceivable\x20by\x20the\x20buyer\x20BEFORE\x20ordering,\x20and\x20an\x20unfunded\x20or\x20unguarded\x20incentive\x20promise\x20must\x20not\x20publish.','objectTypes':['service','reward','guard'],'templateRefs':[],'requiredConstraints':[{'constraint_id':'reward_pool_funded','description':'reward_funding\x20input\x20present\x20at\x20build\x20(an\x20unfunded\x20incentive\x20promise\x20must\x20not\x20publish)','level':'hard','blocking':!![]},{'constraint_id':'reward_claim_replay_armed','description':'Claim\x20guard\x20carries\x20the\x20record-gate\x20idempotency\x20leg\x20(replay-drain\x20target\x20otherwise)','level':'hard','blocking':!![]}],'evaluationImpact':[{'dimension':'trust','effect':'boost','description':'Funded,\x20perceivable\x20review\x20incentives\x20raise\x20honest\x20review\x20volume'},{'dimension':'promotion_integrity','effect':'required','description':'Incentive\x20terms\x20are\x20chain-enforced\x20(funded\x20pool\x20+\x20guarded\x20claim),\x20not\x20prose\x20promises'}],'industryFit':{'freelance':0x4b,'education':0x41,'rental':0x2d,'retail':0x55,'subscription':0x4b,'travel':0x41,'licensing':0x2d,'crowdfunding':0x2d,'general':0x41},'addressesPainPoints':['No\x20mechanism\x20to\x20incentivize\x20honest\x20buyer\x20reviews','Review\x20rewards\x20locked\x20inside\x20incumbent\x20platforms','Incentive\x20promises\x20that\x20evaporate\x20after\x20purchase'],'intentSignals':[/incentive/i,/reward/i,/cashback/i,/rebate/i,/bonus/i,/\btips?\b/i],'userProtections':['Incentive\x20perceivable\x20BEFORE\x20ordering\x20(funded\x20at\x20build,\x20not\x20after)','Claim\x20terms\x20chain-enforced\x20with\x20replay\x20protection','Rating\x20polarity\x20recorded\x20as\x20range-queryable\x20on-chain\x20rows\x20(1-5\x20rating\x20column)'],'merchantObligations':['Fund\x20the\x20reward\x20pool\x20at\x20build\x20time\x20(reward_funding)','Keep\x20the\x20claim\x20guard\x20replay-armed\x20(record-gate\x20leg)','Disclose\x20claim\x20terms\x20in\x20the\x20listing/WIP\x20promise'],'requiresKeeper':![]},{'id':'after_sales_guarantee','name':'After-Sales\x20Guarantee','description':'Declared\x20buyer\x20after-sales\x20remedy\x20(template\x20after_sales_mode\x20\x27return\x27\x20|\x20\x27exchange\x27\x20|\x20\x27warranty\x27):\x20the\x20machine_shape\x20ships\x20the\x20backing\x20rail\x20(e.g.\x20return_requested\x20->\x20returned),\x20riding\x20a\x20claimed_by\x20polarity\x20pair\x20—\x20the\x20refund\x20leg\x20pays\x20the\x20buyer\x20at\x20claimed_by\x20none,\x20the\x20merchant-recovery\x20leg\x20at\x20claimed_by\x20some\x20—\x20with\x20the\x20remedy\x20window\x20anchored\x20on\x20the\x20delivered\x20ENTRY\x20time\x20so\x20a\x20buyer\x20cannot\x20stall\x20the\x20merchant,\x20and\x20de-conflicted\x20against\x20settlement\x20so\x20refund\x20and\x20ruling\x20payouts\x20never\x20double-pay.','objectTypes':['machine','guard','allocation','order'],'templateRefs':[],'requiredConstraints':[{'constraint_id':'after_sales_rail_present','description':'machine_shape\x20carries\x20a\x20node\x20backing\x20the\x20declared\x20after_sales_mode\x20(compile\x20AFTER_SALES_RAIL_MISSING\x20/\x20scanner\x20R-AFTER-SALES-RAIL)','level':'hard','blocking':!![]},{'constraint_id':'after_sales_polarity_pair','description':'refund\x20leg\x20claimed_by\x20some==false\x20paired\x20with\x20merchant-recovery\x20leg\x20some==true\x20(INV-C1,\x20RAIL_POLARITY_COLLISION\x20backstop)','level':'hard','blocking':!![]},{'constraint_id':'after_sales_window_anchored','description':'remedy\x20window\x20anchored\x20on\x20the\x20delivered\x20ENTRY\x20time,\x20not\x20a\x20drifting\x20current_time\x20(INV-C2,\x20TIME-ANCHOR-01)','level':'hard','blocking':!![]},{'constraint_id':'after_sales_no_double_remedy','description':'after-sales\x20refund\x20and\x20arbitration/award\x20payout\x20are\x20mutually\x20exclusive\x20rails\x20(INV-C3,\x20DUAL-RAIL-01)','level':'soft','blocking':![]}],'evaluationImpact':[{'dimension':'fund_safety','effect':'required','description':'The\x20claimed_by\x20polarity\x20pair\x20means\x20an\x20order\x20is\x20refunded\x20OR\x20recovered,\x20never\x20both'},{'dimension':'consumer_diligence','effect':'boost','description':'A\x20declared,\x20structurally-backed\x20remedy\x20window\x20is\x20verifiable\x20before\x20purchase'}],'industryFit':{'freelance':0x28,'education':0x2d,'rental':0x46,'retail':0x62,'subscription':0x23,'travel':0x37,'licensing':0x41,'crowdfunding':0x37,'general':0x3c},'addressesPainPoints':['Return/refund\x20policy\x20locked\x20inside\x20incumbent\x20platforms','No\x20enforced\x20return\x20window\x20—\x20buyer\x20stalls\x20or\x20merchant\x20refuses','Refund\x20and\x20dispute\x20payout\x20both\x20fire\x20(double-pay)','Exchange/warranty\x20promised\x20in\x20prose\x20with\x20no\x20on-chain\x20rail'],'intentSignals':[/after[ -]?sales/i,/\breturn/i,/exchange/i,/warranty/i,/remedy/i],'userProtections':['Remedy\x20window\x20is\x20chain-anchored\x20on\x20delivery\x20entry\x20(verifiable,\x20not\x20merchant\x20discretion)','Refund\x20returns\x20to\x20the\x20Order\x20(not\x20a\x20platform\x20balance)','The\x20polarity\x20pair\x20guarantees\x20exactly\x20one\x20remedy\x20pays'],'merchantObligations':['Ship\x20the\x20backing\x20rail\x20for\x20the\x20declared\x20after_sales_mode','Anchor\x20the\x20remedy\x20window\x20on\x20the\x20delivered\x20entry\x20time','Keep\x20the\x20refund\x20and\x20recovery\x20legs\x20a\x20claimed_by\x20polarity\x20pair\x20(never\x20both\x20satisfiable)'],'requiresKeeper':![]},{'id':'acceptance_judging','name':'Acceptance\x20&\x20Judging','description':'Declared\x20acceptance_mode\x20(\x27milestone\x27\x20|\x20\x27contest\x27\x20|\x20\x27bounty\x27\x20|\x20\x27agent\x27):\x20who\x20decides\x20the\x20escrow\x20releases\x20and\x20how\x20many\x20redelivery\x20rounds\x20are\x20allowed.\x20A\x20judge-decided\x20mode\x20routes\x20the\x20release\x20decision\x20to\x20an\x20independent\x20venue\x20(arbitration_mode\x20\x27third_party\x27)\x20so\x20the\x20payout-owing\x20party\x20never\x20self-adjudicates;\x20a\x20finite\x20revision_rounds_max\x20is\x20backed\x20by\x20a\x20counter\x20Repository\x20guard\x20because\x20the\x20chain\x20bounds\x20edges,\x20not\x20visits;\x20the\x20acceptance\x20and\x20timeout\x20siblings\x20are\x20distinct\x20forwards\x20so\x20the\x20buyer\x27s\x20approval\x20and\x20the\x20auto-accept\x20deadline\x20never\x20race\x20into\x20one\x20node.','objectTypes':['machine','guard','allocation','arb','repository'],'templateRefs':[],'requiredConstraints':[{'constraint_id':'acceptance_judge_independent','description':'a\x20judge-decided\x20acceptance_mode\x20(contest/bounty/agent)\x20declares\x20arbitration_mode\x20\x27third_party\x27\x20(INV-A3,\x20compile\x20ACCEPTANCE_JUDGE_NOT_INDEPENDENT\x20/\x20scanner\x20R-ACCEPTANCE-JUDGE)','level':'hard','blocking':!![]},{'constraint_id':'acceptance_revision_bounded','description':'a\x20finite\x20revision_rounds_max\x20is\x20backed\x20by\x20a\x20counter\x20Repository\x20guard,\x20or\x20declared\x20\x27unlimited\x27\x20(INV-A1,\x20compile\x20ACCEPTANCE_REVISION_UNBOUNDED\x20/\x20scanner\x20R-ACCEPTANCE-REVISION)','level':'hard','blocking':!![]},{'constraint_id':'acceptance_race_free','description':'the\x20acceptance\x20forward\x20and\x20its\x20timeout\x20complement\x20are\x20distinct\x20siblings,\x20never\x20a\x20dual-prev\x20race\x20into\x20one\x20node\x20(INV-A2,\x20widened\x20R-REVIEW-NORACE)','level':'soft','blocking':![]}],'evaluationImpact':[{'dimension':'arbitration_fairness','effect':'required','description':'A\x20judge-decided\x20release\x20routes\x20through\x20an\x20independent\x20venue,\x20not\x20the\x20payout-owing\x20party'},{'dimension':'fund_safety','effect':'boost','description':'A\x20finite\x20revision\x20cap\x20the\x20chain\x20can\x20actually\x20enforce\x20(counter-backed)\x20prevents\x20an\x20unbounded\x20redelivery\x20drain'},{'dimension':'operational_risk','effect':'boost','description':'Distinct\x20accept/timeout\x20siblings\x20keep\x20the\x20buyer\x27s\x20decision\x20and\x20the\x20auto-accept\x20deadline\x20from\x20deadlocking\x20the\x20node'}],'industryFit':{'freelance':0x60,'education':0x37,'rental':0x1e,'retail':0x23,'subscription':0x1e,'travel':0x28,'licensing':0x4b,'crowdfunding':0x23,'general':0x3c},'addressesPainPoints':['Contest/bounty\x20winner\x20picked\x20by\x20the\x20party\x20holding\x20the\x20escrow\x20(self-adjudication)','Revision\x20rounds\x20promised\x20as\x20finite\x20in\x20prose\x20but\x20unbounded\x20on-chain\x20(progress.move\x20caps\x20edges,\x20not\x20visits)','Buyer\x20approval\x20and\x20auto-accept\x20timeout\x20racing\x20into\x20one\x20node\x20(deadlock\x20or\x20double-advance)','Agent-task\x20evaluator\x20not\x20identity-bound\x20to\x20the\x20delivery'],'intentSignals':[/acceptance/i,/judg(e|ing)/i,/contest/i,/bounty/i,/revision/i,/redeliver/i,/deliverable approv/i,/who decides/i],'userProtections':['A\x20judge-decided\x20release\x20is\x20ruled\x20by\x20an\x20independent\x20venue,\x20verifiable\x20before\x20purchase','A\x20finite\x20revision\x20cap\x20is\x20genuinely\x20enforceable\x20(counter\x20guard),\x20not\x20a\x20prose\x20promise','Auto-accept\x20only\x20fires\x20on\x20its\x20own\x20distinct\x20timeout\x20forward,\x20never\x20by\x20racing\x20the\x20buyer\x27s\x20decision'],'merchantObligations':['Declare\x20arbitration_mode\x20\x27third_party\x27\x20for\x20any\x20judge-decided\x20acceptance_mode','Back\x20a\x20finite\x20revision_rounds_max\x20with\x20a\x20counter\x20Repository\x20guard,\x20or\x20declare\x20it\x20\x27unlimited\x27\x20honestly','Keep\x20the\x20acceptance\x20and\x20timeout\x20forwards\x20distinct\x20siblings\x20(distinct\x20forward\x20names)'],'requiresKeeper':!![],'keeperHint':'A\x20judge-decided\x20acceptance\x20needs\x20a\x20keeper\x20to\x20push\x20the\x20ruling/placement\x20terminal\x20forward\x20once\x20the\x20independent\x20venue\x20decides;\x20the\x20accept-timeout\x20forward\x20also\x20needs\x20a\x20keeper\x20at\x20the\x20window\x20deadline'},{'id':'installment_deposit','name':'Installment\x20&\x20Deposit','description':'Declared\x20installment_mode\x20(\x27deposit_balance\x27\x20|\x20\x27milestone_n\x27):\x20the\x20buyer\x20pays\x20in\x20stages\x20—\x20a\x20deposit\x20now\x20and\x20the\x20balance\x20later,\x20or\x20N\x20milestone\x20captures.\x20Each\x20later\x20capture\x20rides\x20the\x20one-PTB\x20order_renew\x20call\x20(fund\x20+\x20record\x20+\x20advance).\x20PRE-STATE\x20CONSTRAINT\x20(esound-mn-261021\x20B-1,\x20mainnet-verified):\x20a\x20guard\x20reading\x20allocation.balance\x20sees\x20only\x20the\x20COMMITTED\x20pre-transaction\x20balance\x20—\x20the\x20same-PTB\x20payment\x20is\x20INVISIBLE\x20to\x20it,\x20so\x20a\x20balance-gated\x20capture\x20forward\x20ALWAYS\x20aborts\x20when\x20advanced\x20by\x20order_renew.\x20A\x20capture\x20forward\x20therefore\x20EITHER\x20binds\x20the\x20fund\x20gate\x20and\x20draws\x20on\x20funds\x20committed\x20in\x20a\x20prior\x20transaction\x20(prepaid-full\x20at\x20buy\x20—\x20staged-release\x20semantics),\x20OR\x20is\x20gate-less\x20and\x20relies\x20on\x20this\x20module\x27s\x20order_renew\x20routing\x20to\x20land\x20the\x20funds;\x20every\x20deposit-held\x20state\x20carries\x20a\x20refund/cancel\x20exit\x20rail\x20(a\x20full\x20refund\x20or\x20a\x20declared\x20kill\x20fee)\x20because\x20the\x20chain\x20imposes\x20no\x20obligation\x20to\x20pay\x20the\x20balance,\x20so\x20a\x20buyer\x20who\x20walks\x20away\x20never\x20strands\x20the\x20paid\x20portion.','objectTypes':['machine','guard','allocation','order','payment'],'templateRefs':[],'requiredConstraints':[{'constraint_id':'installment_funding_gated','description':'every\x20capture\x20forward\x20(a\x20due\x20state\x20advancing\x20into\x20a\x20paid\x20state)\x20either\x20binds\x20a\x20fund-gate\x20Guard\x20reading\x20allocation.balance\x20(satisfiable\x20only\x20against\x20funds\x20committed\x20in\x20a\x20PRIOR\x20transaction\x20—\x20prepaid\x20shape,\x20INV-B1,\x20compile\x20INSTALLMENT_FUNDING_UNGATED\x20/\x20scanner\x20R-INSTALLMENT-FUNDING)\x20or\x20is\x20gate-less\x20and\x20relies\x20on\x20the\x20order_renew\x20routing\x20to\x20land\x20the\x20funds\x20same-PTB\x20(a\x20balance\x20gate\x20+\x20same-PTB\x20order_renew\x20ALWAYS\x20aborts\x20—\x20esound-mn-261021\x20B-1)','level':'soft','blocking':![]},{'constraint_id':'installment_deposit_exit','description':'every\x20deposit-held\x20state\x20carries\x20a\x20refund/cancel/forfeit\x20exit\x20rail\x20so\x20the\x20paid\x20portion\x20is\x20never\x20stranded\x20(INV-B2,\x20compile\x20INSTALLMENT_DEPOSIT_STRANDED\x20/\x20scanner\x20R-INSTALLMENT-DEPOSIT)','level':'soft','blocking':![]},{'constraint_id':'installment_release_once','description':'the\x20release\x20allocator\x20is\x20once_per_order\x20and\x20order-anchored\x20so\x20a\x20replay\x20cannot\x20re-capture\x20(INV-B3,\x20rides\x20the\x20existing\x20E-2\x20/\x20once-slot\x20/\x20order-anchor\x20audit)','level':'soft','blocking':![]}],'evaluationImpact':[{'dimension':'fund_safety','effect':'required','description':'The\x20capture\x20cannot\x20zero-value-advance:\x20gate-less\x20captures\x20land\x20funds\x20via\x20the\x20order_renew\x20routing;\x20balance-gated\x20captures\x20draw\x20on\x20prior-transaction\x20funds\x20(PRE-STATE\x20CONSTRAINT\x20—\x20same-PTB\x20funding\x20is\x20invisible\x20to\x20guards,\x20esound-mn-261021\x20B-1)'},{'dimension':'consumer_diligence','effect':'boost','description':'A\x20declared\x20deposit-exit\x20policy\x20(full\x20refund\x20vs\x20kill\x20fee)\x20is\x20verifiable\x20before\x20the\x20buyer\x20commits\x20the\x20deposit'},{'dimension':'operational_risk','effect':'boost','description':'once_per_order\x20+\x20order\x20anchor\x20on\x20the\x20release\x20keeps\x20a\x20replay\x20from\x20re-capturing\x20or\x20double-releasing'}],'industryFit':{'freelance':0x46,'education':0x2d,'rental':0x37,'retail':0x5a,'subscription':0x28,'travel':0x32,'licensing':0x1e,'crowdfunding':0x37,'general':0x3c},'addressesPainPoints':['Pre-order\x20/\x20deposit-then-balance\x20sales\x20locked\x20inside\x20incumbent\x20platforms','A\x20later\x20payment\x20recorded\x20without\x20the\x20funds\x20actually\x20landing\x20(zero-value\x20advance)','A\x20buyer\x20who\x20walks\x20away\x20strands\x20the\x20deposit\x20with\x20no\x20on-chain\x20exit','Milestone\x20billing\x20where\x20a\x20replay\x20re-charges\x20or\x20double-releases'],'intentSignals':[/installment/i,/deposit/i,/pay in stages/i,/down[ -]?payment/i,/balance (later|afterwards?)/i,/part(ial)? payment/i,/staged? payment/i],'userProtections':['A\x20capture\x20forward\x20cannot\x20zero-value-advance\x20(gate-less\x20captures\x20land\x20funds\x20via\x20the\x20order_renew\x20routing;\x20balance-gated\x20captures\x20require\x20prior-transaction\x20funds)','The\x20deposit-exit\x20policy\x20is\x20declared\x20and\x20structurally\x20backed\x20before\x20purchase','The\x20release\x20is\x20once-per-order\x20and\x20order-anchored,\x20so\x20no\x20replay\x20double-charges'],'merchantObligations':['Give\x20every\x20capture\x20forward\x20a\x20funding\x20story:\x20gate-less\x20+\x20order_renew\x20routing,\x20or\x20a\x20balance\x20fund\x20gate\x20fed\x20by\x20PRIOR-transaction\x20funds\x20(prepaid\x20shape\x20—\x20a\x20gate\x20plus\x20same-PTB\x20order_renew\x20always\x20aborts,\x20esound-mn-261021\x20B-1)','Ship\x20a\x20deposit-exit\x20rail\x20(refund\x20or\x20declared\x20kill\x20fee)\x20from\x20every\x20deposit-held\x20state','Make\x20the\x20release\x20allocator\x20once_per_order\x20and\x20order-anchored','Disclose\x20the\x20deposit\x20amount,\x20balance\x20window,\x20and\x20exit\x20policy\x20in\x20the\x20listing/WIP\x20promise'],'requiresKeeper':!![],'keeperHint':'The\x20balance-window\x20deadline\x20(a\x20buyer\x20who\x20never\x20pays\x20the\x20balance)\x20needs\x20a\x20keeper\x20to\x20drive\x20the\x20deposit-exit\x20rail\x20at\x20the\x20window\x20close;\x20a\x20milestone\x20capture\x20timeout\x20likewise'},{'id':'affiliate_commission','name':'Affiliate\x20Commission','description':'Declared\x20affiliate_mode\x20(\x27commission\x27):\x20the\x20merchant\x20sells\x20through\x20referral/affiliate\x20partners\x20and\x20owes\x20the\x20referring\x20partner\x20an\x20independent\x20commission\x20leg.\x20The\x20commission\x20is\x20window-anchored\x20—\x20it\x20accrues\x20at\x20attribution\x20but\x20is\x20claimable\x20only\x20after\x20the\x20attribution/refund\x20window\x20closes,\x20so\x20an\x20in-window\x20refund\x20never\x20has\x20to\x20reverse\x20an\x20already-paid\x20partner\x20(the\x20chain\x20has\x20no\x20debit/clawback\x20primitive,\x20so\x20a\x20released\x20commission\x20is\x20unrecoverable\x20and\x20the\x20template\x20must\x20disclose\x20that\x20honestly).\x20The\x20commission\x20leg\x20is\x20an\x20INDEPENDENT\x20allocation\x20off\x20a\x20dedicated\x20pool,\x20never\x20a\x20drain\x20of\x20the\x20buyer\x27s\x20goods\x20escrow.','objectTypes':['machine','guard','allocation','repository'],'templateRefs':[],'requiredConstraints':[{'constraint_id':'affiliate_rail_present','description':'a\x20declared\x20commission\x20overlay\x20has\x20a\x20commission-family\x20machine\x20node\x20or\x20a\x20commission\x20allocator\x20row,\x20and\x20the\x20leg\x20is\x20INDEPENDENT\x20of\x20the\x20goods\x20escrow\x20(INV-D3,\x20compile\x20AFFILIATE_RAIL_MISSING\x20/\x20scanner\x20R-AFFILIATE-RAIL)','level':'soft','blocking':![]},{'constraint_id':'affiliate_clawback_disclosed','description':'a\x20build_note\x20discloses\x20the\x20post-lock\x20no-clawback\x20truth\x20—\x20a\x20released\x20commission\x20cannot\x20be\x20reversed\x20on\x20chain\x20(INV-D2,\x20compile\x20AFFILIATE_CLAWBACK_UNDISCLOSED\x20/\x20scanner\x20R-AFFILIATE-DISCLOSURE)','level':'soft','blocking':![]},{'constraint_id':'affiliate_window_anchored','description':'the\x20commission\x20claim\x20is\x20gated\x20by\x20a\x20window-anchored\x20guard\x20so\x20it\x20is\x20claimable\x20only\x20after\x20the\x20attribution/refund\x20window\x20closes\x20(INV-D1,\x20rides\x20the\x20generic\x20TIME-ANCHOR-01\x20audit)','level':'soft','blocking':![]}],'evaluationImpact':[{'dimension':'fund_safety','effect':'required','description':'The\x20commission\x20leg\x20is\x20an\x20independent\x20allocation\x20off\x20its\x20own\x20pool,\x20never\x20a\x20Surplus/Rate\x20drain\x20of\x20the\x20buyer\x27s\x20goods\x20escrow\x20(防抢池)'},{'dimension':'consumer_diligence','effect':'boost','description':'The\x20post-lock\x20no-clawback\x20truth\x20is\x20disclosed\x20before\x20purchase,\x20so\x20a\x20buyer/merchant\x20never\x20assumes\x20a\x20reversal\x20the\x20chain\x20cannot\x20do'},{'dimension':'operational_risk','effect':'boost','description':'The\x20window\x20anchor\x20means\x20an\x20in-window\x20refund\x20never\x20has\x20to\x20reverse\x20an\x20already-paid\x20partner\x20—\x20the\x20unrecoverable\x20surface\x20is\x20minimized\x20by\x20construction'}],'industryFit':{'freelance':0x3c,'education':0x37,'rental':0x23,'retail':0x50,'subscription':0x41,'travel':0x3c,'licensing':0x46,'crowdfunding':0x3c,'general':0x3c},'addressesPainPoints':['Referral/affiliate\x20payouts\x20locked\x20inside\x20incumbent\x20affiliate\x20networks\x20with\x20opaque\x20attribution','A\x20commission\x20drained\x20from\x20the\x20buyer\x27s\x20goods\x20escrow\x20instead\x20of\x20an\x20independent\x20pool\x20(抢池)','A\x20refund\x20after\x20commission\x20release\x20falsely\x20assumed\x20to\x20claw\x20back\x20the\x20partner\x20payout\x20(no\x20on-chain\x20debit\x20exists)','Attribution\x20claimed\x20instantly,\x20before\x20the\x20refund\x20window,\x20then\x20unrecoverable\x20when\x20the\x20order\x20refunds'],'intentSignals':[/affiliate/i,/referral/i,/referr/i,/commission/i,/revenue[ -]?shar/i,/partner[ -]?payout/i],'userProtections':['The\x20commission\x20is\x20paid\x20from\x20a\x20dedicated\x20pool,\x20so\x20the\x20buyer\x27s\x20goods\x20escrow\x20is\x20never\x20drained\x20by\x20the\x20partner\x20leg','The\x20post-lock\x20no-clawback\x20reality\x20is\x20disclosed\x20before\x20purchase,\x20not\x20discovered\x20at\x20refund\x20time','The\x20commission\x20is\x20only\x20claimable\x20after\x20the\x20attribution/refund\x20window\x20closes,\x20so\x20an\x20in-window\x20refund\x20is\x20clean'],'merchantObligations':['Route\x20the\x20commission\x20through\x20an\x20INDEPENDENT\x20allocation\x20leg\x20to\x20an\x20explicit\x20non-empty\x20partner\x20Entity','Gate\x20the\x20claim\x20with\x20a\x20window-anchored\x20guard\x20(claimable\x20only\x20after\x20the\x20attribution/refund\x20window)','Disclose\x20the\x20post-lock\x20no-clawback\x20truth\x20in\x20a\x20build_note\x20and\x20the\x20listing\x20promise','Declare\x20the\x20commission\x20rate/bps\x20and\x20the\x20attribution\x20window\x20in\x20the\x20listing\x20so\x20a\x20partner\x20can\x20price\x20it\x20before\x20referral'],'requiresKeeper':!![],'keeperHint':'The\x20attribution/refund\x20window\x20deadline\x20needs\x20a\x20keeper\x20to\x20open\x20the\x20commission\x20claim\x20once\x20the\x20window\x20closes\x20(the\x20claim\x20guard\x27s\x20time\x20gate\x20arms\x20at\x20entry_time\x20+\x20window)'},{'id':'crowdfunding','name':'Crowdfunding\x20Campaign','description':'Declared\x20crowdfunding_mode\x20(\x27threshold\x27\x20all-or-nothing\x20/\x20\x27flexible\x27\x20keep-it-all):\x20backers\x20each\x20escrow\x20a\x20contribution\x20in\x20its\x20OWN\x20unpooled\x20Allocation\x20(for_object\x20=\x20their\x20order,\x20never\x20balance-joined,\x20so\x20attribution\x20survives).\x20A\x20shared\x20campaign\x20Repository\x20records\x20one\x20writer-bound\x20numeric\x20row\x20per\x20contribution\x20(id_from\x20signer,\x20value\x20=\x20amount).\x20At\x20an\x20ABSOLUTE\x20campaign\x20deadline\x20a\x20settlement\x20guard\x20reads\x20the\x20on-chain\x20aggregate\x20(repository.data\x20sum-where,\x20query\x201174\x20→\x20U256)\x20and\x20decides:\x20aggregate\x20>=\x20goal\x20→\x20release\x20every\x20contribution\x20to\x20the\x20project\x20Entity;\x20aggregate\x20<\x20goal\x20(threshold\x20model)\x20→\x20refund\x20each\x20backer\x20their\x20own\x20contribution\x20(slot\x200\x20—\x20the\x20submitted\x20Order,\x20extracted\x20by\x20owner_receive;\x20NEVER\x20slot\x20254\x20on\x20a\x20refund\x20rail).\x20The\x20flexible\x20model\x20has\x20no\x20goal\x20and\x20no\x20refund\x20leg\x20—\x20contributions\x20release\x20at\x20the\x20deadline\x20and\x20are\x20non-refundable\x20(disclosed).\x20The\x20aggregate\x20is\x20attested-roster\x20evidence,\x20not\x20a\x20chain-verified\x20custody\x20proof;\x20a\x20raise\x20is\x20never\x20an\x20investment.','objectTypes':['machine','guard','allocation','repository'],'templateRefs':[],'requiredConstraints':[{'constraint_id':'crowdfunding_exit_rail_present','description':'a\x20declared\x20campaign\x20has\x20a\x20release/settlement\x20rail,\x20and\x20a\x20threshold\x20campaign\x20additionally\x20has\x20a\x20refund\x20rail\x20—\x20the\x20two-leg\x20escrow-exit\x20(release\x20XOR\x20refund,\x20D-BUG-2)\x20so\x20contributions\x20never\x20strand\x20at\x20the\x20deadline\x20(INV-E1,\x20compile\x20CROWDFUNDING_THRESHOLD_GATE_MISSING\x20/\x20scanner\x20R-CROWDFUNDING-RAIL)','level':'soft','blocking':![]},{'constraint_id':'crowdfunding_aggregate_writer_bound','description':'a\x20threshold\x20aggregate\x20reads\x20a\x20repository.data\x20sum-where\x20over\x20WRITER-BOUND\x20rows\x20(id_from\x20signer\x20+\x20an\x20identity\x20write_guard\x20order.owner==Signer),\x20never\x20an\x20existence\x20read\x20(INV-E2\x20/\x20R-X1-17,\x20compile\x20CROWDFUNDING_AGGREGATE_UNBOUND\x20/\x20scanner\x20R-CROWDFUNDING-AGGREGATE)','level':'soft','blocking':![]},{'constraint_id':'crowdfunding_disclosure_present','description':'build_notes\x20disclose\x20the\x20L-04\x20aggregate\x20trust\x20boundary\x20(threshold),\x20the\x20L-01\x20non-investment\x20statement,\x20the\x20L-05\x20KYC/AML\x20caution,\x20and\x20—\x20for\x20a\x20flexible\x20build\x20—\x20the\x20NO-REFUND\x20keep-it-all\x20posture\x20(INV-E3,\x20compile\x20CROWDFUNDING_DISCLOSURE_MISSING\x20/\x20scanner\x20R-CROWDFUNDING-DISCLOSURE)','level':'soft','blocking':![]}],'evaluationImpact':[{'dimension':'fund_safety','effect':'required','description':'Each\x20contribution\x20is\x20escrowed\x20UNPOOLED\x20(for_object\x20=\x20its\x20own\x20order,\x20never\x20balance::join)\x20so\x20a\x20missed\x20campaign\x20refunds\x20every\x20backer\x20their\x20OWN\x20money;\x20the\x20release/refund\x20legs\x20are\x20mutually\x20exclusive\x20(D-BUG-2)'},{'dimension':'consumer_diligence','effect':'boost','description':'The\x20aggregate-trust\x20boundary,\x20the\x20non-investment\x20posture\x20and\x20(flexible)\x20the\x20no-refund\x20reality\x20are\x20disclosed\x20before\x20contribution,\x20so\x20a\x20backer\x20never\x20assumes\x20a\x20chain-verified\x20custody\x20proof\x20or\x20a\x20refund\x20the\x20model\x20does\x20not\x20have'},{'dimension':'operational_risk','effect':'boost','description':'One\x20ABSOLUTE\x20shared\x20deadline\x20(not\x20per-order\x20entry+duration)\x20means\x20every\x20backer\x20settles\x20at\x20the\x20same\x20cutoff;\x20the\x20writer-bound\x20ledger\x20makes\x20the\x20raise\x20total\x20attributable\x20and\x20honest'}],'industryFit':{'freelance':0x1e,'education':0x28,'rental':0x14,'retail':0x3c,'subscription':0x23,'travel':0x19,'licensing':0x2d,'crowdfunding':0x64,'general':0x37},'addressesPainPoints':['An\x20all-or-nothing\x20raise\x20where\x20a\x20missed\x20goal\x20must\x20refund\x20every\x20backer,\x20but\x20pooled\x20custody\x20loses\x20per-backer\x20attribution','A\x20funding\x20total\x20presented\x20as\x20a\x20chain-verified\x20custody\x20proof\x20when\x20it\x20is\x20only\x20an\x20attested\x20sum\x20over\x20keeper-supplied\x20rows','A\x20backer\x20mistaking\x20a\x20flexible\x20keep-it-all\x20raise\x20for\x20a\x20refundable\x20all-or-nothing\x20campaign','Pooled\x20cross-border\x20fundraising\x20treated\x20as\x20a\x20casual\x20purchase\x20despite\x20HIGH\x20securities\x20/\x20money-transmission\x20/\x20KYC-AML\x20exposure'],'intentSignals':[/crowdfund/i,/\bbackers?\b/i,/campaign/i,/all[ -]?or[ -]?nothing/i,/fundrais/i,/\bpledge/i,/raise (funds|money)/i,/keep[ -]?it[ -]?all/i],'userProtections':['Each\x20contribution\x20is\x20escrowed\x20to\x20the\x20backer\x27s\x20OWN\x20order\x20(unpooled),\x20so\x20a\x20missed\x20threshold\x20refunds\x20exactly\x20their\x20money','The\x20aggregate-trust\x20boundary\x20and\x20the\x20non-investment\x20posture\x20are\x20disclosed\x20before\x20contribution','A\x20flexible\x20raise\x20states\x20the\x20NO-REFUND\x20keep-it-all\x20posture\x20up\x20front,\x20never\x20blurred\x20with\x20all-or-nothing','Delivery\x20after\x20a\x20successful\x20raise\x20is\x20backed\x20by\x20the\x20compensation\x20fund\x20+\x20third-party\x20arbitration'],'merchantObligations':['Escrow\x20each\x20contribution\x20UNPOOLED\x20(for_object\x20=\x20the\x20funder\x27s\x20order),\x20never\x20balance-joined\x20into\x20a\x20shared\x20pot','Bind\x20the\x20campaign\x20Repository\x20write_guard\x20to\x20the\x20contributing\x20backer\x20(id_from\x20signer,\x20order.owner==Signer)\x20so\x20the\x20aggregate\x20cannot\x20be\x20forged','Gate\x20release\x20on\x20the\x20sum-where\x20aggregate\x20ANDed\x20with\x20an\x20ABSOLUTE\x20shared\x20campaign\x20deadline;\x20pair\x20the\x20refund\x20leg\x20with\x20a\x20recover_gate\x20rail\x20(D-BUG-2)','Disclose\x20the\x20L-04\x20aggregate\x20trust\x20boundary,\x20the\x20L-01\x20non-investment\x20statement,\x20the\x20L-05\x20KYC/AML\x20caution,\x20and\x20(flexible)\x20the\x20no-refund\x20posture\x20in\x20build_notes\x20and\x20the\x20listing'],'requiresKeeper':!![],'keeperHint':'The\x20ABSOLUTE\x20campaign\x20deadline\x20needs\x20a\x20keeper\x20to\x20drive\x20settlement\x20once\x20Clock\x20>=\x20deadline:\x20on\x20a\x20met\x20goal\x20advance\x20each\x20order\x20to\x20the\x20release\x20terminal;\x20on\x20a\x20missed\x20threshold\x20enumerate\x20contributor\x20ids\x20via\x20find-where\x20(1176)\x20/\x20keys-where\x20(1177,\x20max\x20100\x20per\x20batch)\x20and\x20advance\x20each\x20refund\x20leg'}];export function getBusinessModule(a){return CORE_BUSINESS_MODULES['find'](b=>b['id']===a);}export function getModulesForIndustry(a){return[...CORE_BUSINESS_MODULES]['sort']((c,d)=>(d['industryFit'][a]??0x0)-(c['industryFit'][a]??0x0));}export function recommendModules(a,b,c){const d=c?.['minFit']??0x32,e=c?.['maxModules']??0x5,f=CORE_BUSINESS_MODULES['map'](g=>{let h=g['industryFit'][a]??0x32;const i=b['toLowerCase']();for(const j of g['addressesPainPoints']){const k=j['toLowerCase']()['split'](/\s+/),l=k['filter'](n=>i['includes'](n))['length'];h+=l*0x5;}return{'module':g,'score':Math['min'](h,0x64)};});return f['filter'](g=>g['score']>=d)['sort']((g,h)=>h['score']-g['score'])['slice'](0x0,e)['map'](g=>g['module']);}export function moduleHasIntentEvidence(a,b){if(!a['intentSignals']||a['intentSignals']['length']===0x0)return![];return a['intentSignals']['some'](c=>c['test'](b));}export function checkModuleConstraints(a,b,c){const d=a['requiredConstraints']['filter'](h=>h['blocking']&&!b['has'](h['constraint_id']))['map'](h=>h['constraint_id']),e=d['length']===0x0,f=a['evaluationImpact']['filter'](h=>h['effect']==='boost'||h['effect']==='required')['reduce']((h,i)=>h+(i['effect']==='required'?0xf:0x8),0x0),g=c?.['evidenceMatched']===![]?0x0:f;return{'module':a['id'],'adopted':e,'reason':e?undefined:'Missing\x20required\x20constraints:\x20'+d['join'](',\x20'),'missingConstraints':d['length']>0x0?d:undefined,'estimatedScoreBoost':Math['min'](g,0x64),'evidence_matched':c?.['evidenceMatched']};}export function calculateModuleScoreBoost(a){const b={};for(const c of a){for(const d of c['evaluationImpact']){const e=d['effect']==='required'?0xf:d['effect']==='boost'?0x8:0x3;b[d['dimension']]=(b[d['dimension']]??0x0)+e;}}return b;}
1
+ export const CORE_BUSINESS_MODULES=[{'id':'milestone_escrow','name':'Milestone\x20Escrow','description':'Funds\x20held\x20in\x20Order\x20and\x20released\x20per\x20milestone\x20completion.\x20Protects\x20both\x20merchant\x20and\x20user.','objectTypes':['service','machine','order','allocation'],'templateRefs':[{'template_id':'freelance-machine','object_type':'machine','purpose':'Milestone\x20workflow\x20with\x20accept/reject\x20nodes'},{'template_id':'milestone-allocation','object_type':'allocation','purpose':'Per-milestone\x20fund\x20release'}],'requiredConstraints':[{'constraint_id':'order_allocators_bound','description':'Order\x20must\x20have\x20allocators\x20bound\x20before\x20publish','level':'hard','blocking':!![]},{'constraint_id':'machine_published','description':'Machine\x20must\x20be\x20published\x20and\x20bound\x20to\x20Service','level':'hard','blocking':!![]},{'constraint_id':'milestone_forward_guarded','description':'Each\x20milestone\x20forward\x20must\x20have\x20a\x20guard','level':'soft','blocking':![]}],'evaluationImpact':[{'dimension':'fund_safety','effect':'boost','description':'Escrow\x20ensures\x20funds\x20not\x20released\x20until\x20verification'},{'dimension':'escrow_quality','effect':'required','description':'Module\x20requires\x20proper\x20escrow\x20configuration'},{'dimension':'operational_risk','effect':'boost','description':'Milestones\x20reduce\x20single-point\x20delivery\x20risk'}],'industryFit':{'freelance':0x5f,'education':0x50,'rental':0x3c,'retail':0x28,'subscription':0x1e,'travel':0x32,'licensing':0x55,'crowdfunding':0x55,'general':0x46},'addressesPainPoints':['Client\x20never\x20approves\x20deliverables','Merchant\x20delivers\x20but\x20cannot\x20get\x20paid','Full\x20upfront\x20payment\x20with\x20no\x20delivery\x20guarantee'],'intentSignals':[/milestone/i,/escrow/i,/pay(ment)? (per|on|at|upon) (each )?(milestone|stage|delivery|approval)/i,/staged? (payment|release)/i,/progress payment/i,/hold funds until/i],'userProtections':['Funds\x20held\x20in\x20escrow\x20until\x20milestone\x20verified','Can\x20reject\x20substandard\x20deliverables','Refund\x20for\x20unstarted\x20milestones'],'merchantObligations':['Must\x20deliver\x20each\x20milestone\x20to\x20defined\x20acceptance\x20criteria','Must\x20configure\x20Machine\x20with\x20proper\x20forward\x20guards'],'requiresKeeper':!![],'keeperHint':'Keeper\x20must\x20monitor\x20Machine\x20node\x20timeouts\x20and\x20trigger\x20adminUnhold\x20if\x20user\x20does\x20not\x20respond'},{'id':'independent_arbitration','name':'Independent\x20Arbitration','description':'Third-party\x20arbitration\x20with\x20Guard-weighted\x20voting.\x20Arbitration\x20Permission\x20MUST\x20differ\x20from\x20Service\x20Permission\x20(contract-enforced).','objectTypes':['arb','permission','guard'],'templateRefs':[{'template_id':'arbitration-3-voters','object_type':'arb','purpose':'3-voter\x20arbitration\x20with\x20weighted\x20voting'},{'template_id':'voting-guard-weighted','object_type':'guard','purpose':'Vote\x20weight\x20from\x20Guard\x20config'}],'requiredConstraints':[{'constraint_id':'arbitration_permission_independent','description':'Arbitration.permission\x20!=\x20Service.permission','level':'hard','blocking':!![]},{'constraint_id':'voting_guard_configured','description':'At\x20least\x20one\x20voting_guard\x20must\x20be\x20configured','level':'soft','blocking':![]},{'constraint_id':'arbitration_bound_to_service','description':'Arbitration\x20must\x20be\x20in\x20Service.arbitrations\x20list','level':'hard','blocking':!![]}],'evaluationImpact':[{'dimension':'arbitration_coverage','effect':'required','description':'Module\x20requires\x20arbitration\x20configuration'},{'dimension':'arbitration_fairness','effect':'required','description':'Independent\x20permission\x20ensures\x20neutrality'},{'dimension':'governance_risk','effect':'boost','description':'Reduces\x20platform-as-judge\x20risk'}],'industryFit':{'freelance':0x5a,'education':0x4b,'rental':0x55,'retail':0x4b,'subscription':0x3c,'travel':0x50,'licensing':0x5a,'crowdfunding':0x50,'general':0x46},'addressesPainPoints':['Platform\x20acts\x20as\x20both\x20judge\x20and\x20party','Arbitration\x20fees\x20too\x20high\x20for\x20small\x20claims','No\x20binding\x20dispute\x20resolution'],'intentSignals':[/arbitrat/i,/dispute/i,/mediat/i,/third[ -]?party (resolution|judgement|judgment|venue)/i,/voting/i,/ruling/i,/appeal/i],'userProtections':['Independent\x20arbitrators\x20(not\x20merchant\x20or\x20platform)','Guard-weighted\x20voting\x20prevents\x20Sybil\x20attacks','Micro-arbitration:\x20no\x20per-case\x20fees'],'merchantObligations':['Must\x20accept\x20arbitration\x20verdict','Must\x20maintain\x20compensation_fund\x20for\x20indemnities'],'requiresKeeper':![]},{'id':'wip_provenance','name':'WIP\x20Provenance','description':'Work-in-progress\x20hash\x20commitments\x20on-chain\x20via\x20Repository.\x20Prevents\x20tampering\x20of\x20delivery\x20evidence.','objectTypes':['repository','guard','proof'],'templateRefs':[{'template_id':'wip-hash-guard','object_type':'guard','purpose':'Verify\x20WIP\x20hash\x20matches\x20commitment'},{'template_id':'delivery-proof','object_type':'proof','purpose':'On-chain\x20delivery\x20confirmation'}],'requiredConstraints':[{'constraint_id':'repository_published','description':'Repository\x20must\x20be\x20published','level':'hard','blocking':!![]},{'constraint_id':'wip_hash_before_delivery','description':'WIP\x20hash\x20must\x20be\x20committed\x20before\x20delivery','level':'soft','blocking':![]}],'evaluationImpact':[{'dimension':'proof_integrity','effect':'required','description':'WIP\x20hash\x20provides\x20tamper-proof\x20evidence'},{'dimension':'transparency','effect':'boost','description':'On-chain\x20commitment\x20is\x20publicly\x20verifiable'}],'industryFit':{'freelance':0x5a,'education':0x55,'rental':0x5f,'retail':0x46,'subscription':0x3c,'travel':0x46,'licensing':0x5f,'crowdfunding':0x55,'general':0x4b},'addressesPainPoints':['Evidence\x20stored\x20on\x20platform\x20servers\x20can\x20be\x20tampered','No\x20proof\x20of\x20pre-delivery\x20state\x20(e.g.\x20rental\x20condition)','Dispute\x20resolution\x20relies\x20on\x20trust\x20in\x20platform'],'intentSignals':[/\bwip\b/i,/work[ -]?in[ -]?progress/i,/\bhash\b/i,/evidence/i,/tamper/i,/proof of (work|progress|delivery)/i],'userProtections':['WIP\x20hash\x20commitment\x20is\x20immutable\x20on-chain','Guard\x20automatically\x20verifies\x20hash\x20match','Repository\x20history\x20is\x20auditable'],'merchantObligations':['Must\x20commit\x20WIP\x20hash\x20at\x20defined\x20checkpoints','Must\x20use\x20Repository\x20for\x20evidence\x20storage'],'requiresKeeper':![]},{'id':'multi_tier_allocation','name':'Multi-Tier\x20Allocation','description':'Order\x20funds\x20automatically\x20split\x20among\x20multiple\x20recipients.\x20Fully\x20transparent\x20on-chain.','objectTypes':['allocation','treasury','payment'],'templateRefs':[{'template_id':'multi-tier-allocation','object_type':'allocation','purpose':'Waterfall\x20fund\x20distribution'},{'template_id':'supplier-waterfall','object_type':'allocation','purpose':'Supplier\x20payment\x20tiers'}],'requiredConstraints':[{'constraint_id':'allocators_configured','description':'Allocators\x20must\x20be\x20configured\x20with\x20recipients','level':'hard','blocking':!![]},{'constraint_id':'sharing_sum_100','description':'Allocation\x20percentages\x20must\x20sum\x20to\x20100%','level':'hard','blocking':!![]},{'constraint_id':'platform_fee_zero','description':'Platform\x20fee\x20should\x20be\x200\x20or\x20user-defined','level':'soft','blocking':![]}],'evaluationImpact':[{'dimension':'fee_transparency','effect':'required','description':'All\x20allocations\x20visible\x20on-chain'},{'dimension':'supplier_visibility','effect':'boost','description':'Supplier\x20payments\x20are\x20auditable'}],'industryFit':{'freelance':0x3c,'education':0x32,'rental':0x28,'retail':0x50,'subscription':0x46,'travel':0x5f,'licensing':0x62,'crowdfunding':0x50,'general':0x46},'addressesPainPoints':['Multi-layer\x20commission\x20hidden\x20from\x20users','Suppliers\x20paid\x20opaquely','Platform\x20takes\x20undisclosed\x20FX\x20spread'],'intentSignals':[/multi[ -]?tier/i,/waterfall/i,/\bsplit/i,/divide/i,/distribut/i,/tiered payout/i],'userProtections':['Full\x20allocation\x20waterfall\x20visible\x20on-chain','No\x20hidden\x20fees','Can\x20verify\x20supplier\x20payments'],'merchantObligations':['Must\x20declare\x20all\x20allocation\x20recipients\x20upfront','Cannot\x20change\x20allocation\x20after\x20publish'],'requiresKeeper':![]},{'id':'subscription_with_proof','name':'Subscription\x20with\x20Delivery\x20Proof','description':'Each\x20billing\x20cycle\x20requires\x20proof\x20of\x20content\x20delivery\x20before\x20charging.\x20Prevents\x20creator\x20abandonment.','objectTypes':['service','guard','repository','progress'],'templateRefs':[{'template_id':'subscription-machine','object_type':'machine','purpose':'Cycle-based\x20workflow'},{'template_id':'delivery-guard-cycle','object_type':'guard','purpose':'Verify\x20content\x20delivery\x20per\x20cycle'}],'requiredConstraints':[{'constraint_id':'delivery_guard_per_cycle','description':'Each\x20cycle\x20must\x20have\x20a\x20delivery\x20guard','level':'hard','blocking':!![]},{'constraint_id':'repository_updated','description':'Repository\x20must\x20be\x20updated\x20with\x20cycle\x20content\x20hash','level':'soft','blocking':![]}],'evaluationImpact':[{'dimension':'content_commitment','effect':'required','description':'Delivery\x20proof\x20required\x20before\x20each\x20charge'},{'dimension':'timeout_protection','effect':'boost','description':'Cycles\x20enforce\x20regular\x20delivery'}],'industryFit':{'freelance':0x28,'education':0x55,'rental':0x1e,'retail':0x14,'subscription':0x62,'travel':0x1e,'licensing':0x28,'crowdfunding':0x19,'general':0x32},'addressesPainPoints':['Creator\x20abandons\x20after\x20collecting\x20subscriptions','Silent\x20auto-renewal\x20with\x20no\x20delivery\x20proof','No\x20mechanism\x20to\x20hold\x20creators\x20accountable'],'intentSignals':[/subscri/i,/recurring/i,/billing cycle/i,/auto[ -]?renew/i,/renewal/i,/membership/i],'userProtections':['Payment\x20only\x20after\x20delivery\x20proof\x20verified','Can\x20cancel\x20if\x20delivery\x20guard\x20fails','Cycle\x20history\x20on-chain'],'merchantObligations':['Must\x20deliver\x20content\x20and\x20commit\x20hash\x20each\x20cycle','Must\x20configure\x20delivery_guard\x20per\x20cycle'],'requiresKeeper':!![],'keeperHint':'Keeper\x20triggers\x20cycle\x20transitions\x20and\x20verifies\x20delivery_guard\x20conditions'},{'id':'accept_timeout_protection','name':'Accept\x20Timeout\x20Protection','description':'If\x20user\x20does\x20not\x20accept/reject\x20within\x20N\x20days,\x20auto-accept\x20advances\x20the\x20Machine.\x20Protects\x20merchant\x20from\x20indefinite\x20stalls.','objectTypes':['machine','guard'],'templateRefs':[{'template_id':'timeout-forward','object_type':'machine','purpose':'Forward\x20with\x20time_guard\x20+\x20adminUnhold\x20fallback'}],'requiredConstraints':[{'constraint_id':'time_guard_configured','description':'time_guard\x20must\x20be\x20set\x20on\x20accept\x20forward','level':'hard','blocking':!![]},{'constraint_id':'adminUnhold_permission','description':'Admin\x20must\x20have\x20PROGRESS_UNHOLD\x20(224)\x20permission','level':'soft','blocking':![]}],'evaluationImpact':[{'dimension':'timeout_protection','effect':'required','description':'Auto-advance\x20prevents\x20indefinite\x20user\x20stalls'},{'dimension':'operational_risk','effect':'boost','description':'Reduces\x20delivery\x20timeline\x20uncertainty'}],'industryFit':{'freelance':0x5f,'education':0x46,'rental':0x50,'retail':0x3c,'subscription':0x28,'travel':0x3c,'licensing':0x55,'crowdfunding':0x46,'general':0x4b},'addressesPainPoints':['Buyer\x20never\x20approves\x20deliverables\x20(common\x20on\x20incumbent\x20talent\x20marketplaces)','Merchant\x20cash\x20flow\x20blocked\x20by\x20inactive\x20buyer','Infinite\x20revision\x20loops\x20without\x20resolution'],'intentSignals':[/timeout/i,/time[ -]?out/i,/auto[ -]?accept/i,/never (approves?|responds?|accepts?)/i,/unresponsive/i,/inactive (buyer|client)/i,/\bstall/i,/\bdeadline\b/i],'userProtections':['Still\x20has\x20full\x20N\x20days\x20to\x20review\x20and\x20reject','Rejection\x20triggers\x20arbitration\x20if\x20configured'],'merchantObligations':['Must\x20configure\x20time_guard\x20on\x20forward','Timeout\x20value\x20comes\x20from\x20the\x20template\x27s\x20window\x20fee_params\x20(e.g.\x20escrow_release_days;\x20override\x20per\x20build\x20via\x20fee_overrides)\x20—\x20never\x20a\x20hardcoded\x20number'],'requiresKeeper':!![],'keeperHint':'Keeper\x20monitors\x20time_guard\x20deadlines\x20and\x20advances\x20the\x20timeout\x20forward\x20when\x20the\x20window\x20elapses\x20(adminUnhold\x20is\x20only\x20the\x20hold-release\x20escape\x20hatch,\x20never\x20the\x20timeout\x20path)'},{'id':'refund_guarantee','name':'Refund\x20Guarantee','description':'Service\x20maintains\x20compensation_fund\x20for\x20refunds.\x20Refund_guard\x20validates\x20eligibility\x20and\x20transfers\x20funds\x20back\x20to\x20Order.','objectTypes':['service','guard','order'],'templateRefs':[{'template_id':'refund-guard','object_type':'guard','purpose':'Validate\x20refund\x20eligibility'}],'requiredConstraints':[{'constraint_id':'compensation_fund_positive','description':'compensation_fund_add\x20>\x200','level':'hard','blocking':!![]},{'constraint_id':'refund_guard_configured','description':'Service\x20must\x20have\x20refund_guard','level':'soft','blocking':![]}],'evaluationImpact':[{'dimension':'fund_safety','effect':'boost','description':'Compensation\x20fund\x20backs\x20refund\x20promise'},{'dimension':'consumer_diligence','effect':'boost','description':'Shows\x20merchant\x20confidence\x20in\x20service\x20quality'}],'industryFit':{'freelance':0x46,'education':0x55,'rental':0x5a,'retail':0x5f,'subscription':0x50,'travel':0x55,'licensing':0x4b,'crowdfunding':0x5f,'general':0x50},'addressesPainPoints':['Refund\x20trapped\x20in\x20incumbent\x20platform\x20balance','No\x20refund\x20mechanism\x20for\x20service\x20failure','Refund\x20decision\x20centralized\x20at\x20platform'],'intentSignals':[/refund/i,/money[ -]?back/i,/guarantee/i],'userProtections':['Refund\x20goes\x20back\x20to\x20Order\x20(not\x20platform\x20balance)','Guard\x20validates\x20eligibility\x20(not\x20platform\x20discretion)','Compensation\x20fund\x20guarantees\x20liquidity'],'merchantObligations':['Must\x20maintain\x20compensation_fund\x20>\x200','Must\x20configure\x20refund_guard\x20rules'],'requiresKeeper':![]},{'id':'reputation_on_chain','name':'On-Chain\x20Reputation','description':'Merchant\x20and\x20user\x20behavior\x20permanently\x20recorded\x20on\x20Registrar.\x20Evaluations,\x20completions,\x20and\x20disputes\x20contribute\x20to\x20reputation\x20score.','objectTypes':['service','order','arb'],'templateRefs':[],'requiredConstraints':[{'constraint_id':'service_published','description':'Service\x20must\x20be\x20published\x20to\x20accumulate\x20reputation','level':'soft','blocking':![]}],'evaluationImpact':[{'dimension':'reputation_verifiability','effect':'required','description':'On-chain\x20history\x20is\x20tamper-proof'},{'dimension':'trust','effect':'boost','description':'Reputation\x20signals\x20reduce\x20information\x20asymmetry'}],'industryFit':{'freelance':0x5a,'education':0x50,'rental':0x55,'retail':0x5a,'subscription':0x55,'travel':0x50,'licensing':0x50,'crowdfunding':0x41,'general':0x55},'addressesPainPoints':['Fake\x20reviews\x20and\x20rating\x20manipulation','No\x20cross-platform\x20reputation\x20portability','Platform\x20can\x20delete\x20negative\x20reviews'],'intentSignals':[/reputation/i,/\breviews?\b/i,/\brating/i,/track record/i,/feedback/i],'userProtections':['Reputation\x20is\x20on-chain\x20and\x20immutable','Can\x20verify\x20merchant\x27s\x20complete\x20transaction\x20history','Dispute\x20outcomes\x20affect\x20reputation\x20permanently'],'merchantObligations':['All\x20service\x20interactions\x20become\x20part\x20of\x20permanent\x20record','Cannot\x20hide\x20negative\x20outcomes'],'requiresKeeper':![]},{'id':'supplier_collaboration','name':'Supplier\x20Collaboration','description':'Enable\x20merchant\x20to\x20delegate\x20sub-services\x20to\x20suppliers\x20with\x20transparent\x20payment\x20splitting.\x20No\x20platform\x20intermediary.','objectTypes':['service','allocation','demand'],'templateRefs':[{'template_id':'supplier-demand','object_type':'demand','purpose':'Create\x20sub-service\x20demand\x20for\x20suppliers'},{'template_id':'supplier-allocation','object_type':'allocation','purpose':'Split\x20order\x20payment\x20with\x20suppliers'}],'requiredConstraints':[{'constraint_id':'demand_configured','description':'Demand\x20must\x20reference\x20main\x20Service','level':'soft','blocking':![]},{'constraint_id':'allocation_sharing_configured','description':'Allocation\x20sharing\x20must\x20include\x20suppliers','level':'hard','blocking':!![]}],'evaluationImpact':[{'dimension':'supplier_visibility','effect':'required','description':'Supplier\x20payments\x20transparent\x20on-chain'},{'dimension':'governance_risk','effect':'boost','description':'No\x20platform\x20controls\x20supplier\x20relationships'}],'industryFit':{'freelance':0x3c,'education':0x46,'rental':0x28,'retail':0x55,'subscription':0x32,'travel':0x5a,'licensing':0x41,'crowdfunding':0x1e,'general':0x3c},'addressesPainPoints':['Supplier\x20payments\x20opaque\x20to\x20end\x20user','Platform\x20controls\x20supplier\x20relationships','No\x20direct\x20merchant-supplier\x20collaboration'],'intentSignals':[/supplier/i,/subcontract/i,/outsourc/i,/vendor/i,/sub[ -]?service/i,/delegate to/i],'userProtections':['Can\x20see\x20all\x20suppliers\x20involved\x20in\x20service','Supplier\x20payments\x20are\x20on-chain\x20auditable','Merchant\x20remains\x20accountable\x20for\x20supplier\x20quality'],'merchantObligations':['Must\x20declare\x20all\x20suppliers\x20upfront','Must\x20ensure\x20supplier\x20deliverables\x20meet\x20criteria'],'requiresKeeper':![]},{'id':'damage_attestation','name':'Damage\x20Attestation','description':'Rental-specific:\x20pre/post\x20condition\x20photos\x20hashed\x20to\x20Repository.\x20Guard\x20compares\x20hashes\x20to\x20automatically\x20enforce\x20damage\x20deductions.','objectTypes':['repository','guard','service'],'templateRefs':[{'template_id':'rental-condition-guard','object_type':'guard','purpose':'Compare\x20pre/post\x20rental\x20condition\x20hashes'},{'template_id':'condition-repository','object_type':'repository','purpose':'Store\x20rental\x20condition\x20evidence'}],'requiredConstraints':[{'constraint_id':'pre_rental_hash','description':'Pre-rental\x20condition\x20hash\x20must\x20be\x20committed','level':'hard','blocking':!![]},{'constraint_id':'post_rental_hash','description':'Post-rental\x20condition\x20hash\x20must\x20be\x20committed','level':'hard','blocking':!![]}],'evaluationImpact':[{'dimension':'proof_integrity','effect':'required','description':'Condition\x20hashes\x20prevent\x20tampering'},{'dimension':'arbitration_fairness','effect':'boost','description':'Objective\x20evidence\x20reduces\x20dispute\x20bias'}],'industryFit':{'freelance':0x14,'education':0x1e,'rental':0x62,'retail':0x28,'subscription':0x14,'travel':0x3c,'licensing':0x19,'crowdfunding':0x14,'general':0x28},'addressesPainPoints':['Landlord\x20claims\x20damage\x20without\x20proof\x20(common\x20on\x20incumbent\x20short-stay\x20platforms)','No\x20mandatory\x20pre-rental\x20photo\x20(vehicle-rental\x20damage\x20claims\x20denied)','Platform\x20arbitrates\x20damage\x20disputes\x20opaquely'],'intentSignals':[/damage/i,/condition (photo|report|check|record)/i,/pre[ -]?rental/i,/post[ -]?rental/i,/attest/i,/wear and tear/i],'userProtections':['Pre-rental\x20hash\x20commits\x20baseline\x20condition','Guard\x20automatically\x20compares\x20post-rental\x20state','Cannot\x20be\x20charged\x20for\x20pre-existing\x20damage'],'merchantObligations':['Must\x20commit\x20pre-rental\x20condition\x20hash','Must\x20commit\x20post-rental\x20condition\x20hash','Must\x20use\x20Repository\x20for\x20evidence\x20storage'],'requiresKeeper':!![],'keeperHint':'Keeper\x20triggers\x20post-rental\x20hash\x20collection\x20and\x20initiates\x20damage\x20Guard\x20comparison'},{'id':'discount_lifecycle','name':'Discount\x20Lifecycle','description':'Coupon\x20promotions\x20bound\x20to\x20a\x20Service\x20(percentage\x20or\x20fixed-amount\x20off):\x20minted\x20to\x20recipients,\x20redeemed\x20automatically\x20at\x20buy,\x20burned\x20on\x20use.\x20Chain\x20truth:\x20a\x20redeemed\x20coupon\x27s\x20balance\x20decrements\x20PERMANENTLY\x20(no\x20restock,\x20no\x20revert),\x20and\x20standing\x20renewal\x20discounts\x20are\x20NOT\x20constructible\x20(the\x20renew\x20path\x20has\x20no\x20discount\x20hook\x20—\x20every\x20renewal\x20re-prices\x20from\x20the\x20SKU\x20price).','objectTypes':['service'],'templateRefs':[],'requiredConstraints':[{'constraint_id':'discount_budget_planned','description':'Total\x20discount\x20budget\x20(max_uses\x20x\x20discount_value)\x20planned\x20before\x20minting\x20—\x20the\x20burn\x20is\x20irreversible','level':'hard','blocking':!![]},{'constraint_id':'discount_burn_disclosed','description':'Burn-on-use\x20semantics\x20(permanent\x20decrement,\x20no\x20revert)\x20disclosed\x20in\x20the\x20promotion\x20terms','level':'hard','blocking':!![]},{'constraint_id':'discount_renewal_disclosed','description':'\x27First\x20period\x20X%\x20off,\x20then\x20standard\x27\x20disclosed\x20in\x20the\x20listing/WIP\x20BEFORE\x20purchase\x20(renewals\x20re-price\x20from\x20the\x20SKU\x20price\x20—\x20anti-dark-pattern)','level':'soft','blocking':![]}],'evaluationImpact':[{'dimension':'promotion_integrity','effect':'required','description':'Coupon\x20budget\x20and\x20burn\x20semantics\x20are\x20planned\x20and\x20disclosed,\x20never\x20improvised'},{'dimension':'fee_transparency','effect':'boost','description':'The\x20discounted\x20price\x20at\x20redemption\x20is\x20computed\x20by\x20the\x20chain,\x20not\x20asserted\x20by\x20prose'}],'industryFit':{'freelance':0x2d,'education':0x46,'rental':0x32,'retail':0x5f,'subscription':0x55,'travel':0x50,'licensing':0x3c,'crowdfunding':0x37,'general':0x46},'addressesPainPoints':['Coupon\x20systems\x20locked\x20inside\x20incumbent\x20platforms','Promotions\x20improvised\x20after\x20publish\x20with\x20no\x20budget\x20plan','Discount\x20promises\x20that\x20silently\x20change\x20at\x20renewal'],'intentSignals':[/coupon/i,/discount/i,/\bpromo/i,/voucher/i,/percentage off/i,/first[ -]?period off/i],'userProtections':['Redemption\x20is\x20computed\x20on-chain\x20at\x20buy\x20(no\x20manual\x20discount\x20approval)','Renewal\x20price\x20is\x20the\x20SKU\x20price\x20—\x20a\x20first-period\x20coupon\x20cannot\x20silently\x20renew\x20at\x20the\x20discounted\x20price','Expired\x20coupons\x20cannot\x20redeem'],'merchantObligations':['Plan\x20the\x20total\x20discount\x20budget\x20(max_uses\x20x\x20value)\x20before\x20minting','Disclose\x20burn-on-use\x20and\x20renewal\x20re-pricing\x20in\x20the\x20promotion\x20terms','Never\x20promise\x20a\x20standing\x20renewal\x20discount\x20(not\x20constructible\x20on-chain)'],'requiresKeeper':![]},{'id':'praise_incentive','name':'Review\x20Praise\x20Incentive','description':'Sale-time-planned\x20claim\x20Reward\x20for\x20buyer\x20reviews\x20(template\x20review_mode\x20\x27review_reward\x27):\x20the\x20build\x20emits\x20the\x20Reward\x20object,\x20attaches\x20the\x20replay-armed\x20claim\x20guard,\x20binds\x20it\x20to\x20the\x20Service,\x20and\x20funds\x20it\x20via\x20the\x20reward_funding\x20input\x20—\x20so\x20the\x20incentive\x20is\x20perceivable\x20by\x20the\x20buyer\x20BEFORE\x20ordering,\x20and\x20an\x20unfunded\x20or\x20unguarded\x20incentive\x20promise\x20must\x20not\x20publish.','objectTypes':['service','reward','guard'],'templateRefs':[],'requiredConstraints':[{'constraint_id':'reward_pool_funded','description':'reward_funding\x20input\x20present\x20at\x20build\x20(an\x20unfunded\x20incentive\x20promise\x20must\x20not\x20publish)','level':'hard','blocking':!![]},{'constraint_id':'reward_claim_replay_armed','description':'Claim\x20guard\x20carries\x20the\x20record-gate\x20idempotency\x20leg\x20(replay-drain\x20target\x20otherwise)','level':'hard','blocking':!![]}],'evaluationImpact':[{'dimension':'trust','effect':'boost','description':'Funded,\x20perceivable\x20review\x20incentives\x20raise\x20honest\x20review\x20volume'},{'dimension':'promotion_integrity','effect':'required','description':'Incentive\x20terms\x20are\x20chain-enforced\x20(funded\x20pool\x20+\x20guarded\x20claim),\x20not\x20prose\x20promises'}],'industryFit':{'freelance':0x4b,'education':0x41,'rental':0x2d,'retail':0x55,'subscription':0x4b,'travel':0x41,'licensing':0x2d,'crowdfunding':0x2d,'general':0x41},'addressesPainPoints':['No\x20mechanism\x20to\x20incentivize\x20honest\x20buyer\x20reviews','Review\x20rewards\x20locked\x20inside\x20incumbent\x20platforms','Incentive\x20promises\x20that\x20evaporate\x20after\x20purchase'],'intentSignals':[/incentive/i,/reward/i,/cashback/i,/rebate/i,/bonus/i,/\btips?\b/i],'userProtections':['Incentive\x20perceivable\x20BEFORE\x20ordering\x20(funded\x20at\x20build,\x20not\x20after)','Claim\x20terms\x20chain-enforced\x20with\x20replay\x20protection','Rating\x20polarity\x20recorded\x20as\x20range-queryable\x20on-chain\x20rows\x20(1-5\x20rating\x20column)'],'merchantObligations':['Fund\x20the\x20reward\x20pool\x20at\x20build\x20time\x20(reward_funding)','Keep\x20the\x20claim\x20guard\x20replay-armed\x20(record-gate\x20leg)','Disclose\x20claim\x20terms\x20in\x20the\x20listing/WIP\x20promise'],'requiresKeeper':![]},{'id':'after_sales_guarantee','name':'After-Sales\x20Guarantee','description':'Declared\x20buyer\x20after-sales\x20remedy\x20(template\x20after_sales_mode\x20\x27return\x27\x20|\x20\x27exchange\x27\x20|\x20\x27warranty\x27):\x20the\x20machine_shape\x20ships\x20the\x20backing\x20rail\x20(e.g.\x20return_requested\x20->\x20returned),\x20riding\x20a\x20claimed_by\x20polarity\x20pair\x20—\x20the\x20refund\x20leg\x20pays\x20the\x20buyer\x20at\x20claimed_by\x20none,\x20the\x20merchant-recovery\x20leg\x20at\x20claimed_by\x20some\x20—\x20with\x20the\x20remedy\x20window\x20anchored\x20on\x20the\x20delivered\x20ENTRY\x20time\x20so\x20a\x20buyer\x20cannot\x20stall\x20the\x20merchant,\x20and\x20de-conflicted\x20against\x20settlement\x20so\x20refund\x20and\x20ruling\x20payouts\x20never\x20double-pay.','objectTypes':['machine','guard','allocation','order'],'templateRefs':[],'requiredConstraints':[{'constraint_id':'after_sales_rail_present','description':'machine_shape\x20carries\x20a\x20node\x20backing\x20the\x20declared\x20after_sales_mode\x20(compile\x20AFTER_SALES_RAIL_MISSING\x20/\x20scanner\x20R-AFTER-SALES-RAIL)','level':'hard','blocking':!![]},{'constraint_id':'after_sales_polarity_pair','description':'refund\x20leg\x20claimed_by\x20some==false\x20paired\x20with\x20merchant-recovery\x20leg\x20some==true\x20(INV-C1,\x20RAIL_POLARITY_COLLISION\x20backstop)','level':'hard','blocking':!![]},{'constraint_id':'after_sales_window_anchored','description':'remedy\x20window\x20anchored\x20on\x20the\x20delivered\x20ENTRY\x20time,\x20not\x20a\x20drifting\x20current_time\x20(INV-C2,\x20TIME-ANCHOR-01)','level':'hard','blocking':!![]},{'constraint_id':'after_sales_no_double_remedy','description':'after-sales\x20refund\x20and\x20arbitration/award\x20payout\x20are\x20mutually\x20exclusive\x20rails\x20(INV-C3,\x20DUAL-RAIL-01)','level':'soft','blocking':![]}],'evaluationImpact':[{'dimension':'fund_safety','effect':'required','description':'The\x20claimed_by\x20polarity\x20pair\x20means\x20an\x20order\x20is\x20refunded\x20OR\x20recovered,\x20never\x20both'},{'dimension':'consumer_diligence','effect':'boost','description':'A\x20declared,\x20structurally-backed\x20remedy\x20window\x20is\x20verifiable\x20before\x20purchase'}],'industryFit':{'freelance':0x28,'education':0x2d,'rental':0x46,'retail':0x62,'subscription':0x23,'travel':0x37,'licensing':0x41,'crowdfunding':0x37,'general':0x3c},'addressesPainPoints':['Return/refund\x20policy\x20locked\x20inside\x20incumbent\x20platforms','No\x20enforced\x20return\x20window\x20—\x20buyer\x20stalls\x20or\x20merchant\x20refuses','Refund\x20and\x20dispute\x20payout\x20both\x20fire\x20(double-pay)','Exchange/warranty\x20promised\x20in\x20prose\x20with\x20no\x20on-chain\x20rail'],'intentSignals':[/after[ -]?sales/i,/\breturn/i,/exchange/i,/warranty/i,/remedy/i],'userProtections':['Remedy\x20window\x20is\x20chain-anchored\x20on\x20delivery\x20entry\x20(verifiable,\x20not\x20merchant\x20discretion)','Refund\x20returns\x20to\x20the\x20Order\x20(not\x20a\x20platform\x20balance)','The\x20polarity\x20pair\x20guarantees\x20exactly\x20one\x20remedy\x20pays'],'merchantObligations':['Ship\x20the\x20backing\x20rail\x20for\x20the\x20declared\x20after_sales_mode','Anchor\x20the\x20remedy\x20window\x20on\x20the\x20delivered\x20entry\x20time','Keep\x20the\x20refund\x20and\x20recovery\x20legs\x20a\x20claimed_by\x20polarity\x20pair\x20(never\x20both\x20satisfiable)'],'requiresKeeper':![]},{'id':'acceptance_judging','name':'Acceptance\x20&\x20Judging','description':'Declared\x20acceptance_mode\x20(\x27milestone\x27\x20|\x20\x27contest\x27\x20|\x20\x27bounty\x27\x20|\x20\x27agent\x27):\x20who\x20decides\x20the\x20escrow\x20releases\x20and\x20how\x20many\x20redelivery\x20rounds\x20are\x20allowed.\x20A\x20judge-decided\x20mode\x20routes\x20the\x20release\x20decision\x20to\x20an\x20independent\x20venue\x20(arbitration_mode\x20\x27third_party\x27)\x20so\x20the\x20payout-owing\x20party\x20never\x20self-adjudicates;\x20a\x20finite\x20revision_rounds_max\x20is\x20backed\x20by\x20a\x20counter\x20Repository\x20guard\x20because\x20the\x20chain\x20bounds\x20edges,\x20not\x20visits;\x20the\x20acceptance\x20and\x20timeout\x20siblings\x20are\x20distinct\x20forwards\x20so\x20the\x20buyer\x27s\x20approval\x20and\x20the\x20auto-accept\x20deadline\x20never\x20race\x20into\x20one\x20node.','objectTypes':['machine','guard','allocation','arb','repository'],'templateRefs':[],'requiredConstraints':[{'constraint_id':'acceptance_judge_independent','description':'a\x20judge-decided\x20acceptance_mode\x20(contest/bounty/agent)\x20declares\x20arbitration_mode\x20\x27third_party\x27\x20(INV-A3,\x20compile\x20ACCEPTANCE_JUDGE_NOT_INDEPENDENT\x20/\x20scanner\x20R-ACCEPTANCE-JUDGE)','level':'hard','blocking':!![]},{'constraint_id':'acceptance_revision_bounded','description':'a\x20finite\x20revision_rounds_max\x20is\x20backed\x20by\x20a\x20counter\x20Repository\x20guard,\x20or\x20declared\x20\x27unlimited\x27\x20(INV-A1,\x20compile\x20ACCEPTANCE_REVISION_UNBOUNDED\x20/\x20scanner\x20R-ACCEPTANCE-REVISION)','level':'hard','blocking':!![]},{'constraint_id':'acceptance_race_free','description':'the\x20acceptance\x20forward\x20and\x20its\x20timeout\x20complement\x20are\x20distinct\x20siblings,\x20never\x20a\x20dual-prev\x20race\x20into\x20one\x20node\x20(INV-A2,\x20widened\x20R-REVIEW-NORACE)','level':'soft','blocking':![]}],'evaluationImpact':[{'dimension':'arbitration_fairness','effect':'required','description':'A\x20judge-decided\x20release\x20routes\x20through\x20an\x20independent\x20venue,\x20not\x20the\x20payout-owing\x20party'},{'dimension':'fund_safety','effect':'boost','description':'A\x20finite\x20revision\x20cap\x20the\x20chain\x20can\x20actually\x20enforce\x20(counter-backed)\x20prevents\x20an\x20unbounded\x20redelivery\x20drain'},{'dimension':'operational_risk','effect':'boost','description':'Distinct\x20accept/timeout\x20siblings\x20keep\x20the\x20buyer\x27s\x20decision\x20and\x20the\x20auto-accept\x20deadline\x20from\x20deadlocking\x20the\x20node'}],'industryFit':{'freelance':0x60,'education':0x37,'rental':0x1e,'retail':0x23,'subscription':0x1e,'travel':0x28,'licensing':0x4b,'crowdfunding':0x23,'general':0x3c},'addressesPainPoints':['Contest/bounty\x20winner\x20picked\x20by\x20the\x20party\x20holding\x20the\x20escrow\x20(self-adjudication)','Revision\x20rounds\x20promised\x20as\x20finite\x20in\x20prose\x20but\x20unbounded\x20on-chain\x20(progress.move\x20caps\x20edges,\x20not\x20visits)','Buyer\x20approval\x20and\x20auto-accept\x20timeout\x20racing\x20into\x20one\x20node\x20(deadlock\x20or\x20double-advance)','Agent-task\x20evaluator\x20not\x20identity-bound\x20to\x20the\x20delivery'],'intentSignals':[/acceptance/i,/judg(e|ing)/i,/contest/i,/bounty/i,/revision/i,/redeliver/i,/deliverable approv/i,/who decides/i],'userProtections':['A\x20judge-decided\x20release\x20is\x20ruled\x20by\x20an\x20independent\x20venue,\x20verifiable\x20before\x20purchase','A\x20finite\x20revision\x20cap\x20is\x20genuinely\x20enforceable\x20(counter\x20guard),\x20not\x20a\x20prose\x20promise','Auto-accept\x20only\x20fires\x20on\x20its\x20own\x20distinct\x20timeout\x20forward,\x20never\x20by\x20racing\x20the\x20buyer\x27s\x20decision'],'merchantObligations':['Declare\x20arbitration_mode\x20\x27third_party\x27\x20for\x20any\x20judge-decided\x20acceptance_mode','Back\x20a\x20finite\x20revision_rounds_max\x20with\x20a\x20counter\x20Repository\x20guard,\x20or\x20declare\x20it\x20\x27unlimited\x27\x20honestly','Keep\x20the\x20acceptance\x20and\x20timeout\x20forwards\x20distinct\x20siblings\x20(distinct\x20forward\x20names)'],'requiresKeeper':!![],'keeperHint':'A\x20judge-decided\x20acceptance\x20needs\x20a\x20keeper\x20to\x20push\x20the\x20ruling/placement\x20terminal\x20forward\x20once\x20the\x20independent\x20venue\x20decides;\x20the\x20accept-timeout\x20forward\x20also\x20needs\x20a\x20keeper\x20at\x20the\x20window\x20deadline'},{'id':'installment_deposit','name':'Installment\x20&\x20Deposit','description':'Declared\x20installment_mode\x20(\x27deposit_balance\x27\x20|\x20\x27milestone_n\x27):\x20the\x20buyer\x20pays\x20in\x20stages\x20—\x20a\x20deposit\x20now\x20and\x20the\x20balance\x20later,\x20or\x20N\x20milestone\x20captures.\x20Each\x20later\x20capture\x20rides\x20the\x20one-PTB\x20order_renew\x20call\x20(fund\x20+\x20record\x20+\x20advance).\x20PRE-STATE\x20CONSTRAINT\x20(esound-mn-261021\x20B-1,\x20mainnet-verified):\x20a\x20guard\x20reading\x20allocation.balance\x20sees\x20only\x20the\x20COMMITTED\x20pre-transaction\x20balance\x20—\x20the\x20same-PTB\x20payment\x20is\x20INVISIBLE\x20to\x20it,\x20so\x20a\x20balance-gated\x20capture\x20forward\x20ALWAYS\x20aborts\x20when\x20advanced\x20by\x20order_renew.\x20A\x20capture\x20forward\x20therefore\x20EITHER\x20binds\x20the\x20fund\x20gate\x20and\x20draws\x20on\x20funds\x20committed\x20in\x20a\x20prior\x20transaction\x20(prepaid-full\x20at\x20buy\x20—\x20staged-release\x20semantics),\x20OR\x20is\x20gate-less\x20and\x20relies\x20on\x20this\x20module\x27s\x20order_renew\x20routing\x20to\x20land\x20the\x20funds;\x20every\x20deposit-held\x20state\x20carries\x20a\x20refund/cancel\x20exit\x20rail\x20(a\x20full\x20refund\x20or\x20a\x20declared\x20kill\x20fee)\x20because\x20the\x20chain\x20imposes\x20no\x20obligation\x20to\x20pay\x20the\x20balance,\x20so\x20a\x20buyer\x20who\x20walks\x20away\x20never\x20strands\x20the\x20paid\x20portion.','objectTypes':['machine','guard','allocation','order','payment'],'templateRefs':[],'requiredConstraints':[{'constraint_id':'installment_funding_gated','description':'every\x20capture\x20forward\x20(a\x20due\x20state\x20advancing\x20into\x20a\x20paid\x20state)\x20either\x20binds\x20a\x20fund-gate\x20Guard\x20reading\x20allocation.balance\x20(satisfiable\x20only\x20against\x20funds\x20committed\x20in\x20a\x20PRIOR\x20transaction\x20—\x20prepaid\x20shape,\x20INV-B1,\x20compile\x20INSTALLMENT_FUNDING_UNGATED\x20/\x20scanner\x20R-INSTALLMENT-FUNDING)\x20or\x20is\x20gate-less\x20and\x20relies\x20on\x20the\x20order_renew\x20routing\x20to\x20land\x20the\x20funds\x20same-PTB\x20(a\x20balance\x20gate\x20+\x20same-PTB\x20order_renew\x20ALWAYS\x20aborts\x20—\x20esound-mn-261021\x20B-1)','level':'soft','blocking':![]},{'constraint_id':'installment_deposit_exit','description':'every\x20deposit-held\x20state\x20carries\x20a\x20refund/cancel/forfeit\x20exit\x20rail\x20so\x20the\x20paid\x20portion\x20is\x20never\x20stranded\x20(INV-B2,\x20compile\x20INSTALLMENT_DEPOSIT_STRANDED\x20/\x20scanner\x20R-INSTALLMENT-DEPOSIT)','level':'soft','blocking':![]},{'constraint_id':'installment_release_once','description':'the\x20release\x20allocator\x20is\x20once_per_order\x20and\x20order-anchored\x20so\x20a\x20replay\x20cannot\x20re-capture\x20(INV-B3,\x20rides\x20the\x20existing\x20E-2\x20/\x20once-slot\x20/\x20order-anchor\x20audit)','level':'soft','blocking':![]}],'evaluationImpact':[{'dimension':'fund_safety','effect':'required','description':'The\x20capture\x20cannot\x20zero-value-advance:\x20gate-less\x20captures\x20land\x20funds\x20via\x20the\x20order_renew\x20routing;\x20balance-gated\x20captures\x20draw\x20on\x20prior-transaction\x20funds\x20(PRE-STATE\x20CONSTRAINT\x20—\x20same-PTB\x20funding\x20is\x20invisible\x20to\x20guards,\x20esound-mn-261021\x20B-1)'},{'dimension':'consumer_diligence','effect':'boost','description':'A\x20declared\x20deposit-exit\x20policy\x20(full\x20refund\x20vs\x20kill\x20fee)\x20is\x20verifiable\x20before\x20the\x20buyer\x20commits\x20the\x20deposit'},{'dimension':'operational_risk','effect':'boost','description':'once_per_order\x20+\x20order\x20anchor\x20on\x20the\x20release\x20keeps\x20a\x20replay\x20from\x20re-capturing\x20or\x20double-releasing'}],'industryFit':{'freelance':0x46,'education':0x2d,'rental':0x37,'retail':0x5a,'subscription':0x28,'travel':0x32,'licensing':0x1e,'crowdfunding':0x37,'general':0x3c},'addressesPainPoints':['Pre-order\x20/\x20deposit-then-balance\x20sales\x20locked\x20inside\x20incumbent\x20platforms','A\x20later\x20payment\x20recorded\x20without\x20the\x20funds\x20actually\x20landing\x20(zero-value\x20advance)','A\x20buyer\x20who\x20walks\x20away\x20strands\x20the\x20deposit\x20with\x20no\x20on-chain\x20exit','Milestone\x20billing\x20where\x20a\x20replay\x20re-charges\x20or\x20double-releases'],'intentSignals':[/installment/i,/deposit/i,/pay in stages/i,/down[ -]?payment/i,/balance (later|afterwards?)/i,/part(ial)? payment/i,/staged? payment/i],'userProtections':['A\x20capture\x20forward\x20cannot\x20zero-value-advance\x20(gate-less\x20captures\x20land\x20funds\x20via\x20the\x20order_renew\x20routing;\x20balance-gated\x20captures\x20require\x20prior-transaction\x20funds)','The\x20deposit-exit\x20policy\x20is\x20declared\x20and\x20structurally\x20backed\x20before\x20purchase','The\x20release\x20is\x20once-per-order\x20and\x20order-anchored,\x20so\x20no\x20replay\x20double-charges'],'merchantObligations':['Give\x20every\x20capture\x20forward\x20a\x20funding\x20story:\x20gate-less\x20+\x20order_renew\x20routing,\x20or\x20a\x20balance\x20fund\x20gate\x20fed\x20by\x20PRIOR-transaction\x20funds\x20(prepaid\x20shape\x20—\x20a\x20gate\x20plus\x20same-PTB\x20order_renew\x20always\x20aborts,\x20esound-mn-261021\x20B-1)','Ship\x20a\x20deposit-exit\x20rail\x20(refund\x20or\x20declared\x20kill\x20fee)\x20from\x20every\x20deposit-held\x20state','Make\x20the\x20release\x20allocator\x20once_per_order\x20and\x20order-anchored','Disclose\x20the\x20deposit\x20amount,\x20balance\x20window,\x20and\x20exit\x20policy\x20in\x20the\x20listing/WIP\x20promise'],'requiresKeeper':!![],'keeperHint':'The\x20balance-window\x20deadline\x20(a\x20buyer\x20who\x20never\x20pays\x20the\x20balance)\x20needs\x20a\x20keeper\x20to\x20drive\x20the\x20deposit-exit\x20rail\x20at\x20the\x20window\x20close;\x20a\x20milestone\x20capture\x20timeout\x20likewise'},{'id':'affiliate_commission','name':'Affiliate\x20Commission','description':'Declared\x20affiliate_mode\x20(\x27commission\x27):\x20the\x20merchant\x20sells\x20through\x20referral/affiliate\x20partners\x20and\x20owes\x20the\x20referring\x20partner\x20an\x20independent\x20commission\x20leg.\x20The\x20commission\x20is\x20window-anchored\x20—\x20it\x20accrues\x20at\x20attribution\x20but\x20is\x20claimable\x20only\x20after\x20the\x20attribution/refund\x20window\x20closes,\x20so\x20an\x20in-window\x20refund\x20never\x20has\x20to\x20reverse\x20an\x20already-paid\x20partner\x20(the\x20chain\x20has\x20no\x20debit/clawback\x20primitive,\x20so\x20a\x20released\x20commission\x20is\x20unrecoverable\x20and\x20the\x20template\x20must\x20disclose\x20that\x20honestly).\x20The\x20commission\x20leg\x20is\x20an\x20INDEPENDENT\x20allocation\x20off\x20a\x20dedicated\x20pool,\x20never\x20a\x20drain\x20of\x20the\x20buyer\x27s\x20goods\x20escrow.','objectTypes':['machine','guard','allocation','repository'],'templateRefs':[],'requiredConstraints':[{'constraint_id':'affiliate_rail_present','description':'a\x20declared\x20commission\x20overlay\x20has\x20a\x20commission-family\x20machine\x20node\x20or\x20a\x20commission\x20allocator\x20row,\x20and\x20the\x20leg\x20is\x20INDEPENDENT\x20of\x20the\x20goods\x20escrow\x20(INV-D3,\x20compile\x20AFFILIATE_RAIL_MISSING\x20/\x20scanner\x20R-AFFILIATE-RAIL)','level':'soft','blocking':![]},{'constraint_id':'affiliate_clawback_disclosed','description':'a\x20build_note\x20discloses\x20the\x20post-lock\x20no-clawback\x20truth\x20—\x20a\x20released\x20commission\x20cannot\x20be\x20reversed\x20on\x20chain\x20(INV-D2,\x20compile\x20AFFILIATE_CLAWBACK_UNDISCLOSED\x20/\x20scanner\x20R-AFFILIATE-DISCLOSURE)','level':'soft','blocking':![]},{'constraint_id':'affiliate_window_anchored','description':'the\x20commission\x20claim\x20is\x20gated\x20by\x20a\x20window-anchored\x20guard\x20so\x20it\x20is\x20claimable\x20only\x20after\x20the\x20attribution/refund\x20window\x20closes\x20(INV-D1,\x20rides\x20the\x20generic\x20TIME-ANCHOR-01\x20audit)','level':'soft','blocking':![]}],'evaluationImpact':[{'dimension':'fund_safety','effect':'required','description':'The\x20commission\x20leg\x20is\x20an\x20independent\x20allocation\x20off\x20its\x20own\x20pool,\x20never\x20a\x20Surplus/Rate\x20drain\x20of\x20the\x20buyer\x27s\x20goods\x20escrow\x20(anti-grab-pool)'},{'dimension':'consumer_diligence','effect':'boost','description':'The\x20post-lock\x20no-clawback\x20truth\x20is\x20disclosed\x20before\x20purchase,\x20so\x20a\x20buyer/merchant\x20never\x20assumes\x20a\x20reversal\x20the\x20chain\x20cannot\x20do'},{'dimension':'operational_risk','effect':'boost','description':'The\x20window\x20anchor\x20means\x20an\x20in-window\x20refund\x20never\x20has\x20to\x20reverse\x20an\x20already-paid\x20partner\x20—\x20the\x20unrecoverable\x20surface\x20is\x20minimized\x20by\x20construction'}],'industryFit':{'freelance':0x3c,'education':0x37,'rental':0x23,'retail':0x50,'subscription':0x41,'travel':0x3c,'licensing':0x46,'crowdfunding':0x3c,'general':0x3c},'addressesPainPoints':['Referral/affiliate\x20payouts\x20locked\x20inside\x20incumbent\x20affiliate\x20networks\x20with\x20opaque\x20attribution','A\x20commission\x20drained\x20from\x20the\x20buyer\x27s\x20goods\x20escrow\x20instead\x20of\x20an\x20independent\x20pool\x20(pool-grabbing)','A\x20refund\x20after\x20commission\x20release\x20falsely\x20assumed\x20to\x20claw\x20back\x20the\x20partner\x20payout\x20(no\x20on-chain\x20debit\x20exists)','Attribution\x20claimed\x20instantly,\x20before\x20the\x20refund\x20window,\x20then\x20unrecoverable\x20when\x20the\x20order\x20refunds'],'intentSignals':[/affiliate/i,/referral/i,/referr/i,/commission/i,/revenue[ -]?shar/i,/partner[ -]?payout/i],'userProtections':['The\x20commission\x20is\x20paid\x20from\x20a\x20dedicated\x20pool,\x20so\x20the\x20buyer\x27s\x20goods\x20escrow\x20is\x20never\x20drained\x20by\x20the\x20partner\x20leg','The\x20post-lock\x20no-clawback\x20reality\x20is\x20disclosed\x20before\x20purchase,\x20not\x20discovered\x20at\x20refund\x20time','The\x20commission\x20is\x20only\x20claimable\x20after\x20the\x20attribution/refund\x20window\x20closes,\x20so\x20an\x20in-window\x20refund\x20is\x20clean'],'merchantObligations':['Route\x20the\x20commission\x20through\x20an\x20INDEPENDENT\x20allocation\x20leg\x20to\x20an\x20explicit\x20non-empty\x20partner\x20Entity','Gate\x20the\x20claim\x20with\x20a\x20window-anchored\x20guard\x20(claimable\x20only\x20after\x20the\x20attribution/refund\x20window)','Disclose\x20the\x20post-lock\x20no-clawback\x20truth\x20in\x20a\x20build_note\x20and\x20the\x20listing\x20promise','Declare\x20the\x20commission\x20rate/bps\x20and\x20the\x20attribution\x20window\x20in\x20the\x20listing\x20so\x20a\x20partner\x20can\x20price\x20it\x20before\x20referral'],'requiresKeeper':!![],'keeperHint':'The\x20attribution/refund\x20window\x20deadline\x20needs\x20a\x20keeper\x20to\x20open\x20the\x20commission\x20claim\x20once\x20the\x20window\x20closes\x20(the\x20claim\x20guard\x27s\x20time\x20gate\x20arms\x20at\x20entry_time\x20+\x20window)'},{'id':'crowdfunding','name':'Crowdfunding\x20Campaign','description':'Declared\x20crowdfunding_mode\x20(\x27threshold\x27\x20all-or-nothing\x20/\x20\x27flexible\x27\x20keep-it-all):\x20backers\x20each\x20escrow\x20a\x20contribution\x20in\x20its\x20OWN\x20unpooled\x20Allocation\x20(for_object\x20=\x20their\x20order,\x20never\x20balance-joined,\x20so\x20attribution\x20survives).\x20A\x20shared\x20campaign\x20Repository\x20records\x20one\x20writer-bound\x20numeric\x20row\x20per\x20contribution\x20(id_from\x20signer,\x20value\x20=\x20amount).\x20At\x20an\x20ABSOLUTE\x20campaign\x20deadline\x20a\x20settlement\x20guard\x20reads\x20the\x20on-chain\x20aggregate\x20(repository.data\x20sum-where,\x20query\x201174\x20→\x20U256)\x20and\x20decides:\x20aggregate\x20>=\x20goal\x20→\x20release\x20every\x20contribution\x20to\x20the\x20project\x20Entity;\x20aggregate\x20<\x20goal\x20(threshold\x20model)\x20→\x20refund\x20each\x20backer\x20their\x20own\x20contribution\x20(slot\x200\x20—\x20the\x20submitted\x20Order,\x20extracted\x20by\x20owner_receive;\x20NEVER\x20slot\x20254\x20on\x20a\x20refund\x20rail).\x20The\x20flexible\x20model\x20has\x20no\x20goal\x20and\x20no\x20refund\x20leg\x20—\x20contributions\x20release\x20at\x20the\x20deadline\x20and\x20are\x20non-refundable\x20(disclosed).\x20The\x20aggregate\x20is\x20attested-roster\x20evidence,\x20not\x20a\x20chain-verified\x20custody\x20proof;\x20a\x20raise\x20is\x20never\x20an\x20investment.','objectTypes':['machine','guard','allocation','repository'],'templateRefs':[],'requiredConstraints':[{'constraint_id':'crowdfunding_exit_rail_present','description':'a\x20declared\x20campaign\x20has\x20a\x20release/settlement\x20rail,\x20and\x20a\x20threshold\x20campaign\x20additionally\x20has\x20a\x20refund\x20rail\x20—\x20the\x20two-leg\x20escrow-exit\x20(release\x20XOR\x20refund,\x20D-BUG-2)\x20so\x20contributions\x20never\x20strand\x20at\x20the\x20deadline\x20(INV-E1,\x20compile\x20CROWDFUNDING_THRESHOLD_GATE_MISSING\x20/\x20scanner\x20R-CROWDFUNDING-RAIL)','level':'soft','blocking':![]},{'constraint_id':'crowdfunding_aggregate_writer_bound','description':'a\x20threshold\x20aggregate\x20reads\x20the\x20ESCROW-BOUND\x20sum\x20(query\x201179,\x20per-row\x20min(row,\x20order.amount))\x20over\x20ORDER-KEYED\x20rows\x20(policy\x20id_from\x20unset,\x20row\x20id\x20=\x20the\x20funder\x27s\x20Order\x20address\x20+\x20an\x20identity\x20write_guard\x20order.owner==Signer),\x20never\x20a\x20self-reported\x20free-form\x20sum\x20over\x20wallet-keyed\x20rows\x20(INV-E2\x20/\x20R-X1-17,\x20compile\x20CROWDFUNDING_AGGREGATE_UNBOUND\x20/\x20CROWDFUNDING_SIGNER_KEYED_ROWS\x20/\x20scanner\x20R-CROWDFUNDING-AGGREGATE)','level':'soft','blocking':![]},{'constraint_id':'crowdfunding_disclosure_present','description':'build_notes\x20disclose\x20the\x20L-04\x20aggregate\x20trust\x20boundary\x20(threshold),\x20the\x20L-01\x20non-investment\x20statement,\x20the\x20L-05\x20KYC/AML\x20caution,\x20and\x20—\x20for\x20a\x20flexible\x20build\x20—\x20the\x20NO-REFUND\x20keep-it-all\x20posture\x20(INV-E3,\x20compile\x20CROWDFUNDING_DISCLOSURE_MISSING\x20/\x20scanner\x20R-CROWDFUNDING-DISCLOSURE)','level':'soft','blocking':![]}],'evaluationImpact':[{'dimension':'fund_safety','effect':'required','description':'Each\x20contribution\x20is\x20escrowed\x20UNPOOLED\x20(for_object\x20=\x20its\x20own\x20order,\x20never\x20balance::join)\x20so\x20a\x20missed\x20campaign\x20refunds\x20every\x20backer\x20their\x20OWN\x20money;\x20the\x20release/refund\x20legs\x20are\x20mutually\x20exclusive\x20(D-BUG-2)'},{'dimension':'consumer_diligence','effect':'boost','description':'The\x20aggregate-trust\x20boundary,\x20the\x20non-investment\x20posture\x20and\x20(flexible)\x20the\x20no-refund\x20reality\x20are\x20disclosed\x20before\x20contribution,\x20so\x20a\x20backer\x20never\x20assumes\x20a\x20chain-verified\x20custody\x20proof\x20or\x20a\x20refund\x20the\x20model\x20does\x20not\x20have'},{'dimension':'operational_risk','effect':'boost','description':'One\x20ABSOLUTE\x20shared\x20deadline\x20(not\x20per-order\x20entry+duration)\x20means\x20every\x20backer\x20settles\x20at\x20the\x20same\x20cutoff;\x20the\x20writer-bound\x20ledger\x20makes\x20the\x20raise\x20total\x20attributable\x20and\x20honest'}],'industryFit':{'freelance':0x1e,'education':0x28,'rental':0x14,'retail':0x3c,'subscription':0x23,'travel':0x19,'licensing':0x2d,'crowdfunding':0x64,'general':0x37},'addressesPainPoints':['An\x20all-or-nothing\x20raise\x20where\x20a\x20missed\x20goal\x20must\x20refund\x20every\x20backer,\x20but\x20pooled\x20custody\x20loses\x20per-backer\x20attribution','A\x20funding\x20total\x20presented\x20as\x20a\x20chain-verified\x20custody\x20proof\x20when\x20it\x20is\x20only\x20an\x20attested\x20sum\x20over\x20keeper-supplied\x20rows','A\x20backer\x20mistaking\x20a\x20flexible\x20keep-it-all\x20raise\x20for\x20a\x20refundable\x20all-or-nothing\x20campaign','Pooled\x20cross-border\x20fundraising\x20treated\x20as\x20a\x20casual\x20purchase\x20despite\x20HIGH\x20securities\x20/\x20money-transmission\x20/\x20KYC-AML\x20exposure'],'intentSignals':[/crowdfund/i,/\bbackers?\b/i,/campaign/i,/all[ -]?or[ -]?nothing/i,/fundrais/i,/\bpledge/i,/raise (funds|money)/i,/keep[ -]?it[ -]?all/i],'userProtections':['Each\x20contribution\x20is\x20escrowed\x20to\x20the\x20backer\x27s\x20OWN\x20order\x20(unpooled),\x20so\x20a\x20missed\x20threshold\x20refunds\x20exactly\x20their\x20money','The\x20aggregate-trust\x20boundary\x20and\x20the\x20non-investment\x20posture\x20are\x20disclosed\x20before\x20contribution','A\x20flexible\x20raise\x20states\x20the\x20NO-REFUND\x20keep-it-all\x20posture\x20up\x20front,\x20never\x20blurred\x20with\x20all-or-nothing','Delivery\x20after\x20a\x20successful\x20raise\x20is\x20backed\x20by\x20the\x20compensation\x20fund\x20+\x20third-party\x20arbitration'],'merchantObligations':['Escrow\x20each\x20contribution\x20UNPOOLED\x20(for_object\x20=\x20the\x20funder\x27s\x20order),\x20never\x20balance-joined\x20into\x20a\x20shared\x20pot','Bind\x20the\x20campaign\x20Repository\x20write_guard\x20to\x20the\x20contributing\x20backer\x20(id_from\x20signer,\x20order.owner==Signer)\x20so\x20the\x20aggregate\x20cannot\x20be\x20forged','Gate\x20release\x20on\x20the\x20sum-where\x20aggregate\x20ANDed\x20with\x20an\x20ABSOLUTE\x20shared\x20campaign\x20deadline;\x20pair\x20the\x20refund\x20leg\x20with\x20a\x20recover_gate\x20rail\x20(D-BUG-2)','Disclose\x20the\x20L-04\x20aggregate\x20trust\x20boundary,\x20the\x20L-01\x20non-investment\x20statement,\x20the\x20L-05\x20KYC/AML\x20caution,\x20and\x20(flexible)\x20the\x20no-refund\x20posture\x20in\x20build_notes\x20and\x20the\x20listing'],'requiresKeeper':!![],'keeperHint':'The\x20ABSOLUTE\x20campaign\x20deadline\x20needs\x20a\x20keeper\x20to\x20drive\x20settlement\x20once\x20Clock\x20>=\x20deadline:\x20on\x20a\x20met\x20goal\x20advance\x20each\x20order\x20to\x20the\x20release\x20terminal;\x20on\x20a\x20missed\x20threshold\x20enumerate\x20contributor\x20ids\x20via\x20find-where\x20(1176)\x20/\x20keys-where\x20(1177,\x20max\x20100\x20per\x20batch)\x20and\x20advance\x20each\x20refund\x20leg'},{'id':'logistics_fulfillment','name':'Logistics\x20&\x20Fulfillment','description':'Declared\x20logistics_mode\x20(\x27carrier\x27\x20|\x20\x27merchant_managed\x27\x20|\x20\x27courier\x27\x20|\x20\x27pickup_point\x27):\x20how\x20the\x20physical\x20good\x20reaches\x20the\x20buyer.\x20carrier\x20=\x20third-party\x20carrier\x20with\x20mandatory\x20tracking\x20evidence;\x20merchant_managed\x20=\x20the\x20merchant\x27s\x20own\x20staff\x20(handover/inspection);\x20courier\x20=\x20per-order\x20dispatched\x20riders\x20riding\x20namedOperator\x20roster\x20rails\x20(the\x20ONLY\x20forward\x20a\x20third-party\x20rider\x20can\x20pass\x20—\x20no\x20permission\x20entity,\x20no\x20buyer\x20identity);\x20pickup_point\x20=\x20batch\x20consolidation\x20anchored\x20on\x20an\x20ABSOLUTE\x20shared\x20cutoff\x20with\x20a\x20bounded\x20unclaimed-goods\x20exit.\x20Every\x20physical\x20mode\x20carries\x20a\x20transit-loss\x20story\x20(an\x20express\x20loss\x20rail\x20or\x20a\x20disclosed\x20arbitration→refund\x20remedy).\x20The\x20delivery\x20fee\x20is\x20known\x20at\x20order\x20time\x20and\x20must\x20be\x20an\x20INDEPENDENT\x20leg\x20—\x20never\x20a\x20Surplus/Rate\x20drain\x20of\x20the\x20buyer\x27s\x20goods\x20escrow.','objectTypes':['machine','guard','allocation','repository'],'templateRefs':[],'requiredConstraints':[{'constraint_id':'logistics_rail_present','description':'the\x20declared\x20topology\x20is\x20structurally\x20expressed:\x20courier\x20builds\x20bind\x20namedOperator\x20handover\x20rails\x20(compile\x20LOGISTICS_COURIER_RAIL_MISSING)\x20with\x20exclusive\x20admission\x20via\x20kernel\x20query\x201575\x20(order.named_operator\x20member,\x20protocol\x20v138\x20—\x20the\x20rail\x20alone\x20AUTHORIZES\x20members\x20and\x20never\x20bars\x20non-members;\x20template\x20tpl_forward_roster_member_gate),\x20pickup_point\x20builds\x20carry\x20the\x20absolute\x20batch\x20cutoff\x20+\x20the\x20unclaimed-goods\x20exit\x20window\x20(LOGISTICS_PICKUP_CUTOFF_MISSING),\x20carrier\x20builds\x20bind\x20tracking\x20evidence\x20(LOGISTICS_CARRIER_EVIDENCE_MISSING)','level':'soft','blocking':![]},{'constraint_id':'logistics_loss_covered','description':'every\x20physical\x20mode\x20carries\x20a\x20transit-loss\x20story\x20—\x20an\x20express\x20loss\x20rail\x20or\x20a\x20disclosed\x20arbitration→refund\x20remedy\x20(compile\x20LOGISTICS_TRANSIT_LOSS_UNCOVERED\x20/\x20scanner\x20R-LOGISTICS-TRANSIT)','level':'soft','blocking':![]},{'constraint_id':'logistics_fee_independent','description':'the\x20delivery\x20fee\x20is\x20an\x20INDEPENDENT\x20Amount/Rate\x20leg\x20off\x20its\x20own\x20pool\x20—\x20never\x20a\x20Surplus\x20drain\x20of\x20the\x20buyer\x27s\x20goods\x20escrow\x20(compile\x20LOGISTICS_COURIER_FEE_POOLED;\x20the\x20anti-grab-pool\x20family)','level':'soft','blocking':![]},{'constraint_id':'logistics_dispatch_disclosed','description':'courier/pickup_point\x20builds\x20disclose\x20the\x20two\x20dispatch\x20SOLE-TRUTHs:\x20no\x20on-chain\x20dispatch\x20scheduler\x20(off-chain\x20keeper,\x20roster\x20via\x20permission\x20index\x20221)\x20and\x20no\x20distance/weight/weather\x20oracle\x20(compile\x20LOGISTICS_DISPATCH_UNDISCLOSED\x20/\x20scanner\x20R-LOGISTICS-DISCLOSURE)','level':'soft','blocking':![]}],'evaluationImpact':[{'dimension':'consumer_diligence','effect':'required','description':'The\x20fulfillment\x20topology\x20is\x20declared\x20and\x20enforced\x20before\x20purchase\x20—\x20the\x20buyer\x20knows\x20whether\x20goods\x20ride\x20a\x20carrier\x20(with\x20tracking\x20evidence),\x20the\x20merchant\x27s\x20own\x20staff,\x20a\x20dispatched\x20rider,\x20or\x20a\x20pickup\x20batch'},{'dimension':'fund_safety','effect':'boost','description':'The\x20delivery\x20fee\x20never\x20drains\x20the\x20goods\x20escrow\x20(independent\x20leg)\x20and\x20every\x20physical\x20mode\x20carries\x20a\x20transit-loss\x20route,\x20so\x20an\x20undeliverable\x20order\x20never\x20strands\x20the\x20buyer\x27s\x20funds\x20silently'},{'dimension':'operational_risk','effect':'boost','description':'Dispatch\x20is\x20honestly\x20disclosed\x20as\x20an\x20off-chain\x20keeper\x20duty\x20(no\x20on-chain\x20scheduler/oracle\x20exists),\x20so\x20ETA\x20and\x20pricing\x20promises\x20never\x20masquerade\x20as\x20chain\x20guarantees'}],'industryFit':{'freelance':0x1e,'education':0x19,'rental':0x37,'retail':0x46,'subscription':0x23,'travel':0x1e,'licensing':0x14,'crowdfunding':0x28,'general':0x28},'addressesPainPoints':['Fulfillment\x20topology\x20correctness\x20audited\x20by\x20prose\x20instead\x20of\x20structure\x20(a\x20courier\x20build\x20with\x20no\x20rider\x20rail,\x20a\x20pickup\x20batch\x20with\x20no\x20cutoff)','A\x20delivery\x20fee\x20drained\x20from\x20the\x20buyer\x27s\x20goods\x20escrow\x20instead\x20of\x20an\x20independent\x20leg\x20(pool-grabbing)','Goods\x20lost\x20in\x20transit\x20with\x20no\x20taught\x20remedy\x20route,\x20silently\x20stranding\x20the\x20buyer\x27s\x20funds','Builders\x20assuming\x20an\x20on-chain\x20dispatch\x20scheduler\x20or\x20distance\x20oracle\x20the\x20chain\x20does\x20not\x20have'],'intentSignals':[/deliver(y|ies)?/i,/\bshipping\b/i,/courier/i,/\brider\b/i,/dispatch/i,/pickup point/i,/self[- ]pick/i,/fulfillment/i,/\blogistics\b/i],'userProtections':['The\x20fulfillment\x20mode\x20is\x20declared\x20and\x20structurally\x20enforced,\x20not\x20a\x20prose\x20promise','A\x20lost-in-transit\x20order\x20has\x20a\x20disclosed\x20remedy\x20route\x20(arbitration\x20→\x20refund),\x20never\x20silence','The\x20delivery\x20fee\x20comes\x20out\x20of\x20its\x20own\x20pool,\x20never\x20out\x20of\x20the\x20buyer\x27s\x20goods\x20escrow','Dispatch\x20and\x20ETA\x20claims\x20are\x20disclosed\x20as\x20off-chain\x20keeper\x20operations,\x20not\x20chain\x20guarantees','Courier\x20handovers\x20are\x20roster-exclusive:\x20a\x20rider\x20not\x20on\x20the\x20order\x27s\x20named-operator\x20roster\x20is\x20kernel-barred\x20from\x20advancing\x20(query\x201575)'],'merchantObligations':['Declare\x20logistics_mode\x20and\x20honor\x20its\x20semantics\x20(rails,\x20evidence,\x20cutoffs)\x20—\x20compile\x20blocks\x20a\x20declared\x20topology\x20the\x20shape\x20cannot\x20express','Keep\x20the\x20delivery\x20fee\x20on\x20an\x20independent\x20leg\x20off\x20its\x20own\x20pool','Give\x20every\x20physical\x20build\x20a\x20transit-loss\x20story\x20(loss\x20rail\x20or\x20disclosed\x20arbitration→refund\x20remedy)','For\x20courier/pickup_point:\x20run\x20the\x20dispatch\x20keeper\x20(roster\x20writes\x20via\x20permission\x20index\x20221)\x20and\x20disclose\x20that\x20ETA/pricing\x20live\x20off-chain'],'requiresKeeper':!![],'keeperHint':'Dynamic\x20modes\x20(courier/pickup_point)\x20need\x20the\x20dispatch\x20keeper:\x20fill\x20the\x20namedOperator\x20roster\x20per\x20order/shift\x20via\x20permission\x20index\x20221\x20(miss\x20=\x20the\x20order\x20waits\x20at\x20the\x20handover\x20state);\x20pickup\x20batches\x20need\x20the\x20keeper\x20to\x20drive\x20the\x20cutoff\x20release\x20and\x20the\x20unclaimed-goods\x20exit\x20at\x20the\x20window\x20deadline'}];export function getBusinessModule(a){return CORE_BUSINESS_MODULES['find'](b=>b['id']===a);}export function getModulesForIndustry(a){return[...CORE_BUSINESS_MODULES]['sort']((c,d)=>(d['industryFit'][a]??0x0)-(c['industryFit'][a]??0x0));}export function recommendModules(a,b,c){const d=c?.['minFit']??0x32,e=c?.['maxModules']??0x5,f=CORE_BUSINESS_MODULES['map'](g=>{let h=g['industryFit'][a]??0x32;const i=b['toLowerCase']();for(const j of g['addressesPainPoints']){const k=j['toLowerCase']()['split'](/\s+/),l=k['filter'](n=>i['includes'](n))['length'];h+=l*0x5;}return{'module':g,'score':Math['min'](h,0x64)};});return f['filter'](g=>g['score']>=d)['sort']((g,h)=>h['score']-g['score'])['slice'](0x0,e)['map'](g=>g['module']);}export function moduleHasIntentEvidence(a,b){if(!a['intentSignals']||a['intentSignals']['length']===0x0)return![];return a['intentSignals']['some'](c=>c['test'](b));}export function checkModuleConstraints(a,b,c){const d=a['requiredConstraints']['filter'](h=>h['blocking']&&!b['has'](h['constraint_id']))['map'](h=>h['constraint_id']),e=d['length']===0x0,f=a['evaluationImpact']['filter'](h=>h['effect']==='boost'||h['effect']==='required')['reduce']((h,i)=>h+(i['effect']==='required'?0xf:0x8),0x0),g=c?.['evidenceMatched']===![]?0x0:f;return{'module':a['id'],'adopted':e,'reason':e?undefined:'Missing\x20required\x20constraints:\x20'+d['join'](',\x20'),'missingConstraints':d['length']>0x0?d:undefined,'estimatedScoreBoost':Math['min'](g,0x64),'evidence_matched':c?.['evidenceMatched']};}export function calculateModuleScoreBoost(a){const b={};for(const c of a){for(const d of c['evaluationImpact']){const e=d['effect']==='required'?0xf:d['effect']==='boost'?0x8:0x3;b[d['dimension']]=(b[d['dimension']]??0x0)+e;}}return b;}