@wowok/agent-mcp 3.4.2 → 3.4.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/.build-stamp.json +5 -0
- package/dist/chain-semantics/composition-truth.js +1 -1
- package/dist/chain-semantics/eval-order.js +1 -1
- package/dist/chain-semantics/field-capability.js +1 -1
- package/dist/chain-semantics/freeze-map.js +1 -1
- package/dist/chain-semantics/fund-flow.js +1 -1
- package/dist/chain-semantics/guard-verbs.js +1 -1
- package/dist/chain-semantics/object-graph.js +1 -1
- package/dist/composition/audit.js +1 -1
- package/dist/composition/compile.d.ts +10 -3
- package/dist/composition/compile.js +1 -1
- package/dist/composition/emit-phases.d.ts +30 -2
- package/dist/composition/emit-phases.js +1 -1
- package/dist/composition/guard-fill.d.ts +8 -0
- package/dist/composition/guard-fill.js +1 -1
- package/dist/composition/inflight.js +1 -1
- package/dist/composition/input-normalize.js +1 -1
- package/dist/composition/materialize.d.ts +2 -0
- package/dist/composition/materialize.js +1 -1
- package/dist/composition/mode-gates.js +1 -1
- package/dist/composition/param-disclosure.js +1 -1
- package/dist/composition/plan-retry-ledger.d.ts +16 -0
- package/dist/composition/plan-retry-ledger.js +1 -1
- package/dist/composition/plan.d.ts +15 -1
- package/dist/composition/plan.js +1 -1
- package/dist/config/config-audit.spec.js +1 -1
- package/dist/config/judgment.d.ts +5 -0
- package/dist/config/judgment.js +1 -1
- package/dist/evaluation/builtins/arbitration-score.d.ts +1 -0
- package/dist/evaluation/builtins/arbitration-score.js +1 -1
- package/dist/evaluation/builtins/demand-match.js +1 -1
- package/dist/evaluation/builtins/graph-service.d.ts +8 -0
- package/dist/evaluation/builtins/graph-service.js +1 -1
- package/dist/evaluation/capability.d.ts +9 -0
- package/dist/evaluation/engine.js +1 -1
- package/dist/evaluation/extract.d.ts +9 -1
- package/dist/evaluation/extract.js +1 -1
- package/dist/evaluation/match-operation.js +1 -1
- package/dist/evaluation/match-policy.d.ts +5 -3
- package/dist/evaluation/match-policy.js +1 -1
- package/dist/evaluation/standards.d.ts +1 -0
- package/dist/evaluation/standards.js +1 -1
- package/dist/evaluation/structured-lines.js +1 -1
- package/dist/evaluation/types.d.ts +1 -0
- package/dist/extensions/capability.js +1 -1
- package/dist/harness/recover.js +1 -1
- package/dist/index.js +1 -1
- package/dist/intent/types.d.ts +1 -1
- package/dist/intent/types.js +1 -1
- package/dist/knowledge/allocation-ledger.js +1 -1
- package/dist/knowledge/allocator-rail-verifier.d.ts +17 -1
- package/dist/knowledge/allocator-rail-verifier.js +1 -1
- package/dist/knowledge/arb-fund-facts.d.ts +7 -0
- package/dist/knowledge/arb-fund-facts.js +1 -1
- package/dist/knowledge/arbitration-rail-verifier.d.ts +35 -0
- package/dist/knowledge/arbitration-rail-verifier.js +1 -0
- package/dist/knowledge/audit-rules.d.ts +11 -0
- package/dist/knowledge/audit-rules.js +1 -1
- package/dist/knowledge/baselines/judgment-baselines.json +1 -0
- package/dist/knowledge/baselines/rules/guard.json +7 -6
- package/dist/knowledge/baselines/rules/progress.json +4 -4
- package/dist/knowledge/baselines/rules/reward.json +118 -3
- package/dist/knowledge/builtin-templates.d.ts +3 -2
- package/dist/knowledge/builtin-templates.js +1 -1
- package/dist/knowledge/chain-query-registry.d.ts +14 -0
- package/dist/knowledge/chain-query-registry.js +1 -0
- package/dist/knowledge/event-semantics.js +1 -1
- package/dist/knowledge/fee-param-bindings.d.ts +2 -0
- package/dist/knowledge/fee-param-bindings.js +1 -1
- package/dist/knowledge/getting-started.js +1 -1
- package/dist/knowledge/guard-binding-table.js +1 -1
- package/dist/knowledge/guard-binding-verifier.d.ts +7 -0
- package/dist/knowledge/guard-binding-verifier.js +1 -1
- package/dist/knowledge/guard-design-patterns.d.ts +1 -1
- package/dist/knowledge/guard-design-patterns.js +1 -1
- package/dist/knowledge/guard-host-context.js +1 -1
- package/dist/knowledge/guard-lint.js +1 -1
- package/dist/knowledge/guard-node-gates.d.ts +3 -1
- package/dist/knowledge/guard-node-gates.js +1 -1
- package/dist/knowledge/guard-puzzle.js +1 -1
- package/dist/knowledge/guard-render.js +1 -1
- package/dist/knowledge/guard-risk.js +1 -1
- package/dist/knowledge/guard-templates.d.ts +2 -1
- package/dist/knowledge/guard-templates.js +1 -1
- package/dist/knowledge/guard-translation.js +1 -1
- package/dist/knowledge/index.d.ts +2 -0
- package/dist/knowledge/index.js +1 -1
- package/dist/knowledge/industry-registry.js +1 -1
- package/dist/knowledge/jsonrpc-enum.js +1 -1
- package/dist/knowledge/knob-docs.js +1 -1
- package/dist/knowledge/param-schema.d.ts +1 -1
- package/dist/knowledge/param-schema.js +1 -1
- package/dist/knowledge/param-tiers.d.ts +2 -0
- package/dist/knowledge/param-tiers.js +1 -1
- package/dist/knowledge/path-oracle/products/food-delivery.js +1 -1
- package/dist/knowledge/pattern-resolutions.d.ts +2 -0
- package/dist/knowledge/pattern-resolutions.js +1 -1
- package/dist/knowledge/product-detail-source.d.ts +37 -0
- package/dist/knowledge/product-detail-source.js +1 -0
- package/dist/knowledge/product-doc-b5.d.ts +16 -0
- package/dist/knowledge/product-doc-b5.js +1 -0
- package/dist/knowledge/progress-ledger.js +1 -1
- package/dist/knowledge/projection.spec.js +1 -1
- package/dist/knowledge/publish-gate.d.ts +20 -0
- package/dist/knowledge/publish-gate.js +1 -0
- package/dist/knowledge/publish-readiness.d.ts +25 -0
- package/dist/knowledge/publish-readiness.js +1 -0
- package/dist/knowledge/publish-surface-contract.d.ts +16 -0
- package/dist/knowledge/publish-surface-contract.js +1 -0
- package/dist/knowledge/rail-exit-satisfiability.d.ts +25 -0
- package/dist/knowledge/rail-exit-satisfiability.js +1 -0
- package/dist/knowledge/reward-ledger.d.ts +1 -1
- package/dist/knowledge/reward-ledger.js +1 -1
- package/dist/knowledge/reward-risk.d.ts +1 -1
- package/dist/knowledge/reward-risk.js +1 -1
- package/dist/knowledge/service-ledger.d.ts +3 -1
- package/dist/knowledge/service-ledger.js +1 -1
- package/dist/knowledge/template-loader.d.ts +41 -2
- package/dist/knowledge/template-loader.js +1 -1
- package/dist/knowledge/template-registry.js +1 -1
- package/dist/knowledge/template-scanner.d.ts +17 -0
- package/dist/knowledge/template-scanner.js +1 -1
- package/dist/knowledge/workflow-guidance.d.ts +4 -0
- package/dist/knowledge/workflow-guidance.js +1 -1
- package/dist/monitor/MonitorLoop.js +1 -1
- package/dist/monitor/normalize.d.ts +1 -1
- package/dist/monitor/normalize.js +1 -1
- package/dist/monitor/types.js +1 -1
- package/dist/participation/game-context.js +1 -1
- package/dist/participation/radar-core.js +1 -1
- package/dist/playbooks/service-build/business-puzzle.js +1 -1
- package/dist/playbooks/service-build/machine-panorama.js +1 -1
- package/dist/playbooks/service-build/merchant-guide.d.ts +28 -3
- package/dist/playbooks/service-build/merchant-guide.js +1 -1
- package/dist/playbooks/service-build/object-panorama.d.ts +4 -0
- 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.js +1 -1
- package/dist/playbooks/service-build/service-panorama.js +1 -1
- package/dist/playbooks/service-build/service-quote.js +1 -1
- package/dist/review/index.js +1 -1
- package/dist/review/order.js +1 -1
- package/dist/safety/confirm-gate.js +1 -1
- package/dist/schema/benchmark-migration/index.d.ts +24 -0
- package/dist/schema/benchmark-migration/index.js +1 -1
- package/dist/schema/call/allocation.d.ts +11 -7
- package/dist/schema/call/allocation.js +1 -1
- package/dist/schema/call/arbitration.d.ts +4 -0
- package/dist/schema/call/arbitration.js +1 -1
- package/dist/schema/call/base.d.ts +28 -0
- package/dist/schema/call/base.js +1 -1
- package/dist/schema/call/bridge.d.ts +21 -0
- package/dist/schema/call/contact.d.ts +4 -0
- package/dist/schema/call/demand.d.ts +4 -0
- package/dist/schema/call/guard.d.ts +12 -0
- package/dist/schema/call/handler.d.ts +1 -0
- package/dist/schema/call/handler.js +1 -1
- package/dist/schema/call/machine.d.ts +16 -8
- package/dist/schema/call/normalize-error.d.ts +1 -0
- package/dist/schema/call/normalize-error.js +1 -0
- package/dist/schema/call/order.d.ts +7 -3
- package/dist/schema/call/order.js +1 -1
- package/dist/schema/call/payment.d.ts +7 -3
- package/dist/schema/call/permission.d.ts +4 -0
- package/dist/schema/call/personal.d.ts +4 -0
- package/dist/schema/call/progress.d.ts +4 -0
- package/dist/schema/call/progress.js +1 -1
- package/dist/schema/call/proof.d.ts +8 -0
- package/dist/schema/call/receipt.js +1 -1
- package/dist/schema/call/repository.d.ts +4 -0
- package/dist/schema/call/reward.d.ts +6 -2
- package/dist/schema/call/reward.js +1 -1
- package/dist/schema/call/semantic.d.ts +2 -2
- package/dist/schema/call/semantic.js +1 -1
- package/dist/schema/call/service.d.ts +6 -2
- package/dist/schema/call/treasury.d.ts +10 -6
- package/dist/schema/common/index.js +1 -1
- package/dist/schema/envelope-unify.d.ts +1 -0
- package/dist/schema/envelope-unify.js +1 -1
- package/dist/schema/evaluation/index.d.ts +43 -0
- package/dist/schema/evaluation/index.js +1 -1
- package/dist/schema/goal/index.d.ts +14 -2
- package/dist/schema/goal/planning.d.ts +18 -0
- package/dist/schema/goal/planning.js +1 -1
- package/dist/schema/intent-radar/index.d.ts +12 -0
- package/dist/schema/intent-radar/index.js +1 -1
- package/dist/schema/keeper/index.d.ts +1 -0
- package/dist/schema/local/index.d.ts +10 -0
- package/dist/schema/local/index.js +1 -1
- package/dist/schema/local/wip.js +1 -1
- package/dist/schema/messenger/index.d.ts +1 -0
- package/dist/schema/messenger/index.js +1 -1
- package/dist/schema/operations.d.ts +95 -12
- package/dist/schema/operations.js +1 -1
- package/dist/schema/persona/index.d.ts +22 -0
- package/dist/schema/query/bi.d.ts +28 -2
- package/dist/schema/query/bi.js +1 -1
- package/dist/schema/query/index.d.ts +67 -61
- package/dist/schema/query/index.js +1 -1
- package/dist/schema/schema-version.js +1 -1
- package/dist/schema/workflow/index.js +1 -1
- package/dist/schema-query-impl/index.d.ts +1 -0
- package/dist/schema-query-impl/index.js +1 -1
- package/dist/schemas/account_operation.output.json +2 -1
- package/dist/schemas/benchmark_migration_operation.output.json +74 -0
- package/dist/schemas/benchmark_migration_operation.schema.json +32 -0
- package/dist/schemas/bridge_operation.output.json +2 -1
- package/dist/schemas/bridge_operation.schema.json +40 -0
- package/dist/schemas/evaluation_operation.output.json +96 -0
- package/dist/schemas/evaluation_operation.schema.json +39 -0
- package/dist/schemas/goal_operation.schema.json +32 -0
- package/dist/schemas/guard2file.schema.json +8 -0
- package/dist/schemas/index.json +1 -1
- package/dist/schemas/intent_radar.output.json +10 -2
- package/dist/schemas/intent_radar.schema.json +5 -1
- package/dist/schemas/keeper_operation.output.json +2 -1
- package/dist/schemas/local_cache_operation.output.json +2 -1
- package/dist/schemas/local_history_operation.output.json +2 -1
- package/dist/schemas/local_info_operation.output.json +2 -1
- package/dist/schemas/local_mark_operation.output.json +2 -1
- package/dist/schemas/local_mark_operation.schema.json +10 -1
- package/dist/schemas/machineNode2file.schema.json +8 -0
- package/dist/schemas/messenger_operation.output.json +2 -1
- package/dist/schemas/messenger_operation.schema.json +2 -1
- package/dist/schemas/monitor_events.output.json +2 -1
- package/dist/schemas/monitor_subscription.output.json +2 -1
- package/dist/schemas/onchain_events.output.json +206 -13
- package/dist/schemas/onchain_events.schema.json +16 -0
- package/dist/schemas/onchain_operations.output.json +22 -3
- package/dist/schemas/onchain_operations.schema.json +971 -326
- package/dist/schemas/onchain_operations_allocation.schema.json +19 -12
- package/dist/schemas/onchain_operations_arbitration.schema.json +9 -1
- package/dist/schemas/onchain_operations_contact.schema.json +8 -0
- package/dist/schemas/onchain_operations_demand.schema.json +8 -0
- package/dist/schemas/onchain_operations_gen_passport.schema.json +8 -0
- package/dist/schemas/onchain_operations_gen_proof.schema.json +8 -0
- package/dist/schemas/onchain_operations_guard.schema.json +654 -114
- package/dist/schemas/onchain_operations_machine.schema.json +11 -3
- package/dist/schemas/onchain_operations_order.schema.json +14 -11
- package/dist/schemas/onchain_operations_payment.schema.json +12 -9
- package/dist/schemas/onchain_operations_permission.schema.json +8 -0
- package/dist/schemas/onchain_operations_personal.schema.json +8 -0
- package/dist/schemas/onchain_operations_progress.schema.json +9 -1
- package/dist/schemas/onchain_operations_proof.schema.json +8 -0
- package/dist/schemas/onchain_operations_repository.schema.json +8 -0
- package/dist/schemas/onchain_operations_reward.schema.json +14 -11
- package/dist/schemas/onchain_operations_service.schema.json +13 -10
- package/dist/schemas/onchain_operations_treasury.schema.json +17 -19
- package/dist/schemas/onchain_table_data.output.json +52 -10
- package/dist/schemas/persona_operation.output.json +57 -0
- package/dist/schemas/persona_operation.schema.json +9 -0
- package/dist/schemas/query_toolkit.output.json +325 -22
- package/dist/schemas/query_toolkit.schema.json +18 -5
- package/dist/schemas/wip_file.output.json +2 -2
- package/dist/schemas/wip_file.schema.json +2 -2
- package/dist/schemas/workflow_operation.schema.json +1 -1
- package/dist/tools/error-catalog.d.ts +17 -0
- package/dist/tools/error-catalog.js +1 -0
- package/dist/tools/handlers/benchmark-migration.d.ts +20 -8
- package/dist/tools/handlers/benchmark-migration.js +1 -1
- package/dist/tools/handlers/config.js +1 -1
- package/dist/tools/handlers/entry-edge-recipe.d.ts +101 -0
- package/dist/tools/handlers/entry-edge-recipe.js +1 -0
- package/dist/tools/handlers/escrow-deficit.d.ts +10 -0
- package/dist/tools/handlers/escrow-deficit.js +1 -0
- package/dist/tools/handlers/evaluation.js +1 -1
- package/dist/tools/handlers/fund-rail-recipe.d.ts +10 -0
- package/dist/tools/handlers/fund-rail-recipe.js +1 -0
- package/dist/tools/handlers/intent-radar.js +1 -1
- package/dist/tools/handlers/local.js +1 -1
- package/dist/tools/handlers/mark-namespace.d.ts +30 -0
- package/dist/tools/handlers/mark-namespace.js +1 -0
- package/dist/tools/handlers/messenger.js +1 -1
- package/dist/tools/handlers/onchain-name-registration.d.ts +1 -0
- package/dist/tools/handlers/onchain-name-registration.js +1 -1
- package/dist/tools/handlers/onchain-name-registration.spec.js +1 -1
- package/dist/tools/handlers/onchain.d.ts +30 -1
- package/dist/tools/handlers/onchain.js +1 -1
- package/dist/tools/handlers/publish-binding-echo.d.ts +22 -0
- package/dist/tools/handlers/publish-binding-echo.js +1 -0
- package/dist/tools/handlers/query.d.ts +1 -1
- package/dist/tools/handlers/query.js +1 -1
- package/dist/tools/handlers/review-chain.d.ts +1 -0
- package/dist/tools/handlers/review-chain.js +1 -1
- package/dist/tools/handlers/schema-query.js +1 -1
- package/dist/tools/handlers/stale-build-check.d.ts +9 -0
- package/dist/tools/handlers/stale-build-check.js +1 -0
- package/dist/tools/handlers/submission-assembly.d.ts +55 -0
- package/dist/tools/handlers/submission-assembly.js +1 -0
- package/dist/tools/handlers/wip.js +1 -1
- package/dist/tools/index.d.ts +1 -0
- package/dist/tools/index.js +1 -1
- package/dist/tools/move-fn-index.gen.js +1 -1
- package/dist/tools/publish-gate-state.d.ts +5 -0
- package/dist/tools/publish-gate-state.js +1 -0
- package/dist/tools/registry/business.js +1 -1
- package/dist/tools/registry/onchain.js +1 -1
- package/dist/tools/registry/query.js +1 -1
- package/dist/tools/retry.js +1 -1
- package/dist/tools/runtime-health.js +1 -1
- package/dist/tools/shared.js +1 -1
- package/dist/tools/upgrade-check.d.ts +1 -0
- package/dist/tools/upgrade-check.js +1 -1
- package/dist/tools/wip-verify-ledger.d.ts +2 -0
- package/dist/tools/wip-verify-ledger.js +1 -1
- package/dist/tools/wrap.d.ts +15 -1
- package/dist/tools/wrap.js +1 -1
- package/package.json +5 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
import{initServicePuzzleFromIntent,initMachinePuzzleFromIntent,initAllocationPuzzleFromIntent,initTreasuryPuzzleFromIntent,initArbitrationPuzzleFromIntent,initRewardPuzzleFromIntent,initProgressPuzzleFromIntent,initOrderPuzzleFromIntent,initPuzzleFromIntent as
|
|
1
|
+
import{initServicePuzzleFromIntent,initMachinePuzzleFromIntent,initAllocationPuzzleFromIntent,initTreasuryPuzzleFromIntent,initArbitrationPuzzleFromIntent,initRewardPuzzleFromIntent,initProgressPuzzleFromIntent,initOrderPuzzleFromIntent,initPuzzleFromIntent as a417a,checkServicePuzzleCompleteness,checkMachinePuzzleCompleteness,checkAllocationPuzzleCompleteness,checkTreasuryPuzzleCompleteness,checkArbitrationPuzzleCompleteness,checkRewardPuzzleCompleteness,checkProgressPuzzleCompleteness,checkOrderPuzzleCompleteness,checkPuzzleCompleteness as a417b}from'../../knowledge/index.js';import{initPuzzleFromIntent as a417c,checkPuzzleCompleteness as a417d}from'../../knowledge/permission-puzzle.js';const KEYWORD_TABLE=[{'category':'Product/Service','keywords_zh':['product','selling','sell','sales','store','open\x20shop'],'keywords_en':['sell','product','sale','shop','store'],'objects':['service','order','progress'],'required_level':'R','scene_id':'retail'},{'category':'Subscription','keywords_zh':['subscription','cycle','renewal'],'keywords_en':['subscribe','recurring','subscription'],'objects':['service','machine','reward'],'required_level':'C','scene_id':'subscription'},{'category':'Rental','keywords_zh':['rent','lease','return'],'keywords_en':['rent','lease','return'],'objects':['service','machine','arb'],'required_level':'C','scene_id':'rental_return'},{'category':'Trust','keywords_zh':['deposit','pledge','verify','trust'],'keywords_en':['deposit','trust','verify'],'objects':['guard','permission','treasury'],'required_level':'R','scene_id':'trust_deposit'},{'category':'Funds','keywords_zh':['split','collect','share\x20profit','income','incentive'],'keywords_en':['split','revenue','reward'],'objects':['allocation','treasury','reward'],'required_level':'R','scene_id':'revenue_split'},{'category':'Workflow','keywords_zh':['node','stage','process','workflow'],'keywords_en':['workflow','stage','node'],'objects':['machine','progress'],'required_level':'R','scene_id':'workflow'},{'category':'Dispute','keywords_zh':['arbitration','refund','conflict','rights\x20protection'],'keywords_en':['arbitration','refund','dispute'],'objects':['arb','proof'],'required_level':'C','scene_id':'arbitration_dispute'},{'category':'Contact','keywords_zh':['customer\x20service','contact','communication'],'keywords_en':['contact','support','im'],'objects':['contact'],'required_level':'C','scene_id':'contact_im'},{'category':'Data','keywords_zh':['evidence','record','data'],'keywords_en':['evidence','record','data'],'objects':['repository','proof'],'required_level':'C','scene_id':'evidence_record'},{'category':'User\x20Profile','keywords_zh':['personal\x20info','preference','privacy'],'keywords_en':['personal','profile','privacy'],'objects':['personal','contact'],'required_level':'OPTIONAL','scene_id':'user_profile'},{'category':'Demand\x20Submission','keywords_zh':['demand','publish','inquiry'],'keywords_en':['demand','request','inquiry'],'objects':['demand'],'required_level':'OPTIONAL','scene_id':'demand_inquiry'}],INDUSTRY_KEYWORDS=[{'industry':'freelance','words':['freelance','outsourcing','freelance','gig']},{'industry':'rental','words':['rental','lease','rental','rent']},{'industry':'education','words':['education','course','training','education','course']},{'industry':'travel','words':['travel','tour','itinerary','travel','trip']},{'industry':'subscription','words':['subscription','cycle','subscription','recurring']}];function buildPuzzleDispatch(){const a=(c,d)=>{try{return c(d);}catch{return undefined;}},b=(c,d)=>{if(!c)return{'missing':[],'complete':![],'next_step':'init\x20failed'};try{return d(c);}catch{return{'missing':[],'complete':![],'next_step':'check\x20failed'};}};return{'service':{'init':c=>a(initServicePuzzleFromIntent,{'primary_goal':c}),'check':c=>b(c,checkServicePuzzleCompleteness)},'machine':{'init':c=>a(initMachinePuzzleFromIntent,c),'check':c=>b(c,checkMachinePuzzleCompleteness)},'allocation':{'init':c=>a(initAllocationPuzzleFromIntent,{'primary_goal':c}),'check':c=>b(c,checkAllocationPuzzleCompleteness)},'treasury':{'init':c=>a(initTreasuryPuzzleFromIntent,{'primary_goal':c}),'check':c=>b(c,checkTreasuryPuzzleCompleteness)},'arb':{'init':c=>a(initArbitrationPuzzleFromIntent,{'primary_goal':c}),'check':c=>b(c,checkArbitrationPuzzleCompleteness)},'reward':{'init':c=>a(initRewardPuzzleFromIntent,{'primary_goal':c}),'check':c=>b(c,checkRewardPuzzleCompleteness)},'progress':{'init':c=>a(initProgressPuzzleFromIntent,{'primary_goal':c}),'check':c=>b(c,checkProgressPuzzleCompleteness)},'order':{'init':c=>a(initOrderPuzzleFromIntent,{'primary_goal':c}),'check':c=>b(c,checkOrderPuzzleCompleteness)},'permission':{'init':c=>a(a417c,{'primary_goal':c}),'check':c=>b(c,a417d)},'guard':{'init':c=>a(a417a,{'primary_goal':c}),'check':c=>b(c,a417b)}};}export function extractKeywords(a){if(!a||typeof a!=='string')return[];const b=[];for(const c of KEYWORD_TABLE){const d=[...c['keywords_zh'],...c['keywords_en']];for(const e of d){try{const f=new RegExp(escapeRegex(e),'gi'),g=(a['match'](f)||[])['length'];g>0x0&&b['push']({'keyword':e,'category':c['category'],'matched_objects':[...c['objects']],'required_level':c['required_level'],'match_count':g});}catch{}}}return b['sort']((h,i)=>i['match_count']-h['match_count']),b;}function escapeRegex(a){return a['replace'](/[.*+?^${}()|[\]\\]/g,'\x5c$&');}export function resolveIndustry(a,b){const c=((a??'')+'\x20'+(b??''))['toLowerCase']();for(const d of INDUSTRY_KEYWORDS){for(const e of d['words']){if(c['includes'](e['toLowerCase']()))return d['industry'];}}return'general';}export function identifyObjects(a,b){if(b['length']===0x0)return{'primary':'service','secondary':['permission','machine','progress'],'scenes':[{'object':'service','scene_id':'general'}]};const c=b['find'](i=>i['required_level']==='R'),d=(c??b[0x0])['matched_objects'][0x0],e=new Set([d]),f=[];for(const i of b){for(const j of i['matched_objects']){!e['has'](j)&&(e['add'](j),f['push'](j));}}const g=[],h=new Set();for(const k of KEYWORD_TABLE){const l=b['find'](n=>n['category']===k['category']);if(!l)continue;if(h['has'](k['scene_id']))continue;h['add'](k['scene_id']),g['push']({'object':k['objects'][0x0],'scene_id':k['scene_id']});}return{'primary':d,'secondary':f,'scenes':g};}export function analyzeBusinessIntent(a){const b=[];if(!a||!a['user_intent']||typeof a['user_intent']!=='string')return{'intent_parsed':{'primary_object':'service','secondary_objects':[],'detected_scenes':[],'industry':'general','keyword_matches':[]},'puzzles':{},'overall_completeness':'empty','next_step':'Please\x20provide\x20a\x20non-empty\x20business\x20intent.','recommended_creation_order':[],'warnings':['input.user_intent\x20is\x20empty']};const c=a['user_intent'],e=extractKeywords(c),f=resolveIndustry(c,a['industry']),{primary:g,secondary:h,scenes:i}=identifyObjects(c,e);let j=[g,...h];if(a['target_objects']&&a['target_objects']['length']>0x0){const p=a['target_objects']['filter'](q=>['service','machine','guard','permission','reward','arb','progress','treasury','demand','repository','contact','order','allocation','personal','payment','proof']['includes'](q));if(p['length']>0x0)j=p;}const k=buildPuzzleDispatch(),l={};for(const q of j){const r=k[q];if(!r){b['push']('No\x20puzzle\x20module\x20for\x20\x27'+q+'\x27\x20—\x20skipped\x20(L3\x20object)');continue;}const s=r['init'](c),t=s?r['check'](s):undefined,u=extractMissingDimensions(t);l[q]={'puzzle':s,'completeness':t,'missing_dimensions':u},!s&&b['push']('Puzzle\x20init\x20failed\x20for\x20\x27'+q+'\x27');}const m=aggregatePuzzleCompleteness(l),n=suggestNextPuzzleStep({'intent_parsed':{'primary_object':g,'secondary_objects':h,'detected_scenes':i,'industry':f,'keyword_matches':e},'puzzles':l,'overall_completeness':m,'next_step':'','recommended_creation_order':[],'warnings':b}),o=['permission','progress','machine','guard','allocation','service'];return{'intent_parsed':{'primary_object':g,'secondary_objects':h,'detected_scenes':i,'industry':f,'keyword_matches':e},'puzzles':l,'overall_completeness':m,'next_step':n,'recommended_creation_order':o,'warnings':b};}function extractMissingDimensions(a){if(!a||typeof a!=='object')return[];const b=a,d=b['missing'];if(Array['isArray'](d))return d['map'](f=>String(f));const e=b['missing_details'];if(Array['isArray'](e))return e['map'](f=>String(f?.['dimension']??f));return[];}export function aggregatePuzzleCompleteness(a){const b=Object['values'](a??{});if(b['length']===0x0)return'empty';const c=b['filter'](f=>!f['puzzle'])['length'];if(c===b['length'])return'empty';const d=b['reduce']((f,g)=>f+(g['missing_dimensions']?.['length']??0x0),0x0);if(d===0x0)return'complete';return'partial';}export function suggestNextPuzzleStep(a){if(!a)return'No\x20result\x20to\x20suggest\x20from.';if(a['overall_completeness']==='complete')return'All\x20puzzle\x20dimensions\x20are\x20complete\x20—\x20ready\x20for\x20risk\x20calibration\x20(stage\x203).';if(a['overall_completeness']==='empty')return'No\x20puzzle\x20has\x20been\x20initialized.\x20Provide\x20more\x20concrete\x20business\x20intent\x20so\x20the\x20primary\x20object\x20can\x20be\x20identified.';const b=['permission','treasury','allocation','guard','machine','service','order','progress','arb','reward','proof','repository','demand','contact','personal','payment'],d=a['puzzles']??{},e=b['filter'](f=>d[f]);for(const f of e){const g=d[f];if(!g)continue;const h=g['missing_dimensions']??[];if(h['length']===0x0)continue;const i=g['completeness'],j=i&&typeof i==='object'?i['next_step']:undefined;if(typeof j==='string'&&j['trim']())return'['+f+']\x20'+j;return'['+f+']\x20Complete\x20dimension'+(h['length']>0x1?'s':'')+'\x20'+h['join'](',\x20')+'\x20to\x20advance\x20the\x20puzzle.';}return'Continue\x20dialog\x20to\x20fill\x20remaining\x20pending\x20fields.';}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Config,LocalMark,query_objects,objectTypeFromAddress,ObjectType}from'@wowok/wowok';import{resolveAddress as
|
|
1
|
+
import{Config,LocalMark,query_objects,objectTypeFromAddress,ObjectType}from'@wowok/wowok';import{resolveAddress as a425a}from'../../tools/handlers/name-resolution.js';import{fetchMachineNodes,buildMachineGraph}from'./machine-nodes.js';import{batchQueryObjectsByIds,fetchObjectLinkerTx,ringWindowSaturated}from'../../graph/onchain/sdk-batch.js';export async function handleMachinePanorama(a){const b=a['object_address'];if(!b)throw new Error('\x27object_address\x27\x20is\x20required\x20for\x20machine_panorama');let c=a['context_network']??undefined;const d=[];let f=await a425a(b,'machine'),g=null;try{if(!c)c=await Config['Instance']()['network_get']();const x=await query_objects({'objects':[f],'network':c});g=x?.['objects']?.[0x0]??null;if(!g&&a['context_network']){const y=await Config['Instance']()['network_get']();if(y&&y!==c){const z=await query_objects({'objects':[f],'network':y,'no_cache':!![]}),A=z?.['objects']?.[0x0]??null;A&&(g=A,c=y);}}}catch(B){throw new Error('Failed\x20to\x20query\x20Machine\x20'+f+'\x20on\x20'+c+':\x20'+(''+(B instanceof Error?B['message']:String(B))));}if(!g)throw new Error('Machine\x20'+f+'\x20not\x20found\x20on\x20'+c+'.\x20It\x20may\x20not\x20exist\x20on\x20this\x20network.');f=g['object']??f;let h=null,j=[];try{const C=await LocalMark['Instance']()['list']({'address':f});C['length']>0x0&&(h=C[0x0]['name']??null,j=(C[0x0]['tags']??[])['map'](D=>String(D)));}catch{d['push']('head:\x20LocalMark\x20lookup\x20failed');}let k={'nodes':[],'edges':[]};try{const D=await fetchMachineNodes(f,c,!![]);k=buildMachineGraph(D);}catch{d['push']('graph:\x20node\x20fetch\x20failed\x20(non-blocking)');}if(typeof g['permission']==='string'&&g['permission'])try{const E=await query_objects({'objects':[g['permission']],'network':c}),F=E?.['objects']?.[0x0]??null,G=Array['isArray'](F?.['perm_remark'])?F['perm_remark']:Array['isArray'](F?.['remark'])?F['remark']:[],H=G['map'](I=>({'index':typeof I?.['index']==='number'?I['index']:parseInt(I?.['index'],0xa),'remark':typeof I?.['remark']==='string'?I['remark']:''}))['filter'](I=>Number['isFinite'](I['index']));k['permission']={'address':g['permission'],'remarks':H};}catch{d['push']('graph:\x20permission\x20read\x20failed\x20(non-blocking)');}const l=[];let m=0x0,n=null,p=null,q=0x0,s=![],u=[];try{const I=await fetchObjectLinkerTx(f,c,!![]),J=I?.['items']??[];s=ringWindowSaturated(J['length']);const K=new Map();for(const R of J){const S=typeof R?.['who']==='string'?R['who']['toLowerCase']():'';if(!S||S==='0x0')continue;if(!objectTypeFromAddress(S))continue;const T=typeof R?.['time']==='number'?R['time']:null,U=K['get'](S);K['set'](S,U==null?T:T==null?U:Math['max'](U,T));}q=K['size'];const L=new Map();for(const [V,W]of K){const X=String(objectTypeFromAddress(V)),Y=L['get'](X)??[];Y['push']({'address':V,'time':W}),L['set'](X,Y);}for(const Z of L['values']()){Z['sort']((a0,a1)=>(a1['time']??0x0)-(a0['time']??0x0));}const M=['Progress','Allocation','Payment','Guard'];u=[];for(const a0 of M){const a1=L['get'](a0);a1&&a1['length']>0x0&&(u['push']({'label':a0,'items':a1}),L['delete'](a0));}for(const [a2,a3]of L){if(a3['length']>0x0)u['push']({'label':a2,'items':a3});}const N=J['filter'](a4=>objectTypeFromAddress(a4['who'])===ObjectType['Progress']);m=N['length'];for(const a4 of N){if(typeof a4?.['time']==='number'){if(n===null||a4['time']<n)n=a4['time'];if(p===null||a4['time']>p)p=a4['time'];}}const O=N['slice'](-0x3)['reverse'](),P=O['map'](a5=>a5['who']),Q=new Map();if(P['length']>0x0)try{const a5=await batchQueryObjectsByIds(P,c,!![]);for(const a6 of a5){if(a6?.['object'])Q['set'](a6['object'],a6);}}catch{d['push']('progresses:\x20detail\x20fetch\x20failed');}for(const a7 of O){const a8=typeof a7?.['who']==='string'?a7['who']:'';if(!a8)continue;const a9=Q['get'](a8);l['push']({'progress':a8,'name':null,'current':a9?.['current']??null,'task':a9?.['task']??null,'history_count':typeof a9?.['history_count']==='number'?a9['history_count']:null,'current_time':typeof a9?.['current_time']==='number'?a9['current_time']:null,'created_at':typeof a7?.['time']==='number'?a7['time']:null});}}catch{d['push']('progresses:\x20global-table\x20lookup\x20failed\x20(non-blocking)');}const w='Analyze\x20ALL\x20workflow\x20progresses\x20of\x20Machine\x20'+f+'\x20('+c+')\x20one\x20by\x20one,\x20newest\x20first.\x20'+('The\x20progresses\x20live\x20in\x20the\x20machine\x27s\x20FIFO\x20tx-linker\x20window\x20holding\x20at\x20most\x205200\x20newest\x20entries\x20—\x20the\x20retained\x20count\x20is\x20a\x20lower\x20bound\x20when\x20the\x20window\x20is\x20saturated\x20(currently\x20'+m+(s?',\x20saturated':'')+').\x20')+'For\x20each\x20progress\x20call\x20object_panorama\x20with\x20the\x20progress\x27s\x20FULL\x200x\x20address\x20(collect\x20the\x20addresses\x20from\x20the\x20same\x20reverse-index\x20source;\x20work\x20newest-first)\x20and\x20render\x20ONE\x20table\x20row\x20per\x20progress:\x20'+'progress\x20address\x20chip\x20(first\x20column)\x20|\x20current\x20node\x20|\x20task\x20|\x20history\x20events\x20|\x20last\x20activity\x20(local\x20date)\x20|\x20registered\x20(local\x20date).\x20'+'Close\x20with\x20the\x203\x20most\x20valuable\x20patterns\x20across\x20the\x20rows\x20(stuck\x20nodes,\x20age\x20of\x20active\x20progresses,\x20throughput).\x20Progresses\x20only\x20—\x20do\x20not\x20re-analyze\x20the\x20Machine\x20graph\x20itself.';return{'action':'machine_panorama','machineAddress':f,'network':String(c),'now_ms':Date['now'](),'head':{'name':h,'tags':j,'description':typeof g['description']==='string'?g['description']:null,'published':typeof g['bPublished']==='boolean'?g['bPublished']:null,'paused':typeof g['bPaused']==='boolean'?g['bPaused']:null},'fields':{'permission':g['permission']??null,'um':g['um']??null,'node_count':k['nodes']['length']>0x0?k['nodes']['length']:typeof g['node_count']==='number'?g['node_count']+0x1:null,'onchain_table_node_count':typeof g['node_count']==='number'?g['node_count']:k['nodes']['length']>0x0?k['nodes']['length']-0x1:null,'consensus_repositories':Array['isArray'](g['consensus_repositories'])?g['consensus_repositories']:[]},'graph':k,'progresses':{'count':m,'window_saturated':s,'preview_truncated':m>l['length'],'stats':{'first_created_ms':n,'last_created_ms':p},...m>l['length']?{'drilldown':{'total_count':m,'analyzed_count':l['length'],'prompt':w}}:{},'items':l},'related':{'count':q,'window_saturated':s,'groups':u},'data_gaps':d};}
|
|
@@ -15,6 +15,9 @@ export interface GuideState {
|
|
|
15
15
|
review_mode?: "review" | "review_reward" | "none";
|
|
16
16
|
reward_funding?: string;
|
|
17
17
|
reward_claim_amount?: string;
|
|
18
|
+
experience_compensation_mode?: "reward" | "none";
|
|
19
|
+
experience_pool_funding?: string;
|
|
20
|
+
compensation_fund?: string;
|
|
18
21
|
after_sales_mode?: "return" | "exchange" | "warranty" | "none";
|
|
19
22
|
acceptance_mode?: "milestone" | "contest" | "bounty" | "agent" | "none";
|
|
20
23
|
installment_mode?: "deposit_balance" | "milestone_n" | "none";
|
|
@@ -39,6 +42,9 @@ export interface MerchantGuideInput {
|
|
|
39
42
|
review_mode?: string;
|
|
40
43
|
reward_funding?: string;
|
|
41
44
|
reward_claim_amount?: string;
|
|
45
|
+
experience_compensation_mode?: string;
|
|
46
|
+
experience_pool_funding?: string;
|
|
47
|
+
compensation_fund?: string;
|
|
42
48
|
after_sales_mode?: string;
|
|
43
49
|
acceptance_mode?: string;
|
|
44
50
|
installment_mode?: string;
|
|
@@ -60,6 +66,9 @@ export interface MerchantGuideInput {
|
|
|
60
66
|
review_mode?: string;
|
|
61
67
|
reward_funding?: string;
|
|
62
68
|
reward_claim_amount?: string;
|
|
69
|
+
experience_compensation_mode?: string;
|
|
70
|
+
experience_pool_funding?: string;
|
|
71
|
+
compensation_fund?: string;
|
|
63
72
|
after_sales_mode?: string;
|
|
64
73
|
acceptance_mode?: string;
|
|
65
74
|
installment_mode?: string;
|
|
@@ -80,6 +89,7 @@ export interface PostDeployStep {
|
|
|
80
89
|
action: string;
|
|
81
90
|
tool_hint: string;
|
|
82
91
|
failure_if_skipped: string;
|
|
92
|
+
note?: string;
|
|
83
93
|
}
|
|
84
94
|
interface CreationPlanEntry {
|
|
85
95
|
order: number;
|
|
@@ -117,6 +127,8 @@ export declare function handleMerchantGuide(v: MerchantGuideInput): Promise<{
|
|
|
117
127
|
blocks: import("../../composition/reflux.js").RefluxBlock[];
|
|
118
128
|
iterations: number;
|
|
119
129
|
};
|
|
130
|
+
wip_source_steps?: import("../../knowledge/product-detail-source.js").WipSourceStep[] | undefined;
|
|
131
|
+
wip_source_steps_note?: string | undefined;
|
|
120
132
|
required_local_marks?: string[] | undefined;
|
|
121
133
|
required_local_marks_note?: string | undefined;
|
|
122
134
|
warnings: string[];
|
|
@@ -132,6 +144,7 @@ export declare function handleMerchantGuide(v: MerchantGuideInput): Promise<{
|
|
|
132
144
|
external_refs?: string[];
|
|
133
145
|
pending_guards?: import("../../composition/plan.js").PendingGuard[];
|
|
134
146
|
derived_params?: import("../../composition/plan.js").DerivedParam[];
|
|
147
|
+
runtime_writes?: import("../../composition/plan.js").RuntimeWriteStep[];
|
|
135
148
|
};
|
|
136
149
|
pending_count_note?: string | undefined;
|
|
137
150
|
pending_guard_designs?: {
|
|
@@ -149,11 +162,13 @@ export declare function handleMerchantGuide(v: MerchantGuideInput): Promise<{
|
|
|
149
162
|
key_queries?: string[] | undefined;
|
|
150
163
|
logic_summary_note?: string | undefined;
|
|
151
164
|
logic_summary?: string | undefined;
|
|
165
|
+
advisory_note?: string | undefined;
|
|
152
166
|
key: string;
|
|
153
167
|
template_id: string;
|
|
154
168
|
host: "reward" | "service" | "arbitration" | "machine" | "repository";
|
|
155
169
|
purpose: string;
|
|
156
170
|
bound: boolean;
|
|
171
|
+
resolution_required: boolean;
|
|
157
172
|
}[] | undefined;
|
|
158
173
|
mandatory_disclosures: string[];
|
|
159
174
|
supply_chain?: {
|
|
@@ -186,7 +201,7 @@ export declare function handleMerchantGuide(v: MerchantGuideInput): Promise<{
|
|
|
186
201
|
graph_validation: {
|
|
187
202
|
valid: boolean;
|
|
188
203
|
hard_violations: {
|
|
189
|
-
id: "PLAN_DUP_STEP" | "PLAN_UNKNOWN_KIND" | "PLAN_REF_UNKNOWN" | "PLAN_REF_FORWARD" | "PLAN_PUBLISH_TARGET" | "PLAN_PROSE_GUARD" | "PLAN_MACHINE_NODES" | "PLAN_REQUIRES_UNKNOWN" | "PLAN_GUARD_PLACEHOLDER" | "PLAN_GUARD_EMPTY_VEC" | "PLAN_GUARD_ZERO_ADDR" | "PLAN_LOGIC_ARITY" | "PLAN_NAME_COLLISION";
|
|
204
|
+
id: "PLAN_DUP_STEP" | "PLAN_UNKNOWN_KIND" | "PLAN_REF_UNKNOWN" | "PLAN_REF_FORWARD" | "PLAN_PUBLISH_TARGET" | "PLAN_PROSE_GUARD" | "PLAN_MACHINE_NODES" | "PLAN_REQUIRES_UNKNOWN" | "PLAN_GUARD_PLACEHOLDER" | "PLAN_GUARD_EMPTY_VEC" | "PLAN_GUARD_ZERO_ADDR" | "PLAN_LOGIC_ARITY" | "PLAN_NAME_COLLISION" | "PLAN_LATE_EMPTY_MARK" | "PLAN_NAME_REF_ORPHAN";
|
|
190
205
|
description: string;
|
|
191
206
|
fix: string;
|
|
192
207
|
}[];
|
|
@@ -275,6 +290,9 @@ export declare function handleMerchantGuide(v: MerchantGuideInput): Promise<{
|
|
|
275
290
|
review_mode?: "review" | "review_reward" | "none";
|
|
276
291
|
reward_funding?: string;
|
|
277
292
|
reward_claim_amount?: string;
|
|
293
|
+
experience_compensation_mode?: "reward" | "none";
|
|
294
|
+
experience_pool_funding?: string;
|
|
295
|
+
compensation_fund?: string;
|
|
278
296
|
after_sales_mode?: "return" | "exchange" | "warranty" | "none";
|
|
279
297
|
acceptance_mode?: "milestone" | "contest" | "bounty" | "agent" | "none";
|
|
280
298
|
installment_mode?: "deposit_balance" | "milestone_n" | "none";
|
|
@@ -315,7 +333,7 @@ export declare function handleMerchantGuide(v: MerchantGuideInput): Promise<{
|
|
|
315
333
|
risk_appetite: "medium";
|
|
316
334
|
key_risk: string;
|
|
317
335
|
machine_shape: {
|
|
318
|
-
semantic_role?: "active" | "
|
|
336
|
+
semantic_role?: "active" | "final" | "draft" | "delivered" | "cancelled" | undefined;
|
|
319
337
|
operator?: "merchant" | "order_payer" | undefined;
|
|
320
338
|
name: string;
|
|
321
339
|
role: string;
|
|
@@ -336,7 +354,7 @@ export declare function handleMerchantGuide(v: MerchantGuideInput): Promise<{
|
|
|
336
354
|
rows?: {
|
|
337
355
|
track: "refund" | "settlement";
|
|
338
356
|
recipient: "signer" | "entity" | "guard_identifier";
|
|
339
|
-
mode: "amount" | "surplus" | "rate";
|
|
357
|
+
mode: "amount" | "surplus" | "rate" | "formula";
|
|
340
358
|
recipient_key?: string | undefined;
|
|
341
359
|
value?: string | number | undefined;
|
|
342
360
|
value_from?: string | undefined;
|
|
@@ -345,6 +363,13 @@ export declare function handleMerchantGuide(v: MerchantGuideInput): Promise<{
|
|
|
345
363
|
fix?: string | number | undefined;
|
|
346
364
|
fix_from?: string | undefined;
|
|
347
365
|
guard_key?: string | undefined;
|
|
366
|
+
formula?: {
|
|
367
|
+
selector: number;
|
|
368
|
+
repo?: string | undefined;
|
|
369
|
+
key?: string | undefined;
|
|
370
|
+
predicate?: unknown;
|
|
371
|
+
ids?: unknown[] | undefined;
|
|
372
|
+
} | undefined;
|
|
348
373
|
note?: string | undefined;
|
|
349
374
|
}[] | undefined;
|
|
350
375
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{analyzeIntent}from'./intent-analyzer.js';import{compileTemplate}from'../../composition/compile.js';import{reflux,auditScore}from'../../composition/reflux.js';import{planBlueprint}from'../../composition/blueprint-view.js';import{getGuardDesignPattern}from'../../knowledge/guard-design-patterns.js';import{GUARD_TEMPLATES,getTemplatesByScene}from'../../knowledge/guard-templates.js';import{GUARD_AFTER_SERVICE_DRAFT,relationDirection}from'../../knowledge/object-dependency.js';import{collectLateMarks}from'../../composition/plan.js';import{BUILTIN_TEMPLATES_VERSION}from'../../knowledge/builtin-templates.js';import{templateCatalogDigest}from'../../knowledge/template-loader.js';import{checkGameTheoryConstraints}from'./game-theory.js';import{assessWorkflowDesign}from'./workflow-design-assessment.js';import{getCapability,recommendCapabilities,checkCapabilityConstraints,capabilityIntentEvidence}from'../../extensions/capability.js';import{requirementCoverage}from'../../knowledge/requirement-families.js';import{recipientDesignGuidance}from'../../knowledge/recipient-constraint.js';import{getTemplate,getTemplatesByIndustry}from'../../knowledge/template-loader.js';import{resolveUserInputQuestions}from'../../knowledge/param-schema.js';import{getScenarioMode}from'../../knowledge/scenario-modes.js';function derivePlanSatisfiedConstraints(a,b){const c=new Set(),d=i=>a['edges']['some'](j=>j['relation']===i),e=i=>a['nodes']['some'](j=>j['id']===i),f=i=>a['nodes']['some'](j=>j['type']===i),g=i=>a['adoptedModules']['includes'](i);if(d('has_order_allocators'))c['add']('order_allocators_bound');if(d('uses_machine'))c['add']('machine_bound_before_publish');if(d('has_arbitration'))c['add']('arbitration_bound_to_service');if(e('machine'))c['add']('machine_published');if(e('repository'))c['add']('repository_published');if(e('service'))c['add']('service_published');e('permission_arb')&&e('permission')&&c['add']('arbitration_permission_independent');g('independent_arbitration')&&a['nodes']['some'](i=>i['id']['includes']('guard')&&i['id']['includes']('arbitration'))&&c['add']('voting_guard_configured');g('accept_timeout_protection')&&(c['add']('time_guard_configured'),c['add']('adminUnhold_permission'));g('milestone_escrow')&&f('guard')&&c['add']('milestone_forward_guarded');const h=d('has_order_allocators');if(h&&b['payment']['allocation']&&b['payment']['allocation']['length']>0x0){c['add']('allocators_configured');const i=b['payment']['allocation']['reduce']((k,l)=>k+l['percentage'],0x0);if(Math['abs'](i-0x64)<0.001)c['add']('sharing_sum_100');const j=b['payment']['allocation']['find'](k=>k['recipient']==='platform');if(!j||j['percentage']===0x0)c['add']('platform_fee_zero');g('supplier_collaboration')&&(c['add']('allocation_sharing_configured'),c['add']('demand_configured'));}g('wip_provenance')&&e('repository')&&c['add']('wip_hash_before_delivery');g('subscription_with_proof')&&e('repository')&&(c['add']('delivery_guard_per_cycle'),c['add']('repository_updated'));g('damage_attestation')&&(c['add']('pre_rental_hash'),c['add']('post_rental_hash'));g('refund_guarantee')&&(c['add']('compensation_fund_positive'),c['add']('refund_guard_configured'));if(g('praise_incentive')){const k=a['plan']['steps']['some'](m=>m['op']==='create'&&m['object']==='reward'),l=a['plan']['steps']['some'](m=>m['op']==='configure'&&m['method']==='coin_add');k&&l&&(c['add']('reward_pool_funded'),c['add']('reward_claim_replay_armed'));}g('discount_lifecycle')&&(c['add']('discount_budget_planned'),c['add']('discount_burn_disclosed'));if(g('after_sales_guarantee')){const m=a['plan']['steps']['find'](p=>p['op']==='create'&&p['object']==='machine'),n=m?.['params']?.['nodes']??[],o=n['some'](p=>/return|refund|exchange|replace|reship|swap|warranty|repair/i['test'](p['name']??''));o&&(c['add']('after_sales_rail_present'),c['add']('after_sales_rail_node_gated'),c['add']('after_sales_window_anchored'),c['add']('after_sales_no_double_remedy'));}if(g('acceptance_judging')){const p=a['plan']['steps']['find'](t=>t['op']==='create'&&t['object']==='machine'),q=p?.['params']?.['nodes']??[],r=q['map'](t=>t['name']??''),s=r['some'](t=>/accept|approv|award|ruling|place|placement|triage|vot|evaluat|winner|judge/i['test'](t));if(s){const t=r['some'](u=>/revis|redeliver|resubmit|rework/i['test'](u));c['add']('acceptance_race_free');if(e('arbitration'))c['add']('acceptance_judge_independent');if(!t||e('repository'))c['add']('acceptance_revision_bounded');}}if(g('installment_deposit')){const u=a['plan']['steps']['find'](z=>z['op']==='create'&&z['object']==='machine'),v=u?.['params']?.['nodes']??[],w=v['map'](z=>z['name']??''),x=w['some'](z=>/(deposit|down_?pay|balance_due|balance_owed|installment|milestone|awaiting|owed)/i['test'](z)),y=w['some'](z=>/(paid|funded|captured|settled)/i['test'](z));x&&y&&(c['add']('installment_funding_gated'),c['add']('installment_deposit_exit'),c['add']('installment_release_once'));}if(g('affiliate_commission')){const z=a['plan']['steps']['find'](D=>D['op']==='create'&&D['object']==='machine'),A=z?.['params']?.['nodes']??[],B=A['map'](D=>D['name']??''),C=B['some'](D=>/(commission|affiliate|referr|attribut|partner_?payout)/i['test'](D));C&&(c['add']('affiliate_rail_present'),c['add']('affiliate_clawback_disclosed'),c['add']('affiliate_window_anchored'));}if(g('crowdfunding')){const D=a['plan']['steps']['find'](H=>H['op']==='create'&&H['object']==='machine'),E=D?.['params']?.['nodes']??[],F=E['map'](H=>H['name']??''),G=F['some'](H=>/(releas|settle|funded|disburs|project)/i['test'](H));G&&(c['add']('crowdfunding_exit_rail_present'),c['add']('crowdfunding_aggregate_writer_bound'),c['add']('crowdfunding_disclosure_present'));}if(g('logistics_fulfillment')){const H=a['plan']['steps']['find'](L=>L['op']==='create'&&L['object']==='machine'),I=H?.['params']?.['nodes']??[],J=I['map'](L=>L['name']??''),K=J['some'](L=>/(dispatch|handover|hand_over|pickup|deliver|courier|rider|shipped)/i['test'](L));K&&(c['add']('logistics_rail_present'),c['add']('logistics_loss_covered'),c['add']('logistics_fee_independent'),c['add']('logistics_dispatch_disclosed'));}return c;}function deriveDeployTimeChecks(a,b=![]){const c=[];return a['nodes']['some'](d=>d['id']==='machine')&&c['push']('Machine\x20published\x20AND\x20bound\x20to\x20Service\x20BEFORE\x20Service.publish\x20(machine\x20is\x20immutable\x20after\x20publish)'),a['edges']['some'](d=>d['relation']==='has_order_allocators')&&(c['push']('Service.order_allocators\x20bound\x20(verify\x20via\x20query_objects\x20after\x20publish\x20—\x20order_allocators\x20is\x20FROZEN\x20at\x20publish)'),c['push']('Settlement\x20is\x20NOT\x20triggered\x20by\x20reaching\x20a\x20Machine\x20node\x20alone\x20—\x20an\x20explicit\x20alloc_by_guard\x20call\x20(keeper\x20or\x20merchant)\x20fires\x20the\x20settlement\x20Allocator\x20once\x20its\x20Guard\x20passes.\x20Declare\x20the\x20node->allocator\x20trigger\x20(which\x20terminal\x20node\x20unlocks\x20settlement)\x20and\x20schedule\x20the\x20keeper\x20step;\x20otherwise\x20orders\x20stall\x20at\x20the\x20settle\x20node\x20with\x20allocation_state=pending'),c['push']('ALLOCATOR\x20GUARD\x20DESIGN\x20—\x20hand-built\x20rails\x20(sahr\x20lesson):\x20BEFORE\x20writing\x20the\x20settlement\x20Guard,\x20map\x20the\x20host\x20object\x27s\x20RICH\x20STATES:\x20enumerate\x20the\x20Machine\x27s\x20terminal\x20nodes\x20(settlement\x20vs\x20refund\x20polarity),\x20the\x20mid-flight\x20states\x20a\x20claim\x20or\x20dispute\x20opens,\x20and\x20which\x20business\x20event\x20each\x20state\x20transition\x20represents;\x20the\x20allocator\x20gate\x20must\x20sit\x20at\x20exactly\x20ONE\x20mapped\x20transition\x20(e.g.\x20\x27order\x20reached\x20settle\x20terminal\x20AND\x20business\x20obligations\x20verified\x27),\x20never\x20at\x20\x27any\x20time\x20after\x20start\x27.\x20Then\x20bind\x20WHO\x20may\x20trigger\x20alloc_by_guard:\x20the\x20gate\x20carries\x20a\x20caller-identity\x20leg\x20—\x20context(Signer)\x20compared\x20against\x20a\x20table\x20entry,\x20a\x20permission.admin\x20/\x20order.owner\x20read,\x20or\x20the\x20named-operator\x20roster\x20query.\x20order.claimed_by\x20is\x20ORDER\x20STATE,\x20not\x20a\x20caller\x20binding\x20—\x20a\x20gate\x20whose\x20legs\x20read\x20only\x20order/progress/clock\x20state\x20is\x20callable\x20by\x20ANY\x20address,\x20and\x20a\x20bystander\x20can\x20accelerate\x20someone\x20else\x27s\x20payout\x20(sahr,\x20live-proven)'),c['push']('ALLOCATOR\x20GUARD\x20REVIEW\x20—\x20pre-publish,\x20semantic\x20alignment:\x20SAFETY\x20—\x20a\x20settlement\x20track\x20with\x20refund\x20exposure\x20carries\x20the\x20dispute\x20freeze\x20leg\x20logic_not[order.dispute.open]\x20(query\x201576)\x20so\x20a\x20filed\x20dispute\x20freezes\x20new\x20settlements;\x20resolved-awaiting-stamp\x20flows\x20drive\x20the\x20stamp\x20with\x20order.dispute.unstamped\x20(query\x201578).\x20EFFECTIVENESS\x20—\x20read\x20every\x20gate\x20leg\x20back\x20against\x20the\x20business\x20description\x20(who\x20SHOULD\x20trigger,\x20at\x20which\x20business\x20milestone,\x20with\x20what\x20evidence):\x20structural\x20lint\x20passing\x20is\x20NOT\x20semantic\x20alignment.\x20Run\x20the\x20template\x20scan\x20dry-run\x20before\x20publish\x20—\x20the\x20knowledge\x20face\x20discloses\x20identity-less\x20allocator\x20gates\x20as\x20RAIL_NO_CALLER_IDENTITY\x20(info,\x20never\x20blocking);\x20treat\x20the\x20disclosure\x20as\x20a\x20design-review\x20flag\x20and\x20resolve\x20it\x20either\x20with\x20a\x20caller-identity\x20leg\x20or\x20a\x20DOCUMENTED\x20open-trigger\x20rationale\x20(scene\x20verifies\x20identity\x20upstream\x20/\x20intentionally\x20open\x20venue),\x20never\x20by\x20silence'),c['push']('ALLOCATOR\x20RULING\x20DIRECTION\x20—\x20the\x20rich-state\x20matrix\x20closes\x20BOTH\x20ruling\x20outcomes:\x20an\x20award\x20exit\x20on\x20the\x20ARBITRATION\x20indemnity\x20track\x20(a\x20tpl_forward_arb_ruling_won\x20claimed_by==true\x20leg\x20is\x20legal\x20arb-side\x20state,\x20decision\x2011)\x20bound\x20ONLY\x20to\x20a\x20buyer-side\x20identity\x20(order.owner/agent)\x20is\x20unreachable\x20after\x20a\x20MERCHANT-favored\x20ruling\x20or\x20dismissal\x20—\x20nobody\x20but\x20the\x20buyer\x20can\x20open\x20the\x20exit\x20and\x20the\x20escrow\x20principal\x20strands\x20(w3k7\x20m2:\x201.25\x20WOW\x20held\x20on\x20a\x20fully-guarded\x20order;\x20the\x20protocol\x20is\x20direction-blind,\x20the\x20order\x20object\x20exposes\x20NO\x20winner\x20accessor,\x20so\x20the\x20guard\x20itself\x20cannot\x20branch\x20on\x20who\x20won).\x20Pair\x20the\x20buyer-side\x20award\x20exit\x20with\x20a\x20merchant-side\x20exit\x20(a\x20terminal-node-gated\x20recovery\x20sweep\x20—\x20the\x20canonical\x20recover\x20rail),\x20or\x20document\x20that\x20the\x20keeper\x20dual-payout\x20protocol\x20is\x20the\x20intended\x20sole\x20post-ruling\x20exit.\x20Overlap\x20between\x20an\x20award\x20and\x20a\x20fund-rail\x20payout\x20is\x20LEGAL\x20under\x20decision\x2011\x20and\x20is\x20disclosed\x20at\x20the\x20MCP\x20dual-payout\x20confirmation\x20gate\x20—\x20resolve\x20reachability\x20before\x20publish,\x20never\x20by\x20silence.\x20INVERTED\x20FUNDING\x20award-recipient\x20face\x20(W5-01\x20d;\x20the\x20order-side\x20award\x20payout\x20hard-binds\x20to\x20the\x20order\x20owner\x20on\x20both\x20compensate\x20and\x20conclude\x20paths):\x20a\x20ruling\x20pays\x20ONLY\x20the\x20compensation\x20indemnity,\x20never\x20the\x20escrow\x20principal\x20—\x20and\x20on\x20an\x20INVERTED-FUNDING\x20build\x20(bounty/contest:\x20the\x20SPONSOR\x20is\x20the\x20order_payer,\x20so\x20order.owner\x20IS\x20the\x20funder)\x20a\x20hunter/designer-side\x20win\x20pays\x20THE\x20SPONSOR,\x20not\x20the\x20winning\x20party;\x20state\x20both\x20directions\x20(award\x20recipient\x20+\x20principal\x20exit\x20via\x20the\x20recover\x20rail\x27s\x20note)\x20in\x20the\x20storefront/quote\x20before\x20publish')),(a['adoptedModules']['includes']('refund_guarantee')||a['nodes']['some'](d=>d['id']==='arbitration'))&&(b?c['push']('COMPENSATION\x20FUND:\x20DO\x20NOT\x20FUND\x20—\x20this\x20template\x20declares\x20compensation_fund_policy=forbidden\x20(the\x20unreserved\x20pool\x20is\x20double-takeable\x20via\x20refund-then-claim\x20until\x20the\x20arbitration-escrow\x20shared\x20gate\x20lands;\x20user\x20ruling\x202026-10-15).\x20Disputes\x20ride\x20the\x20escrow\x20rails\x20only;\x20the\x20compensation_fund_topup\x20post-deploy\x20step\x20is\x20intentionally\x20absent'):c['push']('compensation_fund\x20MUST\x20be\x20able\x20to\x20cover\x20payouts:\x20a\x20claim\x20against\x20a\x20drained\x20fund\x20aborts\x20with\x20E_COMPENSATION_NOT_MATCH.\x20Size\x20the\x20fund\x20>=\x203x\x20a\x20TYPICAL\x20single\x20order\x20(3x\x20IS\x20the\x20chain\x27s\x20hard\x20award\x20ceiling,\x20MAX_INDEMNITY_MULTIPLE)\x20—\x20per-order\x20coverage\x20is\x20enforced\x20at\x20BUY\x20time\x20(each\x20order\x20is\x20checked\x20against\x203x\x20ITS\x20OWN\x20amount,\x20not\x203x\x20the\x20highest\x20SKU),\x20so\x20publish\x20no\x20longer\x20blocks\x20on\x20coverage;\x20verify\x20the\x20on-chain\x20balance\x20before\x20going\x20live.\x205R-07③:\x20after\x20go-live\x20the\x20keeper\x20WATCHES\x20the\x20water\x20level\x20(see\x20the\x20compensation_fund_watch\x20step)\x20—\x20no\x20hard\x20gate,\x20the\x20merchant\x20decides')),a['nodes']['some'](d=>d['id']==='arbitration')&&(c['push']('Arbitration\x20activation\x20is\x20ATOMIC\x20in\x20the\x20creation\x20plan\x20—\x20the\x20chain\x20hardcodes\x20every\x20new\x20Arbitration\x20to\x20PAUSED\x20at\x20construction,\x20and\x20the\x20plan\x27s\x20arbitration\x20create\x20payload\x20carries\x20pause:false,\x20which\x20the\x20executor\x20composes\x20as\x20the\x20unpause\x20write\x20in\x20the\x20SAME\x20transaction\x20(the\x20creator\x20is\x20the\x20new\x20Permission\x27s\x20admin,\x20so\x20the\x20356\x20assert\x20passes).\x20Verify\x20the\x20paused\x20flag\x20reads\x20false\x20after\x20materialization\x20(a\x20paused\x20venue\x20aborts\x20every\x20dispute\x20filing).\x20Keep\x20Arbitration.permission\x20distinct\x20from\x20Service.permission\x20on-chain\x20(E_ARBITRATION_PERMISSION_CONFLICT=33)'),c['push']('ARBITRATION\x20VENUE\x20OWNERSHIP\x20(D-5):\x20the\x20recommended\x20onboarding\x20default\x20is\x20a\x20SELF-BUILT\x20venue\x20—\x20your\x20own\x20Arbitration\x20object\x20with\x20your\x20own\x20permission/admin\x20(voting_guard\x20tpl_voting_guard_open_vote\x20for\x20community\x20cases,\x20tpl_voting_guard_numeric_weight\x20for\x20a\x20named\x20panel).\x20A\x20THIRD-PARTY\x20venue\x20you\x20do\x20not\x20control\x20hands\x20the\x20private\x20key\x20that\x20answers\x20and\x20appeals\x20cases\x20to\x20its\x20operator:\x20an\x20outside\x20store\x27s\x20admin\x20going\x20silent\x20strands\x20your\x20defense\x20(F-16,\x20live-proven).\x20Use\x20an\x20outside\x20venue\x20ONLY\x20when\x20its\x20operator\x20is\x20a\x20named,\x20reachable\x20counterparty\x20the\x20merchant\x20accepts')),a['nodes']['some'](d=>d['id']==='repository')&&c['push']('Repository\x20published\x20and\x20Guard\x20write\x20validation\x20configured'),c['push']('After\x20materialization,\x20confirm\x20the\x20on-chain\x20state\x20matches\x20this\x20plan\x20(query_toolkit\x20query_type=\x27service_panorama\x27)'),c;}function derivePostDeploySteps(a,b=![],c=![]){const d=[];return!b&&(a['adoptedModules']['includes']('refund_guarantee')||a['nodes']['some'](e=>e['id']==='arbitration'))&&(!c&&d['push']({'order':d['length']+0x1,'id':'compensation_fund_topup','title':'Top\x20up\x20the\x20compensation\x20fund','when':'After\x20the\x20Service\x20PUBLISHES\x20successfully\x20(post-publish,\x20before\x20the\x20store\x20goes\x20live\x20to\x20buyers)','action':'Call\x20compensation_fund_add\x20sized\x20>=\x203x\x20a\x20TYPICAL\x20single\x20order\x20(3x\x20=\x20the\x20chain\x27s\x20hard\x20award\x20ceiling,\x20MAX_INDEMNITY_MULTIPLE;\x20above\x203x\x20only\x20buys\x20headroom\x20for\x20concurrent\x20claims).\x20Per-order\x20coverage\x20is\x20enforced\x20at\x20BUY\x20time\x20—\x20each\x20incoming\x20order\x20is\x20checked\x20against\x203x\x20ITS\x20OWN\x20amount\x20and\x20under-covered\x20orders\x20cannot\x20be\x20created\x20—\x20then\x20verify\x20the\x20on-chain\x20fund\x20balance\x20via\x20query_objects','tool_hint':'onchain_operations\x20(service.compensation_fund_add)','failure_if_skipped':'a\x20compensation\x20claim\x20against\x20an\x20empty\x20fund\x20aborts\x20(E_COMPENSATION_NOT_MATCH,\x20testnet\x20lesson\x20R-4)'}),d['push']({'order':d['length']+0x1,'id':'compensation_fund_watch','title':'Watch\x20the\x20compensation-fund\x20water\x20level\x20(recurring\x20keeper\x20step)','when':'Recurring\x20—\x20on\x20every\x20keeper\x20cycle\x20after\x20go-live,\x20and\x20ALWAYS\x20immediately\x20after\x20each\x20arbitration\x20payout\x20posts','action':'Query\x20the\x20on-chain\x20fund\x20balance\x20and\x20classify\x20it\x20with\x20classifyFundWaterLevel(balance,\x20low_water_threshold)\x20into\x20THREE\x20tiers:\x20HEALTHY\x20(balance\x20>=\x20threshold\x20—\x20silence\x20is\x20the\x20healthy\x20signal,\x20no\x20event)\x20/\x20LOW\x20WATER\x20(0\x20<\x20balance\x20<\x20threshold\x20—\x20surface\x20fundWaterReminder:\x20recommend\x20topping\x20up\x20via\x20compensation_fund_add;\x20one\x20large\x20award\x20could\x20make\x20a\x20flagship\x20SKU\x20unbuyable,\x20F-46)\x20/\x20DEPLETED\x20(balance\x200\x20—\x20surface\x20fundWaterReminder\x20LOUD:\x20every\x20claim\x20aborts\x2027\x20and\x20under-covered\x20SKUs\x20are\x20unbuyable).\x20Thresholds\x20are\x20the\x20MERCHANT\x27s\x20call\x20(decision\x207)\x20—\x20recommended\x20anchor:\x20low-water\x20line\x20at\x203x\x20the\x20flagship\x20SKU\x20price\x20(below\x20it\x20the\x20flagship\x20can\x20no\x20longer\x20be\x20bought),\x20healthy\x20line\x20at\x203x\x20the\x20typical\x20order.\x20NEVER\x20block\x20a\x20SKU\x20or\x20gate\x20a\x20claim\x20on\x20the\x20tier\x20—\x20the\x20reminder\x20is\x20the\x20whole\x20feature;\x20the\x20merchant\x20decides\x20(top\x20up\x20/\x20accept\x20the\x20exposure)','tool_hint':'query_toolkit\x20(service_panorama:\x20fund\x20balance)\x20+\x20fund-layer\x20classifyFundWaterLevel\x20+\x20onchain_operations\x20(service.compensation_fund_add)\x20on\x20the\x20merchant\x27s\x20decision','failure_if_skipped':'a\x20drained\x20or\x20low\x20fund\x20is\x20SILENT\x20—\x20the\x20first\x20signal\x20is\x20a\x20buyer\x27s\x20claim\x20aborting\x20(27)\x20or\x20a\x20flagship\x20SKU\x20failing\x20to\x20sell\x20(buy-time\x203x\x20coverage\x20refusal,\x20F-46)'})),a['nodes']['some'](e=>e['id']==='arbitration')&&(d['push']({'order':d['length']+0x1,'id':'arbitration_unpause','title':'Verify\x20the\x20Arbitration\x20is\x20ACTIVE\x20(activation\x20rode\x20the\x20create)','when':'Immediately\x20after\x20materialization\x20—\x20before\x20the\x20store\x20goes\x20live\x20to\x20buyers','action':'The\x20creation\x20plan\x27s\x20arbitration\x20create\x20payload\x20carries\x20pause:false\x20(the\x20chain\x20hardcodes\x20new\x20Arbitrations\x20to\x20paused;\x20the\x20executor\x20composes\x20the\x20unpause\x20in\x20the\x20same\x20transaction)\x20—\x20VERIFY\x20the\x20paused\x20flag\x20reads\x20false\x20via\x20query_toolkit;\x20only\x20an\x20already-paused\x20leftover\x20venue\x20(built\x20before\x20this\x20payload\x20field\x20existed)\x20needs\x20a\x20manual\x20unpause.\x20Keep\x20its\x20Permission\x20distinct\x20from\x20the\x20Service\x20Permission\x20(E_ARBITRATION_PERMISSION_CONFLICT=33)','tool_hint':'query_toolkit\x20(arbitration\x20paused\x20flag);\x20manual\x20unpause\x20via\x20onchain_operations\x20(arbitration\x20pause:false)\x20ONLY\x20for\x20a\x20legacy\x20paused\x20venue','failure_if_skipped':'a\x20paused\x20Arbitration\x20aborts\x20every\x20dispute\x20filing\x20(testnet\x20lesson\x20R-5)'}),d['push']({'order':d['length']+0x1,'id':'arbitration_permission_write','title':'Grant\x20the\x20operator\x20account\x20its\x20venue-management\x20permissions','when':'After\x20the\x20Arbitration\x20object\x20is\x20created,\x20BEFORE\x20any\x20venue-management\x20call\x20(description/guard/fee/pause\x20edits)\x20from\x20the\x20operator\x20account','action':'Write\x20the\x20operator\x20permission\x20row:\x20onchain_operations\x20operation_type=\x27permission\x27,\x20data={object:\x27<arbitration_permission_object>\x27,\x20table:{op:\x27add\x20perm\x20by\x20entity\x27,\x20entity:\x27<operator_account>\x27,\x20index:[350,351,354,356,357,359]}}\x20—\x20350\x20file\x20new\x20cases,\x20351\x20description,\x20354\x20voting_guard\x20management,\x20356\x20pause/resume,\x20357\x20fee,\x20359\x20ruling.\x20The\x20arbitration\x20Permission\x20table\x20starts\x20EMPTY\x20with\x20only\x20the\x20creator\x20seeded\x20as\x20admin,\x20so\x20without\x20this\x20row\x20every\x20operator\x20call\x20aborts\x20on\x20the\x20permission\x20assert.\x20entity\x20must\x20be\x20a\x20FULL\x2066-char\x200x\x20address\x20or\x20a\x20local\x20mark\x20name\x20—\x20a\x20truncated\x20address\x20normalizes\x20to\x20a\x20DIFFERENT\x20on-chain\x20address\x20and\x20grants\x20the\x20wrong\x20row\x20silently','tool_hint':'onchain_operations\x20(permission\x20add\x20perm\x20by\x20entity,\x20indexes\x20350/351/354/356/357/359)','failure_if_skipped':'the\x20operator\x20account\x20holds\x20NO\x20rows\x20in\x20the\x20arbitration\x20Permission\x20table\x20—\x20every\x20venue-management\x20call\x20from\x20it\x20aborts\x20on\x20the\x20permission\x20assert\x20(permission\x20350-359\x20failures)'}),d['push']({'order':d['length']+0x1,'id':'arbitration_arbitrator_grant','title':'Grant\x20the\x20arbitrator\x20account\x20its\x20case-lifecycle\x20permissions','when':'After\x20arbitration_permission_write,\x20BEFORE\x20the\x20first\x20dispute\x20reaches\x20voting','action':'Write\x20the\x20arbitrator\x20permission\x20row:\x20same\x20permission-object\x20call\x20shape\x20with\x20entity:\x27<arbitrator_account>\x27\x20and\x20index:[358,359,360,361,362,363,364]\x20—\x20358\x20vote,\x20359\x20ruling,\x20360\x20feedback,\x20361\x20confirm,\x20362\x20voting-deadline\x20change,\x20363\x20reset,\x20364\x20receive.\x20Note:\x20the\x20disputing\x20CUSTOMER\x20must\x20hold\x20358\x20for\x20their\x20vote\x20to\x20count\x20(a\x20plain\x20vote\x20with\x20an\x20empty\x20voting_guard\x20still\x20asserts\x20358\x20—\x20ungranted,\x20voting\x20collapses\x20to\x20admin-only,\x20E-13);\x20that\x20per-dispute\x20customer\x20grant\x20is\x20issued\x20at\x20filing\x20time,\x20NOT\x20in\x20this\x20step.\x20Full\x2066-char\x20address\x20or\x20mark\x20name\x20only','tool_hint':'onchain_operations\x20(permission\x20add\x20perm\x20by\x20entity,\x20indexes\x20358-364)','failure_if_skipped':'358-364\x20stay\x20creator-admin-only\x20—\x20the\x20named\x20arbitrator\x20cannot\x20vote/rule/confirm,\x20and\x20the\x20customer\x27s\x20vote\x20collapses\x20to\x20admin-only\x20(E-13),\x20dead-locking\x20the\x20first\x20dispute'}),d['push']({'order':d['length']+0x1,'id':'voting_guard_open_vote','title':'Bind\x20the\x20open-vote\x20voting_guard\x20(tpl_voting_guard_open_vote)','when':'After\x20the\x20Arbitration\x20is\x20activated,\x20BEFORE\x20the\x20first\x20dispute\x20can\x20be\x20voted\x20on','action':'Create\x20the\x20open-vote\x20guard\x20(tpl_voting_guard_open_vote:\x20always-true\x20root\x20+\x20FixedValue\x20weight\x201\x20=\x20one\x20person\x20one\x20vote)\x20and\x20set\x20it\x20as\x20the\x20Arbitration\x27s\x20voting_guard;\x20skip\x20this\x20step\x20ONLY\x20for\x20a\x20deliberately\x20closed\x20panel\x20(then\x20bind\x20tpl_voting_guard_numeric_weight\x20with\x20the\x20arbitrator\x20address\x20list\x20instead)','tool_hint':'onchain_operations\x20(guard\x20creation\x20+\x20arbitration\x20voting_guard\x20set,\x20op=\x27set\x27)','failure_if_skipped':'an\x20EMPTY\x20voting_guard\x20dead-locks\x20every\x20plain\x20vote\x20on\x20permission\x20358\x20(creator-admin\x20only)\x20—\x20the\x20first\x20dispute\x20cannot\x20reach\x20a\x20verdict\x20if\x20the\x20admin\x20is\x20unresponsive\x20(crs9-F-36,\x20R-ARB-VOTE-LOCK)'})),a['edges']['some'](f=>f['relation']==='has_order_allocators')&&d['push']({'order':d['length']+0x1,'id':'settlement_alloc_by_guard','title':'Fire\x20settlement\x20via\x20alloc_by_guard\x20(keeper\x20or\x20merchant\x20step)','when':'Recurring\x20—\x20after\x20EACH\x20order\x20reaches\x20its\x20settlement\x20terminal\x20node\x20(declare\x20which\x20node\x20unlocks\x20settlement)','action':'Call\x20alloc_by_guard\x20on\x20the\x20order\x27s\x20allocation\x20with\x20the\x20settlement\x20Guard;\x20reaching\x20the\x20Machine\x20node\x20alone\x20does\x20NOT\x20settle\x20(allocation_state\x20stays\x20pending)','tool_hint':'onchain_operations\x20(allocation.alloc_by_guard);\x20schedule\x20as\x20a\x20keeper\x20step','failure_if_skipped':'orders\x20stall\x20at\x20the\x20settle\x20node\x20with\x20funds\x20locked\x20in\x20escrow\x20(testnet\x20lesson\x20R-2)'}),d['push']({'order':d['length']+0x1,'id':'verify_service_panorama','title':'Verify\x20the\x20on-chain\x20state\x20matches\x20the\x20plan','when':'After\x20all\x20creation\x20steps\x20and\x20the\x20steps\x20above\x20are\x20done','action':'Run\x20the\x20service\x20panorama\x20query\x20and\x20diff\x20it\x20against\x20this\x20plan\x27s\x20blueprint/creation_plan','tool_hint':'query_toolkit\x20query_type=\x27service_panorama\x27','failure_if_skipped':'plan/chain\x20drift\x20(missing\x20binding,\x20wrong\x20allocator\x20order)\x20stays\x20undetected\x20until\x20an\x20order\x20hits\x20it'}),d;}function buildCreationPlan(a){const b=[],c=new Map(a['nodes']['map'](j=>[j['id'],j])),f=new Map();for(const j of a['nodes'])f['set'](j['id'],new Set());for(const k of a['edges']){if(!f['has'](k['from'])||!c['has'](k['to']))continue;const l=relationDirection(k['relation'])==='to_depends_on_from',m=l?k['to']:k['from'],o=l?k['from']:k['to'];if(m===o||!f['has'](m))continue;f['get'](m)['add'](o);}for(const p of a['nodes']){for(const q of Object['values'](p['config'])){q['type']==='address_ref'&&q['targetId']!==p['id']&&f['has'](q['targetId'])&&f['get'](p['id'])['add'](q['targetId']);}}{const r=GUARD_AFTER_SERVICE_DRAFT,s=a['nodes']['filter'](t=>t['type']===r['provider'])['map'](t=>t['id']);if(s['length']>0x0)for(const t of a['nodes']){if(t['type']!==r['dependent'])continue;const u=f['get'](t['id']);if(u===undefined)continue;for(const v of s)u['add'](v);}}const g=new Map([...f]['map'](([w,x])=>[w,[...x]])),h=[],i=new Map(f);while(i['size']>0x0){const w=[...i['entries']()]['filter'](([,x])=>x['size']===0x0)['map'](([x])=>x);if(w['length']===0x0){h['push'](...i['keys']());break;}w['sort']();for(const x of w){h['push'](x),i['delete'](x);for(const y of i['values']())y['delete'](x);}}return h['forEach']((z,A)=>{const B=c['get'](z),C=B['config']['name'],D=C?.['type']==='string'?C['value']:z,E=D['includes']('/')?D['replaceAll']('/','__'):D,F=z==='arbitration'?'Create\x20'+B['type']+'\x20via\x20onchain_operations\x20WITH\x20pause:false\x20(creation-time\x20activation),\x20then\x20configure.\x20Purpose:\x20'+B['purpose']:'Create\x20'+B['type']+'\x20via\x20onchain_operations,\x20then\x20configure.\x20Purpose:\x20'+B['purpose'];b['push']({'order':A+0x1,'node_id':z,'object_type':B['type'],'suggested_name':E,'depends_on':g['get'](z)??[],'operation_hint':F});}),b;}function resolveTemplate(a,b){if(!a)return undefined;const c=getTemplate(a);if(c)return c;const d=getTemplatesByIndustry(a);if(b){const f=b['toLowerCase'](),g=d['filter'](h=>{const i=String(h['product_ref']??'')['trim']()['toLowerCase']();return i['length']>0x0&&f['includes'](i);});if(g['length']===0x1)return g[0x0];}const e=getScenarioMode(a)?.['default_template'];if(e){const h=getTemplate(e);if(h)return h;}if(d['length']>0x0)return d[0x0];return undefined;}export const GAS_PER_ORDER_SMALLEST=0x5b8d80;export const MIN_ECONOMIC_ORDER_SMALLEST=0x2faf080;const GAS_RATIO_WARN_THRESHOLD=0.1,wow=a=>Number((a/0x3b9aca00)['toFixed'](0x6))+'\x20WOW';export function gasEconomicsWarnings(a,b){const c=[],d=(a??[])['map'](j=>Number(j?.['price']))['filter'](j=>Number['isFinite'](j)&&j>0x0);if(d['length']===0x0)return c;const e=Math['min'](...d),f=Number(b),g=Number['isFinite'](f)&&f>0x0?f:0x0,h=g+GAS_PER_ORDER_SMALLEST,i=h/e;if(e<MIN_ECONOMIC_ORDER_SMALLEST)c['push']('GAS\x20ECONOMY\x20(ddmc4\x20B-39\x20/\x20ks7\x20A-10):\x20the\x20cheapest\x20SKU\x20is\x20'+wow(e)+'\x20—\x20below\x20the\x20≈'+wow(MIN_ECONOMIC_ORDER_SMALLEST)+'\x20minimum\x20ECONOMIC\x20per-order\x20price.\x20'+('Measured\x20settlement\x20gas\x20is\x20≈'+wow(GAS_PER_ORDER_SMALLEST)+'\x20per\x20transaction')+(g>0x0?',\x20plus\x20'+wow(g)+'\x20cashback\x20per\x20claim':'')+('\x20—\x20per-order\x20overhead\x20≈'+wow(h)+'\x20('+Math['round'](i*0x64)+'%\x20of\x20this\x20SKU).\x20')+'Micro-priced\x20SKUs\x20lose\x20their\x20entire\x20margin\x20to\x20gas:\x20raise\x20the\x20price,\x20drop\x20the\x20per-claim\x20cashback,\x20or\x20batch\x20settlements.');else i>GAS_RATIO_WARN_THRESHOLD&&c['push']('GAS\x20ECONOMY\x20(ks7\x20A-10):\x20cashback\x20+\x20settlement\x20gas\x20≈'+wow(h)+'\x20per\x20order\x20is\x20'+Math['round'](i*0x64)+'%\x20of\x20the\x20cheapest\x20SKU\x20('+wow(e)+')\x20—\x20above\x20the\x2010%\x20warning\x20line.\x20'+'Trim\x20the\x20per-claim\x20cashback\x20or\x20raise\x20the\x20price.');return c;}export async function handleMerchantGuide(a){const b=a['guide_state']??{'intent_text':''},d=a['guide_confirm']??{},e={'intent_text':(a['intent']??b['intent_text']??'')['trim'](),'confirmed_industry':d['industry']??b['confirmed_industry'],'currency':d['currency']??b['currency'],'deliverables':d['deliverables']??b['deliverables'],'payment_override':d['payment']??b['payment_override'],'trust_override':d['trust']??b['trust_override'],'adopted_module_ids':d['adopted_module_ids']??b['adopted_module_ids'],'guard_resolutions':{...b['guard_resolutions']??{},...d['guard_resolutions']??{}},'review_mode':d['review_mode']??b['review_mode'],'reward_funding':d['reward_funding']??b['reward_funding'],'reward_claim_amount':d['reward_claim_amount']??b['reward_claim_amount'],'after_sales_mode':d['after_sales_mode']??b['after_sales_mode'],'acceptance_mode':d['acceptance_mode']??b['acceptance_mode'],'installment_mode':d['installment_mode']??b['installment_mode'],'affiliate_mode':d['affiliate_mode']??b['affiliate_mode'],'crowdfunding_mode':d['crowdfunding_mode']??b['crowdfunding_mode'],'logistics_mode':d['logistics_mode']??b['logistics_mode'],'supply_chain':d['supply_chain']??b['supply_chain'],'sales':d['sales']??b['sales']};for(const T of Object['keys'](e)){if(e[T]===undefined)delete e[T];}if(e['guard_resolutions']&&Object['keys'](e['guard_resolutions'])['length']===0x0)delete e['guard_resolutions'];if(!e['intent_text'])throw new Error('merchant_guide\x20requires\x20\x27intent\x27\x20(business\x20description)\x20for\x20Step\x201.\x20'+'Example:\x20intent=\x27I\x20want\x20to\x20offer\x20online\x20design\x20service\x20with\x20milestone\x20payments\x27.\x20'+'Pass\x20the\x20returned\x20guide_state\x20back\x20UNCHANGED\x20on\x20subsequent\x20calls,\x20plus\x20guide_confirm\x20for\x20merchant\x20decisions.');const f=await analyzeIntent(e['intent_text'],{'preferredIndustry':e['confirmed_industry'],'currency':e['currency']});if(!e['confirmed_industry'])return{'action':'merchant_guide','current_step':0x2,'step_name':'Industry\x20Matching','guide_state':e,'intent_draft':f['intent'],'industry_options':{'inferred':f['inferredIndustry'],'confidence':f['industryConfidence'],'similar':f['similarIndustries']},'warnings':f['warnings'],'next_action':'Confirm\x20the\x20industry\x20by\x20calling\x20merchant_guide\x20again\x20with\x20guide_state\x20(UNCHANGED)\x20'+('plus\x20guide_confirm={\x20industry:\x20\x27<one\x20of:\x20'+f['similarIndustries']['join'](',\x20')+'\x20—\x20or\x20any\x20other\x20industry\x20id>\x27\x20}')};const g={...f['intent'],'industry':e['confirmed_industry'],'deliverables':e['deliverables']??f['intent']['deliverables'],'payment':{...f['intent']['payment'],...e['payment_override']??{}},'trust':{...f['intent']['trust'],...e['trust_override']??{}}},h=!!e['adopted_module_ids'],i=e['adopted_module_ids']?e['adopted_module_ids']['map'](U=>getCapability(U))['filter'](U=>!!U):recommendCapabilities(e['confirmed_industry'],e['intent_text'],{'maxCapabilities':0x5}),j=a['template_override']??resolveTemplate(e['confirmed_industry'],e['intent_text']);if(!j)throw new Error('No\x20compilable\x20template\x20found\x20for\x20industry\x20\x27'+e['confirmed_industry']+'\x27.\x20'+'Register\x20a\x20template\x20via\x20industry_pack_operation\x20or\x20pass\x20template_override\x20explicitly.');const l=resolveUserInputQuestions(j),m={'currency':e['currency']??g['payment']['currency'],...e['payment_override']?{'payment':e['payment_override']}:{},...e['trust_override']?{'trust':e['trust_override']}:{},...e['deliverables']?{'deliverables':e['deliverables']}:{},...e['adopted_module_ids']?{'adopted_module_ids':e['adopted_module_ids']}:{},...e['review_mode']?{'review_mode':e['review_mode']}:{},...e['reward_funding']!==undefined?{'reward_funding':e['reward_funding']}:{},...e['reward_claim_amount']!==undefined?{'reward_claim_amount':e['reward_claim_amount']}:{},...e['after_sales_mode']?{'after_sales_mode':e['after_sales_mode']}:{},...e['acceptance_mode']?{'acceptance_mode':e['acceptance_mode']}:{},...e['installment_mode']?{'installment_mode':e['installment_mode']}:{},...e['affiliate_mode']?{'affiliate_mode':e['affiliate_mode']}:{},...e['crowdfunding_mode']?{'crowdfunding_mode':e['crowdfunding_mode']}:{},...e['logistics_mode']?{'logistics_mode':e['logistics_mode']}:{},...e['sales']?.['length']?{'sales':e['sales']}:{},...e['fee_overrides']??{}},n={};Object['assign'](n,e['guard_resolutions']??{});const o=compileTemplate(j,m,{'nameBase':a['name_base']??j['id'],'intent':e['intent_text'],'guardResolutions':n,'buildTimeMs':Date['now'](),...e['supply_chain']!==undefined&&e['supply_chain']['length']>0x0?{'supplyChain':e['supply_chain']}:{}}),p=reflux(o['plan']),q=p['plan'],r=p['audit'],s=auditScore(r),t=planBlueprint(q,g,i['map'](U=>U['id'])),u=o['blockers']['map'](U=>({'module':'template','missing_constraints':[U['code']],'fix':U['detail']})),w=derivePlanSatisfiedConstraints(t,g),x={'paymentModel':e['payment_override']?.['model'],'trustArbitration':e['trust_override']?.['arbitration'],'trustRefundPolicy':e['trust_override']?.['refundPolicy'],'proofsOfDelivery':e['deliverables']?.['map'](U=>U['proofOfDelivery']),'allocationCount':e['payment_override']?.['allocation']?.['length']},y=i['map'](U=>{const V=capabilityIntentEvidence(U,e['intent_text'],x);return checkCapabilityConstraints(U,w,{'evidenceMatched':h||V['matched'],'evidence':V});}),z=j['compensation_fund_policy']==='forbidden',A=deriveDeployTimeChecks(t,z),B=derivePostDeploySteps(t,z,q['steps']['some'](U=>U['op']==='configure'&&U['id']==='service_compensation'&&U['method']==='compensation_fund_add')),C=t['edges']['some'](U=>U['relation']==='has_order_allocators')?recipientDesignGuidance()['map'](U=>({'id':U['id'],'move_recipient':U['move_recipient'],'semantics':U['semantics'],'required_constraints':U['required_constraints'],'finding_if_unmet':U['finding_if_unmet']})):undefined,D=r['findings']['filter'](U=>U['level']==='critical'||U['level']==='high')['map'](U=>({'module':'audit','missing_constraints':[U['rule_id']],'fix':U['title']+'\x20—\x20'+(U['mitigation']??U['description'])})),E=[{'re':/allocat|refund|recover|claimed_by|settle|escrow/i,'scene':'service_order_allocators_guard'},{'re':/\bbuy\b|purchase|allowlist|blocklist/i,'scene':'service_buy_guard'},{'re':/reward/i,'scene':'reward_claim'},{'re':/write_guard|repository_write/i,'scene':'repository_write_guard'},{'re':/arbitrat|ruling|voting/i,'scene':'arbitration_usage_guard'},{'re':/forward|node|witness|deliver|review|cancel|expire|submission|progress/i,'scene':'machine_forward_guard'}],F=[{'re':/claimed_by\s*some\s*==\s*true/i,'tpl':'tpl_allocator_node_gate_recover'},{'re':/claimed_by\s*some\s*==\s*false|claimed_by\s*(?:is\s+)?none|\brefund|\bcancel/i,'tpl':'tpl_allocator_node_gate_refund'},{'re':/claimed_by\s*some|\brecover|\baward/i,'tpl':'tpl_allocator_node_gate_recover'}],G=[{'host':'machine','re':/pattern\.time_lock_progress/i,'tpl':'tpl_time_lock_progress'},{'host':'machine','re':/pattern\.time_window_upper_bound/i,'tpl':'tpl_time_window_upper'},{'host':'reward','re':/pattern\./i,'tpl':'tpl_reward_one_time_claim'}],H=(U,V,W,X,Y)=>{let Z;const a0=/tpl_[a-z0-9_]+/['exec'](U+'\x20'+V),a1=X==='machine'||X==='machine_forward'?'machine_forward_guard':X==='reward'?'reward_claim':X==='repository'?'repository_write_guard':X==='arbitration'?'arbitration_usage_guard':undefined;if(a0!==null){const a6=GUARD_TEMPLATES['find'](a7=>a7['id']===a0[0x0])?.['scene_id'];a6!==undefined&&(a1===undefined||a6===a1||a6==='service_order_allocators_guard'&&X!=='reward')&&(Z=a6);}Z===undefined&&X!=='reward'&&!G['some'](a7=>a7['host']===(X==='machine_forward'?'machine':X)&&a7['re']['test'](U))&&/\ballocators?\b|claimed_by|guard_identifier|order_allocators/i['test'](V)&&(Z='service_order_allocators_guard');if(Z===undefined){if(a1!==undefined)Z=a1;else{const a7=E['find'](a8=>a8['re']['test'](U+'\x20'+V));Z=a7?.['scene'];}}if(Z===undefined)return undefined;const a2=getTemplatesByScene(Z);let a3=W!==undefined&&a2['some'](a8=>a8['applicable_industries']['includes'](W))?a2['filter'](a8=>a8['applicable_industries']['includes'](W)):a2;if(/\btime[_-]?lock|\bwindow|\btimeout|\bduration|\bdeadline|\bdays?\b|\bclock|\bdelay/i['test'](U+'\x20'+V)){const a8=a3['filter'](a9=>JSON['stringify'](a9['example_root']??{})['toLowerCase']()['includes']('clock'));if(a8['length']===0x0)return undefined;a3=a8;}if(Y['length']>0x0){const a9=a0!==null?a3['find'](ab=>ab['id']===a0[0x0]):undefined,aa=a3['filter'](ab=>{const ac=[];if(ab['example_root']!==undefined){const ad=JSON['stringify'](ab['example_root']);for(const ae of ad['matchAll'](/"query":"([^"]+)"/g))ac['push'](ae[0x1]);if(ad['includes']('\x22type\x22:\x22query_progress_history_time\x22'))ac['push']('progress.history.time');if(ad['includes']('\x22type\x22:\x22query_progress_history_find\x22'))ac['push']('progress.history.find');}return ac['some'](af=>Y['some'](ag=>af===ag||af['startsWith'](ag)||ag['startsWith'](af)));});if(a9!==undefined&&!aa['includes'](a9))aa['push'](a9);if(aa['length']===0x0)return undefined;a3=aa;}const a4=X==='machine_forward'?'machine':X,a5=G['find'](ab=>ab['host']===a4&&ab['re']['test'](U+'\x20'+V)&&a3['some'](ac=>ac['id']===ab['tpl']));a5!==undefined&&(a3=[...a3]['sort']((ab,ac)=>(ab['id']===a5['tpl']?0x0:0x1)-(ac['id']===a5['tpl']?0x0:0x1)));if(Z==='service_order_allocators_guard'){const ab=F['find'](ac=>ac['re']['test'](U+'\x20'+V));ab!==undefined&&(a3=[...a3]['sort']((ac,ad)=>(ac['id']===ab['tpl']?0x0:0x1)-(ad['id']===ab['tpl']?0x0:0x1)));}return a3['slice'](0x0,0x3)['map'](ac=>({'template_id':ac['id'],'name':ac['name'],'parameters':ac['parameters']['map'](ad=>({'name':ad['name'],'required':ad['required'],...ad['default']!==undefined?{'default':ad['default']}:{},'description':ad['description']}))}));},I=[],J=o['unresolved']['map'](U=>{const V=getGuardDesignPattern(U['template_id']),W=H(U['template_id'],U['purpose'],j?.['industry'],U['host'],V?.['key_queries']??[]),X=new Set((j?.['machine_shape']??[])['flatMap'](a6=>(a6['from']??[])['map'](a7=>typeof a7==='string'?undefined:a7['guard_key'])['filter'](a7=>typeof a7==='string'))),Y=new Map((j?.['allocator']['rows']??[])['filter'](a6=>typeof a6['guard_key']==='string')['map'](a6=>[a6['guard_key'],a6])),Z=Y['get'](U['key']),a0=Z!==undefined&&!X['has'](U['key']),a1=!X['has'](U['key'])&&!Y['has'](U['key'])&&U['policy']===undefined&&U['host']!=='reward'&&!(U['host']==='service'&&U['key']==='buy'),a2=U['host']==='service'&&U['key']==='buy';if(!a1&&!a2)I['push'](U['key']);const a3=U['key']['toLowerCase'](),a4=(U['purpose']??'')['toLowerCase'](),a5=/recover|award/['test'](a3)||!/refund/['test'](a3)&&/recover|award/['test'](a4)?'NODE\x20GATE\x20REQUIRED\x20(the\x20sketch\x20above\x20omits\x20it):\x20this\x20recovery\x20rail\x20is\x20a\x20terminal-node-gated\x20sweep\x20—\x20resolve\x20the\x20gate\x20to\x20fire\x20only\x20when\x20the\x20order\x20has\x20reached\x20the\x20recovery\x20terminal\x20nodes\x20(tpl_allocator_node_gate_recover\x20family\x20carries\x20the\x20node-gate\x20slot\x20set;\x20NEVER\x20slot\x20254).\x20NEVER\x20add\x20an\x20order.claimed_by\x20leg:\x20fund\x20rails\x20never\x20read\x20the\x20claimed_by\x20axis\x20(decision\x2011,\x20R-FUND-RAIL-CLAIMED-BY\x20/\x20RAIL_CLAIMED_BY_LEG\x20critical).':/refund/['test'](a3)||!/recover|award/['test'](a3)&&/refund/['test'](a4)?'NODE\x20GATE\x20REQUIRED\x20(the\x20sketch\x20above\x20omits\x20it):\x20this\x20refund\x20rail\x20may\x20only\x20fire\x20at\x20its\x20refund\x20terminal\x20node\x20—\x20resolve\x20the\x20gate\x20against\x20order\x20node\x20state,\x20never\x20against\x20order.claimed_by\x20(fund\x20rails\x20NEVER\x20read\x20the\x20claimed_by\x20axis;\x20decision\x2011,\x20R-FUND-RAIL-CLAIMED-BY\x20/\x20RAIL_CLAIMED_BY_LEG\x20critical).\x20The\x20arbitration\x20award\x20is\x20the\x20indemnity\x20track\x27s\x20separate\x20commercial\x20payout\x20—\x20any\x20refund/award\x20overlap\x20is\x20legal\x20and\x20disclosed\x20at\x20the\x20MCP\x20dual-payout\x20confirmation\x20gate.':undefined;return{'key':U['key'],'template_id':U['template_id'],'host':U['host'],'purpose':U['purpose'],'bound':!a1&&!a2,...V?.['logic_summary']?{'logic_summary':V['logic_summary']}:{},...a5?{'logic_summary_note':a5}:{},...V?.['key_queries']?.['length']?{'key_queries':V['key_queries']}:{},...W!==undefined&&W['length']>0x0?{'suggested_templates':W}:{},'how_to_resolve':'guide_confirm.guard_resolutions[\x27'+U['key']+'\x27]\x20=\x20{\x20kind:\x20\x27inline\x27,\x20table,\x20root\x20}\x20(a\x20resolved\x20Guard),\x20'+'or\x20{\x20kind:\x20\x27template\x27,\x20template_id:\x20\x27tpl_*\x27,\x20params\x20}\x20when\x20a\x20guard\x20template\x20matches\x20this\x20design'+(W!==undefined&&W['length']>0x0?'\x20(suggested_templates\x20below\x20list\x20the\x20matching\x20executable\x20forms\x20and\x20their\x20parameters)':'.')+(U['host']==='machine'&&!a0?'\x20MACHINE-HOST\x20REQUIREMENT:\x20the\x20inline\x20table\x20MUST\x20declare\x20the\x20protocol\x20task-binding\x20slot\x20'+'{\x20identifier:\x20254,\x20b_submission:\x20true,\x20value_type:\x20\x22Address\x22\x20}\x20—\x20the\x20forward\x27s\x20passport\x20only\x20emits\x20'+'DECLARED\x20slots,\x20so\x20a\x20machine-forward\x20guard\x20without\x20this\x20row\x20aborts\x20EVERY\x20order-bound\x20forward\x20'+'it\x20gates\x20(code\x2011)\x20and\x20the\x20pre-publish\x20gate\x20blocks\x20the\x20Machine\x20publish.':'')+(a0?'\x20ALLOCATOR-RAIL\x20NOTE:\x20this\x20design\x20gates\x20an\x20allocator\x20rail\x20(not\x20a\x20machine\x20forward)\x20—\x20do\x20NOT\x20add\x20the\x20'+'254\x20task-binding\x20slot:\x20a\x20254\x20declaration\x20arms\x20once-per-order\x20replay\x20protection\x20at\x20alloc\x20time\x20'+'(allocation\x20ONCE_FOR_OBJECT)\x20and\x20permanently\x20blocks\x20multi-fire\x20rails\x20(a\x20second\x20release\x20aborts\x20'+'E_ONCE_TRIGGERED).\x20The\x20kernel\x20injects\x20254\x20ONLY\x20for\x20GuardIdentifier(254)-recipient\x20rails.'+(Z['recipient']==='guard_identifier'&&Z['recipient_key']!=='254'?'\x20This\x20rail\x27s\x20recipient\x20is\x20GuardIdentifier('+(Z['recipient_key']??'0')+')\x20—\x20the\x20inline\x20table\x20MUST\x20'+('declare\x20slot\x20'+(Z['recipient_key']??'0')+'\x20as\x20an\x20Address\x20submission\x20instead\x20(N-K21:\x20the\x20passport\x20')+'submits\x20the\x20ORDER\x20address\x20into\x20it;\x20an\x20undeclared\x20slot\x20makes\x20the\x20rail\x20unexecutable).':''):'')+(a1?'\x20ADVISORY\x20DESIGN\x20(run75747\x20F-38):\x20nothing\x20in\x20this\x20archetype\x20binds\x20this\x20key\x20—\x20no\x20machine\x20edge,\x20allocator\x20'+'rail,\x20repository\x20policy,\x20or\x20service\x20mount.\x20If\x20this\x20design\x20does\x20not\x20apply\x20to\x20your\x20shop\x20you\x20may\x20resolve\x20'+'it\x20with\x20{\x20kind:\x20\x27omit\x27\x20}\x20instead\x20of\x20building\x20a\x20Guard\x20no\x20one\x20consumes:\x20the\x20design\x20leaves\x20'+'pending_guard_designs,\x20no\x20Guard\x20object\x20is\x20created,\x20and\x20the\x20decision\x20is\x20recorded\x20in\x20the\x20build\x27s\x20'+'warnings.\x20An\x20omit\x20of\x20a\x20BOUND\x20design\x20is\x20refused\x20(GUARD_OMIT_UNSUPPORTED).':'')};}),K=u['length']>0x0||r['blocking'],L={'expiredTerminal':(j['machine_shape']??[])['some'](U=>/expire|deadline|timeout/i['test'](String(U?.['name']??'')))},M=checkGameTheoryConstraints(t,g,L),N=[];for(const U of requirementCoverage(e['intent_text'],j)){if(U['status']==='mapped')continue;N['push']({'id':U['family'],'label':U['label'],'severity':U['status']==='blocker'&&U['family']==='fulfillment'?'critical':'medium','message':'Intent\x20promises\x20\x27'+U['label']+'\x27\x20(stated:\x20\x22'+U['evidence']+'\x22)\x20but\x20the\x20matched\x20template\x20does\x20not\x20carry\x20it:\x20'+U['note'],'fix':U['note']});}for(const V of y){if(V['adopted']||V['evidence_matched']!==![])continue;N['push']({'id':'module_'+V['capability'],'label':V['capability'],'severity':'info','message':'Module\x20\x27'+V['capability']+'\x27\x20rides\x20score\x20alone\x20(no\x20intent\x20evidence):\x20its\x20objects\x20ARE\x20included\x20in\x20this\x20build\x20—\x20an\x20UNCONFIRMED\x20adoption.','fix':'Confirm\x20via\x20guide_state.adopted_module_ids,\x20answer\x20the\x20structured\x20payment/trust\x20questions,\x20or\x20rebuild\x20with\x20an\x20adoption\x20list\x20that\x20omits\x20it.'});}const O=assessWorkflowDesign(t,{'gaps':N}),P=buildCreationPlan(t),Q=[...new Set(q['steps']['filter'](W=>typeof W['account']==='string')['map'](W=>W['account']))]['sort'](),R=[...collectLateMarks(q)]['sort'](),S=j?{'name':j['id'],'display_name':j['variant']+'\x20archetype\x20('+j['industry']+')','source':a['template_override']?'custom':'builtin','risk_appetite':'medium','key_risk':j['key_risk'],'machine_shape':j['machine_shape']['map'](W=>({'name':W['name'],'role':W['role'],...W['operator']?{'operator':W['operator']}:{},...W['semantic_role']?{'semantic_role':W['semantic_role']}:{}})),'guards':j['guards']['map'](W=>({'template_id':W['template_id'],'host':W['host'],'purpose':W['purpose']})),'allocator':j['allocator'],'risk_constraints':{},'build_notes':j['build_notes']??[],...j['time_anchors']?{'time_anchors':j['time_anchors']}:{}}:undefined;return{'action':'merchant_guide','current_step':K?0x9:0xa,'step_name':K?'Harness\x20Check\x20(issues\x20found)':'Submission\x20Plan\x20Ready','guide_state':{...e,'adopted_module_ids':i['map'](W=>W['id'])},'intent':{'intent_type':g['intent'],'industry':g['industry'],'roles':g['roles'],'deliverables':g['deliverables'],'payment':g['payment'],'trust':g['trust']},'adopted_modules':i['map'](W=>({'id':W['id'],'name':W['name'],'description':W['description'],'requires_keeper':W['requiresKeeper'],'keeper_hint':W['keeperHint'],'user_protections':W['userProtections'],'merchant_obligations':W['merchantObligations']})),'mode_prior':S,...l['length']>0x0?{'user_input_questions':l,'user_input_note':'Collect\x20each\x20answer\x20and\x20pass\x20it\x20back\x20as\x20guide_state.fee_overrides[\x27<param_key>\x27]\x20on\x20the\x20next\x20merchant_guide\x20call;\x20unanswered\x20questions\x20keep\x20the\x20template\x20default.'}:{},...S?.['time_anchors']?{'time_anchor_instructions':Object['entries'](S['time_anchors'])['map'](([W,X])=>{const Y=X['startsWith']('order.time')?'\x20(order-creation\x20time\x20—\x20PRE-checkout\x20branches\x20only;\x20a\x20post-checkout\x20window\x20anchored\x20here\x20is\x20unreachable)':X['startsWith']('progress.current_time')?'\x20(entry\x20time\x20of\x20the\x20window\x27s\x20source\x20node\x20—\x20witness-derived\x20via\x20OrderProgress,\x20one\x20Guard\x20serves\x20every\x20order)':X['startsWith']('absolute_date')?'\x20(per-order\x20instance\x20Guard\x20—\x20the\x20absolute\x20date\x20differs\x20per\x20booking)':'';return'Time\x20windows\x20for\x20\x27'+W+'\x27\x20anchor\x20to\x20'+X+Y;})}:{},'blueprint':{'nodes':t['nodes']['map'](W=>({'id':W['id'],'type':W['type'],'purpose':W['purpose']})),'edges':t['edges']['map'](W=>({'from':W['from'],'to':W['to'],'relation':W['relation'],'required':W['required']}))},'evaluation_preview':{'estimatedRiskScore':s,'estimatedCompletenessScore':Math['min'](0x64,0x1e+i['length']*0x8),'keyRisks':r['findings']['filter'](W=>W['level']==='critical'||W['level']==='high')['map'](W=>W['title']),'strengths':r['findings']['filter'](W=>W['level']==='info')['map'](W=>W['title']),'moduleBoosts':{}},'graph_validation':{'valid':r['issues']['length']===0x0,'hard_violations':r['issues']['map'](W=>({'id':W['code'],'description':W['detail'],'fix':'Fix\x20the\x20Plan\x20structure'})),'soft_notes':r['findings']['filter'](W=>W['level']==='medium'||W['level']==='low')['map'](W=>({'id':W['rule_id'],'description':W['title']}))},'harness_check':{'module_constraints':y['map'](W=>{const X=W['capability']==='discount_lifecycle'&&W['adopted']?'ADOPTION-BASED\x20satisfaction\x20(disclosure\x20obligations\x20accepted\x20with\x20module\x20adoption),\x20NOT\x20plan\x20structure:\x20creation_plan\x20intentionally\x20carries\x20no\x20Discount/SKU\x20nodes\x20—\x20they\x20are\x20minted\x20in\x20merchant\x20post-deploy\x20steps\x20and\x20verified\x20on-chain\x20after\x20deploy\x20(query\x20the\x20minted\x20Service.discount).\x20Reward\x20FUNDING\x20rides\x20review_mode\x20compile\x20emission,\x20BUT\x20the\x20reward\x20claim\x20GUARD\x20SPEC\x20must\x20still\x20be\x20declared\x20in\x20the\x20plan\x27s\x20guards[]\x20(host:\x27reward\x27)\x20—\x20compile\x20emits\x20the\x20rail\x20only\x20from\x20that\x20spec,\x20and\x20REVIEW_REWARD_GUARD_MISSING\x20hard-blocks\x20publish\x20when\x20it\x20is\x20omitted\x20(G-02,\x20onlyfans-mn\x20261019:\x20the\x20old\x20prose\x20denied\x20the\x20guard\x20spec\x20and\x20deadlocked\x20every\x20reward\x20publish).':W['reason'],Y=W['evidence_matched']===![]?W['reason']:X;return{'module':W['capability'],'plan_satisfied':W['adopted'],'missing':W['missingConstraints'],'reason':Y,'findings':W['findings'],'evidence_matched':W['evidence_matched']};}),'blocking_issues':[...u['map'](W=>({'module':W['module'],'missing_constraints':W['missing_constraints'],'fix':W['fix']})),...D],'module_gaps':y['filter'](W=>!W['adopted'])['map'](W=>({'module':W['capability'],'missing_constraints':W['missingConstraints'],'fix':W['reason']})),'deploy_time_checks':A,'recipient_design_guidance':C},'game_theory':{'summary':M['summary'],'coverage':M['coveredCount']+'/'+M['totalCount'],'exposed_scenarios':M['exposedScenarios'],'wow_alignments':M['wowAlignments'],'scenarios':M['results']['map'](W=>({'scenario':W['scenario'],'covered':W['covered'],'conflict':W['conflict'],'user_protection':W['userProtection'],'evaluation_metric':W['evaluationMetric'],'recommendation':W['recommendation']}))},'workflow_design_assessment':{'score':O['score'],'summary':O['summary'],'findings':O['findings']['map'](W=>({'kind':W['kind'],'severity':W['severity'],'message':W['message'],'fix':W['fix']})),'checks':O['checks']['map'](W=>({'id':W['id'],'dimension':W['dimension'],'passed':W['passed'],'severity':W['severity'],'message':W['message'],'fix':W['fix']}))},'creation_plan':P,'post_deploy_steps':B,...o['supplyChain']!==undefined?{'supply_chain':o['supplyChain']['map'](W=>({'steps':W['steps']['map'](X=>X['id']),'inputs':W['inputs'],'primitives':W['primitives'],'notes':W['notes'],...W['handoff']!==undefined?{'handoff':W['handoff']}:{}}))}:{},'mandatory_disclosures':['PII\x20discipline\x20(rex5\x20B-57):\x20never\x20write\x20personal\x20data\x20(phone,\x20email,\x20exact\x20unit\x20address)\x20into\x20public\x20on-chain\x20fields\x20—\x20Contact\x20description/location/IM\x20entries,\x20repository\x20rows,\x20progress\x20messages\x20and\x20WIP\x20text\x20are\x20all\x20public.\x20Exchange\x20PII\x20over\x20the\x20encrypted\x20Messenger\x20and\x20keep\x20only\x20WTS\x20proofs\x20on\x20chain;\x20the\x20local\x20harness\x20store\x20is\x20non-private\x20too\x20(cache.db\x20holds\x20messenger\x20plaintext\x20and\x20LocalInfo\x20entries\x20unencrypted\x20on\x20disk,\x20readable\x20by\x20any\x20session\x20sharing\x20the\x20keystore).','Trust-claim\x20prose\x20is\x20not\x20a\x20chain\x20anchor\x20(rex5\x20T-31):\x20any\x20compensation-fund\x20or\x20protection\x20figure\x20quoted\x20in\x20the\x20service\x20description\x20is\x20free\x20text\x20—\x20awards\x20shrink\x20the\x20live\x20fund\x20in\x20place\x20(the\x20quoted\x20number\x20silently\x20goes\x20stale)\x20and\x20the\x20per-order\x20covered\x20ceiling\x20is\x20fund/3\x20(MAX_INDEMNITY_MULTIPLE),\x20not\x20the\x20headline.\x20Keep\x20quoted\x20numbers\x20synced\x20to\x20the\x20live\x20fund\x20balance\x20before\x20publishing\x20and\x20after\x20every\x20award.','Single-account\x20build\x20contract\x20(MN5-5R\x20decision):\x20this\x20pipeline\x20wires\x20ONLY\x20the\x20deploying\x20account\x20—\x20the\x20permission\x20layer\x27s\x20admin\x20pass-through\x20means\x20a\x20single-account\x20build\x20needs\x20zero\x20grants,\x20so\x20no\x20other\x20account\x20is\x20ever\x20granted.\x20A\x20multi-account\x20shop\x20(separate\x20keeper/staff/operator\x20accounts)\x20will\x20be\x20REFUSED\x20at\x20execution\x20time\x20(error\x20codes\x201000/1002\x20and\x20the\x20350~364\x20abort\x20family)\x20—\x20the\x20plan\x20will\x20look\x20complete\x20and\x20still\x20fail\x20on\x20first\x20non-admin\x20operation.\x20Until\x20an\x20explicit\x20account-grant\x20phase\x20ships,\x20run\x20multi-account\x20shops\x20by\x20declaring\x20the\x20limitation\x20up\x20front\x20and\x20granting\x20roles\x20manually\x20post-publish;\x20do\x20not\x20let\x20the\x20plan\x27s\x20completeness\x20imply\x20multi-account\x20readiness.'],...J['length']>0x0?{'pending_guard_designs':J}:{},...J['length']>0x0&&(q['pending_guards']?.['length']??0x0)!==J['length']?{'pending_count_note':'Two\x20counts,\x20two\x20views:\x20pending_guard_designs\x20lists\x20'+J['length']+'\x20unresolved\x20design(s)\x20(compile\x20view\x20—\x20includes\x20advisory\x20designs\x20with\x20no\x20edge/rail/policy/buy\x20mount);\x20'+('the\x20plan\x20audit\x20counts\x20'+(q['pending_guards']?.['length']??0x0)+'\x20(plan\x20view\x20—\x20site-bound\x20designs\x20only;\x20the\x20rule-pack\x20titles\x20\x22of\x20N\x20pending\x20in\x20total\x22\x20quote\x20this).\x20')+'The\x20LIST\x20is\x20the\x20resolution\x20fill\x20space;\x20the\x20audit\x20number\x20is\x20its\x20site-bound\x20subset.'}:{},'warnings':[...f['warnings'],...gasEconomicsWarnings(e['sales'],e['reward_claim_amount']),...o['omitted']['length']>0x0?['Advisory\x20guard\x20design(s)\x20omitted\x20by\x20decision\x20({kind:\x27omit\x27}):\x20'+o['omitted']['join'](',\x20')+'\x20—\x20'+'no\x20Guard\x20created,\x20nothing\x20binds\x20them\x20(run75747\x20F-38).']:[],...(o['supplyChain']??[])['flatMap']((W,X)=>W['notes']['map'](Y=>'Supply-chain\x20promise\x20#'+String(X+0x1)+':\x20'+Y))],'next_action':u['length']>0x0?'Resolve\x20the\x20blocking_issues\x20above\x20(compile\x20blockers\x20—\x20harness_check.blocking_issues\x20rows\x20with\x20module\x20\x27template\x27;\x20adjust\x20the\x20template\x20or\x20its\x20build\x20inputs),\x20then\x20call\x20merchant_guide\x20again.':r['blocking']?'The\x20plan\x20audit\x20is\x20BLOCKING\x20(see\x20harness_check.blocking_issues\x20and\x20audit.findings\x20—\x20e.g.\x20a\x20terminal\x20node\x20with\x20no\x20fund\x20exit,\x20or\x20an\x20unresolved\x20guard\x20bound\x20to\x20a\x20fund\x20path).\x20Fix\x20the\x20plan/template\x20or\x20guard\x20resolutions\x20and\x20call\x20merchant_guide\x20again;\x20do\x20NOT\x20materialize\x20this\x20plan.'+(J['length']>0x0?'\x20Pending\x20guard\x20designs:\x20'+J['length']+'\x20listed\x20in\x20pending_guard_designs\x20—\x20resolve\x20each\x20via\x20guide_confirm.guard_resolutions\x20(kind\x20\x27inline\x27\x20with\x20the\x20Guard\x20table+root,\x20kind\x20\x27template\x27\x20with\x20a\x20tpl_*\x20id,\x20or\x20{kind:\x27omit\x27}\x20for\x20advisory\x20designs\x20that\x20do\x20not\x20apply\x20to\x20this\x20shop),\x20then\x20call\x20merchant_guide\x20again.':''):I['length']>0x0?'Plan\x20is\x20structurally\x20ready,\x20but\x20'+I['length']+'\x20bound\x20guard\x20design(s)\x20('+I['map'](W=>'\x27'+W+'\x27')['join'](',\x20')+')\x20are\x20UNRESOLVED\x20(plan.pending_guard_designs)\x20—\x20do\x20NOT\x20materialize\x20yet:\x20an\x20unresolved\x20bound\x20design\x20ships\x20a\x20guard\x20the\x20executor\x20invents.\x20Resolve\x20each\x20via\x20guide_confirm.guard_resolutions\x20(kind\x20\x27inline\x27\x20with\x20the\x20Guard\x20table+root,\x20kind\x20\x27template\x27\x20with\x20a\x20tpl_*\x20id,\x20or\x20{kind:\x27omit\x27}\x20for\x20advisory\x20designs\x20that\x20do\x20not\x20apply\x20to\x20this\x20shop),\x20then\x20call\x20merchant_guide\x20again.':'Plan\x20ready.\x20Materialize\x20in\x20ONE\x20deterministic\x20call:\x20benchmark_migration\x20{action:\x27plan_execute\x27,\x20plan:\x20this\x20response\x27s\x20plan\x20object\x20verbatim'+(Q['length']>0x0?',\x20accounts:{'+Q['map'](W=>W+':\x20<its\x20controller\x20env>')['join'](',\x20')+'}':'')+('}\x20—\x20it\x20pre-flights\x20the\x20freeze\x20gate,\x20bind-audits\x20every\x20reference,\x20pre-resolves\x20local\x20marks,\x20slices\x20on\x20timeout_ms,\x20and\x20RESUMES\x20from\x20failures\x20(completed_steps\x20+\x20previous_outputs;\x20never\x20re-run\x20from\x20scratch\x20—\x20ghost\x20duplicates).\x20Then\x20run\x20post_deploy_steps\x20in\x20order\x20('+B['map'](W=>W['id'])['join'](',\x20')+').\x20WIZARD\x20CONTRACT:\x20on\x20the\x20Service\x20publish\x20call\x20(data.publish=true),\x20pass\x20this\x20exact\x20plan\x20back\x20as\x20data.creation_plan\x20—\x20the\x20publish\x20gate\x20replays\x20its\x20freeze\x20matrix\x20and\x20rejects\x20the\x20publish\x20if\x20any\x20gate\x20fails;\x20omitting\x20it\x20leaves\x20the\x20manual\x20path\x20ungated.\x20Manual\x20fallback\x20(only\x20if\x20plan_execute\x20refuses):\x20create\x20the\x20objects\x20in\x20creation_plan\x20order\x20via\x20onchain_operations,\x20then\x20run\x20post_deploy_steps\x20in\x20order.'),'plan':((()=>{const W=templateCatalogDigest(String(q['templateId']??''));return{...q,...W!==undefined?{'template_digest':W}:{},'catalog_version':BUILTIN_TEMPLATES_VERSION};})()),...R['length']>0x0?{'required_local_marks':R,'required_local_marks_note':'plan_execute\x20(the\x20default\x20materializer\x20above)\x20resolves\x20each\x20of\x20these\x20local\x20names\x20against\x20the\x20LocalMark\x20store\x20of\x20the\x20target\x20network\x20and\x20refuses\x20to\x20execute\x20while\x20any\x20is\x20unregistered.\x20'+'Register\x20them\x20BEFORE\x20executing\x20(local_mark_operation\x20add).\x20A\x20name\x20that\x20matches\x20an\x20object\x20this\x20plan\x20itself\x20creates\x20is\x20bound\x20to\x20that\x20object\x20automatically.\x20'+'A\x20recipient\x20mark\x20must\x20point\x20at\x20a\x20real\x20account\x20address:\x20an\x20empty\x20name\x20makes\x20the\x20SDK\x20substitute\x20the\x20deploying\x20account,\x20and\x20an\x20object-id\x20/\x20zero-address\x20recipient\x20is\x20transferred\x20and\x20cannot\x20be\x20retrieved.'}:{},'audit':{'issues':r['issues'],'findings':r['findings'],'blocking':r['blocking'],'score':s},'reflux':{'applied':p['applied'],'blocks':p['blocks'],'iterations':p['iterations']}};}
|
|
1
|
+
import{analyzeIntent}from'./intent-analyzer.js';import{compileTemplate}from'../../composition/compile.js';import{guardMountCensus}from'../../composition/guard-fill.js';import{reflux,auditScore}from'../../composition/reflux.js';import{planBlueprint}from'../../composition/blueprint-view.js';import{getGuardDesignPattern}from'../../knowledge/guard-design-patterns.js';import{lookupBinding}from'../../knowledge/guard-binding-table.js';import{GUARD_TEMPLATES,getTemplatesByScene}from'../../knowledge/guard-templates.js';import{GUARD_AFTER_SERVICE_DRAFT,relationDirection}from'../../knowledge/object-dependency.js';import{collectLateMarks}from'../../composition/plan.js';import{BUILTIN_TEMPLATES_VERSION}from'../../knowledge/builtin-templates.js';import{templateCatalogDigest}from'../../knowledge/template-loader.js';import{checkGameTheoryConstraints}from'./game-theory.js';import{assessWorkflowDesign}from'./workflow-design-assessment.js';import{getCapability,recommendCapabilities,checkCapabilityConstraints,capabilityIntentEvidence}from'../../extensions/capability.js';import{requirementCoverage}from'../../knowledge/requirement-families.js';import{recipientDesignGuidance}from'../../knowledge/recipient-constraint.js';import{getTemplate,getTemplatesByIndustry}from'../../knowledge/template-loader.js';import{resolveUserInputQuestions}from'../../knowledge/param-schema.js';import{PRODUCT_DETAIL_SOURCE_KEY,resolveProductDetailSource}from'../../knowledge/product-detail-source.js';import{getScenarioMode}from'../../knowledge/scenario-modes.js';function derivePlanSatisfiedConstraints(a,b){const c=new Set(),d=i=>a['edges']['some'](j=>j['relation']===i),e=i=>a['nodes']['some'](j=>j['id']===i),f=i=>a['nodes']['some'](j=>j['type']===i),g=i=>a['adoptedModules']['includes'](i);if(d('has_order_allocators'))c['add']('order_allocators_bound');if(d('uses_machine'))c['add']('machine_bound_before_publish');if(d('has_arbitration'))c['add']('arbitration_bound_to_service');if(e('machine'))c['add']('machine_published');if(e('repository'))c['add']('repository_published');if(e('service'))c['add']('service_published');e('permission_arb')&&e('permission')&&c['add']('arbitration_permission_independent');g('independent_arbitration')&&a['nodes']['some'](i=>i['id']['includes']('guard')&&i['id']['includes']('arbitration'))&&c['add']('voting_guard_configured');g('accept_timeout_protection')&&(c['add']('time_guard_configured'),c['add']('adminUnhold_permission'));g('milestone_escrow')&&f('guard')&&c['add']('milestone_forward_guarded');const h=d('has_order_allocators');if(h&&b['payment']['allocation']&&b['payment']['allocation']['length']>0x0){c['add']('allocators_configured');const i=b['payment']['allocation']['reduce']((k,l)=>k+l['percentage'],0x0);if(Math['abs'](i-0x64)<0.001)c['add']('sharing_sum_100');const j=b['payment']['allocation']['find'](k=>k['recipient']==='platform');if(!j||j['percentage']===0x0)c['add']('platform_fee_zero');g('supplier_collaboration')&&(c['add']('allocation_sharing_configured'),c['add']('demand_configured'));}g('wip_provenance')&&e('repository')&&c['add']('wip_hash_before_delivery');g('subscription_with_proof')&&e('repository')&&(c['add']('delivery_guard_per_cycle'),c['add']('repository_updated'));g('damage_attestation')&&(c['add']('pre_rental_hash'),c['add']('post_rental_hash'));g('refund_guarantee')&&(c['add']('compensation_fund_positive'),c['add']('refund_guard_configured'));if(g('praise_incentive')){const k=a['plan']['steps']['some'](m=>m['op']==='create'&&m['object']==='reward'),l=a['plan']['steps']['some'](m=>m['op']==='configure'&&m['method']==='coin_add');k&&l&&(c['add']('reward_pool_funded'),c['add']('reward_claim_replay_armed'));}g('discount_lifecycle')&&(c['add']('discount_budget_planned'),c['add']('discount_burn_disclosed'));if(g('after_sales_guarantee')){const m=a['plan']['steps']['find'](p=>p['op']==='create'&&p['object']==='machine'),n=m?.['params']?.['nodes']??[],o=n['some'](p=>/return|refund|exchange|replace|reship|swap|warranty|repair/i['test'](p['name']??''));o&&(c['add']('after_sales_rail_present'),c['add']('after_sales_rail_node_gated'),c['add']('after_sales_window_anchored'),c['add']('after_sales_no_double_remedy'));}if(g('acceptance_judging')){const p=a['plan']['steps']['find'](t=>t['op']==='create'&&t['object']==='machine'),q=p?.['params']?.['nodes']??[],r=q['map'](t=>t['name']??''),s=r['some'](t=>/accept|approv|award|ruling|place|placement|triage|vot|evaluat|winner|judge/i['test'](t));if(s){const t=r['some'](u=>/revis|redeliver|resubmit|rework/i['test'](u));c['add']('acceptance_race_free');if(e('arbitration'))c['add']('acceptance_judge_independent');if(!t||e('repository'))c['add']('acceptance_revision_bounded');}}if(g('installment_deposit')){const u=a['plan']['steps']['find'](z=>z['op']==='create'&&z['object']==='machine'),v=u?.['params']?.['nodes']??[],w=v['map'](z=>z['name']??''),x=w['some'](z=>/(deposit|down_?pay|balance_due|balance_owed|installment|milestone|awaiting|owed)/i['test'](z)),y=w['some'](z=>/(paid|funded|captured|settled)/i['test'](z));x&&y&&(c['add']('installment_funding_gated'),c['add']('installment_deposit_exit'),c['add']('installment_release_once'));}if(g('affiliate_commission')){const z=a['plan']['steps']['find'](D=>D['op']==='create'&&D['object']==='machine'),A=z?.['params']?.['nodes']??[],B=A['map'](D=>D['name']??''),C=B['some'](D=>/(commission|affiliate|referr|attribut|partner_?payout)/i['test'](D));C&&(c['add']('affiliate_rail_present'),c['add']('affiliate_clawback_disclosed'),c['add']('affiliate_window_anchored'));}if(g('crowdfunding')){const D=a['plan']['steps']['find'](H=>H['op']==='create'&&H['object']==='machine'),E=D?.['params']?.['nodes']??[],F=E['map'](H=>H['name']??''),G=F['some'](H=>/(releas|settle|funded|disburs|project)/i['test'](H));G&&(c['add']('crowdfunding_exit_rail_present'),c['add']('crowdfunding_aggregate_writer_bound'),c['add']('crowdfunding_disclosure_present'));}if(g('logistics_fulfillment')){const H=a['plan']['steps']['find'](L=>L['op']==='create'&&L['object']==='machine'),I=H?.['params']?.['nodes']??[],J=I['map'](L=>L['name']??''),K=J['some'](L=>/(dispatch|handover|hand_over|pickup|deliver|courier|rider|shipped)/i['test'](L));K&&(c['add']('logistics_rail_present'),c['add']('logistics_loss_covered'),c['add']('logistics_fee_independent'),c['add']('logistics_dispatch_disclosed'));}return c;}function deriveDeployTimeChecks(a,b=![]){const c=[];return a['nodes']['some'](d=>d['id']==='machine')&&c['push']('Machine\x20published\x20AND\x20bound\x20to\x20Service\x20BEFORE\x20Service.publish\x20(machine\x20is\x20immutable\x20after\x20publish)'),a['edges']['some'](d=>d['relation']==='has_order_allocators')&&(c['push']('Service.order_allocators\x20bound\x20(verify\x20via\x20query_objects\x20after\x20publish\x20—\x20order_allocators\x20is\x20FROZEN\x20at\x20publish)'),c['push']('Settlement\x20is\x20NOT\x20triggered\x20by\x20reaching\x20a\x20Machine\x20node\x20alone\x20—\x20an\x20explicit\x20alloc_by_guard\x20call\x20(keeper\x20or\x20merchant)\x20fires\x20the\x20settlement\x20Allocator\x20once\x20its\x20Guard\x20passes.\x20Declare\x20the\x20node->allocator\x20trigger\x20(which\x20terminal\x20node\x20unlocks\x20settlement)\x20and\x20schedule\x20the\x20keeper\x20step;\x20otherwise\x20orders\x20stall\x20at\x20the\x20settle\x20node\x20with\x20allocation_state=pending'),c['push']('ALLOCATOR\x20GUARD\x20DESIGN\x20—\x20hand-built\x20rails\x20(sahr\x20lesson):\x20BEFORE\x20writing\x20the\x20settlement\x20Guard,\x20map\x20the\x20host\x20object\x27s\x20RICH\x20STATES:\x20enumerate\x20the\x20Machine\x27s\x20terminal\x20nodes\x20(settlement\x20vs\x20refund\x20polarity),\x20the\x20mid-flight\x20states\x20a\x20claim\x20or\x20dispute\x20opens,\x20and\x20which\x20business\x20event\x20each\x20state\x20transition\x20represents;\x20the\x20allocator\x20gate\x20must\x20sit\x20at\x20exactly\x20ONE\x20mapped\x20transition\x20(e.g.\x20\x27order\x20reached\x20settle\x20terminal\x20AND\x20business\x20obligations\x20verified\x27),\x20never\x20at\x20\x27any\x20time\x20after\x20start\x27.\x20Then\x20bind\x20WHO\x20may\x20trigger\x20alloc_by_guard:\x20the\x20gate\x20carries\x20a\x20caller-identity\x20leg\x20—\x20context(Signer)\x20compared\x20against\x20a\x20table\x20entry,\x20a\x20permission.admin\x20/\x20order.owner\x20read,\x20or\x20the\x20named-operator\x20roster\x20query.\x20order.claimed_by\x20is\x20ORDER\x20STATE,\x20not\x20a\x20caller\x20binding\x20—\x20a\x20gate\x20whose\x20legs\x20read\x20only\x20order/progress/clock\x20state\x20is\x20callable\x20by\x20ANY\x20address,\x20and\x20a\x20bystander\x20can\x20accelerate\x20someone\x20else\x27s\x20payout\x20(sahr,\x20live-proven)'),c['push']('ALLOCATOR\x20GUARD\x20REVIEW\x20—\x20pre-publish,\x20semantic\x20alignment:\x20SAFETY\x20—\x20a\x20settlement\x20track\x20with\x20refund\x20exposure\x20carries\x20the\x20dispute\x20freeze\x20leg\x20logic_not[order.dispute.open]\x20(query\x201576)\x20so\x20a\x20filed\x20dispute\x20freezes\x20new\x20settlements;\x20resolved-awaiting-stamp\x20flows\x20drive\x20the\x20stamp\x20with\x20order.dispute.unstamped\x20(query\x201578).\x20EFFECTIVENESS\x20—\x20read\x20every\x20gate\x20leg\x20back\x20against\x20the\x20business\x20description\x20(who\x20SHOULD\x20trigger,\x20at\x20which\x20business\x20milestone,\x20with\x20what\x20evidence):\x20structural\x20lint\x20passing\x20is\x20NOT\x20semantic\x20alignment.\x20Run\x20the\x20template\x20scan\x20dry-run\x20before\x20publish\x20—\x20the\x20knowledge\x20face\x20discloses\x20identity-less\x20allocator\x20gates\x20as\x20RAIL_NO_CALLER_IDENTITY\x20(info,\x20never\x20blocking);\x20treat\x20the\x20disclosure\x20as\x20a\x20design-review\x20flag\x20and\x20resolve\x20it\x20either\x20with\x20a\x20caller-identity\x20leg\x20or\x20a\x20DOCUMENTED\x20open-trigger\x20rationale\x20(scene\x20verifies\x20identity\x20upstream\x20/\x20intentionally\x20open\x20venue),\x20never\x20by\x20silence'),c['push']('ALLOCATOR\x20RULING\x20DIRECTION\x20—\x20the\x20rich-state\x20matrix\x20closes\x20BOTH\x20ruling\x20outcomes:\x20an\x20award\x20exit\x20on\x20the\x20ARBITRATION\x20indemnity\x20track\x20(a\x20tpl_forward_arb_ruling_won\x20claimed_by==true\x20leg\x20is\x20legal\x20arb-side\x20state,\x20decision\x2011)\x20bound\x20ONLY\x20to\x20a\x20buyer-side\x20identity\x20(order.owner/agent)\x20is\x20unreachable\x20after\x20a\x20MERCHANT-favored\x20ruling\x20or\x20dismissal\x20—\x20nobody\x20but\x20the\x20buyer\x20can\x20open\x20the\x20exit\x20and\x20the\x20escrow\x20principal\x20strands\x20(w3k7\x20m2:\x201.25\x20WOW\x20held\x20on\x20a\x20fully-guarded\x20order;\x20the\x20protocol\x20is\x20direction-blind,\x20the\x20order\x20object\x20exposes\x20NO\x20winner\x20accessor,\x20so\x20the\x20guard\x20itself\x20cannot\x20branch\x20on\x20who\x20won).\x20Pair\x20the\x20buyer-side\x20award\x20exit\x20with\x20a\x20merchant-side\x20exit\x20(a\x20terminal-node-gated\x20recovery\x20sweep\x20—\x20the\x20canonical\x20recover\x20rail),\x20or\x20document\x20that\x20the\x20keeper\x20dual-payout\x20protocol\x20is\x20the\x20intended\x20sole\x20post-ruling\x20exit.\x20Overlap\x20between\x20an\x20award\x20and\x20a\x20fund-rail\x20payout\x20is\x20LEGAL\x20under\x20decision\x2011\x20and\x20is\x20disclosed\x20at\x20the\x20MCP\x20dual-payout\x20confirmation\x20gate\x20—\x20resolve\x20reachability\x20before\x20publish,\x20never\x20by\x20silence.\x20INVERTED\x20FUNDING\x20award-recipient\x20face\x20(W5-01\x20d;\x20the\x20order-side\x20award\x20payout\x20hard-binds\x20to\x20the\x20order\x20owner\x20on\x20both\x20compensate\x20and\x20conclude\x20paths):\x20a\x20ruling\x20pays\x20ONLY\x20the\x20compensation\x20indemnity,\x20never\x20the\x20escrow\x20principal\x20—\x20and\x20on\x20an\x20INVERTED-FUNDING\x20build\x20(bounty/contest:\x20the\x20SPONSOR\x20is\x20the\x20order_payer,\x20so\x20order.owner\x20IS\x20the\x20funder)\x20a\x20hunter/designer-side\x20win\x20pays\x20THE\x20SPONSOR,\x20not\x20the\x20winning\x20party;\x20state\x20both\x20directions\x20(award\x20recipient\x20+\x20principal\x20exit\x20via\x20the\x20recover\x20rail\x27s\x20note)\x20in\x20the\x20storefront/quote\x20before\x20publish')),(a['adoptedModules']['includes']('refund_guarantee')||a['nodes']['some'](d=>d['id']==='arbitration'))&&(b?c['push']('COMPENSATION\x20FUND:\x20DO\x20NOT\x20FUND\x20—\x20this\x20template\x20declares\x20compensation_fund_policy=forbidden\x20(the\x20unreserved\x20pool\x20is\x20double-takeable\x20via\x20refund-then-claim\x20until\x20the\x20arbitration-escrow\x20shared\x20gate\x20lands;\x20user\x20ruling\x202026-10-15).\x20Disputes\x20ride\x20the\x20escrow\x20rails\x20only;\x20the\x20compensation_fund_topup\x20post-deploy\x20step\x20is\x20intentionally\x20absent'):c['push']('compensation_fund\x20MUST\x20be\x20able\x20to\x20cover\x20payouts:\x20a\x20claim\x20against\x20a\x20drained\x20fund\x20aborts\x20with\x20E_COMPENSATION_NOT_MATCH.\x20Size\x20the\x20fund\x20>=\x203x\x20a\x20TYPICAL\x20single\x20order\x20(3x\x20IS\x20the\x20chain\x27s\x20hard\x20award\x20ceiling,\x20MAX_INDEMNITY_MULTIPLE)\x20—\x20per-order\x20coverage\x20is\x20enforced\x20at\x20BUY\x20time\x20(each\x20order\x20is\x20checked\x20against\x203x\x20ITS\x20OWN\x20amount,\x20not\x203x\x20the\x20highest\x20SKU),\x20so\x20publish\x20no\x20longer\x20blocks\x20on\x20coverage;\x20verify\x20the\x20on-chain\x20balance\x20before\x20going\x20live.\x205R-07③:\x20after\x20go-live\x20the\x20keeper\x20WATCHES\x20the\x20water\x20level\x20(see\x20the\x20compensation_fund_watch\x20step)\x20—\x20no\x20hard\x20gate,\x20the\x20merchant\x20decides')),a['nodes']['some'](d=>d['id']==='arbitration')&&(c['push']('Arbitration\x20activation\x20is\x20ATOMIC\x20in\x20the\x20creation\x20plan\x20—\x20the\x20chain\x20hardcodes\x20every\x20new\x20Arbitration\x20to\x20PAUSED\x20at\x20construction,\x20and\x20the\x20plan\x27s\x20arbitration\x20create\x20payload\x20carries\x20pause:false,\x20which\x20the\x20executor\x20composes\x20as\x20the\x20unpause\x20write\x20in\x20the\x20SAME\x20transaction\x20(the\x20creator\x20is\x20the\x20new\x20Permission\x27s\x20admin,\x20so\x20the\x20356\x20assert\x20passes).\x20Verify\x20the\x20paused\x20flag\x20reads\x20false\x20after\x20materialization\x20(a\x20paused\x20venue\x20aborts\x20every\x20dispute\x20filing).\x20Keep\x20Arbitration.permission\x20distinct\x20from\x20Service.permission\x20on-chain\x20(E_ARBITRATION_PERMISSION_CONFLICT=33)'),c['push']('ARBITRATION\x20VENUE\x20OWNERSHIP\x20(D-5):\x20the\x20recommended\x20onboarding\x20default\x20is\x20a\x20SELF-BUILT\x20venue\x20—\x20your\x20own\x20Arbitration\x20object\x20with\x20your\x20own\x20permission/admin\x20(voting_guard\x20tpl_voting_guard_open_vote\x20for\x20community\x20cases,\x20tpl_voting_guard_numeric_weight\x20for\x20a\x20named\x20panel).\x20A\x20THIRD-PARTY\x20venue\x20you\x20do\x20not\x20control\x20hands\x20the\x20private\x20key\x20that\x20answers\x20and\x20appeals\x20cases\x20to\x20its\x20operator:\x20an\x20outside\x20store\x27s\x20admin\x20going\x20silent\x20strands\x20your\x20defense\x20(F-16,\x20live-proven).\x20Use\x20an\x20outside\x20venue\x20ONLY\x20when\x20its\x20operator\x20is\x20a\x20named,\x20reachable\x20counterparty\x20the\x20merchant\x20accepts')),a['nodes']['some'](d=>d['id']==='repository')&&c['push']('Repository\x20published\x20and\x20Guard\x20write\x20validation\x20configured'),c['push']('After\x20materialization,\x20confirm\x20the\x20on-chain\x20state\x20matches\x20this\x20plan\x20(query_toolkit\x20query_type=\x27service_panorama\x27)'),c;}function derivePostDeploySteps(a,b=![],c=![]){const d=[];return!b&&(a['adoptedModules']['includes']('refund_guarantee')||a['nodes']['some'](e=>e['id']==='arbitration'))&&(!c&&d['push']({'order':d['length']+0x1,'id':'compensation_fund_topup','title':'Top\x20up\x20the\x20compensation\x20fund','when':'After\x20the\x20Service\x20PUBLISHES\x20successfully\x20(post-publish,\x20before\x20the\x20store\x20goes\x20live\x20to\x20buyers)','action':'Call\x20compensation_fund_add\x20sized\x20>=\x203x\x20a\x20TYPICAL\x20single\x20order\x20(3x\x20=\x20the\x20chain\x27s\x20hard\x20award\x20ceiling,\x20MAX_INDEMNITY_MULTIPLE;\x20above\x203x\x20only\x20buys\x20headroom\x20for\x20concurrent\x20claims).\x20Per-order\x20coverage\x20is\x20enforced\x20at\x20BUY\x20time\x20—\x20each\x20incoming\x20order\x20is\x20checked\x20against\x203x\x20ITS\x20OWN\x20amount\x20and\x20under-covered\x20orders\x20cannot\x20be\x20created\x20—\x20then\x20verify\x20the\x20on-chain\x20fund\x20balance\x20via\x20query_objects','tool_hint':'onchain_operations\x20(service.compensation_fund_add)','failure_if_skipped':'a\x20compensation\x20claim\x20against\x20an\x20empty\x20fund\x20aborts\x20(E_COMPENSATION_NOT_MATCH,\x20testnet\x20lesson\x20R-4)'}),d['push']({'order':d['length']+0x1,'id':'compensation_fund_watch','title':'Watch\x20the\x20compensation-fund\x20water\x20level\x20(recurring\x20keeper\x20step)','when':'Recurring\x20—\x20on\x20every\x20keeper\x20cycle\x20after\x20go-live,\x20and\x20ALWAYS\x20immediately\x20after\x20each\x20arbitration\x20payout\x20posts','action':'Query\x20the\x20on-chain\x20fund\x20balance\x20and\x20classify\x20it\x20with\x20classifyFundWaterLevel(balance,\x20low_water_threshold)\x20into\x20THREE\x20tiers:\x20HEALTHY\x20(balance\x20>=\x20threshold\x20—\x20silence\x20is\x20the\x20healthy\x20signal,\x20no\x20event)\x20/\x20LOW\x20WATER\x20(0\x20<\x20balance\x20<\x20threshold\x20—\x20surface\x20fundWaterReminder:\x20recommend\x20topping\x20up\x20via\x20compensation_fund_add;\x20one\x20large\x20award\x20could\x20make\x20a\x20flagship\x20SKU\x20unbuyable,\x20F-46)\x20/\x20DEPLETED\x20(balance\x200\x20—\x20surface\x20fundWaterReminder\x20LOUD:\x20every\x20claim\x20aborts\x2027\x20and\x20under-covered\x20SKUs\x20are\x20unbuyable).\x20Thresholds\x20are\x20the\x20MERCHANT\x27s\x20call\x20(decision\x207)\x20—\x20recommended\x20anchor:\x20low-water\x20line\x20at\x203x\x20the\x20flagship\x20SKU\x20price\x20(below\x20it\x20the\x20flagship\x20can\x20no\x20longer\x20be\x20bought),\x20healthy\x20line\x20at\x203x\x20the\x20typical\x20order.\x20NEVER\x20block\x20a\x20SKU\x20or\x20gate\x20a\x20claim\x20on\x20the\x20tier\x20—\x20the\x20reminder\x20is\x20the\x20whole\x20feature;\x20the\x20merchant\x20decides\x20(top\x20up\x20/\x20accept\x20the\x20exposure)','tool_hint':'query_toolkit\x20(service_panorama:\x20fund\x20balance)\x20+\x20fund-layer\x20classifyFundWaterLevel\x20+\x20onchain_operations\x20(service.compensation_fund_add)\x20on\x20the\x20merchant\x27s\x20decision','failure_if_skipped':'a\x20drained\x20or\x20low\x20fund\x20is\x20SILENT\x20—\x20the\x20first\x20signal\x20is\x20a\x20buyer\x27s\x20claim\x20aborting\x20(27)\x20or\x20a\x20flagship\x20SKU\x20failing\x20to\x20sell\x20(buy-time\x203x\x20coverage\x20refusal,\x20F-46)'})),a['nodes']['some'](e=>e['id']==='arbitration')&&(d['push']({'order':d['length']+0x1,'id':'arbitration_unpause','title':'Verify\x20the\x20Arbitration\x20is\x20ACTIVE\x20(activation\x20rode\x20the\x20create)','when':'Immediately\x20after\x20materialization\x20—\x20before\x20the\x20store\x20goes\x20live\x20to\x20buyers','action':'The\x20creation\x20plan\x27s\x20arbitration\x20create\x20payload\x20carries\x20pause:false\x20(the\x20chain\x20hardcodes\x20new\x20Arbitrations\x20to\x20paused;\x20the\x20executor\x20composes\x20the\x20unpause\x20in\x20the\x20same\x20transaction)\x20—\x20VERIFY\x20the\x20paused\x20flag\x20reads\x20false\x20via\x20query_toolkit;\x20only\x20an\x20already-paused\x20leftover\x20venue\x20(built\x20before\x20this\x20payload\x20field\x20existed)\x20needs\x20a\x20manual\x20unpause.\x20Keep\x20its\x20Permission\x20distinct\x20from\x20the\x20Service\x20Permission\x20(E_ARBITRATION_PERMISSION_CONFLICT=33)','tool_hint':'query_toolkit\x20(arbitration\x20paused\x20flag);\x20manual\x20unpause\x20via\x20onchain_operations\x20(arbitration\x20pause:false)\x20ONLY\x20for\x20a\x20legacy\x20paused\x20venue','failure_if_skipped':'a\x20paused\x20Arbitration\x20aborts\x20every\x20dispute\x20filing\x20(testnet\x20lesson\x20R-5)'}),d['push']({'order':d['length']+0x1,'id':'arbitration_permission_write','title':'Grant\x20the\x20operator\x20account\x20its\x20venue-management\x20permissions','when':'After\x20the\x20Arbitration\x20object\x20is\x20created,\x20BEFORE\x20any\x20venue-management\x20call\x20(description/guard/fee/pause\x20edits)\x20from\x20the\x20operator\x20account','action':'Write\x20the\x20operator\x20permission\x20row:\x20onchain_operations\x20operation_type=\x27permission\x27,\x20data={object:\x27<arbitration_permission_object>\x27,\x20table:{op:\x27add\x20perm\x20by\x20entity\x27,\x20entity:\x27<operator_account>\x27,\x20index:[350,351,354,356,357,359]}}\x20—\x20350\x20file\x20new\x20cases,\x20351\x20description,\x20354\x20voting_guard\x20management,\x20356\x20pause/resume,\x20357\x20fee,\x20359\x20ruling.\x20The\x20arbitration\x20Permission\x20table\x20starts\x20EMPTY\x20with\x20only\x20the\x20creator\x20seeded\x20as\x20admin,\x20so\x20without\x20this\x20row\x20every\x20operator\x20call\x20aborts\x20on\x20the\x20permission\x20assert.\x20entity\x20must\x20be\x20a\x20FULL\x2066-char\x200x\x20address\x20or\x20a\x20local\x20mark\x20name\x20—\x20a\x20truncated\x20address\x20normalizes\x20to\x20a\x20DIFFERENT\x20on-chain\x20address\x20and\x20grants\x20the\x20wrong\x20row\x20silently','tool_hint':'onchain_operations\x20(permission\x20add\x20perm\x20by\x20entity,\x20indexes\x20350/351/354/356/357/359)','failure_if_skipped':'the\x20operator\x20account\x20holds\x20NO\x20rows\x20in\x20the\x20arbitration\x20Permission\x20table\x20—\x20every\x20venue-management\x20call\x20from\x20it\x20aborts\x20on\x20the\x20permission\x20assert\x20(permission\x20350-359\x20failures)','note':'SIGNER\x20DISCLOSURE:\x20until\x20the\x20row\x20above\x20lands,\x20the\x20ONLY\x20account\x20that\x20can\x20manage\x20this\x20venue\x20(pause\x20356\x20included)\x20is\x20the\x20venue\x20Permission\x27s\x20admin\x20—\x20its\x20CREATOR.\x20In\x20the\x20usual\x20single-venue\x20build\x20the\x20creator\x20is\x20the\x20arbitrator\x27s\x20account,\x20so\x20an\x20emergency\x20pause\x20before\x20this\x20step\x20must\x20be\x20signed\x20by\x20the\x20arbitrator,\x20not\x20the\x20merchant\x20operator.'}),d['push']({'order':d['length']+0x1,'id':'arbitration_arbitrator_grant','title':'Grant\x20the\x20arbitrator\x20account\x20its\x20case-lifecycle\x20permissions','when':'After\x20arbitration_permission_write,\x20BEFORE\x20the\x20first\x20dispute\x20reaches\x20voting','action':'Write\x20the\x20arbitrator\x20permission\x20row:\x20same\x20permission-object\x20call\x20shape\x20with\x20entity:\x27<arbitrator_account>\x27\x20and\x20index:[358,359,360,361,362,363,364]\x20—\x20358\x20vote,\x20359\x20ruling,\x20360\x20feedback,\x20361\x20confirm,\x20362\x20voting-deadline\x20change,\x20363\x20reset,\x20364\x20receive.\x20Note:\x20the\x20disputing\x20CUSTOMER\x20must\x20hold\x20358\x20for\x20their\x20vote\x20to\x20count\x20(a\x20plain\x20vote\x20with\x20an\x20empty\x20voting_guard\x20still\x20asserts\x20358\x20—\x20ungranted,\x20voting\x20collapses\x20to\x20admin-only,\x20E-13);\x20that\x20per-dispute\x20customer\x20grant\x20is\x20issued\x20at\x20filing\x20time,\x20NOT\x20in\x20this\x20step.\x20Full\x2066-char\x20address\x20or\x20mark\x20name\x20only','tool_hint':'onchain_operations\x20(permission\x20add\x20perm\x20by\x20entity,\x20indexes\x20358-364)','failure_if_skipped':'358-364\x20stay\x20creator-admin-only\x20—\x20the\x20named\x20arbitrator\x20cannot\x20vote/rule/confirm,\x20and\x20the\x20customer\x27s\x20vote\x20collapses\x20to\x20admin-only\x20(E-13),\x20dead-locking\x20the\x20first\x20dispute'}),d['push']({'order':d['length']+0x1,'id':'voting_guard_open_vote','title':'Bind\x20the\x20open-vote\x20voting_guard\x20(tpl_voting_guard_open_vote)','when':'After\x20the\x20Arbitration\x20is\x20activated,\x20BEFORE\x20the\x20first\x20dispute\x20can\x20be\x20voted\x20on','action':'Create\x20the\x20open-vote\x20guard\x20(tpl_voting_guard_open_vote:\x20always-true\x20root\x20+\x20FixedValue\x20weight\x201\x20=\x20one\x20person\x20one\x20vote)\x20and\x20set\x20it\x20as\x20the\x20Arbitration\x27s\x20voting_guard;\x20skip\x20this\x20step\x20ONLY\x20for\x20a\x20deliberately\x20closed\x20panel\x20(then\x20bind\x20tpl_voting_guard_numeric_weight\x20with\x20the\x20arbitrator\x20address\x20list\x20instead)','tool_hint':'onchain_operations\x20(guard\x20creation\x20+\x20arbitration\x20voting_guard\x20set,\x20op=\x27set\x27)','failure_if_skipped':'an\x20EMPTY\x20voting_guard\x20dead-locks\x20every\x20plain\x20vote\x20on\x20permission\x20358\x20(creator-admin\x20only)\x20—\x20the\x20first\x20dispute\x20cannot\x20reach\x20a\x20verdict\x20if\x20the\x20admin\x20is\x20unresponsive\x20(crs9-F-36,\x20R-ARB-VOTE-LOCK)'})),a['edges']['some'](f=>f['relation']==='has_order_allocators')&&d['push']({'order':d['length']+0x1,'id':'settlement_alloc_by_guard','title':'Fire\x20settlement\x20via\x20alloc_by_guard\x20(keeper\x20or\x20merchant\x20step)','when':'Recurring\x20—\x20after\x20EACH\x20order\x20reaches\x20its\x20settlement\x20terminal\x20node\x20(declare\x20which\x20node\x20unlocks\x20settlement)','action':'Call\x20alloc_by_guard\x20on\x20the\x20order\x27s\x20allocation\x20with\x20the\x20settlement\x20Guard;\x20reaching\x20the\x20Machine\x20node\x20alone\x20does\x20NOT\x20settle\x20(allocation_state\x20stays\x20pending)','tool_hint':'onchain_operations\x20(allocation.alloc_by_guard);\x20schedule\x20as\x20a\x20keeper\x20step','failure_if_skipped':'orders\x20stall\x20at\x20the\x20settle\x20node\x20with\x20funds\x20locked\x20in\x20escrow\x20(testnet\x20lesson\x20R-2)'}),d['push']({'order':d['length']+0x1,'id':'verify_service_panorama','title':'Verify\x20the\x20on-chain\x20state\x20matches\x20the\x20plan','when':'After\x20all\x20creation\x20steps\x20and\x20the\x20steps\x20above\x20are\x20done','action':'Run\x20the\x20service\x20panorama\x20query\x20and\x20diff\x20it\x20against\x20this\x20plan\x27s\x20blueprint/creation_plan','tool_hint':'query_toolkit\x20query_type=\x27service_panorama\x27','failure_if_skipped':'plan/chain\x20drift\x20(missing\x20binding,\x20wrong\x20allocator\x20order)\x20stays\x20undetected\x20until\x20an\x20order\x20hits\x20it'}),d;}function buildCreationPlan(a){const b=[],c=new Map(a['nodes']['map'](j=>[j['id'],j])),f=new Map();for(const j of a['nodes'])f['set'](j['id'],new Set());for(const k of a['edges']){if(!f['has'](k['from'])||!c['has'](k['to']))continue;const l=relationDirection(k['relation'])==='to_depends_on_from',m=l?k['to']:k['from'],o=l?k['from']:k['to'];if(m===o||!f['has'](m))continue;f['get'](m)['add'](o);}for(const p of a['nodes']){for(const q of Object['values'](p['config'])){q['type']==='address_ref'&&q['targetId']!==p['id']&&f['has'](q['targetId'])&&f['get'](p['id'])['add'](q['targetId']);}}{const r=GUARD_AFTER_SERVICE_DRAFT,s=a['nodes']['filter'](t=>t['type']===r['provider'])['map'](t=>t['id']);if(s['length']>0x0)for(const t of a['nodes']){if(t['type']!==r['dependent'])continue;const u=f['get'](t['id']);if(u===undefined)continue;for(const v of s)u['add'](v);}}const g=new Map([...f]['map'](([w,x])=>[w,[...x]])),h=[],i=new Map(f);while(i['size']>0x0){const w=[...i['entries']()]['filter'](([,x])=>x['size']===0x0)['map'](([x])=>x);if(w['length']===0x0){h['push'](...i['keys']());break;}w['sort']();for(const x of w){h['push'](x),i['delete'](x);for(const y of i['values']())y['delete'](x);}}return h['forEach']((z,A)=>{const B=c['get'](z),C=B['config']['name'],D=C?.['type']==='string'?C['value']:z,E=D['includes']('/')?D['replaceAll']('/','__'):D,F=z==='arbitration'?'Create\x20'+B['type']+'\x20via\x20onchain_operations\x20WITH\x20pause:false\x20(creation-time\x20activation),\x20then\x20configure.\x20Purpose:\x20'+B['purpose']:'Create\x20'+B['type']+'\x20via\x20onchain_operations,\x20then\x20configure.\x20Purpose:\x20'+B['purpose'];b['push']({'order':A+0x1,'node_id':z,'object_type':B['type'],'suggested_name':E,'depends_on':g['get'](z)??[],'operation_hint':F});}),b;}function resolveTemplate(a,b){if(!a)return undefined;const c=getTemplate(a);if(c)return c;const d=getTemplatesByIndustry(a);if(b){const f=b['toLowerCase'](),g=d['filter'](h=>{const i=String(h['product_ref']??'')['trim']()['toLowerCase']();return i['length']>0x0&&f['includes'](i);});if(g['length']===0x1)return g[0x0];}const e=getScenarioMode(a)?.['default_template'];if(e){const h=getTemplate(e);if(h)return h;}if(d['length']>0x0)return d[0x0];return undefined;}export const GAS_PER_ORDER_SMALLEST=0x5b8d80;export const MIN_ECONOMIC_ORDER_SMALLEST=0x2faf080;const GAS_RATIO_WARN_THRESHOLD=0.1,wow=a=>Number((a/0x3b9aca00)['toFixed'](0x6))+'\x20WOW';export function gasEconomicsWarnings(a,b){const c=[],d=(a??[])['map'](j=>Number(j?.['price']))['filter'](j=>Number['isFinite'](j)&&j>0x0);if(d['length']===0x0)return c;const e=Math['min'](...d),f=Number(b),g=Number['isFinite'](f)&&f>0x0?f:0x0,h=g+GAS_PER_ORDER_SMALLEST,i=h/e;if(e<MIN_ECONOMIC_ORDER_SMALLEST)c['push']('GAS\x20ECONOMY\x20(ddmc4\x20B-39\x20/\x20ks7\x20A-10):\x20the\x20cheapest\x20SKU\x20is\x20'+wow(e)+'\x20—\x20below\x20the\x20≈'+wow(MIN_ECONOMIC_ORDER_SMALLEST)+'\x20minimum\x20ECONOMIC\x20per-order\x20price.\x20'+('Measured\x20settlement\x20gas\x20is\x20≈'+wow(GAS_PER_ORDER_SMALLEST)+'\x20per\x20transaction')+(g>0x0?',\x20plus\x20'+wow(g)+'\x20cashback\x20per\x20claim':'')+('\x20—\x20per-order\x20overhead\x20≈'+wow(h)+'\x20('+Math['round'](i*0x64)+'%\x20of\x20this\x20SKU).\x20')+'Micro-priced\x20SKUs\x20lose\x20their\x20entire\x20margin\x20to\x20gas:\x20raise\x20the\x20price,\x20drop\x20the\x20per-claim\x20cashback,\x20or\x20batch\x20settlements.');else i>GAS_RATIO_WARN_THRESHOLD&&c['push']('GAS\x20ECONOMY\x20(ks7\x20A-10):\x20cashback\x20+\x20settlement\x20gas\x20≈'+wow(h)+'\x20per\x20order\x20is\x20'+Math['round'](i*0x64)+'%\x20of\x20the\x20cheapest\x20SKU\x20('+wow(e)+')\x20—\x20above\x20the\x2010%\x20warning\x20line.\x20'+'Trim\x20the\x20per-claim\x20cashback\x20or\x20raise\x20the\x20price.');return c;}export async function handleMerchantGuide(a){const b=a['guide_state']??{'intent_text':''},d=a['guide_confirm']??{},e={'intent_text':(a['intent']??b['intent_text']??'')['trim'](),'confirmed_industry':d['industry']??b['confirmed_industry'],'currency':d['currency']??b['currency'],'deliverables':d['deliverables']??b['deliverables'],'payment_override':d['payment']??b['payment_override'],'trust_override':d['trust']??b['trust_override'],'adopted_module_ids':d['adopted_module_ids']??b['adopted_module_ids'],'guard_resolutions':{...b['guard_resolutions']??{},...d['guard_resolutions']??{}},'review_mode':d['review_mode']??b['review_mode'],'reward_funding':d['reward_funding']??b['reward_funding'],'reward_claim_amount':d['reward_claim_amount']??b['reward_claim_amount'],'experience_compensation_mode':d['experience_compensation_mode']??b['experience_compensation_mode'],'experience_pool_funding':d['experience_pool_funding']??b['experience_pool_funding'],'compensation_fund':d['compensation_fund']??b['compensation_fund'],'after_sales_mode':d['after_sales_mode']??b['after_sales_mode'],'acceptance_mode':d['acceptance_mode']??b['acceptance_mode'],'installment_mode':d['installment_mode']??b['installment_mode'],'affiliate_mode':d['affiliate_mode']??b['affiliate_mode'],'crowdfunding_mode':d['crowdfunding_mode']??b['crowdfunding_mode'],'logistics_mode':d['logistics_mode']??b['logistics_mode'],'supply_chain':d['supply_chain']??b['supply_chain'],'sales':d['sales']??b['sales']};for(const W of Object['keys'](e)){if(e[W]===undefined)delete e[W];}if(e['guard_resolutions']&&Object['keys'](e['guard_resolutions'])['length']===0x0)delete e['guard_resolutions'];if(!e['intent_text'])throw new Error('merchant_guide\x20requires\x20\x27intent\x27\x20(business\x20description)\x20for\x20Step\x201.\x20'+'Example:\x20intent=\x27I\x20want\x20to\x20offer\x20online\x20design\x20service\x20with\x20milestone\x20payments\x27.\x20'+'Pass\x20the\x20returned\x20guide_state\x20back\x20UNCHANGED\x20on\x20subsequent\x20calls,\x20plus\x20guide_confirm\x20for\x20merchant\x20decisions.');const f=await analyzeIntent(e['intent_text'],{'preferredIndustry':e['confirmed_industry'],'currency':e['currency']});if(!e['confirmed_industry'])return{'action':'merchant_guide','current_step':0x2,'step_name':'Industry\x20Matching','guide_state':e,'intent_draft':f['intent'],'industry_options':{'inferred':f['inferredIndustry'],'confidence':f['industryConfidence'],'similar':f['similarIndustries']},'warnings':f['warnings'],'next_action':'Confirm\x20the\x20industry\x20by\x20calling\x20merchant_guide\x20again\x20with\x20guide_state\x20(UNCHANGED)\x20'+('plus\x20guide_confirm={\x20industry:\x20\x27<one\x20of:\x20'+f['similarIndustries']['join'](',\x20')+'\x20—\x20or\x20any\x20other\x20industry\x20id>\x27\x20}')};const g={...f['intent'],'industry':e['confirmed_industry'],'deliverables':e['deliverables']??f['intent']['deliverables'],'payment':{...f['intent']['payment'],...e['payment_override']??{}},'trust':{...f['intent']['trust'],...e['trust_override']??{}}},h=!!e['adopted_module_ids'],i=e['adopted_module_ids']?e['adopted_module_ids']['map'](X=>getCapability(X))['filter'](X=>!!X):recommendCapabilities(e['confirmed_industry'],e['intent_text'],{'maxCapabilities':0x5}),j=a['template_override']??resolveTemplate(e['confirmed_industry'],e['intent_text']);if(!j)throw new Error('No\x20compilable\x20template\x20found\x20for\x20industry\x20\x27'+e['confirmed_industry']+'\x27.\x20'+'Register\x20a\x20template\x20via\x20industry_pack_operation\x20or\x20pass\x20template_override\x20explicitly.');const l=resolveUserInputQuestions(j),m=e['fee_overrides']?.[PRODUCT_DETAIL_SOURCE_KEY]??j?.['fee_params']?.[PRODUCT_DETAIL_SOURCE_KEY],n=await resolveProductDetailSource(m,e['sales']);if(n['enriched']['length']>0x0&&Array['isArray'](e['sales'])&&e['sales']['length']>0x0){const X=new Map(n['enriched']['map'](Y=>[Y['sku'],Y]));e['sales']=e['sales']['map'](Y=>{if(Y===null||typeof Y!=='object')return Y;const Z=X['get'](String(Y['name']??''));return Z===undefined?Y:{...Y,'wip':Z['wip'],'wip_hash':Z['wip_hash']};});}const o={'currency':e['currency']??g['payment']['currency'],...e['payment_override']?{'payment':e['payment_override']}:{},...e['trust_override']?{'trust':e['trust_override']}:{},...e['deliverables']?{'deliverables':e['deliverables']}:{},...e['adopted_module_ids']?{'adopted_module_ids':e['adopted_module_ids']}:{},...e['review_mode']?{'review_mode':e['review_mode']}:{},...e['reward_funding']!==undefined?{'reward_funding':e['reward_funding']}:{},...e['reward_claim_amount']!==undefined?{'reward_claim_amount':e['reward_claim_amount']}:{},...e['experience_compensation_mode']?{'experience_compensation_mode':e['experience_compensation_mode']}:{},...e['experience_pool_funding']!==undefined?{'experience_pool_funding':e['experience_pool_funding']}:{},...e['compensation_fund']!==undefined?{'compensation_fund':e['compensation_fund']}:{},...e['after_sales_mode']?{'after_sales_mode':e['after_sales_mode']}:{},...e['acceptance_mode']?{'acceptance_mode':e['acceptance_mode']}:{},...e['installment_mode']?{'installment_mode':e['installment_mode']}:{},...e['affiliate_mode']?{'affiliate_mode':e['affiliate_mode']}:{},...e['crowdfunding_mode']?{'crowdfunding_mode':e['crowdfunding_mode']}:{},...e['logistics_mode']?{'logistics_mode':e['logistics_mode']}:{},...e['sales']?.['length']?{'sales':e['sales']}:{},...e['fee_overrides']??{}},p={};Object['assign'](p,e['guard_resolutions']??{});const q=compileTemplate(j,o,{'nameBase':a['name_base']??j['id'],'intent':e['intent_text'],'guardResolutions':p,'buildTimeMs':Date['now'](),...e['supply_chain']!==undefined&&e['supply_chain']['length']>0x0?{'supplyChain':e['supply_chain']}:{}}),r=reflux(q['plan']),s=r['plan'],t=r['audit'],u=auditScore(t),w=planBlueprint(s,g,i['map'](Y=>Y['id'])),x=q['blockers']['map'](Y=>({'module':'template','missing_constraints':[Y['code']],'fix':Y['detail']})),y=derivePlanSatisfiedConstraints(w,g),z={'paymentModel':e['payment_override']?.['model'],'trustArbitration':e['trust_override']?.['arbitration'],'trustRefundPolicy':e['trust_override']?.['refundPolicy'],'proofsOfDelivery':e['deliverables']?.['map'](Y=>Y['proofOfDelivery']),'allocationCount':e['payment_override']?.['allocation']?.['length']},A=i['map'](Y=>{const Z=capabilityIntentEvidence(Y,e['intent_text'],z);return checkCapabilityConstraints(Y,y,{'evidenceMatched':h||Z['matched'],'evidence':Z});}),B=j['compensation_fund_policy']==='forbidden',C=deriveDeployTimeChecks(w,B),D=derivePostDeploySteps(w,B,s['steps']['some'](Y=>Y['op']==='configure'&&Y['id']==='service_compensation'&&Y['method']==='compensation_fund_add')),E=w['edges']['some'](Y=>Y['relation']==='has_order_allocators')?recipientDesignGuidance()['map'](Y=>({'id':Y['id'],'move_recipient':Y['move_recipient'],'semantics':Y['semantics'],'required_constraints':Y['required_constraints'],'finding_if_unmet':Y['finding_if_unmet']})):undefined,F=t['findings']['filter'](Y=>Y['level']==='critical'||Y['level']==='high')['map'](Y=>({'module':'audit','missing_constraints':[Y['rule_id']],'fix':Y['title']+'\x20—\x20'+(Y['mitigation']??Y['description'])})),G=[{'re':/allocat|refund|recover|claimed_by|settle|escrow/i,'scene':'service_order_allocators_guard'},{'re':/\bbuy\b|purchase|allowlist|blocklist/i,'scene':'service_buy_guard'},{'re':/reward/i,'scene':'reward_claim'},{'re':/write_guard|repository_write/i,'scene':'repository_write_guard'},{'re':/arbitrat|ruling|voting/i,'scene':'arbitration_usage_guard'},{'re':/forward|node|witness|deliver|review|cancel|expire|submission|progress/i,'scene':'machine_forward_guard'}],H=[{'re':/claimed_by\s*some\s*==\s*true/i,'tpl':'tpl_allocator_node_gate_recover'},{'re':/claimed_by\s*some\s*==\s*false|claimed_by\s*(?:is\s+)?none|\brefund|\bcancel/i,'tpl':'tpl_allocator_node_gate_refund'},{'re':/claimed_by\s*some|\brecover|\baward/i,'tpl':'tpl_allocator_node_gate_recover'}],I=[{'host':'machine','re':/pattern\.time_lock_progress/i,'tpl':'tpl_time_lock_progress'},{'host':'machine','re':/pattern\.time_window_upper_bound/i,'tpl':'tpl_time_window_upper'},{'host':'reward','re':/pattern\./i,'tpl':'tpl_reward_one_time_claim'}],J=(Y,Z,a0,a1,a2)=>{let a3;const a4=/tpl_[a-z0-9_]+/['exec'](Y+'\x20'+Z),a5=a1==='machine'||a1==='machine_forward'?'machine_forward_guard':a1==='reward'?'reward_claim':a1==='repository'?'repository_write_guard':a1==='arbitration'?'arbitration_usage_guard':undefined;if(a4!==null){const aa=GUARD_TEMPLATES['find'](ab=>ab['id']===a4[0x0])?.['scene_id'];aa!==undefined&&(a5===undefined||aa===a5||aa==='service_order_allocators_guard'&&a1!=='reward')&&(a3=aa);}a3===undefined&&a1!=='reward'&&!I['some'](ab=>ab['host']===(a1==='machine_forward'?'machine':a1)&&ab['re']['test'](Y))&&/\ballocators?\b|claimed_by|guard_identifier|order_allocators/i['test'](Z)&&(a3='service_order_allocators_guard');if(a3===undefined){if(a5!==undefined)a3=a5;else{const ab=G['find'](ac=>ac['re']['test'](Y+'\x20'+Z));a3=ab?.['scene'];}}if(a3===undefined)return undefined;const a6=getTemplatesByScene(a3);let a7=a0!==undefined&&a6['some'](ac=>ac['applicable_industries']['includes'](a0))?a6['filter'](ac=>ac['applicable_industries']['includes'](a0)):a6;if(/\btime[_-]?lock|\bwindow|\btimeout|\bduration|\bdeadline|\bdays?\b|\bclock|\bdelay/i['test'](Y+'\x20'+Z)){const ac=a7['filter'](ad=>JSON['stringify'](ad['example_root']??{})['toLowerCase']()['includes']('clock'));if(ac['length']===0x0)return undefined;a7=ac;}if(a2['length']>0x0){const ad=a4!==null?a7['find'](af=>af['id']===a4[0x0]):undefined,ae=a7['filter'](af=>{const ag=[];if(af['example_root']!==undefined){const ah=JSON['stringify'](af['example_root']);for(const ai of ah['matchAll'](/"query":"([^"]+)"/g))ag['push'](ai[0x1]);if(ah['includes']('\x22type\x22:\x22query_progress_history_time\x22'))ag['push']('progress.history.time');if(ah['includes']('\x22type\x22:\x22query_progress_history_find\x22'))ag['push']('progress.history.find');}return ag['some'](aj=>a2['some'](ak=>aj===ak||aj['startsWith'](ak)||ak['startsWith'](aj)));});if(ad!==undefined&&!ae['includes'](ad))ae['push'](ad);if(ae['length']===0x0)return undefined;a7=ae;}const a8=a1==='machine_forward'?'machine':a1,a9=I['find'](af=>af['host']===a8&&af['re']['test'](Y+'\x20'+Z)&&a7['some'](ag=>ag['id']===af['tpl']));a9!==undefined&&(a7=[...a7]['sort']((af,ag)=>(af['id']===a9['tpl']?0x0:0x1)-(ag['id']===a9['tpl']?0x0:0x1)));if(a3==='service_order_allocators_guard'){const af=H['find'](ag=>ag['re']['test'](Y+'\x20'+Z));af!==undefined&&(a7=[...a7]['sort']((ag,ah)=>(ag['id']===af['tpl']?0x0:0x1)-(ah['id']===af['tpl']?0x0:0x1)));}return a7['slice'](0x0,0x3)['map'](ag=>({'template_id':ag['id'],'name':ag['name'],'parameters':ag['parameters']['map'](ah=>({'name':ah['name'],'required':ah['required'],...ah['default']!==undefined?{'default':ah['default']}:{},'description':ah['description']}))}));},K=[],L=guardMountCensus(j,o),M=q['unresolved']['map'](Y=>{const Z=getGuardDesignPattern(Y['template_id']),a0=J(Y['template_id'],Y['purpose'],j?.['industry'],Y['host'],Z?.['key_queries']??[]),a1=new Map((j?.['allocator']['rows']??[])['filter'](a9=>typeof a9['guard_key']==='string')['map'](a9=>[a9['guard_key'],a9])),a2=a1['get'](Y['key']),a3=a2!==undefined&&!L['edgeKeys']['has'](Y['key']),a4=!L['edgeKeys']['has'](Y['key'])&&!L['railKeys']['has'](Y['key'])&&!L['policyKeys']['has'](Y['key'])&&Y['host']!=='reward'&&!(Y['host']==='service'&&Y['key']==='buy'),a5=Y['host']==='service'&&Y['key']==='buy';if(!a4&&!a5)K['push'](Y['key']);const a6=Y['key']['toLowerCase'](),a7=(Y['purpose']??'')['toLowerCase'](),a8=/recover|award/['test'](a6)||!/refund/['test'](a6)&&/recover|award/['test'](a7)?'NODE\x20GATE\x20REQUIRED\x20(the\x20sketch\x20above\x20omits\x20it):\x20this\x20recovery\x20rail\x20is\x20a\x20terminal-node-gated\x20sweep\x20—\x20resolve\x20the\x20gate\x20to\x20fire\x20only\x20when\x20the\x20order\x20has\x20reached\x20the\x20recovery\x20terminal\x20nodes\x20(tpl_allocator_node_gate_recover\x20family\x20carries\x20the\x20node-gate\x20slot\x20set;\x20NEVER\x20slot\x20254).\x20NEVER\x20add\x20an\x20order.claimed_by\x20leg:\x20fund\x20rails\x20never\x20read\x20the\x20claimed_by\x20axis\x20(decision\x2011,\x20R-FUND-RAIL-CLAIMED-BY\x20/\x20RAIL_CLAIMED_BY_LEG\x20critical).':/refund/['test'](a6)||!/recover|award/['test'](a6)&&/refund/['test'](a7)?'NODE\x20GATE\x20REQUIRED\x20(the\x20sketch\x20above\x20omits\x20it):\x20this\x20refund\x20rail\x20may\x20only\x20fire\x20at\x20its\x20refund\x20terminal\x20node\x20—\x20resolve\x20the\x20gate\x20against\x20order\x20node\x20state,\x20never\x20against\x20order.claimed_by\x20(fund\x20rails\x20NEVER\x20read\x20the\x20claimed_by\x20axis;\x20decision\x2011,\x20R-FUND-RAIL-CLAIMED-BY\x20/\x20RAIL_CLAIMED_BY_LEG\x20critical).\x20The\x20arbitration\x20award\x20is\x20the\x20indemnity\x20track\x27s\x20separate\x20commercial\x20payout\x20—\x20any\x20refund/award\x20overlap\x20is\x20legal\x20and\x20disclosed\x20at\x20the\x20MCP\x20dual-payout\x20confirmation\x20gate.':undefined;return{'key':Y['key'],'template_id':Y['template_id'],'host':Y['host'],'purpose':Y['purpose'],'bound':!a4&&!a5,'resolution_required':!a4||a5||j!==undefined&&lookupBinding(Y,j)!==undefined,...!(a4&&!a5)||j!==undefined&&lookupBinding(Y,j)!==undefined?{}:{'advisory_note':'ADVISORY\x20ONLY\x20—\x20nothing\x20binds\x20this\x20design\x20and\x20the\x20plan\x20ships\x20WITHOUT\x20it.\x20NO\x20resolution\x20needed\x20unless\x20you\x20WANT\x20the\x20gate;\x20add\x20guide_confirm.guard_resolutions[\x27'+Y['key']+'\x27]\x20only\x20then\x20(algr12\x20M-14).'},...Z?.['logic_summary']?{'logic_summary':Z['logic_summary']}:{},...a8?{'logic_summary_note':a8}:{},...Z?.['key_queries']?.['length']?{'key_queries':Z['key_queries']}:{},...a0!==undefined&&a0['length']>0x0?{'suggested_templates':a0}:{},'how_to_resolve':'guide_confirm.guard_resolutions[\x27'+Y['key']+'\x27]\x20=\x20{\x20kind:\x20\x27inline\x27,\x20table,\x20root\x20}\x20(a\x20resolved\x20Guard),\x20'+'or\x20{\x20kind:\x20\x27template\x27,\x20template_id:\x20\x27tpl_*\x27,\x20params\x20}\x20when\x20a\x20guard\x20template\x20matches\x20this\x20design'+(a0!==undefined&&a0['length']>0x0?'\x20(suggested_templates\x20below\x20list\x20the\x20matching\x20executable\x20forms\x20and\x20their\x20parameters)':'.')+(Y['host']==='machine'&&!a3?'\x20MACHINE-HOST\x20REQUIREMENT:\x20the\x20inline\x20table\x20MUST\x20declare\x20the\x20protocol\x20task-binding\x20slot\x20'+'{\x20identifier:\x20254,\x20b_submission:\x20true,\x20value_type:\x20\x22Address\x22\x20}\x20—\x20the\x20forward\x27s\x20passport\x20only\x20emits\x20'+'DECLARED\x20slots,\x20so\x20a\x20machine-forward\x20guard\x20without\x20this\x20row\x20aborts\x20EVERY\x20order-bound\x20forward\x20'+'it\x20gates\x20(code\x2011)\x20and\x20the\x20pre-publish\x20gate\x20blocks\x20the\x20Machine\x20publish.':'')+(a3?'\x20ALLOCATOR-RAIL\x20NOTE:\x20this\x20design\x20gates\x20an\x20allocator\x20rail\x20(not\x20a\x20machine\x20forward)\x20—\x20do\x20NOT\x20add\x20the\x20'+'254\x20task-binding\x20slot:\x20a\x20254\x20declaration\x20arms\x20once-per-order\x20replay\x20protection\x20at\x20alloc\x20time\x20'+'(allocation\x20ONCE_FOR_OBJECT)\x20and\x20permanently\x20blocks\x20multi-fire\x20rails\x20(a\x20second\x20release\x20aborts\x20'+'E_ONCE_TRIGGERED).\x20The\x20kernel\x20injects\x20254\x20ONLY\x20for\x20GuardIdentifier(254)-recipient\x20rails.'+(a2['recipient']==='guard_identifier'&&a2['recipient_key']!=='254'?'\x20This\x20rail\x27s\x20recipient\x20is\x20GuardIdentifier('+(a2['recipient_key']??'0')+')\x20—\x20the\x20inline\x20table\x20MUST\x20'+('declare\x20slot\x20'+(a2['recipient_key']??'0')+'\x20as\x20an\x20Address\x20submission\x20instead\x20(N-K21:\x20the\x20passport\x20')+'submits\x20the\x20ORDER\x20address\x20into\x20it;\x20an\x20undeclared\x20slot\x20makes\x20the\x20rail\x20unexecutable).':''):'')+(a4?'\x20ADVISORY\x20DESIGN\x20(run75747\x20F-38):\x20nothing\x20in\x20this\x20archetype\x20binds\x20this\x20key\x20—\x20no\x20machine\x20edge,\x20allocator\x20'+'rail,\x20repository\x20policy,\x20or\x20service\x20mount.\x20If\x20this\x20design\x20does\x20not\x20apply\x20to\x20your\x20shop\x20you\x20may\x20resolve\x20'+'it\x20with\x20{\x20kind:\x20\x27omit\x27\x20}\x20instead\x20of\x20building\x20a\x20Guard\x20no\x20one\x20consumes:\x20the\x20design\x20leaves\x20'+'pending_guard_designs,\x20no\x20Guard\x20object\x20is\x20created,\x20and\x20the\x20decision\x20is\x20recorded\x20in\x20the\x20build\x27s\x20'+'warnings.\x20An\x20omit\x20of\x20a\x20BOUND\x20design\x20is\x20refused\x20(GUARD_OMIT_UNSUPPORTED).':'')};}),N=x['length']>0x0||t['blocking'],O={'expiredTerminal':(j['machine_shape']??[])['some'](Y=>/expire|deadline|timeout/i['test'](String(Y?.['name']??'')))},P=checkGameTheoryConstraints(w,g,O),Q=[];for(const Y of requirementCoverage(e['intent_text'],j)){if(Y['status']==='mapped')continue;Q['push']({'id':Y['family'],'label':Y['label'],'severity':Y['status']==='blocker'&&Y['family']==='fulfillment'?'critical':'medium','message':'Intent\x20promises\x20\x27'+Y['label']+'\x27\x20(stated:\x20\x22'+Y['evidence']+'\x22)\x20but\x20the\x20matched\x20template\x20does\x20not\x20carry\x20it:\x20'+Y['note'],'fix':Y['note']});}for(const Z of A){if(Z['adopted']||Z['evidence_matched']!==![])continue;Q['push']({'id':'module_'+Z['capability'],'label':Z['capability'],'severity':'info','message':'Module\x20\x27'+Z['capability']+'\x27\x20rides\x20score\x20alone\x20(no\x20intent\x20evidence):\x20its\x20objects\x20ARE\x20included\x20in\x20this\x20build\x20—\x20an\x20UNCONFIRMED\x20adoption.','fix':'Confirm\x20via\x20guide_state.adopted_module_ids,\x20answer\x20the\x20structured\x20payment/trust\x20questions,\x20or\x20rebuild\x20with\x20an\x20adoption\x20list\x20that\x20omits\x20it.'});}const R=assessWorkflowDesign(w,{'gaps':Q}),S=buildCreationPlan(w),T=[...new Set(s['steps']['filter'](a0=>typeof a0['account']==='string')['map'](a0=>a0['account']))]['sort'](),U=[...collectLateMarks(s)]['sort'](),V=j?{'name':j['id'],'display_name':j['variant']+'\x20archetype\x20('+j['industry']+')','source':a['template_override']?'custom':'builtin','risk_appetite':'medium','key_risk':j['key_risk'],'machine_shape':j['machine_shape']['map'](a0=>({'name':a0['name'],'role':a0['role'],...a0['operator']?{'operator':a0['operator']}:{},...a0['semantic_role']?{'semantic_role':a0['semantic_role']}:{}})),'guards':j['guards']['map'](a0=>({'template_id':a0['template_id'],'host':a0['host'],'purpose':a0['purpose']})),'allocator':j['allocator'],'risk_constraints':{},'build_notes':j['build_notes']??[],...j['time_anchors']?{'time_anchors':j['time_anchors']}:{}}:undefined;return{'action':'merchant_guide','current_step':N?0x9:0xa,'step_name':N?'Harness\x20Check\x20(issues\x20found)':'Submission\x20Plan\x20Ready','guide_state':{...e,'adopted_module_ids':i['map'](a0=>a0['id'])},'intent':{'intent_type':g['intent'],'industry':g['industry'],'roles':g['roles'],'deliverables':g['deliverables'],'payment':g['payment'],'trust':g['trust']},'adopted_modules':i['map'](a0=>({'id':a0['id'],'name':a0['name'],'description':a0['description'],'requires_keeper':a0['requiresKeeper'],'keeper_hint':a0['keeperHint'],'user_protections':a0['userProtections'],'merchant_obligations':a0['merchantObligations']})),'mode_prior':V,...l['length']>0x0?{'user_input_questions':l,'user_input_note':'Collect\x20each\x20answer\x20and\x20pass\x20it\x20back\x20as\x20guide_state.fee_overrides[\x27<param_key>\x27]\x20on\x20the\x20next\x20merchant_guide\x20call;\x20unanswered\x20questions\x20keep\x20the\x20template\x20default.'}:{},...V?.['time_anchors']?{'time_anchor_instructions':Object['entries'](V['time_anchors'])['map'](([a0,a1])=>{const a2=a1['startsWith']('order.time')?'\x20(order-creation\x20time\x20—\x20PRE-checkout\x20branches\x20only;\x20a\x20post-checkout\x20window\x20anchored\x20here\x20is\x20unreachable)':a1['startsWith']('progress.current_time')?'\x20(entry\x20time\x20of\x20the\x20window\x27s\x20source\x20node\x20—\x20witness-derived\x20via\x20OrderProgress,\x20one\x20Guard\x20serves\x20every\x20order)':a1['startsWith']('absolute_date')?'\x20(per-order\x20instance\x20Guard\x20—\x20the\x20absolute\x20date\x20differs\x20per\x20booking)':'';return'Time\x20windows\x20for\x20\x27'+a0+'\x27\x20anchor\x20to\x20'+a1+a2;})}:{},'blueprint':{'nodes':w['nodes']['map'](a0=>({'id':a0['id'],'type':a0['type'],'purpose':a0['purpose']})),'edges':w['edges']['map'](a0=>({'from':a0['from'],'to':a0['to'],'relation':a0['relation'],'required':a0['required']}))},'evaluation_preview':{'estimatedRiskScore':u,'estimatedCompletenessScore':Math['min'](0x64,0x1e+i['length']*0x8),'keyRisks':t['findings']['filter'](a0=>a0['level']==='critical'||a0['level']==='high')['map'](a0=>a0['title']),'strengths':t['findings']['filter'](a0=>a0['level']==='info')['map'](a0=>a0['title']),'moduleBoosts':{}},'graph_validation':{'valid':t['issues']['length']===0x0,'hard_violations':t['issues']['map'](a0=>({'id':a0['code'],'description':a0['detail'],'fix':'Fix\x20the\x20Plan\x20structure'})),'soft_notes':t['findings']['filter'](a0=>a0['level']==='medium'||a0['level']==='low')['map'](a0=>({'id':a0['rule_id'],'description':a0['title']}))},'harness_check':{'module_constraints':A['map'](a0=>{const a1=a0['capability']==='discount_lifecycle'&&a0['adopted']?'ADOPTION-BASED\x20satisfaction\x20(disclosure\x20obligations\x20accepted\x20with\x20module\x20adoption),\x20NOT\x20plan\x20structure:\x20creation_plan\x20intentionally\x20carries\x20no\x20Discount/SKU\x20nodes\x20—\x20they\x20are\x20minted\x20in\x20merchant\x20post-deploy\x20steps\x20and\x20verified\x20on-chain\x20after\x20deploy\x20(query\x20the\x20minted\x20Service.discount).\x20Reward\x20FUNDING\x20rides\x20review_mode\x20compile\x20emission,\x20BUT\x20the\x20reward\x20claim\x20GUARD\x20SPEC\x20must\x20still\x20be\x20declared\x20in\x20the\x20plan\x27s\x20guards[]\x20(host:\x27reward\x27)\x20—\x20compile\x20emits\x20the\x20rail\x20only\x20from\x20that\x20spec,\x20and\x20REVIEW_REWARD_GUARD_MISSING\x20hard-blocks\x20publish\x20when\x20it\x20is\x20omitted\x20(G-02,\x20onlyfans-mn\x20261019:\x20the\x20old\x20prose\x20denied\x20the\x20guard\x20spec\x20and\x20deadlocked\x20every\x20reward\x20publish).':a0['reason'],a2=a0['evidence_matched']===![]?a0['reason']:a1;return{'module':a0['capability'],'plan_satisfied':a0['adopted'],'missing':a0['missingConstraints'],'reason':a2,'findings':a0['findings'],'evidence_matched':a0['evidence_matched']};}),'blocking_issues':[...x['map'](a0=>({'module':a0['module'],'missing_constraints':a0['missing_constraints'],'fix':a0['fix']})),...F],'module_gaps':A['filter'](a0=>!a0['adopted'])['map'](a0=>({'module':a0['capability'],'missing_constraints':a0['missingConstraints'],'fix':a0['reason']})),'deploy_time_checks':C,'recipient_design_guidance':E},'game_theory':{'summary':P['summary'],'coverage':P['coveredCount']+'/'+P['totalCount'],'exposed_scenarios':P['exposedScenarios'],'wow_alignments':P['wowAlignments'],'scenarios':P['results']['map'](a0=>({'scenario':a0['scenario'],'covered':a0['covered'],'conflict':a0['conflict'],'user_protection':a0['userProtection'],'evaluation_metric':a0['evaluationMetric'],'recommendation':a0['recommendation']}))},'workflow_design_assessment':{'score':R['score'],'summary':R['summary'],'findings':R['findings']['map'](a0=>({'kind':a0['kind'],'severity':a0['severity'],'message':a0['message'],'fix':a0['fix']})),'checks':R['checks']['map'](a0=>({'id':a0['id'],'dimension':a0['dimension'],'passed':a0['passed'],'severity':a0['severity'],'message':a0['message'],'fix':a0['fix']}))},'creation_plan':S,'post_deploy_steps':D,...q['supplyChain']!==undefined?{'supply_chain':q['supplyChain']['map'](a0=>({'steps':a0['steps']['map'](a1=>a1['id']),'inputs':a0['inputs'],'primitives':a0['primitives'],'notes':a0['notes'],...a0['handoff']!==undefined?{'handoff':a0['handoff']}:{}}))}:{},'mandatory_disclosures':['PII\x20discipline\x20(rex5\x20B-57):\x20never\x20write\x20personal\x20data\x20(phone,\x20email,\x20exact\x20unit\x20address)\x20into\x20public\x20on-chain\x20fields\x20—\x20Contact\x20description/location/IM\x20entries,\x20repository\x20rows,\x20progress\x20messages\x20and\x20WIP\x20text\x20are\x20all\x20public.\x20Exchange\x20PII\x20over\x20the\x20encrypted\x20Messenger\x20and\x20keep\x20only\x20WTS\x20proofs\x20on\x20chain;\x20the\x20local\x20harness\x20store\x20is\x20non-private\x20too\x20(cache.db\x20holds\x20messenger\x20plaintext\x20and\x20LocalInfo\x20entries\x20unencrypted\x20on\x20disk,\x20readable\x20by\x20any\x20session\x20sharing\x20the\x20keystore).','Trust-claim\x20prose\x20is\x20not\x20a\x20chain\x20anchor\x20(rex5\x20T-31):\x20any\x20compensation-fund\x20or\x20protection\x20figure\x20quoted\x20in\x20the\x20service\x20description\x20is\x20free\x20text\x20—\x20awards\x20shrink\x20the\x20live\x20fund\x20in\x20place\x20(the\x20quoted\x20number\x20silently\x20goes\x20stale)\x20and\x20the\x20per-order\x20covered\x20ceiling\x20is\x20fund/3\x20(MAX_INDEMNITY_MULTIPLE),\x20not\x20the\x20headline.\x20Keep\x20quoted\x20numbers\x20synced\x20to\x20the\x20live\x20fund\x20balance\x20before\x20publishing\x20and\x20after\x20every\x20award.','Single-account\x20build\x20contract\x20(MN5-5R\x20decision):\x20this\x20pipeline\x20wires\x20ONLY\x20the\x20deploying\x20account\x20—\x20the\x20permission\x20layer\x27s\x20admin\x20pass-through\x20means\x20a\x20single-account\x20build\x20needs\x20zero\x20grants,\x20so\x20no\x20other\x20account\x20is\x20ever\x20granted.\x20A\x20multi-account\x20shop\x20(separate\x20keeper/staff/operator\x20accounts)\x20will\x20be\x20REFUSED\x20at\x20execution\x20time\x20(error\x20codes\x201000/1002\x20and\x20the\x20350~364\x20abort\x20family)\x20—\x20the\x20plan\x20will\x20look\x20complete\x20and\x20still\x20fail\x20on\x20first\x20non-admin\x20operation.\x20Until\x20an\x20explicit\x20account-grant\x20phase\x20ships,\x20run\x20multi-account\x20shops\x20by\x20declaring\x20the\x20limitation\x20up\x20front\x20and\x20granting\x20roles\x20manually\x20post-publish;\x20do\x20not\x20let\x20the\x20plan\x27s\x20completeness\x20imply\x20multi-account\x20readiness.'],...M['length']>0x0?{'pending_guard_designs':M}:{},...M['length']>0x0&&(s['pending_guards']?.['length']??0x0)!==M['length']?{'pending_count_note':'Two\x20counts,\x20two\x20views:\x20pending_guard_designs\x20lists\x20'+M['length']+'\x20unresolved\x20design(s)\x20(compile\x20view\x20—\x20includes\x20advisory\x20designs\x20with\x20no\x20edge/rail/policy/buy\x20mount);\x20'+('the\x20plan\x20audit\x20counts\x20'+(s['pending_guards']?.['length']??0x0)+'\x20(plan\x20view\x20—\x20site-bound\x20designs\x20only;\x20the\x20rule-pack\x20titles\x20\x22of\x20N\x20pending\x20in\x20total\x22\x20quote\x20this).\x20')+'The\x20LIST\x20is\x20the\x20resolution\x20fill\x20space;\x20the\x20audit\x20number\x20is\x20its\x20site-bound\x20subset.'}:{},'warnings':[...f['warnings'],...gasEconomicsWarnings(e['sales'],e['reward_claim_amount']),...q['omitted']['length']>0x0?['Advisory\x20guard\x20design(s)\x20omitted\x20by\x20decision\x20({kind:\x27omit\x27}):\x20'+q['omitted']['join'](',\x20')+'\x20—\x20'+'no\x20Guard\x20created,\x20nothing\x20binds\x20them\x20(run75747\x20F-38).']:[],...(q['supplyChain']??[])['flatMap']((a0,a1)=>a0['notes']['map'](a2=>'Supply-chain\x20promise\x20#'+String(a1+0x1)+':\x20'+a2)),...n['warnings']],'next_action':x['length']>0x0?'Resolve\x20the\x20blocking_issues\x20above\x20(compile\x20blockers\x20—\x20harness_check.blocking_issues\x20rows\x20with\x20module\x20\x27template\x27;\x20adjust\x20the\x20template\x20or\x20its\x20build\x20inputs),\x20then\x20call\x20merchant_guide\x20again.':t['blocking']?'The\x20plan\x20audit\x20is\x20BLOCKING\x20(see\x20harness_check.blocking_issues\x20and\x20audit.findings\x20—\x20e.g.\x20a\x20terminal\x20node\x20with\x20no\x20fund\x20exit,\x20or\x20an\x20unresolved\x20guard\x20bound\x20to\x20a\x20fund\x20path).\x20Fix\x20the\x20plan/template\x20or\x20guard\x20resolutions\x20and\x20call\x20merchant_guide\x20again;\x20do\x20NOT\x20materialize\x20this\x20plan.'+(M['length']>0x0?'\x20Pending\x20guard\x20designs:\x20'+M['length']+'\x20listed\x20in\x20pending_guard_designs\x20—\x20resolve\x20each\x20via\x20guide_confirm.guard_resolutions\x20(kind\x20\x27inline\x27\x20with\x20the\x20Guard\x20table+root,\x20kind\x20\x27template\x27\x20with\x20a\x20tpl_*\x20id,\x20or\x20{kind:\x27omit\x27}\x20for\x20advisory\x20designs\x20that\x20do\x20not\x20apply\x20to\x20this\x20shop),\x20then\x20call\x20merchant_guide\x20again.':''):K['length']>0x0?'Plan\x20is\x20structurally\x20ready,\x20but\x20'+K['length']+'\x20bound\x20guard\x20design(s)\x20('+K['map'](a0=>'\x27'+a0+'\x27')['join'](',\x20')+')\x20are\x20UNRESOLVED\x20(plan.pending_guard_designs)\x20—\x20do\x20NOT\x20materialize\x20yet:\x20an\x20unresolved\x20bound\x20design\x20ships\x20a\x20guard\x20the\x20executor\x20invents.\x20Resolve\x20each\x20via\x20guide_confirm.guard_resolutions\x20(kind\x20\x27inline\x27\x20with\x20the\x20Guard\x20table+root,\x20kind\x20\x27template\x27\x20with\x20a\x20tpl_*\x20id,\x20or\x20{kind:\x27omit\x27}\x20for\x20advisory\x20designs\x20that\x20do\x20not\x20apply\x20to\x20this\x20shop),\x20then\x20call\x20merchant_guide\x20again.':'Plan\x20ready.\x20Materialize\x20in\x20ONE\x20deterministic\x20call:\x20benchmark_migration\x20{action:\x27plan_execute\x27,\x20plan:\x20this\x20response\x27s\x20plan\x20object\x20verbatim'+(T['length']>0x0?',\x20accounts:{'+T['map'](a0=>a0+':\x20<its\x20controller\x20env>')['join'](',\x20')+'}':'')+('}\x20—\x20it\x20pre-flights\x20the\x20freeze\x20gate,\x20bind-audits\x20every\x20reference,\x20pre-resolves\x20local\x20marks,\x20slices\x20on\x20timeout_ms,\x20and\x20RESUMES\x20from\x20failures\x20(completed_steps\x20+\x20previous_outputs;\x20never\x20re-run\x20from\x20scratch\x20—\x20ghost\x20duplicates).\x20Then\x20run\x20post_deploy_steps\x20in\x20order\x20('+D['map'](a0=>a0['id'])['join'](',\x20')+').\x20WIZARD\x20CONTRACT:\x20on\x20the\x20Service\x20publish\x20call\x20(data.publish=true),\x20pass\x20this\x20exact\x20plan\x20back\x20as\x20data.creation_plan\x20—\x20the\x20publish\x20gate\x20replays\x20its\x20freeze\x20matrix\x20and\x20rejects\x20the\x20publish\x20if\x20any\x20gate\x20fails;\x20omitting\x20it\x20leaves\x20the\x20manual\x20path\x20ungated.\x20Manual\x20fallback\x20(only\x20if\x20plan_execute\x20refuses):\x20create\x20the\x20objects\x20in\x20creation_plan\x20order\x20via\x20onchain_operations,\x20then\x20run\x20post_deploy_steps\x20in\x20order.'),'plan':((()=>{const a0=templateCatalogDigest(String(s['templateId']??''));return{...s,...a0!==undefined?{'template_digest':a0}:{},'catalog_version':BUILTIN_TEMPLATES_VERSION};})()),...U['length']>0x0?{'required_local_marks':U,'required_local_marks_note':'plan_execute\x20(the\x20default\x20materializer\x20above)\x20resolves\x20each\x20of\x20these\x20local\x20names\x20against\x20the\x20LocalMark\x20store\x20of\x20the\x20target\x20network\x20and\x20refuses\x20to\x20execute\x20while\x20any\x20is\x20unregistered.\x20'+'Register\x20them\x20BEFORE\x20executing\x20(local_mark_operation\x20add).\x20A\x20name\x20that\x20matches\x20an\x20object\x20this\x20plan\x20itself\x20creates\x20is\x20bound\x20to\x20that\x20object\x20automatically.\x20'+'A\x20recipient\x20mark\x20must\x20point\x20at\x20a\x20real\x20account\x20address:\x20an\x20empty\x20name\x20makes\x20the\x20SDK\x20substitute\x20the\x20deploying\x20account,\x20and\x20an\x20object-id\x20/\x20zero-address\x20recipient\x20is\x20transferred\x20and\x20cannot\x20be\x20retrieved.'}:{},...n['steps']['length']>0x0?{'wip_source_steps':n['steps'],'wip_source_steps_note':'Execute-time\x20obligations\x20created\x20by\x20fee_overrides[\x27product_detail_source\x27].\x20A\x20URL\x20source\x20binds\x20sale.wip\x20directly\x20(wip_hash\x20stays\x20\x22\x22\x20until\x20pinned\x20—\x20pin\x20via\x20wip_file\x20verify\x20+\x20sales.op:\x27wip_set\x27);\x20a\x20local\x20source\x20is\x20already\x20hash-pinned\x20at\x20generate\x20time\x20but\x20MUST\x20be\x20hosted\x20publicly\x20and\x20rebound\x20before\x20customers\x20can\x20buy.\x20Both\x20are\x20ordinary\x20onchain_operations\x20calls,\x20not\x20plan\x20steps\x20—\x20run\x20them\x20in\x20the\x20order\x20given.'}:{},'audit':{'issues':t['issues'],'findings':t['findings'],'blocking':t['blocking'],'score':u},'reflux':{'applied':r['applied'],'blocks':r['blocks'],'iterations':r['iterations']}};}
|