@wowok/agent-mcp 3.2.7 → 3.3.0

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 (265) hide show
  1. package/README.md +2 -2
  2. package/dist/chain-semantics/field-capability.js +1 -1
  3. package/dist/chain-semantics/freeze-map.js +1 -1
  4. package/dist/chain-semantics/fund-flow.js +1 -1
  5. package/dist/chain-semantics/guard-verbs.js +1 -1
  6. package/dist/chain-semantics/object-graph.js +1 -1
  7. package/dist/composition/audit.js +1 -1
  8. package/dist/composition/compile.d.ts +10 -1
  9. package/dist/composition/compile.js +1 -1
  10. package/dist/composition/inflight.d.ts +10 -0
  11. package/dist/composition/inflight.js +1 -1
  12. package/dist/extensions/business-modules.d.ts +1 -1
  13. package/dist/extensions/business-modules.js +1 -1
  14. package/dist/extensions/capability-manifest.js +1 -1
  15. package/dist/extensions/industry-audit.spec.js +1 -1
  16. package/dist/extensions/industry-pack.js +1 -1
  17. package/dist/graph/onchain/edge-schema.js +1 -1
  18. package/dist/graph/onchain/facts.spec.js +1 -1
  19. package/dist/graph/onchain/field-manifest.js +1 -1
  20. package/dist/harness/index.d.ts +1 -0
  21. package/dist/harness/index.js +1 -1
  22. package/dist/harness/operation-id.d.ts +1 -0
  23. package/dist/harness/operation-id.js +1 -0
  24. package/dist/harness/recover.js +1 -1
  25. package/dist/index.js +1 -1
  26. package/dist/intent/types.d.ts +1 -1
  27. package/dist/intent/types.js +1 -1
  28. package/dist/keeper/KeeperScan.d.ts +2 -1
  29. package/dist/keeper/KeeperScan.js +1 -1
  30. package/dist/keeper/keeper.spec.js +1 -1
  31. package/dist/keeper/types.d.ts +3 -0
  32. package/dist/keeper/types.js +1 -1
  33. package/dist/knowledge/allocator-rail-verifier.d.ts +34 -0
  34. package/dist/knowledge/allocator-rail-verifier.js +1 -0
  35. package/dist/knowledge/arbitration-ledger.js +1 -1
  36. package/dist/knowledge/arbitration-templates.js +1 -1
  37. package/dist/knowledge/arbitration-venue-order.js +1 -1
  38. package/dist/knowledge/audit-rules.d.ts +19 -1
  39. package/dist/knowledge/audit-rules.js +1 -1
  40. package/dist/knowledge/baselines/rules/alloc_audit.json +1 -1
  41. package/dist/knowledge/baselines/rules/arb.json +1 -1
  42. package/dist/knowledge/baselines/rules/guard.json +106 -1
  43. package/dist/knowledge/baselines/rules/machine.json +9 -6
  44. package/dist/knowledge/baselines/rules/plan.json +40 -17
  45. package/dist/knowledge/baselines/semantic-facts.js +1 -1
  46. package/dist/knowledge/builtin-templates.d.ts +1 -1
  47. package/dist/knowledge/builtin-templates.js +1 -1
  48. package/dist/knowledge/contract-invariants.js +1 -1
  49. package/dist/knowledge/discount-threshold.d.ts +11 -0
  50. package/dist/knowledge/discount-threshold.js +1 -1
  51. package/dist/knowledge/event-semantics.js +1 -1
  52. package/dist/knowledge/fund-layer.js +1 -1
  53. package/dist/knowledge/getting-started.js +1 -1
  54. package/dist/knowledge/guard-anchor-reach.d.ts +1 -1
  55. package/dist/knowledge/guard-anchor-reach.js +1 -1
  56. package/dist/knowledge/guard-bindings.js +1 -1
  57. package/dist/knowledge/guard-design-patterns.d.ts +1 -1
  58. package/dist/knowledge/guard-design-patterns.js +1 -1
  59. package/dist/knowledge/guard-field-cognition.js +1 -1
  60. package/dist/knowledge/guard-ledger.js +1 -1
  61. package/dist/knowledge/guard-lint.js +1 -1
  62. package/dist/knowledge/guard-render.js +1 -1
  63. package/dist/knowledge/guard-risk.d.ts +1 -0
  64. package/dist/knowledge/guard-risk.js +1 -1
  65. package/dist/knowledge/guard-submission-brief.d.ts +6 -0
  66. package/dist/knowledge/guard-submission-brief.js +1 -1
  67. package/dist/knowledge/guard-templates.d.ts +2 -2
  68. package/dist/knowledge/guard-templates.js +1 -1
  69. package/dist/knowledge/index.js +1 -1
  70. package/dist/knowledge/industry-registry.js +1 -1
  71. package/dist/knowledge/industry-strategy.js +1 -1
  72. package/dist/knowledge/jsonrpc-enum.js +1 -1
  73. package/dist/knowledge/machine-ledger.js +1 -1
  74. package/dist/knowledge/machine-puzzle.d.ts +1 -1
  75. package/dist/knowledge/machine-puzzle.js +1 -1
  76. package/dist/knowledge/machine-risk.js +1 -1
  77. package/dist/knowledge/machine-templates.js +1 -1
  78. package/dist/knowledge/machine-topology.d.ts +8 -0
  79. package/dist/knowledge/machine-topology.js +1 -1
  80. package/dist/knowledge/machine-translation.js +1 -1
  81. package/dist/knowledge/order-ledger.js +1 -1
  82. package/dist/knowledge/permission-ledger.js +1 -1
  83. package/dist/knowledge/protocol-facts.d.ts +16 -0
  84. package/dist/knowledge/protocol-facts.js +1 -0
  85. package/dist/knowledge/recipient-constraint.js +1 -1
  86. package/dist/knowledge/reward-ledger.d.ts +2 -1
  87. package/dist/knowledge/reward-ledger.js +1 -1
  88. package/dist/knowledge/reward-templates.js +1 -1
  89. package/dist/knowledge/safety-rules.d.ts +0 -2
  90. package/dist/knowledge/safety-rules.js +1 -1
  91. package/dist/knowledge/scenario-modes.d.ts +7 -0
  92. package/dist/knowledge/scenario-modes.js +1 -1
  93. package/dist/knowledge/strategy-manuals.js +1 -1
  94. package/dist/knowledge/template-loader.d.ts +13 -1
  95. package/dist/knowledge/template-loader.js +1 -1
  96. package/dist/knowledge/template-registry.js +1 -1
  97. package/dist/knowledge/template-scanner.d.ts +2 -0
  98. package/dist/knowledge/template-scanner.js +1 -1
  99. package/dist/knowledge/tool-constraints.js +1 -1
  100. package/dist/knowledge/tools-reference.js +1 -1
  101. package/dist/knowledge/workflow-guidance.d.ts +7 -3
  102. package/dist/knowledge/workflow-guidance.js +1 -1
  103. package/dist/monitor/MonitorLoop.js +1 -1
  104. package/dist/monitor/normalize.d.ts +1 -1
  105. package/dist/monitor/normalize.js +1 -1
  106. package/dist/monitor/types.d.ts +1 -1
  107. package/dist/monitor/types.js +1 -1
  108. package/dist/participation/radar-core.d.ts +1 -1
  109. package/dist/playbooks/service-build/business-puzzle.js +1 -1
  110. package/dist/playbooks/service-build/game-theory.d.ts +1 -0
  111. package/dist/playbooks/service-build/game-theory.js +1 -1
  112. package/dist/playbooks/service-build/intent-analyzer.js +1 -1
  113. package/dist/playbooks/service-build/machine-panorama.js +1 -1
  114. package/dist/playbooks/service-build/merchant-guide.d.ts +8 -0
  115. package/dist/playbooks/service-build/merchant-guide.js +1 -1
  116. package/dist/playbooks/service-build/object-panorama.d.ts +28 -1
  117. package/dist/playbooks/service-build/object-panorama.js +1 -1
  118. package/dist/playbooks/service-build/participation-radar.d.ts +2 -0
  119. package/dist/playbooks/service-build/participation-radar.js +1 -1
  120. package/dist/playbooks/service-build/relationship-profile.js +1 -1
  121. package/dist/playbooks/service-build/reverse-mapping-nk4.spec.js +1 -1
  122. package/dist/playbooks/service-build/reverse-mapping.js +1 -1
  123. package/dist/playbooks/service-build/service-panorama.js +1 -1
  124. package/dist/playbooks/service-build/service-quote.js +1 -1
  125. package/dist/playbooks/service-build/service-quote.spec.js +1 -1
  126. package/dist/relationship/registry.js +1 -1
  127. package/dist/review/index.js +1 -1
  128. package/dist/role/profiles.js +1 -1
  129. package/dist/safety/confirm-gate.js +1 -1
  130. package/dist/safety/preview.d.ts +1 -0
  131. package/dist/safety/preview.js +1 -1
  132. package/dist/schema/benchmark-migration/index.d.ts +19 -1
  133. package/dist/schema/benchmark-migration/index.js +1 -1
  134. package/dist/schema/call/allocation.d.ts +1 -1
  135. package/dist/schema/call/arbitration.d.ts +8 -8
  136. package/dist/schema/call/arbitration.js +1 -1
  137. package/dist/schema/call/base.d.ts +52 -5
  138. package/dist/schema/call/base.js +1 -1
  139. package/dist/schema/call/bridge.d.ts +3 -0
  140. package/dist/schema/call/contact.d.ts +5 -5
  141. package/dist/schema/call/demand.d.ts +5 -5
  142. package/dist/schema/call/error-codes.d.ts +1 -1
  143. package/dist/schema/call/error-codes.js +1 -1
  144. package/dist/schema/call/guard.d.ts +3 -3
  145. package/dist/schema/call/guard.js +1 -1
  146. package/dist/schema/call/handler.js +1 -1
  147. package/dist/schema/call/machine.d.ts +13 -5
  148. package/dist/schema/call/machine.js +1 -1
  149. package/dist/schema/call/order.d.ts +5 -5
  150. package/dist/schema/call/order.js +1 -1
  151. package/dist/schema/call/permission.d.ts +5 -5
  152. package/dist/schema/call/personal.d.ts +4 -4
  153. package/dist/schema/call/progress.d.ts +5 -5
  154. package/dist/schema/call/progress.js +1 -1
  155. package/dist/schema/call/proof.js +1 -1
  156. package/dist/schema/call/receipt.d.ts +8 -0
  157. package/dist/schema/call/receipt.js +1 -1
  158. package/dist/schema/call/repository.d.ts +9 -9
  159. package/dist/schema/call/repository.js +1 -1
  160. package/dist/schema/call/reward.d.ts +25 -5
  161. package/dist/schema/call/reward.js +1 -1
  162. package/dist/schema/call/semantic.js +1 -1
  163. package/dist/schema/call/service.d.ts +10 -5
  164. package/dist/schema/call/service.js +1 -1
  165. package/dist/schema/call/treasury.d.ts +5 -5
  166. package/dist/schema/common/index.d.ts +6 -6
  167. package/dist/schema/common/index.js +1 -1
  168. package/dist/schema/goal/index.d.ts +17 -1
  169. package/dist/schema/goal/planning.d.ts +28 -2
  170. package/dist/schema/goal/planning.js +1 -1
  171. package/dist/schema/industry-pack/index.d.ts +3 -0
  172. package/dist/schema/industry-pack/index.js +1 -1
  173. package/dist/schema/intent-radar/index.d.ts +9 -0
  174. package/dist/schema/intent-radar/index.js +1 -1
  175. package/dist/schema/local/index.d.ts +31 -0
  176. package/dist/schema/local/index.js +1 -1
  177. package/dist/schema/messenger/index.js +1 -1
  178. package/dist/schema/operations.d.ts +57 -43
  179. package/dist/schema/operations.js +1 -1
  180. package/dist/schema/query/bi.d.ts +22 -6
  181. package/dist/schema/query/bi.js +1 -1
  182. package/dist/schema/query/index.d.ts +164 -102
  183. package/dist/schema/query/index.js +1 -1
  184. package/dist/schema/schema-query/index.d.ts +2 -0
  185. package/dist/schema/schema-query/index.js +1 -1
  186. package/dist/schema/schema-version.js +1 -1
  187. package/dist/schema/utils/permission-machine-check.d.ts +2 -0
  188. package/dist/schema/utils/permission-machine-check.js +1 -1
  189. package/dist/schema/workflow/index.d.ts +1 -1
  190. package/dist/schema-query-impl/index.d.ts +1 -1
  191. package/dist/schema-query-impl/index.js +1 -1
  192. package/dist/schemas/account_operation.output.json +3 -0
  193. package/dist/schemas/account_operation.schema.json +4 -4
  194. package/dist/schemas/benchmark_migration_operation.output.json +42 -0
  195. package/dist/schemas/benchmark_migration_operation.schema.json +40 -3
  196. package/dist/schemas/bridge_operation.output.json +3 -0
  197. package/dist/schemas/goal_operation.schema.json +52 -2
  198. package/dist/schemas/index.json +1 -1
  199. package/dist/schemas/industry_pack_operation.output.json +8 -0
  200. package/dist/schemas/industry_pack_operation.schema.json +9 -0
  201. package/dist/schemas/intent_radar.output.json +8 -2
  202. package/dist/schemas/intent_radar.schema.json +4 -1
  203. package/dist/schemas/local_cache_operation.output.json +3 -0
  204. package/dist/schemas/local_history_operation.output.json +3 -0
  205. package/dist/schemas/local_info_operation.output.json +3 -0
  206. package/dist/schemas/local_mark_operation.output.json +3 -0
  207. package/dist/schemas/messenger_operation.schema.json +4 -4
  208. package/dist/schemas/monitor_events.schema.json +3 -1
  209. package/dist/schemas/onchain_events.output.json +275 -11
  210. package/dist/schemas/onchain_events.schema.json +25 -1
  211. package/dist/schemas/onchain_operations.output.json +47 -5
  212. package/dist/schemas/onchain_operations.schema.json +664 -179
  213. package/dist/schemas/onchain_operations_allocation.schema.json +7 -7
  214. package/dist/schemas/onchain_operations_arbitration.schema.json +21 -15
  215. package/dist/schemas/onchain_operations_contact.schema.json +15 -10
  216. package/dist/schemas/onchain_operations_demand.schema.json +15 -10
  217. package/dist/schemas/onchain_operations_gen_passport.schema.json +5 -5
  218. package/dist/schemas/onchain_operations_gen_proof.schema.json +1 -1
  219. package/dist/schemas/onchain_operations_guard.schema.json +346 -8
  220. package/dist/schemas/onchain_operations_machine.schema.json +24 -11
  221. package/dist/schemas/onchain_operations_order.schema.json +17 -12
  222. package/dist/schemas/onchain_operations_permission.schema.json +10 -5
  223. package/dist/schemas/onchain_operations_personal.schema.json +2 -2
  224. package/dist/schemas/onchain_operations_progress.schema.json +17 -12
  225. package/dist/schemas/onchain_operations_proof.schema.json +6 -6
  226. package/dist/schemas/onchain_operations_repository.schema.json +19 -14
  227. package/dist/schemas/onchain_operations_reward.schema.json +96 -15
  228. package/dist/schemas/onchain_operations_service.schema.json +33 -21
  229. package/dist/schemas/onchain_operations_treasury.schema.json +15 -10
  230. package/dist/schemas/onchain_table_data.output.json +7 -7
  231. package/dist/schemas/query_toolkit.output.json +268 -44
  232. package/dist/schemas/query_toolkit.schema.json +1 -1
  233. package/dist/schemas/schema_query.schema.json +7 -2
  234. package/dist/schemas/workflow_operation.schema.json +5 -5
  235. package/dist/schemas/wowok_buildin_info.output.json +140 -3
  236. package/dist/schemas/wowok_buildin_info.schema.json +2 -2
  237. package/dist/tools/handlers/benchmark-migration.d.ts +66 -1
  238. package/dist/tools/handlers/benchmark-migration.js +1 -1
  239. package/dist/tools/handlers/config.js +1 -1
  240. package/dist/tools/handlers/dispatch-expectations.d.ts +0 -1
  241. package/dist/tools/handlers/dispatch-expectations.js +1 -1
  242. package/dist/tools/handlers/industry-pack.js +1 -1
  243. package/dist/tools/handlers/intent-radar.js +1 -1
  244. package/dist/tools/handlers/keeper.d.ts +1 -1
  245. package/dist/tools/handlers/local.js +1 -1
  246. package/dist/tools/handlers/onchain.d.ts +12 -0
  247. package/dist/tools/handlers/onchain.js +1 -1
  248. package/dist/tools/handlers/query.d.ts +1 -0
  249. package/dist/tools/handlers/query.js +1 -1
  250. package/dist/tools/handlers/review-chain.js +1 -1
  251. package/dist/tools/handlers/schema-query.js +1 -1
  252. package/dist/tools/handlers/workflow.js +1 -1
  253. package/dist/tools/index.js +1 -1
  254. package/dist/tools/move-fn-index.gen.js +1 -1
  255. package/dist/tools/registry/agent.js +1 -1
  256. package/dist/tools/registry/business.js +1 -1
  257. package/dist/tools/registry/files.js +1 -1
  258. package/dist/tools/registry/query.js +1 -1
  259. package/dist/tools/rules-hook.js +1 -1
  260. package/dist/tools/upgrade-check.d.ts +23 -0
  261. package/dist/tools/upgrade-check.js +1 -1
  262. package/dist/tools/wip-deploy-assist.d.ts +6 -0
  263. package/dist/tools/wip-deploy-assist.js +1 -1
  264. package/dist/tools/wrap.js +1 -1
  265. package/package.json +2 -2
