@wowok/agent-mcp 3.0.3 → 3.0.5
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.
- package/dist/evaluation/path-reasoning.d.ts +4 -2
- package/dist/evaluation/path-reasoning.js +1 -1
- package/dist/extensions/constraint-registry.d.ts +2 -2
- package/dist/extensions/constraint-registry.js +1 -1
- package/dist/extensions/custom-registry-file.d.ts +22 -0
- package/dist/extensions/custom-registry-file.js +1 -0
- package/dist/extensions/index.d.ts +2 -1
- package/dist/extensions/index.js +1 -1
- package/dist/extensions/industry-pack.d.ts +7 -0
- package/dist/extensions/industry-pack.js +1 -1
- package/dist/extensions/metric-registry.d.ts +2 -2
- package/dist/extensions/metric-registry.js +1 -1
- package/dist/extensions/modes.js +1 -1
- package/dist/extensions/registry.d.ts +2 -2
- package/dist/extensions/registry.js +1 -1
- package/dist/extensions/types.d.ts +4 -0
- package/dist/goal/GoalEngine.d.ts +13 -1
- package/dist/goal/GoalEngine.js +1 -1
- package/dist/goal/next-steps.d.ts +12 -0
- package/dist/goal/next-steps.js +1 -0
- package/dist/goal/pursue.d.ts +18 -0
- package/dist/goal/pursue.js +1 -0
- package/dist/goal/types.d.ts +72 -0
- package/dist/goal/types.js +1 -1
- package/dist/graph/onchain/analyze.d.ts +44 -0
- package/dist/graph/onchain/analyze.js +1 -0
- package/dist/graph/onchain/analyze.spec.d.ts +1 -0
- package/dist/graph/onchain/analyze.spec.js +1 -0
- package/dist/graph/onchain/anti-cheat.d.ts +39 -0
- package/dist/graph/onchain/anti-cheat.js +1 -0
- package/dist/graph/onchain/anti-cheat.spec.d.ts +1 -0
- package/dist/graph/onchain/anti-cheat.spec.js +1 -0
- package/dist/graph/onchain/dataplane.d.ts +44 -0
- package/dist/graph/onchain/dataplane.js +1 -0
- package/dist/graph/onchain/edge-schema.d.ts +60 -0
- package/dist/graph/onchain/edge-schema.js +1 -0
- package/dist/graph/onchain/expand.d.ts +4 -0
- package/dist/graph/onchain/expand.js +1 -0
- package/dist/graph/onchain/extract.d.ts +21 -0
- package/dist/graph/onchain/extract.js +1 -0
- package/dist/graph/onchain/index.d.ts +17 -0
- package/dist/graph/onchain/index.js +1 -0
- package/dist/graph/onchain/interest.d.ts +10 -0
- package/dist/graph/onchain/interest.js +1 -0
- package/dist/graph/onchain/interest.spec.d.ts +1 -0
- package/dist/graph/onchain/interest.spec.js +1 -0
- package/dist/graph/onchain/onchain.spec.d.ts +1 -0
- package/dist/graph/onchain/onchain.spec.js +1 -0
- package/dist/graph/onchain/order-status.d.ts +53 -0
- package/dist/graph/onchain/order-status.js +1 -0
- package/dist/graph/onchain/project-relationship.d.ts +3 -0
- package/dist/graph/onchain/project-relationship.js +1 -0
- package/dist/graph/onchain/sdk-batch.d.ts +117 -0
- package/dist/graph/onchain/sdk-batch.js +1 -0
- package/dist/graph/onchain/sdk-dataplane.d.ts +40 -0
- package/dist/graph/onchain/sdk-dataplane.js +1 -0
- package/dist/graph/onchain/strategy.d.ts +54 -0
- package/dist/graph/onchain/strategy.js +1 -0
- package/dist/graph/onchain/strategy.spec.d.ts +1 -0
- package/dist/graph/onchain/strategy.spec.js +1 -0
- package/dist/graph/onchain/types.d.ts +238 -0
- package/dist/graph/onchain/types.js +1 -0
- package/dist/graph/onchain/viewport.d.ts +5 -0
- package/dist/graph/onchain/viewport.js +1 -0
- package/dist/harness/recover.js +1 -1
- package/dist/index.js +1 -1
- package/dist/intent/enrich.js +1 -1
- package/dist/keeper/detectors.d.ts +1 -1
- package/dist/keeper/detectors.js +1 -1
- package/dist/knowledge/account-marks.js +1 -1
- package/dist/knowledge/anti-cheat.d.ts +2 -37
- package/dist/knowledge/anti-cheat.js +1 -1
- package/dist/knowledge/contract-invariants.js +1 -1
- package/dist/knowledge/event-semantics.js +1 -1
- package/dist/knowledge/getting-started.d.ts +37 -0
- package/dist/knowledge/getting-started.js +1 -0
- package/dist/knowledge/goal-completion.js +1 -1
- package/dist/knowledge/guard-puzzle.js +1 -1
- package/dist/knowledge/guard-render.d.ts +1 -0
- package/dist/knowledge/guard-render.js +1 -1
- package/dist/knowledge/guard-submission-brief.d.ts +83 -0
- package/dist/knowledge/guard-submission-brief.js +1 -0
- package/dist/knowledge/guard-submission-prompt.d.ts +13 -0
- package/dist/knowledge/guard-submission-prompt.js +1 -1
- package/dist/knowledge/index.d.ts +6 -4
- package/dist/knowledge/index.js +1 -1
- package/dist/knowledge/industry-registry.js +1 -1
- package/dist/knowledge/industry-strategy.d.ts +91 -0
- package/dist/knowledge/industry-strategy.js +1 -0
- package/dist/knowledge/jsonrpc-enum.js +1 -1
- package/dist/knowledge/market-metrics.d.ts +14 -3
- package/dist/knowledge/market-metrics.js +1 -1
- package/dist/knowledge/migration-preflight.js +1 -1
- package/dist/knowledge/operation-dictionary.d.ts +1 -1
- package/dist/knowledge/safety-rules.js +1 -1
- package/dist/knowledge/scenario-topology.d.ts +6 -1
- package/dist/knowledge/scenario-topology.js +1 -1
- package/dist/knowledge/service-ledger.js +1 -1
- package/dist/knowledge/service-risk-node.d.ts +3 -0
- package/dist/knowledge/service-risk-node.js +1 -0
- package/dist/knowledge/service-risk.d.ts +2 -0
- package/dist/knowledge/service-risk.js +1 -1
- package/dist/knowledge/service-templates.d.ts +2 -0
- package/dist/knowledge/service-templates.js +1 -1
- package/dist/knowledge/strategy-manuals.d.ts +17 -0
- package/dist/knowledge/strategy-manuals.js +1 -0
- package/dist/knowledge/supply-chain.d.ts +3 -1
- package/dist/knowledge/supply-chain.js +1 -1
- package/dist/knowledge/template-registry.js +1 -1
- package/dist/knowledge/tools-reference.js +1 -1
- package/dist/knowledge/workflow-guidance.d.ts +3 -118
- package/dist/knowledge/workflow-guidance.js +1 -1
- package/dist/knowledge/workspace-lists.js +1 -1
- package/dist/monitor/MonitorLoop.js +1 -1
- package/dist/monitor/ScopeResolver.js +1 -1
- package/dist/participation/radar-core.d.ts +15 -15
- package/dist/participation/radar-core.js +1 -1
- package/dist/persona/analyzer.d.ts +2 -1
- package/dist/persona/bridge.d.ts +5 -1
- package/dist/persona/bridge.js +1 -1
- package/dist/persona/defaults.js +1 -1
- package/dist/persona/distill-goal.d.ts +7 -1
- package/dist/persona/distill-goal.js +1 -1
- package/dist/persona/index.d.ts +13 -3
- package/dist/persona/index.js +1 -1
- package/dist/persona/model.d.ts +12 -2
- package/dist/persona/model.js +1 -1
- package/dist/persona/overrides.d.ts +1 -0
- package/dist/persona/overrides.js +1 -1
- package/dist/persona/topology-focus.d.ts +29 -0
- package/dist/persona/topology-focus.js +1 -0
- package/dist/persona/types.d.ts +81 -0
- package/dist/playbooks/service-build/business-puzzle.js +1 -1
- package/dist/playbooks/service-build/context-assembly.js +1 -1
- package/dist/playbooks/service-build/machine-nodes.js +1 -1
- package/dist/playbooks/service-build/machine-panorama.js +1 -1
- package/dist/playbooks/service-build/object-panorama.js +1 -1
- package/dist/playbooks/service-build/participation-radar.js +1 -1
- package/dist/playbooks/service-build/relationship-profile.d.ts +1 -0
- package/dist/playbooks/service-build/relationship-profile.js +1 -1
- package/dist/playbooks/service-build/service-panorama.d.ts +4 -0
- package/dist/playbooks/service-build/service-panorama.js +1 -1
- package/dist/playbooks/service-build/topology-query.d.ts +14 -0
- package/dist/playbooks/service-build/topology-query.js +1 -0
- package/dist/role/index.d.ts +1 -0
- package/dist/role/index.js +1 -1
- package/dist/role/profiles.d.ts +26 -0
- package/dist/role/profiles.js +1 -0
- package/dist/safety/confirm-gate.d.ts +4 -1
- package/dist/safety/confirm-gate.js +1 -1
- package/dist/schema/call/allocation.d.ts +11 -6
- package/dist/schema/call/arbitration.d.ts +5 -0
- package/dist/schema/call/base.d.ts +5 -0
- package/dist/schema/call/base.js +1 -1
- package/dist/schema/call/bridge.d.ts +26 -1
- package/dist/schema/call/contact.d.ts +5 -0
- package/dist/schema/call/demand.d.ts +5 -0
- package/dist/schema/call/guard.d.ts +35 -20
- package/dist/schema/call/machine.d.ts +10 -0
- package/dist/schema/call/order.d.ts +5 -0
- package/dist/schema/call/payment.d.ts +5 -0
- package/dist/schema/call/permission.d.ts +5 -0
- package/dist/schema/call/personal.d.ts +5 -0
- package/dist/schema/call/progress.d.ts +5 -0
- package/dist/schema/call/proof.d.ts +10 -0
- package/dist/schema/call/repository.d.ts +5 -0
- package/dist/schema/call/repository.js +1 -1
- package/dist/schema/call/reward.d.ts +5 -0
- package/dist/schema/call/semantic.js +1 -1
- package/dist/schema/call/service.d.ts +9 -4
- package/dist/schema/call/treasury.d.ts +5 -0
- package/dist/schema/common/index.js +1 -1
- package/dist/schema/employee/index.d.ts +7 -7
- package/dist/schema/evaluation/index.d.ts +22 -9
- package/dist/schema/evaluation/index.js +1 -1
- package/dist/schema/goal/index.d.ts +37 -1
- package/dist/schema/goal/index.js +1 -1
- package/dist/schema/goal/planning.d.ts +1 -1
- package/dist/schema/index.d.ts +2 -0
- package/dist/schema/index.js +1 -1
- package/dist/schema/industry-pack/index.d.ts +7 -0
- package/dist/schema/industry-pack/index.js +1 -1
- package/dist/schema/interaction/index.d.ts +34 -0
- package/dist/schema/interaction/index.js +1 -0
- package/dist/schema/local/index.d.ts +8 -4
- package/dist/schema/local/index.js +1 -1
- package/dist/schema/messenger/index.d.ts +324 -64
- package/dist/schema/messenger/index.js +1 -1
- package/dist/schema/operations.d.ts +236 -11
- package/dist/schema/operations.js +1 -1
- package/dist/schema/persona/index.d.ts +15743 -0
- package/dist/schema/persona/index.js +1 -1
- package/dist/schema/query/bi.d.ts +869 -2
- package/dist/schema/query/bi.js +1 -1
- package/dist/schema/query/index.d.ts +163 -41
- package/dist/schema/query/index.js +1 -1
- package/dist/schema/schema-query/index.d.ts +16 -0
- package/dist/schema/schema-query/index.js +1 -1
- package/dist/schema/schema-version.js +1 -1
- package/dist/schema/strategy-review/index.d.ts +137 -0
- package/dist/schema/strategy-review/index.js +1 -0
- package/dist/schema/trust/index.d.ts +6 -6
- package/dist/schema/workflow/index.d.ts +2 -2
- package/dist/schema-query-impl/index.js +1 -1
- package/dist/schemas/account_operation.output.json +8 -4
- package/dist/schemas/account_operation.schema.json +6 -2
- package/dist/schemas/ask_user.output.json +54 -0
- package/dist/schemas/ask_user.schema.json +78 -0
- package/dist/schemas/bridge_operation.schema.json +50 -5
- package/dist/schemas/evaluation_operation.output.json +24 -0
- package/dist/schemas/goal_operation.schema.json +124 -0
- package/dist/schemas/guard2file.schema.json +10 -1
- package/dist/schemas/index.json +13 -1
- package/dist/schemas/industry_pack_operation.output.json +39 -0
- package/dist/schemas/local_mark_operation.schema.json +2 -2
- package/dist/schemas/machineNode2file.schema.json +10 -1
- package/dist/schemas/messenger_operation.output.json +678 -200
- package/dist/schemas/messenger_operation.schema.json +74 -239
- package/dist/schemas/onchain_events.output.json +2 -2
- package/dist/schemas/onchain_operations.schema.json +183 -21
- package/dist/schemas/onchain_operations_allocation.schema.json +10 -1
- package/dist/schemas/onchain_operations_arbitration.schema.json +10 -1
- package/dist/schemas/onchain_operations_contact.schema.json +10 -1
- package/dist/schemas/onchain_operations_demand.schema.json +10 -1
- package/dist/schemas/onchain_operations_gen_passport.schema.json +10 -1
- package/dist/schemas/onchain_operations_gen_proof.schema.json +10 -1
- package/dist/schemas/onchain_operations_guard.schema.json +10 -1
- package/dist/schemas/onchain_operations_machine.schema.json +10 -1
- package/dist/schemas/onchain_operations_order.schema.json +10 -1
- package/dist/schemas/onchain_operations_payment.schema.json +10 -1
- package/dist/schemas/onchain_operations_permission.schema.json +10 -1
- package/dist/schemas/onchain_operations_personal.schema.json +10 -1
- package/dist/schemas/onchain_operations_progress.schema.json +10 -1
- package/dist/schemas/onchain_operations_proof.schema.json +10 -1
- package/dist/schemas/onchain_operations_repository.schema.json +13 -4
- package/dist/schemas/onchain_operations_reward.schema.json +10 -1
- package/dist/schemas/onchain_operations_service.schema.json +10 -1
- package/dist/schemas/onchain_operations_treasury.schema.json +10 -1
- package/dist/schemas/onchain_table_data.output.json +184 -0
- package/dist/schemas/onchain_table_data.schema.json +43 -43
- package/dist/schemas/persona_operation.output.json +37778 -262
- package/dist/schemas/persona_operation.schema.json +5960 -1
- package/dist/schemas/query_toolkit.output.json +1580 -2
- package/dist/schemas/query_toolkit.schema.json +194 -32
- package/dist/schemas/schema_query.schema.json +25 -1
- package/dist/schemas/strategy_review_operation.output.json +532 -0
- package/dist/schemas/strategy_review_operation.schema.json +66 -0
- package/dist/schemas/wowok_buildin_info.output.json +188 -6
- package/dist/schemas/wowok_buildin_info.schema.json +14 -0
- package/dist/strategy/collectors.d.ts +66 -0
- package/dist/strategy/collectors.js +1 -0
- package/dist/strategy/collectors.spec.d.ts +1 -0
- package/dist/strategy/collectors.spec.js +1 -0
- package/dist/strategy/index.d.ts +5 -0
- package/dist/strategy/index.js +1 -0
- package/dist/strategy/metrics.d.ts +20 -0
- package/dist/strategy/metrics.js +1 -0
- package/dist/strategy/review.d.ts +48 -0
- package/dist/strategy/review.js +1 -0
- package/dist/strategy/scorecard.d.ts +32 -0
- package/dist/strategy/scorecard.js +1 -0
- package/dist/strategy/store.d.ts +26 -0
- package/dist/strategy/store.js +1 -0
- package/dist/tools/handlers/ask-user.d.ts +3 -0
- package/dist/tools/handlers/ask-user.js +1 -0
- package/dist/tools/handlers/config.js +1 -1
- package/dist/tools/handlers/evaluation.js +1 -1
- package/dist/tools/handlers/goal.js +1 -1
- package/dist/tools/handlers/industry-pack.js +1 -1
- package/dist/tools/handlers/local.js +1 -1
- package/dist/tools/handlers/messenger.js +1 -1
- package/dist/tools/handlers/onchain.js +1 -1
- package/dist/tools/handlers/permission.js +1 -1
- package/dist/tools/handlers/persona.js +1 -1
- package/dist/tools/handlers/query.d.ts +6 -0
- package/dist/tools/handlers/query.js +1 -1
- package/dist/tools/handlers/schema-query.js +1 -1
- package/dist/tools/handlers/strategy-review.d.ts +2 -0
- package/dist/tools/handlers/strategy-review.js +1 -0
- package/dist/tools/handlers/watch.js +1 -1
- package/dist/tools/handlers/workflow.js +1 -1
- package/dist/tools/index.d.ts +5 -2
- package/dist/tools/index.js +1 -1
- package/dist/tools/registry/agent.js +1 -1
- package/dist/tools/registry/bridge.js +1 -1
- package/dist/tools/registry/business.js +1 -1
- package/dist/tools/registry/interaction.d.ts +2 -0
- package/dist/tools/registry/interaction.js +1 -0
- package/dist/tools/registry/local.js +1 -1
- package/dist/tools/registry/messenger.js +1 -1
- package/dist/tools/registry/monitor.js +1 -1
- package/dist/tools/registry/onchain.js +1 -1
- package/dist/tools/registry/query.js +1 -1
- package/dist/tools/rules-hook.js +1 -1
- package/dist/tools/shared.d.ts +2 -1
- package/dist/tools/shared.js +1 -1
- package/dist/tools/types.d.ts +7 -1
- package/dist/tools/wrap.d.ts +3 -3
- package/dist/tools/wrap.js +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
import{MAX_SALE_COUNT,MAX_REPOSITORY_COUNT,MAX_ARBITRATION_COUNT,MAX_DISCOUNT_TOTAL_COUNT,MAX_WIP_LENGTH,MAX_WIP_HASH_LENGTH}from'@wowok/wowok';const R_S_1_01={'id':'R-S-1-01','category':'structural','trigger':'sales\x20count\x20exceeds\x20MAX_SALE_COUNT\x20(50)','check':a=>{const b=a['current_sales_count']??0x0;if(a['sales']&&(a['sales']['op']==='add'||a['sales']['op']==='set')){const c=a['sales']['op']==='set'?a['sales']['sales']['length']:b+a['sales']['sales']['length'];if(c>MAX_SALE_COUNT)return{'id':'R-S-1-01','level':'HIGH','category':'structural','title':'Sales\x20count\x20exceeds\x20limit','description':'Service\x20would\x20have\x20'+c+'\x20sales\x20items,\x20exceeds\x20MAX_SALE_COUNT\x20'+MAX_SALE_COUNT,'affected_stakeholders':['owner','system'],'scenario':'Adding\x20too\x20many\x20product\x20SKUs','mitigation':'Split\x20into\x20multiple\x20Service\x20objects\x20or\x20remove\x20discontinued\x20items','evidence':'sales_count='+c};}return null;}},R_S_1_02={'id':'R-S-1-02','category':'structural','trigger':'repositories\x20count\x20exceeds\x20MAX_REPOSITORY_COUNT\x20(100)','check':a=>{const b=a['current_repositories_count']??0x0;if(a['repositories']&&(a['repositories']['op']==='add'||a['repositories']['op']==='set')){const c=a['repositories']['op']==='set'?a['repositories']['objects']['length']:b+a['repositories']['objects']['length'];if(c>MAX_REPOSITORY_COUNT)return{'id':'R-S-1-02','level':'MEDIUM','category':'structural','title':'Repositories\x20count\x20exceeds\x20limit','description':'Service\x20would\x20have\x20'+c+'\x20repositories,\x20exceeds\x20MAX_REPOSITORY_COUNT\x20'+MAX_REPOSITORY_COUNT,'affected_stakeholders':['owner'],'scenario':'Binding\x20too\x20many\x20data\x20repositories','mitigation':'Consolidate\x20repositories\x20or\x20remove\x20inactive\x20ones','evidence':'repositories_count='+c};}return null;}},R_S_1_03={'id':'R-S-1-03','category':'structural','trigger':'arbitrations\x20count\x20exceeds\x20MAX_ARBITRATION_COUNT\x20(20)','check':a=>{const b=a['current_arbitrations_count']??0x0;if(a['arbitrations']&&(a['arbitrations']['op']==='add'||a['arbitrations']['op']==='set')){const c=a['arbitrations']['op']==='set'?a['arbitrations']['objects']['length']:b+a['arbitrations']['objects']['length'];if(c>MAX_ARBITRATION_COUNT)return{'id':'R-S-1-03','level':'HIGH','category':'structural','title':'Arbitrations\x20count\x20exceeds\x20limit','description':'Service\x20would\x20have\x20'+c+'\x20arbitrations,\x20exceeds\x20MAX_ARBITRATION_COUNT\x20'+MAX_ARBITRATION_COUNT,'affected_stakeholders':['owner','arbitrator'],'scenario':'Binding\x20too\x20many\x20Arbitration\x20objects','mitigation':'Use\x201-3\x20Arbitration\x20objects\x20covering\x20different\x20dispute\x20scopes','evidence':'arbitrations_count='+c};}return null;}},R_S_1_04={'id':'R-S-1-04','category':'structural','trigger':'WIP\x20hash\x20length\x20exceeds\x20MAX_WIP_HASH_LENGTH\x20(64)\x20or\x20URL\x20exceeds\x20MAX_WIP_LENGTH\x20(1024)','check':a=>{if(a['sales']&&(a['sales']['op']==='add'||a['sales']['op']==='set'))for(const b of a['sales']['sales']){if(b['wip_hash']&&b['wip_hash']['length']>MAX_WIP_HASH_LENGTH)return{'id':'R-S-1-04','level':'HIGH','category':'structural','title':'WIP\x20hash\x20length\x20exceeds\x20limit','description':'Sale\x20\x22'+b['name']+'\x22\x20wip_hash\x20length\x20'+b['wip_hash']['length']+'\x20>\x20MAX_WIP_HASH_LENGTH\x20'+MAX_WIP_HASH_LENGTH,'affected_stakeholders':['owner','customer'],'scenario':'Malformed\x20WIP\x20hash\x20(should\x20be\x20sha256\x20hex,\x2064\x20chars)','mitigation':'Use\x20sha256\x20hex\x20hash\x20(64\x20characters,\x20no\x20prefix)','evidence':'wip_hash_length='+b['wip_hash']['length']};if(b['wip']&&b['wip']['length']>MAX_WIP_LENGTH)return{'id':'R-S-1-04','level':'HIGH','category':'structural','title':'WIP\x20URL\x20length\x20exceeds\x20limit','description':'Sale\x20\x22'+b['name']+'\x22\x20wip\x20URL\x20length\x20'+b['wip']['length']+'\x20>\x20MAX_WIP_LENGTH\x20'+MAX_WIP_LENGTH,'affected_stakeholders':['owner'],'scenario':'WIP\x20URL\x20too\x20long\x20(use\x20IPFS\x20or\x20short\x20HTTPS\x20URL)','mitigation':'Use\x20IPFS\x20CID\x20or\x20shorter\x20URL','evidence':'wip_url_length='+b['wip']['length']};}return null;}},R_S_1_05={'id':'R-S-1-05','category':'structural','trigger':'sale.wip\x20is\x20a\x20local\x20path\x20/\x20localhost\x20/\x20LAN\x20URL\x20(not\x20network-deployable)\x20—\x20every\x20customer\x20order\x20fails','check':a=>{if(a['sales']&&(a['sales']['op']==='add'||a['sales']['op']==='set'))for(const b of a['sales']['sales']){if(b['wip']&&b['wip']!==''){let c=null;const d=b['wip'];if(/^[A-Za-z]:[\\/]/['test'](d)||d['startsWith']('/')||d['startsWith']('./')||d['startsWith']('../'))c='local\x20filesystem\x20path';else{if(/^https?:\/\/(localhost|127\.0\.0\.1|\[::1\]|0\.0\.0\.0)([:/]|$)/i['test'](d))c='localhost/loopback\x20URL';else{if(/^https?:\/\/(10\.\d{1,3}\.\d{1,3}\.\d{1,3}|172\.(1[6-9]|2\d|3[01])\.\d{1,3}\.\d{1,3}|192\.168\.\d{1,3}\.\d{1,3})([:/]|$)/i['test'](d))c='LAN\x20(private\x20IP)\x20URL';else!/^https?:\/\//i['test'](d)&&!d['startsWith']('ipfs://')&&!d['startsWith']('data:')&&(c='unrecognized\x20format\x20(not\x20a\x20network\x20URL)');}}if(c)return{'id':'R-S-1-05','level':'CRITICAL','category':'structural','title':'WIP\x20is\x20not\x20network-deployed\x20—\x20every\x20customer\x20order\x20will\x20fail','description':'Sale\x20\x22'+b['name']+'\x22\x20wip\x20\x22'+b['wip']+'\x22\x20is\x20a\x20'+c+'.\x20It\x20passes\x20set-time\x20verification\x20'+'on\x20the\x20merchant\x27s\x20own\x20machine\x20but\x20is\x20unreachable\x20by\x20customers\x20on\x20other\x20machines\x20—\x20'+'order_new\x20aborts\x20100%\x20when\x20a\x20customer\x20tries\x20to\x20buy.','affected_stakeholders':['owner','customer'],'scenario':'Merchant\x20sets\x20wip\x20to\x20a\x20local\x20file\x20path\x20/\x20localhost\x20/\x20LAN\x20URL\x20and\x20publishes\x20the\x20Service;\x20'+'the\x20on-chain\x20wip\x20points\x20at\x20the\x20merchant\x27s\x20machine;\x20customers\x20cannot\x20fetch\x20it.','mitigation':'Deploy\x20the\x20.wip\x20file\x20to\x20a\x20public\x20host\x20(GitHub\x20Pages,\x20IPFS,\x20or\x20your\x20own\x20website)\x20and\x20set\x20'+'sale.wip\x20to\x20the\x20public\x20URL.\x20Or\x20leave\x20sale.wip\x20empty\x20(\x22\x22)\x20to\x20skip\x20WIP\x20verification\x20'+'(TESTING\x20ONLY\x20—\x20not\x20recommended\x20for\x20production).','evidence':'sale='+b['name']+',\x20wip='+b['wip']};}}return null;}},R_S_2_01={'id':'R-S-2-01','category':'semantic','trigger':'WIP\x20hash\x20tampering\x20risk\x20—\x20owner\x20updates\x20WIP\x20file\x20without\x20updating\x20wip_hash','check':a=>{if(a['sales']&&(a['sales']['op']==='add'||a['sales']['op']==='set'))for(const b of a['sales']['sales']){if(b['wip']&&!b['wip_hash'])return{'id':'R-S-2-01','level':'CRITICAL','category':'semantic','title':'WIP\x20hash\x20missing\x20—\x20tampering\x20risk','description':'Sale\x20\x22'+b['name']+'\x22\x20has\x20wip\x20URL\x20but\x20no\x20wip_hash.\x20Owner\x20could\x20replace\x20the\x20WIP\x20file\x20without\x20customers\x20noticing.','affected_stakeholders':['customer','owner'],'scenario':'Owner\x20sets\x20wip\x20without\x20hash,\x20then\x20changes\x20file\x20content\x20later','mitigation':'Always\x20compute\x20sha256(wip_file_content)\x20and\x20set\x20as\x20wip_hash.\x20SDK\x20auto-derives\x20if\x20omitted,\x20but\x20explicit\x20hash\x20is\x20safer.','evidence':'sale='+b['name']};}return null;}},R_S_2_02={'id':'R-S-2-02','category':'semantic','trigger':'compensation_fund\x20confused\x20with\x20Service\x20balance\x20(internal\x20Balance<T>)','check':a=>{if(a['compensation_fund_add'])return{'id':'R-S-2-02','level':'HIGH','category':'semantic','title':'compensation_fund\x20is\x20internal\x20Balance<T>,\x20NOT\x20Service-owned\x20Treasury','description':'Depositing\x20'+a['compensation_fund_add']['balance']+'\x20to\x20compensation_fund.\x20This\x20balance\x20is\x20internal\x20to\x20Service<T>\x20and\x20is\x20consumed\x20by\x20arbitration::compensation_claim,\x20not\x20by\x20owner\x20withdrawals.\x20Owner\x20can\x20only\x20withdraw\x20via\x20compensation_fund_withdraw\x20(requires\x20bPaused=true\x20+\x20lock_duration\x20expired).','affected_stakeholders':['owner','arbitrator','customer'],'scenario':'Owner\x20confuses\x20compensation_fund\x20with\x20general\x20Treasury','mitigation':'Use\x20external\x20Treasury\x20(referenced\x20via\x20order_allocators.sharing.who=Entity)\x20for\x20general\x20funds.\x20Use\x20compensation_fund\x20only\x20for\x20arbitration\x20payouts.','evidence':'deposit='+a['compensation_fund_add']['balance']};return null;}},R_S_2_03={'id':'R-S-2-03','category':'semantic','trigger':'quote\x20side\x20effect\x20—\x20stock\x20deduction\x20not\x20rolled\x20back\x20on\x20later\x20failure','check':a=>{if(a['order_new']&&a['order_new']['buy']['items']['length']>0x0)return{'id':'R-S-2-03','level':'HIGH','category':'semantic','title':'Order\x20flow:\x20stock\x20deducted\x20at\x20quote\x20stage\x20—\x20NOT\x20rolled\x20back\x20on\x20failure','description':'Order\x20will\x20deduct\x20stock\x20at\x20Stage\x203\x20(quote).\x20If\x20Stages\x204-7\x20fail,\x20stock\x20remains\x20deducted.\x20Customer\x20must\x20manually\x20re-add\x20stock\x20or\x20accept\x20the\x20loss.','affected_stakeholders':['owner','customer'],'scenario':'Customer\x27s\x20transaction\x20fails\x20after\x20quote\x20but\x20stock\x20is\x20gone','mitigation':'1)\x20Monitor\x20failed\x20transactions\x20and\x20re-add\x20stock\x20via\x20stock_add.\x202)\x20Set\x20sales\x20suspension\x20during\x20high-failure\x20periods.\x203)\x20Use\x20small\x20batch\x20orders\x20to\x20limit\x20blast\x20radius.','evidence':'items='+a['order_new']['buy']['items']['length']};return null;}},R_S_2_04={'id':'R-S-2-04','category':'semantic','trigger':'Discount\x20issuance\x20—\x20verify\x20type\x20and\x20total\x20count\x20semantics','check':a=>{if(a['discount']){const b=a['discount']['count'];if(b>MAX_DISCOUNT_TOTAL_COUNT)return{'id':'R-S-2-04','level':'MEDIUM','category':'semantic','title':'Discount\x20count\x20exceeds\x20total\x20cap','description':'Issuing\x20'+b+'\x20discounts\x20exceeds\x20MAX_DISCOUNT_TOTAL_COUNT\x20'+MAX_DISCOUNT_TOTAL_COUNT,'affected_stakeholders':['owner'],'scenario':'Bulk\x20discount\x20issuance','mitigation':'Issue\x20in\x20batches\x20of\x20<=\x201000\x20(MAX_DISCOUNT_COUNT_ONCE)\x20and\x20keep\x20total\x20<=\x20'+MAX_DISCOUNT_TOTAL_COUNT,'evidence':'count='+b};}return null;}},R_S_2_05={'id':'R-S-2-05','category':'semantic','trigger':'Order\x20placed\x20without\x20verifying\x20WIP\x20hash\x20—\x20buyer\x20passes\x20empty\x20wip_hash','check':a=>{if(a['order_new']){const b=a['order_new']['buy']['items']['filter'](c=>c['wip_hash']==='');if(b['length']>0x0)return{'id':'R-S-2-05','level':'MEDIUM','category':'semantic','title':'Order\x20with\x20empty\x20wip_hash\x20—\x20SDK\x20auto-fills\x20from\x20sale','description':b['length']+'\x20item(s)\x20have\x20empty\x20wip_hash.\x20SDK\x20will\x20auto-fill\x20from\x20sale.wip_hash\x20at\x20order\x20time.\x20If\x20owner\x20updates\x20the\x20WIP\x20file\x20between\x20viewing\x20and\x20ordering,\x20buyer\x20receives\x20the\x20new\x20(potentially\x20different)\x20content.','affected_stakeholders':['customer'],'scenario':'Time-of-check\x20to\x20time-of-use\x20WIP\x20mismatch','mitigation':'Buyer\x20should\x20explicitly\x20pass\x20the\x20wip_hash\x20they\x20saw\x20when\x20viewing\x20the\x20product.\x20Empty\x20string\x20is\x20convenience\x20but\x20riskier.','evidence':'empty_hash_items='+b['length']};}return null;}},R_S_3_01={'id':'R-S-3-01','category':'authority','trigger':'publish\x20operation\x20—\x20requires\x20SERVICE_PUBLISH\x20(311)\x20+\x20prerequisites','check':a=>{if(!a['publish'])return null;const b=[];if(!a['current_order_allocators_set'])b['push']('order_allocators\x20not\x20set\x20(F-S-18,\x20E_NO_ALLOCATOR)');const c=a['current_compensation_fund_balance']??'0';BigInt(c)>0x0n&&(a['current_arbitrations_count']??0x0)===0x0&&b['push']('compensation_fund\x20>\x200\x20but\x20no\x20arbitrations\x20(F-S-19,\x20E_ARBITRATION_NOT_SET_WITH_COMPENSATION_FUND)');if(b['length']>0x0)return{'id':'R-S-3-01','level':'CRITICAL','category':'authority','title':'Publish\x20blocked\x20—\x20prerequisites\x20not\x20met','description':'Cannot\x20publish:\x20'+b['join'](';\x20'),'affected_stakeholders':['owner'],'scenario':'Owner\x20attempts\x20publish\x20without\x20configuring\x20prerequisites','mitigation':'Configure\x20order_allocators\x20(and\x20arbitrations\x20if\x20compensation_fund\x20>\x200)\x20before\x20publish','evidence':'blockers='+b['length']};return null;}},R_S_3_02={'id':'R-S-3-02','category':'authority','trigger':'pause\x20operation\x20—\x20affects\x20new\x20orders\x20but\x20not\x20existing\x20Progress','check':a=>{if(a['pause']===undefined)return null;return{'id':'R-S-3-02','level':'MEDIUM','category':'authority','title':a['pause']?'Pausing\x20Service\x20—\x20new\x20orders\x20blocked,\x20existing\x20Progress\x20continues':'Resuming\x20Service\x20—\x20new\x20orders\x20accepted','description':a['pause']?'Service.bPaused\x20=\x20true\x20will\x20reject\x20new\x20orders\x20(E_PAUSED,\x20service:19).\x20Existing\x20orders\x27\x20Progress\x20continues\x20normally.':'Service.bPaused\x20=\x20false\x20will\x20allow\x20new\x20orders\x20again.','affected_stakeholders':['owner','customer'],'scenario':a['pause']?'Owner\x20pauses\x20for\x20maintenance/stockout':'Owner\x20resumes\x20after\x20maintenance','mitigation':a['pause']?'Communicate\x20pause\x20to\x20customers.\x20Use\x20compensation_fund_withdraw\x20only\x20when\x20paused.':'Verify\x20stock\x20levels\x20before\x20resuming.','evidence':'pause='+a['pause']};}},R_S_3_03={'id':'R-S-3-03','category':'authority','trigger':'buy_guard\x20change\x20—\x20post-publish\x20mutable\x20(unusual\x20exception)','check':a=>{if(a['buy_guard']===undefined)return null;if(a['current_bPublished'])return{'id':'R-S-3-03','level':'MEDIUM','category':'authority','title':'buy_guard\x20change\x20post-publish\x20—\x20unusual\x20mutability','description':'buy_guard\x20is\x20the\x20ONLY\x20publish-locked-field\x20exception:\x20it\x20remains\x20mutable\x20post-publish.\x20Other\x20fields\x20(machine/arbitrations/order_allocators)\x20are\x20immutable.','affected_stakeholders':['owner','customer'],'scenario':'Owner\x20changes\x20buy_guard\x20strategy\x20after\x20publish\x20(e.g.\x20whitelist\x20→\x20public)','mitigation':'Document\x20buy_guard\x20changes\x20for\x20transparency.\x20Customers\x20should\x20re-verify\x20buy_guard\x20before\x20ordering.','evidence':'buy_guard='+(a['buy_guard']??'(cleared)')};return null;}},R_S_3_04={'id':'R-S-3-04','category':'authority','trigger':'Ownership\x20transfer\x20(builder\x20field)\x20—\x20irreversible','check':a=>{if(!a['builder'])return null;return{'id':'R-S-3-04','level':'HIGH','category':'authority','title':'Service\x20ownership\x20transfer\x20—\x20IRREVERSIBLE','description':'Transferring\x20Service\x20to\x20'+a['builder']+'.\x20Original\x20owner\x20loses\x20ALL\x20control.\x20New\x20owner\x20inherits\x20permission\x20+\x20compensation_fund\x20+\x20all\x20bindings.','affected_stakeholders':['owner'],'scenario':'Owner\x20transfers\x20Service\x20to\x20new\x20address','mitigation':'1)\x20Verify\x20new\x20owner\x20address\x20twice.\x202)\x20Withdraw\x20compensation_fund\x20first\x20(if\x20applicable).\x203)\x20Export\x20Service\x20JSON\x20before\x20transfer.','evidence':'new_owner='+a['builder']};}},R_S_4_01={'id':'R-S-4-01','category':'lifecycle','trigger':'publish\x20is\x20irreversible\x20—\x20bPublished\x20cannot\x20be\x20reset\x20to\x20false','check':a=>{if(!a['publish'])return null;if(a['current_bPublished'])return{'id':'R-S-4-01','level':'HIGH','category':'lifecycle','title':'Service\x20already\x20published\x20—\x20publish\x20is\x20no-op','description':'Service.bPublished\x20is\x20already\x20true.\x20Subsequent\x20publish\x20calls\x20have\x20no\x20effect\x20(bPublished\x20is\x20one-shot,\x20cannot\x20revert).','affected_stakeholders':['owner'],'scenario':'Owner\x20calls\x20publish\x20again\x20on\x20already-published\x20Service','mitigation':'Skip\x20publish\x20if\x20already\x20published.\x20To\x20\x27reset\x27\x20a\x20Service,\x20create\x20a\x20new\x20one.','evidence':'bPublished=true'};return{'id':'R-S-4-01','level':'HIGH','category':'lifecycle','title':'Publish\x20is\x20IRREVERSIBLE\x20—\x203\x20fields\x20will\x20be\x20locked\x20forever','description':'Once\x20published:\x20machine\x20(306),\x20arbitrations\x20(308),\x20order_allocators\x20(313)\x20become\x20permanently\x20immutable.\x20bPublished\x20cannot\x20be\x20reset\x20to\x20false.\x20Clone\x20Service\x20to\x20make\x20changes.','affected_stakeholders':['owner','customer'],'scenario':'Owner\x20publishes\x20Service\x20for\x20the\x20first\x20time','mitigation':'Verify\x20all\x20configurations\x20before\x20publish.\x20Run\x20pre-publish\x20checklist\x20(confirm-gate.ts).','evidence':'bPublished=false→true'};}},R_S_4_02={'id':'R-S-4-02','category':'lifecycle','trigger':'setting_lock_duration\x20add\x20—\x20only-increase\x20mechanism','check':a=>{if(a['setting_lock_duration_add']===undefined)return null;return{'id':'R-S-4-02','level':'MEDIUM','category':'lifecycle','title':'setting_lock_duration\x20can\x20only\x20INCREASE','description':'Adding\x20'+a['setting_lock_duration_add']+'\x20ms\x20to\x20setting_lock_duration.\x20New\x20value\x20=\x20old\x20+\x20input\x20(safe_add).\x20Cannot\x20be\x20decreased\x20—\x20protects\x20customers\x20from\x20owner\x20reducing\x20lock\x20to\x20withdraw\x20compensation_fund\x20faster.','affected_stakeholders':['owner','customer'],'scenario':'Owner\x20extends\x20lock\x20period\x20to\x20build\x20trust','mitigation':'Ensure\x20extension\x20is\x20intentional.\x20Lock\x20affects\x20rewards/compensation_fund_withdraw/compensation_fund_receive.','evidence':'add_ms='+a['setting_lock_duration_add']};}},R_S_4_03={'id':'R-S-4-03','category':'lifecycle','trigger':'machine/arbitrations/order_allocators\x20modification\x20after\x20publish\x20—\x20SDK\x20blocks','check':a=>{if(!a['current_bPublished'])return null;const b=[];if(a['machine']!==undefined)b['push']('machine\x20(306)');if(a['arbitrations']!==undefined)b['push']('arbitrations\x20(308)');if(a['order_allocators']!==undefined)b['push']('order_allocators\x20(313)');if(b['length']>0x0)return{'id':'R-S-4-03','level':'HIGH','category':'lifecycle','title':'Post-publish\x20modification\x20blocked\x20by\x20SDK','description':'Service\x20is\x20published.\x20Cannot\x20modify:\x20'+b['join'](',\x20')+'.\x20SDK\x20checkNotPublished()\x20will\x20abort.\x20To\x20change\x20these\x20fields,\x20clone\x20the\x20Service.','affected_stakeholders':['owner'],'scenario':'Owner\x20attempts\x20to\x20change\x20locked\x20field\x20post-publish','mitigation':'Create\x20a\x20new\x20Service\x20with\x20the\x20desired\x20configuration.\x20Migrate\x20active\x20orders\x20if\x20needed.','evidence':'blocked='+b['join'](',')};return null;}},R_S_4_04={'id':'R-S-4-04','category':'lifecycle','trigger':'sales\x20modification\x20—\x20stock/price\x20changes\x20affect\x20future\x20orders\x20only','check':a=>{if(!a['sales'])return null;return{'id':'R-S-4-04','level':'LOW','category':'lifecycle','title':'Sales\x20modification\x20affects\x20future\x20orders\x20only','description':'Sales\x20add/set/remove/clear\x20changes\x20do\x20NOT\x20affect\x20already-created\x20Orders.\x20Existing\x20Orders\x27\x20Progress\x20continues\x20with\x20the\x20original\x20sale\x20parameters.','affected_stakeholders':['owner','customer'],'scenario':'Owner\x20updates\x20prices\x20mid-campaign','mitigation':'Communicate\x20price/stock\x20changes\x20to\x20customers.\x20Existing\x20orders\x20are\x20unaffected.','evidence':'sales_op='+a['sales']['op']};}},R_S_4_05={'id':'R-S-4-05','category':'lifecycle','trigger':'Service\x20paused\x20(state-only\x20buyer\x20rule)\x20—\x20new\x20orders\x20are\x20suspended','check':a=>{if(!a['current_bPaused'])return null;return{'id':'R-S-4-05','level':'HIGH','category':'lifecycle','title':'Service\x20is\x20paused\x20—\x20ordering\x20suspended','description':'Service.bPaused\x20is\x20true.\x20The\x20merchant\x20has\x20actively\x20paused\x20the\x20Service;\x20new\x20orders\x20cannot\x20be\x20placed\x20until\x20it\x20resumes.','affected_stakeholders':['customer'],'scenario':'Buyer\x20performs\x20due\x20diligence\x20on\x20a\x20paused\x20Service','mitigation':'Confirm\x20with\x20the\x20merchant\x20(via\x20Messenger)\x20when\x20the\x20Service\x20will\x20resume\x20before\x20ordering.','evidence':'bPaused=true'};}},R_S_4_06={'id':'R-S-4-06','category':'lifecycle','trigger':'Service\x20not\x20published\x20(state-only\x20buyer\x20rule)\x20—\x20cannot\x20be\x20ordered','check':a=>{if(a['current_bPublished']!==![])return null;return{'id':'R-S-4-06','level':'HIGH','category':'lifecycle','title':'Service\x20is\x20not\x20published\x20—\x20cannot\x20be\x20ordered','description':'Service.bPublished\x20is\x20false.\x20The\x20Service\x20is\x20still\x20a\x20draft:\x20it\x20is\x20not\x20visible\x20on\x20the\x20market\x20and\x20order_new\x20will\x20fail.','affected_stakeholders':['customer'],'scenario':'Buyer\x20evaluates\x20a\x20draft\x20Service\x20shared\x20out-of-band','mitigation':'Wait\x20until\x20the\x20merchant\x20publishes\x20the\x20Service\x20(publish\x20is\x20irreversible\x20—\x20configuration\x20is\x20locked\x20at\x20that\x20point).','evidence':'bPublished=false'};}},R_S_5_01={'id':'R-S-5-01','category':'cross_object','trigger':'Machine\x20binding\x20—\x20post-publish\x20immutable,\x20Progress\x20inherits','check':a=>{if(a['machine']===undefined)return null;if(a['current_bPublished'])return{'id':'R-S-5-01','level':'HIGH','category':'cross_object','title':'Machine\x20binding\x20immutable\x20post-publish','description':'Service\x20is\x20published;\x20machine\x20cannot\x20be\x20changed.\x20All\x20future\x20Progress\x20objects\x20will\x20use\x20the\x20bound\x20Machine.','affected_stakeholders':['owner'],'scenario':'Owner\x20wants\x20to\x20upgrade\x20workflow\x20post-publish','mitigation':'Create\x20new\x20Service\x20with\x20new\x20Machine.\x20Migrate\x20customers\x20via\x20discounts.','evidence':'machine='+(a['machine']??'(cleared)')};return{'id':'R-S-5-01','level':'MEDIUM','category':'cross_object','title':'Machine\x20binding\x20—\x20verify\x20Machine\x20is\x20published','description':'Binding\x20Machine\x20'+a['machine']+'.\x20Ensure\x20Machine\x20is\x20published\x20(machine::publish)\x20—\x20Service\x20cannot\x20bind\x20unpublished\x20Machine.','affected_stakeholders':['owner'],'scenario':'Owner\x20binds\x20Machine\x20before\x20publishing\x20Service','mitigation':'Verify\x20Machine.bPublished\x20=\x20true\x20before\x20binding.','evidence':'machine='+a['machine']};}},R_S_5_02={'id':'R-S-5-02','category':'cross_object','trigger':'Arbitration\x20binding\x20—\x20required\x20when\x20compensation_fund\x20>\x200','check':a=>{if(!a['arbitrations'])return null;const b=a['current_compensation_fund_balance']??'0';if(BigInt(b)>0x0n&&(a['current_arbitrations_count']??0x0)===0x0)return{'id':'R-S-5-02','level':'HIGH','category':'cross_object','title':'Arbitration\x20required\x20—\x20compensation_fund\x20has\x20balance','description':'compensation_fund\x20balance\x20is\x20'+b+'.\x20Publish\x20will\x20fail\x20(E_ARBITRATION_NOT_SET_WITH_COMPENSATION_FUND)\x20until\x20arbitrations\x20is\x20non-empty.','affected_stakeholders':['owner'],'scenario':'Owner\x20deposits\x20compensation_fund\x20without\x20configuring\x20arbitrations','mitigation':'Add\x20at\x20least\x201\x20Arbitration\x20object\x20before\x20publish.','evidence':'compensation_fund='+b};return null;}},R_S_5_03={'id':'R-S-5-03','category':'cross_object','trigger':'order_allocators\x20binding\x20—\x20publish\x20prerequisite,\x20post-publish\x20immutable','check':a=>{if(a['order_allocators']===undefined)return null;if(a['current_bPublished'])return{'id':'R-S-5-03','level':'HIGH','category':'cross_object','title':'order_allocators\x20immutable\x20post-publish','description':'Service\x20is\x20published;\x20order_allocators\x20cannot\x20be\x20changed.\x20Fund\x20distribution\x20strategy\x20is\x20permanently\x20locked.','affected_stakeholders':['owner'],'scenario':'Owner\x20wants\x20to\x20adjust\x20fee\x20split\x20post-publish','mitigation':'Create\x20new\x20Service\x20with\x20new\x20allocators.\x20Cannot\x20migrate\x20existing\x20Orders.','evidence':'order_allocators='+(a['order_allocators']?'(set)':'(cleared)')};if(a['publish']&&!a['order_allocators'])return{'id':'R-S-5-03','level':'CRITICAL','category':'cross_object','title':'Publish\x20without\x20order_allocators\x20—\x20will\x20fail','description':'Publish\x20will\x20abort\x20with\x20E_NO_ALLOCATOR.\x20order_allocators\x20is\x20a\x20mandatory\x20publish\x20prerequisite.','affected_stakeholders':['owner'],'scenario':'Owner\x20attempts\x20publish\x20without\x20configuring\x20allocators','mitigation':'Set\x20order_allocators\x20before\x20publish.','evidence':'order_allocators=null'};return null;}},R_S_5_04={'id':'R-S-5-04','category':'cross_object','trigger':'Repository/Reward\x20binding\x20—\x20verify\x20object\x20types\x20before\x20adding','check':a=>{if(a['repositories']&&(a['repositories']['op']==='add'||a['repositories']['op']==='set'))return{'id':'R-S-5-04','level':'LOW','category':'cross_object','title':'Repository\x20binding\x20—\x20verify\x20object\x20types','description':'Adding\x20'+a['repositories']['objects']['length']+'\x20repositories.\x20SDK\x20uses\x20queryObjectsWithType\x20to\x20validate\x20each\x20is\x20ObjectType.Repository\x20before\x20binding.','affected_stakeholders':['owner'],'scenario':'Owner\x20adds\x20non-Repository\x20object\x20by\x20mistake','mitigation':'Use\x20LocalMark\x20names\x20or\x20addresses\x20that\x20are\x20confirmed\x20Repository\x20objects.','evidence':'objects='+a['repositories']['objects']['length']};if(a['rewards']&&(a['rewards']['op']==='add'||a['rewards']['op']==='set'))return{'id':'R-S-5-04','level':'LOW','category':'cross_object','title':'Reward\x20binding\x20—\x20verify\x20object\x20types','description':'Adding\x20'+a['rewards']['objects']['length']+'\x20rewards.\x20SDK\x20validates\x20ObjectType.Reward.\x20add\x20is\x20always\x20allowed;\x20only\x20remove/clear\x20are\x20time-locked\x20after\x20publish.','affected_stakeholders':['owner'],'scenario':'Owner\x20adds\x20Reward\x20objects','mitigation':'Verify\x20Reward\x20objects\x20exist\x20and\x20are\x20active.\x20Remember\x20that\x20removing\x20them\x20later\x20requires\x20pause\x20+\x20setting_lock_duration\x20elapsed.','evidence':'objects='+a['rewards']['objects']['length']};return null;}},R_S_5_05={'id':'R-S-5-05','category':'cross_object','trigger':'compensation_fund\x20has\x20balance\x20but\x20no\x20Arbitration\x20bound\x20(state-only\x20buyer\x20rule)','check':a=>{const b=a['current_compensation_fund_balance'];if(b===undefined)return null;let c;try{c=BigInt(b);}catch{return null;}if(c>0x0n&&(a['current_arbitrations_count']??0x0)===0x0)return{'id':'R-S-5-05','level':'HIGH','category':'cross_object','title':'Compensation\x20fund\x20without\x20Arbitration\x20—\x20fund\x20is\x20unclaimable','description':'compensation_fund\x20balance\x20is\x20'+b+'\x20but\x20no\x20Arbitration\x20object\x20is\x20bound.\x20Compensation\x20is\x20claimed\x20via\x20dispute\x20→\x20arbitration()\x20ruling\x20with\x20indemnity\x20→\x20arb_withdraw;\x20without\x20an\x20Arbitration\x20binding\x20there\x20is\x20no\x20dispute\x20path\x20to\x20trigger\x20a\x20payout.','affected_stakeholders':['customer','owner'],'scenario':'Buyer\x20sees\x20a\x20compensation\x20fund\x20but\x20no\x20dispute\x20path\x20to\x20claim\x20it','mitigation':'Require\x20the\x20merchant\x20to\x20bind\x20at\x20least\x20one\x20Arbitration\x20object\x20before\x20ordering.','evidence':'compensation_fund='+b+',\x20arbitrations=0'};return null;}},ALL_RULES=[R_S_1_01,R_S_1_02,R_S_1_03,R_S_1_04,R_S_1_05,R_S_2_01,R_S_2_02,R_S_2_03,R_S_2_04,R_S_2_05,R_S_3_01,R_S_3_02,R_S_3_03,R_S_3_04,R_S_4_01,R_S_4_02,R_S_4_03,R_S_4_04,R_S_4_05,R_S_4_06,R_S_5_01,R_S_5_02,R_S_5_03,R_S_5_04,R_S_5_05];export const SERVICE_RISK_VERSION='1.1.0';export function getAllServiceRiskRules(){return[...ALL_RULES];}export function getServiceRiskRulesCount(){return ALL_RULES['length'];}export function getServiceRiskRulesByCategory(a){return ALL_RULES['filter'](b=>b['category']===a);}export function assessServiceRisks(a){const b=[];for(const f of ALL_RULES){const g=f['check'](a);if(g)b['push'](g);}const c=b['length']===0x0?'LOW':b['some'](h=>h['level']==='CRITICAL')?'CRITICAL':b['some'](h=>h['level']==='HIGH')?'HIGH':b['some'](h=>h['level']==='MEDIUM')?'MEDIUM':'LOW',d={};for(const h of b){d[h['category']]=(d[h['category']]??0x0)+0x1;}const e={};for(const i of b){for(const j of i['affected_stakeholders']){if(!e[j])e[j]=[];e[j]['push'](i['id']+':\x20'+i['mitigation']);}}return{'summary':'Assessed\x20'+b['length']+'\x20risk(s)\x20across\x20'+Object['keys'](d)['length']+'\x20categories','risks':b,'overall_risk':c,'risks_by_category':d,'stakeholder_advice':e,'needs_human_review':b['some'](k=>k['level']==='CRITICAL'||k['level']==='HIGH')};}
|
|
1
|
+
import{MAX_SALE_COUNT,MAX_REPOSITORY_COUNT,MAX_ARBITRATION_COUNT,MAX_DISCOUNT_TOTAL_COUNT,MAX_WIP_LENGTH,MAX_WIP_HASH_LENGTH}from'@wowok/wowok';const R_S_1_01={'id':'R-S-1-01','category':'structural','trigger':'sales\x20count\x20exceeds\x20MAX_SALE_COUNT\x20(50)','check':a=>{const b=a['current_sales_count']??0x0;if(a['sales']&&(a['sales']['op']==='add'||a['sales']['op']==='set')){const c=a['sales']['op']==='set'?a['sales']['sales']['length']:b+a['sales']['sales']['length'];if(c>MAX_SALE_COUNT)return{'id':'R-S-1-01','level':'HIGH','category':'structural','title':'Sales\x20count\x20exceeds\x20limit','description':'Service\x20would\x20have\x20'+c+'\x20sales\x20items,\x20exceeds\x20MAX_SALE_COUNT\x20'+MAX_SALE_COUNT,'affected_stakeholders':['owner','system'],'scenario':'Adding\x20too\x20many\x20product\x20SKUs','mitigation':'Split\x20into\x20multiple\x20Service\x20objects\x20or\x20remove\x20discontinued\x20items','evidence':'sales_count='+c};}return null;}},R_S_1_02={'id':'R-S-1-02','category':'structural','trigger':'repositories\x20count\x20exceeds\x20MAX_REPOSITORY_COUNT\x20(100)','check':a=>{const b=a['current_repositories_count']??0x0;if(a['repositories']&&(a['repositories']['op']==='add'||a['repositories']['op']==='set')){const c=a['repositories']['op']==='set'?a['repositories']['objects']['length']:b+a['repositories']['objects']['length'];if(c>MAX_REPOSITORY_COUNT)return{'id':'R-S-1-02','level':'MEDIUM','category':'structural','title':'Repositories\x20count\x20exceeds\x20limit','description':'Service\x20would\x20have\x20'+c+'\x20repositories,\x20exceeds\x20MAX_REPOSITORY_COUNT\x20'+MAX_REPOSITORY_COUNT,'affected_stakeholders':['owner'],'scenario':'Binding\x20too\x20many\x20data\x20repositories','mitigation':'Consolidate\x20repositories\x20or\x20remove\x20inactive\x20ones','evidence':'repositories_count='+c};}return null;}},R_S_1_03={'id':'R-S-1-03','category':'structural','trigger':'arbitrations\x20count\x20exceeds\x20MAX_ARBITRATION_COUNT\x20(20)','check':a=>{const b=a['current_arbitrations_count']??0x0;if(a['arbitrations']&&(a['arbitrations']['op']==='add'||a['arbitrations']['op']==='set')){const c=a['arbitrations']['op']==='set'?a['arbitrations']['objects']['length']:b+a['arbitrations']['objects']['length'];if(c>MAX_ARBITRATION_COUNT)return{'id':'R-S-1-03','level':'HIGH','category':'structural','title':'Arbitrations\x20count\x20exceeds\x20limit','description':'Service\x20would\x20have\x20'+c+'\x20arbitrations,\x20exceeds\x20MAX_ARBITRATION_COUNT\x20'+MAX_ARBITRATION_COUNT,'affected_stakeholders':['owner','arbitrator'],'scenario':'Binding\x20too\x20many\x20Arbitration\x20objects','mitigation':'Use\x201-3\x20Arbitration\x20objects\x20covering\x20different\x20dispute\x20scopes','evidence':'arbitrations_count='+c};}return null;}},R_S_1_04={'id':'R-S-1-04','category':'structural','trigger':'WIP\x20hash\x20length\x20exceeds\x20MAX_WIP_HASH_LENGTH\x20(64)\x20or\x20URL\x20exceeds\x20MAX_WIP_LENGTH\x20(1024)','check':a=>{if(a['sales']&&(a['sales']['op']==='add'||a['sales']['op']==='set'))for(const b of a['sales']['sales']){if(b['wip_hash']&&b['wip_hash']['length']>MAX_WIP_HASH_LENGTH)return{'id':'R-S-1-04','level':'HIGH','category':'structural','title':'WIP\x20hash\x20length\x20exceeds\x20limit','description':'Sale\x20\x22'+b['name']+'\x22\x20wip_hash\x20length\x20'+b['wip_hash']['length']+'\x20>\x20MAX_WIP_HASH_LENGTH\x20'+MAX_WIP_HASH_LENGTH,'affected_stakeholders':['owner','customer'],'scenario':'Malformed\x20WIP\x20hash\x20(should\x20be\x20sha256\x20hex,\x2064\x20chars)','mitigation':'Use\x20sha256\x20hex\x20hash\x20(64\x20characters,\x20no\x20prefix)','evidence':'wip_hash_length='+b['wip_hash']['length']};if(b['wip']&&b['wip']['length']>MAX_WIP_LENGTH)return{'id':'R-S-1-04','level':'HIGH','category':'structural','title':'WIP\x20URL\x20length\x20exceeds\x20limit','description':'Sale\x20\x22'+b['name']+'\x22\x20wip\x20URL\x20length\x20'+b['wip']['length']+'\x20>\x20MAX_WIP_LENGTH\x20'+MAX_WIP_LENGTH,'affected_stakeholders':['owner'],'scenario':'WIP\x20URL\x20too\x20long\x20(use\x20IPFS\x20or\x20short\x20HTTPS\x20URL)','mitigation':'Use\x20IPFS\x20CID\x20or\x20shorter\x20URL','evidence':'wip_url_length='+b['wip']['length']};}return null;}},R_S_1_05={'id':'R-S-1-05','category':'structural','trigger':'sale.wip\x20is\x20a\x20local\x20path\x20/\x20localhost\x20/\x20LAN\x20URL\x20(not\x20network-deployable)\x20—\x20every\x20customer\x20order\x20fails','check':a=>{if(a['sales']&&(a['sales']['op']==='add'||a['sales']['op']==='set'))for(const b of a['sales']['sales']){if(b['wip']&&b['wip']!==''){let c=null;const d=b['wip'];if(/^[A-Za-z]:[\\/]/['test'](d)||d['startsWith']('/')||d['startsWith']('./')||d['startsWith']('../'))c='local\x20filesystem\x20path';else{if(/^https?:\/\/(localhost|127\.0\.0\.1|\[::1\]|0\.0\.0\.0)([:/]|$)/i['test'](d))c='localhost/loopback\x20URL';else{if(/^https?:\/\/(10\.\d{1,3}\.\d{1,3}\.\d{1,3}|172\.(1[6-9]|2\d|3[01])\.\d{1,3}\.\d{1,3}|192\.168\.\d{1,3}\.\d{1,3})([:/]|$)/i['test'](d))c='LAN\x20(private\x20IP)\x20URL';else!/^https?:\/\//i['test'](d)&&!d['startsWith']('ipfs://')&&!d['startsWith']('data:')&&(c='unrecognized\x20format\x20(not\x20a\x20network\x20URL)');}}if(c)return{'id':'R-S-1-05','level':'CRITICAL','category':'structural','title':'WIP\x20is\x20not\x20network-deployed\x20—\x20every\x20customer\x20order\x20will\x20fail','description':'Sale\x20\x22'+b['name']+'\x22\x20wip\x20\x22'+b['wip']+'\x22\x20is\x20a\x20'+c+'.\x20It\x20passes\x20set-time\x20verification\x20'+'on\x20the\x20merchant\x27s\x20own\x20machine\x20but\x20is\x20unreachable\x20by\x20customers\x20on\x20other\x20machines\x20—\x20'+'order_new\x20aborts\x20100%\x20when\x20a\x20customer\x20tries\x20to\x20buy.','affected_stakeholders':['owner','customer'],'scenario':'Merchant\x20sets\x20wip\x20to\x20a\x20local\x20file\x20path\x20/\x20localhost\x20/\x20LAN\x20URL\x20and\x20publishes\x20the\x20Service;\x20'+'the\x20on-chain\x20wip\x20points\x20at\x20the\x20merchant\x27s\x20machine;\x20customers\x20cannot\x20fetch\x20it.','mitigation':'Deploy\x20the\x20.wip\x20file\x20to\x20a\x20public\x20host\x20(GitHub\x20Pages,\x20IPFS,\x20or\x20your\x20own\x20website)\x20and\x20set\x20'+'sale.wip\x20to\x20the\x20public\x20URL.\x20Or\x20leave\x20sale.wip\x20empty\x20(\x22\x22)\x20to\x20skip\x20WIP\x20verification\x20'+'(TESTING\x20ONLY\x20—\x20not\x20recommended\x20for\x20production).','evidence':'sale='+b['name']+',\x20wip='+b['wip']};}}return null;}},R_S_2_01={'id':'R-S-2-01','category':'semantic','trigger':'WIP\x20hash\x20tampering\x20risk\x20—\x20owner\x20updates\x20WIP\x20file\x20without\x20updating\x20wip_hash','check':a=>{if(a['sales']&&(a['sales']['op']==='add'||a['sales']['op']==='set'))for(const b of a['sales']['sales']){if(b['wip']&&!b['wip_hash'])return{'id':'R-S-2-01','level':'CRITICAL','category':'semantic','title':'WIP\x20hash\x20missing\x20—\x20tampering\x20risk','description':'Sale\x20\x22'+b['name']+'\x22\x20has\x20wip\x20URL\x20but\x20no\x20wip_hash.\x20Owner\x20could\x20replace\x20the\x20WIP\x20file\x20without\x20customers\x20noticing.','affected_stakeholders':['customer','owner'],'scenario':'Owner\x20sets\x20wip\x20without\x20hash,\x20then\x20changes\x20file\x20content\x20later','mitigation':'Always\x20compute\x20sha256(wip_file_content)\x20and\x20set\x20as\x20wip_hash.\x20SDK\x20auto-derives\x20if\x20omitted,\x20but\x20explicit\x20hash\x20is\x20safer.','evidence':'sale='+b['name']};}return null;}},R_S_2_02={'id':'R-S-2-02','category':'semantic','trigger':'compensation_fund\x20confused\x20with\x20Service\x20balance\x20(internal\x20Balance<T>)','check':a=>{if(a['compensation_fund_add'])return{'id':'R-S-2-02','level':'HIGH','category':'semantic','title':'compensation_fund\x20is\x20internal\x20Balance<T>,\x20NOT\x20Service-owned\x20Treasury','description':'Depositing\x20'+a['compensation_fund_add']['balance']+'\x20to\x20compensation_fund.\x20This\x20balance\x20is\x20internal\x20to\x20Service<T>\x20and\x20is\x20consumed\x20by\x20arbitration::compensation_claim,\x20not\x20by\x20owner\x20withdrawals.\x20Owner\x20can\x20only\x20withdraw\x20via\x20compensation_fund_withdraw\x20(requires\x20bPaused=true\x20+\x20lock_duration\x20expired).','affected_stakeholders':['owner','arbitrator','customer'],'scenario':'Owner\x20confuses\x20compensation_fund\x20with\x20general\x20Treasury','mitigation':'Use\x20external\x20Treasury\x20(referenced\x20via\x20order_allocators.sharing.who=Entity)\x20for\x20general\x20funds.\x20Use\x20compensation_fund\x20only\x20for\x20arbitration\x20payouts.','evidence':'deposit='+a['compensation_fund_add']['balance']};return null;}},R_S_2_03={'id':'R-S-2-03','category':'semantic','trigger':'quote\x20side\x20effect\x20—\x20stock\x20deduction\x20not\x20rolled\x20back\x20on\x20later\x20failure','check':a=>{if(a['order_new']&&a['order_new']['buy']['items']['length']>0x0)return{'id':'R-S-2-03','level':'HIGH','category':'semantic','title':'Order\x20flow:\x20stock\x20deducted\x20at\x20quote\x20stage\x20—\x20NOT\x20rolled\x20back\x20on\x20failure','description':'Order\x20will\x20deduct\x20stock\x20at\x20Stage\x203\x20(quote).\x20If\x20Stages\x204-7\x20fail,\x20stock\x20remains\x20deducted.\x20Customer\x20must\x20manually\x20re-add\x20stock\x20or\x20accept\x20the\x20loss.','affected_stakeholders':['owner','customer'],'scenario':'Customer\x27s\x20transaction\x20fails\x20after\x20quote\x20but\x20stock\x20is\x20gone','mitigation':'1)\x20Monitor\x20failed\x20transactions\x20and\x20re-add\x20stock\x20via\x20stock_add.\x202)\x20Set\x20sales\x20suspension\x20during\x20high-failure\x20periods.\x203)\x20Use\x20small\x20batch\x20orders\x20to\x20limit\x20blast\x20radius.','evidence':'items='+a['order_new']['buy']['items']['length']};return null;}},R_S_2_04={'id':'R-S-2-04','category':'semantic','trigger':'Discount\x20issuance\x20—\x20verify\x20type\x20and\x20total\x20count\x20semantics','check':a=>{if(a['discount']){const b=a['discount']['count'];if(b>MAX_DISCOUNT_TOTAL_COUNT)return{'id':'R-S-2-04','level':'MEDIUM','category':'semantic','title':'Discount\x20count\x20exceeds\x20total\x20cap','description':'Issuing\x20'+b+'\x20discounts\x20exceeds\x20MAX_DISCOUNT_TOTAL_COUNT\x20'+MAX_DISCOUNT_TOTAL_COUNT,'affected_stakeholders':['owner'],'scenario':'Bulk\x20discount\x20issuance','mitigation':'Issue\x20in\x20batches\x20of\x20<=\x201000\x20(MAX_DISCOUNT_COUNT_ONCE)\x20and\x20keep\x20total\x20<=\x20'+MAX_DISCOUNT_TOTAL_COUNT,'evidence':'count='+b};}return null;}},R_S_2_05={'id':'R-S-2-05','category':'semantic','trigger':'Order\x20placed\x20without\x20verifying\x20WIP\x20hash\x20—\x20buyer\x20passes\x20empty\x20wip_hash','check':a=>{if(a['order_new']){const b=a['order_new']['buy']['items']['filter'](c=>c['wip_hash']==='');if(b['length']>0x0)return{'id':'R-S-2-05','level':'MEDIUM','category':'semantic','title':'Order\x20with\x20empty\x20wip_hash\x20—\x20SDK\x20auto-fills\x20from\x20sale','description':b['length']+'\x20item(s)\x20have\x20empty\x20wip_hash.\x20SDK\x20will\x20auto-fill\x20from\x20sale.wip_hash\x20at\x20order\x20time.\x20If\x20owner\x20updates\x20the\x20WIP\x20file\x20between\x20viewing\x20and\x20ordering,\x20buyer\x20receives\x20the\x20new\x20(potentially\x20different)\x20content.','affected_stakeholders':['customer'],'scenario':'Time-of-check\x20to\x20time-of-use\x20WIP\x20mismatch','mitigation':'Buyer\x20should\x20explicitly\x20pass\x20the\x20wip_hash\x20they\x20saw\x20when\x20viewing\x20the\x20product.\x20Empty\x20string\x20is\x20convenience\x20but\x20riskier.','evidence':'empty_hash_items='+b['length']};}return null;}},R_S_3_01={'id':'R-S-3-01','category':'authority','trigger':'publish\x20operation\x20—\x20requires\x20SERVICE_PUBLISH\x20(311)\x20+\x20prerequisites','check':a=>{if(!a['publish'])return null;const b=[];if(!a['current_order_allocators_set'])b['push']('order_allocators\x20not\x20set\x20(F-S-18,\x20E_NO_ALLOCATOR)');const c=a['current_compensation_fund_balance']??'0';BigInt(c)>0x0n&&(a['current_arbitrations_count']??0x0)===0x0&&b['push']('compensation_fund\x20>\x200\x20but\x20no\x20arbitrations\x20(F-S-19,\x20E_ARBITRATION_NOT_SET_WITH_COMPENSATION_FUND)');if(b['length']>0x0)return{'id':'R-S-3-01','level':'CRITICAL','category':'authority','title':'Publish\x20blocked\x20—\x20prerequisites\x20not\x20met','description':'Cannot\x20publish:\x20'+b['join'](';\x20'),'affected_stakeholders':['owner'],'scenario':'Owner\x20attempts\x20publish\x20without\x20configuring\x20prerequisites','mitigation':'Configure\x20order_allocators\x20(and\x20arbitrations\x20if\x20compensation_fund\x20>\x200)\x20before\x20publish','evidence':'blockers='+b['length']};return null;}},R_S_3_02={'id':'R-S-3-02','category':'authority','trigger':'pause\x20operation\x20—\x20affects\x20new\x20orders\x20but\x20not\x20existing\x20Progress','check':a=>{if(a['pause']===undefined)return null;return{'id':'R-S-3-02','level':'MEDIUM','category':'authority','title':a['pause']?'Pausing\x20Service\x20—\x20new\x20orders\x20blocked,\x20existing\x20Progress\x20continues':'Resuming\x20Service\x20—\x20new\x20orders\x20accepted','description':a['pause']?'Service.bPaused\x20=\x20true\x20will\x20reject\x20new\x20orders\x20(E_PAUSED,\x20service:19).\x20Existing\x20orders\x27\x20Progress\x20continues\x20normally.':'Service.bPaused\x20=\x20false\x20will\x20allow\x20new\x20orders\x20again.','affected_stakeholders':['owner','customer'],'scenario':a['pause']?'Owner\x20pauses\x20for\x20maintenance/stockout':'Owner\x20resumes\x20after\x20maintenance','mitigation':a['pause']?'Communicate\x20pause\x20to\x20customers.\x20Use\x20compensation_fund_withdraw\x20only\x20when\x20paused.':'Verify\x20stock\x20levels\x20before\x20resuming.','evidence':'pause='+a['pause']};}},R_S_3_03={'id':'R-S-3-03','category':'authority','trigger':'buy_guard\x20change\x20—\x20post-publish\x20mutable\x20(unusual\x20exception)','check':a=>{if(a['buy_guard']===undefined)return null;if(a['current_bPublished'])return{'id':'R-S-3-03','level':'MEDIUM','category':'authority','title':'buy_guard\x20change\x20post-publish\x20—\x20unusual\x20mutability','description':'buy_guard\x20is\x20the\x20ONLY\x20publish-locked-field\x20exception:\x20it\x20remains\x20mutable\x20post-publish.\x20Other\x20fields\x20(machine/arbitrations/order_allocators)\x20are\x20immutable.','affected_stakeholders':['owner','customer'],'scenario':'Owner\x20changes\x20buy_guard\x20strategy\x20after\x20publish\x20(e.g.\x20whitelist\x20→\x20public)','mitigation':'Document\x20buy_guard\x20changes\x20for\x20transparency.\x20Customers\x20should\x20re-verify\x20buy_guard\x20before\x20ordering.','evidence':'buy_guard='+(a['buy_guard']??'(cleared)')};return null;}},R_S_3_04={'id':'R-S-3-04','category':'authority','trigger':'Ownership\x20transfer\x20(builder\x20field)\x20—\x20irreversible','check':a=>{if(!a['builder'])return null;return{'id':'R-S-3-04','level':'HIGH','category':'authority','title':'Service\x20ownership\x20transfer\x20—\x20IRREVERSIBLE','description':'Transferring\x20Service\x20to\x20'+a['builder']+'.\x20Original\x20owner\x20loses\x20ALL\x20control.\x20New\x20owner\x20inherits\x20permission\x20+\x20compensation_fund\x20+\x20all\x20bindings.','affected_stakeholders':['owner'],'scenario':'Owner\x20transfers\x20Service\x20to\x20new\x20address','mitigation':'1)\x20Verify\x20new\x20owner\x20address\x20twice.\x202)\x20Withdraw\x20compensation_fund\x20first\x20(if\x20applicable).\x203)\x20Export\x20Service\x20JSON\x20before\x20transfer.','evidence':'new_owner='+a['builder']};}},R_S_4_01={'id':'R-S-4-01','category':'lifecycle','trigger':'publish\x20is\x20irreversible\x20—\x20bPublished\x20cannot\x20be\x20reset\x20to\x20false','check':a=>{if(!a['publish'])return null;if(a['current_bPublished'])return{'id':'R-S-4-01','level':'HIGH','category':'lifecycle','title':'Service\x20already\x20published\x20—\x20publish\x20is\x20no-op','description':'Service.bPublished\x20is\x20already\x20true.\x20Subsequent\x20publish\x20calls\x20have\x20no\x20effect\x20(bPublished\x20is\x20one-shot,\x20cannot\x20revert).','affected_stakeholders':['owner'],'scenario':'Owner\x20calls\x20publish\x20again\x20on\x20already-published\x20Service','mitigation':'Skip\x20publish\x20if\x20already\x20published.\x20To\x20\x27reset\x27\x20a\x20Service,\x20create\x20a\x20new\x20one.','evidence':'bPublished=true'};return{'id':'R-S-4-01','level':'HIGH','category':'lifecycle','title':'Publish\x20is\x20IRREVERSIBLE\x20—\x203\x20fields\x20will\x20be\x20locked\x20forever','description':'Once\x20published:\x20machine\x20(306),\x20arbitrations\x20(308),\x20order_allocators\x20(313)\x20become\x20permanently\x20immutable.\x20bPublished\x20cannot\x20be\x20reset\x20to\x20false.\x20Clone\x20Service\x20to\x20make\x20changes.','affected_stakeholders':['owner','customer'],'scenario':'Owner\x20publishes\x20Service\x20for\x20the\x20first\x20time','mitigation':'Verify\x20all\x20configurations\x20before\x20publish.\x20Run\x20pre-publish\x20checklist\x20(confirm-gate.ts).','evidence':'bPublished=false→true'};}},R_S_4_02={'id':'R-S-4-02','category':'lifecycle','trigger':'setting_lock_duration\x20add\x20—\x20only-increase\x20mechanism','check':a=>{if(a['setting_lock_duration_add']===undefined)return null;return{'id':'R-S-4-02','level':'MEDIUM','category':'lifecycle','title':'setting_lock_duration\x20can\x20only\x20INCREASE','description':'Adding\x20'+a['setting_lock_duration_add']+'\x20ms\x20to\x20setting_lock_duration.\x20New\x20value\x20=\x20old\x20+\x20input\x20(safe_add).\x20Cannot\x20be\x20decreased\x20—\x20protects\x20customers\x20from\x20owner\x20reducing\x20lock\x20to\x20withdraw\x20compensation_fund\x20faster.','affected_stakeholders':['owner','customer'],'scenario':'Owner\x20extends\x20lock\x20period\x20to\x20build\x20trust','mitigation':'Ensure\x20extension\x20is\x20intentional.\x20Lock\x20affects\x20rewards/compensation_fund_withdraw/compensation_fund_receive.','evidence':'add_ms='+a['setting_lock_duration_add']};}},R_S_4_03={'id':'R-S-4-03','category':'lifecycle','trigger':'machine/arbitrations/order_allocators\x20modification\x20after\x20publish\x20—\x20SDK\x20blocks','check':a=>{if(!a['current_bPublished'])return null;const b=[];if(a['machine']!==undefined)b['push']('machine\x20(306)');if(a['arbitrations']!==undefined)b['push']('arbitrations\x20(308)');if(a['order_allocators']!==undefined)b['push']('order_allocators\x20(313)');if(b['length']>0x0)return{'id':'R-S-4-03','level':'HIGH','category':'lifecycle','title':'Post-publish\x20modification\x20blocked\x20by\x20SDK','description':'Service\x20is\x20published.\x20Cannot\x20modify:\x20'+b['join'](',\x20')+'.\x20SDK\x20checkNotPublished()\x20will\x20abort.\x20To\x20change\x20these\x20fields,\x20clone\x20the\x20Service.','affected_stakeholders':['owner'],'scenario':'Owner\x20attempts\x20to\x20change\x20locked\x20field\x20post-publish','mitigation':'Create\x20a\x20new\x20Service\x20with\x20the\x20desired\x20configuration.\x20Migrate\x20active\x20orders\x20if\x20needed.','evidence':'blocked='+b['join'](',')};return null;}},R_S_4_04={'id':'R-S-4-04','category':'lifecycle','trigger':'sales\x20modification\x20—\x20stock/price\x20changes\x20affect\x20future\x20orders\x20only','check':a=>{if(!a['sales'])return null;return{'id':'R-S-4-04','level':'LOW','category':'lifecycle','title':'Sales\x20modification\x20affects\x20future\x20orders\x20only','description':'Sales\x20add/set/remove/clear\x20changes\x20do\x20NOT\x20affect\x20already-created\x20Orders.\x20Existing\x20Orders\x27\x20Progress\x20continues\x20with\x20the\x20original\x20sale\x20parameters.','affected_stakeholders':['owner','customer'],'scenario':'Owner\x20updates\x20prices\x20mid-campaign','mitigation':'Communicate\x20price/stock\x20changes\x20to\x20customers.\x20Existing\x20orders\x20are\x20unaffected.','evidence':'sales_op='+a['sales']['op']};}},R_S_4_05={'id':'R-S-4-05','category':'lifecycle','trigger':'Service\x20paused\x20(state-only\x20buyer\x20rule)\x20—\x20new\x20orders\x20are\x20suspended','check':a=>{if(!a['current_bPaused'])return null;return{'id':'R-S-4-05','level':'HIGH','category':'lifecycle','title':'Service\x20is\x20paused\x20—\x20ordering\x20suspended','description':'Service.bPaused\x20is\x20true.\x20The\x20merchant\x20has\x20actively\x20paused\x20the\x20Service;\x20new\x20orders\x20cannot\x20be\x20placed\x20until\x20it\x20resumes.','affected_stakeholders':['customer'],'scenario':'Buyer\x20performs\x20due\x20diligence\x20on\x20a\x20paused\x20Service','mitigation':'Confirm\x20with\x20the\x20merchant\x20(via\x20Messenger)\x20when\x20the\x20Service\x20will\x20resume\x20before\x20ordering.','evidence':'bPaused=true'};}},R_S_4_06={'id':'R-S-4-06','category':'lifecycle','trigger':'Service\x20not\x20published\x20(state-only\x20buyer\x20rule)\x20—\x20cannot\x20be\x20ordered','check':a=>{if(a['current_bPublished']!==![])return null;return{'id':'R-S-4-06','level':'HIGH','category':'lifecycle','title':'Service\x20is\x20not\x20published\x20—\x20cannot\x20be\x20ordered','description':'Service.bPublished\x20is\x20false.\x20The\x20Service\x20is\x20still\x20a\x20draft:\x20it\x20is\x20not\x20visible\x20on\x20the\x20market\x20and\x20order_new\x20will\x20fail.','affected_stakeholders':['customer'],'scenario':'Buyer\x20evaluates\x20a\x20draft\x20Service\x20shared\x20out-of-band','mitigation':'Wait\x20until\x20the\x20merchant\x20publishes\x20the\x20Service\x20(publish\x20is\x20irreversible\x20—\x20configuration\x20is\x20locked\x20at\x20that\x20point).','evidence':'bPublished=false'};}},R_S_5_01={'id':'R-S-5-01','category':'cross_object','trigger':'Machine\x20binding\x20—\x20post-publish\x20immutable,\x20Progress\x20inherits','check':a=>{if(a['machine']===undefined)return null;if(a['current_bPublished'])return{'id':'R-S-5-01','level':'HIGH','category':'cross_object','title':'Machine\x20binding\x20immutable\x20post-publish','description':'Service\x20is\x20published;\x20machine\x20cannot\x20be\x20changed.\x20All\x20future\x20Progress\x20objects\x20will\x20use\x20the\x20bound\x20Machine.','affected_stakeholders':['owner'],'scenario':'Owner\x20wants\x20to\x20upgrade\x20workflow\x20post-publish','mitigation':'Create\x20new\x20Service\x20with\x20new\x20Machine.\x20Migrate\x20customers\x20via\x20discounts.','evidence':'machine='+(a['machine']??'(cleared)')};return{'id':'R-S-5-01','level':'MEDIUM','category':'cross_object','title':'Machine\x20binding\x20—\x20verify\x20Machine\x20is\x20published','description':'Binding\x20Machine\x20'+a['machine']+'.\x20Ensure\x20Machine\x20is\x20published\x20(machine::publish)\x20—\x20Service\x20cannot\x20bind\x20unpublished\x20Machine.','affected_stakeholders':['owner'],'scenario':'Owner\x20binds\x20Machine\x20before\x20publishing\x20Service','mitigation':'Verify\x20Machine.bPublished\x20=\x20true\x20before\x20binding.','evidence':'machine='+a['machine']};}},R_S_5_02={'id':'R-S-5-02','category':'cross_object','trigger':'Arbitration\x20binding\x20—\x20required\x20when\x20compensation_fund\x20>\x200','check':a=>{if(!a['arbitrations'])return null;const b=a['current_compensation_fund_balance']??'0';if(BigInt(b)>0x0n&&(a['current_arbitrations_count']??0x0)===0x0)return{'id':'R-S-5-02','level':'HIGH','category':'cross_object','title':'Arbitration\x20required\x20—\x20compensation_fund\x20has\x20balance','description':'compensation_fund\x20balance\x20is\x20'+b+'.\x20Publish\x20will\x20fail\x20(E_ARBITRATION_NOT_SET_WITH_COMPENSATION_FUND)\x20until\x20arbitrations\x20is\x20non-empty.','affected_stakeholders':['owner'],'scenario':'Owner\x20deposits\x20compensation_fund\x20without\x20configuring\x20arbitrations','mitigation':'Add\x20at\x20least\x201\x20Arbitration\x20object\x20before\x20publish.','evidence':'compensation_fund='+b};return null;}},R_S_5_03={'id':'R-S-5-03','category':'cross_object','trigger':'order_allocators\x20binding\x20—\x20publish\x20prerequisite,\x20post-publish\x20immutable','check':a=>{if(a['order_allocators']===undefined)return null;if(a['current_bPublished'])return{'id':'R-S-5-03','level':'HIGH','category':'cross_object','title':'order_allocators\x20immutable\x20post-publish','description':'Service\x20is\x20published;\x20order_allocators\x20cannot\x20be\x20changed.\x20Fund\x20distribution\x20strategy\x20is\x20permanently\x20locked.','affected_stakeholders':['owner'],'scenario':'Owner\x20wants\x20to\x20adjust\x20fee\x20split\x20post-publish','mitigation':'Create\x20new\x20Service\x20with\x20new\x20allocators.\x20Cannot\x20migrate\x20existing\x20Orders.','evidence':'order_allocators='+(a['order_allocators']?'(set)':'(cleared)')};if(a['publish']&&!a['order_allocators'])return{'id':'R-S-5-03','level':'CRITICAL','category':'cross_object','title':'Publish\x20without\x20order_allocators\x20—\x20will\x20fail','description':'Publish\x20will\x20abort\x20with\x20E_NO_ALLOCATOR.\x20order_allocators\x20is\x20a\x20mandatory\x20publish\x20prerequisite.','affected_stakeholders':['owner'],'scenario':'Owner\x20attempts\x20publish\x20without\x20configuring\x20allocators','mitigation':'Set\x20order_allocators\x20before\x20publish.','evidence':'order_allocators=null'};return null;}},R_S_5_04={'id':'R-S-5-04','category':'cross_object','trigger':'Repository/Reward\x20binding\x20—\x20verify\x20object\x20types\x20before\x20adding','check':a=>{if(a['repositories']&&(a['repositories']['op']==='add'||a['repositories']['op']==='set'))return{'id':'R-S-5-04','level':'LOW','category':'cross_object','title':'Repository\x20binding\x20—\x20verify\x20object\x20types','description':'Adding\x20'+a['repositories']['objects']['length']+'\x20repositories.\x20SDK\x20uses\x20queryObjectsWithType\x20to\x20validate\x20each\x20is\x20ObjectType.Repository\x20before\x20binding.','affected_stakeholders':['owner'],'scenario':'Owner\x20adds\x20non-Repository\x20object\x20by\x20mistake','mitigation':'Use\x20LocalMark\x20names\x20or\x20addresses\x20that\x20are\x20confirmed\x20Repository\x20objects.','evidence':'objects='+a['repositories']['objects']['length']};if(a['rewards']&&(a['rewards']['op']==='add'||a['rewards']['op']==='set'))return{'id':'R-S-5-04','level':'LOW','category':'cross_object','title':'Reward\x20binding\x20—\x20verify\x20object\x20types','description':'Adding\x20'+a['rewards']['objects']['length']+'\x20rewards.\x20SDK\x20validates\x20ObjectType.Reward.\x20add\x20is\x20always\x20allowed;\x20only\x20remove/clear\x20are\x20time-locked\x20after\x20publish.','affected_stakeholders':['owner'],'scenario':'Owner\x20adds\x20Reward\x20objects','mitigation':'Verify\x20Reward\x20objects\x20exist\x20and\x20are\x20active.\x20Remember\x20that\x20removing\x20them\x20later\x20requires\x20pause\x20+\x20setting_lock_duration\x20elapsed.','evidence':'objects='+a['rewards']['objects']['length']};return null;}},R_S_5_05={'id':'R-S-5-05','category':'cross_object','trigger':'compensation_fund\x20has\x20balance\x20but\x20no\x20Arbitration\x20bound\x20(state-only\x20buyer\x20rule)','check':a=>{const b=a['current_compensation_fund_balance'];if(b===undefined)return null;let c;try{c=BigInt(b);}catch{return null;}if(c>0x0n&&(a['current_arbitrations_count']??0x0)===0x0)return{'id':'R-S-5-05','level':'HIGH','category':'cross_object','title':'Compensation\x20fund\x20without\x20Arbitration\x20—\x20fund\x20is\x20unclaimable','description':'compensation_fund\x20balance\x20is\x20'+b+'\x20but\x20no\x20Arbitration\x20object\x20is\x20bound.\x20Compensation\x20is\x20claimed\x20via\x20dispute\x20→\x20arbitration()\x20ruling\x20with\x20indemnity\x20→\x20arb_withdraw;\x20without\x20an\x20Arbitration\x20binding\x20there\x20is\x20no\x20dispute\x20path\x20to\x20trigger\x20a\x20payout.','affected_stakeholders':['customer','owner'],'scenario':'Buyer\x20sees\x20a\x20compensation\x20fund\x20but\x20no\x20dispute\x20path\x20to\x20claim\x20it','mitigation':'Require\x20the\x20merchant\x20to\x20bind\x20at\x20least\x20one\x20Arbitration\x20object\x20before\x20ordering.','evidence':'compensation_fund='+b+',\x20arbitrations=0'};return null;}},ALL_RULES=[R_S_1_01,R_S_1_02,R_S_1_03,R_S_1_04,R_S_1_05,R_S_2_01,R_S_2_02,R_S_2_03,R_S_2_04,R_S_2_05,R_S_3_01,R_S_3_02,R_S_3_03,R_S_3_04,R_S_4_01,R_S_4_02,R_S_4_03,R_S_4_04,R_S_4_05,R_S_4_06,R_S_5_01,R_S_5_02,R_S_5_03,R_S_5_04,R_S_5_05];export const SERVICE_RISK_VERSION='1.1.0';export const SERVICE_STATE_RULE_IDS=['R-S-4-05','R-S-4-06','R-S-5-05'];export function assessServiceStateRisks(a){const b=new Set(SERVICE_STATE_RULE_IDS),c=[];for(const d of ALL_RULES){if(!b['has'](d['id']))continue;const e=d['check'](a);if(e)c['push'](e);}return c;}export function getAllServiceRiskRules(){return[...ALL_RULES];}export function getServiceRiskRulesCount(){return ALL_RULES['length'];}export function getServiceRiskRulesByCategory(a){return ALL_RULES['filter'](b=>b['category']===a);}export function assessServiceRisks(a){const b=[];for(const f of ALL_RULES){const g=f['check'](a);if(g)b['push'](g);}const c=b['length']===0x0?'LOW':b['some'](h=>h['level']==='CRITICAL')?'CRITICAL':b['some'](h=>h['level']==='HIGH')?'HIGH':b['some'](h=>h['level']==='MEDIUM')?'MEDIUM':'LOW',d={};for(const h of b){d[h['category']]=(d[h['category']]??0x0)+0x1;}const e={};for(const i of b){for(const j of i['affected_stakeholders']){if(!e[j])e[j]=[];e[j]['push'](i['id']+':\x20'+i['mitigation']);}}return{'summary':'Assessed\x20'+b['length']+'\x20risk(s)\x20across\x20'+Object['keys'](d)['length']+'\x20categories','risks':b,'overall_risk':c,'risks_by_category':d,'stakeholder_advice':e,'needs_human_review':b['some'](k=>k['level']==='CRITICAL'||k['level']==='HIGH')};}
|
|
@@ -35,5 +35,7 @@ export interface FillServiceTemplateResult {
|
|
|
35
35
|
body?: object;
|
|
36
36
|
error?: string;
|
|
37
37
|
missing_required?: string[];
|
|
38
|
+
pricing_note?: string;
|
|
38
39
|
}
|
|
40
|
+
export declare const SERVICE_PRICING_NOTE = "Pricing coin: prices in the generated body are denominated in the object's type_parameter token (default 0x2::wow::WOW), which is FIXED at creation \u2014 buyers must hold that exact token to order. To price in a different token, pass its full type (from wowok_buildin_info 'mainnet bridge tokens' wowTypeTag) as type_parameter BEFORE creating. Testnet has ONLY WOW (no stablecoins are bridged); multi-token pricing is a mainnet capability.";
|
|
39
41
|
export declare function fillServiceTemplate(templateId: string, params: Record<string, string | number | string[] | object>): FillServiceTemplateResult;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export const SERVICE_TEMPLATES=[{'id':'T-S-01','name':'Retail\x20e-commerce\x20Service','description':'Standard\x20retail\x20shop\x20with\x20multiple\x20SKUs,\x20WIP-verified\x20products,\x20owner-only\x20allocation','applicable_scenes':['service_retail','service_buy_guard'],'industry_tags':['retail','ecommerce','digital_goods'],'params':[{'name':'owner_address','type':'address','description':'Service\x20owner\x20address\x20(receives\x20payments)','required':!![]},{'name':'permission_address','type':'address','description':'Permission\x20object\x20address\x20(must\x20be\x20owned\x20by\x20owner)','required':!![]},{'name':'description','type':'string','description':'Shop\x20description','required':!![]},{'name':'location','type':'string','description':'Service\x20geographic\x20location\x20(city/region)','required':![],'default':''},{'name':'sales_items','type':'object','description':'Array\x20of\x20{name,\x20price,\x20stock,\x20wip,\x20wip_hash}','required':!![]},{'name':'buy_guard_address','type':'address','description':'Buyer\x20eligibility\x20Guard\x20(null\x20for\x20public\x20sale)','required':![],'default':''}],'body':a=>{const b={'object':null,'description':a['description'],'permission':a['permission_address'],'location':a['location']||undefined,'sales':{'op':'add','sales':a['sales_items']},'order_allocators':[{'threshold':'0','sharing':[{'who':{'Object':a['owner_address']},'weight':0x64}]}]};if(a['buy_guard_address'])b['buy_guard']=a['buy_guard_address'];return b;},'notes':['WIP\x20hash\x20is\x20MANDATORY\x20for\x20tamper\x20protection\x20—\x20never\x20leave\x20empty\x20if\x20wip\x20URL\x20is\x20set','Use\x20buy_guard\x20for\x20pre-sale\x20whitelist\x20phase,\x20then\x20clear\x20for\x20public\x20sale','Single-recipient\x20allocation\x20(owner\x20100%)\x20—\x20use\x20T-S-08\x20for\x20multi-party\x20split'],'post_publish_considerations':['machine/arbitrations/order_allocators\x20become\x20immutable\x20—\x20verify\x20before\x20publish','Sales\x20can\x20still\x20be\x20added/removed/updated\x20post-publish','buy_guard\x20can\x20be\x20changed\x20post-publish\x20(unusual\x20exception)']},{'id':'T-S-02','name':'Rental\x20Service\x20(deposit\x20+\x20use\x20+\x20return)','description':'Equipment/asset\x20rental\x20with\x20deposit\x20guarantee,\x20Machine\x20workflow,\x20and\x20arbitration','applicable_scenes':['service_rental'],'industry_tags':['rental','equipment','real_estate'],'params':[{'name':'owner_address','type':'address','description':'Service\x20owner\x20(rental\x20company)','required':!![]},{'name':'permission_address','type':'address','description':'Permission\x20object\x20address','required':!![]},{'name':'description','type':'string','description':'Rental\x20service\x20description','required':!![]},{'name':'machine_address','type':'address','description':'Published\x20Machine\x20with\x20Reserve→Pay→Pickup→Return→Refund\x20nodes','required':!![]},{'name':'arbitration_address','type':'address','description':'Arbitration\x20for\x20deposit\x20disputes','required':!![]},{'name':'rental_items','type':'object','description':'Array\x20of\x20{name,\x20price,\x20stock=1,\x20wip,\x20wip_hash}','required':!![]},{'name':'compensation_fund_balance','type':'string','description':'Initial\x20deposit\x20to\x20compensation_fund\x20(in\x20base\x20units)','required':![],'default':'0'}],'body':a=>({'object':null,'description':a['description'],'permission':a['permission_address'],'machine':a['machine_address'],'arbitrations':{'op':'add','objects':[a['arbitration_address']]},'sales':{'op':'add','sales':a['rental_items']},'order_allocators':[{'threshold':'0','sharing':[{'who':{'Object':a['owner_address']},'weight':0x64}]}],'compensation_fund_add':a['compensation_fund_balance']&&a['compensation_fund_balance']!=='0'?{'balance':a['compensation_fund_balance']}:undefined}),'notes':['stock=1\x20per\x20rental\x20item\x20(unique\x20items)\x20—\x20once\x20rented,\x20stock\x20becomes\x200','Machine\x20must\x20define\x20deposit/return/refund\x20nodes\x20for\x20proper\x20rental\x20flow','compensation_fund\x20holds\x20deposit\x20guarantees\x20—\x20separate\x20from\x20rental\x20fee','Arbitration\x20required\x20if\x20compensation_fund\x20>\x200\x20(F-S-19)'],'post_publish_considerations':['Machine\x20binding\x20is\x20permanent\x20—\x20verify\x20workflow\x20before\x20publish','Arbitration\x20binding\x20is\x20permanent\x20—\x20choose\x20reputable\x20arbiters','Sales\x20can\x20be\x20updated\x20(add\x20new\x20rental\x20items,\x20remove\x20deprecated\x20ones)']},{'id':'T-S-03','name':'Subscription\x20Service\x20(tiered\x20plans)','description':'Recurring-access\x20service\x20with\x20tiered\x20plans\x20(Free/Pro/Enterprise),\x20discount\x20coupons,\x20loyalty\x20rewards','applicable_scenes':['service_subscription'],'industry_tags':['subscription','saas','membership'],'params':[{'name':'owner_address','type':'address','description':'Service\x20owner','required':!![]},{'name':'permission_address','type':'address','description':'Permission\x20object\x20address','required':!![]},{'name':'description','type':'string','description':'Subscription\x20service\x20description','required':!![]},{'name':'tier_plans','type':'object','description':'Array\x20of\x20{name,\x20price,\x20stock=999999,\x20wip,\x20wip_hash}\x20for\x20each\x20tier','required':!![]},{'name':'trial_discount_count','type':'number','description':'Number\x20of\x20trial\x20discount\x20coupons\x20to\x20issue','required':![],'default':0x0},{'name':'reward_address','type':'address','description':'Loyalty\x20Reward\x20object\x20address\x20(optional)','required':![],'default':''}],'body':a=>{const b={'object':null,'description':a['description'],'permission':a['permission_address'],'sales':{'op':'add','sales':a['tier_plans']},'order_allocators':[{'threshold':'0','sharing':[{'who':{'Object':a['owner_address']},'weight':0x64}]}]};return a['reward_address']&&(b['rewards']={'op':'add','objects':[a['reward_address']]}),b;},'notes':['Subscription\x20renewals\x20are\x20handled\x20by\x20repeat\x20orders\x20(no\x20native\x20recurring\x20billing)','Use\x20large\x20stock\x20values\x20(e.g.\x20999999)\x20since\x20subscriptions\x20are\x20not\x20inventory-limited','Trial\x20discounts:\x20issue\x20via\x20service::discount\x20(312)\x20post-publish','Loyalty\x20rewards:\x20bind\x20via\x20service::reward_add\x20(318)\x20—\x20locked\x20by\x20setting_lock_duration'],'post_publish_considerations':['Tier\x20prices\x20can\x20be\x20updated\x20via\x20sales_set\x20(existing\x20subscribers\x20unaffected)','Discount\x20coupons\x20can\x20be\x20issued/destroyed\x20post-publish','Rewards\x20can\x20be\x20added\x20but\x20removal\x20locked\x20by\x20duration']},{'id':'T-S-04','name':'Workflow-bound\x20Service\x20(machine-driven\x20delivery)','description':'Service\x20with\x20multi-step\x20delivery\x20workflow\x20(e.g.\x20freelance,\x20custom\x20manufacturing,\x20course)','applicable_scenes':['service_workflow','service_rental'],'industry_tags':['workflow','freelance','manufacturing','education'],'params':[{'name':'owner_address','type':'address','description':'Service\x20owner\x20(provider)','required':!![]},{'name':'permission_address','type':'address','description':'Permission\x20object\x20address','required':!![]},{'name':'description','type':'string','description':'Service\x20description','required':!![]},{'name':'machine_address','type':'address','description':'Published\x20Machine\x20with\x20Pay→Confirm→Deliver→Sign-off\x20nodes','required':!![]},{'name':'service_items','type':'object','description':'Array\x20of\x20{name,\x20price,\x20stock,\x20wip,\x20wip_hash}','required':!![]},{'name':'customer_required','type':'string[]','description':'Required\x20info\x20fields\x20(e.g.\x20[\x27name\x27,\x27project_brief\x27])','required':![],'default':[]}],'body':a=>({'object':null,'description':a['description'],'permission':a['permission_address'],'machine':a['machine_address'],'sales':{'op':'add','sales':a['service_items']},'customer_required':a['customer_required'],'order_allocators':[{'threshold':'0','sharing':[{'who':{'Object':a['owner_address']},'weight':0x64}]}]}),'notes':['Machine\x20MUST\x20be\x20published\x20before\x20binding\x20(machine::publish)','Each\x20order\x20creates\x20a\x20Progress\x20object\x20tracking\x20the\x20workflow','Named\x20operators\x20can\x20be\x20assigned\x20per\x20Forward\x20in\x20the\x20Machine','Service.bPaused\x20does\x20NOT\x20affect\x20already-created\x20Progress\x20(existing\x20orders\x20continue)'],'post_publish_considerations':['Machine\x20binding\x20is\x20PERMANENT\x20—\x20cannot\x20upgrade\x20workflow\x20post-publish','To\x20change\x20workflow:\x20clone\x20Service\x20with\x20new\x20Machine,\x20migrate\x20customers\x20via\x20discounts','customer_required\x20fields\x20can\x20be\x20updated\x20post-publish']},{'id':'T-S-05','name':'Arbitration-bound\x20Service\x20(dispute-ready)','description':'Service\x20with\x20multiple\x20Arbitration\x20objects\x20for\x20different\x20dispute\x20scopes\x20+\x20compensation_fund','applicable_scenes':['service_arbitration','service_arbitration_binding'],'industry_tags':['arbitration','dispute_resolution','high_value'],'params':[{'name':'owner_address','type':'address','description':'Service\x20owner','required':!![]},{'name':'permission_address','type':'address','description':'Permission\x20object\x20address','required':!![]},{'name':'description','type':'string','description':'Service\x20description','required':!![]},{'name':'arbitration_addresses','type':'string[]','description':'1-3\x20Arbitration\x20object\x20addresses\x20(different\x20scopes)','required':!![]},{'name':'compensation_fund_balance','type':'string','description':'Initial\x20compensation_fund\x20deposit\x20(base\x20units)','required':!![]},{'name':'setting_lock_duration_ms','type':'number','description':'Initial\x20setting_lock_duration\x20in\x20ms\x20(default\x2030\x20days)','required':![],'default':0x9a7ec800},{'name':'service_items','type':'object','description':'Array\x20of\x20{name,\x20price,\x20stock,\x20wip,\x20wip_hash}','required':!![]}],'body':a=>({'object':null,'description':a['description'],'permission':a['permission_address'],'arbitrations':{'op':'add','objects':a['arbitration_addresses']},'compensation_fund_add':{'balance':a['compensation_fund_balance']},'setting_lock_duration_add':a['setting_lock_duration_ms'],'sales':{'op':'add','sales':a['service_items']},'order_allocators':[{'threshold':'0','sharing':[{'who':{'Object':a['owner_address']},'weight':0x64}]}]}),'notes':['Use\x202-3\x20Arbitration\x20objects:\x20e.g.\x20one\x20for\x20quality\x20disputes,\x20one\x20for\x20delivery\x20disputes','compensation_fund\x20>\x200\x20REQUIRES\x20arbitrations\x20non-empty\x20(F-S-19,\x20E_ARBITRATION_NOT_SET_WITH_COMPENSATION_FUND)','compensation_fund\x20coin\x20type\x20MUST\x20match\x20Service<T>\x20type\x20parameter','setting_lock_duration\x20protects\x20customers\x20—\x20only-increase\x20mechanism'],'post_publish_considerations':['Arbitration\x20bindings\x20are\x20PERMANENT\x20—\x20verify\x20arb\x20reputation\x20before\x20publish','compensation_fund_add\x20(deposit)\x20is\x20always\x20mutable\x20post-publish','compensation_fund_withdraw\x20requires\x20bPaused=true\x20+\x20lock_duration\x20expired','Cannot\x20add\x20new\x20Arbitration\x20post-publish\x20—\x20only\x20pre-publish']},{'id':'T-S-06','name':'Compensation\x20fund\x20Service\x20(embedded\x20Balance<T>)','description':'Service\x20focused\x20on\x20compensation_fund\x20management\x20—\x20emphasizes\x20distinction\x20from\x20Treasury','applicable_scenes':['service_compensation_fund','service_arbitration'],'industry_tags':['finance','escrow','guarantee'],'params':[{'name':'owner_address','type':'address','description':'Service\x20owner','required':!![]},{'name':'permission_address','type':'address','description':'Permission\x20object\x20address','required':!![]},{'name':'description','type':'string','description':'Service\x20description','required':!![]},{'name':'arbitration_addresses','type':'string[]','description':'Arbitration\x20objects\x20(required\x20when\x20fund\x20>\x200)','required':!![]},{'name':'initial_deposit','type':'string','description':'Initial\x20compensation_fund\x20deposit\x20(base\x20units)','required':!![]},{'name':'lock_duration_ms','type':'number','description':'setting_lock_duration\x20(ms)','required':![],'default':0x9a7ec800},{'name':'service_items','type':'object','description':'Sales\x20items','required':!![]}],'body':a=>({'object':null,'description':a['description'],'permission':a['permission_address'],'arbitrations':{'op':'add','objects':a['arbitration_addresses']},'compensation_fund_add':{'balance':a['initial_deposit']},'setting_lock_duration_add':a['lock_duration_ms'],'sales':{'op':'add','sales':a['service_items']},'order_allocators':[{'threshold':'0','sharing':[{'who':{'Object':a['owner_address']},'weight':0x64}]}]}),'notes':['⚠️\x20compensation_fund\x20is\x20INTERNAL\x20Balance<T>\x20—\x20distinct\x20from\x20Treasury\x20(external)','Treasury\x20is\x20referenced\x20via\x20order_allocators.sharing.who=Entity\x20(Treasury\x20address)','compensation_fund\x20is\x20consumed\x20by\x20arbitration::compensation_claim\x20(driven\x20by\x20arb\x20result)','Owner\x20can\x20only\x20withdraw\x20via\x20compensation_fund_withdraw\x20(requires\x20paused\x20+\x20lock\x20expired)'],'post_publish_considerations':['Deposits\x20(compensation_fund_add)\x20always\x20allowed','Withdrawals\x20(compensation_fund_withdraw)\x20require\x20bPaused=true\x20+\x20lock_duration\x20expired','Receive\x20(compensation_fund_receive)\x20locked\x20by\x20duration','setting_lock_duration\x20only-increase\x20—\x20plan\x20withdrawal\x20timeline\x20carefully']},{'id':'T-S-07','name':'Dynamic\x20pricing\x20Service\x20(discount-driven)','description':'Service\x20with\x20promotional\x20discount\x20coupons\x20—\x20supports\x20rates\x20(basis\x20points,\x20per\x2010000)\x20and\x20minus\x20(direct\x20deduction)\x20types','applicable_scenes':['service_dynamic_pricing'],'industry_tags':['retail','marketing','promotion'],'params':[{'name':'owner_address','type':'address','description':'Service\x20owner','required':!![]},{'name':'permission_address','type':'address','description':'Permission\x20object\x20address','required':!![]},{'name':'description','type':'string','description':'Service\x20description','required':!![]},{'name':'service_items','type':'object','description':'Array\x20of\x20{name,\x20price,\x20stock,\x20wip,\x20wip_hash}','required':!![]},{'name':'discount_specs','type':'object','description':'Array\x20of\x20{name,\x20type,\x20data,\x20count,\x20expire_at}\x20for\x20initial\x20discounts','required':![],'default':[]}],'body':a=>({'object':null,'description':a['description'],'permission':a['permission_address'],'sales':{'op':'add','sales':a['service_items']},'order_allocators':[{'threshold':'0','sharing':[{'who':{'Object':a['owner_address']},'weight':0x64}]}]}),'notes':['Discounts\x20are\x20issued\x20POST-PUBLISH\x20via\x20service::discount\x20(312)\x20—\x20not\x20in\x20create\x20body','discount_type=0\x20rates\x20(basis\x20points,\x20e.g.\x201000=10%);\x201=minus\x20(direct\x20deduction,\x20base\x20units)','MAX_DISCOUNT_COUNT_ONCE\x20=\x201000\x20per\x20issue\x20call','MAX_DISCOUNT_RECEIVER_ONCE\x20=\x201000\x20receivers\x20per\x20call','MAX_DISCOUNT_TOTAL_COUNT\x20=\x2020000\x20total\x20coupons\x20per\x20Service','discount_destroy\x20is\x20holder-only\x20(no\x20SERVICE_DISCOUNT\x20permission\x20needed)'],'post_publish_considerations':['Discount\x20coupons\x20can\x20be\x20issued/destroyed\x20freely','Sales\x20prices\x20can\x20be\x20updated\x20via\x20sales_set\x20(existing\x20orders\x20unaffected)','Track\x20discount\x20usage\x20to\x20avoid\x20stockout\x20of\x20promotional\x20items']},{'id':'T-S-08','name':'Multi-allocator\x20Service\x20(tiered\x20fund\x20distribution)','description':'Service\x20with\x20multiple\x20allocator\x20tiers\x20—\x20first-match-wins\x20distribution\x20based\x20on\x20order\x20value','applicable_scenes':['service_multi_allocator','service_order_allocator','service_reward'],'industry_tags':['marketplace','platform','logistics'],'params':[{'name':'owner_address','type':'address','description':'Service\x20owner\x20(merchant)','required':!![]},{'name':'permission_address','type':'address','description':'Permission\x20object\x20address','required':!![]},{'name':'description','type':'string','description':'Service\x20description','required':!![]},{'name':'platform_address','type':'address','description':'Platform\x20fee\x20recipient','required':!![]},{'name':'logistics_address','type':'address','description':'Logistics\x20fee\x20recipient\x20(optional)','required':![],'default':''},{'name':'service_items','type':'object','description':'Array\x20of\x20{name,\x20price,\x20stock,\x20wip,\x20wip_hash}','required':!![]},{'name':'tier1_threshold','type':'string','description':'Small\x20order\x20threshold\x20(base\x20units,\x20e.g.\x20\x270\x27)','required':![],'default':'0'},{'name':'tier2_threshold','type':'string','description':'Medium\x20order\x20threshold\x20(base\x20units)','required':![],'default':'10000000000'},{'name':'tier3_threshold','type':'string','description':'Large\x20order\x20threshold\x20(base\x20units)','required':![],'default':'100000000000'}],'body':a=>{const b=[{'threshold':a['tier1_threshold'],'sharing':[{'who':{'Object':a['owner_address']},'weight':0x5a},{'who':{'Object':a['platform_address']},'weight':0xa}]},{'threshold':a['tier2_threshold'],'sharing':a['logistics_address']?[{'who':{'Object':a['owner_address']},'weight':0x50},{'who':{'Object':a['platform_address']},'weight':0xa},{'who':{'Object':a['logistics_address']},'weight':0xa}]:[{'who':{'Object':a['owner_address']},'weight':0x55},{'who':{'Object':a['platform_address']},'weight':0xf}]},{'threshold':a['tier3_threshold'],'sharing':a['logistics_address']?[{'who':{'Object':a['owner_address']},'weight':0x46},{'who':{'Object':a['platform_address']},'weight':0xa},{'who':{'Object':a['logistics_address']},'weight':0x14}]:[{'who':{'Object':a['owner_address']},'weight':0x50},{'who':{'Object':a['platform_address']},'weight':0x14}]}];return{'object':null,'description':a['description'],'permission':a['permission_address'],'sales':{'op':'add','sales':a['service_items']},'order_allocators':b};},'notes':['First-match-wins:\x20first\x20allocator\x20whose\x20threshold\x20<=\x20order\x20value\x20handles\x20distribution','Each\x20tier\x20can\x20have\x20its\x20own\x20Guard\x20for\x20execution\x20authorization\x20(optional)','Thresholds\x20must\x20be\x20ascending\x20(tier1\x20<\x20tier2\x20<\x20tier3)','MAX_SHARING_COUNT\x20=\x20100\x20per\x20allocator\x20(sum\x20of\x20sharing\x20entries)','Treasury\x20addresses\x20can\x20be\x20referenced\x20via\x20sharing.who=Entity\x20(Treasury\x20object)'],'post_publish_considerations':['⚠️\x20order_allocators\x20is\x20IMMUTABLE\x20post-publish\x20(F-S-22)\x20—\x20verify\x20tiers\x20before\x20publish','To\x20change\x20fee\x20split:\x20clone\x20Service\x20with\x20new\x20allocators\x20(cannot\x20migrate\x20existing\x20Orders)','Sales\x20can\x20still\x20be\x20updated\x20post-publish\x20(only\x20allocator\x20is\x20locked)']},{'id':'T-S-09','name':'Supply\x20Chain\x20Sub-order\x20Service\x20(milestone\x20unlock\x20via\x20buy_guard)','description':'Sub-service\x20whose\x20buy_guard\x20verifies\x20the\x20user\x20purchased\x20the\x20main\x20service\x20order.\x20Each\x20milestone\x20=\x20one\x20sub-order.\x20Enables\x20supply\x20chain\x20composition:\x20main\x20service\x20→\x20multiple\x20sub-services\x20with\x20conditional\x20access.','applicable_scenes':['service_buy_guard'],'industry_tags':['travel','rental','education','freelance','ecommerce','supply_chain'],'params':[{'name':'owner_address','type':'address','description':'Sub-service\x20owner\x20address','required':!![]},{'name':'permission_address','type':'address','description':'Permission\x20object\x20address','required':!![]},{'name':'description','type':'string','description':'Sub-service\x20description\x20(e.g.,\x20\x27Hotel\x20booking\x20for\x20tour\x20package\x20X\x27)','required':!![]},{'name':'main_service_address','type':'address','description':'Main\x20Service\x20object\x20address\x20(the\x20parent\x20service)','required':!![]},{'name':'buy_guard_address','type':'address','description':'Guard\x20address\x20verifying\x20main\x20order\x20ownership\x20(order.owner==Signer\x20AND\x20order.service==main_service)','required':!![]},{'name':'price','type':'number','description':'Sub-service\x20price','required':!![]},{'name':'machine_address','type':'address','description':'Machine\x20object\x20for\x20sub-order\x20workflow','required':!![]}],'body':a=>({'object':null,'description':a['description'],'service_type':'supply_chain_sub','buy_guard':a['buy_guard_address'],'price':a['price'],'machine':a['machine_address'],'permission':a['permission_address']}),'notes':['VERIFIED:\x20service.move#L173\x20(buy_guard:\x20Option<address>),\x20L263-268\x20(buy_with_passport\x20evaluates\x20buy_guard)','VERIFIER-EVIDENCE\x20DESIGN:\x20user\x20submits\x20main\x20Order\x20as\x20evidence\x20(b_submission=true),\x20buy_guard\x20verifies\x20order.owner==Signer\x20AND\x20order.service==main_service_address','No\x20parent_order\x20field\x20needed\x20—\x20relationship\x20verified\x20via\x20buy_guard\x20querying\x20submitted\x20Order\x20fields','Each\x20milestone\x20=\x20one\x20sub-order\x20with\x20its\x20own\x20Service\x20+\x20buy_guard\x20+\x20Machine','Main\x20flow\x20Machine\x20can\x20branch\x20to\x20different\x20sub-services\x20based\x20on\x20node\x20progression','Use\x20tpl_buy_guard_order_holder\x20(guard-templates.ts)\x20for\x20the\x20buy_guard\x20design'],'post_publish_considerations':['buy_guard\x20is\x20mutable\x20post-publish\x20(can\x20update\x20the\x20guard\x20address)','If\x20main\x20service\x20is\x20unpublished,\x20sub-service\x20buy_guard\x20will\x20fail\x20(order.service\x20won\x27t\x20match)','Consider\x20publishing\x20main\x20service\x20before\x20sub-services']}];export const SERVICE_TEMPLATES_VERSION='1.0.0';export function getAllServiceTemplates(){return[...SERVICE_TEMPLATES];}export function getServiceTemplateById(a){return SERVICE_TEMPLATES['find'](b=>b['id']===a);}export function getServiceTemplatesByScene(a){return SERVICE_TEMPLATES['filter'](b=>b['applicable_scenes']['includes'](a));}export function getServiceTemplatesByIndustry(a){return SERVICE_TEMPLATES['filter'](b=>b['industry_tags']['includes'](a)||b['industry_tags']['includes']('universal'));}export function suggestServiceTemplateForScene(a){const b=getServiceTemplatesByScene(a);return b['length']>0x0?b[0x0]:undefined;}export function listServiceTemplates(){return SERVICE_TEMPLATES['map'](a=>({'id':a['id'],'name':a['name'],'description':a['description'],'scenes':a['applicable_scenes']}));}export function fillServiceTemplate(a,b){const c=getServiceTemplateById(a);if(!c)return{'ok':![],'error':'Template\x20'+a+'\x20not\x20found'};const d=[];for(const f of c['params']){f['required']&&!(f['name']in b)&&d['push'](f['name']);}if(d['length']>0x0)return{'ok':![],'error':'Missing\x20required\x20params:\x20'+d['join'](',\x20'),'missing_required':d};const e={...b};for(const g of c['params']){!(g['name']in e)&&g['default']!==undefined&&(e[g['name']]=g['default']);}return{'ok':!![],'body':c['body'](e)};}
|
|
1
|
+
export const SERVICE_TEMPLATES=[{'id':'T-S-01','name':'Retail\x20e-commerce\x20Service','description':'Standard\x20retail\x20shop\x20with\x20multiple\x20SKUs,\x20WIP-verified\x20products,\x20owner-only\x20allocation','applicable_scenes':['service_retail','service_buy_guard'],'industry_tags':['retail','ecommerce','digital_goods'],'params':[{'name':'owner_address','type':'address','description':'Service\x20owner\x20address\x20(receives\x20payments)','required':!![]},{'name':'permission_address','type':'address','description':'Permission\x20object\x20address\x20(must\x20be\x20owned\x20by\x20owner)','required':!![]},{'name':'description','type':'string','description':'Shop\x20description','required':!![]},{'name':'location','type':'string','description':'Service\x20geographic\x20location\x20(city/region)','required':![],'default':''},{'name':'sales_items','type':'object','description':'Array\x20of\x20{name,\x20price,\x20stock,\x20wip,\x20wip_hash}','required':!![]},{'name':'buy_guard_address','type':'address','description':'Buyer\x20eligibility\x20Guard\x20(null\x20for\x20public\x20sale)','required':![],'default':''}],'body':a=>{const b={'object':null,'description':a['description'],'permission':a['permission_address'],'location':a['location']||undefined,'sales':{'op':'add','sales':a['sales_items']},'order_allocators':[{'threshold':'0','sharing':[{'who':{'Object':a['owner_address']},'weight':0x64}]}]};if(a['buy_guard_address'])b['buy_guard']=a['buy_guard_address'];return b;},'notes':['WIP\x20hash\x20is\x20MANDATORY\x20for\x20tamper\x20protection\x20—\x20never\x20leave\x20empty\x20if\x20wip\x20URL\x20is\x20set','Use\x20buy_guard\x20for\x20pre-sale\x20whitelist\x20phase,\x20then\x20clear\x20for\x20public\x20sale','Single-recipient\x20allocation\x20(owner\x20100%)\x20—\x20use\x20T-S-08\x20for\x20multi-party\x20split'],'post_publish_considerations':['machine/arbitrations/order_allocators\x20become\x20immutable\x20—\x20verify\x20before\x20publish','Sales\x20can\x20still\x20be\x20added/removed/updated\x20post-publish','buy_guard\x20can\x20be\x20changed\x20post-publish\x20(unusual\x20exception)']},{'id':'T-S-02','name':'Rental\x20Service\x20(deposit\x20+\x20use\x20+\x20return)','description':'Equipment/asset\x20rental\x20with\x20deposit\x20guarantee,\x20Machine\x20workflow,\x20and\x20arbitration','applicable_scenes':['service_rental'],'industry_tags':['rental','equipment','real_estate'],'params':[{'name':'owner_address','type':'address','description':'Service\x20owner\x20(rental\x20company)','required':!![]},{'name':'permission_address','type':'address','description':'Permission\x20object\x20address','required':!![]},{'name':'description','type':'string','description':'Rental\x20service\x20description','required':!![]},{'name':'machine_address','type':'address','description':'Published\x20Machine\x20with\x20Reserve→Pay→Pickup→Return→Refund\x20nodes','required':!![]},{'name':'arbitration_address','type':'address','description':'Arbitration\x20for\x20deposit\x20disputes','required':!![]},{'name':'rental_items','type':'object','description':'Array\x20of\x20{name,\x20price,\x20stock=1,\x20wip,\x20wip_hash}','required':!![]},{'name':'compensation_fund_balance','type':'string','description':'Initial\x20deposit\x20to\x20compensation_fund\x20(in\x20base\x20units)','required':![],'default':'0'}],'body':a=>({'object':null,'description':a['description'],'permission':a['permission_address'],'machine':a['machine_address'],'arbitrations':{'op':'add','objects':[a['arbitration_address']]},'sales':{'op':'add','sales':a['rental_items']},'order_allocators':[{'threshold':'0','sharing':[{'who':{'Object':a['owner_address']},'weight':0x64}]}],'compensation_fund_add':a['compensation_fund_balance']&&a['compensation_fund_balance']!=='0'?{'balance':a['compensation_fund_balance']}:undefined}),'notes':['stock=1\x20per\x20rental\x20item\x20(unique\x20items)\x20—\x20once\x20rented,\x20stock\x20becomes\x200','Machine\x20must\x20define\x20deposit/return/refund\x20nodes\x20for\x20proper\x20rental\x20flow','compensation_fund\x20holds\x20deposit\x20guarantees\x20—\x20separate\x20from\x20rental\x20fee','Arbitration\x20required\x20if\x20compensation_fund\x20>\x200\x20(F-S-19)'],'post_publish_considerations':['Machine\x20binding\x20is\x20permanent\x20—\x20verify\x20workflow\x20before\x20publish','Arbitration\x20binding\x20is\x20permanent\x20—\x20choose\x20reputable\x20arbiters','Sales\x20can\x20be\x20updated\x20(add\x20new\x20rental\x20items,\x20remove\x20deprecated\x20ones)']},{'id':'T-S-03','name':'Subscription\x20Service\x20(tiered\x20plans)','description':'Recurring-access\x20service\x20with\x20tiered\x20plans\x20(Free/Pro/Enterprise),\x20discount\x20coupons,\x20loyalty\x20rewards','applicable_scenes':['service_subscription'],'industry_tags':['subscription','saas','membership'],'params':[{'name':'owner_address','type':'address','description':'Service\x20owner','required':!![]},{'name':'permission_address','type':'address','description':'Permission\x20object\x20address','required':!![]},{'name':'description','type':'string','description':'Subscription\x20service\x20description','required':!![]},{'name':'tier_plans','type':'object','description':'Array\x20of\x20{name,\x20price,\x20stock=999999,\x20wip,\x20wip_hash}\x20for\x20each\x20tier','required':!![]},{'name':'trial_discount_count','type':'number','description':'Number\x20of\x20trial\x20discount\x20coupons\x20to\x20issue','required':![],'default':0x0},{'name':'reward_address','type':'address','description':'Loyalty\x20Reward\x20object\x20address\x20(optional)','required':![],'default':''}],'body':a=>{const b={'object':null,'description':a['description'],'permission':a['permission_address'],'sales':{'op':'add','sales':a['tier_plans']},'order_allocators':[{'threshold':'0','sharing':[{'who':{'Object':a['owner_address']},'weight':0x64}]}]};return a['reward_address']&&(b['rewards']={'op':'add','objects':[a['reward_address']]}),b;},'notes':['Subscription\x20renewals\x20are\x20handled\x20by\x20repeat\x20orders\x20(no\x20native\x20recurring\x20billing)','Use\x20large\x20stock\x20values\x20(e.g.\x20999999)\x20since\x20subscriptions\x20are\x20not\x20inventory-limited','Trial\x20discounts:\x20issue\x20via\x20service::discount\x20(312)\x20post-publish','Loyalty\x20rewards:\x20bind\x20via\x20service::reward_add\x20(318)\x20—\x20locked\x20by\x20setting_lock_duration'],'post_publish_considerations':['Tier\x20prices\x20can\x20be\x20updated\x20via\x20sales_set\x20(existing\x20subscribers\x20unaffected)','Discount\x20coupons\x20can\x20be\x20issued/destroyed\x20post-publish','Rewards\x20can\x20be\x20added\x20but\x20removal\x20locked\x20by\x20duration']},{'id':'T-S-04','name':'Workflow-bound\x20Service\x20(machine-driven\x20delivery)','description':'Service\x20with\x20multi-step\x20delivery\x20workflow\x20(e.g.\x20freelance,\x20custom\x20manufacturing,\x20course)','applicable_scenes':['service_workflow','service_rental'],'industry_tags':['workflow','freelance','manufacturing','education'],'params':[{'name':'owner_address','type':'address','description':'Service\x20owner\x20(provider)','required':!![]},{'name':'permission_address','type':'address','description':'Permission\x20object\x20address','required':!![]},{'name':'description','type':'string','description':'Service\x20description','required':!![]},{'name':'machine_address','type':'address','description':'Published\x20Machine\x20with\x20Pay→Confirm→Deliver→Sign-off\x20nodes','required':!![]},{'name':'service_items','type':'object','description':'Array\x20of\x20{name,\x20price,\x20stock,\x20wip,\x20wip_hash}','required':!![]},{'name':'customer_required','type':'string[]','description':'Required\x20info\x20fields\x20(e.g.\x20[\x27name\x27,\x27project_brief\x27])','required':![],'default':[]}],'body':a=>({'object':null,'description':a['description'],'permission':a['permission_address'],'machine':a['machine_address'],'sales':{'op':'add','sales':a['service_items']},'customer_required':a['customer_required'],'order_allocators':[{'threshold':'0','sharing':[{'who':{'Object':a['owner_address']},'weight':0x64}]}]}),'notes':['Machine\x20MUST\x20be\x20published\x20before\x20binding\x20(machine::publish)','Each\x20order\x20creates\x20a\x20Progress\x20object\x20tracking\x20the\x20workflow','Named\x20operators\x20can\x20be\x20assigned\x20per\x20Forward\x20in\x20the\x20Machine','Service.bPaused\x20does\x20NOT\x20affect\x20already-created\x20Progress\x20(existing\x20orders\x20continue)'],'post_publish_considerations':['Machine\x20binding\x20is\x20PERMANENT\x20—\x20cannot\x20upgrade\x20workflow\x20post-publish','To\x20change\x20workflow:\x20clone\x20Service\x20with\x20new\x20Machine,\x20migrate\x20customers\x20via\x20discounts','customer_required\x20fields\x20can\x20be\x20updated\x20post-publish']},{'id':'T-S-05','name':'Arbitration-bound\x20Service\x20(dispute-ready)','description':'Service\x20with\x20multiple\x20Arbitration\x20objects\x20for\x20different\x20dispute\x20scopes\x20+\x20compensation_fund','applicable_scenes':['service_arbitration','service_arbitration_binding'],'industry_tags':['arbitration','dispute_resolution','high_value'],'params':[{'name':'owner_address','type':'address','description':'Service\x20owner','required':!![]},{'name':'permission_address','type':'address','description':'Permission\x20object\x20address','required':!![]},{'name':'description','type':'string','description':'Service\x20description','required':!![]},{'name':'arbitration_addresses','type':'string[]','description':'1-3\x20Arbitration\x20object\x20addresses\x20(different\x20scopes)','required':!![]},{'name':'compensation_fund_balance','type':'string','description':'Initial\x20compensation_fund\x20deposit\x20(base\x20units)','required':!![]},{'name':'setting_lock_duration_ms','type':'number','description':'Initial\x20setting_lock_duration\x20in\x20ms\x20(default\x2030\x20days)','required':![],'default':0x9a7ec800},{'name':'service_items','type':'object','description':'Array\x20of\x20{name,\x20price,\x20stock,\x20wip,\x20wip_hash}','required':!![]}],'body':a=>({'object':null,'description':a['description'],'permission':a['permission_address'],'arbitrations':{'op':'add','objects':a['arbitration_addresses']},'compensation_fund_add':{'balance':a['compensation_fund_balance']},'setting_lock_duration_add':a['setting_lock_duration_ms'],'sales':{'op':'add','sales':a['service_items']},'order_allocators':[{'threshold':'0','sharing':[{'who':{'Object':a['owner_address']},'weight':0x64}]}]}),'notes':['Use\x202-3\x20Arbitration\x20objects:\x20e.g.\x20one\x20for\x20quality\x20disputes,\x20one\x20for\x20delivery\x20disputes','compensation_fund\x20>\x200\x20REQUIRES\x20arbitrations\x20non-empty\x20(F-S-19,\x20E_ARBITRATION_NOT_SET_WITH_COMPENSATION_FUND)','compensation_fund\x20coin\x20type\x20MUST\x20match\x20Service<T>\x20type\x20parameter','setting_lock_duration\x20protects\x20customers\x20—\x20only-increase\x20mechanism'],'post_publish_considerations':['Arbitration\x20bindings\x20are\x20PERMANENT\x20—\x20verify\x20arb\x20reputation\x20before\x20publish','compensation_fund_add\x20(deposit)\x20is\x20always\x20mutable\x20post-publish','compensation_fund_withdraw\x20requires\x20bPaused=true\x20+\x20lock_duration\x20expired','Cannot\x20add\x20new\x20Arbitration\x20post-publish\x20—\x20only\x20pre-publish']},{'id':'T-S-06','name':'Compensation\x20fund\x20Service\x20(embedded\x20Balance<T>)','description':'Service\x20focused\x20on\x20compensation_fund\x20management\x20—\x20emphasizes\x20distinction\x20from\x20Treasury','applicable_scenes':['service_compensation_fund','service_arbitration'],'industry_tags':['finance','escrow','guarantee'],'params':[{'name':'owner_address','type':'address','description':'Service\x20owner','required':!![]},{'name':'permission_address','type':'address','description':'Permission\x20object\x20address','required':!![]},{'name':'description','type':'string','description':'Service\x20description','required':!![]},{'name':'arbitration_addresses','type':'string[]','description':'Arbitration\x20objects\x20(required\x20when\x20fund\x20>\x200)','required':!![]},{'name':'initial_deposit','type':'string','description':'Initial\x20compensation_fund\x20deposit\x20(base\x20units)','required':!![]},{'name':'lock_duration_ms','type':'number','description':'setting_lock_duration\x20(ms)','required':![],'default':0x9a7ec800},{'name':'service_items','type':'object','description':'Sales\x20items','required':!![]}],'body':a=>({'object':null,'description':a['description'],'permission':a['permission_address'],'arbitrations':{'op':'add','objects':a['arbitration_addresses']},'compensation_fund_add':{'balance':a['initial_deposit']},'setting_lock_duration_add':a['lock_duration_ms'],'sales':{'op':'add','sales':a['service_items']},'order_allocators':[{'threshold':'0','sharing':[{'who':{'Object':a['owner_address']},'weight':0x64}]}]}),'notes':['⚠️\x20compensation_fund\x20is\x20INTERNAL\x20Balance<T>\x20—\x20distinct\x20from\x20Treasury\x20(external)','Treasury\x20is\x20referenced\x20via\x20order_allocators.sharing.who=Entity\x20(Treasury\x20address)','compensation_fund\x20is\x20consumed\x20by\x20arbitration::compensation_claim\x20(driven\x20by\x20arb\x20result)','Owner\x20can\x20only\x20withdraw\x20via\x20compensation_fund_withdraw\x20(requires\x20paused\x20+\x20lock\x20expired)'],'post_publish_considerations':['Deposits\x20(compensation_fund_add)\x20always\x20allowed','Withdrawals\x20(compensation_fund_withdraw)\x20require\x20bPaused=true\x20+\x20lock_duration\x20expired','Receive\x20(compensation_fund_receive)\x20locked\x20by\x20duration','setting_lock_duration\x20only-increase\x20—\x20plan\x20withdrawal\x20timeline\x20carefully']},{'id':'T-S-07','name':'Dynamic\x20pricing\x20Service\x20(discount-driven)','description':'Service\x20with\x20promotional\x20discount\x20coupons\x20—\x20supports\x20rates\x20(basis\x20points,\x20per\x2010000)\x20and\x20minus\x20(direct\x20deduction)\x20types','applicable_scenes':['service_dynamic_pricing'],'industry_tags':['retail','marketing','promotion'],'params':[{'name':'owner_address','type':'address','description':'Service\x20owner','required':!![]},{'name':'permission_address','type':'address','description':'Permission\x20object\x20address','required':!![]},{'name':'description','type':'string','description':'Service\x20description','required':!![]},{'name':'service_items','type':'object','description':'Array\x20of\x20{name,\x20price,\x20stock,\x20wip,\x20wip_hash}','required':!![]},{'name':'discount_specs','type':'object','description':'Array\x20of\x20{name,\x20type,\x20data,\x20count,\x20expire_at}\x20for\x20initial\x20discounts','required':![],'default':[]}],'body':a=>({'object':null,'description':a['description'],'permission':a['permission_address'],'sales':{'op':'add','sales':a['service_items']},'order_allocators':[{'threshold':'0','sharing':[{'who':{'Object':a['owner_address']},'weight':0x64}]}]}),'notes':['Discounts\x20are\x20issued\x20POST-PUBLISH\x20via\x20service::discount\x20(312)\x20—\x20not\x20in\x20create\x20body','discount_type=0\x20rates\x20(basis\x20points,\x20e.g.\x201000=10%);\x201=minus\x20(direct\x20deduction,\x20base\x20units)','MAX_DISCOUNT_COUNT_ONCE\x20=\x201000\x20per\x20issue\x20call','MAX_DISCOUNT_RECEIVER_ONCE\x20=\x201000\x20receivers\x20per\x20call','MAX_DISCOUNT_TOTAL_COUNT\x20=\x2020000\x20total\x20coupons\x20per\x20Service','discount_destroy\x20is\x20holder-only\x20(no\x20SERVICE_DISCOUNT\x20permission\x20needed)'],'post_publish_considerations':['Discount\x20coupons\x20can\x20be\x20issued/destroyed\x20freely','Sales\x20prices\x20can\x20be\x20updated\x20via\x20sales_set\x20(existing\x20orders\x20unaffected)','Track\x20discount\x20usage\x20to\x20avoid\x20stockout\x20of\x20promotional\x20items']},{'id':'T-S-08','name':'Multi-allocator\x20Service\x20(tiered\x20fund\x20distribution)','description':'Service\x20with\x20multiple\x20allocator\x20tiers\x20—\x20first-match-wins\x20distribution\x20based\x20on\x20order\x20value','applicable_scenes':['service_multi_allocator','service_order_allocator','service_reward'],'industry_tags':['marketplace','platform','logistics'],'params':[{'name':'owner_address','type':'address','description':'Service\x20owner\x20(merchant)','required':!![]},{'name':'permission_address','type':'address','description':'Permission\x20object\x20address','required':!![]},{'name':'description','type':'string','description':'Service\x20description','required':!![]},{'name':'platform_address','type':'address','description':'Platform\x20fee\x20recipient','required':!![]},{'name':'logistics_address','type':'address','description':'Logistics\x20fee\x20recipient\x20(optional)','required':![],'default':''},{'name':'service_items','type':'object','description':'Array\x20of\x20{name,\x20price,\x20stock,\x20wip,\x20wip_hash}','required':!![]},{'name':'tier1_threshold','type':'string','description':'Small\x20order\x20threshold\x20(base\x20units,\x20e.g.\x20\x270\x27)','required':![],'default':'0'},{'name':'tier2_threshold','type':'string','description':'Medium\x20order\x20threshold\x20(base\x20units)','required':![],'default':'10000000000'},{'name':'tier3_threshold','type':'string','description':'Large\x20order\x20threshold\x20(base\x20units)','required':![],'default':'100000000000'}],'body':a=>{const b=[{'threshold':a['tier1_threshold'],'sharing':[{'who':{'Object':a['owner_address']},'weight':0x5a},{'who':{'Object':a['platform_address']},'weight':0xa}]},{'threshold':a['tier2_threshold'],'sharing':a['logistics_address']?[{'who':{'Object':a['owner_address']},'weight':0x50},{'who':{'Object':a['platform_address']},'weight':0xa},{'who':{'Object':a['logistics_address']},'weight':0xa}]:[{'who':{'Object':a['owner_address']},'weight':0x55},{'who':{'Object':a['platform_address']},'weight':0xf}]},{'threshold':a['tier3_threshold'],'sharing':a['logistics_address']?[{'who':{'Object':a['owner_address']},'weight':0x46},{'who':{'Object':a['platform_address']},'weight':0xa},{'who':{'Object':a['logistics_address']},'weight':0x14}]:[{'who':{'Object':a['owner_address']},'weight':0x50},{'who':{'Object':a['platform_address']},'weight':0x14}]}];return{'object':null,'description':a['description'],'permission':a['permission_address'],'sales':{'op':'add','sales':a['service_items']},'order_allocators':b};},'notes':['First-match-wins:\x20first\x20allocator\x20whose\x20threshold\x20<=\x20order\x20value\x20handles\x20distribution','Each\x20tier\x20can\x20have\x20its\x20own\x20Guard\x20for\x20execution\x20authorization\x20(optional)','Thresholds\x20must\x20be\x20ascending\x20(tier1\x20<\x20tier2\x20<\x20tier3)','MAX_SHARING_COUNT\x20=\x20100\x20per\x20allocator\x20(sum\x20of\x20sharing\x20entries)','Treasury\x20addresses\x20can\x20be\x20referenced\x20via\x20sharing.who=Entity\x20(Treasury\x20object)'],'post_publish_considerations':['⚠️\x20order_allocators\x20is\x20IMMUTABLE\x20post-publish\x20(F-S-22)\x20—\x20verify\x20tiers\x20before\x20publish','To\x20change\x20fee\x20split:\x20clone\x20Service\x20with\x20new\x20allocators\x20(cannot\x20migrate\x20existing\x20Orders)','Sales\x20can\x20still\x20be\x20updated\x20post-publish\x20(only\x20allocator\x20is\x20locked)']},{'id':'T-S-09','name':'Supply\x20Chain\x20Sub-order\x20Service\x20(milestone\x20unlock\x20via\x20buy_guard)','description':'Sub-service\x20whose\x20buy_guard\x20verifies\x20the\x20user\x20purchased\x20the\x20main\x20service\x20order.\x20Each\x20milestone\x20=\x20one\x20sub-order.\x20Enables\x20supply\x20chain\x20composition:\x20main\x20service\x20→\x20multiple\x20sub-services\x20with\x20conditional\x20access.','applicable_scenes':['service_buy_guard'],'industry_tags':['travel','rental','education','freelance','ecommerce','supply_chain'],'params':[{'name':'owner_address','type':'address','description':'Sub-service\x20owner\x20address','required':!![]},{'name':'permission_address','type':'address','description':'Permission\x20object\x20address','required':!![]},{'name':'description','type':'string','description':'Sub-service\x20description\x20(e.g.,\x20\x27Hotel\x20booking\x20for\x20tour\x20package\x20X\x27)','required':!![]},{'name':'main_service_address','type':'address','description':'Main\x20Service\x20object\x20address\x20(the\x20parent\x20service)','required':!![]},{'name':'buy_guard_address','type':'address','description':'Guard\x20address\x20verifying\x20main\x20order\x20ownership\x20(order.owner==Signer\x20AND\x20order.service==main_service)','required':!![]},{'name':'price','type':'number','description':'Sub-service\x20price','required':!![]},{'name':'machine_address','type':'address','description':'Machine\x20object\x20for\x20sub-order\x20workflow','required':!![]}],'body':a=>({'object':null,'description':a['description'],'service_type':'supply_chain_sub','buy_guard':a['buy_guard_address'],'price':a['price'],'machine':a['machine_address'],'permission':a['permission_address']}),'notes':['VERIFIED:\x20service.move#L173\x20(buy_guard:\x20Option<address>),\x20L263-268\x20(buy_with_passport\x20evaluates\x20buy_guard)','VERIFIER-EVIDENCE\x20DESIGN:\x20user\x20submits\x20main\x20Order\x20as\x20evidence\x20(b_submission=true),\x20buy_guard\x20verifies\x20order.owner==Signer\x20AND\x20order.service==main_service_address','No\x20parent_order\x20field\x20needed\x20—\x20relationship\x20verified\x20via\x20buy_guard\x20querying\x20submitted\x20Order\x20fields','Each\x20milestone\x20=\x20one\x20sub-order\x20with\x20its\x20own\x20Service\x20+\x20buy_guard\x20+\x20Machine','Main\x20flow\x20Machine\x20can\x20branch\x20to\x20different\x20sub-services\x20based\x20on\x20node\x20progression','Use\x20tpl_buy_guard_order_holder\x20(guard-templates.ts)\x20for\x20the\x20buy_guard\x20design'],'post_publish_considerations':['buy_guard\x20is\x20mutable\x20post-publish\x20(can\x20update\x20the\x20guard\x20address)','If\x20main\x20service\x20is\x20unpublished,\x20sub-service\x20buy_guard\x20will\x20fail\x20(order.service\x20won\x27t\x20match)','Consider\x20publishing\x20main\x20service\x20before\x20sub-services']}];export const SERVICE_TEMPLATES_VERSION='1.0.0';export function getAllServiceTemplates(){return[...SERVICE_TEMPLATES];}export function getServiceTemplateById(a){return SERVICE_TEMPLATES['find'](b=>b['id']===a);}export function getServiceTemplatesByScene(a){return SERVICE_TEMPLATES['filter'](b=>b['applicable_scenes']['includes'](a));}export function getServiceTemplatesByIndustry(a){return SERVICE_TEMPLATES['filter'](b=>b['industry_tags']['includes'](a)||b['industry_tags']['includes']('universal'));}export function suggestServiceTemplateForScene(a){const b=getServiceTemplatesByScene(a);return b['length']>0x0?b[0x0]:undefined;}export function listServiceTemplates(){return SERVICE_TEMPLATES['map'](a=>({'id':a['id'],'name':a['name'],'description':a['description'],'scenes':a['applicable_scenes']}));}export const SERVICE_PRICING_NOTE='Pricing\x20coin:\x20prices\x20in\x20the\x20generated\x20body\x20are\x20denominated\x20in\x20the\x20object\x27s\x20type_parameter\x20token\x20(default\x200x2::wow::WOW),\x20which\x20is\x20FIXED\x20at\x20creation\x20—\x20buyers\x20must\x20hold\x20that\x20exact\x20token\x20to\x20order.\x20To\x20price\x20in\x20a\x20different\x20token,\x20pass\x20its\x20full\x20type\x20(from\x20wowok_buildin_info\x20\x27mainnet\x20bridge\x20tokens\x27\x20wowTypeTag)\x20as\x20type_parameter\x20BEFORE\x20creating.\x20Testnet\x20has\x20ONLY\x20WOW\x20(no\x20stablecoins\x20are\x20bridged);\x20multi-token\x20pricing\x20is\x20a\x20mainnet\x20capability.';export function fillServiceTemplate(a,b){const c=getServiceTemplateById(a);if(!c)return{'ok':![],'error':'Template\x20'+a+'\x20not\x20found'};const d=[];for(const f of c['params']){f['required']&&!(f['name']in b)&&d['push'](f['name']);}if(d['length']>0x0)return{'ok':![],'error':'Missing\x20required\x20params:\x20'+d['join'](',\x20'),'missing_required':d};const e={...b};for(const g of c['params']){!(g['name']in e)&&g['default']!==undefined&&(e[g['name']]=g['default']);}return{'ok':!![],'body':c['body'](e),'pricing_note':SERVICE_PRICING_NOTE};}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export declare const STRATEGY_MANUAL_FILENAME = "strategy-manual.md";
|
|
2
|
+
export declare const STRATEGY_MANUAL_VERSION = 1;
|
|
3
|
+
export interface ManualSentinel {
|
|
4
|
+
version: number;
|
|
5
|
+
hash: string;
|
|
6
|
+
}
|
|
7
|
+
export interface BuiltinStrategyManual {
|
|
8
|
+
industry: string;
|
|
9
|
+
version: number;
|
|
10
|
+
body: string;
|
|
11
|
+
}
|
|
12
|
+
export declare function renderStrategyManual(industry: string): string | null;
|
|
13
|
+
export declare function parseManualSentinel(raw: string): ManualSentinel | null;
|
|
14
|
+
export type ManualFileState = "current" | "outdated" | "user_modified" | "user_file";
|
|
15
|
+
export declare function classifyManualFile(industry: string, raw: string): ManualFileState;
|
|
16
|
+
export declare function getBuiltinStrategyManual(industry: string): BuiltinStrategyManual | undefined;
|
|
17
|
+
export declare function listBuiltinStrategyManualIndustries(): string[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createHash}from'node:crypto';export const STRATEGY_MANUAL_FILENAME='strategy-manual.md';export const STRATEGY_MANUAL_VERSION=0x1;const SENTINEL_RE=/^<!-- builtin:strategy-manual:v(\d+):([0-9a-f]+) -->\r?\n/;function bodyHash(a){return createHash('sha256')['update'](a,'utf8')['digest']('hex')['slice'](0x0,0x10);}export function renderStrategyManual(a){const b=BUILTIN_STRATEGY_MANUALS[a];if(!b)return null;return'<!--\x20builtin:strategy-manual:v'+b['version']+':'+bodyHash(b['body'])+'\x20-->\x0a'+b['body'];}export function parseManualSentinel(a){const b=SENTINEL_RE['exec'](a);if(!b)return null;return{'version':Number(b[0x1]),'hash':b[0x2]};}export function classifyManualFile(a,b){const c=BUILTIN_STRATEGY_MANUALS[a],d=parseManualSentinel(b);if(!d)return'user_file';if(!c)return'user_file';const e=b['replace'](SENTINEL_RE,''),f=bodyHash(e)!==d['hash'];if(f)return'user_modified';return d['version']<c['version']?'outdated':'current';}export function getBuiltinStrategyManual(a){return BUILTIN_STRATEGY_MANUALS[a];}export function listBuiltinStrategyManualIndustries(){return Object['keys'](BUILTIN_STRATEGY_MANUALS);}const EDUCATION_MANUAL='#\x20Education\x20Merchant\x20Strategy\x20Manual\x0a\x0a>\x20Built-in\x20tactical\x20playbook\x20for\x20attendance-based\x20education\x20services\x20on\x20WoWok.\x0a>\x20Curated\x20from\x20the\x20K1\x20six-industry\x20commercial\x20handbook.\x20Figures\x20marked\x0a>\x20**[estimate]**\x20are\x20planning\x20estimates;\x20empirical\x20anchors\x20are\x20marked\x20**[K1]**.\x0a\x0a##\x201.\x20What\x20you\x20are\x20really\x20selling\x0a\x0aYou\x20are\x20not\x20selling\x20\x22crypto\x20payments\x22.\x20You\x20are\x20selling\x20the\x20one\x20guarantee\x0aparents\x20could\x20not\x20buy\x20anywhere:\x20**unearned\x20tuition\x20can\x20never\x20be\x20embezzled,\x20and\x0athe\x20parent\x20can\x20verify\x20that\x20on-chain\x20themselves.**\x0a\x0aThe\x20traditional\x20risk\x20stack\x20is\x20brutal:\x20parents\x20prepay\x20in\x20full,\x20the\x20platform\x0atakes\x2025–40%,\x20institutions\x20can\x20commingle\x20the\x20funds,\x20teachers\x20settle\x207–13\x20days\x0alater,\x20and\x20when\x20an\x20institution\x20collapses\x20(Byju\x27s:\x20$533M\x20in\x20prepaid\x20tuition\x0aunaccounted\x20for),\x20recovery\x20is\x2040–80%\x20at\x20best.\x20Chinese\x20regulators\x20require\x0acustody,\x20but\x20paper\x20custody\x20can\x20be\x20technically\x20hollowed\x20out\x20when\x20the\x20collecting\x0aentity\x20is\x20not\x20the\x20custodial\x20entity.\x0a\x0aYour\x20WoWok\x20structure\x20makes\x20the\x20failure\x20structurally\x20impossible:\x0a\x0a1.\x20Parent\x20prepays\x20into\x20an\x20Allocation\x20contract\x20—\x20funds\x20never\x20land\x20on\x20your\x20books.\x0a2.\x20Every\x20lesson\x27s\x20fee\x20releases\x20on\x20the\x20parent\x27s\x20attendance\x20signature\x0a\x20\x20\x20(`attendance_guard_signer`),\x20in\x20seconds.\x0a3.\x20Withdrawal\x20at\x20a\x20\x22withdrawn\x22\x20node\x20refunds\x20all\x20unearned\x20lessons\x20in\x20a\x20single\x0a\x20\x20\x20transaction,\x20with\x20no\x20institutional\x20cooperation\x20—\x20100%\x20recovery\x20by\x20design.\x0a4.\x20`setting_lock_duration`\x20locks\x20the\x20fee\x20schedule\x20(default\x2030\x20days).\x0a\x0aOne\x20sentence\x20for\x20every\x20landing\x20page:\x20*\x22Unearned\x20tuition\x20can\x20never\x20be\x20taken\x20—\x0aand\x20you\x20can\x20verify\x20that\x20sentence\x20yourself\x20on-chain.\x22*\x0a\x0aHonest\x20boundary,\x20always:\x20the\x20structure\x20prevents\x20fund\x20embezzlement.\x20It\x20does\x20not\x0aprevent\x20bad\x20teaching.\x20Say\x20so.\x20Overclaiming\x20destroys\x20the\x20only\x20moat\x20you\x20have:\x0averifiable\x20honesty.\x0a\x0a##\x202.\x20Economics\x20to\x20memorize\x0a\x0a|\x20Anchor\x20|\x20Value\x20|\x0a|---|---|\x0a|\x20AOV\x20(30-lesson\x20package)\x20|\x20¥3,000\x20**[K1]**\x20|\x0a|\x20Legacy\x20combined\x20fee\x20|\x20Outschool\x2030%\x20≈\x20¥900/order\x20|\x0a|\x20WoW\x20cost\x20|\x20gas\x20≈\x20$0.05–2.5\x20for\x20N+2\x20transactions\x20|\x0a|\x20Extra\x20per\x20order\x20|\x20≈\x20¥890\x20|\x0a|\x20Teacher\x20settlement\x20|\x207–13\x20days\x20→\x20seconds\x20|\x0a\x0aFormula:\x20extra\x20per\x20order\x20=\x20legacy\x20fee\x20rate\x20×\x20AOV\x20−\x20(gas\x20+\x20keeper\x20amortization\x0a+\x20one-time\x20migration\x20cost).\x20The\x20gas\x20line\x20is\x20noise\x20against\x20¥900\x20saved;\x20adoption\x0apays\x20on\x20essentially\x20the\x20first\x20package.\x20Price\x20in\x20fiat\x20terms\x20—\x20WOW\x20token\x0avolatility\x20must\x20never\x20enter\x20a\x20parent\x27s\x20tuition\x20decision.\x0a\x0a##\x203.\x20Pricing\x20models\x0a\x0a1.\x20**Per-lesson\x20escrow\x20release**\x20(default).\x20Escrowed\x20package,\x201/N\x20release\x20per\x0a\x20\x20\x20attendance\x20signature.\x20Fits\x20every\x20attendance-based\x20scenario.\x0a2.\x20**Package\x20price\x20with\x20rate-based\x20release**.\x20¥3,000\x20class\x20packages;\x20refund\x0a\x20\x20\x20policy\x20declared\x20up\x20front;\x20compensation\x20fund\x20bound.\x0a3.\x20**Trial-class\x20conversion\x20price**.\x20One\x20escrowed\x20trial,\x20enrollment\x20balance\x0a\x20\x20\x20only\x20after\x20the\x20parent\x20signs;\x20pairs\x20with\x20referral\x20reward.\x20Never\x20run\x20trials\x0a\x20\x20\x20permanently\x20below\x20delivery\x20cost.\x0a\x0aPosture\x20guidance:\x0a\x0a-\x20**Volume**:\x20group-buy\x20and\x20early-bird\x20through\x20parent\x20KOC\x20communities;\x0a\x20\x20trial-class\x20discounts\x20as\x20the\x20cold-start\x20hook.\x20Never\x20below\x20per-lesson\x20cost.\x0a-\x20**Balanced**:\x20mix\x20institutional\x20direct\x20sales\x20with\x20community\x20KOC\x20growth.\x0a-\x20**Margin**:\x20sell\x20compliance\x20to\x20mid-size\x20institutions\x20as\x20a\x20moat\x20—\x20\x22I\x20locked\x0a\x20\x20tuition\x20into\x20an\x20on-chain\x20contract;\x20do\x20you\x20dare?\x22\x20is\x20*their*\x20sales\x20line\x20to\x0a\x20\x20parents.\x20BD\x20costs\x20¥1,500–3,000\x20per\x20signed\x20institution.\x0a\x0aRecorded/self-paced\x20courses\x20are\x20a\x20MISMATCH.\x20Route\x20them\x20to\x20the\x20subscription\x0amodel\x20(per-period\x20signed\x20charges\x20+\x20delivery\x20gate).\x20Do\x20not\x20sell\x20them\x20as\x0aattendance\x20escrow\x20—\x20the\x20mode-fit\x20check\x20is\x20a\x20standard\x20intake\x20action.\x0a\x0a##\x204.\x20Build\x20checklist\x0a\x0a-\x20[\x20]\x20Service\x20with\x20the\x20education\x20blueprint:\x20`attendance_guard_signer`\x20at\x0a\x20\x20\x20\x20\x20\x20every\x20lesson\x20node,\x20rate-mode\x20Allocator\x20releasing\x20per\x20lesson.\x0a-\x20[\x20]\x20A\x20\x22withdrawn\x22\x20node\x20with\x20a\x20one-transaction\x20refund\x20Allocator\x20path.\x0a-\x20[\x20]\x20`setting_lock_duration`\x20on\x20the\x20fee\x20schedule.\x0a-\x20[\x20]\x20Arbitration\x20bound\x20+\x20compensation\x20fund\x20funded.\x0a-\x20[\x20]\x20Public\x20verification\x20view:\x20order,\x20Allocation\x20and\x20Payment\x20objects\x0a\x20\x20\x20\x20\x20\x20readable\x20by\x20the\x20parent\x20(reverse\x20readability\x20is\x20validated\x20in\x20K1).\x0a-\x20[\x20]\x20Target:\x20a\x20fully\x20configured\x20shop\x20in\x20≤10\x20guided\x20dialogues\x20(K1\x20validated\x2011).\x0a\x0a##\x205.\x20The\x2090-day\x20campaigns\x0a\x0a**Campaign\x20A\x20—\x20\x22Tuition\x20Transparency\x20Experiment\x22\x20(M1–M2).**\x20One\x20seed\x0ainstitution\x20runs\x20two\x20parallel\x20classes:\x20traditional\x20collection\x20vs\x20WoW\x0acustody.\x20Publish\x20everything:\x20parents\x20see\x20the\x20B-class\x20contract\x20balance\x20and\x0arelease\x20records.\x20At\x20the\x20week-4\x20parent\x20open\x20day,\x20demo\x20a\x20mid-course\x20withdrawal\x0arefund\x20live,\x20one\x20transaction.\x20KPI:\x201\x20anchor\x20institution,\x20≥30\x20escrow\x20orders,\x0aone\x20verifiable\x20case\x20piece,\x20parent\x20NPS\x20≥60.\x20Budget\x20$6–9K\x20**[estimate]**.\x0a\x0a**Campaign\x20B\x20—\x20\x22The\x20Regulatory\x20Answer\x22\x20(M2–M3).**\x20No\x20ads.\x20Publish\x20the\x0awhite-paper\x20*From\x20Paper\x20Custody\x20to\x20Protocol\x20Custody*,\x20route\x20it\x20to\x20local\x0aregulatory\x20discussions,\x20trade\x20media\x20and\x20parent\x20communities.\x20Frame:\x20\x22WoW\x20is\x0athe\x20technical\x20answer\x20to\x20custody\x20regulation,\x20not\x20its\x20object.\x22\x20Have\x20a\x2024-hour\x0aresponse\x20draft\x20ready\x20for\x20the\x20next\x20sector\x20failure\x20news\x20cycle\x20—\x20one\x20will\x20come.\x0aKPI:\x202\x20media\x20citations,\x203\x20inbound\x20institutions,\x20$0\x20ad\x20spend.\x0a\x0a##\x206.\x20Channels\x20in\x20order\x0a\x0a1.\x20Parent-rights\x20and\x20local\x20parent\x20KOC\x20groups\x20(¥30–80\x20per\x20paying\x20parent).\x0a2.\x20Institutional\x20direct\x20BD\x20—\x20supply\x20decides\x20the\x20two-sided\x20cold\x20start.\x0a3.\x20Industry\x20media\x20/\x20policy\x20white-papers\x20—\x20zero-cost\x20endorsement.\x0a4.\x20Paid\x20ads\x20—\x20do\x20not\x20use\x20in\x20the\x20first\x2090\x20days;\x20they\x20conflict\x20with\x20the\x20trust\x0a\x20\x20\x20narrative.\x0a\x0a##\x207.\x20Conversion\x20and\x20retention\x0a\x0a-\x20Show\x20the\x20contract\x20balance\x20and\x20release\x20history\x20BEFORE\x20payment.\x0a-\x20The\x20live\x20withdrawal-refund\x20demo\x20is\x20the\x20trial-to-enrollment\x20closer.\x0a-\x20Renew\x20on\x20per-lesson\x20release\x20history\x20+\x20attendance\x20records;\x20use\x20sibling\x20and\x0a\x20\x20referral\x20rewards\x20rather\x20than\x20discounting.\x0a-\x20Institutions\x20can\x20recruit\x20teachers\x20with\x20\x22settlement\x20in\x20seconds\x22\x20—\x20the\x20same\x0a\x20\x20feature\x20sells\x20both\x20sides.\x0a\x0a##\x208.\x20Competitor\x20watch\x20(weekly)\x0a\x0aTrack\x20headline\x20price\x20vs\x20escrow\x20structure,\x20arbitration\x20availability,\x0acompensation-fund\x20coverage,\x20release\x20granularity,\x20and\x20refund-window\x20terms.\x0aNever\x20respond\x20to\x20a\x20price\x20war\x20with\x20discounts:\x20respond\x20by\x20inviting\x20the\x20parent\x0ato\x20read\x20the\x20contract.\x0a\x0a##\x209.\x20Red\x20lines\x0a\x0a1.\x20Recorded-only\x20products\x20route\x20to\x20subscription\x20—\x20never\x20disguised\x20as\x0a\x20\x20\x20attendance\x20courses.\x0a2.\x20Never\x20imply\x20the\x20structure\x20guarantees\x20teaching\x20quality.\x0a3.\x20All\x20external\x20material\x20carries\x20the\x20testnet\x20/\x20estimate\x20/\x20WOW-price\x0a\x20\x20\x20disclaimers.\x20Fiat-denominated\x20figures\x20only.\x0a',RENTAL_MANUAL='#\x20Rental\x20Merchant\x20Strategy\x20Manual\x0a\x0a>\x20Built-in\x20tactical\x20playbook\x20for\x20high-value\x20equipment\x20and\x20P2P\x20rentals\x20on\x0a>\x20WoWok.\x20Anchors\x20marked\x20**[k1rent]**\x20come\x20from\x20the\x20fully\x20executed\x20on-chain\x0a>\x20rental\x20pilot;\x20**[estimate]**\x20marks\x20planning\x20figures.\x0a\x0a##\x201.\x20What\x20you\x20are\x20really\x20selling\x0a\x0aRentals\x20are\x20a\x20dispute\x20business\x20that\x20pretends\x20to\x20be\x20a\x20utilization\x20business.\x0aThe\x20incumbent\x20stack\x20has\x20three\x20structural\x20holes:\x0a\x0a1.\x20**Fake\x20deposits.**\x20Card\x20pre-authorizations\x20are\x20not\x20real\x20deductions;\x2077%\x20of\x0a\x20\x20\x20hosts\x20collect\x20no\x20deposit\x20at\x20all\x20—\x20deterrence\x20is\x20zero.\x0a2.\x20**Evidence\x20asymmetry.**\x20Without\x20dated\x20pre-rental\x20photos,\x20damage-claim\x0a\x20\x20\x20rejection\x20runs\x2020%\x20→\x2070%;\x20even\x20paid\x20claims\x20are\x20discounted\x20for\x20depreciation\x0a\x20\x20\x20(60–85%\x20actually\x20paid).\x0a3.\x20**Slow,\x20weaponized\x20settlement.**\x20Refunds\x20take\x207–15\x20business\x20days;\x20review\x0a\x20\x20\x20extortion\x20($50–200\x20per\x20review)\x20shares\x20the\x20same\x20game\x20window\x20as\x20claims.\x0a\x0aWoWok\x20closes\x20all\x20three.\x20Rent\x20+\x20a\x20REAL\x20deposit\x20are\x20bundled\x20into\x20the\x20order\x20and\x0aescrowed\x20in\x20the\x20Allocation\x20contract.\x20A\x20pre-rental\x20WIP\x20hash\x20baseline\x20is\x0amandatory\x20at\x20the\x20handover_out\x20node.\x20On\x20return,\x20post-rental\x20WIP\x20is\x20compared\x20and\x0aexactly\x20one\x20of\x20three\x20mutually\x20exclusive\x20Allocator\x20paths\x20fires:\x20clean\x20return\x0a(deposit\x20back\x20in\x20full),\x20cancellation\x20(full\x20refund),\x20or\x20graded\x20damage\x0adeduction.\x20Settlement\x20is\x20a\x20single\x20allocation\x20transaction\x20—\x20≈3\x20seconds\x20on\x0ak1rent\x20**[k1rent]**\x20—\x20exact\x20to\x20the\x20cent.\x0a\x0aYour\x20sentence:\x20*\x22The\x20platform\x20itself\x20admitted\x20the\x20evidence\x20crisis\x20—\x20we\x20turned\x0ait\x20into\x20structural\x20immunity,\x20and\x20the\x20deposit\x20is\x20real.\x22*\x0a\x0a##\x202.\x20The\x20k1rent\x20receipts\x20are\x20your\x20marketing\x0a\x0aThree\x20immutable\x20Payment\x20records\x20exist\x20from\x20the\x20pilot:\x0a\x0a-\x20`0x078b0834`\x20—\x20clean:\x202\x20rent\x20→\x20merchant,\x203\x20deposit\x20→\x20customer;\x0a-\x20`0xfac811d5`\x20—\x20cancellation:\x205\x20fully\x20→\x20customer;\x0a-\x20`0xe812ed37`\x20—\x20damage:\x203.5\x20→\x20merchant,\x201.5\x20→\x20customer.\x0a\x0aA\x20traditional\x20platform\x27s\x20\x22case\x20study\x22\x20cannot\x20be\x20independently\x20verified.\x20These\x0athree\x20can,\x20by\x20anyone,\x20forever.\x20Build\x20the\x20interactive\x20audit\x20page\x20around\x20the\x0a10-node\x20machine\x20+\x20three\x20paths\x20and\x20make\x20that\x20page\x20the\x20center\x20of\x20your\x0aacquisition.\x0a\x0a##\x203.\x20Economics\x20to\x20memorize\x0a\x0a|\x20Anchor\x20|\x20Value\x20|\x0a|---|---|\x0a|\x20AOV\x20(camera,\x203\x20days)\x20|\x20$200\x20|\x0a|\x20Legacy\x20host-side\x20commission\x20|\x2015.5%\x20≈\x20$31/order\x20|\x0a|\x20Full-cycle\x20WoW\x20cost\x20|\x20≈\x200.05\x20WOW\x20≈\x20¥0.35\x20(5–7\x20txns)\x20**[k1rent]**\x20|\x0a|\x20Deposit\x20refund\x20|\x207–15\x20business\x20days\x20→\x20≈3\x20seconds\x20|\x0a|\x20Insurance/arbitration\x20collapse\x20|\x20Getaround:\x20$750M\x20burden\x20|\x0a\x0aPrice\x20floor:\x20rental\x20rate\x20must\x20cover\x20maintenance\x20+\x20depreciation\x20+\x0abracket-expected\x20damage.\x20The\x20deposit\x20is\x20never\x20lent\x20against\x20or\x20rehypothecated.\x0a\x0a##\x204.\x20Pricing\x20models\x0a\x0a1.\x20**Rent\x20+\x20deposit\x20bundled\x20escrow,\x20three-path\x20settlement**\x20(default\x20and\x0a\x20\x20\x20core).\x20Pre-rental\x20WIP\x20baseline\x20is\x20non-negotiable\x20—\x20without\x20it\x20the\x20damage\x0a\x20\x20\x20guard\x20cannot\x20pass\x20and\x20the\x20product\x20does\x20not\x20exist.\x0a2.\x20**Pre-agreed\x20graded\x20damage\x20brackets**\x20(light\x2020%\x20/\x20heavy\x2050%\x20/\x20total\x20100%)\x0a\x20\x20\x20for\x20continuous\x20damage\x20amounts\x20like\x20the\x20$347.50\x20case.\x20Brackets\x20are\x0a\x20\x20\x20disclosed\x20and\x20accepted\x20at\x20order\x20time;\x20micro-arbitration\x20only\x20assigns\x20the\x0a\x20\x20\x20bracket\x20—\x20it\x20never\x20improvises\x20amounts.\x0a3.\x20**Duration\x20discount\x20ladder**\x20(monthly\x2010%\x20/\x20quarterly\x2020%\x20/\x20annual\x2030%)\x0a\x20\x20\x20to\x20push\x20utilization,\x20never\x20below\x20maintenance\x20+\x20depreciation\x20per\x20period.\x0a\x0aPosture\x20guidance:\x20volume\x20plays\x20utilization\x20and\x20repeat\x20credits\x20(but\x20never\x0awaives\x20the\x20real\x20deposit);\x20margin\x20sells\x20premium\x20high-value\x20gear\x20on\x0averifiable\x20deposit\x20safety\x20and\x203-second\x20refunds;\x20balanced\x20runs\x20the\x2010-merchant\x0aseed\x20program.\x0a\x0a##\x205.\x20Build\x20checklist\x0a\x0a-\x20[\x20]\x2010-node\x20rental\x20machine\x20with\x20handover_out\x20baseline\x20node\x20and\x20return\x20node.\x0a-\x20[\x20]\x20WIP\x20hash\x20capture\x20guided\x20UX\x20at\x20both\x20handover\x20and\x20return\x20(this\x20is\x20the\x0a\x20\x20\x20\x20\x20\x20trust\x20moment\x20—\x20make\x20it\x20easy,\x20not\x20bureaucratic).\x0a-\x20[\x20]\x20Three\x20mutually\x20exclusive\x20Allocator\x20paths,\x20first-match\x20semantics.\x0a-\x20[\x20]\x20Independent\x20arbitration\x20permission\x20(see\x20red\x20line:\x20do\x20not\x20claim\x0a\x20\x20\x20\x20\x20\x20contract-enforced\x20independence\x20without\x20negative-test\x20backing).\x0a-\x20[\x20]\x20Keeper\x20auto-return\x20reminders\x20as\x20standard\x20onboarding,\x20$5–20/month\x0a\x20\x20\x20\x20\x20\x20transparently\x20priced.\x0a-\x20[\x20]\x20Compensation\x20fund\x20sized\x20for\x20the\x20high-value\x20inventory\x20tail.\x0a\x0a##\x206.\x20The\x2090-day\x20campaigns\x0a\x0a**Campaign\x20A\x20—\x20\x22Audit\x20This\x20Ledger\x20Yourself\x22\x20(M1).**\x20Publish\x20the\x20k1rent\x0aaudit\x20page\x20and\x20invite\x20anyone\x20to\x20audit\x20it.\x20Distribute\x20in\x20photography\x20forums,\x0acamera\x20second-hand\x20groups,\x20Reddit\x20r/photography,\x20Bilibili\x20gear\x20channels.\x20KPI:\x0a≥5,000\x20audit-page\x20UV,\x203\x20inbound\x20rental\x20merchants,\x201\x20organic\x20KOC\x20retelling.\x0aBudget\x20$1.5–2.5K\x20**[estimate]**.\x0a\x0a**Campaign\x20B\x20—\x20\x22Deposit\x20Protection\x20Program\x22\x20(M1–M3).**\x20Recruit\x2010\x20equipment\x0arental\x20merchants;\x20templated\x20build\x20≤10\x20dialogues;\x20keeper\x20subsidy\x20$20/mo\x20per\x0amerchant\x20plus\x20first-order\x20gas\x20subsidy\x20for\x203\x20months.\x20KPI:\x2010\x20published\x0aServices,\x20≥100\x20cumulative\x20orders,\x20zero\x20escalated\x20disputes\x20(everything\x20closed\x0aby\x20guard\x20or\x20on-chain\x20micro-arbitration).\x20Budget\x20$8–12K\x20**[estimate]**.\x0a\x0a##\x207.\x20Cold-start\x20mechanics\x0a\x0aSign\x20supply\x20first.\x20Equipment\x20owners\x20get\x20the\x20deposit-custody\x20sales\x20line;\x20\x22my\x0arule:\x20on-chain\x20deposit\x22\x20is\x20their\x20filter\x20for\x20serious\x20renters.\x20Owners\x20bring\x0ademand.\x20Targets:\x20camera/gear,\x20construction\x20machinery,\x20outdoor\x20equipment,\x20and\x0aP2P\x20hosts\x20—\x20high-value,\x20low-frequency,\x20damage-dispute-rich,\x20AOV\x20$100–500.\x0a\x0aIntercept\x20second-hand\x20marketplace\x20dispute\x20threads\x20with\x20one\x20line:\x20\x22this\x0adispute\x20could\x20not\x20have\x20happened\x20on\x20WoW\x22\x20—\x20plus\x20the\x20audit\x20link.\x0a\x0a##\x208.\x20Competitor\x20watch\x20(biweekly)\x0a\x0aRent\x20price,\x20whether\x20the\x20deposit\x20is\x20actually\x20held\x20(vs\x20card\x20auth),\x20pre-rental\x0aevidence\x20requirement,\x20refund\x20speed,\x20arbitration\x20independence.\x20Cite\x0aopponents\x27\x20own\x20documents\x20(Airbnb\x27s\x202026\x20AI-image\x20claim\x20ban,\x20Getaround\x27s\x0ashutdown)\x20—\x20their\x20copy\x20outperforms\x20any\x20copy\x20you\x20could\x20write.\x0a\x0a##\x209.\x20Retention\x0a\x0a-\x20Show\x20historical\x20settlement\x20transactions\x20to\x20first-time\x20renters\x20before\x20they\x0a\x20\x20fund.\x0a-\x20Re-rental\x20via\x20accumulated\x20credit,\x20not\x20coupons.\x0a-\x20Keep\x20claims\x20structurally\x20separate\x20from\x20reviews\x20—\x20this\x20kills\x20review\x0a\x20\x20extortion\x20and\x20is\x20worth\x20saying\x20out\x20loud.\x0a\x0a##\x2010.\x20Red\x20lines\x0a\x0a1.\x20No\x20damage\x20deduction\x20without\x20a\x20pre-rental\x20baseline\x20(guard\x20must\x20fail).\x0a2.\x20\x22Contract-enforced\x22\x20arbitration\x20claims\x20require\x20negative-test\x20backing\x0a\x20\x20\x20first\x20(P-5\x20lesson).\x0a3.\x20Never\x20hide\x20the\x20keeper\x20subscription\x20cost.\x0a',FREELANCE_MANUAL='#\x20Freelance\x20(Services)\x20Merchant\x20Strategy\x20Manual\x0a\x0a>\x20Built-in\x20tactical\x20playbook\x20for\x20project-based\x20freelancers\x20and\x20small\x20studios\x0a>\x20on\x20WoWok.\x20Anchors\x20from\x20the\x20K1\x20Upwork\x20analysis;\x20**[estimate]**\x20marks\x0a>\x20planning\x20figures.\x0a\x0a##\x201.\x20What\x20you\x20are\x20really\x20selling\x0a\x0aIncumbent\x20freelance\x20platforms\x20extract\x20on\x20four\x20axes\x20simultaneously:\x0a\x0a-\x2015.4%\x20take\x20(plus\x203–7.99%\x20client-side\x20fees\x20and\x20contract\x20startup\x20fees);\x0a-\x20Connects\x20bid-entry\x20costs\x20of\x20$48–120\x20for\x20a\x20first\x20order,\x20with\x20~60%\x20of\x0a\x20\x20proposals\x20getting\x20no\x20reply;\x0a-\x20up\x20to\x2027\x20days\x20from\x20delivery\x20to\x20settled\x20cash;\x0a-\x20arbitration\x20at\x20$337.50\x20per\x20party\x20—\x20which\x20makes\x20every\x20dispute\x20under\x20~$700\x0a\x20\x20structurally\x20unsolvable,\x20precisely\x20the\x20long-tail\x20amount\x20band;\x0a-\x20reputation\x20locked\x20inside\x20the\x20platform\x20(JSS),\x20plus\x2010-minute\x20screenshot\x0a\x20\x20surveillance\x20(Work\x20Diary).\x0a\x0aWoWok\x20flips\x20each\x20one:\x20escrow\x20at\x20signing,\x20WIP\x20delivery\x20anchoring,\x20acceptance\x0asignature\x20releasing\x20funds\x20in\x20seconds,\x2014-day\x20silence\x20auto-acceptance\x20via\x20time\x0aguard\x20+\x20keeper,\x20micro-arbitration\x20at\x20any\x20amount,\x20and\x20a\x20Passport\x20credential\x0athe\x20freelancer\x20carries\x20across\x20every\x20client\x20and\x20industry.\x0a\x0aYour\x20sentence:\x20*\x22Upwork\x20says\x20disputes\x20under\x20$700\x20aren\x27t\x20worth\x20solving.\x20We\x20say\x0aevery\x20one\x20is\x20—\x20and\x20your\x20reputation\x20is\x20your\x20asset,\x20not\x20their\x20hostage.\x22*\x0a\x0aPhilosophy\x20line\x20that\x20also\x20functions\x20as\x20a\x20filter:\x20**we\x20verify\x20outcomes,\x20we\x20do\x0anot\x20monitor\x20processes.**\x20Decline\x20hourly-surveillance\x20clients\x20happily.\x0a\x0a##\x202.\x20Economics\x20to\x20memorize\x0a\x0a|\x20Anchor\x20|\x20Value\x20|\x0a|---|---|\x0a|\x20Milestone\x20contract\x20AOV\x20|\x20$1,000\x20|\x0a|\x20Legacy\x20take\x20|\x2015.4%\x20≈\x20$154\x20(+\x20client\x203–7.99%)\x20|\x0a|\x20WoW\x20cost\x20|\x20gas\x20$0.01–0.6\x20across\x204–8\x20txns\x20|\x0a|\x20Arbitration\x20|\x20≈\x20$0.01\x20vs\x20$337.50/party\x20|\x0a|\x20Settlement\x20|\x20up\x20to\x2027\x20days\x20→\x20seconds\x20|\x0a\x0aA\x20single\x20$1,000\x20contract\x20retains\x20≈$153\x20that\x20used\x20to\x20leave;\x20adoption\x20pays\x20on\x0athe\x20first\x20escrowed\x20job.\x0a\x0a##\x203.\x20Pricing\x20models\x0a\x0a1.\x20**Milestone\x20escrow\x20with\x20acceptance\x20signature**\x20(default).\x20Every\x20milestone\x0a\x20\x20\x20objectively\x20verifiable;\x20`deliver_guard_wip`\x20anchors\x20the\x20delivery,\x0a\x20\x20\x20`accept_guard_signer`\x20releases,\x2014-day\x20time\x20guard\x20auto-accepts.\x0a2.\x20**Fixed-price\x20deliverable\x20with\x20revision\x20loops**\x20(logos,\x20translations,\x0a\x20\x20\x20articles).\x20Revision\x20rounds\x20modeled\x20as\x20machine\x20loops\x20—\x20cap\x20the\x20rounds\x20up\x0a\x20\x20\x20front.\x0a3.\x20**Demand-based\x20reverse\x20bidding**:\x20clients\x20post\x20Demands,\x20you\x20present\x20with\x0a\x20\x20\x20Passport/trust\x20gating;\x20zero\x20connect\x20fees,\x20no\x2060%-no-reply\x20graveyard.\x0a\x0aPosture\x20guidance:\x20volume\x20competes\x20on\x20Demand\x20participation\x20and\x20first-order\x0aspeed;\x20margin\x20positions\x20on\x20public\x20on-chain\x20delivery\x20history\x20and\x20refuses\x0aprocess\x20surveillance;\x20balanced\x20standardizes\x20milestone\x20templates\x20and\x20mixes\x0aDemand\x20with\x20referral\x20clients.\x0a\x0a##\x204.\x20Build\x20checklist\x0a\x0a-\x20[\x20]\x20Service\x20priced\x20per\x20milestone\x20(3–5\x20splits\x20in\x20the\x20first\x20proposal\x20—\x20it\x0a\x20\x20\x20\x20\x20\x20de-risks\x20the\x20client\x20and\x20signals\x20professionalism).\x0a-\x20[\x20]\x20Escrow\x20before\x20any\x20work\x20starts.\x20Never\x20start\x20on\x20a\x20\x22trusted\x20client\x22\x0a\x20\x20\x20\x20\x20\x20promise.\x0a-\x20[\x20]\x20WIP\x20hashing\x20at\x20each\x20delivery;\x20acceptance\x20gate;\x2014-day\x20auto-accept\x20time\x0a\x20\x20\x20\x20\x20\x20guard\x20+\x20keeper.\x0a-\x20[\x20]\x20Arbitration\x20bound\x20even\x20on\x20small\x20jobs\x20—\x20the\x20cost\x20is\x20trivial\x20and\x20the\x0a\x20\x20\x20\x20\x20\x20availability\x20is\x20the\x20pitch.\x0a-\x20[\x20]\x20Passport\x20issuance\x20workflow\x20ready\x20before\x20leading\x20with\x20portability\x0a\x20\x20\x20\x20\x20\x20claims\x20(BUG-02\x20P0\x20dependency).\x0a\x0a##\x205.\x20Campaign\x20sequencing\x20(start\x20M2,\x20need\x20≥20\x20merchants\x20first)\x0a\x0a**\x22$699\x20Arbitration\x20Clinic\x22\x20(M2–M3).**\x20Publicly\x20accept\x20and\x20resolve\x20real\x0asub-$700\x20commercial\x20disputes\x20on-chain;\x20publish\x20a\x20weekly\x20micro-arbitration\x0adocumentary.\x20KPI:\x20≥10\x20closed\x20arbitrations,\x20≥3,000\x20average\x20reads\x20per\x20episode,\x0aarbitrator\x20pool\x20≥15.\x20Budget\x20$3–5K\x20**[estimate]**.\x0a\x0a**\x22Transparent\x20Income\x20Witnesses\x22\x20KOC\x20program.**\x20Sign\x205–8\x20mid-tier\x20(not\x0ahead-tier)\x20freelancers\x20who\x20publish\x20real\x20Upwork-vs-WoW\x20income\x20comparisons\x20at\x0aauditable\x20addresses.\x20KOL\x20settlement\x20auto-splits\x20via\x20Allocation\x20after\x20verified\x0afirst-order\x20conversion\x20—\x20no\x20monthly\x20net\x20terms.\x20KPI:\x20≥30\x20registered\x0afreelancers\x20per\x20KOC,\x20on-chain-verifiable\x20conversion\x20≥8%.\x20Budget\x20$6–10K\x0a**[estimate]**.\x0a\x0a##\x206.\x20Channels\x0a\x0ar/freelance,\x20Indie\x20Hackers,\x20digital-nomad\x20communities\x20(67%\x20of\x20Gen\x20Z\x20regard\x0amultiple\x20income\x20streams\x20as\x20essential\x20—\x20Passport\x20lands\x20here),\x20design\x20and\x0atranslation\x20verticals,\x20and\x20Demand\x20bounty\x20events\x20for\x20the\x20demand\x20side.\x0aEstimated\x20$3–8\x20per\x20registered\x20freelancer\x20**[estimate]**.\x0a\x0a##\x207.\x20Conversion\x20and\x20retention\x0a\x0a-\x20Proposals\x20show\x20WIP\x20hashes\x20of\x20similar\x20completed\x20milestones.\x0a-\x20Always\x20propose\x20the\x20milestone\x20split\x20in\x20the\x20first\x20message.\x0a-\x20At\x20delivery,\x20explicitly\x20point\x20at\x20the\x20Passport\x20credential\x20earned:\x20every\x0a\x20\x20clean\x20completion\x20is\x20a\x20portable\x20asset.\x20That\x20sentence\x20is\x20the\x20retention\x20loop.\x0a-\x20Revision\x20scope\x20is\x20agreed\x20before\x20escrow,\x20never\x20negotiated\x20mid-delivery.\x0a\x0a##\x208.\x20Competitor\x20watch\x20(biweekly)\x0a\x0aEffective\x20fee\x20after\x20tiered\x20cuts,\x20escrow\x20availability,\x20settlement\x20speed,\x0aarbitration\x20fee\x20floor,\x20reputation\x20portability.\x20Let\x20the\x20platform\x27s\x20own\x20fee\x0aadjustment\x20notices\x20carry\x20the\x20contrast.\x0a\x0a##\x209.\x20Red\x20lines\x0a\x0a1.\x20No\x20work\x20before\x20milestone\x20escrow.\x0a2.\x20No\x20reputation-portability\x20claims\x20before\x20Passport\x20issuance\x20UX\x20is\x0a\x20\x20\x20production-ready.\x0a3.\x20Never\x20bid\x20below\x20the\x20minimum-rate\x20floor\x20to\x20win\x20volume\x20—\x20outcome\x0a\x20\x20\x20verification\x20is\x20a\x20premium\x20position.\x0a',SUBSCRIPTION_MANUAL='#\x20Subscription\x20/\x20Membership\x20Merchant\x20Strategy\x20Manual\x0a\x0a>\x20Built-in\x20tactical\x20playbook\x20for\x20creator\x20memberships,\x20newsletters\x20and\x20indie\x0a>\x20software\x20on\x20WoWok.\x20Anchors\x20from\x20the\x20K1\x20Patreon/OnlyFans/Apple-IAP\x20analysis.\x0a\x0a##\x201.\x20What\x20you\x20are\x20really\x20selling\x0a\x0aThe\x20subscription\x20industry\x20runs\x20on\x20institutional\x20dark\x20patterns:\x20Patreon\x0araised\x20fees\x20unilaterally\x20three\x20times\x20in\x20thirteen\x20years\x20(5%\x20→\x208–12%\x20→\x2010%);\x0aApple\x20IAP\x20takes\x2030%\x20and\x20floats\x20payouts\x20for\x20up\x20to\x2075\x20days;\x20consumers\x0aunderestimate\x20subscription\x20spend\x20by\x202.5×\x20and\x2042%\x20pay\x20for\x20services\x20they\x20do\x0anot\x20use;\x20Amazon\x27s\x20cancellation\x20flow\x20ran\x204\x20pages\x20/\x206\x20clicks\x20/\x2015\x20options\x20(FTC\x0a$2.5B\x20settlement\x20context);\x20and\x20creators\x20who\x20stop\x20publishing\x20keep\x20getting\x0apaid\x20by\x20their\x20subscribers.\x0a\x0aYour\x20structure\x20makes\x20the\x20dark\x20patterns\x20impossible\x20rather\x20than\x20merely\x0adisclosed:\x0a\x0a-\x20`charge_guard_signer`\x20—\x20EVERY\x20period\x27s\x20charge\x20needs\x20the\x20subscriber\x27s\x0a\x20\x20explicit\x20signature.\x20No\x20auto-renewal\x20path\x20exists.\x0a-\x20`deliver_guard_wip`\x20—\x20without\x20delivered\x20value,\x20the\x20period\x27s\x20charge\x20cannot\x0a\x20\x20pass.\x20This\x20is\x20an\x20industry\x20blank:\x20no\x20incumbent\x20can\x20offer\x20it.\x0a-\x20`cancel_guard_signer`\x20—\x20cancellation\x20is\x20one\x20signature\x20(15\x20options\x20→\x201).\x0a-\x20Allocation\x20100%\x20→\x20creator,\x20frozen\x20at\x20publish.\x20The\x20thirteen-year\x20rate-ratchet\x0a\x20\x20history\x20cannot\x20repeat;\x20it\x20is\x20a\x20protocol\x20property,\x20not\x20a\x20promise.\x0a\x0aThe\x20per-period\x20signature\x20is\x20DELIBERATE\x20FRICTION.\x20Sell\x20it\x20correctly:\x20friction\x0ais\x20protection;\x20the\x20people\x20who\x20remain\x20after\x20signing\x20are\x20real\x20fans;\x20the\x20friction\x0ais\x20a\x20retention-quality\x20certificate.\x20Never\x20sneak\x20auto-renewal\x20back\x20in\x20to\x0aoptimize\x20conversion.\x0a\x0aYour\x20sentence:\x20*\x22Thirteen\x20years\x20of\x20unilateral\x20price\x20raises\x20cannot\x20exist\x20in\x20a\x0afrozen\x20contract\x20—\x20and\x20every\x20single\x20charge\x20is\x20one\x20you\x20signed\x20yourself.\x22*\x0a\x0a##\x202.\x20Economics\x20to\x20memorize\x0a\x0a|\x20Anchor\x20|\x20Value\x20|\x0a|---|---|\x0a|\x20Creator\x20monthly\x20anchor\x20|\x20$100/month\x20($1,200/year)\x20|\x0a|\x20Legacy\x20take\x20|\x20Patreon\x2010%\x20≈\x20$10/month;\x20iOS\x20IAP\x2030%\x20|\x0a|\x20WoW\x20cost\x20|\x20gas\x20$0.03–2\x20across\x2024\x20annual\x20txns\x20|\x0a|\x20Payout\x20|\x20IAP\x20up\x20to\x2075-day\x20float\x20→\x20seconds\x20per\x20period\x20|\x0a|\x20Extra\x20per\x20year\x20|\x20≈\x20$120\x20on\x20a\x20single\x20$100/mo\x20membership\x20|\x0a\x0aFloor:\x20no\x20period\x20charge\x20passes\x20without\x20delivery\x20evidence.\x20The\x20creator\x20must\x0akeep\x20producing\x20—\x20that\x20obligation\x20is\x20the\x20subscriber\x27s\x20protection\x20and\x20the\x0aproduct\x27s\x20integrity.\x0a\x0a##\x203.\x20Pricing\x20models\x0a\x0a1.\x20**Per-period\x20signed\x20charge\x20with\x20delivery\x20gate**\x20(default).\x20Monthly\x20or\x0a\x20\x20\x20chosen\x20cadence;\x20explicit\x20signature\x20each\x20period;\x20charge\x20blocked\x20without\x0a\x20\x20\x20delivery\x20proof;\x20one-signature\x20cancellation.\x0a2.\x20**Annual\x20prepay\x20released\x20per\x20period**.\x20Annual\x20cash\x20lands\x20in\x20escrow\x20and\x0a\x20\x20\x20releases\x20monthly\x20—\x20prepayment\x20with\x20structural\x20stoppage\x20protection\x20for\x0a\x20\x20\x20undelivered\x20months.\x0a3.\x20**Tiered\x20membership**.\x20Each\x20tier\x20maps\x20to\x20concrete\x20deliverables\x20and\x20its\x20own\x0a\x20\x20\x20delivery\x20guard;\x20up/downgrade\x20takes\x20effect\x20next\x20period\x20only.\x20Tier\x0a\x20\x20\x20deliverables\x20must\x20be\x20specific\x20enough\x20for\x20a\x20guard\x20to\x20evaluate.\x0a\x0aPosture\x20guidance:\x20volume\x20rides\x20the\x20consumer\x20\x22signing\x20movement\x22\x20with\x0afirst-month\x20pricing;\x20margin\x20serves\x20fewer\x20true\x20fans\x20at\x20premium\x20tiers\x20and\x0arefuses\x2030%\x20channels;\x20balanced\x20pairs\x20acquisition\x20tools\x20with\x20retention\x0arituals.\x0a\x0a##\x204.\x20Build\x20checklist\x0a\x0a-\x20[\x20]\x20Billing-cycle\x20machine\x20with\x20charge\x20guard\x20+\x20delivery\x20gate\x20per\x20period.\x0a-\x20[\x20]\x20One-signature\x20cancellation\x20node;\x20confirm\x20there\x20is\x20exactly\x20one\x20path.\x0a-\x20[\x20]\x20Frozen\x20Allocation\x20100%\x20to\x20creator;\x20no\x20post-publish\x20fee\x20edit\x20surface.\x0a-\x20[\x20]\x20Annual\x20plan:\x20escrowed\x20prepay,\x20per-period\x20release,\x20undelivered-month\x0a\x20\x20\x20\x20\x20\x20refund\x20guaranteed\x20structurally.\x0a-\x20[\x20]\x20DRM/content\x20access\x20rules\x20declared\x20off-chain\x20where\x20applicable.\x0a\x0a##\x205.\x20The\x20\x22Signing\x20Movement\x22\x20campaign\x20(M2–M4)\x0a\x0aTwo\x20assets,\x20one\x20narrative:\x0a\x0a1.\x20**Consumer\x20side\x20—\x20subscription\x20checkup\x20widget.**\x20Input\x20your\x20subscription\x0a\x20\x20\x20list;\x20learn\x20how\x20much\x20you\x20annually\x20pay\x20for\x20unused\x20services\x20(cite\x20the\x202.5×\x0a\x20\x20\x20underestimate\x20and\x2042%\x20unused\x20figures).\x20KPI:\x20≥20,000\x20checkups.\x0a2.\x20**Creator\x20side\x20—\x20\x22100%\x20Arrival\x20Day\x22.**\x20One\x20day\x20each\x20month,\x20creators\x20post\x0a\x20\x20\x20their\x20on-chain\x20per-period\x20release\x20receipts.\x20KPI:\x2030\x20onboarded\x20creators.\x0a\x0aPlus\x20the\x20one-signature\x20cancellation\x20demo\x20video\x20(target\x20≥100K\x20views).\x20Launch\x0aagainst\x20FTC/platform\x20price-hike\x20news\x20cycles\x20—\x20they\x20recur\x20predictably;\x20keep\x0a24-hour\x20response\x20drafts.\x20Budget\x20$4–7K\x20**[estimate]**.\x0a\x0aCapture\x20education\x20recorded-course\x20overflow:\x20the\x20routing\x20rule\x20sends\x0arecorded/self-paced\x20courses\x20here\x20from\x20the\x20education\x20intake.\x0a\x0a##\x206.\x20Channels\x0a\x0aCreator\x20communities\x20(Discord,\x20Patreon\x20forums\x20—\x20the\x20$131–180\x20median-monthly\x0acreators\x20feel\x20a\x2010–20%\x20fee\x20as\x20a\x20survival\x20issue),\x20newsletter\x20and\x20indie-dev\x0acircles\x20(IAP\x2030%\x20+\x2075-day\x20float),\x20Hacker\x20News\x20and\x20the\x20anti-dark-pattern\x0aaudience.\x20$2–5\x20per\x20subscriber\x20**[estimate]**.\x20Values\x20alignment\x20beats\x20ad\x0aspend\x20in\x20this\x20segment.\x0a\x0a##\x207.\x20Retention\x0a\x0a-\x20Migrate\x20creators\x20one\x20tier\x20at\x20a\x20time;\x20show\x20per-period\x20release\x20receipts.\x0a-\x20Lead\x20with\x20the\x20unused-month\x20guarantee:\x20no\x20delivery,\x20no\x20charge.\x0a-\x20The\x20cancellation\x20demo\x20doubles\x20as\x20a\x20conversion\x20asset\x20—\x20trust\x20that\x20you\x20can\x0a\x20\x20leave\x20is\x20why\x20people\x20stay.\x0a-\x20Upgrade/downgrade\x20effective\x20next\x20period\x20keeps\x20accounting\x20and\x20guard\x20logic\x0a\x20\x20honest.\x0a\x0a##\x208.\x20Competitor\x20watch\x20(weekly)\x0a\x0aTake\x20rate\x20and\x20unilateral-change\x20history,\x20charge\x20transparency,\x20cancellation\x0aclick\x20count,\x20stopped-creator\x20policy,\x20time-to-payout.\x20Contrast\x20the\x20FTC\x0asettlement\x20and\x20frozen\x20Allocation\x20—\x20opponent\x20documents,\x20not\x20your\x20adjectives.\x0a\x0a##\x209.\x20Red\x20lines\x0a\x0a1.\x20Never\x20implement,\x20document,\x20or\x20imply\x20auto-renewal.\x0a2.\x20Never\x20charge\x20a\x20period\x20without\x20delivery\x20evidence.\x0a3.\x20Rate-lock\x20claims\x20exist\x20only\x20through\x20published\x20frozen\x20Allocation.\x0a',TRAVEL_MANUAL='#\x20Travel\x20(Custom\x20&\x20Multi-Segment)\x20Merchant\x20Strategy\x20Manual\x0a\x0a>\x20Built-in\x20tactical\x20playbook\x20for\x20custom-trip\x20and\x20multi-segment\x20travel\x20studios\x0a>\x20on\x20WoWok.\x20This\x20is\x20a\x20tier-3\x20playbook:\x20the\x20economics\x20are\x20the\x20strongest\x20in\x20the\x0a>\x20catalog,\x20but\x20the\x20adoption\x20bottleneck\x20is\x20real.\x20Anchors\x20from\x20the\x20K1\x0a>\x20Booking/TUI\x20analysis.\x0a\x0a##\x201.\x20Why\x20travel\x20is\x20deliberately\x20third\x20in\x20line\x0a\x0aBooking\x27s\x20effective\x20hotel\x20commission\x20runs\x2025–36%\x20after\x20Preferred/Genius\x0astacking,\x20the\x20merchant\x20model\x20floats\x20roughly\x20$134B/year\x20in\x20client\x20money,\x20VCC\x0amanual\x20settlement\x20takes\x202–6\x20weeks,\x20and\x20the\x20fund\x20waterfall\x20is\x20invisible:\x0atravelers\x20see\x20totals,\x20hotels\x20see\x20net\x20rates.\x20When\x20failures\x20happen\x20—\x20Thomas\x0aCook\x27s\x20£400M\x20stranded\x20customers,\x20$35B\x20pandemic\x20refunds\x20—\x20relief\x20is\x20post-hoc;\x0aEU261\x20compensates\x20flight\x20legs\x20while\x20downstream\x20segments\x20simply\x20die.\x0a\x0aWoWok\x27s\x20answer\x20is\x20structurally\x20superior:\x20a\x20multi-segment\x20machine\x0a(`segment_D1..DN`)\x20releases\x20each\x20segment\x27s\x20fee\x20as\x20its\x20WIP\x20passes;\x20an\x0ainterrupted\x20node\x20refunds\x20undelivered\x20segments\x20in\x20one\x20transaction;\x20the\x20agent\x0aruns\x20a\x20second-level\x20Allocation\x20from\x20its\x20own\x20Treasury\x20so\x20the\x20waterfall\x20is\x0areadable\x20on-chain;\x20Treasury-scoped\x20Payments\x20can\x20compensate\x20across\x20segments.\x0a\x0aThe\x20bottleneck\x20is\x20adoption,\x20not\x20economics:\x20hotels\x20and\x20drivers\x20are\x20not\x20on\x0achain.\x20That\x20is\x20why\x20the\x20first\x20viable\x20form\x20is\x20the\x20**agent\x20as\x20the\x20single\x0aon-chain\x20counterparty**\x20—\x20agent↔client\x20custody\x20closes\x20the\x20trust\x20loop\x20alone,\x0aand\x20supplier\x20participation\x20grows\x20later\x20with\x20the\x20Passport\x20network.\x20Do\x20not\x0afront-load\x20this\x20industry\x20before\x20the\x20tier-1/2\x20reputation\x20network\x20exists.\x0a\x0aYour\x20sentence:\x20*\x22Thomas\x20Cook\x27s\x20£400M\x20was\x20post-hoc\x20relief.\x20The\x20same\x20money\x20in\x0acustody\x20with\x20interruption\x20branches\x20is\x20pre-event\x20isolation.\x22*\x0a\x0a##\x202.\x20Economics\x20to\x20memorize\x0a\x0a|\x20Anchor\x20|\x20Value\x20|\x0a|---|---|\x0a|\x20AOV\x20(5-segment\x20custom\x20trip)\x20|\x20$2,000\x20|\x0a|\x20Effective\x20legacy\x20commission\x20|\x2025–36%\x20≈\x20$350–720/trip\x20|\x0a|\x20WoW\x20cost\x20|\x20gas\x20≈\x20$0.02–1\x20across\x202×segments+3\x20txns\x20|\x0a|\x20Settlement\x20|\x20VCC\x202–6\x20weeks\x20→\x20per-segment\x20seconds\x20|\x0a\x0aGas\x20is\x20noise\x20against\x20$350–700\x20saved\x20per\x20trip.\x20The\x20binding\x20constraint\x20is\x0asupplier\x20adoption;\x20never\x20pretend\x20otherwise.\x0a\x0a##\x203.\x20Pricing\x20models\x0a\x0a1.\x20**Multi-leg\x20itinerary\x20with\x20per-segment\x20release**\x20(default\x20and\x20core).\x0a\x20\x20\x20Every\x20segment\x20has\x20WIP\x20evidence\x20and\x20its\x20own\x20Allocator\x20slice;\x20the\x0a\x20\x20\x20interrupted\x20path\x20refunds\x20undelivered\x20legs\x20in\x20one\x20transaction.\x0a2.\x20**Agent\x20single-counterparty\x20custody**\x20for\x20downstream\x20suppliers\x20not\x20yet\x20on\x0a\x20\x20\x20chain.\x20The\x20agent\x20escrows\x20against\x20the\x20client,\x20holds\x20correct\x20licensing\x20and\x0a\x20\x20\x20funds\x20compensation\x20coverage\x20sized\x20to\x20the\x20maximum\x20single\x20segment.\x0a3.\x20**Weather/condition-guaranteed\x20pricing**\x20via\x20quoted\x20guard\x20+\x20a\x20specified\x0a\x20\x20\x20evidence\x20repository\x20oracle;\x20auto-refund\x20on\x20trigger\x20—\x20test\x20the\x20trigger\x0a\x20\x20\x20source\x20before\x20selling\x20it.\x0a\x0aFIT\x20EXCLUSION:\x20do\x20not\x20sell\x20standard\x20standalone\x20flights\x20or\x20hotels.\x20The\x20WoW\x0avalue\x20there\x20is\x20weak;\x20the\x20fit\x20is\x20custom\x20and\x20packaged\x20multi-segment\x20trips\x0a(TUI\x20fit:\x2010/10).\x0a\x0a##\x204.\x20Build\x20checklist\x0a\x0a-\x20[\x20]\x20Segment\x20machine\x20D1..DN\x20with\x20per-segment\x20WIP\x20gates\x20and\x20release\x0a\x20\x20\x20\x20\x20\x20Allocators.\x0a-\x20[\x20]\x20Explicit\x20interrupted\x20node\x20with\x20one-transaction\x20refund.\x0a-\x20[\x20]\x20Agent\x20Entity\x20with\x20own\x20Treasury\x20+\x20second-level\x20Allocation;\x20waterfall\x0a\x20\x20\x20\x20\x20\x20readable\x20by\x20the\x20buyer\x20BEFORE\x20payment.\x0a-\x20[\x20]\x20Per-leg\x20cancellation\x20policy\x20disclosed\x20at\x20sale;\x20refundable\x20vs\x0a\x20\x20\x20\x20\x20\x20non-refundable\x20legs\x20separated,\x20never\x20blurred.\x0a-\x20[\x20]\x20Compensation\x20fund\x20sized\x20for\x20the\x20maximum\x20single\x20segment.\x0a-\x20[\x20]\x20Weather/condition\x20guard\x20trigger\x20source\x20specified\x20and\x20tested.\x0a\x0a##\x205.\x20Pilot\x20playbook\x20(M4+)\x0a\x0a-\x20Pilot\x20with\x202–3\x20custom-trip\x20/\x20packaged-tour\x20studios\x20under\x20agent-only\x0a\x20\x20custody.\x20Budget\x20$10–15K\x20**[estimate]**.\x0a-\x20Asset\x201:\x20the\x20interactive\x20**$2,000\x20waterfall\x20visualization**\x20—\x20exactly\x20how\x0a\x20\x20the\x20trip\x20price\x20splits\x20to\x20hotel,\x20guide\x20and\x20agent,\x20readable\x20on-chain\x20before\x0a\x20\x20purchase.\x20No\x20OTA\x20on\x20earth\x20can\x20show\x20this.\x0a-\x20Asset\x202:\x20the\x20**weather-guard\x20auto-refund\x20demo**\x20—\x20converts\x20\x22escrow\x22\x20from\x20a\x0a\x20\x20word\x20into\x20a\x20visible\x20guarantee.\x0a-\x20Anchor\x20content\x20to\x20the\x20next\x20large\x20travel-failure\x20news\x20cycle;\x20the\x20structural\x0a\x20\x20contrast\x20(pre-event\x20isolation\x20vs\x20post-hoc\x20relief)\x20writes\x20itself.\x0a\x0a##\x206.\x20Competitor\x20watch\x20(monthly)\x0a\x0aEffective\x20commission\x20after\x20Preferred/Genius,\x20waterfall\x20transparency,\x0aper-leg\x20cancellation\x20terms,\x20downstream\x20refund\x20handling\x20(the\x20EU261\x20gap),\x0asettlement\x20speed.\x20Travel\x20is\x20seasonal\x20and\x20contractual\x20—\x20monthly\x20is\x20sufficient;\x0aspend\x20the\x20attention\x20on\x20the\x20pilot\x20studios.\x0a\x0a##\x207.\x20Retention\x0a\x0a-\x20The\x20pre-trip\x20waterfall\x20inspection\x20is\x20the\x20sales\x20asset\x20AND\x20the\x20delivery\x0a\x20\x20promise\x20—\x20rebook\x20on\x20the\x20gap\x20between\x20the\x20two\x20being\x20zero.\x0a-\x20Interrupted-segment\x20one-transaction\x20refund\x20demonstrated\x20before\x20payment.\x0a-\x20Win\x20re-books\x20with\x20itinerary\x20history\x20and\x20per-leg\x20transparency,\x20not\x20points.\x0a\x0a##\x208.\x20Red\x20lines\x0a\x0a1.\x20No\x20standard\x20flight/hotel\x20resale\x20—\x20weak\x20fit,\x20damages\x20positioning.\x0a2.\x20No\x20large\x20cross-period\x20custody\x20marketing\x20before\x20stablecoin\x20bridging\x20is\x0a\x20\x20\x20ready;\x20price\x20in\x20fiat\x20terms.\x0a3.\x20Never\x20commingle\x20undelivered-segment\x20funds\x20with\x20operating\x20cash;\x20cross-leg\x0a\x20\x20\x20responsibility\x20disclosed,\x20never\x20blurred.\x0a',RETAIL_MANUAL='#\x20Retail\x20(Private-Domain\x20Commerce)\x20Merchant\x20Strategy\x20Manual\x0a\x0a>\x20Built-in\x20tactical\x20playbook\x20for\x20sellers\x20who\x20already\x20own\x20traffic\x20—\x20DTC\x20sites,\x0a>\x20community\x20commerce\x20and\x20creator\x20stores\x20—\x20on\x20WoWok.\x20Tier-3\x20deliberately:\x20WoW\x0a>\x20replaces\x20the\x20trust\x20and\x20settlement\x20tax,\x20not\x20the\x20traffic.\x20Anchors\x20from\x20the\x0a>\x20K1\x20Amazon/Etsy\x20analysis.\x0a\x0a##\x201.\x20The\x20honest\x20admission\x20that\x20makes\x20the\x20pitch\x20work\x0a\x0aAmazon\x20sellers\x20carry\x20a\x2030–35%\x20combined\x20burden\x20(8–15%\x20referral\x20+\x20FBA\x20+\x20Q4\x0astorage\x20multipliers\x20+\x208–12%\x20TACoS),\x20wait\x2014\x20days\x20for\x20settlement\x20under\x20DD+7\x0areserves\x20that\x20can\x20jump\x20to\x20DD+90\x20(new\x20sellers\x20commonly\x20face\x20100%\x20reserves),\x0aface\x20A-to-z\x20rulings\x20that\x20default\x20to\x20the\x20buyer\x20on\x20absence,\x20and\x20absorb\x20a\x2019.3%\x0areturn\x20rate\x20of\x20which\x20~9%\x20is\x20fraudulent.\x20Etsy-style\x20unilateral\x20fee\x20increases\x0a(24.2%)\x20complete\x20the\x20picture.\x0a\x0aWoWok\x20answers\x20with\x20escrow\x20released\x20on\x20the\x20receipt-confirmation\x20guard,\x0areturn-auth\x20gating\x20that\x20requires\x20dual-signed\x20or\x20logistics-repository\x20evidence,\x0aconfigurable\x20arbitration\x20voting\x20periods,\x20and\x20a\x20repository\x20provenance\x20chain.\x0a\x0aThe\x20honest\x20admission:\x20**WoW\x20does\x20not\x20sell\x20traffic.**\x20Amazon\x27s\x2040.5%\x20share\x20is\x0athe\x20value\x20of\x20demand,\x20and\x20a\x20zero-traffic\x20seller\x20should\x20be\x20rejected\x20at\x20intake.\x0aThe\x20filter\x20sentence\x20is\x20the\x20strategy:\x20*\x22Of\x20the\x2030%\x20you\x20pay\x20Amazon,\x20which\x20part\x0abuys\x20traffic\x20and\x20which\x20buys\x20trust?\x20We\x20don\x27t\x20sell\x20traffic\x20—\x20trust\x20is\x20free.\x22*\x0aPutting\x20the\x20boundary\x20in\x20the\x20intake\x20questionnaire\x20raises\x20conversion\x20quality.\x0a\x0a##\x202.\x20Economics\x20to\x20memorize\x0a\x0a|\x20Anchor\x20|\x20Value\x20|\x0a|---|---|\x0a|\x20Private-domain\x20AOV\x20|\x20$50\x20|\x0a|\x20Legacy\x20combined\x20burden\x20|\x2030–35%\x20≈\x20$300–350\x20per\x20$1,000\x20GMV\x20|\x0a|\x20WoW\x20cost\x20per\x20$1,000\x20GMV\x20|\x20gas\x20≈\x20$0.01–0.5\x20across\x204–6\x20txns\x20(<\x20$1)\x20|\x0a|\x20Settlement\x20|\x2014\x20days\x20+\x20reserve\x20risk\x20→\x20seconds\x20|\x0a|\x20Return\x20rate\x20/\x20fraud\x20share\x20|\x2019.3%\x20/\x209%\x20|\x0a\x0aFloor:\x20never\x20price\x20below\x20COGS\x20+\x20shipping\x20+\x20expected-return\x20provision;\x0acompensation\x20coverage\x20at\x205×\x20maximum\x20single\x20order\x20by\x20default.\x20The\x20economics\x0awork\x20at\x20almost\x20any\x20AOV\x20—\x20traffic\x20availability\x20is\x20the\x20only\x20admission\x0acriterion.\x0a\x0a##\x203.\x20Pricing\x20models\x0a\x0a1.\x20**Escrow\x20released\x20on\x20confirmed\x20receipt**\x20(default).\x20Funds\x20release\x20seconds\x0a\x20\x20\x20after\x20the\x20receipt\x20guard;\x20`return_auth_guard`\x20requires\x20return\x20evidence;\x0a\x20\x20\x20repository\x20provenance\x20supports\x20authenticity\x20claims.\x0a2.\x20**Member/bundle\x20pricing\x20for\x20private\x20communities**.\x20Spend-threshold\x20and\x0a\x20\x20\x20member\x20pricing\x20via\x20rewards\x20inside\x20the\x20owned\x20channel\x20—\x20no\x20platform\x20TACoS.\x0a\x20\x20\x20Bundles\x20stay\x20escrowed\x20per\x20deliverable;\x20never\x20release\x20pre-shipment.\x0a\x0aPosture\x20guidance:\x20volume\x20converts\x20existing\x20flow\x20into\x20escrow\x20GMV\x20with\x0afirst-order\x20and\x20spend-threshold\x20rewards\x20(viable\x20only\x20because\x20gas\x20is\x20under\x20$1\x0aper\x20thousand\x20GMV);\x20margin\x20sells\x20provenance-authenticated\x20premium\x20goods\x20with\x0arepository\x20evidence;\x20balanced\x20pilots\x205–8\x20sellers\x20around\x20the\x20gas-bill\x20proof\x0aevent.\x0a\x0a##\x204.\x20Build\x20checklist\x0a\x0a-\x20[\x20]\x20Order\x20→\x20escrow\x20→\x20shipment\x20→\x20receipt-guard\x20release,\x20seconds\x20latency.\x0a-\x20[\x20]\x20Return-auth\x20flow\x20requiring\x20dual\x20signature\x20or\x20logistics\x20repository\x0a\x20\x20\x20\x20\x20\x20record\x20(structurally\x20raises\x20fraud\x20cost\x20against\x20the\x209%\x20fraud\x20share).\x0a-\x20[\x20]\x20Arbitration\x20with\x20configured\x20voting\x20period;\x20no\x20auto-default\x20rulings.\x0a-\x20[\x20]\x20Compensation\x20fund\x205×\x20max\x20single\x20order.\x0a-\x20[\x20]\x20Repository\x20provenance\x20chain\x20for\x20SKUs\x20where\x20authenticity\x20is\x20claimed.\x0a-\x20[\x20]\x20Intake\x20questionnaire\x20confirming\x20existing\x20traffic;\x20reject\x20zero-traffic\x0a\x20\x20\x20\x20\x20\x20applicants\x20explicitly.\x0a\x0a##\x205.\x20Pilot\x20playbook\x20(M4+)\x0a\x0a-\x20**\x22$1,000\x20GMV\x20Cost\x20Teardown\x22\x20livestream**:\x20the\x20same\x20shop\x27s\x20private-domain\x0a\x20\x20orders\x20run\x20through\x20WoW,\x20full-cycle\x20gas\x20bill\x20published\x20against\x20the\x20$300–350\x0a\x20\x20Amazon\x20burden\x20for\x20identical\x20GMV.\x20Numbers\x20in\x20fiat.\x0a-\x20**Etsy-refugee\x20targeting**:\x20recruit\x20directly\x20from\x20communities\x20hit\x20by\x20the\x0a\x20\x2024.2%\x20unilateral\x20fee\x20event\x20—\x20the\x20triggering\x20event\x20is\x20the\x20acquisition\x0a\x20\x20channel.\x0a-\x205–8\x20sellers\x20pilot,\x20budget\x20$6–10K\x20**[estimate]**.\x0a\x0a##\x206.\x20Channels\x0a\x0a1.\x20Existing\x20private-traffic\x20sellers\x20(DTC,\x20community\x20commerce,\x20We-commerce)\x0a\x20\x20\x20—\x20the\x20only\x20segment\x20that\x20passes\x20the\x20filter.\x0a2.\x20Etsy\x20fee-hike\x20victim\x20communities.\x0a3.\x20Live\x20cost-comparison\x20events\x20and\x20their\x20replays.\x0a\x0a##\x207.\x20Conversion\x20and\x20retention\x0a\x0a-\x20Make\x20receipt\x20confirmation\x20a\x20one-tap\x20moment\x20and\x20show\x20the\x20release\x20seconds\x0a\x20\x20later\x20—\x20the\x20speed\x20gap\x20to\x2014-day\x20+\x20reserve\x20settlement\x20is\x20visceral.\x0a-\x20Re-purchase\x20via\x20spend\x20cashback\x20and\x20repository-issued\x20provenance\x0a\x20\x20certificates.\x0a-\x20Show\x20return-averse\x20buyers\x20the\x20evidence-gated\x20return\x20flow\x20up\x20front;\x20it\x0a\x20\x20protects\x20them\x20as\x20much\x20as\x20the\x20seller.\x0a\x0a##\x208.\x20Competitor\x20watch\x20(weekly)\x0a\x0aHeadline\x20price,\x20reserve\x20policy,\x20return-fraud\x20handling,\x20arbitration\x20default\x0abehavior,\x20provenance\x20evidence.\x20Retail\x20promotion\x20cycles\x20move\x20fast;\x20weekly\x0acadence.\x20Never\x20answer\x20a\x20price\x20war\x20—\x20answer\x20with\x20the\x20settlement\x20and\x20reserve\x0acontrast.\x0a\x0a##\x209.\x20Red\x20lines\x0a\x0a1.\x20Never\x20promise\x20traffic.\x0a2.\x20No\x20auto-default\x20buyer-win\x20rulings;\x20the\x20arbitration\x20voting\x20period\x20must\x20be\x0a\x20\x20\x20configured.\x0a3.\x20Physical\x20authenticity\x20claims\x20require\x20repository\x20evidence\x20—\x20never\x20beyond\x0a\x20\x20\x20what\x20the\x20evidence\x20proves.\x0a',BUILTIN_STRATEGY_MANUALS={'education':{'industry':'education','version':STRATEGY_MANUAL_VERSION,'body':EDUCATION_MANUAL},'rental':{'industry':'rental','version':STRATEGY_MANUAL_VERSION,'body':RENTAL_MANUAL},'freelance':{'industry':'freelance','version':STRATEGY_MANUAL_VERSION,'body':FREELANCE_MANUAL},'subscription':{'industry':'subscription','version':STRATEGY_MANUAL_VERSION,'body':SUBSCRIPTION_MANUAL},'travel':{'industry':'travel','version':STRATEGY_MANUAL_VERSION,'body':TRAVEL_MANUAL},'retail':{'industry':'retail','version':STRATEGY_MANUAL_VERSION,'body':RETAIL_MANUAL}};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type DataPlane, type TopologyGraph } from "../graph/onchain/index.js";
|
|
1
2
|
export interface SupplyChainService {
|
|
2
3
|
identifier: number;
|
|
3
4
|
name: string;
|
|
@@ -21,4 +22,5 @@ export interface SupplyChainGraph {
|
|
|
21
22
|
machine?: string;
|
|
22
23
|
edges: SupplyChainEdge[];
|
|
23
24
|
}
|
|
24
|
-
export declare function
|
|
25
|
+
export declare function projectSupplyChain(graph: TopologyGraph, service: string): SupplyChainGraph;
|
|
26
|
+
export declare function resolveSupplyChainGraph(service: string, network?: string, planeOverride?: DataPlane): Promise<SupplyChainGraph>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{Config}from'@wowok/wowok';import{SdkDataPlane,expandTopology}from'../graph/onchain/index.js';import{resolveAddress}from'../playbooks/service-build/relationship-profile.js';const VALUE_TYPE_NAMES={0x0:'Bool',0x1:'Address',0x2:'String',0x3:'U8',0x4:'U16',0x5:'U32',0x6:'U64',0x7:'U128',0x8:'U256',0x9:'VecBool',0xa:'VecAddress',0xb:'VecString',0xc:'VecU8',0xd:'VecU16',0xe:'VecU32',0xf:'VecU64',0x10:'VecU128',0x11:'VecU256',0x12:'VecVecU8',0x13:'Value'};function valueTypeName(a){if(typeof a==='number')return VALUE_TYPE_NAMES[a]??String(a);const b=String(a??'');if(b===''||b==='undefined')return'Unknown';return b;}function isAddressType(a){if(typeof a==='number')return a===0x1;const b=String(a??'')['toLowerCase']();return b==='address'||b==='1';}function itemAddress(a){if(typeof a==='string')return a;if(a&&typeof a==='object'){const b=a;if(typeof b['name_or_address']==='string')return b['name_or_address'];if(typeof b['address']==='string')return b['address'];}return undefined;}const NODE_MARK='::node::';export function projectSupplyChain(a,b){const c=b['toLowerCase'](),f={'service':c,'edges':[]},g=a['nodes']['get'](c);if(!g||!g['raw'])return f;const h=(a['out']['get'](c)??[])['find'](l=>l['schema']==='service.machine')?.['to'];if(!h)return f;f['machine']=h;const i=new Map();for(const l of a['nodes']['values']()){if(l['objectType']!=='Guard'||!l['raw'])continue;const m=l['raw']['data']??l['raw'];if(Array['isArray'](m['table']))i['set'](l['id'],m['table']);}const j=''+h+NODE_MARK,k=new Set();for(const o of a['edges']){if(o['schema']!=='wf.transition'||!o['from']['startsWith'](j))continue;const q=o['payload']??{},r=typeof q['guard']==='string'?q['guard']:'';if(!r)continue;const s=String(q['node']??''),t=String(q['prevNode']??''),u=String(q['forward']??''),v=s+'|'+t+'|'+u+'|'+r;if(k['has'](v))continue;k['add'](v);const w=i['get'](r['toLowerCase']());if(!w)continue;const x=[],y=[];for(const z of w){const A=z?.['b_submission']===!![],B=String(z?.['name']??''),C=Number(z?.['identifier']??0x0);if(A)y['push']({'identifier':C,'name':B,'value_type':valueTypeName(z?.['value_type'])});else{if(isAddressType(z?.['value_type'])){const D=itemAddress(z?.['value']);if(D)x['push']({'identifier':C,'name':B,'address':D});}}}(x['length']>0x0||y['length']>0x0)&&f['edges']['push']({'node':s,'prev_node':t,'forward':u,'guard':r,'purchased_services':x,'required_submissions':y});}return f;}export async function resolveSupplyChainGraph(a,b,c){const d={'service':a,'edges':[]};let e;try{e=await resolveAddress(a,'service');}catch{return d;}const f=b??await Config['Instance']()['network_get']()??'testnet',g=c??new SdkDataPlane(f);let h;try{h=await expandTopology(g,{'network':f,'seed':e,'budget':{'maxDepth':0x4,'maxNodes':0x190,'maxRpcs':0x18,'perKindCaps':{'machine.node':0xc8}},'edges':{'schemas':['service.machine','machine.node'],'tableEdges':['machine.node']}});}catch{return{'service':e,'edges':[]};}return projectSupplyChain(h,e);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{GUARD_TEMPLATES,fillGuardTemplate}from'./guard-templates.js';import{MACHINE_TEMPLATES,fillTemplate as
|
|
1
|
+
import{GUARD_TEMPLATES,fillGuardTemplate}from'./guard-templates.js';import{MACHINE_TEMPLATES,fillTemplate as a191a}from'./machine-templates.js';import{SERVICE_TEMPLATES,fillServiceTemplate}from'./service-templates.js';import{ORDER_TEMPLATES,fillTemplate as a191b}from'./order-templates.js';import{PROGRESS_TEMPLATES,fillProgressTemplate}from'./progress-templates.js';import{ARBITRATION_TEMPLATES,fillTemplate as a191c}from'./arbitration-templates.js';import{TREASURY_TEMPLATES,fillTemplate as a191d}from'./treasury-templates.js';import{PERMISSION_TEMPLATES,fillTemplate as a191e}from'./permission-templates.js';import{PASSPORT_TEMPLATES,fillTemplate as a191f}from'./passport-templates.js';import{ALLOCATION_TEMPLATES,fillTemplate as a191g}from'./allocation-templates.js';import{CONTACT_TEMPLATES,fillTemplate as a191h}from'./contact-templates.js';import{REWARD_TEMPLATES}from'./reward-templates.js';export const TEMPLATE_REGISTRY_VERSION=0x1;export const TEMPLATE_OBJECT_TYPES=['guard','machine','service','order','progress','arbitration','treasury','permission','passport','allocation','reward','contact'];function normalizeParam(a){return{'name':a['name'],'type':a['type'],'description':a['description']??'','required':a['required'],...a['default']!==undefined?{'default':a['default']}:{},...a['constraint']!==undefined?{'constraint':a['constraint']}:{}};}function guardMeta(a){return{'id':a['id'],'object_type':'guard','name':a['name'],'description':a['description'],'scenes':[a['scene_id']],'industries':a['applicable_industries'],'instantiable':!![],'parameters':a['parameters']['map'](b=>normalizeParam(b))};}function machineMeta(a){return{'id':a['id'],'object_type':'machine','name':a['name'],'description':a['description'],'scenes':[a['scene_id']],'industries':a['applicable_industries'],'instantiable':!![],'parameters':a['parameters']['map'](b=>normalizeParam(b))};}function bodyMeta(a,b,c,d){return{'id':a['id'],'object_type':b,'name':a['name'],'description':a['description'],'scenes':c,'industries':d,'instantiable':!![],'parameters':a['params']['map'](e=>normalizeParam(e))};}function rewardMeta(a){return{'id':a['type'],'object_type':'reward','name':a['name'],'description':a['description'],'scenes':[],'industries':[],'instantiable':![],'parameters':a['parameters']['map'](b=>normalizeParam(b))};}let REGISTRY=null,ID_COLLISIONS=[];function buildRegistry(){const a=new Map(),b=[],c=d=>{if(a['has'](d['meta']['id'])){b['push'](d['meta']['id']);return;}a['set'](d['meta']['id'],d);};for(const d of GUARD_TEMPLATES){c({'meta':guardMeta(d),'raw':d,'notes':d['creation_notes']});}for(const e of MACHINE_TEMPLATES){c({'meta':machineMeta(e),'raw':e,'notes':e['creation_notes']});}for(const f of SERVICE_TEMPLATES){c({'meta':bodyMeta(f,'service',f['applicable_scenes'],f['industry_tags']),'raw':f,'notes':f['notes']});}for(const g of ORDER_TEMPLATES){c({'meta':bodyMeta(g,'order',g['applicable_scenes'],g['industry_tags']),'raw':g,'notes':g['notes']});}for(const h of PROGRESS_TEMPLATES){c({'meta':bodyMeta(h,'progress',h['applicable_scenes'],h['industry_tags']),'raw':h,'notes':h['notes']});}for(const i of ARBITRATION_TEMPLATES){c({'meta':bodyMeta(i,'arbitration',i['applicable_scenes'],i['industry_tags']),'raw':i,'notes':i['notes']});}for(const j of TREASURY_TEMPLATES){c({'meta':bodyMeta(j,'treasury',j['applicable_scenes'],j['industry_tags']),'raw':j,'notes':j['notes']});}for(const k of PERMISSION_TEMPLATES){c({'meta':bodyMeta(k,'permission',k['applicable_scenes'],k['industry_tags']),'raw':k,'notes':k['notes']});}for(const l of PASSPORT_TEMPLATES){c({'meta':bodyMeta(l,'passport',l['applicable_scenarios'],l['industry_tags']),'raw':l,'notes':l['notes']});}for(const m of ALLOCATION_TEMPLATES){c({'meta':bodyMeta(m,'allocation',m['applicable_scenes'],m['industry_tags']),'raw':m,'notes':m['notes']});}for(const n of REWARD_TEMPLATES){c({'meta':rewardMeta(n),'raw':n,'guidance':{'guardCondition':n['guardCondition'],'amountRange':n['amountRange'],'allocationStrategy':n['allocationStrategy'],'example':n['example'],'relevantGuardOps':n['relevantGuardOps']}});}for(const o of CONTACT_TEMPLATES){c({'meta':bodyMeta(o,'contact',o['applicable_scenes'],o['industry_tags']),'raw':o,'notes':o['notes']});}return ID_COLLISIONS=b,a;}function registry(){return!REGISTRY&&(REGISTRY=buildRegistry()),REGISTRY;}export function getTemplateIdCollisions(){return registry(),ID_COLLISIONS;}export function getTemplateCounts(){const a=Object['fromEntries'](TEMPLATE_OBJECT_TYPES['map'](b=>[b,0x0]));for(const b of registry()['values']()){a[b['meta']['object_type']]+=0x1;}return a;}export function listTemplates(a){const b=[...registry()['values']()]['map'](c=>c['meta']);return a?b['filter'](c=>c['object_type']===a):b;}export function getTemplateDetail(a){const b=registry()['get'](a);if(!b)return null;return{...b['meta'],'raw':b['raw'],...b['notes']?{'notes':b['notes']}:{},...b['guidance']?{'guidance':b['guidance']}:{}};}export function findTemplateObjectType(a){return registry()['get'](a)?.['meta']['object_type']??null;}export function instantiateTemplate(a,b){const c=registry()['get'](a);if(!c)return{'ok':![],'object_type':null,'template_id':a,'error':'Template\x20not\x20found:\x20'+a+'.\x20Use\x20get_templates\x20without\x20\x27template\x27\x20to\x20list\x20all\x20template\x20ids.'};const d=c['meta']['object_type'];if(!c['meta']['instantiable'])return{'ok':![],'object_type':d,'template_id':a,'error':'Reward\x20templates\x20are\x20guidance-only\x20(prose\x20guard\x20conditions)\x20and\x20cannot\x20be\x20'+'instantiated\x20into\x20executable\x20JSON.\x20Use\x20the\x20guidance\x20payload\x20to\x20design\x20the\x20'+'Reward\x20+\x20Guard\x20manually.','guidance':c['guidance']};switch(d){case'guard':{const e=fillGuardTemplate(a,b);if(!e['ok'])return{'ok':![],'object_type':d,'template_id':a,'error':e['error'],...e['missing']?{'missing_params':e['missing']}:{}};return{'ok':!![],'object_type':d,'template_id':a,'body':{'table':e['table'],'root':e['root']},...c['notes']?{'notes':c['notes']}:{}};}case'machine':{const f=a191a(a,b);if(!f['success'])return{'ok':![],'object_type':d,'template_id':a,'error':f['validation_errors']?.['join'](';\x20')??'Machine\x20template\x20fill\x20failed',...f['missing_params']?{'missing_params':f['missing_params']}:{}};return{'ok':!![],'object_type':d,'template_id':a,'body':{'nodes':f['filled_nodes'],'pairs':f['filled_pairs']},...c['notes']?{'notes':c['notes']}:{}};}case'service':{const g=fillServiceTemplate(a,b);if(!g['ok'])return{'ok':![],'object_type':d,'template_id':a,'error':g['error']??'Service\x20template\x20fill\x20failed',...g['missing_required']?{'missing_params':g['missing_required']}:{}};return{'ok':!![],'object_type':d,'template_id':a,'body':g['body'],...c['notes']?{'notes':c['notes']}:{}};}case'order':case'arbitration':case'treasury':case'permission':case'passport':case'allocation':case'progress':case'contact':{const h=fillBodyTemplate(d,a,b);if(!h['ok'])return{'ok':![],'object_type':d,'template_id':a,'error':h['error']};return{'ok':!![],'object_type':d,'template_id':a,'body':h['body'],...c['notes']?{'notes':c['notes']}:{}};}default:return{'ok':![],'object_type':d,'template_id':a,'error':'Instantiation\x20not\x20supported\x20for\x20object_type\x20\x27'+d+'\x27'};}}function fillBodyTemplate(a,b,c){switch(a){case'order':return a191b(b,c);case'arbitration':return a191c(b,c);case'treasury':return a191d(b,c);case'permission':return a191e(b,c);case'passport':return a191f(b,c);case'allocation':return a191g(b,c);case'progress':return fillProgressTemplate(b,c);case'contact':return a191h(b,c);default:return{'ok':![],'error':'No\x20body-template\x20fill\x20for\x20\x27'+a+'\x27'};}}
|