@wowok/agent-mcp 3.3.8 → 3.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chain-semantics/field-capability.js +1 -1
- package/dist/chain-semantics/freeze-map.js +1 -1
- package/dist/chain-semantics/fund-flow.js +1 -1
- package/dist/chain-semantics/guard-verbs.js +1 -1
- package/dist/chain-semantics/object-graph.js +1 -1
- package/dist/composition/audit.js +1 -1
- package/dist/composition/compile.d.ts +3 -2
- package/dist/composition/compile.js +1 -1
- package/dist/composition/inflight.d.ts +6 -0
- package/dist/composition/inflight.js +1 -1
- package/dist/composition/materialize.d.ts +4 -0
- package/dist/composition/materialize.js +1 -1
- package/dist/composition/param-disclosure.d.ts +61 -0
- package/dist/composition/param-disclosure.js +1 -0
- package/dist/composition/plan.d.ts +11 -1
- package/dist/composition/plan.js +1 -1
- package/dist/customer/account-events.js +1 -1
- package/dist/data/api/api.spec.js +1 -1
- package/dist/data/api/cli.js +1 -1
- package/dist/data/api/server.d.ts +1 -0
- package/dist/data/api/server.js +1 -1
- package/dist/data/projection/store.d.ts +2 -1
- package/dist/data/projection/store.js +1 -1
- package/dist/data/projection/types.d.ts +10 -0
- package/dist/data/sync/cdc.js +1 -1
- package/dist/data/sync/cdc.spec.js +1 -1
- package/dist/data/sync/store.d.ts +5 -0
- package/dist/data/sync/store.js +1 -1
- package/dist/data/sync/types.d.ts +2 -0
- package/dist/evaluation/builtins/graph-service.spec.js +1 -1
- package/dist/evaluation/engine.js +1 -1
- package/dist/evaluation/guard-scan.js +1 -1
- package/dist/experience/realtime-feedback.js +1 -1
- package/dist/extensions/business-modules.js +1 -1
- package/dist/extensions/industry-pack.js +1 -1
- package/dist/extensions/modes.js +1 -1
- package/dist/graph/onchain/expand.js +1 -1
- package/dist/graph/onchain/exposure.js +1 -1
- package/dist/harness/recover.js +1 -1
- package/dist/index.js +1 -1
- package/dist/knowledge/allocation-risk.js +1 -1
- package/dist/knowledge/allocation-templates.js +1 -1
- package/dist/knowledge/allocator-rail-verifier.js +1 -1
- package/dist/knowledge/arb-fund-facts.d.ts +1 -0
- package/dist/knowledge/arb-fund-facts.js +1 -1
- package/dist/knowledge/arbitration-ledger.js +1 -1
- package/dist/knowledge/arbitration-risk.d.ts +1 -0
- package/dist/knowledge/arbitration-risk.js +1 -1
- package/dist/knowledge/audit-rules.js +1 -1
- package/dist/knowledge/baselines/rules/allocation.json +6 -6
- package/dist/knowledge/baselines/rules/arb.json +2 -2
- package/dist/knowledge/baselines/rules/guard.json +11 -11
- package/dist/knowledge/baselines/rules/order.json +1 -1
- package/dist/knowledge/baselines/rules/plan.json +1 -1
- package/dist/knowledge/baselines/semantic-facts.js +1 -1
- package/dist/knowledge/builtin-templates.d.ts +14 -1
- package/dist/knowledge/builtin-templates.js +1 -1
- package/dist/knowledge/catalog-facts.d.ts +4 -0
- package/dist/knowledge/catalog-facts.js +1 -0
- package/dist/knowledge/commission-landing.js +1 -1
- package/dist/knowledge/component-schema.d.ts +64 -0
- package/dist/knowledge/component-schema.js +1 -0
- package/dist/knowledge/entity-recipient-guard.js +1 -1
- package/dist/knowledge/event-semantics.js +1 -1
- package/dist/knowledge/fee-param-bindings.d.ts +26 -0
- package/dist/knowledge/fee-param-bindings.js +1 -0
- package/dist/knowledge/fund-layer.js +1 -1
- package/dist/knowledge/getting-started.d.ts +2 -2
- package/dist/knowledge/getting-started.js +1 -1
- package/dist/knowledge/guard-anchor-reach.js +1 -1
- package/dist/knowledge/guard-design-patterns.js +1 -1
- package/dist/knowledge/guard-ledger.js +1 -1
- package/dist/knowledge/guard-lint.d.ts +1 -0
- package/dist/knowledge/guard-lint.js +1 -1
- package/dist/knowledge/guard-puzzle.js +1 -1
- package/dist/knowledge/guard-risk.js +1 -1
- package/dist/knowledge/guard-templates.d.ts +1 -1
- package/dist/knowledge/guard-templates.js +1 -1
- package/dist/knowledge/guard-translation.js +1 -1
- package/dist/knowledge/index.js +1 -1
- package/dist/knowledge/industry-registry.js +1 -1
- package/dist/knowledge/industry-strategy.js +1 -1
- package/dist/knowledge/jsonrpc-enum.d.ts +14 -3
- package/dist/knowledge/jsonrpc-enum.js +1 -1
- package/dist/knowledge/knob-docs.d.ts +5 -0
- package/dist/knowledge/knob-docs.js +1 -0
- package/dist/knowledge/machine-templates.js +1 -1
- package/dist/knowledge/machine-topology.js +1 -1
- package/dist/knowledge/machine-translation.js +1 -1
- package/dist/knowledge/onchain-constants.d.ts +2 -0
- package/dist/knowledge/onchain-constants.js +1 -1
- package/dist/knowledge/order-ledger.js +1 -1
- package/dist/knowledge/param-schema.d.ts +70 -0
- package/dist/knowledge/param-schema.js +1 -0
- package/dist/knowledge/param-tiers.d.ts +25 -0
- package/dist/knowledge/param-tiers.js +1 -0
- package/dist/knowledge/passport-ledger.d.ts +1 -1
- package/dist/knowledge/passport-ledger.js +1 -1
- package/dist/knowledge/pattern-resolutions.d.ts +106 -0
- package/dist/knowledge/pattern-resolutions.js +1 -0
- package/dist/knowledge/projection.spec.js +1 -1
- package/dist/knowledge/safety-rules.js +1 -1
- package/dist/knowledge/scenario-modes.d.ts +1 -0
- package/dist/knowledge/scenario-modes.js +1 -1
- package/dist/knowledge/scenario-topology.js +1 -1
- package/dist/knowledge/service-allocation-semantics.js +1 -1
- package/dist/knowledge/service-ledger.js +1 -1
- package/dist/knowledge/service-templates.js +1 -1
- package/dist/knowledge/strategy-manuals.d.ts +1 -1
- package/dist/knowledge/strategy-manuals.js +1 -1
- package/dist/knowledge/template-loader.d.ts +101 -1
- package/dist/knowledge/template-loader.js +1 -1
- package/dist/knowledge/template-nav.d.ts +7 -0
- package/dist/knowledge/template-nav.js +1 -0
- package/dist/knowledge/template-registry.js +1 -1
- package/dist/knowledge/template-scanner.d.ts +33 -0
- package/dist/knowledge/template-scanner.js +1 -1
- package/dist/knowledge/template-test-profiles.d.ts +17 -0
- package/dist/knowledge/template-test-profiles.js +1 -0
- package/dist/knowledge/template-validation.d.ts +1 -0
- package/dist/knowledge/template-validation.js +1 -1
- package/dist/knowledge/tools-reference.js +1 -1
- package/dist/knowledge/treasury-templates.js +1 -1
- package/dist/knowledge/workflow-guidance.js +1 -1
- package/dist/monitor/MonitorLoop.js +1 -1
- package/dist/participation/time-window.d.ts +37 -0
- package/dist/participation/time-window.js +1 -0
- package/dist/playbooks/service-build/business-puzzle.js +1 -1
- package/dist/playbooks/service-build/machine-panorama.d.ts +1 -0
- package/dist/playbooks/service-build/machine-panorama.js +1 -1
- package/dist/playbooks/service-build/merchant-guide.d.ts +4 -1
- package/dist/playbooks/service-build/merchant-guide.js +1 -1
- package/dist/playbooks/service-build/migration-planner.js +1 -1
- package/dist/playbooks/service-build/object-panorama.js +1 -1
- package/dist/playbooks/service-build/participation-radar.d.ts +1 -0
- package/dist/playbooks/service-build/participation-radar.js +1 -1
- package/dist/playbooks/service-build/relationship-profile.js +1 -1
- package/dist/playbooks/service-build/service-panorama.d.ts +1 -0
- package/dist/playbooks/service-build/service-panorama.js +1 -1
- package/dist/playbooks/service-build/service-quote.js +1 -1
- package/dist/playbooks/service-build/service-quote.spec.js +1 -1
- package/dist/playbooks/service-build/workflow-design-assessment.js +1 -1
- package/dist/relationship/registry.js +1 -1
- package/dist/review/index.js +1 -1
- package/dist/runtime/instance-registry.d.ts +7 -1
- package/dist/runtime/instance-registry.js +1 -1
- package/dist/safety/confirm-gate.js +1 -1
- package/dist/schema/benchmark-migration/index.d.ts +2 -0
- package/dist/schema/benchmark-migration/index.js +1 -1
- package/dist/schema/call/allocation.js +1 -1
- package/dist/schema/call/arbitration.js +1 -1
- package/dist/schema/call/base.d.ts +8 -0
- package/dist/schema/call/base.js +1 -1
- package/dist/schema/call/bridge.d.ts +2 -0
- package/dist/schema/call/error-codes.d.ts +1 -1
- package/dist/schema/call/error-codes.js +1 -1
- package/dist/schema/call/guard.js +1 -1
- package/dist/schema/call/handler.js +1 -1
- package/dist/schema/call/machine.js +1 -1
- package/dist/schema/call/semantic.js +1 -1
- package/dist/schema/call/service.d.ts +3 -3
- package/dist/schema/call/service.js +1 -1
- package/dist/schema/common/index.js +1 -1
- package/dist/schema/evaluation/index.d.ts +8 -0
- package/dist/schema/evaluation/index.js +1 -1
- package/dist/schema/goal/planning.d.ts +1 -0
- package/dist/schema/goal/planning.js +1 -1
- package/dist/schema/industry-pack/index.d.ts +29 -0
- package/dist/schema/industry-pack/index.js +1 -1
- package/dist/schema/local/index.d.ts +20 -0
- package/dist/schema/local/index.js +1 -1
- package/dist/schema/messenger/index.d.ts +2 -0
- package/dist/schema/messenger/index.js +1 -1
- package/dist/schema/operations.d.ts +1 -1
- package/dist/schema/operations.js +1 -1
- package/dist/schema/query/bi.d.ts +106 -0
- package/dist/schema/query/bi.js +1 -1
- package/dist/schema/query/index.d.ts +5 -5
- package/dist/schema/query/index.js +1 -1
- package/dist/schema/schema-version.js +1 -1
- package/dist/schema/watch/index.js +1 -1
- package/dist/schema-query-impl/index.js +1 -1
- package/dist/schemas/account_operation.output.json +4 -2
- package/dist/schemas/benchmark_migration_operation.output.json +3 -3
- package/dist/schemas/benchmark_migration_operation.schema.json +16 -2
- package/dist/schemas/bridge_operation.output.json +4 -2
- package/dist/schemas/bridge_operation.schema.json +5 -5
- package/dist/schemas/evaluation_operation.output.json +16 -0
- package/dist/schemas/guard2file.schema.json +1 -1
- package/dist/schemas/index.json +1 -1
- package/dist/schemas/industry_pack_operation.output.json +150 -1
- package/dist/schemas/industry_pack_operation.schema.json +9 -3
- package/dist/schemas/keeper_operation.output.json +2 -2
- package/dist/schemas/local_cache_operation.output.json +4 -2
- package/dist/schemas/local_history_operation.output.json +4 -2
- package/dist/schemas/local_info_operation.output.json +4 -2
- package/dist/schemas/local_mark_operation.output.json +4 -2
- package/dist/schemas/machineNode2file.schema.json +1 -1
- package/dist/schemas/messenger_operation.output.json +13 -2
- package/dist/schemas/messenger_operation.schema.json +41 -34
- package/dist/schemas/monitor_events.output.json +2 -2
- package/dist/schemas/monitor_subscription.output.json +2 -2
- package/dist/schemas/onchain_events.output.json +14 -14
- package/dist/schemas/onchain_operations.output.json +13 -10
- package/dist/schemas/onchain_operations.schema.json +124 -99
- package/dist/schemas/onchain_operations_allocation.schema.json +7 -6
- package/dist/schemas/onchain_operations_arbitration.schema.json +7 -6
- package/dist/schemas/onchain_operations_contact.schema.json +4 -3
- package/dist/schemas/onchain_operations_demand.schema.json +4 -3
- package/dist/schemas/onchain_operations_gen_passport.schema.json +4 -3
- package/dist/schemas/onchain_operations_gen_proof.schema.json +1 -1
- package/dist/schemas/onchain_operations_guard.schema.json +7 -6
- package/dist/schemas/onchain_operations_machine.schema.json +9 -7
- package/dist/schemas/onchain_operations_order.schema.json +6 -4
- package/dist/schemas/onchain_operations_payment.schema.json +2 -2
- package/dist/schemas/onchain_operations_permission.schema.json +19 -15
- package/dist/schemas/onchain_operations_personal.schema.json +17 -14
- package/dist/schemas/onchain_operations_progress.schema.json +6 -4
- package/dist/schemas/onchain_operations_proof.schema.json +4 -3
- package/dist/schemas/onchain_operations_repository.schema.json +9 -7
- package/dist/schemas/onchain_operations_reward.schema.json +5 -4
- package/dist/schemas/onchain_operations_service.schema.json +15 -12
- package/dist/schemas/onchain_operations_treasury.schema.json +4 -3
- package/dist/schemas/onchain_table_data.output.json +18 -13
- package/dist/schemas/onchain_table_data.schema.json +13 -13
- package/dist/schemas/query_toolkit.output.json +301 -33
- package/dist/schemas/query_toolkit.schema.json +6 -6
- package/dist/schemas/watch_operation.output.json +3 -3
- package/dist/schemas/workflow_operation.schema.json +3 -2
- package/dist/schemas/wowok_buildin_info.schema.json +1 -1
- package/dist/task/playbook.js +1 -1
- package/dist/tools/handlers/benchmark-migration.d.ts +1 -0
- package/dist/tools/handlers/benchmark-migration.js +1 -1
- package/dist/tools/handlers/config.js +1 -1
- package/dist/tools/handlers/evaluation.js +1 -1
- package/dist/tools/handlers/evaluation.spec.js +1 -1
- package/dist/tools/handlers/industry-pack.js +1 -1
- package/dist/tools/handlers/messenger.js +1 -1
- package/dist/tools/handlers/onchain.d.ts +4 -0
- package/dist/tools/handlers/onchain.js +1 -1
- package/dist/tools/index.js +1 -1
- package/dist/tools/registry/business.js +1 -1
- package/dist/tools/registry/onchain.js +1 -1
- package/dist/tools/registry/query.js +1 -1
- package/dist/tools/sanitize-output.js +1 -1
- package/dist/tools/sanitize-output.spec.js +1 -1
- package/dist/tools/types.d.ts +1 -0
- package/dist/tools/upgrade-check.d.ts +22 -0
- package/dist/tools/upgrade-check.js +1 -1
- package/dist/tools/wrap.d.ts +1 -1
- package/dist/tools/wrap.js +1 -1
- package/package.json +7 -6
|
@@ -1 +1 @@
|
|
|
1
|
-
import{MAX_INDEMNITY_MULTIPLE,TASK_BINDING_SLOT}from'./onchain-constants.js';import{TWO_TX_RENEW_RECIPE}from'./protocol-facts.js';import{lintForwardAmbiguity,findLoopCycles}from'./machine-topology.js';import{isRenewalLoopEdge}from'../participation/radar-core.js';function numericAmount(a){if(typeof a==='number')return Number['isFinite'](a)?a:undefined;if(typeof a==='string'){const b=a['trim']();if(/^\d+$/['test'](b))return Number(b);}return undefined;}export{numericAmount};export function salesItemsOf(a){if(Array['isArray'](a?.['sales']))return a['sales'];if(Array['isArray'](a?.['sales']?.['sales']))return a['sales']['sales'];return[];}export function allocatorCountOf(a){const b=a?.['order_allocators'];if(Array['isArray'](b))return b['length'];if(Array['isArray'](b?.['allocators']))return b['allocators']['length'];return 0x0;}export function arbitrationRefsOf(b){const c=b?.['arbitrations'];if(Array['isArray'](c))return c['filter'](e=>typeof e==='string');if(Array['isArray'](c?.['objects']))return c['objects']['filter'](e=>typeof e==='string');return[];}export function compensationFundOf(a){if(a?.['compensation_fund_add']?.['balance']!=null)return a['compensation_fund_add']['balance'];if(a?.['compensation_fund']!=null)return a['compensation_fund'];return undefined;}export function serviceNameOf(a){if(typeof a?.['object']==='string')return a['object'];if(typeof a?.['object']?.['name']==='string'&&a['object']['name'])return a['object']['name'];if(typeof a?.['namedNew']?.['name']==='string'&&a['namedNew']['name'])return a['namedNew']['name'];return undefined;}export function typeParameterOf(a){if(typeof a?.['type_parameter']==='string'&&a['type_parameter'])return a['type_parameter'];if(typeof a?.['object']?.['type_parameter']==='string'&&a['object']['type_parameter'])return a['object']['type_parameter'];if(typeof a?.['namedNew']?.['type_parameter']==='string'&&a['namedNew']['type_parameter'])return a['namedNew']['type_parameter'];return undefined;}export const DISPUTE_FAMILY_NODE_REGEX=/(^|_)(disputed?|arbitration|arb)(_|$)/i;export const FUND_TERMINAL_NODE_REGEX=/^(refund|refunded|deposit_refunded|deposit_deducted|cancel|cancelled)$/i;export const ANTI_PATTERN_NODE_REGEX=new RegExp(DISPUTE_FAMILY_NODE_REGEX['source']+'|'+FUND_TERMINAL_NODE_REGEX['source'],'i');export const REMEDY_FAMILY_NODE_REGEX=/(revis|review|rework|refund|cancel|return|claim)/i;export function isRemedyLoopEdge(a,b){return REMEDY_FAMILY_NODE_REGEX['test'](a)||REMEDY_FAMILY_NODE_REGEX['test'](b);}export function classifyLoopCycle(a,b){for(let c=0x0;c<a['length'];c++){if(isRenewalLoopEdge(a[c],a[(c+0x1)%a['length']]))return'renewal';}if(b==='review-loop')return'remedy';if(b==='paid-cycle')return'charge';if(a['some'](d=>REMEDY_FAMILY_NODE_REGEX['test'](d)))return'remedy';return'charge';}export function auditMachineNodes(a,b){const c=[],d=[];if(!Array['isArray'](a)||a['length']===0x0)return d['push']('pre_publish:\x20machine\x20node\x20set\x20unavailable\x20—\x20topology\x20not\x20verifiable;\x20'+'verify\x20via\x20machineNode2file\x20BEFORE\x20publish\x20(immutable\x20after\x20publish,\x20IMMUT-001)'),{'critical':c,'warnings':d};const e=a;for(const u of e){const v=typeof u?.['name']==='string'?u['name']:'';if(!v)continue;if(DISPUTE_FAMILY_NODE_REGEX['test'](v))c['push']('R-M1-11:\x20machine\x20node\x20\x22'+v+'\x22\x20models\x20dispute\x20flow\x20—\x20'+'disputes\x20must\x20route\x20via\x20the\x20separate\x20Arbitration\x20object\x20(off-Machine);\x20'+'rename\x20the\x20node\x20to\x20the\x20business\x20state\x20that\x20triggers\x20it');else FUND_TERMINAL_NODE_REGEX['test'](v)&&d['push']('R-M1-11:\x20machine\x20node\x20\x22'+v+'\x22\x20uses\x20a\x20bare\x20fund-terminal\x20name\x20—\x20reaching\x20'+'it\x20moves\x20no\x20funds\x20by\x20itself.\x20This\x20is\x20legitimate\x20ONLY\x20when\x20a\x20refund\x20allocator\x20'+'rail\x27s\x20guard\x20anchors\x20to\x20this\x20node\x20(per-node\x20refund\x20tracks);\x20otherwise\x20rename\x20it\x20'+'to\x20the\x20business\x20state\x20(e.g.\x20cancel_requested\x20/\x20closed_cancel)\x20and\x20route\x20the\x20'+'refund\x20via\x20an\x20Allocator\x20triggered\x20by\x20that\x20state.\x20The\x20template\x20scanner\x20verifies\x20'+'the\x20anchoring\x20when\x20a\x20template\x20is\x20present.');}const g=new Set();for(const w of e){const x=typeof w?.['name']==='string'?w['name']:'';if(!x)continue;g['has'](x)&&c['push']('MC-C-04:\x20duplicate\x20machine\x20node\x20name\x20\x22'+x+'\x22\x20—\x20on-chain\x20will\x20reject\x20the\x20publish\x20transaction'),g['add'](x);}const h=e['some'](y=>Array['isArray'](y?.['pairs'])&&y['pairs']['some'](z=>z?.['prev_node']===''));!h&&c['push']('Machine\x20has\x20no\x20entry\x20pair\x20(prev_node=\x22\x22)\x20—\x20Progress\x20can\x20never\x20advance\x20'+'from\x20the\x20initial\x20state;\x20orders\x20are\x20permanently\x20stuck');const i=new Map();for(const y of e){const z=typeof y?.['name']==='string'&&y['name']!==''?y['name']:'(unnamed\x20node)';for(const A of Array['isArray'](y?.['pairs'])?y['pairs']:[]){const B=A?.['prev_node'];if(typeof B!=='string')continue;const C=Array['isArray'](A?.['forwards'])?A['forwards']:[];for(const D of C){const E=typeof D==='string'?D:typeof D?.['name']==='string'?D['name']:'';if(E==='')continue;const F=B+'\x00'+E,G=i['get'](F);if(G===z)c['push']('H-09:\x20duplicate\x20machine\x20edge\x20(prev_node\x20\x22'+B+'\x22\x20->\x20forward\x20\x22'+E+'\x22)\x20re-declared\x20on\x20node\x20\x22'+z+'\x22\x20—\x20'+'partitioned\x20building\x20re-sends\x20are\x20APPEND-ONLY\x20on\x20the\x20draft\x20(sso-tn-261027:\x2017\x20entries\x20/\x2014\x20unique\x20names);\x20'+'the\x20chain\x20edge\x20lookup\x20takes\x20the\x20FIRST\x20match,\x20so\x20every\x20extra\x20copy\x20is\x20unreachable\x20dead\x20weight\x20that\x20ships\x20'+'the\x20draft\x27s\x20ghost\x20edges\x20into\x20an\x20immutable\x20machine\x20(IMMUT-001).\x20Drop\x20the\x20duplicate\x20pair\x20'+'(delete\x20it\x20on\x20the\x20still-unpublished\x20draft\x20machine)\x20before\x20publishing');else G===undefined&&i['set'](F,z);}}}const j=new Map();for(const H of e){const I=typeof H?.['name']==='string'?H['name']:'';if(!I)continue;if(!j['has'](I))j['set'](I,[]);for(const J of H?.['pairs']??[]){const K=J?.['prev_node'];if(typeof K==='string'&&K!==''){const L=j['get'](K);if(L)L['push'](I);else j['set'](K,[I]);}}}const k=findLoopCycles(j)['map'](M=>({'c':M,'tier':classifyLoopCycle(M['cycle'],b)})),l=k['filter'](M=>M['tier']==='renewal'),m=k['filter'](M=>M['tier']==='remedy'),o=k['filter'](M=>M['tier']==='charge');o['length']>0x0&&c['push']('pre_publish:\x20machine\x20contains\x20charge-bearing\x20loop\x20cycle(s)\x20'+o['map'](M=>'['+M['c']['cycle']['join']('\x20->\x20')+']')['join'](',\x20')+'\x20—\x20'+'on-chain\x20a\x20revisit\x20is\x20NOT\x20verified\x20to\x20re-fund\x20the\x20Allocation,\x20and\x20this\x20static\x20pass\x20sees\x20only\x20the\x20forward\x27s\x20guard\x20reference\x20'+'(never\x20the\x20guard\x20table),\x20so\x20a\x20per-revisit-fee\x20cycle\x20(retake\x20/\x20session-card\x20shape)\x20is\x20UNPROVABLE\x20here\x20even\x20though\x20the\x20'+'allocation.balance\x20Guard\x20query\x20(1051,\x20witness\x20OrderAllocation\x20109)\x20makes\x20the\x20fee\x20enforceable\x20at\x20the\x20guard\x20layer\x20'+'(zero-value\x20re-delivery\x20cycles,\x20test/11\x20R2-F3\x20/\x20crs\x20P2-3).\x20THREE\x20WAYS\x20OUT\x20—\x20'+'(1)\x20NO-CHARGE\x20revisit\x20(F-06,\x20ctra-mn\x20261019:\x20a\x20delivered->in_progress\x20revision\x20loop\x20is\x20business-correct\x20and\x20was\x20false-CRITICAL\x20here):\x20'+'declare\x20`reentry_kind:\x20\x22review-loop\x22`\x20on\x20this\x20publish\x20payload\x20(AP-3\x20—\x20machine-checkable,\x20no\x20renaming\x20needed)\x20'+'OR\x20rename\x20ANY\x20ONE\x20node\x20of\x20the\x20cycle\x20with\x20a\x20remedy\x20word\x20root\x20the\x20classifier\x20reads\x20—\x20revis*/review*/rework*/refund*/cancel*/return*/claim*\x20'+'(e.g.\x20\x27revising\x27\x20instead\x20of\x20\x27in_progress\x27)\x20—\x20and\x20the\x20cycle\x20reclassifies\x20as\x20remedy\x20tier\x20(warning,\x20not\x20a\x20blocker);\x20'+'(2)\x20GENUINELY\x20charge-bearing\x20with\x20neutral\x20names:\x20declare\x20`reentry_kind:\x20\x22paid-cycle\x22`\x20(keeps\x20this\x20block\x20—\x20'+'it\x20is\x20the\x20declaration\x20of\x20intent)\x20and\x20bind\x20the\x20fund-gate\x20Guard\x20on\x20the\x20loop\x20forward\x20'+'(constant\x20=\x20order\x20address,\x20convert_witness\x20OrderAllocation,\x20allocation.balance\x20>=\x20revisit\x20fee)\x20AND\x20publish\x20through\x20a\x20template\x20'+'carrying\x20that\x20convention\x20—\x20PRE-STATE\x20CONSTRAINT\x20(esound-mn-261021\x20B-1):\x20the\x20gate\x20reads\x20the\x20COMMITTED\x20pre-transaction\x20'+'balance,\x20so\x20the\x20revisit\x20funds\x20must\x20be\x20committed\x20in\x20a\x20PRIOR\x20transaction.\x20'+TWO_TX_RENEW_RECIPE+'\x20'+'Alternatively\x20replace\x20the\x20loop\x20with\x20per-period\x20NEW\x20Orders\x20(REUSE\x20pattern\x20—\x20a\x20fresh\x20order\x20per\x20period\x20instead\x20of\x20an\x20in-order\x20loop\x20that\x20replays\x20its\x20forwards\x20every\x20lap).\x20'+'(3)\x20A\x20funded\x20renewal\x20loop\x20(post-period\x20node\x20back\x20into\x20a\x20charging\x20node,\x20advanced\x20via\x20the\x20one-PTB\x20order_renew\x20call,\x20'+'NO\x20balance\x20gate\x20on\x20the\x20renew\x20forward\x20—\x20see\x20the\x20PRE-STATE\x20CONSTRAINT\x20above)\x20'+'is\x20the\x20only\x20sanctioned\x20charge-bearing\x20cycle\x20shape\x20for\x20in-order\x20renewals.');l['length']>0x0&&d['push']('pre_publish:\x20machine\x20contains\x20renewal\x20loop\x20cycle(s)\x20'+l['map'](M=>'['+M['c']['cycle']['join']('\x20->\x20')+']')['join'](',\x20')+'\x20—\x20on-chain\x20a\x20revisit\x20'+'is\x20NOT\x20verified\x20to\x20re-fund\x20the\x20Allocation.\x20Every\x20renewal/loop\x20forward\x20MUST\x20carry\x20the\x20new-period\x20'+'payment\x20into\x20the\x20order\x20escrow\x20(use\x20the\x20order\x20call\x27s\x20order_renew\x20field:\x20create\x20the\x20period\x20payment,\x20receive\x20it\x20into\x20the\x20'+'allocation,\x20and\x20advance\x20the\x20progress\x20—\x20all\x20in\x20one\x20transaction),\x20or\x20the\x20loop\x20allows\x20zero-value\x20'+'re-delivery\x20cycles\x20(test/11\x20R2-F3).\x20'+'PRE-STATE\x20CONSTRAINT\x20(esound-mn-261021\x20B-1,\x20mainnet-verified):\x20a\x20guard\x20on\x20the\x20renew\x20forward\x20reading\x20'+'allocation.balance\x20(query\x201051)\x20evaluates\x20the\x20COMMITTED\x20pre-transaction\x20balance\x20—\x20the\x20same-PTB\x20order_renew\x20'+'payment\x20is\x20INVISIBLE\x20to\x20it,\x20so\x20a\x20balance-gated\x20renew\x20forward\x20ALWAYS\x20aborts.\x20NEVER\x20bind\x20a\x20balance\x20gate\x20to\x20a\x20'+'forward\x20that\x20order_renew\x20advances\x20in\x20the\x20same\x20PTB.\x20'+TWO_TX_RENEW_RECIPE+'\x20'+'The\x20zero-value\x20protection\x20rides\x20this\x20routing\x20convention\x20(order_renew\x27s\x20amount).');m['length']>0x0&&d['push']('pre_publish:\x20machine\x20contains\x20remedy\x20loop\x20cycle(s)\x20'+m['map'](M=>'['+M['c']['cycle']['join']('\x20->\x20')+']')['join'](',\x20')+'\x20—\x20'+'a\x20same-order\x20revisit\x20(revision/review/rework/refund/cancel\x20family)\x20implies\x20NO\x20new\x20charge,\x20so\x20no\x20fund\x20gate\x20is\x20needed\x20on\x20it\x20'+'(the\x20allocation.balance\x20query\x20exists\x20but\x20is\x20irrelevant\x20here).\x20Visible\x20by\x20design\x20(crs\x20P2-3):\x20if\x20the\x20business\x20EVER\x20intends\x20'+'a\x20revisit\x20to\x20cost\x20money,\x20that\x20fee\x20IS\x20enforceable\x20via\x20the\x20balance\x20query\x20(1051)\x20—\x20but\x20that\x20reshapes\x20the\x20cycle\x20into\x20the\x20'+'charge\x20tier\x20above;\x20keep\x20remedy\x20revisits\x20free\x20or\x20restructure\x20as\x20per-period\x20NEW\x20Orders.');for(const M of e){const N=typeof M?.['name']==='string'?M['name']:'?';for(const O of M?.['pairs']??[]){for(const P of O?.['forwards']??[]){const Q=P?.['namedOperator']!==undefined&&P?.['namedOperator']!==null,R=P?.['permissionIndex']!==undefined&&P?.['permissionIndex']!==null,S=P?.['guard']!==undefined&&P?.['guard']!==null;!Q&&!R&&!S&&d['push']('pre_publish:\x20node\x20\x22'+N+'\x22\x20forward\x20\x22'+String(P?.['name']??'?')+'\x22\x20has\x20no\x20executor\x20binding\x20(namedOperator\x20/\x20permissionIndex\x20/\x20guard)\x20—\x20no\x20one\x20can\x20advance\x20it');}}}const q=computeTerminalReachability(a),r=new Map(),s=new Map();for(const T of e){for(const U of T?.['pairs']??[]){const V=U?.['prev_node'];if(typeof V!=='string'||V==='')continue;for(const W of U?.['forwards']??[]){const X=W?.['namedOperator']!=null&&String(W['namedOperator'])!==''?'operator:'+String(W['namedOperator']):W?.['permissionIndex']!=null?'permission:'+String(W['permissionIndex']):null;s['set'](V,(s['get'](V)??0x0)+0x1);if(X!=null){const Y=r['get'](V)??new Set();Y['add'](X),r['set'](V,Y);}}}}for(const [Z,a0]of r){(s['get'](Z)??0x0)>=0x1&&a0['size']===0x1&&d['push']('pre_publish:\x20LIVE-ACT-02\x20node\x20\x22'+Z+'\x22\x20—\x20every\x20outgoing\x20forward\x20binds\x20the\x20SAME\x20single\x20identity\x20('+[...a0]['join'](',\x20')+'):\x20'+'if\x20that\x20actor\x20goes\x20silent\x20the\x20order\x20LATCHES\x20here\x20and\x20the\x20escrow\x20freezes\x20—\x20there\x20is\x20no\x20counterparty\x20or\x20keeper\x20exit\x20'+'(alg26\x20261026\x20O9/O5\x20family:\x20changes_requested\x20with\x20only\x20a\x20contributor\x20resubmit\x20edge;\x20claimed\x20with\x20only\x20a\x20merchant\x20assign\x20edge).\x20'+'Design\x20the\x20exit\x20edge\x20NOW\x20(keeper/auto-close\x20forward\x20with\x20its\x20own\x20identity,\x20or\x20a\x20counterparty-signed\x20cancel/refund\x20edge)\x20—\x20'+'immutable\x20after\x20publish\x20(IMMUT-001).\x20If\x20single-operator-by-design,\x20this\x20warning\x20can\x20be\x20ignored');}const t=lintForwardAmbiguity(a,'pre_publish');return c['push'](...t['critical']),d['push'](...t['warnings']),q['unreachable']['length']>0x0&&d['push']('pre_publish:\x20unreachable\x20machine\x20node(s)\x20'+q['unreachable']['map'](a1=>'\x22'+a1+'\x22')['join'](',\x20')+'\x20—\x20'+'no\x20path\x20from\x20the\x20entry\x20pair\x20reaches\x20them;\x20dead\x20topology\x20is\x20frozen\x20at\x20publish\x20(IMMUT-001).\x20'+'Wire\x20them\x20into\x20the\x20flow\x20or\x20remove\x20them\x20before\x20publish'),{'critical':c,'warnings':d};}export function computeTerminalReachability(a){const b=[],c=[];if(!Array['isArray'](a)||a['length']===0x0)return{'terminals':b,'unreachable':c};const d=a,e=new Map(),f=[],g=[];for(const j of d){const k=typeof j?.['name']==='string'?j['name']:'';if(!k)continue;f['push'](k);if(!e['has'](k))e['set'](k,[]);let l=![];for(const m of j?.['pairs']??[]){const o=m?.['prev_node'];if(o==='')l=!![];else{if(typeof o==='string'&&o!==''){const q=e['get'](o);if(q)q['push'](k);else e['set'](o,[k]);}}}if(l)g['push'](k);}if(f['length']===0x0||g['length']===0x0)return{'terminals':b,'unreachable':c};const h=new Set(),i=[...g];while(i['length']>0x0){const r=i['pop']();if(h['has'](r))continue;h['add'](r);for(const s of e['get'](r)??[])i['push'](s);}for(const t of f){if(!h['has'](t))c['push'](t);else{if((e['get'](t)??[])['length']===0x0)b['push'](t);}}return{'terminals':b,'unreachable':c};}export const REVIEW_FAMILY_NODE_REGEX=/(^|_)(review|reviews|reviewed|reviewing|evaluated|evaluate|feedback|rating|rated)(_|$)/i;export function lintReviewLockedTerminals(a,b){const c=[],d=[];if(!Array['isArray'](a)||a['length']===0x0)return{'critical':c,'warnings':d};const e=a,h=u=>Array['isArray'](u?.['pairs'])?u['pairs']:Array['isArray'](u?.['value'])?u['value']:[],i=[],j=[],k=[];for(const u of e){const v=typeof u?.['name']==='string'?u['name']:'';if(!v)continue;j['push'](v);let w=![];for(const x of h(u)){const y=x,z=y?.['prev_node'];if(z==='')w=!![];const A=Array['isArray'](y?.['forwards'])?y['forwards']:[],B=[];for(const C of A){const D=C,E=D?.['guard'],F=typeof E==='string'&&E['trim']()!==''?E:E&&typeof E==='object'?E['guard']??E['$ref']:undefined;if(typeof F==='string'&&F['trim']()!=='')B['push'](F);}typeof z==='string'&&z!==''&&i['push']({'from':z,'to':v,'guardRefs':B});}if(w)k['push'](v);}if(j['length']===0x0||k['length']===0x0)return{'critical':c,'warnings':d};const l=computeTerminalReachability(a);if(l['terminals']['length']===0x0)return{'critical':c,'warnings':d};const m=G=>{if(G['guardRefs']['length']===0x0)return![];for(const H of G['guardRefs']){const I=b['get'](H['toLowerCase']());if(!I||I['length']===0x0)return![];const J=I['every'](K=>REVIEW_FAMILY_NODE_REGEX['test'](K));if(!J||I['includes'](G['from']))return![];}return!![];},o=G=>REVIEW_FAMILY_NODE_REGEX['test'](G),q=G=>{const H=new Map();for(const K of i){if(m(K))continue;if(G&&(o(K['from'])||o(K['to'])))continue;const L=H['get'](K['from']);if(L)L['push'](K['to']);else H['set'](K['from'],[K['to']]);}const I=new Set(),J=[...k];while(J['length']>0x0){const M=J['pop']();if(I['has'](M))continue;I['add'](M);for(const N of H['get'](M)??[])J['push'](N);}return I;},r=q(![]),s=q(!![]);for(const G of l['terminals']){if(!r['has'](G))c['push']('REVIEW-LOCK-01:\x20terminal\x20\x22'+G+'\x22\x20is\x20enterable\x20ONLY\x20through\x20forward(s)\x20whose\x20guard\x20pins\x20a\x20'+'review/feedback\x20node\x20the\x20edge\x20itself\x20does\x20not\x20depart\x20from\x20—\x20the\x20rail\x20can\x20never\x20fire\x20(the\x20guard\x20asserts\x20a\x20'+'progress\x20state\x20this\x20transition\x20cannot\x20produce),\x20so\x20a\x20buyer\x20who\x20never\x20reviews\x20strands\x20every\x20order\x27s\x20'+'escrow\x20permanently.\x20Machine\x20topology\x20is\x20immutable\x20after\x20publish\x20(IMMUT-001).\x20Fix\x20BEFORE\x20publish:\x20'+'re-pin\x20the\x20settlement\x20guard\x20to\x20the\x20node\x20the\x20forward\x20actually\x20departs\x20from,\x20and\x20add\x20a\x20time-lock\x20keeper\x20'+'auto-confirm\x20rail\x20(the\x20template\x20deliver_confirm_timeout\x20convention)\x20so\x20settlement\x20never\x20depends\x20on\x20the\x20'+'buyer\x20choosing\x20to\x20review');else!s['has'](G)&&d['push']('REVIEW-LOCK-01:\x20terminal\x20\x22'+G+'\x22\x20is\x20reachable\x20only\x20THROUGH\x20a\x20review/feedback\x20node\x20—\x20a\x20buyer\x20who\x20'+'silently\x20skips\x20reviewing\x20can\x20never\x20let\x20their\x20order\x20reach\x20it.\x20The\x20sanctioned\x20shape\x20keeps\x20the\x20review\x20'+'stop\x20OPTIONAL\x20with\x20an\x20exit\x20edge\x20back\x20to\x20the\x20settlement\x20rail,\x20and\x20a\x20keeper\x20time-lock\x20rail\x20that\x20opens\x20'+'settlement\x20independently\x20(retail\x20deliver_confirm_timeout\x20convention).\x20Verify\x20one\x20of\x20the\x20two\x20exists;\x20'+'if\x20the\x20review\x20node\x20is\x20meant\x20to\x20be\x20keeper-advanceable,\x20this\x20is\x20satisfied\x20and\x20may\x20be\x20ignored');}return{'critical':c,'warnings':d};}export function arbitrationVotingLockDetail(a){if(!Array['isArray'](a))return null;if(a['length']>0x0)return null;return'voting_guard\x20is\x20empty\x20(no\x20guard-weighted\x20voters).\x20Plain\x20votes\x20hard-require\x20the\x20vote\x20permission\x20(358)\x20on\x20the\x20'+'arbitration\x27s\x20own\x20Permission:\x20only\x20that\x20Permission\x27s\x20admin\x20(its\x20creator,\x20by\x20default)\x20and\x20explicit\x20358\x20'+'grantees\x20pass\x20the\x20assert,\x20so\x20without\x20grants\x20the\x20disputing\x20CUSTOMER\x20can\x20never\x20vote\x20and\x20the\x20arb\x20admin\x20is\x20the\x20'+'only\x20possible\x20voter\x20AND\x20the\x20judge\x20—\x20a\x20dispute\x20opened\x20against\x20this\x20service\x20dead-locks\x20when\x20that\x20admin\x20is\x20'+'unresponsive.\x20Configure\x20a\x20public\x20voting_guard\x20on\x20the\x20Arbitration\x20(voting_guard\x20op=\x27set\x27\x20with\x20guard\x20+\x20vote\x20'+'weight\x20—\x20the\x20field\x20stays\x20mutable\x20after\x20publish;\x20the\x20standard\x20shape\x20is\x20tpl_voting_guard_open_vote,\x20the\x20'+'always-true\x20guard\x20at\x20FixedValue\x20weight\x201)\x20or\x20bind\x20an\x20arbitration\x20that\x20already\x20carries\x20one,\x20BEFORE\x20'+'publishing\x20this\x20service';}const TIME_PROFILE_UNIT_MS={'ms':0x1,'msec':0x1,'msecs':0x1,'millisecond':0x1,'milliseconds':0x1,'s':0x3e8,'sec':0x3e8,'secs':0x3e8,'second':0x3e8,'seconds':0x3e8,'m':0xea60,'min':0xea60,'mins':0xea60,'minute':0xea60,'minutes':0xea60,'h':0x36ee80,'hr':0x36ee80,'hrs':0x36ee80,'hour':0x36ee80,'hours':0x36ee80,'d':0x5265c00,'day':0x5265c00,'days':0x5265c00,'w':0x240c8400,'wk':0x240c8400,'wks':0x240c8400,'week':0x240c8400,'weeks':0x240c8400},TIME_PROFILE_DURATION_REGEX=/(\d+(?:\.\d+)?)\s*(ms|milliseconds?|msecs?|minutes?|mins?|seconds?|secs?|hours?|hrs?|days?|weeks?|wks?|min|sec|hr|wk|[smhdw])\b/gi,TIME_PROFILE_ADMISSION_REGEX=/compress(?:ed|ion)|accelerat(?:ed|ion)|shorten(?:ed)?(?:\s+for)?|test\s+(?:value|window|duration|constant)|demo\s+(?:value|window|duration)|for\s+(?:fast\s+|quick\s+)?test(?:ing)?|regression\s+(?:value|window)/i;function timeProfileIsTimeQuery(a){if(typeof a==='number')return a===0x4f7||a===0x4f8||a===0x500;if(typeof a==='string')return/(^|\.)time$|current_time/i['test'](a);return![];}function timeProfileNodeChildren(a){const b=[];for(const c of['nodes','node','nodeLeft','nodeRight','parameters','historyIdx','sessionIdx','forwardIdx','where','find','recipient']){const d=a[c];if(Array['isArray'](d))b['push'](...d);else{if(d&&typeof d==='object')b['push'](d);}}return b;}export function guardTimeProfileDetail(a){const b=typeof a['description']==='string'?a['description']:'',c=TIME_PROFILE_ADMISSION_REGEX['test'](b);let d=0x0;for(const l of b['matchAll'](TIME_PROFILE_DURATION_REGEX)){const n=TIME_PROFILE_UNIT_MS[l[0x2]['toLowerCase']()];if(!n)continue;const o=Number(l[0x1])*n;if(Number['isFinite'](o)&&o>d)d=o;}if(!c&&d===0x0)return null;const e=Array['isArray'](a['table'])?a['table']:[],f=p=>{const q=e['find'](r=>Number(r?.['identifier'])===p);return numericAmount(q?.['value']);},h=p=>{if(!p||typeof p!=='object')return![];const q=p;if(q['type']==='context'&&q['context']==='Clock')return!![];if(q['type']==='query'&&timeProfileIsTimeQuery(q['query']))return!![];if(q['type']==='query_progress_history_time')return!![];return timeProfileNodeChildren(q)['some'](h);},i=[],j=(p,q)=>{if(!p||typeof p!=='object')return;const r=p,s=q||typeof r['type']==='string'&&r['type']['startsWith']('calc_');if(r['type']==='identifier'&&s){const t=f(Number(r['identifier']));if(t!==undefined&&t>0x0)i['push'](t);}for(const u of timeProfileNodeChildren(r))j(u,s);};if(a['root']&&typeof a['root']==='object'&&h(a['root']))j(a['root'],![]);const k=i['find'](p=>p<d/0x64);if(k!==undefined){const p=q=>q>=0x5265c00?q/0x5265c00+'d':q>=0x36ee80?q/0x36ee80+'h':q>=0xea60?q/0xea60+'min':q/0x3e8+'s';return{'level':'critical','detail':'time\x20constant\x20'+p(k)+'\x20is\x20>=100x\x20below\x20the\x20production\x20duration\x20the\x20description\x20itself\x20'+('declares\x20('+p(d)+')\x20—\x20a\x20compressed\x20test\x20value\x20frozen\x20into\x20a\x20production\x20guard.\x20Guards\x20')+'freeze\x20at\x20publish\x20(IMMUT-001),\x20so\x20the\x20window\x20will\x20enforce\x20the\x20compressed\x20value\x20against\x20real\x20orders\x20'+'(klook\x20mainnet\x20261014:\x20\x2724h\x20free\x20cancellation\x27\x20enforced\x20as\x202\x20minutes).\x20Rebuild\x20the\x20guard\x20with\x20the\x20'+'production\x20duration\x20from\x20the\x20template\x20fee_params\x20BEFORE\x20publishing'};}if(c)return{'level':'warning','detail':'description\x20admits\x20compressed/accelerated\x20time\x20constants,\x20but\x20NO\x20time\x20constant\x20in\x20this\x20guard\x27s\x20logic\x20'+'tree\x20is\x20>=100x\x20below\x20the\x20declared\x20production\x20duration\x20—\x20the\x20values\x20look\x20production-scaled.\x20Manual\x20'+'review\x20requested\x20(prose\x20alone\x20no\x20longer\x20blocks\x20publish,\x20BF-07):\x20confirm\x20the\x20tree\x20constants\x20match\x20the\x20'+'production\x20durations\x20in\x20the\x20template\x20fee_params\x20BEFORE\x20publishing\x20—\x20guards\x20freeze\x20at\x20publish\x20'+'(IMMUT-001),\x20so\x20a\x20mis-scaled\x20window\x20(klook\x20mainnet\x20261014:\x20\x2724h\x20free\x20cancellation\x27\x20enforced\x20as\x202\x20'+'minutes)\x20is\x20UNFIXABLE'};return null;}export function rewardRefsOf(a){const b=a?.['rewards'];if(typeof b==='string'&&b['trim']()!=='')return[b];if(Array['isArray'](b))return b['filter'](c=>typeof c==='string'&&c['trim']()!=='');if(Array['isArray'](b?.['objects']))return b['objects']['filter'](c=>typeof c==='string'&&c['trim']()!=='');return[];}export function serviceRewardsUnfundedDetail(b){if(!b||typeof b!=='object')return null;const c=b['data']??b,d=Array['isArray'](c?.['guards'])?c['guards']:[],e=numericAmount(c?.['balance']?.['value']??c?.['balance']);if(e===undefined)return null;let f=0x0;for(const h of d){const i=h?.['amount'];if(i?.['type']!==0x1)continue;const j=numericAmount(i?.['value']?.['value']??i?.['value']);if(j!==undefined&&j>f)f=j;}if(f===0x0)return null;if(e>=f)return null;return'reward\x20pool\x20balance\x20'+e+'\x20cannot\x20cover\x20its\x20largest\x20single-claim\x20promise\x20('+f+').\x20'+'The\x20on-chain\x20publish\x20entry\x20does\x20NOT\x20verify\x20reward\x20funding\x20—\x20a\x20failed\x20reward_fund\x20transfer\x20still\x20'+'publishes\x20(onlyfans\x20mainnet\x20261014\x20shipped\x20a\x20store\x20promising\x20cashback\x20with\x20an\x20empty\x20pool),\x20and\x20the\x20'+'claim\x20aborts\x20once\x20the\x20pool\x20drains.\x20Fund\x20the\x20Reward\x20(reward_fund)\x20up\x20to\x20expected_orders\x20x\x20per-claim\x20'+'amount,\x20or\x20remove\x20the\x20reward\x20binding\x20BEFORE\x20publishing\x20this\x20service';}export const TASK_BINDING_REMEDIATION_ENTRY={'identifier':TASK_BINDING_SLOT,'b_submission':!![],'value_type':'Address','name':'task_binding\x20order\x20anchor\x20(protocol\x20slot\x20254;\x20written\x20by\x20order\x20creation)'};const TASK_BINDING_TRIGGER='the\x20triggering\x20Passport\x20must\x20submit\x20identifier\x20'+TASK_BINDING_SLOT+'\x20carrying\x20the\x20Order\x20address';export function declaresTaskBindingSlot(a){if(!Array['isArray'](a))return![];return a['some'](b=>{if(typeof b!=='object'||b===null)return![];const c=b;return Number(c['identifier'])===TASK_BINDING_SLOT&&c['b_submission']===!![]&&String(c['value_type'])==='Address';});}export const REFUND_RAIL_NODE_REGEX=/(^|_)(refund|refunded|cancel|cancelled|return|returned)(_|$)/i;export function lintTaskBindingAdvisories(a){const b=[];if(!Array['isArray'](a['table']))return b;const c=declaresTaskBindingSlot(a['table']),d=a['guardRef']!==undefined?'\x22'+a['guardRef']+'\x22':'this\x20guard';if(a['refundReentry']===!![]&&c)return b['push']({'code':'TASKBIND-254-REFUND-REPLAY','level':'warning','detail':'refund\x20rail\x20guard\x20'+d+'\x20declares\x20protocol\x20slot\x20'+TASK_BINDING_SLOT+'\x20(b_submission:\x20true).\x20'+(TASK_BINDING_SLOT+'\x20is\x20the\x20ONCE_FOR_OBJECT\x20task-binding\x20slot:\x20a\x20refund\x20rail\x20that\x20can\x20re-enter\x20its\x20')+'refund\x20node\x20in\x20a\x20later\x20period\x20(deposit\x20re-refund,\x20re-selected\x20order,\x20renewal\x20cycle)\x20re-fires\x20on\x20the\x20'+'SAME\x20order\x20and\x20aborts\x20E_ONCE_TRIGGERED\x20(code\x2016)\x20on\x20every\x20release\x20after\x20the\x20first\x20—\x20a\x20perpetual\x20'+('abort,\x20not\x20a\x20one-time\x20failure\x20(OFN\x20#P-04).\x20Remove\x20the\x20'+TASK_BINDING_SLOT+'\x20row\x20and\x20anchor\x20the\x20payee\x20')+'on\x20a\x20user\x20submission\x20slot\x20(slot\x200,\x20the\x20submitted\x20Order)\x20instead.\x20Guards\x20are\x20create-frozen\x20and\x20'+'order_allocators\x20freeze\x20at\x20service\x20publish\x20—\x20correct\x20it\x20BEFORE\x20the\x20irreversible\x20write.','remediation':{'entry':TASK_BINDING_REMEDIATION_ENTRY,'trigger':'delete\x20the\x20254\x20row;\x20pay\x20the\x20refund\x20through\x20a\x20user\x20slot\x20(slot\x200)\x20that\x20the\x20trigger\x20Passport\x20submits\x20'+'with\x20the\x20Order\x20address'}}),b;return a['allocatorBound']===!![]&&!c&&b['push']({'code':'TASKBIND-254-MISSING','level':'warning','detail':'allocator-bound\x20hand-composed\x20guard\x20'+d+'\x20declares\x20no\x20{identifier:\x20'+TASK_BINDING_SLOT+',\x20'+'b_submission:\x20true,\x20value_type:\x20\x22Address\x22}\x20row.\x20The\x20passport\x20only\x20emits\x20DECLARED\x20slots,\x20so\x20once\x20an\x20'+'order-bound\x20path\x20uses\x20this\x20guard\x20every\x20guarded\x20forward\x20aborts\x20(code\x2011)\x20—\x20and\x20a\x20NEW\x20buyer\x27s\x20first\x20'+'order\x20is\x20the\x20one\x20that\x20hits\x20the\x20254\x20placeholder\x20immediately.\x20Add\x20the\x20row\x20below;\x20the\x20trigger\x20Passport\x20'+('must\x20submit\x20identifier\x20'+TASK_BINDING_SLOT+'\x20(the\x20Order\x20address).\x20Guards\x20are\x20create-frozen\x20and\x20machine\x20')+'topology\x20/\x20order_allocators\x20freeze\x20at\x20publish\x20—\x20correct\x20it\x20BEFORE\x20the\x20irreversible\x20write.','remediation':{'entry':TASK_BINDING_REMEDIATION_ENTRY,'trigger':TASK_BINDING_TRIGGER}}),b;}export function lintMachineTaskBindingPreflight(a){if(!Array['isArray'](a['refs'])||a['refs']['length']===0x0)return[];if(a['resolved']['some'](f=>declaresTaskBindingSlot(f['table'])))return[];const b=new Set(a['resolved']['map'](f=>f['ref']['toLowerCase']())),c=a['refs']['filter'](f=>!b['has'](f['toLowerCase']())),d='NONE\x20of\x20this\x20machine\x27s\x20'+a['refs']['length']+'\x20forward\x20guard(s)\x20declares\x20the\x20protocol\x20slot\x20'+(TASK_BINDING_SLOT+'\x20Address\x20submission\x20row.\x20A\x20settlement/claim\x20guard\x20shared\x20with\x20an\x20allocator\x20rail,\x20and\x20every\x20')+'order-bound\x20forward,\x20will\x20abort\x20(code\x2011)\x20once\x20a\x20Service\x20attaches\x20—\x20a\x20new\x20buyer\x27s\x20first\x20order\x20hits\x20the\x20'+'placeholder\x20immediately.',e=a['readError']!==undefined?'the\x20forward-guard\x20definitions\x20could\x20not\x20be\x20read\x20('+a['readError']+'),\x20so\x20the\x20'+TASK_BINDING_SLOT+'\x20'+('declaration\x20is\x20UNVERIFIED.\x20Verify\x20'+d+'\x20Add\x20{identifier:\x20'+TASK_BINDING_SLOT+',\x20b_submission:\x20true,\x20')+'value_type:\x20\x22Address\x22}\x20to\x20each\x20guard\x20BEFORE\x20publish;\x20machine\x20topology\x20is\x20immutable\x20after\x20publish\x20and\x20'+'guards\x20are\x20create-frozen.':d+(c['length']>0x0?'\x20'+c['length']+'\x20ref(s)\x20could\x20not\x20be\x20resolved\x20by\x20this\x20read\x20('+c['join'](',\x20')+')\x20—\x20'+'their\x20declarations\x20are\x20unverified.':'')+('\x20Add\x20{identifier:\x20'+TASK_BINDING_SLOT+',\x20b_submission:\x20true,\x20value_type:\x20\x22Address\x22}\x20to\x20each\x20guard\x27s\x20table\x20')+'BEFORE\x20publish;\x20machine\x20topology\x20is\x20immutable\x20after\x20publish\x20(IMMUT-001)\x20and\x20guards\x20are\x20create-frozen.';return[{'code':a['readError']!==undefined?'TASKBIND-254-UNVERIFIED':'TASKBIND-254-MISSING','level':'warning','detail':e,'remediation':{'entry':TASK_BINDING_REMEDIATION_ENTRY,'trigger':TASK_BINDING_TRIGGER}}];}export function formatTaskBindingAdvisory(a,b='pre_publish'){return b+':\x20task-binding\x20advisory\x20['+a['code']+']\x20'+a['detail'];}export const AUDIT_RULES=[{'id':'audit_machine_bound','description':'Service\x20should\x20have\x20a\x20Machine\x20workflow\x20bound\x20before\x20publish','severity':'warning','fields':['machine'],'check':(a,b)=>{if(!a?.['publish'])return!![];return!!a?.['machine'];},'message':()=>'Publishing\x20a\x20service\x20without\x20a\x20Machine\x20workflow.\x20Customers\x20won\x27t\x20have\x20a\x20structured\x20order\x20process.','recommendation':'Create\x20a\x20Machine\x20(workflow\x20template)\x20and\x20bind\x20it\x20to\x20the\x20service\x20before\x20publishing.\x20The\x20machine\x20field\x20becomes\x20IMMUTABLE\x20after\x20publish.'},{'id':'audit_order_allocators','description':'Service\x20should\x20have\x20order_allocators\x20for\x20fund\x20distribution','severity':'warning','fields':['order_allocators'],'check':a=>{if(!a?.['publish'])return!![];return allocatorCountOf(a)>0x0;},'message':()=>'Publishing\x20a\x20service\x20without\x20order_allocators.\x20Order\x20funds\x20cannot\x20be\x20auto-distributed\x20to\x20suppliers.','recommendation':'Configure\x20order_allocators\x20before\x20publishing\x20—\x20this\x20field\x20becomes\x20IMMUTABLE\x20after\x20publish.'},{'id':'audit_buy_guard','description':'Service\x20should\x20have\x20a\x20buy_guard\x20for\x20customer\x20screening','severity':'info','fields':['buy_guard'],'check':a=>!!a?.['buy_guard'],'message':()=>'No\x20buy_guard\x20configured\x20—\x20anyone\x20can\x20purchase\x20this\x20service\x20without\x20verification.','recommendation':'Consider\x20adding\x20a\x20Guard\x20to\x20verify\x20customer\x20eligibility\x20(e.g.,\x20identity,\x20wallet\x20balance,\x20location).'},{'id':'audit_arb_alloc_boundary','description':'Arbitration\x20and\x20Allocator\x20coexist\x20→\x20surface\x20the\x20two-system\x20boundary\x20reminder','severity':'warning','fields':['arbitrations','compensation_fund_add','compensation_fund','order_allocators'],'check':a=>{if(!a?.['publish'])return!![];const b=arbitrationRefsOf(a)['length']>0x0||compensationFundOf(a)!==undefined;return!(b&&allocatorCountOf(a)>0x0);},'message':()=>'Arbitration\x20and\x20Allocator\x20are\x20INDEPENDENT\x20systems\x20by\x20design:\x20a\x20ruling\x20records\x20the\x20case\x20and\x20pays\x20from\x20the\x20service\x20compensation\x20fund\x20—\x20it\x20never\x20moves\x20escrow\x20and\x20never\x20advances\x20the\x20workflow.\x20With\x20both\x20configured,\x20a\x20buyer\x20can\x20receive\x20BOTH\x20the\x20arbitration\x20compensation\x20AND\x20a\x20full\x20escrow\x20refund\x20unless\x20the\x20refund/settlement\x20path\x20is\x20gated.\x20This\x20is\x20a\x20boundary\x20reminder,\x20not\x20a\x20defect\x20—\x20verify\x20the\x20coupling\x20check\x20was\x20done\x20deliberately.','recommendation':'Gate\x20the\x20refund/settlement\x20allocator\x27s\x20Guard\x20on\x20order.claimed_by\x20(read-only\x20cross-system\x20evidence\x20—\x20the\x20sanctioned\x20link),\x20or\x20hold\x20the\x20final\x20settlement\x20forward\x20until\x20the\x20case\x20closes.\x20Do\x20NOT\x20couple\x20the\x20systems\x20the\x20other\x20way\x20(no\x20dispute\x20state\x20on\x20the\x20order\x20flow,\x20no\x20workflow\x20step\x20into\x20arbitration):\x20coupling\x20opens\x20the\x20double-pay\x20path.\x20For\x20per-case\x20fund\x20actions,\x20the\x20deposit-reimbursement\x20pattern\x20(guard-design\x20patterns)\x20is\x20the\x20supported\x20route.'},{'id':'audit_compensation_fund','description':'Service\x20should\x20have\x20a\x20compensation_fund\x20for\x20trust','severity':'warning','fields':['compensation_fund_add','compensation_fund'],'check':a=>compensationFundOf(a)!==undefined,'message':()=>'No\x20compensation_fund\x20configured.\x20Customers\x20have\x20no\x20financial\x20protection\x20if\x20you\x20fail\x20to\x20deliver.','recommendation':'Deposit\x20via\x20compensation_fund_add\x20{balance}\x20to\x20enable\x20arbitration\x20payouts.\x20The\x20fund\x20deters\x20fraud\x20and\x20enables\x20arbitration\x20claims.'},{'id':'audit_arbitrations','description':'Service\x20should\x20have\x20arbitration\x20options\x20for\x20dispute\x20resolution','severity':'info','fields':['arbitrations'],'check':a=>arbitrationRefsOf(a)['length']>0x0,'message':()=>'No\x20arbitration\x20configured.\x20Disputes\x20cannot\x20be\x20resolved\x20through\x20a\x20third\x20party.','recommendation':'Add\x20at\x20least\x20one\x20Arbitration\x20object\x20via\x20arbitrations:{op:\x27add\x27,\x20objects:[...]}\x20to\x20enable\x20on-chain\x20dispute\x20resolution.'},{'id':'audit_arbitration_removal_strands_awards','description':'Removing\x20an\x20authorized\x20venue\x20can\x20strand\x20an\x20award\x20it\x20already\x20ruled\x20on','severity':'error','fields':['arbitrations'],'check':a=>{const b=a?.['arbitrations']?.['remove']??a?.['arbitrations']?.['clear'],c=Array['isArray'](b)?b['length']>0x0:a?.['arbitrations']?.['op']==='clear';if(!c)return!![];if(arbitrationRefsOf(a)['length']>0x0)return!![];return compensationFundOf(a)===undefined;},'message':a=>{const b=a?.['arbitrations']?.['clear']?'every\x20authorized\x20venue':'venue(s)\x20'+(a?.['arbitrations']?.['remove']??[])['join'](',\x20');return'Removing\x20'+b+'\x20while\x20a\x20compensation\x20fund\x20is\x20configured\x20makes\x20any\x20award\x20it\x20already\x20ruled\x20on\x20UNPAYABLE:\x20an\x20on-chain\x20payout\x20now\x20requires\x20the\x20deciding\x20venue\x20to\x20still\x20be\x20on\x20the\x20Service\x27s\x20allowlist,\x20so\x20paying\x20out\x20aborts\x20with\x20E_ARBITRATION_NOT_ALLOWED=39\x20and\x20the\x20escrowed\x20funds\x20stay\x20stranded.';},'recommendation':'Before\x20removing\x20a\x20venue,\x20confirm\x20no\x20case\x20it\x20ruled\x20on\x20is\x20still\x20awaiting\x20compensation\x20payout\x20(query\x20the\x20Arb\x20objects\x20for\x20status\x20Arbitrated,\x20not\x20Finished).\x20Add\x20the\x20replacement\x20venue\x20FIRST,\x20drain\x20the\x20old\x20venue\x27s\x20cases,\x20and\x20only\x20then\x20remove\x20it.\x20A\x20buyer\x20should\x20never\x20be\x20left\x20holding\x20an\x20uncollectable\x20award.'},{'id':'audit_price','description':'Service\x20should\x20have\x20at\x20least\x20one\x20priced\x20sale\x20item','severity':'error','fields':['sales'],'check':a=>{const b=salesItemsOf(a);if(b['length']===0x0)return!![];return b['some'](c=>c?.['price']!==undefined&&c?.['price']!==null);},'message':()=>'Sales\x20list\x20present\x20but\x20no\x20item\x20has\x20a\x20price.\x20Customers\x20cannot\x20place\x20orders\x20without\x20knowing\x20the\x20cost.','recommendation':'Set\x20price\x20on\x20each\x20sales\x20item\x20(smallest-unit\x20string\x20or\x20display\x20form\x20like\x20\x272.5WOW\x27).'},{'id':'audit_compensation_fund_covers_award_ceiling','description':'compensation_fund\x20should\x20cover\x20the\x203x\x20award\x20ceiling\x20of\x20the\x20largest\x20sale\x20(disclosure)','severity':'warning','fields':['compensation_fund_add','compensation_fund','sales'],'check':a=>{if(!a?.['publish'])return!![];const b=compensationFundOf(a);if(b===undefined)return!![];const c=numericAmount(b);if(c===undefined)return!![];if(c===0x0)return![];const e=salesItemsOf(a)['map'](g=>numericAmount(g?.['price']))['filter'](g=>g!==undefined&&g>0x0);if(e['length']===0x0)return!![];const f=e['reduce']((g,h)=>g+h,0x0);return c>=MAX_INDEMNITY_MULTIPLE*f;},'message':()=>'compensation_fund\x20does\x20not\x20cover\x20the\x20award\x20ceiling\x20of\x20the\x20largest\x20sale.\x20An\x20award\x20is\x20hard-capped\x20at\x20'+MAX_INDEMNITY_MULTIPLE+'x\x20'+'the\x20order\x20amount\x20(arb.move\x20MAX_INDEMNITY_MULTIPLE,\x20enforced\x20at\x20ruling\x20time),\x20so\x20a\x20ruling\x20at\x20the\x20ceiling\x20'+'would\x20abort\x20the\x20buyer\x27s\x20claim\x20with\x2027\x20(E_COMPENSATION_NOT_MATCH)\x20—\x20the\x20ruling\x20stands\x20but\x20is\x20unpayable\x20'+'until\x20you\x20deposit,\x20and\x20the\x20abort\x20does\x20NOT\x20consume\x20the\x20claim.\x20Disclosure\x20only:\x20this\x20no\x20longer\x20blocks\x20'+'publish\x20—\x20per-order\x20coverage\x20is\x20enforced\x20at\x20BUY\x20time\x20(the\x20buyer\x27s\x20order\x20is\x20rejected\x20while\x20the\x20fund\x20'+'cannot\x20cover\x203x\x20that\x20order),\x20so\x20under-ceiling\x20funding\x20stops\x20sales\x20instead\x20of\x20stranding\x20awards.','recommendation':'For\x20every\x20order\x20you\x20want\x20to\x20sell,\x20keep\x20the\x20fund\x20at\x20>=\x20'+MAX_INDEMNITY_MULTIPLE+'x\x20THAT\x20order\x20via\x20'+'compensation_fund_add\x20(a\x200.49\x20course\x20needs\x201.47;\x20a\x203.99\x20course\x20needs\x2011.97\x20—\x20no\x20cross-SKU\x20subsidy).\x20'+('Above\x20'+MAX_INDEMNITY_MULTIPLE+'x\x20the\x20current\x20order\x20is\x20optional:\x20it\x20only\x20buys\x20tolerance\x20for\x20several\x20')+'CONCURRENT\x20claims\x20against\x20the\x20one\x20per-Service\x20pool\x20(there\x20is\x20no\x20on-chain\x20concurrency\x20limit),\x20which\x20'+'is\x20a\x20capital-allocation\x20choice.\x20A\x20service\x20with\x20NO\x20fund\x20sells\x20freely\x20—\x20that\x20is\x20the\x20documented\x20'+'no-protection\x20posture\x20(audit_compensation_fund\x20discloses\x20it;\x20buyers\x20see\x20coverage\x20via\x20order\x20monitor).'},{'id':'audit_description','description':'Service\x20should\x20have\x20a\x20description','severity':'warning','fields':['description'],'check':a=>typeof a?.['description']==='string'&&a['description']['length']>0x0,'message':()=>'Service\x20has\x20no\x20description.\x20Customers\x20won\x27t\x20understand\x20what\x20you\x27re\x20offering.','recommendation':'Write\x20a\x20clear\x20description\x20of\x20the\x20service,\x20including\x20deliverables,\x20timelines,\x20and\x20terms.'},{'id':'audit_named_new_name','description':'Service\x20being\x20created\x20should\x20have\x20a\x20name','severity':'warning','check':a=>serviceNameOf(a)!==undefined,'message':()=>'Creating\x20a\x20service\x20without\x20a\x20name\x20makes\x20it\x20hard\x20to\x20reference\x20and\x20organize.','recommendation':'Set\x20object:{name:\x20...}\x20(or\x20namedNew.name)\x20following\x20the\x20convention:\x20<projectPrefix>_<service>_<purpose>.'},{'id':'audit_customer_required_needs_um','description':'customer_required\x20requires\x20a\x20Contact\x20bound\x20via\x20um\x20(SDK-enforced\x20hard\x20link;\x20mirrored\x20here)','severity':'error','fields':['customer_required','um'],'check':a=>{const b=Array['isArray'](a?.['customer_required'])?a['customer_required']:[];if(b['length']===0x0)return!![];return!!a?.['um'];},'message':()=>'customer_required\x20is\x20set\x20but\x20no\x20Contact\x20is\x20bound\x20via\x20um\x20—\x20customers\x20cannot\x20deliver\x20the\x20required\x20private\x20information\x20through\x20end-to-end\x20encrypted\x20Messenger.','recommendation':'Bind\x20um:{Contact\x20name/id}\x20in\x20the\x20same\x20call\x20(SDK\x20order_new\x20will\x20fail\x20the\x20buyer\x20otherwise).'},{'id':'audit_customer_required_is_declared_not_enforced','description':'customer_required\x20has\x20no\x20on-chain\x20enforcement\x20at\x20buy\x20time\x20—\x20a\x20Guard\x20must\x20gate\x20fulfilment','severity':'warning','fields':['customer_required'],'check':a=>{const b=Array['isArray'](a?.['customer_required'])?a['customer_required']:[];return b['length']===0x0;},'message':a=>{const b=Array['isArray'](a?.['customer_required'])?a['customer_required']:[];return'customer_required\x20('+b['length']+'\x20field(s):\x20'+b['join'](',\x20')+')\x20is\x20DECLARATIVE\x20ONLY:\x20the\x20on-chain\x20purchase\x20entry\x20never\x20reads\x20this\x20list,\x20so\x20an\x20order\x20that\x20supplies\x20none\x20of\x20these\x20fields\x20is\x20still\x20created\x20and\x20progresses.\x20Nothing\x20on-chain\x20will\x20stop\x20it.';},'recommendation':'Bind\x20pattern.required_info_evidence_gate\x20(schema_query\x20action=get_guard_design_patterns)\x20on\x20the\x20first\x20forward\x20that\x20needs\x20the\x20information:\x20query\x20\x27order.required_info\x20some\x27\x20(1572)\x20over\x20the\x20Order.\x20The\x20buyer\x20records\x20the\x20credential\x20via\x20order_required_info_update:\x20EITHER\x20the\x20merchant\x27s\x20IM\x20user\x20address\x20resolved\x20from\x20the\x20Service\x27s\x20Contact\x20(zero\x20cost,\x20address\x20record\x20only)\x20OR\x20an\x20on-chain\x20WTS\x20Proof\x20object\x20address\x20(embeds\x20the\x20merchant\x20IM\x20address\x20and\x20the\x20last-message\x20timestamp;\x20costs\x20gas,\x20publicly\x20verifiable).\x20\x27order.required_info\x27\x20(1573)\x20returns\x20the\x20recorded\x20address\x20but\x20aborts\x20while\x20nothing\x20is\x20recorded\x20—\x20gate\x20on\x201572\x20first.\x20When\x20the\x20listing\x20genuinely\x20promises\x20a\x20PER-ORDER\x20credential,\x20prefer\x20the\x20controlled\x20bind\x20entry\x20(order_required_info_bind):\x20the\x20chain\x20verifies\x20the\x20Proof\x20is\x20about\x20THIS\x20order\x20and\x20owner-created\x20at\x20write\x20time\x20and\x20rejects\x20a\x20mismatch\x20—\x20no\x20guard\x20needed\x20to\x20catch\x20a\x20wrong-proof\x20record.\x20BOUNDARY:\x20that\x20binding\x20proves\x20the\x20credential\x20AUTHOR\x20only,\x20never\x20its\x20content\x20or\x20any\x20rating\x20—\x20do\x20not\x20mirror\x20it\x20onto\x20review/reward\x20claims;\x20public\x20reviews\x20are\x20Repository\x20rows\x20whose\x20values\x20are\x20enforced\x20guard-side\x20via\x20data-value\x20probes,\x20not\x20through\x20Proof\x20objects.'},{'id':'audit_dangling_deps','description':'Service\x20dependencies\x20should\x20be\x20fully\x20created','severity':'error','check':(a,b)=>{if(!a?.['publish'])return!![];if(!b?.['graph'])return!![];const c=b['graph']['findDanglingDependencies']()??[];return c['length']===0x0;},'message':()=>'Service\x20references\x20objects\x20that\x20are\x20not\x20yet\x20created.\x20Publishing\x20will\x20lock\x20these\x20references.','recommendation':'Ensure\x20all\x20referenced\x20objects\x20(machine,\x20allocators,\x20guards)\x20are\x20created\x20and\x20finalized\x20before\x20publishing.'},{'id':'audit_type_parameter','description':'Service\x20should\x20have\x20a\x20token\x20type\x20specified','severity':'info','fields':['type_parameter','namedNew'],'check':a=>typeParameterOf(a)!==undefined,'message':()=>'No\x20payment\x20token\x20type\x20specified.\x20Defaulting\x20to\x20WOW\x20(0x2::wow::WOW).','recommendation':'Explicitly\x20set\x20type_parameter\x20(inside\x20object:{...})\x20if\x20you\x20want\x20to\x20accept\x20non-WOW\x20tokens\x20(e.g.,\x20USDT,\x20ETH).'},{'id':'audit_wip_unreachable_url','description':'sale.wip\x20must\x20be\x20a\x20publicly\x20reachable\x20URL\x20(no\x20localhost/LAN/file\x20paths)','severity':'error','fields':['sales'],'check':(a,b)=>{if(typeof b?.['network']==='string'&&/local/i['test'](b['network']))return!![];const c=salesItemsOf(a);if(c['length']===0x0)return!![];return c['every'](e=>{const f=e?.['wip'];if(typeof f!=='string'||f['trim']()==='')return!![];return!/^(https?:\/\/)?(localhost|127\.0\.0\.1|\[::1\]|0\.0\.0\.0)/i['test'](f)&&!/^https?:\/\/(192\.168\.|10\.|172\.(1[6-9]|2\d|3[01])\.)/i['test'](f)&&!/^file:/i['test'](f);});},'message':a=>{const b=salesItemsOf(a)['map'](c=>String(c?.['wip']??''))['filter'](c=>c!==''&&(/^(https?:\/\/)?(localhost|127\.0\.0\.1|\[::1\]|0\.0\.0\.0)/i['test'](c)||/^https?:\/\/(192\.168\.|10\.|172\.(1[6-9]|2\d|3[01])\.)/i['test'](c)||/^file:/i['test'](c)));return'sale.wip\x20is\x20NOT\x20publicly\x20reachable\x20('+b['join'](',\x20')+').\x20The\x20URL\x20is\x20stored\x20on-chain\x20and\x20every\x20'+'customer\x20fetches\x20it\x20at\x20order\x20time\x20—\x20order_new\x20aborts\x20100%\x20for\x20anyone\x20outside\x20your\x20machine.\x20'+'Host\x20the\x20file\x20publicly:\x20wip_file\x20upload\x20to\x20the\x20official\x20free\x20host\x20(wip.store.wowok.net)\x20or\x20your\x20own\x20'+'endpoint\x20(GitHub\x20Pages\x20/\x20IPFS\x20/\x20your\x20website)';},'recommendation':'Replace\x20the\x20internal\x20URL\x20with\x20a\x20public\x20one.\x20Internal\x20URLs\x20are\x20sanctioned\x20ONLY\x20on\x20env.network=localnet\x20for\x20testing.'},{'id':'audit_wip_missing_public','description':'On\x20public\x20networks\x20every\x20sale\x20item\x20should\x20carry\x20a\x20product-detail\x20(wip)\x20URL','severity':'info','fields':['sales'],'check':(a,b)=>{const c=b?.['network'];if(typeof c==='string'&&/local/i['test'](c))return!![];const e=salesItemsOf(a);if(e['length']===0x0)return!![];return e['every'](f=>typeof f?.['wip']==='string'&&f['wip']['trim']()!=='');},'message':()=>'One\x20or\x20more\x20sale\x20items\x20have\x20NO\x20product-detail\x20(wip)\x20URL.\x20The\x20listing\x20works,\x20but\x20customers\x20see\x20no\x20detail\x20'+'page\x20and\x20the\x20service\x27s\x20market\x20completeness\x20score\x20is\x20downgraded.\x20Easiest:\x20upload\x20the\x20detail\x20file\x20with\x20the\x20'+'wip_file\x20tool\x20to\x20the\x20official\x20free\x20host\x20(https://wip.store.wowok.net\x20—\x2010\x20files\x20per\x20account,\x20180-day\x20'+'retention,\x2012MB/file)\x20and\x20put\x20the\x20returned\x20URL\x20into\x20sale.wip;\x20or\x20host\x20your\x20own\x20(GitHub\x20Pages\x20/\x20IPFS\x20/\x20'+'your\x20website).\x20For\x20long-lived\x20mainnet\x20listings\x20prefer\x20your\x20own\x20endpoint\x20so\x20the\x20detail\x20outlives\x20the\x20free\x20'+'retention\x20window','recommendation':'Upload\x20a\x20WIP\x20file\x20via\x20wip_file\x20and\x20set\x20sale.wip\x20on\x20each\x20item\x20before/after\x20publish\x20(sales\x20stays\x20modifiable).'},{'id':'audit_free_cancel_window_anchor','description':'A\x20free-cancellation\x20window\x20must\x20either\x20ride\x20the\x20stay-date\x20Repository\x20rail\x20or\x20be\x20disclosed\x20as\x20anchored\x20on\x20booking\x20time','severity':'warning','fields':['creation_plan'],'check':(a,b)=>{if(!a?.['publish'])return!![];const c=Array['isArray'](a?.['creation_plan']?.['guards'])?a['creation_plan']['guards']:[],e=c['some'](h=>{const i=typeof h?.['key']==='string'?h['key']:'',j=typeof h?.['purpose']==='string'?h['purpose']:'';return/free[._ ]?cancel/i['test'](i)||/cancell?ation/i['test'](j)&&/window|hours?|days?/i['test'](j);});if(!e)return!![];const f=c['some'](h=>{const i=typeof h?.['template_id']==='string'?h['template_id']:'',j=typeof h?.['purpose']==='string'?h['purpose']:'',k=/repository_data_check/i['test'](i)&&/stay[._ ]?date|use[._ ]?date|check[._ ]?in[._ ]?date|arrival/i['test'](j),l=/anchored on (booking|order\.time)|booking time by default/i['test'](j);return k||l;});return f;},'message':()=>'A\x20free-cancellation\x20window\x20is\x20declared\x20WITHOUT\x20a\x20stay-date\x20anchor\x20and\x20WITHOUT\x20a\x20booking-time\x20disclosure.\x20'+'The\x20chain\x20has\x20no\x20use-date\x20primitive\x20(order.time\x20is\x20the\x20BOOKING\x20moment\x20—\x20written\x20once,\x20immutable),\x20so\x20the\x20'+'window\x20enforces\x20as\x20\x27from\x20booking\x27.\x20If\x20your\x20buyer-facing\x20copy\x20promises\x20\x27X\x20hours\x20before\x20arrival/check-in\x27,\x20'+'the\x20promised\x20window\x20has\x20typically\x20ALREADY\x20CLOSED\x20at\x20booking\x20(bkd8\x20BK-02,\x20live\x20mainnet)\x20—\x20a\x20silent\x20policy\x20'+'inversion\x20that\x20mis-sells\x20the\x20listing.\x20TWO\x20WAYS\x20OUT:\x20(1)\x20FAITHFUL\x20WINDOW\x20—\x20ride\x20the\x20STAY-DATE\x20PRESCRIPTION\x20'+'(time_anchors.free_cancel\x20in\x20the\x20travel\x20templates):\x20a\x20batched\x20id_from\x20None(0)\x20\x27stay_date\x27\x20row\x20(u64\x20epoch-ms)\x20'+'written\x20into\x20the\x20order-scoped\x20Repository\x20at\x20buy\x20time,\x20plus\x20a\x20pattern.repository_data_check\x20leg\x20comparing\x20'+'Clock\x20against\x20row\x20+\x20window\x20offset\x20(CLOSING\x20<=);\x20(2)\x20HONEST\x20DEFAULT\x20—\x20keep\x20the\x20booking-time\x20anchor\x20and\x20state\x20'+'\x27free\x20cancellation\x20within\x20X\x20hours\x20of\x20BOOKING\x27\x20in\x20the\x20buyer-facing\x20copy\x20so\x20the\x20promise\x20matches\x20the\x20chain','recommendation':'Either\x20add\x20the\x20stay-date\x20Repository\x20row\x20+\x20repository_data_check\x20leg\x20(faithful\x20pre-use\x20window),\x20or\x20restate\x20the\x20cancellation\x20policy\x20as\x20\x27from\x20booking\x27\x20in\x20all\x20buyer-facing\x20copy.'}];const RULE_INDEX=new Map(AUDIT_RULES['map'](a=>[a['id'],a]));function readSeverityOverrides(){try{const {getJudgmentDoc:a}=require('../config/judgment.js');if(typeof a!=='function')return{};const b=a()?.['rules']?.['domains'];if(!b||typeof b!=='object')return{};const c={};for(const d of Object['values'](b)){const e=d?.['severity_overrides'];if(!e||typeof e!=='object')continue;for(const [f,g]of Object['entries'](e)){if(g==='error'||g==='warning'||g==='info')c[f]=g;}}return c;}catch{return{};}}export function auditService(a,b){const c=[],d=a?.['publish']===!![]&&typeof a?.['object']==='string',e=readSeverityOverrides();for(const f of AUDIT_RULES){try{if(d&&f['fields']&&!f['fields']['some'](g=>a[g]!==undefined))continue;!f['check'](a,b)&&c['push']({'rule_id':f['id'],'severity':e[f['id']]??f['severity'],'message':f['message'](a),'recommendation':f['recommendation']});}catch{}}return c;}export function hasBlockingErrors(a){return a['some'](b=>b['severity']==='error');}export function getErrors(a){return a['filter'](b=>b['severity']==='error');}export function getWarnings(a){return a['filter'](b=>b['severity']==='warning');}export function summarizeFindings(a){if(a['length']===0x0)return'All\x20audit\x20checks\x20passed.';const b=getErrors(a),c=getWarnings(a),d=a['filter'](g=>g['severity']==='info'),e=[];if(b['length']>0x0)e['push'](b['length']+'\x20error(s)');if(c['length']>0x0)e['push'](c['length']+'\x20warning(s)');if(d['length']>0x0)e['push'](d['length']+'\x20info');return'Audit:\x20'+e['join'](',\x20')+'.\x20Review\x20before\x20publishing.';}export const AUDIT_RULES_VERSION=0xb;
|
|
1
|
+
import{MAX_INDEMNITY_MULTIPLE,TASK_BINDING_SLOT}from'./onchain-constants.js';import{TWO_TX_RENEW_RECIPE}from'./protocol-facts.js';import{lintForwardAmbiguity,findLoopCycles}from'./machine-topology.js';import{isRenewalLoopEdge}from'../participation/radar-core.js';function numericAmount(a){if(typeof a==='number')return Number['isFinite'](a)?a:undefined;if(typeof a==='string'){const b=a['trim']();if(/^\d+$/['test'](b))return Number(b);}return undefined;}export{numericAmount};export function salesItemsOf(a){if(Array['isArray'](a?.['sales']))return a['sales'];if(Array['isArray'](a?.['sales']?.['sales']))return a['sales']['sales'];return[];}export function allocatorCountOf(a){const b=a?.['order_allocators'];if(Array['isArray'](b))return b['length'];if(Array['isArray'](b?.['allocators']))return b['allocators']['length'];return 0x0;}export function arbitrationRefsOf(b){const c=b?.['arbitrations'];if(Array['isArray'](c))return c['filter'](e=>typeof e==='string');if(Array['isArray'](c?.['objects']))return c['objects']['filter'](e=>typeof e==='string');return[];}export function compensationFundOf(a){if(a?.['compensation_fund_add']?.['balance']!=null)return a['compensation_fund_add']['balance'];if(a?.['compensation_fund']!=null)return a['compensation_fund'];return undefined;}export function serviceNameOf(a){if(typeof a?.['object']==='string')return a['object'];if(typeof a?.['object']?.['name']==='string'&&a['object']['name'])return a['object']['name'];if(typeof a?.['namedNew']?.['name']==='string'&&a['namedNew']['name'])return a['namedNew']['name'];return undefined;}export function typeParameterOf(a){if(typeof a?.['type_parameter']==='string'&&a['type_parameter'])return a['type_parameter'];if(typeof a?.['object']?.['type_parameter']==='string'&&a['object']['type_parameter'])return a['object']['type_parameter'];if(typeof a?.['namedNew']?.['type_parameter']==='string'&&a['namedNew']['type_parameter'])return a['namedNew']['type_parameter'];return undefined;}export const DISPUTE_FAMILY_NODE_REGEX=/(^|_)(disputed?|arbitration|arb)(_|$)/i;export const FUND_TERMINAL_NODE_REGEX=/^(refund|refunded|deposit_refunded|deposit_deducted|cancel|cancelled)$/i;export const ANTI_PATTERN_NODE_REGEX=new RegExp(DISPUTE_FAMILY_NODE_REGEX['source']+'|'+FUND_TERMINAL_NODE_REGEX['source'],'i');export const REMEDY_FAMILY_NODE_REGEX=/(revis|review|rework|refund|cancel|return|claim)/i;export function isRemedyLoopEdge(a,b){return REMEDY_FAMILY_NODE_REGEX['test'](a)||REMEDY_FAMILY_NODE_REGEX['test'](b);}export function classifyLoopCycle(a,b){for(let c=0x0;c<a['length'];c++){if(isRenewalLoopEdge(a[c],a[(c+0x1)%a['length']]))return'renewal';}if(b==='review-loop')return'remedy';if(b==='paid-cycle')return'charge';if(a['some'](d=>REMEDY_FAMILY_NODE_REGEX['test'](d)))return'remedy';return'charge';}export function auditMachineNodes(a,b){const c=[],d=[];if(!Array['isArray'](a)||a['length']===0x0)return d['push']('pre_publish:\x20machine\x20node\x20set\x20unavailable\x20—\x20topology\x20not\x20verifiable;\x20'+'verify\x20via\x20machineNode2file\x20BEFORE\x20publish\x20(immutable\x20after\x20publish,\x20IMMUT-001)'),{'critical':c,'warnings':d};const e=a;for(const u of e){const v=typeof u?.['name']==='string'?u['name']:'';if(!v)continue;if(DISPUTE_FAMILY_NODE_REGEX['test'](v))c['push']('R-M1-11:\x20machine\x20node\x20\x22'+v+'\x22\x20models\x20dispute\x20flow\x20—\x20'+'disputes\x20must\x20route\x20via\x20the\x20separate\x20Arbitration\x20object\x20(off-Machine);\x20'+'rename\x20the\x20node\x20to\x20the\x20business\x20state\x20that\x20triggers\x20it');else FUND_TERMINAL_NODE_REGEX['test'](v)&&d['push']('R-M1-11:\x20machine\x20node\x20\x22'+v+'\x22\x20uses\x20a\x20bare\x20fund-terminal\x20name\x20—\x20reaching\x20'+'it\x20moves\x20no\x20funds\x20by\x20itself.\x20This\x20is\x20legitimate\x20ONLY\x20when\x20a\x20refund\x20allocator\x20'+'rail\x27s\x20guard\x20anchors\x20to\x20this\x20node\x20(per-node\x20refund\x20tracks);\x20otherwise\x20rename\x20it\x20'+'to\x20the\x20business\x20state\x20(e.g.\x20cancel_requested\x20/\x20closed_cancel)\x20and\x20route\x20the\x20'+'refund\x20via\x20an\x20Allocator\x20triggered\x20by\x20that\x20state.\x20The\x20template\x20scanner\x20verifies\x20'+'the\x20anchoring\x20when\x20a\x20template\x20is\x20present.');}const g=new Set();for(const w of e){const x=typeof w?.['name']==='string'?w['name']:'';if(!x)continue;g['has'](x)&&c['push']('MC-C-04:\x20duplicate\x20machine\x20node\x20name\x20\x22'+x+'\x22\x20—\x20on-chain\x20will\x20reject\x20the\x20publish\x20transaction'),g['add'](x);}const h=e['some'](y=>Array['isArray'](y?.['pairs'])&&y['pairs']['some'](z=>z?.['prev_node']===''));!h&&c['push']('Machine\x20has\x20no\x20entry\x20pair\x20(prev_node=\x22\x22)\x20—\x20Progress\x20can\x20never\x20advance\x20'+'from\x20the\x20initial\x20state;\x20orders\x20are\x20permanently\x20stuck');const i=new Map();for(const y of e){const z=typeof y?.['name']==='string'&&y['name']!==''?y['name']:'(unnamed\x20node)';for(const A of Array['isArray'](y?.['pairs'])?y['pairs']:[]){const B=A?.['prev_node'];if(typeof B!=='string')continue;const C=Array['isArray'](A?.['forwards'])?A['forwards']:[];for(const D of C){const E=typeof D==='string'?D:typeof D?.['name']==='string'?D['name']:'';if(E==='')continue;const F=B+'\x00'+E,G=i['get'](F);if(G===z)c['push']('H-09:\x20duplicate\x20machine\x20edge\x20(prev_node\x20\x22'+B+'\x22\x20->\x20forward\x20\x22'+E+'\x22)\x20re-declared\x20on\x20node\x20\x22'+z+'\x22\x20—\x20'+'partitioned\x20building\x20re-sends\x20are\x20APPEND-ONLY\x20on\x20the\x20draft\x20(sso-tn-261027:\x2017\x20entries\x20/\x2014\x20unique\x20names);\x20'+'the\x20chain\x20edge\x20lookup\x20takes\x20the\x20FIRST\x20match,\x20so\x20every\x20extra\x20copy\x20is\x20unreachable\x20dead\x20weight\x20that\x20ships\x20'+'the\x20draft\x27s\x20ghost\x20edges\x20into\x20an\x20immutable\x20machine\x20(IMMUT-001).\x20Drop\x20the\x20duplicate\x20pair\x20'+'(delete\x20it\x20on\x20the\x20still-unpublished\x20draft\x20machine)\x20before\x20publishing');else G===undefined&&i['set'](F,z);}}}const j=new Map();for(const H of e){const I=typeof H?.['name']==='string'?H['name']:'';if(!I)continue;if(!j['has'](I))j['set'](I,[]);for(const J of H?.['pairs']??[]){const K=J?.['prev_node'];if(typeof K==='string'&&K!==''){const L=j['get'](K);if(L)L['push'](I);else j['set'](K,[I]);}}}const k=findLoopCycles(j)['map'](M=>({'c':M,'tier':classifyLoopCycle(M['cycle'],b)})),l=k['filter'](M=>M['tier']==='renewal'),m=k['filter'](M=>M['tier']==='remedy'),o=k['filter'](M=>M['tier']==='charge');o['length']>0x0&&c['push']('pre_publish:\x20machine\x20contains\x20charge-bearing\x20loop\x20cycle(s)\x20'+o['map'](M=>'['+M['c']['cycle']['join']('\x20->\x20')+']')['join'](',\x20')+'\x20—\x20'+'on-chain\x20a\x20revisit\x20is\x20NOT\x20verified\x20to\x20re-fund\x20the\x20Allocation,\x20and\x20this\x20static\x20pass\x20sees\x20only\x20the\x20forward\x27s\x20guard\x20reference\x20'+'(never\x20the\x20guard\x20table),\x20so\x20a\x20per-revisit-fee\x20cycle\x20(retake\x20/\x20session-card\x20shape)\x20is\x20UNPROVABLE\x20here\x20even\x20though\x20the\x20'+'allocation.balance\x20Guard\x20query\x20(1051,\x20witness\x20OrderAllocation\x20109)\x20makes\x20the\x20fee\x20enforceable\x20at\x20the\x20guard\x20layer\x20'+'(zero-value\x20re-delivery\x20cycles,\x20test/11\x20R2-F3\x20/\x20crs\x20P2-3).\x20THREE\x20WAYS\x20OUT\x20—\x20'+'(1)\x20NO-CHARGE\x20revisit\x20(F-06,\x20ctra-mn\x20261019:\x20a\x20delivered->in_progress\x20revision\x20loop\x20is\x20business-correct\x20and\x20was\x20false-CRITICAL\x20here):\x20'+'declare\x20`reentry_kind:\x20\x22review-loop\x22`\x20on\x20this\x20publish\x20payload\x20(AP-3\x20—\x20machine-checkable,\x20no\x20renaming\x20needed)\x20'+'OR\x20rename\x20ANY\x20ONE\x20node\x20of\x20the\x20cycle\x20with\x20a\x20remedy\x20word\x20root\x20the\x20classifier\x20reads\x20—\x20revis*/review*/rework*/refund*/cancel*/return*/claim*\x20'+'(e.g.\x20\x27revising\x27\x20instead\x20of\x20\x27in_progress\x27)\x20—\x20and\x20the\x20cycle\x20reclassifies\x20as\x20remedy\x20tier\x20(warning,\x20not\x20a\x20blocker);\x20'+'(2)\x20GENUINELY\x20charge-bearing\x20with\x20neutral\x20names:\x20declare\x20`reentry_kind:\x20\x22paid-cycle\x22`\x20(keeps\x20this\x20block\x20—\x20'+'it\x20is\x20the\x20declaration\x20of\x20intent)\x20and\x20bind\x20the\x20fund-gate\x20Guard\x20on\x20the\x20loop\x20forward\x20'+'(constant\x20=\x20order\x20address,\x20convert_witness\x20OrderAllocation,\x20allocation.balance\x20>=\x20revisit\x20fee)\x20AND\x20publish\x20through\x20a\x20template\x20'+'carrying\x20that\x20convention\x20—\x20PRE-STATE\x20CONSTRAINT\x20(esound-mn-261021\x20B-1):\x20the\x20gate\x20reads\x20the\x20COMMITTED\x20pre-transaction\x20'+'balance,\x20so\x20the\x20revisit\x20funds\x20must\x20be\x20committed\x20in\x20a\x20PRIOR\x20transaction.\x20'+TWO_TX_RENEW_RECIPE+'\x20'+'Alternatively\x20replace\x20the\x20loop\x20with\x20per-period\x20NEW\x20Orders\x20(REUSE\x20pattern\x20—\x20a\x20fresh\x20order\x20per\x20period\x20instead\x20of\x20an\x20in-order\x20loop\x20that\x20replays\x20its\x20forwards\x20every\x20lap).\x20'+'(3)\x20A\x20funded\x20renewal\x20loop\x20(post-period\x20node\x20back\x20into\x20a\x20charging\x20node,\x20advanced\x20via\x20the\x20one-PTB\x20order_renew\x20call,\x20'+'NO\x20balance\x20gate\x20on\x20the\x20renew\x20forward\x20—\x20see\x20the\x20PRE-STATE\x20CONSTRAINT\x20above)\x20'+'is\x20the\x20only\x20sanctioned\x20charge-bearing\x20cycle\x20shape\x20for\x20in-order\x20renewals.');l['length']>0x0&&d['push']('pre_publish:\x20machine\x20contains\x20renewal\x20loop\x20cycle(s)\x20'+l['map'](M=>'['+M['c']['cycle']['join']('\x20->\x20')+']')['join'](',\x20')+'\x20—\x20on-chain\x20a\x20revisit\x20'+'is\x20NOT\x20verified\x20to\x20re-fund\x20the\x20Allocation.\x20Every\x20renewal/loop\x20forward\x20MUST\x20carry\x20the\x20new-period\x20'+'payment\x20into\x20the\x20order\x20escrow\x20(use\x20the\x20order\x20call\x27s\x20order_renew\x20field:\x20create\x20the\x20period\x20payment,\x20receive\x20it\x20into\x20the\x20'+'allocation,\x20and\x20advance\x20the\x20progress\x20—\x20all\x20in\x20one\x20transaction),\x20or\x20the\x20loop\x20allows\x20zero-value\x20'+'re-delivery\x20cycles\x20(test/11\x20R2-F3).\x20'+'PRE-STATE\x20CONSTRAINT\x20(esound-mn-261021\x20B-1,\x20mainnet-verified):\x20a\x20guard\x20on\x20the\x20renew\x20forward\x20reading\x20'+'allocation.balance\x20(query\x201051)\x20evaluates\x20the\x20COMMITTED\x20pre-transaction\x20balance\x20—\x20the\x20same-PTB\x20order_renew\x20'+'payment\x20is\x20INVISIBLE\x20to\x20it,\x20so\x20a\x20balance-gated\x20renew\x20forward\x20ALWAYS\x20aborts.\x20NEVER\x20bind\x20a\x20balance\x20gate\x20to\x20a\x20'+'forward\x20that\x20order_renew\x20advances\x20in\x20the\x20same\x20PTB.\x20'+TWO_TX_RENEW_RECIPE+'\x20'+'The\x20zero-value\x20protection\x20rides\x20this\x20routing\x20convention\x20(order_renew\x27s\x20amount).');m['length']>0x0&&d['push']('pre_publish:\x20machine\x20contains\x20remedy\x20loop\x20cycle(s)\x20'+m['map'](M=>'['+M['c']['cycle']['join']('\x20->\x20')+']')['join'](',\x20')+'\x20—\x20'+'a\x20same-order\x20revisit\x20(revision/review/rework/refund/cancel\x20family)\x20implies\x20NO\x20new\x20charge,\x20so\x20no\x20fund\x20gate\x20is\x20needed\x20on\x20it\x20'+'(the\x20allocation.balance\x20query\x20exists\x20but\x20is\x20irrelevant\x20here).\x20Visible\x20by\x20design\x20(crs\x20P2-3):\x20if\x20the\x20business\x20EVER\x20intends\x20'+'a\x20revisit\x20to\x20cost\x20money,\x20that\x20fee\x20IS\x20enforceable\x20via\x20the\x20balance\x20query\x20(1051)\x20—\x20but\x20that\x20reshapes\x20the\x20cycle\x20into\x20the\x20'+'charge\x20tier\x20above;\x20keep\x20remedy\x20revisits\x20free\x20or\x20restructure\x20as\x20per-period\x20NEW\x20Orders.');for(const M of e){const N=typeof M?.['name']==='string'?M['name']:'?';for(const O of M?.['pairs']??[]){for(const P of O?.['forwards']??[]){const Q=P?.['namedOperator']!==undefined&&P?.['namedOperator']!==null,R=P?.['permissionIndex']!==undefined&&P?.['permissionIndex']!==null,S=P?.['guard']!==undefined&&P?.['guard']!==null;!Q&&!R&&!S&&d['push']('pre_publish:\x20node\x20\x22'+N+'\x22\x20forward\x20\x22'+String(P?.['name']??'?')+'\x22\x20has\x20no\x20executor\x20binding\x20(namedOperator\x20/\x20permissionIndex\x20/\x20guard)\x20—\x20no\x20one\x20can\x20advance\x20it');}}}const q=computeTerminalReachability(a),r=new Map(),s=new Map();for(const T of e){for(const U of T?.['pairs']??[]){const V=U?.['prev_node'];if(typeof V!=='string'||V==='')continue;for(const W of U?.['forwards']??[]){const X=W?.['namedOperator']!=null&&String(W['namedOperator'])!==''?'operator:'+String(W['namedOperator']):W?.['permissionIndex']!=null?'permission:'+String(W['permissionIndex']):null;s['set'](V,(s['get'](V)??0x0)+0x1);if(X!=null){const Y=r['get'](V)??new Set();Y['add'](X),r['set'](V,Y);}}}}for(const [Z,a0]of r){(s['get'](Z)??0x0)>=0x1&&a0['size']===0x1&&d['push']('pre_publish:\x20LIVE-ACT-02\x20node\x20\x22'+Z+'\x22\x20—\x20every\x20outgoing\x20forward\x20binds\x20the\x20SAME\x20single\x20identity\x20('+[...a0]['join'](',\x20')+'):\x20'+'if\x20that\x20actor\x20goes\x20silent\x20the\x20order\x20LATCHES\x20here\x20and\x20the\x20escrow\x20freezes\x20—\x20there\x20is\x20no\x20counterparty\x20or\x20keeper\x20exit\x20'+'(alg26\x20261026\x20O9/O5\x20family:\x20changes_requested\x20with\x20only\x20a\x20contributor\x20resubmit\x20edge;\x20claimed\x20with\x20only\x20a\x20merchant\x20assign\x20edge).\x20'+'Design\x20the\x20exit\x20edge\x20NOW\x20(a\x20keeper\x20or\x20auto-close\x20forward\x20with\x20its\x20own\x20identity,\x20or\x20a\x20counterparty-signed\x20cancel/refund\x20edge)\x20—\x20'+'immutable\x20after\x20publish\x20(IMMUT-001).\x20If\x20single-operator-by-design,\x20this\x20warning\x20can\x20be\x20ignored');}const t=lintForwardAmbiguity(a,'pre_publish');return c['push'](...t['critical']),d['push'](...t['warnings']),q['unreachable']['length']>0x0&&d['push']('pre_publish:\x20unreachable\x20machine\x20node(s)\x20'+q['unreachable']['map'](a1=>'\x22'+a1+'\x22')['join'](',\x20')+'\x20—\x20'+'no\x20path\x20from\x20the\x20entry\x20pair\x20reaches\x20them;\x20dead\x20topology\x20is\x20frozen\x20at\x20publish\x20(IMMUT-001).\x20'+'Wire\x20them\x20into\x20the\x20flow\x20or\x20remove\x20them\x20before\x20publish'),{'critical':c,'warnings':d};}export function computeTerminalReachability(a){const b=[],c=[];if(!Array['isArray'](a)||a['length']===0x0)return{'terminals':b,'unreachable':c};const d=a,e=new Map(),f=[],g=[];for(const j of d){const k=typeof j?.['name']==='string'?j['name']:'';if(!k)continue;f['push'](k);if(!e['has'](k))e['set'](k,[]);let l=![];for(const m of j?.['pairs']??[]){const o=m?.['prev_node'];if(o==='')l=!![];else{if(typeof o==='string'&&o!==''&&o!==k){const q=e['get'](o);if(q)q['push'](k);else e['set'](o,[k]);}}}if(l)g['push'](k);}if(f['length']===0x0||g['length']===0x0)return{'terminals':b,'unreachable':c};const h=new Set(),i=[...g];while(i['length']>0x0){const r=i['pop']();if(h['has'](r))continue;h['add'](r);for(const s of e['get'](r)??[])i['push'](s);}for(const t of f){if(!h['has'](t))c['push'](t);else{if((e['get'](t)??[])['length']===0x0)b['push'](t);}}return{'terminals':b,'unreachable':c};}export const REVIEW_FAMILY_NODE_REGEX=/(^|_)(review|reviews|reviewed|reviewing|evaluated|evaluate|feedback|rating|rated)(_|$)/i;export function lintReviewLockedTerminals(a,b){const c=[],d=[];if(!Array['isArray'](a)||a['length']===0x0)return{'critical':c,'warnings':d};const e=a,h=u=>Array['isArray'](u?.['pairs'])?u['pairs']:Array['isArray'](u?.['value'])?u['value']:[],i=[],j=[],k=[];for(const u of e){const v=typeof u?.['name']==='string'?u['name']:'';if(!v)continue;j['push'](v);let w=![];for(const x of h(u)){const y=x,z=y?.['prev_node'];if(z==='')w=!![];const A=Array['isArray'](y?.['forwards'])?y['forwards']:[],B=[];for(const C of A){const D=C,E=D?.['guard'],F=typeof E==='string'&&E['trim']()!==''?E:E&&typeof E==='object'?E['guard']??E['$ref']:undefined;if(typeof F==='string'&&F['trim']()!=='')B['push'](F);}typeof z==='string'&&z!==''&&i['push']({'from':z,'to':v,'guardRefs':B});}if(w)k['push'](v);}if(j['length']===0x0||k['length']===0x0)return{'critical':c,'warnings':d};const l=computeTerminalReachability(a);if(l['terminals']['length']===0x0)return{'critical':c,'warnings':d};const m=G=>{if(G['guardRefs']['length']===0x0)return![];for(const H of G['guardRefs']){const I=b['get'](H['toLowerCase']());if(!I||I['length']===0x0)return![];const J=I['every'](K=>REVIEW_FAMILY_NODE_REGEX['test'](K));if(!J||I['includes'](G['from']))return![];}return!![];},o=G=>REVIEW_FAMILY_NODE_REGEX['test'](G),q=G=>{const H=new Map();for(const K of i){if(m(K))continue;if(G&&(o(K['from'])||o(K['to'])))continue;const L=H['get'](K['from']);if(L)L['push'](K['to']);else H['set'](K['from'],[K['to']]);}const I=new Set(),J=[...k];while(J['length']>0x0){const M=J['pop']();if(I['has'](M))continue;I['add'](M);for(const N of H['get'](M)??[])J['push'](N);}return I;},r=q(![]),s=q(!![]);for(const G of l['terminals']){if(!r['has'](G))c['push']('REVIEW-LOCK-01:\x20terminal\x20\x22'+G+'\x22\x20is\x20enterable\x20ONLY\x20through\x20forward(s)\x20whose\x20guard\x20pins\x20a\x20'+'review/feedback\x20node\x20the\x20edge\x20itself\x20does\x20not\x20depart\x20from\x20—\x20the\x20rail\x20can\x20never\x20fire\x20(the\x20guard\x20asserts\x20a\x20'+'progress\x20state\x20this\x20transition\x20cannot\x20produce),\x20so\x20a\x20buyer\x20who\x20never\x20reviews\x20strands\x20every\x20order\x27s\x20'+'escrow\x20permanently.\x20Machine\x20topology\x20is\x20immutable\x20after\x20publish\x20(IMMUT-001).\x20Fix\x20BEFORE\x20publish:\x20'+'re-pin\x20the\x20settlement\x20guard\x20to\x20the\x20node\x20the\x20forward\x20actually\x20departs\x20from,\x20and\x20add\x20a\x20time-lock\x20keeper\x20'+'auto-confirm\x20rail\x20(the\x20template\x20deliver_confirm_timeout\x20convention)\x20so\x20settlement\x20never\x20depends\x20on\x20the\x20'+'buyer\x20choosing\x20to\x20review');else!s['has'](G)&&d['push']('REVIEW-LOCK-01:\x20terminal\x20\x22'+G+'\x22\x20is\x20reachable\x20only\x20THROUGH\x20a\x20review/feedback\x20node\x20—\x20a\x20buyer\x20who\x20'+'silently\x20skips\x20reviewing\x20can\x20never\x20let\x20their\x20order\x20reach\x20it.\x20The\x20sanctioned\x20shape\x20keeps\x20the\x20review\x20'+'stop\x20OPTIONAL\x20with\x20an\x20exit\x20edge\x20back\x20to\x20the\x20settlement\x20rail,\x20and\x20a\x20keeper\x20time-lock\x20rail\x20that\x20opens\x20'+'settlement\x20independently\x20(retail\x20deliver_confirm_timeout\x20convention).\x20Verify\x20one\x20of\x20the\x20two\x20exists;\x20'+'if\x20the\x20review\x20node\x20is\x20meant\x20to\x20be\x20keeper-advanceable,\x20this\x20is\x20satisfied\x20and\x20may\x20be\x20ignored');}return{'critical':c,'warnings':d};}export function arbitrationVotingLockDetail(a){if(!Array['isArray'](a))return null;if(a['length']>0x0)return null;return'voting_guard\x20is\x20empty\x20(no\x20guard-weighted\x20voters).\x20Plain\x20votes\x20hard-require\x20the\x20vote\x20permission\x20(358)\x20on\x20the\x20'+'arbitration\x27s\x20own\x20Permission:\x20only\x20that\x20Permission\x27s\x20admin\x20(its\x20creator,\x20by\x20default)\x20and\x20explicit\x20358\x20'+'grantees\x20pass\x20the\x20assert,\x20so\x20without\x20grants\x20the\x20disputing\x20CUSTOMER\x20can\x20never\x20vote\x20and\x20the\x20arb\x20admin\x20is\x20the\x20'+'only\x20possible\x20voter\x20AND\x20the\x20judge\x20—\x20a\x20dispute\x20opened\x20against\x20this\x20service\x20dead-locks\x20when\x20that\x20admin\x20is\x20'+'unresponsive.\x20Configure\x20a\x20public\x20voting_guard\x20on\x20the\x20Arbitration\x20(voting_guard\x20op=\x27set\x27\x20with\x20guard\x20+\x20vote\x20'+'weight\x20—\x20the\x20field\x20stays\x20mutable\x20after\x20publish;\x20the\x20standard\x20shape\x20is\x20tpl_voting_guard_open_vote,\x20the\x20'+'always-true\x20guard\x20at\x20FixedValue\x20weight\x201)\x20or\x20bind\x20an\x20arbitration\x20that\x20already\x20carries\x20one,\x20BEFORE\x20'+'publishing\x20this\x20service';}const TIME_PROFILE_UNIT_MS={'ms':0x1,'msec':0x1,'msecs':0x1,'millisecond':0x1,'milliseconds':0x1,'s':0x3e8,'sec':0x3e8,'secs':0x3e8,'second':0x3e8,'seconds':0x3e8,'m':0xea60,'min':0xea60,'mins':0xea60,'minute':0xea60,'minutes':0xea60,'h':0x36ee80,'hr':0x36ee80,'hrs':0x36ee80,'hour':0x36ee80,'hours':0x36ee80,'d':0x5265c00,'day':0x5265c00,'days':0x5265c00,'w':0x240c8400,'wk':0x240c8400,'wks':0x240c8400,'week':0x240c8400,'weeks':0x240c8400},TIME_PROFILE_DURATION_REGEX=/(\d+(?:\.\d+)?)\s*(ms|milliseconds?|msecs?|minutes?|mins?|seconds?|secs?|hours?|hrs?|days?|weeks?|wks?|min|sec|hr|wk|[smhdw])\b/gi,TIME_PROFILE_ADMISSION_REGEX=/compress(?:ed|ion)|accelerat(?:ed|ion)|shorten(?:ed)?(?:\s+for)?|test\s+(?:value|window|duration|constant)|demo\s+(?:value|window|duration)|for\s+(?:fast\s+|quick\s+)?test(?:ing)?|regression\s+(?:value|window)/i,TIME_PROFILE_FLOOR_MS=0x36ee80;function timeProfileIsTimeQuery(a){if(typeof a==='number')return a===0x4f7||a===0x4f8||a===0x500;if(typeof a==='string')return/(^|\.)time$|current_time/i['test'](a);return![];}function timeProfileNodeChildren(a){const b=[];for(const c of['nodes','node','nodeLeft','nodeRight','parameters','historyIdx','sessionIdx','forwardIdx','where','find','recipient']){const d=a[c];if(Array['isArray'](d))b['push'](...d);else{if(d&&typeof d==='object')b['push'](d);}}return b;}export function guardTimeProfileDetail(a){const b=typeof a['description']==='string'?a['description']:'',c=TIME_PROFILE_ADMISSION_REGEX['test'](b);let d=0x0;for(const o of b['matchAll'](TIME_PROFILE_DURATION_REGEX)){const p=TIME_PROFILE_UNIT_MS[o[0x2]['toLowerCase']()];if(!p)continue;const q=Number(o[0x1])*p;if(Number['isFinite'](q)&&q>d)d=q;}if(!c&&d===0x0)return null;const e=Array['isArray'](a['table'])?a['table']:[],f=r=>{const s=e['find'](u=>Number(u?.['identifier'])===r);return numericAmount(s?.['value']);},h=r=>{if(!r||typeof r!=='object')return![];const s=r;if(s['type']==='context'&&s['context']==='Clock')return!![];if(s['type']==='query'&&timeProfileIsTimeQuery(s['query']))return!![];if(s['type']==='query_progress_history_time')return!![];return timeProfileNodeChildren(s)['some'](h);},i=[],j=(r,s)=>{if(!r||typeof r!=='object')return;const t=r,u=s||typeof t['type']==='string'&&t['type']['startsWith']('calc_');if(t['type']==='identifier'&&u){const w=f(Number(t['identifier']));if(w!==undefined&&w>0x0)i['push'](w);}for(const x of timeProfileNodeChildren(t))j(x,u);};if(a['root']&&typeof a['root']==='object'&&h(a['root']))j(a['root'],![]);const k=i['find'](r=>r<d/0x64),l=r=>r>=0x5265c00?r/0x5265c00+'d':r>=0x36ee80?r/0x36ee80+'h':r>=0xea60?r/0xea60+'min':r/0x3e8+'s';if(k!==undefined)return{'level':'critical','detail':'time\x20constant\x20'+l(k)+'\x20is\x20>=100x\x20below\x20the\x20production\x20duration\x20the\x20description\x20itself\x20'+('declares\x20('+l(d)+')\x20—\x20a\x20compressed\x20test\x20value\x20frozen\x20into\x20a\x20production\x20guard.\x20Guards\x20')+'freeze\x20at\x20publish\x20(IMMUT-001),\x20so\x20the\x20window\x20will\x20enforce\x20the\x20compressed\x20value\x20against\x20real\x20orders\x20'+'(klook\x20mainnet\x20261014:\x20\x2724h\x20free\x20cancellation\x27\x20enforced\x20as\x202\x20minutes).\x20Rebuild\x20the\x20guard\x20with\x20the\x20'+'production\x20duration\x20from\x20the\x20template\x20fee_params\x20BEFORE\x20publishing'};if(c)return{'level':'warning','detail':'description\x20admits\x20compressed/accelerated\x20time\x20constants,\x20but\x20NO\x20time\x20constant\x20in\x20this\x20guard\x27s\x20logic\x20'+'tree\x20is\x20>=100x\x20below\x20the\x20declared\x20production\x20duration\x20—\x20the\x20values\x20look\x20production-scaled.\x20Manual\x20'+'review\x20requested\x20(prose\x20alone\x20no\x20longer\x20blocks\x20publish,\x20BF-07):\x20confirm\x20the\x20tree\x20constants\x20match\x20the\x20'+'production\x20durations\x20in\x20the\x20template\x20fee_params\x20BEFORE\x20publishing\x20—\x20guards\x20freeze\x20at\x20publish\x20'+'(IMMUT-001),\x20so\x20a\x20mis-scaled\x20window\x20(klook\x20mainnet\x20261014:\x20\x2724h\x20free\x20cancellation\x27\x20enforced\x20as\x202\x20'+'minutes)\x20is\x20UNFIXABLE'};const n=i['find'](r=>r<TIME_PROFILE_FLOOR_MS);if(n!==undefined)return{'level':'warning','detail':'time\x20constant\x20'+l(n)+'\x20is\x20below\x20the\x20'+TIME_PROFILE_FLOOR_MS/0x36ee80+'h\x20sanity\x20floor\x20'+'(the\x20description\x20declares\x20no\x20production\x20duration\x20and\x20admits\x20no\x20compression,\x20yet\x20the\x20window\x20is\x20'+'sub-hour)\x20—\x20almost\x20always\x20a\x20compressed\x20test\x20value\x20frozen\x20into\x20the\x20guard.\x20Guards\x20freeze\x20at\x20publish\x20'+'(IMMUT-001):\x20confirm\x20the\x20value\x20is\x20intended\x20for\x20LIVE\x20traffic,\x20or\x20rebuild\x20with\x20the\x20production\x20'+'duration\x20from\x20the\x20template\x20fee_params\x20BEFORE\x20mainnet\x20publish\x20(ddmc2\x20F-11:\x20a\x203-minute\x20filing\x20'+'window\x20permanently\x20revoked\x20a\x20buyer\x27s\x20dispute\x20right\x20on\x20one\x20transport\x20retry)'};return null;}export function rewardRefsOf(a){const b=a?.['rewards'];if(typeof b==='string'&&b['trim']()!=='')return[b];if(Array['isArray'](b))return b['filter'](c=>typeof c==='string'&&c['trim']()!=='');if(Array['isArray'](b?.['objects']))return b['objects']['filter'](c=>typeof c==='string'&&c['trim']()!=='');return[];}export function serviceRewardsUnfundedDetail(b){if(!b||typeof b!=='object')return null;const c=b['data']??b,d=Array['isArray'](c?.['guards'])?c['guards']:[],e=numericAmount(c?.['balance']?.['value']??c?.['balance']);if(e===undefined)return null;let f=0x0;for(const h of d){const i=h?.['amount'];if(i?.['type']!==0x1)continue;const j=numericAmount(i?.['value']?.['value']??i?.['value']);if(j!==undefined&&j>f)f=j;}if(f===0x0)return null;if(e>=f)return null;return'reward\x20pool\x20balance\x20'+e+'\x20cannot\x20cover\x20its\x20largest\x20single-claim\x20promise\x20('+f+').\x20'+'The\x20on-chain\x20publish\x20entry\x20does\x20NOT\x20verify\x20reward\x20funding\x20—\x20a\x20failed\x20reward_fund\x20transfer\x20still\x20'+'publishes\x20(onlyfans\x20mainnet\x20261014\x20shipped\x20a\x20store\x20promising\x20cashback\x20with\x20an\x20empty\x20pool),\x20and\x20the\x20'+'claim\x20aborts\x20once\x20the\x20pool\x20drains.\x20Fund\x20the\x20Reward\x20(reward_fund)\x20up\x20to\x20expected_orders\x20x\x20per-claim\x20'+'amount,\x20or\x20remove\x20the\x20reward\x20binding\x20BEFORE\x20publishing\x20this\x20service';}export const TASK_BINDING_REMEDIATION_ENTRY={'identifier':TASK_BINDING_SLOT,'b_submission':!![],'value_type':'Address','name':'task_binding\x20order\x20anchor\x20(protocol\x20slot\x20254;\x20written\x20by\x20order\x20creation)'};const TASK_BINDING_TRIGGER='the\x20triggering\x20Passport\x20must\x20submit\x20identifier\x20'+TASK_BINDING_SLOT+'\x20carrying\x20the\x20Order\x20address';export function declaresTaskBindingSlot(a){if(!Array['isArray'](a))return![];return a['some'](b=>{if(typeof b!=='object'||b===null)return![];const c=b;return Number(c['identifier'])===TASK_BINDING_SLOT&&c['b_submission']===!![]&&String(c['value_type'])==='Address';});}export const REFUND_RAIL_NODE_REGEX=/(^|_)(refund|refunded|cancel|cancelled|return|returned)(_|$)/i;export function lintTaskBindingAdvisories(a){const b=[];if(!Array['isArray'](a['table']))return b;const c=declaresTaskBindingSlot(a['table']),d=a['guardRef']!==undefined?'\x22'+a['guardRef']+'\x22':'this\x20guard';if(a['refundReentry']===!![]&&c)return b['push']({'code':'TASKBIND-254-REFUND-REPLAY','level':'warning','detail':'refund\x20rail\x20guard\x20'+d+'\x20declares\x20protocol\x20slot\x20'+TASK_BINDING_SLOT+'\x20(b_submission:\x20true).\x20'+(TASK_BINDING_SLOT+'\x20is\x20the\x20ONCE_FOR_OBJECT\x20task-binding\x20slot:\x20a\x20refund\x20rail\x20that\x20can\x20re-enter\x20its\x20')+'refund\x20node\x20in\x20a\x20later\x20period\x20(deposit\x20re-refund,\x20re-selected\x20order,\x20renewal\x20cycle)\x20re-fires\x20on\x20the\x20'+'SAME\x20order\x20and\x20aborts\x20E_ONCE_TRIGGERED\x20(code\x2016)\x20on\x20every\x20release\x20after\x20the\x20first\x20—\x20a\x20perpetual\x20'+('abort,\x20not\x20a\x20one-time\x20failure\x20(OFN\x20#P-04).\x20Remove\x20the\x20'+TASK_BINDING_SLOT+'\x20row\x20and\x20anchor\x20the\x20payee\x20')+'on\x20a\x20user\x20submission\x20slot\x20(slot\x200,\x20the\x20submitted\x20Order)\x20instead.\x20Guards\x20are\x20create-frozen\x20and\x20'+'order_allocators\x20freeze\x20at\x20service\x20publish\x20—\x20correct\x20it\x20BEFORE\x20the\x20irreversible\x20write.','remediation':{'entry':TASK_BINDING_REMEDIATION_ENTRY,'trigger':'delete\x20the\x20254\x20row;\x20pay\x20the\x20refund\x20through\x20a\x20user\x20slot\x20(slot\x200)\x20that\x20the\x20trigger\x20Passport\x20submits\x20'+'with\x20the\x20Order\x20address'}}),b;return a['allocatorBound']===!![]&&!c&&b['push']({'code':'TASKBIND-254-MISSING','level':'warning','detail':'allocator-bound\x20hand-composed\x20guard\x20'+d+'\x20declares\x20no\x20{identifier:\x20'+TASK_BINDING_SLOT+',\x20'+'b_submission:\x20true,\x20value_type:\x20\x22Address\x22}\x20row.\x20The\x20passport\x20only\x20emits\x20DECLARED\x20slots,\x20so\x20once\x20an\x20'+'order-bound\x20path\x20uses\x20this\x20guard\x20every\x20guarded\x20forward\x20aborts\x20(code\x2011)\x20—\x20and\x20a\x20NEW\x20buyer\x27s\x20first\x20'+'order\x20is\x20the\x20one\x20that\x20hits\x20the\x20254\x20placeholder\x20immediately.\x20Add\x20the\x20row\x20below;\x20the\x20trigger\x20Passport\x20'+('must\x20submit\x20identifier\x20'+TASK_BINDING_SLOT+'\x20(the\x20Order\x20address).\x20Guards\x20are\x20create-frozen\x20and\x20machine\x20')+'topology\x20/\x20order_allocators\x20freeze\x20at\x20publish\x20—\x20correct\x20it\x20BEFORE\x20the\x20irreversible\x20write.','remediation':{'entry':TASK_BINDING_REMEDIATION_ENTRY,'trigger':TASK_BINDING_TRIGGER}}),b;}export function lintMachineTaskBindingPreflight(a){if(!Array['isArray'](a['refs'])||a['refs']['length']===0x0)return[];if(a['resolved']['some'](f=>declaresTaskBindingSlot(f['table'])))return[];const b=new Set(a['resolved']['map'](f=>f['ref']['toLowerCase']())),c=a['refs']['filter'](f=>!b['has'](f['toLowerCase']())),d='NONE\x20of\x20this\x20machine\x27s\x20'+a['refs']['length']+'\x20forward\x20guard(s)\x20declares\x20the\x20protocol\x20slot\x20'+(TASK_BINDING_SLOT+'\x20Address\x20submission\x20row.\x20A\x20settlement/claim\x20guard\x20shared\x20with\x20an\x20allocator\x20rail,\x20and\x20every\x20')+'order-bound\x20forward,\x20will\x20abort\x20(code\x2011)\x20once\x20a\x20Service\x20attaches\x20—\x20a\x20new\x20buyer\x27s\x20first\x20order\x20hits\x20the\x20'+'placeholder\x20immediately.',e=a['readError']!==undefined?'the\x20forward-guard\x20definitions\x20could\x20not\x20be\x20read\x20('+a['readError']+'),\x20so\x20the\x20'+TASK_BINDING_SLOT+'\x20'+('declaration\x20is\x20UNVERIFIED.\x20Verify\x20'+d+'\x20Add\x20{identifier:\x20'+TASK_BINDING_SLOT+',\x20b_submission:\x20true,\x20')+'value_type:\x20\x22Address\x22}\x20to\x20each\x20guard\x20BEFORE\x20publish;\x20machine\x20topology\x20is\x20immutable\x20after\x20publish\x20and\x20'+'guards\x20are\x20create-frozen.':d+(c['length']>0x0?'\x20'+c['length']+'\x20ref(s)\x20could\x20not\x20be\x20resolved\x20by\x20this\x20read\x20('+c['join'](',\x20')+')\x20—\x20'+'their\x20declarations\x20are\x20unverified.':'')+('\x20Add\x20{identifier:\x20'+TASK_BINDING_SLOT+',\x20b_submission:\x20true,\x20value_type:\x20\x22Address\x22}\x20to\x20each\x20guard\x27s\x20table\x20')+'BEFORE\x20publish;\x20machine\x20topology\x20is\x20immutable\x20after\x20publish\x20(IMMUT-001)\x20and\x20guards\x20are\x20create-frozen.';return[{'code':a['readError']!==undefined?'TASKBIND-254-UNVERIFIED':'TASKBIND-254-MISSING','level':'warning','detail':e,'remediation':{'entry':TASK_BINDING_REMEDIATION_ENTRY,'trigger':TASK_BINDING_TRIGGER}}];}export function formatTaskBindingAdvisory(a,b='pre_publish'){return b+':\x20task-binding\x20advisory\x20['+a['code']+']\x20'+a['detail'];}export const AUDIT_RULES=[{'id':'audit_machine_bound','description':'Service\x20should\x20have\x20a\x20Machine\x20workflow\x20bound\x20before\x20publish','severity':'warning','fields':['machine'],'check':(a,b)=>{if(!a?.['publish'])return!![];return!!a?.['machine'];},'message':()=>'Publishing\x20a\x20service\x20without\x20a\x20Machine\x20workflow.\x20Customers\x20won\x27t\x20have\x20a\x20structured\x20order\x20process.','recommendation':'Create\x20a\x20Machine\x20(workflow\x20template)\x20and\x20bind\x20it\x20to\x20the\x20service\x20before\x20publishing.\x20The\x20machine\x20field\x20becomes\x20IMMUTABLE\x20after\x20publish.'},{'id':'audit_order_allocators','description':'Service\x20should\x20have\x20order_allocators\x20for\x20fund\x20distribution','severity':'warning','fields':['order_allocators'],'check':a=>{if(!a?.['publish'])return!![];return allocatorCountOf(a)>0x0;},'message':()=>'Publishing\x20a\x20service\x20without\x20order_allocators.\x20Order\x20funds\x20cannot\x20be\x20auto-distributed\x20to\x20suppliers.','recommendation':'Configure\x20order_allocators\x20before\x20publishing\x20—\x20this\x20field\x20becomes\x20IMMUTABLE\x20after\x20publish.'},{'id':'audit_buy_guard','description':'Service\x20should\x20have\x20a\x20buy_guard\x20for\x20customer\x20screening','severity':'info','fields':['buy_guard'],'check':a=>!!a?.['buy_guard'],'message':()=>'No\x20buy_guard\x20configured\x20—\x20anyone\x20can\x20purchase\x20this\x20service\x20without\x20verification.','recommendation':'Consider\x20adding\x20a\x20Guard\x20to\x20verify\x20customer\x20eligibility\x20(e.g.,\x20identity,\x20wallet\x20balance,\x20location).'},{'id':'audit_arb_alloc_boundary','description':'Arbitration\x20and\x20Allocator\x20coexist\x20→\x20surface\x20the\x20two-system\x20boundary\x20reminder','severity':'warning','fields':['arbitrations','compensation_fund_add','compensation_fund','order_allocators'],'check':a=>{if(!a?.['publish'])return!![];const b=arbitrationRefsOf(a)['length']>0x0||compensationFundOf(a)!==undefined;return!(b&&allocatorCountOf(a)>0x0);},'message':()=>'Arbitration\x20and\x20Allocator\x20are\x20INDEPENDENT\x20systems\x20by\x20design:\x20a\x20ruling\x20records\x20the\x20case\x20and\x20pays\x20from\x20the\x20service\x20compensation\x20fund\x20—\x20it\x20never\x20moves\x20escrow\x20and\x20never\x20advances\x20the\x20workflow.\x20With\x20both\x20configured,\x20a\x20buyer\x20can\x20receive\x20BOTH\x20the\x20arbitration\x20compensation\x20AND\x20a\x20full\x20escrow\x20refund\x20unless\x20the\x20refund/settlement\x20path\x20is\x20gated.\x20This\x20is\x20a\x20boundary\x20reminder,\x20not\x20a\x20defect\x20—\x20verify\x20the\x20coupling\x20check\x20was\x20done\x20deliberately.','recommendation':'Gate\x20the\x20refund/settlement\x20allocator\x27s\x20Guard\x20on\x20order.claimed_by\x20(read-only\x20cross-system\x20evidence\x20—\x20the\x20sanctioned\x20link),\x20or\x20hold\x20the\x20final\x20settlement\x20forward\x20until\x20the\x20case\x20closes.\x20Do\x20NOT\x20couple\x20the\x20systems\x20the\x20other\x20way\x20(no\x20dispute\x20state\x20on\x20the\x20order\x20flow,\x20no\x20workflow\x20step\x20into\x20arbitration):\x20coupling\x20opens\x20the\x20double-pay\x20path.\x20For\x20per-case\x20fund\x20actions,\x20the\x20deposit-reimbursement\x20pattern\x20(guard-design\x20patterns)\x20is\x20the\x20supported\x20route.'},{'id':'audit_compensation_fund','description':'Service\x20should\x20have\x20a\x20compensation_fund\x20for\x20trust','severity':'warning','fields':['compensation_fund_add','compensation_fund'],'check':a=>compensationFundOf(a)!==undefined,'message':()=>'No\x20compensation_fund\x20configured.\x20Customers\x20have\x20no\x20financial\x20protection\x20if\x20you\x20fail\x20to\x20deliver.','recommendation':'Deposit\x20via\x20compensation_fund_add\x20{balance}\x20to\x20enable\x20arbitration\x20payouts.\x20The\x20fund\x20deters\x20fraud\x20and\x20enables\x20arbitration\x20claims.'},{'id':'audit_arbitrations','description':'Service\x20should\x20have\x20arbitration\x20options\x20for\x20dispute\x20resolution','severity':'info','fields':['arbitrations'],'check':a=>arbitrationRefsOf(a)['length']>0x0,'message':()=>'No\x20arbitration\x20configured.\x20Disputes\x20cannot\x20be\x20resolved\x20through\x20a\x20third\x20party.','recommendation':'Add\x20at\x20least\x20one\x20Arbitration\x20object\x20via\x20arbitrations:{op:\x27add\x27,\x20objects:[...]}\x20to\x20enable\x20on-chain\x20dispute\x20resolution.'},{'id':'audit_arbitration_removal_strands_awards','description':'Removing\x20an\x20authorized\x20venue\x20can\x20strand\x20an\x20award\x20it\x20already\x20ruled\x20on','severity':'error','fields':['arbitrations'],'check':a=>{const b=a?.['arbitrations']?.['remove']??a?.['arbitrations']?.['clear'],c=Array['isArray'](b)?b['length']>0x0:a?.['arbitrations']?.['op']==='clear';if(!c)return!![];if(arbitrationRefsOf(a)['length']>0x0)return!![];return compensationFundOf(a)===undefined;},'message':a=>{const b=a?.['arbitrations']?.['clear']?'every\x20authorized\x20venue':'venue(s)\x20'+(a?.['arbitrations']?.['remove']??[])['join'](',\x20');return'Removing\x20'+b+'\x20while\x20a\x20compensation\x20fund\x20is\x20configured\x20makes\x20any\x20award\x20it\x20already\x20ruled\x20on\x20UNPAYABLE:\x20an\x20on-chain\x20payout\x20now\x20requires\x20the\x20deciding\x20venue\x20to\x20still\x20be\x20on\x20the\x20Service\x27s\x20allowlist,\x20so\x20paying\x20out\x20aborts\x20with\x20E_ARBITRATION_NOT_ALLOWED=39\x20and\x20the\x20escrowed\x20funds\x20stay\x20stranded.';},'recommendation':'Before\x20removing\x20a\x20venue,\x20confirm\x20no\x20case\x20it\x20ruled\x20on\x20is\x20still\x20awaiting\x20compensation\x20payout\x20(query\x20the\x20Arb\x20objects\x20for\x20status\x20Arbitrated,\x20not\x20Finished).\x20Add\x20the\x20replacement\x20venue\x20FIRST,\x20drain\x20the\x20old\x20venue\x27s\x20cases,\x20and\x20only\x20then\x20remove\x20it.\x20A\x20buyer\x20should\x20never\x20be\x20left\x20holding\x20an\x20uncollectable\x20award.'},{'id':'audit_price','description':'Service\x20should\x20have\x20at\x20least\x20one\x20priced\x20sale\x20item','severity':'error','fields':['sales'],'check':a=>{const b=salesItemsOf(a);if(b['length']===0x0)return!![];return b['some'](c=>c?.['price']!==undefined&&c?.['price']!==null);},'message':()=>'Sales\x20list\x20present\x20but\x20no\x20item\x20has\x20a\x20price.\x20Customers\x20cannot\x20place\x20orders\x20without\x20knowing\x20the\x20cost.','recommendation':'Set\x20price\x20on\x20each\x20sales\x20item\x20(smallest-unit\x20string\x20or\x20display\x20form\x20like\x20\x272.5WOW\x27).'},{'id':'audit_compensation_fund_covers_award_ceiling','description':'compensation_fund\x20should\x20cover\x20the\x203x\x20award\x20ceiling\x20of\x20the\x20largest\x20sale\x20(disclosure)','severity':'warning','fields':['compensation_fund_add','compensation_fund','sales'],'check':a=>{if(!a?.['publish'])return!![];const b=compensationFundOf(a);if(b===undefined)return!![];const c=numericAmount(b);if(c===undefined)return!![];if(c===0x0)return![];const e=salesItemsOf(a)['map'](g=>numericAmount(g?.['price']))['filter'](g=>g!==undefined&&g>0x0);if(e['length']===0x0)return!![];const f=e['reduce']((g,h)=>g+h,0x0);return c>=MAX_INDEMNITY_MULTIPLE*f;},'message':()=>'compensation_fund\x20does\x20not\x20cover\x20the\x20award\x20ceiling\x20of\x20the\x20largest\x20sale.\x20An\x20award\x20is\x20hard-capped\x20at\x20'+MAX_INDEMNITY_MULTIPLE+'x\x20'+'the\x20order\x20amount\x20(the\x20MAX_INDEMNITY_MULTIPLE\x20cap,\x20enforced\x20at\x20ruling\x20time),\x20so\x20a\x20ruling\x20at\x20the\x20ceiling\x20'+'would\x20abort\x20the\x20buyer\x27s\x20claim\x20with\x2027\x20(E_COMPENSATION_NOT_MATCH)\x20—\x20the\x20ruling\x20stands\x20but\x20is\x20unpayable\x20'+'until\x20you\x20deposit,\x20and\x20the\x20abort\x20does\x20NOT\x20consume\x20the\x20claim.\x20Disclosure\x20only:\x20this\x20no\x20longer\x20blocks\x20'+'publish\x20—\x20per-order\x20coverage\x20is\x20enforced\x20at\x20BUY\x20time\x20(the\x20buyer\x27s\x20order\x20is\x20rejected\x20while\x20the\x20fund\x20'+'cannot\x20cover\x203x\x20that\x20order),\x20so\x20under-ceiling\x20funding\x20stops\x20sales\x20instead\x20of\x20stranding\x20awards.','recommendation':'For\x20every\x20order\x20you\x20want\x20to\x20sell,\x20keep\x20the\x20fund\x20at\x20>=\x20'+MAX_INDEMNITY_MULTIPLE+'x\x20THAT\x20order\x20via\x20'+'compensation_fund_add\x20(a\x200.49\x20course\x20needs\x201.47;\x20a\x203.99\x20course\x20needs\x2011.97\x20—\x20no\x20cross-SKU\x20subsidy).\x20'+('Above\x20'+MAX_INDEMNITY_MULTIPLE+'x\x20the\x20current\x20order\x20is\x20optional:\x20it\x20only\x20buys\x20tolerance\x20for\x20several\x20')+'CONCURRENT\x20claims\x20against\x20the\x20one\x20per-Service\x20pool\x20(there\x20is\x20no\x20on-chain\x20concurrency\x20limit),\x20which\x20'+'is\x20a\x20capital-allocation\x20choice.\x20A\x20service\x20with\x20NO\x20fund\x20sells\x20freely\x20—\x20that\x20is\x20the\x20documented\x20'+'no-protection\x20posture\x20(audit_compensation_fund\x20discloses\x20it;\x20buyers\x20see\x20coverage\x20via\x20order\x20monitor).'},{'id':'audit_description','description':'Service\x20should\x20have\x20a\x20description','severity':'warning','fields':['description'],'check':a=>typeof a?.['description']==='string'&&a['description']['length']>0x0,'message':()=>'Service\x20has\x20no\x20description.\x20Customers\x20won\x27t\x20understand\x20what\x20you\x27re\x20offering.','recommendation':'Write\x20a\x20clear\x20description\x20of\x20the\x20service,\x20including\x20deliverables,\x20timelines,\x20and\x20terms.'},{'id':'audit_named_new_name','description':'Service\x20being\x20created\x20should\x20have\x20a\x20name','severity':'warning','check':a=>serviceNameOf(a)!==undefined,'message':()=>'Creating\x20a\x20service\x20without\x20a\x20name\x20makes\x20it\x20hard\x20to\x20reference\x20and\x20organize.','recommendation':'Set\x20object:{name:\x20...}\x20(or\x20namedNew.name)\x20following\x20the\x20convention:\x20<projectPrefix>_<service>_<purpose>.'},{'id':'audit_customer_required_needs_um','description':'customer_required\x20requires\x20a\x20Contact\x20bound\x20via\x20um\x20(SDK-enforced\x20hard\x20link;\x20mirrored\x20here)','severity':'error','fields':['customer_required','um'],'check':a=>{const b=Array['isArray'](a?.['customer_required'])?a['customer_required']:[];if(b['length']===0x0)return!![];return!!a?.['um'];},'message':()=>'customer_required\x20is\x20set\x20but\x20no\x20Contact\x20is\x20bound\x20via\x20um\x20—\x20customers\x20cannot\x20deliver\x20the\x20required\x20private\x20information\x20through\x20end-to-end\x20encrypted\x20Messenger.','recommendation':'Bind\x20um:{Contact\x20name/id}\x20in\x20the\x20same\x20call\x20(SDK\x20order_new\x20will\x20fail\x20the\x20buyer\x20otherwise).'},{'id':'audit_customer_required_is_declared_not_enforced','description':'customer_required\x20has\x20no\x20on-chain\x20enforcement\x20at\x20buy\x20time\x20—\x20a\x20Guard\x20must\x20gate\x20fulfilment','severity':'warning','fields':['customer_required'],'check':a=>{const b=Array['isArray'](a?.['customer_required'])?a['customer_required']:[];return b['length']===0x0;},'message':a=>{const b=Array['isArray'](a?.['customer_required'])?a['customer_required']:[];return'customer_required\x20('+b['length']+'\x20field(s):\x20'+b['join'](',\x20')+')\x20is\x20DECLARATIVE\x20ONLY:\x20the\x20on-chain\x20purchase\x20entry\x20never\x20reads\x20this\x20list,\x20so\x20an\x20order\x20that\x20supplies\x20none\x20of\x20these\x20fields\x20is\x20still\x20created\x20and\x20progresses.\x20Nothing\x20on-chain\x20will\x20stop\x20it.';},'recommendation':'Bind\x20pattern.required_info_evidence_gate\x20(schema_query\x20action=get_guard_design_patterns)\x20on\x20the\x20first\x20forward\x20that\x20needs\x20the\x20information:\x20query\x20\x27order.required_info\x20some\x27\x20(1572)\x20over\x20the\x20Order.\x20The\x20buyer\x20records\x20the\x20credential\x20via\x20order_required_info_update:\x20EITHER\x20the\x20merchant\x27s\x20IM\x20user\x20address\x20resolved\x20from\x20the\x20Service\x27s\x20Contact\x20(zero\x20cost,\x20address\x20record\x20only)\x20OR\x20an\x20on-chain\x20WTS\x20Proof\x20object\x20address\x20(embeds\x20the\x20merchant\x20IM\x20address\x20and\x20the\x20last-message\x20timestamp;\x20costs\x20gas,\x20publicly\x20verifiable).\x20\x27order.required_info\x27\x20(1573)\x20returns\x20the\x20recorded\x20address\x20but\x20aborts\x20while\x20nothing\x20is\x20recorded\x20—\x20gate\x20on\x201572\x20first.\x20When\x20the\x20listing\x20genuinely\x20promises\x20a\x20PER-ORDER\x20credential,\x20prefer\x20the\x20controlled\x20bind\x20entry\x20(order_required_info_bind):\x20the\x20chain\x20verifies\x20the\x20Proof\x20is\x20about\x20THIS\x20order\x20and\x20owner-created\x20at\x20write\x20time\x20and\x20rejects\x20a\x20mismatch\x20—\x20no\x20guard\x20needed\x20to\x20catch\x20a\x20wrong-proof\x20record.\x20BOUNDARY:\x20that\x20binding\x20proves\x20the\x20credential\x20AUTHOR\x20only,\x20never\x20its\x20content\x20or\x20any\x20rating\x20—\x20do\x20not\x20mirror\x20it\x20onto\x20review/reward\x20claims;\x20public\x20reviews\x20are\x20Repository\x20rows\x20whose\x20values\x20are\x20enforced\x20guard-side\x20via\x20data-value\x20probes,\x20not\x20through\x20Proof\x20objects.'},{'id':'audit_dangling_deps','description':'Service\x20dependencies\x20should\x20be\x20fully\x20created','severity':'error','check':(a,b)=>{if(!a?.['publish'])return!![];if(!b?.['graph'])return!![];const c=b['graph']['findDanglingDependencies']()??[];return c['length']===0x0;},'message':()=>'Service\x20references\x20objects\x20that\x20are\x20not\x20yet\x20created.\x20Publishing\x20will\x20lock\x20these\x20references.','recommendation':'Ensure\x20all\x20referenced\x20objects\x20(machine,\x20allocators,\x20guards)\x20are\x20created\x20and\x20finalized\x20before\x20publishing.'},{'id':'audit_type_parameter','description':'Service\x20should\x20have\x20a\x20token\x20type\x20specified','severity':'info','fields':['type_parameter','namedNew'],'check':a=>typeParameterOf(a)!==undefined,'message':()=>'No\x20payment\x20token\x20type\x20specified.\x20Defaulting\x20to\x20WOW\x20(0x2::wow::WOW).','recommendation':'Explicitly\x20set\x20type_parameter\x20(inside\x20object:{...})\x20if\x20you\x20want\x20to\x20accept\x20non-WOW\x20tokens\x20(e.g.,\x20USDT,\x20ETH).'},{'id':'audit_wip_unreachable_url','description':'sale.wip\x20must\x20be\x20a\x20publicly\x20reachable\x20URL\x20(no\x20localhost/LAN/file\x20paths)','severity':'error','fields':['sales'],'check':(a,b)=>{if(typeof b?.['network']==='string'&&/local/i['test'](b['network']))return!![];const c=salesItemsOf(a);if(c['length']===0x0)return!![];return c['every'](e=>{const f=e?.['wip'];if(typeof f!=='string'||f['trim']()==='')return!![];return!/^(https?:\/\/)?(localhost|127\.0\.0\.1|\[::1\]|0\.0\.0\.0)/i['test'](f)&&!/^https?:\/\/(192\.168\.|10\.|172\.(1[6-9]|2\d|3[01])\.)/i['test'](f)&&!/^file:/i['test'](f);});},'message':a=>{const b=salesItemsOf(a)['map'](c=>String(c?.['wip']??''))['filter'](c=>c!==''&&(/^(https?:\/\/)?(localhost|127\.0\.0\.1|\[::1\]|0\.0\.0\.0)/i['test'](c)||/^https?:\/\/(192\.168\.|10\.|172\.(1[6-9]|2\d|3[01])\.)/i['test'](c)||/^file:/i['test'](c)));return'sale.wip\x20is\x20NOT\x20publicly\x20reachable\x20('+b['join'](',\x20')+').\x20The\x20URL\x20is\x20stored\x20on-chain\x20and\x20every\x20'+'customer\x20fetches\x20it\x20at\x20order\x20time\x20—\x20order_new\x20aborts\x20100%\x20for\x20anyone\x20outside\x20your\x20machine.\x20'+'Host\x20the\x20file\x20publicly:\x20wip_file\x20upload\x20to\x20the\x20official\x20free\x20host\x20(wip.store.wowok.net)\x20or\x20your\x20own\x20'+'endpoint\x20(GitHub\x20Pages\x20/\x20IPFS\x20/\x20your\x20website)';},'recommendation':'Replace\x20the\x20internal\x20URL\x20with\x20a\x20public\x20one.\x20Internal\x20URLs\x20are\x20sanctioned\x20ONLY\x20on\x20env.network=localnet\x20for\x20testing.'},{'id':'audit_wip_missing_public','description':'On\x20public\x20networks\x20every\x20sale\x20item\x20should\x20carry\x20a\x20product-detail\x20(wip)\x20URL','severity':'info','fields':['sales'],'check':(a,b)=>{const c=b?.['network'];if(typeof c==='string'&&/local/i['test'](c))return!![];const e=salesItemsOf(a);if(e['length']===0x0)return!![];return e['every'](f=>typeof f?.['wip']==='string'&&f['wip']['trim']()!=='');},'message':()=>'One\x20or\x20more\x20sale\x20items\x20have\x20NO\x20product-detail\x20(wip)\x20URL.\x20The\x20listing\x20works,\x20but\x20customers\x20see\x20no\x20detail\x20'+'page\x20and\x20the\x20service\x27s\x20market\x20completeness\x20score\x20is\x20downgraded.\x20Easiest:\x20upload\x20the\x20detail\x20file\x20with\x20the\x20'+'wip_file\x20tool\x20to\x20the\x20official\x20free\x20host\x20(https://wip.store.wowok.net\x20—\x2010\x20files\x20per\x20account,\x20180-day\x20'+'retention,\x2012MB/file)\x20and\x20put\x20the\x20returned\x20URL\x20into\x20sale.wip;\x20or\x20host\x20your\x20own\x20(GitHub\x20Pages\x20/\x20IPFS\x20/\x20'+'your\x20website).\x20For\x20long-lived\x20mainnet\x20listings\x20prefer\x20your\x20own\x20endpoint\x20so\x20the\x20detail\x20outlives\x20the\x20free\x20'+'retention\x20window','recommendation':'Upload\x20a\x20WIP\x20file\x20via\x20wip_file\x20and\x20set\x20sale.wip\x20on\x20each\x20item\x20before/after\x20publish\x20(sales\x20stays\x20modifiable).'},{'id':'audit_free_cancel_window_anchor','description':'A\x20free-cancellation\x20window\x20must\x20either\x20ride\x20the\x20stay-date\x20Repository\x20rail\x20or\x20be\x20disclosed\x20as\x20anchored\x20on\x20booking\x20time','severity':'warning','fields':['creation_plan'],'check':(a,b)=>{if(!a?.['publish'])return!![];const c=Array['isArray'](a?.['creation_plan']?.['guards'])?a['creation_plan']['guards']:[],e=c['some'](h=>{const i=typeof h?.['key']==='string'?h['key']:'',j=typeof h?.['purpose']==='string'?h['purpose']:'';return/free[._ ]?cancel/i['test'](i)||/cancell?ation/i['test'](j)&&/window|hours?|days?/i['test'](j);});if(!e)return!![];const f=c['some'](h=>{const i=typeof h?.['template_id']==='string'?h['template_id']:'',j=typeof h?.['purpose']==='string'?h['purpose']:'',k=/repository_data_check/i['test'](i)&&/stay[._ ]?date|use[._ ]?date|check[._ ]?in[._ ]?date|arrival/i['test'](j),l=/anchored on (booking|order\.time)|booking time by default|service_start_ms|absolute (service|departure|event|use) (start|date)/i['test'](j);return k||l;});return f;},'message':()=>'A\x20free-cancellation\x20window\x20is\x20declared\x20WITHOUT\x20a\x20stay-date\x20anchor\x20and\x20WITHOUT\x20a\x20booking-time\x20disclosure.\x20'+'The\x20chain\x20has\x20no\x20use-date\x20primitive\x20(order.time\x20is\x20the\x20BOOKING\x20moment\x20—\x20written\x20once,\x20immutable),\x20so\x20the\x20'+'window\x20enforces\x20as\x20\x27from\x20booking\x27.\x20If\x20your\x20buyer-facing\x20copy\x20promises\x20\x27X\x20hours\x20before\x20arrival/check-in\x27,\x20'+'the\x20promised\x20window\x20has\x20typically\x20ALREADY\x20CLOSED\x20at\x20booking\x20(bkd8\x20BK-02,\x20live\x20mainnet)\x20—\x20a\x20silent\x20policy\x20'+'inversion\x20that\x20mis-sells\x20the\x20listing.\x20TWO\x20WAYS\x20OUT:\x20(1)\x20FAITHFUL\x20WINDOW\x20—\x20ride\x20the\x20STAY-DATE\x20PRESCRIPTION\x20'+'(time_anchors.free_cancel\x20in\x20the\x20travel\x20templates):\x20a\x20batched\x20id_from\x20None(0)\x20\x27stay_date\x27\x20row\x20(u64\x20epoch-ms)\x20'+'written\x20into\x20the\x20order-scoped\x20Repository\x20at\x20buy\x20time,\x20plus\x20a\x20pattern.repository_data_check\x20leg\x20comparing\x20'+'Clock\x20against\x20row\x20+\x20window\x20offset\x20(CLOSING\x20<=);\x20(2)\x20HONEST\x20DEFAULT\x20—\x20keep\x20the\x20booking-time\x20anchor\x20and\x20state\x20'+'\x27free\x20cancellation\x20within\x20X\x20hours\x20of\x20BOOKING\x27\x20in\x20the\x20buyer-facing\x20copy\x20so\x20the\x20promise\x20matches\x20the\x20chain','recommendation':'Either\x20add\x20the\x20stay-date\x20Repository\x20row\x20+\x20repository_data_check\x20leg\x20(faithful\x20pre-use\x20window),\x20or\x20restate\x20the\x20cancellation\x20policy\x20as\x20\x27from\x20booking\x27\x20in\x20all\x20buyer-facing\x20copy.'}];const RULE_INDEX=new Map(AUDIT_RULES['map'](a=>[a['id'],a]));function readSeverityOverrides(){try{const {getJudgmentDoc:a}=require('../config/judgment.js');if(typeof a!=='function')return{};const b=a()?.['rules']?.['domains'];if(!b||typeof b!=='object')return{};const c={};for(const d of Object['values'](b)){const e=d?.['severity_overrides'];if(!e||typeof e!=='object')continue;for(const [f,g]of Object['entries'](e)){if(g==='error'||g==='warning'||g==='info')c[f]=g;}}return c;}catch{return{};}}export function auditService(a,b){const c=[],d=a?.['publish']===!![]&&typeof a?.['object']==='string',e=readSeverityOverrides();for(const f of AUDIT_RULES){try{if(d&&f['fields']&&!f['fields']['some'](g=>a[g]!==undefined))continue;!f['check'](a,b)&&c['push']({'rule_id':f['id'],'severity':e[f['id']]??f['severity'],'message':f['message'](a),'recommendation':f['recommendation']});}catch{}}return c;}export function hasBlockingErrors(a){return a['some'](b=>b['severity']==='error');}export function getErrors(a){return a['filter'](b=>b['severity']==='error');}export function getWarnings(a){return a['filter'](b=>b['severity']==='warning');}export function summarizeFindings(a){if(a['length']===0x0)return'All\x20audit\x20checks\x20passed.';const b=getErrors(a),c=getWarnings(a),d=a['filter'](g=>g['severity']==='info'),e=[];if(b['length']>0x0)e['push'](b['length']+'\x20error(s)');if(c['length']>0x0)e['push'](c['length']+'\x20warning(s)');if(d['length']>0x0)e['push'](d['length']+'\x20info');return'Audit:\x20'+e['join'](',\x20')+'.\x20Review\x20before\x20publishing.';}export const AUDIT_RULES_VERSION=0xb;
|
|
@@ -305,7 +305,7 @@
|
|
|
305
305
|
"when": { "field": "duplicate_guards_present", "op": "eq", "value": true },
|
|
306
306
|
"level": "high",
|
|
307
307
|
"title": "Duplicate Guard addresses in allocators — every duplicate FIRES on the same call",
|
|
308
|
-
"description": "Multiple Allocators reference the same Guard object: ${duplicate_guards_csv_sp}.
|
|
308
|
+
"description": "Multiple Allocators reference the same Guard object: ${duplicate_guards_csv_sp}. the on-chain allocation runs a full loop with no early exit: a distribution call submitting that guard fires EVERY matching allocator, in vector order, each against the balance left by the previous one. This is a legitimate waterfall mechanism ONLY if intended; if the duplicates were meant as alternative paths, they are NOT alternatives — one call triggers all of them, the pool is split repeatedly, and a later allocator may abort on insufficient balance or pay out of money earmarked for another track.",
|
|
309
309
|
"scenario": "Reusing same Guard object across multiple Allocators",
|
|
310
310
|
"mitigation": "Intended waterfall (fee first, then split the remainder): keep the shared guard and verify the vector order matches the intended payout sequence. Intended alternatives (refund vs damage vs settle): give each path its OWN Guard object (they may share root/table but must be distinct objects) so the caller's guard selection picks exactly one path.",
|
|
311
311
|
"evidence": "total=${allocators_total}, unique=${allocators_unique}, dupes=${duplicate_guards_csv}",
|
|
@@ -326,7 +326,7 @@
|
|
|
326
326
|
] },
|
|
327
327
|
"level": "critical",
|
|
328
328
|
"title": "GuardIdentifier recipients with NO for_object anchor — the chain enforces NOTHING",
|
|
329
|
-
"description": "payment_info.for_object is None while allocator(s) pay GuardIdentifier recipients. Verified on-chain: the recipient binding check is gated on the anchor being Some —
|
|
329
|
+
"description": "payment_info.for_object is None while allocator(s) pay GuardIdentifier recipients. Verified on-chain: the recipient binding check is gated on the anchor being Some — the on-chain allocation runs the ERECIPIENT_NOT_FOR_OBJECT (15) assertion only inside `if (option::is_some(&binding))`; with None the passport-submitted address is paid VERBATIM, and the code comment itself (the contract code itself) pushes the due-diligence obligation to the tooling layer. Whoever builds a satisfying passport names the payout address — funds can be redirected with nothing on-chain objecting. The Service order flow always anchors (it sets for_object to the paying order) and the Arbitration fee flow anchors too (the arbitration fee flow does the same), so a None anchor is reachable only through a standalone or custom-constructed PaymentInfo — exactly the surface this rule gates.",
|
|
330
330
|
"scenario": "Allocation created without a for_object anchor while using GuardIdentifier recipients",
|
|
331
331
|
"mitigation": "Set payment_info.for_object to the intended anchor at create (mismatch then aborts with code 15 — mechanism-enforced). If the payout destination must stay passport-chosen by design, do NOT use GuardIdentifier legs: use Entity legs (static, declared at create) or constrain the submitted address inside the guard expression itself. Treat any None+GuardIdentifier config as a fund-redirection hole until one of those is in place.",
|
|
332
332
|
"evidence": "for_object=None",
|
|
@@ -448,7 +448,7 @@
|
|
|
448
448
|
] },
|
|
449
449
|
"level": "high",
|
|
450
450
|
"title": "No fallback Allocator: a FUTURE alloc() with an unmatched guard aborts with E_ALLOCATOR_NOT_MATCHED",
|
|
451
|
-
"description": "Multi-Allocation configuration (${allocators_count} Allocators) where the caller context explicitly reports NO alternative Allocator. An ABSENT caller context does not fire this rule (unknown is not declined — the Amazon P2-11 false-positive class). This finding is about FUTURE trigger calls, not the current call's parameters. alloc() is driven by the caller explicitly specifying an Allocator via alloc_by_guard: if the guard address does not match any allocators[].guard, alloc() aborts with E_ALLOCATOR_NOT_MATCHED
|
|
451
|
+
"description": "Multi-Allocation configuration (${allocators_count} Allocators) where the caller context explicitly reports NO alternative Allocator. An ABSENT caller context does not fire this rule (unknown is not declined — the Amazon P2-11 false-positive class). This finding is about FUTURE trigger calls, not the current call's parameters. alloc() is driven by the caller explicitly specifying an Allocator via alloc_by_guard: if the guard address does not match any allocators[].guard, alloc() aborts with E_ALLOCATOR_NOT_MATCHED on the on-chain allocation — the transaction reverts and funds remain in the order escrow, not stuck in Allocation.balance. Linked to guard-risk.ts R-X1-05.",
|
|
452
452
|
"scenario": "Caller passes a guard address not present in allocators[] (e.g. wrong Guard object, or order state not matching any terminal node)",
|
|
453
453
|
"mitigation": "1) The caller should verify alloc_by_guard ∈ allocators[].guard address set before calling alloc(). 2) Provide an alternative Allocator and document the caller's retry strategy. 3) Catch the abort and surface the mismatch to the operator.",
|
|
454
454
|
"evidence": "allocators=${allocators_count}, hasFallback=${has_fallback_allocator_display}",
|
|
@@ -547,9 +547,9 @@
|
|
|
547
547
|
"when": { "field": "entity_recipient_bad_count", "op": "gte", "value": 1 },
|
|
548
548
|
"level": "critical",
|
|
549
549
|
"title": "${entity_recipient_bad_count_display} sharing row(s) pay an unnamed Entity — the share goes to the DEPLOYING ACCOUNT: ${entity_recipient_bad_rows_csv_sp}",
|
|
550
|
-
"description": "Offending sharing row(s): ${entity_recipient_bad_rows_csv_sp}. A recipient row reading { who: { Entity: { name_or_address: \"\" } } } (or with the key omitted entirely) is NOT a no-op: the SDK resolver substitutes the DEFAULT LOCAL ACCOUNT before the address ever reaches Move, so the order escrow pays the account that ran the deploy instead of any intended third party. There is no on-chain defence at all:
|
|
550
|
+
"description": "Offending sharing row(s): ${entity_recipient_bad_rows_csv_sp}. A recipient row reading { who: { Entity: { name_or_address: \"\" } } } (or with the key omitted entirely) is NOT a no-op: the SDK resolver substitutes the DEFAULT LOCAL ACCOUNT before the address ever reaches Move, so the order escrow pays the account that ran the deploy instead of any intended third party. There is no on-chain defence at all: the on-chain allocation swallows Recipient::Entity in a catch-all at declaration, and forwards the raw address to the payment constructor at payout, so the chain accepts ANY Entity address and a degenerate one silently burns the share permanently. DIRECT-SALES INVARIANT (verbatim, shared with the tool-constraint layer and the pre-call gate): WoWok is DIRECT SALES: the merchant pays gas only and there is NO platform commission, so no allocator sharing row may pay the deploying account. An omitted / empty / unresolved Entity recipient is NOT a no-op — the SDK resolves it to the DEFAULT LOCAL ACCOUNT ADDRESS via its local-account resolution, so the share silently leaves the escrow to whoever ran the deploy. AUDIT INVARIANT: any allocator sharing item resolving to the platform/builder entity with a non-zero share is an ERROR under direct-sales. Under direct sales there is no platform to pay, so an unnamed Entity row is never legitimate.",
|
|
551
551
|
"scenario": "A sharing row is authored with a blank, omitted, zero, or builder-equivalent Entity recipient — typically a placeholder the author intended to fill in, or a 'platform' leg copied from an incumbent marketplace split that this protocol has no recipient for.",
|
|
552
|
-
"mitigation": "WoWok is DIRECT SALES: the merchant pays gas only and there is NO platform commission, so no allocator sharing row may pay the deploying account. An omitted / empty / unresolved Entity recipient is NOT a no-op — the SDK resolves it to the DEFAULT LOCAL ACCOUNT
|
|
552
|
+
"mitigation": "WoWok is DIRECT SALES: the merchant pays gas only and there is NO platform commission, so no allocator sharing row may pay the deploying account. An omitted / empty / unresolved Entity recipient is NOT a no-op — the SDK resolves it to the DEFAULT LOCAL ACCOUNT ADDRESS via its local-account resolution, so the share silently leaves the escrow to whoever ran the deploy. AUDIT INVARIANT: any allocator sharing item resolving to the platform/builder entity with a non-zero share is an ERROR under direct-sales. How to fix the allocator table: (a) the merchant keeps the WHOLE sale — ONE sharing row { who: { GuardIdentifier: 0 }, sharing: 10000, mode: \"Rate\" }, the refund track anchored via payment_info.for_object so only the order owner can receive it; (b) a GENUINE third party must be an EXPLICIT, non-empty Entity the buyer can see BEFORE ordering — { who: { Entity: { name_or_address: \"<mark_name_or_0x_address>\" } } }; (c) NEVER use { Signer: \"signer\" } for a refund — it pays tx_context::sender, i.e. whoever runs the alloc() call; (d) order_allocators is PERMANENTLY IMMUTABLE after publish (no pause+lock escape), so fix the recipient table BEFORE publish, not after.",
|
|
553
553
|
"evidence": "badRows=${entity_recipient_bad_rows_csv}, count=${entity_recipient_bad_count_display}",
|
|
554
554
|
"stakeholders": ["owner", "recipient", "service_provider"],
|
|
555
555
|
"exposure": {
|
|
@@ -558,7 +558,7 @@
|
|
|
558
558
|
{ "role": "merchant", "basis": "A third-party share (supplier, orchestrator, arbitrator fee) credited to the deploying account inflates the merchant's own take while the genuine recipient is unpaid — the ledger a buyer reads before ordering no longer matches where the money lands." }
|
|
559
559
|
],
|
|
560
560
|
"gain_paths": [
|
|
561
|
-
{ "role": "collaborator", "path": "Whoever holds the DEFAULT LOCAL ACCOUNT at deploy time (the deploying account) receives the unnamed share verbatim, because the SDK resolves the blank Entity to that account and the chain records it as a plain Recipient::Entity payout.", "viability": "viable", "gate": "Direct-pay and unconditional: nothing in Move distinguishes a substituted recipient from an authored one.
|
|
561
|
+
{ "role": "collaborator", "path": "Whoever holds the DEFAULT LOCAL ACCOUNT at deploy time (the deploying account) receives the unnamed share verbatim, because the SDK resolves the blank Entity to that account and the chain records it as a plain Recipient::Entity payout.", "viability": "viable", "gate": "Direct-pay and unconditional: nothing in Move distinguishes a substituted recipient from an authored one. the on-chain allocation matches only Recipient::GuardIdentifier and lets Recipient::Entity fall through a (_) catch-all, and it forwards the raw address to the payment constructor with no check at all — so there is no chain-side assertion left to fire." }
|
|
562
562
|
]
|
|
563
563
|
}
|
|
564
564
|
}
|
|
@@ -162,9 +162,9 @@
|
|
|
162
162
|
"when": { "field": "escrow_released_before_case", "op": "eq", "value": true },
|
|
163
163
|
"level": "high",
|
|
164
164
|
"title": "Refund-then-claim ordering — the principal may recover twice",
|
|
165
|
-
"description": "The order's escrow was already released BEFORE this case was filed (deficit ${escrow_deficit_display}). Neither ordering is closed on-chain (
|
|
165
|
+
"description": "The order's escrow was already released BEFORE this case was filed (deficit ${escrow_deficit_display}). Neither ordering is closed on-chain (the on-chain order deliberately ships no receive-gate): after this claim settles the refund allocator can still split the remaining escrow unless its Guard is gated on order.claimed_by some==false. The discriminating evidence is fully on-chain: (1) refund/alloc event timestamps vs the case creation time — the decisive ordering signal; (2) escrow balance vs order amount (the deficit); (3) the order's progress path (visited refund terminals); (4) the owner receive history.",
|
|
166
166
|
"scenario": "Buyer collects a refund via the refund track, then files a dispute and claims the indemnity on top",
|
|
167
|
-
"mitigation": "At ruling time, net the indemnity against the
|
|
167
|
+
"mitigation": "At ruling time the netting is polarity-bound (rex5 B-66): payouts released TO THE ORDER (buyer-side refund rail, per Payment record recipients) → net the indemnity against the refunded principal, compensate the delta; payouts released to NON-order recipients (merchant/Entity settlement or recover) → the buyer's loss is the FULL price and the indemnity must NOT be reduced. A positive deficit alone proves only that money left the escrow, never who received it. The defendant attaches the escrow forensics (with per-payout polarity) to the case statement.",
|
|
168
168
|
"evidence": "escrow_released_before_case=true (deficit=${escrow_deficit_display})",
|
|
169
169
|
"stakeholders": ["principal", "arbitrator", "voter"]
|
|
170
170
|
}
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"const_addr_list": "KERNEL — constant Address table entries (b_submission=false, value set) rendered as '#id=value', comma joined.",
|
|
27
27
|
"const_addr_count": "KERNEL — number of constant Address table entries (b_submission=false, value set).",
|
|
28
28
|
"sys_addr_list": "KERNEL — system-address table entries (0xaab/0xaaa) rendered as '#id=value(name)', comma joined.",
|
|
29
|
-
"sys_addr_wrong": "KERNEL — a system-address entry's name annotation
|
|
29
|
+
"sys_addr_wrong": "KERNEL — a system-address entry's name annotation names a DIFFERENT system object (0xaab annotated as linker/permission/contact/messenger, or 0xaaa annotated as entity/permission/contact/messenger). Note: 0xaab is the Move-level Entity object (SDK constant ENTITY_REGISTRAR_ADDRESS — legacy alias) and 0xaaa is the Registrar object (SDK constant ENTITY_LINKER_ADDRESS — legacy alias); alias-vs-Move-name divergence is documented, not flagged (rex5 T-06).",
|
|
30
30
|
"witness_multihop_codes": "KERNEL — multi-hop witness codes (106/107/108) present in the root.",
|
|
31
31
|
"witness_multihop_csv": "KERNEL — witness_multihop_codes comma-space joined.",
|
|
32
32
|
"witness_multihop_names_block": "KERNEL — one ' - <code>: <chain name>' line per multi-hop witness code, newline joined.",
|
|
@@ -238,25 +238,25 @@
|
|
|
238
238
|
{
|
|
239
239
|
"rule_id": "R-C1-02",
|
|
240
240
|
"dimension": "data_source_trust",
|
|
241
|
-
"trigger": "Guard table contains
|
|
241
|
+
"trigger": "Guard table contains Entity-object(0xaab) or Registrar(0xaaa) system address constants",
|
|
242
242
|
"cases": [
|
|
243
243
|
{
|
|
244
244
|
"when": { "all": [{ "field": "sys_addr_list", "op": "present" }, { "field": "sys_addr_wrong", "op": "eq", "value": true }] },
|
|
245
245
|
"level": "medium",
|
|
246
|
-
"title": "
|
|
247
|
-
"description": "
|
|
248
|
-
"scenario": "System address misuse:
|
|
249
|
-
"mitigation": "1)
|
|
246
|
+
"title": "System address name annotation suspected to be wrong",
|
|
247
|
+
"description": "Chain truth: 0xaab is the Entity object (WOW_ENTITY_OBJECT_ID — where per-address entity registration records live) and 0xaaa is the Registrar object (WOW_REGISTRAR_OBJECT_ID). The SDK exported constants use legacy aliases (ENTITY_REGISTRAR_ADDRESS=0xaab, ENTITY_LINKER_ADDRESS=0xaaa). The detected annotation names a DIFFERENT system object (e.g. 0xaab annotated as linker), which may cause the Guard to query the wrong object.",
|
|
248
|
+
"scenario": "System address misuse: an annotation naming another system object causes query-target confusion",
|
|
249
|
+
"mitigation": "1) 0xaab is the Entity object (registration records; SDK alias 'EntityRegistrar');2) 0xaaa is the Registrar object (SDK alias 'EntityLinker');3) The table entry name should indicate the intended system object purpose",
|
|
250
250
|
"evidence": "System address entries: ${sys_addr_list}",
|
|
251
251
|
"stakeholders": ["provider"]
|
|
252
252
|
},
|
|
253
253
|
{
|
|
254
254
|
"when": { "all": [{ "field": "sys_addr_list", "op": "present" }, { "field": "sys_addr_wrong", "op": "eq", "value": false }] },
|
|
255
255
|
"level": "low",
|
|
256
|
-
"title": "Guard uses
|
|
257
|
-
"description": "
|
|
258
|
-
"scenario": "System address
|
|
259
|
-
"mitigation": "1)
|
|
256
|
+
"title": "Guard uses Entity-object/Registrar system address constants",
|
|
257
|
+
"description": "Chain truth: 0xaab is the Entity object (WOW_ENTITY_OBJECT_ID) and 0xaaa is the Registrar object (WOW_REGISTRAR_OBJECT_ID); SDK constants use legacy aliases (ENTITY_REGISTRAR_ADDRESS=0xaab, ENTITY_LINKER_ADDRESS=0xaaa). Address usage looks consistent; keep the name annotation clear to avoid later maintenance confusion.",
|
|
258
|
+
"scenario": "System address usage: alias-vs-Move-name divergence documented for maintainers",
|
|
259
|
+
"mitigation": "1) 0xaab is the Entity object (registration records; SDK alias 'EntityRegistrar');2) 0xaaa is the Registrar object (SDK alias 'EntityLinker');3) The table entry name should indicate the intended system object purpose",
|
|
260
260
|
"evidence": "System address entries: ${sys_addr_list}",
|
|
261
261
|
"stakeholders": ["provider"]
|
|
262
262
|
}
|
|
@@ -793,7 +793,7 @@
|
|
|
793
793
|
"when": { "field": "scene_binding_field", "op": "eq", "value": "order_allocators" },
|
|
794
794
|
"level": "medium",
|
|
795
795
|
"title": "order_allocators multi-guard paths may cause unfair allocation",
|
|
796
|
-
"description": "A distribution call submits ONE guard; every allocator bound to that guard fires in vector order against the shrinking pool (allocation
|
|
796
|
+
"description": "A distribution call submits ONE guard; every allocator bound to that guard fires in vector order against the shrinking pool (the on-chain allocation). If a single guard binds multiple allocators with overlapping conditions, the pool is split repeatedly and later allocators may receive less than intended or abort on insufficient balance. For alternative business paths (settle vs refund), use DIFFERENT guards so the caller's guard choice selects exactly one path.",
|
|
797
797
|
"scenario": "Allocation path overlap: multiple allocators bound to the same guard all fire, draining the pool in unexpected order",
|
|
798
798
|
"mitigation": "1) Bind each business path (settle/refund/damage) to its OWN Guard object; 2) Make guard conditions mutually exclusive via guard logic, not list order; 3) When a waterfall IS intended (fee first, then split remainder), keep the shared guard and verify the vector order matches the intended payout sequence",
|
|
799
799
|
"stakeholders": ["provider"]
|
|
@@ -236,7 +236,7 @@
|
|
|
236
236
|
"when": { "field": "operation", "op": "eq", "value": "arb_claim_compensation" },
|
|
237
237
|
"level": "high",
|
|
238
238
|
"title": "arb_claim_compensation is IRREVERSIBLE (claimed_by one-time set)",
|
|
239
|
-
"description": "Setting claimed_by is permanent. After this call: (1) claimed_by cannot be reset, (2) NO new disputes can be filed (E_ORDER_ALREADY_CLAIMED), (3) all unresolved disputes become unactionable, (4) NO on-chain seal follows — the owner receive entries are deliberately ungated (order
|
|
239
|
+
"description": "Setting claimed_by is permanent. After this call: (1) claimed_by cannot be reset, (2) NO new disputes can be filed (E_ORDER_ALREADY_CLAIMED), (3) all unresolved disputes become unactionable, (4) NO on-chain seal follows — the owner receive entries are deliberately ungated (the on-chain order), so escrow still on the order remains claimable; enforce any refund-vs-claim exclusion by gating the refund allocator on order.claimed_by some==false. If first compensation is insufficient, buyer has no recourse.",
|
|
240
240
|
"scenario": "Buyer claims partial compensation, then discovers additional damages",
|
|
241
241
|
"mitigation": "BEFORE claiming: (1) enumerate ALL disputes, (2) ensure proposition covers all damages, (3) confirm Arb ruling is final. Add explicit user confirmation (C-O-08).",
|
|
242
242
|
"evidence": "operation=arb_claim_compensation, current_claimed_by=${claimed_by_display}",
|
|
@@ -121,7 +121,7 @@
|
|
|
121
121
|
{
|
|
122
122
|
"rule_id": "FUND-ZERO-01",
|
|
123
123
|
"dimension": "fund_flow",
|
|
124
|
-
"trigger": "The machine routes a post-settlement arbitration re-route (an arbitration-promise guard — arb.indemnity / arb.order / arb.status / order.dispute — on an edge leaving a settled/refund-class node) while the compensation pool is never funded. service::compensation_claim pays the ruling from
|
|
124
|
+
"trigger": "The machine routes a post-settlement arbitration re-route (an arbitration-promise guard — arb.indemnity / arb.order / arb.status / order.dispute — on an edge leaving a settled/refund-class node) while the compensation pool is never funded. service::compensation_claim pays the ruling from the service compensation fund and an underfunded pool aborts the payout with code 27 (E_COMPENSATION_NOT_MATCH, claim left unconsumed); the escrow behind a settled/refunded node is structurally drained, so with a zero or absent fund the promised exit is dead by construction (gf26-tn-261026 GF2-02: a 0-fund shop published and the buyer's only remedy had no money behind it).",
|
|
125
125
|
"cases": [
|
|
126
126
|
{
|
|
127
127
|
"when": { "all": [ { "field": "fund_arb_route_unfunded", "op": "truthy" }, { "field": "fund_topup_present", "op": "falsy" } ] },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export const SEMANTIC_FACTS=[{'fact_id':'FACT-ALLOC-01','subject':'Allocator\x20guard-matching\x20and\x20firing\x20semantics','authoritative':'A\x20distribution\x20call\x20submits\x20ONE\x20guard\x20address;\x20every\x20allocator\x20whose\x20bound\x20guard\x20equals\x20the\x20submitted\x20address\x20fires,\x20in\x20vector\x20order,\x20each\x20against\x20the\x20balance\x20left\x20by\x20the\x20previous\x20(allocation.move:366-368\x20—\x20the\x20loop\x20has\x20no\x20early\x20exit).\x20'+'ORDER\x20IS\x20PRIORITY\x20(SV-3,\x20az3-mn-261013):\x20within\x20one\x20guard,\x20multiple\x20FIX/RATE\x20entries\x20consume\x20the\x20pool\x20strictly\x20in\x20their\x20declared\x20row\x20order\x20(allocation.move:422-427)\x20—\x20a\x20row\x20that\x20under-rates\x20leaves\x20too\x20little\x20for\x20later\x20rows,\x20and\x20a\x20later\x20row\x20that\x20cannot\x20be\x20fully\x20filled\x20aborts\x20the\x20distribution\x20(EZERO,\x2014).\x20Author\x20multi-row\x20splits\x20POOL-DESCENDING\x20(largest\x20claimant\x20first)\x20and\x20verify\x20Σ(fix/rate\x20values)\x20<=\x20the\x20pool\x20the\x20guard\x20can\x20see\x20at\x20fire\x20time.\x20'+'Allocators\x20with\x20DIFFERENT\x20guards\x20are\x20alternative\x20paths\x20selected\x20by\x20the\x20caller\x27s\x20guard\x20choice,\x20not\x20by\x20list\x20position.\x20Mutual\x20exclusion\x20must\x20be\x20expressed\x20inside\x20the\x20guard\x20conditions.','falsehoods':['first-match-wins','first\x20Allocator\x20whose\x20Guard\x20returns\x20true','first\x20allocator\x20whose\x20guard\x20passes\x20wins','the\x20first\x20Allocator\x20whose\x20Guard\x20returns\x20true\x20wins','first-match\x20allocator\x20semantics','only\x20the\x20first\x20one','only\x20the\x20first\x20one\x20matches','duplicate\x20addresses\x20only\x20match\x20the\x20first','the\x20first\x20one\x20wins','the\x20first\x20allocator\x20whose\x20guard'],'harm':'Templates\x20built\x20on\x20\x27first-match\x27\x20semantics\x20silently\x20stack\x20distributions\x20or\x20leave\x20refund\x20paths\x20unreachable,\x20because\x20the\x20contract\x20fires\x20ALL\x20allocators\x20bound\x20to\x20the\x20submitted\x20guard.'},{'fact_id':'FACT-ALLOC-02','subject':'Surplus\x20semantics\x20—\x20drains\x20the\x20entire\x20remaining\x20pool','authoritative':'Surplus\x20mode\x20distributes\x20the\x20ENTIRE\x20remaining\x20balance\x20of\x20the\x20order\x27s\x20allocation\x20pool,\x20not\x20just\x20the\x20amount\x20earmarked\x20for\x20a\x20specific\x20track.\x20If\x20a\x20refund-path\x20allocator\x20uses\x20Surplus\x20while\x20the\x20settlement\x20path\x20has\x20unpaid\x20fixed-amount\x20legs,\x20the\x20Surplus\x20takes\x20everything,\x20including\x20the\x20settlement\x20money.','falsehoods':['Surplus\x20takes\x20only\x20what\x20is\x20left','Surplus\x20returns\x20the\x20remainder\x20after\x20other\x20tracks','Surplus\x20is\x20safe\x20because\x20it\x20only\x20takes\x20leftovers'],'harm':'A\x20refund/deposit\x20allocator\x20using\x20Surplus\x20will\x20over-refund\x20the\x20buyer\x20and\x20starve\x20the\x20merchant\x20when\x20the\x20settlement\x20track\x20has\x20not\x20yet\x20fired\x20(ziroom\x20T5:\x20585/525\x20WOW\x20fully\x20refunded,\x20merchant\x20received\x200).'},{'fact_id':'FACT-ALLOC-03','subject':'Allocator\x20fix\x20semantics\x20—\x20computed\x20Amount-leg\x20total,\x20PAID,\x20never\x20a\x20holdback','authoritative':'fix\x20is\x20not\x20a\x20settable\x20parameter:\x20the\x20allocator-registration\x20call\x20computes\x20it\x20internally\x20as\x20the\x20sum\x20of\x20the\x20allocator\x27s\x20Amount-mode\x20legs\x20(allocation.move:399\x20fix:\x20total_amount),\x20and\x20alloc()\x20PAYS\x20every\x20Amount\x20leg\x20(allocation.move:540\x20balance::split)\x20while\x20subtracting\x20fix\x20only\x20from\x20the\x20net-Rate\x20base\x20(allocation.move:485\x20total_rates\x20=\x20balance\x20-\x20fix).\x20A\x20pure-Rate\x20allocator\x20therefore\x20has\x20fix=0\x20and\x20drains\x20100%\x20of\x20the\x20pool;\x20adding\x20Amount\x20legs\x20raises\x20outflow,\x20it\x20never\x20withholds.\x20The\x20allocator-registration\x20call\x20surface\x20takes\x20only\x20(guard,\x20sharing,\x20max)\x20—\x20no\x20fix\x20argument\x20at\x20all\x20—\x20so\x20a\x20template-side\x20fix\x20value\x20is\x20silently\x20dropped\x20before\x20the\x20transaction\x20is\x20built.\x20The\x20chain\x20has\x20NO\x20holdback/reserve\x20primitive;\x20the\x20only\x20way\x20to\x20leave\x20funds\x20in\x20a\x20pool\x20is\x20to\x20not\x20distribute\x20them\x20(no\x20allocator\x20fires,\x20or\x20a\x20max-capped\x20Surplus\x20stops\x20at\x20the\x20cap).','falsehoods':['the\x20reserve\x20never\x20leaves','reserve\x20never\x20leaves\x20the\x20pool','the\x20reserve\x20stays\x20in\x20the\x20pool','reserve\x20physically\x20stays\x20in\x20the\x20pool','the\x20fix\x20retains\x20the\x20reserve','fix-retained\x20claim\x20reserve','leaves\x20the\x20reserve\x20in\x20the\x20pool','fix=reserve','only\x20on-chain\x20holdback'],'harm':'Templates\x20that\x20declare\x20fix=reserve\x20ship\x20a\x20payout\x20rail\x20that\x20drains\x20100%\x20of\x20the\x20escrow\x20at\x20the\x20first\x20release;\x20the\x20claim/refund\x20legs\x20behind\x20it\x20are\x20dead\x20by\x20construction\x20and\x20the\x20money\x20is\x20gone\x20(airbnb\x20mainnet\x20audit\x202026-10-07:\x20ABNB_STAY_SERVICE\x20allocators[0]\x20fix=\x220\x22,\x20full\x20drain\x20at\x20payout_24h).'},{'fact_id':'FACT-GUARD-01','subject':'GuardIdentifier\x20recipient\x20+\x20for_object\x20binding','authoritative':'ERECIPIENT_NOT_FOR_OBJECT\x20is\x20enforced\x20ONLY\x20when\x20the\x20recipient\x20kind\x20is\x20GuardIdentifier\x20AND\x20payment_info.for_object\x20is\x20Some(binding).\x20Pure\x20Entity\x20recipients\x20and\x20unbound\x20GuardIdentifier\x20legs\x20skip\x20this\x20check\x20entirely\x20—\x20the\x20tooling\x20layer\x20(scanner,\x20template\x20compiler)\x20must\x20flag\x20them\x20(allocation.move:434-443).','falsehoods':['the\x20contract\x20checks\x20all\x20recipients\x20against\x20for_object','GuardIdentifier\x20recipients\x20are\x20always\x20safe','the\x20contract\x20validates\x20every\x20recipient\x20binding'],'harm':'An\x20unbound\x20GuardIdentifier\x20or\x20pure\x20Entity\x20recipient\x20can\x20redirect\x20funds\x20to\x20the\x20deploying\x20account\x20or\x20an\x20arbitrary\x20address\x20without\x20any\x20on-chain\x20error.'},{'fact_id':'FACT-MACHINE-01','subject':'Machine\x20edge\x20\x27from\x27\x20semantics','authoritative':'A\x20machine\x20edge\x20declares\x20a\x20single\x20source\x20node\x20in\x20its\x20\x27from\x27\x20field.\x20Multiple\x20edges\x20from\x20the\x20same\x20source\x20node\x20are\x20allowed\x20and\x20represent\x20alternative\x20paths;\x20they\x20are\x20NOT\x20merged.\x20An\x20edge\x20without\x20\x27from\x27\x20is\x20invalid\x20in\x20the\x20new\x20topology\x20format\x20and\x20causes\x20compile-time\x20blockers.','falsehoods':['edges\x20without\x20from\x20are\x20auto-derived','missing\x20from\x20means\x20any\x20node','from\x20is\x20optional\x20for\x20backward\x20compatibility'],'harm':'Old\x20flat\x20machine_shape\x20without\x20from\x20fields\x20compiles\x20into\x20an\x20incomplete\x20topology,\x20leaving\x20nodes\x20unreachable\x20and\x20fund\x20paths\x20missing.'},{'fact_id':'FACT-ENTITY-01','subject':'Entity\x20recipient\x20fallback\x20to\x20deployer','authoritative':'When\x20an\x20Entity\x20recipient\x27s\x20name_or_address\x20is\x20empty,\x20omitted,\x20or\x20resolves\x20to\x20the\x20deploying\x20account,\x20the\x20share\x20is\x20paid\x20to\x20the\x20DEPLOYING\x20ACCOUNT\x20(allocation.move:434-443).\x20This\x20is\x20a\x20silent\x20fallback\x20—\x20no\x20error\x20is\x20raised.','falsehoods':['empty\x20Entity\x20names\x20are\x20rejected','the\x20contract\x20validates\x20Entity\x20recipients','an\x20unnamed\x20Entity\x20recipient\x20causes\x20an\x20abort'],'harm':'A\x20template\x20with\x20a\x20placeholder\x20Entity\x20recipient\x20silently\x20pays\x20the\x20share\x20to\x20whoever\x20deploys\x20the\x20service,\x20which\x20is\x20almost\x20never\x20the\x20intended\x20recipient.'},{'fact_id':'FACT-REWARD-01','subject':'Reward\x20replay\x20scope\x20(SV-2)\x20—\x20entry-stamped\x20+\x20order-scoped\x20where\x20is\x20the\x20primary\x20once-per-buyer-per-order\x20form','authoritative':'SV-2\x20(azx7-mn-261014\x20live\x20T8):\x20on\x20a\x20guard\x20whose\x20reward\x20claim\x20entry\x20carries\x20the\x20store_from_id\x20stamp,\x20the\x20ORDER-SCOPED\x20record\x20query\x20(where:{storeFromId:{identifier:0}})\x20is\x20live\x20—\x20once\x20per\x20buyer\x20per\x20order\x20(the\x20native\x20claim\x20key\x20is\x20recipient+guard+stamp).\x20Entry-stamped\x20+\x20empty\x20where\x20is\x20the\x20DELIBERATE\x20once-per-buyer-for-life\x20variant;\x20an\x20unstamped\x20entry\x20never\x20keys\x20its\x20claim\x20records,\x20which\x20is\x20the\x20only\x20context\x20where\x20the\x20old\x20\x27storeFromId\x20filter\x20no-ops\x27\x20verdict\x20ever\x20held.\x20knowledge/protocol-facts.ts\x20(SV2_REPLAY_GATE_CLAUSE)\x20is\x20the\x20single-source\x20teaching\x20text;\x20the\x20compile\x20REVIEW_REWARD_UNARMED\x20blocker\x20interpolates\x20its\x20prescription\x20from\x20there.','falsehoods':['the\x20EMPTY\x20where\x20is\x20MANDATORY','NEVER\x20the\x20storeFromId\x20query\x20filter','storeFromId-filtered\x20record\x20query\x20is\x20a\x20SILENT\x20NO-OP','empty-where\x20exists_where\x20gate\x20is\x20the\x20only\x20working\x20idiom','filter\x20is\x20a\x20silent\x20no-op\x20on\x20the\x20current\x20runtime','NEVER\x20bind\x20storeFromId,\x20that\x20filter\x20silently\x20evaluates'],'harm':'The\x20retracted\x20ofn-mn-261012\x20F-01\x20reading\x20(run-75747\x20F-31)\x20shipped\x20pools\x20gated\x20recipient-only-for-life\x20—\x20silently\x20killing\x20the\x20buyer\x27s\x20second\x20order\x20(upw-mn-261014\x20F-48)\x20—\x20while\x20the\x20auditor\x20that\x20should\x20have\x20caught\x20it\x20carried\x20the\x20same\x20stale\x20verdict.'}];export function scanContent(a,b){const c=[],d=b['toLowerCase']();for(const e of SEMANTIC_FACTS){for(const f of e['falsehoods']){const g=f['toLowerCase']();let h=0x0;while((h=d['indexOf'](g,h))!==-0x1){const i=d['slice'](Math['max'](0x0,h-0xc),h),j=/(?:^|[\s"'])not\s+$/['test'](i)||/never\s+$/['test'](i);!j&&c['push']({'fact_id':e['fact_id'],'phrasing':f}),h+=g['length'];}}}return c;}
|
|
1
|
+
export const SEMANTIC_FACTS=[{'fact_id':'FACT-ALLOC-01','subject':'Allocator\x20guard-matching\x20and\x20firing\x20semantics','authoritative':'A\x20distribution\x20call\x20submits\x20ONE\x20guard\x20address;\x20every\x20allocator\x20whose\x20bound\x20guard\x20equals\x20the\x20submitted\x20address\x20fires,\x20in\x20vector\x20order,\x20each\x20against\x20the\x20balance\x20left\x20by\x20the\x20previous\x20(the\x20distribution\x20loop\x20has\x20no\x20early\x20exit).\x20'+'ORDER\x20IS\x20PRIORITY\x20(SV-3,\x20az3-mn-261013):\x20within\x20one\x20guard,\x20multiple\x20FIX/RATE\x20entries\x20consume\x20the\x20pool\x20strictly\x20in\x20their\x20declared\x20row\x20order\x20(the\x20on-chain\x20per-guard\x20row\x20order)\x20—\x20a\x20row\x20that\x20under-rates\x20leaves\x20too\x20little\x20for\x20later\x20rows,\x20and\x20a\x20later\x20row\x20that\x20cannot\x20be\x20fully\x20filled\x20aborts\x20the\x20distribution\x20(EZERO,\x2014).\x20Author\x20multi-row\x20splits\x20POOL-DESCENDING\x20(largest\x20claimant\x20first)\x20and\x20verify\x20Σ(fix/rate\x20values)\x20<=\x20the\x20pool\x20the\x20guard\x20can\x20see\x20at\x20fire\x20time.\x20'+'Allocators\x20with\x20DIFFERENT\x20guards\x20are\x20alternative\x20paths\x20selected\x20by\x20the\x20caller\x27s\x20guard\x20choice,\x20not\x20by\x20list\x20position.\x20Mutual\x20exclusion\x20must\x20be\x20expressed\x20inside\x20the\x20guard\x20conditions.','falsehoods':['first-match-wins','first\x20Allocator\x20whose\x20Guard\x20returns\x20true','first\x20allocator\x20whose\x20guard\x20passes\x20wins','the\x20first\x20Allocator\x20whose\x20Guard\x20returns\x20true\x20wins','first-match\x20allocator\x20semantics','only\x20the\x20first\x20one','only\x20the\x20first\x20one\x20matches','duplicate\x20addresses\x20only\x20match\x20the\x20first','the\x20first\x20one\x20wins','the\x20first\x20allocator\x20whose\x20guard'],'harm':'Templates\x20built\x20on\x20\x27first-match\x27\x20semantics\x20silently\x20stack\x20distributions\x20or\x20leave\x20refund\x20paths\x20unreachable,\x20because\x20the\x20contract\x20fires\x20ALL\x20allocators\x20bound\x20to\x20the\x20submitted\x20guard.'},{'fact_id':'FACT-ALLOC-02','subject':'Surplus\x20semantics\x20—\x20drains\x20the\x20entire\x20remaining\x20pool','authoritative':'Surplus\x20mode\x20distributes\x20the\x20ENTIRE\x20remaining\x20balance\x20of\x20the\x20order\x27s\x20allocation\x20pool,\x20not\x20just\x20the\x20amount\x20earmarked\x20for\x20a\x20specific\x20track.\x20If\x20a\x20refund-path\x20allocator\x20uses\x20Surplus\x20while\x20the\x20settlement\x20path\x20has\x20unpaid\x20fixed-amount\x20legs,\x20the\x20Surplus\x20takes\x20everything,\x20including\x20the\x20settlement\x20money.','falsehoods':['Surplus\x20takes\x20only\x20what\x20is\x20left','Surplus\x20returns\x20the\x20remainder\x20after\x20other\x20tracks','Surplus\x20is\x20safe\x20because\x20it\x20only\x20takes\x20leftovers'],'harm':'A\x20refund/deposit\x20allocator\x20using\x20Surplus\x20will\x20over-refund\x20the\x20buyer\x20and\x20starve\x20the\x20merchant\x20when\x20the\x20settlement\x20track\x20has\x20not\x20yet\x20fired\x20(ziroom\x20T5:\x20585/525\x20WOW\x20fully\x20refunded,\x20merchant\x20received\x200).'},{'fact_id':'FACT-ALLOC-03','subject':'Allocator\x20fix\x20semantics\x20—\x20computed\x20Amount-leg\x20total,\x20PAID,\x20never\x20a\x20holdback','authoritative':'fix\x20is\x20not\x20a\x20settable\x20parameter:\x20the\x20allocator-registration\x20call\x20computes\x20it\x20internally\x20as\x20the\x20sum\x20of\x20the\x20allocator\x27s\x20Amount-mode\x20legs\x20(the\x20registration\x20call\x20sets\x20fix:\x20total_amount),\x20and\x20alloc()\x20PAYS\x20every\x20Amount\x20leg\x20while\x20subtracting\x20fix\x20only\x20from\x20the\x20net-Rate\x20base\x20(total_rates\x20=\x20balance\x20-\x20fix).\x20A\x20pure-Rate\x20allocator\x20therefore\x20has\x20fix=0\x20and\x20drains\x20100%\x20of\x20the\x20pool;\x20adding\x20Amount\x20legs\x20raises\x20outflow,\x20it\x20never\x20withholds.\x20The\x20allocator-registration\x20call\x20surface\x20takes\x20only\x20(guard,\x20sharing,\x20max)\x20—\x20no\x20fix\x20argument\x20at\x20all\x20—\x20so\x20a\x20template-side\x20fix\x20value\x20is\x20silently\x20dropped\x20before\x20the\x20transaction\x20is\x20built.\x20The\x20chain\x20has\x20NO\x20holdback/reserve\x20primitive;\x20the\x20only\x20way\x20to\x20leave\x20funds\x20in\x20a\x20pool\x20is\x20to\x20not\x20distribute\x20them\x20(no\x20allocator\x20fires,\x20or\x20a\x20max-capped\x20Surplus\x20stops\x20at\x20the\x20cap).','falsehoods':['the\x20reserve\x20never\x20leaves','reserve\x20never\x20leaves\x20the\x20pool','the\x20reserve\x20stays\x20in\x20the\x20pool','reserve\x20physically\x20stays\x20in\x20the\x20pool','the\x20fix\x20retains\x20the\x20reserve','fix-retained\x20claim\x20reserve','leaves\x20the\x20reserve\x20in\x20the\x20pool','fix=reserve','only\x20on-chain\x20holdback'],'harm':'Templates\x20that\x20declare\x20fix=reserve\x20ship\x20a\x20payout\x20rail\x20that\x20drains\x20100%\x20of\x20the\x20escrow\x20at\x20the\x20first\x20release;\x20the\x20claim/refund\x20legs\x20behind\x20it\x20are\x20dead\x20by\x20construction\x20and\x20the\x20money\x20is\x20gone\x20(airbnb\x20mainnet\x20audit\x202026-10-07:\x20ABNB_STAY_SERVICE\x20allocators[0]\x20fix=\x220\x22,\x20full\x20drain\x20at\x20payout_24h).'},{'fact_id':'FACT-GUARD-01','subject':'GuardIdentifier\x20recipient\x20+\x20for_object\x20binding','authoritative':'ERECIPIENT_NOT_FOR_OBJECT\x20is\x20enforced\x20ONLY\x20when\x20the\x20recipient\x20kind\x20is\x20GuardIdentifier\x20AND\x20payment_info.for_object\x20is\x20Some(binding).\x20Pure\x20Entity\x20recipients\x20and\x20unbound\x20GuardIdentifier\x20legs\x20skip\x20this\x20check\x20entirely\x20—\x20the\x20tooling\x20layer\x20(scanner,\x20template\x20compiler)\x20must\x20flag\x20them\x20(the\x20on-chain\x20recipient\x20check).','falsehoods':['the\x20contract\x20checks\x20all\x20recipients\x20against\x20for_object','GuardIdentifier\x20recipients\x20are\x20always\x20safe','the\x20contract\x20validates\x20every\x20recipient\x20binding'],'harm':'An\x20unbound\x20GuardIdentifier\x20or\x20pure\x20Entity\x20recipient\x20can\x20redirect\x20funds\x20to\x20the\x20deploying\x20account\x20or\x20an\x20arbitrary\x20address\x20without\x20any\x20on-chain\x20error.'},{'fact_id':'FACT-MACHINE-01','subject':'Machine\x20edge\x20\x27from\x27\x20semantics','authoritative':'A\x20machine\x20edge\x20declares\x20a\x20single\x20source\x20node\x20in\x20its\x20\x27from\x27\x20field.\x20Multiple\x20edges\x20from\x20the\x20same\x20source\x20node\x20are\x20allowed\x20and\x20represent\x20alternative\x20paths;\x20they\x20are\x20NOT\x20merged.\x20An\x20edge\x20without\x20\x27from\x27\x20is\x20invalid\x20in\x20the\x20new\x20topology\x20format\x20and\x20causes\x20compile-time\x20blockers.','falsehoods':['edges\x20without\x20from\x20are\x20auto-derived','missing\x20from\x20means\x20any\x20node','from\x20is\x20optional\x20for\x20backward\x20compatibility'],'harm':'Old\x20flat\x20machine_shape\x20without\x20from\x20fields\x20compiles\x20into\x20an\x20incomplete\x20topology,\x20leaving\x20nodes\x20unreachable\x20and\x20fund\x20paths\x20missing.'},{'fact_id':'FACT-ENTITY-01','subject':'Entity\x20recipient\x20fallback\x20to\x20deployer','authoritative':'When\x20an\x20Entity\x20recipient\x27s\x20name_or_address\x20is\x20empty,\x20omitted,\x20or\x20resolves\x20to\x20the\x20deploying\x20account,\x20the\x20share\x20is\x20paid\x20to\x20the\x20DEPLOYING\x20ACCOUNT\x20(the\x20on-chain\x20payout\x20path).\x20This\x20is\x20a\x20silent\x20fallback\x20—\x20no\x20error\x20is\x20raised.','falsehoods':['empty\x20Entity\x20names\x20are\x20rejected','the\x20contract\x20validates\x20Entity\x20recipients','an\x20unnamed\x20Entity\x20recipient\x20causes\x20an\x20abort'],'harm':'A\x20template\x20with\x20a\x20placeholder\x20Entity\x20recipient\x20silently\x20pays\x20the\x20share\x20to\x20whoever\x20deploys\x20the\x20service,\x20which\x20is\x20almost\x20never\x20the\x20intended\x20recipient.'},{'fact_id':'FACT-REWARD-01','subject':'Reward\x20replay\x20scope\x20(SV-2)\x20—\x20entry-stamped\x20+\x20order-scoped\x20where\x20is\x20the\x20primary\x20once-per-buyer-per-order\x20form','authoritative':'SV-2\x20(azx7-mn-261014\x20live\x20T8):\x20on\x20a\x20guard\x20whose\x20reward\x20claim\x20entry\x20carries\x20the\x20store_from_id\x20stamp,\x20the\x20ORDER-SCOPED\x20record\x20query\x20(where:{storeFromId:{identifier:0}})\x20is\x20live\x20—\x20once\x20per\x20buyer\x20per\x20order\x20(the\x20native\x20claim\x20key\x20is\x20recipient+guard+stamp).\x20Entry-stamped\x20+\x20empty\x20where\x20is\x20the\x20DELIBERATE\x20once-per-buyer-for-life\x20variant;\x20an\x20unstamped\x20entry\x20never\x20keys\x20its\x20claim\x20records,\x20which\x20is\x20the\x20only\x20context\x20where\x20the\x20old\x20\x27storeFromId\x20filter\x20no-ops\x27\x20verdict\x20ever\x20held.\x20The\x20canonical\x20protocol-facts\x20teaching\x20(SV2_REPLAY_GATE_CLAUSE)\x20is\x20the\x20single-source\x20text;\x20the\x20compile\x20REVIEW_REWARD_UNARMED\x20blocker\x20interpolates\x20its\x20prescription\x20from\x20there.','falsehoods':['the\x20EMPTY\x20where\x20is\x20MANDATORY','NEVER\x20the\x20storeFromId\x20query\x20filter','storeFromId-filtered\x20record\x20query\x20is\x20a\x20SILENT\x20NO-OP','empty-where\x20exists_where\x20gate\x20is\x20the\x20only\x20working\x20idiom','filter\x20is\x20a\x20silent\x20no-op\x20on\x20the\x20current\x20runtime','NEVER\x20bind\x20storeFromId,\x20that\x20filter\x20silently\x20evaluates'],'harm':'The\x20retracted\x20ofn-mn-261012\x20F-01\x20reading\x20(run-75747\x20F-31)\x20shipped\x20pools\x20gated\x20recipient-only-for-life\x20—\x20silently\x20killing\x20the\x20buyer\x27s\x20second\x20order\x20(upw-mn-261014\x20F-48)\x20—\x20while\x20the\x20auditor\x20that\x20should\x20have\x20caught\x20it\x20carried\x20the\x20same\x20stale\x20verdict.'}];export function scanContent(a,b){const c=[],d=b['toLowerCase']();for(const e of SEMANTIC_FACTS){for(const f of e['falsehoods']){const g=f['toLowerCase']();let h=0x0;while((h=d['indexOf'](g,h))!==-0x1){const i=d['slice'](Math['max'](0x0,h-0xc),h),j=/(?:^|[\s"'])not\s+$/['test'](i)||/never\s+$/['test'](i);!j&&c['push']({'fact_id':e['fact_id'],'phrasing':f}),h+=g['length'];}}}return c;}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { Industry } from "../customer/index.js";
|
|
2
2
|
import type { ModeMachineNode, ModeGuardRef, ModeAllocatorStrategy } from "./scenario-modes.js";
|
|
3
|
+
import { GUARD_TEMPLATES } from "./guard-templates.js";
|
|
3
4
|
export type TemplateArbitrationMode = "none" | "merchant_pick" | "mutual_pick" | "third_party";
|
|
4
5
|
export interface ArchetypeTemplate {
|
|
5
6
|
id: string;
|
|
@@ -25,6 +26,7 @@ export interface ArchetypeTemplate {
|
|
|
25
26
|
user_inputs: string[];
|
|
26
27
|
key_risk: string;
|
|
27
28
|
compensation_fund_policy?: "allowed" | "forbidden";
|
|
29
|
+
settlement_window_merge?: readonly string[];
|
|
28
30
|
reentry_kind?: "none" | "review-loop" | "paid-cycle";
|
|
29
31
|
build_notes: string[];
|
|
30
32
|
evidence_refs?: string[];
|
|
@@ -51,7 +53,7 @@ export interface ArchetypeTemplate {
|
|
|
51
53
|
logistics_mode?: "none" | "carrier" | "merchant_managed" | "courier" | "pickup_point";
|
|
52
54
|
crowdfunding_mode?: "none" | "threshold" | "flexible";
|
|
53
55
|
}
|
|
54
|
-
export declare const BUILTIN_TEMPLATES_VERSION =
|
|
56
|
+
export declare const BUILTIN_TEMPLATES_VERSION = 140;
|
|
55
57
|
export declare const BUILTIN_TEMPLATES: ArchetypeTemplate[];
|
|
56
58
|
export declare const TEMPLATE_KEYWORDS: Record<string, string[]>;
|
|
57
59
|
export declare const TEMPLATE_TAGS: Record<string, string[]>;
|
|
@@ -62,6 +64,17 @@ export declare const DISCOVERY_PRODUCT_REFS: readonly string[];
|
|
|
62
64
|
export declare function isDiscoveryTag(tag: string): boolean;
|
|
63
65
|
export declare function getBuiltinTemplate(id: string): ArchetypeTemplate | undefined;
|
|
64
66
|
export declare function listBuiltinTemplates(): ArchetypeTemplate[];
|
|
67
|
+
export declare function guardTemplateHasIdentityLeg(root: unknown): boolean;
|
|
68
|
+
export declare const STATE_AUTHORIZING_TPL: ReadonlySet<string>;
|
|
69
|
+
export interface BuyerRailEdgeScan {
|
|
70
|
+
template_id: string;
|
|
71
|
+
edge: string;
|
|
72
|
+
guard_key: string;
|
|
73
|
+
design: string;
|
|
74
|
+
tpl: (typeof GUARD_TEMPLATES)[number] | undefined;
|
|
75
|
+
hasIdentity: boolean;
|
|
76
|
+
}
|
|
77
|
+
export declare function scanBuyerRailGuardEdges(entries?: ArchetypeTemplate[]): BuyerRailEdgeScan[];
|
|
65
78
|
export declare function validateBuiltinTemplateCatalog(entries?: ArchetypeTemplate[]): void;
|
|
66
79
|
export interface OnceSlotAdvisory {
|
|
67
80
|
template_id: string;
|