@wowok/agent-mcp 3.3.7 → 3.3.9
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/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/communication/message-cursors.d.ts +35 -0
- package/dist/communication/message-cursors.js +1 -0
- package/dist/communication/wts-attestation.d.ts +5 -0
- package/dist/communication/wts-attestation.js +1 -1
- package/dist/composition/audit.js +1 -1
- package/dist/composition/compile.d.ts +2 -2
- package/dist/composition/compile.js +1 -1
- package/dist/composition/inflight.d.ts +7 -0
- package/dist/composition/inflight.js +1 -1
- package/dist/composition/materialize.d.ts +4 -1
- package/dist/composition/materialize.js +1 -1
- package/dist/config/index.d.ts +1 -0
- package/dist/config/index.js +1 -1
- package/dist/config/store-policy.d.ts +14 -0
- package/dist/config/store-policy.js +1 -0
- package/dist/config/store-policy.spec.d.ts +1 -0
- package/dist/config/store-policy.spec.js +1 -0
- package/dist/customer/industry-risks.js +1 -1
- package/dist/customer/user-preferences.js +1 -1
- package/dist/evaluation/builtins/graph-service.spec.js +1 -1
- package/dist/evaluation/engine.js +1 -1
- package/dist/experience/realtime-feedback.js +1 -1
- package/dist/extensions/business-modules.d.ts +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/analyze.js +1 -1
- package/dist/graph/onchain/expand.js +1 -1
- package/dist/graph/onchain/exposure.js +1 -1
- package/dist/graph/onchain/facts.d.ts +1 -0
- package/dist/graph/onchain/facts.js +1 -1
- package/dist/graph/onchain/facts.spec.js +1 -1
- package/dist/harness/recover.js +1 -1
- package/dist/knowledge/acquisition-flywheel.js +1 -1
- package/dist/knowledge/allocation-ledger.d.ts +1 -0
- package/dist/knowledge/allocation-ledger.js +1 -1
- package/dist/knowledge/allocator-rail-verifier.d.ts +6 -2
- package/dist/knowledge/allocator-rail-verifier.js +1 -1
- package/dist/knowledge/arbitration-ledger.js +1 -1
- package/dist/knowledge/audit-rules.d.ts +37 -0
- package/dist/knowledge/audit-rules.js +1 -1
- package/dist/knowledge/baselines/rules/plan.json +32 -2
- package/dist/knowledge/builtin-templates.d.ts +13 -1
- package/dist/knowledge/builtin-templates.js +1 -1
- package/dist/knowledge/commission-landing.d.ts +26 -0
- package/dist/knowledge/commission-landing.js +1 -0
- package/dist/knowledge/discount-threshold.js +1 -1
- package/dist/knowledge/fund-layer.d.ts +7 -0
- package/dist/knowledge/fund-layer.js +1 -1
- package/dist/knowledge/getting-started.js +1 -1
- package/dist/knowledge/guard-design-patterns.d.ts +1 -1
- package/dist/knowledge/guard-design-patterns.js +1 -1
- package/dist/knowledge/guard-puzzle.js +1 -1
- package/dist/knowledge/guard-render.d.ts +7 -0
- package/dist/knowledge/guard-render.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-generalizer.js +1 -1
- package/dist/knowledge/industry-registry.d.ts +1 -1
- package/dist/knowledge/industry-registry.js +1 -1
- package/dist/knowledge/industry-strategy.js +1 -1
- package/dist/knowledge/jsonrpc-enum.js +1 -1
- package/dist/knowledge/machine-fork-watch.d.ts +9 -0
- package/dist/knowledge/machine-fork-watch.js +1 -0
- package/dist/knowledge/migration-preflight.js +1 -1
- package/dist/knowledge/projection.spec.js +1 -1
- package/dist/knowledge/scenario-modes.d.ts +8 -2
- package/dist/knowledge/scenario-modes.js +1 -1
- package/dist/knowledge/semantic-ir.d.ts +24 -5
- package/dist/knowledge/semantic-ir.js +1 -1
- package/dist/knowledge/service-ledger.js +1 -1
- package/dist/knowledge/strategy-manuals.js +1 -1
- package/dist/knowledge/template-index.js +1 -1
- package/dist/knowledge/template-loader.d.ts +11 -0
- package/dist/knowledge/template-loader.js +1 -1
- package/dist/knowledge/template-registry.js +1 -1
- package/dist/knowledge/template-scanner.d.ts +4 -2
- package/dist/knowledge/template-scanner.js +1 -1
- package/dist/knowledge/template-validation.js +1 -1
- package/dist/knowledge/tools-reference.js +1 -1
- package/dist/monitor/MonitorLoop.js +1 -1
- package/dist/playbooks/service-build/business-puzzle.js +1 -1
- package/dist/playbooks/service-build/machine-panorama.js +1 -1
- package/dist/playbooks/service-build/merchant-guide.d.ts +12 -6
- package/dist/playbooks/service-build/merchant-guide.js +1 -1
- package/dist/playbooks/service-build/migration-planner.d.ts +10 -2
- package/dist/playbooks/service-build/migration-planner.js +1 -1
- package/dist/playbooks/service-build/mode-actions.d.ts +1 -0
- package/dist/playbooks/service-build/mode-actions.js +1 -1
- package/dist/playbooks/service-build/object-panorama.js +1 -1
- package/dist/playbooks/service-build/participation-radar.js +1 -1
- package/dist/playbooks/service-build/relationship-profile.js +1 -1
- package/dist/playbooks/service-build/service-panorama.js +1 -1
- package/dist/playbooks/service-build/service-quote.js +1 -1
- package/dist/playbooks/service-build/service-quote.spec.js +1 -1
- package/dist/review/index.js +1 -1
- package/dist/safety/confirm-gate.js +1 -1
- package/dist/schema/benchmark-migration/index.d.ts +72 -1
- package/dist/schema/benchmark-migration/index.js +1 -1
- package/dist/schema/call/allocation.d.ts +3 -0
- package/dist/schema/call/allocation.js +1 -1
- package/dist/schema/call/base.d.ts +24 -0
- package/dist/schema/call/bridge.d.ts +6 -0
- package/dist/schema/call/error-codes.d.ts +1 -1
- package/dist/schema/call/error-codes.js +1 -1
- package/dist/schema/call/order.js +1 -1
- package/dist/schema/call/semantic.js +1 -1
- package/dist/schema/call/service.js +1 -1
- package/dist/schema/common/index.js +1 -1
- package/dist/schema/config/index.d.ts +24 -0
- package/dist/schema/config/index.js +1 -1
- package/dist/schema/goal/index.d.ts +14 -0
- package/dist/schema/goal/planning.d.ts +26 -0
- package/dist/schema/goal/planning.js +1 -1
- package/dist/schema/industry-pack/index.d.ts +9 -1
- package/dist/schema/industry-pack/modes.d.ts +9 -1
- package/dist/schema/industry-pack/modes.js +1 -1
- package/dist/schema/local/index.d.ts +60 -0
- package/dist/schema/local/index.js +1 -1
- package/dist/schema/messenger/index.d.ts +278 -1
- package/dist/schema/messenger/index.js +1 -1
- package/dist/schema/operations.d.ts +1 -0
- package/dist/schema/query/bi.d.ts +38 -0
- package/dist/schema/query/bi.js +1 -1
- package/dist/schema/query/index.d.ts +3 -0
- package/dist/schema/query/index.js +1 -1
- package/dist/schema/schema-version.js +1 -1
- package/dist/schema/service-clone/index.d.ts +17 -0
- package/dist/schema/service-clone/index.js +1 -1
- package/dist/schema-query-impl/index.js +1 -1
- package/dist/schemas/account_operation.output.json +6 -0
- package/dist/schemas/benchmark_migration_operation.output.json +254 -2
- package/dist/schemas/benchmark_migration_operation.schema.json +87 -5
- package/dist/schemas/bridge_operation.output.json +6 -0
- package/dist/schemas/config_operation.output.json +95 -0
- package/dist/schemas/config_operation.schema.json +16 -1
- package/dist/schemas/goal_operation.schema.json +22 -0
- package/dist/schemas/index.json +1 -1
- package/dist/schemas/industry_pack_operation.output.json +4 -0
- package/dist/schemas/industry_pack_operation.schema.json +40 -3
- package/dist/schemas/local_cache_operation.output.json +6 -0
- package/dist/schemas/local_history_operation.output.json +6 -0
- package/dist/schemas/local_info_operation.output.json +6 -0
- package/dist/schemas/local_mark_operation.output.json +6 -0
- package/dist/schemas/messenger_operation.output.json +609 -1
- package/dist/schemas/messenger_operation.schema.json +96 -1
- package/dist/schemas/onchain_operations.output.json +6 -0
- package/dist/schemas/onchain_operations.schema.json +334 -7
- package/dist/schemas/onchain_operations_allocation.schema.json +10 -1
- package/dist/schemas/onchain_operations_guard.schema.json +318 -0
- package/dist/schemas/onchain_operations_order.schema.json +1 -1
- package/dist/schemas/onchain_operations_service.schema.json +5 -5
- package/dist/schemas/query_toolkit.output.json +271 -8
- package/dist/schemas/service_clone_operation.output.json +79 -0
- package/dist/tools/handlers/benchmark-migration.d.ts +14 -0
- package/dist/tools/handlers/benchmark-migration.js +1 -1
- package/dist/tools/handlers/config.js +1 -1
- package/dist/tools/handlers/messenger.js +1 -1
- package/dist/tools/handlers/onchain.d.ts +19 -1
- package/dist/tools/handlers/onchain.js +1 -1
- package/dist/tools/handlers/query.d.ts +1 -0
- package/dist/tools/handlers/query.js +1 -1
- package/dist/tools/handlers/service-clone.d.ts +18 -0
- package/dist/tools/handlers/service-clone.js +1 -1
- package/dist/tools/registry/business.js +1 -1
- package/dist/tools/wrap.js +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
export const ACQUISITION_FLYWHEEL_VERSION=0x1;export const INDUSTRY_FLYWHEELS=[{'industry':'freelance','trustSellingPoints':['Delivery\x20acceptance\x20+\x20fund\x20escrow\x20+\x20arbitration\x20guarantee','Transparent\x20process:\x20Machine\x20defines\x20clear\x20delivery\x20nodes','compensation_fund\x20secures\x20customer\x20rights'],'keyActions':[{'action':'Set\x20Reward\x20first-order\x20bonus','purpose':'Attract\x20new\x20customers\x20to\x20place\x20orders','mutableField':'rewards','metricToWatch':'New\x20customer\x20order\x20rate'},{'action':'Cumulative-spend\x20tiered\x20Reward','purpose':'Incentivize\x20repurchase','mutableField':'rewards','metricToWatch':'Repurchase\x20rate'},{'action':'Adjust\x20Machine\x20nodes','purpose':'Optimize\x20delivery\x20process\x20speed','mutableField':'description','metricToWatch':'Average\x20completion\x20time'},{'action':'Increase\x20compensation_fund','purpose':'Improve\x20trust\x20score','mutableField':'compensation_fund','metricToWatch':'Trust\x20score'}],'rewardStrategy':'First-order\x20reward\x20+\x20cumulative-spend\x20tiered\x20reward\x20(e.g.\x20discount\x20after\x205\x20orders)','discountStrategy':'Monthly\x20discount\x20+\x20long-term\x20cooperation\x20discount','trustDescription':'Fund\x20escrow\x20+\x20delivery\x20acceptance\x20+\x20arbitration\x20guarantee'},{'industry':'rental','trustSellingPoints':['Deposit\x20escrow\x20+\x20damage\x20Guard\x20+\x20return\x20process','Guard\x20verifies\x20item\x20condition\x20to\x20prevent\x20disputes','compensation_fund\x20covers\x20damage\x20risk'],'keyActions':[{'action':'Set\x20Discount\x20long-term\x20rental\x20bonus','purpose':'Incentivize\x20long-term\x20rental','mutableField':'discount','metricToWatch':'Long-term\x20rental\x20ratio'},{'action':'Credit-accumulation\x20Reward','purpose':'Multi-rental\x20credit\x20accumulation','mutableField':'rewards','metricToWatch':'Re-rental\x20rate'},{'action':'Configure\x20damage\x20Guard','purpose':'Reduce\x20dispute\x20rate','mutableField':'buy_guard','metricToWatch':'Dispute\x20rate'},{'action':'Increase\x20compensation_fund','purpose':'Cover\x20damage\x20risk','mutableField':'compensation_fund','metricToWatch':'Trust\x20score'}],'rewardStrategy':'Credit\x20accumulation\x20+\x20long-term\x20rental\x20discount\x20+\x20referral\x20cashback','discountStrategy':'Monthly\x2010%\x20off\x20+\x20quarterly\x2020%\x20off\x20+\x20annual\x2030%\x20off','trustDescription':'Deposit\x20escrow\x20+\x20Guard\x20verification\x20+\x20return\x20guarantee'},{'industry':'education','trustSellingPoints':['Transparent\x20course\x20progress\x20+\x20refund\x20Guard','Machine\x20defines\x20learning\x20stages\x20and\x20acceptance\x20nodes'],'keyActions':[{'action':'Set\x20milestone\x20Reward','purpose':'Incentivize\x20course\x20completion','mutableField':'rewards','metricToWatch':'Course\x20completion\x20rate'},{'action':'Referral\x20cashback\x20Reward','purpose':'Viral\x20acquisition','mutableField':'rewards','metricToWatch':'Referral\x20rate'}],'rewardStrategy':'Milestone\x20reward\x20+\x20referral\x20cashback\x20+\x20trial-class\x20discount','discountStrategy':'Early-bird\x20price\x20+\x20group-buy\x20price\x20+\x20student-aid\x20discount','trustDescription':'Transparent\x20progress\x20+\x20refund\x20guarantee\x20+\x20acceptance\x20nodes'},{'industry':'travel','trustSellingPoints':['Itinerary\x20escrow\x20+\x20cancellation\x20Guard\x20+\x20arbitration\x20guarantee','Guard\x20verifies\x20itinerary\x20change\x20conditions'],'keyActions':[{'action':'Limited-time\x20flash-sale\x20Reward','purpose':'Clearance\x20promotion','mutableField':'rewards','metricToWatch':'Conversion\x20rate'},{'action':'Spend\x20cashback\x20Reward','purpose':'Improve\x20repurchase','mutableField':'rewards','metricToWatch':'Repurchase\x20rate'}],'rewardStrategy':'Limited-time\x20flash\x20sale\x20+\x20spend\x20cashback\x20+\x20referral\x20commission','discountStrategy':'Early-bird\x20price\x20+\x20group-buy\x20price\x20+\x20member\x20price','trustDescription':'Itinerary\x20escrow\x20+\x20cancellation\x20guarantee\x20+\x20arbitration'},{'industry':'subscription','trustSellingPoints':['Transparent\x20subscription\x20+\x20auto-renewal\x20Guard\x20+\x20cancel\x20anytime','Machine\x20defines\x20billing\x20cycles\x20and\x20auto-debit'],'keyActions':[{'action':'Loyalty\x20Reward','purpose':'Long-term\x20retention','mutableField':'rewards','metricToWatch':'Renewal\x20rate'},{'action':'Referral\x20cashback\x20Reward','purpose':'Viral\x20acquisition','mutableField':'rewards','metricToWatch':'Referral\x20rate'}],'rewardStrategy':'Loyalty\x20reward\x20+\x20referral\x20cashback\x20+\x20first-month\x20discount','discountStrategy':'Annual\x20discount\x20+\x20team\x20discount\x20+\x20upgrade\x20discount','trustDescription':'Transparent\x20subscription\x20+\x20renewal\x20guarantee\x20+\x20cancel\x20anytime'},{'industry':'retail','trustSellingPoints':['Transaction\x20escrow\x20+\x20logistics\x20Guard\x20+\x20refund\x20guarantee','Guard\x20verifies\x20shipping\x20and\x20receipt'],'keyActions':[{'action':'First-order\x20discount','purpose':'Attract\x20new\x20customers','mutableField':'discount','metricToWatch':'New\x20customer\x20order\x20rate'},{'action':'Spend\x20cashback\x20Reward','purpose':'Improve\x20repurchase','mutableField':'rewards','metricToWatch':'Repurchase\x20rate'}],'rewardStrategy':'First-order\x20discount\x20+\x20spend\x20cashback\x20+\x20spend-threshold\x20discount','discountStrategy':'Spend-threshold\x20discount\x20+\x20limited-time\x20discount\x20+\x20member\x20price','trustDescription':'Transaction\x20escrow\x20+\x20logistics\x20Guard\x20+\x20refund\x20guarantee'},{'industry':'licensing','trustSellingPoints':['License\x20terms\x20hash-anchored\x20as\x20a\x20WIP\x20object\x20—\x20the\x20grant\x20is\x20provable,\x20not\x20prose','Royalty/purchase\x20proceeds\x20split\x20on-chain\x20via\x20Allocation\x20—\x20the\x20split\x20is\x20frozen\x20at\x20publish\x20and\x20auditable\x20by\x20every\x20rights-holder','Territory\x20+\x20term\x20enforced\x20by\x20Guard\x20(allowlist\x20/\x20time-lock);\x20escrow\x20+\x20inspection\x20window\x20before\x20the\x20grant\x20is\x20final'],'keyActions':[{'action':'Anchor\x20license\x20terms\x20as\x20WIP','purpose':'Make\x20the\x20granted\x20rights\x20provable\x20in\x20a\x20dispute','mutableField':'description','metricToWatch':'Dispute\x20rate'},{'action':'Publish\x20the\x20Allocation\x20split','purpose':'Show\x20rights-holders\x20their\x20share\x20is\x20frozen\x20and\x20auditable','mutableField':'allocator','metricToWatch':'Trust\x20score'},{'action':'Configure\x20an\x20inspection-window\x20time-lock\x20Guard','purpose':'Give\x20the\x20buyer\x20a\x20verify-then-release\x20window\x20before\x20the\x20grant\x20is\x20final','mutableField':'buy_guard','metricToWatch':'Refund/dispute\x20rate'},{'action':'Increase\x20compensation_fund','purpose':'Back\x20the\x20reporting-honesty\x20promise\x20the\x20buyer\x20is\x20trusting','mutableField':'compensation_fund','metricToWatch':'Trust\x20score'}],'rewardStrategy':'Repeat-license\x20/\x20catalog-referral\x20reward;\x20early-access\x20reward\x20on\x20a\x20new\x20drop','discountStrategy':'Volume-license\x20discount\x20+\x20tiered\x20license\x20pricing\x20(basic/premium/unlimited/exclusive)','trustDescription':'Terms\x20hash-anchored\x20+\x20on-chain\x20royalty\x20split\x20+\x20territory/term\x20Guard\x20+\x20escrow\x20inspection\x20window'},{'industry':'crowdfunding','trustSellingPoints':['Each\x20contribution\x20is\x20escrowed\x20in\x20its\x20OWN\x20Allocation\x20(never\x20pooled)\x20—\x20a\x20funder\x27s\x20money\x20stays\x20attributable\x20to\x20their\x20order\x20and\x20is\x20refundable\x20to\x20them,\x20not\x20lost\x20in\x20a\x20merged\x20pot','The\x20funding\x20threshold\x20is\x20an\x20on-chain\x20aggregate\x20read\x20(a\x20shared\x20campaign\x20ledger\x20summed\x20at\x20settlement)\x20—\x20the\x20raise\x20is\x20provable,\x20and\x20the\x20deadline\x20release/refund\x20decision\x20is\x20enforced\x20by\x20Guard,\x20not\x20by\x20the\x20project\x27s\x20goodwill','Two-leg\x20escrow\x20exit:\x20on\x20deadline\x20the\x20funds\x20EITHER\x20release\x20to\x20the\x20project\x20(threshold\x20met)\x20XOR\x20refund\x20per\x20contributor\x20(threshold\x20missed)\x20—\x20never\x20both,\x20never\x20neither'],'keyActions':[{'action':'Publish\x20the\x20funding\x20threshold\x20+\x20deadline','purpose':'Make\x20the\x20all-or-nothing\x20gate\x20provable\x20so\x20funders\x20trust\x20the\x20raise\x20is\x20real','mutableField':'description','metricToWatch':'Funding\x20conversion\x20rate'},{'action':'Configure\x20the\x20two-leg\x20settlement\x20Guard\x20(release\x20XOR\x20refund)','purpose':'Guarantee\x20a\x20missed\x20campaign\x20refunds\x20every\x20contributor\x20automatically','mutableField':'allocator','metricToWatch':'Refund/dispute\x20rate'},{'action':'Set\x20an\x20early-backer\x20Reward','purpose':'Reward\x20funders\x20who\x20commit\x20before\x20the\x20deadline','mutableField':'rewards','metricToWatch':'Early-funding\x20velocity'},{'action':'Increase\x20compensation_fund','purpose':'Back\x20the\x20delivery\x20promise\x20funders\x20trust\x20after\x20a\x20successful\x20raise','mutableField':'compensation_fund','metricToWatch':'Trust\x20score'}],'rewardStrategy':'Early-backer\x20reward\x20+\x20referral\x20reward\x20(viral\x20campaign\x20sharing);\x20tiered\x20reward\x20by\x20contribution\x20level.\x20NOT\x20an\x20investment\x20return\x20—\x20never\x20promise\x20financial\x20yield\x20(L-01)','discountStrategy':'Early-bird\x20contribution\x20tier\x20+\x20group-backer\x20bundle;\x20no\x20discounting\x20that\x20implies\x20a\x20resale\x20return','trustDescription':'Per-contributor\x20escrow\x20(unpooled)\x20+\x20on-chain\x20aggregate\x20threshold\x20+\x20deadline\x20two-leg\x20release/refund\x20+\x20arbitration\x20guarantee'}];let _registryLookup=null;export function _setRegistryLookup(a){_registryLookup=a;}export function getFlywheelForIndustry(a){if(_registryLookup){const b=_registryLookup(a);if(b?.['flywheel'])return b['flywheel'];}return INDUSTRY_FLYWHEELS['find'](c=>c['industry']===a['toLowerCase']());}export function listIndustries(){return INDUSTRY_FLYWHEELS['map'](a=>a['industry']);}export function suggestAcquisitionActions(a){const b=getFlywheelForIndustry(a);return b?.['keyActions']??[];}export function generateTrustDescription(a){const b=[];if(a['industry']){const c=getFlywheelForIndustry(a['industry']);c&&b['push'](c['trustDescription']);}return a['orderCount']!==undefined&&a['orderCount']>0x0&&b['push']('Completed\x20'+a['orderCount']+'\x20orders'),a['completedRate']!==undefined&&b['push']('Completion\x20rate\x20'+Math['round'](a['completedRate']*0x64)+'%'),a['avgCompletionTime']!==undefined&&(a['avgCompletionTime']<0x1?b['push']('Average\x20completion\x20time\x20'+Math['round'](a['avgCompletionTime']*0x3c)+'\x20minutes'):b['push']('Average\x20completion\x20time\x20'+Math['round'](a['avgCompletionTime'])+'\x20hours')),a['hasCompensationFund']&&b['push']('Sufficient\x20compensation\x20fund'),a['hasArbitration']&&b['push']('Third-party\x20arbitration\x20guarantee'),a['reviewCount']!==undefined&&a['reviewCount']>0x0&&a['reviewLikeRate']!==undefined&&b['push']('Like\x20rate\x20'+Math['round'](a['reviewLikeRate']*0x64)+'%\x20('+a['reviewCount']+'\x20reviews)'),b['join'](';\x20')||'No\x20trust\x20data\x20available';}export function buildAcquisitionDashboard(a){const {orderCount:b,completedRate:c,avgCompletionTime:d,repeatCustomerRate:e,reviewLikeRate:f,reviewCount:g}=a;let h='cold_start';if(b>=0x32)h='optimization';else{if(b>=0x14)h='mature';else{if(b>=0x5)h='growing';}}const i=[];if(h==='cold_start')i['push']('Cold-start\x20stage:\x20set\x20first-order\x20Reward\x20to\x20attract\x20new\x20customers'),i['push']('Increase\x20compensation_fund\x20to\x20boost\x20initial\x20trust');else{if(h==='growing')i['push']('Growing\x20stage:\x20set\x20referral\x20cashback\x20Reward\x20for\x20viral\x20acquisition'),e!==undefined&&e<0.2&&i['push']('Repurchase\x20rate\x20is\x20low;\x20consider\x20setting\x20cumulative-spend\x20tiered\x20Reward');else h==='mature'?(f!==undefined&&f>0.8&&i['push']('High\x20like\x20rate;\x20you\x20can\x20highlight\x20trust\x20metrics\x20in\x20the\x20description'),e!==undefined&&e>0.3&&i['push']('High\x20repurchase\x20rate;\x20consider\x20setting\x20loyalty\x20Reward\x20to\x20incentivize\x20long-term\x20customers')):(i['push']('Optimization\x20stage:\x20fine-tune\x20pricing\x20and\x20Reward\x20strategies'),d!==undefined&&d>0x30&&i['push']('Completion\x20time\x20is\x20long;\x20consider\x20optimizing\x20the\x20Machine\x20process'));}return{'metrics':{'orderCount':b,'completedRate':c??0x0,'avgCompletionTime':d,'repeatCustomerRate':e,'reviewLikeRate':f,'reviewCount':g},'suggestions':i,'flywheelStage':h};}
|
|
1
|
+
export const ACQUISITION_FLYWHEEL_VERSION=0x1;export const INDUSTRY_FLYWHEELS=[{'industry':'freelance','trustSellingPoints':['Delivery\x20acceptance\x20+\x20fund\x20escrow\x20+\x20arbitration\x20guarantee','Transparent\x20process:\x20Machine\x20defines\x20clear\x20delivery\x20nodes','compensation_fund\x20secures\x20customer\x20rights'],'keyActions':[{'action':'Set\x20Reward\x20first-order\x20bonus','purpose':'Attract\x20new\x20customers\x20to\x20place\x20orders','mutableField':'rewards','metricToWatch':'New\x20customer\x20order\x20rate'},{'action':'Cumulative-spend\x20tiered\x20Reward','purpose':'Incentivize\x20repurchase','mutableField':'rewards','metricToWatch':'Repurchase\x20rate'},{'action':'Adjust\x20Machine\x20nodes','purpose':'Optimize\x20delivery\x20process\x20speed','mutableField':'description','metricToWatch':'Average\x20completion\x20time'},{'action':'Increase\x20compensation_fund','purpose':'Improve\x20trust\x20score','mutableField':'compensation_fund','metricToWatch':'Trust\x20score'}],'rewardStrategy':'First-order\x20reward\x20+\x20cumulative-spend\x20tiered\x20reward\x20(e.g.\x20discount\x20after\x205\x20orders)','discountStrategy':'Monthly\x20discount\x20+\x20long-term\x20cooperation\x20discount','trustDescription':'Fund\x20escrow\x20+\x20delivery\x20acceptance\x20+\x20arbitration\x20guarantee'},{'industry':'rental','trustSellingPoints':['Deposit\x20escrow\x20+\x20damage\x20Guard\x20+\x20return\x20process','Guard\x20verifies\x20item\x20condition\x20to\x20prevent\x20disputes','compensation_fund\x20covers\x20damage\x20risk'],'keyActions':[{'action':'Set\x20Discount\x20long-term\x20rental\x20bonus','purpose':'Incentivize\x20long-term\x20rental','mutableField':'discount','metricToWatch':'Long-term\x20rental\x20ratio'},{'action':'Credit-accumulation\x20Reward','purpose':'Multi-rental\x20credit\x20accumulation','mutableField':'rewards','metricToWatch':'Re-rental\x20rate'},{'action':'Configure\x20damage\x20Guard','purpose':'Reduce\x20dispute\x20rate','mutableField':'buy_guard','metricToWatch':'Dispute\x20rate'},{'action':'Increase\x20compensation_fund','purpose':'Cover\x20damage\x20risk','mutableField':'compensation_fund','metricToWatch':'Trust\x20score'}],'rewardStrategy':'Credit\x20accumulation\x20+\x20long-term\x20rental\x20discount\x20+\x20referral\x20cashback','discountStrategy':'Monthly\x2010%\x20off\x20+\x20quarterly\x2020%\x20off\x20+\x20annual\x2030%\x20off','trustDescription':'Deposit\x20escrow\x20+\x20Guard\x20verification\x20+\x20return\x20guarantee'},{'industry':'education','trustSellingPoints':['Transparent\x20course\x20progress\x20+\x20refund\x20Guard','Machine\x20defines\x20learning\x20stages\x20and\x20acceptance\x20nodes'],'keyActions':[{'action':'Set\x20milestone\x20Reward','purpose':'Incentivize\x20course\x20completion','mutableField':'rewards','metricToWatch':'Course\x20completion\x20rate'},{'action':'Referral\x20cashback\x20Reward','purpose':'Viral\x20acquisition','mutableField':'rewards','metricToWatch':'Referral\x20rate'}],'rewardStrategy':'Milestone\x20reward\x20+\x20referral\x20cashback\x20+\x20trial-class\x20discount','discountStrategy':'Early-bird\x20price\x20+\x20group-buy\x20price\x20+\x20student-aid\x20discount','trustDescription':'Transparent\x20progress\x20+\x20refund\x20guarantee\x20+\x20acceptance\x20nodes'},{'industry':'travel','trustSellingPoints':['Itinerary\x20escrow\x20+\x20cancellation\x20Guard\x20+\x20arbitration\x20guarantee','Guard\x20verifies\x20itinerary\x20change\x20conditions'],'keyActions':[{'action':'Limited-time\x20flash-sale\x20Reward','purpose':'Clearance\x20promotion','mutableField':'rewards','metricToWatch':'Conversion\x20rate'},{'action':'Spend\x20cashback\x20Reward','purpose':'Improve\x20repurchase','mutableField':'rewards','metricToWatch':'Repurchase\x20rate'}],'rewardStrategy':'Limited-time\x20flash\x20sale\x20+\x20spend\x20cashback\x20+\x20referral\x20commission','discountStrategy':'Early-bird\x20price\x20+\x20group-buy\x20price\x20+\x20member\x20price','trustDescription':'Itinerary\x20escrow\x20+\x20cancellation\x20guarantee\x20+\x20arbitration'},{'industry':'subscription','trustSellingPoints':['Transparent\x20subscription\x20+\x20auto-renewal\x20Guard\x20+\x20cancel\x20anytime','Machine\x20defines\x20billing\x20cycles\x20and\x20auto-debit'],'keyActions':[{'action':'Loyalty\x20Reward','purpose':'Long-term\x20retention','mutableField':'rewards','metricToWatch':'Renewal\x20rate'},{'action':'Referral\x20cashback\x20Reward','purpose':'Viral\x20acquisition','mutableField':'rewards','metricToWatch':'Referral\x20rate'}],'rewardStrategy':'Loyalty\x20reward\x20+\x20referral\x20cashback\x20+\x20first-month\x20discount','discountStrategy':'Annual\x20discount\x20+\x20team\x20discount\x20+\x20upgrade\x20discount','trustDescription':'Transparent\x20subscription\x20+\x20renewal\x20guarantee\x20+\x20cancel\x20anytime'},{'industry':'retail','trustSellingPoints':['Transaction\x20escrow\x20+\x20logistics\x20Guard\x20+\x20refund\x20guarantee','Guard\x20verifies\x20shipping\x20and\x20receipt'],'keyActions':[{'action':'First-order\x20discount','purpose':'Attract\x20new\x20customers','mutableField':'discount','metricToWatch':'New\x20customer\x20order\x20rate'},{'action':'Spend\x20cashback\x20Reward','purpose':'Improve\x20repurchase','mutableField':'rewards','metricToWatch':'Repurchase\x20rate'}],'rewardStrategy':'First-order\x20discount\x20+\x20spend\x20cashback\x20+\x20spend-threshold\x20discount','discountStrategy':'Spend-threshold\x20discount\x20+\x20limited-time\x20discount\x20+\x20member\x20price','trustDescription':'Transaction\x20escrow\x20+\x20logistics\x20Guard\x20+\x20refund\x20guarantee'},{'industry':'licensing','trustSellingPoints':['License\x20terms\x20hash-anchored\x20as\x20a\x20WIP\x20object\x20—\x20the\x20grant\x20is\x20provable,\x20not\x20prose','Royalty/purchase\x20proceeds\x20split\x20on-chain\x20via\x20Allocation\x20—\x20the\x20split\x20is\x20frozen\x20at\x20publish\x20and\x20auditable\x20by\x20every\x20rights-holder','Territory\x20+\x20term\x20enforced\x20by\x20Guard\x20(allowlist\x20/\x20time-lock);\x20escrow\x20+\x20inspection\x20window\x20before\x20the\x20grant\x20is\x20final'],'keyActions':[{'action':'Anchor\x20license\x20terms\x20as\x20WIP','purpose':'Make\x20the\x20granted\x20rights\x20provable\x20in\x20a\x20dispute','mutableField':'description','metricToWatch':'Dispute\x20rate'},{'action':'Publish\x20the\x20Allocation\x20split','purpose':'Show\x20rights-holders\x20their\x20share\x20is\x20frozen\x20and\x20auditable','mutableField':'allocator','metricToWatch':'Trust\x20score'},{'action':'Configure\x20an\x20inspection-window\x20time-lock\x20Guard','purpose':'Give\x20the\x20buyer\x20a\x20verify-then-release\x20window\x20before\x20the\x20grant\x20is\x20final','mutableField':'buy_guard','metricToWatch':'Refund/dispute\x20rate'},{'action':'Increase\x20compensation_fund','purpose':'Back\x20the\x20reporting-honesty\x20promise\x20the\x20buyer\x20is\x20trusting','mutableField':'compensation_fund','metricToWatch':'Trust\x20score'}],'rewardStrategy':'Repeat-license\x20/\x20catalog-referral\x20reward;\x20early-access\x20reward\x20on\x20a\x20new\x20drop','discountStrategy':'Volume-license\x20discount\x20+\x20tiered\x20license\x20pricing\x20(basic/premium/unlimited/exclusive)','trustDescription':'Terms\x20hash-anchored\x20+\x20on-chain\x20royalty\x20split\x20+\x20territory/term\x20Guard\x20+\x20escrow\x20inspection\x20window'},{'industry':'crowdfunding','trustSellingPoints':['Each\x20contribution\x20is\x20escrowed\x20in\x20its\x20OWN\x20Allocation\x20(never\x20pooled)\x20—\x20a\x20funder\x27s\x20money\x20stays\x20attributable\x20to\x20their\x20order\x20and\x20is\x20refundable\x20to\x20them,\x20not\x20lost\x20in\x20a\x20merged\x20pot','The\x20funding\x20threshold\x20is\x20an\x20on-chain\x20aggregate\x20read\x20(a\x20shared\x20campaign\x20ledger\x20summed\x20at\x20settlement)\x20—\x20the\x20raise\x20is\x20provable,\x20and\x20the\x20deadline\x20release/refund\x20decision\x20is\x20enforced\x20by\x20Guard,\x20not\x20by\x20the\x20project\x27s\x20goodwill','Two-leg\x20escrow\x20exit:\x20on\x20deadline\x20the\x20funds\x20EITHER\x20release\x20to\x20the\x20project\x20(threshold\x20met)\x20XOR\x20refund\x20per\x20contributor\x20(threshold\x20missed)\x20—\x20never\x20both,\x20never\x20neither'],'keyActions':[{'action':'Publish\x20the\x20funding\x20threshold\x20+\x20deadline','purpose':'Make\x20the\x20all-or-nothing\x20gate\x20provable\x20so\x20funders\x20trust\x20the\x20raise\x20is\x20real','mutableField':'description','metricToWatch':'Funding\x20conversion\x20rate'},{'action':'Configure\x20the\x20two-leg\x20settlement\x20Guard\x20(release\x20XOR\x20refund)','purpose':'Guarantee\x20a\x20missed\x20campaign\x20refunds\x20every\x20contributor\x20automatically','mutableField':'allocator','metricToWatch':'Refund/dispute\x20rate'},{'action':'Set\x20an\x20early-backer\x20Reward','purpose':'Reward\x20funders\x20who\x20commit\x20before\x20the\x20deadline','mutableField':'rewards','metricToWatch':'Early-funding\x20velocity'},{'action':'Increase\x20compensation_fund','purpose':'Back\x20the\x20delivery\x20promise\x20funders\x20trust\x20after\x20a\x20successful\x20raise','mutableField':'compensation_fund','metricToWatch':'Trust\x20score'}],'rewardStrategy':'Early-backer\x20reward\x20+\x20referral\x20reward\x20(viral\x20campaign\x20sharing);\x20tiered\x20reward\x20by\x20contribution\x20level.\x20NOT\x20an\x20investment\x20return\x20—\x20never\x20promise\x20financial\x20yield\x20(L-01)','discountStrategy':'Early-bird\x20contribution\x20tier\x20+\x20group-backer\x20bundle;\x20no\x20discounting\x20that\x20implies\x20a\x20resale\x20return','trustDescription':'Per-contributor\x20escrow\x20(unpooled)\x20+\x20on-chain\x20aggregate\x20threshold\x20+\x20deadline\x20two-leg\x20release/refund\x20+\x20arbitration\x20guarantee'},{'industry':'delivery','trustSellingPoints':['Every\x20food\x20dollar\x20is\x20escrowed\x20at\x20order\x20time\x20and\x20released\x20only\x20after\x20the\x20rider\x27s\x20delivery\x20evidence\x20passes\x20the\x20customer\x27s\x20confirmation\x20window\x20—\x20the\x20restaurant\x20cannot\x20spend\x20before\x20the\x20meal\x20arrives','Transit-loss\x20and\x20pickup\x20evidence\x20are\x20written\x20as\x20Machine\x20receipts\x20(who\x20picked\x20up,\x20when,\x20from\x20where)\x20—\x20a\x20missing\x20order\x20is\x20provable,\x20not\x20a\x20he-said-she-said','Auto-confirm\x20with\x20an\x20explicit\x20claim\x20window:\x20silence\x20after\x20delivery\x20releases\x20funds,\x20but\x20a\x20customer\x20claim\x20inside\x20the\x20window\x20still\x20reaches\x20third-party\x20arbitration'],'keyActions':[{'action':'Publish\x20the\x20commission\x20split\x20(restaurant\x20rate\x20/\x20platform\x20rate)','purpose':'Restaurants\x20trust\x20a\x20frozen\x20on-chain\x20split\x20more\x20than\x20a\x20negotiated\x20invoice','mutableField':'allocator','metricToWatch':'Restaurant\x20retention\x20rate'},{'action':'Set\x20an\x20order-frequency\x20Reward\x20(e.g.\x20every\x2010th\x20delivery\x20free\x20shipping)','purpose':'Drive\x20repurchase\x20cadence\x20—\x20the\x20core\x20economic\x20lever\x20of\x20food\x20delivery','mutableField':'rewards','metricToWatch':'Repurchase\x20rate'},{'action':'Configure\x20the\x20auto-confirm\x20+\x20claim\x20window\x20Guards','purpose':'Keep\x20settlement\x20fast\x20for\x20the\x20platform\x20while\x20preserving\x20the\x20customer\x27s\x20dispute\x20window','mutableField':'machine','metricToWatch':'Dispute\x20rate'},{'action':'Increase\x20compensation_fund','purpose':'Back\x20the\x20transit-loss\x20remedy\x20promise\x20(refund\x20or\x20re-delivery)','mutableField':'compensation_fund','metricToWatch':'Trust\x20score'}],'rewardStrategy':'Order-frequency\x20reward\x20(streak\x20/\x20every-Nth-order)\x20+\x20first-order\x20bonus;\x20rider-side\x20incentives\x20are\x20paid\x20by\x20the\x20platform\x20off-chain,\x20never\x20promised\x20from\x20the\x20escrow','discountStrategy':'First-order\x20discount\x20+\x20minimum-order\x20floor\x20+\x20peak-hour\x20surcharge;\x20coupon\x20burns\x20on\x20refund\x20(design\x20refunds\x20around\x20it)','trustDescription':'Order-time\x20escrow\x20+\x20rider\x20evidence\x20receipts\x20+\x20auto-confirm\x20with\x20claim\x20window\x20+\x20third-party\x20arbitration\x20+\x20transit-loss\x20remedy'},{'industry':'group_buy','trustSellingPoints':['The\x20group\x20threshold\x20and\x20the\x20absolute\x20cutoff\x20deadline\x20are\x20both\x20on-chain\x20Guards\x20—\x20the\x20deal\x20provably\x20happens\x20only\x20if\x20enough\x20neighbors\x20commit\x20before\x20the\x20deadline','Each\x20neighbor\x27s\x20payment\x20is\x20escrowed\x20in\x20its\x20own\x20Allocation;\x20after\x20the\x20cutoff\x20it\x20is\x20EITHER\x20released\x20to\x20the\x20group\x20leader\x20(deal\x20on)\x20XOR\x20refunded\x20per\x20buyer\x20(deal\x20off)\x20—\x20never\x20both','Unclaimed-pickup\x20expiry\x20is\x20enforced\x20by\x20a\x20time-lock\x20Guard\x20(refund\x20after\x20N\x20days\x20at\x20the\x20pickup\x20point),\x20so\x20a\x20forgotten\x20parcel\x20cannot\x20silently\x20become\x20the\x20leader\x27s\x20income'],'keyActions':[{'action':'Publish\x20the\x20group\x20threshold\x20+\x20absolute\x20cutoff\x20deadline','purpose':'Neighbors\x20trust\x20a\x20deadline\x20that\x20is\x20a\x20Guard,\x20not\x20a\x20promise','mutableField':'description','metricToWatch':'Group\x20fill\x20rate'},{'action':'Configure\x20the\x20unclaimed-expiry\x20refund\x20Guard','purpose':'Prove\x20that\x20unclaimed\x20goods\x20return\x20money\x20to\x20buyers,\x20not\x20to\x20the\x20leader','mutableField':'machine','metricToWatch':'Refund\x20rate'},{'action':'Publish\x20the\x20single-layer\x20leader\x20commission\x20as\x20an\x20on-chain\x20Allocation\x20leg','purpose':'Show\x20the\x20leader\x20earns\x20a\x20disclosed\x20rate,\x20not\x20a\x20hidden\x20markup','mutableField':'allocator','metricToWatch':'Trust\x20score'},{'action':'Pre-lock\x20a\x20delay-compensation\x20fund','purpose':'Back\x20the\x20delivery-delay\x20promise\x20that\x20community\x20groups\x20run\x20on','mutableField':'compensation_fund','metricToWatch':'Trust\x20score'}],'rewardStrategy':'Leader\x20commission\x20is\x20a\x20single\x20disclosed\x20Allocation\x20layer\x20(off-chain\x20pass-through\x20to\x20team\x20members);\x20buyer-side\x20reward\x20=\x20repeat-participation\x20streak;\x20NEVER\x20structure\x20multi-layer\x20commission\x20(headhunting/pyramid\x20exposure)','discountStrategy':'Group-size\x20tiered\x20pricing\x20(bigger\x20group\x20=\x20lower\x20unit\x20price)\x20+\x20early-bird\x20per\x20round;\x20threshold\x20math\x20must\x20stay\x20solvable\x20with\x20the\x20floor\x20price','trustDescription':'On-chain\x20group\x20threshold\x20+\x20absolute\x20deadline\x20+\x20per-buyer\x20escrow\x20(release\x20XOR\x20refund)\x20+\x20unclaimed-pickup\x20expiry\x20refund\x20+\x20single-layer\x20commission\x20disclosure'}];let _registryLookup=null;export function _setRegistryLookup(a){_registryLookup=a;}export function getFlywheelForIndustry(a){if(_registryLookup){const b=_registryLookup(a);if(b?.['flywheel'])return b['flywheel'];}return INDUSTRY_FLYWHEELS['find'](c=>c['industry']===a['toLowerCase']());}export function listIndustries(){return INDUSTRY_FLYWHEELS['map'](a=>a['industry']);}export function suggestAcquisitionActions(a){const b=getFlywheelForIndustry(a);return b?.['keyActions']??[];}export function generateTrustDescription(a){const b=[];if(a['industry']){const c=getFlywheelForIndustry(a['industry']);c&&b['push'](c['trustDescription']);}return a['orderCount']!==undefined&&a['orderCount']>0x0&&b['push']('Completed\x20'+a['orderCount']+'\x20orders'),a['completedRate']!==undefined&&b['push']('Completion\x20rate\x20'+Math['round'](a['completedRate']*0x64)+'%'),a['avgCompletionTime']!==undefined&&(a['avgCompletionTime']<0x1?b['push']('Average\x20completion\x20time\x20'+Math['round'](a['avgCompletionTime']*0x3c)+'\x20minutes'):b['push']('Average\x20completion\x20time\x20'+Math['round'](a['avgCompletionTime'])+'\x20hours')),a['hasCompensationFund']&&b['push']('Sufficient\x20compensation\x20fund'),a['hasArbitration']&&b['push']('Third-party\x20arbitration\x20guarantee'),a['reviewCount']!==undefined&&a['reviewCount']>0x0&&a['reviewLikeRate']!==undefined&&b['push']('Like\x20rate\x20'+Math['round'](a['reviewLikeRate']*0x64)+'%\x20('+a['reviewCount']+'\x20reviews)'),b['join'](';\x20')||'No\x20trust\x20data\x20available';}export function buildAcquisitionDashboard(a){const {orderCount:b,completedRate:c,avgCompletionTime:d,repeatCustomerRate:e,reviewLikeRate:f,reviewCount:g}=a;let h='cold_start';if(b>=0x32)h='optimization';else{if(b>=0x14)h='mature';else{if(b>=0x5)h='growing';}}const i=[];if(h==='cold_start')i['push']('Cold-start\x20stage:\x20set\x20first-order\x20Reward\x20to\x20attract\x20new\x20customers'),i['push']('Increase\x20compensation_fund\x20to\x20boost\x20initial\x20trust');else{if(h==='growing')i['push']('Growing\x20stage:\x20set\x20referral\x20cashback\x20Reward\x20for\x20viral\x20acquisition'),e!==undefined&&e<0.2&&i['push']('Repurchase\x20rate\x20is\x20low;\x20consider\x20setting\x20cumulative-spend\x20tiered\x20Reward');else h==='mature'?(f!==undefined&&f>0.8&&i['push']('High\x20like\x20rate;\x20you\x20can\x20highlight\x20trust\x20metrics\x20in\x20the\x20description'),e!==undefined&&e>0.3&&i['push']('High\x20repurchase\x20rate;\x20consider\x20setting\x20loyalty\x20Reward\x20to\x20incentivize\x20long-term\x20customers')):(i['push']('Optimization\x20stage:\x20fine-tune\x20pricing\x20and\x20Reward\x20strategies'),d!==undefined&&d>0x30&&i['push']('Completion\x20time\x20is\x20long;\x20consider\x20optimizing\x20the\x20Machine\x20process'));}return{'metrics':{'orderCount':b,'completedRate':c??0x0,'avgCompletionTime':d,'repeatCustomerRate':e,'reviewLikeRate':f,'reviewCount':g},'suggestions':i,'flywheelStage':h};}
|
|
@@ -46,6 +46,7 @@ export declare const ALLOCATION_ERROR_CODES: {
|
|
|
46
46
|
readonly E_ONCE_TRIGGERED: 16;
|
|
47
47
|
readonly EMIXED_RATE_BASES: 17;
|
|
48
48
|
readonly EFORMULA_SPEC_INVALID: 24;
|
|
49
|
+
readonly EEMPTY_POOL_BATCH: 26;
|
|
49
50
|
};
|
|
50
51
|
export declare const ORDER_ALLOCATION_ALREADY_SPECIFIED = "E_ALLOCATION_ALREADY_SPECIFIED";
|
|
51
52
|
export declare const ALLOCATION_SCENES: AllocationScene[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{MAX_SHARING_COUNT,MAX_ALLOCATOR_COUNT}from'@wowok/wowok';export{MAX_ALLOCATOR_COUNT};export const ALLOCATION_MAX_SHARING_COUNT=MAX_SHARING_COUNT;export const ALLOCATION_MODE_AMOUNT=0x0;export const ALLOCATION_MODE_RATE=0x1;export const ALLOCATION_MODE_SURPLUS=0x2;export const ALLOCATION_MODE_RATE_GROSS=0x3;export const ALLOCATION_MODE_FORMULA=0x4;export const RATE_TOTAL_FULL=0x2710;export const ALLOCATION_ERROR_CODES={'ERECIPIENT_IDENTIFIER_NOT_ADDRESS':0x1,'EALLOCATOR_COUNT_EXCEEDED':0x2,'ENO_ALLOCATOR':0x3,'ERATE_NOT_10000':0x4,'EMULTIPLE_SURPLUS':0x5,'ERATE_EXCEEDS_10000':0x6,'EINSUFFICIENT_BALANCE':0x7,'EALLOCATORS_EMPTY':0x8,'ENO_PAYMENT_INFO':0x9,'ESHARING_COUNT_EXCEEDED':0xa,'ESHARING_MODE_INVALID':0xb,'EAMOUNT_BELOW_THRESHOLD':0xc,'EAMOUNT_EXCEEDS_MAX':0xd,'EZERO_DISTRIBUTION':0xe,'ERECIPIENT_NOT_FOR_OBJECT':0xf,'E_ONCE_TRIGGERED':0x10,'EMIXED_RATE_BASES':0x11,'EFORMULA_SPEC_INVALID':0x18};export const ORDER_ALLOCATION_ALREADY_SPECIFIED='E_ALLOCATION_ALREADY_SPECIFIED';export const ALLOCATION_SCENES=[{'id':'allocation_standard_three_way_split','name':'Standard\x20three-way\x20split\x20(merchant\x20/\x20platform\x20/\x20logistics)','trigger_source':'service_order_allocators','distribution_strategy':'pure_rate','coin_type_note':'All\x20three\x20Treasury\x20objects\x20must\x20use\x20the\x20same\x20Coin<T>\x20type\x20as\x20the\x20Allocation','typical_allocator_count':0x1,'sharing_who_types':['Entity'],'modes_used':['Rate'],'guard_requirement':'required','non_zero_threshold':![],'uses_max':![],'common_patterns':['Single\x20Allocator,\x203\x20Rate\x20sharing\x20items,\x20sum(rates)\x20===\x2010000','Each\x20sharing.who=Entity\x20points\x20to\x20a\x20Treasury\x20address','Guard\x20verifies\x20order.service\x20binding\x20(query\x201563)\x20to\x20prevent\x20cross-project\x20bypass','Guard\x20verifies\x20progress.current_node\x20===\x20\x27Complete\x27'],'dependencies':['Service','Treasury','Guard','Order','Progress','Machine','Payment'],'key_constraints':['F-A-05:\x20sum(rates)\x20===\x2010000\x20(pure\x20Rate\x20mode)','Treasury\x20Permission\x20should\x20match\x20Service\x20Permission\x20(R-A-12)','order_allocators\x20immutable\x20after\x20Service\x20publish\x20(R-A-10)'],'recommended_templates':['T-A-02']},{'id':'allocation_merchant_full_payment','name':'Merchant\x20full\x20payment\x20(single\x20recipient,\x20100%)','trigger_source':'service_order_allocators','distribution_strategy':'pure_rate','coin_type_note':'Simplest\x20configuration\x20—\x20single\x20Treasury\x20or\x20personal\x20address','typical_allocator_count':0x1,'sharing_who_types':['Entity'],'modes_used':['Rate'],'guard_requirement':'single_relaxed','non_zero_threshold':![],'uses_max':![],'common_patterns':['Single\x20Allocator,\x201\x20Rate\x20sharing\x20=\x2010000','Guard\x20only\x20verifies\x20order\x20status\x20(no\x20complex\x20conditions)','who=Entity\x20can\x20be\x20either\x20Treasury\x20or\x20personal\x20wallet'],'dependencies':['Service','Guard','Order','Payment'],'key_constraints':['Simplest\x20allocation\x20configuration','No\x20multi-party\x20coordination\x20required'],'recommended_templates':['T-A-01']},{'id':'allocation_refund_first_surplus_to_merchant','name':'Refund\x20first\x20+\x20surplus\x20to\x20merchant\x20(Amount\x20+\x20Surplus\x20hybrid)','trigger_source':'service_order_allocators','distribution_strategy':'amount_plus_surplus','coin_type_note':'Refund\x20amount\x20must\x20match\x20Coin<T>\x20precision','typical_allocator_count':0x1,'sharing_who_types':['Entity'],'modes_used':['Amount','Surplus'],'guard_requirement':'required','non_zero_threshold':!![],'uses_max':![],'common_patterns':['Single\x20Allocator,\x202\x20sharing\x20items','sharing[0]:\x20Amount=refund_value,\x20who=Entity(customer_address)','sharing[1]:\x20Surplus,\x20who=Entity(merchant_treasury)','fix\x20=\x20refund_value\x20(cached\x20Amount\x20sum)','threshold\x20=\x20refund_value\x20(ensure\x20sufficient\x20balance\x20for\x20Amount)'],'dependencies':['Service','Treasury','Guard','Order','Payment'],'key_constraints':['F-A-04:\x20at\x20most\x201\x20Surplus\x20per\x20Allocator','F-A-07:\x20fix\x20>=\x20threshold\x20(Amount\x20sum\x20must\x20cover\x20threshold)','fix\x20must\x20precisely\x20match\x20the\x20refund\x20amount'],'recommended_templates':['T-A-03']},{'id':'allocation_treasury_personal_alternatives','name':'Treasury\x20+\x20Personal\x20alternative\x20strategies\x20(caller-specified\x20guard)','trigger_source':'service_order_allocators','distribution_strategy':'first_match_alternatives','coin_type_note':'Both\x20target\x20addresses\x20must\x20accept\x20the\x20same\x20Coin<T>','typical_allocator_count':0x2,'sharing_who_types':['Entity'],'modes_used':['Rate'],'guard_requirement':'multiple_unique','non_zero_threshold':![],'uses_max':![],'common_patterns':['2\x20Allocators,\x20each\x20with\x201\x20Rate=10000\x20sharing','Allocator[0]:\x20guard=guard_treasury,\x20who=Entity(treasury_address)','Allocator[1]:\x20guard=guard_personal,\x20who=Entity(personal_address)','Two\x20Guard\x20objects\x20must\x20be\x20different\x20addresses\x20(R-A-11)','caller-specified\x20guard:\x20caller\x20selects\x20Treasury\x20or\x20Personal\x20path\x20via\x20alloc_by_guard;\x20the\x20Passport\x20hard-verifies\x20the\x20selected\x20Guard\x20(failure\x20aborts\x20with\x20E_VERIFY_FAILED;\x20caller\x20must\x20switch\x20guard\x20and\x20retry)'],'dependencies':['Service','Treasury','Guard','Order','Payment'],'key_constraints':['F-A-14:\x20allocators[].guard\x20must\x20be\x20unique','Treasury\x20Permission\x20should\x20match\x20Service\x20Permission\x20(R-A-12)','Guard\x20A\x20and\x20Guard\x20B\x20may\x20share\x20root/table\x20but\x20must\x20differ\x20in\x20description'],'recommended_templates':['T-A-04']},{'id':'allocation_tiered_by_order_amount','name':'Tiered\x20split\x20by\x20order\x20amount\x20(multi-Allocator\x20amount-threshold\x20switch)','trigger_source':'service_order_allocators','distribution_strategy':'tiered_by_amount','coin_type_note':'Amount\x20threshold\x20uses\x20Coin<T>\x20smallest\x20unit\x20(e.g.\x20MIST\x20for\x20WOW)','typical_allocator_count':0x2,'sharing_who_types':['Entity'],'modes_used':['Rate'],'guard_requirement':'multiple_unique','non_zero_threshold':![],'uses_max':![],'common_patterns':['2\x20Allocators\x20triggered\x20by\x20mutually\x20exclusive\x20Guard\x20conditions','Allocator[0]:\x20guard\x20verifies\x20order.amount\x20<\x20threshold,\x20Rate=10000\x20to\x20merchant','Allocator[1]:\x20guard\x20verifies\x20order.amount\x20>=\x20threshold,\x20Rate=8000/2000\x20split','caller-specified\x20guard:\x20caller\x20selects\x20the\x20matching\x20Allocator\x20based\x20on\x20order\x20amount;\x20allocator\x20order\x20is\x20irrelevant','Guard\x20queries\x20order.amount\x20(query\x201561)'],'dependencies':['Service','Treasury','Guard','Order','Payment'],'key_constraints':['Guard\x20conditions\x20must\x20be\x20mutually\x20exclusive\x20(R-A-4-02\x20design\x20clarity)','Caller\x20must\x20select\x20correct\x20guard\x20based\x20on\x20order.amount\x20(no\x20auto-fallback)'],'recommended_templates':['T-A-05']},{'id':'allocation_dynamic_recipient','name':'Multi-role\x20split\x20with\x20dynamic\x20recipient\x20(GuardIdentifier)','trigger_source':'service_order_allocators','distribution_strategy':'dynamic_recipient','coin_type_note':'Passport\x20table\x20must\x20contain\x20address-typed\x20entry\x20at\x20the\x20referenced\x20identifier','typical_allocator_count':0x1,'sharing_who_types':['Entity','GuardIdentifier'],'modes_used':['Rate'],'guard_requirement':'required','non_zero_threshold':![],'uses_max':![],'common_patterns':['Single\x20Allocator,\x203\x20Rate\x20sharing\x20items','sharing[0]:\x20Rate=8000,\x20who=Entity(merchant_treasury)','sharing[1]:\x20Rate=1000,\x20who=Entity(platform_treasury)','sharing[2]:\x20Rate=1000,\x20who=GuardIdentifier(0)\x20—\x20resolves\x20from\x20Passport\x20table','Customer\x20submits\x20Passport\x20with\x20referrer\x20address\x20at\x20identifier=0'],'dependencies':['Service','Treasury','Guard','Passport','Order','Payment'],'key_constraints':['F-A-13:\x20Passport\x20table[identifier]\x20must\x20be\x20address\x20type\x20(else\x20ERECIPIENT_IDENTIFIER_NOT_ADDRESS)','Guard\x20must\x20verify\x20Passport\x20completeness','Customer\x20order\x20must\x20include\x20Passport\x20with\x20referrer\x20address'],'recommended_templates':['T-A-06']},{'id':'allocation_arbitration_fees','name':'Arbitration\x20fees\x20split\x20(arbitrator\x20/\x20platform)','trigger_source':'arbitration_fees','distribution_strategy':'pure_rate','coin_type_note':'Coin<T>\x20must\x20match\x20Arbitration\x27s\x20fee\x20Coin\x20type','typical_allocator_count':0x1,'sharing_who_types':['Entity'],'modes_used':['Rate'],'guard_requirement':'required','non_zero_threshold':![],'uses_max':![],'common_patterns':['Triggered\x20by\x20the\x20Arbitration\x20fee-allocation\x20operation\x20(permission\x20365),\x20direct\x20or\x20Passport\x20path','Single\x20Allocator,\x202\x20Rate\x20sharing\x20items:\x208000\x20arbitrator\x20/\x202000\x20platform','payment_info\x20reuses\x20Arbitration\x27s\x20payment_info','Caller\x20must\x20hold\x20ARBITRATION_FEES_ALLOC=365\x20permission'],'dependencies':['Arbitration','Treasury','Guard','Payment'],'key_constraints':['Independent\x20from\x20Service-order\x20Allocation','Requires\x20ARBITRATION_FEES_ALLOC=365\x20permission'],'recommended_templates':['T-A-08']},{'id':'allocation_refund_to_order','name':'Refund\x20Allocator\x20(100%\x20to\x20Order\x20object)','trigger_source':'service_order_allocators','distribution_strategy':'refund_to_order','coin_type_note':'who=Entity\x20must\x20be\x20the\x20Order\x20object\x20address\x20(NOT\x20a\x20personal\x20wallet)','typical_allocator_count':0x1,'sharing_who_types':['Entity'],'modes_used':['Rate'],'guard_requirement':'required','non_zero_threshold':![],'uses_max':![],'common_patterns':['Single\x20Allocator,\x201\x20Rate=10000\x20sharing','who=Entity(order_address)\x20—\x20funds\x20flow\x20back\x20to\x20Order,\x20not\x20personal\x20wallet','Guard\x20verifies\x20customer\x20refund\x20request\x20and\x20eligibility','Customer-side\x20risk\x20assessment\x20adds\x208-point\x20weight\x20(onchain_topology\x20graph\x20evaluation)'],'dependencies':['Service','Guard','Order','Payment'],'key_constraints':['who=Entity\x20MUST\x20be\x20Order\x20object\x20address\x20(not\x20personal\x20address)','Customer\x20due-diligence\x20rewards\x20this\x20configuration\x20(8-point\x20weight)','Refund\x20funds\x20return\x20to\x20Order\x20for\x20downstream\x20handling'],'recommended_templates':['T-A-07']},{'id':'allocation_max_capped_retain','name':'Max-capped\x20allocation\x20(retain\x20residual\x20balance)','trigger_source':'service_order_allocators','distribution_strategy':'max_capped','coin_type_note':'max\x20field\x20uses\x20Coin<T>\x20smallest\x20unit','typical_allocator_count':0x1,'sharing_who_types':['Entity'],'modes_used':['Amount','Rate'],'guard_requirement':'required','non_zero_threshold':!![],'uses_max':!![],'common_patterns':['Single\x20Allocator\x20with\x20max\x20field\x20set','max\x20triple\x20role:\x20Amount\x20cap\x20+\x20NET\x20Rate\x20base\x20+\x20Surplus\x20cap','Amount\x20sharing\x20consumes\x20fix;\x20NET\x20Rate\x20sharing\x20uses\x20(max\x20-\x20fix)\x20as\x20base\x20(RateGross\x20uses\x20max\x20itself)','Residual\x20balance\x20remains\x20in\x20Allocation\x20for\x20subsequent\x20alloc()\x20calls'],'dependencies':['Service','Treasury','Guard','Order','Payment'],'key_constraints':['F-A-08:\x20Amount\x20sum\x20<=\x20max\x20(EAMOUNT_EXCEEDS_MAX)','NET\x20Rate:\x20max\x20-\x20fix\x20becomes\x20the\x20base\x20(NOT\x20balance\x20-\x20fix);\x20RateGross:\x20the\x20base\x20is\x20max\x20(fix\x20not\x20removed)','Residual\x20balance\x20may\x20be\x20claimed\x20by\x20re-triggering\x20alloc()'],'recommended_templates':[]},{'id':'allocation_multi_node_trigger','name':'Multi-Machine-node\x20triggered\x20allocation\x20(Complete\x20/\x20Refund\x20/\x20Lost)','trigger_source':'service_order_allocators','distribution_strategy':'multi_node_trigger','coin_type_note':'All\x20Allocators\x20share\x20the\x20same\x20Allocation\x27s\x20Coin<T>','typical_allocator_count':0x3,'sharing_who_types':['Entity'],'modes_used':['Rate'],'guard_requirement':'multiple_unique','non_zero_threshold':![],'uses_max':![],'common_patterns':['3\x20Allocators\x20mapped\x20to\x20Machine\x20terminal\x20nodes\x20(Complete/Refund/Lost)','Each\x20Allocator\x27s\x20Guard\x20verifies\x20progress.current_node\x20==\x20<node_name>','Mutually\x20exclusive\x20Guard\x20conditions\x20(only\x20one\x20terminal\x20node\x20active\x20at\x20a\x20time)','Machine.required_allocators[]\x20describes\x20each\x20trigger_node\x20mapping'],'dependencies':['Service','Treasury','Guard','Order','Progress','Machine','Payment'],'key_constraints':['Guard\x20conditions\x20must\x20be\x20mutually\x20exclusive','Sequence-sensitive:\x20business-flow\x20order','Machine.required_allocators[trigger_node]\x20must\x20map\x20to\x20Allocator\x20indices'],'recommended_templates':[]},{'id':'allocation_standalone_periodic_split','name':'Standalone\x20periodic\x20split\x20(investment\x20dividends\x20/\x20shared\x20income)','trigger_source':'standalone','distribution_strategy':'periodic_split','coin_type_note':'Coin<T>\x20must\x20match\x20the\x20asset\x20being\x20distributed\x20(e.g.\x20profit\x20token)','typical_allocator_count':0x1,'sharing_who_types':['Entity'],'modes_used':['Rate'],'guard_requirement':'required','non_zero_threshold':![],'uses_max':![],'common_patterns':['Single\x20Allocator,\x20N\x20Rate\x20sharing\x20items,\x20sum(rates)\x20===\x2010000','Each\x20sharing.who=Entity\x20points\x20to\x20a\x20beneficiary\x20wallet\x20(not\x20Treasury)','Guard\x20verifies\x20time-based\x20trigger\x20(e.g.\x20context(Clock).timestamp\x20>=\x20next_release)\x20or\x20signer\x20authorization','User\x20calls\x20receive()\x20to\x20deposit\x20funds,\x20then\x20alloc()\x20to\x20trigger\x20distribution','No\x20Service/Order/Progress/Machine\x20context\x20required'],'dependencies':['Treasury','Guard','Payment'],'key_constraints':['F-A-05:\x20sum(rates)\x20===\x2010000\x20(pure\x20Rate\x20mode)','R-A-3-04:\x20standalone\x20mode\x20has\x20no\x20Service-layer\x20access\x20control\x20—\x20Guard\x20+\x20Passport\x20MUST\x20be\x20sufficient','Caller\x20is\x20fully\x20responsible\x20for\x20receive\x20→\x20alloc\x20lifecycle\x20(no\x20auto-trigger)','Guard\x20should\x20bind\x20Signer\x20to\x20prevent\x20unauthorized\x20alloc()\x20calls'],'recommended_templates':['T-A-09']},{'id':'allocation_standalone_vesting','name':'Standalone\x20vesting\x20release\x20(time-locked\x20multi-stage\x20unlock)','trigger_source':'standalone','distribution_strategy':'time_locked_vesting','coin_type_note':'Coin<T>\x20must\x20match\x20the\x20vested\x20asset\x20(e.g.\x20locked\x20team\x20tokens)','typical_allocator_count':0x3,'sharing_who_types':['Entity'],'modes_used':['Amount','Rate','Surplus'],'guard_requirement':'multiple_unique','non_zero_threshold':!![],'uses_max':!![],'common_patterns':['N\x20Allocators,\x20each\x20mapped\x20to\x20a\x20vesting\x20stage\x20(e.g.\x2025%\x20at\x20month\x2012,\x2025%\x20at\x20month\x2024,\x2050%\x20surplus\x20at\x20month\x2036)','Each\x20Allocator\x27s\x20Guard\x20verifies\x20context(Clock).timestamp\x20>=\x20stage_unlock_time','Amount\x20sharing\x20per\x20stage\x20with\x20max\x20field\x20capping\x20the\x20cumulative\x20release','Final\x20Allocator\x20uses\x20Surplus\x20to\x20drain\x20remaining\x20balance\x20after\x20last\x20vesting\x20stage','Mutually\x20exclusive\x20Guard\x20conditions\x20(only\x20one\x20stage\x20active\x20at\x20a\x20time,\x20based\x20on\x20timestamp)','User\x20calls\x20receive()\x20to\x20deposit\x20locked\x20tokens,\x20then\x20alloc()\x20at\x20each\x20vesting\x20milestone'],'dependencies':['Treasury','Guard','Passport','Payment'],'key_constraints':['F-A-04:\x20at\x20most\x201\x20Surplus\x20per\x20Allocator\x20(final\x20stage\x20uses\x20Surplus\x20to\x20drain\x20remainder)','F-A-08:\x20Amount\x20sum\x20<=\x20max\x20(EAMOUNT_EXCEEDS_MAX)','R-A-3-04:\x20standalone\x20mode\x20has\x20no\x20Service-layer\x20access\x20control\x20—\x20Guard\x20time-lock\x20MUST\x20be\x20enforced','Guard\x20conditions\x20must\x20be\x20mutually\x20exclusive\x20by\x20timestamp\x20(R-A-4-02)','Caller\x20must\x20wait\x20for\x20time-lock\x20expiry\x20before\x20alloc()\x20succeeds;\x20otherwise\x20alloc()\x20silently\x20returns\x20(R-A-4-01)'],'recommended_templates':['T-A-10']}];export const ALLOCATION_LEDGER_VERSION='1.0.0';export function getScenesByTriggerSource(a){return ALLOCATION_SCENES['filter'](b=>b['trigger_source']===a);}export function getScenesByMode(a){return ALLOCATION_SCENES['filter'](b=>b['modes_used']['includes'](a));}export function getScenesByStrategy(a){return ALLOCATION_SCENES['filter'](b=>b['distribution_strategy']===a);}export function findSceneById(a){return ALLOCATION_SCENES['find'](b=>b['id']===a);}export function inferSceneFromIntent(a){const b=a['toLowerCase']();if(b['includes']('arbitration')||b['includes']('fees\x20alloc'))return findSceneById('allocation_arbitration_fees');if(b['includes']('standalone')||b['includes']('periodic\x20split')||b['includes']('investment\x20dividend')||b['includes']('shared\x20income')||b['includes']('dividend'))return findSceneById('allocation_standalone_periodic_split');if(b['includes']('vesting')||b['includes']('time-lock')||b['includes']('unlock\x20period')||b['includes']('locked\x20release')||b['includes']('token\x20unlock'))return findSceneById('allocation_standalone_vesting');if(b['includes']('refund')){if(b['includes']('order')||b['includes']('100%'))return findSceneById('allocation_refund_to_order');if(b['includes']('surplus')||b['includes']('merchant'))return findSceneById('allocation_refund_first_surplus_to_merchant');}if(b['includes']('alternative')||b['includes']('priority')||b['includes']('treasury')&&b['includes']('personal'))return findSceneById('allocation_treasury_personal_alternatives');if(b['includes']('tiered')||b['includes']('threshold\x20switch'))return findSceneById('allocation_tiered_by_order_amount');if(b['includes']('dynamic\x20recipient')||b['includes']('referrer')||b['includes']('guardidentifier'))return findSceneById('allocation_dynamic_recipient');if(b['includes']('retain')||b['includes']('max'))return findSceneById('allocation_max_capped_retain');if(b['includes']('multi-node')||b['includes']('multi\x20machine')||b['includes']('multi_node'))return findSceneById('allocation_multi_node_trigger');const c=(a['match'](/%/g)||[])['length'];if(c<=0x1)return findSceneById('allocation_merchant_full_payment');if(c>=0x2)return findSceneById('allocation_standard_three_way_split');return undefined;}export function getAllScenes(){return[...ALLOCATION_SCENES];}export function getScenesCount(){return ALLOCATION_SCENES['length'];}export function allocationModeToNumber(a){switch(a){case'Amount':return ALLOCATION_MODE_AMOUNT;case'Rate':return ALLOCATION_MODE_RATE;case'Surplus':return ALLOCATION_MODE_SURPLUS;case'RateGross':return ALLOCATION_MODE_RATE_GROSS;case'Formula':return ALLOCATION_MODE_FORMULA;}}export function allocationModeFromNumber(a){switch(a){case ALLOCATION_MODE_AMOUNT:return'Amount';case ALLOCATION_MODE_RATE:return'Rate';case ALLOCATION_MODE_SURPLUS:return'Surplus';case ALLOCATION_MODE_RATE_GROSS:return'RateGross';case ALLOCATION_MODE_FORMULA:return'Formula';default:throw new Error('Invalid\x20AllocationMode\x20number:\x20'+a);}}export function getRecipientType(a){if('GuardIdentifier'in a)return'GuardIdentifier';if('Entity'in a)return'Entity';return'Signer';}export function isSignerRecipient(a){return'Signer'in a;}export function isEntityRecipient(a){return'Entity'in a;}export function isGuardIdentifierRecipient(a){return'GuardIdentifier'in a;}export function getErrorName(a){for(const [b,d]of Object['entries'](ALLOCATION_ERROR_CODES)){if(d===a)return b;}return undefined;}export function getErrorDescription(a){const b={0x1:'GuardIdentifier\x20resolved\x20value\x20is\x20not\x20an\x20address\x20type',0x2:'Allocator\x20count\x20exceeds\x20MAX_ALLOCATOR_COUNT\x20(100)',0x3:'No\x20Allocator\x20in\x20the\x20allocators\x20vector',0x4:'Pure\x20Rate\x20mode\x20sum\x20!=\x2010000\x20(no\x20Surplus\x20to\x20absorb\x20remainder)',0x5:'Multiple\x20Surplus\x20sharing\x20in\x20a\x20single\x20Allocator',0x6:'Rate\x20+\x20Surplus\x20sum\x20>\x2010000',0x7:'balance\x20<\x20threshold\x20(insufficient\x20balance\x20to\x20trigger\x20alloc)',0x8:'allocators.allocators\x20is\x20empty',0x9:'payment_info\x20is\x20None\x20when\x20alloc()\x20is\x20called',0xa:'sharing\x20count\x20exceeds\x20MAX_SHARING_COUNT\x20(100)',0xb:'sharing\x20mode\x20is\x20not\x200\x20(Amount)\x20/\x201\x20(Rate)\x20/\x202\x20(Surplus)\x20/\x203\x20(RateGross)\x20/\x204\x20(Formula)',0xc:'Amount\x20sum\x20(fix)\x20<\x20threshold',0xd:'Amount\x20sum\x20(fix)\x20>\x20max',0xe:'distribution\x20computes\x20to\x20zero\x20while\x20the\x20pool\x20still\x20holds\x20funds\x20(or\x20balance\x20is\x200)',0xf:'GuardIdentifier\x20recipient\x20address\x20!=\x20payment_info.for_object\x20anchor\x20(abort\x20fires\x20only\x20when\x20a\x20for_object\x20binding\x20is\x20declared)',0x10:'once-trigger\x20key\x20already\x20consumed\x20—\x20the\x20guard\x20submitted\x20the\x20reserved\x20identifier\x20255\x20and\x20its\x20raw\x20submission\x20bytes\x20were\x20recorded\x20as\x20a\x20(guard,\x20allocator\x20index,\x20raw\x20bytes)\x20dynamic-field\x20key\x20on\x20this\x20Allocation',0x11:'mixed\x20rate\x20bases\x20—\x20one\x20allocator\x20carries\x20both\x20NET\x20Rate\x20and\x20RateGross\x20entries\x20while\x20a\x20fixed\x20Amount\x20total\x20is\x20present\x20(rejected\x20only\x20when\x20fix\x20>\x200;\x20with\x20fix\x20==\x200\x20the\x20two\x20bases\x20coincide\x20and\x20mixing\x20is\x20allowed)',0x12:'RateGross\x20+\x20fixed\x20Amount\x20without\x20a\x20max\x20cap\x20—\x20plan\x20payability\x20unprovable\x20at\x20declaration\x20time',0x13:'guard\x20not\x20bound\x20to\x20any\x20allocator\x20on\x20this\x20Allocation\x20(was\x20a\x20silent\x20no-op\x20success\x20before)',0x14:'allocator\x20append\x20rejected:\x20new\x20Allocators\x20is\x20not\x20a\x20pure\x20extension\x20(prefix/threshold\x20changed)',0x15:'once-for-object\x20slot\x20(identifier\x20254)\x20armed\x20but\x20payment_info\x20declares\x20no\x20for_object\x20binding',0x18:'FormulaSpec\x20rejected:\x20selector\x20is\x20not\x20COUNT(0)/SUM(1),\x20allocator/slot\x20index\x20out\x20of\x20range,\x20or\x20the\x20target\x20sharing\x20slot\x20is\x20not\x20a\x20Formula\x20(mode\x204)\x20leg'};return b[a];}
|
|
1
|
+
import{MAX_SHARING_COUNT,MAX_ALLOCATOR_COUNT}from'@wowok/wowok';export{MAX_ALLOCATOR_COUNT};export const ALLOCATION_MAX_SHARING_COUNT=MAX_SHARING_COUNT;export const ALLOCATION_MODE_AMOUNT=0x0;export const ALLOCATION_MODE_RATE=0x1;export const ALLOCATION_MODE_SURPLUS=0x2;export const ALLOCATION_MODE_RATE_GROSS=0x3;export const ALLOCATION_MODE_FORMULA=0x4;export const RATE_TOTAL_FULL=0x2710;export const ALLOCATION_ERROR_CODES={'ERECIPIENT_IDENTIFIER_NOT_ADDRESS':0x1,'EALLOCATOR_COUNT_EXCEEDED':0x2,'ENO_ALLOCATOR':0x3,'ERATE_NOT_10000':0x4,'EMULTIPLE_SURPLUS':0x5,'ERATE_EXCEEDS_10000':0x6,'EINSUFFICIENT_BALANCE':0x7,'EALLOCATORS_EMPTY':0x8,'ENO_PAYMENT_INFO':0x9,'ESHARING_COUNT_EXCEEDED':0xa,'ESHARING_MODE_INVALID':0xb,'EAMOUNT_BELOW_THRESHOLD':0xc,'EAMOUNT_EXCEEDS_MAX':0xd,'EZERO_DISTRIBUTION':0xe,'ERECIPIENT_NOT_FOR_OBJECT':0xf,'E_ONCE_TRIGGERED':0x10,'EMIXED_RATE_BASES':0x11,'EFORMULA_SPEC_INVALID':0x18,'EEMPTY_POOL_BATCH':0x1a};export const ORDER_ALLOCATION_ALREADY_SPECIFIED='E_ALLOCATION_ALREADY_SPECIFIED';export const ALLOCATION_SCENES=[{'id':'allocation_standard_three_way_split','name':'Standard\x20three-way\x20split\x20(merchant\x20/\x20platform\x20/\x20logistics)','trigger_source':'service_order_allocators','distribution_strategy':'pure_rate','coin_type_note':'All\x20three\x20Treasury\x20objects\x20must\x20use\x20the\x20same\x20Coin<T>\x20type\x20as\x20the\x20Allocation','typical_allocator_count':0x1,'sharing_who_types':['Entity'],'modes_used':['Rate'],'guard_requirement':'required','non_zero_threshold':![],'uses_max':![],'common_patterns':['Single\x20Allocator,\x203\x20Rate\x20sharing\x20items,\x20sum(rates)\x20===\x2010000','Each\x20sharing.who=Entity\x20points\x20to\x20a\x20Treasury\x20address','Guard\x20verifies\x20order.service\x20binding\x20(query\x201563)\x20to\x20prevent\x20cross-project\x20bypass','Guard\x20verifies\x20progress.current_node\x20===\x20\x27Complete\x27'],'dependencies':['Service','Treasury','Guard','Order','Progress','Machine','Payment'],'key_constraints':['F-A-05:\x20sum(rates)\x20===\x2010000\x20(pure\x20Rate\x20mode)','Treasury\x20Permission\x20should\x20match\x20Service\x20Permission\x20(R-A-12)','order_allocators\x20immutable\x20after\x20Service\x20publish\x20(R-A-10)'],'recommended_templates':['T-A-02']},{'id':'allocation_merchant_full_payment','name':'Merchant\x20full\x20payment\x20(single\x20recipient,\x20100%)','trigger_source':'service_order_allocators','distribution_strategy':'pure_rate','coin_type_note':'Simplest\x20configuration\x20—\x20single\x20Treasury\x20or\x20personal\x20address','typical_allocator_count':0x1,'sharing_who_types':['Entity'],'modes_used':['Rate'],'guard_requirement':'single_relaxed','non_zero_threshold':![],'uses_max':![],'common_patterns':['Single\x20Allocator,\x201\x20Rate\x20sharing\x20=\x2010000','Guard\x20only\x20verifies\x20order\x20status\x20(no\x20complex\x20conditions)','who=Entity\x20can\x20be\x20either\x20Treasury\x20or\x20personal\x20wallet'],'dependencies':['Service','Guard','Order','Payment'],'key_constraints':['Simplest\x20allocation\x20configuration','No\x20multi-party\x20coordination\x20required'],'recommended_templates':['T-A-01']},{'id':'allocation_refund_first_surplus_to_merchant','name':'Refund\x20first\x20+\x20surplus\x20to\x20merchant\x20(Amount\x20+\x20Surplus\x20hybrid)','trigger_source':'service_order_allocators','distribution_strategy':'amount_plus_surplus','coin_type_note':'Refund\x20amount\x20must\x20match\x20Coin<T>\x20precision','typical_allocator_count':0x1,'sharing_who_types':['Entity'],'modes_used':['Amount','Surplus'],'guard_requirement':'required','non_zero_threshold':!![],'uses_max':![],'common_patterns':['Single\x20Allocator,\x202\x20sharing\x20items','sharing[0]:\x20Amount=refund_value,\x20who=Entity(customer_address)','sharing[1]:\x20Surplus,\x20who=Entity(merchant_treasury)','fix\x20=\x20refund_value\x20(cached\x20Amount\x20sum)','threshold\x20=\x20refund_value\x20(ensure\x20sufficient\x20balance\x20for\x20Amount)'],'dependencies':['Service','Treasury','Guard','Order','Payment'],'key_constraints':['F-A-04:\x20at\x20most\x201\x20Surplus\x20per\x20Allocator','F-A-07:\x20fix\x20>=\x20threshold\x20(Amount\x20sum\x20must\x20cover\x20threshold)','fix\x20must\x20precisely\x20match\x20the\x20refund\x20amount'],'recommended_templates':['T-A-03']},{'id':'allocation_treasury_personal_alternatives','name':'Treasury\x20+\x20Personal\x20alternative\x20strategies\x20(caller-specified\x20guard)','trigger_source':'service_order_allocators','distribution_strategy':'first_match_alternatives','coin_type_note':'Both\x20target\x20addresses\x20must\x20accept\x20the\x20same\x20Coin<T>','typical_allocator_count':0x2,'sharing_who_types':['Entity'],'modes_used':['Rate'],'guard_requirement':'multiple_unique','non_zero_threshold':![],'uses_max':![],'common_patterns':['2\x20Allocators,\x20each\x20with\x201\x20Rate=10000\x20sharing','Allocator[0]:\x20guard=guard_treasury,\x20who=Entity(treasury_address)','Allocator[1]:\x20guard=guard_personal,\x20who=Entity(personal_address)','Two\x20Guard\x20objects\x20must\x20be\x20different\x20addresses\x20(R-A-11)','caller-specified\x20guard:\x20caller\x20selects\x20Treasury\x20or\x20Personal\x20path\x20via\x20alloc_by_guard;\x20the\x20Passport\x20hard-verifies\x20the\x20selected\x20Guard\x20(failure\x20aborts\x20with\x20E_VERIFY_FAILED;\x20caller\x20must\x20switch\x20guard\x20and\x20retry)'],'dependencies':['Service','Treasury','Guard','Order','Payment'],'key_constraints':['F-A-14:\x20allocators[].guard\x20must\x20be\x20unique','Treasury\x20Permission\x20should\x20match\x20Service\x20Permission\x20(R-A-12)','Guard\x20A\x20and\x20Guard\x20B\x20may\x20share\x20root/table\x20but\x20must\x20differ\x20in\x20description'],'recommended_templates':['T-A-04']},{'id':'allocation_tiered_by_order_amount','name':'Tiered\x20split\x20by\x20order\x20amount\x20(multi-Allocator\x20amount-threshold\x20switch)','trigger_source':'service_order_allocators','distribution_strategy':'tiered_by_amount','coin_type_note':'Amount\x20threshold\x20uses\x20Coin<T>\x20smallest\x20unit\x20(e.g.\x20MIST\x20for\x20WOW)','typical_allocator_count':0x2,'sharing_who_types':['Entity'],'modes_used':['Rate'],'guard_requirement':'multiple_unique','non_zero_threshold':![],'uses_max':![],'common_patterns':['2\x20Allocators\x20triggered\x20by\x20mutually\x20exclusive\x20Guard\x20conditions','Allocator[0]:\x20guard\x20verifies\x20order.amount\x20<\x20threshold,\x20Rate=10000\x20to\x20merchant','Allocator[1]:\x20guard\x20verifies\x20order.amount\x20>=\x20threshold,\x20Rate=8000/2000\x20split','caller-specified\x20guard:\x20caller\x20selects\x20the\x20matching\x20Allocator\x20based\x20on\x20order\x20amount;\x20allocator\x20order\x20is\x20irrelevant','Guard\x20queries\x20order.amount\x20(query\x201561)'],'dependencies':['Service','Treasury','Guard','Order','Payment'],'key_constraints':['Guard\x20conditions\x20must\x20be\x20mutually\x20exclusive\x20(R-A-4-02\x20design\x20clarity)','Caller\x20must\x20select\x20correct\x20guard\x20based\x20on\x20order.amount\x20(no\x20auto-fallback)'],'recommended_templates':['T-A-05']},{'id':'allocation_dynamic_recipient','name':'Multi-role\x20split\x20with\x20dynamic\x20recipient\x20(GuardIdentifier)','trigger_source':'service_order_allocators','distribution_strategy':'dynamic_recipient','coin_type_note':'Passport\x20table\x20must\x20contain\x20address-typed\x20entry\x20at\x20the\x20referenced\x20identifier','typical_allocator_count':0x1,'sharing_who_types':['Entity','GuardIdentifier'],'modes_used':['Rate'],'guard_requirement':'required','non_zero_threshold':![],'uses_max':![],'common_patterns':['Single\x20Allocator,\x203\x20Rate\x20sharing\x20items','sharing[0]:\x20Rate=8000,\x20who=Entity(merchant_treasury)','sharing[1]:\x20Rate=1000,\x20who=Entity(platform_treasury)','sharing[2]:\x20Rate=1000,\x20who=GuardIdentifier(0)\x20—\x20resolves\x20from\x20Passport\x20table','Customer\x20submits\x20Passport\x20with\x20referrer\x20address\x20at\x20identifier=0'],'dependencies':['Service','Treasury','Guard','Passport','Order','Payment'],'key_constraints':['F-A-13:\x20Passport\x20table[identifier]\x20must\x20be\x20address\x20type\x20(else\x20ERECIPIENT_IDENTIFIER_NOT_ADDRESS)','Guard\x20must\x20verify\x20Passport\x20completeness','Customer\x20order\x20must\x20include\x20Passport\x20with\x20referrer\x20address'],'recommended_templates':['T-A-06']},{'id':'allocation_arbitration_fees','name':'Arbitration\x20fees\x20split\x20(arbitrator\x20/\x20platform)','trigger_source':'arbitration_fees','distribution_strategy':'pure_rate','coin_type_note':'Coin<T>\x20must\x20match\x20Arbitration\x27s\x20fee\x20Coin\x20type','typical_allocator_count':0x1,'sharing_who_types':['Entity'],'modes_used':['Rate'],'guard_requirement':'required','non_zero_threshold':![],'uses_max':![],'common_patterns':['Triggered\x20by\x20the\x20Arbitration\x20fee-allocation\x20operation\x20(permission\x20365),\x20direct\x20or\x20Passport\x20path','Single\x20Allocator,\x202\x20Rate\x20sharing\x20items:\x208000\x20arbitrator\x20/\x202000\x20platform','payment_info\x20reuses\x20Arbitration\x27s\x20payment_info','Caller\x20must\x20hold\x20ARBITRATION_FEES_ALLOC=365\x20permission'],'dependencies':['Arbitration','Treasury','Guard','Payment'],'key_constraints':['Independent\x20from\x20Service-order\x20Allocation','Requires\x20ARBITRATION_FEES_ALLOC=365\x20permission'],'recommended_templates':['T-A-08']},{'id':'allocation_refund_to_order','name':'Refund\x20Allocator\x20(100%\x20to\x20Order\x20object)','trigger_source':'service_order_allocators','distribution_strategy':'refund_to_order','coin_type_note':'who=Entity\x20must\x20be\x20the\x20Order\x20object\x20address\x20(NOT\x20a\x20personal\x20wallet)','typical_allocator_count':0x1,'sharing_who_types':['Entity'],'modes_used':['Rate'],'guard_requirement':'required','non_zero_threshold':![],'uses_max':![],'common_patterns':['Single\x20Allocator,\x201\x20Rate=10000\x20sharing','who=Entity(order_address)\x20—\x20funds\x20flow\x20back\x20to\x20Order,\x20not\x20personal\x20wallet','Guard\x20verifies\x20customer\x20refund\x20request\x20and\x20eligibility','Customer-side\x20risk\x20assessment\x20adds\x208-point\x20weight\x20(onchain_topology\x20graph\x20evaluation)'],'dependencies':['Service','Guard','Order','Payment'],'key_constraints':['who=Entity\x20MUST\x20be\x20Order\x20object\x20address\x20(not\x20personal\x20address)','Customer\x20due-diligence\x20rewards\x20this\x20configuration\x20(8-point\x20weight)','Refund\x20funds\x20return\x20to\x20Order\x20for\x20downstream\x20handling'],'recommended_templates':['T-A-07']},{'id':'allocation_max_capped_retain','name':'Max-capped\x20allocation\x20(retain\x20residual\x20balance)','trigger_source':'service_order_allocators','distribution_strategy':'max_capped','coin_type_note':'max\x20field\x20uses\x20Coin<T>\x20smallest\x20unit','typical_allocator_count':0x1,'sharing_who_types':['Entity'],'modes_used':['Amount','Rate'],'guard_requirement':'required','non_zero_threshold':!![],'uses_max':!![],'common_patterns':['Single\x20Allocator\x20with\x20max\x20field\x20set','max\x20triple\x20role:\x20Amount\x20cap\x20+\x20NET\x20Rate\x20base\x20+\x20Surplus\x20cap','Amount\x20sharing\x20consumes\x20fix;\x20NET\x20Rate\x20sharing\x20uses\x20(max\x20-\x20fix)\x20as\x20base\x20(RateGross\x20uses\x20max\x20itself)','Residual\x20balance\x20remains\x20in\x20Allocation\x20for\x20subsequent\x20alloc()\x20calls'],'dependencies':['Service','Treasury','Guard','Order','Payment'],'key_constraints':['F-A-08:\x20Amount\x20sum\x20<=\x20max\x20(EAMOUNT_EXCEEDS_MAX)','NET\x20Rate:\x20max\x20-\x20fix\x20becomes\x20the\x20base\x20(NOT\x20balance\x20-\x20fix);\x20RateGross:\x20the\x20base\x20is\x20max\x20(fix\x20not\x20removed)','Residual\x20balance\x20may\x20be\x20claimed\x20by\x20re-triggering\x20alloc()'],'recommended_templates':[]},{'id':'allocation_multi_node_trigger','name':'Multi-Machine-node\x20triggered\x20allocation\x20(Complete\x20/\x20Refund\x20/\x20Lost)','trigger_source':'service_order_allocators','distribution_strategy':'multi_node_trigger','coin_type_note':'All\x20Allocators\x20share\x20the\x20same\x20Allocation\x27s\x20Coin<T>','typical_allocator_count':0x3,'sharing_who_types':['Entity'],'modes_used':['Rate'],'guard_requirement':'multiple_unique','non_zero_threshold':![],'uses_max':![],'common_patterns':['3\x20Allocators\x20mapped\x20to\x20Machine\x20terminal\x20nodes\x20(Complete/Refund/Lost)','Each\x20Allocator\x27s\x20Guard\x20verifies\x20progress.current_node\x20==\x20<node_name>','Mutually\x20exclusive\x20Guard\x20conditions\x20(only\x20one\x20terminal\x20node\x20active\x20at\x20a\x20time)','Machine.required_allocators[]\x20describes\x20each\x20trigger_node\x20mapping'],'dependencies':['Service','Treasury','Guard','Order','Progress','Machine','Payment'],'key_constraints':['Guard\x20conditions\x20must\x20be\x20mutually\x20exclusive','Sequence-sensitive:\x20business-flow\x20order','Machine.required_allocators[trigger_node]\x20must\x20map\x20to\x20Allocator\x20indices'],'recommended_templates':[]},{'id':'allocation_standalone_periodic_split','name':'Standalone\x20periodic\x20split\x20(investment\x20dividends\x20/\x20shared\x20income)','trigger_source':'standalone','distribution_strategy':'periodic_split','coin_type_note':'Coin<T>\x20must\x20match\x20the\x20asset\x20being\x20distributed\x20(e.g.\x20profit\x20token)','typical_allocator_count':0x1,'sharing_who_types':['Entity'],'modes_used':['Rate'],'guard_requirement':'required','non_zero_threshold':![],'uses_max':![],'common_patterns':['Single\x20Allocator,\x20N\x20Rate\x20sharing\x20items,\x20sum(rates)\x20===\x2010000','Each\x20sharing.who=Entity\x20points\x20to\x20a\x20beneficiary\x20wallet\x20(not\x20Treasury)','Guard\x20verifies\x20time-based\x20trigger\x20(e.g.\x20context(Clock).timestamp\x20>=\x20next_release)\x20or\x20signer\x20authorization','User\x20calls\x20receive()\x20to\x20deposit\x20funds,\x20then\x20alloc()\x20to\x20trigger\x20distribution','No\x20Service/Order/Progress/Machine\x20context\x20required'],'dependencies':['Treasury','Guard','Payment'],'key_constraints':['F-A-05:\x20sum(rates)\x20===\x2010000\x20(pure\x20Rate\x20mode)','R-A-3-04:\x20standalone\x20mode\x20has\x20no\x20Service-layer\x20access\x20control\x20—\x20Guard\x20+\x20Passport\x20MUST\x20be\x20sufficient','Caller\x20is\x20fully\x20responsible\x20for\x20receive\x20→\x20alloc\x20lifecycle\x20(no\x20auto-trigger)','Guard\x20should\x20bind\x20Signer\x20to\x20prevent\x20unauthorized\x20alloc()\x20calls'],'recommended_templates':['T-A-09']},{'id':'allocation_standalone_vesting','name':'Standalone\x20vesting\x20release\x20(time-locked\x20multi-stage\x20unlock)','trigger_source':'standalone','distribution_strategy':'time_locked_vesting','coin_type_note':'Coin<T>\x20must\x20match\x20the\x20vested\x20asset\x20(e.g.\x20locked\x20team\x20tokens)','typical_allocator_count':0x3,'sharing_who_types':['Entity'],'modes_used':['Amount','Rate','Surplus'],'guard_requirement':'multiple_unique','non_zero_threshold':!![],'uses_max':!![],'common_patterns':['N\x20Allocators,\x20each\x20mapped\x20to\x20a\x20vesting\x20stage\x20(e.g.\x2025%\x20at\x20month\x2012,\x2025%\x20at\x20month\x2024,\x2050%\x20surplus\x20at\x20month\x2036)','Each\x20Allocator\x27s\x20Guard\x20verifies\x20context(Clock).timestamp\x20>=\x20stage_unlock_time','Amount\x20sharing\x20per\x20stage\x20with\x20max\x20field\x20capping\x20the\x20cumulative\x20release','Final\x20Allocator\x20uses\x20Surplus\x20to\x20drain\x20remaining\x20balance\x20after\x20last\x20vesting\x20stage','Mutually\x20exclusive\x20Guard\x20conditions\x20(only\x20one\x20stage\x20active\x20at\x20a\x20time,\x20based\x20on\x20timestamp)','User\x20calls\x20receive()\x20to\x20deposit\x20locked\x20tokens,\x20then\x20alloc()\x20at\x20each\x20vesting\x20milestone'],'dependencies':['Treasury','Guard','Passport','Payment'],'key_constraints':['F-A-04:\x20at\x20most\x201\x20Surplus\x20per\x20Allocator\x20(final\x20stage\x20uses\x20Surplus\x20to\x20drain\x20remainder)','F-A-08:\x20Amount\x20sum\x20<=\x20max\x20(EAMOUNT_EXCEEDS_MAX)','R-A-3-04:\x20standalone\x20mode\x20has\x20no\x20Service-layer\x20access\x20control\x20—\x20Guard\x20time-lock\x20MUST\x20be\x20enforced','Guard\x20conditions\x20must\x20be\x20mutually\x20exclusive\x20by\x20timestamp\x20(R-A-4-02)','Caller\x20must\x20wait\x20for\x20time-lock\x20expiry\x20before\x20alloc()\x20succeeds;\x20otherwise\x20alloc()\x20silently\x20returns\x20(R-A-4-01)'],'recommended_templates':['T-A-10']}];export const ALLOCATION_LEDGER_VERSION='1.0.0';export function getScenesByTriggerSource(a){return ALLOCATION_SCENES['filter'](b=>b['trigger_source']===a);}export function getScenesByMode(a){return ALLOCATION_SCENES['filter'](b=>b['modes_used']['includes'](a));}export function getScenesByStrategy(a){return ALLOCATION_SCENES['filter'](b=>b['distribution_strategy']===a);}export function findSceneById(a){return ALLOCATION_SCENES['find'](b=>b['id']===a);}export function inferSceneFromIntent(a){const b=a['toLowerCase']();if(b['includes']('arbitration')||b['includes']('fees\x20alloc'))return findSceneById('allocation_arbitration_fees');if(b['includes']('standalone')||b['includes']('periodic\x20split')||b['includes']('investment\x20dividend')||b['includes']('shared\x20income')||b['includes']('dividend'))return findSceneById('allocation_standalone_periodic_split');if(b['includes']('vesting')||b['includes']('time-lock')||b['includes']('unlock\x20period')||b['includes']('locked\x20release')||b['includes']('token\x20unlock'))return findSceneById('allocation_standalone_vesting');if(b['includes']('refund')){if(b['includes']('order')||b['includes']('100%'))return findSceneById('allocation_refund_to_order');if(b['includes']('surplus')||b['includes']('merchant'))return findSceneById('allocation_refund_first_surplus_to_merchant');}if(b['includes']('alternative')||b['includes']('priority')||b['includes']('treasury')&&b['includes']('personal'))return findSceneById('allocation_treasury_personal_alternatives');if(b['includes']('tiered')||b['includes']('threshold\x20switch'))return findSceneById('allocation_tiered_by_order_amount');if(b['includes']('dynamic\x20recipient')||b['includes']('referrer')||b['includes']('guardidentifier'))return findSceneById('allocation_dynamic_recipient');if(b['includes']('retain')||b['includes']('max'))return findSceneById('allocation_max_capped_retain');if(b['includes']('multi-node')||b['includes']('multi\x20machine')||b['includes']('multi_node'))return findSceneById('allocation_multi_node_trigger');const c=(a['match'](/%/g)||[])['length'];if(c<=0x1)return findSceneById('allocation_merchant_full_payment');if(c>=0x2)return findSceneById('allocation_standard_three_way_split');return undefined;}export function getAllScenes(){return[...ALLOCATION_SCENES];}export function getScenesCount(){return ALLOCATION_SCENES['length'];}export function allocationModeToNumber(a){switch(a){case'Amount':return ALLOCATION_MODE_AMOUNT;case'Rate':return ALLOCATION_MODE_RATE;case'Surplus':return ALLOCATION_MODE_SURPLUS;case'RateGross':return ALLOCATION_MODE_RATE_GROSS;case'Formula':return ALLOCATION_MODE_FORMULA;}}export function allocationModeFromNumber(a){switch(a){case ALLOCATION_MODE_AMOUNT:return'Amount';case ALLOCATION_MODE_RATE:return'Rate';case ALLOCATION_MODE_SURPLUS:return'Surplus';case ALLOCATION_MODE_RATE_GROSS:return'RateGross';case ALLOCATION_MODE_FORMULA:return'Formula';default:throw new Error('Invalid\x20AllocationMode\x20number:\x20'+a);}}export function getRecipientType(a){if('GuardIdentifier'in a)return'GuardIdentifier';if('Entity'in a)return'Entity';return'Signer';}export function isSignerRecipient(a){return'Signer'in a;}export function isEntityRecipient(a){return'Entity'in a;}export function isGuardIdentifierRecipient(a){return'GuardIdentifier'in a;}export function getErrorName(a){for(const [b,d]of Object['entries'](ALLOCATION_ERROR_CODES)){if(d===a)return b;}return undefined;}export function getErrorDescription(a){const b={0x1:'GuardIdentifier\x20resolved\x20value\x20is\x20not\x20an\x20address\x20type',0x2:'Allocator\x20count\x20exceeds\x20MAX_ALLOCATOR_COUNT\x20(100)',0x3:'No\x20Allocator\x20in\x20the\x20allocators\x20vector',0x4:'Pure\x20Rate\x20mode\x20sum\x20!=\x2010000\x20(no\x20Surplus\x20to\x20absorb\x20remainder)',0x5:'Multiple\x20Surplus\x20sharing\x20in\x20a\x20single\x20Allocator',0x6:'Rate\x20+\x20Surplus\x20sum\x20>\x2010000',0x7:'balance\x20<\x20threshold\x20(insufficient\x20balance\x20to\x20trigger\x20alloc)',0x8:'allocators.allocators\x20is\x20empty',0x9:'payment_info\x20is\x20None\x20when\x20alloc()\x20is\x20called',0xa:'sharing\x20count\x20exceeds\x20MAX_SHARING_COUNT\x20(100)',0xb:'sharing\x20mode\x20is\x20not\x200\x20(Amount)\x20/\x201\x20(Rate)\x20/\x202\x20(Surplus)\x20/\x203\x20(RateGross)\x20/\x204\x20(Formula)',0xc:'Amount\x20sum\x20(fix)\x20<\x20threshold',0xd:'Amount\x20sum\x20(fix)\x20>\x20max',0xe:'distribution\x20computes\x20to\x20zero\x20while\x20the\x20pool\x20still\x20holds\x20funds\x20(or\x20balance\x20is\x200)',0xf:'GuardIdentifier\x20recipient\x20address\x20!=\x20payment_info.for_object\x20anchor\x20(abort\x20fires\x20only\x20when\x20a\x20for_object\x20binding\x20is\x20declared)',0x10:'once-trigger\x20key\x20already\x20consumed\x20—\x20the\x20guard\x20submitted\x20the\x20reserved\x20identifier\x20255\x20and\x20its\x20raw\x20submission\x20bytes\x20were\x20recorded\x20as\x20a\x20(guard,\x20allocator\x20index,\x20raw\x20bytes)\x20dynamic-field\x20key\x20on\x20this\x20Allocation',0x11:'mixed\x20rate\x20bases\x20—\x20one\x20allocator\x20carries\x20both\x20NET\x20Rate\x20and\x20RateGross\x20entries\x20while\x20a\x20fixed\x20Amount\x20total\x20is\x20present\x20(rejected\x20only\x20when\x20fix\x20>\x200;\x20with\x20fix\x20==\x200\x20the\x20two\x20bases\x20coincide\x20and\x20mixing\x20is\x20allowed)',0x12:'RateGross\x20+\x20fixed\x20Amount\x20without\x20a\x20max\x20cap\x20—\x20plan\x20payability\x20unprovable\x20at\x20declaration\x20time',0x13:'guard\x20not\x20bound\x20to\x20any\x20allocator\x20on\x20this\x20Allocation\x20(was\x20a\x20silent\x20no-op\x20success\x20before)',0x14:'allocator\x20append\x20rejected:\x20new\x20Allocators\x20is\x20not\x20a\x20pure\x20extension\x20(prefix/threshold\x20changed)',0x15:'once-for-object\x20slot\x20(identifier\x20254)\x20armed\x20but\x20payment_info\x20declares\x20no\x20for_object\x20binding',0x18:'FormulaSpec\x20rejected:\x20selector\x20is\x20not\x20COUNT(0)/SUM(1),\x20allocator/slot\x20index\x20out\x20of\x20range,\x20or\x20the\x20target\x20sharing\x20slot\x20is\x20not\x20a\x20Formula\x20(mode\x204)\x20leg'};return b[a];}
|
|
@@ -26,9 +26,13 @@ export interface RailNodeInput {
|
|
|
26
26
|
name: string;
|
|
27
27
|
semanticRole?: string;
|
|
28
28
|
}
|
|
29
|
-
export type RailFindingCode = "RAIL_TERMINAL_UNCOVERED" | "RAIL_AWARD_EXIT_MISSING" | "RAIL_POLARITY_COLLISION" | "RAIL_DEAD_LITERAL";
|
|
29
|
+
export type RailFindingCode = "RAIL_TERMINAL_UNCOVERED" | "RAIL_AWARD_EXIT_MISSING" | "RAIL_POLARITY_COLLISION" | "RAIL_DEAD_LITERAL" | "RAIL_RULING_WINDOW";
|
|
30
|
+
export type RailFindingLevel = "critical" | "info";
|
|
30
31
|
export interface RailFinding {
|
|
31
32
|
code: RailFindingCode;
|
|
33
|
+
level: RailFindingLevel;
|
|
32
34
|
detail: string;
|
|
33
35
|
}
|
|
34
|
-
export declare function verifyAllocatorRails(guards: RailGuardInput[], nodes: RailNodeInput[]
|
|
36
|
+
export declare function verifyAllocatorRails(guards: RailGuardInput[], nodes: RailNodeInput[], opts?: {
|
|
37
|
+
arbitrationBound?: boolean;
|
|
38
|
+
}): RailFinding[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const SYM_NODE='progress.current',SYM_CLAIMED='order.claimed_by\x20some';function slotValue(a,b){if(b===undefined)return{'value':undefined,'isSubmission':![]};const c=a['find'](d=>d['identifier']===b);if(!c)return{'value':undefined,'isSubmission':![]};return{'value':c['value'],'isSubmission':c['b_submission']===!![]};}function classifyQueryLhs(a){if(a===SYM_NODE)return{'kind':'node'};if(a===SYM_CLAIMED)return{'kind':'claimed'};return{'kind':'unknown'};}function resolveValue(a,b){if(!b||b['type']!=='identifier')return{'known':![]};const c=slotValue(a,b['identifier']);if(c['isSubmission'])return{'known':![]};if(c['value']===undefined)return{'known':![]};return{'known':!![],'value':c['value']};}function evaluate(a,b,d){if(!b||typeof b['type']!=='string')return undefined;switch(b['type']){case'logic_and':{const e=Array['isArray'](b['nodes'])?b['nodes']:[];let f=![];for(const g of e){const h=evaluate(a,g,d);if(h===![])return![];if(h===undefined)f=!![];}return f?undefined:!![];}case'logic_or':{const i=Array['isArray'](b['nodes'])?b['nodes']:[];let j=![];for(const k of i){const l=evaluate(a,k,d);if(l===!![])return!![];if(l===undefined)j=!![];}return j?undefined:![];}case'logic_not':{const m=evaluate(a,b['node'],d);if(m===undefined)return undefined;return!m;}case'logic_equal':{const n=Array['isArray'](b['nodes'])?b['nodes']:[];if(n['length']<0x2)return undefined;const o=classifyQueryLhs(n[0x0]?.['query']),p=resolveValue(a,n[0x1]),q=o['kind']==='unknown'?classifyQueryLhs(n[0x1]?.['query']):o,r=!p['known']&&n[0x1]?.['query']!==undefined?resolveValue(a,n[0x0]):p;if(q['kind']==='node'){if(!r['known']||typeof r['value']!=='string')return undefined;return d['node']===r['value'];}if(q['kind']==='claimed'){if(!r['known']||typeof r['value']!=='boolean')return undefined;return d['claimed']===r['value'];}return undefined;}default:return undefined;}}function satisfiable(a,b,c){return evaluate(a,b,c)!==![];}function findDeadLiterals(a,b,c,d){if(!a||typeof a['type']!=='string')return;if(a['type']==='logic_and'&&Array['isArray'](a['nodes'])){const e=new Map();for(const f of a['nodes']){const g=resolvableEquality(f,b);if(g)e['set'](g['symbol'],g['value']);}for(const h of a['nodes']){const i=resolvableEquality(h,b);if(i){const k=e['get'](i['symbol']);if(k!==undefined&&k!==i['value']){d['push']({'code':'RAIL_DEAD_LITERAL','detail':deadLiteralDetail(c,i['symbol'],k,i['value'])});return;}continue;}const j=findClash(h,b,e);if(j){d['push']({'code':'RAIL_DEAD_LITERAL','detail':deadLiteralDetail(c,j['symbol'],j['pinned'],j['value'])});return;}}for(const l of a['nodes'])findDeadLiterals(l,b,c,d);return;}if(Array['isArray'](a['nodes'])){for(const m of a['nodes'])findDeadLiterals(m,b,c,d);}if(a['node'])findDeadLiterals(a['node'],b,c,d);}function resolvableEquality(c,d){if(!c||c['type']!=='logic_equal'||!Array['isArray'](c['nodes']))return undefined;for(const [e,f]of[[c['nodes'][0x0],c['nodes'][0x1]],[c['nodes'][0x1],c['nodes'][0x0]]]){if(!e||typeof e['query']!=='string')continue;const g=classifyQueryLhs(e['query']);if(g['kind']==='unknown')continue;const h=resolveValue(d,f);if(!h['known'])continue;return{'symbol':g['kind']==='node'?SYM_NODE:SYM_CLAIMED,'value':h['value']};}return undefined;}function findClash(a,b,c){if(!a||typeof a['type']!=='string')return undefined;if(a['type']==='logic_not')return undefined;const d=resolvableEquality(a,b);if(d){const e=c['get'](d['symbol']);if(e!==undefined&&e!==d['value'])return{'symbol':d['symbol'],'pinned':e,'value':d['value']};return undefined;}if(Array['isArray'](a['nodes']))for(const f of a['nodes']){const g=findClash(f,b,c);if(g)return g;}if(a['node'])return findClash(a['node'],b,c);return undefined;}function deadLiteralDetail(a,b,c,d){return'allocator\x20guard\x20\x27'+a+'\x27:\x20one\x20conjunction\x20scope\x20carries\x20'+b+'\x20'+('==\x20'+JSON['stringify'](c)+'\x20and\x20ALSO\x20'+b+'\x20==\x20'+JSON['stringify'](d)+'\x20—\x20the\x20second\x20')+'literal\x20contradicts\x20the\x20first\x20and\x20is\x20a\x20DEAD\x20literal\x20(azx7-mn-261014\x20CR-azx7-01:\x20a\x20pinned\x20'+'node\x20equality\x20made\x20the\x20sibling\x20closed_cancel/item_lost\x20legs\x20unreachable,\x20stranding\x20the\x20'+'escrow\x20at\x20every\x20other\x20terminal).\x20Hoist\x20the\x20node\x20predicate\x20to\x20ONE\x20top-level\x20n-ary\x20logic_or\x20'+'instead\x20of\x20AND-prepending\x20a\x20single-node\x20gate.';}export function verifyAllocatorRails(a,b){const c=[];if(a['length']===0x0||b['length']===0x0)return c;const d=b['filter'](i=>i['semanticRole']==='cancelled'||i['semanticRole']==='final'),e=b['map'](i=>({'node':i['name'],'claimed':!![]}));for(const i of a){if(i['root']===undefined)continue;const j=i['table'];findDeadLiterals(i['root'],j,i['key'],c);}for(const k of d){const l={'node':k['name'],'claimed':![]},m=a['some'](n=>satisfiable(n['table'],n['root'],l));!m&&c['push']({'code':'RAIL_TERMINAL_UNCOVERED','detail':'terminal\x20node\x20\x27'+k['name']+'\x27\x20(role\x20'+k['semanticRole']+')\x20has\x20NO\x20allocator\x20rail\x20'+'satisfiable\x20at\x20claimed_by=none\x20—\x20a\x20normal\x20(unclaimed)\x20order\x20reaching\x20this\x20'+'terminal\x20strands\x20its\x20escrow\x20forever\x20(azx7-mn-261014\x20CR-azx7-01:\x20refund\x20'+'rejected\x20abort\x207\x20at\x20closed_cancel/item_lost;\x20crs-mn-261014\x20F-30:\x20double-'+'negated\x20claimed_by\x20leg\x20bricked\x20the\x20refund\x20at\x20returned).\x20Guards/allocators\x20'+'freeze\x20at\x20publish\x20—\x20fix\x20the\x20rail\x20polarity/node-set\x20BEFORE\x20publishing.'});}const f=a['some'](n=>e['some'](o=>satisfiable(n['table'],n['root'],o)));!f&&c['push']({'code':'RAIL_AWARD_EXIT_MISSING','detail':'no\x20allocator\x20rail\x20is\x20satisfiable\x20at\x20claimed_by=some\x20on\x20ANY\x20machine\x20node\x20—\x20an\x20'+'arbitration-paid\x20order\x20has\x20NO\x20escrow\x20exit\x20(escrow-exit\x20invariant,\x20az-mn-261007).\x20'+'Pair\x20the\x20refund\x20rail\x20with\x20a\x20merchant-recovery\x20allocator\x20asserting\x20order.claimed_by\x20'+'some\x20==\x20true\x20(query\x201570)\x20on\x20the\x20post-delivery\x20node\x20set.\x20R2-05\x20DISMISSAL-STAMP\x20CAUTION\x20'+'(alg26-tn-261026\x20O11):\x20a\x20concluded\x20DISMISSAL\x20(indemnity=0)\x20ALSO\x20stamps\x20order.claimed_by\x20'+'(service.move:1703-1711\x20—\x20permissionless\x20keeper\x20conclude;\x20on\x20protocol\x20>=\x20154\x20the\x20ruled-zero\x20'+'seal\x20closes\x20claimed_by-none\x20refund\x20rails\x20BY\x20DESIGN,\x20F-BS-54/56).\x20A\x20recover\x20rail\x20discriminated\x20'+'ONLY\x20on\x20the\x20bare\x20order\x20stamp\x20routes\x20to\x20its\x20STATIC\x20recipient\x20regardless\x20of\x20the\x20ruling\x20direction\x20—\x20'+'under\x20a\x20dismissal\x20that\x20static\x20recipient\x20can\x20be\x20the\x20LOSING\x20party\x20(O11:\x20assignee\x20took\x200.15\x20after\x20'+'losing).\x20Split\x20the\x20recover\x20rail\x20by\x20arb\x20outcome\x20or\x20bind\x20its\x20recipient\x20to\x20the\x20winning\x20side\x20—\x20'+'discriminate\x20on\x20the\x20arb-side\x20award\x20(indemnity\x20>\x200\x20/\x20award-claimed\x20polarity),\x20never\x20the\x20bare\x20'+'order\x20stamp:\x20\x27claimed_by\x20some\x20⇒\x20recover-safe\x27\x20holds\x20ONLY\x20when\x20indemnity\x20>\x200.'});const h=a['filter'](n=>n['root']!==undefined);for(const n of e){const o=h['some'](q=>q['track']==='refund'&&satisfiable(q['table'],q['root'],n));if(!o)continue;const p=a['some'](q=>claimedTrueLegPasses(q,n));p&&c['push']({'code':'RAIL_POLARITY_COLLISION','detail':'at\x20node\x20\x27'+n['node']+'\x27\x20with\x20claimed_by=some,\x20BOTH\x20a\x20refund-track\x20rail\x20and\x20an\x20'+'award-polarity\x20rail\x20(claimed_by\x20some\x20==\x20true)\x20are\x20satisfiable\x20—\x20the\x20pairing\x20'+'can\x20double-pay\x20the\x20same\x20escrow\x20(crs-mn-261014\x20F-30:\x20the\x20double-negated\x20refund\x20'+'leg\x20passed\x20only\x20AFTER\x20the\x20award\x20paid;\x20dry-run\x20simulated\x20the\x20escrow\x20draining\x20'+'on\x20top\x20of\x20a\x20paid\x20ruling).\x20The\x20refund\x20leg\x20must\x20be\x20logic_equal[query\x20'+'\x27order.claimed_by\x20some\x27,\x20Bool\x20false]\x20—\x20never\x20logic_not(query)==false.'});}return c;}function claimedTrueLegPasses(a,b){const c=a['table'],d={'node':b['node'],'claimed':!![]};return satisfiable(c,a['root'],d)&&!satisfiable(c,a['root'],{'node':b['node'],'claimed':![]});}
|
|
1
|
+
const SYM_NODE='progress.current',SYM_CLAIMED='order.claimed_by\x20some';function slotValue(a,b){if(b===undefined)return{'value':undefined,'isSubmission':![]};const c=a['find'](d=>d['identifier']===b);if(!c)return{'value':undefined,'isSubmission':![]};return{'value':c['value'],'isSubmission':c['b_submission']===!![]};}function classifyQueryLhs(a){if(a===SYM_NODE)return{'kind':'node'};if(a===SYM_CLAIMED)return{'kind':'claimed'};return{'kind':'unknown'};}function resolveValue(a,b){if(!b||b['type']!=='identifier')return{'known':![]};const c=slotValue(a,b['identifier']);if(c['isSubmission'])return{'known':![]};if(c['value']===undefined)return{'known':![]};return{'known':!![],'value':c['value']};}function evaluate(a,b,d){if(!b||typeof b['type']!=='string')return undefined;switch(b['type']){case'logic_and':{const e=Array['isArray'](b['nodes'])?b['nodes']:[];let f=![];for(const g of e){const h=evaluate(a,g,d);if(h===![])return![];if(h===undefined)f=!![];}return f?undefined:!![];}case'logic_or':{const i=Array['isArray'](b['nodes'])?b['nodes']:[];let j=![];for(const k of i){const l=evaluate(a,k,d);if(l===!![])return!![];if(l===undefined)j=!![];}return j?undefined:![];}case'logic_not':{const m=evaluate(a,b['node'],d);if(m===undefined)return undefined;return!m;}case'logic_equal':{const n=Array['isArray'](b['nodes'])?b['nodes']:[];if(n['length']<0x2)return undefined;const o=classifyQueryLhs(n[0x0]?.['query']),p=resolveValue(a,n[0x1]),q=o['kind']==='unknown'?classifyQueryLhs(n[0x1]?.['query']):o,r=!p['known']&&n[0x1]?.['query']!==undefined?resolveValue(a,n[0x0]):p;if(q['kind']==='node'){if(!r['known']||typeof r['value']!=='string')return undefined;return d['node']===r['value'];}if(q['kind']==='claimed'){if(!r['known']||typeof r['value']!=='boolean')return undefined;return d['claimed']===r['value'];}return undefined;}default:return undefined;}}function satisfiable(a,b,c){return evaluate(a,b,c)!==![];}function findDeadLiterals(a,b,c,d){if(!a||typeof a['type']!=='string')return;if(a['type']==='logic_and'&&Array['isArray'](a['nodes'])){const e=new Map();for(const f of a['nodes']){const g=resolvableEquality(f,b);if(g)e['set'](g['symbol'],g['value']);}for(const h of a['nodes']){const i=resolvableEquality(h,b);if(i){const k=e['get'](i['symbol']);if(k!==undefined&&k!==i['value']){d['push']({'code':'RAIL_DEAD_LITERAL','level':'critical','detail':deadLiteralDetail(c,i['symbol'],k,i['value'])});return;}continue;}const j=findClash(h,b,e);if(j){d['push']({'code':'RAIL_DEAD_LITERAL','level':'critical','detail':deadLiteralDetail(c,j['symbol'],j['pinned'],j['value'])});return;}}for(const l of a['nodes'])findDeadLiterals(l,b,c,d);return;}if(Array['isArray'](a['nodes'])){for(const m of a['nodes'])findDeadLiterals(m,b,c,d);}if(a['node'])findDeadLiterals(a['node'],b,c,d);}function resolvableEquality(c,d){if(!c||c['type']!=='logic_equal'||!Array['isArray'](c['nodes']))return undefined;for(const [e,f]of[[c['nodes'][0x0],c['nodes'][0x1]],[c['nodes'][0x1],c['nodes'][0x0]]]){if(!e||typeof e['query']!=='string')continue;const g=classifyQueryLhs(e['query']);if(g['kind']==='unknown')continue;const h=resolveValue(d,f);if(!h['known'])continue;return{'symbol':g['kind']==='node'?SYM_NODE:SYM_CLAIMED,'value':h['value']};}return undefined;}function findClash(a,b,c){if(!a||typeof a['type']!=='string')return undefined;if(a['type']==='logic_not')return undefined;const d=resolvableEquality(a,b);if(d){const e=c['get'](d['symbol']);if(e!==undefined&&e!==d['value'])return{'symbol':d['symbol'],'pinned':e,'value':d['value']};return undefined;}if(Array['isArray'](a['nodes']))for(const f of a['nodes']){const g=findClash(f,b,c);if(g)return g;}if(a['node'])return findClash(a['node'],b,c);return undefined;}function deadLiteralDetail(a,b,c,d){return'allocator\x20guard\x20\x27'+a+'\x27:\x20one\x20conjunction\x20scope\x20carries\x20'+b+'\x20'+('==\x20'+JSON['stringify'](c)+'\x20and\x20ALSO\x20'+b+'\x20==\x20'+JSON['stringify'](d)+'\x20—\x20the\x20second\x20')+'literal\x20contradicts\x20the\x20first\x20and\x20is\x20a\x20DEAD\x20literal\x20(azx7-mn-261014\x20CR-azx7-01:\x20a\x20pinned\x20'+'node\x20equality\x20made\x20the\x20sibling\x20closed_cancel/item_lost\x20legs\x20unreachable,\x20stranding\x20the\x20'+'escrow\x20at\x20every\x20other\x20terminal).\x20Hoist\x20the\x20node\x20predicate\x20to\x20ONE\x20top-level\x20n-ary\x20logic_or\x20'+'instead\x20of\x20AND-prepending\x20a\x20single-node\x20gate.';}function hasArbitrationEvidenceLeg(a){if(!a||typeof a!=='object')return![];const b=a;if(typeof b['query']==='string'){const d=b['query'];return d['startsWith']('arb.')||d['startsWith']('order.dispute');}if(Array['isArray'](b['nodes'])){for(const e of b['nodes'])if(hasArbitrationEvidenceLeg(e))return!![];}if(b['node']&&hasArbitrationEvidenceLeg(b['node']))return!![];return![];}export function verifyAllocatorRails(a,b,c){const d=[];if(a['length']===0x0)return d;if(c?.['arbitrationBound']===!![]){const j=a['filter'](k=>k['track']==='refund'&&k['root']!==undefined&&!hasArbitrationEvidenceLeg(k['root']))['map'](k=>k['key']);j['length']>0x0&&d['push']({'code':'RAIL_RULING_WINDOW','level':'info','detail':'refund\x20rail(s)\x20['+j['join'](',\x20')+']\x20carry\x20no\x20arbitration-side\x20evidence\x20leg\x20'+'(arb.*\x20/\x20order.dispute*)\x20—\x20the\x20\x22ruled\x20but\x20unclaimed\x22\x20window\x20stays\x20open:\x20after\x20a\x20'+'buyer-favored\x20ruling\x20awards\x20compensation\x20but\x20BEFORE\x20the\x20claim/conclude\x20stamps\x20'+'order.claimed_by,\x20the\x20claimed_by-none\x20refund\x20route\x20can\x20still\x20drain\x20the\x20escrow\x20'+'(dual-track\x20overlap\x20is\x20a\x20LEGITIMATE\x20chain-allowed\x20commercial\x20shape,\x20order.move\x20'+'merchant\x27s-choice\x20note\x20—\x20disclosure,\x20not\x20a\x20violation).\x20To\x20close\x20it,\x20gate\x20the\x20rail\x20'+'on\x20ruling\x20evidence\x20(arb.indemnity\x20legs)\x20—\x20buildable\x20ONLY\x20when\x20this\x20rail\x20is\x20reachable\x20'+'exclusively\x20from\x20dispute-state\x20nodes,\x20or\x20sequence\x20the\x20edge\x20behind\x20the\x20claimed_by\x20stamp\x20'+'(tpl_forward_arb_ruling_won/dismissed\x204R-03b\x20form).\x20See\x20pattern.arb_status_escrow_holdback.'});}if(b['length']===0x0)return d;const e=b['filter'](k=>k['semanticRole']==='cancelled'||k['semanticRole']==='final'),f=b['map'](k=>({'node':k['name'],'claimed':!![]}));for(const k of a){if(k['root']===undefined)continue;const l=k['table'];findDeadLiterals(k['root'],l,k['key'],d);}for(const m of e){const n={'node':m['name'],'claimed':![]},o=a['some'](p=>satisfiable(p['table'],p['root'],n));!o&&d['push']({'code':'RAIL_TERMINAL_UNCOVERED','level':'critical','detail':'terminal\x20node\x20\x27'+m['name']+'\x27\x20(role\x20'+m['semanticRole']+')\x20has\x20NO\x20allocator\x20rail\x20'+'satisfiable\x20at\x20claimed_by=none\x20—\x20a\x20normal\x20(unclaimed)\x20order\x20reaching\x20this\x20'+'terminal\x20strands\x20its\x20escrow\x20forever\x20(azx7-mn-261014\x20CR-azx7-01:\x20refund\x20'+'rejected\x20abort\x207\x20at\x20closed_cancel/item_lost;\x20crs-mn-261014\x20F-30:\x20double-'+'negated\x20claimed_by\x20leg\x20bricked\x20the\x20refund\x20at\x20returned).\x20Guards/allocators\x20'+'freeze\x20at\x20publish\x20—\x20fix\x20the\x20rail\x20polarity/node-set\x20BEFORE\x20publishing.'});}const h=a['some'](p=>f['some'](q=>satisfiable(p['table'],p['root'],q)));!h&&d['push']({'code':'RAIL_AWARD_EXIT_MISSING','level':'critical','detail':'no\x20allocator\x20rail\x20is\x20satisfiable\x20at\x20claimed_by=some\x20on\x20ANY\x20machine\x20node\x20—\x20an\x20'+'arbitration-paid\x20order\x20has\x20NO\x20escrow\x20exit\x20(escrow-exit\x20invariant,\x20az-mn-261007).\x20'+'Pair\x20the\x20refund\x20rail\x20with\x20a\x20merchant-recovery\x20allocator\x20asserting\x20order.claimed_by\x20'+'some\x20==\x20true\x20(query\x201570)\x20on\x20the\x20post-delivery\x20node\x20set.\x20R2-05\x20DISMISSAL-STAMP\x20CAUTION\x20'+'(alg26-tn-261026\x20O11):\x20a\x20concluded\x20DISMISSAL\x20(indemnity=0)\x20ALSO\x20stamps\x20order.claimed_by\x20'+'(service.move:1703-1711\x20—\x20permissionless\x20keeper\x20conclude;\x20on\x20protocol\x20>=\x20154\x20the\x20ruled-zero\x20'+'seal\x20closes\x20claimed_by-none\x20refund\x20rails\x20BY\x20DESIGN,\x20F-BS-54/56).\x20A\x20recover\x20rail\x20discriminated\x20'+'ONLY\x20on\x20the\x20bare\x20order\x20stamp\x20routes\x20to\x20its\x20STATIC\x20recipient\x20regardless\x20of\x20the\x20ruling\x20direction\x20—\x20'+'under\x20a\x20dismissal\x20that\x20static\x20recipient\x20can\x20be\x20the\x20LOSING\x20party\x20(O11:\x20assignee\x20took\x200.15\x20after\x20'+'losing).\x20Split\x20the\x20recover\x20rail\x20by\x20arb\x20outcome\x20or\x20bind\x20its\x20recipient\x20to\x20the\x20winning\x20side\x20—\x20'+'discriminate\x20on\x20the\x20arb-side\x20award\x20(indemnity\x20>\x200\x20/\x20award-claimed\x20polarity),\x20never\x20the\x20bare\x20'+'order\x20stamp:\x20\x27claimed_by\x20some\x20⇒\x20recover-safe\x27\x20holds\x20ONLY\x20when\x20indemnity\x20>\x200.'});const i=a['filter'](p=>p['root']!==undefined);for(const p of f){const q=i['some'](u=>u['track']==='refund'&&satisfiable(u['table'],u['root'],p));if(!q)continue;const r=a['some'](u=>claimedTrueLegPasses(u,p));r&&d['push']({'code':'RAIL_POLARITY_COLLISION','level':'critical','detail':'at\x20node\x20\x27'+p['node']+'\x27\x20with\x20claimed_by=some,\x20BOTH\x20a\x20refund-track\x20rail\x20and\x20an\x20'+'award-polarity\x20rail\x20(claimed_by\x20some\x20==\x20true)\x20are\x20satisfiable\x20—\x20the\x20pairing\x20'+'can\x20double-pay\x20the\x20same\x20escrow\x20(crs-mn-261014\x20F-30:\x20the\x20double-negated\x20refund\x20'+'leg\x20passed\x20only\x20AFTER\x20the\x20award\x20paid;\x20dry-run\x20simulated\x20the\x20escrow\x20draining\x20'+'on\x20top\x20of\x20a\x20paid\x20ruling).\x20The\x20refund\x20leg\x20must\x20be\x20logic_equal[query\x20'+'\x27order.claimed_by\x20some\x27,\x20Bool\x20false]\x20—\x20never\x20logic_not(query)==false.'});}return d;}function claimedTrueLegPasses(a,b){const c=a['table'],d={'node':b['node'],'claimed':!![]};return satisfiable(c,a['root'],d)&&!satisfiable(c,a['root'],{'node':b['node'],'claimed':![]});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export const ARB_STATUS_CODE={'Principal_confirming':0x0,'Arbitrator_confirming':0x1,'Voting':0x2,'Arbitrated':0x3,'Objectionable':0x4,'Finished':0x5,'Withdrawn':0x6};export const ARB_TERMINAL_STATUSES=['Finished','Withdrawn'];export const ARB_STATUS_ALIASES={'created':'Principal_confirming','voting':'Voting','feedback':'Arbitrator_confirming','confirmed':'Arbitrated','completed':'Finished','reset':'Objectionable','disputed':'Withdrawn'};export const ARBITRATION_PERMISSIONS=[{'index':0x15e,'name':'ARBITRATION_NEW','description':'Create\x20new\x20Arbitration\x20object','governed_operations':['create\x20a\x20new\x20arbitration\x20service']},{'index':0x15f,'name':'ARBITRATION_DESCRIPTION','description':'Modify\x20Arbitration\x20description','governed_operations':['modify\x20the\x20arbitration\x20description']},{'index':0x160,'name':'ARBITRATION_ENDPOINT','description':'Reserved\x20placeholder\x20—\x20not\x20used\x20on-chain\x20(SDK\x20commented\x20out)','governed_operations':[],'is_reserved':!![]},{'index':0x161,'name':'ARBITRATION_LOCATION','description':'Set\x20Arbitration\x20location','governed_operations':['set\x20the\x20arbitration\x20location']},{'index':0x162,'name':'ARBITRATION_VOTING_GUARD','description':'Manage\x20voting_guard\x20list\x20(add\x20/\x20remove\x20/\x20clear)\x20—\x20controls\x20vote\x20weight','governed_operations':['add\x20a\x20passport-identifier\x20voting\x20guard\x20(dynamic\x20weight)','add\x20a\x20fixed-weight\x20voting\x20guard','remove\x20a\x20voting\x20guard','clear\x20the\x20voting\x20guard\x20list']},{'index':0x163,'name':'ARBITRATION_USAGE_GUARD','description':'Set\x20/\x20clear\x20usage_guard\x20—\x20controls\x20who\x20can\x20file\x20disputes','governed_operations':['set\x20the\x20usage\x20guard\x20(restrict\x20who\x20can\x20file\x20disputes)','clear\x20the\x20usage\x20guard']},{'index':0x164,'name':'ARBITRATION_PAUSE','description':'Pause\x20/\x20resume\x20Arbitration\x20(bPaused\x20default\x20true)','governed_operations':['pause/resume\x20the\x20arbitration\x20service']},{'index':0x165,'name':'ARBITRATION_FEE','description':'Set\x20dispute\x20application\x20fee\x20(u64)','governed_operations':['set\x20the\x20dispute\x20application\x20fee']},{'index':0x166,'name':'ARBITRATION_VOTE','description':'Cast\x20a\x20vote.\x20With\x20an\x20EMPTY\x20voting_guard\x20this\x20is\x20an\x20equal-weight\x20vote\x20(1\x20person\x201\x20vote)\x20—\x20'+'NOT\x20permissionless:\x20plain\x20voting\x20asserts\x20permission\x20358\x20on\x20the\x20arbitration\x27s\x20bound\x20Permission,\x20'+'whose\x20admin\x20ALWAYS\x20passes\x20the\x20assert\x20(a\x20fresh\x20Permission\x20seeds\x20its\x20creator\x20as\x20the\x20sole\x20admin;\x20'+'the\x20table\x20starts\x20empty).\x20So\x20only\x20the\x20arb-side\x20admin\x20and\x20explicit\x20358\x20grantees\x20can\x20vote\x20—\x20the\x20'+'disputing\x20customer\x20must\x20be\x20GRANTED\x20358\x20first,\x20or\x20voting\x20collapses\x20to\x20admin-only\x20(E-13,\x20test/6)','governed_operations':['cast\x20a\x20vote\x20(empty\x20voting_guard\x20=\x201\x20person\x201\x20vote,\x20permission\x20358\x20still\x20required)','cast\x20a\x20weighted\x20vote\x20via\x20voting_guard\x20(weights\x20resolved\x20per\x20guard)']},{'index':0x167,'name':'ARBITRATION_ARBITRATION','description':'Make\x20definitive\x20arbitration\x20ruling\x20(with\x20indemnity)','governed_operations':['issue\x20the\x20definitive\x20arbitration\x20ruling\x20(with\x20indemnity)']},{'index':0x168,'name':'ARBITRATION_FEEDBACK','description':'Provide\x20feedback\x20on\x20Arb\x20case','governed_operations':['attach\x20feedback\x20to\x20the\x20Arb\x20case']},{'index':0x169,'name':'ARBITRATION_CONFIRM','description':'Confirm\x20materials\x20submitted\x20by\x20principal\x20(starts\x20voting\x20phase)','governed_operations':['confirm\x20the\x20principal\x27s\x20materials\x20(starts\x20the\x20voting\x20phase)']},{'index':0x16a,'name':'ARBITRATION_VOTING_DEADLINE_CHANGE','description':'Change\x20voting\x20deadline\x20for\x20an\x20Arb\x20case','governed_operations':['change\x20the\x20voting\x20deadline\x20for\x20an\x20Arb\x20case']},{'index':0x16b,'name':'ARBITRATION_RESET','description':'Reset\x20arbitration\x20—\x20principal\x20resubmits\x20materials,\x20restart\x20lifecycle','governed_operations':['reset\x20the\x20arbitration\x20(principal\x20resubmits\x20materials)']},{'index':0x16c,'name':'ARBITRATION_ARB_WITHDRAW','description':'Withdraw\x20arbitration\x20fees\x20from\x20Arb\x20into\x20Arbitration.balance','governed_operations':['withdraw\x20arbitration\x20fees\x20from\x20the\x20Arb\x20into\x20Arbitration.balance']},{'index':0x16d,'name':'ARBITRATION_FEES_ALLOC','description':'Allocate\x20arbitration\x20fees\x20to\x20Allocation\x20object','governed_operations':['allocate\x20arbitration\x20fees\x20to\x20an\x20Allocation\x20object']},{'index':0x16e,'name':'ARBITRATION_FEES_TRANSFER','description':'Transfer\x20arbitration\x20fees\x20to\x20Treasury\x20object','governed_operations':['transfer\x20arbitration\x20fees\x20to\x20a\x20Treasury\x20object']},{'index':0x16f,'name':'ARBITRATION_OWNER_RECEIVE','description':'Owner\x20receive\x20(unwrap\x20received\x20Coin/Object\x20and\x20send\x20to\x20Permission\x20owner)','governed_operations':['owner\x20receipt\x20of\x20payments\x20(unwrapped\x20to\x20the\x20owner)','owner\x20receipt\x20of\x20whole\x20objects']},{'index':0x170,'name':'ARBITRATION_UM','description':'Set\x20/\x20clear\x20User\x20Manager\x20(Contact\x20object)','governed_operations':['bind\x20a\x20Contact\x20as\x20the\x20UM\x20coordinator','unbind\x20the\x20UM\x20Contact']}];export const DUAL_GUARD_MATRIX=[{'voting_guard_empty':!![],'usage_guard_empty':!![],'dispute_method':'dispute','vote_method':'vote','scenario':'Open\x20dispute\x20+\x20open\x20voting\x20(1\x20person\x201\x20vote)'},{'voting_guard_empty':!![],'usage_guard_empty':![],'dispute_method':'dispute_via_passport','vote_method':'vote','scenario':'Restricted\x20dispute\x20+\x20open\x20voting'},{'voting_guard_empty':![],'usage_guard_empty':!![],'dispute_method':'dispute','vote_method':'vote_weighted_by_guard','scenario':'Open\x20dispute\x20+\x20weighted\x20voting'},{'voting_guard_empty':![],'usage_guard_empty':![],'dispute_method':'dispute_via_passport','vote_method':'vote_weighted_by_guard','scenario':'Restricted\x20dispute\x20+\x20weighted\x20voting\x20(most\x20controlled)'}];export const ARBITRATION_SCENES=[{'id':'arbitration_create','name':'Create\x20new\x20Arbitration\x20service','operation_category':'lifecycle','permission_index':0x15e,'permission_name':'ARBITRATION_NEW','requires_voting_guard':'any','requires_usage_guard':'any','has_passport_variant':!![],'governed_operations':['create\x20a\x20new\x20arbitration\x20service'],'common_patterns':['Pre-publish\x20config:\x20create\x20Arbitration\x20+\x20Permission\x20together','bPaused\x20defaults\x20to\x20true\x20—\x20must\x20call\x20pause(false)\x20to\x20enable','Generic\x20T:\x20choose\x20Coin\x20type\x20(e.g.\x200x2::wow::WOW)\x20at\x20creation','object-linker\x20binding\x20(core):\x20permission\x20+\x20arbitration\x20linked\x20by\x20an\x20affiliation\x20core\x20binding'],'recommended_templates':['T-AB-01','T-AB-02']},{'id':'arbitration_dispute','name':'File\x20dispute\x20against\x20an\x20Order\x20(creates\x20Arb\x20case)','operation_category':'dispute','permission_index':0x0,'permission_name':'(order\x20op\x20permission\x20—\x20no\x20ARBITRATION_*\x20index)','required_arb_status':[],'resulting_arb_status':'Arbitrator_confirming','requires_voting_guard':'any','requires_usage_guard':'any','has_passport_variant':!![],'governed_operations':['file\x20a\x20dispute\x20against\x20an\x20Order\x20(creates\x20the\x20Arb\x20case)'],'common_patterns':['Fee\x20gate:\x20coin::value(&fee)\x20>=\x20self.fee,\x20else\x20E_FEE_NOT_ENOUGH','Order\x20op\x20permission\x20check\x20required\x20(caller\x20must\x20hold\x20the\x20matching\x20order\x20operation\x20permission)','Creates\x20independent\x20Arb<T>\x20object\x20with\x20its\x20own\x20lifecycle','If\x20usage_guard\x20is\x20Some\x20→\x20the\x20dispute\x20must\x20go\x20through\x20passport\x20verification','Order.dispute\x20list:\x20appends\x20new\x20Arb\x20(max\x2010\x20per\x20Order)','One-shot\x20filing:\x20the\x20Arb\x20is\x20created\x20directly\x20in\x20Arbitrator_confirming\x20status\x20—\x20proposition\x20and\x20description\x20are\x20final\x20at\x20filing;\x20edits\x20require\x20the\x20arbitrator\x20to\x20reset\x20the\x20case\x20back\x20to\x20Principal_confirming\x20first.\x20Assemble\x20the\x20complete\x20proposition\x20before\x20calling\x20dispute.'],'recommended_templates':['T-AB-01','T-AB-03','T-AB-04']},{'id':'arbitration_vote','name':'Vote\x20on\x20Arb\x20propositions','operation_category':'voting','permission_index':0x166,'permission_name':'ARBITRATION_VOTE','required_arb_status':['Voting'],'requires_voting_guard':'any','requires_usage_guard':'not_applicable','has_passport_variant':!![],'governed_operations':['open\x20a\x20vote\x20(1\x20person\x201\x20vote)','cast\x20a\x20weighted\x20vote\x20(weights\x20resolved\x20from\x20the\x20voting\x20guard)'],'common_patterns':['Open\x20vote:\x20voting_guard\x20empty\x20→\x20plain\x20vote\x20(passport\x20variant\x20supported);\x20equal\x20weight\x20'+'(1\x20person\x201\x20vote)\x20but\x20permission\x20358\x20still\x20gates\x20every\x20NON-admin\x20voter\x20—\x20the\x20bound\x20'+'Permission\x27s\x20admin\x20(its\x20creator,\x20by\x20default)\x20always\x20passes,\x20so\x20grant\x20358\x20to\x20the\x20disputing\x20'+'parties\x20or\x20voting\x20collapses\x20to\x20admin-only\x20(E-13)','Weighted\x20vote:\x20voting_guard\x20non-empty\x20→\x20vote\x20weight\x20resolved\x20per\x20voting\x20guard','votes:\x20u8\x20array\x20—\x20index\x20into\x20proposition\x20list\x20(0..N-1)','Mismatch:\x20vote()\x20with\x20non-empty\x20voting_guard\x20→\x20E_VOTING_GUARD_USED','Guard\x20not\x20in\x20list:\x20E_VOTING_GUARD_NOT_FOUND','E-15:\x20the\x20voting_deadline\x20IS\x20the\x20dispute-resolution\x20delay\x20window\x20—\x20the\x20ruling\x20(arbitration)\x20'+'aborts\x20with\x20E_VOTING_DEADLINE_NOT_PASSED\x20until\x20the\x20deadline\x20elapses.\x20Size\x20the\x20window\x20to\x20the\x20'+'business\x20expectation\x20(e.g.\x2010\x20minutes\x20for\x20tests,\x20days\x20for\x20production)'],'recommended_templates':['T-AB-02','T-AB-03']},{'id':'arbitration_confirm','name':'Confirm\x20principal\x20materials\x20and\x20start\x20voting\x20phase','operation_category':'ruling','permission_index':0x169,'permission_name':'ARBITRATION_CONFIRM','required_arb_status':['Arbitrator_confirming'],'resulting_arb_status':'Voting','requires_voting_guard':'any','requires_usage_guard':'not_applicable','has_passport_variant':!![],'governed_operations':['confirm\x20the\x20principal\x27s\x20materials\x20(starts\x20the\x20voting\x20phase)'],'common_patterns':['Transitions\x20Arb\x20from\x20Arbitrator_confirming\x20→\x20Voting','voting_deadline:\x20u64\x20timestamp_ms\x20(null\x20=\x20no\x20deadline)','Once\x20in\x20Voting,\x20only\x20vote\x20/\x20voting_deadline_change\x20/\x20reset\x20allowed'],'recommended_templates':['T-AB-01','T-AB-02']},{'id':'arbitration_feedback','name':'Provide\x20feedback\x20on\x20Arb\x20case','operation_category':'ruling','permission_index':0x168,'permission_name':'ARBITRATION_FEEDBACK','required_arb_status':['Principal_confirming','Arbitrator_confirming','Voting','Arbitrated','Objectionable'],'requires_voting_guard':'not_applicable','requires_usage_guard':'not_applicable','has_passport_variant':!![],'governed_operations':['attach\x20feedback\x20to\x20the\x20Arb\x20case'],'common_patterns':['Feedback\x20is\x20informational\x20—\x20does\x20not\x20change\x20Arb\x20status','Used\x20by\x20principal\x20/\x20arbitrator\x20/\x20voters\x20to\x20attach\x20notes','No\x20state\x20transition;\x20supplements\x20the\x20case\x20record'],'recommended_templates':['T-AB-01','T-AB-07']},{'id':'arbitration_ruling','name':'Make\x20definitive\x20arbitration\x20ruling\x20with\x20indemnity','operation_category':'ruling','permission_index':0x167,'permission_name':'ARBITRATION_ARBITRATION','required_arb_status':['Voting'],'resulting_arb_status':'Arbitrated','requires_voting_guard':'any','requires_usage_guard':'not_applicable','has_passport_variant':!![],'governed_operations':['issue\x20the\x20definitive\x20arbitration\x20ruling\x20(with\x20indemnity)'],'common_patterns':['Ruling\x20produces:\x20feedback\x20(string)\x20+\x20indemnity\x20(u64)','indemnity\x20is\x20compensation\x20amount\x20—\x20paid\x20through\x20the\x20order\x20compensation\x20flow','compensation\x20is\x20package-internal\x20—\x20only\x20the\x20order\x20lifecycle\x20can\x20trigger\x20it','Once\x20Arbitrated,\x20case\x20enters\x20Objectionable\x20window\x20(reset\x20possible)','E-16:\x20the\x20indemnity\x20is\x20paid\x20from\x20the\x20SERVICE\x27s\x20merchant-prepaid\x20compensation_fund\x20pool,\x20'+'NOT\x20from\x20the\x20order\x20escrow.\x20If\x20the\x20pool\x20is\x20smaller\x20than\x20the\x20indemnity,\x20arb_claim_compensation\x20'+'aborts\x20with\x20code\x2027\x20(E_COMPENSATION_NOT_MATCH)\x20—\x20the\x20ruling\x20stands\x20but\x20is\x20unpayable\x20until\x20the\x20'+'merchant\x20tops\x20up\x20(the\x20abort\x20does\x20NOT\x20consume\x20the\x20claim)','E-17/E-17b:\x20the\x20ruling\x20does\x20NOT\x20propagate\x20to\x20the\x20Machine/Allocation\x20escrow,\x20so\x20a\x20settlement\x20'+'forward\x20can\x20still\x20FIRE\x20after\x20a\x20claim.\x20Where\x20the\x20SEAL\x20actually\x20lives\x20(corrected\x20per\x20rex2-261024\x20'+'C-02\x20+\x20order.move\x20source):\x20the\x20escrow\x27s\x20Order-side\x20receive\x20has\x20deliberately\x20NO\x20claimed_by\x20gate\x20'+'(order.move\x20NOTE\x20—\x20principal\x20restitution\x20and\x20damages\x20are\x20two\x20INDEPENDENT\x20tracks;\x20gating\x20receive\x20'+'would\x20strand\x20the\x20principal\x20inside\x20the\x20order.\x20rex2\x20T9\x20live-proven:\x20claim\x20first,\x20then\x20owner_receive\x20'+'extracted\x20the\x20full\x20principal).\x20The\x20mutual\x20exclusion\x20lives\x20at\x20the\x20ALLOCATOR-GUARD\x20layer\x20instead:\x20'+'the\x20merchant\x27s\x20rail\x20pairing\x20—\x20refund\x20rail\x20gated\x20order.claimed_by\x20none\x20+\x20paired\x20recover\x20rail\x20'+'gated\x20claimed_by\x20some\x20(D-BUG-2,\x20template-shipped\x20refund_gate/recover_gate)\x20—\x20is\x20what\x20closes\x20the\x20'+'buyer\x20refund\x20leg\x20once\x20claimed_by\x20is\x20set.\x20That\x20pairing\x20is\x20a\x20MERCHANT\x20choice:\x20a\x20service\x20without\x20it\x20'+'can\x20stack\x20refund\x20+\x20compensation\x20in\x20both\x20directions\x20(rex2\x20T6/T9\x20live\x20double\x20payout,\x20297M\x20>\x20250M\x20'+'principal),\x20which\x20is\x20why\x20the\x20client\x20keeps\x20the\x20acknowledge_dual_payout\x20gate.\x20claim\x20mechanics:\x20'+'compensate()\x20sets\x20claimed_by\x20when\x20an\x20award\x20is\x20CLAIMED\x20—\x20and\x20since\x20BF-14\x20a\x20zero-award\x20claim\x20aborts\x20'+'E_ZERO_INDEMNITY_CLAIM\x20inside\x20arbitration\x20finalization\x20BEFORE\x20any\x20state\x20change,\x20so\x20a\x20plain\x20dismissal\x20leaves\x20'+'the\x20flag\x20unset\x20and\x20refund\x20rails\x20live.\x20RULED-ZERO\x20SEAL\x20(F-BS-54/56,\x20protocol\x20154\x20'+'enable_arb_dismissal_conclusion_gate):\x20the\x20arbitration\x20conclusion\x20operation\x20stamps\x20claimed_by\x20on\x20a\x20CONCLUDED\x20DISMISSAL\x20'+'(amount-insensitive,\x20BKN-P1\x20decision\x20option\x20a)\x20—\x20on\x20protocol\x20>=\x20154\x20a\x20ruled-zero\x20closes\x20the\x20'+'claimed_by-none\x20refund\x20rails\x20at\x20ruling\x20time\x20and\x20the\x20recover\x20rail\x20becomes\x20the\x20only\x20escrow\x20exit\x20'+'(principal\x20exits\x20to\x20the\x20MERCHANT,\x20not\x20the\x20buyer).\x20On\x20a\x20PRE-154\x20network,\x20or\x20when\x20no\x20keeper\x20runs\x20'+'the\x20arbitration\x20conclusion\x20operation,\x20a\x20ruled-zero\x20does\x20NOT\x20seal:\x20the\x20buyer\x20can\x20lose\x20the\x20arbitration\x20and\x20still\x20walk\x20the\x20'+'refund\x20rail\x20—\x20probe\x20the\x20protocol\x20feature\x20before\x20relying\x20on\x20it.\x20STRANDING\x20IS\x20A\x20SERVICE-SHAPE\x20BUG,\x20'+'NOT\x20A\x20CHAIN\x20RULE:\x20gating\x20a\x20refund\x20rail\x20on\x20claimed_by\x20none\x20while\x20shipping\x20NO\x20recover\x20rail\x20leaves\x20a\x20'+'claimed\x20order\x20with\x20no\x20escrow\x20exit\x20(h1b-tn-261024\x20O11\x20live:\x201.0\x20WOW\x20stranded\x20after\x20a\x20zero-payout\x20'+'dismissal).\x20The\x20compile-time\x20rail\x20verifier\x20blocks\x20that\x20shape\x20pre-publish\x20'+'(RAIL_AWARD_EXIT_MISSING).\x20The\x20pairing\x20guarantees\x20no\x20stranding,\x20not\x20no-misallocation:\x20'+'award-amount\x20polarity\x20is\x20not\x20expressible\x20on\x20the\x20refund\x20track\x20(long-term:\x20N-9\x20order-authority\x20'+'model\x20window)'],'recommended_templates':['T-AB-01','T-AB-05']},{'id':'arbitration_reset','name':'Reset\x20arbitration\x20—\x20principal\x20resubmits\x20materials','operation_category':'ruling','permission_index':0x16b,'permission_name':'ARBITRATION_RESET','required_arb_status':['Objectionable','Arbitrator_confirming'],'resulting_arb_status':'Principal_confirming','requires_voting_guard':'any','requires_usage_guard':'not_applicable','has_passport_variant':!![],'governed_operations':['reset\x20the\x20arbitration\x20(principal\x20resubmits\x20materials)'],'common_patterns':['Resets\x20Arb\x20from\x20Objectionable/Arbitrator_confirming\x20→\x20Principal_confirming','Used\x20when\x20principal\x20objects\x20to\x20ruling\x20and\x20resubmits\x20materials','Feedback\x20required\x20(string\x20explaining\x20reset\x20reason)','Restart\x20full\x20lifecycle:\x20Principal_confirming\x20→\x20...\x20→\x20Finished'],'recommended_templates':['T-AB-07']},{'id':'arbitration_arb_withdraw','name':'Withdraw\x20arbitration\x20fees\x20from\x20Arb\x20into\x20Arbitration.balance','operation_category':'fund','permission_index':0x16c,'permission_name':'ARBITRATION_ARB_WITHDRAW','required_arb_status':['Finished','Arbitrated'],'requires_voting_guard':'not_applicable','requires_usage_guard':'not_applicable','has_passport_variant':!![],'governed_operations':['withdraw\x20arbitration\x20fees\x20from\x20the\x20Arb\x20into\x20Arbitration.balance'],'common_patterns':['Moves\x20fees\x20from\x20the\x20Arb\x20object\x20into\x20Arbitration.balance\x20(clock-checked)','Finished:\x20withdraw\x20immediately','Arbitrated:\x20must\x20wait\x20WITHDRAW_DURATION_TIME\x20(30d)\x20past\x20indemnity.time\x20—\x20silence\x20=\x20acceptance','Objectionable:\x20NEVER\x20withdrawable\x20(protocol\x20141)\x20—\x20the\x20fee\x20stays\x20escrowed\x20until\x20the\x20objection\x20cycle\x20is\x20closed\x20by\x20the\x20principal\x20re-confirming','Increases\x20Arbitration.balance\x20—\x20funds\x20available\x20for\x20fee\x20allocation/transfer'],'recommended_templates':['T-AB-06']},{'id':'arbitration_fees_alloc','name':'Allocate\x20arbitration\x20fees\x20to\x20Allocation\x20object','operation_category':'fund','permission_index':0x16d,'permission_name':'ARBITRATION_FEES_ALLOC','requires_voting_guard':'not_applicable','requires_usage_guard':'not_applicable','has_passport_variant':!![],'governed_operations':['allocate\x20arbitration\x20fees\x20to\x20an\x20Allocation\x20object'],'common_patterns':['Destination:\x20Allocation\x20object\x20(parameterized\x20fund\x20distribution)','payment_remark\x20+\x20payment_index:\x20bookkeeping\x20for\x20Payment\x20object','May\x20create\x20new\x20Payment\x20object\x20if\x20newPayment\x20name\x20provided','Triggers\x20balance::withdraw_all\x20—\x20extracts\x20ALL\x20balance'],'recommended_templates':['T-AB-06']},{'id':'arbitration_fees_transfer','name':'Transfer\x20arbitration\x20fees\x20to\x20Treasury\x20object','operation_category':'fund','permission_index':0x16e,'permission_name':'ARBITRATION_FEES_TRANSFER','requires_voting_guard':'not_applicable','requires_usage_guard':'not_applicable','has_passport_variant':!![],'governed_operations':['transfer\x20arbitration\x20fees\x20to\x20a\x20Treasury\x20object'],'common_patterns':['Destination:\x20Treasury\x20object\x20(general\x20fund\x20pool)','Same\x20bookkeeping\x20as\x20fee\x20allocation\x20(remark\x20+\x20index\x20+\x20newPayment)','Triggers\x20balance::withdraw_all\x20—\x20extracts\x20ALL\x20balance','Choose\x20Allocation\x20vs\x20Treasury\x20by\x20distribution\x20need'],'recommended_templates':['T-AB-06']},{'id':'arbitration_voting_guard_config','name':'Configure\x20voting_guard\x20list\x20(add\x20/\x20set\x20/\x20remove\x20/\x20clear)','operation_category':'guard','permission_index':0x162,'permission_name':'ARBITRATION_VOTING_GUARD','requires_voting_guard':'any','requires_usage_guard':'not_applicable','has_passport_variant':!![],'governed_operations':['add\x20a\x20passport-identifier\x20voting\x20guard\x20(dynamic\x20weight)','add\x20a\x20fixed-weight\x20voting\x20guard','remove\x20a\x20voting\x20guard','clear\x20the\x20voting\x20guard\x20list'],'common_patterns':['Max\x2050\x20guards:\x20MAX_VOTING_GUARD_COUNT=50\x20(off-by-one-safe:\x20len<50\x20allows\x20add)','GuardIdentifier(u8):\x20dynamic\x20weight\x20from\x20Passport\x20submission\x20value','FixedValue(u32):\x20static\x20weight\x20(e.g.\x20100\x20votes\x20per\x20holder)','Add\x20same\x20guard\x20twice\x20→\x20updates\x20vote_weight\x20(no\x20duplicate)','op=\x27set\x27\x20=\x20clear\x20then\x20add;\x20op=\x27add\x27\x20=\x20append;\x20op=\x27remove\x27\x20=\x20by\x20address'],'recommended_templates':['T-AB-02','T-AB-03']},{'id':'arbitration_usage_guard_config','name':'Configure\x20usage_guard\x20(set\x20/\x20clear)','operation_category':'guard','permission_index':0x163,'permission_name':'ARBITRATION_USAGE_GUARD','requires_voting_guard':'not_applicable','requires_usage_guard':'any','has_passport_variant':!![],'governed_operations':['set\x20the\x20usage\x20guard\x20(restrict\x20who\x20can\x20file\x20disputes)','clear\x20the\x20usage\x20guard'],'common_patterns':['Single\x20guard\x20(Option<address>)\x20—\x20not\x20a\x20list','Some(guard):\x20the\x20dispute\x20must\x20go\x20through\x20passport\x20verification','None:\x20dispute\x20can\x20use\x20either\x20variant\x20(no\x20passport\x20needed)','object-linker\x20affiliation\x20change:\x20updates\x20link\x20when\x20guard\x20changes'],'recommended_templates':['T-AB-04']},{'id':'arbitration_pause','name':'Pause\x20/\x20resume\x20Arbitration\x20service','operation_category':'lifecycle','permission_index':0x164,'permission_name':'ARBITRATION_PAUSE','requires_voting_guard':'not_applicable','requires_usage_guard':'not_applicable','has_passport_variant':!![],'governed_operations':['pause/resume\x20the\x20arbitration\x20service'],'common_patterns':['bPaused\x20default\x20true\x20—\x20new\x20Arbitration\x20cannot\x20accept\x20disputes','pause(false)\x20to\x20enable,\x20pause(true)\x20to\x20disable','Paused\x20Arbitration\x20rejects\x20dispute\x20(E_PAUSED)','Does\x20not\x20affect\x20already-open\x20Arb\x20cases'],'recommended_templates':['T-AB-01']},{'id':'arbitration_service_statement','name':'Service\x20(defendant)\x20appends\x20a\x20text\x20statement\x20to\x20the\x20case\x20record','operation_category':'dispute','permission_index':0x141,'permission_name':'SERVICE_ARB_STATEMENT','requires_voting_guard':'not_applicable','requires_usage_guard':'not_applicable','has_passport_variant':!![],'governed_operations':['append\x20the\x20seller\x27s\x20text\x20statement\x20to\x20a\x20case\x20against\x20an\x20order\x20of\x20the\x20service\x20(ArbStatementEvent)'],'common_patterns':['Defendant-side\x20voice\x20WITHOUT\x20holding\x20the\x20order\x20—\x20the\x20arb/arbitration\x20function\x20family\x20is\x20order-anchored;\x20this\x20entry\x20is\x20service-anchored','PRIMARY\x20evidence\x20channel\x20is\x20Messenger:\x20submit\x20encrypted\x20WTS\x20records\x20of\x20the\x20exchange\x20with\x20the\x20order\x20customer\x20first','This\x20statement\x20is\x20the\x20SECONDARY\x20channel:\x20declare\x20facts\x20or\x20report\x20customer\x20behavior\x20(absence,\x20non-cooperation)\x20on\x20the\x20case\x20record','Event-only:\x20nothing\x20on\x20the\x20Arb\x20object\x20is\x20mutated;\x20the\x20record\x20cannot\x20be\x20rewritten\x20or\x20deleted\x20by\x20any\x20party','Text\x20length\x20cap\x20identical\x20to\x20description/objection\x20(DESCRIPTION\x20bound,\x204000)'],'recommended_templates':[]}];export const ARBITRATION_LEDGER_VERSION='1.0.0';export function getScenesByCategory(a){return ARBITRATION_SCENES['filter'](b=>b['operation_category']===a);}export function findSceneById(a){return ARBITRATION_SCENES['find'](b=>b['id']===a);}export function findSceneByPermissionIndex(a){return ARBITRATION_SCENES['find'](b=>b['permission_index']===a);}export function getPermissionByIndex(a){return ARBITRATION_PERMISSIONS['find'](b=>b['index']===a);}export function getPermissionByName(a){return ARBITRATION_PERMISSIONS['find'](b=>b['name']===a);}export function isReservedIndex(a){const b=getPermissionByIndex(a);return!!b?.['is_reserved'];}export function isUsedPermissionIndex(a){const b=getPermissionByIndex(a);return!!b&&!b['is_reserved'];}export function getActivePermissionCount(){return ARBITRATION_PERMISSIONS['filter'](a=>!a['is_reserved'])['length'];}export function inferSceneFromIntent(a){const b=a['toLowerCase'](),c=[{'keywords':['create','new'],'sceneId':'arbitration_create'},{'keywords':['dispute','file','complaint'],'sceneId':'arbitration_dispute'},{'keywords':['vote','voting','decide'],'sceneId':'arbitration_vote'},{'keywords':['confirm','materials'],'sceneId':'arbitration_confirm'},{'keywords':['feedback','opinion'],'sceneId':'arbitration_feedback'},{'keywords':['ruling','arbitration','verdict'],'sceneId':'arbitration_ruling'},{'keywords':['reset','resubmit'],'sceneId':'arbitration_reset'},{'keywords':['arb_withdraw','withdraw','withdraw\x20fees'],'sceneId':'arbitration_arb_withdraw'},{'keywords':['allocate','allocate\x20fees','fees\x20allocation'],'sceneId':'arbitration_fees_alloc'},{'keywords':['fees_transfer','transfer','transfer\x20in'],'sceneId':'arbitration_fees_transfer'},{'keywords':['voting_guard','voting\x20guard'],'sceneId':'arbitration_voting_guard_config'},{'keywords':['usage_guard','usage\x20guard'],'sceneId':'arbitration_usage_guard_config'},{'keywords':['pause','enable'],'sceneId':'arbitration_pause'}];for(const {keywords:d,sceneId:e}of c){if(d['some'](f=>b['includes'](f['toLowerCase']()))){const f=findSceneById(e);if(f)return f;}}return undefined;}export function getDualGuardMatrixEntry(a,b){return DUAL_GUARD_MATRIX['find'](c=>c['voting_guard_empty']===a&&c['usage_guard_empty']===b);}export function isValidArbStatusTransition(a,b){const c={'Principal_confirming':['Arbitrator_confirming'],'Arbitrator_confirming':['Voting','Principal_confirming'],'Voting':['Arbitrated'],'Arbitrated':['Objectionable','Finished','Withdrawn'],'Objectionable':['Principal_confirming'],'Finished':['Withdrawn'],'Withdrawn':[]};return c[a]?.['includes'](b)??![];}export function isTerminalArbStatus(a){return ARB_TERMINAL_STATUSES['includes'](a);}export function getScenesProducingStatus(a){return ARBITRATION_SCENES['filter'](b=>b['resulting_arb_status']===a);}export function getScenesRequiringStatus(a){return ARBITRATION_SCENES['filter'](b=>b['required_arb_status']?.['includes'](a));}export function getArbitrationScenesCount(){return ARBITRATION_SCENES['length'];}export function getAllArbitrationPermissions(){return[...ARBITRATION_PERMISSIONS];}export function getActiveArbitrationPermissions(){return ARBITRATION_PERMISSIONS['filter'](a=>!a['is_reserved']);}
|
|
1
|
+
export const ARB_STATUS_CODE={'Principal_confirming':0x0,'Arbitrator_confirming':0x1,'Voting':0x2,'Arbitrated':0x3,'Objectionable':0x4,'Finished':0x5,'Withdrawn':0x6};export const ARB_TERMINAL_STATUSES=['Finished','Withdrawn'];export const ARB_STATUS_ALIASES={'created':'Principal_confirming','voting':'Voting','feedback':'Arbitrator_confirming','confirmed':'Arbitrated','completed':'Finished','reset':'Objectionable','disputed':'Withdrawn'};export const ARBITRATION_PERMISSIONS=[{'index':0x15e,'name':'ARBITRATION_NEW','description':'Create\x20new\x20Arbitration\x20object','governed_operations':['create\x20a\x20new\x20arbitration\x20service']},{'index':0x15f,'name':'ARBITRATION_DESCRIPTION','description':'Modify\x20Arbitration\x20description','governed_operations':['modify\x20the\x20arbitration\x20description']},{'index':0x160,'name':'ARBITRATION_ENDPOINT','description':'Reserved\x20placeholder\x20—\x20not\x20used\x20on-chain\x20(SDK\x20commented\x20out)','governed_operations':[],'is_reserved':!![]},{'index':0x161,'name':'ARBITRATION_LOCATION','description':'Set\x20Arbitration\x20location','governed_operations':['set\x20the\x20arbitration\x20location']},{'index':0x162,'name':'ARBITRATION_VOTING_GUARD','description':'Manage\x20voting_guard\x20list\x20(add\x20/\x20remove\x20/\x20clear)\x20—\x20controls\x20vote\x20weight','governed_operations':['add\x20a\x20passport-identifier\x20voting\x20guard\x20(dynamic\x20weight)','add\x20a\x20fixed-weight\x20voting\x20guard','remove\x20a\x20voting\x20guard','clear\x20the\x20voting\x20guard\x20list']},{'index':0x163,'name':'ARBITRATION_USAGE_GUARD','description':'Set\x20/\x20clear\x20usage_guard\x20—\x20controls\x20who\x20can\x20file\x20disputes','governed_operations':['set\x20the\x20usage\x20guard\x20(restrict\x20who\x20can\x20file\x20disputes)','clear\x20the\x20usage\x20guard']},{'index':0x164,'name':'ARBITRATION_PAUSE','description':'Pause\x20/\x20resume\x20Arbitration\x20(bPaused\x20default\x20true)','governed_operations':['pause/resume\x20the\x20arbitration\x20service']},{'index':0x165,'name':'ARBITRATION_FEE','description':'Set\x20dispute\x20application\x20fee\x20(u64)','governed_operations':['set\x20the\x20dispute\x20application\x20fee']},{'index':0x166,'name':'ARBITRATION_VOTE','description':'Cast\x20a\x20vote.\x20With\x20an\x20EMPTY\x20voting_guard\x20this\x20is\x20an\x20equal-weight\x20vote\x20(1\x20person\x201\x20vote)\x20—\x20'+'NOT\x20permissionless:\x20plain\x20voting\x20asserts\x20permission\x20358\x20on\x20the\x20arbitration\x27s\x20bound\x20Permission,\x20'+'whose\x20admin\x20ALWAYS\x20passes\x20the\x20assert\x20(a\x20fresh\x20Permission\x20seeds\x20its\x20creator\x20as\x20the\x20sole\x20admin;\x20'+'the\x20table\x20starts\x20empty).\x20So\x20only\x20the\x20arb-side\x20admin\x20and\x20explicit\x20358\x20grantees\x20can\x20vote\x20—\x20the\x20'+'disputing\x20customer\x20must\x20be\x20GRANTED\x20358\x20first,\x20or\x20voting\x20collapses\x20to\x20admin-only\x20(E-13,\x20test/6)','governed_operations':['cast\x20a\x20vote\x20(empty\x20voting_guard\x20=\x201\x20person\x201\x20vote,\x20permission\x20358\x20still\x20required)','cast\x20a\x20weighted\x20vote\x20via\x20voting_guard\x20(weights\x20resolved\x20per\x20guard)']},{'index':0x167,'name':'ARBITRATION_ARBITRATION','description':'Make\x20definitive\x20arbitration\x20ruling\x20(with\x20indemnity)','governed_operations':['issue\x20the\x20definitive\x20arbitration\x20ruling\x20(with\x20indemnity)']},{'index':0x168,'name':'ARBITRATION_FEEDBACK','description':'Provide\x20feedback\x20on\x20Arb\x20case','governed_operations':['attach\x20feedback\x20to\x20the\x20Arb\x20case']},{'index':0x169,'name':'ARBITRATION_CONFIRM','description':'Confirm\x20materials\x20submitted\x20by\x20principal\x20(starts\x20voting\x20phase)','governed_operations':['confirm\x20the\x20principal\x27s\x20materials\x20(starts\x20the\x20voting\x20phase)']},{'index':0x16a,'name':'ARBITRATION_VOTING_DEADLINE_CHANGE','description':'Change\x20voting\x20deadline\x20for\x20an\x20Arb\x20case','governed_operations':['change\x20the\x20voting\x20deadline\x20for\x20an\x20Arb\x20case']},{'index':0x16b,'name':'ARBITRATION_RESET','description':'Reset\x20arbitration\x20—\x20principal\x20resubmits\x20materials,\x20restart\x20lifecycle','governed_operations':['reset\x20the\x20arbitration\x20(principal\x20resubmits\x20materials)']},{'index':0x16c,'name':'ARBITRATION_ARB_WITHDRAW','description':'Withdraw\x20arbitration\x20fees\x20from\x20Arb\x20into\x20Arbitration.balance','governed_operations':['withdraw\x20arbitration\x20fees\x20from\x20the\x20Arb\x20into\x20Arbitration.balance']},{'index':0x16d,'name':'ARBITRATION_FEES_ALLOC','description':'Allocate\x20arbitration\x20fees\x20to\x20Allocation\x20object','governed_operations':['allocate\x20arbitration\x20fees\x20to\x20an\x20Allocation\x20object']},{'index':0x16e,'name':'ARBITRATION_FEES_TRANSFER','description':'Transfer\x20arbitration\x20fees\x20to\x20Treasury\x20object','governed_operations':['transfer\x20arbitration\x20fees\x20to\x20a\x20Treasury\x20object']},{'index':0x16f,'name':'ARBITRATION_OWNER_RECEIVE','description':'Owner\x20receive\x20(unwrap\x20received\x20Coin/Object\x20and\x20send\x20to\x20Permission\x20owner)','governed_operations':['owner\x20receipt\x20of\x20payments\x20(unwrapped\x20to\x20the\x20owner)','owner\x20receipt\x20of\x20whole\x20objects']},{'index':0x170,'name':'ARBITRATION_UM','description':'Set\x20/\x20clear\x20User\x20Manager\x20(Contact\x20object)','governed_operations':['bind\x20a\x20Contact\x20as\x20the\x20UM\x20coordinator','unbind\x20the\x20UM\x20Contact']}];export const DUAL_GUARD_MATRIX=[{'voting_guard_empty':!![],'usage_guard_empty':!![],'dispute_method':'dispute','vote_method':'vote','scenario':'Open\x20dispute\x20+\x20open\x20voting\x20(1\x20person\x201\x20vote)'},{'voting_guard_empty':!![],'usage_guard_empty':![],'dispute_method':'dispute_via_passport','vote_method':'vote','scenario':'Restricted\x20dispute\x20+\x20open\x20voting'},{'voting_guard_empty':![],'usage_guard_empty':!![],'dispute_method':'dispute','vote_method':'vote_weighted_by_guard','scenario':'Open\x20dispute\x20+\x20weighted\x20voting'},{'voting_guard_empty':![],'usage_guard_empty':![],'dispute_method':'dispute_via_passport','vote_method':'vote_weighted_by_guard','scenario':'Restricted\x20dispute\x20+\x20weighted\x20voting\x20(most\x20controlled)'}];export const ARBITRATION_SCENES=[{'id':'arbitration_create','name':'Create\x20new\x20Arbitration\x20service','operation_category':'lifecycle','permission_index':0x15e,'permission_name':'ARBITRATION_NEW','requires_voting_guard':'any','requires_usage_guard':'any','has_passport_variant':!![],'governed_operations':['create\x20a\x20new\x20arbitration\x20service'],'common_patterns':['Pre-publish\x20config:\x20create\x20Arbitration\x20+\x20Permission\x20together','bPaused\x20defaults\x20to\x20true\x20—\x20must\x20call\x20pause(false)\x20to\x20enable','Generic\x20T:\x20choose\x20Coin\x20type\x20(e.g.\x200x2::wow::WOW)\x20at\x20creation','object-linker\x20binding\x20(core):\x20permission\x20+\x20arbitration\x20linked\x20by\x20an\x20affiliation\x20core\x20binding'],'recommended_templates':['T-AB-01','T-AB-02']},{'id':'arbitration_dispute','name':'File\x20dispute\x20against\x20an\x20Order\x20(creates\x20Arb\x20case)','operation_category':'dispute','permission_index':0x0,'permission_name':'(order\x20op\x20permission\x20—\x20no\x20ARBITRATION_*\x20index)','required_arb_status':[],'resulting_arb_status':'Arbitrator_confirming','requires_voting_guard':'any','requires_usage_guard':'any','has_passport_variant':!![],'governed_operations':['file\x20a\x20dispute\x20against\x20an\x20Order\x20(creates\x20the\x20Arb\x20case)'],'common_patterns':['Fee\x20gate:\x20coin::value(&fee)\x20>=\x20self.fee,\x20else\x20E_FEE_NOT_ENOUGH','Order\x20op\x20permission\x20check\x20required\x20(caller\x20must\x20hold\x20the\x20matching\x20order\x20operation\x20permission)','Creates\x20independent\x20Arb<T>\x20object\x20with\x20its\x20own\x20lifecycle','If\x20usage_guard\x20is\x20Some\x20→\x20the\x20dispute\x20must\x20go\x20through\x20passport\x20verification','Order.dispute\x20list:\x20appends\x20new\x20Arb\x20(max\x2010\x20per\x20Order)','One-shot\x20filing:\x20the\x20Arb\x20is\x20created\x20directly\x20in\x20Arbitrator_confirming\x20status\x20—\x20proposition\x20and\x20description\x20are\x20final\x20at\x20filing;\x20edits\x20require\x20the\x20arbitrator\x20to\x20reset\x20the\x20case\x20back\x20to\x20Principal_confirming\x20first.\x20Assemble\x20the\x20complete\x20proposition\x20before\x20calling\x20dispute.'],'recommended_templates':['T-AB-01','T-AB-03','T-AB-04']},{'id':'arbitration_vote','name':'Vote\x20on\x20Arb\x20propositions','operation_category':'voting','permission_index':0x166,'permission_name':'ARBITRATION_VOTE','required_arb_status':['Voting'],'requires_voting_guard':'any','requires_usage_guard':'not_applicable','has_passport_variant':!![],'governed_operations':['open\x20a\x20vote\x20(1\x20person\x201\x20vote)','cast\x20a\x20weighted\x20vote\x20(weights\x20resolved\x20from\x20the\x20voting\x20guard)'],'common_patterns':['Open\x20vote:\x20voting_guard\x20empty\x20→\x20plain\x20vote\x20(passport\x20variant\x20supported);\x20equal\x20weight\x20'+'(1\x20person\x201\x20vote)\x20but\x20permission\x20358\x20still\x20gates\x20every\x20NON-admin\x20voter\x20—\x20the\x20bound\x20'+'Permission\x27s\x20admin\x20(its\x20creator,\x20by\x20default)\x20always\x20passes,\x20so\x20grant\x20358\x20to\x20the\x20disputing\x20'+'parties\x20or\x20voting\x20collapses\x20to\x20admin-only\x20(E-13)','Weighted\x20vote:\x20voting_guard\x20non-empty\x20→\x20vote\x20weight\x20resolved\x20per\x20voting\x20guard','votes:\x20u8\x20array\x20—\x20index\x20into\x20proposition\x20list\x20(0..N-1)','Mismatch:\x20vote()\x20with\x20non-empty\x20voting_guard\x20→\x20E_VOTING_GUARD_USED','Guard\x20not\x20in\x20list:\x20E_VOTING_GUARD_NOT_FOUND','E-15:\x20the\x20voting_deadline\x20IS\x20the\x20dispute-resolution\x20delay\x20window\x20—\x20the\x20ruling\x20(arbitration)\x20'+'aborts\x20with\x20E_VOTING_DEADLINE_NOT_PASSED\x20until\x20the\x20deadline\x20elapses.\x20Size\x20the\x20window\x20to\x20the\x20'+'business\x20expectation\x20(e.g.\x2010\x20minutes\x20for\x20tests,\x20days\x20for\x20production)'],'recommended_templates':['T-AB-02','T-AB-03']},{'id':'arbitration_confirm','name':'Confirm\x20principal\x20materials\x20and\x20start\x20voting\x20phase','operation_category':'ruling','permission_index':0x169,'permission_name':'ARBITRATION_CONFIRM','required_arb_status':['Arbitrator_confirming'],'resulting_arb_status':'Voting','requires_voting_guard':'any','requires_usage_guard':'not_applicable','has_passport_variant':!![],'governed_operations':['confirm\x20the\x20principal\x27s\x20materials\x20(starts\x20the\x20voting\x20phase)'],'common_patterns':['Transitions\x20Arb\x20from\x20Arbitrator_confirming\x20→\x20Voting','voting_deadline:\x20u64\x20timestamp_ms\x20(null\x20=\x20no\x20deadline)','Once\x20in\x20Voting,\x20only\x20vote\x20/\x20voting_deadline_change\x20/\x20reset\x20allowed'],'recommended_templates':['T-AB-01','T-AB-02']},{'id':'arbitration_feedback','name':'Provide\x20feedback\x20on\x20Arb\x20case','operation_category':'ruling','permission_index':0x168,'permission_name':'ARBITRATION_FEEDBACK','required_arb_status':['Principal_confirming','Arbitrator_confirming','Voting','Arbitrated','Objectionable'],'requires_voting_guard':'not_applicable','requires_usage_guard':'not_applicable','has_passport_variant':!![],'governed_operations':['attach\x20feedback\x20to\x20the\x20Arb\x20case'],'common_patterns':['Feedback\x20is\x20informational\x20—\x20does\x20not\x20change\x20Arb\x20status','Used\x20by\x20principal\x20/\x20arbitrator\x20/\x20voters\x20to\x20attach\x20notes','No\x20state\x20transition;\x20supplements\x20the\x20case\x20record'],'recommended_templates':['T-AB-01','T-AB-07']},{'id':'arbitration_ruling','name':'Make\x20definitive\x20arbitration\x20ruling\x20with\x20indemnity','operation_category':'ruling','permission_index':0x167,'permission_name':'ARBITRATION_ARBITRATION','required_arb_status':['Voting'],'resulting_arb_status':'Arbitrated','requires_voting_guard':'any','requires_usage_guard':'not_applicable','has_passport_variant':!![],'governed_operations':['issue\x20the\x20definitive\x20arbitration\x20ruling\x20(with\x20indemnity)'],'common_patterns':['Ruling\x20produces:\x20feedback\x20(string)\x20+\x20indemnity\x20(u64)','indemnity\x20is\x20compensation\x20amount\x20—\x20paid\x20through\x20the\x20order\x20compensation\x20flow','compensation\x20is\x20package-internal\x20—\x20only\x20the\x20order\x20lifecycle\x20can\x20trigger\x20it','Once\x20Arbitrated,\x20case\x20enters\x20Objectionable\x20window\x20(reset\x20possible)','E-16:\x20the\x20indemnity\x20is\x20paid\x20from\x20the\x20SERVICE\x27s\x20merchant-prepaid\x20compensation_fund\x20pool,\x20'+'NOT\x20from\x20the\x20order\x20escrow.\x20If\x20the\x20pool\x20is\x20smaller\x20than\x20the\x20indemnity,\x20arb_claim_compensation\x20'+'aborts\x20with\x20code\x2027\x20(E_COMPENSATION_NOT_MATCH)\x20—\x20the\x20ruling\x20stands\x20but\x20is\x20unpayable\x20until\x20the\x20'+'merchant\x20tops\x20up\x20(the\x20abort\x20does\x20NOT\x20consume\x20the\x20claim)','E-17/E-17b:\x20the\x20ruling\x20does\x20NOT\x20propagate\x20to\x20the\x20Machine/Allocation\x20escrow,\x20so\x20a\x20settlement\x20'+'forward\x20can\x20still\x20FIRE\x20after\x20a\x20claim.\x20Where\x20the\x20SEAL\x20actually\x20lives\x20(corrected\x20per\x20rex2-261024\x20'+'C-02\x20+\x20order.move\x20source):\x20the\x20escrow\x27s\x20Order-side\x20receive\x20has\x20deliberately\x20NO\x20claimed_by\x20gate\x20'+'(order.move\x20NOTE\x20—\x20principal\x20restitution\x20and\x20damages\x20are\x20two\x20INDEPENDENT\x20tracks;\x20gating\x20receive\x20'+'would\x20strand\x20the\x20principal\x20inside\x20the\x20order.\x20rex2\x20T9\x20live-proven:\x20claim\x20first,\x20then\x20owner_receive\x20'+'extracted\x20the\x20full\x20principal).\x20The\x20mutual\x20exclusion\x20lives\x20at\x20the\x20ALLOCATOR-GUARD\x20layer\x20instead:\x20'+'the\x20merchant\x27s\x20rail\x20pairing\x20—\x20refund\x20rail\x20gated\x20order.claimed_by\x20none\x20+\x20paired\x20recover\x20rail\x20'+'gated\x20claimed_by\x20some\x20(D-BUG-2,\x20template-shipped\x20refund_gate/recover_gate)\x20—\x20is\x20what\x20closes\x20the\x20'+'buyer\x20refund\x20leg\x20once\x20claimed_by\x20is\x20set.\x20That\x20pairing\x20is\x20a\x20MERCHANT\x20choice:\x20a\x20service\x20without\x20it\x20'+'can\x20stack\x20refund\x20+\x20compensation\x20in\x20both\x20directions\x20(rex2\x20T6/T9\x20live\x20double\x20payout,\x20297M\x20>\x20250M\x20'+'principal),\x20which\x20is\x20why\x20the\x20client\x20keeps\x20the\x20acknowledge_dual_payout\x20gate\x20(keeper\x20posture\x20拍板⑧\x20'+'dm-mtw-261027:\x20the\x20flag\x20stays\x20a\x20HUMAN\x20netting\x20decision\x20—\x20an\x20automated\x20keeper\x20refused\x20with\x20'+'dual_payout_unconfirmed\x20must\x20stop\x20and\x20escalate,\x20never\x20self-ack;\x20every\x20refusal\x20envelope\x20carries\x20the\x20'+'KEEPER\x20DIRECTIVE\x20verbatim).\x20claim\x20mechanics:\x20'+'compensate()\x20sets\x20claimed_by\x20when\x20an\x20award\x20is\x20CLAIMED\x20—\x20and\x20since\x20BF-14\x20a\x20zero-award\x20claim\x20aborts\x20'+'E_ZERO_INDEMNITY_CLAIM\x20inside\x20arbitration\x20finalization\x20BEFORE\x20any\x20state\x20change,\x20so\x20a\x20plain\x20dismissal\x20leaves\x20'+'the\x20flag\x20unset\x20and\x20refund\x20rails\x20live.\x20RULED-ZERO\x20SEAL\x20(F-BS-54/56,\x20protocol\x20154\x20'+'enable_arb_dismissal_conclusion_gate):\x20the\x20arbitration\x20conclusion\x20operation\x20stamps\x20claimed_by\x20on\x20a\x20CONCLUDED\x20DISMISSAL\x20'+'(amount-insensitive,\x20BKN-P1\x20decision\x20option\x20a)\x20—\x20on\x20protocol\x20>=\x20154\x20a\x20ruled-zero\x20closes\x20the\x20'+'claimed_by-none\x20refund\x20rails\x20at\x20ruling\x20time\x20and\x20the\x20recover\x20rail\x20becomes\x20the\x20only\x20escrow\x20exit\x20'+'(principal\x20exits\x20to\x20the\x20MERCHANT,\x20not\x20the\x20buyer).\x20On\x20a\x20PRE-154\x20network,\x20or\x20when\x20no\x20keeper\x20runs\x20'+'the\x20arbitration\x20conclusion\x20operation,\x20a\x20ruled-zero\x20does\x20NOT\x20seal:\x20the\x20buyer\x20can\x20lose\x20the\x20arbitration\x20and\x20still\x20walk\x20the\x20'+'refund\x20rail\x20—\x20probe\x20the\x20protocol\x20feature\x20before\x20relying\x20on\x20it.\x20STRANDING\x20IS\x20A\x20SERVICE-SHAPE\x20BUG,\x20'+'NOT\x20A\x20CHAIN\x20RULE:\x20gating\x20a\x20refund\x20rail\x20on\x20claimed_by\x20none\x20while\x20shipping\x20NO\x20recover\x20rail\x20leaves\x20a\x20'+'claimed\x20order\x20with\x20no\x20escrow\x20exit\x20(h1b-tn-261024\x20O11\x20live:\x201.0\x20WOW\x20stranded\x20after\x20a\x20zero-payout\x20'+'dismissal).\x20The\x20compile-time\x20rail\x20verifier\x20blocks\x20that\x20shape\x20pre-publish\x20'+'(RAIL_AWARD_EXIT_MISSING).\x20The\x20pairing\x20guarantees\x20no\x20stranding,\x20not\x20no-misallocation:\x20'+'award-amount\x20polarity\x20is\x20not\x20expressible\x20on\x20the\x20refund\x20track\x20(long-term:\x20N-9\x20order-authority\x20'+'model\x20window)'],'recommended_templates':['T-AB-01','T-AB-05']},{'id':'arbitration_reset','name':'Reset\x20arbitration\x20—\x20principal\x20resubmits\x20materials','operation_category':'ruling','permission_index':0x16b,'permission_name':'ARBITRATION_RESET','required_arb_status':['Objectionable','Arbitrator_confirming'],'resulting_arb_status':'Principal_confirming','requires_voting_guard':'any','requires_usage_guard':'not_applicable','has_passport_variant':!![],'governed_operations':['reset\x20the\x20arbitration\x20(principal\x20resubmits\x20materials)'],'common_patterns':['Resets\x20Arb\x20from\x20Objectionable/Arbitrator_confirming\x20→\x20Principal_confirming','Used\x20when\x20principal\x20objects\x20to\x20ruling\x20and\x20resubmits\x20materials','Feedback\x20required\x20(string\x20explaining\x20reset\x20reason)','Restart\x20full\x20lifecycle:\x20Principal_confirming\x20→\x20...\x20→\x20Finished'],'recommended_templates':['T-AB-07']},{'id':'arbitration_arb_withdraw','name':'Withdraw\x20arbitration\x20fees\x20from\x20Arb\x20into\x20Arbitration.balance','operation_category':'fund','permission_index':0x16c,'permission_name':'ARBITRATION_ARB_WITHDRAW','required_arb_status':['Finished','Arbitrated'],'requires_voting_guard':'not_applicable','requires_usage_guard':'not_applicable','has_passport_variant':!![],'governed_operations':['withdraw\x20arbitration\x20fees\x20from\x20the\x20Arb\x20into\x20Arbitration.balance'],'common_patterns':['Moves\x20fees\x20from\x20the\x20Arb\x20object\x20into\x20Arbitration.balance\x20(clock-checked)','Finished:\x20withdraw\x20immediately','Arbitrated:\x20must\x20wait\x20WITHDRAW_DURATION_TIME\x20(30d)\x20past\x20indemnity.time\x20—\x20silence\x20=\x20acceptance','Objectionable:\x20NEVER\x20withdrawable\x20(protocol\x20141)\x20—\x20the\x20fee\x20stays\x20escrowed\x20until\x20the\x20objection\x20cycle\x20is\x20closed\x20by\x20the\x20principal\x20re-confirming','Increases\x20Arbitration.balance\x20—\x20funds\x20available\x20for\x20fee\x20allocation/transfer'],'recommended_templates':['T-AB-06']},{'id':'arbitration_fees_alloc','name':'Allocate\x20arbitration\x20fees\x20to\x20Allocation\x20object','operation_category':'fund','permission_index':0x16d,'permission_name':'ARBITRATION_FEES_ALLOC','requires_voting_guard':'not_applicable','requires_usage_guard':'not_applicable','has_passport_variant':!![],'governed_operations':['allocate\x20arbitration\x20fees\x20to\x20an\x20Allocation\x20object'],'common_patterns':['Destination:\x20Allocation\x20object\x20(parameterized\x20fund\x20distribution)','payment_remark\x20+\x20payment_index:\x20bookkeeping\x20for\x20Payment\x20object','May\x20create\x20new\x20Payment\x20object\x20if\x20newPayment\x20name\x20provided','Triggers\x20balance::withdraw_all\x20—\x20extracts\x20ALL\x20balance'],'recommended_templates':['T-AB-06']},{'id':'arbitration_fees_transfer','name':'Transfer\x20arbitration\x20fees\x20to\x20Treasury\x20object','operation_category':'fund','permission_index':0x16e,'permission_name':'ARBITRATION_FEES_TRANSFER','requires_voting_guard':'not_applicable','requires_usage_guard':'not_applicable','has_passport_variant':!![],'governed_operations':['transfer\x20arbitration\x20fees\x20to\x20a\x20Treasury\x20object'],'common_patterns':['Destination:\x20Treasury\x20object\x20(general\x20fund\x20pool)','Same\x20bookkeeping\x20as\x20fee\x20allocation\x20(remark\x20+\x20index\x20+\x20newPayment)','Triggers\x20balance::withdraw_all\x20—\x20extracts\x20ALL\x20balance','Choose\x20Allocation\x20vs\x20Treasury\x20by\x20distribution\x20need'],'recommended_templates':['T-AB-06']},{'id':'arbitration_voting_guard_config','name':'Configure\x20voting_guard\x20list\x20(add\x20/\x20set\x20/\x20remove\x20/\x20clear)','operation_category':'guard','permission_index':0x162,'permission_name':'ARBITRATION_VOTING_GUARD','requires_voting_guard':'any','requires_usage_guard':'not_applicable','has_passport_variant':!![],'governed_operations':['add\x20a\x20passport-identifier\x20voting\x20guard\x20(dynamic\x20weight)','add\x20a\x20fixed-weight\x20voting\x20guard','remove\x20a\x20voting\x20guard','clear\x20the\x20voting\x20guard\x20list'],'common_patterns':['Max\x2050\x20guards:\x20MAX_VOTING_GUARD_COUNT=50\x20(off-by-one-safe:\x20len<50\x20allows\x20add)','GuardIdentifier(u8):\x20dynamic\x20weight\x20from\x20Passport\x20submission\x20value','FixedValue(u32):\x20static\x20weight\x20(e.g.\x20100\x20votes\x20per\x20holder)','Add\x20same\x20guard\x20twice\x20→\x20updates\x20vote_weight\x20(no\x20duplicate)','op=\x27set\x27\x20=\x20clear\x20then\x20add;\x20op=\x27add\x27\x20=\x20append;\x20op=\x27remove\x27\x20=\x20by\x20address'],'recommended_templates':['T-AB-02','T-AB-03']},{'id':'arbitration_usage_guard_config','name':'Configure\x20usage_guard\x20(set\x20/\x20clear)','operation_category':'guard','permission_index':0x163,'permission_name':'ARBITRATION_USAGE_GUARD','requires_voting_guard':'not_applicable','requires_usage_guard':'any','has_passport_variant':!![],'governed_operations':['set\x20the\x20usage\x20guard\x20(restrict\x20who\x20can\x20file\x20disputes)','clear\x20the\x20usage\x20guard'],'common_patterns':['Single\x20guard\x20(Option<address>)\x20—\x20not\x20a\x20list','Some(guard):\x20the\x20dispute\x20must\x20go\x20through\x20passport\x20verification','None:\x20dispute\x20can\x20use\x20either\x20variant\x20(no\x20passport\x20needed)','object-linker\x20affiliation\x20change:\x20updates\x20link\x20when\x20guard\x20changes'],'recommended_templates':['T-AB-04']},{'id':'arbitration_pause','name':'Pause\x20/\x20resume\x20Arbitration\x20service','operation_category':'lifecycle','permission_index':0x164,'permission_name':'ARBITRATION_PAUSE','requires_voting_guard':'not_applicable','requires_usage_guard':'not_applicable','has_passport_variant':!![],'governed_operations':['pause/resume\x20the\x20arbitration\x20service'],'common_patterns':['bPaused\x20default\x20true\x20—\x20new\x20Arbitration\x20cannot\x20accept\x20disputes','pause(false)\x20to\x20enable,\x20pause(true)\x20to\x20disable','Paused\x20Arbitration\x20rejects\x20dispute\x20(E_PAUSED)','Does\x20not\x20affect\x20already-open\x20Arb\x20cases'],'recommended_templates':['T-AB-01']},{'id':'arbitration_service_statement','name':'Service\x20(defendant)\x20appends\x20a\x20text\x20statement\x20to\x20the\x20case\x20record','operation_category':'dispute','permission_index':0x141,'permission_name':'SERVICE_ARB_STATEMENT','requires_voting_guard':'not_applicable','requires_usage_guard':'not_applicable','has_passport_variant':!![],'governed_operations':['append\x20the\x20seller\x27s\x20text\x20statement\x20to\x20a\x20case\x20against\x20an\x20order\x20of\x20the\x20service\x20(ArbStatementEvent)'],'common_patterns':['Defendant-side\x20voice\x20WITHOUT\x20holding\x20the\x20order\x20—\x20the\x20arb/arbitration\x20function\x20family\x20is\x20order-anchored;\x20this\x20entry\x20is\x20service-anchored','PRIMARY\x20evidence\x20channel\x20is\x20Messenger:\x20submit\x20encrypted\x20WTS\x20records\x20of\x20the\x20exchange\x20with\x20the\x20order\x20customer\x20first','This\x20statement\x20is\x20the\x20SECONDARY\x20channel:\x20declare\x20facts\x20or\x20report\x20customer\x20behavior\x20(absence,\x20non-cooperation)\x20on\x20the\x20case\x20record','Event-only:\x20nothing\x20on\x20the\x20Arb\x20object\x20is\x20mutated;\x20the\x20record\x20cannot\x20be\x20rewritten\x20or\x20deleted\x20by\x20any\x20party','Text\x20length\x20cap\x20identical\x20to\x20description/objection\x20(DESCRIPTION\x20bound,\x204000)'],'recommended_templates':[]}];export const ARBITRATION_LEDGER_VERSION='1.0.0';export function getScenesByCategory(a){return ARBITRATION_SCENES['filter'](b=>b['operation_category']===a);}export function findSceneById(a){return ARBITRATION_SCENES['find'](b=>b['id']===a);}export function findSceneByPermissionIndex(a){return ARBITRATION_SCENES['find'](b=>b['permission_index']===a);}export function getPermissionByIndex(a){return ARBITRATION_PERMISSIONS['find'](b=>b['index']===a);}export function getPermissionByName(a){return ARBITRATION_PERMISSIONS['find'](b=>b['name']===a);}export function isReservedIndex(a){const b=getPermissionByIndex(a);return!!b?.['is_reserved'];}export function isUsedPermissionIndex(a){const b=getPermissionByIndex(a);return!!b&&!b['is_reserved'];}export function getActivePermissionCount(){return ARBITRATION_PERMISSIONS['filter'](a=>!a['is_reserved'])['length'];}export function inferSceneFromIntent(a){const b=a['toLowerCase'](),c=[{'keywords':['create','new'],'sceneId':'arbitration_create'},{'keywords':['dispute','file','complaint'],'sceneId':'arbitration_dispute'},{'keywords':['vote','voting','decide'],'sceneId':'arbitration_vote'},{'keywords':['confirm','materials'],'sceneId':'arbitration_confirm'},{'keywords':['feedback','opinion'],'sceneId':'arbitration_feedback'},{'keywords':['ruling','arbitration','verdict'],'sceneId':'arbitration_ruling'},{'keywords':['reset','resubmit'],'sceneId':'arbitration_reset'},{'keywords':['arb_withdraw','withdraw','withdraw\x20fees'],'sceneId':'arbitration_arb_withdraw'},{'keywords':['allocate','allocate\x20fees','fees\x20allocation'],'sceneId':'arbitration_fees_alloc'},{'keywords':['fees_transfer','transfer','transfer\x20in'],'sceneId':'arbitration_fees_transfer'},{'keywords':['voting_guard','voting\x20guard'],'sceneId':'arbitration_voting_guard_config'},{'keywords':['usage_guard','usage\x20guard'],'sceneId':'arbitration_usage_guard_config'},{'keywords':['pause','enable'],'sceneId':'arbitration_pause'}];for(const {keywords:d,sceneId:e}of c){if(d['some'](f=>b['includes'](f['toLowerCase']()))){const f=findSceneById(e);if(f)return f;}}return undefined;}export function getDualGuardMatrixEntry(a,b){return DUAL_GUARD_MATRIX['find'](c=>c['voting_guard_empty']===a&&c['usage_guard_empty']===b);}export function isValidArbStatusTransition(a,b){const c={'Principal_confirming':['Arbitrator_confirming'],'Arbitrator_confirming':['Voting','Principal_confirming'],'Voting':['Arbitrated'],'Arbitrated':['Objectionable','Finished','Withdrawn'],'Objectionable':['Principal_confirming'],'Finished':['Withdrawn'],'Withdrawn':[]};return c[a]?.['includes'](b)??![];}export function isTerminalArbStatus(a){return ARB_TERMINAL_STATUSES['includes'](a);}export function getScenesProducingStatus(a){return ARBITRATION_SCENES['filter'](b=>b['resulting_arb_status']===a);}export function getScenesRequiringStatus(a){return ARBITRATION_SCENES['filter'](b=>b['required_arb_status']?.['includes'](a));}export function getArbitrationScenesCount(){return ARBITRATION_SCENES['length'];}export function getAllArbitrationPermissions(){return[...ARBITRATION_PERMISSIONS];}export function getActiveArbitrationPermissions(){return ARBITRATION_PERMISSIONS['filter'](a=>!a['is_reserved']);}
|
|
@@ -64,6 +64,43 @@ export declare function guardTimeProfileDetail(g: {
|
|
|
64
64
|
} | null;
|
|
65
65
|
export declare function rewardRefsOf(d: any): string[];
|
|
66
66
|
export declare function serviceRewardsUnfundedDetail(rewardObj: unknown): string | null;
|
|
67
|
+
export type TaskBindingAdvisoryCode = "TASKBIND-254-MISSING" | "TASKBIND-254-UNVERIFIED" | "TASKBIND-254-REFUND-REPLAY";
|
|
68
|
+
export interface TaskBindingRemediation {
|
|
69
|
+
entry: TaskBindingRemediationEntry;
|
|
70
|
+
trigger: string;
|
|
71
|
+
}
|
|
72
|
+
export interface TaskBindingRemediationEntry {
|
|
73
|
+
identifier: number;
|
|
74
|
+
b_submission: true;
|
|
75
|
+
value_type: "Address";
|
|
76
|
+
name: string;
|
|
77
|
+
}
|
|
78
|
+
export interface TaskBindingAdvisory {
|
|
79
|
+
code: TaskBindingAdvisoryCode;
|
|
80
|
+
level: "warning";
|
|
81
|
+
detail: string;
|
|
82
|
+
remediation?: TaskBindingRemediation;
|
|
83
|
+
}
|
|
84
|
+
export declare const TASK_BINDING_REMEDIATION_ENTRY: TaskBindingRemediationEntry;
|
|
85
|
+
export declare function declaresTaskBindingSlot(table: unknown): boolean;
|
|
86
|
+
export declare const REFUND_RAIL_NODE_REGEX: RegExp;
|
|
87
|
+
export interface TaskBindingAdvisoryInput {
|
|
88
|
+
guardRef?: string;
|
|
89
|
+
table: unknown;
|
|
90
|
+
allocatorBound?: boolean;
|
|
91
|
+
refundReentry?: boolean;
|
|
92
|
+
}
|
|
93
|
+
export declare function lintTaskBindingAdvisories(input: TaskBindingAdvisoryInput): TaskBindingAdvisory[];
|
|
94
|
+
export interface MachineTaskBindingPreflightInput {
|
|
95
|
+
refs: string[];
|
|
96
|
+
resolved: Array<{
|
|
97
|
+
ref: string;
|
|
98
|
+
table: unknown;
|
|
99
|
+
}>;
|
|
100
|
+
readError?: string;
|
|
101
|
+
}
|
|
102
|
+
export declare function lintMachineTaskBindingPreflight(input: MachineTaskBindingPreflightInput): TaskBindingAdvisory[];
|
|
103
|
+
export declare function formatTaskBindingAdvisory(f: TaskBindingAdvisory, gate?: string): string;
|
|
67
104
|
export declare const AUDIT_RULES: AuditRule[];
|
|
68
105
|
export declare function auditService(data: any, context?: AuditContext): AuditFinding[];
|
|
69
106
|
export declare function hasBlockingErrors(findings: AuditFinding[]): boolean;
|