@wowok/agent-mcp 3.3.8 → 3.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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 +3 -2
- package/dist/composition/compile.js +1 -1
- package/dist/composition/inflight.d.ts +6 -0
- package/dist/composition/inflight.js +1 -1
- package/dist/composition/materialize.d.ts +4 -0
- package/dist/composition/materialize.js +1 -1
- package/dist/composition/param-disclosure.d.ts +61 -0
- package/dist/composition/param-disclosure.js +1 -0
- package/dist/composition/plan.d.ts +11 -1
- package/dist/composition/plan.js +1 -1
- package/dist/customer/account-events.js +1 -1
- package/dist/data/api/api.spec.js +1 -1
- package/dist/data/api/cli.js +1 -1
- package/dist/data/api/server.d.ts +1 -0
- package/dist/data/api/server.js +1 -1
- package/dist/data/projection/store.d.ts +2 -1
- package/dist/data/projection/store.js +1 -1
- package/dist/data/projection/types.d.ts +10 -0
- package/dist/data/sync/cdc.js +1 -1
- package/dist/data/sync/cdc.spec.js +1 -1
- package/dist/data/sync/store.d.ts +5 -0
- package/dist/data/sync/store.js +1 -1
- package/dist/data/sync/types.d.ts +2 -0
- package/dist/evaluation/builtins/graph-service.spec.js +1 -1
- package/dist/evaluation/engine.js +1 -1
- package/dist/evaluation/guard-scan.js +1 -1
- package/dist/experience/realtime-feedback.js +1 -1
- package/dist/extensions/business-modules.js +1 -1
- package/dist/extensions/industry-pack.js +1 -1
- package/dist/extensions/modes.js +1 -1
- package/dist/graph/onchain/expand.js +1 -1
- package/dist/graph/onchain/exposure.js +1 -1
- package/dist/harness/recover.js +1 -1
- package/dist/index.js +1 -1
- package/dist/knowledge/allocation-risk.js +1 -1
- package/dist/knowledge/allocation-templates.js +1 -1
- package/dist/knowledge/allocator-rail-verifier.js +1 -1
- package/dist/knowledge/arb-fund-facts.d.ts +1 -0
- package/dist/knowledge/arb-fund-facts.js +1 -1
- package/dist/knowledge/arbitration-ledger.js +1 -1
- package/dist/knowledge/arbitration-risk.d.ts +1 -0
- package/dist/knowledge/arbitration-risk.js +1 -1
- package/dist/knowledge/audit-rules.js +1 -1
- package/dist/knowledge/baselines/rules/allocation.json +6 -6
- package/dist/knowledge/baselines/rules/arb.json +2 -2
- package/dist/knowledge/baselines/rules/guard.json +11 -11
- package/dist/knowledge/baselines/rules/order.json +1 -1
- package/dist/knowledge/baselines/rules/plan.json +1 -1
- package/dist/knowledge/baselines/semantic-facts.js +1 -1
- package/dist/knowledge/builtin-templates.d.ts +14 -1
- package/dist/knowledge/builtin-templates.js +1 -1
- package/dist/knowledge/catalog-facts.d.ts +4 -0
- package/dist/knowledge/catalog-facts.js +1 -0
- package/dist/knowledge/commission-landing.js +1 -1
- package/dist/knowledge/component-schema.d.ts +64 -0
- package/dist/knowledge/component-schema.js +1 -0
- package/dist/knowledge/entity-recipient-guard.js +1 -1
- package/dist/knowledge/event-semantics.js +1 -1
- package/dist/knowledge/fee-param-bindings.d.ts +26 -0
- package/dist/knowledge/fee-param-bindings.js +1 -0
- package/dist/knowledge/fund-layer.js +1 -1
- package/dist/knowledge/getting-started.d.ts +2 -2
- package/dist/knowledge/getting-started.js +1 -1
- package/dist/knowledge/guard-anchor-reach.js +1 -1
- package/dist/knowledge/guard-design-patterns.js +1 -1
- package/dist/knowledge/guard-ledger.js +1 -1
- package/dist/knowledge/guard-lint.d.ts +1 -0
- package/dist/knowledge/guard-lint.js +1 -1
- package/dist/knowledge/guard-puzzle.js +1 -1
- package/dist/knowledge/guard-risk.js +1 -1
- package/dist/knowledge/guard-templates.d.ts +1 -1
- package/dist/knowledge/guard-templates.js +1 -1
- package/dist/knowledge/guard-translation.js +1 -1
- package/dist/knowledge/index.js +1 -1
- package/dist/knowledge/industry-registry.js +1 -1
- package/dist/knowledge/industry-strategy.js +1 -1
- package/dist/knowledge/jsonrpc-enum.d.ts +14 -3
- package/dist/knowledge/jsonrpc-enum.js +1 -1
- package/dist/knowledge/knob-docs.d.ts +5 -0
- package/dist/knowledge/knob-docs.js +1 -0
- package/dist/knowledge/machine-templates.js +1 -1
- package/dist/knowledge/machine-topology.js +1 -1
- package/dist/knowledge/machine-translation.js +1 -1
- package/dist/knowledge/onchain-constants.d.ts +2 -0
- package/dist/knowledge/onchain-constants.js +1 -1
- package/dist/knowledge/order-ledger.js +1 -1
- package/dist/knowledge/param-schema.d.ts +70 -0
- package/dist/knowledge/param-schema.js +1 -0
- package/dist/knowledge/param-tiers.d.ts +25 -0
- package/dist/knowledge/param-tiers.js +1 -0
- package/dist/knowledge/passport-ledger.d.ts +1 -1
- package/dist/knowledge/passport-ledger.js +1 -1
- package/dist/knowledge/pattern-resolutions.d.ts +106 -0
- package/dist/knowledge/pattern-resolutions.js +1 -0
- package/dist/knowledge/projection.spec.js +1 -1
- package/dist/knowledge/safety-rules.js +1 -1
- package/dist/knowledge/scenario-modes.d.ts +1 -0
- package/dist/knowledge/scenario-modes.js +1 -1
- package/dist/knowledge/scenario-topology.js +1 -1
- package/dist/knowledge/service-allocation-semantics.js +1 -1
- package/dist/knowledge/service-ledger.js +1 -1
- package/dist/knowledge/service-templates.js +1 -1
- package/dist/knowledge/strategy-manuals.d.ts +1 -1
- package/dist/knowledge/strategy-manuals.js +1 -1
- package/dist/knowledge/template-loader.d.ts +101 -1
- package/dist/knowledge/template-loader.js +1 -1
- package/dist/knowledge/template-nav.d.ts +7 -0
- package/dist/knowledge/template-nav.js +1 -0
- package/dist/knowledge/template-registry.js +1 -1
- package/dist/knowledge/template-scanner.d.ts +33 -0
- package/dist/knowledge/template-scanner.js +1 -1
- package/dist/knowledge/template-test-profiles.d.ts +17 -0
- package/dist/knowledge/template-test-profiles.js +1 -0
- package/dist/knowledge/template-validation.d.ts +1 -0
- package/dist/knowledge/template-validation.js +1 -1
- package/dist/knowledge/tools-reference.js +1 -1
- package/dist/knowledge/treasury-templates.js +1 -1
- package/dist/knowledge/workflow-guidance.js +1 -1
- package/dist/monitor/MonitorLoop.js +1 -1
- package/dist/participation/time-window.d.ts +37 -0
- package/dist/participation/time-window.js +1 -0
- package/dist/playbooks/service-build/business-puzzle.js +1 -1
- package/dist/playbooks/service-build/machine-panorama.d.ts +1 -0
- package/dist/playbooks/service-build/machine-panorama.js +1 -1
- package/dist/playbooks/service-build/merchant-guide.d.ts +4 -1
- package/dist/playbooks/service-build/merchant-guide.js +1 -1
- package/dist/playbooks/service-build/migration-planner.js +1 -1
- package/dist/playbooks/service-build/object-panorama.js +1 -1
- package/dist/playbooks/service-build/participation-radar.d.ts +1 -0
- 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.d.ts +1 -0
- package/dist/playbooks/service-build/service-panorama.js +1 -1
- package/dist/playbooks/service-build/service-quote.js +1 -1
- package/dist/playbooks/service-build/service-quote.spec.js +1 -1
- package/dist/playbooks/service-build/workflow-design-assessment.js +1 -1
- package/dist/relationship/registry.js +1 -1
- package/dist/review/index.js +1 -1
- package/dist/runtime/instance-registry.d.ts +7 -1
- package/dist/runtime/instance-registry.js +1 -1
- package/dist/safety/confirm-gate.js +1 -1
- package/dist/schema/benchmark-migration/index.d.ts +2 -0
- package/dist/schema/benchmark-migration/index.js +1 -1
- package/dist/schema/call/allocation.js +1 -1
- package/dist/schema/call/arbitration.js +1 -1
- package/dist/schema/call/base.d.ts +8 -0
- package/dist/schema/call/base.js +1 -1
- package/dist/schema/call/bridge.d.ts +2 -0
- package/dist/schema/call/error-codes.d.ts +1 -1
- package/dist/schema/call/error-codes.js +1 -1
- package/dist/schema/call/guard.js +1 -1
- package/dist/schema/call/handler.js +1 -1
- package/dist/schema/call/machine.js +1 -1
- package/dist/schema/call/semantic.js +1 -1
- package/dist/schema/call/service.d.ts +3 -3
- package/dist/schema/call/service.js +1 -1
- package/dist/schema/common/index.js +1 -1
- package/dist/schema/evaluation/index.d.ts +8 -0
- package/dist/schema/evaluation/index.js +1 -1
- package/dist/schema/goal/planning.d.ts +1 -0
- package/dist/schema/goal/planning.js +1 -1
- package/dist/schema/industry-pack/index.d.ts +29 -0
- package/dist/schema/industry-pack/index.js +1 -1
- package/dist/schema/local/index.d.ts +20 -0
- package/dist/schema/local/index.js +1 -1
- package/dist/schema/messenger/index.d.ts +2 -0
- package/dist/schema/messenger/index.js +1 -1
- package/dist/schema/operations.d.ts +1 -1
- package/dist/schema/operations.js +1 -1
- package/dist/schema/query/bi.d.ts +106 -0
- package/dist/schema/query/bi.js +1 -1
- package/dist/schema/query/index.d.ts +5 -5
- package/dist/schema/query/index.js +1 -1
- package/dist/schema/schema-version.js +1 -1
- package/dist/schema/watch/index.js +1 -1
- package/dist/schema-query-impl/index.js +1 -1
- package/dist/schemas/account_operation.output.json +4 -2
- package/dist/schemas/benchmark_migration_operation.output.json +3 -3
- package/dist/schemas/benchmark_migration_operation.schema.json +16 -2
- package/dist/schemas/bridge_operation.output.json +4 -2
- package/dist/schemas/bridge_operation.schema.json +5 -5
- package/dist/schemas/evaluation_operation.output.json +16 -0
- package/dist/schemas/guard2file.schema.json +1 -1
- package/dist/schemas/index.json +1 -1
- package/dist/schemas/industry_pack_operation.output.json +150 -1
- package/dist/schemas/industry_pack_operation.schema.json +9 -3
- package/dist/schemas/keeper_operation.output.json +2 -2
- package/dist/schemas/local_cache_operation.output.json +4 -2
- package/dist/schemas/local_history_operation.output.json +4 -2
- package/dist/schemas/local_info_operation.output.json +4 -2
- package/dist/schemas/local_mark_operation.output.json +4 -2
- package/dist/schemas/machineNode2file.schema.json +1 -1
- package/dist/schemas/messenger_operation.output.json +13 -2
- package/dist/schemas/messenger_operation.schema.json +41 -34
- package/dist/schemas/monitor_events.output.json +2 -2
- package/dist/schemas/monitor_subscription.output.json +2 -2
- package/dist/schemas/onchain_events.output.json +14 -14
- package/dist/schemas/onchain_operations.output.json +13 -10
- package/dist/schemas/onchain_operations.schema.json +124 -99
- package/dist/schemas/onchain_operations_allocation.schema.json +7 -6
- package/dist/schemas/onchain_operations_arbitration.schema.json +7 -6
- package/dist/schemas/onchain_operations_contact.schema.json +4 -3
- package/dist/schemas/onchain_operations_demand.schema.json +4 -3
- package/dist/schemas/onchain_operations_gen_passport.schema.json +4 -3
- package/dist/schemas/onchain_operations_gen_proof.schema.json +1 -1
- package/dist/schemas/onchain_operations_guard.schema.json +7 -6
- package/dist/schemas/onchain_operations_machine.schema.json +9 -7
- package/dist/schemas/onchain_operations_order.schema.json +6 -4
- package/dist/schemas/onchain_operations_payment.schema.json +2 -2
- package/dist/schemas/onchain_operations_permission.schema.json +19 -15
- package/dist/schemas/onchain_operations_personal.schema.json +17 -14
- package/dist/schemas/onchain_operations_progress.schema.json +6 -4
- package/dist/schemas/onchain_operations_proof.schema.json +4 -3
- package/dist/schemas/onchain_operations_repository.schema.json +9 -7
- package/dist/schemas/onchain_operations_reward.schema.json +5 -4
- package/dist/schemas/onchain_operations_service.schema.json +15 -12
- package/dist/schemas/onchain_operations_treasury.schema.json +4 -3
- package/dist/schemas/onchain_table_data.output.json +18 -13
- package/dist/schemas/onchain_table_data.schema.json +13 -13
- package/dist/schemas/query_toolkit.output.json +301 -33
- package/dist/schemas/query_toolkit.schema.json +6 -6
- package/dist/schemas/watch_operation.output.json +3 -3
- package/dist/schemas/workflow_operation.schema.json +3 -2
- package/dist/schemas/wowok_buildin_info.schema.json +1 -1
- package/dist/task/playbook.js +1 -1
- package/dist/tools/handlers/benchmark-migration.d.ts +1 -0
- package/dist/tools/handlers/benchmark-migration.js +1 -1
- package/dist/tools/handlers/config.js +1 -1
- package/dist/tools/handlers/evaluation.js +1 -1
- package/dist/tools/handlers/evaluation.spec.js +1 -1
- package/dist/tools/handlers/industry-pack.js +1 -1
- package/dist/tools/handlers/messenger.js +1 -1
- package/dist/tools/handlers/onchain.d.ts +4 -0
- package/dist/tools/handlers/onchain.js +1 -1
- package/dist/tools/index.js +1 -1
- 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/sanitize-output.js +1 -1
- package/dist/tools/sanitize-output.spec.js +1 -1
- package/dist/tools/types.d.ts +1 -0
- package/dist/tools/upgrade-check.d.ts +22 -0
- package/dist/tools/upgrade-check.js +1 -1
- package/dist/tools/wrap.d.ts +1 -1
- package/dist/tools/wrap.js +1 -1
- package/package.json +7 -6
package/dist/extensions/modes.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{getScenarioMode}from'../knowledge/scenario-modes.js';import{BUILTIN_TEMPLATES}from'../knowledge/builtin-templates.js';import{getIndustryTraits}from'../knowledge/industry-registry.js';import{getIndustryRiskChecks,getIndustryNeeds}from'../customer/index.js';import{SUPPORTED_INDUSTRIES}from'../customer/user-preferences.js';import{getFlywheelForIndustry}from'../knowledge/acquisition-flywheel.js';const GENERAL_TRAITS={'has_logistics':![],'communication_heavy':![],'pure_digital':![],'long_cycle':![],'deposit_required':![],'multi_tier_allocation':![],'regulatory_intensity':'low','trust_sensitivity':'medium','consumption_frequency':'occasional','avg_ticket_size':'medium'},GENERAL_FLYWHEEL={'industry':'general','trustSellingPoints':[],'keyActions':[],'rewardStrategy':'User-defined','discountStrategy':'User-defined','trustDescription':'User-defined\x20trust\x20mechanism'},GENERAL_MACHINE_SHAPE=[{'name':'paid','role':'Entry:\x20order\x20created\x20and\x20paid'},{'name':'delivering','role':'Service\x20delivery\x20in\x20progress'},{'name':'delivered','role':'Deliverable\x20available\x20for\x20review'},{'name':'completed','role':'Service\x20completed,\x20funds\x20released'},{'name':'cancelled','role':'Pre-delivery\x20cancellation\x20—\x20triggers\x20refund\x20Allocator','operator':'order_payer'}],GENERAL_ALLOCATOR={'recipient':'signer','count':0x1,'mode':'surplus','description':'Default:\x20surplus\x20to\x20service\x20owner\x20(general\x20fallback)'},RETAIL_D2C_MACHINE_SHAPE=[{'name':'ordered','role':'Entry:\x20order\x20created\x20(funds\x20escrowed\x20in\x20Allocation)'},{'name':'shipped','role':'Merchant\x20ships\x20goods'},{'name':'delivered','role':'Goods\x20delivered\x20to\x20buyer'},{'name':'completed','role':'Buyer\x20confirms\x20receipt\x20—\x20withdraw_guard\x20releases\x20funds','operator':'order_payer'},{'name':'cancelled','role':'Pre-ship\x20cancellation\x20—\x20refund_guard\x20refunds\x20buyer','operator':'order_payer'}],RETAIL_D2C_GUARDS=[{'template_id':'withdraw_guard_delivery','host':'service','purpose':'Release\x20funds\x20to\x20merchant\x20+\x20processor\x20on\x20order\x20completion\x20(delivery\x20confirmation)'},{'template_id':'refund_guard_cancellation','host':'service','purpose':'Refund\x20100%\x20to\x20buyer\x20on\x20order\x20cancellation'}],RETAIL_D2C_ALLOCATOR={'recipient':'entity','count':0x2,'mode':'rate','description':'Merchant\x2097%\x20+\x20Processor\x203%\x20(rate-based\x20split,\x20no\x20platform\x20commission)'},RETAIL_D2C_KEY_RISK='No\x20platform\x20arbitration\x20—\x20disputes\x20rely\x20on\x20optional\x20Arbitration\x20or\x20off-chain\x20chargeback',RETAIL_D2C_BUILD_NOTES=['Allocation\x20escrow\x20replaces\x20platform\x20custody\x20—\x20funds\x20locked\x20in\x20contract\x20until\x20Guard\x20releases','withdraw_guard\x20enforces\x20delivery\x20gate\x20—\x20merchant\x20must\x20reach\x20\x27completed\x27\x20state\x20to\x20receive\x20payment','refund_guard\x20ensures\x20100%\x20refund\x20on\x20cancellation\x20—\x20no\x20merchant\x20approval\x20needed','No\x20buy_guard\x20needed\x20—\x20D2C\x20doesn\x27t\x20gate\x20purchases\x20(open\x20storefront)','Arbitration\x20is\x20optional\x20—\x20add\x20when\x20dispute\x20volume\x20justifies\x20the\x20cost','Service\x20↔\x20Guard\x20circular\x20dependency:\x20create\x20Service\x20(unpublished)\x20→\x20create\x20Guards\x20→\x20update\x20Service\x20(publish)'],SUPPORTED_INDUSTRY_SET=new Set([...SUPPORTED_INDUSTRIES,'retail_d2c']);function fetchTemplate(a){const b=a==='retail_d2c'?'retail':a,c=getIndustryTraits(b)??GENERAL_TRAITS,d=SUPPORTED_INDUSTRY_SET['has'](a),e=a==='retail_d2c'?'retail':a,f=d?getIndustryRiskChecks(e):[],g=d?getIndustryNeeds(e):[],h=getFlywheelForIndustry(b)??GENERAL_FLYWHEEL;let i,j,k,l,m;if(a==='retail_d2c')i=RETAIL_D2C_MACHINE_SHAPE,j=RETAIL_D2C_GUARDS,k=RETAIL_D2C_ALLOCATOR,l=RETAIL_D2C_KEY_RISK,m=RETAIL_D2C_BUILD_NOTES;else{if(a==='general'){const n=getScenarioMode('general');i=GENERAL_MACHINE_SHAPE,j=[],k=GENERAL_ALLOCATOR,l=n?.['key_risk']??'No\x20safety\x20net\x20—\x20user\x20must\x20design\x20all\x20trust\x20mechanisms\x20manually',m=n?.['build_notes'];}else{const o=getScenarioMode(a);if(!o)throw new Error('[modes.ts]\x20No\x20scenario\x20mode\x20found\x20for\x20industry:\x20'+a);const p=BUILTIN_TEMPLATES['find'](q=>q['id']===o['default_template']);if(!p)throw new Error('[modes.ts]\x20Mode\x20\x27'+a+'\x27\x20default_template\x20\x27'+o['default_template']+'\x27\x20is\x20not\x20in\x20the\x20builtin\x20template\x20catalog');i=p['machine_shape'],j=p['guards'],k=p['allocator'],l=o['key_risk'],m=o['build_notes'];}}return{'traits':c,'risk_checks':f,'needs':g,'flywheel':h,'machine_shape':i,'guards':j,'allocator':k,'key_risk':l,'build_notes':m};}export const BUILTIN_MODES=[{'name':'freelance','display_name':'Freelance','version':'v1','source':'builtin',...fetchTemplate('freelance'),'analyze':{'key_questions':['Are\x20WIP\x20hashes\x20bound\x20to\x20each\x20milestone,\x20so\x20delivery\x20evidence\x20cannot\x20be\x20substituted\x20after\x20acceptance?','Does\x20the\x20acceptance\x20gate\x20have\x20a\x20time-bounded\x20escape\x20(keeper-driven\x20auto-accept),\x20or\x20can\x20a\x20silent\x20buyer\x20hold\x20the\x20provider\x27s\x20funds\x20hostage\x20indefinitely?']},'capabilities_used':['permission.index_create','permission.role_assign','guard.validate_buy','guard.validate_wip_hash','machine.node_topology','treasury.owner_receive','allocation.distribute','allocation.distribute_milestone','service.publish','progress.advance','arb.vote_weighted','contact.im_create'],'config_overrides':{'service':{'setting_lock_duration':'30d','engagement_type':'milestone'},'machine':{'wip_required':!![],'wip_hash_algorithm':'sha256','acceptance_gate':!![]}},'expected_benefits':[{'metric':'Dispute\x20rate\x20reduction','expected_value':'40%','evidence':'WIP\x20hash\x20+\x20milestone\x20allocation\x20enforces\x20delivery\x20evidence'},{'metric':'Delivery\x20confirmation\x20efficiency','expected_value':'+50%','evidence':'acceptance\x20gate\x20automates\x20acceptance\x20workflow'},{'metric':'Provider\x20payment\x20assurance','expected_value':'100%','evidence':'Funds\x20auto-release\x20to\x20provider\x20after\x20accepted\x20node'}],'risk_appetite':'balanced','risk_constraints':{'require_arbitration':!![],'require_compensation_fund':![],'require_wip_evidence':!![],'other_constraints':['setting_lock_duration\x20>=\x207d\x20to\x20lock\x20engagement-period\x20rules','Acceptance\x20timeout\x20=\x20the\x20template\x27s\x20escrow_release_days\x20(single\x20source:\x20fee_params,\x20override\x20via\x20fee_overrides).\x20Mechanism:\x20dual-branch\x20time-gated\x20forward\x20(pattern.time_lock_progress\x20anchored\x20on\x20the\x20delivered\x20entry);\x20a\x20keeper\x20advances\x20the\x20timeout\x20path.\x20adminUnhold\x20(224)\x20is\x20ONLY\x20the\x20hold-release\x20escape\x20hatch,\x20never\x20the\x20timeout\x20mechanism.']},'applicable_conditions':{'business_scale':'small','min_daily_orders':0x1,'other_conditions':['Suitable\x20for\x20mid-to-long-term\x20project\x20delivery','Requires\x20milestone-based\x20phased\x20acceptance']},'similar_industries':['rental','education'],'novel_capabilities':['allocation.distribute_milestone'],'disabled_builtin_constraints':['require_compensation_fund']},{'name':'rental','display_name':'Rental','version':'v1','source':'builtin',...fetchTemplate('rental'),'analyze':{'key_questions':['Is\x20the\x20deposit\x20escrowed\x20on-chain\x20and\x20sized\x20against\x20the\x20item\x27s\x20full\x20replacement\x20value,\x20not\x20just\x20the\x20rental\x20fee?','Are\x20pre-handover\x20and\x20post-return\x20WIP\x20states\x20hash-recorded,\x20so\x20damage\x20attribution\x20is\x20provable\x20rather\x20than\x20asserted?']},'capabilities_used':['permission.index_create','permission.role_assign','guard.validate_buy','guard.validate_wip_hash','machine.node_topology','treasury.owner_receive','allocation.distribute','service.publish','progress.advance','arb.vote_weighted','contact.im_create'],'config_overrides':{'treasury':{'deposit_escrow':!![],'deposit_deductible':!![]},'machine':{'wip_required':!![],'wip_stages':['handover_out','returned'],'inspection_gate':!![]}},'expected_benefits':[{'metric':'Deposit\x20dispute\x20rate','expected_value':'-60%','evidence':'pre-rental\x20WIP\x20mandatorily\x20records\x20item\x27s\x20original\x20state'},{'metric':'Damage\x20liability\x20accuracy','expected_value':'+70%','evidence':'pre/post\x20WIP\x20hash\x20comparison\x20eliminates\x20unfounded\x20deductions'},{'metric':'Trust\x20score','expected_value':'+25%','evidence':'compensation_fund\x20covers\x20damage\x20risk'}],'risk_appetite':'conservative','risk_constraints':{'require_arbitration':!![],'require_compensation_fund':!![],'require_wip_evidence':!![],'max_single_transaction':0x2710,'compensation_fund_coverage_ratio':0xa,'other_constraints':['Deposit\x20must\x20be\x20escrowed\x20(no\x20direct\x20transfer)','lock_duration\x20>=\x207d\x20to\x20prevent\x20arbitrary\x20merchant\x20withdrawal']},'applicable_conditions':{'business_scale':'small','min_daily_orders':0x1,'other_conditions':['Requires\x20physical\x20item\x20handover','Has\x20logistics\x20or\x20offline\x20delivery\x20leg']},'similar_industries':['retail','travel'],'novel_capabilities':[]},{'name':'education','display_name':'Education','version':'v1','source':'builtin',...fetchTemplate('education'),'analyze':{'key_questions':['Does\x20tuition\x20release\x20per\x20attended\x20session\x20(Progress\x20node),\x20so\x20undelivered\x20sessions\x20stay\x20refundable\x20if\x20the\x20institution\x20disappears?','Does\x20setting_lock_duration\x20span\x20the\x20full\x20term,\x20so\x20the\x20institution\x20cannot\x20tighten\x20refund\x20rules\x20mid-course?']},'capabilities_used':['permission.index_create','permission.role_assign','guard.validate_buy','guard.validate_wip_hash','machine.node_topology','treasury.owner_receive','allocation.distribute','allocation.distribute_milestone','service.publish','progress.advance','arb.vote_weighted','contact.im_create'],'config_overrides':{'allocation':{'strategy':{'recipient':'entity','count':0x1,'mode':'amount','description':'1/N\x20of\x20tuition\x20released\x20per\x20session\x20attendance'},'session_threshold':!![]},'service':{'setting_lock_duration':'120d','anti_runaway':!![]}},'expected_benefits':[{'metric':'Refund\x20dispute\x20rate','expected_value':'-50%','evidence':'per-session\x20release\x20distributes\x20tuition\x20by\x20class'},{'metric':'Institution\x20runaway\x20risk','expected_value':'eliminated','evidence':'Funds\x20release\x20per\x20session;\x20undelivered\x20portion\x20is\x20refundable'},{'metric':'Attendance\x20traceability','expected_value':'100%','evidence':'attendance_guard\x20signs\x20each\x20session'}],'risk_appetite':'conservative','risk_constraints':{'require_arbitration':!![],'require_compensation_fund':!![],'require_wip_evidence':![],'other_constraints':['setting_lock_duration\x20covers\x20the\x20entire\x20term\x20(>=90d)','Long-cycle\x20projects\x20must\x20monitor\x20>90d\x20progress']},'applicable_conditions':{'business_scale':'medium','min_daily_orders':0x1,'other_conditions':['Long-cycle\x20delivery','Requires\x20per-session\x20acceptance','Regulatory\x20intensity:\x20medium']},'similar_industries':['freelance','subscription'],'novel_capabilities':['allocation.distribute_milestone'],'disabled_builtin_constraints':['require_wip_evidence']},{'name':'travel','display_name':'Travel','version':'v1','source':'builtin',...fetchTemplate('travel'),'analyze':{'key_questions':['Does\x20each\x20itinerary\x20segment\x20have\x20its\x20own\x20guard\x20and\x20WIP\x20acceptance,\x20so\x20one\x20failed\x20leg\x20is\x20refundable\x20without\x20unwinding\x20the\x20whole\x20trip?','Is\x20the\x20multi-tier\x20allocation\x20waterfall\x20(agency\x20→\x20hotel/guide/driver)\x20visible\x20on-chain,\x20so\x20the\x20agency\x20cannot\x20silently\x20re-split\x20funds?']},'capabilities_used':['permission.index_create','permission.role_assign','guard.validate_buy','guard.validate_wip_hash','machine.node_topology','treasury.owner_receive','allocation.distribute','service.publish','progress.advance','arb.vote_weighted','contact.im_create'],'config_overrides':{'allocation':{'strategy':{'recipient':'entity','count':0x3,'mode':'amount','description':'Deposit\x2020%\x20to\x20agency,\x20final\x2080%\x20to\x20agency,\x20then\x20agency-side\x20Allocation\x20splits\x20to\x20hotel/guide/driver\x20per\x20segment'},'multi_tier_waterfall':!![],'guard_chaining':!![]},'service':{'supply_chain_suborders':!![],'segment_guard_required':!![]}},'expected_benefits':[{'metric':'Fund\x20transparency','expected_value':'100%','evidence':'multi-tier\x20allocation\x20splits\x20per\x20segment\x20to\x20hotel/guide/driver'},{'metric':'Itinerary\x20change\x20disputes','expected_value':'-45%','evidence':'segment\x20WIP\x20accepts\x20each\x20leg'},{'metric':'Breach\x20compensation\x20assurance','expected_value':'+60%','evidence':'compensation_fund\x20covers\x20itinerary\x20breach'}],'risk_appetite':'balanced','risk_constraints':{'require_arbitration':!![],'require_compensation_fund':!![],'require_wip_evidence':!![],'other_constraints':['Multi-tier\x20allocation\x20requires\x20guard\x20chaining\x20validation','deposit\x2020%\x20+\x20final\x2080%\x20two-stage\x20payment']},'applicable_conditions':{'business_scale':'medium','min_daily_orders':0x1,'other_conditions':['Multi-segment\x20itinerary\x20combination','Requires\x20hotel/guide/driver\x20multi-party\x20allocation']},'similar_industries':['rental','education'],'novel_capabilities':[]},{'name':'subscription','display_name':'Subscription','version':'v1','source':'builtin',...fetchTemplate('subscription'),'analyze':{'key_questions':['Is\x20every\x20periodic\x20charge\x20gated\x20by\x20an\x20explicit\x20user\x20confirmation,\x20with\x20no\x20auto-renew\x20default?','Can\x20the\x20subscriber\x20cancel\x20anytime\x20effective\x20next\x20period,\x20without\x20a\x20dead-end\x20node\x20in\x20the\x20machine?']},'capabilities_used':['permission.index_create','permission.role_assign','guard.validate_buy','machine.node_topology','treasury.owner_receive','allocation.distribute','service.publish','progress.advance','arb.vote_weighted','reward.claim_guard','contact.im_create'],'config_overrides':{'machine':{'no_auto_renew_trap':!![],'user_confirmed_charge':!![],'cancel_anytime':!![],'next_period_effective':!![]},'service':{'creator_data_subscription':!![],'periodic_billing':!![]}},'expected_benefits':[{'metric':'Renewal\x20rate','expected_value':'+25%','evidence':'loyalty\x20reward\x20+\x20transparent\x20subscription\x20mechanism'},{'metric':'Cancellation\x20disputes','expected_value':'eliminated','evidence':'cancel\x20anytime\x20+\x20no\x20auto-renew\x20trap'},{'metric':'Creator\x20retention','expected_value':'+30%','evidence':'deliver_guard_wip\x20prevents\x20content\x20dropout'}],'risk_appetite':'aggressive','risk_constraints':{'require_arbitration':![],'require_compensation_fund':![],'require_wip_evidence':![],'compensation_fund_coverage_ratio':0x3,'other_constraints':['Forbid\x20dead-end\x20nodes\x20(prevent\x20lock-in)','charge_guard\x20requires\x20user\x20confirmation\x20each\x20period']},'applicable_conditions':{'business_scale':'small','min_daily_orders':0x5,'other_conditions':['Pure-digital\x20delivery','Periodic\x20content\x20or\x20SaaS\x20service']},'similar_industries':['freelance','education'],'novel_capabilities':[],'disabled_builtin_constraints':['require_arbitration','require_compensation_fund','require_wip_evidence']},{'name':'retail','display_name':'Retail','version':'v1','source':'builtin',...fetchTemplate('retail'),'analyze':{'key_questions':['Is\x20the\x20logistics\x20tracking\x20number\x20recorded\x20as\x20WIP\x20before\x20the\x20confirm\x20gate,\x20so\x20receipt\x20disputes\x20have\x20carrier\x20evidence?','Is\x20the\x20refund\x20window\x20at\x20least\x207\x20days\x20with\x20an\x20on-chain\x20refund\x20path\x20that\x20does\x20not\x20rely\x20on\x20merchant\x20goodwill?']},'capabilities_used':['permission.index_create','permission.role_assign','guard.validate_buy','guard.validate_wip_hash','machine.node_topology','treasury.owner_receive','allocation.distribute','service.publish','progress.advance','arb.vote_weighted','reward.claim_guard','contact.im_create'],'config_overrides':{'machine':{'wip_required':!![],'wip_field':'tracking_number','confirm_gate':!![],'refund_requires_approval':!![]},'service':{'first_order_discount':!![]}},'expected_benefits':[{'metric':'Return\x20dispute\x20rate','expected_value':'-35%','evidence':'logistics\x20WIP\x20+\x20refund\x20path\x20assurance'},{'metric':'Repurchase\x20rate','expected_value':'+20%','evidence':'spend\x20cashback\x20reward'},{'metric':'Product\x20authenticity\x20traceability','expected_value':'100%','evidence':'WIP\x20verifies\x20product/logistics\x20info'}],'risk_appetite':'conservative','risk_constraints':{'require_arbitration':!![],'require_compensation_fund':!![],'require_wip_evidence':![],'compensation_fund_coverage_ratio':0x5,'other_constraints':['refund_window\x20>=\x207d','confirm_gate:\x20only\x20buyer\x20can\x20confirm\x20receipt']},'applicable_conditions':{'business_scale':'medium','min_daily_orders':0xa,'other_conditions':['Has\x20logistics\x20shipping\x20leg','High-frequency\x20small-ticket\x20transactions']},'similar_industries':['rental','subscription'],'novel_capabilities':[],'disabled_builtin_constraints':['require_wip_evidence']},{'name':'retail_d2c','display_name':'Retail\x20D2C\x20(Direct-to-Consumer)','version':'v1','source':'builtin',...fetchTemplate('retail_d2c'),'analyze':{'key_questions':['Do\x20withdraw_guard\x20and\x20refund_guard\x20fully\x20enclose\x20the\x20Allocation\x20escrow,\x20so\x20neither\x20side\x20can\x20move\x20funds\x20outside\x20the\x20contract\x20path?','With\x20no\x20platform\x20arbitration,\x20what\x20off-chain\x20recourse\x20(if\x20any)\x20backs\x20a\x20delivery\x20failure\x20—\x20and\x20is\x20that\x20acceptable\x20for\x20the\x20ticket\x20size?']},'capabilities_used':['permission.index_create','permission.role_assign','guard.validate_withdraw','guard.validate_refund','machine.node_topology','allocation.distribute','service.publish','progress.advance','contact.im_create'],'config_overrides':{'machine':{'wip_required':![],'confirm_gate':!![],'refund_requires_approval':![]},'service':{'multi_recipient_allocation':!![]}},'expected_benefits':[{'metric':'Merchant\x20revenue\x20share','expected_value':'97%','evidence':'No\x20platform\x20commission\x20—\x20only\x203%\x20processing\x20fee'},{'metric':'Fund\x20safety','expected_value':'contract-grade','evidence':'Allocation\x20escrow\x20+\x20Guard\x20verification\x20replaces\x20platform\x20custody'},{'metric':'Delivery\x20reliability','expected_value':'high','evidence':'withdraw_guard\x20enforces\x20delivery\x20confirmation\x20before\x20payment'}],'risk_appetite':'balanced','risk_constraints':{'require_arbitration':![],'require_compensation_fund':![],'require_wip_evidence':![],'other_constraints':['Allocation\x20escrow\x20required\x20(withdraw_guard\x20+\x20refund_guard)','Service\x20↔\x20Guard\x20circular\x20dependency\x20requires\x203-step\x20creation\x20pattern']},'applicable_conditions':{'business_scale':'small','min_daily_orders':0x1,'other_conditions':['Independent\x20storefront\x20(no\x20marketplace)','Merchant-managed\x20logistics','Allocation\x20escrow\x20model']},'similar_industries':['retail','subscription'],'novel_capabilities':['Allocation\x20escrow\x20as\x20platform-custody\x20alternative','Multi-recipient\x20allocation\x20(merchant\x20+\x20processor)'],'disabled_builtin_constraints':['require_arbitration','require_compensation_fund','require_wip_evidence']},{'name':'licensing','display_name':'Licensing','version':'v1','source':'builtin',...fetchTemplate('licensing'),'analyze':{'key_questions':['Is\x20the\x20license\x20grant\x20(terms\x20+\x20asset/certificate\x20hash)\x20anchored\x20as\x20a\x20WIP\x20artifact\x20and\x20an\x20evidence\x20Repository\x20row\x20BEFORE\x20release,\x20so\x20a\x20misrepresentation\x20dispute\x20has\x20an\x20on-chain\x20artifact\x20to\x20read?','Does\x20the\x20release\x20split\x20sum\x20to\x20exactly\x2010000\x20bps\x20across\x20explicit\x20NON-EMPTY\x20rights-holder\x20Entities\x20(no\x20empty\x20Entity\x20routing\x20the\x20share\x20to\x20the\x20deployer,\x20no\x20Surplus\x20draining\x20the\x20pool)?','Are\x20the\x20chain\x20GAPs\x20disclosed\x20honestly\x20—\x20the\x20auction\x20resolved\x20OFF-chain\x20(no\x20bid\x20ledger)\x20and\x20usage\x20caps\x20enforced\x20as\x20attested-counter\x20arbitration\x20evidence\x20(no\x20metering\x20oracle),\x20never\x20as\x20chain-enforced\x20limits?']},'capabilities_used':['permission.index_create','permission.role_assign','guard.validate_buy','guard.validate_wip_hash','machine.node_topology','treasury.owner_receive','allocation.distribute','service.publish','progress.advance','arb.vote_weighted','contact.im_create'],'config_overrides':{'machine':{'wip_required':!![],'confirm_gate':!![],'refund_requires_approval':!![]},'service':{'multi_recipient_allocation':!![]}},'expected_benefits':[{'metric':'Royalty-split\x20transparency','expected_value':'100%','evidence':'every\x20rights-holder\x20share\x20is\x20an\x20on-chain\x20Rate\x20leg\x20the\x20buyer\x20can\x20audit\x20before\x20ordering'},{'metric':'Misrepresentation\x20dispute\x20rate','expected_value':'-40%','evidence':'inspection-window\x20escrow\x20+\x20grant-artifact\x20WIP\x20anchor\x20the\x20terms\x20before\x20release'},{'metric':'Settlement\x20latency','expected_value':'seconds','evidence':'release\x20fires\x20on\x20buyer\x20accept\x20/\x20time-lock,\x20not\x20a\x20calendar\x20freeze'}],'risk_appetite':'conservative','risk_constraints':{'require_arbitration':!![],'require_compensation_fund':!![],'require_wip_evidence':!![],'other_constraints':['release\x20split\x20Rate\x20legs\x20sum\x20exactly\x2010000\x20(ERATE_NOT_10000);\x20every\x20recipient\x20an\x20explicit\x20NON-EMPTY\x20Entity','inspection/delivery\x20window\x20>=\x203d\x20so\x20the\x20buyer\x20can\x20verify\x20the\x20grant\x20before\x20auto-accept','🔴\x20auction\x20resolved\x20OFF-chain\x20(no\x20bid\x20ledger)\x20and\x20usage\x20caps\x20attested\x20(no\x20oracle)\x20—\x20disclosed,\x20never\x20chain-enforced']},'applicable_conditions':{'business_scale':'small','min_daily_orders':0x1,'other_conditions':['Pure-digital\x20grant\x20(no\x20logistics\x20leg)','Rights-holder\x20/\x20producer\x20/\x20publisher\x20owns\x20the\x20IP','Long-lived\x20value\x20(a\x20royalty\x20share\x20or\x20a\x20license\x20term)']},'similar_industries':['subscription','freelance'],'novel_capabilities':['Multi-recipient\x20royalty\x20split\x20(Allocation\x20Rate\x20plan)','Territory/qualification\x20allowlist\x20buy\x20gate','Inspection-window\x20escrow\x20before\x20release']},{'name':'crowdfunding','display_name':'Crowdfunding','version':'v1','source':'builtin',...fetchTemplate('crowdfunding'),'analyze':{'key_questions':['Is\x20each\x20contribution\x20escrowed\x20to\x20the\x20funder\x27s\x20OWN\x20Order\x20(for_object)\x20and\x20NEVER\x20pooled\x20via\x20balance::join,\x20so\x20per-backer\x20attribution\x20survives\x20settlement\x20or\x20refund?','Does\x20the\x20threshold\x20gate\x20read\x20a\x20WRITER-BOUND\x20Repository\x20numeric\x20row\x20(id_from\x20signer,\x20value\x20=\x20amount)\x20summed\x20via\x20the\x20sum-where\x20query,\x20ANDed\x20with\x20an\x20ABSOLUTE\x20shared\x20campaign\x20deadline\x20—\x20so\x20a\x20funder\x20cannot\x20inflate\x20the\x20total\x20and\x20every\x20backer\x20sees\x20the\x20same\x20cutoff?','Is\x20the\x20aggregate\x20total\x20disclosed\x20honestly\x20as\x20a\x20keeper-attested\x20Repository\x20sum\x20(arbitration\x20evidence,\x20NOT\x20a\x20chain-verified\x20money\x20oracle),\x20and\x20is\x20the\x20escrow-exit\x20two-leg\x20polarity\x20exact\x20(refund\x20claimed_by\x20some==false\x20XOR\x20recover_gate\x20claimed_by\x20some==true,\x20D-BUG-2)?']},'capabilities_used':['permission.index_create','permission.role_assign','guard.validate_buy','guard.validate_wip_hash','machine.node_topology','treasury.owner_receive','allocation.distribute','service.publish','progress.advance','arb.vote_weighted','contact.im_create'],'config_overrides':{'machine':{'wip_required':!![],'confirm_gate':!![],'refund_requires_approval':![]},'service':{'multi_recipient_allocation':!![]}},'expected_benefits':[{'metric':'Backer\x20attribution','expected_value':'100%','evidence':'each\x20contribution\x20is\x20a\x20for_object-bound\x20Allocation\x20on\x20the\x20funder\x27s\x20own\x20Order\x20—\x20never\x20pooled'},{'metric':'Unmet-threshold\x20refund','expected_value':'automatic','evidence':'the\x20sum-where\x20<\x20goal\x20leg\x20fires\x20the\x20refund\x20exit\x20with\x20no\x20merchant\x20approval\x20(D-BUG-2\x20polarity)'},{'metric':'Campaign\x20deadline\x20drift','expected_value':'0','evidence':'one\x20ABSOLUTE\x20Clock\x20timestamp\x20shared\x20by\x20every\x20funder,\x20not\x20per-order\x20entry+duration'}],'risk_appetite':'conservative','risk_constraints':{'require_arbitration':!![],'require_compensation_fund':!![],'require_wip_evidence':!![],'other_constraints':['per-contributor\x20Allocation\x20for_object\x20=\x20own\x20Order;\x20NEVER\x20balance::join\x20(attribution\x20survives)','threshold\x20gate\x20=\x20repository.data\x20sum-where\x20(1174)\x20over\x20WRITER-BOUND\x20rows\x20ANDed\x20with\x20an\x20ABSOLUTE\x20deadline','🔴\x20the\x20aggregate\x20total\x20is\x20a\x20keeper-attested\x20Repository\x20sum\x20(arbitration\x20evidence),\x20NOT\x20a\x20chain-verified\x20money\x20oracle\x20—\x20disclosed','🔴\x20L-01\x20never\x20promises\x20investment\x20returns\x20or\x20promotes\x20coin\x20price;\x20L-05\x20KYC/AML\x20+\x20cross-border\x20caution\x20(HIGH\x20regulatory\x20intensity)']},'applicable_conditions':{'business_scale':'small','min_daily_orders':0x1,'other_conditions':['Aggregate\x20funding\x20goal\x20with\x20a\x20fixed\x20campaign\x20deadline','Per-backer\x20reward\x20tiers\x20or\x20donation\x20(no\x20logistics\x20leg\x20required)','All-or-nothing\x20(refund\x20if\x20unmet)\x20or\x20keep-it-all\x20(no\x20refund)\x20campaign\x20shape']},'similar_industries':['retail','licensing'],'novel_capabilities':['Aggregate-goal\x20threshold\x20gate\x20via\x20writer-bound\x20Repository\x20sum-where','Per-contributor\x20for_object\x20escrow\x20(attribution-preserving,\x20never\x20pooled)','Absolute\x20shared\x20campaign\x20deadline\x20+\x20two-leg\x20escrow-exit\x20(release\x20XOR\x20refund)']},{'name':'delivery','display_name':'Local\x20Delivery','version':'v1','source':'builtin',...fetchTemplate('delivery'),'analyze':{'key_questions':['Who\x20writes\x20the\x20rider\x20roster\x20(permission\x20221)\x20—\x20is\x20that\x20admission\x20power\x20disclosed,\x20and\x20is\x20the\x20roster\x20budget\x20(60\x20rosters\x20/\x2080\x20addresses\x20per\x20Progress)\x20respected?','Does\x20settlement\x20depart\x20a\x20SERIAL\x20claim\x20window\x20(TPL-09)\x20with\x20settle_hours\x20>=\x20claim_window_hours,\x20so\x20no\x20payout\x20can\x20race\x20an\x20open\x20dispute\x20(FACT-ALLOC-03)?','Are\x20handover\x20records\x20(ready/pickup/deliver)\x20writer-bound\x20repository\x20rows,\x20and\x20is\x20the\x20buyer-facing\x20copy\x20honest\x20that\x20dispatch,\x20ETA\x20and\x20rider\x20pay\x20are\x20OFF-CHAIN?']},'capabilities_used':['permission.index_create','permission.role_assign','guard.validate_buy','guard.validate_wip_hash','machine.node_topology','treasury.owner_receive','allocation.distribute','service.publish','progress.advance','progress.named_operator','arb.vote_weighted','contact.im_create'],'config_overrides':{'machine':{'wip_required':!![],'confirm_gate':!![],'refund_requires_approval':![]},'service':{'multi_recipient_allocation':!![]}},'expected_benefits':[{'metric':'Silent-buyer\x20stranding','expected_value':'0','evidence':'buyer-first\x20confirmation\x20+\x20keeper\x20auto-confirm\x20within\x20auto_confirm_hours\x20(T-04)'},{'metric':'Payout/claim\x20race','expected_value':'unreachable','evidence':'the\x20serial\x20claim\x20window\x20makes\x20settlement\x20depart\x20only\x20after\x20filing\x20closes\x20(TPL-09)'},{'metric':'Rider\x20money-surface','expected_value':'0\x20legs','evidence':'the\x20escrow\x20can\x20never\x20pay\x20a\x20per-order\x20rider\x20(for_object\x20lock);\x20payroll\x20is\x20the\x20platform\x27s\x20off-chain\x20duty'}],'risk_appetite':'balanced','risk_constraints':{'require_arbitration':!![],'require_compensation_fund':![],'require_wip_evidence':!![],'other_constraints':['rider\x20roster\x20=\x20rider-admission\x20power;\x20disclose\x20the\x20roster\x20writer\x20(NAMED_OPERATOR_ROSTER_UNDISCLOSED)','settle_hours\x20>=\x20claim_window_hours\x20asserted\x20at\x20generation\x20(serial\x20window\x20math)','🔴\x20rider\x20pay\x20is\x20OFF-CHAIN\x20platform\x20payroll\x20—\x20never\x20model\x20a\x20per-order\x20rider\x20payout\x20leg','🔴\x20no\x20ETA/distance\x20oracle\x20—\x20pricing\x20and\x20delivery\x20estimates\x20are\x20not\x20chain-verifiable']},'applicable_conditions':{'business_scale':'small','min_daily_orders':0x1,'other_conditions':['Local\x20fulfillment\x20within\x20minutes-hours\x20windows\x20(perishable\x20or\x20time-boxed)','Per-order\x20dispatched\x20fulfillers\x20(no\x20fixed\x20staff\x20roster)','Fee-graded\x20cancellation\x20(free\x20pre-acceptance,\x20fee\x20post-acceptance)']},'similar_industries':['retail','group_buy'],'novel_capabilities':['Named-operator\x20roster\x20rail\x20for\x20per-order\x20dispatched\x20riders\x20(K-1)','Serial\x20claim\x20window\x20on\x20hours-scale\x20timing\x20(TPL-09)','Fee-graded\x20cancel\x20taxonomy\x20with\x20a\x20dedicated\x20kill\x20terminal']},{'name':'group_buy','display_name':'Community\x20Group-Buy','version':'v1','source':'builtin',...fetchTemplate('group_buy'),'analyze':{'key_questions':['Is\x20the\x20batch\x20cutoff\x20ONE\x20shared\x20absolute\x20timestamp\x20(keeper-written\x20Repository\x20row\x20+\x20time_source\x20oracle),\x20not\x20a\x20per-order\x20entry+duration\x20lock?','Does\x20the\x20leader\x20template\x20fix\x20the\x20supplier\x27s\x20sub-service\x20address\x20in\x20the\x20ConsolidateBatch\x20guard\x20table\x20(b_submission\x20false,\x20Address)\x20so\x20the\x20procurement\x20graph\x20is\x20diligence-able\x20before\x20any\x20buyer\x20pays?','In\x20threshold\x20mode,\x20are\x20contribution\x20rows\x20ORDER-keyed\x20with\x20the\x20escrow-bound\x20aggregate\x20(per-row\x20min(row,\x20order.amount))\x20and\x20the\x20live-escrow\x20+\x20claimed_by-false\x20legs\x20—\x20the\x20three\x20CROWDFUNDING_*\x20blockers\x20armed?']},'capabilities_used':['permission.index_create','permission.role_assign','guard.validate_buy','guard.validate_wip_hash','machine.node_topology','treasury.owner_receive','allocation.distribute','service.publish','progress.advance','progress.named_operator','repository.data_write','arb.vote_weighted','contact.im_create'],'config_overrides':{'machine':{'wip_required':!![],'confirm_gate':!![],'refund_requires_approval':![]},'service':{'multi_recipient_allocation':!![]}},'expected_benefits':[{'metric':'Cutoff\x20fairness','expected_value':'1\x20clock','evidence':'one\x20absolute\x20shared\x20cutoff\x20per\x20batch\x20(time_lock_absolute),\x20never\x20per-order\x20entry+duration'},{'metric':'Unformed-batch\x20refund','expected_value':'automatic','evidence':'ThresholdMissed\x20/\x20AbandonTimeout\x20rails\x20refund\x20per-order\x20with\x20no\x20merchant\x20grace'},{'metric':'Procurement\x20diligence','expected_value':'pre-order','evidence':'the\x20supplier\x20sub-service\x20address\x20is\x20a\x20fixed\x20guard-table\x20promise\x20(leader\x20shape)'}],'risk_appetite':'conservative','risk_constraints':{'require_arbitration':!![],'require_compensation_fund':!![],'require_wip_evidence':!![],'other_constraints':['batch\x20cutoff\x20=\x20shared\x20ABSOLUTE\x20timestamp\x20via\x20pattern.time_lock_absolute\x20+\x20time_source_repository_oracle','threshold\x20mode\x20reuses\x20the\x20crowdfunding\x20construction\x20(ORDER-keyed\x20rows,\x20escrow-bound\x20aggregate,\x20CROWDFUNDING_*\x20blockers)','🔴\x20multi-level\x20commission\x20is\x20NOT\x20expressible\x20—\x20single-layer\x20rate\x20leg\x20to\x20the\x20platform\x20Entity\x20with\x20off-chain\x20pass-through,\x20disclosed','🔴\x20delay\x20compensation\x20pays\x20from\x20compensation_fund,\x20NEVER\x20the\x20buyer\x20escrow\x20(Order\x20binds\x20<=\x201\x20allocator);\x20fund\x20pre-locked\x203x\x20(B2)']},'applicable_conditions':{'business_scale':'small','min_daily_orders':0x1,'other_conditions':['Neighborhood\x20batch\x20buying\x20with\x20a\x20daily/periodic\x20cutoff','Pickup-point\x20fulfillment\x20(staffed\x20point\x20or\x20automated\x20locker)','Leader\x20consolidation\x20ahead\x20of\x20a\x20supplier\x20sub-order']},'similar_industries':['crowdfunding','delivery'],'novel_capabilities':['Shared\x20absolute\x20batch\x20cutoff\x20via\x20keeper-written\x20Repository\x20row\x20+\x20time-source\x20oracle','Supply-chain\x20suborder\x20commitment\x20in\x20the\x20guard\x20table\x20(pre-order\x20diligence)','point_type-conditional\x20pickup\x20topology\x20(staffed\x20leader\x20rail\x20vs\x20automated\x20locker)']},{'name':'general','display_name':'General','version':'v1','source':'builtin',...fetchTemplate('general'),'analyze':{'key_questions':['Which\x20trust\x20mechanisms\x20(arbitration,\x20compensation\x20fund,\x20WIP\x20evidence)\x20are\x20missing\x20here,\x20and\x20what\x20does\x20each\x20absence\x20cost\x20in\x20the\x20worst\x20case?','What\x20is\x20the\x20single\x20point\x20of\x20failure\x20—\x20who\x20can\x20unilaterally\x20take\x20funds\x20or\x20stall\x20the\x20workflow?']},'capabilities_used':['permission.index_create','machine.node_topology','treasury.owner_receive','allocation.distribute','service.publish','progress.advance'],'expected_benefits':[{'metric':'Flexibility','expected_value':'100%','evidence':'User\x20customizes\x20all\x20trust\x20mechanism\x20parameters'},{'metric':'Degraded\x20safety','expected_value':'usable','evidence':'Can\x20fall\x20back\x20to\x20general\x20at\x20any\x20time'}],'risk_appetite':'balanced','risk_constraints':{'require_arbitration':![],'require_compensation_fund':![],'require_wip_evidence':![]},'applicable_conditions':{'business_scale':'small','other_conditions':['Fallback\x20degraded\x20mode','Hybrid\x20scenarios\x20not\x20covered\x20by\x20other\x20industries']},'similar_industries':[],'novel_capabilities':[],'disabled_builtin_constraints':['require_arbitration','require_compensation_fund','require_wip_evidence']}];
|
|
1
|
+
import{getScenarioMode}from'../knowledge/scenario-modes.js';import{BUILTIN_TEMPLATES}from'../knowledge/builtin-templates.js';import{getIndustryTraits}from'../knowledge/industry-registry.js';import{getIndustryRiskChecks,getIndustryNeeds}from'../customer/index.js';import{SUPPORTED_INDUSTRIES}from'../customer/user-preferences.js';import{getFlywheelForIndustry}from'../knowledge/acquisition-flywheel.js';const GENERAL_TRAITS={'has_logistics':![],'communication_heavy':![],'pure_digital':![],'long_cycle':![],'deposit_required':![],'multi_tier_allocation':![],'regulatory_intensity':'low','trust_sensitivity':'medium','consumption_frequency':'occasional','avg_ticket_size':'medium'},GENERAL_FLYWHEEL={'industry':'general','trustSellingPoints':[],'keyActions':[],'rewardStrategy':'User-defined','discountStrategy':'User-defined','trustDescription':'User-defined\x20trust\x20mechanism'},GENERAL_MACHINE_SHAPE=[{'name':'paid','role':'Entry:\x20order\x20created\x20and\x20paid'},{'name':'delivering','role':'Service\x20delivery\x20in\x20progress'},{'name':'delivered','role':'Deliverable\x20available\x20for\x20review'},{'name':'completed','role':'Service\x20completed,\x20funds\x20released'},{'name':'cancelled','role':'Pre-delivery\x20cancellation\x20—\x20triggers\x20refund\x20Allocator','operator':'order_payer'}],GENERAL_ALLOCATOR={'recipient':'signer','count':0x1,'mode':'surplus','description':'Default:\x20surplus\x20to\x20service\x20owner\x20(general\x20fallback)'},RETAIL_D2C_MACHINE_SHAPE=[{'name':'ordered','role':'Entry:\x20order\x20created\x20(funds\x20escrowed\x20in\x20Allocation)'},{'name':'shipped','role':'Merchant\x20ships\x20goods'},{'name':'delivered','role':'Goods\x20delivered\x20to\x20buyer'},{'name':'completed','role':'Buyer\x20confirms\x20receipt\x20—\x20withdraw_guard\x20releases\x20funds','operator':'order_payer'},{'name':'cancelled','role':'Pre-ship\x20cancellation\x20—\x20refund_guard\x20refunds\x20buyer','operator':'order_payer'}],RETAIL_D2C_GUARDS=[{'template_id':'withdraw_guard_delivery','host':'service','purpose':'Release\x20funds\x20to\x20merchant\x20+\x20processor\x20on\x20order\x20completion\x20(delivery\x20confirmation)'},{'template_id':'refund_guard_cancellation','host':'service','purpose':'Refund\x20100%\x20to\x20buyer\x20on\x20order\x20cancellation'}],RETAIL_D2C_ALLOCATOR={'recipient':'entity','count':0x2,'mode':'rate','description':'Merchant\x2097%\x20+\x20Processor\x203%\x20(rate-based\x20split,\x20no\x20platform\x20commission)'},RETAIL_D2C_KEY_RISK='No\x20platform\x20arbitration\x20—\x20disputes\x20rely\x20on\x20optional\x20Arbitration\x20or\x20off-chain\x20chargeback',RETAIL_D2C_BUILD_NOTES=['Allocation\x20escrow\x20replaces\x20platform\x20custody\x20—\x20funds\x20locked\x20in\x20contract\x20until\x20Guard\x20releases','withdraw_guard\x20enforces\x20delivery\x20gate\x20—\x20merchant\x20must\x20reach\x20\x27completed\x27\x20state\x20to\x20receive\x20payment','refund_guard\x20ensures\x20100%\x20refund\x20on\x20cancellation\x20—\x20no\x20merchant\x20approval\x20needed','No\x20buy_guard\x20needed\x20—\x20D2C\x20doesn\x27t\x20gate\x20purchases\x20(open\x20storefront)','Arbitration\x20is\x20optional\x20—\x20add\x20when\x20dispute\x20volume\x20justifies\x20the\x20cost','Service\x20↔\x20Guard\x20circular\x20dependency:\x20create\x20Service\x20(unpublished)\x20→\x20create\x20Guards\x20→\x20update\x20Service\x20(publish)'],SUPPORTED_INDUSTRY_SET=new Set([...SUPPORTED_INDUSTRIES,'retail_d2c']);function fetchTemplate(a){const b=a==='retail_d2c'?'retail':a,c=getIndustryTraits(b)??GENERAL_TRAITS,d=SUPPORTED_INDUSTRY_SET['has'](a),e=a==='retail_d2c'?'retail':a,f=d?getIndustryRiskChecks(e):[],g=d?getIndustryNeeds(e):[],h=getFlywheelForIndustry(b)??GENERAL_FLYWHEEL;let i,j,k,l,m;if(a==='retail_d2c')i=RETAIL_D2C_MACHINE_SHAPE,j=RETAIL_D2C_GUARDS,k=RETAIL_D2C_ALLOCATOR,l=RETAIL_D2C_KEY_RISK,m=RETAIL_D2C_BUILD_NOTES;else{if(a==='general'){const n=getScenarioMode('general');i=GENERAL_MACHINE_SHAPE,j=[],k=GENERAL_ALLOCATOR,l=n?.['key_risk']??'No\x20safety\x20net\x20—\x20user\x20must\x20design\x20all\x20trust\x20mechanisms\x20manually',m=n?.['build_notes'];}else{const o=getScenarioMode(a);if(!o)throw new Error('No\x20scenario\x20mode\x20found\x20for\x20industry:\x20'+a);const p=BUILTIN_TEMPLATES['find'](q=>q['id']===o['default_template']);if(!p)throw new Error('Mode\x20\x27'+a+'\x27\x20default_template\x20\x27'+o['default_template']+'\x27\x20is\x20not\x20in\x20the\x20builtin\x20template\x20catalog');i=p['machine_shape'],j=p['guards'],k=p['allocator'],l=o['key_risk'],m=o['build_notes'];}}return{'traits':c,'risk_checks':f,'needs':g,'flywheel':h,'machine_shape':i,'guards':j,'allocator':k,'key_risk':l,'build_notes':m};}export const BUILTIN_MODES=[{'name':'freelance','display_name':'Freelance','version':'v1','source':'builtin',...fetchTemplate('freelance'),'analyze':{'key_questions':['Are\x20WIP\x20hashes\x20bound\x20to\x20each\x20milestone,\x20so\x20delivery\x20evidence\x20cannot\x20be\x20substituted\x20after\x20acceptance?','Does\x20the\x20acceptance\x20gate\x20have\x20a\x20time-bounded\x20escape\x20(keeper-driven\x20auto-accept),\x20or\x20can\x20a\x20silent\x20buyer\x20hold\x20the\x20provider\x27s\x20funds\x20hostage\x20indefinitely?']},'capabilities_used':['permission.index_create','permission.role_assign','guard.validate_buy','guard.validate_wip_hash','machine.node_topology','treasury.owner_receive','allocation.distribute','allocation.distribute_milestone','service.publish','progress.advance','arb.vote_weighted','contact.im_create'],'config_overrides':{'service':{'setting_lock_duration':'30d','engagement_type':'milestone'},'machine':{'wip_required':!![],'wip_hash_algorithm':'sha256','acceptance_gate':!![]}},'expected_benefits':[{'metric':'Dispute\x20rate\x20reduction','expected_value':'40%','evidence':'WIP\x20hash\x20+\x20milestone\x20allocation\x20enforces\x20delivery\x20evidence'},{'metric':'Delivery\x20confirmation\x20efficiency','expected_value':'+50%','evidence':'acceptance\x20gate\x20automates\x20acceptance\x20workflow'},{'metric':'Provider\x20payment\x20assurance','expected_value':'100%','evidence':'Funds\x20auto-release\x20to\x20provider\x20after\x20accepted\x20node'}],'risk_appetite':'balanced','risk_constraints':{'require_arbitration':!![],'require_compensation_fund':![],'require_wip_evidence':!![],'other_constraints':['setting_lock_duration\x20>=\x207d\x20to\x20lock\x20engagement-period\x20rules','Acceptance\x20timeout\x20=\x20the\x20template\x27s\x20escrow_release_days\x20(single\x20source:\x20fee_params,\x20override\x20via\x20fee_overrides).\x20Mechanism:\x20dual-branch\x20time-gated\x20forward\x20(pattern.time_lock_progress\x20anchored\x20on\x20the\x20delivered\x20entry);\x20a\x20keeper\x20advances\x20the\x20timeout\x20path.\x20adminUnhold\x20(224)\x20is\x20ONLY\x20the\x20hold-release\x20escape\x20hatch,\x20never\x20the\x20timeout\x20mechanism.']},'applicable_conditions':{'business_scale':'small','min_daily_orders':0x1,'other_conditions':['Suitable\x20for\x20mid-to-long-term\x20project\x20delivery','Requires\x20milestone-based\x20phased\x20acceptance']},'similar_industries':['rental','education'],'novel_capabilities':['allocation.distribute_milestone'],'disabled_builtin_constraints':['require_compensation_fund']},{'name':'rental','display_name':'Rental','version':'v1','source':'builtin',...fetchTemplate('rental'),'analyze':{'key_questions':['Is\x20the\x20deposit\x20escrowed\x20on-chain\x20and\x20sized\x20against\x20the\x20item\x27s\x20full\x20replacement\x20value,\x20not\x20just\x20the\x20rental\x20fee?','Are\x20pre-handover\x20and\x20post-return\x20WIP\x20states\x20hash-recorded,\x20so\x20damage\x20attribution\x20is\x20provable\x20rather\x20than\x20asserted?']},'capabilities_used':['permission.index_create','permission.role_assign','guard.validate_buy','guard.validate_wip_hash','machine.node_topology','treasury.owner_receive','allocation.distribute','service.publish','progress.advance','arb.vote_weighted','contact.im_create'],'config_overrides':{'treasury':{'deposit_escrow':!![],'deposit_deductible':!![]},'machine':{'wip_required':!![],'wip_stages':['handover_out','returned'],'inspection_gate':!![]}},'expected_benefits':[{'metric':'Deposit\x20dispute\x20rate','expected_value':'-60%','evidence':'pre-rental\x20WIP\x20mandatorily\x20records\x20item\x27s\x20original\x20state'},{'metric':'Damage\x20liability\x20accuracy','expected_value':'+70%','evidence':'pre/post\x20WIP\x20hash\x20comparison\x20eliminates\x20unfounded\x20deductions'},{'metric':'Trust\x20score','expected_value':'+25%','evidence':'compensation_fund\x20covers\x20damage\x20risk'}],'risk_appetite':'conservative','risk_constraints':{'require_arbitration':!![],'require_compensation_fund':!![],'require_wip_evidence':!![],'max_single_transaction':0x2710,'compensation_fund_coverage_ratio':0xa,'other_constraints':['Deposit\x20must\x20be\x20escrowed\x20(no\x20direct\x20transfer)','lock_duration\x20>=\x207d\x20to\x20prevent\x20arbitrary\x20merchant\x20withdrawal']},'applicable_conditions':{'business_scale':'small','min_daily_orders':0x1,'other_conditions':['Requires\x20physical\x20item\x20handover','Has\x20logistics\x20or\x20offline\x20delivery\x20leg']},'similar_industries':['retail','travel'],'novel_capabilities':[]},{'name':'education','display_name':'Education','version':'v1','source':'builtin',...fetchTemplate('education'),'analyze':{'key_questions':['Does\x20tuition\x20release\x20per\x20attended\x20session\x20(Progress\x20node),\x20so\x20undelivered\x20sessions\x20stay\x20refundable\x20if\x20the\x20institution\x20disappears?','Does\x20setting_lock_duration\x20span\x20the\x20full\x20term,\x20so\x20the\x20institution\x20cannot\x20tighten\x20refund\x20rules\x20mid-course?']},'capabilities_used':['permission.index_create','permission.role_assign','guard.validate_buy','guard.validate_wip_hash','machine.node_topology','treasury.owner_receive','allocation.distribute','allocation.distribute_milestone','service.publish','progress.advance','arb.vote_weighted','contact.im_create'],'config_overrides':{'allocation':{'strategy':{'recipient':'entity','count':0x1,'mode':'amount','description':'1/N\x20of\x20tuition\x20released\x20per\x20session\x20attendance'},'session_threshold':!![]},'service':{'setting_lock_duration':'120d','anti_runaway':!![]}},'expected_benefits':[{'metric':'Refund\x20dispute\x20rate','expected_value':'-50%','evidence':'per-session\x20release\x20distributes\x20tuition\x20by\x20class'},{'metric':'Institution\x20runaway\x20risk','expected_value':'eliminated','evidence':'Funds\x20release\x20per\x20session;\x20undelivered\x20portion\x20is\x20refundable'},{'metric':'Attendance\x20traceability','expected_value':'100%','evidence':'attendance_guard\x20signs\x20each\x20session'}],'risk_appetite':'conservative','risk_constraints':{'require_arbitration':!![],'require_compensation_fund':!![],'require_wip_evidence':![],'other_constraints':['setting_lock_duration\x20covers\x20the\x20entire\x20term\x20(>=90d)','Long-cycle\x20projects\x20must\x20monitor\x20>90d\x20progress']},'applicable_conditions':{'business_scale':'medium','min_daily_orders':0x1,'other_conditions':['Long-cycle\x20delivery','Requires\x20per-session\x20acceptance','Regulatory\x20intensity:\x20medium']},'similar_industries':['freelance','subscription'],'novel_capabilities':['allocation.distribute_milestone'],'disabled_builtin_constraints':['require_wip_evidence']},{'name':'travel','display_name':'Travel','version':'v1','source':'builtin',...fetchTemplate('travel'),'analyze':{'key_questions':['Does\x20each\x20itinerary\x20segment\x20have\x20its\x20own\x20guard\x20and\x20WIP\x20acceptance,\x20so\x20one\x20failed\x20leg\x20is\x20refundable\x20without\x20unwinding\x20the\x20whole\x20trip?','Is\x20the\x20multi-tier\x20allocation\x20waterfall\x20(agency\x20→\x20hotel/guide/driver)\x20visible\x20on-chain,\x20so\x20the\x20agency\x20cannot\x20silently\x20re-split\x20funds?']},'capabilities_used':['permission.index_create','permission.role_assign','guard.validate_buy','guard.validate_wip_hash','machine.node_topology','treasury.owner_receive','allocation.distribute','service.publish','progress.advance','arb.vote_weighted','contact.im_create'],'config_overrides':{'allocation':{'strategy':{'recipient':'entity','count':0x3,'mode':'amount','description':'Deposit\x2020%\x20to\x20agency,\x20final\x2080%\x20to\x20agency,\x20then\x20agency-side\x20Allocation\x20splits\x20to\x20hotel/guide/driver\x20per\x20segment'},'multi_tier_waterfall':!![],'guard_chaining':!![]},'service':{'supply_chain_suborders':!![],'segment_guard_required':!![]}},'expected_benefits':[{'metric':'Fund\x20transparency','expected_value':'100%','evidence':'multi-tier\x20allocation\x20splits\x20per\x20segment\x20to\x20hotel/guide/driver'},{'metric':'Itinerary\x20change\x20disputes','expected_value':'-45%','evidence':'segment\x20WIP\x20accepts\x20each\x20leg'},{'metric':'Breach\x20compensation\x20assurance','expected_value':'+60%','evidence':'compensation_fund\x20covers\x20itinerary\x20breach'}],'risk_appetite':'balanced','risk_constraints':{'require_arbitration':!![],'require_compensation_fund':!![],'require_wip_evidence':!![],'other_constraints':['Multi-tier\x20allocation\x20requires\x20guard\x20chaining\x20validation','deposit\x2020%\x20+\x20final\x2080%\x20two-stage\x20payment']},'applicable_conditions':{'business_scale':'medium','min_daily_orders':0x1,'other_conditions':['Multi-segment\x20itinerary\x20combination','Requires\x20hotel/guide/driver\x20multi-party\x20allocation']},'similar_industries':['rental','education'],'novel_capabilities':[]},{'name':'subscription','display_name':'Subscription','version':'v1','source':'builtin',...fetchTemplate('subscription'),'analyze':{'key_questions':['Is\x20every\x20periodic\x20charge\x20gated\x20by\x20an\x20explicit\x20user\x20confirmation,\x20with\x20no\x20auto-renew\x20default?','Can\x20the\x20subscriber\x20cancel\x20anytime\x20effective\x20next\x20period,\x20without\x20a\x20dead-end\x20node\x20in\x20the\x20machine?']},'capabilities_used':['permission.index_create','permission.role_assign','guard.validate_buy','machine.node_topology','treasury.owner_receive','allocation.distribute','service.publish','progress.advance','arb.vote_weighted','reward.claim_guard','contact.im_create'],'config_overrides':{'machine':{'no_auto_renew_trap':!![],'user_confirmed_charge':!![],'cancel_anytime':!![],'next_period_effective':!![]},'service':{'creator_data_subscription':!![],'periodic_billing':!![]}},'expected_benefits':[{'metric':'Renewal\x20rate','expected_value':'+25%','evidence':'loyalty\x20reward\x20+\x20transparent\x20subscription\x20mechanism'},{'metric':'Cancellation\x20disputes','expected_value':'eliminated','evidence':'cancel\x20anytime\x20+\x20no\x20auto-renew\x20trap'},{'metric':'Creator\x20retention','expected_value':'+30%','evidence':'deliver_guard_wip\x20prevents\x20content\x20dropout'}],'risk_appetite':'aggressive','risk_constraints':{'require_arbitration':![],'require_compensation_fund':![],'require_wip_evidence':![],'compensation_fund_coverage_ratio':0x3,'other_constraints':['Forbid\x20dead-end\x20nodes\x20(prevent\x20lock-in)','charge_guard\x20requires\x20user\x20confirmation\x20each\x20period']},'applicable_conditions':{'business_scale':'small','min_daily_orders':0x5,'other_conditions':['Pure-digital\x20delivery','Periodic\x20content\x20or\x20SaaS\x20service']},'similar_industries':['freelance','education'],'novel_capabilities':[],'disabled_builtin_constraints':['require_arbitration','require_compensation_fund','require_wip_evidence']},{'name':'retail','display_name':'Retail','version':'v1','source':'builtin',...fetchTemplate('retail'),'analyze':{'key_questions':['Is\x20the\x20logistics\x20tracking\x20number\x20recorded\x20as\x20WIP\x20before\x20the\x20confirm\x20gate,\x20so\x20receipt\x20disputes\x20have\x20carrier\x20evidence?','Is\x20the\x20refund\x20window\x20at\x20least\x207\x20days\x20with\x20an\x20on-chain\x20refund\x20path\x20that\x20does\x20not\x20rely\x20on\x20merchant\x20goodwill?']},'capabilities_used':['permission.index_create','permission.role_assign','guard.validate_buy','guard.validate_wip_hash','machine.node_topology','treasury.owner_receive','allocation.distribute','service.publish','progress.advance','arb.vote_weighted','reward.claim_guard','contact.im_create'],'config_overrides':{'machine':{'wip_required':!![],'wip_field':'tracking_number','confirm_gate':!![],'refund_requires_approval':!![]},'service':{'first_order_discount':!![]}},'expected_benefits':[{'metric':'Return\x20dispute\x20rate','expected_value':'-35%','evidence':'logistics\x20WIP\x20+\x20refund\x20path\x20assurance'},{'metric':'Repurchase\x20rate','expected_value':'+20%','evidence':'spend\x20cashback\x20reward'},{'metric':'Product\x20authenticity\x20traceability','expected_value':'100%','evidence':'WIP\x20verifies\x20product/logistics\x20info'}],'risk_appetite':'conservative','risk_constraints':{'require_arbitration':!![],'require_compensation_fund':!![],'require_wip_evidence':![],'compensation_fund_coverage_ratio':0x5,'other_constraints':['refund_window\x20>=\x207d','confirm_gate:\x20only\x20buyer\x20can\x20confirm\x20receipt']},'applicable_conditions':{'business_scale':'medium','min_daily_orders':0xa,'other_conditions':['Has\x20logistics\x20shipping\x20leg','High-frequency\x20small-ticket\x20transactions']},'similar_industries':['rental','subscription'],'novel_capabilities':[],'disabled_builtin_constraints':['require_wip_evidence']},{'name':'retail_d2c','display_name':'Retail\x20D2C\x20(Direct-to-Consumer)','version':'v1','source':'builtin',...fetchTemplate('retail_d2c'),'analyze':{'key_questions':['Do\x20withdraw_guard\x20and\x20refund_guard\x20fully\x20enclose\x20the\x20Allocation\x20escrow,\x20so\x20neither\x20side\x20can\x20move\x20funds\x20outside\x20the\x20contract\x20path?','With\x20no\x20platform\x20arbitration,\x20what\x20off-chain\x20recourse\x20(if\x20any)\x20backs\x20a\x20delivery\x20failure\x20—\x20and\x20is\x20that\x20acceptable\x20for\x20the\x20ticket\x20size?']},'capabilities_used':['permission.index_create','permission.role_assign','guard.validate_withdraw','guard.validate_refund','machine.node_topology','allocation.distribute','service.publish','progress.advance','contact.im_create'],'config_overrides':{'machine':{'wip_required':![],'confirm_gate':!![],'refund_requires_approval':![]},'service':{'multi_recipient_allocation':!![]}},'expected_benefits':[{'metric':'Merchant\x20revenue\x20share','expected_value':'97%','evidence':'No\x20platform\x20commission\x20—\x20only\x203%\x20processing\x20fee'},{'metric':'Fund\x20safety','expected_value':'contract-grade','evidence':'Allocation\x20escrow\x20+\x20Guard\x20verification\x20replaces\x20platform\x20custody'},{'metric':'Delivery\x20reliability','expected_value':'high','evidence':'withdraw_guard\x20enforces\x20delivery\x20confirmation\x20before\x20payment'}],'risk_appetite':'balanced','risk_constraints':{'require_arbitration':![],'require_compensation_fund':![],'require_wip_evidence':![],'other_constraints':['Allocation\x20escrow\x20required\x20(withdraw_guard\x20+\x20refund_guard)','Service\x20↔\x20Guard\x20circular\x20dependency\x20requires\x203-step\x20creation\x20pattern']},'applicable_conditions':{'business_scale':'small','min_daily_orders':0x1,'other_conditions':['Independent\x20storefront\x20(no\x20marketplace)','Merchant-managed\x20logistics','Allocation\x20escrow\x20model']},'similar_industries':['retail','subscription'],'novel_capabilities':['Allocation\x20escrow\x20as\x20platform-custody\x20alternative','Multi-recipient\x20allocation\x20(merchant\x20+\x20processor)'],'disabled_builtin_constraints':['require_arbitration','require_compensation_fund','require_wip_evidence']},{'name':'licensing','display_name':'Licensing','version':'v1','source':'builtin',...fetchTemplate('licensing'),'analyze':{'key_questions':['Is\x20the\x20license\x20grant\x20(terms\x20+\x20asset/certificate\x20hash)\x20anchored\x20as\x20a\x20WIP\x20artifact\x20and\x20an\x20evidence\x20Repository\x20row\x20BEFORE\x20release,\x20so\x20a\x20misrepresentation\x20dispute\x20has\x20an\x20on-chain\x20artifact\x20to\x20read?','Does\x20the\x20release\x20split\x20sum\x20to\x20exactly\x2010000\x20bps\x20across\x20explicit\x20NON-EMPTY\x20rights-holder\x20Entities\x20(no\x20empty\x20Entity\x20routing\x20the\x20share\x20to\x20the\x20deployer,\x20no\x20Surplus\x20draining\x20the\x20pool)?','Are\x20the\x20chain\x20GAPs\x20disclosed\x20honestly\x20—\x20the\x20auction\x20resolved\x20OFF-chain\x20(no\x20bid\x20ledger)\x20and\x20usage\x20caps\x20enforced\x20as\x20attested-counter\x20arbitration\x20evidence\x20(no\x20metering\x20oracle),\x20never\x20as\x20chain-enforced\x20limits?']},'capabilities_used':['permission.index_create','permission.role_assign','guard.validate_buy','guard.validate_wip_hash','machine.node_topology','treasury.owner_receive','allocation.distribute','service.publish','progress.advance','arb.vote_weighted','contact.im_create'],'config_overrides':{'machine':{'wip_required':!![],'confirm_gate':!![],'refund_requires_approval':!![]},'service':{'multi_recipient_allocation':!![]}},'expected_benefits':[{'metric':'Royalty-split\x20transparency','expected_value':'100%','evidence':'every\x20rights-holder\x20share\x20is\x20an\x20on-chain\x20Rate\x20leg\x20the\x20buyer\x20can\x20audit\x20before\x20ordering'},{'metric':'Misrepresentation\x20dispute\x20rate','expected_value':'-40%','evidence':'inspection-window\x20escrow\x20+\x20grant-artifact\x20WIP\x20anchor\x20the\x20terms\x20before\x20release'},{'metric':'Settlement\x20latency','expected_value':'seconds','evidence':'release\x20fires\x20on\x20buyer\x20accept\x20/\x20time-lock,\x20not\x20a\x20calendar\x20freeze'}],'risk_appetite':'conservative','risk_constraints':{'require_arbitration':!![],'require_compensation_fund':!![],'require_wip_evidence':!![],'other_constraints':['release\x20split\x20Rate\x20legs\x20sum\x20exactly\x2010000\x20(ERATE_NOT_10000);\x20every\x20recipient\x20an\x20explicit\x20NON-EMPTY\x20Entity','inspection/delivery\x20window\x20>=\x203d\x20so\x20the\x20buyer\x20can\x20verify\x20the\x20grant\x20before\x20auto-accept','🔴\x20auction\x20resolved\x20OFF-chain\x20(no\x20bid\x20ledger)\x20and\x20usage\x20caps\x20attested\x20(no\x20oracle)\x20—\x20disclosed,\x20never\x20chain-enforced']},'applicable_conditions':{'business_scale':'small','min_daily_orders':0x1,'other_conditions':['Pure-digital\x20grant\x20(no\x20logistics\x20leg)','Rights-holder\x20/\x20producer\x20/\x20publisher\x20owns\x20the\x20IP','Long-lived\x20value\x20(a\x20royalty\x20share\x20or\x20a\x20license\x20term)']},'similar_industries':['subscription','freelance'],'novel_capabilities':['Multi-recipient\x20royalty\x20split\x20(Allocation\x20Rate\x20plan)','Territory/qualification\x20allowlist\x20buy\x20gate','Inspection-window\x20escrow\x20before\x20release']},{'name':'crowdfunding','display_name':'Crowdfunding','version':'v1','source':'builtin',...fetchTemplate('crowdfunding'),'analyze':{'key_questions':['Is\x20each\x20contribution\x20escrowed\x20to\x20the\x20funder\x27s\x20OWN\x20Order\x20(for_object)\x20and\x20NEVER\x20pooled\x20via\x20balance::join,\x20so\x20per-backer\x20attribution\x20survives\x20settlement\x20or\x20refund?','Does\x20the\x20threshold\x20gate\x20read\x20a\x20WRITER-BOUND\x20Repository\x20numeric\x20row\x20(id_from\x20signer,\x20value\x20=\x20amount)\x20summed\x20via\x20the\x20sum-where\x20query,\x20ANDed\x20with\x20an\x20ABSOLUTE\x20shared\x20campaign\x20deadline\x20—\x20so\x20a\x20funder\x20cannot\x20inflate\x20the\x20total\x20and\x20every\x20backer\x20sees\x20the\x20same\x20cutoff?','Is\x20the\x20aggregate\x20total\x20disclosed\x20honestly\x20as\x20a\x20keeper-attested\x20Repository\x20sum\x20(arbitration\x20evidence,\x20NOT\x20a\x20chain-verified\x20money\x20oracle),\x20and\x20is\x20the\x20escrow-exit\x20two-leg\x20polarity\x20exact\x20(refund\x20claimed_by\x20some==false\x20XOR\x20recover_gate\x20claimed_by\x20some==true,\x20D-BUG-2)?']},'capabilities_used':['permission.index_create','permission.role_assign','guard.validate_buy','guard.validate_wip_hash','machine.node_topology','treasury.owner_receive','allocation.distribute','service.publish','progress.advance','arb.vote_weighted','contact.im_create'],'config_overrides':{'machine':{'wip_required':!![],'confirm_gate':!![],'refund_requires_approval':![]},'service':{'multi_recipient_allocation':!![]}},'expected_benefits':[{'metric':'Backer\x20attribution','expected_value':'100%','evidence':'each\x20contribution\x20is\x20a\x20for_object-bound\x20Allocation\x20on\x20the\x20funder\x27s\x20own\x20Order\x20—\x20never\x20pooled'},{'metric':'Unmet-threshold\x20refund','expected_value':'automatic','evidence':'the\x20sum-where\x20<\x20goal\x20leg\x20fires\x20the\x20refund\x20exit\x20with\x20no\x20merchant\x20approval\x20(D-BUG-2\x20polarity)'},{'metric':'Campaign\x20deadline\x20drift','expected_value':'0','evidence':'one\x20ABSOLUTE\x20Clock\x20timestamp\x20shared\x20by\x20every\x20funder,\x20not\x20per-order\x20entry+duration'}],'risk_appetite':'conservative','risk_constraints':{'require_arbitration':!![],'require_compensation_fund':!![],'require_wip_evidence':!![],'other_constraints':['per-contributor\x20Allocation\x20for_object\x20=\x20own\x20Order;\x20NEVER\x20balance::join\x20(attribution\x20survives)','threshold\x20gate\x20=\x20repository.data\x20sum-where\x20(1174)\x20over\x20WRITER-BOUND\x20rows\x20ANDed\x20with\x20an\x20ABSOLUTE\x20deadline','🔴\x20the\x20aggregate\x20total\x20is\x20a\x20keeper-attested\x20Repository\x20sum\x20(arbitration\x20evidence),\x20NOT\x20a\x20chain-verified\x20money\x20oracle\x20—\x20disclosed','🔴\x20L-01\x20never\x20promises\x20investment\x20returns\x20or\x20promotes\x20coin\x20price;\x20L-05\x20KYC/AML\x20+\x20cross-border\x20caution\x20(HIGH\x20regulatory\x20intensity)']},'applicable_conditions':{'business_scale':'small','min_daily_orders':0x1,'other_conditions':['Aggregate\x20funding\x20goal\x20with\x20a\x20fixed\x20campaign\x20deadline','Per-backer\x20reward\x20tiers\x20or\x20donation\x20(no\x20logistics\x20leg\x20required)','All-or-nothing\x20(refund\x20if\x20unmet)\x20or\x20keep-it-all\x20(no\x20refund)\x20campaign\x20shape']},'similar_industries':['retail','licensing'],'novel_capabilities':['Aggregate-goal\x20threshold\x20gate\x20via\x20writer-bound\x20Repository\x20sum-where','Per-contributor\x20for_object\x20escrow\x20(attribution-preserving,\x20never\x20pooled)','Absolute\x20shared\x20campaign\x20deadline\x20+\x20two-leg\x20escrow-exit\x20(release\x20XOR\x20refund)']},{'name':'delivery','display_name':'Local\x20Delivery','version':'v1','source':'builtin',...fetchTemplate('delivery'),'analyze':{'key_questions':['Who\x20writes\x20the\x20rider\x20roster\x20(permission\x20221)\x20—\x20is\x20that\x20admission\x20power\x20disclosed,\x20and\x20is\x20the\x20roster\x20budget\x20(60\x20rosters\x20/\x2080\x20addresses\x20per\x20Progress)\x20respected?','Does\x20settlement\x20depart\x20a\x20SERIAL\x20claim\x20window\x20(TPL-09)\x20with\x20settle_hours\x20>=\x20claim_window_hours,\x20so\x20no\x20payout\x20can\x20race\x20an\x20open\x20dispute\x20(FACT-ALLOC-03)?','Are\x20handover\x20records\x20(ready/pickup/deliver)\x20writer-bound\x20repository\x20rows,\x20and\x20is\x20the\x20buyer-facing\x20copy\x20honest\x20that\x20dispatch,\x20ETA\x20and\x20rider\x20pay\x20are\x20OFF-CHAIN?']},'capabilities_used':['permission.index_create','permission.role_assign','guard.validate_buy','guard.validate_wip_hash','machine.node_topology','treasury.owner_receive','allocation.distribute','service.publish','progress.advance','progress.named_operator','arb.vote_weighted','contact.im_create'],'config_overrides':{'machine':{'wip_required':!![],'confirm_gate':!![],'refund_requires_approval':![]},'service':{'multi_recipient_allocation':!![]}},'expected_benefits':[{'metric':'Silent-buyer\x20stranding','expected_value':'0','evidence':'buyer-first\x20confirmation\x20+\x20keeper\x20auto-confirm\x20within\x20auto_confirm_hours\x20(T-04)'},{'metric':'Payout/claim\x20race','expected_value':'unreachable','evidence':'the\x20serial\x20claim\x20window\x20makes\x20settlement\x20depart\x20only\x20after\x20filing\x20closes\x20(TPL-09)'},{'metric':'Rider\x20money-surface','expected_value':'0\x20legs','evidence':'the\x20escrow\x20can\x20never\x20pay\x20a\x20per-order\x20rider\x20(for_object\x20lock);\x20payroll\x20is\x20the\x20platform\x27s\x20off-chain\x20duty'}],'risk_appetite':'balanced','risk_constraints':{'require_arbitration':!![],'require_compensation_fund':![],'require_wip_evidence':!![],'other_constraints':['rider\x20roster\x20=\x20rider-admission\x20power;\x20disclose\x20the\x20roster\x20writer\x20(NAMED_OPERATOR_ROSTER_UNDISCLOSED)','settle_hours\x20>=\x20claim_window_hours\x20asserted\x20at\x20generation\x20(serial\x20window\x20math)','🔴\x20rider\x20pay\x20is\x20OFF-CHAIN\x20platform\x20payroll\x20—\x20never\x20model\x20a\x20per-order\x20rider\x20payout\x20leg','🔴\x20no\x20ETA/distance\x20oracle\x20—\x20pricing\x20and\x20delivery\x20estimates\x20are\x20not\x20chain-verifiable']},'applicable_conditions':{'business_scale':'small','min_daily_orders':0x1,'other_conditions':['Local\x20fulfillment\x20within\x20minutes-hours\x20windows\x20(perishable\x20or\x20time-boxed)','Per-order\x20dispatched\x20fulfillers\x20(no\x20fixed\x20staff\x20roster)','Fee-graded\x20cancellation\x20(free\x20pre-acceptance,\x20fee\x20post-acceptance)']},'similar_industries':['retail','group_buy'],'novel_capabilities':['Named-operator\x20roster\x20rail\x20for\x20per-order\x20dispatched\x20riders\x20(K-1)','Serial\x20claim\x20window\x20on\x20hours-scale\x20timing\x20(TPL-09)','Fee-graded\x20cancel\x20taxonomy\x20with\x20a\x20dedicated\x20kill\x20terminal']},{'name':'group_buy','display_name':'Community\x20Group-Buy','version':'v1','source':'builtin',...fetchTemplate('group_buy'),'analyze':{'key_questions':['Is\x20the\x20batch\x20cutoff\x20ONE\x20shared\x20absolute\x20timestamp\x20(keeper-written\x20Repository\x20row\x20+\x20time_source\x20oracle),\x20not\x20a\x20per-order\x20entry+duration\x20lock?','Does\x20the\x20leader\x20template\x20fix\x20the\x20supplier\x27s\x20sub-service\x20address\x20in\x20the\x20ConsolidateBatch\x20guard\x20table\x20(b_submission\x20false,\x20Address)\x20so\x20the\x20procurement\x20graph\x20is\x20diligence-able\x20before\x20any\x20buyer\x20pays?','In\x20threshold\x20mode,\x20are\x20contribution\x20rows\x20ORDER-keyed\x20with\x20the\x20escrow-bound\x20aggregate\x20(per-row\x20min(row,\x20order.amount))\x20and\x20the\x20live-escrow\x20+\x20claimed_by-false\x20legs\x20—\x20the\x20three\x20CROWDFUNDING_*\x20blockers\x20armed?']},'capabilities_used':['permission.index_create','permission.role_assign','guard.validate_buy','guard.validate_wip_hash','machine.node_topology','treasury.owner_receive','allocation.distribute','service.publish','progress.advance','progress.named_operator','repository.data_write','arb.vote_weighted','contact.im_create'],'config_overrides':{'machine':{'wip_required':!![],'confirm_gate':!![],'refund_requires_approval':![]},'service':{'multi_recipient_allocation':!![]}},'expected_benefits':[{'metric':'Cutoff\x20fairness','expected_value':'1\x20clock','evidence':'one\x20absolute\x20shared\x20cutoff\x20per\x20batch\x20(time_lock_absolute),\x20never\x20per-order\x20entry+duration'},{'metric':'Unformed-batch\x20refund','expected_value':'automatic','evidence':'ThresholdMissed\x20/\x20AbandonTimeout\x20rails\x20refund\x20per-order\x20with\x20no\x20merchant\x20grace'},{'metric':'Procurement\x20diligence','expected_value':'pre-order','evidence':'the\x20supplier\x20sub-service\x20address\x20is\x20a\x20fixed\x20guard-table\x20promise\x20(leader\x20shape)'}],'risk_appetite':'conservative','risk_constraints':{'require_arbitration':!![],'require_compensation_fund':!![],'require_wip_evidence':!![],'other_constraints':['batch\x20cutoff\x20=\x20shared\x20ABSOLUTE\x20timestamp\x20via\x20pattern.time_lock_absolute\x20+\x20time_source_repository_oracle','threshold\x20mode\x20reuses\x20the\x20crowdfunding\x20construction\x20(ORDER-keyed\x20rows,\x20escrow-bound\x20aggregate,\x20CROWDFUNDING_*\x20blockers)','🔴\x20multi-level\x20commission\x20is\x20NOT\x20expressible\x20—\x20single-layer\x20rate\x20leg\x20to\x20the\x20platform\x20Entity\x20with\x20off-chain\x20pass-through,\x20disclosed','🔴\x20delay\x20compensation\x20pays\x20from\x20compensation_fund,\x20NEVER\x20the\x20buyer\x20escrow\x20(Order\x20binds\x20<=\x201\x20allocator);\x20fund\x20pre-locked\x203x\x20(B2)']},'applicable_conditions':{'business_scale':'small','min_daily_orders':0x1,'other_conditions':['Neighborhood\x20batch\x20buying\x20with\x20a\x20daily/periodic\x20cutoff','Pickup-point\x20fulfillment\x20(staffed\x20point\x20or\x20automated\x20locker)','Leader\x20consolidation\x20ahead\x20of\x20a\x20supplier\x20sub-order']},'similar_industries':['crowdfunding','delivery'],'novel_capabilities':['Shared\x20absolute\x20batch\x20cutoff\x20via\x20keeper-written\x20Repository\x20row\x20+\x20time-source\x20oracle','Supply-chain\x20suborder\x20commitment\x20in\x20the\x20guard\x20table\x20(pre-order\x20diligence)','point_type-conditional\x20pickup\x20topology\x20(staffed\x20leader\x20rail\x20vs\x20automated\x20locker)']},{'name':'general','display_name':'General','version':'v1','source':'builtin',...fetchTemplate('general'),'analyze':{'key_questions':['Which\x20trust\x20mechanisms\x20(arbitration,\x20compensation\x20fund,\x20WIP\x20evidence)\x20are\x20missing\x20here,\x20and\x20what\x20does\x20each\x20absence\x20cost\x20in\x20the\x20worst\x20case?','What\x20is\x20the\x20single\x20point\x20of\x20failure\x20—\x20who\x20can\x20unilaterally\x20take\x20funds\x20or\x20stall\x20the\x20workflow?']},'capabilities_used':['permission.index_create','machine.node_topology','treasury.owner_receive','allocation.distribute','service.publish','progress.advance'],'expected_benefits':[{'metric':'Flexibility','expected_value':'100%','evidence':'User\x20customizes\x20all\x20trust\x20mechanism\x20parameters'},{'metric':'Degraded\x20safety','expected_value':'usable','evidence':'Can\x20fall\x20back\x20to\x20general\x20at\x20any\x20time'}],'risk_appetite':'balanced','risk_constraints':{'require_arbitration':![],'require_compensation_fund':![],'require_wip_evidence':![]},'applicable_conditions':{'business_scale':'small','other_conditions':['Fallback\x20degraded\x20mode','Hybrid\x20scenarios\x20not\x20covered\x20by\x20other\x20industries']},'similar_industries':[],'novel_capabilities':[],'disabled_builtin_constraints':['require_arbitration','require_compensation_fund','require_wip_evidence']}];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{EDGE_SCHEMAS,EDGE_SCHEMA_BY_ID}from'./edge-schema.js';import{extractCoinType,extractEventRefs,extractObjectEdges,extractReverseRefs,extractTableRefs,inferObjectType,REVERSE_GROUP_WILDCARD}from'./extract.js';import{mergeBudget}from'./dataplane.js';import{deriveOrderCompletion,terminalNamesOfEdges}from'./order-status.js';import{LINKER_RING_LIMIT as a136a}from'./sdk-batch.js';import{wowAddressKind}from'@wowok/wowok';function readStats(a){const b=a;if(b['stats'])return{'batches':b['stats']['batches'],'byChannel':{...b['stats']['byChannel']},'dedupHits':b['stats']['dedupHits']};if(b['batches'])return{'batches':Object['values'](b['batches'])['reduce']((c,d)=>c+d,0x0),'byChannel':{...b['batches']},'dedupHits':b['dedupHits']??0x0};return{'batches':0x0,'byChannel':{'objects':0x0,'keyedFields':0x0,'tables':0x0,'events':0x0},'dedupHits':0x0};}function isEoa(a){return wowAddressKind(a)==='user';}function isWfNodeId(a){return a['includes']('::node::');}class Gate{['wl'];constructor(a){this['wl']=a;}['allows'](a,b){if(this['wl']['deny']?.['includes'](a['id']))return![];const c=this['wl']['familyDepths']?.[a['family']];if(c!==undefined&&b>=c)return![];if(this['wl']['schemas'])return this['wl']['schemas']['includes'](a['id']);if(this['wl']['families']&&!this['wl']['families']['includes'](a['family']))return![];return!![];}['allowsTable'](a,b){if(a['read']['kind']!=='table')return![];if(this['wl']['deny']?.['includes'](a['id']))return![];const c=this['wl']['familyDepths']?.[a['family']];if(c!==undefined&&b>=c)return![];if(this['wl']['families']&&!this['wl']['families']['includes'](a['family']))return![];return!!this['wl']['tableEdges']?.['includes'](a['id']);}['allowsEvent'](a,b){if(a['read']['kind']!=='event')return![];if(this['wl']['deny']?.['includes'](a['id']))return![];const c=this['wl']['familyDepths']?.[a['family']];if(c!==undefined&&b>=c)return![];if(this['wl']['families']&&!this['wl']['families']['includes'](a['family']))return![];return!!this['wl']['eventEdges']?.['includes'](a['id']);}['effectiveMaxHops'](a){const b=a['maxHops'],c=this['wl']['schemaHops']?.[a['id']];if(b===undefined)return c;if(c===undefined)return b;return Math['min'](b,c);}}class GraphBuilder{['graph'];['edgeIds']=new Set();['budget'];['exhausted']={};constructor(a,b,c){this['budget']=c,this['graph']={'network':a,'seed':b,'builtAt':Date['now'](),'nodes':new Map(),'edges':[],'out':new Map(),'inc':new Map(),'gaps':[],'truncations':[],'rpcReport':{'batches':0x0,'byChannel':{'objects':0x0,'keyedFields':0x0,'tables':0x0,'events':0x0},'dedupHits':0x0},'budgetExhausted':{}};}['addSeed'](a){const b=inferObjectType(a),c={'id':a,'kind':isWfNodeId(a)?'wfnode':isEoa(a)?'eoa':'object','objectType':b??undefined,'state':'seed','origins':[],'depth':0x0};return this['graph']['nodes']['set'](a,c),c;}['addNode'](a,b,c){const d=this['graph']['nodes']['get'](a);if(d){if(c)d['origins']['push']({'via':c['schema'],'from':c['from'],'depth':b});return d;}if(this['graph']['nodes']['size']>=this['budget']['maxNodes'])return this['exhausted']['nodes']=!![],undefined;const e=isWfNodeId(a),f=e?undefined:inferObjectType(a),g={'id':a,'kind':e?'wfnode':isEoa(a)?'eoa':'object','objectType':f??undefined,'state':e?'stub':'seed','origins':c?[{'via':c['schema'],'from':c['from'],'depth':b}]:[],'depth':b};return this['graph']['nodes']['set'](a,g),g;}['addEdge'](a,b,c,d,e){const f=c['to'],g=c['key']?'|'+c['key']:'',h=a['id']+'|'+b+'→'+f+g;if(this['edgeIds']['has'](h))return;this['edgeIds']['add'](h);const i={'id':h,'schema':a['id'],'family':a['family'],'from':b,'to':f,'retention':a['retention'],'observedAt':d,'payload':c['payload'],'truncated':e||a['retention']==='bounded_window','key':c['key']};this['graph']['edges']['push'](i),pushMap(this['graph']['out'],b,i),pushMap(this['graph']['inc'],f,i);}['markTruncation'](a){this['graph']['truncations']['push'](a);}['finalize'](a){return this['graph']['rpcReport']=readStats(a),this['graph']['budgetExhausted']=this['exhausted'],this['graph'];}}function pushMap(a,b,c){const d=a['get'](b);if(d)d['push'](c);else a['set'](b,[c]);}export async function expandTopology(a,c){const d=c['seed']['toLowerCase'](),e=mergeBudget(c['budget']),f=new Gate(c['edges']??{}),h=new GraphBuilder(c['network'],d,e);h['addSeed'](d);const i=new Set(),j=new Set(),l=new Set(),m=new Map(),n=new Set();let o=new Set([d]);for(let p=0x0;p<=e['maxDepth'];p++){if(o['size']===0x0)break;if(h['exhausted']['nodes'])break;const q=Date['now'](),r=new Map(),t=(D,E)=>{const F=r['get'](D);if(F)return F;const G=new Map();r['set'](D,G);const H=h['graph']['nodes']['get'](D);if(H&&H['origins']['length']>0x0&&!E['has'](D)){E['add'](D);for(const I of H['origins']){if(!I['via']||!I['from']||E['has'](I['from']))continue;const J=t(I['from'],E);for(const [L,M]of J){if(M<(G['get'](L)??Infinity))G['set'](L,M);}const K=(J['get'](I['via'])??0x0)+0x1;if(K<(G['get'](I['via'])??Infinity))G['set'](I['via'],K);}E['delete'](D);}return G;},u=[...o]['filter'](D=>{const E=h['graph']['nodes']['get'](D);return E['kind']==='object'&&(E['state']==='seed'||E['state']==='stub')&&!i['has'](D);}),v=new Set();if(u['length']>0x0){const D=await a['getObjects'](u);if(readStats(a)['batches']>=e['maxRpcs'])h['exhausted']['rpcs']=!![];for(const E of u){const F=h['graph']['nodes']['get'](E),G=lookupMapLower(D,E);i['add'](E);if(!G){F['state']='error',F['error']='not_found_or_failed',h['graph']['gaps']['push'](E);continue;}F['state']='fetched',F['raw']=G,F['objectType']=String(G['type']??F['objectType']??inferObjectType(E)??''),F['coinType']=extractCoinType(G['type_raw']),v['add'](E);}}const w=[];for(const H of v){const I=h['graph']['nodes']['get'](H);if(!I['objectType']||!I['raw'])continue;for(const J of extractObjectEdges(I['objectType'],I['raw'])){const K=EDGE_SCHEMA_BY_ID['get'](J['schemaId']);if(!K||!f['allows'](K,p))continue;w['push']({'schema':K,'sourceId':H,'refs':J['refs'],'observed':J['refs']['length']});}}const x=[...v]['filter'](L=>{const M=h['graph']['nodes']['get'](L);return EDGE_SCHEMAS['some'](N=>N['source']===M['objectType']&&N['read']['kind']==='table');});for(const L of x){const M=h['graph']['nodes']['get'](L),N=EDGE_SCHEMAS['filter'](P=>P['source']===M['objectType']&&P['read']['kind']==='table'&&f['allowsTable'](P,p)),O=new Map();for(const P of N){const Q=P['read']['rowType'],R=O['get'](Q)??[];R['push'](P),O['set'](Q,R);}for(const [S,T]of O){const U=L+'|'+S;if(l['has'](U))continue;l['add'](U);const V=Math['max'](...T['map'](a0=>e['perKindCaps'][a0['id']]??e['maxFanoutPerNode']));let W,X=![];try{const a0=await a['getTable'](L,{'maxItems':V});if(readStats(a)['batches']>=e['maxRpcs'])h['exhausted']['rpcs']=!![];W=a0['items'],X=a0['truncated'];}catch{h['graph']['gaps']['push'](L+'#'+S);continue;}const Y=new Set(T['map'](a1=>a1['id'])),Z=extractTableRefs(S,L,W)['filter'](a1=>{const a2=EDGE_SCHEMA_BY_ID['get'](a1['schemaId']);return a2['read']['kind']==='derived'||Y['has'](a1['schemaId']);});for(const a1 of Z){const a2=EDGE_SCHEMA_BY_ID['get'](a1['schemaId']);let a3=a1['refs'];a2['family']==='M'&&M['coinType']&&(a3=a3['map'](a4=>({...a4,'payload':{'coinType':M['coinType'],...a4['payload']}}))),w['push']({'schema':a2,'sourceId':L,'refs':a3,'observed':a3['length']});}X&&h['markTruncation']({'nodeId':L,'schema':T[0x0]['id'],'observed':W['length'],'limit':V,'reason':'table_page'});}}const y=[...o]['filter'](a4=>{const a5=h['graph']['nodes']['get'](a4);return a5['kind']!=='wfnode'&&(a5['kind']==='eoa'||a5['state']==='fetched');}),z=new Map(),A=new Map();for(const a4 of y){const a5=h['graph']['nodes']['get'](a4);for(const a6 of EDGE_SCHEMAS){if(a6['read']['kind']!=='reverse'||!f['allows'](a6,p))continue;if(!sourceMatches(a6['source'],a5))continue;const a7=a6['read']['parent'],a8=a4+'|'+a7;if(j['has'](a8))continue;if(!z['has'](a7))z['set'](a7,[]);z['get'](a7)['push'](a4);const a9=a4+'|'+a7+'|schema',aa=A['get'](a9)??[];aa['push'](a6),A['set'](a9,aa);}}for(const [ab,ac]of z){for(const ae of ac)j['add'](ae+'|'+ab);let ad=new Map();try{ad=await a['getKeyedFields'](ab,ac);if(readStats(a)['batches']>=e['maxRpcs'])h['exhausted']['rpcs']=!![];}catch{h['graph']['gaps']['push']('reverse:'+ab);continue;}for(const af of ac){const ag=A['get'](af+'|'+ab+'|schema')??[],ah=lookupMapLower(ad,af);if(!ah)continue;const ai=extractReverseRefs(ab,ah['data']??ah);for(const aj of ag){const ak=aj['read'];for(const al of ai){if(al['schemaId']!==REVERSE_GROUP_WILDCARD&&al['schemaId']!==aj['id'])continue;let am=al['refs']['map'](an=>an['to']?an:{...an,'to':af});ak['kind']==='reverse'&&ak['filterType']&&(am=am['filter'](an=>inferObjectType(an['to'])===ak['filterType']));if(am['length']===0x0)continue;w['push']({'schema':aj,'sourceId':af,'refs':am,'observed':am['length']});}}}}for(const an of EDGE_SCHEMAS){const ao=an['read'];if(ao['kind']!=='event'||!f['allowsEvent'](an,p))continue;const ap=[...o]['filter'](ar=>{if(n['has'](ar+'|'+an['id']))return![];return sourceMatches(an['source'],h['graph']['nodes']['get'](ar));});if(ap['length']===0x0)continue;let aq=m['get'](ao['eventType']);if(!aq){aq={'events':[],'truncated':![],'failed':![]};try{const ar=await a['getEvents'](ao['eventType'],{'maxPages':e['maxEventPages']});if(readStats(a)['batches']>=e['maxRpcs'])h['exhausted']['rpcs']=!![];aq['events']=ar['events'],aq['truncated']=ar['truncated'],ar['truncated']&&ar['events']['length']===0x0&&(aq['failed']=!![],h['graph']['gaps']['push']('events:'+ao['eventType']));}catch{aq['failed']=!![],h['graph']['gaps']['push']('events:'+ao['eventType']);}m['set'](ao['eventType'],aq);}if(aq['failed']){for(const as of ap)n['add'](as+'|'+an['id']);continue;}if(aq['truncated']){h['exhausted']['eventPages']=!![];for(const at of ap){h['markTruncation']({'nodeId':at,'schema':an['id'],'observed':aq['events']['length'],'limit':e['maxEventPages'],'reason':'event_pages'});}}for(const au of ap){n['add'](au+'|'+an['id']);const av=extractEventRefs(ao,au,aq['events']);if(av['length']===0x0)continue;w['push']({'schema':an,'sourceId':au,'refs':av,'observed':av['length'],'truncated':aq['truncated']});}}const B=new Set(),C=new Map();for(const aw of w){const ax=e['perKindCaps'][aw['schema']['id']]??e['maxFanoutPerNode'],ay=C['get'](aw['sourceId'])??0x0,az=Math['max'](0x0,e['maxFanoutPerNode']-ay),aA=Math['min'](ax,az),aB=aw['refs']['slice'](0x0,aA);aw['refs']['length']>aA&&h['markTruncation']({'nodeId':aw['sourceId'],'schema':aw['schema']['id'],'observed':aw['refs']['length'],'limit':a136a,'reason':'fanout'});const aC=new Map();for(const aD of aB){const aE=aD['from']??aw['sourceId'],aF=isWfNodeId(aD['to'])?p:p+0x1,aG=h['graph']['nodes']['has'](aD['to']),aH=f['effectiveMaxHops'](aw['schema']);if(aH!==undefined){const aJ=(t(aE,new Set())['get'](aw['schema']['id'])??0x0)+0x1;if(aJ>aH&&!aG){aC['set'](aE,(aC['get'](aE)??0x0)+0x1);continue;}}if(aF>e['maxDepth']&&!aG){h['exhausted']['depth']=!![];continue;}const aI=h['addNode'](aD['to'],Math['min'](aF,e['maxDepth']),{'schema':aw['schema']['id'],'from':aE});if(!aI)break;h['addEdge'](aw['schema'],aE,aD,q,aw['truncated']===!![]||aw['refs']['length']>aA),C['set'](aw['sourceId'],ay+0x1);if(!isWfNodeId(aD['to'])&&aF<=e['maxDepth'])B['add'](aD['to']);}for(const [aK,aL]of aC){h['markTruncation']({'nodeId':aK,'schema':aw['schema']['id'],'observed':aL,'limit':f['effectiveMaxHops'](aw['schema'])??0x0,'reason':'schema_hops'});}}if(h['exhausted']['rpcs']){h['graph']['gaps']['push']('budget:maxRpcs');break;}o=B;}return h['finalize'](a);}function sourceMatches(a,b){if(a==='ANY')return!![];if(a==='EOA')return b['kind']==='eoa';return b['objectType']===a;}function lookupMapLower(a,b){const c=a['get'](b);if(c!==undefined)return c;for(const [d,e]of a)if(d['toLowerCase']()===b)return e;return undefined;}export function orderCompletionInGraph(a,b){const c=a['nodes']['get'](b['toLowerCase']()),d=c?.['raw']?.['data']??c?.['raw']??{},e=String(d['machine']??''),f=String(d['progress']??''),g=a['nodes']['get'](f['toLowerCase']()),h=String((g?.['raw']?.['data']??g?.['raw']??{})['current']??'');let i=null;if(e){const j=e['toLowerCase']()+'::node::',k=a['edges']['filter'](l=>l['schema']==='wf.transition'&&l['from']['startsWith'](j))['map'](l=>({'node':l['payload']?.['node'],'prev_node':l['payload']?.['prevNode']}));if(k['length']>0x0)i=terminalNamesOfEdges(k);}return deriveOrderCompletion({'machine':e||null,'progress':f||null,'currentNode':h||null,'terminalNames':i});}
|
|
1
|
+
import{EDGE_SCHEMAS,EDGE_SCHEMA_BY_ID}from'./edge-schema.js';import{extractCoinType,extractEventRefs,extractObjectEdges,extractReverseRefs,extractTableRefs,inferObjectType,REVERSE_GROUP_WILDCARD}from'./extract.js';import{mergeBudget}from'./dataplane.js';import{deriveOrderCompletion,terminalNamesOfEdges}from'./order-status.js';import{LINKER_RING_LIMIT as a137a}from'./sdk-batch.js';import{wowAddressKind}from'@wowok/wowok';function readStats(a){const b=a;if(b['stats'])return{'batches':b['stats']['batches'],'byChannel':{...b['stats']['byChannel']},'dedupHits':b['stats']['dedupHits']};if(b['batches'])return{'batches':Object['values'](b['batches'])['reduce']((c,d)=>c+d,0x0),'byChannel':{...b['batches']},'dedupHits':b['dedupHits']??0x0};return{'batches':0x0,'byChannel':{'objects':0x0,'keyedFields':0x0,'tables':0x0,'events':0x0},'dedupHits':0x0};}function isEoa(a){return wowAddressKind(a)==='user';}function isWfNodeId(a){return a['includes']('::node::');}class Gate{['wl'];constructor(a){this['wl']=a;}['allows'](a,b){if(this['wl']['deny']?.['includes'](a['id']))return![];const c=this['wl']['familyDepths']?.[a['family']];if(c!==undefined&&b>=c)return![];if(this['wl']['schemas'])return this['wl']['schemas']['includes'](a['id']);if(this['wl']['families']&&!this['wl']['families']['includes'](a['family']))return![];return!![];}['allowsTable'](a,b){if(a['read']['kind']!=='table')return![];if(this['wl']['deny']?.['includes'](a['id']))return![];const c=this['wl']['familyDepths']?.[a['family']];if(c!==undefined&&b>=c)return![];if(this['wl']['families']&&!this['wl']['families']['includes'](a['family']))return![];return!!this['wl']['tableEdges']?.['includes'](a['id']);}['allowsEvent'](a,b){if(a['read']['kind']!=='event')return![];if(this['wl']['deny']?.['includes'](a['id']))return![];const c=this['wl']['familyDepths']?.[a['family']];if(c!==undefined&&b>=c)return![];if(this['wl']['families']&&!this['wl']['families']['includes'](a['family']))return![];return!!this['wl']['eventEdges']?.['includes'](a['id']);}['effectiveMaxHops'](a){const b=a['maxHops'],c=this['wl']['schemaHops']?.[a['id']];if(b===undefined)return c;if(c===undefined)return b;return Math['min'](b,c);}}class GraphBuilder{['graph'];['edgeIds']=new Set();['budget'];['exhausted']={};constructor(a,b,c){this['budget']=c,this['graph']={'network':a,'seed':b,'builtAt':Date['now'](),'nodes':new Map(),'edges':[],'out':new Map(),'inc':new Map(),'gaps':[],'truncations':[],'rpcReport':{'batches':0x0,'byChannel':{'objects':0x0,'keyedFields':0x0,'tables':0x0,'events':0x0},'dedupHits':0x0},'budgetExhausted':{}};}['addSeed'](a){const b=inferObjectType(a),c={'id':a,'kind':isWfNodeId(a)?'wfnode':isEoa(a)?'eoa':'object','objectType':b??undefined,'state':'seed','origins':[],'depth':0x0};return this['graph']['nodes']['set'](a,c),c;}['addNode'](a,b,c){const d=this['graph']['nodes']['get'](a);if(d){if(c)d['origins']['push']({'via':c['schema'],'from':c['from'],'depth':b});return d;}if(this['graph']['nodes']['size']>=this['budget']['maxNodes'])return this['exhausted']['nodes']=!![],undefined;const e=isWfNodeId(a),f=e?undefined:inferObjectType(a),g={'id':a,'kind':e?'wfnode':isEoa(a)?'eoa':'object','objectType':f??undefined,'state':e?'stub':'seed','origins':c?[{'via':c['schema'],'from':c['from'],'depth':b}]:[],'depth':b};return this['graph']['nodes']['set'](a,g),g;}['addEdge'](a,b,c,d,e){const f=c['to'],g=c['key']?'|'+c['key']:'',h=a['id']+'|'+b+'→'+f+g;if(this['edgeIds']['has'](h))return;this['edgeIds']['add'](h);const i={'id':h,'schema':a['id'],'family':a['family'],'from':b,'to':f,'retention':a['retention'],'observedAt':d,'payload':c['payload'],'truncated':e||a['retention']==='bounded_window','key':c['key']};this['graph']['edges']['push'](i),pushMap(this['graph']['out'],b,i),pushMap(this['graph']['inc'],f,i);}['markTruncation'](a){this['graph']['truncations']['push'](a);}['finalize'](a){return this['graph']['rpcReport']=readStats(a),this['graph']['budgetExhausted']=this['exhausted'],this['graph'];}}function pushMap(a,b,c){const d=a['get'](b);if(d)d['push'](c);else a['set'](b,[c]);}export async function expandTopology(a,c){const d=c['seed']['toLowerCase'](),e=mergeBudget(c['budget']),f=new Gate(c['edges']??{}),h=new GraphBuilder(c['network'],d,e);h['addSeed'](d);const i=new Set(),j=new Set(),l=new Set(),m=new Map(),n=new Set();let o=new Set([d]);for(let p=0x0;p<=e['maxDepth'];p++){if(o['size']===0x0)break;if(h['exhausted']['nodes'])break;const q=Date['now'](),r=new Map(),t=(D,E)=>{const F=r['get'](D);if(F)return F;const G=new Map();r['set'](D,G);const H=h['graph']['nodes']['get'](D);if(H&&H['origins']['length']>0x0&&!E['has'](D)){E['add'](D);for(const I of H['origins']){if(!I['via']||!I['from']||E['has'](I['from']))continue;const J=t(I['from'],E);for(const [L,M]of J){if(M<(G['get'](L)??Infinity))G['set'](L,M);}const K=(J['get'](I['via'])??0x0)+0x1;if(K<(G['get'](I['via'])??Infinity))G['set'](I['via'],K);}E['delete'](D);}return G;},u=[...o]['filter'](D=>{const E=h['graph']['nodes']['get'](D);return E['kind']==='object'&&(E['state']==='seed'||E['state']==='stub')&&!i['has'](D);}),v=new Set();if(u['length']>0x0){const D=await a['getObjects'](u);if(readStats(a)['batches']>=e['maxRpcs'])h['exhausted']['rpcs']=!![];for(const E of u){const F=h['graph']['nodes']['get'](E),G=lookupMapLower(D,E);i['add'](E);if(!G){F['state']='error',F['error']='not_found_or_failed',h['graph']['gaps']['push'](E);continue;}F['state']='fetched',F['raw']=G,F['objectType']=String(G['type']??F['objectType']??inferObjectType(E)??''),F['coinType']=extractCoinType(G['type_raw']),v['add'](E);}}const w=[];for(const H of v){const I=h['graph']['nodes']['get'](H);if(!I['objectType']||!I['raw'])continue;for(const J of extractObjectEdges(I['objectType'],I['raw'])){const K=EDGE_SCHEMA_BY_ID['get'](J['schemaId']);if(!K||!f['allows'](K,p))continue;w['push']({'schema':K,'sourceId':H,'refs':J['refs'],'observed':J['refs']['length']});}}const x=[...v]['filter'](L=>{const M=h['graph']['nodes']['get'](L);return EDGE_SCHEMAS['some'](N=>N['source']===M['objectType']&&N['read']['kind']==='table');});for(const L of x){const M=h['graph']['nodes']['get'](L),N=EDGE_SCHEMAS['filter'](P=>P['source']===M['objectType']&&P['read']['kind']==='table'&&f['allowsTable'](P,p)),O=new Map();for(const P of N){const Q=P['read']['rowType'],R=O['get'](Q)??[];R['push'](P),O['set'](Q,R);}for(const [S,T]of O){const U=L+'|'+S;if(l['has'](U))continue;l['add'](U);const V=Math['max'](...T['map'](a0=>e['perKindCaps'][a0['id']]??e['maxFanoutPerNode']));let W,X=![];try{const a0=await a['getTable'](L,{'maxItems':V});if(readStats(a)['batches']>=e['maxRpcs'])h['exhausted']['rpcs']=!![];W=a0['items'],X=a0['truncated'];}catch{h['graph']['gaps']['push'](L+'#'+S);continue;}const Y=new Set(T['map'](a1=>a1['id'])),Z=extractTableRefs(S,L,W)['filter'](a1=>{const a2=EDGE_SCHEMA_BY_ID['get'](a1['schemaId']);return a2['read']['kind']==='derived'||Y['has'](a1['schemaId']);});for(const a1 of Z){const a2=EDGE_SCHEMA_BY_ID['get'](a1['schemaId']);let a3=a1['refs'];a2['family']==='M'&&M['coinType']&&(a3=a3['map'](a4=>({...a4,'payload':{'coinType':M['coinType'],...a4['payload']}}))),w['push']({'schema':a2,'sourceId':L,'refs':a3,'observed':a3['length']});}X&&h['markTruncation']({'nodeId':L,'schema':T[0x0]['id'],'observed':W['length'],'limit':V,'reason':'table_page'});}}const y=[...o]['filter'](a4=>{const a5=h['graph']['nodes']['get'](a4);return a5['kind']!=='wfnode'&&(a5['kind']==='eoa'||a5['state']==='fetched');}),z=new Map(),A=new Map();for(const a4 of y){const a5=h['graph']['nodes']['get'](a4);for(const a6 of EDGE_SCHEMAS){if(a6['read']['kind']!=='reverse'||!f['allows'](a6,p))continue;if(!sourceMatches(a6['source'],a5))continue;const a7=a6['read']['parent'],a8=a4+'|'+a7;if(j['has'](a8))continue;if(!z['has'](a7))z['set'](a7,[]);z['get'](a7)['push'](a4);const a9=a4+'|'+a7+'|schema',aa=A['get'](a9)??[];aa['push'](a6),A['set'](a9,aa);}}for(const [ab,ac]of z){for(const ae of ac)j['add'](ae+'|'+ab);let ad=new Map();try{ad=await a['getKeyedFields'](ab,ac);if(readStats(a)['batches']>=e['maxRpcs'])h['exhausted']['rpcs']=!![];}catch{h['graph']['gaps']['push']('reverse:'+ab);continue;}for(const af of ac){const ag=A['get'](af+'|'+ab+'|schema')??[],ah=lookupMapLower(ad,af);if(!ah)continue;const ai=extractReverseRefs(ab,ah['data']??ah);for(const aj of ag){const ak=aj['read'];for(const al of ai){if(al['schemaId']!==REVERSE_GROUP_WILDCARD&&al['schemaId']!==aj['id'])continue;let am=al['refs']['map'](an=>an['to']?an:{...an,'to':af});ak['kind']==='reverse'&&ak['filterType']&&(am=am['filter'](an=>inferObjectType(an['to'])===ak['filterType']));if(am['length']===0x0)continue;w['push']({'schema':aj,'sourceId':af,'refs':am,'observed':am['length']});}}}}for(const an of EDGE_SCHEMAS){const ao=an['read'];if(ao['kind']!=='event'||!f['allowsEvent'](an,p))continue;const ap=[...o]['filter'](ar=>{if(n['has'](ar+'|'+an['id']))return![];return sourceMatches(an['source'],h['graph']['nodes']['get'](ar));});if(ap['length']===0x0)continue;let aq=m['get'](ao['eventType']);if(!aq){aq={'events':[],'truncated':![],'failed':![]};try{const ar=await a['getEvents'](ao['eventType'],{'maxPages':e['maxEventPages']});if(readStats(a)['batches']>=e['maxRpcs'])h['exhausted']['rpcs']=!![];aq['events']=ar['events'],aq['truncated']=ar['truncated'],ar['truncated']&&ar['events']['length']===0x0&&(aq['failed']=!![],h['graph']['gaps']['push']('events:'+ao['eventType']));}catch{aq['failed']=!![],h['graph']['gaps']['push']('events:'+ao['eventType']);}m['set'](ao['eventType'],aq);}if(aq['failed']){for(const as of ap)n['add'](as+'|'+an['id']);continue;}if(aq['truncated']){h['exhausted']['eventPages']=!![];for(const at of ap){h['markTruncation']({'nodeId':at,'schema':an['id'],'observed':aq['events']['length'],'limit':e['maxEventPages'],'reason':'event_pages'});}}for(const au of ap){n['add'](au+'|'+an['id']);const av=extractEventRefs(ao,au,aq['events']);if(av['length']===0x0)continue;w['push']({'schema':an,'sourceId':au,'refs':av,'observed':av['length'],'truncated':aq['truncated']});}}const B=new Set(),C=new Map();for(const aw of w){const ax=e['perKindCaps'][aw['schema']['id']]??e['maxFanoutPerNode'],ay=C['get'](aw['sourceId'])??0x0,az=Math['max'](0x0,e['maxFanoutPerNode']-ay),aA=Math['min'](ax,az),aB=aw['refs']['slice'](0x0,aA);aw['refs']['length']>aA&&h['markTruncation']({'nodeId':aw['sourceId'],'schema':aw['schema']['id'],'observed':aw['refs']['length'],'limit':a137a,'reason':'fanout'});const aC=new Map();for(const aD of aB){const aE=aD['from']??aw['sourceId'],aF=isWfNodeId(aD['to'])?p:p+0x1,aG=h['graph']['nodes']['has'](aD['to']),aH=f['effectiveMaxHops'](aw['schema']);if(aH!==undefined){const aJ=(t(aE,new Set())['get'](aw['schema']['id'])??0x0)+0x1;if(aJ>aH&&!aG){aC['set'](aE,(aC['get'](aE)??0x0)+0x1);continue;}}if(aF>e['maxDepth']&&!aG){h['exhausted']['depth']=!![];continue;}const aI=h['addNode'](aD['to'],Math['min'](aF,e['maxDepth']),{'schema':aw['schema']['id'],'from':aE});if(!aI)break;h['addEdge'](aw['schema'],aE,aD,q,aw['truncated']===!![]||aw['refs']['length']>aA),C['set'](aw['sourceId'],ay+0x1);if(!isWfNodeId(aD['to'])&&aF<=e['maxDepth'])B['add'](aD['to']);}for(const [aK,aL]of aC){h['markTruncation']({'nodeId':aK,'schema':aw['schema']['id'],'observed':aL,'limit':f['effectiveMaxHops'](aw['schema'])??0x0,'reason':'schema_hops'});}}if(h['exhausted']['rpcs']){h['graph']['gaps']['push']('budget:maxRpcs');break;}o=B;}return h['finalize'](a);}function sourceMatches(a,b){if(a==='ANY')return!![];if(a==='EOA')return b['kind']==='eoa';return b['objectType']===a;}function lookupMapLower(a,b){const c=a['get'](b);if(c!==undefined)return c;for(const [d,e]of a)if(d['toLowerCase']()===b)return e;return undefined;}export function orderCompletionInGraph(a,b){const c=a['nodes']['get'](b['toLowerCase']()),d=c?.['raw']?.['data']??c?.['raw']??{},e=String(d['machine']??''),f=String(d['progress']??''),g=a['nodes']['get'](f['toLowerCase']()),h=String((g?.['raw']?.['data']??g?.['raw']??{})['current']??'');let i=null;if(e){const j=e['toLowerCase']()+'::node::',k=a['edges']['filter'](l=>l['schema']==='wf.transition'&&l['from']['startsWith'](j))['map'](l=>({'node':l['payload']?.['node'],'prev_node':l['payload']?.['prevNode']}));if(k['length']>0x0)i=terminalNamesOfEdges(k);}return deriveOrderCompletion({'machine':e||null,'progress':f||null,'currentNode':h||null,'terminalNames':i});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{applyExposureGate as
|
|
1
|
+
import{applyExposureGate as a140a}from'../../config/exposure.js';export{resolveViability,factRef,parseFactRef}from'../../config/exposure.js';export const EXPOSURE_ROLES={'buyer':'buyer','merchant':'merchant','supplier':'supplier','collaborator':'collaborator','arbitrator':'arbitrator','system':'system','neutral':'neutral'};export function applyExposureGate(a,b){return a140a(a,b);}export function lossParty(a,b){return{'role':a,'basis':b};}export function gainPath(a,b,c,d){return{'role':a,'path':b,'viability':c,'gate':d};}
|
package/dist/harness/recover.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const RECOVERY_RULES={'insufficient_balance':{'error_code':'insufficient_balance','strategy':'claim_faucet','max_attempts':0x3,'automation':'semi','detail':'1.\x20Testnet:\x20claim\x20WOW\x20from\x20the\x20faucet\x202.\x20Mainnet:\x20transfer\x20ETH/USDT/USDC/WBTC\x20via\x20the\x20ETH\x20mainnet\x20cross-chain\x20bridge\x20(query\x20active\x20EVM\x20account\x20→\x20top\x20up\x20from\x20external\x20wallet\x20→\x20confirm\x20→\x20cross-chain)\x203.\x20Point\x20the\x20user\x20to\x20the\x20live\x20airdrop\x20page\x20(https://wowok.net/airdrop.html)\x20for\x20the\x20current\x20round\x204.\x20Retry\x20original\x20operation.\x20NOTE:\x20this\x20rule\x20is\x20for\x20the\x20SIGNING\x20ACCOUNT\x27s\x20wallet/gas\x20only\x20—\x20an\x20on-chain\x20POOL\x20shortage\x20(reward/allocation)\x20classifies\x20as\x20pool_shortage,\x20never\x20here','user_prompt':'Insufficient\x20balance\x20for\x20gas\x20or\x20operation.\x20How\x20to\x20obtain\x20WOW\x20tokens:\x20(1)\x20Testnet\x20—\x20claim\x20WOW\x20from\x20the\x20faucet\x20(https://faucet.testnet.wowok.net);\x20all\x20merchant\x20and\x20order\x20testing\x20can\x20use\x20WOW\x20as\x20the\x20payment\x20token.\x20(2)\x20Mainnet\x20—\x20transfer\x20ETH\x20/\x20USDT\x20/\x20USDC\x20/\x20WBTC\x20via\x20the\x20ETH\x20mainnet\x20cross-chain\x20bridge:\x20first\x20query\x20the\x20active\x20EVM\x20account\x20(bridge_operation\x20query_active_evm_account,\x20auto-generated\x20on\x20first\x20use),\x20then\x20transfer\x20from\x20an\x20external\x20wallet\x20(e.g.\x20MetaMask)\x20to\x20that\x20address,\x20confirm\x20the\x20balance\x20arrived,\x20and\x20cross-chain\x20to\x20WOW\x20mainnet\x20(bridge_operation\x20cross_chain_evm_to_wow).\x20(3)\x20WOW\x20airdrop:\x20current\x20round\x20status,\x20pool\x20and\x20eligibility\x20are\x20published\x20live\x20at\x20https://wowok.net/airdrop.html\x20(referral:\x20https://wowok.net/refer.html)\x20—\x20open\x20that\x20page\x20rather\x20than\x20assuming\x20a\x20round\x20is\x20live\x20or\x20closed.\x20Query\x20wowok_buildin_info\x20with\x20info=\x27funding\x20guidance\x27\x20for\x20the\x20canonical\x20funding\x20guidance.'},'pool_shortage':{'error_code':'pool_shortage','strategy':'adjust_params','max_attempts':0x1,'automation':'semi','detail':'An\x20on-chain\x20POOL\x20cannot\x20cover\x20the\x20operation\x20(reward.move:243\x20abort\x206\x20/\x20'+'allocation.move:509\x20abort\x207)\x20—\x20a\x20pool\x20funding\x20problem,\x20NOT\x20the\x20caller\x27s\x20wallet;\x20a\x20faucet\x20claim\x20will\x20NOT\x20help\x20and\x20re-sending\x20the\x20rail\x20unchanged\x20changes\x20nothing.\x201.\x20Reward\x20pool:\x20the\x20reward\x20ISSUER\x20tops\x20it\x20up\x20with\x20reward\x20coin_add\x20(permission\x20153)\x20—\x20the\x20claim\x20key\x20slot\x20is\x20written\x20BEFORE\x20the\x20balance\x20assert\x20and\x20the\x20abort\x20rolls\x20it\x20back,\x20so\x20NOTHING\x20was\x20consumed;\x20the\x20identical\x20claim\x20succeeds\x20after\x20the\x20top-up\x20(mainnet-proven,\x20T14).\x202.\x20Allocation\x20pool:\x20the\x20payer\x20side\x20funds\x20the\x20order/allocation\x20first\x20(order\x20renew,\x20payment\x20create\x20into\x20the\x20allocation),\x20then\x20re-runs\x20the\x20rail;\x20if\x20the\x20pool\x20is\x20drained\x20because\x20the\x20rail\x20ALREADY\x20paid\x20(balance\x200,\x20once-slot\x20consumed),\x20verify\x20via\x20the\x20Payment\x20record\x20instead\x20of\x20retrying.\x203.\x20As\x20the\x20BUYER:\x20report\x20the\x20shortage\x20to\x20the\x20merchant\x20—\x20never\x20fund\x20a\x20pool\x20you\x20do\x20not\x20own','user_prompt':'The\x20on-chain\x20pool\x20backing\x20this\x20operation\x20is\x20short\x20of\x20funds.\x20The\x20pool\x27s\x20owner\x20must\x20top\x20it\x20up\x20(reward\x20coin_add\x20/\x20allocation\x20funding)\x20—\x20a\x20faucet\x20claim\x20will\x20not\x20help.\x20As\x20the\x20buyer,\x20ask\x20the\x20merchant\x20to\x20fund\x20the\x20pool.'},'stock_exhausted':{'error_code':'stock_exhausted','strategy':'adjust_params','max_attempts':0x1,'automation':'semi','detail':'Merchant-side\x20inventory\x20shortfall\x20(Move\x20service:16\x20E_STOCK_NOT_ENOUGH)\x20—\x20NOT\x20a\x20buyer\x20balance\x20problem,\x20so\x20a\x20faucet\x20claim\x20will\x20NOT\x20help.\x201.\x20Reduce\x20the\x20purchase\x20quantity\x20to\x20the\x20item\x27s\x20remaining\x20stock\x202.\x20Pick\x20another\x20sale\x20item\x203.\x20Ask\x20the\x20merchant\x20to\x20restock,\x20then\x20retry','user_prompt':'The\x20sale\x20item\x27s\x20stock\x20is\x20exhausted\x20for\x20the\x20requested\x20quantity.\x20Reduce\x20the\x20quantity,\x20choose\x20another\x20item,\x20or\x20ask\x20the\x20merchant\x20to\x20restock.'},'allocation_empty':{'error_code':'allocation_empty','strategy':'stop','max_attempts':0x1,'automation':'semi','detail':'The\x20Allocation\x20distributed\x20zero\x20value:\x20its\x20pool\x20is\x20empty\x20(already\x20fully\x20distributed,\x20or\x20the\x20order\x20total\x20was\x20discounted/couponed\x20to\x20zero)\x20—\x20a\x20legitimate\x20outcome\x20for\x20zero-total\x20orders.\x201.\x20Do\x20NOT\x20retry\x20the\x20allocation;\x20it\x20cannot\x20change\x20this.\x202.\x20If\x20funds\x20WERE\x20expected:\x20check\x20whether\x20the\x20order\x27s\x20payments\x20actually\x20funded\x20this\x20Allocation\x20before\x20the\x20rail\x20ran\x20(upstream\x20funding\x20problem),\x20and\x20verify\x20the\x20Payment\x20record\x20—\x20on\x20a\x20RETRIED\x20submission\x20the\x20FIRST\x20attempt\x20may\x20have\x20already\x20landed\x20(a\x20zero\x20balance\x20is\x20exactly\x20what\x20a\x20completed\x20distribution\x20looks\x20like,\x20F-M10).\x203.\x20The\x20chain\x20checks\x20the\x20balance\x20BEFORE\x20guard\x20evaluation,\x20so\x20this\x20abort\x20is\x20NOT\x20evidence\x20about\x20a\x20guard\x27s\x20verdict\x20—\x20never\x20conclude\x20\x27guard\x20rejected\x27\x20from\x20it','user_prompt':'The\x20allocation\x20pool\x20holds\x20nothing\x20to\x20distribute\x20(zero\x20total\x20or\x20already\x20fully\x20paid\x20out).\x20Verify\x20the\x20Payment\x20record\x20before\x20re-running\x20anything;\x20if\x20a\x20payout\x20was\x20expected,\x20the\x20pool\x20needs\x20funding\x20first.'},'sale_suspended':{'error_code':'sale_suspended','strategy':'adjust_params','max_attempts':0x1,'automation':'semi','detail':'The\x20merchant\x20suspended\x20this\x20sale\x20item\x20(Move\x20service:34\x20E_SALE_SUSPENDED).\x201.\x20Pick\x20another\x20(non-suspended)\x20item\x202.\x20Contact\x20the\x20merchant\x20to\x20resume\x20the\x20sale,\x20then\x20retry','user_prompt':'The\x20sale\x20item\x20is\x20suspended\x20by\x20the\x20merchant.\x20Please\x20choose\x20another\x20item\x20or\x20contact\x20the\x20merchant.'},'discount_invalid':{'error_code':'discount_invalid','strategy':'adjust_params','max_attempts':0x1,'automation':'semi','detail':'The\x20discount\x20is\x20outside\x20its\x20[time_start,\x20time_end]\x20validity\x20window\x20(Move\x20service:35\x20E_DISCOUNT_TIME_INVALID).\x201.\x20Retry\x20without\x20the\x20discount\x202.\x20Ask\x20the\x20merchant\x20for\x20a\x20fresh\x20discount,\x20then\x20retry','user_prompt':'The\x20discount\x20is\x20not\x20valid\x20at\x20the\x20current\x20time\x20(outside\x20its\x20validity\x20window).\x20Buy\x20without\x20the\x20discount\x20or\x20ask\x20the\x20merchant\x20for\x20a\x20new\x20one.'},'rate_limit':{'error_code':'rate_limit','strategy':'retry','max_attempts':0x5,'automation':'full','detail':'Rate\x20limit\x20hit\x20(HTTP\x20429).\x20Exponential\x20backoff\x20retry:\x202s\x20/\x204s\x20/\x208s\x20/\x2016s\x20/\x2032s.\x20Avoid\x20parallel\x20calls\x20while\x20the\x20limit\x20window\x20is\x20active.'},'gas_exceeded':{'error_code':'gas_exceeded','strategy':'adjust_params','max_attempts':0x3,'automation':'semi','detail':'Gas\x20budget\x20exceeded.\x201.\x20Increase\x20the\x20gas_budget\x20parameter\x202.\x20Reduce\x20the\x20operation\x20size\x20(fewer\x20objects\x20per\x20transaction)\x203.\x20Retry\x20the\x20original\x20operation','user_prompt':'Gas\x20budget\x20exceeded.\x20Increase\x20the\x20gas\x20budget\x20or\x20reduce\x20the\x20operation\x20size,\x20then\x20retry.'},'insufficient_gas':{'error_code':'insufficient_gas','strategy':'adjust_params','max_attempts':0x1,'automation':'semi','detail':'Gas\x20exhausted\x20—\x20the\x20transaction\x20failed\x20deterministically\x20and\x20did\x20NOT\x20commit\x20on-chain\x20(no\x20state\x20changed;\x20commit-state\x20verification\x20is\x20NOT\x20needed).\x201.\x20Raise\x20the\x20gas_budget\x20parameter\x20above\x20the\x20failed\x20transaction\x27s\x20gas_used\x202.\x20If\x20the\x20account\x20balance\x20cannot\x20cover\x20any\x20budget,\x20fund\x20the\x20signing\x20account\x20with\x20gas\x20tokens\x20first\x203.\x20Resubmit\x20as\x20a\x20FRESH\x20call\x20—\x20do\x20NOT\x20replay\x20the\x20same\x20transaction','user_prompt':'The\x20transaction\x20ran\x20out\x20of\x20gas\x20and\x20did\x20not\x20commit\x20on-chain.\x20Increase\x20the\x20gas\x20budget\x20(or\x20fund\x20the\x20account\x20with\x20gas)\x20and\x20submit\x20a\x20fresh\x20transaction\x20—\x20retrying\x20unchanged\x20will\x20fail\x20the\x20same\x20way.'},'bcs_error':{'error_code':'bcs_error','strategy':'adjust_params','max_attempts':0x2,'automation':'semi','detail':'BCS\x20serialization/deserialization\x20error\x20—\x20a\x20parameter\x20does\x20not\x20match\x20the\x20expected\x20type/structure.\x201.\x20Query\x20the\x20operation\x20schema\x20(schema_query)\x202.\x20Fix\x20the\x20offending\x20parameter\x20type\x20(e.g.\x20BigInt\x20vs\x20number,\x20vector\x20element\x20type)\x203.\x20Retry','user_prompt':'A\x20parameter\x20failed\x20serialization.\x20Check\x20the\x20parameter\x20types\x20against\x20the\x20schema\x20and\x20retry.'},'signature_error':{'error_code':'signature_error','strategy':'switch_account','max_attempts':0x2,'automation':'semi','detail':'Signature\x20verification\x20failed.\x201.\x20Verify\x20the\x20account\x20is\x20not\x20suspended\x202.\x20Check\x20the\x20network\x20matches\x20the\x20account\x27s\x203.\x20Switch\x20to\x20a\x20healthy\x20account\x20and\x20retry','user_prompt':'Signature\x20verification\x20failed.\x20The\x20account\x20may\x20be\x20suspended\x20or\x20misconfigured.\x20Switch\x20accounts\x20or\x20check\x20the\x20configuration\x20and\x20retry.'},'config_error':{'error_code':'config_error','strategy':'escalate_human','max_attempts':0x1,'automation':'manual','detail':'Local\x20configuration\x20error\x20(network\x20not\x20specified,\x20persistent\x20storage\x20not\x20set).\x201.\x20Show\x20the\x20user\x20which\x20configuration\x20is\x20missing\x202.\x20Guide\x20the\x20user\x20through\x20the\x20account_operation/config\x20setup\x203.\x20Retry\x20after\x20the\x20user\x20fixes\x20it','user_prompt':'Local\x20configuration\x20is\x20incomplete.\x20Please\x20finish\x20the\x20account/network\x20setup\x20and\x20retry.'},'wip_verification_failed':{'error_code':'wip_verification_failed','strategy':'adjust_params','max_attempts':0x2,'automation':'semi','detail':'WIP\x20file\x20not\x20publicly\x20reachable\x20/\x20hash\x20mismatch.\x201.\x20Upload\x20via\x20the\x20wip\x20storage\x20service\x20(wip_file\x20type=\x27upload\x27\x20—\x20official\x20free\x20store\x20or\x20storage=\x27custom\x27)\x202.\x20Or\x20deploy\x20to\x20a\x20public\x20URL\x20(GitHub\x20Pages\x20/\x20IPFS\x20/\x20own\x20site)\x203.\x20Update\x20the\x20sale\x27s\x20wip\x20URL\x204.\x20Re-run\x20the\x20operation','user_prompt':'The\x20WIP\x20file\x20could\x20not\x20be\x20verified\x20from\x20a\x20public\x20URL.\x20Upload\x20it\x20with\x20wip_file\x20type=\x27upload\x27\x20(official\x20free\x20store\x20or\x20your\x20own\x20service)\x20or\x20deploy\x20it\x20(GitHub\x20Pages\x20/\x20IPFS),\x20update\x20the\x20sale\x27s\x20WIP\x20URL,\x20and\x20retry.'},'wip_storage_unavailable':{'error_code':'wip_storage_unavailable','strategy':'retry','max_attempts':0x3,'automation':'full','detail':'Transient\x20wip\x20storage\x20transport\x20failure.\x201.\x20Retry\x20the\x20same\x20request\x20with\x20bounded\x20backoff\x202.\x20Large\x20WIP\x20files\x20are\x20network-sensitive:\x20compress\x20images\x20before\x20generate\x20(each\x20image\x20<=\x202MB,\x20total\x20<=\x2010MB)\x203.\x20Check\x20connectivity\x20to\x20the\x20storage\x20base\x20URL\x20if\x20retries\x20keep\x20failing','user_prompt':'The\x20wip\x20storage\x20request\x20failed\x20due\x20to\x20a\x20network\x20problem.\x20Retry\x20the\x20upload;\x20if\x20it\x20keeps\x20failing,\x20reduce\x20the\x20file\x20size\x20or\x20check\x20connectivity.'},'wip_storage_rejected':{'error_code':'wip_storage_rejected','strategy':'adjust_params','max_attempts':0x1,'automation':'semi','detail':'WIP\x20storage\x20service\x20rejected\x20the\x20request\x20(HTTP\x204xx\x20—\x20deterministic\x20client-side\x20fault,\x20retrying\x20unchanged\x20fails\x20identically).\x20400:\x20malformed\x20body\x20or\x20failed\x20WIP\x20validation\x20—\x20re-generate\x20via\x20wip_file\x20type=\x27generate\x27\x20401:\x20re-sign\x20with\x20a\x20fresh\x20nonce\x20inside\x20the\x20timestamp\x20window\x20403:\x20check\x20storage\x20service\x20configuration\x20404:\x20file\x20does\x20not\x20exist\x20—\x20re-upload\x20409:\x20quota\x20—\x20delete\x20old\x20files\x20via\x20wip_file\x20type=\x27list\x27\x20then\x20delete\x20413:\x20compress\x20images\x20(each\x20<=\x202MB,\x20total\x20<=\x2010MB)\x20and\x20regenerate','user_prompt':'The\x20WIP\x20storage\x20service\x20rejected\x20the\x20request\x20(HTTP\x204xx).\x20Fix\x20the\x20specific\x20fault\x20(re-generate/re-sign/re-upload\x20per\x20the\x20status\x20code)\x20and\x20retry\x20—\x20do\x20not\x20retry\x20unchanged.'},'network_error':{'error_code':'network_error','strategy':'retry','max_attempts':0x5,'automation':'full','detail':'Transport\x20failure\x20(timeout\x20/\x20connection\x20reset\x20/\x20RPC\x20unreachable\x20/\x20HTTP\x205xx\x20gateway\x20error).\x20Exponential\x20backoff\x20retry:\x201s\x20/\x202s\x20/\x204s\x20/\x208s\x20/\x2016s.\x20Switch\x20RPC\x20node\x20if\x20available.\x20READS:\x20a\x20plain\x20retry\x20is\x20safe.\x20FUND-MOVING\x20WRITES:\x20before\x20any\x20resubmission,\x20verify\x20whether\x20the\x20previous\x20attempt\x20landed\x20(query\x20the\x20reported\x20digest\x20directly,\x20or\x20the\x20expected\x20object\x20via\x20the\x20sender\x27s\x20recent\x20on-chain\x20objects\x20/\x20onchain_events)\x20—\x20if\x20it\x20landed,\x20ADOPT\x20it\x20and\x20stop;\x20a\x20blind\x20backoff\x20retry\x20of\x20a\x20landed\x20write\x20moves\x20the\x20funds\x20a\x20second\x20time.'},'submission_unknown':{'error_code':'submission_unknown','strategy':'query_and_retry','max_attempts':0x2,'automation':'semi','detail':'Transport-level\x20failure\x20after\x20the\x20request\x20left\x20the\x20client\x20—\x20the\x20submission\x20state\x20is\x20UNKNOWN\x20and\x20the\x20transaction\x20may\x20already\x20be\x20committed.\x20NEVER\x20auto-retry\x20a\x20write\x20here.\x201.\x20Verify\x20commit\x20state\x20on-chain:\x20query_toolkit\x20for\x20the\x20object\x20this\x20call\x20would\x20create/modify\x20(resolve\x20the\x20reference\x20from\x20the\x20call\x27s\x20own\x20arguments),\x20or\x20onchain_events\x20for\x20the\x20sender\x27s\x20recent\x20transactions.\x202.\x20If\x20the\x20expected\x20object\x20EXISTS,\x20adopt\x20it\x20and\x20continue\x20the\x20workflow\x20(the\x20operation\x20succeeded\x20despite\x20the\x20transport\x20error).\x203.\x20If\x20confirmed\x20ABSENT,\x20resubmit\x20the\x20SAME\x20call\x20once\x20—\x20for\x20a\x20FIRST-EVER\x20transaction\x20on\x20a\x20fresh\x20account\x20make\x20that\x20resubmission\x20with\x20env.no_auto_register=true\x20and\x20SAY\x20SO\x20(the\x20SDK\x20silently\x20appends\x20an\x20entity\x20registration\x20to\x20a\x20first\x20business\x20call;\x20if\x20that\x20appended\x20leg\x20was\x20the\x20failing\x20leg\x20the\x20skip\x20lets\x20the\x20call\x20through\x20—\x20ziroom-mn-261013\x20live\x20case;\x20if\x20the\x20resubmission\x20aborts,\x20the\x20envelope\x20now\x20names\x20the\x20abort\x20—\x20re-enable\x20auto\x20registration\x20and\x20retry).\x204.\x20If\x20the\x20reported\x20digest\x20does\x20not\x20resolve\x20or\x20the\x20failure\x20repeats,\x20STOP\x20looping\x20on\x20digest\x20checks\x20and\x20re-run\x20the\x20SAME\x20call\x20with\x20env.dry_run=true\x20—\x20the\x20simulation\x20surfaces\x20the\x20real\x20failure\x20(exact\x20Move\x20abort)\x20without\x20gas\x20or\x20duplicate\x20risk.\x205.\x20Reads\x20are\x20idempotent\x20—\x20retry\x20immediately.\x206.\x20M-K2\x20replay\x20discipline:\x20a\x20FAILED\x20receipt\x20is\x20final\x20—\x20its\x20digest\x20is\x20consumed\x20and\x20replaying\x20the\x20same\x20bytes\x20returns\x20the\x20same\x20failure\x20forever;\x20fix\x20the\x20cause\x20(usually\x20funding)\x20and\x20build\x20a\x20FRESH\x20transaction.\x20Live\x20mainnet\x20incident\x20behind\x20this\x20rule:\x20an\x20order_new\x20-32603\x20\x27did\x20not\x20complete\x27\x20had\x20committed;\x20the\x20blind\x20retry\x20created\x20a\x20second\x20order\x20with\x20a\x20second\x20full\x20escrow\x20and\x20a\x20second\x20stock\x20decrement','user_prompt':'The\x20request\x20failed\x20at\x20transport\x20level\x20but\x20may\x20have\x20already\x20been\x20committed\x20on-chain.\x20Verify\x20whether\x20the\x20expected\x20object\x20exists\x20(query\x20it)\x20before\x20any\x20retry\x20—\x20a\x20blind\x20retry\x20can\x20duplicate\x20the\x20operation\x20(double\x20escrow).\x20For\x20read\x20operations,\x20a\x20plain\x20retry\x20is\x20safe.'},'transaction_expired':{'error_code':'transaction_expired','strategy':'retry','max_attempts':0x3,'automation':'full','detail':'The\x20transaction\x20expired\x20before\x20execution\x20(epoch\x20boundary\x20or\x20validator/gateway\x20outage)\x20—\x20it\x20did\x20NOT\x20land\x20and\x20nothing\x20was\x20committed.\x20Bounded\x20backoff\x20retry:\x2010s\x20/\x2030s\x20/\x2060s,\x20resubmit\x20the\x20SAME\x20call\x20unchanged.\x20If\x20a\x20dry_run\x20passes\x20while\x20the\x20real\x20call\x20keeps\x20failing,\x20the\x20fault\x20is\x20chain-side\x20—\x20wait\x20it\x20out.\x20Verify\x20with\x20onchain_events\x20if\x20unsure.'},'guard_rejected':{'error_code':'guard_rejected','strategy':'fill_submission','max_attempts':0x2,'automation':'semi','detail':'1.\x20Parse\x20Guard\x20table\x20structure\x202.\x20If\x20the\x20Guard\x20defines\x20submission\x20items,\x20fill\x20them\x20and\x20resubmit\x20with\x20call_with_submission\x203.\x20If\x20it\x20defines\x20none,\x20the\x20rule\x20evaluated\x20false\x20—\x20typical\x20causes:\x20a\x20TIME\x20WINDOW\x20(Clock\x20deadline/opening\x20comparison\x20—\x20this\x20call\x20may\x20sit\x20outside\x20the\x20window,\x20and\x20a\x20mis-oriented\x20comparison\x20inverts\x20it:\x20everything\x20inside\x20rejected,\x20everything\x20after\x20admitted),\x20an\x20IDENTITY\x20condition\x20(signer/state\x20checks\x20—\x20the\x20caller\x20may\x20not\x20be\x20the\x20address\x20the\x20rule\x20expects),\x20or\x20a\x20DATA-DEPENDENCY\x20ORDERING\x20(R-03,\x20nnd-tn-261025:\x20the\x20rule\x20reads\x20a\x20repository\x20row\x20/\x20workflow\x20state\x20that\x20does\x20not\x20hold\x20yet\x20—\x20e.g.\x20a\x20repository\x20data_add\x20whose\x20policy\x20write_guard\x20checks\x20progress.current\x20is\x20only\x20admitted\x20AFTER\x20the\x20machine\x20reaches\x20the\x20granting\x20node,\x20while\x20that\x20node\x27s\x20forward\x20may\x20read\x20this\x20very\x20row;\x20the\x20fix\x20is\x20ORDER,\x20not\x20parameters\x20—\x20find\x20the\x20reading\x20node\x20via\x20the\x20machine\x20node\x20table\x20(onchain_table_data)\x20or\x20analyze_guard_semantics,\x20advance\x20there\x20first,\x20then\x20re-run\x20the\x20SAME\x20write);\x20adjust\x20the\x20call\x27s\x20parameters\x20or\x20change\x20the\x20Guard\x20(docs#40)\x204.\x20When\x20the\x20failure\x20is\x20passport\x20E_VERIFY_FAILED\x20and\x20a\x20submission\x20was\x20supplied,\x20the\x20response\x20appends\x20a\x20\x27Guard\x20diagnosis\x20(dry-run)\x27\x20line\x20naming\x20the\x20first\x20failing\x20impact\x20guard\x20—\x20fix\x20that\x20guard\x20first\x205.\x20A\x20TIME-window\x20rejection\x20may\x20simply\x20be\x20EARLY:\x20re-run\x20the\x20SAME\x20call\x20with\x20env.dry_run=true\x20to\x20probe\x20the\x20window\x20for\x20free\x20(guard\x20rejections\x20do\x20NOT\x20consume\x20the\x20total\x20retry\x20budget;\x20only\x20the\x20per-code\x20cap\x20of\x202\x20applies)','user_prompt':'Guard\x20verification\x20rejected.\x20If\x20the\x20Guard\x20defines\x20submission\x20items,\x20fill\x20in\x20the\x20required\x20submission\x20data\x20and\x20resubmit;\x20if\x20it\x20defines\x20none,\x20the\x20Guard\x20rule\x20evaluated\x20false\x20—\x20the\x20usual\x20causes\x20are\x20a\x20time\x20window\x20(this\x20call\x20may\x20be\x20outside\x20the\x20Clock\x20deadline/opening\x20window),\x20an\x20identity\x20condition\x20(the\x20caller\x20is\x20not\x20the\x20address\x20the\x20rule\x20expects),\x20or\x20a\x20data-dependency\x20ordering\x20(the\x20rule\x20reads\x20a\x20row\x20/\x20workflow\x20state\x20that\x20does\x20not\x20hold\x20yet\x20—\x20advance\x20the\x20workflow\x20to\x20the\x20granting\x20node\x20first,\x20then\x20re-run\x20the\x20same\x20write);\x20adjust\x20this\x20call\x27s\x20parameters\x20or\x20change\x20the\x20Guard\x20rule.\x20When\x20the\x20response\x20includes\x20a\x20\x27Guard\x20diagnosis\x20(dry-run)\x27\x20line,\x20it\x20names\x20the\x20first\x20failing\x20impact\x20guard\x20—\x20address\x20that\x20guard\x20first.\x20A\x20time-window\x20rejection\x20may\x20simply\x20be\x20early:\x20probe\x20the\x20window\x20with\x20env.dry_run=true\x20(free\x20—\x20guard\x20rejections\x20do\x20not\x20consume\x20the\x20total\x20retry\x20budget).'},'time_lock_not_elapsed':{'error_code':'time_lock_not_elapsed','strategy':'wait_and_retry','max_attempts':0x1,'automation':'semi','detail':'1.\x20Verify\x20Service\x20is\x20paused\x20(bPaused=true).\x20If\x20not,\x20submit\x20pause=true\x20first.\x202.\x20Wait\x20until\x20paused_time\x20+\x20setting_lock_duration\x20<=\x20current\x20clock.\x203.\x20Retry\x20the\x20original\x20operation.\x20Do\x20NOT\x20recreate\x20the\x20object.','user_prompt':'Service\x20setting_lock_duration\x20has\x20not\x20elapsed\x20since\x20the\x20Service\x20was\x20paused.\x20Please\x20pause\x20the\x20Service\x20if\x20it\x20is\x20not\x20already\x20paused,\x20wait\x20for\x20the\x20lock\x20duration\x20to\x20elapse,\x20then\x20retry.'},'immutable_violation':{'error_code':'immutable_violation','strategy':'recreate','max_attempts':0x1,'automation':'semi','detail':'1.\x20Stop\x20modification\x20attempt\x202.\x20Evaluate\x20creating\x20a\x20new\x20object\x20as\x20replacement\x203.\x20Re-plan\x20affected\x20phases','user_prompt':'Cannot\x20modify\x20an\x20immutable\x20object.\x20A\x20new\x20object\x20must\x20be\x20created\x20as\x20a\x20replacement.\x20Confirm\x20to\x20proceed\x20with\x20recreation.'},'permission_denied':{'error_code':'permission_denied','strategy':'switch_account','max_attempts':0x2,'automation':'semi','detail':'1.\x20Query\x20object\x27s\x20permission_guard\x202.\x20List\x20accounts\x20with\x20permission\x203.\x20Switch\x20account\x20or\x20prompt\x20user\x20to\x20add\x20permission','user_prompt':'Current\x20account\x20lacks\x20permission\x20for\x20this\x20operation.\x20Switch\x20to\x20an\x20authorized\x20account\x20or\x20update\x20the\x20Permission\x20object.'},'object_not_found':{'error_code':'object_not_found','strategy':'query_and_retry','max_attempts':0x3,'automation':'semi','detail':'1.\x20Verify\x20the\x20referenced\x20name/ID\x20spelling\x20(local_mark_list)\x20and\x20that\x20the\x20object\x20exists\x20on\x20the\x20current\x20network\x202.\x20If\x20recently\x20created,\x20re-query\x20the\x20object\x20(may\x20be\x20sync\x20delay)\x203.\x20If\x20truly\x20absent,\x20search\x20for\x20similar\x20objects\x204.\x20Prompt\x20user\x20to\x20reselect','user_prompt':'Referenced\x20object\x20not\x20found.\x20First\x20verify\x20the\x20name/ID\x20spelling\x20and\x20that\x20the\x20object\x20exists\x20on\x20the\x20current\x20network;\x20if\x20it\x20was\x20created\x20recently,\x20this\x20may\x20be\x20a\x20synchronization\x20delay\x20—\x20retry.\x20If\x20the\x20issue\x20persists,\x20please\x20select\x20a\x20valid\x20object.'},'state_conflict':{'error_code':'state_conflict','strategy':'adjust_params','max_attempts':0x2,'automation':'full','detail':'1.\x20Query\x20object\x27s\x20current\x20true\x20state\x202.\x20Update\x20ODG\x20status\x20annotations\x203.\x20Adjust\x20subsequent\x20operations\x20(e.g.,\x20skip\x20completed\x20steps)'},'invalid_parameter':{'error_code':'invalid_parameter','strategy':'adjust_params','max_attempts':0x2,'automation':'semi','detail':'1.\x20Query\x20the\x20relevant\x20schema\x202.\x20Auto-fix\x20obvious\x20errors\x20(e.g.,\x20BigInt\x20vs\x20string)\x203.\x20If\x20unfixable,\x20prompt\x20user','user_prompt':'Parameter\x20validation\x20failed.\x20Please\x20check\x20the\x20parameter\x20types\x20and\x20values\x20against\x20the\x20schema\x20and\x20retry.'},'move_abort_unmapped':{'error_code':'move_abort_unmapped','strategy':'stop','max_attempts':0x1,'automation':'manual','detail':'The\x20chain\x27s\x20business\x20logic\x20aborted\x20and\x20the\x20(module,\x20abort\x20code)\x20pair\x20has\x20no\x20local\x20mapping.\x20Read\x20the\x20module\x20and\x20abort\x20code\x20from\x20move_abort_info\x20/\x20the\x20message\x20(rendered\x20as\x20\x27abort\x20(N)\x27),\x20resolve\x20their\x20meaning\x20from\x20the\x20module\x27s\x20documentation\x20or\x20the\x20wowok-tools\x20Skill,\x20fix\x20the\x20business\x20cause,\x20and\x20issue\x20a\x20NEW\x20call.\x20Do\x20NOT\x20restart\x20the\x20server\x20and\x20do\x20NOT\x20retry\x20the\x20identical\x20call\x20—\x20it\x20aborts\x20deterministically.','user_prompt':'The\x20operation\x20was\x20rejected\x20by\x20the\x20chain\x27s\x20business\x20logic\x20and\x20its\x20abort\x20code\x20is\x20not\x20mapped\x20locally.\x20The\x20module\x20name\x20and\x20abort\x20code\x20in\x20the\x20error\x20are\x20authoritative\x20—\x20review\x20them\x20(and\x20the\x20object\x20state\x20via\x20query_toolkit)\x20before\x20adjusting\x20anything.'},'missing_data':{'error_code':'missing_data','strategy':'adjust_params','max_attempts':0x2,'automation':'semi','detail':'A\x20guard\x20rule\x20read\x20a\x20keyed\x20table\x20row\x20that\x20does\x20NOT\x20exist\x20(repository.data\x20/\x20oracle\x20entry)\x20and\x20the\x20verifier\x20surfaced\x20it\x20as\x20a\x20location-only\x20fault\x20inside\x20the\x20passport\x20module\x20—\x20no\x20abort\x20code,\x20because\x20the\x20framework\x20cannot\x20express\x20\x27row\x20absent\x27\x20as\x20an\x20abort.\x20This\x20is\x20a\x20DATA\x20problem:\x201.\x20Identify\x20the\x20repository\x20and\x20key\x20the\x20guard\x20rule\x20reads\x20(guard2file\x20/\x20analyze_guard_semantics\x20on\x20the\x20guard\x20source)\x202.\x20Have\x20the\x20row\x27s\x20producer\x20write\x20it\x20(e.g.\x20an\x20oracle\x20timestamp\x20like\x20checkin_ts),\x20or\x20add\x20it\x20with\x20repository\x20data_add\x20(data_add.name\x20must\x20match\x20a\x20policy\x20rule\x20name)\x203.\x20Retry\x20the\x20SAME\x20call\x20unchanged\x20—\x20a\x20dry_run\x20that\x20turns\x20clean\x20after\x20the\x20row\x20exists\x20confirms\x20the\x20diagnosis.\x20OR-BRANCH\x20NOTE\x20(alg26\x20261026\x20F-A26-13):\x20a\x20guard\x27s\x20OR\x20does\x20NOT\x20short-circuit\x20—\x20every\x20branch\x20is\x20evaluated,\x20so\x20a\x20row\x20read\x20by\x20ANY\x20branch\x20must\x20exist\x20even\x20when\x20the\x20taken\x20path\x20would\x20not\x20read\x20it;\x20seed\x20initial\x20rows\x20(e.g.\x20a\x20counter\x20at\x200)\x20for\x20every\x20OR\x20branch\x20before\x20first\x20use','user_prompt':'A\x20guard\x20rule\x20references\x20a\x20data\x20row\x20that\x20has\x20not\x20been\x20written\x20yet\x20(location-only\x20fault\x20inside\x20the\x20passport\x20module\x20—\x20NOT\x20a\x20network\x20problem).\x20Identify\x20the\x20repository\x20row\x20the\x20guard\x20expects\x20(guard2file\x20/\x20analyze_guard_semantics),\x20write\x20it\x20with\x20repository\x20data_add\x20(or\x20let\x20its\x20producer\x20write\x20it),\x20then\x20retry.'},'guard_data_missing':{'error_code':'guard_data_missing','strategy':'adjust_params','max_attempts':0x1,'automation':'semi','detail':'A\x20guard\x20rule\x20read\x20DATA\x20that\x20does\x20not\x20exist\x20—\x20a\x20keyed\x20(id,key)\x20repository/oracle\x20row\x20or\x20a\x20field\x20of\x20an\x20object\x20the\x20guard\x20references\x20—\x20and\x20the\x20passport\x20guard\x20verifier\x20panicked\x20at\x20execution\x20time\x20with\x20NO\x20abort\x20code.\x20This\x20is\x20a\x20GUARD-DATA\x20problem,\x20NOT\x20an\x20environment\x20fault\x20(do\x20not\x20restart\x20the\x20server,\x20do\x20not\x20look\x20for\x20a\x20routing\x20cause).\x201.\x20Export\x20the\x20guard\x20(guard2file\x20/\x20analyze_guard_semantics)\x20and\x20list\x20every\x20row/field\x20it\x20reads,\x20including\x20OR\x20branches\x20(an\x20OR\x20does\x20not\x20short-circuit\x20—\x20every\x20branch\x27s\x20row\x20must\x20exist).\x202.\x20Seed\x20the\x20missing\x20(id,key)\x20row\x20with\x20repository\x20data_add\x20(data_add.name\x20must\x20match\x20a\x20policy\x20rule\x20name),\x20or\x20point\x20the\x20guard\x20at\x20a\x20row/object\x20that\x20already\x20exists\x20—\x20a\x20history-time\x20anchor\x20(query_progress_history_time\x20id\x201280,\x20next_node,\x20find=last)\x20must\x20name\x20a\x20node\x20present\x20on\x20this\x20order\x27s\x20path/period.\x203.\x20Retry\x20the\x20SAME\x20call\x20unchanged;\x20a\x20dry_run\x20that\x20turns\x20clean\x20confirms\x20the\x20diagnosis.','user_prompt':'A\x20guard\x20reads\x20repository\x20data\x20that\x20has\x20not\x20been\x20written\x20yet\x20(not\x20a\x20network\x20or\x20server\x20problem).\x20Identify\x20the\x20(id,key)\x20row\x20the\x20guard\x20expects,\x20write\x20it\x20with\x20repository\x20data_add\x20or\x20use\x20an\x20existing\x20row,\x20then\x20retry.'},'state_not_visible':{'error_code':'state_not_visible','strategy':'wait_and_retry','max_attempts':0x3,'automation':'full','detail':'The\x20state\x20this\x20call\x20needs\x20was\x20JUST\x20written\x20and\x20is\x20not\x20yet\x20visible\x20to\x20reads\x20(write-to-visibility\x20window),\x20or\x20it\x20does\x20not\x20exist\x20at\x20all.\x201.\x20If\x20a\x20write\x20on\x20this\x20order/machine\x20committed\x20within\x20the\x20last\x20few\x20seconds,\x20wait\x20500ms\x20(doubling\x20each\x20attempt)\x20and\x20replay\x20the\x20SAME\x20call\x20UNCHANGED\x20—\x20NEVER\x20edit\x20parameters\x20to\x20\x27fix\x27\x20a\x20visibility\x20window;\x20an\x20aborted\x20call\x20never\x20landed,\x20so\x20the\x20replay\x20cannot\x20double-spend.\x202.\x20If\x20the\x20fault\x20persists\x20past\x20~3\x20attempts\x20(or\x20nothing\x20was\x20just\x20written),\x20the\x20state\x20is\x20deterministically\x20ABSENT\x20—\x20stop\x20retrying:\x20for\x20a\x20forward-info\x20miss\x20query\x20the\x20Machine\x27s\x20node\x20table\x20(onchain_table_data\x20onchain_table_item_machine_node)\x20and\x20use\x20an\x20existing\x20node/next_node/forward\x20triple\x20—\x20on\x20an\x20already-built\x20machine\x20check\x20TOPOLOGY\x20first\x20(alg26\x20261026\x20F-A26-14):\x20the\x20forward\x20may\x20simply\x20not\x20be\x20an\x20out-edge\x20of\x20the\x20order\x27s\x20CURRENT\x20node,\x20which\x20no\x20retry\x20can\x20fix;\x20for\x20a\x20guard-read\x20repository\x20row\x20follow\x20the\x20missing_data\x20path\x20(write\x20the\x20row).','user_prompt':'A\x20just-committed\x20write\x20is\x20not\x20visible\x20to\x20this\x20read\x20yet.\x20The\x20same\x20call\x20will\x20be\x20replayed\x20after\x20a\x20short\x20wait\x20—\x20no\x20parameter\x20change\x20is\x20needed.\x20If\x20it\x20keeps\x20failing,\x20the\x20required\x20state\x20is\x20genuinely\x20missing\x20and\x20must\x20be\x20created\x20first.'},'unreachable_transition':{'error_code':'unreachable_transition','strategy':'query_and_retry','max_attempts':0x1,'automation':'full','detail':'The\x20requested\x20forward\x20name\x20does\x20not\x20exist\x20on\x20the\x20(prev_node,\x20node)\x20pair\x20at\x20the\x20order\x27s\x20current\x20node\x20(machine.move:75\x20E_FORWARD_NOT_AT_NODE)\x20—\x20the\x20transition\x20is\x20not\x20in\x20the\x20Machine\x20graph.\x20Deterministic:\x20no\x20account\x20switch,\x20retry\x20or\x20gas\x20change\x20can\x20create\x20a\x20missing\x20edge,\x20and\x20a\x20published\x20Machine\x20is\x20immutable\x20(IMMUT-001).\x201.\x20Read\x20the\x20order\x27s\x20current\x20progress\x20node\x20(order\x20progress\x20with\x20convert_witness=\x27OrderProgress\x27).\x202.\x20Query\x20the\x20Machine\x20node\x20table\x20(onchain_table_item_machine_node)\x20and\x20list\x20the\x20pair\x27s\x20ACTUAL\x20forwards.\x203.\x20Re-issue\x20the\x20operation\x20with\x20an\x20existing\x20forward\x20name\x20that\x20leads\x20toward\x20the\x20goal.\x204.\x20If\x20no\x20existing\x20edge\x20reaches\x20the\x20intended\x20state\x20on\x20a\x20published\x20Machine,\x20the\x20path\x20is\x20impossible\x20—\x20redesign\x20requires\x20a\x20NEW\x20Machine\x20version\x20(pre-publish:\x20fix\x20the\x20graph\x20and\x20republish).','user_prompt':'The\x20requested\x20machine\x20transition\x20does\x20not\x20exist\x20at\x20the\x20order\x27s\x20current\x20node\x20—\x20retrying\x20or\x20switching\x20accounts\x20cannot\x20help.\x20The\x20available\x20forwards\x20must\x20be\x20read\x20from\x20the\x20machine\x27s\x20node\x20table\x20and\x20an\x20existing\x20one\x20used\x20instead;\x20if\x20none\x20fits,\x20the\x20machine\x20graph\x20itself\x20must\x20be\x20changed\x20before\x20publish.'},'forward_not_at_node':{'error_code':'forward_not_at_node','strategy':'query_and_retry','max_attempts':0x1,'automation':'full','detail':'The\x20order\x27s\x20CURRENT\x20Progress\x20node\x20carries\x20no\x20forward\x20with\x20the\x20requested\x20name\x20(machine.move:365\x20E_INFO_NOT_FOUND\x20=\x2013)\x20—\x20the\x20forward\x20is\x20not\x20an\x20out-edge\x20of\x20the\x20node\x20the\x20order\x20stands\x20on.\x20Deterministic\x20topology\x20mismatch:\x20retrying\x20the\x20same\x20triple,\x20waiting\x20or\x20switching\x20accounts\x20cannot\x20create\x20the\x20edge.\x201.\x20Read\x20the\x20order\x27s\x20CURRENT\x20node\x20(order\x20progress\x20with\x20convert_witness=\x27OrderProgress\x27).\x202.\x20Query\x20the\x20Machine\x20node\x20table\x20(onchain_table_item_machine_node)\x20and\x20list\x20the\x20pair\x27s\x20ACTUAL\x20forwards\x20at\x20that\x20node.\x203.\x20Re-issue\x20with\x20one\x20of\x20those\x20forward\x20names,\x20or\x20first\x20advance\x20through\x20the\x20intermediate\x20node\x20that\x20carries\x20the\x20intended\x20edge.\x204.\x20Always\x20surface\x20current_node\x20+\x20available_forwards,\x20never\x20the\x20same\x20triple\x20again.\x20Distinct\x20from\x20unreachable_transition\x20(machine:25)\x20where\x20the\x20pair\x20exists\x20at\x20this\x20node\x20and\x20only\x20the\x20name\x20is\x20missing.','user_prompt':'The\x20order\x20is\x20standing\x20on\x20a\x20node\x20that\x20has\x20no\x20such\x20forward.\x20The\x20current\x20node\x20and\x20its\x20actual\x20forward\x20names\x20must\x20be\x20read\x20from\x20the\x20machine\x20node\x20table\x20and\x20an\x20edge\x20sourced\x20there\x20used\x20instead\x20(or\x20the\x20order\x20advanced\x20to\x20the\x20right\x20node\x20first).\x20Retrying\x20cannot\x20help.'},'anchor_unavailable':{'error_code':'anchor_unavailable','strategy':'escalate_human','max_attempts':0x1,'automation':'manual','detail':'The\x20messenger\x20WTS\x20evidence\x20chain\x20is\x20unavailable:\x20the\x20server\x20key-book\x20anchor\x20could\x20not\x20be\x20confirmed\x20on\x20the\x20current\x20network\x20(signer\x20not\x20pinned\x20for\x20this\x20network,\x20anchor\x20repository\x20absent\x20on-chain\x20—\x20typical\x20after\x20a\x20chain\x20re-genesis\x20—\x20or\x20the\x20anchor\x20chain\x20read\x20failed).\x20This\x20is\x20an\x20INFRASTRUCTURE\x20configuration\x20gap,\x20NOT\x20a\x20guard\x20rejection,\x20a\x20network\x20fault,\x20or\x20a\x20parameter\x20problem\x20—\x20signing\x20and\x20anchoring\x20fail\x20closed\x20by\x20design\x20(an\x20unconfirmed\x20key\x20book\x20cannot\x20ground\x20evidence).\x20Remedy\x20(out\x20of\x20band,\x20no\x20retry\x20will\x20help):\x201.\x20Deploy\x20or\x20re-anchor\x20the\x20messenger\x20server\x20key\x20book\x20on\x20the\x20target\x20network\x202.\x20Pin\x20its\x20signer\x20for\x20that\x20network\x20in\x20the\x20SDK\x20keybook\x20table\x203.\x20Until\x20then,\x20treat\x20the\x20messenger\x20channel\x20as\x20private\x20communication\x20WITHOUT\x20third-party\x20provability\x20(verify_wts\x20still\x20returns\x20a\x20structured\x20valid:false\x20verdict\x20with\x20the\x20anchor\x20reason)','user_prompt':'The\x20WTS\x20evidence\x20chain\x20cannot\x20be\x20anchored\x20on\x20this\x20network:\x20the\x20messenger\x20server\x20key-book\x20anchor\x20is\x20missing\x20or\x20unconfirmed.\x20This\x20needs\x20an\x20out-of-band\x20keybook\x20deployment\x20plus\x20SDK\x20signer\x20pinning\x20for\x20the\x20network\x20—\x20retrying\x20the\x20call\x20will\x20fail\x20the\x20same\x20way.\x20Until\x20fixed,\x20messenger\x20communication\x20remains\x20private\x20but\x20cannot\x20be\x20turned\x20into\x20third-party-verifiable\x20evidence.'},'capability_unavailable':{'error_code':'capability_unavailable','strategy':'stop','max_attempts':0x1,'automation':'manual','detail':'The\x20connected\x20chain\x20package\x20does\x20not\x20carry\x20this\x20protocol\x20entry,\x20so\x20the\x20call\x20is\x20impossible\x20on\x20this\x20package\x20version.\x20Deterministic\x20—\x20retrying,\x20re-signing\x20or\x20editing\x20parameters\x20cannot\x20add\x20the\x20missing\x20entry.\x20Remedy\x20(no\x20retry\x20involved):\x201.\x20Apply\x20the\x20documented\x20downgrade\x20for\x20the\x20intent\x20(for\x20a\x20reward\x20evidence\x20pin:\x20drop\x20the\x20evidence\x20binding\x20and\x20keep\x20the\x20repository-floor\x20guard\x20leg,\x20disclosing\x20that\x20it\x20proves\x20only\x20\x27a\x20qualifying\x20repository\x20row\x20exists\x20for\x20this\x20order\x27\x20—\x20not\x20who\x20wrote\x20it)\x202.\x20Check\x20the\x20target\x20network\x27s\x20package\x20release\x20notes\x20for\x20the\x20version\x20that\x20ships\x20the\x20entry\x20before\x20re-enabling\x20it\x203.\x20Never\x20treat\x20the\x20missing\x20entry\x20name\x20as\x20a\x20fixable\x20parameter','user_prompt':'This\x20call\x20needs\x20a\x20chain\x20capability\x20the\x20connected\x20package\x20does\x20not\x20have\x20yet.\x20It\x20cannot\x20succeed\x20on\x20this\x20network\x20version\x20—\x20no\x20retry\x20or\x20parameter\x20change\x20will\x20help.\x20The\x20documented\x20downgrade\x20keeps\x20the\x20goal\x20achievable\x20with\x20a\x20weaker\x20guarantee\x20that\x20must\x20be\x20disclosed\x20(for\x20a\x20review\x20bounty:\x20the\x20repository-floor\x20leg\x20proves\x20a\x20qualifying\x20rating\x20row\x20exists\x20for\x20the\x20order,\x20not\x20that\x20the\x20buyer\x20wrote\x20a\x20real\x20review).'},'delivery_unknown':{'error_code':'delivery_unknown','strategy':'query_and_retry','max_attempts':0x1,'automation':'semi','detail':'The\x20messenger\x20send\x20failed\x20at\x20transport\x20level\x20AFTER\x20submission:\x20delivery\x20state\x20is\x20UNKNOWN\x20because\x20the\x20relay\x20may\x20have\x20already\x20committed\x20the\x20message\x20despite\x20the\x20client-side\x20failure.\x20A\x20blind\x20re-send\x20DOUBLE-DELIVERS\x20the\x20same\x20encrypted\x20payload,\x20so\x20the\x20retry\x20loop\x20is\x20verify-first:\x20read\x20the\x20conversation\x20(watch_conversations\x20/\x20message\x20list)\x20and\x20check\x20for\x20the\x20identical\x20payload;\x20re-send\x20only\x20after\x20confirming\x20it\x20never\x20arrived.\x20Note\x20the\x20message,\x20when\x20it\x20did\x20arrive,\x20is\x20fully\x20end-to-end\x20encrypted\x20—\x20only\x20delivery\x20is\x20uncertain','user_prompt':'The\x20send\x20failed\x20after\x20submission,\x20so\x20delivery\x20is\x20uncertain\x20(the\x20server\x20may\x20have\x20committed\x20it\x20anyway).\x20Do\x20NOT\x20resend\x20blindly:\x20first\x20check\x20the\x20conversation\x20for\x20the\x20same\x20message;\x20resend\x20only\x20if\x20it\x20never\x20arrived.'},'transport_unavailable':{'error_code':'transport_unavailable','strategy':'retry','max_attempts':0x3,'automation':'full','detail':'A\x20transport-level\x20object\x20FETCH\x20failed\x20(\x27Fetch\x20<Type>\x20object\x200x...\x20failed\x27)\x20—\x20a\x20READ-path\x20availability\x20problem\x20(fullnode/gateway),\x20NOT\x20a\x20guard\x20rejection\x20and\x20NOT\x20an\x20on-chain\x20abort.\x201.\x20READ\x20calls\x20are\x20idempotent:\x20retry\x20after\x20a\x20brief\x20backoff,\x20or\x20against\x20a\x20healthy\x20endpoint.\x202.\x20If\x20this\x20error\x20surfaced\x20on\x20a\x20WRITE\x20call,\x20the\x20write\x27s\x20submission\x20state\x20is\x20UNKNOWN\x20—\x20do\x20NOT\x20blindly\x20resend;\x20first\x20query\x20the\x20expected\x20object\x20on-chain\x20and\x20adopt\x20or\x20resubmit\x20per\x20the\x20submission_unknown\x20discipline\x20(ghost-order\x20hazard).\x203.\x20Never\x20re-interpret\x20this\x20as\x20a\x20guard\x20failure:\x20no\x20guard\x20was\x20evaluated,\x20nothing\x20reached\x20Move.\x204.\x20Persistent\x20failures\x20across\x20endpoints\x20→\x20check\x20network/fullnode\x20health\x20before\x20touching\x20business\x20logic'},'unknown':{'error_code':'unknown','strategy':'escalate_human','max_attempts':0x1,'automation':'manual','detail':'1.\x20Report\x20full\x20error\x20context\x20to\x20the\x20user\x202.\x20Escalate\x20to\x20human\x20intervention\x203.\x20Flag\x20for\x20error-classification\x20rule\x20addition','user_prompt':'An\x20unclassified\x20error\x20occurred.\x20Please\x20review\x20the\x20error\x20details\x20and\x20contact\x20support\x20if\x20needed.'}};const operationAttempts=new Map();function getAttemptCount(a,b){const c=operationAttempts['get'](a);if(!c)return 0x0;return c['get'](b)??0x0;}function incrementAttempt(a,b){!operationAttempts['has'](a)&&operationAttempts['set'](a,new Map());const c=operationAttempts['get'](a),d=(c['get'](b)??0x0)+0x1;return c['set'](b,d),d;}const BUDGET_EXEMPT_CODES=new Set(['guard_rejected']);function getBudgetAttempts(a){const b=operationAttempts['get'](a);if(!b)return 0x0;let c=0x0;for(const [d,e]of b){if(!BUDGET_EXEMPT_CODES['has'](d))c+=e;}return c;}export function resetAttempts(a){operationAttempts['delete'](a);}export function recover(a,b,c){const d=RECOVERY_RULES[a]??RECOVERY_RULES['unknown'],e=0x5,f=getBudgetAttempts(b),g=getAttemptCount(b,a);if(d['max_attempts']<=0x1||d['strategy']==='stop')return{'strategy':d['strategy'],'should_retry':![],'max_attempts':d['max_attempts'],'current_attempt':g,'adjusted_params':d['adjusted_params'],'user_prompt':d['user_prompt'],'detail':d['detail']};if(f>=e)return{'strategy':'stop','should_retry':![],'max_attempts':e,'current_attempt':f,'detail':'Total\x20retry\x20limit\x20('+e+')\x20reached\x20for\x20operation\x20'+b+'.\x20Escalating\x20to\x20human\x20intervention.\x20Attempts\x20recorded\x20for\x20this\x20operation\x20id:\x20'+([...(operationAttempts['get'](b)??new Map())['entries']()]['map'](([j,k])=>j+':'+k)['join'](',\x20')||'none')+'.','user_prompt':'Maximum\x20retry\x20attempts\x20reached.\x20Manual\x20intervention\x20required.'};if(g>=d['max_attempts'])return{'strategy':'escalate_human','should_retry':![],'max_attempts':d['max_attempts'],'current_attempt':g,'detail':'Per-error-code\x20retry\x20limit\x20('+d['max_attempts']+')\x20reached\x20for\x20'+a+'.\x20Escalating\x20to\x20human.','user_prompt':'Recovery\x20attempts\x20for\x20'+a+'\x20exhausted.\x20Manual\x20intervention\x20required.'};const h=incrementAttempt(b,a),i={'strategy':d['strategy'],'should_retry':d['automation']==='full'||h<d['max_attempts'],'max_attempts':d['max_attempts'],'current_attempt':h,'adjusted_params':d['adjusted_params'],'user_prompt':d['user_prompt'],'detail':d['detail']};return i['should_retry']&&c?.['retryable']===![]&&a!=='guard_rejected'&&d['strategy']!=='fill_submission'&&d['strategy']!=='query_and_retry'&&(i['should_retry']=![],i['detail']+='\x20NON-RETRYABLE\x20CLASSIFICATION:\x20retrying\x20the\x20IDENTICAL\x20call\x20fails\x20identically\x20—\x20apply\x20the\x20strategy\x20above\x20to\x20fix\x20the\x20cause,\x20then\x20submit\x20a\x20FRESH\x20call.'),i;}export function getBackoffDelay(a){return Math['pow'](0x2,a-0x1)*0x3e8;}
|
|
1
|
+
export const RECOVERY_RULES={'insufficient_balance':{'error_code':'insufficient_balance','strategy':'claim_faucet','max_attempts':0x3,'automation':'semi','detail':'1.\x20Testnet:\x20claim\x20WOW\x20from\x20the\x20faucet\x202.\x20Mainnet:\x20transfer\x20ETH/USDT/USDC/WBTC\x20via\x20the\x20ETH\x20mainnet\x20cross-chain\x20bridge\x20(query\x20active\x20EVM\x20account\x20→\x20top\x20up\x20from\x20external\x20wallet\x20→\x20confirm\x20→\x20cross-chain)\x203.\x20Point\x20the\x20user\x20to\x20the\x20live\x20airdrop\x20page\x20(https://wowok.net/airdrop.html)\x20for\x20the\x20current\x20round\x204.\x20Retry\x20original\x20operation.\x20NOTE:\x20this\x20rule\x20is\x20for\x20the\x20SIGNING\x20ACCOUNT\x27s\x20wallet/gas\x20only\x20—\x20an\x20on-chain\x20POOL\x20shortage\x20(reward/allocation)\x20classifies\x20as\x20pool_shortage,\x20never\x20here','user_prompt':'Insufficient\x20balance\x20for\x20gas\x20or\x20operation.\x20How\x20to\x20obtain\x20WOW\x20tokens:\x20(1)\x20Testnet\x20—\x20claim\x20WOW\x20from\x20the\x20faucet\x20(https://faucet.testnet.wowok.net);\x20all\x20merchant\x20and\x20order\x20testing\x20can\x20use\x20WOW\x20as\x20the\x20payment\x20token.\x20(2)\x20Mainnet\x20—\x20transfer\x20ETH\x20/\x20USDT\x20/\x20USDC\x20/\x20WBTC\x20via\x20the\x20ETH\x20mainnet\x20cross-chain\x20bridge:\x20first\x20query\x20the\x20active\x20EVM\x20account\x20(bridge_operation\x20query_active_evm_account,\x20auto-generated\x20on\x20first\x20use),\x20then\x20transfer\x20from\x20an\x20external\x20wallet\x20(e.g.\x20MetaMask)\x20to\x20that\x20address,\x20confirm\x20the\x20balance\x20arrived,\x20and\x20cross-chain\x20to\x20WOW\x20mainnet\x20(bridge_operation\x20cross_chain_evm_to_wow).\x20(3)\x20WOW\x20airdrop:\x20current\x20round\x20status,\x20pool\x20and\x20eligibility\x20are\x20published\x20live\x20at\x20https://wowok.net/airdrop.html\x20(referral:\x20https://wowok.net/refer.html)\x20—\x20open\x20that\x20page\x20rather\x20than\x20assuming\x20a\x20round\x20is\x20live\x20or\x20closed.\x20Query\x20wowok_buildin_info\x20with\x20info=\x27funding\x20guidance\x27\x20for\x20the\x20canonical\x20funding\x20guidance.'},'pool_shortage':{'error_code':'pool_shortage','strategy':'adjust_params','max_attempts':0x1,'automation':'semi','detail':'An\x20on-chain\x20POOL\x20cannot\x20cover\x20the\x20operation\x20(the\x20reward\x20pool\x20aborts\x20with\x206,\x20'+'the\x20allocation\x20pool\x20with\x207)\x20—\x20a\x20pool\x20funding\x20problem,\x20NOT\x20the\x20caller\x27s\x20wallet;\x20a\x20faucet\x20claim\x20will\x20NOT\x20help\x20and\x20re-sending\x20the\x20rail\x20unchanged\x20changes\x20nothing.\x201.\x20Reward\x20pool:\x20the\x20reward\x20ISSUER\x20tops\x20it\x20up\x20with\x20reward\x20coin_add\x20(permission\x20153)\x20—\x20the\x20claim\x20key\x20slot\x20is\x20written\x20BEFORE\x20the\x20balance\x20assert\x20and\x20the\x20abort\x20rolls\x20it\x20back,\x20so\x20NOTHING\x20was\x20consumed;\x20the\x20identical\x20claim\x20succeeds\x20after\x20the\x20top-up\x20(mainnet-proven,\x20T14).\x202.\x20Allocation\x20pool:\x20the\x20payer\x20side\x20funds\x20the\x20order/allocation\x20first\x20(order\x20renew,\x20payment\x20create\x20into\x20the\x20allocation),\x20then\x20re-runs\x20the\x20rail;\x20if\x20the\x20pool\x20is\x20drained\x20because\x20the\x20rail\x20ALREADY\x20paid\x20(balance\x200,\x20once-slot\x20consumed),\x20verify\x20via\x20the\x20Payment\x20record\x20instead\x20of\x20retrying.\x203.\x20As\x20the\x20BUYER:\x20report\x20the\x20shortage\x20to\x20the\x20merchant\x20—\x20never\x20fund\x20a\x20pool\x20you\x20do\x20not\x20own','user_prompt':'The\x20on-chain\x20pool\x20backing\x20this\x20operation\x20is\x20short\x20of\x20funds.\x20The\x20pool\x27s\x20owner\x20must\x20top\x20it\x20up\x20(reward\x20coin_add\x20/\x20allocation\x20funding)\x20—\x20a\x20faucet\x20claim\x20will\x20not\x20help.\x20As\x20the\x20buyer,\x20ask\x20the\x20merchant\x20to\x20fund\x20the\x20pool.'},'stock_exhausted':{'error_code':'stock_exhausted','strategy':'adjust_params','max_attempts':0x1,'automation':'semi','detail':'Merchant-side\x20inventory\x20shortfall\x20(on-chain\x20E_STOCK_NOT_ENOUGH)\x20—\x20NOT\x20a\x20buyer\x20balance\x20problem,\x20so\x20a\x20faucet\x20claim\x20will\x20NOT\x20help.\x201.\x20Reduce\x20the\x20purchase\x20quantity\x20to\x20the\x20item\x27s\x20remaining\x20stock\x202.\x20Pick\x20another\x20sale\x20item\x203.\x20Ask\x20the\x20merchant\x20to\x20restock,\x20then\x20retry','user_prompt':'The\x20sale\x20item\x27s\x20stock\x20is\x20exhausted\x20for\x20the\x20requested\x20quantity.\x20Reduce\x20the\x20quantity,\x20choose\x20another\x20item,\x20or\x20ask\x20the\x20merchant\x20to\x20restock.'},'allocation_empty':{'error_code':'allocation_empty','strategy':'stop','max_attempts':0x1,'automation':'semi','detail':'The\x20Allocation\x20distributed\x20zero\x20value:\x20its\x20pool\x20is\x20empty\x20(already\x20fully\x20distributed,\x20or\x20the\x20order\x20total\x20was\x20discounted/couponed\x20to\x20zero)\x20—\x20a\x20legitimate\x20outcome\x20for\x20zero-total\x20orders.\x201.\x20Do\x20NOT\x20retry\x20the\x20allocation;\x20it\x20cannot\x20change\x20this.\x202.\x20If\x20funds\x20WERE\x20expected:\x20check\x20whether\x20the\x20order\x27s\x20payments\x20actually\x20funded\x20this\x20Allocation\x20before\x20the\x20rail\x20ran\x20(upstream\x20funding\x20problem),\x20and\x20verify\x20the\x20Payment\x20record\x20—\x20on\x20a\x20RETRIED\x20submission\x20the\x20FIRST\x20attempt\x20may\x20have\x20already\x20landed\x20(a\x20zero\x20balance\x20is\x20exactly\x20what\x20a\x20completed\x20distribution\x20looks\x20like,\x20F-M10).\x203.\x20The\x20chain\x20checks\x20the\x20balance\x20BEFORE\x20guard\x20evaluation,\x20so\x20this\x20abort\x20is\x20NOT\x20evidence\x20about\x20a\x20guard\x27s\x20verdict\x20—\x20never\x20conclude\x20\x27guard\x20rejected\x27\x20from\x20it','user_prompt':'The\x20allocation\x20pool\x20holds\x20nothing\x20to\x20distribute\x20(zero\x20total\x20or\x20already\x20fully\x20paid\x20out).\x20Verify\x20the\x20Payment\x20record\x20before\x20re-running\x20anything;\x20if\x20a\x20payout\x20was\x20expected,\x20the\x20pool\x20needs\x20funding\x20first.'},'sale_suspended':{'error_code':'sale_suspended','strategy':'adjust_params','max_attempts':0x1,'automation':'semi','detail':'The\x20merchant\x20suspended\x20this\x20sale\x20item\x20(Move\x20service:34\x20E_SALE_SUSPENDED).\x201.\x20Pick\x20another\x20(non-suspended)\x20item\x202.\x20Contact\x20the\x20merchant\x20to\x20resume\x20the\x20sale,\x20then\x20retry','user_prompt':'The\x20sale\x20item\x20is\x20suspended\x20by\x20the\x20merchant.\x20Please\x20choose\x20another\x20item\x20or\x20contact\x20the\x20merchant.'},'discount_invalid':{'error_code':'discount_invalid','strategy':'adjust_params','max_attempts':0x1,'automation':'semi','detail':'The\x20discount\x20is\x20outside\x20its\x20[time_start,\x20time_end]\x20validity\x20window\x20(Move\x20service:35\x20E_DISCOUNT_TIME_INVALID).\x201.\x20Retry\x20without\x20the\x20discount\x202.\x20Ask\x20the\x20merchant\x20for\x20a\x20fresh\x20discount,\x20then\x20retry','user_prompt':'The\x20discount\x20is\x20not\x20valid\x20at\x20the\x20current\x20time\x20(outside\x20its\x20validity\x20window).\x20Buy\x20without\x20the\x20discount\x20or\x20ask\x20the\x20merchant\x20for\x20a\x20new\x20one.'},'rate_limit':{'error_code':'rate_limit','strategy':'retry','max_attempts':0x5,'automation':'full','detail':'Rate\x20limit\x20hit\x20(HTTP\x20429).\x20Exponential\x20backoff\x20retry:\x202s\x20/\x204s\x20/\x208s\x20/\x2016s\x20/\x2032s.\x20Avoid\x20parallel\x20calls\x20while\x20the\x20limit\x20window\x20is\x20active.'},'gas_exceeded':{'error_code':'gas_exceeded','strategy':'adjust_params','max_attempts':0x3,'automation':'semi','detail':'Gas\x20budget\x20exceeded.\x201.\x20Increase\x20the\x20gas_budget\x20parameter\x202.\x20Reduce\x20the\x20operation\x20size\x20(fewer\x20objects\x20per\x20transaction)\x203.\x20Retry\x20the\x20original\x20operation','user_prompt':'Gas\x20budget\x20exceeded.\x20Increase\x20the\x20gas\x20budget\x20or\x20reduce\x20the\x20operation\x20size,\x20then\x20retry.'},'insufficient_gas':{'error_code':'insufficient_gas','strategy':'adjust_params','max_attempts':0x1,'automation':'semi','detail':'Gas\x20exhausted\x20—\x20the\x20transaction\x20failed\x20deterministically\x20and\x20did\x20NOT\x20commit\x20on-chain\x20(no\x20state\x20changed;\x20commit-state\x20verification\x20is\x20NOT\x20needed).\x201.\x20Raise\x20the\x20gas_budget\x20parameter\x20above\x20the\x20failed\x20transaction\x27s\x20gas_used\x202.\x20If\x20the\x20account\x20balance\x20cannot\x20cover\x20any\x20budget,\x20fund\x20the\x20signing\x20account\x20with\x20gas\x20tokens\x20first\x203.\x20Resubmit\x20as\x20a\x20FRESH\x20call\x20—\x20do\x20NOT\x20replay\x20the\x20same\x20transaction','user_prompt':'The\x20transaction\x20ran\x20out\x20of\x20gas\x20and\x20did\x20not\x20commit\x20on-chain.\x20Increase\x20the\x20gas\x20budget\x20(or\x20fund\x20the\x20account\x20with\x20gas)\x20and\x20submit\x20a\x20fresh\x20transaction\x20—\x20retrying\x20unchanged\x20will\x20fail\x20the\x20same\x20way.'},'bcs_error':{'error_code':'bcs_error','strategy':'adjust_params','max_attempts':0x2,'automation':'semi','detail':'BCS\x20serialization/deserialization\x20error\x20—\x20a\x20parameter\x20does\x20not\x20match\x20the\x20expected\x20type/structure.\x201.\x20Query\x20the\x20operation\x20schema\x20(schema_query)\x202.\x20Fix\x20the\x20offending\x20parameter\x20type\x20(e.g.\x20BigInt\x20vs\x20number,\x20vector\x20element\x20type)\x203.\x20Retry','user_prompt':'A\x20parameter\x20failed\x20serialization.\x20Check\x20the\x20parameter\x20types\x20against\x20the\x20schema\x20and\x20retry.'},'signature_error':{'error_code':'signature_error','strategy':'switch_account','max_attempts':0x2,'automation':'semi','detail':'Signature\x20verification\x20failed.\x201.\x20Verify\x20the\x20account\x20is\x20not\x20suspended\x202.\x20Check\x20the\x20network\x20matches\x20the\x20account\x27s\x203.\x20Switch\x20to\x20a\x20healthy\x20account\x20and\x20retry','user_prompt':'Signature\x20verification\x20failed.\x20The\x20account\x20may\x20be\x20suspended\x20or\x20misconfigured.\x20Switch\x20accounts\x20or\x20check\x20the\x20configuration\x20and\x20retry.'},'config_error':{'error_code':'config_error','strategy':'escalate_human','max_attempts':0x1,'automation':'manual','detail':'Local\x20configuration\x20error\x20(network\x20not\x20specified,\x20persistent\x20storage\x20not\x20set).\x201.\x20Show\x20the\x20user\x20which\x20configuration\x20is\x20missing\x202.\x20Guide\x20the\x20user\x20through\x20the\x20account_operation/config\x20setup\x203.\x20Retry\x20after\x20the\x20user\x20fixes\x20it','user_prompt':'Local\x20configuration\x20is\x20incomplete.\x20Please\x20finish\x20the\x20account/network\x20setup\x20and\x20retry.'},'wip_verification_failed':{'error_code':'wip_verification_failed','strategy':'adjust_params','max_attempts':0x2,'automation':'semi','detail':'WIP\x20file\x20not\x20publicly\x20reachable\x20/\x20hash\x20mismatch.\x201.\x20Upload\x20via\x20the\x20wip\x20storage\x20service\x20(wip_file\x20type=\x27upload\x27\x20—\x20official\x20free\x20store\x20or\x20storage=\x27custom\x27)\x202.\x20Or\x20deploy\x20to\x20a\x20public\x20URL\x20(GitHub\x20Pages\x20/\x20IPFS\x20/\x20own\x20site)\x203.\x20Update\x20the\x20sale\x27s\x20wip\x20URL\x204.\x20Re-run\x20the\x20operation','user_prompt':'The\x20WIP\x20file\x20could\x20not\x20be\x20verified\x20from\x20a\x20public\x20URL.\x20Upload\x20it\x20with\x20wip_file\x20type=\x27upload\x27\x20(official\x20free\x20store\x20or\x20your\x20own\x20service)\x20or\x20deploy\x20it\x20(GitHub\x20Pages\x20/\x20IPFS),\x20update\x20the\x20sale\x27s\x20WIP\x20URL,\x20and\x20retry.'},'wip_storage_unavailable':{'error_code':'wip_storage_unavailable','strategy':'retry','max_attempts':0x3,'automation':'full','detail':'Transient\x20wip\x20storage\x20transport\x20failure.\x201.\x20Retry\x20the\x20same\x20request\x20with\x20bounded\x20backoff\x202.\x20Large\x20WIP\x20files\x20are\x20network-sensitive:\x20compress\x20images\x20before\x20generate\x20(each\x20image\x20<=\x202MB,\x20total\x20<=\x2010MB)\x203.\x20Check\x20connectivity\x20to\x20the\x20storage\x20base\x20URL\x20if\x20retries\x20keep\x20failing','user_prompt':'The\x20wip\x20storage\x20request\x20failed\x20due\x20to\x20a\x20network\x20problem.\x20Retry\x20the\x20upload;\x20if\x20it\x20keeps\x20failing,\x20reduce\x20the\x20file\x20size\x20or\x20check\x20connectivity.'},'wip_storage_rejected':{'error_code':'wip_storage_rejected','strategy':'adjust_params','max_attempts':0x1,'automation':'semi','detail':'WIP\x20storage\x20service\x20rejected\x20the\x20request\x20(HTTP\x204xx\x20—\x20deterministic\x20client-side\x20fault,\x20retrying\x20unchanged\x20fails\x20identically).\x20400:\x20malformed\x20body\x20or\x20failed\x20WIP\x20validation\x20—\x20re-generate\x20via\x20wip_file\x20type=\x27generate\x27\x20401:\x20re-sign\x20with\x20a\x20fresh\x20nonce\x20inside\x20the\x20timestamp\x20window\x20403:\x20check\x20storage\x20service\x20configuration\x20404:\x20file\x20does\x20not\x20exist\x20—\x20re-upload\x20409:\x20quota\x20—\x20delete\x20old\x20files\x20via\x20wip_file\x20type=\x27list\x27\x20then\x20delete\x20413:\x20compress\x20images\x20(each\x20<=\x202MB,\x20total\x20<=\x2010MB)\x20and\x20regenerate','user_prompt':'The\x20WIP\x20storage\x20service\x20rejected\x20the\x20request\x20(HTTP\x204xx).\x20Fix\x20the\x20specific\x20fault\x20(re-generate/re-sign/re-upload\x20per\x20the\x20status\x20code)\x20and\x20retry\x20—\x20do\x20not\x20retry\x20unchanged.'},'network_error':{'error_code':'network_error','strategy':'retry','max_attempts':0x5,'automation':'full','detail':'Transport\x20failure\x20(timeout\x20/\x20connection\x20reset\x20/\x20RPC\x20unreachable\x20/\x20HTTP\x205xx\x20gateway\x20error).\x20Exponential\x20backoff\x20retry:\x201s\x20/\x202s\x20/\x204s\x20/\x208s\x20/\x2016s.\x20Switch\x20RPC\x20node\x20if\x20available.\x20READS:\x20a\x20plain\x20retry\x20is\x20safe.\x20FUND-MOVING\x20WRITES:\x20before\x20any\x20resubmission,\x20verify\x20whether\x20the\x20previous\x20attempt\x20landed\x20(query\x20the\x20reported\x20digest\x20directly,\x20or\x20the\x20expected\x20object\x20via\x20the\x20sender\x27s\x20recent\x20on-chain\x20objects\x20/\x20onchain_events)\x20—\x20if\x20it\x20landed,\x20ADOPT\x20it\x20and\x20stop;\x20a\x20blind\x20backoff\x20retry\x20of\x20a\x20landed\x20write\x20moves\x20the\x20funds\x20a\x20second\x20time.'},'submission_unknown':{'error_code':'submission_unknown','strategy':'query_and_retry','max_attempts':0x2,'automation':'semi','detail':'Transport-level\x20failure\x20after\x20the\x20request\x20left\x20the\x20client\x20—\x20the\x20submission\x20state\x20is\x20UNKNOWN\x20and\x20the\x20transaction\x20may\x20already\x20be\x20committed.\x20NEVER\x20auto-retry\x20a\x20write\x20here.\x201.\x20Verify\x20commit\x20state\x20on-chain:\x20query_toolkit\x20for\x20the\x20object\x20this\x20call\x20would\x20create/modify\x20(resolve\x20the\x20reference\x20from\x20the\x20call\x27s\x20own\x20arguments),\x20or\x20onchain_events\x20for\x20the\x20sender\x27s\x20recent\x20transactions.\x202.\x20If\x20the\x20expected\x20object\x20EXISTS,\x20adopt\x20it\x20and\x20continue\x20the\x20workflow\x20(the\x20operation\x20succeeded\x20despite\x20the\x20transport\x20error).\x203.\x20If\x20confirmed\x20ABSENT,\x20resubmit\x20the\x20SAME\x20call\x20once\x20—\x20for\x20a\x20FIRST-EVER\x20transaction\x20on\x20a\x20fresh\x20account\x20make\x20that\x20resubmission\x20with\x20env.no_auto_register=true\x20and\x20SAY\x20SO\x20(the\x20SDK\x20silently\x20appends\x20an\x20entity\x20registration\x20to\x20a\x20first\x20business\x20call;\x20if\x20that\x20appended\x20leg\x20was\x20the\x20failing\x20leg\x20the\x20skip\x20lets\x20the\x20call\x20through\x20—\x20ziroom-mn-261013\x20live\x20case;\x20if\x20the\x20resubmission\x20aborts,\x20the\x20envelope\x20now\x20names\x20the\x20abort\x20—\x20re-enable\x20auto\x20registration\x20and\x20retry).\x204.\x20If\x20the\x20reported\x20digest\x20does\x20not\x20resolve\x20or\x20the\x20failure\x20repeats,\x20STOP\x20looping\x20on\x20digest\x20checks\x20and\x20re-run\x20the\x20SAME\x20call\x20with\x20env.dry_run=true\x20—\x20the\x20simulation\x20surfaces\x20the\x20real\x20failure\x20(exact\x20Move\x20abort)\x20without\x20gas\x20or\x20duplicate\x20risk.\x205.\x20Reads\x20are\x20idempotent\x20—\x20retry\x20immediately.\x206.\x20M-K2\x20replay\x20discipline:\x20a\x20FAILED\x20receipt\x20is\x20final\x20—\x20its\x20digest\x20is\x20consumed\x20and\x20replaying\x20the\x20same\x20bytes\x20returns\x20the\x20same\x20failure\x20forever;\x20fix\x20the\x20cause\x20(usually\x20funding)\x20and\x20build\x20a\x20FRESH\x20transaction.\x20Live\x20mainnet\x20incident\x20behind\x20this\x20rule:\x20an\x20order_new\x20-32603\x20\x27did\x20not\x20complete\x27\x20had\x20committed;\x20the\x20blind\x20retry\x20created\x20a\x20second\x20order\x20with\x20a\x20second\x20full\x20escrow\x20and\x20a\x20second\x20stock\x20decrement','user_prompt':'The\x20request\x20failed\x20at\x20transport\x20level\x20but\x20may\x20have\x20already\x20been\x20committed\x20on-chain.\x20Verify\x20whether\x20the\x20expected\x20object\x20exists\x20(query\x20it)\x20before\x20any\x20retry\x20—\x20a\x20blind\x20retry\x20can\x20duplicate\x20the\x20operation\x20(double\x20escrow).\x20For\x20read\x20operations,\x20a\x20plain\x20retry\x20is\x20safe.'},'transaction_expired':{'error_code':'transaction_expired','strategy':'retry','max_attempts':0x3,'automation':'full','detail':'The\x20transaction\x20expired\x20before\x20execution\x20(epoch\x20boundary\x20or\x20validator/gateway\x20outage)\x20—\x20it\x20did\x20NOT\x20land\x20and\x20nothing\x20was\x20committed.\x20Bounded\x20backoff\x20retry:\x2010s\x20/\x2030s\x20/\x2060s,\x20resubmit\x20the\x20SAME\x20call\x20unchanged.\x20If\x20a\x20dry_run\x20passes\x20while\x20the\x20real\x20call\x20keeps\x20failing,\x20the\x20fault\x20is\x20chain-side\x20—\x20wait\x20it\x20out.\x20Verify\x20with\x20onchain_events\x20if\x20unsure.'},'submission_too_large':{'error_code':'submission_too_large','strategy':'adjust_params','max_attempts':0x1,'automation':'manual','detail':'The\x20guard\x20submission\x27s\x20BCS\x20size\x20exceeded\x20MAX_SUBMISSION_SIZE=256\x20(the\x20guard\x20submission-size\x20ceiling,\x20abort\x203)\x20—\x20the\x20whole\x20submission\x20struct,\x20not\x20the\x20guard-table\x20candidate\x20vector.\x201.\x20Move\x20roster/candidate\x20lists\x20OUT\x20of\x20the\x20witness:\x20sum_where/count_where\x20\x27ids\x27\x20accept\x20a\x20guard-table\x20VecAddress\x20entry\x20(cap\x20100\x20ids).\x202.\x20Keep\x20only\x20per-call\x20attestation\x20inline\x20—\x20budget\x20≈7\x20addresses\x20(7×32B\x20=\x20224B;\x20the\x208th\x20aborts).\x203.\x20Split\x20the\x20verification\x20into\x20multiple\x20guards\x20if\x20more\x20inline\x20evidence\x20is\x20unavoidable.\x204.\x20Resubmit\x20with\x20the\x20shrunken\x20submission.','user_prompt':'The\x20guard\x20submission\x20is\x20too\x20large\x20for\x20the\x20protocol\x27s\x20256-byte\x20witness\x20ceiling.\x20Roster-style\x20candidate\x20lists\x20(up\x20to\x20100)\x20belong\x20in\x20the\x20guard-table\x20id\x20vector;\x20only\x20~7\x20addresses\x20fit\x20in\x20the\x20inline\x20witness.\x20Slim\x20the\x20submission\x20and\x20retry.'},'guard_rejected':{'error_code':'guard_rejected','strategy':'fill_submission','max_attempts':0x2,'automation':'semi','detail':'1.\x20Parse\x20Guard\x20table\x20structure\x202.\x20If\x20the\x20Guard\x20defines\x20submission\x20items,\x20fill\x20them\x20and\x20resubmit\x20with\x20call_with_submission\x203.\x20If\x20it\x20defines\x20none,\x20the\x20rule\x20evaluated\x20false\x20—\x20typical\x20causes:\x20a\x20TIME\x20WINDOW\x20(Clock\x20deadline/opening\x20comparison\x20—\x20this\x20call\x20may\x20sit\x20outside\x20the\x20window,\x20and\x20a\x20mis-oriented\x20comparison\x20inverts\x20it:\x20everything\x20inside\x20rejected,\x20everything\x20after\x20admitted),\x20an\x20IDENTITY\x20condition\x20(signer/state\x20checks\x20—\x20the\x20caller\x20may\x20not\x20be\x20the\x20address\x20the\x20rule\x20expects),\x20or\x20a\x20DATA-DEPENDENCY\x20ORDERING\x20(R-03,\x20nnd-tn-261025:\x20the\x20rule\x20reads\x20a\x20repository\x20row\x20/\x20workflow\x20state\x20that\x20does\x20not\x20hold\x20yet\x20—\x20e.g.\x20a\x20repository\x20data_add\x20whose\x20policy\x20write_guard\x20checks\x20progress.current\x20is\x20only\x20admitted\x20AFTER\x20the\x20machine\x20reaches\x20the\x20granting\x20node,\x20while\x20that\x20node\x27s\x20forward\x20may\x20read\x20this\x20very\x20row;\x20the\x20fix\x20is\x20ORDER,\x20not\x20parameters\x20—\x20find\x20the\x20reading\x20node\x20via\x20the\x20machine\x20node\x20table\x20(onchain_table_data)\x20or\x20analyze_guard_semantics,\x20advance\x20there\x20first,\x20then\x20re-run\x20the\x20SAME\x20write);\x20adjust\x20the\x20call\x27s\x20parameters\x20or\x20change\x20the\x20Guard\x20(docs#40)\x204.\x20When\x20the\x20failure\x20is\x20passport\x20E_VERIFY_FAILED\x20and\x20a\x20submission\x20was\x20supplied,\x20the\x20response\x20appends\x20a\x20\x27Guard\x20diagnosis\x20(dry-run)\x27\x20line\x20naming\x20the\x20first\x20failing\x20impact\x20guard\x20—\x20fix\x20that\x20guard\x20first\x205.\x20A\x20TIME-window\x20rejection\x20may\x20simply\x20be\x20EARLY:\x20re-run\x20the\x20SAME\x20call\x20with\x20env.dry_run=true\x20to\x20probe\x20the\x20window\x20for\x20free\x20(guard\x20rejections\x20do\x20NOT\x20consume\x20the\x20total\x20retry\x20budget;\x20only\x20the\x20per-code\x20cap\x20of\x202\x20applies)','user_prompt':'Guard\x20verification\x20rejected.\x20If\x20the\x20Guard\x20defines\x20submission\x20items,\x20fill\x20in\x20the\x20required\x20submission\x20data\x20and\x20resubmit;\x20if\x20it\x20defines\x20none,\x20the\x20Guard\x20rule\x20evaluated\x20false\x20—\x20the\x20usual\x20causes\x20are\x20a\x20time\x20window\x20(this\x20call\x20may\x20be\x20outside\x20the\x20Clock\x20deadline/opening\x20window),\x20an\x20identity\x20condition\x20(the\x20caller\x20is\x20not\x20the\x20address\x20the\x20rule\x20expects),\x20or\x20a\x20data-dependency\x20ordering\x20(the\x20rule\x20reads\x20a\x20row\x20/\x20workflow\x20state\x20that\x20does\x20not\x20hold\x20yet\x20—\x20advance\x20the\x20workflow\x20to\x20the\x20granting\x20node\x20first,\x20then\x20re-run\x20the\x20same\x20write);\x20adjust\x20this\x20call\x27s\x20parameters\x20or\x20change\x20the\x20Guard\x20rule.\x20When\x20the\x20response\x20includes\x20a\x20\x27Guard\x20diagnosis\x20(dry-run)\x27\x20line,\x20it\x20names\x20the\x20first\x20failing\x20impact\x20guard\x20—\x20address\x20that\x20guard\x20first.\x20A\x20time-window\x20rejection\x20may\x20simply\x20be\x20early:\x20probe\x20the\x20window\x20with\x20env.dry_run=true\x20(free\x20—\x20guard\x20rejections\x20do\x20not\x20consume\x20the\x20total\x20retry\x20budget).'},'time_lock_not_elapsed':{'error_code':'time_lock_not_elapsed','strategy':'wait_and_retry','max_attempts':0x1,'automation':'semi','detail':'1.\x20Verify\x20Service\x20is\x20paused\x20(bPaused=true).\x20If\x20not,\x20submit\x20pause=true\x20first.\x202.\x20Wait\x20until\x20paused_time\x20+\x20setting_lock_duration\x20<=\x20current\x20clock.\x203.\x20Retry\x20the\x20original\x20operation.\x20Do\x20NOT\x20recreate\x20the\x20object.','user_prompt':'Service\x20setting_lock_duration\x20has\x20not\x20elapsed\x20since\x20the\x20Service\x20was\x20paused.\x20Please\x20pause\x20the\x20Service\x20if\x20it\x20is\x20not\x20already\x20paused,\x20wait\x20for\x20the\x20lock\x20duration\x20to\x20elapse,\x20then\x20retry.'},'immutable_violation':{'error_code':'immutable_violation','strategy':'recreate','max_attempts':0x1,'automation':'semi','detail':'1.\x20Stop\x20modification\x20attempt\x202.\x20Evaluate\x20creating\x20a\x20new\x20object\x20as\x20replacement\x203.\x20Re-plan\x20affected\x20phases','user_prompt':'Cannot\x20modify\x20an\x20immutable\x20object.\x20A\x20new\x20object\x20must\x20be\x20created\x20as\x20a\x20replacement.\x20Confirm\x20to\x20proceed\x20with\x20recreation.'},'permission_denied':{'error_code':'permission_denied','strategy':'switch_account','max_attempts':0x2,'automation':'semi','detail':'1.\x20Query\x20object\x27s\x20permission_guard\x202.\x20List\x20accounts\x20with\x20permission\x203.\x20Switch\x20account\x20or\x20prompt\x20user\x20to\x20add\x20permission','user_prompt':'Current\x20account\x20lacks\x20permission\x20for\x20this\x20operation.\x20Switch\x20to\x20an\x20authorized\x20account\x20or\x20update\x20the\x20Permission\x20object.'},'object_not_found':{'error_code':'object_not_found','strategy':'query_and_retry','max_attempts':0x3,'automation':'semi','detail':'1.\x20Verify\x20the\x20referenced\x20name/ID\x20spelling\x20(local_mark_list)\x20and\x20that\x20the\x20object\x20exists\x20on\x20the\x20current\x20network\x202.\x20If\x20recently\x20created,\x20re-query\x20the\x20object\x20(may\x20be\x20sync\x20delay)\x203.\x20If\x20truly\x20absent,\x20search\x20for\x20similar\x20objects\x204.\x20Prompt\x20user\x20to\x20reselect','user_prompt':'Referenced\x20object\x20not\x20found.\x20First\x20verify\x20the\x20name/ID\x20spelling\x20and\x20that\x20the\x20object\x20exists\x20on\x20the\x20current\x20network;\x20if\x20it\x20was\x20created\x20recently,\x20this\x20may\x20be\x20a\x20synchronization\x20delay\x20—\x20retry.\x20If\x20the\x20issue\x20persists,\x20please\x20select\x20a\x20valid\x20object.'},'state_conflict':{'error_code':'state_conflict','strategy':'adjust_params','max_attempts':0x2,'automation':'full','detail':'1.\x20Query\x20object\x27s\x20current\x20true\x20state\x202.\x20Update\x20ODG\x20status\x20annotations\x203.\x20Adjust\x20subsequent\x20operations\x20(e.g.,\x20skip\x20completed\x20steps)'},'invalid_parameter':{'error_code':'invalid_parameter','strategy':'adjust_params','max_attempts':0x2,'automation':'semi','detail':'1.\x20Query\x20the\x20relevant\x20schema\x202.\x20Auto-fix\x20obvious\x20errors\x20(e.g.,\x20BigInt\x20vs\x20string)\x203.\x20If\x20unfixable,\x20prompt\x20user','user_prompt':'Parameter\x20validation\x20failed.\x20Please\x20check\x20the\x20parameter\x20types\x20and\x20values\x20against\x20the\x20schema\x20and\x20retry.'},'move_abort_unmapped':{'error_code':'move_abort_unmapped','strategy':'stop','max_attempts':0x1,'automation':'manual','detail':'The\x20chain\x27s\x20business\x20logic\x20aborted\x20and\x20the\x20(module,\x20abort\x20code)\x20pair\x20has\x20no\x20local\x20mapping.\x20Read\x20the\x20module\x20and\x20abort\x20code\x20from\x20move_abort_info\x20/\x20the\x20message\x20(rendered\x20as\x20\x27abort\x20(N)\x27),\x20resolve\x20their\x20meaning\x20from\x20the\x20module\x27s\x20documentation\x20or\x20the\x20wowok-tools\x20Skill,\x20fix\x20the\x20business\x20cause,\x20and\x20issue\x20a\x20NEW\x20call.\x20Do\x20NOT\x20restart\x20the\x20server\x20and\x20do\x20NOT\x20retry\x20the\x20identical\x20call\x20—\x20it\x20aborts\x20deterministically.','user_prompt':'The\x20operation\x20was\x20rejected\x20by\x20the\x20chain\x27s\x20business\x20logic\x20and\x20its\x20abort\x20code\x20is\x20not\x20mapped\x20locally.\x20The\x20module\x20name\x20and\x20abort\x20code\x20in\x20the\x20error\x20are\x20authoritative\x20—\x20review\x20them\x20(and\x20the\x20object\x20state\x20via\x20query_toolkit)\x20before\x20adjusting\x20anything.'},'missing_data':{'error_code':'missing_data','strategy':'adjust_params','max_attempts':0x2,'automation':'semi','detail':'A\x20guard\x20rule\x20read\x20a\x20keyed\x20table\x20row\x20that\x20does\x20NOT\x20exist\x20(repository.data\x20/\x20oracle\x20entry)\x20and\x20the\x20verifier\x20surfaced\x20it\x20as\x20a\x20location-only\x20fault\x20inside\x20the\x20passport\x20module\x20—\x20no\x20abort\x20code,\x20because\x20the\x20framework\x20cannot\x20express\x20\x27row\x20absent\x27\x20as\x20an\x20abort.\x20This\x20is\x20a\x20DATA\x20problem:\x201.\x20Identify\x20the\x20repository\x20and\x20key\x20the\x20guard\x20rule\x20reads\x20(guard2file\x20/\x20analyze_guard_semantics\x20on\x20the\x20guard\x20source)\x202.\x20Have\x20the\x20row\x27s\x20producer\x20write\x20it\x20(e.g.\x20an\x20oracle\x20timestamp\x20like\x20checkin_ts),\x20or\x20add\x20it\x20with\x20repository\x20data_add\x20(data_add.name\x20must\x20match\x20a\x20policy\x20rule\x20name)\x203.\x20Retry\x20the\x20SAME\x20call\x20unchanged\x20—\x20a\x20dry_run\x20that\x20turns\x20clean\x20after\x20the\x20row\x20exists\x20confirms\x20the\x20diagnosis.\x20OR-BRANCH\x20NOTE\x20(alg26\x20261026\x20F-A26-13):\x20a\x20guard\x27s\x20OR\x20does\x20NOT\x20short-circuit\x20—\x20every\x20branch\x20is\x20evaluated,\x20so\x20a\x20row\x20read\x20by\x20ANY\x20branch\x20must\x20exist\x20even\x20when\x20the\x20taken\x20path\x20would\x20not\x20read\x20it;\x20seed\x20initial\x20rows\x20(e.g.\x20a\x20counter\x20at\x200)\x20for\x20every\x20OR\x20branch\x20before\x20first\x20use','user_prompt':'A\x20guard\x20rule\x20references\x20a\x20data\x20row\x20that\x20has\x20not\x20been\x20written\x20yet\x20(location-only\x20fault\x20inside\x20the\x20passport\x20module\x20—\x20NOT\x20a\x20network\x20problem).\x20Identify\x20the\x20repository\x20row\x20the\x20guard\x20expects\x20(guard2file\x20/\x20analyze_guard_semantics),\x20write\x20it\x20with\x20repository\x20data_add\x20(or\x20let\x20its\x20producer\x20write\x20it),\x20then\x20retry.'},'guard_data_missing':{'error_code':'guard_data_missing','strategy':'adjust_params','max_attempts':0x1,'automation':'semi','detail':'A\x20guard\x20rule\x20read\x20DATA\x20that\x20does\x20not\x20exist\x20—\x20a\x20keyed\x20(id,key)\x20repository/oracle\x20row\x20or\x20a\x20field\x20of\x20an\x20object\x20the\x20guard\x20references\x20—\x20and\x20the\x20passport\x20guard\x20verifier\x20panicked\x20at\x20execution\x20time\x20with\x20NO\x20abort\x20code.\x20This\x20is\x20a\x20GUARD-DATA\x20problem,\x20NOT\x20an\x20environment\x20fault\x20(do\x20not\x20restart\x20the\x20server,\x20do\x20not\x20look\x20for\x20a\x20routing\x20cause).\x201.\x20Export\x20the\x20guard\x20(guard2file\x20/\x20analyze_guard_semantics)\x20and\x20list\x20every\x20row/field\x20it\x20reads,\x20including\x20OR\x20branches\x20(an\x20OR\x20does\x20not\x20short-circuit\x20—\x20every\x20branch\x27s\x20row\x20must\x20exist).\x202.\x20Seed\x20the\x20missing\x20(id,key)\x20row\x20with\x20repository\x20data_add\x20(data_add.name\x20must\x20match\x20a\x20policy\x20rule\x20name),\x20or\x20point\x20the\x20guard\x20at\x20a\x20row/object\x20that\x20already\x20exists\x20—\x20a\x20history-time\x20anchor\x20(query_progress_history_time\x20id\x201280,\x20next_node,\x20find=last)\x20must\x20name\x20a\x20node\x20present\x20on\x20this\x20order\x27s\x20path/period.\x203.\x20Retry\x20the\x20SAME\x20call\x20unchanged;\x20a\x20dry_run\x20that\x20turns\x20clean\x20confirms\x20the\x20diagnosis.','user_prompt':'A\x20guard\x20reads\x20repository\x20data\x20that\x20has\x20not\x20been\x20written\x20yet\x20(not\x20a\x20network\x20or\x20server\x20problem).\x20Identify\x20the\x20(id,key)\x20row\x20the\x20guard\x20expects,\x20write\x20it\x20with\x20repository\x20data_add\x20or\x20use\x20an\x20existing\x20row,\x20then\x20retry.'},'state_not_visible':{'error_code':'state_not_visible','strategy':'wait_and_retry','max_attempts':0x3,'automation':'full','detail':'The\x20state\x20this\x20call\x20needs\x20was\x20JUST\x20written\x20and\x20is\x20not\x20yet\x20visible\x20to\x20reads\x20(write-to-visibility\x20window),\x20or\x20it\x20does\x20not\x20exist\x20at\x20all.\x201.\x20If\x20a\x20write\x20on\x20this\x20order/machine\x20committed\x20within\x20the\x20last\x20few\x20seconds,\x20wait\x20500ms\x20(doubling\x20each\x20attempt)\x20and\x20replay\x20the\x20SAME\x20call\x20UNCHANGED\x20—\x20NEVER\x20edit\x20parameters\x20to\x20\x27fix\x27\x20a\x20visibility\x20window;\x20an\x20aborted\x20call\x20never\x20landed,\x20so\x20the\x20replay\x20cannot\x20double-spend.\x202.\x20If\x20the\x20fault\x20persists\x20past\x20~3\x20attempts\x20(or\x20nothing\x20was\x20just\x20written),\x20the\x20state\x20is\x20deterministically\x20ABSENT\x20—\x20stop\x20retrying:\x20for\x20a\x20forward-info\x20miss\x20query\x20the\x20Machine\x27s\x20node\x20table\x20(onchain_table_data\x20onchain_table_item_machine_node)\x20and\x20use\x20an\x20existing\x20node/next_node/forward\x20triple\x20—\x20on\x20an\x20already-built\x20machine\x20check\x20TOPOLOGY\x20first\x20(alg26\x20261026\x20F-A26-14):\x20the\x20forward\x20may\x20simply\x20not\x20be\x20an\x20out-edge\x20of\x20the\x20order\x27s\x20CURRENT\x20node,\x20which\x20no\x20retry\x20can\x20fix;\x20for\x20a\x20guard-read\x20repository\x20row\x20follow\x20the\x20missing_data\x20path\x20(write\x20the\x20row).','user_prompt':'A\x20just-committed\x20write\x20is\x20not\x20visible\x20to\x20this\x20read\x20yet.\x20The\x20same\x20call\x20will\x20be\x20replayed\x20after\x20a\x20short\x20wait\x20—\x20no\x20parameter\x20change\x20is\x20needed.\x20If\x20it\x20keeps\x20failing,\x20the\x20required\x20state\x20is\x20genuinely\x20missing\x20and\x20must\x20be\x20created\x20first.'},'unreachable_transition':{'error_code':'unreachable_transition','strategy':'query_and_retry','max_attempts':0x1,'automation':'full','detail':'The\x20requested\x20forward\x20name\x20does\x20not\x20exist\x20on\x20the\x20(prev_node,\x20node)\x20pair\x20at\x20the\x20order\x27s\x20current\x20node\x20(on-chain\x20E_FORWARD_NOT_AT_NODE)\x20—\x20the\x20transition\x20is\x20not\x20in\x20the\x20Machine\x20graph.\x20Deterministic:\x20no\x20account\x20switch,\x20retry\x20or\x20gas\x20change\x20can\x20create\x20a\x20missing\x20edge,\x20and\x20a\x20published\x20Machine\x20is\x20immutable\x20(IMMUT-001).\x201.\x20Read\x20the\x20order\x27s\x20current\x20progress\x20node\x20(order\x20progress\x20with\x20convert_witness=\x27OrderProgress\x27).\x202.\x20Query\x20the\x20Machine\x20node\x20table\x20(onchain_table_item_machine_node)\x20and\x20list\x20the\x20pair\x27s\x20ACTUAL\x20forwards.\x203.\x20Re-issue\x20the\x20operation\x20with\x20an\x20existing\x20forward\x20name\x20that\x20leads\x20toward\x20the\x20goal.\x204.\x20If\x20no\x20existing\x20edge\x20reaches\x20the\x20intended\x20state\x20on\x20a\x20published\x20Machine,\x20the\x20path\x20is\x20impossible\x20—\x20redesign\x20requires\x20a\x20NEW\x20Machine\x20version\x20(pre-publish:\x20fix\x20the\x20graph\x20and\x20republish).','user_prompt':'The\x20requested\x20machine\x20transition\x20does\x20not\x20exist\x20at\x20the\x20order\x27s\x20current\x20node\x20—\x20retrying\x20or\x20switching\x20accounts\x20cannot\x20help.\x20The\x20available\x20forwards\x20must\x20be\x20read\x20from\x20the\x20machine\x27s\x20node\x20table\x20and\x20an\x20existing\x20one\x20used\x20instead;\x20if\x20none\x20fits,\x20the\x20machine\x20graph\x20itself\x20must\x20be\x20changed\x20before\x20publish.'},'forward_not_at_node':{'error_code':'forward_not_at_node','strategy':'query_and_retry','max_attempts':0x1,'automation':'full','detail':'The\x20order\x27s\x20CURRENT\x20Progress\x20node\x20carries\x20no\x20forward\x20with\x20the\x20requested\x20name\x20(on-chain\x20E_INFO_NOT_FOUND\x20=\x2013)\x20—\x20the\x20forward\x20is\x20not\x20an\x20out-edge\x20of\x20the\x20node\x20the\x20order\x20stands\x20on.\x20Deterministic\x20topology\x20mismatch:\x20retrying\x20the\x20same\x20triple,\x20waiting\x20or\x20switching\x20accounts\x20cannot\x20create\x20the\x20edge.\x201.\x20Read\x20the\x20order\x27s\x20CURRENT\x20node\x20(order\x20progress\x20with\x20convert_witness=\x27OrderProgress\x27).\x202.\x20Query\x20the\x20Machine\x20node\x20table\x20(onchain_table_item_machine_node)\x20and\x20list\x20the\x20pair\x27s\x20ACTUAL\x20forwards\x20at\x20that\x20node.\x203.\x20Re-issue\x20with\x20one\x20of\x20those\x20forward\x20names,\x20or\x20first\x20advance\x20through\x20the\x20intermediate\x20node\x20that\x20carries\x20the\x20intended\x20edge.\x204.\x20Always\x20surface\x20current_node\x20+\x20available_forwards,\x20never\x20the\x20same\x20triple\x20again.\x20Distinct\x20from\x20unreachable_transition\x20(machine:25)\x20where\x20the\x20pair\x20exists\x20at\x20this\x20node\x20and\x20only\x20the\x20name\x20is\x20missing.','user_prompt':'The\x20order\x20is\x20standing\x20on\x20a\x20node\x20that\x20has\x20no\x20such\x20forward.\x20The\x20current\x20node\x20and\x20its\x20actual\x20forward\x20names\x20must\x20be\x20read\x20from\x20the\x20machine\x20node\x20table\x20and\x20an\x20edge\x20sourced\x20there\x20used\x20instead\x20(or\x20the\x20order\x20advanced\x20to\x20the\x20right\x20node\x20first).\x20Retrying\x20cannot\x20help.'},'anchor_unavailable':{'error_code':'anchor_unavailable','strategy':'escalate_human','max_attempts':0x1,'automation':'manual','detail':'The\x20messenger\x20WTS\x20evidence\x20chain\x20is\x20unavailable:\x20the\x20server\x20key-book\x20anchor\x20could\x20not\x20be\x20confirmed\x20on\x20the\x20current\x20network\x20(signer\x20not\x20pinned\x20for\x20this\x20network,\x20anchor\x20repository\x20absent\x20on-chain\x20—\x20typical\x20after\x20a\x20chain\x20re-genesis\x20—\x20or\x20the\x20anchor\x20chain\x20read\x20failed).\x20This\x20is\x20an\x20INFRASTRUCTURE\x20configuration\x20gap,\x20NOT\x20a\x20guard\x20rejection,\x20a\x20network\x20fault,\x20or\x20a\x20parameter\x20problem\x20—\x20signing\x20and\x20anchoring\x20fail\x20closed\x20by\x20design\x20(an\x20unconfirmed\x20key\x20book\x20cannot\x20ground\x20evidence).\x20Remedy\x20(out\x20of\x20band,\x20no\x20retry\x20will\x20help):\x201.\x20Deploy\x20or\x20re-anchor\x20the\x20messenger\x20server\x20key\x20book\x20on\x20the\x20target\x20network\x202.\x20Pin\x20its\x20signer\x20for\x20that\x20network\x20in\x20the\x20SDK\x20keybook\x20table\x203.\x20Until\x20then,\x20treat\x20the\x20messenger\x20channel\x20as\x20private\x20communication\x20WITHOUT\x20third-party\x20provability\x20(verify_wts\x20still\x20returns\x20a\x20structured\x20valid:false\x20verdict\x20with\x20the\x20anchor\x20reason)','user_prompt':'The\x20WTS\x20evidence\x20chain\x20cannot\x20be\x20anchored\x20on\x20this\x20network:\x20the\x20messenger\x20server\x20key-book\x20anchor\x20is\x20missing\x20or\x20unconfirmed.\x20This\x20needs\x20an\x20out-of-band\x20keybook\x20deployment\x20plus\x20SDK\x20signer\x20pinning\x20for\x20the\x20network\x20—\x20retrying\x20the\x20call\x20will\x20fail\x20the\x20same\x20way.\x20Until\x20fixed,\x20messenger\x20communication\x20remains\x20private\x20but\x20cannot\x20be\x20turned\x20into\x20third-party-verifiable\x20evidence.'},'capability_unavailable':{'error_code':'capability_unavailable','strategy':'stop','max_attempts':0x1,'automation':'manual','detail':'The\x20connected\x20chain\x20package\x20does\x20not\x20carry\x20this\x20protocol\x20entry,\x20so\x20the\x20call\x20is\x20impossible\x20on\x20this\x20package\x20version.\x20Deterministic\x20—\x20retrying,\x20re-signing\x20or\x20editing\x20parameters\x20cannot\x20add\x20the\x20missing\x20entry.\x20Remedy\x20(no\x20retry\x20involved):\x201.\x20Apply\x20the\x20documented\x20downgrade\x20for\x20the\x20intent\x20(for\x20a\x20reward\x20evidence\x20pin:\x20drop\x20the\x20evidence\x20binding\x20and\x20keep\x20the\x20repository-floor\x20guard\x20leg,\x20disclosing\x20that\x20it\x20proves\x20only\x20\x27a\x20qualifying\x20repository\x20row\x20exists\x20for\x20this\x20order\x27\x20—\x20not\x20who\x20wrote\x20it)\x202.\x20Check\x20the\x20target\x20network\x27s\x20package\x20release\x20notes\x20for\x20the\x20version\x20that\x20ships\x20the\x20entry\x20before\x20re-enabling\x20it\x203.\x20Never\x20treat\x20the\x20missing\x20entry\x20name\x20as\x20a\x20fixable\x20parameter','user_prompt':'This\x20call\x20needs\x20a\x20chain\x20capability\x20the\x20connected\x20package\x20does\x20not\x20have\x20yet.\x20It\x20cannot\x20succeed\x20on\x20this\x20network\x20version\x20—\x20no\x20retry\x20or\x20parameter\x20change\x20will\x20help.\x20The\x20documented\x20downgrade\x20keeps\x20the\x20goal\x20achievable\x20with\x20a\x20weaker\x20guarantee\x20that\x20must\x20be\x20disclosed\x20(for\x20a\x20review\x20bounty:\x20the\x20repository-floor\x20leg\x20proves\x20a\x20qualifying\x20rating\x20row\x20exists\x20for\x20the\x20order,\x20not\x20that\x20the\x20buyer\x20wrote\x20a\x20real\x20review).'},'delivery_unknown':{'error_code':'delivery_unknown','strategy':'query_and_retry','max_attempts':0x1,'automation':'semi','detail':'The\x20messenger\x20send\x20failed\x20at\x20transport\x20level\x20AFTER\x20submission:\x20delivery\x20state\x20is\x20UNKNOWN\x20because\x20the\x20relay\x20may\x20have\x20already\x20committed\x20the\x20message\x20despite\x20the\x20client-side\x20failure.\x20A\x20blind\x20re-send\x20DOUBLE-DELIVERS\x20the\x20same\x20encrypted\x20payload,\x20so\x20the\x20retry\x20loop\x20is\x20verify-first:\x20read\x20the\x20conversation\x20(watch_conversations\x20/\x20message\x20list)\x20and\x20check\x20for\x20the\x20identical\x20payload;\x20re-send\x20only\x20after\x20confirming\x20it\x20never\x20arrived.\x20Note\x20the\x20message,\x20when\x20it\x20did\x20arrive,\x20is\x20fully\x20end-to-end\x20encrypted\x20—\x20only\x20delivery\x20is\x20uncertain','user_prompt':'The\x20send\x20failed\x20after\x20submission,\x20so\x20delivery\x20is\x20uncertain\x20(the\x20server\x20may\x20have\x20committed\x20it\x20anyway).\x20Do\x20NOT\x20resend\x20blindly:\x20first\x20check\x20the\x20conversation\x20for\x20the\x20same\x20message;\x20resend\x20only\x20if\x20it\x20never\x20arrived.'},'transport_unavailable':{'error_code':'transport_unavailable','strategy':'retry','max_attempts':0x3,'automation':'full','detail':'A\x20transport-level\x20object\x20FETCH\x20failed\x20(\x27Fetch\x20<Type>\x20object\x200x...\x20failed\x27)\x20—\x20a\x20READ-path\x20availability\x20problem\x20(fullnode/gateway),\x20NOT\x20a\x20guard\x20rejection\x20and\x20NOT\x20an\x20on-chain\x20abort.\x201.\x20READ\x20calls\x20are\x20idempotent:\x20retry\x20after\x20a\x20brief\x20backoff,\x20or\x20against\x20a\x20healthy\x20endpoint.\x202.\x20If\x20this\x20error\x20surfaced\x20on\x20a\x20WRITE\x20call,\x20the\x20write\x27s\x20submission\x20state\x20is\x20UNKNOWN\x20—\x20do\x20NOT\x20blindly\x20resend;\x20first\x20query\x20the\x20expected\x20object\x20on-chain\x20and\x20adopt\x20or\x20resubmit\x20per\x20the\x20submission_unknown\x20discipline\x20(ghost-order\x20hazard).\x203.\x20Never\x20re-interpret\x20this\x20as\x20a\x20guard\x20failure:\x20no\x20guard\x20was\x20evaluated,\x20nothing\x20reached\x20Move.\x204.\x20Persistent\x20failures\x20across\x20endpoints\x20→\x20check\x20network/fullnode\x20health\x20before\x20touching\x20business\x20logic'},'peer_not_registered':{'error_code':'peer_not_registered','strategy':'stop','max_attempts':0x1,'automation':'manual','detail':'The\x20message\x20RECIPIENT\x20is\x20not\x20registered\x20on\x20the\x20messenger\x20server\x20for\x20this\x20network\x20—\x20the\x20relay\x20has\x20no\x20keybook\x20entry\x20for\x20their\x20address,\x20so\x20delivery\x20is\x20impossible\x20until\x20THEY\x20enable\x20messenger.\x20Deterministic\x20recipient-side\x20gap:\x20retrying,\x20re-signing\x20or\x20switching\x20the\x20sender\x27s\x20account\x20cannot\x20fix\x20it.\x201.\x20Verify\x20the\x20recipient\x20address\x20spelling\x20and\x20that\x20both\x20sides\x20are\x20on\x20the\x20SAME\x20network\x20(a\x20foreign-network\x20address\x20reads\x20as\x20unregistered).\x202.\x20Ask\x20the\x20recipient\x20to\x20enable\x20messenger\x20once\x20from\x20their\x20own\x20account\x20(account_operation\x20with\x20messenger\x20registration)\x20on\x20this\x20network.\x203.\x20Re-send\x20AFTER\x20their\x20registration\x20—\x20until\x20then\x20the\x20thread\x20stays\x20undeliverable,\x20not\x20lost\x20(history\x20survives\x20on\x20the\x20sender\x27s\x20side).','user_prompt':'The\x20recipient\x20has\x20not\x20enabled\x20the\x20messenger\x20yet,\x20so\x20the\x20message\x20cannot\x20be\x20delivered.\x20Ask\x20them\x20to\x20enable\x20messenger\x20on\x20this\x20network\x20first,\x20then\x20re-send.\x20Retrying\x20on\x20your\x20side\x20will\x20not\x20help.'},'unknown':{'error_code':'unknown','strategy':'escalate_human','max_attempts':0x1,'automation':'manual','detail':'1.\x20Report\x20full\x20error\x20context\x20to\x20the\x20user\x202.\x20Escalate\x20to\x20human\x20intervention\x203.\x20Flag\x20for\x20error-classification\x20rule\x20addition','user_prompt':'An\x20unclassified\x20error\x20occurred.\x20Please\x20review\x20the\x20error\x20details\x20and\x20contact\x20support\x20if\x20needed.'}};const operationAttempts=new Map();function getAttemptCount(a,b){const c=operationAttempts['get'](a);if(!c)return 0x0;return c['get'](b)??0x0;}function incrementAttempt(a,b){!operationAttempts['has'](a)&&operationAttempts['set'](a,new Map());const c=operationAttempts['get'](a),d=(c['get'](b)??0x0)+0x1;return c['set'](b,d),d;}const BUDGET_EXEMPT_CODES=new Set(['guard_rejected']);function getBudgetAttempts(a){const b=operationAttempts['get'](a);if(!b)return 0x0;let c=0x0;for(const [d,e]of b){if(!BUDGET_EXEMPT_CODES['has'](d))c+=e;}return c;}export function resetAttempts(a){operationAttempts['delete'](a);}export function recover(a,b,c){const d=RECOVERY_RULES[a]??RECOVERY_RULES['unknown'],e=0x5,f=getBudgetAttempts(b),g=getAttemptCount(b,a);if(d['max_attempts']<=0x1||d['strategy']==='stop')return{'strategy':d['strategy'],'should_retry':![],'max_attempts':d['max_attempts'],'current_attempt':g,'adjusted_params':d['adjusted_params'],'user_prompt':d['user_prompt'],'detail':d['detail']};if(f>=e)return{'strategy':'stop','should_retry':![],'max_attempts':e,'current_attempt':f,'detail':'Total\x20retry\x20limit\x20('+e+')\x20reached\x20for\x20operation\x20'+b+'.\x20Escalating\x20to\x20human\x20intervention.\x20Attempts\x20recorded\x20for\x20this\x20operation\x20id:\x20'+([...(operationAttempts['get'](b)??new Map())['entries']()]['map'](([j,k])=>j+':'+k)['join'](',\x20')||'none')+'.','user_prompt':'Maximum\x20retry\x20attempts\x20reached.\x20Manual\x20intervention\x20required.'};if(g>=d['max_attempts'])return{'strategy':'escalate_human','should_retry':![],'max_attempts':d['max_attempts'],'current_attempt':g,'detail':'Per-error-code\x20retry\x20limit\x20('+d['max_attempts']+')\x20reached\x20for\x20'+a+'.\x20Escalating\x20to\x20human.','user_prompt':'Recovery\x20attempts\x20for\x20'+a+'\x20exhausted.\x20Manual\x20intervention\x20required.'};const h=incrementAttempt(b,a),i={'strategy':d['strategy'],'should_retry':d['automation']==='full'||h<d['max_attempts'],'max_attempts':d['max_attempts'],'current_attempt':h,'adjusted_params':d['adjusted_params'],'user_prompt':d['user_prompt'],'detail':d['detail']};return i['should_retry']&&c?.['retryable']===![]&&a!=='guard_rejected'&&d['strategy']!=='fill_submission'&&d['strategy']!=='query_and_retry'&&(i['should_retry']=![],i['detail']+='\x20NON-RETRYABLE\x20CLASSIFICATION:\x20retrying\x20the\x20IDENTICAL\x20call\x20fails\x20identically\x20—\x20apply\x20the\x20strategy\x20above\x20to\x20fix\x20the\x20cause,\x20then\x20submit\x20a\x20FRESH\x20call.'),i;}export function getBackoffDelay(a){return Math['pow'](0x2,a-0x1)*0x3e8;}
|