@@ -1 +1 @@
1
- const MAX_RECORDS=0x32,MAX_AGE_MS=0x2*0x3c*0x3c*0x3e8,records=new Map();let seq=0x0;function hash(a){let b=0x1505;for(let c=0x0;c<a['length'];c++)b=(b<<0x5)+b+a['charCodeAt'](c)>>>0x0;return b['toString'](0x10);}function prune(){const a=Date['now']();for(const [b,c]of records){if(a-c['started_at']>MAX_AGE_MS)records['delete'](b);}while(records['size']>MAX_RECORDS){const d=records['keys']()['next']()['value'];if(d===undefined)break;records['delete'](d);}}function addr(a){return typeof a==='string'&&a['startsWith']('0x')?a:undefined;}export function beginInFlight(a,b,c){const d=b,e=d?.['order_new']?.['buy'],f=addr(d?.['object'])??addr(e?.['service']),g={'marker_id':'ifl_'+Date['now']()['toString'](0x10)+'_'+(seq++)['toString'](0x10),'op':a,'service':f,'buyer':addr(c?.['account']),'items_count':Array['isArray'](e?.['items'])?e['items']['length']:undefined,'params_hash':hash(JSON['stringify'](b??{})),'started_at':Date['now'](),'digests':[],'status':'in_flight'};return records['set'](g['marker_id'],g),prune(),g['marker_id'];}export function recordInFlightOutcome(a,b){const c=records['get'](a);if(!c)return;const d=b?.['digest'];typeof d==='string'&&d&&(c['digests']['push'](d),c['status']='landed');}export function describeLastInFlight(a){let b;for(const d of records['values']())if(d['op']===a)b=d;if(!b)return undefined;const c=[b['service']?'service='+b['service']:undefined,b['buyer']?'buyer='+b['buyer']:undefined,b['items_count']!==undefined?'items='+b['items_count']:undefined]['filter'](Boolean)['join']('\x20');if(b['status']==='landed'&&b['digests']['length']>0x0)return'IN-FLIGHT\x20MARKER\x20'+b['marker_id']+':\x20op='+b['op']+'\x20'+c+'\x20landed\x20with\x20digest\x20'+b['digests'][0x0]+'\x20'+('('+new Date(b['started_at'])['toISOString']()+').\x20The\x20execution\x20DID\x20reach\x20the\x20chain\x20—\x20adopt\x20the\x20')+'resulting\x20object;\x20resubmitting\x20the\x20same\x20call\x20creates\x20a\x20second\x20one.';return'IN-FLIGHT\x20MARKER\x20'+b['marker_id']+':\x20op='+b['op']+'\x20'+c+'\x20started\x20'+new Date(b['started_at'])['toISOString']()+'\x20'+'—\x20this\x20operation\x20is\x20observability-non-atomic:\x20a\x20transport\x20drop\x20after\x20submit\x20leaves\x20the\x20commit\x20state\x20'+'open.\x20Before\x20resubmitting,\x20first\x20verify\x20whether\x20an\x20order\x20with\x20this\x20exact\x20signature\x20already\x20landed\x20'+'(query\x20the\x20sender\x27s\x20recent\x20on-chain\x20objects\x20or\x20onchain_events\x20for\x20this\x20service);\x20adopt\x20it\x20if\x20present,\x20'+'resubmit\x20only\x20if\x20confirmed\x20absent.';}
1
+ const MAX_RECORDS=0x32,MAX_AGE_MS=0x2*0x3c*0x3c*0x3e8,records=new Map();let seq=0x0;function hash(a){let b=0x1505;for(let c=0x0;c<a['length'];c++)b=(b<<0x5)+b+a['charCodeAt'](c)>>>0x0;return b['toString'](0x10);}function prune(){const a=Date['now']();for(const [b,c]of records){if(a-c['started_at']>MAX_AGE_MS)records['delete'](b);}while(records['size']>MAX_RECORDS){const d=records['keys']()['next']()['value'];if(d===undefined)break;records['delete'](d);}}function addr(a){return typeof a==='string'&&a['startsWith']('0x')?a:undefined;}export function beginInFlight(a,b,c){const d=b,e=d?.['order_new']?.['buy'],f=addr(d?.['object'])??addr(e?.['service']),g={'marker_id':'ifl_'+Date['now']()['toString'](0x10)+'_'+(seq++)['toString'](0x10),'op':a,'service':f,'buyer':addr(c?.['account']),'items_count':Array['isArray'](e?.['items'])?e['items']['length']:undefined,'params_hash':hash(JSON['stringify'](b??{})),'started_at':Date['now'](),'digests':[],'status':'in_flight'};return records['set'](g['marker_id'],g),prune(),g['marker_id'];}export function recordInFlightOutcome(a,b){const c=records['get'](a);if(!c)return;const d=b?.['digest'];typeof d==='string'&&d&&(c['digests']['push'](d),c['status']='landed');}export function describeLastInFlight(a){let b;for(const d of records['values']())if(d['op']===a)b=d;if(!b)return undefined;const c=[b['service']?'service='+b['service']:undefined,b['buyer']?'buyer='+b['buyer']:undefined,b['items_count']!==undefined?'items='+b['items_count']:undefined]['filter'](Boolean)['join']('\x20');if(b['status']==='landed'&&b['digests']['length']>0x0)return'IN-FLIGHT\x20MARKER\x20'+b['marker_id']+':\x20op='+b['op']+'\x20'+c+'\x20landed\x20with\x20digest\x20'+b['digests'][0x0]+'\x20'+('('+new Date(b['started_at'])['toISOString']()+').\x20The\x20execution\x20DID\x20reach\x20the\x20chain\x20—\x20adopt\x20the\x20')+'resulting\x20object;\x20resubmitting\x20the\x20same\x20call\x20creates\x20a\x20second\x20one.';return'IN-FLIGHT\x20MARKER\x20'+b['marker_id']+':\x20op='+b['op']+'\x20'+c+'\x20started\x20'+new Date(b['started_at'])['toISOString']()+'\x20'+'—\x20this\x20operation\x20is\x20observability-non-atomic:\x20a\x20transport\x20drop\x20after\x20submit\x20leaves\x20the\x20commit\x20state\x20'+'open.\x20Before\x20resubmitting,\x20first\x20verify\x20whether\x20an\x20order\x20with\x20this\x20exact\x20signature\x20already\x20landed\x20'+'(query\x20the\x20sender\x27s\x20recent\x20on-chain\x20objects\x20or\x20onchain_events\x20for\x20this\x20service);\x20adopt\x20it\x20if\x20present,\x20'+'resubmit\x20only\x20if\x20confirmed\x20absent.';}export function lastInFlightMarker(a){let b;for(const c of records['values']())if(c['op']===a)b=c;return b;}export function matchOrderLandedEvent(a,b){const c=a['started_at']-0x2*0x3c*0x3e8,d=Number(b?.['time']);if(Number['isFinite'](d)&&d<c)return undefined;const e=!!(a['service']&&b?.['service']&&b['service']===a['service']),f=!!(a['buyer']&&b?.['sender']&&b['sender']['toLowerCase']()===a['buyer']['toLowerCase']());if(!e&&!f)return undefined;if(a['buyer']&&b?.['sender']&&!f)return undefined;const g=b?.['digest']??'unknown';return'AUTO-VERIFIED\x20ON-CHAIN:\x20this\x20order\x20DID\x20land\x20despite\x20the\x20error\x20above\x20—\x20order='+(b?.['order']??'?')+((b?.['progress']?'\x20progress='+b['progress']:'')+'\x20digest='+g+'.\x20ADOPT\x20this\x20order\x20object;\x20')+'resubmitting\x20the\x20same\x20call\x20would\x20escrow\x20a\x20SECOND\x20time.';}
@@ -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";
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";
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,'general':0x46},'addressesPainPoints':['Client\x20never\x20approves\x20deliverables','Merchant\x20delivers\x20but\x20cannot\x20get\x20paid','Full\x20upfront\x20payment\x20with\x20no\x20delivery\x20guarantee'],'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,'general':0x46},'addressesPainPoints':['Platform\x20acts\x20as\x20both\x20judge\x20and\x20party','Arbitration\x20fees\x20too\x20high\x20for\x20small\x20claims','No\x20binding\x20dispute\x20resolution'],'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,'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'],'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,'general':0x46},'addressesPainPoints':['Multi-layer\x20commission\x20hidden\x20from\x20users','Suppliers\x20paid\x20opaquely','Platform\x20takes\x20undisclosed\x20FX\x20spread'],'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,'general':0x32},'addressesPainPoints':['Creator\x20abandons\x20after\x20collecting\x20subscriptions','Silent\x20auto-renewal\x20with\x20no\x20delivery\x20proof','No\x20mechanism\x20to\x20hold\x20creators\x20accountable'],'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,'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'],'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,'general':0x50},'addressesPainPoints':['Refund\x20trapped\x20in\x20incumbent\x20platform\x20balance','No\x20refund\x20mechanism\x20for\x20service\x20failure','Refund\x20decision\x20centralized\x20at\x20platform'],'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,'general':0x55},'addressesPainPoints':['Fake\x20reviews\x20and\x20rating\x20manipulation','No\x20cross-platform\x20reputation\x20portability','Platform\x20can\x20delete\x20negative\x20reviews'],'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,'general':0x3c},'addressesPainPoints':['Supplier\x20payments\x20opaque\x20to\x20end\x20user','Platform\x20controls\x20supplier\x20relationships','No\x20direct\x20merchant-supplier\x20collaboration'],'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,'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'],'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'}];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 checkModuleConstraints(a,b){const c=a['requiredConstraints']['filter'](f=>f['blocking']&&!b['has'](f['constraint_id']))['map'](f=>f['constraint_id']),d=c['length']===0x0,e=a['evaluationImpact']['filter'](f=>f['effect']==='boost'||f['effect']==='required')['reduce']((f,g)=>f+(g['effect']==='required'?0xf:0x8),0x0);return{'module':a['id'],'adopted':d,'reason':d?undefined:'Missing\x20required\x20constraints:\x20'+c['join'](',\x20'),'missingConstraints':c['length']>0x0?c:undefined,'estimatedScoreBoost':Math['min'](e,0x64)};}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,'general':0x46},'addressesPainPoints':['Client\x20never\x20approves\x20deliverables','Merchant\x20delivers\x20but\x20cannot\x20get\x20paid','Full\x20upfront\x20payment\x20with\x20no\x20delivery\x20guarantee'],'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,'general':0x46},'addressesPainPoints':['Platform\x20acts\x20as\x20both\x20judge\x20and\x20party','Arbitration\x20fees\x20too\x20high\x20for\x20small\x20claims','No\x20binding\x20dispute\x20resolution'],'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,'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'],'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,'general':0x46},'addressesPainPoints':['Multi-layer\x20commission\x20hidden\x20from\x20users','Suppliers\x20paid\x20opaquely','Platform\x20takes\x20undisclosed\x20FX\x20spread'],'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,'general':0x32},'addressesPainPoints':['Creator\x20abandons\x20after\x20collecting\x20subscriptions','Silent\x20auto-renewal\x20with\x20no\x20delivery\x20proof','No\x20mechanism\x20to\x20hold\x20creators\x20accountable'],'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,'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'],'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,'general':0x50},'addressesPainPoints':['Refund\x20trapped\x20in\x20incumbent\x20platform\x20balance','No\x20refund\x20mechanism\x20for\x20service\x20failure','Refund\x20decision\x20centralized\x20at\x20platform'],'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,'general':0x55},'addressesPainPoints':['Fake\x20reviews\x20and\x20rating\x20manipulation','No\x20cross-platform\x20reputation\x20portability','Platform\x20can\x20delete\x20negative\x20reviews'],'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,'general':0x3c},'addressesPainPoints':['Supplier\x20payments\x20opaque\x20to\x20end\x20user','Platform\x20controls\x20supplier\x20relationships','No\x20direct\x20merchant-supplier\x20collaboration'],'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,'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'],'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,'general':0x46},'addressesPainPoints':['Coupon\x20systems\x20locked\x20inside\x20incumbent\x20platforms','Promotions\x20improvised\x20after\x20publish\x20with\x20no\x20budget\x20plan','Discount\x20promises\x20that\x20silently\x20change\x20at\x20renewal'],'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,'general':0x41},'addressesPainPoints':['No\x20mechanism\x20to\x20incentivize\x20honest\x20buyer\x20reviews','Review\x20rewards\x20locked\x20inside\x20incumbent\x20platforms','Incentive\x20promises\x20that\x20evaporate\x20after\x20purchase'],'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':![]}];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 checkModuleConstraints(a,b){const c=a['requiredConstraints']['filter'](f=>f['blocking']&&!b['has'](f['constraint_id']))['map'](f=>f['constraint_id']),d=c['length']===0x0,e=a['evaluationImpact']['filter'](f=>f['effect']==='boost'||f['effect']==='required')['reduce']((f,g)=>f+(g['effect']==='required'?0xf:0x8),0x0);return{'module':a['id'],'adopted':d,'reason':d?undefined:'Missing\x20required\x20constraints:\x20'+c['join'](',\x20'),'missingConstraints':c['length']>0x0?c:undefined,'estimatedScoreBoost':Math['min'](e,0x64)};}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 +1 @@
1
- export class CapabilityRegistry{static ['instance'];['cards']=new Map();static['Instance'](){return!CapabilityRegistry['instance']&&(CapabilityRegistry['instance']=new CapabilityRegistry()),CapabilityRegistry['instance'];}constructor(){this['registerBuiltins']();}['registerCard'](a){if(!a['capability_id']||!a['object_type']||!a['module'])return![];return this['cards']['set'](a['capability_id'],a),!![];}['getCard'](a){return this['cards']['get'](a);}['registerBuiltins'](){this['registerCard']({'capability_id':'permission.index_create','display_name':'Permission\x20Index\x20Create','description':'Create\x20role\x20permission\x20index,\x20supports\x20multi-role\x20permission\x20assignment\x20such\x20as\x20merchant/customer/arbiter','object_type':'permission','module':'handler','category':'trust','industry_agnostic':'high','risk_profile':{'funds_risk':'low','trust_risk':'low','delivery_risk':'low','compliance_risk':'low','known_risks':['Index\x20proliferation\x20without\x20naming\x20convention\x20makes\x20permission\x20audits\x20harder']},'benefit_profile':{'automation_level':'medium','trust_boost':'high','efficiency_gain':'medium','benefits':['Role-based\x20governance\x20foundation\x20for\x20all\x20other\x20objects']}}),this['registerCard']({'capability_id':'permission.role_assign','display_name':'Permission\x20Role\x20Assign','description':'Assign\x20role\x20permission\x20index\x20to\x20objects\x20(Machine/Service/Allocation)','object_type':'permission','module':'handler','category':'trust','industry_agnostic':'high','risk_profile':{'funds_risk':'low','trust_risk':'medium','delivery_risk':'low','compliance_risk':'low','known_risks':['Mis-assigned\x20role\x20grants\x20unintended\x20operational\x20authority']},'benefit_profile':{'automation_level':'high','trust_boost':'high','efficiency_gain':'medium','benefits':['Binds\x20governance\x20roles\x20to\x20concrete\x20objects']}}),this['registerCard']({'capability_id':'guard.validate_buy','display_name':'Guard\x20Validate\x20Buy','description':'Order\x20validation:\x20check\x20buyer\x20eligibility,\x20order\x20parameters,\x20inventory\x20and\x20other\x20conditions','object_type':'guard','module':'handler','category':'validation','industry_agnostic':'medium','risk_profile':{'funds_risk':'low','trust_risk':'medium','delivery_risk':'medium','compliance_risk':'low','known_risks':['Over-strict\x20buy\x20validation\x20blocks\x20legitimate\x20orders;\x20over-loose\x20validation\x20admits\x20fraud']},'benefit_profile':{'automation_level':'high','trust_boost':'high','efficiency_gain':'high','benefits':['Automated\x20purchase\x20gating\x20without\x20manual\x20review']}}),this['registerCard']({'capability_id':'guard.validate_wip_hash','display_name':'Guard\x20Validate\x20WIP\x20Hash','description':'Validate\x20WIP\x20(Work-In-Progress)\x20hash,\x20used\x20for\x20milestone\x20validation\x20of\x20digital\x20deliverables','object_type':'guard','module':'handler','category':'evidence','industry_agnostic':'low','risk_profile':{'funds_risk':'low','trust_risk':'medium','delivery_risk':'high','compliance_risk':'low','known_risks':['Wrong\x20hash\x20algorithm\x20or\x20field\x20mapping\x20stalls\x20milestone\x20release']},'benefit_profile':{'automation_level':'high','trust_boost':'medium','efficiency_gain':'medium','benefits':['Tamper-proof\x20delivery\x20evidence\x20for\x20digital\x20deliverables']}}),this['registerCard']({'capability_id':'machine.node_topology','display_name':'Machine\x20Node\x20Topology','description':'Workflow\x20node\x20topology:\x20define\x20the\x20state\x20machine\x20from\x20order\x20creation\x20to\x20completion','object_type':'machine','module':'templates','category':'workflow','industry_agnostic':'low','risk_profile':{'funds_risk':'low','trust_risk':'medium','delivery_risk':'high','compliance_risk':'low','known_risks':['Dead-end\x20nodes\x20or\x20missing\x20refund\x20paths\x20trap\x20order\x20funds']},'benefit_profile':{'automation_level':'medium','trust_boost':'medium','efficiency_gain':'high','benefits':['Declarative\x20workflow\x20from\x20order\x20creation\x20to\x20completion']}}),this['registerCard']({'capability_id':'treasury.owner_receive','display_name':'Treasury\x20Owner\x20Receive','description':'Fund\x20escrow:\x20supports\x20owner_receive\x20mode,\x20funds\x20go\x20directly\x20into\x20the\x20object\x20owner\x20wallet','object_type':'treasury','module':'handler','category':'fund_flow','industry_agnostic':'high','risk_profile':{'funds_risk':'high','trust_risk':'medium','delivery_risk':'low','compliance_risk':'low','known_risks':['Direct\x20fund\x20custody\x20—\x20misconfigured\x20owner\x20diverts\x20all\x20proceeds']},'benefit_profile':{'automation_level':'high','trust_boost':'medium','efficiency_gain':'medium','benefits':['Automated\x20escrow\x20and\x20owner\x20settlement']}}),this['registerCard']({'capability_id':'allocation.distribute','display_name':'Multi-tier\x20Allocation\x20Distribution','description':'Multi-tier\x20allocation:\x20supports\x20distributing\x20funds\x20to\x20multiple\x20recipients\x20by\x20ratio\x20/\x20by\x20order\x20/\x20by\x20condition','object_type':'allocation','module':'handler','category':'fund_flow','industry_agnostic':'medium','risk_profile':{'funds_risk':'high','trust_risk':'low','delivery_risk':'medium','compliance_risk':'low','known_risks':['Wrong\x20split\x20ratios\x20or\x20recipient\x20addresses\x20misdirect\x20settlement\x20funds']},'benefit_profile':{'automation_level':'high','trust_boost':'medium','efficiency_gain':'high','benefits':['Multi-recipient\x20settlement\x20without\x20manual\x20transfers']}}),this['registerCard']({'capability_id':'allocation.distribute_milestone','display_name':'Milestone-based\x20Allocation','description':'Milestone\x20allocation:\x20release\x20funds\x20by\x20delivery\x20milestones,\x20each\x20milestone\x20requires\x20WIP\x20hash\x20validation','object_type':'allocation','module':'handler','category':'fund_flow','industry_agnostic':'low','risk_profile':{'funds_risk':'high','trust_risk':'medium','delivery_risk':'medium','compliance_risk':'low','known_risks':['Stuck\x20milestone\x20gates\x20lock\x20buyer\x20funds\x20until\x20evidence\x20is\x20supplied']},'benefit_profile':{'automation_level':'medium','trust_boost':'high','efficiency_gain':'medium','benefits':['Evidence-gated\x20release\x20protects\x20both\x20buyer\x20and\x20provider']}}),this['registerCard']({'capability_id':'service.publish','display_name':'Service\x20Publish','description':'Publish\x20Service\x20object\x20on-chain,\x20bind\x20Machine/Guard/Permission/Allocation\x20and\x20other\x20dependencies','object_type':'service','module':'handler','category':'lifecycle','industry_agnostic':'high','risk_profile':{'funds_risk':'medium','trust_risk':'medium','delivery_risk':'medium','compliance_risk':'medium','known_risks':['Publish\x20freezes\x20machine\x20binding\x20and\x20order_allocators\x20permanently\x20(E_ALREADY_PUBLISHED)']},'benefit_profile':{'automation_level':'medium','trust_boost':'medium','efficiency_gain':'medium','benefits':['On-chain\x20discoverability\x20and\x20order\x20intake']}}),this['registerCard']({'capability_id':'progress.advance','display_name':'Progress\x20Advance','description':'Order\x20fulfillment\x20progress\x20advance:\x20advance\x20to\x20next\x20state\x20based\x20on\x20Machine\x20node\x20topology','object_type':'progress','module':'handler','category':'workflow','industry_agnostic':'medium','risk_profile':{'funds_risk':'medium','trust_risk':'low','delivery_risk':'high','compliance_risk':'low','known_risks':['Forward\x20without\x20authorized\x20executor\x20permanently\x20stalls\x20the\x20order']},'benefit_profile':{'automation_level':'high','trust_boost':'medium','efficiency_gain':'high','benefits':['Deterministic\x20order\x20state\x20progression']}}),this['registerCard']({'capability_id':'arb.vote_weighted','display_name':'Arbitration\x20Vote\x20Weighted','description':'guard-based\x20weighted\x20voting\x20arbitration:\x20vote\x20by\x20Guard\x20weight\x20to\x20determine\x20arbitration\x20result','object_type':'arb','module':'handler','category':'trust','industry_agnostic':'medium','risk_profile':{'funds_risk':'low','trust_risk':'high','delivery_risk':'medium','compliance_risk':'medium','known_risks':['Shared\x20permission\x20with\x20Service\x20destroys\x20dispute\x20independence\x20(E_ARBITRATION_PERMISSION_CONFLICT)']},'benefit_profile':{'automation_level':'medium','trust_boost':'high','efficiency_gain':'low','benefits':['Neutral\x20third-party\x20dispute\x20resolution']}}),this['registerCard']({'capability_id':'reward.claim_guard','display_name':'Reward\x20Claim\x20Guard','description':'Reward\x20claim:\x20release\x20reward\x20after\x20validating\x20claim\x20conditions\x20(such\x20as\x20positive\x20review,\x20repurchase)\x20via\x20Guard','object_type':'reward','module':'handler','category':'fund_flow','industry_agnostic':'medium','risk_profile':{'funds_risk':'medium','trust_risk':'low','delivery_risk':'low','compliance_risk':'low','known_risks':['Loose\x20claim\x20conditions\x20drain\x20the\x20reward\x20pool']},'benefit_profile':{'automation_level':'high','trust_boost':'medium','efficiency_gain':'medium','benefits':['Incentivizes\x20reviews\x20and\x20repurchase']}}),this['registerCard']({'capability_id':'contact.im_create','display_name':'Contact\x20IM\x20Create','description':'Create\x20IM\x20contact\x20object:\x20buyer\x20and\x20seller\x20communicate\x20via\x20Messenger','object_type':'contact','module':'handler','category':'communication','industry_agnostic':'high','risk_profile':{'funds_risk':'low','trust_risk':'low','delivery_risk':'low','compliance_risk':'low','known_risks':['Unattended\x20IM\x20channel\x20degrades\x20dispute\x20response\x20time']},'benefit_profile':{'automation_level':'medium','trust_boost':'medium','efficiency_gain':'medium','benefits':['Direct\x20buyer-seller\x20encrypted\x20communication']}}),this['registerCard']({'capability_id':'demand.matching','display_name':'Demand\x20Matching','description':'Demand\x20matching:\x20match\x20corresponding\x20Service\x20based\x20on\x20user\x20demand','object_type':'demand','module':'handler','category':'query','industry_agnostic':'high','risk_profile':{'funds_risk':'low','trust_risk':'low','delivery_risk':'low','compliance_risk':'low','known_risks':['Poor\x20matching\x20signals\x20bury\x20quality\x20services']},'benefit_profile':{'automation_level':'medium','trust_boost':'low','efficiency_gain':'medium','benefits':['Demand-side\x20discovery\x20channel']}}),this['registerCard']({'capability_id':'repository.write_validate','display_name':'Repository\x20Write\x20Validate','description':'Knowledge\x20base\x20write\x20validation:\x20validate\x20write\x20permissions\x20and\x20data\x20format\x20via\x20Guard','object_type':'repository','module':'handler','category':'validation','industry_agnostic':'high','risk_profile':{'funds_risk':'low','trust_risk':'medium','delivery_risk':'low','compliance_risk':'medium','known_risks':['Unvalidated\x20writes\x20pollute\x20the\x20knowledge\x20base\x20with\x20unverifiable\x20claims']},'benefit_profile':{'automation_level':'medium','trust_boost':'high','efficiency_gain':'medium','benefits':['Guard-gated\x20attestation\x20for\x20off-chain\x20data']}}),this['registerCard']({'capability_id':'proof.evidence_anchor','display_name':'Proof\x20Evidence\x20Anchor','description':'Evidence\x20on-chain:\x20anchor\x20delivery\x20evidence\x20(hash)\x20to\x20on-chain\x20Progress\x20node','object_type':'proof','module':'handler','category':'evidence','industry_agnostic':'medium','risk_profile':{'funds_risk':'low','trust_risk':'medium','delivery_risk':'low','compliance_risk':'low','known_risks':['Anchored\x20evidence\x20is\x20immutable\x20—\x20wrong\x20hash\x20cannot\x20be\x20corrected']},'benefit_profile':{'automation_level':'high','trust_boost':'high','efficiency_gain':'medium','benefits':['Immutable\x20WTS\x20evidence\x20for\x20Messenger\x20confirmations']}}),this['registerCard']({'capability_id':'personal.profile_manage','display_name':'Personal\x20Profile\x20Manage','description':'Personal\x20profile\x20management:\x20user\x20identity/preference/history\x20management','object_type':'personal','module':'handler','category':'data_model','industry_agnostic':'high','risk_profile':{'funds_risk':'low','trust_risk':'low','delivery_risk':'low','compliance_risk':'medium','known_risks':['Profile\x20data\x20may\x20fall\x20under\x20privacy\x20regulation\x20(PII)']},'benefit_profile':{'automation_level':'medium','trust_boost':'low','efficiency_gain':'low','benefits':['Portable\x20user\x20identity\x20across\x20services']}}),this['registerCard']({'capability_id':'payment.settle','display_name':'Payment\x20Settle','description':'Payment\x20settlement:\x20complete\x20fund\x20settlement\x20in\x20collaboration\x20with\x20Allocation','object_type':'payment','module':'handler','category':'fund_flow','industry_agnostic':'high','risk_profile':{'funds_risk':'high','trust_risk':'low','delivery_risk':'low','compliance_risk':'medium','known_risks':['Settlement\x20errors\x20are\x20irreversible\x20once\x20funds\x20transfer']},'benefit_profile':{'automation_level':'high','trust_boost':'low','efficiency_gain':'high','benefits':['Atomic\x20settlement\x20in\x20collaboration\x20with\x20Allocation']}}),this['registerCard']({'capability_id':'guard.validate_withdraw','display_name':'Guard\x20Validate\x20Withdraw','description':'Withdrawal\x20validation:\x20gate\x20fund\x20release\x20from\x20Allocation\x20escrow\x20on\x20delivery\x20confirmation','object_type':'guard','module':'handler','category':'validation','industry_agnostic':'medium','risk_profile':{'funds_risk':'high','trust_risk':'medium','delivery_risk':'medium','compliance_risk':'low','known_risks':['Mis-gated\x20withdrawal\x20releases\x20escrowed\x20funds\x20prematurely']},'benefit_profile':{'automation_level':'high','trust_boost':'high','efficiency_gain':'high','benefits':['Contract-enforced\x20delivery\x20gate\x20replaces\x20platform\x20custody']}}),this['registerCard']({'capability_id':'guard.validate_refund','display_name':'Guard\x20Validate\x20Refund','description':'Refund\x20validation:\x20gate\x20buyer\x20refund\x20on\x20cancellation\x20or\x20return\x20conditions','object_type':'guard','module':'handler','category':'validation','industry_agnostic':'medium','risk_profile':{'funds_risk':'medium','trust_risk':'medium','delivery_risk':'medium','compliance_risk':'low','known_risks':['Over-broad\x20refund\x20conditions\x20enable\x20buyer\x20abuse']},'benefit_profile':{'automation_level':'high','trust_boost':'high','efficiency_gain':'high','benefits':['Trustless\x20buyer\x20refund\x20without\x20merchant\x20approval']}});}}export function getCapabilityRegistry(){return CapabilityRegistry['Instance']();}export const CAPABILITY_MANIFEST_VERSION=0x2;
1
+ export class CapabilityRegistry{static ['instance'];['cards']=new Map();static['Instance'](){return!CapabilityRegistry['instance']&&(CapabilityRegistry['instance']=new CapabilityRegistry()),CapabilityRegistry['instance'];}constructor(){this['registerBuiltins']();}['registerCard'](a){if(!a['capability_id']||!a['object_type']||!a['module'])return![];return this['cards']['set'](a['capability_id'],a),!![];}['getCard'](a){return this['cards']['get'](a);}['registerBuiltins'](){this['registerCard']({'capability_id':'permission.index_create','display_name':'Permission\x20Index\x20Create','description':'Create\x20role\x20permission\x20index,\x20supports\x20multi-role\x20permission\x20assignment\x20such\x20as\x20merchant/customer/arbiter','object_type':'permission','module':'handler','category':'trust','industry_agnostic':'high','risk_profile':{'funds_risk':'low','trust_risk':'low','delivery_risk':'low','compliance_risk':'low','known_risks':['Index\x20proliferation\x20without\x20naming\x20convention\x20makes\x20permission\x20audits\x20harder']},'benefit_profile':{'automation_level':'medium','trust_boost':'high','efficiency_gain':'medium','benefits':['Role-based\x20governance\x20foundation\x20for\x20all\x20other\x20objects']}}),this['registerCard']({'capability_id':'permission.role_assign','display_name':'Permission\x20Role\x20Assign','description':'Assign\x20role\x20permission\x20index\x20to\x20objects\x20(Machine/Service/Allocation)','object_type':'permission','module':'handler','category':'trust','industry_agnostic':'high','risk_profile':{'funds_risk':'low','trust_risk':'medium','delivery_risk':'low','compliance_risk':'low','known_risks':['Mis-assigned\x20role\x20grants\x20unintended\x20operational\x20authority']},'benefit_profile':{'automation_level':'high','trust_boost':'high','efficiency_gain':'medium','benefits':['Binds\x20governance\x20roles\x20to\x20concrete\x20objects']}}),this['registerCard']({'capability_id':'guard.validate_buy','display_name':'Guard\x20Validate\x20Buy','description':'Order\x20validation:\x20check\x20buyer\x20eligibility,\x20order\x20parameters,\x20inventory\x20and\x20other\x20conditions','object_type':'guard','module':'handler','category':'validation','industry_agnostic':'medium','risk_profile':{'funds_risk':'low','trust_risk':'medium','delivery_risk':'medium','compliance_risk':'low','known_risks':['Over-strict\x20buy\x20validation\x20blocks\x20legitimate\x20orders;\x20over-loose\x20validation\x20admits\x20fraud']},'benefit_profile':{'automation_level':'high','trust_boost':'high','efficiency_gain':'high','benefits':['Automated\x20purchase\x20gating\x20without\x20manual\x20review']}}),this['registerCard']({'capability_id':'guard.validate_wip_hash','display_name':'Guard\x20Validate\x20WIP\x20Hash','description':'Validate\x20WIP\x20(Work-In-Progress)\x20hash,\x20used\x20for\x20milestone\x20validation\x20of\x20digital\x20deliverables','object_type':'guard','module':'handler','category':'evidence','industry_agnostic':'low','risk_profile':{'funds_risk':'low','trust_risk':'medium','delivery_risk':'high','compliance_risk':'low','known_risks':['Wrong\x20hash\x20algorithm\x20or\x20field\x20mapping\x20stalls\x20milestone\x20release']},'benefit_profile':{'automation_level':'high','trust_boost':'medium','efficiency_gain':'medium','benefits':['Tamper-proof\x20delivery\x20evidence\x20for\x20digital\x20deliverables']}}),this['registerCard']({'capability_id':'machine.node_topology','display_name':'Machine\x20Node\x20Topology','description':'Workflow\x20node\x20topology:\x20define\x20the\x20state\x20machine\x20from\x20order\x20creation\x20to\x20completion','object_type':'machine','module':'templates','category':'workflow','industry_agnostic':'low','risk_profile':{'funds_risk':'low','trust_risk':'medium','delivery_risk':'high','compliance_risk':'low','known_risks':['Dead-end\x20nodes\x20or\x20missing\x20refund\x20paths\x20trap\x20order\x20funds']},'benefit_profile':{'automation_level':'medium','trust_boost':'medium','efficiency_gain':'high','benefits':['Declarative\x20workflow\x20from\x20order\x20creation\x20to\x20completion']}}),this['registerCard']({'capability_id':'treasury.owner_receive','display_name':'Treasury\x20Owner\x20Receive','description':'Fund\x20escrow:\x20supports\x20owner_receive\x20mode,\x20funds\x20go\x20directly\x20into\x20the\x20object\x20owner\x20wallet','object_type':'treasury','module':'handler','category':'fund_flow','industry_agnostic':'high','risk_profile':{'funds_risk':'high','trust_risk':'medium','delivery_risk':'low','compliance_risk':'low','known_risks':['Direct\x20fund\x20custody\x20—\x20misconfigured\x20owner\x20diverts\x20all\x20proceeds']},'benefit_profile':{'automation_level':'high','trust_boost':'medium','efficiency_gain':'medium','benefits':['Automated\x20escrow\x20and\x20owner\x20settlement']}}),this['registerCard']({'capability_id':'allocation.distribute','display_name':'Multi-tier\x20Allocation\x20Distribution','description':'Multi-tier\x20allocation:\x20supports\x20distributing\x20funds\x20to\x20multiple\x20recipients\x20by\x20ratio\x20/\x20by\x20order\x20/\x20by\x20condition','object_type':'allocation','module':'handler','category':'fund_flow','industry_agnostic':'medium','risk_profile':{'funds_risk':'high','trust_risk':'low','delivery_risk':'medium','compliance_risk':'low','known_risks':['Wrong\x20split\x20ratios\x20or\x20recipient\x20addresses\x20misdirect\x20settlement\x20funds']},'benefit_profile':{'automation_level':'high','trust_boost':'medium','efficiency_gain':'high','benefits':['Multi-recipient\x20settlement\x20without\x20manual\x20transfers']}}),this['registerCard']({'capability_id':'allocation.distribute_milestone','display_name':'Milestone-based\x20Allocation','description':'Milestone\x20allocation:\x20release\x20funds\x20by\x20delivery\x20milestones,\x20each\x20milestone\x20requires\x20WIP\x20hash\x20validation','object_type':'allocation','module':'handler','category':'fund_flow','industry_agnostic':'low','risk_profile':{'funds_risk':'high','trust_risk':'medium','delivery_risk':'medium','compliance_risk':'low','known_risks':['Stuck\x20milestone\x20gates\x20lock\x20buyer\x20funds\x20until\x20evidence\x20is\x20supplied']},'benefit_profile':{'automation_level':'medium','trust_boost':'high','efficiency_gain':'medium','benefits':['Evidence-gated\x20release\x20protects\x20both\x20buyer\x20and\x20provider']}}),this['registerCard']({'capability_id':'service.publish','display_name':'Service\x20Publish','description':'Publish\x20Service\x20object\x20on-chain,\x20bind\x20Machine/Guard/Permission/Allocation\x20and\x20other\x20dependencies','object_type':'service','module':'handler','category':'lifecycle','industry_agnostic':'high','risk_profile':{'funds_risk':'medium','trust_risk':'medium','delivery_risk':'medium','compliance_risk':'medium','known_risks':['Publish\x20freezes\x20the\x20machine\x20graph\x20and\x20the\x20configured\x20prefix\x20+\x20thresholds\x20of\x20order_allocators\x20(E_ALREADY_PUBLISHED);\x20allocator\x20APPEND\x20remains\x20possible\x20(order_allocators_append)\x20—\x20use\x20it\x20to\x20add\x20missing\x20fund-exit\x20legs']},'benefit_profile':{'automation_level':'medium','trust_boost':'medium','efficiency_gain':'medium','benefits':['On-chain\x20discoverability\x20and\x20order\x20intake']}}),this['registerCard']({'capability_id':'progress.advance','display_name':'Progress\x20Advance','description':'Order\x20fulfillment\x20progress\x20advance:\x20advance\x20to\x20next\x20state\x20based\x20on\x20Machine\x20node\x20topology','object_type':'progress','module':'handler','category':'workflow','industry_agnostic':'medium','risk_profile':{'funds_risk':'medium','trust_risk':'low','delivery_risk':'high','compliance_risk':'low','known_risks':['Forward\x20without\x20authorized\x20executor\x20permanently\x20stalls\x20the\x20order']},'benefit_profile':{'automation_level':'high','trust_boost':'medium','efficiency_gain':'high','benefits':['Deterministic\x20order\x20state\x20progression']}}),this['registerCard']({'capability_id':'arb.vote_weighted','display_name':'Arbitration\x20Vote\x20Weighted','description':'guard-based\x20weighted\x20voting\x20arbitration:\x20vote\x20by\x20Guard\x20weight\x20to\x20determine\x20arbitration\x20result','object_type':'arb','module':'handler','category':'trust','industry_agnostic':'medium','risk_profile':{'funds_risk':'low','trust_risk':'high','delivery_risk':'medium','compliance_risk':'medium','known_risks':['Shared\x20permission\x20with\x20Service\x20destroys\x20dispute\x20independence\x20(E_ARBITRATION_PERMISSION_CONFLICT)']},'benefit_profile':{'automation_level':'medium','trust_boost':'high','efficiency_gain':'low','benefits':['Neutral\x20third-party\x20dispute\x20resolution']}}),this['registerCard']({'capability_id':'reward.claim_guard','display_name':'Reward\x20Claim\x20Guard','description':'Reward\x20claim:\x20release\x20reward\x20after\x20validating\x20claim\x20conditions\x20(such\x20as\x20positive\x20review,\x20repurchase)\x20via\x20Guard','object_type':'reward','module':'handler','category':'fund_flow','industry_agnostic':'medium','risk_profile':{'funds_risk':'medium','trust_risk':'low','delivery_risk':'low','compliance_risk':'low','known_risks':['Loose\x20claim\x20conditions\x20drain\x20the\x20reward\x20pool']},'benefit_profile':{'automation_level':'high','trust_boost':'medium','efficiency_gain':'medium','benefits':['Incentivizes\x20reviews\x20and\x20repurchase']}}),this['registerCard']({'capability_id':'contact.im_create','display_name':'Contact\x20IM\x20Create','description':'Create\x20IM\x20contact\x20object:\x20buyer\x20and\x20seller\x20communicate\x20via\x20Messenger','object_type':'contact','module':'handler','category':'communication','industry_agnostic':'high','risk_profile':{'funds_risk':'low','trust_risk':'low','delivery_risk':'low','compliance_risk':'low','known_risks':['Unattended\x20IM\x20channel\x20degrades\x20dispute\x20response\x20time']},'benefit_profile':{'automation_level':'medium','trust_boost':'medium','efficiency_gain':'medium','benefits':['Direct\x20buyer-seller\x20encrypted\x20communication']}}),this['registerCard']({'capability_id':'demand.matching','display_name':'Demand\x20Matching','description':'Demand\x20matching:\x20match\x20corresponding\x20Service\x20based\x20on\x20user\x20demand','object_type':'demand','module':'handler','category':'query','industry_agnostic':'high','risk_profile':{'funds_risk':'low','trust_risk':'low','delivery_risk':'low','compliance_risk':'low','known_risks':['Poor\x20matching\x20signals\x20bury\x20quality\x20services']},'benefit_profile':{'automation_level':'medium','trust_boost':'low','efficiency_gain':'medium','benefits':['Demand-side\x20discovery\x20channel']}}),this['registerCard']({'capability_id':'repository.write_validate','display_name':'Repository\x20Write\x20Validate','description':'Knowledge\x20base\x20write\x20validation:\x20validate\x20write\x20permissions\x20and\x20data\x20format\x20via\x20Guard','object_type':'repository','module':'handler','category':'validation','industry_agnostic':'high','risk_profile':{'funds_risk':'low','trust_risk':'medium','delivery_risk':'low','compliance_risk':'medium','known_risks':['Unvalidated\x20writes\x20pollute\x20the\x20knowledge\x20base\x20with\x20unverifiable\x20claims']},'benefit_profile':{'automation_level':'medium','trust_boost':'high','efficiency_gain':'medium','benefits':['Guard-gated\x20attestation\x20for\x20off-chain\x20data']}}),this['registerCard']({'capability_id':'proof.evidence_anchor','display_name':'Proof\x20Evidence\x20Anchor','description':'Evidence\x20on-chain:\x20anchor\x20delivery\x20evidence\x20(hash)\x20to\x20on-chain\x20Progress\x20node','object_type':'proof','module':'handler','category':'evidence','industry_agnostic':'medium','risk_profile':{'funds_risk':'low','trust_risk':'medium','delivery_risk':'low','compliance_risk':'low','known_risks':['Anchored\x20evidence\x20is\x20immutable\x20—\x20wrong\x20hash\x20cannot\x20be\x20corrected']},'benefit_profile':{'automation_level':'high','trust_boost':'high','efficiency_gain':'medium','benefits':['Immutable\x20WTS\x20evidence\x20for\x20Messenger\x20confirmations']}}),this['registerCard']({'capability_id':'personal.profile_manage','display_name':'Personal\x20Profile\x20Manage','description':'Personal\x20profile\x20management:\x20user\x20identity/preference/history\x20management','object_type':'personal','module':'handler','category':'data_model','industry_agnostic':'high','risk_profile':{'funds_risk':'low','trust_risk':'low','delivery_risk':'low','compliance_risk':'medium','known_risks':['Profile\x20data\x20may\x20fall\x20under\x20privacy\x20regulation\x20(PII)']},'benefit_profile':{'automation_level':'medium','trust_boost':'low','efficiency_gain':'low','benefits':['Portable\x20user\x20identity\x20across\x20services']}}),this['registerCard']({'capability_id':'payment.settle','display_name':'Payment\x20Settle','description':'Payment\x20settlement:\x20complete\x20fund\x20settlement\x20in\x20collaboration\x20with\x20Allocation','object_type':'payment','module':'handler','category':'fund_flow','industry_agnostic':'high','risk_profile':{'funds_risk':'high','trust_risk':'low','delivery_risk':'low','compliance_risk':'medium','known_risks':['Settlement\x20errors\x20are\x20irreversible\x20once\x20funds\x20transfer']},'benefit_profile':{'automation_level':'high','trust_boost':'low','efficiency_gain':'high','benefits':['Atomic\x20settlement\x20in\x20collaboration\x20with\x20Allocation']}}),this['registerCard']({'capability_id':'guard.validate_withdraw','display_name':'Guard\x20Validate\x20Withdraw','description':'Withdrawal\x20validation:\x20gate\x20fund\x20release\x20from\x20Allocation\x20escrow\x20on\x20delivery\x20confirmation','object_type':'guard','module':'handler','category':'validation','industry_agnostic':'medium','risk_profile':{'funds_risk':'high','trust_risk':'medium','delivery_risk':'medium','compliance_risk':'low','known_risks':['Mis-gated\x20withdrawal\x20releases\x20escrowed\x20funds\x20prematurely']},'benefit_profile':{'automation_level':'high','trust_boost':'high','efficiency_gain':'high','benefits':['Contract-enforced\x20delivery\x20gate\x20replaces\x20platform\x20custody']}}),this['registerCard']({'capability_id':'guard.validate_refund','display_name':'Guard\x20Validate\x20Refund','description':'Refund\x20validation:\x20gate\x20buyer\x20refund\x20on\x20cancellation\x20or\x20return\x20conditions','object_type':'guard','module':'handler','category':'validation','industry_agnostic':'medium','risk_profile':{'funds_risk':'medium','trust_risk':'medium','delivery_risk':'medium','compliance_risk':'low','known_risks':['Over-broad\x20refund\x20conditions\x20enable\x20buyer\x20abuse']},'benefit_profile':{'automation_level':'high','trust_boost':'high','efficiency_gain':'high','benefits':['Trustless\x20buyer\x20refund\x20without\x20merchant\x20approval']}});}}export function getCapabilityRegistry(){return CapabilityRegistry['Instance']();}export const CAPABILITY_MANIFEST_VERSION=0x2;
@@ -1 +1 @@
1
- import{afterEach,beforeEach,describe,expect,it}from'vitest';import{existsSync,mkdirSync,mkdtempSync,readFileSync,rmSync,writeFileSync}from'node:fs';import{tmpdir}from'node:os';import{join}from'node:path';import{buildPristineMergedPack,industryReadmeContent,registerIndustryPack,scaffoldIndustryPack,scanPacks}from'./industry-pack.js';import{evaluateIndustryCondition,mergedBaselinesOverlay,resolveComplianceRules,resolveDisputeRules,resolveIndustryBaselines,resolveIndustryPlaybook,resolveIndustryRules,resolveSupplyRules}from'./industry-layers.js';import{applyHardConstraints,resolveCategoryMatchRules}from'../evaluation/category-match-rules.js';import{setJudgmentIndustryOverlay,getJudgmentDoc,clearJudgmentLayers}from'../config/judgment.js';import{PERSONA_ROLES}from'../persona/types.js';let root;beforeEach(()=>{root=mkdtempSync(join(tmpdir(),'wowok-industry-audit-'));}),afterEach(()=>{if(existsSync(root))rmSync(root,{'recursive':!![],'force':!![]});clearJudgmentLayers();});function manifest(a,b){return{'pack':'industry-pack','name':a,'display_name':a,'version':'1.0.0','layers':b};}describe('industry\x20audit\x20—\x20scaffold\x20shape',()=>{it('14.\x20scaffold\x20writes\x20pack.json\x20(all\x20sections;\x20baselines/mode\x20null)\x20+\x20template\x20playbook.md',()=>{const a=scaffoldIndustryPack('audit_scaffold',root);expect(a['ok'])['toBe'](!![]),expect(a['files'])['toEqual'](['pack.json','playbook.md']);const b=JSON['parse'](readFileSync(join(a['dir'],'pack.json'),'utf-8'));expect(b['manifest']['pack'])['toBe']('industry-pack'),expect(b['manifest']['layers'])['toContain']('playbook');for(const d of['match','personae','dispute','compliance','supply','rules']){expect(b[d])['not']['toBeNull']();}expect(b['match']?.['category'])['toBe']('audit_scaffold'),expect(b['baselines'])['toBeNull'](),expect(b['mode'])['toBeNull'](),expect(b['compliance']?.['refund_window'])['toEqual']({'not_applicable':!![]}),expect(b['personae'])['toHaveLength'](PERSONA_ROLES['length']);const c=readFileSync(join(a['dir'],'playbook.md'),'utf-8');expect(c)['toContain']('Industry\x20Playbook'),expect(c)['toContain']('(Example)');}),it('14b.\x20industry\x20README\x20documents\x20the\x20baselines\x20layer\x20and\x20legal\x20layer\x20names',()=>{const a=industryReadmeContent();expect(a)['toContain']('##\x20baselines\x20—\x20judgment\x20baselines\x20overlay'),expect(a)['toContain']('factory\x20<\x20pack\x20baselines\x20<\x20persona\x20fragment\x20<\x20user\x20document\x20<\x20session\x20overrides'),expect(a)['toContain']('\x22severity_deduction\x22:\x20{\x20\x22critical\x22:\x2040\x20}'),expect(a)['toContain']('\x22rule_id\x22:\x20\x22R-UTIL-03\x22,\x20\x22enabled\x22:\x20false'),expect(a)['toContain']('Legal'),expect(a)['toContain']('`baselines`,\x20`playbook`');});}),describe('industry\x20audit\x20—\x20meaningful-content\x20gates',()=>{it('15.\x20a\x20pristine\x20(placeholder-only)\x20pack\x20registers\x20NOTHING:\x20every\x20resolve*\x20stays\x20undefined',()=>{const a=buildPristineMergedPack('audit_pristine');a['manifest']['layers']=['match','personae','dispute','compliance','supply','rules'];const b=registerIndustryPack(a);expect(b['ok'])['toBe'](!![]),expect(b['registered'])['toEqual']([]),expect(resolveCategoryMatchRules('audit_pristine'))['toBeUndefined'](),expect(resolveDisputeRules('audit_pristine'))['toBeUndefined'](),expect(resolveComplianceRules('audit_pristine'))['toBeUndefined'](),expect(resolveSupplyRules('audit_pristine'))['toBeUndefined'](),expect(resolveIndustryRules('audit_pristine'))['toBeUndefined'](),expect(resolveIndustryBaselines('audit_pristine'))['toBeUndefined']();const c=buildPristineMergedPack('audit_pristine2');c['manifest']['layers']=['compliance'],c['compliance']={'category':'audit_pristine2','refund_window':{'days':0xe}},expect(registerIndustryPack(c)['registered'])['toEqual'](['compliance']),expect(resolveComplianceRules('audit_pristine2')?.['refund_window']?.['days'])['toBe'](0xe);});}),describe('industry\x20audit\x20—\x20data\x20layers\x20(dispute/compliance/supply/rules)',()=>{it('16.\x20meaningful\x20dispute/compliance/supply/rules\x20register\x20and\x20resolve;\x20structured\x20conditions\x20evaluate',()=>{const a='audit_data',b=registerIndustryPack({'manifest':manifest(a,['dispute','compliance','supply','rules']),'dispute':{'category':a,'sla_tiers':[{'level':'L1','timeout':'72h','description':'standard\x20tier'}],'fault_rules':['late\x20delivery\x20without\x20evidence\x20->\x20merchant']},'compliance':{'category':a,'refund_window':{'days':0xe},'qualification':['Trade\x20License']},'supply':{'category':a,'supplier_qualification':['ISO-9001'],'first_order_policy':'sample-only','redundancy_required':!![]},'rules':{'category':a,'rules':[{'rule_id':'audit_r1','dimension':'risk','description':'must\x20have\x20arbitration','severity':'hard','red_flag':!![],'condition':{'field':'has_arbitration','op':'eq','value':!![]}},{'rule_id':'audit_r2','description':'counterfeit\x20suspicion','condition_hint':'buyer\x20reports\x20counterfeit'}]}});expect(b['ok'])['toBe'](!![]),expect(b['registered'])['toEqual'](['dispute','compliance','supply','rules']),expect(resolveDisputeRules(a)?.['sla_tiers']?.[0x0]?.['level'])['toBe']('L1'),expect(resolveComplianceRules(a)?.['refund_window']?.['days'])['toBe'](0xe),expect(resolveSupplyRules(a)?.['first_order_policy'])['toBe']('sample-only');const c=resolveIndustryRules(a)?.['rules']??[];expect(c)['toHaveLength'](0x2),expect(c[0x1]?.['condition'])['toBeUndefined'](),expect(evaluateIndustryCondition(c[0x0]['condition'],{'facts':{'has_arbitration':!![]},'entities':{}}))['toBe'](!![]),expect(evaluateIndustryCondition(c[0x0]['condition'],{'facts':{'has_arbitration':![]},'entities':{}}))['toBe'](![]);}),it('17.\x20a\x20meaningful\x20match\x20layer\x20is\x20queryable:\x20constraints\x20apply,\x20modes/weights\x20visible',()=>{const a='audit_match',b=registerIndustryPack({'manifest':manifest(a,['match']),'match':{'category':a,'hard_constraints':[{'field':'bPublished','kind':'truthy','description':'service\x20must\x20be\x20published'}],'soft_weights':{'trust':0x28,'price':0xa},'highlight_fields':['wip_hash'],'calendar_mode':'slot','geo_mode':'near','pricing_rules':['time_slot']}});expect(b['ok'])['toBe'](!![]),expect(b['registered'])['toEqual'](['match']);const c=resolveCategoryMatchRules(a);expect(c?.['geo_mode'])['toBe']('near'),expect(c?.['calendar_mode'])['toBe']('slot'),expect(c?.['soft_weights'])['toEqual']({'trust':0x28,'price':0xa});const d=applyHardConstraints(c,[{'bPublished':![]},{'bPublished':!![]}]);expect(d['passed'])['toHaveLength'](0x1),expect(d['dropped'][0x0]?.['candidate'])['toEqual']({'bPublished':![]});}),it('18a.\x20a\x20legal\x20baselines\x20fragment\x20registers\x20and\x20drives\x20mergedBaselinesOverlay\x20into\x20the\x20judgment\x20chain',()=>{const a='audit_base_ok',b={'monitor':{'thresholds':{'messenger_timeout_hours':0x3}}},c=registerIndustryPack({'manifest':manifest(a,['baselines']),'baselines':b});expect(c['ok'])['toBe'](!![]),expect(c['registered'])['toEqual'](['baselines']),expect(resolveIndustryBaselines(a)?.['fragment'])['toEqual'](b);const d=mergedBaselinesOverlay([a]);expect(d)['toEqual'](b),expect(setJudgmentIndustryOverlay(d)['ok'])['toBe'](!![]),expect(getJudgmentDoc()['monitor']['thresholds']['messenger_timeout_hours'])['toBe'](0x3);}),it('18b.\x20a\x20misspelled-dimension\x20baselines\x20fragment\x20is\x20rejected\x20with\x20a\x20visible\x20error\x20(register\x20+\x20scan)',()=>{const a={'evaluation':{'weights':{'trust_revews':0x32}}},b=registerIndustryPack({'manifest':manifest('audit_base_bad',['baselines']),'baselines':a});expect(b['ok'])['toBe'](![]),expect(b['errors']['join']('\x20'))['toContain']('unknown\x20dimension\x20\x27trust_revews\x27'),expect(resolveIndustryBaselines('audit_base_bad'))['toBeUndefined']();const c=join(root,'audit_base_scan');mkdirSync(c,{'recursive':!![]}),writeFileSync(join(c,'pack.json'),JSON['stringify']({'manifest':manifest('audit_base_scan',['baselines']),'baselines':a}),'utf-8');const [d]=scanPacks(root);expect(d['ok'])['toBe'](![]),expect(d['errors']['join']('\x20'))['toContain']('trust_revews');});}),describe('industry\x20audit\x20—\x20playbook\x20layer',()=>{it('19a.\x20real\x20playbook\x20content\x20registers\x20and\x20resolves',()=>{const a='audit_play',b=join(root,a);mkdirSync(b,{'recursive':!![]}),writeFileSync(join(b,'pack.json'),JSON['stringify']({'manifest':manifest(a,['playbook'])}),'utf-8'),writeFileSync(join(b,'playbook.md'),'#\x20audit_play\x20playbook\x0a\x0aAUDIT-REAL:\x20always\x20answer\x20complaint\x20threads\x20within\x204\x20hours.\x0a','utf-8');const [c]=scanPacks(root);expect(c['ok'])['toBe'](!![]),expect(c['registered'])['toContain']('playbook'),expect(resolveIndustryPlaybook(a)?.['content'])['toContain']('AUDIT-REAL');}),it('19b.\x20the\x20scaffolded\x20TEMPLATE\x20playbook\x20is\x20SKIPPED\x20(placeholder\x20bullets\x20carry\x20no\x20registerable\x20content)',()=>{scaffoldIndustryPack('audit_play_tmpl',root);const [a]=scanPacks(root);expect(a['ok'])['toBe'](!![]),expect(a['registered'])['toEqual']([]),expect(resolveIndustryPlaybook('audit_play_tmpl'))['toBeUndefined']();}),it('19c.\x20template\x20+\x20ONE\x20real\x20user\x20line\x20IS\x20meaningful\x20(no\x20false\x20negative\x20on\x20real\x20content)',()=>{scaffoldIndustryPack('audit_play_mix',root);const a=join(root,'audit_play_mix','playbook.md');writeFileSync(a,readFileSync(a,'utf-8')+'\x0a-\x20AUDIT-REAL:\x20answer\x20complaint\x20threads\x20within\x204\x20hours.\x0a','utf-8');const [b]=scanPacks(root);expect(b['ok'])['toBe'](!![]),expect(b['registered'])['toContain']('playbook'),expect(resolveIndustryPlaybook('audit_play_mix')?.['content'])['toContain']('AUDIT-REAL');});}),describe('industry\x20audit\x20—\x20manifest.layers\x20enable\x20flags',()=>{it('20.\x20a\x20layer\x20removed\x20from\x20manifest.layers\x20is\x20ignored\x20even\x20when\x20its\x20section\x20carries\x20real\x20content',()=>{const a='audit_off',b=registerIndustryPack({'manifest':manifest(a,['compliance']),'dispute':{'category':a,'sla_tiers':[{'level':'L1','timeout':'1h'}]},'compliance':{'category':a,'refund_window':{'days':0x7}}});expect(b['ok'])['toBe'](!![]),expect(b['registered'])['toEqual'](['compliance']),expect(resolveComplianceRules(a)?.['refund_window']?.['days'])['toBe'](0x7),expect(resolveDisputeRules(a))['toBeUndefined']();});});
1
+ import{afterEach,beforeEach,describe,expect,it}from'vitest';import{existsSync,mkdirSync,mkdtempSync,readFileSync,rmSync,writeFileSync}from'node:fs';import{tmpdir}from'node:os';import{join}from'node:path';import{buildPristineMergedPack,getRegisteredPack,industryReadmeContent,packKind,registerIndustryPack,scaffoldIndustryPack,scanPacks}from'./industry-pack.js';import{evaluateIndustryCondition,mergedBaselinesOverlay,resolveComplianceRules,resolveDisputeRules,resolveIndustryBaselines,resolveIndustryPlaybook,resolveIndustryRules,resolveSupplyRules}from'./industry-layers.js';import{applyHardConstraints,resolveCategoryMatchRules}from'../evaluation/category-match-rules.js';import{setJudgmentIndustryOverlay,getJudgmentDoc,clearJudgmentLayers}from'../config/judgment.js';import{PERSONA_ROLES}from'../persona/types.js';let root;beforeEach(()=>{root=mkdtempSync(join(tmpdir(),'wowok-industry-audit-'));}),afterEach(()=>{if(existsSync(root))rmSync(root,{'recursive':!![],'force':!![]});clearJudgmentLayers();});function manifest(a,b){return{'pack':'industry-pack','name':a,'display_name':a,'version':'1.0.0','layers':b};}describe('industry\x20audit\x20—\x20scaffold\x20shape',()=>{it('14.\x20scaffold\x20writes\x20pack.json\x20(all\x20sections;\x20baselines/mode\x20null)\x20+\x20template\x20playbook.md',()=>{const a=scaffoldIndustryPack('audit_scaffold',root);expect(a['ok'])['toBe'](!![]),expect(a['files'])['toEqual'](['pack.json','playbook.md']);const b=JSON['parse'](readFileSync(join(a['dir'],'pack.json'),'utf-8'));expect(b['manifest']['pack'])['toBe']('industry-pack'),expect(b['manifest']['layers'])['toContain']('playbook');for(const d of['match','personae','dispute','compliance','supply','rules']){expect(b[d])['not']['toBeNull']();}expect(b['match']?.['category'])['toBe']('audit_scaffold'),expect(b['baselines'])['toBeNull'](),expect(b['mode'])['toBeNull'](),expect(b['compliance']?.['refund_window'])['toEqual']({'not_applicable':!![]}),expect(b['personae'])['toHaveLength'](PERSONA_ROLES['length']);const c=readFileSync(join(a['dir'],'playbook.md'),'utf-8');expect(c)['toContain']('Industry\x20Playbook'),expect(c)['toContain']('(Example)');}),it('14b.\x20industry\x20README\x20documents\x20the\x20baselines\x20layer\x20and\x20legal\x20layer\x20names',()=>{const a=industryReadmeContent();expect(a)['toContain']('##\x20baselines\x20—\x20judgment\x20baselines\x20overlay'),expect(a)['toContain']('factory\x20<\x20pack\x20baselines\x20<\x20persona\x20fragment\x20<\x20user\x20document\x20<\x20session\x20overrides'),expect(a)['toContain']('\x22severity_deduction\x22:\x20{\x20\x22critical\x22:\x2040\x20}'),expect(a)['toContain']('\x22rule_id\x22:\x20\x22R-UTIL-03\x22,\x20\x22enabled\x22:\x20false'),expect(a)['toContain']('Legal'),expect(a)['toContain']('`baselines`,\x20`playbook`');});}),describe('industry\x20audit\x20—\x20meaningful-content\x20gates',()=>{it('15.\x20a\x20pristine\x20(placeholder-only)\x20pack\x20registers\x20NOTHING:\x20every\x20resolve*\x20stays\x20undefined',()=>{const a=buildPristineMergedPack('audit_pristine');a['manifest']['layers']=['match','personae','dispute','compliance','supply','rules'];const b=registerIndustryPack(a);expect(b['ok'])['toBe'](!![]),expect(b['registered'])['toEqual']([]),expect(resolveCategoryMatchRules('audit_pristine'))['toBeUndefined'](),expect(resolveDisputeRules('audit_pristine'))['toBeUndefined'](),expect(resolveComplianceRules('audit_pristine'))['toBeUndefined'](),expect(resolveSupplyRules('audit_pristine'))['toBeUndefined'](),expect(resolveIndustryRules('audit_pristine'))['toBeUndefined'](),expect(resolveIndustryBaselines('audit_pristine'))['toBeUndefined']();const c=buildPristineMergedPack('audit_pristine2');c['manifest']['layers']=['compliance'],c['compliance']={'category':'audit_pristine2','refund_window':{'days':0xe}},expect(registerIndustryPack(c)['registered'])['toEqual'](['compliance']),expect(resolveComplianceRules('audit_pristine2')?.['refund_window']?.['days'])['toBe'](0xe);}),it('15b.\x20the\x20registry\x20record\x20lists\x20REGISTERED\x20layers,\x20not\x20declared\x20ones\x20(no\x20empty-shell\x20\x27full\x27)',()=>{const a=buildPristineMergedPack('audit_shell');a['manifest']['layers']=['match','personae','dispute','compliance','supply','rules'],expect(registerIndustryPack(a)['ok'])['toBe'](!![]);const b=getRegisteredPack('audit_shell');expect(b?.['layers'])['toEqual']([]),expect(packKind(b?.['layers']??[]))['toBe']('stub');const c=buildPristineMergedPack('audit_mixed');c['manifest']['layers']=['dispute','compliance','supply','rules'],c['compliance']={'category':'audit_mixed','refund_window':{'days':0x7}};const d=registerIndustryPack(c);expect(d['ok'])['toBe'](!![]),expect(d['registered'])['toEqual'](['compliance']);const e=getRegisteredPack('audit_mixed');expect(e?.['layers'])['toEqual'](['compliance']),expect(packKind(e?.['layers']??[]))['toBe']('full');});}),describe('industry\x20audit\x20—\x20data\x20layers\x20(dispute/compliance/supply/rules)',()=>{it('16.\x20meaningful\x20dispute/compliance/supply/rules\x20register\x20and\x20resolve;\x20structured\x20conditions\x20evaluate',()=>{const a='audit_data',b=registerIndustryPack({'manifest':manifest(a,['dispute','compliance','supply','rules']),'dispute':{'category':a,'sla_tiers':[{'level':'L1','timeout':'72h','description':'standard\x20tier'}],'fault_rules':['late\x20delivery\x20without\x20evidence\x20->\x20merchant']},'compliance':{'category':a,'refund_window':{'days':0xe},'qualification':['Trade\x20License']},'supply':{'category':a,'supplier_qualification':['ISO-9001'],'first_order_policy':'sample-only','redundancy_required':!![]},'rules':{'category':a,'rules':[{'rule_id':'audit_r1','dimension':'risk','description':'must\x20have\x20arbitration','severity':'hard','red_flag':!![],'condition':{'field':'has_arbitration','op':'eq','value':!![]}},{'rule_id':'audit_r2','description':'counterfeit\x20suspicion','condition_hint':'buyer\x20reports\x20counterfeit'}]}});expect(b['ok'])['toBe'](!![]),expect(b['registered'])['toEqual'](['dispute','compliance','supply','rules']),expect(resolveDisputeRules(a)?.['sla_tiers']?.[0x0]?.['level'])['toBe']('L1'),expect(resolveComplianceRules(a)?.['refund_window']?.['days'])['toBe'](0xe),expect(resolveSupplyRules(a)?.['first_order_policy'])['toBe']('sample-only');const c=resolveIndustryRules(a)?.['rules']??[];expect(c)['toHaveLength'](0x2),expect(c[0x1]?.['condition'])['toBeUndefined'](),expect(evaluateIndustryCondition(c[0x0]['condition'],{'facts':{'has_arbitration':!![]},'entities':{}}))['toBe'](!![]),expect(evaluateIndustryCondition(c[0x0]['condition'],{'facts':{'has_arbitration':![]},'entities':{}}))['toBe'](![]);}),it('17.\x20a\x20meaningful\x20match\x20layer\x20is\x20queryable:\x20constraints\x20apply,\x20modes/weights\x20visible',()=>{const a='audit_match',b=registerIndustryPack({'manifest':manifest(a,['match']),'match':{'category':a,'hard_constraints':[{'field':'bPublished','kind':'truthy','description':'service\x20must\x20be\x20published'}],'soft_weights':{'trust':0x28,'price':0xa},'highlight_fields':['wip_hash'],'calendar_mode':'slot','geo_mode':'near','pricing_rules':['time_slot']}});expect(b['ok'])['toBe'](!![]),expect(b['registered'])['toEqual'](['match']);const c=resolveCategoryMatchRules(a);expect(c?.['geo_mode'])['toBe']('near'),expect(c?.['calendar_mode'])['toBe']('slot'),expect(c?.['soft_weights'])['toEqual']({'trust':0x28,'price':0xa});const d=applyHardConstraints(c,[{'bPublished':![]},{'bPublished':!![]}]);expect(d['passed'])['toHaveLength'](0x1),expect(d['dropped'][0x0]?.['candidate'])['toEqual']({'bPublished':![]});}),it('18a.\x20a\x20legal\x20baselines\x20fragment\x20registers\x20and\x20drives\x20mergedBaselinesOverlay\x20into\x20the\x20judgment\x20chain',()=>{const a='audit_base_ok',b={'monitor':{'thresholds':{'messenger_timeout_hours':0x3}}},c=registerIndustryPack({'manifest':manifest(a,['baselines']),'baselines':b});expect(c['ok'])['toBe'](!![]),expect(c['registered'])['toEqual'](['baselines']),expect(resolveIndustryBaselines(a)?.['fragment'])['toEqual'](b);const d=mergedBaselinesOverlay([a]);expect(d)['toEqual'](b),expect(setJudgmentIndustryOverlay(d)['ok'])['toBe'](!![]),expect(getJudgmentDoc()['monitor']['thresholds']['messenger_timeout_hours'])['toBe'](0x3);}),it('18b.\x20a\x20misspelled-dimension\x20baselines\x20fragment\x20is\x20rejected\x20with\x20a\x20visible\x20error\x20(register\x20+\x20scan)',()=>{const a={'evaluation':{'weights':{'trust_revews':0x32}}},b=registerIndustryPack({'manifest':manifest('audit_base_bad',['baselines']),'baselines':a});expect(b['ok'])['toBe'](![]),expect(b['errors']['join']('\x20'))['toContain']('unknown\x20dimension\x20\x27trust_revews\x27'),expect(resolveIndustryBaselines('audit_base_bad'))['toBeUndefined']();const c=join(root,'audit_base_scan');mkdirSync(c,{'recursive':!![]}),writeFileSync(join(c,'pack.json'),JSON['stringify']({'manifest':manifest('audit_base_scan',['baselines']),'baselines':a}),'utf-8');const [d]=scanPacks(root);expect(d['ok'])['toBe'](![]),expect(d['errors']['join']('\x20'))['toContain']('trust_revews');});}),describe('industry\x20audit\x20—\x20playbook\x20layer',()=>{it('19a.\x20real\x20playbook\x20content\x20registers\x20and\x20resolves',()=>{const a='audit_play',b=join(root,a);mkdirSync(b,{'recursive':!![]}),writeFileSync(join(b,'pack.json'),JSON['stringify']({'manifest':manifest(a,['playbook'])}),'utf-8'),writeFileSync(join(b,'playbook.md'),'#\x20audit_play\x20playbook\x0a\x0aAUDIT-REAL:\x20always\x20answer\x20complaint\x20threads\x20within\x204\x20hours.\x0a','utf-8');const [c]=scanPacks(root);expect(c['ok'])['toBe'](!![]),expect(c['registered'])['toContain']('playbook'),expect(resolveIndustryPlaybook(a)?.['content'])['toContain']('AUDIT-REAL');}),it('19b.\x20the\x20scaffolded\x20TEMPLATE\x20playbook\x20is\x20SKIPPED\x20(placeholder\x20bullets\x20carry\x20no\x20registerable\x20content)',()=>{scaffoldIndustryPack('audit_play_tmpl',root);const [a]=scanPacks(root);expect(a['ok'])['toBe'](!![]),expect(a['registered'])['toEqual']([]),expect(resolveIndustryPlaybook('audit_play_tmpl'))['toBeUndefined']();}),it('19c.\x20template\x20+\x20ONE\x20real\x20user\x20line\x20IS\x20meaningful\x20(no\x20false\x20negative\x20on\x20real\x20content)',()=>{scaffoldIndustryPack('audit_play_mix',root);const a=join(root,'audit_play_mix','playbook.md');writeFileSync(a,readFileSync(a,'utf-8')+'\x0a-\x20AUDIT-REAL:\x20answer\x20complaint\x20threads\x20within\x204\x20hours.\x0a','utf-8');const [b]=scanPacks(root);expect(b['ok'])['toBe'](!![]),expect(b['registered'])['toContain']('playbook'),expect(resolveIndustryPlaybook('audit_play_mix')?.['content'])['toContain']('AUDIT-REAL');});}),describe('industry\x20audit\x20—\x20manifest.layers\x20enable\x20flags',()=>{it('20.\x20a\x20layer\x20removed\x20from\x20manifest.layers\x20is\x20ignored\x20even\x20when\x20its\x20section\x20carries\x20real\x20content',()=>{const a='audit_off',b=registerIndustryPack({'manifest':manifest(a,['compliance']),'dispute':{'category':a,'sla_tiers':[{'level':'L1','timeout':'1h'}]},'compliance':{'category':a,'refund_window':{'days':0x7}}});expect(b['ok'])['toBe'](!![]),expect(b['registered'])['toEqual'](['compliance']),expect(resolveComplianceRules(a)?.['refund_window']?.['days'])['toBe'](0x7),expect(resolveDisputeRules(a))['toBeUndefined']();});});