@wowok/agent-mcp 3.3.7 → 3.3.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chain-semantics/fund-flow.js +1 -1
- package/dist/chain-semantics/guard-verbs.js +1 -1
- package/dist/chain-semantics/object-graph.js +1 -1
- package/dist/communication/message-cursors.d.ts +35 -0
- package/dist/communication/message-cursors.js +1 -0
- package/dist/communication/wts-attestation.d.ts +5 -0
- package/dist/communication/wts-attestation.js +1 -1
- package/dist/composition/audit.js +1 -1
- package/dist/composition/compile.d.ts +2 -2
- package/dist/composition/compile.js +1 -1
- package/dist/composition/inflight.d.ts +7 -0
- package/dist/composition/inflight.js +1 -1
- package/dist/composition/materialize.d.ts +4 -1
- package/dist/composition/materialize.js +1 -1
- package/dist/config/index.d.ts +1 -0
- package/dist/config/index.js +1 -1
- package/dist/config/store-policy.d.ts +14 -0
- package/dist/config/store-policy.js +1 -0
- package/dist/config/store-policy.spec.d.ts +1 -0
- package/dist/config/store-policy.spec.js +1 -0
- package/dist/customer/industry-risks.js +1 -1
- package/dist/customer/user-preferences.js +1 -1
- package/dist/evaluation/builtins/graph-service.spec.js +1 -1
- package/dist/evaluation/engine.js +1 -1
- package/dist/experience/realtime-feedback.js +1 -1
- package/dist/extensions/business-modules.d.ts +1 -1
- package/dist/extensions/business-modules.js +1 -1
- package/dist/extensions/industry-pack.js +1 -1
- package/dist/extensions/modes.js +1 -1
- package/dist/graph/onchain/analyze.js +1 -1
- package/dist/graph/onchain/expand.js +1 -1
- package/dist/graph/onchain/exposure.js +1 -1
- package/dist/graph/onchain/facts.d.ts +1 -0
- package/dist/graph/onchain/facts.js +1 -1
- package/dist/graph/onchain/facts.spec.js +1 -1
- package/dist/harness/recover.js +1 -1
- package/dist/knowledge/acquisition-flywheel.js +1 -1
- package/dist/knowledge/allocation-ledger.d.ts +1 -0
- package/dist/knowledge/allocation-ledger.js +1 -1
- package/dist/knowledge/allocator-rail-verifier.d.ts +6 -2
- package/dist/knowledge/allocator-rail-verifier.js +1 -1
- package/dist/knowledge/arbitration-ledger.js +1 -1
- package/dist/knowledge/audit-rules.d.ts +37 -0
- package/dist/knowledge/audit-rules.js +1 -1
- package/dist/knowledge/baselines/rules/plan.json +32 -2
- package/dist/knowledge/builtin-templates.d.ts +13 -1
- package/dist/knowledge/builtin-templates.js +1 -1
- package/dist/knowledge/commission-landing.d.ts +26 -0
- package/dist/knowledge/commission-landing.js +1 -0
- package/dist/knowledge/discount-threshold.js +1 -1
- package/dist/knowledge/fund-layer.d.ts +7 -0
- package/dist/knowledge/fund-layer.js +1 -1
- package/dist/knowledge/getting-started.js +1 -1
- package/dist/knowledge/guard-design-patterns.d.ts +1 -1
- package/dist/knowledge/guard-design-patterns.js +1 -1
- package/dist/knowledge/guard-puzzle.js +1 -1
- package/dist/knowledge/guard-render.d.ts +7 -0
- package/dist/knowledge/guard-render.js +1 -1
- package/dist/knowledge/guard-risk.js +1 -1
- package/dist/knowledge/guard-templates.d.ts +1 -1
- package/dist/knowledge/guard-templates.js +1 -1
- package/dist/knowledge/guard-translation.js +1 -1
- package/dist/knowledge/index.js +1 -1
- package/dist/knowledge/industry-generalizer.js +1 -1
- package/dist/knowledge/industry-registry.d.ts +1 -1
- package/dist/knowledge/industry-registry.js +1 -1
- package/dist/knowledge/industry-strategy.js +1 -1
- package/dist/knowledge/jsonrpc-enum.js +1 -1
- package/dist/knowledge/machine-fork-watch.d.ts +9 -0
- package/dist/knowledge/machine-fork-watch.js +1 -0
- package/dist/knowledge/migration-preflight.js +1 -1
- package/dist/knowledge/projection.spec.js +1 -1
- package/dist/knowledge/scenario-modes.d.ts +8 -2
- package/dist/knowledge/scenario-modes.js +1 -1
- package/dist/knowledge/semantic-ir.d.ts +24 -5
- package/dist/knowledge/semantic-ir.js +1 -1
- package/dist/knowledge/service-ledger.js +1 -1
- package/dist/knowledge/strategy-manuals.js +1 -1
- package/dist/knowledge/template-index.js +1 -1
- package/dist/knowledge/template-loader.d.ts +11 -0
- package/dist/knowledge/template-loader.js +1 -1
- package/dist/knowledge/template-registry.js +1 -1
- package/dist/knowledge/template-scanner.d.ts +4 -2
- package/dist/knowledge/template-scanner.js +1 -1
- package/dist/knowledge/template-validation.js +1 -1
- package/dist/knowledge/tools-reference.js +1 -1
- package/dist/monitor/MonitorLoop.js +1 -1
- package/dist/playbooks/service-build/business-puzzle.js +1 -1
- package/dist/playbooks/service-build/machine-panorama.js +1 -1
- package/dist/playbooks/service-build/merchant-guide.d.ts +12 -6
- package/dist/playbooks/service-build/merchant-guide.js +1 -1
- package/dist/playbooks/service-build/migration-planner.d.ts +10 -2
- package/dist/playbooks/service-build/migration-planner.js +1 -1
- package/dist/playbooks/service-build/mode-actions.d.ts +1 -0
- package/dist/playbooks/service-build/mode-actions.js +1 -1
- package/dist/playbooks/service-build/object-panorama.js +1 -1
- package/dist/playbooks/service-build/participation-radar.js +1 -1
- package/dist/playbooks/service-build/relationship-profile.js +1 -1
- package/dist/playbooks/service-build/service-panorama.js +1 -1
- package/dist/playbooks/service-build/service-quote.js +1 -1
- package/dist/playbooks/service-build/service-quote.spec.js +1 -1
- package/dist/review/index.js +1 -1
- package/dist/safety/confirm-gate.js +1 -1
- package/dist/schema/benchmark-migration/index.d.ts +72 -1
- package/dist/schema/benchmark-migration/index.js +1 -1
- package/dist/schema/call/allocation.d.ts +3 -0
- package/dist/schema/call/allocation.js +1 -1
- package/dist/schema/call/base.d.ts +24 -0
- package/dist/schema/call/bridge.d.ts +6 -0
- package/dist/schema/call/error-codes.d.ts +1 -1
- package/dist/schema/call/error-codes.js +1 -1
- package/dist/schema/call/order.js +1 -1
- package/dist/schema/call/semantic.js +1 -1
- package/dist/schema/call/service.js +1 -1
- package/dist/schema/common/index.js +1 -1
- package/dist/schema/config/index.d.ts +24 -0
- package/dist/schema/config/index.js +1 -1
- package/dist/schema/goal/index.d.ts +14 -0
- package/dist/schema/goal/planning.d.ts +26 -0
- package/dist/schema/goal/planning.js +1 -1
- package/dist/schema/industry-pack/index.d.ts +9 -1
- package/dist/schema/industry-pack/modes.d.ts +9 -1
- package/dist/schema/industry-pack/modes.js +1 -1
- package/dist/schema/local/index.d.ts +60 -0
- package/dist/schema/local/index.js +1 -1
- package/dist/schema/messenger/index.d.ts +278 -1
- package/dist/schema/messenger/index.js +1 -1
- package/dist/schema/operations.d.ts +1 -0
- package/dist/schema/query/bi.d.ts +38 -0
- package/dist/schema/query/bi.js +1 -1
- package/dist/schema/query/index.d.ts +3 -0
- package/dist/schema/query/index.js +1 -1
- package/dist/schema/schema-version.js +1 -1
- package/dist/schema/service-clone/index.d.ts +17 -0
- package/dist/schema/service-clone/index.js +1 -1
- package/dist/schema-query-impl/index.js +1 -1
- package/dist/schemas/account_operation.output.json +6 -0
- package/dist/schemas/benchmark_migration_operation.output.json +254 -2
- package/dist/schemas/benchmark_migration_operation.schema.json +87 -5
- package/dist/schemas/bridge_operation.output.json +6 -0
- package/dist/schemas/config_operation.output.json +95 -0
- package/dist/schemas/config_operation.schema.json +16 -1
- package/dist/schemas/goal_operation.schema.json +22 -0
- package/dist/schemas/index.json +1 -1
- package/dist/schemas/industry_pack_operation.output.json +4 -0
- package/dist/schemas/industry_pack_operation.schema.json +40 -3
- package/dist/schemas/local_cache_operation.output.json +6 -0
- package/dist/schemas/local_history_operation.output.json +6 -0
- package/dist/schemas/local_info_operation.output.json +6 -0
- package/dist/schemas/local_mark_operation.output.json +6 -0
- package/dist/schemas/messenger_operation.output.json +609 -1
- package/dist/schemas/messenger_operation.schema.json +96 -1
- package/dist/schemas/onchain_operations.output.json +6 -0
- package/dist/schemas/onchain_operations.schema.json +334 -7
- package/dist/schemas/onchain_operations_allocation.schema.json +10 -1
- package/dist/schemas/onchain_operations_guard.schema.json +318 -0
- package/dist/schemas/onchain_operations_order.schema.json +1 -1
- package/dist/schemas/onchain_operations_service.schema.json +5 -5
- package/dist/schemas/query_toolkit.output.json +271 -8
- package/dist/schemas/service_clone_operation.output.json +79 -0
- package/dist/tools/handlers/benchmark-migration.d.ts +14 -0
- package/dist/tools/handlers/benchmark-migration.js +1 -1
- package/dist/tools/handlers/config.js +1 -1
- package/dist/tools/handlers/messenger.js +1 -1
- package/dist/tools/handlers/onchain.d.ts +19 -1
- package/dist/tools/handlers/onchain.js +1 -1
- package/dist/tools/handlers/query.d.ts +1 -0
- package/dist/tools/handlers/query.js +1 -1
- package/dist/tools/handlers/service-clone.d.ts +18 -0
- package/dist/tools/handlers/service-clone.js +1 -1
- package/dist/tools/registry/business.js +1 -1
- package/dist/tools/wrap.js +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
export const FUND_FLOWS={'buy_entry':{'kind':'entry','summary':'Buyer\x20pays:\x20coin\x20split\x20->\x20Order\x20+\x20Allocation\x20escrow\x20anchored\x20to\x20the\x20order.','path':['service\x20buy\x20(creates\x20Order,\x20service.move:459)','order-bound\x20Allocation\x20creation\x20(splits\x20coin,\x20sets\x20payment_info.for_object=order,\x20service.move:408)'],'invariants':['Allocation.balance\x20==\x20order\x20amount\x20at\x20creation','quote.ctx\x20binds\x20quote\x20to\x20tx\x20digest;\x20stock\x20deducted\x20in\x20same\x20tx\x20as\x20buy'],'sources':[{'file':'service.move','line':0x206,'pattern':'buy2_imp'},{'file':'service.move','line':0x1d3,'pattern':'order_allocation'}]},'exit_alloc':{'kind':'exit','summary':'Escrow\x20exit\x201\x20(settlement\x20/\x20refund):\x20guard-matched\x20allocators\x20distribute\x20the\x20pool.','path':['allocation.alloc\x20(allocation.move:408)','per\x20matched\x20allocator:\x20once-slot\x20(OnceKey{guard,\x20allocator\x20index,\x20key})\x20consumed','Payment<T>\x20created;\x20CoinWrapper<T>\x20transferred\x20to\x20each\x20recipient','recipient\x20unwraps\x20via\x20payment.unwrap\x20/\x20order.owner_receive'],'invariants':['balance\x20>=\x20allocators.threshold\x20(EINSUFFICIENT_BALANCE)','balance\x20>\x200\x20(EZERO_DISTRIBUTION)\x20—\x20replay\x20on\x20drained\x20pool\x20aborts','payment_info\x20must\x20be\x20some\x20(ENO_PAYMENT_INFO)','every\x20allocator\x20with\x20matching\x20guard\x20RUNS,\x20in\x20vector\x20order,\x20against\x20the\x20shrinking\x20pool','once-slot\x20per\x20allocator\x20index\x20makes\x20replay\x20of\x20the\x20same\x20guard\x20abort'],'findings':['A-3'],'sources':[{'file':'allocation.move','line':0x1ee,'pattern':'public\x20fun\x20alloc<T>'},{'file':'allocation.move','line':0x1f5,'pattern':'EZERO_DISTRIBUTION'}]},'allocation_pool_no_exit':{'kind':'fact','summary':'F-BS-32\x20FINAL\x20RULING\x20(b31\x20audit\x202026-10-22):\x20Allocation\x20has\x20NO\x20drain\x20exit\x20—\x20value\x20leaves\x20a\x20pool\x20ONLY\x20through\x20allocator\x20legs\x20whose\x20guards\x20PASS.','path':['the\x20ONLY\x20sanctioned\x20remedy\x20for\x20a\x20frozen\x20residual\x20is\x20PRE-PUBLISH:\x20extend\x20the\x20allocator\x20set\x20(append-only,\x20publish-gated)\x20with\x20a\x20leg\x20whose\x20guard\x20opens\x20under\x20consensus,\x20or\x20accept\x20the\x20freeze','no\x20order-anchored,\x20service-anchored,\x20or\x20flag-gated\x20side\x20exit\x20exists\x20—\x20a\x20guard-bypassing\x20drain\x20is\x20a\x20backdoor\x20by\x20construction\x20and\x20was\x20REJECTED\x20at\x20the\x20language\x20level'],'invariants':['every\x20entry\x20in\x20allocation.move\x20upholds\x20\x27no\x20value\x20moves\x20without\x20a\x20matching\x20guard\x27\x20—\x20a\x20drain\x20primitive\x20is\x20a\x20rejected\x20shape,\x20NEVER\x20re-propose\x20it','frozen\x20residuals\x20are\x20prevented\x20pre-publish\x20by\x20the\x20AB7-C1\x20shape\x20gate\x20(recipient\x20!=\x20anchor)\x20and\x20allocator\x20planning;\x20mainnet\x200x1dcf3f3a\x20(0.01\x20frozen,\x20no\x20exit)\x20stands\x20as\x20the\x20accepted\x20cost\x20of\x20the\x20discipline'],'findings':['F-BS-32'],'sources':[{'file':'allocation.move','line':0x78,'pattern':'pool-drain\x20primitive\x20REJECTED'},{'file':'service.move','line':0x6b3,'pattern':'NO\x20drain\x20entry\x20exists'}]},'exit_compensation':{'kind':'exit','summary':'Escrow\x20exit\x202\x20(arbitration\x20indemnity):\x20service\x20compensation_fund\x20pays\x20order\x20owner\x20directly.','path':['service\x20compensation\x20claim\x20(service.move:516;\x20arbitrations\x20whitelist\x20+\x20E33\x20conflict\x20check\x20at\x20:525-527)','arbitration.compensate\x20->\x20order.compensate\x20writes\x20claimed_by','compensation_fund\x20split\x20->\x20public_transfer\x20to\x20order.owner\x20(service.move:541)'],'invariants':['order\x20must\x20not\x20be\x20already\x20claimed\x20(E_ORDER_ALREADY_CLAIMED)','claiming\x20arbitration\x20must\x20be\x20in\x20service.arbitrations\x20whitelist'],'sources':[{'file':'service.move','line':0x243,'pattern':'compensation_claim'},{'file':'service.move','line':0x25c,'pattern':'order::owner(order)'},{'file':'order.move','line':0x72,'pattern':'public(package)\x20fun\x20compensate'}]},'dual_rail_fact':{'kind':'fact','summary':'A-3\x20dual\x20rail:\x20alloc\x20never\x20reads\x20claimed_by;\x20compensate\x20never\x20touches\x20the\x20escrow\x20balance.','path':['order.move:238-259\x20(deliberate:\x20refund-of-principal\x20+\x20damages\x20in\x20one\x20case\x20is\x20legal)'],'invariants':['Double-pay\x20prevention\x20is\x20delegated\x20to\x20template\x20convention:\x20refund\x20guard\x20MUST\x20assert\x20claimed_by\x20is\x20none','Tool\x20layer\x20MUST\x20enforce\x20this\x20convention\x20via\x20rule\x20DUAL-RAIL-01\x20—\x20the\x20chain\x20will\x20not'],'findings':['A-3'],'sources':[{'file':'order.move','line':0x10c,'pattern':'claimed_by'}]},'order_anchored_refund':{'kind':'fact','summary':'Order-anchored\x20refunds\x20are\x20deliberate:\x20a\x20GuardIdentifier\x20leg\x20on\x20an\x20order\x20escrow\x20pays\x20the\x20Order\x20OBJECT,\x20and\x20the\x20Order\x27s\x20owner-claim\x20entry\x20extracts\x20the\x20CoinWrapper\x20to\x20order.owner.','path':['GuardIdentifier\x20leg\x20asserts\x20its\x20passport-submitted\x20address\x20==\x20payment_info.for_object\x20(allocation.move)','the\x20service\x27s\x20escrow\x20setup\x20binds\x20payment_info.for_object\x20to\x20the\x20paying\x20Order','the\x20payment\x20batch\x20transfer\x20moves\x20the\x20CoinWrapper\x20to\x20the\x20Order\x20address','the\x20Order\x27s\x20owner-claim\x20entry\x20receives\x20into\x20the\x20shared\x20Order\x27s\x20own\x20UID\x20(&mut\x20self.id),\x20then\x20transfers\x20the\x20coin\x20to\x20self.owner'],'invariants':['an\x20object\x20address\x20CAN\x20receive:\x20transfer::public_receive\x20only\x20needs\x20&mut\x20UID\x20of\x20the\x20parent,\x20and\x20a\x20shared\x20object\x20qualifies','authorization\x20and\x20destination\x20are\x20separate:\x20the\x20guard\x20decides\x20who\x20may\x20trigger\x20(order.owner\x20or\x20an\x20agent),\x20the\x20payee\x20is\x20always\x20self.owner','the\x20payee\x20is\x20read\x20at\x20extraction\x20time,\x20so\x20a\x20later\x20ownership\x20change\x20is\x20followed\x20automatically','a\x20mismatched\x20submission\x20aborts\x2015\x20—\x20that\x20is\x20the\x20cross-order\x20redirect\x20guard,\x20not\x20a\x20ban\x20on\x20the\x20shape','step\x202\x20is\x20mandatory:\x20the\x20wrapper\x20stays\x20on\x20the\x20Order\x20until\x20the\x20owner-claim\x20entry\x20runs.\x20Build\x20the\x20Receiving\x20from\x20the\x20wrapper\x27s\x20id/version/digest\x20(alloc\x20tx\x20effects);\x20the\x20RPC\x20owned-objects\x20query\x20hardcodes\x20OwnerKind::Address\x20and\x20returns\x20nothing\x20for\x20object-owned\x20children'],'sources':[{'file':'allocation.move','line':0x262,'pattern':'ERECIPIENT_NOT_FOR_OBJECT'},{'file':'service.move','line':0x1d3,'pattern':'order_allocation'},{'file':'order.move','line':0x139,'pattern':'owner_receive'}]},'buyer_receive':{'kind':'exit','summary':'Buyer\x20claims\x20inbound\x20funds:\x20order.owner_receive\x20unwraps\x20Payment\x20and\x20transfers\x20coin\x20to\x20owner.','path':['order.owner_receive\x20(order.move:279-283,\x20public_transfer\x20to\x20self.owner)'],'invariants':['only\x20order.owner\x20receives'],'sources':[{'file':'order.move','line':0x13a,'pattern':'owner_receive'}]},'reward_claim':{'kind':'exit','summary':'Reward\x20pool\x20exit\x201\x20(incentive):\x20guard+passport\x20gated\x20claim\x20transfers\x20coin\x20to\x20recipient.','path':['reward.claim\x20(reward.move:216)\x20->\x20coin\x20to\x20recipient\x20(reward.move:327)'],'invariants':['passport\x20must\x20satisfy\x20the\x20matched\x20RewardGuard'],'sources':[{'file':'reward.move','line':0xd8,'pattern':'public\x20fun\x20claim<T>'}]},'reward_withdraw':{'kind':'exit','summary':'Reward\x20pool\x20exit\x202\x20(balance\x20recovery,\x20ETS-B):\x20permission-gated\x20withdraw\x20leaves\x20inside\x20a\x20Payment\x20object\x20receipt.','path':['reward.withdraw[_and_unwrap]\x20(reward.move:721/:728),\x20precheck\x20E_GUARD_LOCKED_TIME\x20(the\x20internal\x20withdrawal\x20lock)','the\x20escrowed\x20coin\x20is\x20wrapped\x20and\x20delivered\x20to\x20the\x20recipient;\x20the\x20reward\x20source\x20is\x20recorded\x20in\x20the\x20payment\x27s\x20source\x20set;\x20payment.create\x20mints\x20the\x20receipt\x20(reward.move:541)','unwrap=true\x20(single\x20PTB):\x20the\x20receipt\x20is\x20unwrapped\x20to\x20the\x20transaction\x20sender\x20in\x20the\x20same\x20transaction\x20(reward.move:566)'],'invariants':['permission\x20index\x20158\x20(REWARD_WITHDRAW)\x20on\x20the\x20Reward\x27s\x20Permission\x20object','blocked\x20while\x20guard_not_added_expiration_time\x20is\x20Some\x20and\x20in\x20the\x20future\x20(E_GUARD_LOCKED_TIME)','claim\x20replay\x20protection\x20(once-slots)\x20is\x20untouched\x20—\x20withdraw\x20never\x20reads\x20recipient\x20records'],'sources':[{'file':'reward.move','line':0x2d1,'pattern':'public\x20fun\x20withdraw<T>'}]},'treasury_flows':{'kind':'internal','summary':'Treasury:\x20deposit/withdraw/guard-driven\x20external\x20flows;\x20owner_receive\x20bypasses\x20outflow\x20counter.','path':['treasury.deposit\x20/\x20withdraw\x20(external_*_guard\x20driven\x20variants)','treasury.owner_receive\x20moves\x20value\x20out\x20WITHOUT\x20touching\x20outflow'],'invariants':['inflow\x20and\x20outflow\x20are\x20u128\x20accumulators;\x20conservation\x20audit\x20must\x20read\x20fields,\x20not\x20events'],'sources':[{'file':'treasury.move','line':0x48,'pattern':'public\x20struct\x20Treasury<phantom\x20T>\x20has\x20key'}]},'discount_burn':{'kind':'fact','summary':'A-4:\x20coupon\x20burned\x20at\x20buy;\x20the\x20burned\x20object\x20leaves\x20only\x20a\x20dead\x20address\x20(F-ES-18\x20event\x20now\x20records\x20the\x20grant).','path':['the\x20discounted\x20quote\x20sets\x20quote.discount=some\x20when\x20benchmark\x20is\x20met\x20(service.move:411)','the\x20buy\x20path\x20destroys\x20the\x20coupon\x20after\x20capturing\x20its\x20semantics\x20(service.move:514)'],'invariants':['Fix\x20(protocol\x20upgrade,\x20body-level):\x20the\x20discounted\x20quote\x20returns\x20discount:none\x20below\x20benchmark','DiscountRedeemedEvent\x20(F-ES-18)\x20is\x20the\x20only\x20on-chain\x20record\x20of\x20what\x20the\x20burned\x20coupon\x20granted'],'findings':['A-4'],'sources':[{'file':'service.move','line':0x1b7,'pattern':'discount'},{'file':'service.move','line':0x21e,'pattern':'discount_destroy'}]},'conservation_gap':{'kind':'fact','summary':'No\x20on-chain\x20conservation\x20check:\x20accumulator_*\x20are\x20private\x20and\x20sender==@0x0\x20is\x20unreachable.','path':[],'invariants':['Conservation\x20(sum\x20in\x20==\x20sum\x20out\x20+\x20balances)\x20MUST\x20be\x20audited\x20by\x20the\x20tool\x20layer\x20post-materialization\x20(A-14)'],'findings':['A-14'],'sources':[{'file':'service.move','line':0x100,'pattern':'compensation_fund:\x20Balance<T>'}]}};
|
|
1
|
+
export const FUND_FLOWS={'buy_entry':{'kind':'entry','summary':'Buyer\x20pays:\x20coin\x20split\x20->\x20Order\x20+\x20Allocation\x20escrow\x20anchored\x20to\x20the\x20order.','path':['service\x20buy\x20(creates\x20Order,\x20service.move:459)','order-bound\x20Allocation\x20creation\x20(splits\x20coin,\x20sets\x20payment_info.for_object=order,\x20service.move:408)'],'invariants':['Allocation.balance\x20==\x20order\x20amount\x20at\x20creation','quote.ctx\x20binds\x20quote\x20to\x20tx\x20digest;\x20stock\x20deducted\x20in\x20same\x20tx\x20as\x20buy'],'sources':[{'file':'service.move','line':0x206,'pattern':'buy2_imp'},{'file':'service.move','line':0x1d3,'pattern':'order_allocation'}]},'exit_alloc':{'kind':'exit','summary':'Escrow\x20exit\x201\x20(settlement\x20/\x20refund):\x20guard-matched\x20allocators\x20distribute\x20the\x20pool.','path':['allocation.alloc\x20(allocation.move:408)','per\x20matched\x20allocator:\x20once-slot\x20(OnceKey{guard,\x20allocator\x20index,\x20key})\x20consumed','Payment<T>\x20created;\x20CoinWrapper<T>\x20transferred\x20to\x20each\x20recipient','recipient\x20unwraps\x20via\x20payment.unwrap\x20/\x20order.owner_receive'],'invariants':['balance\x20>=\x20allocators.threshold\x20(EINSUFFICIENT_BALANCE)','balance\x20>\x200\x20(EZERO_DISTRIBUTION)\x20—\x20replay\x20on\x20drained\x20pool\x20aborts','payment_info\x20must\x20be\x20some\x20(ENO_PAYMENT_INFO)','every\x20allocator\x20with\x20matching\x20guard\x20RUNS,\x20in\x20vector\x20order,\x20against\x20the\x20shrinking\x20pool','once-slot\x20per\x20allocator\x20index\x20makes\x20replay\x20of\x20the\x20same\x20guard\x20abort'],'findings':['A-3'],'sources':[{'file':'allocation.move','line':0x1ee,'pattern':'public\x20fun\x20alloc<T>'},{'file':'allocation.move','line':0x1f5,'pattern':'EZERO_DISTRIBUTION'}]},'allocation_pool_no_exit':{'kind':'fact','summary':'F-BS-32\x20FINAL\x20RULING\x20(b31\x20audit\x202026-10-22):\x20Allocation\x20has\x20NO\x20drain\x20exit\x20—\x20value\x20leaves\x20a\x20pool\x20ONLY\x20through\x20allocator\x20legs\x20whose\x20guards\x20PASS.','path':['the\x20ONLY\x20sanctioned\x20remedy\x20for\x20a\x20frozen\x20residual\x20is\x20PRE-PUBLISH:\x20extend\x20the\x20allocator\x20set\x20(append-only,\x20publish-gated)\x20with\x20a\x20leg\x20whose\x20guard\x20opens\x20under\x20consensus,\x20or\x20accept\x20the\x20freeze','no\x20order-anchored,\x20service-anchored,\x20or\x20flag-gated\x20side\x20exit\x20exists\x20—\x20a\x20guard-bypassing\x20drain\x20is\x20a\x20backdoor\x20by\x20construction\x20and\x20was\x20REJECTED\x20at\x20the\x20language\x20level'],'invariants':['every\x20entry\x20in\x20allocation.move\x20upholds\x20\x27no\x20value\x20moves\x20without\x20a\x20matching\x20guard\x27\x20—\x20a\x20drain\x20primitive\x20is\x20a\x20rejected\x20shape,\x20NEVER\x20re-propose\x20it','frozen\x20residuals\x20are\x20prevented\x20pre-publish\x20by\x20the\x20AB7-C1\x20shape\x20gate\x20(recipient\x20!=\x20anchor)\x20and\x20allocator\x20planning;\x20mainnet\x200x1dcf3f3a\x20(0.01\x20frozen,\x20no\x20exit)\x20stands\x20as\x20the\x20accepted\x20cost\x20of\x20the\x20discipline'],'findings':['F-BS-32'],'sources':[{'file':'allocation.move','line':0x78,'pattern':'pool-drain\x20primitive\x20REJECTED'},{'file':'service.move','line':0x6b3,'pattern':'NO\x20drain\x20entry\x20exists'}]},'exit_compensation':{'kind':'exit','summary':'Escrow\x20exit\x202\x20(arbitration\x20indemnity):\x20service\x20compensation_fund\x20pays\x20order\x20owner\x20directly.','path':['service\x20compensation\x20claim\x20(service.move:516;\x20arbitrations\x20whitelist\x20+\x20E33\x20conflict\x20check\x20at\x20:525-527)','arbitration.compensate\x20->\x20order.compensate\x20writes\x20claimed_by','compensation_fund\x20split\x20->\x20public_transfer\x20to\x20order.owner\x20(service.move:541)'],'invariants':['order\x20must\x20not\x20be\x20already\x20claimed\x20(E_ORDER_ALREADY_CLAIMED)','claiming\x20arbitration\x20must\x20be\x20in\x20service.arbitrations\x20whitelist'],'sources':[{'file':'service.move','line':0x243,'pattern':'compensation_claim'},{'file':'service.move','line':0x25c,'pattern':'order::owner(order)'},{'file':'order.move','line':0x72,'pattern':'public(package)\x20fun\x20compensate'}]},'dual_rail_fact':{'kind':'fact','summary':'A-3\x20dual\x20rail:\x20alloc\x20never\x20reads\x20claimed_by;\x20compensate\x20never\x20touches\x20the\x20escrow\x20balance.','path':['order.move:238-259\x20(deliberate:\x20refund-of-principal\x20+\x20damages\x20in\x20one\x20case\x20is\x20legal)'],'invariants':['Double-pay\x20prevention\x20is\x20delegated\x20to\x20template\x20convention:\x20refund\x20guard\x20MUST\x20assert\x20claimed_by\x20is\x20none','Tool\x20layer\x20MUST\x20enforce\x20this\x20convention\x20via\x20rule\x20DUAL-RAIL-01\x20—\x20the\x20chain\x20will\x20not'],'findings':['A-3'],'sources':[{'file':'order.move','line':0x10c,'pattern':'claimed_by'}]},'order_anchored_refund':{'kind':'fact','summary':'Order-anchored\x20refunds\x20are\x20deliberate:\x20a\x20GuardIdentifier\x20leg\x20on\x20an\x20order\x20escrow\x20pays\x20the\x20Order\x20OBJECT,\x20and\x20the\x20Order\x27s\x20owner-claim\x20entry\x20extracts\x20the\x20CoinWrapper\x20to\x20order.owner.','path':['GuardIdentifier\x20leg\x20asserts\x20its\x20passport-submitted\x20address\x20==\x20payment_info.for_object\x20(allocation.move)','the\x20service\x27s\x20escrow\x20setup\x20binds\x20payment_info.for_object\x20to\x20the\x20paying\x20Order','the\x20payment\x20batch\x20transfer\x20moves\x20the\x20CoinWrapper\x20to\x20the\x20Order\x20address','the\x20Order\x27s\x20owner-claim\x20entry\x20receives\x20into\x20the\x20shared\x20Order\x27s\x20own\x20UID\x20(&mut\x20self.id),\x20then\x20transfers\x20the\x20coin\x20to\x20self.owner'],'invariants':['an\x20object\x20address\x20CAN\x20receive:\x20transfer::public_receive\x20only\x20needs\x20&mut\x20UID\x20of\x20the\x20parent,\x20and\x20a\x20shared\x20object\x20qualifies','authorization\x20and\x20destination\x20are\x20separate:\x20the\x20guard\x20decides\x20who\x20may\x20trigger\x20(order.owner\x20or\x20an\x20agent),\x20the\x20payee\x20is\x20always\x20self.owner','the\x20payee\x20is\x20read\x20at\x20extraction\x20time,\x20so\x20a\x20later\x20ownership\x20change\x20is\x20followed\x20automatically','a\x20mismatched\x20submission\x20aborts\x2015\x20—\x20that\x20is\x20the\x20cross-order\x20redirect\x20guard,\x20not\x20a\x20ban\x20on\x20the\x20shape','step\x202\x20is\x20mandatory:\x20the\x20wrapper\x20stays\x20on\x20the\x20Order\x20until\x20the\x20owner-claim\x20entry\x20runs.\x20Build\x20the\x20Receiving\x20from\x20the\x20wrapper\x27s\x20id/version/digest\x20(alloc\x20tx\x20effects);\x20the\x20RPC\x20owned-objects\x20query\x20hardcodes\x20OwnerKind::Address\x20and\x20returns\x20nothing\x20for\x20object-owned\x20children'],'sources':[{'file':'allocation.move','line':0x26d,'pattern':'ERECIPIENT_NOT_FOR_OBJECT'},{'file':'service.move','line':0x1d3,'pattern':'order_allocation'},{'file':'order.move','line':0x139,'pattern':'owner_receive'}]},'buyer_receive':{'kind':'exit','summary':'Buyer\x20claims\x20inbound\x20funds:\x20order.owner_receive\x20unwraps\x20Payment\x20and\x20transfers\x20coin\x20to\x20owner.','path':['order.owner_receive\x20(order.move:279-283,\x20public_transfer\x20to\x20self.owner)'],'invariants':['only\x20order.owner\x20receives'],'sources':[{'file':'order.move','line':0x13a,'pattern':'owner_receive'}]},'reward_claim':{'kind':'exit','summary':'Reward\x20pool\x20exit\x201\x20(incentive):\x20guard+passport\x20gated\x20claim\x20transfers\x20coin\x20to\x20recipient.','path':['reward.claim\x20(reward.move:216)\x20->\x20coin\x20to\x20recipient\x20(reward.move:327)'],'invariants':['passport\x20must\x20satisfy\x20the\x20matched\x20RewardGuard'],'sources':[{'file':'reward.move','line':0xd8,'pattern':'public\x20fun\x20claim<T>'}]},'reward_withdraw':{'kind':'exit','summary':'Reward\x20pool\x20exit\x202\x20(balance\x20recovery,\x20ETS-B):\x20permission-gated\x20withdraw\x20leaves\x20inside\x20a\x20Payment\x20object\x20receipt.','path':['reward.withdraw[_and_unwrap]\x20(reward.move:721/:728),\x20precheck\x20E_GUARD_LOCKED_TIME\x20(the\x20internal\x20withdrawal\x20lock)','the\x20escrowed\x20coin\x20is\x20wrapped\x20and\x20delivered\x20to\x20the\x20recipient;\x20the\x20reward\x20source\x20is\x20recorded\x20in\x20the\x20payment\x27s\x20source\x20set;\x20payment.create\x20mints\x20the\x20receipt\x20(reward.move:541)','unwrap=true\x20(single\x20PTB):\x20the\x20receipt\x20is\x20unwrapped\x20to\x20the\x20transaction\x20sender\x20in\x20the\x20same\x20transaction\x20(reward.move:566)'],'invariants':['permission\x20index\x20158\x20(REWARD_WITHDRAW)\x20on\x20the\x20Reward\x27s\x20Permission\x20object','blocked\x20while\x20guard_not_added_expiration_time\x20is\x20Some\x20and\x20in\x20the\x20future\x20(E_GUARD_LOCKED_TIME)','claim\x20replay\x20protection\x20(once-slots)\x20is\x20untouched\x20—\x20withdraw\x20never\x20reads\x20recipient\x20records'],'sources':[{'file':'reward.move','line':0x2d1,'pattern':'public\x20fun\x20withdraw<T>'}]},'treasury_flows':{'kind':'internal','summary':'Treasury:\x20deposit/withdraw/guard-driven\x20external\x20flows;\x20owner_receive\x20bypasses\x20outflow\x20counter.','path':['treasury.deposit\x20/\x20withdraw\x20(external_*_guard\x20driven\x20variants)','treasury.owner_receive\x20moves\x20value\x20out\x20WITHOUT\x20touching\x20outflow'],'invariants':['inflow\x20and\x20outflow\x20are\x20u128\x20accumulators;\x20conservation\x20audit\x20must\x20read\x20fields,\x20not\x20events'],'sources':[{'file':'treasury.move','line':0x48,'pattern':'public\x20struct\x20Treasury<phantom\x20T>\x20has\x20key'}]},'discount_burn':{'kind':'fact','summary':'A-4:\x20coupon\x20burned\x20at\x20buy;\x20the\x20burned\x20object\x20leaves\x20only\x20a\x20dead\x20address\x20(F-ES-18\x20event\x20now\x20records\x20the\x20grant).','path':['the\x20discounted\x20quote\x20sets\x20quote.discount=some\x20when\x20benchmark\x20is\x20met\x20(service.move:411)','the\x20buy\x20path\x20destroys\x20the\x20coupon\x20after\x20capturing\x20its\x20semantics\x20(service.move:514)'],'invariants':['Fix\x20(protocol\x20upgrade,\x20body-level):\x20the\x20discounted\x20quote\x20returns\x20discount:none\x20below\x20benchmark','DiscountRedeemedEvent\x20(F-ES-18)\x20is\x20the\x20only\x20on-chain\x20record\x20of\x20what\x20the\x20burned\x20coupon\x20granted'],'findings':['A-4'],'sources':[{'file':'service.move','line':0x1b7,'pattern':'discount'},{'file':'service.move','line':0x21e,'pattern':'discount_destroy'}]},'conservation_gap':{'kind':'fact','summary':'No\x20on-chain\x20conservation\x20check:\x20accumulator_*\x20are\x20private\x20and\x20sender==@0x0\x20is\x20unreachable.','path':[],'invariants':['Conservation\x20(sum\x20in\x20==\x20sum\x20out\x20+\x20balances)\x20MUST\x20be\x20audited\x20by\x20the\x20tool\x20layer\x20post-materialization\x20(A-14)'],'findings':['A-14'],'sources':[{'file':'service.move','line':0x100,'pattern':'compensation_fund:\x20Balance<T>'}]}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export const GUARD_QUERY_SOURCE='ts-sdk/packages/wowok/src/w/call/guard-ins.ts#GUARDQUERY';export const NATIVE_VALIDATION={'entry':'the\x20native\x20guard-data\x20validation\x20call\x20(guard.move:
|
|
1
|
+
export const GUARD_QUERY_SOURCE='ts-sdk/packages/wowok/src/w/call/guard-ins.ts#GUARDQUERY';export const NATIVE_VALIDATION={'entry':'the\x20native\x20guard-data\x20validation\x20call\x20(guard.move:16),\x20invoked\x20at\x20guard.move:326','semantics':['Query\x20on\x20absent\x20object\x20/\x20unset\x20Option\x20/\x20missing\x20collection\x20entry\x20aborts\x20with\x20VM\x20error\x20(e.g.\x20W_FIELD_NOT_FOUND)\x20—\x20the\x20Guard\x20does\x20NOT\x20silently\x20return\x200.\x20Safe\x20failure\x20mode,\x20NOT\x20a\x20null-bypass\x20risk.','Guard.rep\x20flag:\x20false\x20means\x20the\x20queried\x20object\x20or\x20first\x20parameter\x20failed\x20validation.','Empty-value\x20table\x20constant\x20crashes\x20with\x20MovePrimitiveRuntimeError\x20(A-5):\x20vector::borrow(&item.value,0)\x20without\x20length\x20check.'],'sources':[{'file':'guard.move','line':0x10,'pattern':'native\x20fun\x20validate_guard_data'},{'file':'guard.move','line':0x146,'pattern':'validate_guard_data(&table_data,\x20input)'},{'file':'guard.move','line':0x8b,'pattern':'rep:\x20bool'}]};export const PATH_DEPENDENT_TIME_QUERIES=[{'queryPrefix':'progress.current_time','semantics':'Time\x20of\x20ENTERING\x20the\x20current\x20node\x20(progress.move:497),\x20not\x20of\x20any\x20business\x20event.\x20A\x20buyer\x20leaving\x20a\x20review\x20(detour\x20via\x20reviewed\x20node)\x20postpones\x20merchant\x20settlement\x20windows.','findings':['E-10','D-14'],'sources':[{'file':'progress.move','line':0x75,'pattern':'current_time:\x20u64'}]},{'queryPrefix':'progress.session.forward.time','semantics':'Per-forward\x20last-op\x20time\x20inside\x20the\x20current\x20session;\x20also\x20path-local.','findings':['E-10'],'sources':[{'file':'progress.move','line':0x36,'pattern':'time:\x20u64'}]}];export const STABLE_TIME_QUERIES=[{'queryPrefix':'order.time','semantics':'Order\x20creation\x20time\x20(order.move:151).\x20Never\x20moves.\x20Preferred\x20anchor\x20for\x20settlement/refund\x20windows.'}];export const WRITE_ONLY_QUERY_PREFIXES=[{'queryPrefix':'order.required_info','field':'Order.required_info','findings':['A-1','A-10']},{'queryPrefix':'order.claimed_by','field':'Order.claimed_by','findings':['A-3']},{'queryPrefix':'service.repository','field':'Service.repositories','findings':['A-10']},{'queryPrefix':'service.reward','field':'Service.rewards','findings':['A-10']},{'queryPrefix':'service.sale.wip','field':'Sale.wip','findings':['A-10','A-15']},{'queryPrefix':'machine.consensus_repository','field':'Machine.consensus_repositories','findings':['A-10']}];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export const OBJECT_GRAPH={'Sale':{'module':'service','ownership':'value','references':{},'valueFields':{'name':'String','price':'u64','stock':'u64','suspension':'bool','wip':'String\x20//\x20write-only\x20(A-10)','wip_hash':'String\x20//\x20enforced\x20at\x20quote\x20(E_WIP_HASH_NOT_MATCH)'},'notes':'Value\x20type\x20embedded\x20in\x20Service.sales;\x20no\x20independent\x20identity.','source':{'file':'service.move','line':0x90,'pattern':'public\x20struct\x20Sale\x20has\x20store,\x20drop,\x20copy'},'findings':['A-10','A-15']},'Permission':{'module':'permission','ownership':'shared','references':{'um':'Contact?'},'valueFields':{'owner':'address','admin':'vector<address>','description':'String','remark':'vector<PermissionRemark>','table':'ParentLinkedTable<address,\x20vector<u16>>\x20//\x20entity/guard\x20->\x20perm\x20indexes'},'notes':'USER_DEFINED_PERM_INDEX_START=1000\x20enforced\x20at\x20construction;\x20the\x20permission\x20check\x20grants\x20all\x20indexes\x20to\x20admins.','source':{'file':'permission.move','line':0x21,'pattern':'public\x20struct\x20Permission\x20has\x20key'}},'Guard':{'module':'guard','ownership':'shared','references':{'relies':'address[]\x20//\x20any\x20object'},'valueFields':{'description':'String','table':'vector<TableItem>','validated':'vector<TableItemType>','input':'vector<u8>','relies_logic_and':'bool','immutable':'bool','rep':'bool'},'notes':'rep=false\x20means\x20the\x20queried\x20object/first\x20param\x20failed\x20the\x201167\x20query\x20validation.','source':{'file':'guard.move','line':0x6d,'pattern':'public\x20struct\x20Guard\x20has\x20key'}},'Machine':{'module':'machine','ownership':'shared','references':{'consensus_repositories':'Repository[]','um':'Contact?','permission':'Permission'},'valueFields':{'description':'String','nodes':'ParentLinkedTable<String,\x20vector<NodePair>>','bPaused':'bool','bPublished':'bool'},'notes':'Forward\x20=\x20{namedOperator?\x20|\x20permissionIndex?\x20(pre-check,\x20namedOperator\x20first)}\x20+\x20guard?\x20(post-check).\x20permissionIndex>=1000\x20at\x20construction;\x20retained_submission\x20must\x20be\x20subset\x20of\x20guard\x20submissions.\x20namedOperator\x20\x27\x27\x20(empty)\x20=\x20order\x20holder\x20—\x20the\x20open-subscription\x20buyer\x20self-advance\x20standard;\x20\x27\x27\x20may\x20coexist\x20with\x20permissionIndex\x20on\x20one\x20forward\x20(order\x20holder\x20OR\x20permission\x20entity).','source':{'file':'machine.move','line':0x171,'pattern':'public\x20struct\x20Machine\x20has\x20key'}},'Service<T>':{'module':'service','typeParam':'T','ownership':'shared','references':{'repositories':'Repository[]','buy_guard':'Guard?','machine':'Machine?','arbitrations':'Arbitration<T>[]','order_allocators':'Guard\x20(via\x20Allocators.allocators[].guard)','rewards':'Reward<T>[]','um':'Contact?','permission':'Permission'},'valueFields':{'description':'String','location':'String','sales':'vector<Sale>','bPublished':'bool','bPaused':'bool','customer_required':'vector<String>','compensation_fund':'Balance<T>','paused_time':'Option<u64>','setting_lock_duration':'u64'},'notes':'customer_required\x20is\x20write-only,\x20buy\x20path\x20never\x20enforces\x20it\x20(A-1).\x20compensation_fund\x20pays\x20arbitrator\x20indemnity\x20directly\x20to\x20order\x20owner.','source':{'file':'service.move','line':0xf4,'pattern':'public\x20struct\x20Service<phantom\x20T>\x20has\x20key'},'findings':['A-1','A-4','A-9','A-10','A-15']},'Order':{'module':'order','ownership':'shared','references':{'service':'Service<T>','machine':'Machine?','progress':'Progress?','allocation':'Allocation<T>?','discount':'Discount?','claimed_by':'Arb<T>?','required_info':'Contact|Proof?','dispute':'Arb<T>[]','agent':'address[]'},'valueFields':{'items':'vector<SaleItem>','amount':'u64','owner':'address','time':'u64\x20//\x20order\x20creation'},'notes':'claimed_by\x20written\x20by\x20compensate;\x20NOT\x20read\x20by\x20allocation.alloc\x20(dual-rail,\x20A-3\x20deliberate).\x20required_info\x20writable\x20by\x20owner\x20only;\x20the\x20FIELD\x20stays\x20attestation-only\x20(A-1:\x20buy\x20never\x20requires\x20it),\x20but\x20a\x20controlled\x20Proof\x20bind\x20entry\x20(MOV-PROTOCOL-1212\x2011)\x20now\x20chain-enforces\x20proof-about==order\x20&&\x20proof-creator==owner\x20at\x20write\x20time\x20(rejection\x20aborts,\x20nothing\x20written).','source':{'file':'order.move','line':0x3f,'pattern':'public\x20struct\x20Order\x20has\x20key'},'findings':['A-1','A-3','A-10']},'Progress':{'module':'progress','ownership':'shared','references':{'machine':'Machine','task':'Order?','context_repositories':'Repository[]'},'valueFields':{'current':'String','namedOperator':'vector<NamedOperator>','session':'vector<Session>','history':'ParentTableVec<History>','current_time':'u64\x20//\x20TIME\x20OF\x20ENTERING\x20CURRENT\x20NODE,\x20path-dependent\x20(E-10)'},'notes':'current_time\x20refreshes\x20on\x20every\x20node\x20transition;\x20window\x20guards\x20anchored\x20on\x20it\x20are\x20path-dependent.','source':{'file':'progress.move','line':0x6c,'pattern':'public\x20struct\x20Progress\x20has\x20key'},'findings':['E-10','D-14','A-6']},'Allocation<T>':{'module':'allocation','typeParam':'T','ownership':'shared','references':{'allocators.allocators[].guard':'Guard','payment':'Payment<T>[]','payment_info.for_object':'Order\x20(anchor)'},'valueFields':{'balance':'Balance<T>','allocators':'Allocators','payment_info':'Option<PaymentInfo>'},'notes':'alloc\x20runs\x20EVERY\x20allocator\x20whose\x20guard\x20matches;\x20each\x20consumes\x20a\x20once-slot\x20keyed\x20by\x20allocator\x20index;\x20evaluated\x20in\x20vector\x20order\x20against\x20shrinking\x20pool.','source':{'file':'allocation.move','line':0x1e5,'pattern':'public\x20struct\x20Allocation<phantom\x20T>\x20has\x20key'},'findings':['A-3']},'Payment<T>':{'module':'payment','typeParam':'T','ownership':'shared','references':{'info.for_object':'object?','info.for_guard':'Guard?','from_object':'object?'},'valueFields':{'amount':'u64','time':'u64','info':'PaymentInfo','signer':'address','record':'vector<Revenue>'},'source':{'file':'payment.move','line':0x5c,'pattern':'public\x20struct\x20Payment<phantom\x20T>\x20has\x20key'}},'CoinWrapper<T>':{'module':'payment','typeParam':'T','ownership':'owned','references':{'payment':'Payment<T>'},'valueFields':{'balance':'Balance<T>'},'notes':'Transferred\x20to\x20each\x20recipient;\x20unwrap\x20yields\x20Coin<T>.','source':{'file':'payment.move','line':0x27,'pattern':'public\x20struct\x20CoinWrapper<phantom\x20T>\x20has\x20key,\x20store'}},'Arbitration<T>':{'module':'arbitration','typeParam':'T','ownership':'shared','references':{'voting_guard[].guard':'Guard','usage_guard':'Guard?','um':'Contact?','permission':'Permission'},'valueFields':{'description':'String','location':'String','fee':'u64','balance':'Balance<T>','bPaused':'bool'},'notes':'Independent\x20arbitrator\x20=\x20independent\x20account\x20+\x20independent\x20Permission.\x20Empty\x20voting_guard\x20=\x20open\x20voting.','source':{'file':'arbitration.move','line':0x2f,'pattern':'public\x20struct\x20Arbitration<phantom\x20T>\x20has\x20key'}},'Arb<T>':{'module':'arb','typeParam':'T','ownership':'shared','references':{'order':'Order','arbitration':'Arbitration<T>'},'valueFields':{'voted':'vector<Voted>','proposition':'vector<Proposition>','fee':'Balance<T>','feedback':'String','indemnity':'Option<Indemnity>','voting_deadline':'Option<u64>','objection':'String','status':'u8\x20//\x200..6\x20Principal_confirming..Withdrawn','compensation_time':'Option<u64>','time':'u64'},'source':{'file':'arb.move','line':0xb0,'pattern':'public\x20struct\x20Arb<phantom\x20T>\x20has\x20key'}},'Repository':{'module':'repository','ownership':'shared','references':{'policies[].write_guard[].guard':'Guard','policies[].quote_guard':'Guard?','rewards':'Reward<T>[]','um':'Contact?','permission':'Permission'},'valueFields':{'description':'String','policies':'vector<PolicyRule>','data':'ParentTable<DataKey,\x20vector<u8>>'},'notes':'Policies\x20mutable\x20post-share\x20via\x20the\x20permission-guarded\x20policy\x20add/set/remove/clear\x20calls\x20(repository.move:750-769).\x20The\x20passport-based\x20id-data\x20removal\x20call\x20always\x20aborts\x20(A-8).','source':{'file':'repository.move','line':0x212,'pattern':'public\x20struct\x20Repository\x20has\x20key'},'findings':['A-8','A-10']},'Demand':{'module':'demand','ownership':'shared','references':{'rewards':'Reward<T>[]','guards[].guard':'Guard','um':'Contact?','permission':'Permission'},'valueFields':{'description':'String','location':'String','presenters':'ParentTable<address,\x20ServiceInfo>'},'source':{'file':'demand.move','line':0x49,'pattern':'public\x20struct\x20Demand\x20has\x20key'}},'Reward<T>':{'module':'reward','typeParam':'T','ownership':'shared','references':{'guards[].guard':'Guard','um':'Contact?','permission':'Permission'},'valueFields':{'description':'String','balance':'Balance<T>','guard_not_added_expiration_time':'Option<u64>','record':'ParentTable<address,\x20RecipientRecord>'},'source':{'file':'reward.move','line':0xd2,'pattern':'public\x20struct\x20Reward<phantom\x20T>\x20has\x20key'}},'Treasury<T>':{'module':'treasury','typeParam':'T','ownership':'shared','references':{'external_deposit_guard[].guard':'Guard','external_withdraw_guard[].guard':'Guard','um':'Contact?','permission':'Permission'},'valueFields':{'balance':'Balance<T>','history':'ParentTable<address,\x20Record>','inflow':'u128','outflow':'u128'},'notes':'owner_receive\x20moves\x20value\x20out\x20WITHOUT\x20touching\x20outflow;\x20read\x20inflow\x20field,\x20never\x20re-derive\x20from\x20events.','source':{'file':'treasury.move','line':0x48,'pattern':'public\x20struct\x20Treasury<phantom\x20T>\x20has\x20key'}},'Contact':{'module':'contact','ownership':'shared','references':{'permission':'Permission'},'valueFields':{'description':'String','location':'String','ims':'vector<Im>'},'notes':'The\x20contact\x20status-change\x20call\x20has\x20NO\x20permission\x20check;\x20the\x20permission\x20field\x20is\x20never\x20consulted\x20by\x20it\x20(A-16).','source':{'file':'contact.move','line':0x19,'pattern':'public\x20struct\x20Contact\x20has\x20key'},'findings':['A-16']},'Proof':{'module':'proof','ownership':'owned','references':{'about':'object?'},'valueFields':{'description':'String','proof':'String','item_count':'Option<u64>','server_pubkey':'String','server_signature':'String','signer':'address','proof_type':'u64','time':'u64'},'notes':'No\x20share_object\x20in\x20module;\x20owned\x20by\x20creator.\x20Carrier\x20for\x20WTS\x20evidence\x20anchors.','source':{'file':'proof.move','line':0xd,'pattern':'public\x20struct\x20Proof\x20has\x20key'}},'Discount':{'module':'service','ownership':'owned','references':{'service':'Service<T>'},'valueFields':{'name':'String','discount_type':'u8\x20//\x200=rates\x201=minus','benchmark':'Option<u64>','off':'u64','time_start':'u64','time_end':'u64','transferable':'bool'},'notes':'Transferred\x20to\x20buyer.\x20Burned\x20unconditionally\x20at\x20buy\x20even\x20when\x20benchmark\x20unmet\x20(A-4).','source':{'file':'service.move','line':0xb2,'pattern':'public\x20struct\x20Discount\x20has\x20key'},'findings':['A-4']},'Passport':{'module':'passport','ownership':'owned','references':{'guard[].guard':'Guard','guard[].relies':'address[]','impack':'address[]'},'valueFields':{'result':'bool','tx_hash':'vector<u8>','time':'u64','signer':'address','has_verified':'bool'},'notes':'No\x20share_object\x20in\x20module;\x20carried\x20by\x20signer,\x20mutated\x20across\x20guard\x20checks.','source':{'file':'passport.move','line':0x39,'pattern':'public\x20struct\x20Passport\x20has\x20key'}},'EntityOrders':{'module':'entity_order','ownership':'singleton','references':{},'valueFields':{'table':'ParentTable<address,\x20vector<OrderRoleItem>>'},'notes':'Reverse\x20index\x20entity->orders.\x20FIFO\x20eviction\x20at\x205200\x20entries\x20(entity_order.move:72-78)\x20—\x20silent.','source':{'file':'entity_order.move','line':0x1e,'pattern':'public\x20struct\x20EntityOrders\x20has\x20key'},'findings':['A-13']},'EntityPermission':{'module':'entity_permission','ownership':'singleton','references':{},'valueFields':{'table':'ParentTable<address,\x20vector<PermissionItem>>'},'source':{'file':'entity_permission.move','line':0x1e,'pattern':'public\x20struct\x20EntityPermission\x20has\x20key'}},'EntityContact':{'module':'entity_contact','ownership':'singleton','references':{},'valueFields':{'table':'ParentTable<address,\x20vector<ContactItem>>'},'source':{'file':'entity_contact.move','line':0x18,'pattern':'public\x20struct\x20EntityContact\x20has\x20key'}},'ObjectLinkerCore':{'module':'object_linker','ownership':'singleton','references':{},'valueFields':{'table':'ParentTable<address,\x20vector<CoreLink>>\x20//\x20target\x20->\x20core\x20who[],\x20lossless'},'source':{'file':'object_linker.move','line':0x25,'pattern':'public\x20struct\x20ObjectLinkerCore\x20has\x20key'}},'ObjectLinkerTx':{'module':'object_linker','ownership':'singleton','references':{},'valueFields':{'table':'ParentTable<address,\x20TxBuffer>\x20//\x20target\x20->\x20recent\x20tx\x20who[],\x20lossy\x20FIFO'},'source':{'file':'object_linker.move','line':0x2b,'pattern':'public\x20struct\x20ObjectLinkerTx\x20has\x20key'}},'Registrar':{'module':'registrar','ownership':'singleton','references':{},'valueFields':{'table':'ParentTable<address,\x20Votes>\x20//\x20who\x20->\x20likes/dislikes/favors'},'source':{'file':'registrar.move','line':0xb4,'pattern':'public\x20struct\x20Registrar\x20has\x20key'}},'Entity':{'module':'registrar','ownership':'singleton','references':{},'valueFields':{'table':'ParentTable<address,\x20AddressInfo>'},'source':{'file':'registrar.move','line':0xb9,'pattern':'public\x20struct\x20Entity\x20has\x20key'}},'Messenger':{'module':'registrar','ownership':'singleton','references':{},'valueFields':{'table':'ParentTable<String,\x20PubKeyData>'},'notes':'DEAD:\x20struct\x20declared\x20but\x20share_object\x20commented\x20out\x20(registrar.move:209-212).\x20No\x20on-chain\x20Messenger\x20(A-16).','source':{'file':'registrar.move','line':0x278,'pattern':'public\x20struct\x20Messenger\x20has\x20key'},'findings':['A-16']},'Resource':{'module':'resource','ownership':'shared','references':{},'valueFields':{'table':'ParentTable<address,\x20AddressTag>'},'source':{'file':'resource.move','line':0x11,'pattern':'public\x20struct\x20Resource\x20has\x20key'}}};
|
|
1
|
+
export const OBJECT_GRAPH={'Sale':{'module':'service','ownership':'value','references':{},'valueFields':{'name':'String','price':'u64','stock':'u64','suspension':'bool','wip':'String\x20//\x20write-only\x20(A-10)','wip_hash':'String\x20//\x20enforced\x20at\x20quote\x20(E_WIP_HASH_NOT_MATCH)'},'notes':'Value\x20type\x20embedded\x20in\x20Service.sales;\x20no\x20independent\x20identity.','source':{'file':'service.move','line':0x90,'pattern':'public\x20struct\x20Sale\x20has\x20store,\x20drop,\x20copy'},'findings':['A-10','A-15']},'Permission':{'module':'permission','ownership':'shared','references':{'um':'Contact?'},'valueFields':{'owner':'address','admin':'vector<address>','description':'String','remark':'vector<PermissionRemark>','table':'ParentLinkedTable<address,\x20vector<u16>>\x20//\x20entity/guard\x20->\x20perm\x20indexes'},'notes':'USER_DEFINED_PERM_INDEX_START=1000\x20enforced\x20at\x20construction;\x20the\x20permission\x20check\x20grants\x20all\x20indexes\x20to\x20admins.','source':{'file':'permission.move','line':0x21,'pattern':'public\x20struct\x20Permission\x20has\x20key'}},'Guard':{'module':'guard','ownership':'shared','references':{'relies':'address[]\x20//\x20any\x20object'},'valueFields':{'description':'String','table':'vector<TableItem>','validated':'vector<TableItemType>','input':'vector<u8>','relies_logic_and':'bool','immutable':'bool','rep':'bool'},'notes':'rep=false\x20means\x20the\x20queried\x20object/first\x20param\x20failed\x20the\x201167\x20query\x20validation.','source':{'file':'guard.move','line':0x7d,'pattern':'public\x20struct\x20Guard\x20has\x20key'}},'Machine':{'module':'machine','ownership':'shared','references':{'consensus_repositories':'Repository[]','um':'Contact?','permission':'Permission'},'valueFields':{'description':'String','nodes':'ParentLinkedTable<String,\x20vector<NodePair>>','bPaused':'bool','bPublished':'bool'},'notes':'Forward\x20=\x20{namedOperator?\x20|\x20permissionIndex?\x20(pre-check,\x20namedOperator\x20first)}\x20+\x20guard?\x20(post-check).\x20permissionIndex>=1000\x20at\x20construction;\x20retained_submission\x20must\x20be\x20subset\x20of\x20guard\x20submissions.\x20namedOperator\x20\x27\x27\x20(empty)\x20=\x20order\x20holder\x20—\x20the\x20open-subscription\x20buyer\x20self-advance\x20standard;\x20\x27\x27\x20may\x20coexist\x20with\x20permissionIndex\x20on\x20one\x20forward\x20(order\x20holder\x20OR\x20permission\x20entity).','source':{'file':'machine.move','line':0x171,'pattern':'public\x20struct\x20Machine\x20has\x20key'}},'Service<T>':{'module':'service','typeParam':'T','ownership':'shared','references':{'repositories':'Repository[]','buy_guard':'Guard?','machine':'Machine?','arbitrations':'Arbitration<T>[]','order_allocators':'Guard\x20(via\x20Allocators.allocators[].guard)','rewards':'Reward<T>[]','um':'Contact?','permission':'Permission'},'valueFields':{'description':'String','location':'String','sales':'vector<Sale>','bPublished':'bool','bPaused':'bool','customer_required':'vector<String>','compensation_fund':'Balance<T>','paused_time':'Option<u64>','setting_lock_duration':'u64'},'notes':'customer_required\x20is\x20write-only,\x20buy\x20path\x20never\x20enforces\x20it\x20(A-1).\x20compensation_fund\x20pays\x20arbitrator\x20indemnity\x20directly\x20to\x20order\x20owner.','source':{'file':'service.move','line':0xf4,'pattern':'public\x20struct\x20Service<phantom\x20T>\x20has\x20key'},'findings':['A-1','A-4','A-9','A-10','A-15']},'Order':{'module':'order','ownership':'shared','references':{'service':'Service<T>','machine':'Machine?','progress':'Progress?','allocation':'Allocation<T>?','discount':'Discount?','claimed_by':'Arb<T>?','required_info':'Contact|Proof?','dispute':'Arb<T>[]','agent':'address[]'},'valueFields':{'items':'vector<SaleItem>','amount':'u64','owner':'address','time':'u64\x20//\x20order\x20creation'},'notes':'claimed_by\x20written\x20by\x20compensate;\x20NOT\x20read\x20by\x20allocation.alloc\x20(dual-rail,\x20A-3\x20deliberate).\x20required_info\x20writable\x20by\x20owner\x20only;\x20the\x20FIELD\x20stays\x20attestation-only\x20(A-1:\x20buy\x20never\x20requires\x20it),\x20but\x20a\x20controlled\x20Proof\x20bind\x20entry\x20(MOV-PROTOCOL-1212\x2011)\x20now\x20chain-enforces\x20proof-about==order\x20&&\x20proof-creator==owner\x20at\x20write\x20time\x20(rejection\x20aborts,\x20nothing\x20written).','source':{'file':'order.move','line':0x3f,'pattern':'public\x20struct\x20Order\x20has\x20key'},'findings':['A-1','A-3','A-10']},'Progress':{'module':'progress','ownership':'shared','references':{'machine':'Machine','task':'Order?','context_repositories':'Repository[]'},'valueFields':{'current':'String','namedOperator':'vector<NamedOperator>','session':'vector<Session>','history':'ParentTableVec<History>','current_time':'u64\x20//\x20TIME\x20OF\x20ENTERING\x20CURRENT\x20NODE,\x20path-dependent\x20(E-10)'},'notes':'current_time\x20refreshes\x20on\x20every\x20node\x20transition;\x20window\x20guards\x20anchored\x20on\x20it\x20are\x20path-dependent.','source':{'file':'progress.move','line':0x6c,'pattern':'public\x20struct\x20Progress\x20has\x20key'},'findings':['E-10','D-14','A-6']},'Allocation<T>':{'module':'allocation','typeParam':'T','ownership':'shared','references':{'allocators.allocators[].guard':'Guard','payment':'Payment<T>[]','payment_info.for_object':'Order\x20(anchor)'},'valueFields':{'balance':'Balance<T>','allocators':'Allocators','payment_info':'Option<PaymentInfo>'},'notes':'alloc\x20runs\x20EVERY\x20allocator\x20whose\x20guard\x20matches;\x20each\x20consumes\x20a\x20once-slot\x20keyed\x20by\x20allocator\x20index;\x20evaluated\x20in\x20vector\x20order\x20against\x20shrinking\x20pool.','source':{'file':'allocation.move','line':0x1e5,'pattern':'public\x20struct\x20Allocation<phantom\x20T>\x20has\x20key'},'findings':['A-3']},'Payment<T>':{'module':'payment','typeParam':'T','ownership':'shared','references':{'info.for_object':'object?','info.for_guard':'Guard?','from_object':'object?'},'valueFields':{'amount':'u64','time':'u64','info':'PaymentInfo','signer':'address','record':'vector<Revenue>'},'source':{'file':'payment.move','line':0x5c,'pattern':'public\x20struct\x20Payment<phantom\x20T>\x20has\x20key'}},'CoinWrapper<T>':{'module':'payment','typeParam':'T','ownership':'owned','references':{'payment':'Payment<T>'},'valueFields':{'balance':'Balance<T>'},'notes':'Transferred\x20to\x20each\x20recipient;\x20unwrap\x20yields\x20Coin<T>.','source':{'file':'payment.move','line':0x27,'pattern':'public\x20struct\x20CoinWrapper<phantom\x20T>\x20has\x20key,\x20store'}},'Arbitration<T>':{'module':'arbitration','typeParam':'T','ownership':'shared','references':{'voting_guard[].guard':'Guard','usage_guard':'Guard?','um':'Contact?','permission':'Permission'},'valueFields':{'description':'String','location':'String','fee':'u64','balance':'Balance<T>','bPaused':'bool'},'notes':'Independent\x20arbitrator\x20=\x20independent\x20account\x20+\x20independent\x20Permission.\x20Empty\x20voting_guard\x20=\x20open\x20voting.','source':{'file':'arbitration.move','line':0x2f,'pattern':'public\x20struct\x20Arbitration<phantom\x20T>\x20has\x20key'}},'Arb<T>':{'module':'arb','typeParam':'T','ownership':'shared','references':{'order':'Order','arbitration':'Arbitration<T>'},'valueFields':{'voted':'vector<Voted>','proposition':'vector<Proposition>','fee':'Balance<T>','feedback':'String','indemnity':'Option<Indemnity>','voting_deadline':'Option<u64>','objection':'String','status':'u8\x20//\x200..6\x20Principal_confirming..Withdrawn','compensation_time':'Option<u64>','time':'u64'},'source':{'file':'arb.move','line':0xb0,'pattern':'public\x20struct\x20Arb<phantom\x20T>\x20has\x20key'}},'Repository':{'module':'repository','ownership':'shared','references':{'policies[].write_guard[].guard':'Guard','policies[].quote_guard':'Guard?','rewards':'Reward<T>[]','um':'Contact?','permission':'Permission'},'valueFields':{'description':'String','policies':'vector<PolicyRule>','data':'ParentTable<DataKey,\x20vector<u8>>'},'notes':'Policies\x20mutable\x20post-share\x20via\x20the\x20permission-guarded\x20policy\x20add/set/remove/clear\x20calls\x20(repository.move:750-769).\x20The\x20passport-based\x20id-data\x20removal\x20call\x20always\x20aborts\x20(A-8).','source':{'file':'repository.move','line':0x212,'pattern':'public\x20struct\x20Repository\x20has\x20key'},'findings':['A-8','A-10']},'Demand':{'module':'demand','ownership':'shared','references':{'rewards':'Reward<T>[]','guards[].guard':'Guard','um':'Contact?','permission':'Permission'},'valueFields':{'description':'String','location':'String','presenters':'ParentTable<address,\x20ServiceInfo>'},'source':{'file':'demand.move','line':0x49,'pattern':'public\x20struct\x20Demand\x20has\x20key'}},'Reward<T>':{'module':'reward','typeParam':'T','ownership':'shared','references':{'guards[].guard':'Guard','um':'Contact?','permission':'Permission'},'valueFields':{'description':'String','balance':'Balance<T>','guard_not_added_expiration_time':'Option<u64>','record':'ParentTable<address,\x20RecipientRecord>'},'source':{'file':'reward.move','line':0xd2,'pattern':'public\x20struct\x20Reward<phantom\x20T>\x20has\x20key'}},'Treasury<T>':{'module':'treasury','typeParam':'T','ownership':'shared','references':{'external_deposit_guard[].guard':'Guard','external_withdraw_guard[].guard':'Guard','um':'Contact?','permission':'Permission'},'valueFields':{'balance':'Balance<T>','history':'ParentTable<address,\x20Record>','inflow':'u128','outflow':'u128'},'notes':'owner_receive\x20moves\x20value\x20out\x20WITHOUT\x20touching\x20outflow;\x20read\x20inflow\x20field,\x20never\x20re-derive\x20from\x20events.','source':{'file':'treasury.move','line':0x48,'pattern':'public\x20struct\x20Treasury<phantom\x20T>\x20has\x20key'}},'Contact':{'module':'contact','ownership':'shared','references':{'permission':'Permission'},'valueFields':{'description':'String','location':'String','ims':'vector<Im>'},'notes':'The\x20contact\x20status-change\x20call\x20has\x20NO\x20permission\x20check;\x20the\x20permission\x20field\x20is\x20never\x20consulted\x20by\x20it\x20(A-16).','source':{'file':'contact.move','line':0x19,'pattern':'public\x20struct\x20Contact\x20has\x20key'},'findings':['A-16']},'Proof':{'module':'proof','ownership':'owned','references':{'about':'object?'},'valueFields':{'description':'String','proof':'String','item_count':'Option<u64>','server_pubkey':'String','server_signature':'String','signer':'address','proof_type':'u64','time':'u64'},'notes':'No\x20share_object\x20in\x20module;\x20owned\x20by\x20creator.\x20Carrier\x20for\x20WTS\x20evidence\x20anchors.','source':{'file':'proof.move','line':0xd,'pattern':'public\x20struct\x20Proof\x20has\x20key'}},'Discount':{'module':'service','ownership':'owned','references':{'service':'Service<T>'},'valueFields':{'name':'String','discount_type':'u8\x20//\x200=rates\x201=minus','benchmark':'Option<u64>','off':'u64','time_start':'u64','time_end':'u64','transferable':'bool'},'notes':'Transferred\x20to\x20buyer.\x20Burned\x20unconditionally\x20at\x20buy\x20even\x20when\x20benchmark\x20unmet\x20(A-4).','source':{'file':'service.move','line':0xb2,'pattern':'public\x20struct\x20Discount\x20has\x20key'},'findings':['A-4']},'Passport':{'module':'passport','ownership':'owned','references':{'guard[].guard':'Guard','guard[].relies':'address[]','impack':'address[]'},'valueFields':{'result':'bool','tx_hash':'vector<u8>','time':'u64','signer':'address','has_verified':'bool'},'notes':'No\x20share_object\x20in\x20module;\x20carried\x20by\x20signer,\x20mutated\x20across\x20guard\x20checks.','source':{'file':'passport.move','line':0x39,'pattern':'public\x20struct\x20Passport\x20has\x20key'}},'EntityOrders':{'module':'entity_order','ownership':'singleton','references':{},'valueFields':{'table':'ParentTable<address,\x20vector<OrderRoleItem>>'},'notes':'Reverse\x20index\x20entity->orders.\x20FIFO\x20eviction\x20at\x205200\x20entries\x20(entity_order.move:72-78)\x20—\x20silent.','source':{'file':'entity_order.move','line':0x1e,'pattern':'public\x20struct\x20EntityOrders\x20has\x20key'},'findings':['A-13']},'EntityPermission':{'module':'entity_permission','ownership':'singleton','references':{},'valueFields':{'table':'ParentTable<address,\x20vector<PermissionItem>>'},'source':{'file':'entity_permission.move','line':0x1e,'pattern':'public\x20struct\x20EntityPermission\x20has\x20key'}},'EntityContact':{'module':'entity_contact','ownership':'singleton','references':{},'valueFields':{'table':'ParentTable<address,\x20vector<ContactItem>>'},'source':{'file':'entity_contact.move','line':0x18,'pattern':'public\x20struct\x20EntityContact\x20has\x20key'}},'ObjectLinkerCore':{'module':'object_linker','ownership':'singleton','references':{},'valueFields':{'table':'ParentTable<address,\x20vector<CoreLink>>\x20//\x20target\x20->\x20core\x20who[],\x20lossless'},'source':{'file':'object_linker.move','line':0x25,'pattern':'public\x20struct\x20ObjectLinkerCore\x20has\x20key'}},'ObjectLinkerTx':{'module':'object_linker','ownership':'singleton','references':{},'valueFields':{'table':'ParentTable<address,\x20TxBuffer>\x20//\x20target\x20->\x20recent\x20tx\x20who[],\x20lossy\x20FIFO'},'source':{'file':'object_linker.move','line':0x2b,'pattern':'public\x20struct\x20ObjectLinkerTx\x20has\x20key'}},'Registrar':{'module':'registrar','ownership':'singleton','references':{},'valueFields':{'table':'ParentTable<address,\x20Votes>\x20//\x20who\x20->\x20likes/dislikes/favors'},'source':{'file':'registrar.move','line':0xb4,'pattern':'public\x20struct\x20Registrar\x20has\x20key'}},'Entity':{'module':'registrar','ownership':'singleton','references':{},'valueFields':{'table':'ParentTable<address,\x20AddressInfo>'},'source':{'file':'registrar.move','line':0xb9,'pattern':'public\x20struct\x20Entity\x20has\x20key'}},'Messenger':{'module':'registrar','ownership':'singleton','references':{},'valueFields':{'table':'ParentTable<String,\x20PubKeyData>'},'notes':'DEAD:\x20struct\x20declared\x20but\x20share_object\x20commented\x20out\x20(registrar.move:209-212).\x20No\x20on-chain\x20Messenger\x20(A-16).','source':{'file':'registrar.move','line':0x278,'pattern':'public\x20struct\x20Messenger\x20has\x20key'},'findings':['A-16']},'Resource':{'module':'resource','ownership':'shared','references':{},'valueFields':{'table':'ParentTable<address,\x20AddressTag>'},'source':{'file':'resource.move','line':0x11,'pattern':'public\x20struct\x20Resource\x20has\x20key'}}};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export interface MessageGap {
|
|
2
|
+
from_seq: number;
|
|
3
|
+
to_seq: number;
|
|
4
|
+
missing_count: number;
|
|
5
|
+
reason: string;
|
|
6
|
+
}
|
|
7
|
+
export interface IncrementalMessagePage<T> {
|
|
8
|
+
messages: T[];
|
|
9
|
+
after: number;
|
|
10
|
+
highest_seq: number | null;
|
|
11
|
+
latest_seq: number | null;
|
|
12
|
+
has_more: boolean;
|
|
13
|
+
gap: MessageGap | null;
|
|
14
|
+
degraded: boolean;
|
|
15
|
+
degraded_reasons: string[];
|
|
16
|
+
}
|
|
17
|
+
export declare function pageMessagesBySeq<T extends {
|
|
18
|
+
leafIndex?: number;
|
|
19
|
+
}>(messages: readonly T[], after: number, limit: number, opts?: {
|
|
20
|
+
scanTruncated?: boolean;
|
|
21
|
+
}): IncrementalMessagePage<T>;
|
|
22
|
+
export declare const PEER_RECEIPT_DISCLOSURE: string;
|
|
23
|
+
export interface ConversationReadReceipt {
|
|
24
|
+
account: string;
|
|
25
|
+
peer: string;
|
|
26
|
+
read_through_seq: number | null;
|
|
27
|
+
read_at: number | null;
|
|
28
|
+
peer_read_through_seq: null;
|
|
29
|
+
peer_receipt_available: false;
|
|
30
|
+
scope: "local-session";
|
|
31
|
+
disclosure: string;
|
|
32
|
+
}
|
|
33
|
+
export declare function recordConversationRead(account: string, peer: string, seq: number | null | undefined, at?: number): ConversationReadReceipt;
|
|
34
|
+
export declare function getConversationReadReceipt(account: string, peer: string): ConversationReadReceipt;
|
|
35
|
+
export declare function resetReadWatermarks(): void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const GAP_REASON='sequence\x20discontinuity:\x20the\x20messages\x20in\x20this\x20range\x20are\x20not\x20retained\x20locally\x20(pruned,\x20never\x20fetched,\x20or\x20fetched\x20under\x20another\x20account)\x20—\x20continuity\x20cannot\x20be\x20proven';export function pageMessagesBySeq(a,b,c,d){const e=Math['max'](0x1,Math['min'](0x3e8,Math['floor'](c)||0x1)),f=[];for(const q of a){const r=q?.['leafIndex'];typeof r==='number'&&Number['isFinite'](r)&&f['push']({'message':q,'seq':r});}f['sort']((s,t)=>s['seq']-t['seq']);const g=a['length']-f['length'],h=f['filter'](s=>s['seq']>b),i=h['slice'](0x0,e),j=[];let k=null,l=0x0,m=null,n=b;for(const s of i){if(s['seq']!==n+0x1){const t=n+0x1,u=s['seq']-0x1;l+=u-t+0x1;if(!m)m={'from':t,'to':u};}n=s['seq'];}m&&(k={'from_seq':m['from'],'to_seq':m['to'],'missing_count':l,'reason':GAP_REASON},j['push']('missing\x20message\x20sequence\x20'+m['from']+'..'+m['to']+'\x20('+l+'\x20total\x20in\x20this\x20page)\x20—\x20the\x20result\x20is\x20degraded,\x20not\x20a\x20continuous\x20stream'));g>0x0&&j['push'](g+'\x20message(s)\x20in\x20this\x20conversation\x20carry\x20no\x20server\x20sequence\x20yet\x20(pending/unconfirmed)\x20—\x20they\x20cannot\x20be\x20addressed\x20by\x20`after`\x20and\x20are\x20excluded\x20from\x20the\x20cursor');d?.['scanTruncated']&&j['push']('local\x20conversation\x20scan\x20was\x20truncated,\x20so\x20gap\x20detection\x20only\x20covers\x20the\x20scanned\x20window');const o=i['length']>0x0?i[i['length']-0x1]['seq']:null,p=f['length']>0x0?f[f['length']-0x1]['seq']:null;return{'messages':i['map'](v=>v['message']),'after':b,'highest_seq':o,'latest_seq':p,'has_more':h['length']>i['length'],'gap':k,'degraded':j['length']>0x0,'degraded_reasons':j};}export const PEER_RECEIPT_DISCLOSURE='Peer\x20read\x20state\x20is\x20UNAVAILABLE:\x20the\x20messenger\x20network\x20exposes\x20no\x20read-receipt\x20primitive.\x20'+'`queryMessageStatus`\x20reports\x20server\x20confirmation\x20(pending/confirmed)\x20only,\x20and\x20`ack`\x20deletes\x20the\x20'+'ciphertext\x20after\x20the\x20recipient\x20processes\x20it\x20—\x20neither\x20is\x20a\x20peer-visible\x20read\x20event.\x20`viewedAt`\x20is\x20'+'written\x20to\x20local\x20storage\x20only.\x20peer_read_through_seq\x20is\x20therefore\x20null\x20BY\x20DESIGN:\x20do\x20not\x20present\x20'+'this\x20conversation\x20as\x20delivered\x20or\x20read\x20by\x20the\x20peer.';const watermarks=new Map();function watermarkKey(a,b){return a['trim']()['toLowerCase']()+'::'+b['trim']()['toLowerCase']();}function buildReceipt(a,b,c){return{'account':a,'peer':b,'read_through_seq':c?c['seq']:null,'read_at':c?c['at']:null,'peer_read_through_seq':null,'peer_receipt_available':![],'scope':'local-session','disclosure':PEER_RECEIPT_DISCLOSURE};}export function recordConversationRead(a,b,c,d=Date['now']()){const e=watermarkKey(a,b),f=watermarks['get'](e);if(typeof c==='number'&&Number['isFinite'](c)){const g=Math['max'](0x0,Math['floor'](c));(!f||g>f['seq'])&&watermarks['set'](e,{'seq':g,'at':d});}return buildReceipt(a,b,watermarks['get'](e));}export function getConversationReadReceipt(a,b){return buildReceipt(a,b,watermarks['get'](watermarkKey(a,b)));}export function resetReadWatermarks(){watermarks['clear']();}
|
|
@@ -32,3 +32,8 @@ export interface AnchorCrossCheck {
|
|
|
32
32
|
}
|
|
33
33
|
export declare function checkWtsProofAnchor(doc: unknown, anchor: ProofAnchor): AnchorCrossCheck;
|
|
34
34
|
export declare function readWtsDocument(wtsFilePath: string): Promise<unknown | undefined>;
|
|
35
|
+
export interface WtsSealedAvailability {
|
|
36
|
+
sealed_available: boolean | null;
|
|
37
|
+
sealed_available_note: string | null;
|
|
38
|
+
}
|
|
39
|
+
export declare function evaluateWtsSealedAvailability(probe: unknown): WtsSealedAvailability;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{readFile}from'node:fs/promises';import{verifyFalcon512Signature}from'@wowok/wowok/w/messenger/crypto.js';function resolveServerPublicKey(a,b){const c=Array['isArray'](b?.['serverPublicKeys'])?b['serverPublicKeys']:undefined,d=a?.['serverPublicKeyIndex'];if(c&&typeof d==='number'&&d>=0x0&&d<c['length']){const f=c[d],g=typeof f==='string'?f:f?.['publicKey'];if(typeof g==='string'&&g)return g;}const e=a?.['serverPublicKey'];return typeof e==='string'&&e?e:null;}export function attestWtsDocument(a){const b=a,c=b?.['meta'],d=Array['isArray'](b?.['payload']?.['messages'])?b['payload']['messages']:undefined;if(!c||!d)return undefined;const e=[];let f=0x0;for(const m of d){const n=m??{},o=typeof n['leafIndex']==='number'?n['leafIndex']:undefined,p=resolveServerPublicKey(n,c),q=n['serverSignature'];let r;if(typeof q!=='string'||!q)r='unsigned';else{if(!p)r='no_public_key';else{const s=n['prevRoot']+':'+n['merkleRoot']+':'+n['timestamp']+':'+p;r=verifyFalcon512Signature(p,s,q)?'verified':'invalid_signature';}}if(r==='verified')f++;e['push']({'leaf_index':o,'status':r,'server_public_key':p??undefined});}const g=(Array['isArray'](c['serverPublicKeys'])?c['serverPublicKeys']:[])['map'](t=>typeof t==='string'?t:t?.['publicKey'])['filter'](t=>typeof t==='string'&&!!t),h=f===d['length']&&d['length']>0x0,i=e['filter'](t=>t['status']==='invalid_signature')['length'],j=d['length']-f,k=e['filter'](t=>t['status']==='no_public_key')['length'];let l;if(d['length']===0x0)l='WTS\x20packet\x20contains\x20no\x20messages\x20—\x20nothing\x20to\x20attest.';else{if(i>0x0)l='ATTENTION:\x20'+i+'\x20of\x20'+d['length']+'\x20message(s)\x20carry\x20a\x20server\x20signature\x20that\x20does\x20NOT\x20verify\x20—\x20this\x20packet\x20has\x20been\x20altered\x20or\x20signed\x20by\x20a\x20key\x20that\x20is\x20not\x20the\x20messenger\x20server\x27s.\x20Do\x20NOT\x20present\x20it\x20as\x20evidence.';else h?l='Server-attested:\x20all\x20'+d['length']+'\x20message(s)\x20carry\x20a\x20Falcon512\x20signature\x20that\x20verifies\x20against\x20the\x20packet\x27s\x20own\x20server\x20public\x20key.\x20'+'CAVEAT:\x20that\x20key\x20is\x20declared\x20inside\x20this\x20packet\x20(meta.serverPublicKeys)\x20—\x20the\x20signatures\x20prove\x20the\x20packet\x20is\x20SELF-CONSISTENT\x20under\x20a\x20key\x20its\x20'+'author\x20chose,\x20not\x20that\x20this\x20is\x20the\x20messenger\x20service\x27s\x20key.\x20verify_wts\x20closes\x20this\x20gap\x20by\x20cross-checking\x20every\x20key\x20against\x20the\x20server\x27s\x20OFFICIAL\x20'+'key\x20history\x20(rotation-aware:\x20any\x20historical\x20official\x20key\x20whose\x20window\x20covers\x20the\x20message\x27s\x20server\x20timestamp\x20verifies;\x20keys\x20are\x20scored\x20in\x20their\x20'+'home\x20NETWORK\x20partition\x20only);\x20serverKeysOfficial:true\x20in\x20its\x20result\x20is\x20what\x20makes\x20the\x20packet\x20evidence-grade\x20—\x20for\x20the\x20partition\x20named\x20in\x20'+'serverKeysOfficialNetwork.\x20This\x20MCP\x20recount\x20is\x20file-only\x20and\x20stays\x20independent\x20of\x20that\x20check.\x20Anchor\x20it\x20(an\x20on-chain\x20'+'Proof\x20of\x20the\x20last\x20Merkle\x20root)\x20before\x20treating\x20it\x20as\x20third-party-proof\x20evidence.':l='NOT\x20server-attested:\x20'+j+'\x20of\x20'+d['length']+'\x20message(s)\x20carry\x20no\x20verifying\x20server\x20signature'+(k>0x0?'\x20('+k+'\x20of\x20them\x20reference\x20a\x20server\x20key\x20the\x20packet\x20never\x20supplies,\x20so\x20their\x20signature\x20cannot\x20be\x20checked\x20at\x20all)':'')+'.\x20'+'verify_wts\x20REJECTS\x20such\x20packets\x20(valid:false)\x20—\x20its\x20digest\x20covers\x20the\x20payload\x20with\x20no\x20key,\x20so\x20anyone\x20who\x20edits\x20the\x20content\x20can\x20recompute\x20it,\x20'+'and\x20nothing\x20in\x20the\x20packet\x20can\x20substitute\x20for\x20the\x20server\x27s\x20own\x20signature.\x20Treat\x20these\x20messages\x20as\x20the\x20file\x20author\x27s\x20ASSERTION,\x20not\x20as\x20evidence\x20issued\x20by\x20the\x20'+'messenger\x20server,\x20and\x20do\x20not\x20present\x20them\x20as\x20proof\x20to\x20a\x20counterparty\x20or\x20an\x20arbitrator.';}return{'total_messages':d['length'],'attested_count':f,'unattested_count':d['length']-f,'fully_attested':h,'messages':e,'server_public_keys':g,'packet_signed':!!c['signature'],'verdict':l};}export async function attestWtsFile(a){if(typeof a!=='string'||!a)return undefined;try{if(/^https?:\/\//i['test'](a))return undefined;const b=await readFile(a,'utf8');return attestWtsDocument(JSON['parse'](b));}catch{return undefined;}}export function checkWtsProofAnchor(a,b){const c=a,d=Array['isArray'](c?.['payload']?.['messages'])?c['payload']['messages']:[],e=(b['proof']??'')['toLowerCase'](),f=d['filter'](o=>typeof o?.['merkleRoot']==='string'&&o['merkleRoot']['toLowerCase']()===e&&e!=='')['map'](o=>typeof o['leafIndex']==='number'?o['leafIndex']:-0x1),g=[...(Array['isArray'](c?.['meta']?.['serverPublicKeys'])?c['meta']['serverPublicKeys']:[])['map'](o=>typeof o==='string'?o:o?.['publicKey']),...d['map'](o=>o?.['serverPublicKey'])]['filter'](o=>typeof o==='string'&&!!o)['map'](o=>o['toLowerCase']()),h=(b['server_pubkey']??'')['toLowerCase'](),i=!!h&&g['includes'](h),j=typeof b['time']==='string'?Number(b['time']):b['time'],k=c?.['meta']?.['created'],l=typeof k==='number'?k:Date['parse'](String(k??'')),m=Number['isFinite'](j)&&Number['isFinite'](l)?j<=l:null;let n;if(!e)n='Proof\x20carries\x20no\x20root\x20—\x20nothing\x20to\x20anchor.';else f['length']===0x0?n='Proof\x20root\x20'+e['slice'](0x0,0x12)+'…\x20does\x20NOT\x20appear\x20among\x20this\x20packet\x27s\x20'+d['length']+'\x20message\x20root(s)\x20—\x20the\x20packet\x20does\x20not\x20contain\x20what\x20this\x20Proof\x20froze.':n='ANCHORED:\x20the\x20packet\x27s\x20leaf/leaves\x20['+f['join'](',\x20')+']\x20match\x20the\x20root\x20frozen\x20on\x20chain\x20by\x20Proof\x20'+(b['address']??'?')+'\x20(signer\x20'+(b['signer']??'?')+',\x20'+(m===null?'time\x20not\x20comparable':m?'before\x20the\x20packet\x20was\x20written':'AFTER\x20the\x20packet\x27s\x20own\x20creation\x20stamp\x20—\x20the\x20anchor\x20postdates\x20the\x20content\x20it\x20attests')+').\x20'+(i?'The\x20Proof\x27s\x20server\x20key\x20is\x20the\x20same\x20key\x20the\x20packet\x20attests\x20under,\x20so\x20this\x20segment\x20cannot\x20have\x20been\x20re-fabricated\x20after\x20anchoring.':'WARNING:\x20the\x20Proof\x27s\x20server\x20key\x20differs\x20from\x20the\x20key(s)\x20the\x20packet\x20declares\x20—\x20the\x20anchor\x20and\x20the\x20packet\x20do\x20not\x20share\x20an\x20issuer.');return{'root_matched':f['length']>0x0,'matched_leaf_indices':f,'key_matched':i,'anchored_before_packet':m,'verdict':n};}export async function readWtsDocument(a){if(typeof a!=='string'||!a)return undefined;if(/^https?:\/\//i['test'](a))return undefined;try{return JSON['parse'](await readFile(a,'utf8'));}catch{return undefined;}}
|
|
1
|
+
import{readFile}from'node:fs/promises';import{verifyFalcon512Signature}from'@wowok/wowok/w/messenger/crypto.js';function resolveServerPublicKey(a,b){const c=Array['isArray'](b?.['serverPublicKeys'])?b['serverPublicKeys']:undefined,d=a?.['serverPublicKeyIndex'];if(c&&typeof d==='number'&&d>=0x0&&d<c['length']){const f=c[d],g=typeof f==='string'?f:f?.['publicKey'];if(typeof g==='string'&&g)return g;}const e=a?.['serverPublicKey'];return typeof e==='string'&&e?e:null;}export function attestWtsDocument(a){const b=a,c=b?.['meta'],d=Array['isArray'](b?.['payload']?.['messages'])?b['payload']['messages']:undefined;if(!c||!d)return undefined;const e=[];let f=0x0;for(const m of d){const n=m??{},o=typeof n['leafIndex']==='number'?n['leafIndex']:undefined,p=resolveServerPublicKey(n,c),q=n['serverSignature'];let r;if(typeof q!=='string'||!q)r='unsigned';else{if(!p)r='no_public_key';else{const s=n['prevRoot']+':'+n['merkleRoot']+':'+n['timestamp']+':'+p;r=verifyFalcon512Signature(p,s,q)?'verified':'invalid_signature';}}if(r==='verified')f++;e['push']({'leaf_index':o,'status':r,'server_public_key':p??undefined});}const g=(Array['isArray'](c['serverPublicKeys'])?c['serverPublicKeys']:[])['map'](t=>typeof t==='string'?t:t?.['publicKey'])['filter'](t=>typeof t==='string'&&!!t),h=f===d['length']&&d['length']>0x0,i=e['filter'](t=>t['status']==='invalid_signature')['length'],j=d['length']-f,k=e['filter'](t=>t['status']==='no_public_key')['length'];let l;if(d['length']===0x0)l='WTS\x20packet\x20contains\x20no\x20messages\x20—\x20nothing\x20to\x20attest.';else{if(i>0x0)l='ATTENTION:\x20'+i+'\x20of\x20'+d['length']+'\x20message(s)\x20carry\x20a\x20server\x20signature\x20that\x20does\x20NOT\x20verify\x20—\x20this\x20packet\x20has\x20been\x20altered\x20or\x20signed\x20by\x20a\x20key\x20that\x20is\x20not\x20the\x20messenger\x20server\x27s.\x20Do\x20NOT\x20present\x20it\x20as\x20evidence.';else h?l='Server-attested:\x20all\x20'+d['length']+'\x20message(s)\x20carry\x20a\x20Falcon512\x20signature\x20that\x20verifies\x20against\x20the\x20packet\x27s\x20own\x20server\x20public\x20key.\x20'+'CAVEAT:\x20that\x20key\x20is\x20declared\x20inside\x20this\x20packet\x20(meta.serverPublicKeys)\x20—\x20the\x20signatures\x20prove\x20the\x20packet\x20is\x20SELF-CONSISTENT\x20under\x20a\x20key\x20its\x20'+'author\x20chose,\x20not\x20that\x20this\x20is\x20the\x20messenger\x20service\x27s\x20key.\x20verify_wts\x20closes\x20this\x20gap\x20by\x20cross-checking\x20every\x20key\x20against\x20the\x20server\x27s\x20OFFICIAL\x20'+'key\x20history\x20(rotation-aware:\x20any\x20historical\x20official\x20key\x20whose\x20window\x20covers\x20the\x20message\x27s\x20server\x20timestamp\x20verifies;\x20keys\x20are\x20scored\x20in\x20their\x20'+'home\x20NETWORK\x20partition\x20only);\x20serverKeysOfficial:true\x20in\x20its\x20result\x20is\x20what\x20makes\x20the\x20packet\x20evidence-grade\x20—\x20for\x20the\x20partition\x20named\x20in\x20'+'serverKeysOfficialNetwork.\x20This\x20MCP\x20recount\x20is\x20file-only\x20and\x20stays\x20independent\x20of\x20that\x20check.\x20Anchor\x20it\x20(an\x20on-chain\x20'+'Proof\x20of\x20the\x20last\x20Merkle\x20root)\x20before\x20treating\x20it\x20as\x20third-party-proof\x20evidence.':l='NOT\x20server-attested:\x20'+j+'\x20of\x20'+d['length']+'\x20message(s)\x20carry\x20no\x20verifying\x20server\x20signature'+(k>0x0?'\x20('+k+'\x20of\x20them\x20reference\x20a\x20server\x20key\x20the\x20packet\x20never\x20supplies,\x20so\x20their\x20signature\x20cannot\x20be\x20checked\x20at\x20all)':'')+'.\x20'+'verify_wts\x20REJECTS\x20such\x20packets\x20(valid:false)\x20—\x20its\x20digest\x20covers\x20the\x20payload\x20with\x20no\x20key,\x20so\x20anyone\x20who\x20edits\x20the\x20content\x20can\x20recompute\x20it,\x20'+'and\x20nothing\x20in\x20the\x20packet\x20can\x20substitute\x20for\x20the\x20server\x27s\x20own\x20signature.\x20Treat\x20these\x20messages\x20as\x20the\x20file\x20author\x27s\x20ASSERTION,\x20not\x20as\x20evidence\x20issued\x20by\x20the\x20'+'messenger\x20server,\x20and\x20do\x20not\x20present\x20them\x20as\x20proof\x20to\x20a\x20counterparty\x20or\x20an\x20arbitrator.';}return{'total_messages':d['length'],'attested_count':f,'unattested_count':d['length']-f,'fully_attested':h,'messages':e,'server_public_keys':g,'packet_signed':!!c['signature'],'verdict':l};}export async function attestWtsFile(a){if(typeof a!=='string'||!a)return undefined;try{if(/^https?:\/\//i['test'](a))return undefined;const b=await readFile(a,'utf8');return attestWtsDocument(JSON['parse'](b));}catch{return undefined;}}export function checkWtsProofAnchor(a,b){const c=a,d=Array['isArray'](c?.['payload']?.['messages'])?c['payload']['messages']:[],e=(b['proof']??'')['toLowerCase'](),f=d['filter'](o=>typeof o?.['merkleRoot']==='string'&&o['merkleRoot']['toLowerCase']()===e&&e!=='')['map'](o=>typeof o['leafIndex']==='number'?o['leafIndex']:-0x1),g=[...(Array['isArray'](c?.['meta']?.['serverPublicKeys'])?c['meta']['serverPublicKeys']:[])['map'](o=>typeof o==='string'?o:o?.['publicKey']),...d['map'](o=>o?.['serverPublicKey'])]['filter'](o=>typeof o==='string'&&!!o)['map'](o=>o['toLowerCase']()),h=(b['server_pubkey']??'')['toLowerCase'](),i=!!h&&g['includes'](h),j=typeof b['time']==='string'?Number(b['time']):b['time'],k=c?.['meta']?.['created'],l=typeof k==='number'?k:Date['parse'](String(k??'')),m=Number['isFinite'](j)&&Number['isFinite'](l)?j<=l:null;let n;if(!e)n='Proof\x20carries\x20no\x20root\x20—\x20nothing\x20to\x20anchor.';else f['length']===0x0?n='Proof\x20root\x20'+e['slice'](0x0,0x12)+'…\x20does\x20NOT\x20appear\x20among\x20this\x20packet\x27s\x20'+d['length']+'\x20message\x20root(s)\x20—\x20the\x20packet\x20does\x20not\x20contain\x20what\x20this\x20Proof\x20froze.':n='ANCHORED:\x20the\x20packet\x27s\x20leaf/leaves\x20['+f['join'](',\x20')+']\x20match\x20the\x20root\x20frozen\x20on\x20chain\x20by\x20Proof\x20'+(b['address']??'?')+'\x20(signer\x20'+(b['signer']??'?')+',\x20'+(m===null?'time\x20not\x20comparable':m?'before\x20the\x20packet\x20was\x20written':'AFTER\x20the\x20packet\x27s\x20own\x20creation\x20stamp\x20—\x20the\x20anchor\x20postdates\x20the\x20content\x20it\x20attests')+').\x20'+(i?'The\x20Proof\x27s\x20server\x20key\x20is\x20the\x20same\x20key\x20the\x20packet\x20attests\x20under,\x20so\x20this\x20segment\x20cannot\x20have\x20been\x20re-fabricated\x20after\x20anchoring.':'WARNING:\x20the\x20Proof\x27s\x20server\x20key\x20differs\x20from\x20the\x20key(s)\x20the\x20packet\x20declares\x20—\x20the\x20anchor\x20and\x20the\x20packet\x20do\x20not\x20share\x20an\x20issuer.');return{'root_matched':f['length']>0x0,'matched_leaf_indices':f,'key_matched':i,'anchored_before_packet':m,'verdict':n};}export async function readWtsDocument(a){if(typeof a!=='string'||!a)return undefined;if(/^https?:\/\//i['test'](a))return undefined;try{return JSON['parse'](await readFile(a,'utf8'));}catch{return undefined;}}export function evaluateWtsSealedAvailability(a){const b=a?.['serverKeyAnchor'];if(b&&typeof b['verified']==='boolean'){if(b['verified'])return{'sealed_available':!![],'sealed_available_note':'Evidence\x20tier\x20AVAILABLE:\x20the\x20messenger\x20server\x20key\x20book\x20matches\x20its\x20on-chain\x20anchor,\x20so\x20a\x20packet\x20'+'sealed\x20via\x20sign_wts\x20can\x20verify\x20as\x20third-party-verifiable\x20evidence\x20(pending\x20sign_wts\x20+\x20verify_wts).'};return{'sealed_available':![],'sealed_available_note':'WTS\x20is\x20a\x20private\x20conversation\x20record,\x20NOT\x20third-party-verifiable\x20evidence:\x20the\x20messenger\x20server\x20key\x20book\x20does\x20not\x20'+'match\x20its\x20on-chain\x20anchor\x20(anchor\x20missing\x20or\x20a\x20re-genesis\x20ghost,\x20signer\x20not\x20pinned,\x20or\x20hash\x20mismatch).\x20Sealing\x20via\x20'+'sign_wts\x20cannot\x20promote\x20it\x20in\x20this\x20environment\x20—\x20use\x20proof_message\x20(an\x20on-chain\x20Proof\x20anchor)\x20for\x20anything\x20that\x20must\x20hold\x20chain-side.'};}return{'sealed_available':null,'sealed_available_note':'Evidence-tier\x20pre-check\x20UNVERIFIED:\x20the\x20probe\x20could\x20not\x20score\x20the\x20key-book\x20anchor\x20(probe\x20failed,\x20or\x20the\x20freshly\x20generated\x20'+'packet\x20carried\x20no\x20server-attested\x20messages\x20to\x20check\x20the\x20key\x20book\x20with).\x20The\x20WTS\x20was\x20generated\x20normally;\x20treat\x20the\x20'+'third-party-verifiable\x20tier\x20as\x20UNKNOWN\x20—\x20run\x20sign_wts\x20then\x20verify_wts\x20and\x20read\x20serverKeysOfficial/serverKeyAnchor\x20there.'};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{getJudgmentDoc}from'../config/judgment.js';import{evaluateRuleBook}from'../config/rule-engine.js';import{isPathDependentTimeQuery}from'../chain-semantics/index.js';import{MAX_INDEMNITY_MULTIPLE,TASK_BINDING_SLOT}from'../knowledge/onchain-constants.js';import{numericAmount}from'../knowledge/audit-rules.js';import{createsOf,isRef,refsOf,validatePlan}from'./plan.js';function collectQueries(a,b=[]){if(Array['isArray'](a)){for(const c of a)collectQueries(c,b);}else{if(typeof a==='object'&&a!==null){const d=a;d['type']==='query'&&typeof d['query']==='string'&&b['push']({'query':d['query']});for(const e of Object['values'](d))collectQueries(e,b);}}return b;}function acceptedProgressNodes(a,b){const c=new Map();if(Array['isArray'](b))for(const g of b){if(typeof g==='object'&&g!==null){const h=g;typeof h['identifier']==='number'&&typeof h['value']==='string'&&c['set'](h['identifier'],h['value']);}}const d=i=>{if(typeof i!=='object'||i===null)return undefined;const j=i;if(j['type']==='constant'&&typeof j['value']==='string')return j['value'];if(j['type']==='identifier'&&typeof j['identifier']==='number')return c['get'](j['identifier']);return undefined;},e=[],f=i=>{if(Array['isArray'](i)){for(const n of i)f(n);return;}if(typeof i!=='object'||i===null)return;const j=i,k=Array['isArray'](j['nodes'])?j['nodes']:undefined,l=k?.[0x0]??j['left'],m=k?.[0x1]??j['right'];if(typeof j['type']==='string'&&j['type']['startsWith']('logic')&&typeof l==='object'&&l!==null&&l['type']==='query'&&l['query']==='progress.current'){const o=d(m);if(o!==undefined)e['push'](o);}for(const p of Object['values'](j))f(p);};return f(a),e;}const REPO_WHERE_QUERY_TYPES=new Set(['query_repository_data_count_where','query_repository_data_sum_where','query_repository_data_sum_where_bound','query_repository_data_find_where']);function collectRepoWhereQueries(a,b=[]){if(Array['isArray'](a)){for(const c of a)collectRepoWhereQueries(c,b);}else{if(typeof a==='object'&&a!==null){const d=a;typeof d['type']==='string'&&REPO_WHERE_QUERY_TYPES['has'](d['type'])&&b['push'](d);for(const e of Object['values'](d))collectRepoWhereQueries(e,b);}}return b;}function isRepoDataHasRef(a){if(a['type']==='query'){const c=a['query'];if(typeof c==='string'&&c['trim']()['toLowerCase']()==='repository.data\x20has')return!![];if(c===0x48e||c==='1166')return!![];}const b=a['type'];return typeof b==='string'&&b['toLowerCase']()==='query_repository_data_has';}function subtreeRefsRepoDataHas(a){if(Array['isArray'](a))return a['some'](subtreeRefsRepoDataHas);if(typeof a!=='object'||a===null)return![];const b=a;if(isRepoDataHasRef(b))return!![];return Object['values'](b)['some'](subtreeRefsRepoDataHas);}function rootNegatesRepoDataHas(a){if(Array['isArray'](a))return a['some'](rootNegatesRepoDataHas);if(typeof a!=='object'||a===null)return![];const b=a;if(b['type']==='logic_not'&&subtreeRefsRepoDataHas(b['node']))return!![];return Object['values'](b)['some'](rootNegatesRepoDataHas);}function staticStringOperand(a,b){if(typeof a!=='object'||a===null)return undefined;const c=a;if(typeof c['identifier']==='number'){const d=b['find'](e=>typeof e==='object'&&e!==null&&e['identifier']===c['identifier']);if(d===undefined||d['b_submission']===!![])return undefined;return typeof d['value']==='string'?d['value']:undefined;}return typeof c['value']==='string'?c['value']:undefined;}function isPlanLocalObjectOperand(a,b){if(typeof a!=='object'||a===null)return![];const c=a;if(typeof c['identifier']!=='number')return![];const d=b['find'](f=>typeof f==='object'&&f!==null&&f['identifier']===c['identifier']);if(d===undefined||d['b_submission']===!![])return![];const e=d['value'];if(typeof e==='object'&&e!==null)return!![];return typeof e==='string'&&e['startsWith']('$');}const REACH_GREATER_TYPES={'logic_as_u256_greater':'gt','logic_as_u256_greater_or_equal':'ge'},REACH_LESSER_TYPES={'logic_as_u256_lesser':'lt','logic_as_u256_lesser_or_equal':'le'},REACH_EQUAL_TYPES=new Set(['logic_as_u256_equal','logic_equal']);function reachChannel(a){if(a['type']==='context'&&typeof a['context']==='string')return'context:'+a['context'];const b=a['query'];if(a['type']==='query'&&(typeof b==='string'||typeof b==='number'))return'query:'+String(b)['trim']()['toLowerCase']();return undefined;}function reachConstant(a,b){const c=d=>typeof d==='string'||typeof d==='number'||typeof d==='boolean';if(a['type']==='identifier'&&typeof a['identifier']==='number'){const d=b['find'](e=>typeof e==='object'&&e!==null&&e['identifier']===a['identifier']);if(d===undefined||d['b_submission']===!![])return undefined;return c(d['value'])?d['value']:undefined;}if(a['type']==='constant')return c(a['value'])?a['value']:undefined;return undefined;}function flattenAndChain(a,b=[]){if(typeof a!=='object'||a===null)return b;const c=a;if(c['type']==='logic_and'){const d=Array['isArray'](c['nodes'])?c['nodes']:Array['isArray'](c['and'])?c['and']:[];for(const e of d)flattenAndChain(e,b);return b;}return b['push'](c),b;}function reachLegsOf(a){const b=Array['isArray'](a['params']['table'])?a['params']['table']:[],c=a['params']['root']??a['params']['logic'],d={'legs':[],'selfStrict':[]};if(typeof c!=='object'||c===null)return d;for(const e of flattenAndChain(c)){const f=typeof e['type']==='string'?e['type']:'',g=Array['isArray'](e['nodes'])?e['nodes']:undefined;if(g===undefined||g['length']<0x2)continue;const h=REACH_GREATER_TYPES[f],j=REACH_LESSER_TYPES[f],k=REACH_EQUAL_TYPES['has'](f);if(h===undefined&&j===undefined&&!k)continue;const l=g[0x0];if(typeof l!=='object'||l===null)continue;const m=reachChannel(l),n=reachConstant(l,b);for(let o=0x1;o<g['length'];o++){const p=g[o];if(typeof p!=='object'||p===null)continue;const q=reachConstant(p,b),r=reachChannel(p);if(m!==undefined&&q!==undefined)d['legs']['push']({'channel':m,'dir':k?'eq':h??j,'constant':q});else{if(r!==undefined&&n!==undefined){const s=k?'eq':h!==undefined?h==='gt'?'lt':'le':j==='lt'?'gt':'ge';d['legs']['push']({'channel':r,'dir':s,'constant':n});}else m!==undefined&&r!==undefined&&(m===r&&(h==='gt'||j==='lt')&&d['selfStrict']['push']({'channel':m,'dir':h==='gt'?'gt':'lt'}));}}}return d;}function reachNumeric(a){if(typeof a==='number')return Number['isFinite'](a)?a:undefined;if(typeof a==='string'&&a['trim']()!==''&&!Number['isNaN'](Number(a)))return Number(a);return undefined;}function findReachContradictions(c,f,g=[]){const h=[];for(const l of g){h['push']('guard\x20\x27'+c+'\x27\x20('+l['channel']+'):\x20'+(l['dir']==='gt'?'>':'<')+'\x20itself\x20—\x20'+'unsatisfiable\x20(same-binding\x20self-comparison)');}const k=new Map();for(const m of f){const n=k['get'](m['channel'])??[];n['push'](m),k['set'](m['channel'],n);}for(const [o,p]of k){const q=p['filter'](v=>v['dir']==='gt'||v['dir']==='ge'),r=p['filter'](v=>v['dir']==='lt'||v['dir']==='le');for(const v of q){const w=reachNumeric(v['constant']);if(w===undefined)continue;for(const x of r){const y=reachNumeric(x['constant']);if(y===undefined)continue;(w>y||w===y&&(v['dir']==='gt'||x['dir']==='lt'))&&h['push']('guard\x20\x27'+c+'\x27\x20('+o+'):\x20'+(v['dir']==='gt'?'>':'>=')+'\x20'+String(v['constant'])+'\x20'+('contradicts\x20'+(x['dir']==='lt'?'<':'<=')+'\x20'+String(x['constant'])+'\x20—\x20unsatisfiable'));}}const t=p['filter'](z=>z['dir']==='eq');for(let z=0x0;z<t['length'];z++){for(let A=z+0x1;A<t['length'];A++){const B=t[z],C=t[A],D=reachNumeric(B['constant']),E=reachNumeric(C['constant']),F=typeof B['constant']==='boolean'&&typeof C['constant']==='boolean'&&B['constant']!==C['constant'],G=D!==undefined&&E!==undefined&&D!==E;(F||G)&&h['push']('guard\x20\x27'+c+'\x27\x20('+o+'):\x20==\x20'+String(B['constant'])+'\x20'+('contradicts\x20==\x20'+String(C['constant'])+'\x20—\x20unsatisfiable'));}}for(const H of t){const I=reachNumeric(H['constant']);if(I===undefined)continue;for(const J of q){J['dir']==='gt'&&reachNumeric(J['constant'])===I&&h['push']('guard\x20\x27'+c+'\x27\x20('+o+'):\x20==\x20'+String(H['constant'])+'\x20'+('contradicts\x20>\x20'+String(J['constant'])+'\x20—\x20unsatisfiable'));}for(const K of r){K['dir']==='lt'&&reachNumeric(K['constant'])===I&&h['push']('guard\x20\x27'+c+'\x27\x20('+o+'):\x20==\x20'+String(H['constant'])+'\x20'+('contradicts\x20<\x20'+String(K['constant'])+'\x20—\x20unsatisfiable'));}}}return h;}function guardProjection(a){const b=a['params']['root']??a['params']['logic'],c=collectQueries(b)['map'](d=>d['query']);return{'stepId':a['id'],'queries':c,'acceptedNodes':acceptedProgressNodes(b,a['params']['table']),'table':Array['isArray'](a['params']['table'])?a['params']['table']:[]};}function allocatorRows(a){const b=[],c=d=>{if(typeof d==='object'&&d!==null&&!Array['isArray'](d)){const e=d;if(Array['isArray'](e['allocators']))d=e['allocators'];}if(!Array['isArray'](d))return;for(const f of d){if(typeof f!=='object'||f===null)continue;const g=f,h=g['guard'],i=g['guard_key'],j=Array['isArray'](g['sharing'])?g['sharing']:[],k=j['map'](l=>typeof l==='object'&&l!==null?l['who']:undefined)['map'](l=>typeof l==='object'&&l!==null?l['GuardIdentifier']:undefined)['filter'](l=>typeof l==='number');b['push']({'track':typeof g['track']==='string'?g['track']:'settlement','guardStep':isRef(h)?h['$ref']:undefined,'guardKey':typeof i==='string'?i:undefined,'identifierLegs':k});}};for(const d of a['steps']){if(d['op']==='create'&&d['object']==='service')c(d['params']['order_allocators']);if(d['op']==='configure'&&d['method']==='order_allocators')c(d['params']['allocators']);}return b;}function machineProjection(a){const b=createsOf(a,'machine')[0x0];if(b===undefined)return undefined;const c=b['params']['nodes'];if(!Array['isArray'](c))return{'nodes':[],'edges':[],'terminals':[],'optionalNodes':[],'forwardGuardRefs':[]};const d=[],e=[],f=[],h=[];for(const k of c){if(typeof k!=='object'||k===null)continue;const l=k,m=typeof l['name']==='string'?l['name']:undefined;if(m===undefined)continue;d['push'](m);if(l['optional']===!![])f['push'](m);const n=Array['isArray'](l['pairs'])?l['pairs']:[];for(const o of n){const q=o,r=q?.['prev_node'],s=Array['isArray'](q?.['forwards'])?q['forwards']:[],t=[];for(const u of s){const v=u?.['guard'];isRef(v)&&(t['push'](v['$ref']),h['push'](v['$ref']));}if(typeof r==='string')e['push']({'prev':r,'next':m,'guards':t});}}const i=b['params']['pairs'];if(Array['isArray'](i))for(const w of i){const x=w;if(typeof x?.['prev_node']==='string'&&typeof x?.['next_node']==='string'){const y=Array['isArray'](x['forwards'])?x['forwards']:[],z=[];for(const A of y){const B=A?.['guard'];isRef(B)&&(z['push'](B['$ref']),h['push'](B['$ref']));}e['push']({'prev':x['prev_node'],'next':x['next_node'],'guards':z});}}const j=new Set(e['map'](C=>C['prev'])['filter'](C=>C!==''));return{'nodes':d,'edges':e,'terminals':d['filter'](C=>!j['has'](C)),'optionalNodes':f,'forwardGuardRefs':h};}function pathCountCap2(a,b){const c=new Map();for(const g of a){const h=c['get'](g['prev'])??[];h['push'](g['next']),c['set'](g['prev'],h);}let d=0x0;const f=(i,j)=>{if(d>=0x2)return;if(i===b){d+=0x1;return;}if(j['has'](i))return;const k=new Set(j)['add'](i);for(const l of c['get'](i)??[])f(l,k);};for(const i of c['get']('')??[])f(i,new Set());return d;}const WRITE_ONLY_ENFORCEMENT_SOURCES=[{'object':'service','param':'customer_required','coverQuery':'order.required_info','extract':a=>Array['isArray'](a['params']['customer_required'])&&a['params']['customer_required']['length']>0x0},{'object':'service','param':'sales[].wip','coverQuery':'service.sale.wip','extract':a=>Array['isArray'](a['params']['sales'])&&a['params']['sales']['some'](b=>typeof b==='object'&&b!==null&&typeof b['wip']==='string'&&b['wip']['length']>0x0)}],PROSE_UNIT_MS={'minute':0xea60,'hour':0x36ee80,'hrs':0x36ee80,'hr':0x36ee80,'h':0x36ee80,'day':0x5265c00,'week':0x240c8400},PROSE_DURATION_RE=/(\d+)\s*[-\s]?\s*(minute|hour|hrs|hr|h|day|week)s?\b/gi,WINDOW_CONTEXT_RE=/review|accept|cancel|refund|return|window|claim|bounty|escrow|release|revision|dispute/i;function isPlausibleMsDuration(a){return Number['isFinite'](a)&&a>=0xea60&&a%0x3e8===0x0&&a<=0xa*0x16d*0x5265c00;}function formatMs(a){const b=a/0x5265c00;if(Number['isInteger'](b)&&b>=0x2)return b+'\x20days';const c=a/0x36ee80;if(Number['isInteger'](c)&&c>=0x2)return c+'\x20hours';return a/0xea60+'\x20minutes';}export function extractProseWindowPromises(a){const b=[];for(const c of a['matchAll'](PROSE_DURATION_RE)){const d=Number(c[0x1])*(PROSE_UNIT_MS[c[0x2]['toLowerCase']()]??NaN);if(!Number['isFinite'](d)||d<=0x0||c['index']===undefined)continue;const e=Math['max'](0x0,c['index']-0x50),f=Math['min'](a['length'],c['index']+c[0x0]['length']+0x50);if(!WINDOW_CONTEXT_RE['test'](a['slice'](e,f)))continue;b['push']({'ms':d,'quote':c[0x0]});}return b;}const UNANCHORED_RESTART_RE=/\b(?:restart|reset|renew|start(?:s)? again|begin(?:s)? again)[^.]{0,60}\b(?:window|timer|clock|period)\b|\b(?:window|timer|clock|period)\b[^.]{0,60}\b(?:restart|reset|renew)s?\b/i;function collectEnforcedWindowMs(a){const b=new Set();for(const c of createsOf(a,'guard')){const d=Array['isArray'](c['params']['table'])?c['params']['table']:[];for(const e of d){const f=e;if(f['b_submission']===!![]||f['value_type']!=='U64')continue;const g=f['value'],h=typeof g==='number'?g:typeof g==='string'&&g!==''&&!Number['isNaN'](Number(g))?Number(g):NaN;if(isPlausibleMsDuration(h))b['add'](h);}}return b;}const TIME_CMP_TYPES={'logic_as_u256_greater':'gt','logic_as_u256_greater_or_equal':'ge','logic_as_u256_lesser':'lt','logic_as_u256_lesser_or_equal':'le','logic_as_u256_equal':'eq','logic_equal':'eq'};function isClockContext(a){return a['type']==='context'&&a['context']==='Clock';}function subtreeHasBranch(a){if(Array['isArray'](a))return a['some'](subtreeHasBranch);if(typeof a!=='object'||a===null)return![];const b=a;if(b['type']==='logic_or'||b['type']==='logic_not')return!![];return Object['values'](b)['some'](subtreeHasBranch);}function guardWindowOpen(c){if(typeof c!=='object'||c===null)return!![];if(subtreeHasBranch(c))return!![];let d=![];for(const e of flattenAndChain(c)){const f=TIME_CMP_TYPES[typeof e['type']==='string'?e['type']:''];if(f===undefined)continue;const g=Array['isArray'](e['nodes'])?e['nodes']:undefined;if(g===undefined||g['length']<0x2)continue;const h=g[0x0],i=g[0x1];if(typeof h!=='object'||h===null||typeof i!=='object'||i===null)continue;const j=isClockContext(h),k=isClockContext(i);if(j&&!k){if(f==='lt'||f==='le'||f==='eq')d=!![];}else{if(!j&&k){const l=f==='gt'||f==='ge'?'lt':f==='lt'||f==='le'?'gt':'eq';if(l==='lt')d=!![];}}}return!d;}export function planFacts(a){const b=new Map(createsOf(a,'guard')['map'](an=>[an['id'],guardProjection(an)])),c=allocatorRows(a),d=machineProjection(a),f=createsOf(a,'service')['length']>0x0,h=createsOf(a,'repository')['length']>0x0,i=a['steps']['some'](an=>{if(!(an['op']==='create'&&an['object']==='service'||an['op']==='configure'&&an['method']==='sales'))return![];const ao=an['params']['sales'];return Array['isArray'](ao)&&ao['length']>0x0;}),j=new Set();for(const an of c){const ao=an['guardStep']===undefined?undefined:b['get'](an['guardStep']);for(const ap of ao?.['acceptedNodes']??[])j['add'](ap);}const k=new Set(d?.['optionalNodes']??[]),l=(d?.['terminals']??[])['filter'](aq=>!k['has'](aq)),o=new Set(),q=new Set(c['map'](aq=>aq['guardStep'])['filter'](aq=>aq!==undefined));for(const aq of d?.['edges']??[]){if(aq['next']===''||aq['guards']['length']===0x0)continue;for(const ar of aq['guards']){if(!q['has'](ar))continue;if((b['get'](ar)?.['acceptedNodes']['length']??0x0)===0x0)o['add'](aq['next']);}}const u=l['find'](as=>!j['has'](as)&&!o['has'](as)),w=a['pending_guards']??[],x=w['filter'](as=>as['site']==='allocator')['length'],y=w['filter'](as=>as['site']==='allocator'||as['site']==='machine_edge'),z=w['filter'](as=>as['site']==='service_buy'),A=y[0x0]?.['key'],B=z[0x0]?.['key'],C=d?.['nodes']['find'](as=>/return/i['test'](as)),D=a['steps']['some'](as=>{if(as['op']==='configure'&&as['method']==='arbitrations'){const at=as['params']['objects'];return Array['isArray'](at)&&at['length']>0x0;}if(as['op']==='create'&&as['object']==='service'){const au=as['params']['arbitrations'];return Array['isArray'](au)&&au['length']>0x0;}return![];});let E,F=![];for(const as of a['steps']){if(as['op']==='configure'&&as['method']==='compensation_fund_add'){F=!![];const at=numericAmount(as['params']['balance']);if(at!==undefined)E=(E??0x0)+at;}}let G;const H=au=>{if(!Array['isArray'](au))return;for(const av of au){const aw=numericAmount(av?.['price']);if(aw!==undefined&&aw>0x0)G=Math['max'](G??0x0,aw);}};for(const au of a['steps']){if(au['op']==='create'&&au['object']==='service')H(au['params']['sales']);if(au['op']==='configure'&&au['method']==='sales')H(au['params']['sales']);}const I=E!==undefined&&G!==undefined,J=/^(arb\.indemnity|arb\.order|arb\.status|order\.dispute)/,K=/settled|refunded|reviewed|completed|closed|cancel/i;let L;if(d!==undefined)for(const av of d['edges']){if(av['next']===''||av['guards']['length']===0x0)continue;if(!K['test'](av['prev']))continue;if(av['guards']['some'](aw=>b['get'](aw)?.['queries']['some'](ax=>J['test'](ax)))){L=av['prev'];break;}}const M=L!==undefined&&(!F||E===0x0),N=new Map();for(const aw of createsOf(a,'guard')){N['set'](aw['id'],aw['params']['root']??aw['params']['logic']);}const O=d?.['edges']??[],P=ax=>ax['guards']['length']===0x0||ax['guards']['every'](ay=>{const az=N['get'](ay);return az===undefined||guardWindowOpen(az);});let Q;for(const ax of O){if(ax['prev']!==''||ax['next']==='')continue;const ay=O['filter'](az=>az['prev']===ax['next']);if(ay['length']===0x0)continue;if(ay['every'](az=>!P(az)))Q??=ax['next'];}const R=c['some'](az=>az['guardStep']===undefined&&az['guardKey']!==undefined),S=O['filter'](az=>az['guards']['length']>0x0&&az['guards']['some'](aA=>b['get'](aA)?.['queries']['some'](aB=>J['test'](aB))));let T=![];if(S['length']>0x0&&!R){const az=new Set(S['map'](aC=>aC['next'])['filter'](aC=>aC!=='')),aA=new Set(S['flatMap'](aC=>aC['guards'])),aB=new Set();for(const aC of c){const aD=aC['guardStep']===undefined?undefined:b['get'](aC['guardStep']);if(aD===undefined)continue;if(aD['acceptedNodes']['length']>0x0){for(const aE of aD['acceptedNodes'])aB['add'](aE);}else for(const aF of O){aF['next']!==''&&aF['guards']['includes'](aC['guardStep'])&&aB['add'](aF['next']);}}for(const aG of c){const aH=aG['guardStep']===undefined?undefined:b['get'](aG['guardStep']);if(aH===undefined)continue;if(aH['queries']['some'](aI=>J['test'](aI))||aA['has'](aG['guardStep'])){T=!![];break;}}if(!T)for(const aI of az){if(aB['has'](aI)){T=!![];break;}}}const U=S['length']>0x0&&!T&&!R,V=S[0x0]===undefined?undefined:S[0x0]['prev']!==''?S[0x0]['prev']:S[0x0]['next'],W=[];for(const aJ of a['steps']){const aK=aJ['op']==='create'&&aJ['object']==='service',aL=aJ['op']==='configure'&&aJ['method']==='sales';if(!aK&&!aL)continue;const aM=aJ['params'];if(typeof aM['description']==='string')W['push'](aM['description']);if(!Array['isArray'](aM['sales']))continue;for(const aN of aM['sales']){if(typeof aN!=='object'||aN===null)continue;for(const aO of Object['values'](aN)){if(typeof aO==='string')W['push'](aO);}}}const X=W['flatMap'](aP=>extractProseWindowPromises(aP)),Y=collectEnforcedWindowMs(a),Z=X['filter'](aP=>!Y['has'](aP['ms'])),a0=[];for(const aP of W){const aQ=UNANCHORED_RESTART_RE['exec'](aP);if(aQ)a0['push'](aQ[0x0]);}const a1=c['filter'](aR=>aR['track']==='refund'),a2=a1['map'](aR=>aR['guardStep']===undefined?undefined:b['get'](aR['guardStep']))['find'](aR=>aR!==undefined&&!aR['queries']['some'](aS=>aS['startsWith']('order.claimed_by')))?.['stepId'],a3=new Map();for(const aR of d?.['edges']??[]){for(const aS of aR['guards']){const aT=a3['get'](aS)??[];if(aR['prev']!=='')aT['push'](aR['prev']);if(aR['next']!=='')aT['push'](aR['next']);a3['set'](aS,aT);}}let a4,a5=![];for(const aU of b['values']()){if(aU['queries']['some'](isPathDependentTimeQuery)){a4??=aU['stepId'];if(d!==undefined){const aV=[...aU['acceptedNodes'],...a3['get'](aU['stepId'])??[]];for(const aW of aV){if(pathCountCap2(d['edges'],aW)>=0x2){a5=!![],a4=aU['stepId'];break;}}}}if(a5)break;}const a6=[...b['values']()]['flatMap'](aX=>aX['queries']);let a7;for(const aX of WRITE_ONLY_ENFORCEMENT_SOURCES){for(const aY of createsOf(a,aX['object'])){if(aX['extract'](aY)&&!a6['some'](aZ=>aZ['startsWith'](aX['coverQuery']))){a7=aX['param'];break;}}if(a7!==undefined)break;}const a8=new Set();for(const aZ of a['steps']){if(aZ['op']==='create'&&aZ['object']==='guard')continue;const b0=refsOf(aZ['op']==='publish'?aZ['target']:aZ['params']);for(const b1 of b0)a8['add'](b1);if(aZ['op']==='configure'){for(const b2 of refsOf(aZ['target']))a8['add'](b2);}}const a9=[...b['keys']()]['find'](b3=>!a8['has'](b3)),aa=[...b['values']()]['find'](b3=>!h&&b3['queries']['some'](b4=>b4['startsWith']('repository.')))?.['stepId'];let ab;if(f&&d!==undefined)for(const b3 of d['forwardGuardRefs']){const b4=b['get'](b3);if(b4===undefined)continue;const b5=b4['table']['some'](b6=>b6['identifier']===TASK_BINDING_SLOT&&b6['b_submission']===!![]);if(!b5){ab=b3;break;}}let ac;for(const b6 of c){if(b6['guardStep']===undefined||b6['identifierLegs']['length']===0x0)continue;const b7=b['get'](b6['guardStep']);if(b7===undefined)continue;for(const b8 of b6['identifierLegs']){const b9=b7['table']['find'](ba=>ba['identifier']===b8);if(b9===undefined||b9['b_submission']!==!![]||b9['value_type']!=='Address'){ac='slot\x20'+b8+'\x20of\x20guard\x20\x27'+b6['guardStep']+'\x27';break;}}if(ac!==undefined)break;}const ad=new Set();for(const ba of createsOf(a,'repository')){const bb=ba['params']['policies'];if(!Array['isArray'](bb))continue;for(const bc of bb){const bd=bc?.['name'];if(typeof bd==='string')ad['add'](bd);}}const ae=[];if(ad['size']>0x0)for(const be of createsOf(a,'guard')){const bf=Array['isArray'](be['params']['table'])?be['params']['table']:[];for(const bg of collectRepoWhereQueries(be['params']['root']??be['params']['logic'])){const bh=staticStringOperand(bg['key'],bf);if(bh===undefined)continue;if(!isPlanLocalObjectOperand(bg['object'],bf))continue;!ad['has'](bh)&&ae['push']('\x27'+bh+'\x27\x20in\x20guard\x20\x27'+be['id']+'\x27');}}const af=new Set();for(const bi of createsOf(a,'repository')){const bj=bi['params']['policies'];if(!Array['isArray'](bj))continue;for(const bk of bj){const bl=bk?.['write_guard'];if(!Array['isArray'](bl))continue;for(const bm of bl){const bn=bm?.['guard'],bo=isRef(bn)?bn['$ref']:bn;if(typeof bo==='string')af['add'](bo);}}}let ag,ah=0x0;for(const bp of createsOf(a,'guard')){if(!af['has'](bp['id']))continue;rootNegatesRepoDataHas(bp['params']['root']??bp['params']['logic'])&&(ah++,ag??=bp['id']);}let ai,aj=0x0;for(const bq of createsOf(a,'service')){const br=bq['params']['customer_required'];if(!Array['isArray'](br)||br['length']===0x0)continue;bq['params']['buy_guard']===undefined&&(aj++,ai??=bq['id']);}let ak,al=0x0;for(const bs of d?.['edges']??[]){if(bs['prev']===''||bs['guards']['length']===0x0)continue;for(const bt of bs['guards']){const bu=b['get'](bt);if(bu===undefined||bu['acceptedNodes']['length']===0x0)continue;!bu['acceptedNodes']['includes'](bs['prev'])&&(al++,ak??=bt+'\x20on\x20edge\x20'+bs['prev']+'->'+bs['next']+'\x20(guard\x20pins\x20progress.current\x20in\x20'+('['+bu['acceptedNodes']['join'](',\x20')+']\x20—\x20never\x20\x27'+bs['prev']+'\x27)'));}}const am=[];for(const bv of createsOf(a,'guard')){const bw=reachLegsOf(bv);am['push'](...findReachContradictions(bv['id'],bw['legs'],bw['selfStrict']));}return{'has_service':f,'has_machine':d!==undefined,'has_repository':h,'sales_step_present':i,'allocator_row_count':c['length'],'refund_row_count':a1['length'],'terminal_count':l['length'],'terminal_nodes_display':l['join'](',\x20'),'pending_allocator_guard_count':x,'pending_guard_total':w['length'],...u===undefined?{}:{'first_uncovered_terminal':u},...a2===undefined?{}:{'first_refund_guard_missing_claimed_by':a2},...a4===undefined?{}:{'first_path_dependent_anchor':a4},'path_sensitive':a5,...a7===undefined?{}:{'first_write_only_unenforced_field':a7},...a9===undefined?{}:{'first_orphan_guard':a9},...aa===undefined?{}:{'first_repo_query_without_repository':aa},'repo_write_once_guard_count':ah,...ag===undefined?{}:{'first_repo_write_once_guard':ag},'customer_required_unbacked_count':aj,...ai===undefined?{}:{'first_customer_required_unbacked':ai},...ab===undefined?{}:{'first_edge_guard_missing_254':ab},'node_mismatched_guard_count':al,...ak===undefined?{}:{'first_node_mismatched_guard':ak},'guard_reach_contradiction_count':am['length'],...am['length']>0x0?{'first_guard_reach_contradiction':am[0x0],'guard_reach_contradiction_display':am['join'](';\x20')}:{},...ac===undefined?{}:{'first_alloc_slot_missing':ac},...A===undefined?{}:{'first_pending_fund_guard':A,'pending_fund_guard_count':y['length'],'pending_fund_guard_keys_display':y['map'](bx=>bx['key'])['join'](',\x20')},...B===undefined?{}:{'first_pending_buy_guard':B,'pending_buy_guard_count':z['length'],'pending_buy_guard_keys_display':z['map'](bx=>bx['key'])['join'](',\x20')},'has_return_rail':C!==undefined,...C===undefined?{}:{'return_rail_node':C},'has_arbitration_binding':D,'fund_topup_present':F,...E===undefined?{}:{'fund_topup_amount':E},...I?{'fund_ceiling_breach':E<MAX_INDEMNITY_MULTIPLE*G,'fund_ceiling_basis':MAX_INDEMNITY_MULTIPLE+'x\x20the\x20highest\x20SKU\x20price','fund_concurrent_orders_coverable':Math['floor'](E/(MAX_INDEMNITY_MULTIPLE*G))}:{},'fund_ceiling_unverifiable':F&&!I,...M?{'first_arb_exit_node':L,'fund_arb_route_unfunded':!![]}:{},...Q===undefined?{}:{'entry_no_open_exit':!![],'entry_strand_node':Q},...U&&V!==undefined?{'arb_promise_without_settle_rail':!![],'arb_promise_node':V}:{},...S['length']>0x0&&R&&V!==undefined?{'arb_key_plane_opaque':!![],'arb_key_plane_node':V}:{},...X['length']>0x0?{'prose_window_promise_count':X['length'],'enforced_window_ms_display':[...Y]['sort']((bx,by)=>bx-by)['map'](formatMs)['join'](',\x20')||'none',...Z['length']>0x0?{'prose_time_mismatch_count':Z['length'],'first_prose_time_mismatch':Z[0x0]['quote'],'prose_time_mismatch_display':Z['map'](bx=>bx['quote'])['join'](';\x20')}:{}}:{},...a0['length']>0x0?{'unanchored_window_promise_count':a0['length'],'first_unanchored_window_promise':a0[0x0]}:{},...ad['size']>0x0?{'repo_policy_keys_display':[...ad]['join'](',\x20'),...ae['length']>0x0?{'repo_gate_key_unbacked_count':ae['length'],'first_repo_gate_key_unbacked':ae[0x0],'repo_gate_key_unbacked_display':ae['join'](',\x20')}:{}}:{}};}function planRuleBook(){const a=getJudgmentDoc()['rules']['domains']['plan'];if(!a)throw new Error('factory\x20rule\x20pack\x20\x27plan\x27\x20missing\x20—\x20broken\x20installation');return a['rules'];}export function auditPlan(a){const b=validatePlan(a),c=planFacts(a),{findings:d}=evaluateRuleBook(planRuleBook(),c),e=b['length']>0x0||d['some'](g=>g['level']==='critical'||g['level']==='high');return{'issues':b,'findings':d,'facts':c,'blocking':e};}
|
|
1
|
+
import{getJudgmentDoc}from'../config/judgment.js';import{evaluateRuleBook}from'../config/rule-engine.js';import{isPathDependentTimeQuery}from'../chain-semantics/index.js';import{MAX_INDEMNITY_MULTIPLE,TASK_BINDING_SLOT}from'../knowledge/onchain-constants.js';import{numericAmount}from'../knowledge/audit-rules.js';import{createsOf,isRef,refsOf,validatePlan}from'./plan.js';function collectQueries(a,b=[]){if(Array['isArray'](a)){for(const c of a)collectQueries(c,b);}else{if(typeof a==='object'&&a!==null){const d=a;d['type']==='query'&&typeof d['query']==='string'&&b['push']({'query':d['query']});for(const e of Object['values'](d))collectQueries(e,b);}}return b;}function acceptedProgressNodes(a,b){const c=new Map();if(Array['isArray'](b))for(const g of b){if(typeof g==='object'&&g!==null){const h=g;typeof h['identifier']==='number'&&typeof h['value']==='string'&&c['set'](h['identifier'],h['value']);}}const d=i=>{if(typeof i!=='object'||i===null)return undefined;const j=i;if(j['type']==='constant'&&typeof j['value']==='string')return j['value'];if(j['type']==='identifier'&&typeof j['identifier']==='number')return c['get'](j['identifier']);return undefined;},e=[],f=i=>{if(Array['isArray'](i)){for(const n of i)f(n);return;}if(typeof i!=='object'||i===null)return;const j=i,k=Array['isArray'](j['nodes'])?j['nodes']:undefined,l=k?.[0x0]??j['left'],m=k?.[0x1]??j['right'];if(typeof j['type']==='string'&&j['type']['startsWith']('logic')&&typeof l==='object'&&l!==null&&l['type']==='query'&&l['query']==='progress.current'){const o=d(m);if(o!==undefined)e['push'](o);}for(const p of Object['values'](j))f(p);};return f(a),e;}const REPO_WHERE_QUERY_TYPES=new Set(['query_repository_data_count_where','query_repository_data_sum_where','query_repository_data_sum_where_bound','query_repository_data_find_where']);function collectRepoWhereQueries(a,b=[]){if(Array['isArray'](a)){for(const c of a)collectRepoWhereQueries(c,b);}else{if(typeof a==='object'&&a!==null){const d=a;typeof d['type']==='string'&&REPO_WHERE_QUERY_TYPES['has'](d['type'])&&b['push'](d);for(const e of Object['values'](d))collectRepoWhereQueries(e,b);}}return b;}function isRepoDataHasRef(a){if(a['type']==='query'){const c=a['query'];if(typeof c==='string'&&c['trim']()['toLowerCase']()==='repository.data\x20has')return!![];if(c===0x48e||c==='1166')return!![];}const b=a['type'];return typeof b==='string'&&b['toLowerCase']()==='query_repository_data_has';}function subtreeRefsRepoDataHas(a){if(Array['isArray'](a))return a['some'](subtreeRefsRepoDataHas);if(typeof a!=='object'||a===null)return![];const b=a;if(isRepoDataHasRef(b))return!![];return Object['values'](b)['some'](subtreeRefsRepoDataHas);}function rootNegatesRepoDataHas(a){if(Array['isArray'](a))return a['some'](rootNegatesRepoDataHas);if(typeof a!=='object'||a===null)return![];const b=a;if(b['type']==='logic_not'&&subtreeRefsRepoDataHas(b['node']))return!![];return Object['values'](b)['some'](rootNegatesRepoDataHas);}function staticStringOperand(a,b){if(typeof a!=='object'||a===null)return undefined;const c=a;if(typeof c['identifier']==='number'){const d=b['find'](e=>typeof e==='object'&&e!==null&&e['identifier']===c['identifier']);if(d===undefined||d['b_submission']===!![])return undefined;return typeof d['value']==='string'?d['value']:undefined;}return typeof c['value']==='string'?c['value']:undefined;}function isPlanLocalObjectOperand(a,b){if(typeof a!=='object'||a===null)return![];const c=a;if(typeof c['identifier']!=='number')return![];const d=b['find'](f=>typeof f==='object'&&f!==null&&f['identifier']===c['identifier']);if(d===undefined||d['b_submission']===!![])return![];const e=d['value'];if(typeof e==='object'&&e!==null)return!![];return typeof e==='string'&&e['startsWith']('$');}const REACH_GREATER_TYPES={'logic_as_u256_greater':'gt','logic_as_u256_greater_or_equal':'ge'},REACH_LESSER_TYPES={'logic_as_u256_lesser':'lt','logic_as_u256_lesser_or_equal':'le'},REACH_EQUAL_TYPES=new Set(['logic_as_u256_equal','logic_equal']);function reachChannel(a){if(a['type']==='context'&&typeof a['context']==='string')return'context:'+a['context'];const b=a['query'];if(a['type']==='query'&&(typeof b==='string'||typeof b==='number'))return'query:'+String(b)['trim']()['toLowerCase']();return undefined;}function reachConstant(a,b){const c=d=>typeof d==='string'||typeof d==='number'||typeof d==='boolean';if(a['type']==='identifier'&&typeof a['identifier']==='number'){const d=b['find'](e=>typeof e==='object'&&e!==null&&e['identifier']===a['identifier']);if(d===undefined||d['b_submission']===!![])return undefined;return c(d['value'])?d['value']:undefined;}if(a['type']==='constant')return c(a['value'])?a['value']:undefined;return undefined;}function flattenAndChain(a,b=[]){if(typeof a!=='object'||a===null)return b;const c=a;if(c['type']==='logic_and'){const d=Array['isArray'](c['nodes'])?c['nodes']:Array['isArray'](c['and'])?c['and']:[];for(const e of d)flattenAndChain(e,b);return b;}return b['push'](c),b;}function reachLegsOf(a){const b=Array['isArray'](a['params']['table'])?a['params']['table']:[],c=a['params']['root']??a['params']['logic'],d={'legs':[],'selfStrict':[]};if(typeof c!=='object'||c===null)return d;for(const e of flattenAndChain(c)){const f=typeof e['type']==='string'?e['type']:'',g=Array['isArray'](e['nodes'])?e['nodes']:undefined;if(g===undefined||g['length']<0x2)continue;const h=REACH_GREATER_TYPES[f],j=REACH_LESSER_TYPES[f],k=REACH_EQUAL_TYPES['has'](f);if(h===undefined&&j===undefined&&!k)continue;const l=g[0x0];if(typeof l!=='object'||l===null)continue;const m=reachChannel(l),n=reachConstant(l,b);for(let o=0x1;o<g['length'];o++){const p=g[o];if(typeof p!=='object'||p===null)continue;const q=reachConstant(p,b),r=reachChannel(p);if(m!==undefined&&q!==undefined)d['legs']['push']({'channel':m,'dir':k?'eq':h??j,'constant':q});else{if(r!==undefined&&n!==undefined){const s=k?'eq':h!==undefined?h==='gt'?'lt':'le':j==='lt'?'gt':'ge';d['legs']['push']({'channel':r,'dir':s,'constant':n});}else m!==undefined&&r!==undefined&&(m===r&&(h==='gt'||j==='lt')&&d['selfStrict']['push']({'channel':m,'dir':h==='gt'?'gt':'lt'}));}}}return d;}function reachNumeric(a){if(typeof a==='number')return Number['isFinite'](a)?a:undefined;if(typeof a==='string'&&a['trim']()!==''&&!Number['isNaN'](Number(a)))return Number(a);return undefined;}function findReachContradictions(c,f,g=[]){const h=[];for(const l of g){h['push']('guard\x20\x27'+c+'\x27\x20('+l['channel']+'):\x20'+(l['dir']==='gt'?'>':'<')+'\x20itself\x20—\x20'+'unsatisfiable\x20(same-binding\x20self-comparison)');}const k=new Map();for(const m of f){const n=k['get'](m['channel'])??[];n['push'](m),k['set'](m['channel'],n);}for(const [o,p]of k){const q=p['filter'](v=>v['dir']==='gt'||v['dir']==='ge'),r=p['filter'](v=>v['dir']==='lt'||v['dir']==='le');for(const v of q){const w=reachNumeric(v['constant']);if(w===undefined)continue;for(const x of r){const y=reachNumeric(x['constant']);if(y===undefined)continue;(w>y||w===y&&(v['dir']==='gt'||x['dir']==='lt'))&&h['push']('guard\x20\x27'+c+'\x27\x20('+o+'):\x20'+(v['dir']==='gt'?'>':'>=')+'\x20'+String(v['constant'])+'\x20'+('contradicts\x20'+(x['dir']==='lt'?'<':'<=')+'\x20'+String(x['constant'])+'\x20—\x20unsatisfiable'));}}const t=p['filter'](z=>z['dir']==='eq');for(let z=0x0;z<t['length'];z++){for(let A=z+0x1;A<t['length'];A++){const B=t[z],C=t[A],D=reachNumeric(B['constant']),E=reachNumeric(C['constant']),F=typeof B['constant']==='boolean'&&typeof C['constant']==='boolean'&&B['constant']!==C['constant'],G=D!==undefined&&E!==undefined&&D!==E;(F||G)&&h['push']('guard\x20\x27'+c+'\x27\x20('+o+'):\x20==\x20'+String(B['constant'])+'\x20'+('contradicts\x20==\x20'+String(C['constant'])+'\x20—\x20unsatisfiable'));}}for(const H of t){const I=reachNumeric(H['constant']);if(I===undefined)continue;for(const J of q){J['dir']==='gt'&&reachNumeric(J['constant'])===I&&h['push']('guard\x20\x27'+c+'\x27\x20('+o+'):\x20==\x20'+String(H['constant'])+'\x20'+('contradicts\x20>\x20'+String(J['constant'])+'\x20—\x20unsatisfiable'));}for(const K of r){K['dir']==='lt'&&reachNumeric(K['constant'])===I&&h['push']('guard\x20\x27'+c+'\x27\x20('+o+'):\x20==\x20'+String(H['constant'])+'\x20'+('contradicts\x20<\x20'+String(K['constant'])+'\x20—\x20unsatisfiable'));}}}return h;}function guardProjection(a){const b=a['params']['root']??a['params']['logic'],c=collectQueries(b)['map'](d=>d['query']);return{'stepId':a['id'],'queries':c,'acceptedNodes':acceptedProgressNodes(b,a['params']['table']),'table':Array['isArray'](a['params']['table'])?a['params']['table']:[]};}function allocatorRows(a){const b=[],c=d=>{if(typeof d==='object'&&d!==null&&!Array['isArray'](d)){const e=d;if(Array['isArray'](e['allocators']))d=e['allocators'];}if(!Array['isArray'](d))return;for(const f of d){if(typeof f!=='object'||f===null)continue;const g=f,h=g['guard'],i=g['guard_key'],j=Array['isArray'](g['sharing'])?g['sharing']:[],k=j['map'](l=>typeof l==='object'&&l!==null?l['who']:undefined)['map'](l=>typeof l==='object'&&l!==null?l['GuardIdentifier']:undefined)['filter'](l=>typeof l==='number');b['push']({'track':typeof g['track']==='string'?g['track']:'settlement','guardStep':isRef(h)?h['$ref']:undefined,'guardKey':typeof i==='string'?i:undefined,'identifierLegs':k});}};for(const d of a['steps']){if(d['op']==='create'&&d['object']==='service')c(d['params']['order_allocators']);if(d['op']==='configure'&&d['method']==='order_allocators')c(d['params']['allocators']);}return b;}function machineProjection(a){const b=createsOf(a,'machine')[0x0];if(b===undefined)return undefined;const c=b['params']['nodes'];if(!Array['isArray'](c))return{'nodes':[],'edges':[],'terminals':[],'optionalNodes':[],'forwardGuardRefs':[]};const d=[],e=[],f=[],h=[];for(const k of c){if(typeof k!=='object'||k===null)continue;const l=k,m=typeof l['name']==='string'?l['name']:undefined;if(m===undefined)continue;d['push'](m);if(l['optional']===!![])f['push'](m);const n=Array['isArray'](l['pairs'])?l['pairs']:[];for(const o of n){const q=o,r=q?.['prev_node'],s=Array['isArray'](q?.['forwards'])?q['forwards']:[],t=[];for(const u of s){const v=u?.['guard'];isRef(v)&&(t['push'](v['$ref']),h['push'](v['$ref']));}if(typeof r==='string')e['push']({'prev':r,'next':m,'guards':t});}}const i=b['params']['pairs'];if(Array['isArray'](i))for(const w of i){const x=w;if(typeof x?.['prev_node']==='string'&&typeof x?.['next_node']==='string'){const y=Array['isArray'](x['forwards'])?x['forwards']:[],z=[];for(const A of y){const B=A?.['guard'];isRef(B)&&(z['push'](B['$ref']),h['push'](B['$ref']));}e['push']({'prev':x['prev_node'],'next':x['next_node'],'guards':z});}}const j=new Set(e['map'](C=>C['prev'])['filter'](C=>C!==''));return{'nodes':d,'edges':e,'terminals':d['filter'](C=>!j['has'](C)),'optionalNodes':f,'forwardGuardRefs':h};}function pathCountCap2(a,b){const c=new Map();for(const g of a){const h=c['get'](g['prev'])??[];h['push'](g['next']),c['set'](g['prev'],h);}let d=0x0;const f=(i,j)=>{if(d>=0x2)return;if(i===b){d+=0x1;return;}if(j['has'](i))return;const k=new Set(j)['add'](i);for(const l of c['get'](i)??[])f(l,k);};for(const i of c['get']('')??[])f(i,new Set());return d;}const WRITE_ONLY_ENFORCEMENT_SOURCES=[{'object':'service','param':'customer_required','coverQuery':'order.required_info','extract':a=>Array['isArray'](a['params']['customer_required'])&&a['params']['customer_required']['length']>0x0},{'object':'service','param':'sales[].wip','coverQuery':'service.sale.wip','extract':a=>Array['isArray'](a['params']['sales'])&&a['params']['sales']['some'](b=>typeof b==='object'&&b!==null&&typeof b['wip']==='string'&&b['wip']['length']>0x0)}],PROSE_UNIT_MS={'minute':0xea60,'hour':0x36ee80,'hrs':0x36ee80,'hr':0x36ee80,'h':0x36ee80,'day':0x5265c00,'week':0x240c8400},PROSE_DURATION_RE=/(\d+)\s*[-\s]?\s*(minute|hour|hrs|hr|h|day|week)s?\b/gi,WINDOW_CONTEXT_RE=/review|accept|cancel|refund|return|window|claim|bounty|escrow|release|revision|dispute/i;function isPlausibleMsDuration(a){return Number['isFinite'](a)&&a>=0xea60&&a%0x3e8===0x0&&a<=0xa*0x16d*0x5265c00;}function formatMs(a){const b=a/0x5265c00;if(Number['isInteger'](b)&&b>=0x2)return b+'\x20days';const c=a/0x36ee80;if(Number['isInteger'](c)&&c>=0x2)return c+'\x20hours';return a/0xea60+'\x20minutes';}export function extractProseWindowPromises(a){const b=[];for(const c of a['matchAll'](PROSE_DURATION_RE)){const d=Number(c[0x1])*(PROSE_UNIT_MS[c[0x2]['toLowerCase']()]??NaN);if(!Number['isFinite'](d)||d<=0x0||c['index']===undefined)continue;const e=Math['max'](0x0,c['index']-0x50),f=Math['min'](a['length'],c['index']+c[0x0]['length']+0x50);if(!WINDOW_CONTEXT_RE['test'](a['slice'](e,f)))continue;b['push']({'ms':d,'quote':c[0x0]});}return b;}const UNANCHORED_RESTART_RE=/\b(?:restart|reset|renew|start(?:s)? again|begin(?:s)? again)[^.]{0,60}\b(?:window|timer|clock|period)\b|\b(?:window|timer|clock|period)\b[^.]{0,60}\b(?:restart|reset|renew)s?\b/i;function collectEnforcedWindowMs(a){const b=new Set();for(const c of createsOf(a,'guard')){const d=Array['isArray'](c['params']['table'])?c['params']['table']:[];for(const e of d){const f=e;if(f['b_submission']===!![]||f['value_type']!=='U64')continue;const g=f['value'],h=typeof g==='number'?g:typeof g==='string'&&g!==''&&!Number['isNaN'](Number(g))?Number(g):NaN;if(isPlausibleMsDuration(h))b['add'](h);}}return b;}const TIME_CMP_TYPES={'logic_as_u256_greater':'gt','logic_as_u256_greater_or_equal':'ge','logic_as_u256_lesser':'lt','logic_as_u256_lesser_or_equal':'le','logic_as_u256_equal':'eq','logic_equal':'eq'};function isClockContext(a){return a['type']==='context'&&a['context']==='Clock';}function subtreeHasBranch(a){if(Array['isArray'](a))return a['some'](subtreeHasBranch);if(typeof a!=='object'||a===null)return![];const b=a;if(b['type']==='logic_or'||b['type']==='logic_not')return!![];return Object['values'](b)['some'](subtreeHasBranch);}function guardWindowOpen(c){if(typeof c!=='object'||c===null)return!![];if(subtreeHasBranch(c))return!![];let d=![];for(const e of flattenAndChain(c)){const f=TIME_CMP_TYPES[typeof e['type']==='string'?e['type']:''];if(f===undefined)continue;const g=Array['isArray'](e['nodes'])?e['nodes']:undefined;if(g===undefined||g['length']<0x2)continue;const h=g[0x0],i=g[0x1];if(typeof h!=='object'||h===null||typeof i!=='object'||i===null)continue;const j=isClockContext(h),k=isClockContext(i);if(j&&!k){if(f==='lt'||f==='le'||f==='eq')d=!![];}else{if(!j&&k){const l=f==='gt'||f==='ge'?'lt':f==='lt'||f==='le'?'gt':'eq';if(l==='lt')d=!![];}}}return!d;}export function planFacts(a){const b=new Map(createsOf(a,'guard')['map'](as=>[as['id'],guardProjection(as)])),c=allocatorRows(a),d=machineProjection(a),f=createsOf(a,'service')['length']>0x0,h=createsOf(a,'repository')['length']>0x0,i=a['steps']['some'](as=>{if(!(as['op']==='create'&&as['object']==='service'||as['op']==='configure'&&as['method']==='sales'))return![];const at=as['params']['sales'];return Array['isArray'](at)&&at['length']>0x0;}),j=new Set();for(const as of c){const at=as['guardStep']===undefined?undefined:b['get'](as['guardStep']);for(const au of at?.['acceptedNodes']??[])j['add'](au);}const k=new Set(d?.['optionalNodes']??[]),l=(d?.['terminals']??[])['filter'](av=>!k['has'](av)),o=new Set(),q=new Set(c['map'](av=>av['guardStep'])['filter'](av=>av!==undefined));for(const av of d?.['edges']??[]){if(av['next']===''||av['guards']['length']===0x0)continue;for(const aw of av['guards']){if(!q['has'](aw))continue;if((b['get'](aw)?.['acceptedNodes']['length']??0x0)===0x0)o['add'](av['next']);}}const u=l['find'](ax=>!j['has'](ax)&&!o['has'](ax)),w=a['pending_guards']??[],x=w['filter'](ax=>ax['site']==='allocator')['length'],y=w['filter'](ax=>ax['site']==='allocator'||ax['site']==='machine_edge'),z=w['filter'](ax=>ax['site']==='service_buy'),A=y[0x0]?.['key'],B=z[0x0]?.['key'],C=d?.['nodes']['find'](ax=>/return/i['test'](ax)),D=a['steps']['some'](ax=>{if(ax['op']==='configure'&&ax['method']==='arbitrations'){const ay=ax['params']['objects'];return Array['isArray'](ay)&&ay['length']>0x0;}if(ax['op']==='create'&&ax['object']==='service'){const az=ax['params']['arbitrations'];return Array['isArray'](az)&&az['length']>0x0;}return![];});let E,F=![];for(const ax of a['steps']){if(ax['op']==='configure'&&ax['method']==='compensation_fund_add'){F=!![];const ay=numericAmount(ax['params']['balance']);if(ay!==undefined)E=(E??0x0)+ay;}}let G,H;const I=az=>{if(!Array['isArray'](az))return;for(const aA of az){const aB=numericAmount(aA?.['price']);aB!==undefined&&aB>0x0&&(G=Math['max'](G??0x0,aB),H=H===undefined?aB:Math['min'](H,aB));}};for(const az of a['steps']){if(az['op']==='create'&&az['object']==='service')I(az['params']['sales']);if(az['op']==='configure'&&az['method']==='sales')I(az['params']['sales']);}const J=E!==undefined&&G!==undefined,K=createsOf(a,'reward')['length']>0x0;let L,M;if(K)for(const aA of a['steps']){if(aA['op']==='configure'&&aA['method']==='guard_add'){const aB=aA['params']['amount'];if(aB!==undefined&&aB!==null&&aB['type']==='Fixed'){const aC=numericAmount(aB['value']);if(aC!==undefined)L=Math['max'](L??0x0,aC);}}if(aA['op']==='configure'&&aA['method']==='coin_add'&&/^reward/['test'](aA['id'])){const aD=numericAmount(aA['params']['coin']);if(aD!==undefined)M=(M??0x0)+aD;}}const N=L!==undefined&&H!==undefined,O=/^(arb\.indemnity|arb\.order|arb\.status|order\.dispute)/,P=/settled|refunded|reviewed|completed|closed|cancel/i;let Q;if(d!==undefined)for(const aE of d['edges']){if(aE['next']===''||aE['guards']['length']===0x0)continue;if(!P['test'](aE['prev']))continue;if(aE['guards']['some'](aF=>b['get'](aF)?.['queries']['some'](aG=>O['test'](aG)))){Q=aE['prev'];break;}}const R=Q!==undefined&&(!F||E===0x0),S=new Map();for(const aF of createsOf(a,'guard')){S['set'](aF['id'],aF['params']['root']??aF['params']['logic']);}const T=d?.['edges']??[],U=aG=>aG['guards']['length']===0x0||aG['guards']['every'](aH=>{const aI=S['get'](aH);return aI===undefined||guardWindowOpen(aI);});let V;for(const aG of T){if(aG['prev']!==''||aG['next']==='')continue;const aH=T['filter'](aI=>aI['prev']===aG['next']);if(aH['length']===0x0)continue;if(aH['every'](aI=>!U(aI)))V??=aG['next'];}const W=c['some'](aI=>aI['guardStep']===undefined&&aI['guardKey']!==undefined),X=T['filter'](aI=>aI['guards']['length']>0x0&&aI['guards']['some'](aJ=>b['get'](aJ)?.['queries']['some'](aK=>O['test'](aK))));let Y=![];if(X['length']>0x0&&!W){const aI=new Set(X['map'](aL=>aL['next'])['filter'](aL=>aL!=='')),aJ=new Set(X['flatMap'](aL=>aL['guards'])),aK=new Set();for(const aL of c){const aM=aL['guardStep']===undefined?undefined:b['get'](aL['guardStep']);if(aM===undefined)continue;if(aM['acceptedNodes']['length']>0x0){for(const aN of aM['acceptedNodes'])aK['add'](aN);}else for(const aO of T){aO['next']!==''&&aO['guards']['includes'](aL['guardStep'])&&aK['add'](aO['next']);}}for(const aP of c){const aQ=aP['guardStep']===undefined?undefined:b['get'](aP['guardStep']);if(aQ===undefined)continue;if(aQ['queries']['some'](aR=>O['test'](aR))||aJ['has'](aP['guardStep'])){Y=!![];break;}}if(!Y)for(const aR of aI){if(aK['has'](aR)){Y=!![];break;}}}const Z=X['length']>0x0&&!Y&&!W,a0=X[0x0]===undefined?undefined:X[0x0]['prev']!==''?X[0x0]['prev']:X[0x0]['next'],a1=[];for(const aS of a['steps']){const aT=aS['op']==='create'&&aS['object']==='service',aU=aS['op']==='configure'&&aS['method']==='sales';if(!aT&&!aU)continue;const aV=aS['params'];if(typeof aV['description']==='string')a1['push'](aV['description']);if(!Array['isArray'](aV['sales']))continue;for(const aW of aV['sales']){if(typeof aW!=='object'||aW===null)continue;for(const aX of Object['values'](aW)){if(typeof aX==='string')a1['push'](aX);}}}const a2=a1['flatMap'](aY=>extractProseWindowPromises(aY)),a3=collectEnforcedWindowMs(a),a4=a2['filter'](aY=>!a3['has'](aY['ms'])),a5=[];for(const aY of a1){const aZ=UNANCHORED_RESTART_RE['exec'](aY);if(aZ)a5['push'](aZ[0x0]);}const a6=c['filter'](b0=>b0['track']==='refund'),a7=a6['map'](b0=>b0['guardStep']===undefined?undefined:b['get'](b0['guardStep']))['find'](b0=>b0!==undefined&&!b0['queries']['some'](b1=>b1['startsWith']('order.claimed_by')))?.['stepId'],a8=new Map();for(const b0 of d?.['edges']??[]){for(const b1 of b0['guards']){const b2=a8['get'](b1)??[];if(b0['prev']!=='')b2['push'](b0['prev']);if(b0['next']!=='')b2['push'](b0['next']);a8['set'](b1,b2);}}let a9,aa=![];for(const b3 of b['values']()){if(b3['queries']['some'](isPathDependentTimeQuery)){a9??=b3['stepId'];if(d!==undefined){const b4=[...b3['acceptedNodes'],...a8['get'](b3['stepId'])??[]];for(const b5 of b4){if(pathCountCap2(d['edges'],b5)>=0x2){aa=!![],a9=b3['stepId'];break;}}}}if(aa)break;}const ab=[...b['values']()]['flatMap'](b6=>b6['queries']);let ac;for(const b6 of WRITE_ONLY_ENFORCEMENT_SOURCES){for(const b7 of createsOf(a,b6['object'])){if(b6['extract'](b7)&&!ab['some'](b8=>b8['startsWith'](b6['coverQuery']))){ac=b6['param'];break;}}if(ac!==undefined)break;}const ad=new Set();for(const b8 of a['steps']){if(b8['op']==='create'&&b8['object']==='guard')continue;const b9=refsOf(b8['op']==='publish'?b8['target']:b8['params']);for(const ba of b9)ad['add'](ba);if(b8['op']==='configure'){for(const bb of refsOf(b8['target']))ad['add'](bb);}}const ae=[...b['keys']()]['find'](bc=>!ad['has'](bc)),af=[...b['values']()]['find'](bc=>!h&&bc['queries']['some'](bd=>bd['startsWith']('repository.')))?.['stepId'];let ag;if(f&&d!==undefined)for(const bc of d['forwardGuardRefs']){const bd=b['get'](bc);if(bd===undefined)continue;const be=bd['table']['some'](bf=>bf['identifier']===TASK_BINDING_SLOT&&bf['b_submission']===!![]);if(!be){ag=bc;break;}}let ah;for(const bf of c){if(bf['guardStep']===undefined||bf['identifierLegs']['length']===0x0)continue;const bg=b['get'](bf['guardStep']);if(bg===undefined)continue;for(const bh of bf['identifierLegs']){const bi=bg['table']['find'](bj=>bj['identifier']===bh);if(bi===undefined||bi['b_submission']!==!![]||bi['value_type']!=='Address'){ah='slot\x20'+bh+'\x20of\x20guard\x20\x27'+bf['guardStep']+'\x27';break;}}if(ah!==undefined)break;}const ai=new Set();for(const bj of createsOf(a,'repository')){const bk=bj['params']['policies'];if(!Array['isArray'](bk))continue;for(const bl of bk){const bm=bl?.['name'];if(typeof bm==='string')ai['add'](bm);}}const aj=[];if(ai['size']>0x0)for(const bn of createsOf(a,'guard')){const bo=Array['isArray'](bn['params']['table'])?bn['params']['table']:[];for(const bp of collectRepoWhereQueries(bn['params']['root']??bn['params']['logic'])){const bq=staticStringOperand(bp['key'],bo);if(bq===undefined)continue;if(!isPlanLocalObjectOperand(bp['object'],bo))continue;!ai['has'](bq)&&aj['push']('\x27'+bq+'\x27\x20in\x20guard\x20\x27'+bn['id']+'\x27');}}const ak=new Set();for(const br of createsOf(a,'repository')){const bs=br['params']['policies'];if(!Array['isArray'](bs))continue;for(const bt of bs){const bu=bt?.['write_guard'];if(!Array['isArray'](bu))continue;for(const bv of bu){const bw=bv?.['guard'],bx=isRef(bw)?bw['$ref']:bw;if(typeof bx==='string')ak['add'](bx);}}}let al,am=0x0;for(const by of createsOf(a,'guard')){if(!ak['has'](by['id']))continue;rootNegatesRepoDataHas(by['params']['root']??by['params']['logic'])&&(am++,al??=by['id']);}let an,ao=0x0;for(const bz of createsOf(a,'service')){const bA=bz['params']['customer_required'];if(!Array['isArray'](bA)||bA['length']===0x0)continue;bz['params']['buy_guard']===undefined&&(ao++,an??=bz['id']);}let ap,aq=0x0;for(const bB of d?.['edges']??[]){if(bB['prev']===''||bB['guards']['length']===0x0)continue;for(const bC of bB['guards']){const bD=b['get'](bC);if(bD===undefined||bD['acceptedNodes']['length']===0x0)continue;!bD['acceptedNodes']['includes'](bB['prev'])&&(aq++,ap??=bC+'\x20on\x20edge\x20'+bB['prev']+'->'+bB['next']+'\x20(guard\x20pins\x20progress.current\x20in\x20'+('['+bD['acceptedNodes']['join'](',\x20')+']\x20—\x20never\x20\x27'+bB['prev']+'\x27)'));}}const ar=[];for(const bE of createsOf(a,'guard')){const bF=reachLegsOf(bE);ar['push'](...findReachContradictions(bE['id'],bF['legs'],bF['selfStrict']));}return{'has_service':f,'has_machine':d!==undefined,'has_repository':h,'sales_step_present':i,'allocator_row_count':c['length'],'refund_row_count':a6['length'],'terminal_count':l['length'],'terminal_nodes_display':l['join'](',\x20'),'pending_allocator_guard_count':x,'pending_guard_total':w['length'],...u===undefined?{}:{'first_uncovered_terminal':u},...a7===undefined?{}:{'first_refund_guard_missing_claimed_by':a7},...a9===undefined?{}:{'first_path_dependent_anchor':a9},'path_sensitive':aa,...ac===undefined?{}:{'first_write_only_unenforced_field':ac},...ae===undefined?{}:{'first_orphan_guard':ae},...af===undefined?{}:{'first_repo_query_without_repository':af},'repo_write_once_guard_count':am,...al===undefined?{}:{'first_repo_write_once_guard':al},'customer_required_unbacked_count':ao,...an===undefined?{}:{'first_customer_required_unbacked':an},...ag===undefined?{}:{'first_edge_guard_missing_254':ag},'node_mismatched_guard_count':aq,...ap===undefined?{}:{'first_node_mismatched_guard':ap},'guard_reach_contradiction_count':ar['length'],...ar['length']>0x0?{'first_guard_reach_contradiction':ar[0x0],'guard_reach_contradiction_display':ar['join'](';\x20')}:{},...ah===undefined?{}:{'first_alloc_slot_missing':ah},...A===undefined?{}:{'first_pending_fund_guard':A,'pending_fund_guard_count':y['length'],'pending_fund_guard_keys_display':y['map'](bG=>bG['key'])['join'](',\x20')},...B===undefined?{}:{'first_pending_buy_guard':B,'pending_buy_guard_count':z['length'],'pending_buy_guard_keys_display':z['map'](bG=>bG['key'])['join'](',\x20')},'has_return_rail':C!==undefined,...C===undefined?{}:{'return_rail_node':C},'has_arbitration_binding':D,'fund_topup_present':F,...E===undefined?{}:{'fund_topup_amount':E},...J?{'fund_ceiling_breach':E<MAX_INDEMNITY_MULTIPLE*G,'fund_ceiling_basis':MAX_INDEMNITY_MULTIPLE+'x\x20the\x20highest\x20SKU\x20price','fund_concurrent_orders_coverable':Math['floor'](E/(MAX_INDEMNITY_MULTIPLE*G))}:{},'fund_ceiling_unverifiable':F&&!J,...L!==undefined?{'reward_bounty_amount':L,...M!==undefined?{'reward_funding_amount':M}:{},...M!==undefined&&L>0x0?{'reward_max_claims':Math['floor'](M/L)}:{},...N?{'lowest_sku_price':H,'reward_scale_breach':L>0.5*H,'reward_scale_ratio_display':(L/H)['toFixed'](0x2)+'x\x20the\x20cheapest\x20SKU\x20price'}:{'reward_scale_unverifiable':!![]}}:{},...R?{'first_arb_exit_node':Q,'fund_arb_route_unfunded':!![]}:{},...V===undefined?{}:{'entry_no_open_exit':!![],'entry_strand_node':V},...Z&&a0!==undefined?{'arb_promise_without_settle_rail':!![],'arb_promise_node':a0}:{},...X['length']>0x0&&W&&a0!==undefined?{'arb_key_plane_opaque':!![],'arb_key_plane_node':a0}:{},...a2['length']>0x0?{'prose_window_promise_count':a2['length'],'enforced_window_ms_display':[...a3]['sort']((bG,bH)=>bG-bH)['map'](formatMs)['join'](',\x20')||'none',...a4['length']>0x0?{'prose_time_mismatch_count':a4['length'],'first_prose_time_mismatch':a4[0x0]['quote'],'prose_time_mismatch_display':a4['map'](bG=>bG['quote'])['join'](';\x20')}:{}}:{},...a5['length']>0x0?{'unanchored_window_promise_count':a5['length'],'first_unanchored_window_promise':a5[0x0]}:{},...ai['size']>0x0?{'repo_policy_keys_display':[...ai]['join'](',\x20'),...aj['length']>0x0?{'repo_gate_key_unbacked_count':aj['length'],'first_repo_gate_key_unbacked':aj[0x0],'repo_gate_key_unbacked_display':aj['join'](',\x20')}:{}}:{}};}function planRuleBook(){const a=getJudgmentDoc()['rules']['domains']['plan'];if(!a)throw new Error('factory\x20rule\x20pack\x20\x27plan\x27\x20missing\x20—\x20broken\x20installation');return a['rules'];}export function auditPlan(a){const b=validatePlan(a),c=planFacts(a),{findings:d}=evaluateRuleBook(planRuleBook(),c),e=b['length']>0x0||d['some'](g=>g['level']==='critical'||g['level']==='high');return{'issues':b,'findings':d,'facts':c,'blocking':e};}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { IndustryTemplate } from "../knowledge/template-loader.js";
|
|
2
2
|
import type { JsonValue, Plan } from "./plan.js";
|
|
3
|
-
export type CompilableTemplate = Pick<IndustryTemplate, "id" | "machine_shape" | "guards" | "allocator" | "fee_params" | "arbitration_mode" | "conditional_guards" | "review_mode" | "after_sales_mode" | "acceptance_mode" | "installment_mode" | "affiliate_mode" | "crowdfunding_mode" | "compensation_fund_policy"> & {
|
|
3
|
+
export type CompilableTemplate = Pick<IndustryTemplate, "id" | "machine_shape" | "guards" | "allocator" | "fee_params" | "arbitration_mode" | "conditional_guards" | "review_mode" | "after_sales_mode" | "acceptance_mode" | "installment_mode" | "affiliate_mode" | "crowdfunding_mode" | "logistics_mode" | "compensation_fund_policy"> & {
|
|
4
4
|
build_notes?: string[];
|
|
5
5
|
};
|
|
6
6
|
export interface GuardSpec {
|
|
@@ -32,7 +32,7 @@ export type GuardResolution = {
|
|
|
32
32
|
} | {
|
|
33
33
|
kind: "omit";
|
|
34
34
|
};
|
|
35
|
-
export type CompileBlockerCode = "MACHINE_EDGES_MISSING" | "EDGE_UNKNOWN_PREV" | "GUARD_CYCLE" | "GUARD_KEY_UNKNOWN" | "GUARD_TEMPLATE_PARAMS" | "GUARD_PATTERN_UNKNOWN" | "GUARD_RESOLUTION_UNKNOWN" | "GUARD_OMIT_UNSUPPORTED" | "GUARD_SLOT_UNKNOWN" | "GUARD_FOREIGN_SERVICE" | "ALLOCATOR_VALUE_MISSING" | "ALLOCATOR_FIX_UNSUPPORTED" | "REVIEW_NODE_MISSING" | "REVIEW_REWARD_GUARD_MISSING" | "REVIEW_REWARD_UNFUNDED" | "REVIEW_REWARD_AMOUNT_MISSING" | "REVIEW_REWARD_EVIDENCE_NO_STAMP" | "COMPENSATION_FUND_REQUIRED" | "REVIEW_REWARD_UNARMED" | "AFTER_SALES_RAIL_MISSING" | "ACCEPTANCE_JUDGE_NOT_INDEPENDENT" | "ACCEPTANCE_REVISION_UNBOUNDED" | "INSTALLMENT_FUNDING_UNGATED" | "INSTALLMENT_DEPOSIT_STRANDED" | "REPO_GUARD_POLICY_MISSING" | "REPO_GUARD_SUBMISSION_ID_FORBIDDEN" | "REPO_GUARD_SUBMISSION_SLOT_UNKNOWN" | "RAIL_TERMINAL_UNCOVERED" | "RAIL_AWARD_EXIT_MISSING" | "RAIL_POLARITY_COLLISION" | "RAIL_DEAD_LITERAL" | "FORWARD_GUARD_PINNED_TO_NON_PREV" | "FORWARD_GUARD_IDENTITY_PERM_CONFLICT" | "GUARD_IDENTITY_SLOT_NOT_TASKBOUND" | "PAIR_THRESHOLD_UNREACHABLE" | "PAIR_THRESHOLD_SINGLE_OPERATOR" | "AFFILIATE_RAIL_MISSING" | "AFFILIATE_CLAWBACK_UNDISCLOSED" | "CROWDFUNDING_THRESHOLD_GATE_MISSING" | "CROWDFUNDING_AGGREGATE_UNBOUND" | "CROWDFUNDING_SIGNER_KEYED_ROWS" | "CROWDFUNDING_DISCLOSURE_MISSING" | "PERMISSION_INDEX_DROPPED";
|
|
35
|
+
export type CompileBlockerCode = "MACHINE_EDGES_MISSING" | "EDGE_UNKNOWN_PREV" | "GUARD_CYCLE" | "GUARD_KEY_UNKNOWN" | "GUARD_TEMPLATE_PARAMS" | "GUARD_PATTERN_UNKNOWN" | "GUARD_RESOLUTION_UNKNOWN" | "GUARD_OMIT_UNSUPPORTED" | "GUARD_SLOT_UNKNOWN" | "GUARD_FOREIGN_SERVICE" | "ALLOCATOR_VALUE_MISSING" | "ALLOCATOR_COMPLEMENT_INVALID" | "ALLOCATOR_FIX_UNSUPPORTED" | "REVIEW_NODE_MISSING" | "REVIEW_REWARD_GUARD_MISSING" | "REVIEW_REWARD_UNFUNDED" | "REVIEW_REWARD_AMOUNT_MISSING" | "REVIEW_REWARD_EVIDENCE_NO_STAMP" | "COMPENSATION_FUND_REQUIRED" | "REVIEW_REWARD_UNARMED" | "AFTER_SALES_RAIL_MISSING" | "ACCEPTANCE_JUDGE_NOT_INDEPENDENT" | "ACCEPTANCE_REVISION_UNBOUNDED" | "INSTALLMENT_FUNDING_UNGATED" | "INSTALLMENT_DEPOSIT_STRANDED" | "REPO_GUARD_POLICY_MISSING" | "REPO_GUARD_SUBMISSION_ID_FORBIDDEN" | "REPO_GUARD_SUBMISSION_SLOT_UNKNOWN" | "RAIL_TERMINAL_UNCOVERED" | "RAIL_AWARD_EXIT_MISSING" | "RAIL_POLARITY_COLLISION" | "RAIL_DEAD_LITERAL" | "FORWARD_GUARD_PINNED_TO_NON_PREV" | "FORWARD_GUARD_IDENTITY_PERM_CONFLICT" | "GUARD_IDENTITY_SLOT_NOT_TASKBOUND" | "PAIR_THRESHOLD_UNREACHABLE" | "PAIR_THRESHOLD_SINGLE_OPERATOR" | "AFFILIATE_RAIL_MISSING" | "AFFILIATE_CLAWBACK_UNDISCLOSED" | "CROWDFUNDING_THRESHOLD_GATE_MISSING" | "CROWDFUNDING_AGGREGATE_UNBOUND" | "CROWDFUNDING_SIGNER_KEYED_ROWS" | "CROWDFUNDING_DISCLOSURE_MISSING" | "POLICY_KEY_UNRESOLVED" | "CREDENTIAL_CYCLE" | "NAMED_OPERATOR_RAIL_CONFLICT" | "NAMED_OPERATOR_ROSTER_UNDISCLOSED" | "FORWARD_GUARD_IDENTITY_NAMED_CONFLICT" | "LOGISTICS_COURIER_RAIL_MISSING" | "LOGISTICS_COURIER_FEE_POOLED" | "LOGISTICS_PICKUP_CUTOFF_MISSING" | "LOGISTICS_CARRIER_EVIDENCE_MISSING" | "LOGISTICS_TRANSIT_LOSS_UNCOVERED" | "LOGISTICS_DISPATCH_UNDISCLOSED" | "PERMISSION_INDEX_DROPPED" | "RELEASE_EDGE_PERMISSIONLESS";
|
|
36
36
|
export declare function normalizeInlineGuardTable(table: unknown[], base: string): unknown[];
|
|
37
37
|
export interface CompileBlocker {
|
|
38
38
|
code: CompileBlockerCode;
|