@wowok/agent-mcp 3.4.1 → 3.4.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/.build-stamp.json +5 -0
- package/dist/chain-semantics/composition-truth.js +1 -1
- package/dist/chain-semantics/eval-order.js +1 -1
- package/dist/chain-semantics/field-capability.js +1 -1
- package/dist/chain-semantics/freeze-map.js +1 -1
- package/dist/chain-semantics/fund-flow.js +1 -1
- package/dist/chain-semantics/guard-verbs.js +1 -1
- package/dist/chain-semantics/object-graph.js +1 -1
- package/dist/composition/audit.js +1 -1
- package/dist/composition/compile.d.ts +10 -3
- package/dist/composition/compile.js +1 -1
- package/dist/composition/emit-phases.d.ts +30 -2
- package/dist/composition/emit-phases.js +1 -1
- package/dist/composition/guard-fill.d.ts +8 -0
- package/dist/composition/guard-fill.js +1 -1
- package/dist/composition/inflight.js +1 -1
- package/dist/composition/input-normalize.js +1 -1
- package/dist/composition/materialize.d.ts +2 -0
- package/dist/composition/materialize.js +1 -1
- package/dist/composition/mode-gates.js +1 -1
- package/dist/composition/param-disclosure.js +1 -1
- package/dist/composition/plan-retry-ledger.d.ts +16 -0
- package/dist/composition/plan-retry-ledger.js +1 -1
- package/dist/composition/plan.d.ts +15 -1
- package/dist/composition/plan.js +1 -1
- package/dist/config/config-audit.spec.js +1 -1
- package/dist/config/judgment.d.ts +5 -0
- package/dist/config/judgment.js +1 -1
- package/dist/evaluation/builtins/arbitration-score.d.ts +1 -0
- package/dist/evaluation/builtins/arbitration-score.js +1 -1
- package/dist/evaluation/builtins/demand-match.js +1 -1
- package/dist/evaluation/builtins/graph-service.d.ts +8 -0
- package/dist/evaluation/builtins/graph-service.js +1 -1
- package/dist/evaluation/capability.d.ts +9 -0
- package/dist/evaluation/engine.js +1 -1
- package/dist/evaluation/extract.d.ts +9 -1
- package/dist/evaluation/extract.js +1 -1
- package/dist/evaluation/match-operation.js +1 -1
- package/dist/evaluation/match-policy.d.ts +5 -3
- package/dist/evaluation/match-policy.js +1 -1
- package/dist/evaluation/standards.d.ts +1 -0
- package/dist/evaluation/standards.js +1 -1
- package/dist/evaluation/structured-lines.js +1 -1
- package/dist/evaluation/types.d.ts +1 -0
- package/dist/extensions/capability.js +1 -1
- package/dist/extensions/industry-pack.js +1 -1
- package/dist/extensions/modes.js +1 -1
- package/dist/harness/recover.js +1 -1
- package/dist/index.js +1 -1
- package/dist/intent/types.d.ts +1 -1
- package/dist/intent/types.js +1 -1
- package/dist/knowledge/allocation-ledger.js +1 -1
- package/dist/knowledge/allocator-rail-verifier.d.ts +17 -1
- package/dist/knowledge/allocator-rail-verifier.js +1 -1
- package/dist/knowledge/arb-fund-facts.d.ts +7 -0
- package/dist/knowledge/arb-fund-facts.js +1 -1
- package/dist/knowledge/arbitration-rail-verifier.d.ts +35 -0
- package/dist/knowledge/arbitration-rail-verifier.js +1 -0
- package/dist/knowledge/arbitration-templates.js +1 -1
- package/dist/knowledge/audit-rules.d.ts +13 -1
- package/dist/knowledge/audit-rules.js +1 -1
- package/dist/knowledge/baselines/judgment-baselines.json +1 -0
- package/dist/knowledge/baselines/rules/guard.json +7 -6
- package/dist/knowledge/baselines/rules/progress.json +4 -4
- package/dist/knowledge/baselines/rules/reward.json +118 -3
- package/dist/knowledge/builtin-templates.d.ts +19 -2
- package/dist/knowledge/builtin-templates.js +1 -1
- package/dist/knowledge/chain-query-registry.d.ts +14 -0
- package/dist/knowledge/chain-query-registry.js +1 -0
- package/dist/knowledge/event-semantics.js +1 -1
- package/dist/knowledge/fee-param-bindings.d.ts +2 -0
- package/dist/knowledge/fee-param-bindings.js +1 -1
- package/dist/knowledge/getting-started.js +1 -1
- package/dist/knowledge/guard-binding-table.js +1 -1
- package/dist/knowledge/guard-binding-verifier.d.ts +7 -0
- package/dist/knowledge/guard-binding-verifier.js +1 -1
- package/dist/knowledge/guard-bindings.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-field-cognition.js +1 -1
- package/dist/knowledge/guard-host-context.js +1 -1
- package/dist/knowledge/guard-lint.js +1 -1
- package/dist/knowledge/guard-node-gates.d.ts +3 -1
- package/dist/knowledge/guard-node-gates.js +1 -1
- package/dist/knowledge/guard-puzzle.js +1 -1
- package/dist/knowledge/guard-render.js +1 -1
- package/dist/knowledge/guard-risk.js +1 -1
- package/dist/knowledge/guard-templates.d.ts +2 -1
- package/dist/knowledge/guard-templates.js +1 -1
- package/dist/knowledge/guard-translation.js +1 -1
- package/dist/knowledge/index.d.ts +2 -0
- package/dist/knowledge/index.js +1 -1
- package/dist/knowledge/industry-registry.js +1 -1
- package/dist/knowledge/jsonrpc-enum.js +1 -1
- package/dist/knowledge/knob-docs.js +1 -1
- package/dist/knowledge/param-schema.d.ts +1 -1
- package/dist/knowledge/param-schema.js +1 -1
- package/dist/knowledge/param-tiers.d.ts +2 -0
- package/dist/knowledge/param-tiers.js +1 -1
- package/dist/knowledge/path-oracle/products/food-delivery.js +1 -1
- package/dist/knowledge/pattern-resolutions.d.ts +2 -0
- package/dist/knowledge/pattern-resolutions.js +1 -1
- package/dist/knowledge/product-detail-source.d.ts +37 -0
- package/dist/knowledge/product-detail-source.js +1 -0
- package/dist/knowledge/product-doc-b5.d.ts +16 -0
- package/dist/knowledge/product-doc-b5.js +1 -0
- package/dist/knowledge/progress-ledger.js +1 -1
- package/dist/knowledge/projection.spec.js +1 -1
- package/dist/knowledge/publish-gate.d.ts +20 -0
- package/dist/knowledge/publish-gate.js +1 -0
- package/dist/knowledge/publish-readiness.d.ts +25 -0
- package/dist/knowledge/publish-readiness.js +1 -0
- package/dist/knowledge/publish-surface-contract.d.ts +16 -0
- package/dist/knowledge/publish-surface-contract.js +1 -0
- package/dist/knowledge/rail-exit-satisfiability.d.ts +25 -0
- package/dist/knowledge/rail-exit-satisfiability.js +1 -0
- package/dist/knowledge/reward-ledger.d.ts +1 -1
- package/dist/knowledge/reward-ledger.js +1 -1
- package/dist/knowledge/reward-risk.d.ts +1 -1
- package/dist/knowledge/reward-risk.js +1 -1
- package/dist/knowledge/scenario-modes.js +1 -1
- package/dist/knowledge/service-ledger.d.ts +3 -1
- package/dist/knowledge/service-ledger.js +1 -1
- package/dist/knowledge/template-loader.d.ts +41 -2
- package/dist/knowledge/template-loader.js +1 -1
- package/dist/knowledge/template-registry.js +1 -1
- package/dist/knowledge/template-scanner.d.ts +17 -0
- package/dist/knowledge/template-scanner.js +1 -1
- package/dist/knowledge/template-test-profiles.js +1 -1
- package/dist/knowledge/workflow-guidance.d.ts +4 -0
- package/dist/knowledge/workflow-guidance.js +1 -1
- package/dist/monitor/MonitorLoop.js +1 -1
- package/dist/monitor/normalize.d.ts +1 -1
- package/dist/monitor/normalize.js +1 -1
- package/dist/monitor/types.js +1 -1
- package/dist/participation/customer-interest.d.ts +4 -0
- package/dist/participation/customer-interest.js +1 -1
- package/dist/participation/game-context.js +1 -1
- package/dist/participation/node-action-advisor.d.ts +4 -0
- package/dist/participation/node-action-advisor.js +1 -1
- package/dist/participation/radar-core.js +1 -1
- package/dist/participation/time-window.d.ts +11 -0
- package/dist/participation/time-window.js +1 -1
- package/dist/playbooks/service-build/business-puzzle.js +1 -1
- package/dist/playbooks/service-build/machine-panorama.js +1 -1
- package/dist/playbooks/service-build/merchant-guide.d.ts +28 -3
- package/dist/playbooks/service-build/merchant-guide.js +1 -1
- package/dist/playbooks/service-build/object-panorama.d.ts +4 -0
- package/dist/playbooks/service-build/object-panorama.js +1 -1
- package/dist/playbooks/service-build/participation-radar.js +1 -1
- package/dist/playbooks/service-build/relationship-profile.js +1 -1
- package/dist/playbooks/service-build/service-panorama.js +1 -1
- package/dist/playbooks/service-build/service-quote.js +1 -1
- package/dist/review/index.js +1 -1
- package/dist/review/order.js +1 -1
- package/dist/safety/confirm-gate.js +1 -1
- package/dist/schema/benchmark-migration/index.d.ts +24 -0
- package/dist/schema/benchmark-migration/index.js +1 -1
- package/dist/schema/call/allocation.d.ts +11 -7
- package/dist/schema/call/allocation.js +1 -1
- package/dist/schema/call/arbitration.d.ts +4 -0
- package/dist/schema/call/arbitration.js +1 -1
- package/dist/schema/call/base.d.ts +28 -0
- package/dist/schema/call/base.js +1 -1
- package/dist/schema/call/bridge.d.ts +21 -0
- package/dist/schema/call/contact.d.ts +4 -0
- package/dist/schema/call/demand.d.ts +4 -0
- package/dist/schema/call/guard.d.ts +12 -0
- package/dist/schema/call/handler.d.ts +1 -0
- package/dist/schema/call/handler.js +1 -1
- package/dist/schema/call/machine.d.ts +16 -8
- package/dist/schema/call/normalize-error.d.ts +1 -0
- package/dist/schema/call/normalize-error.js +1 -0
- package/dist/schema/call/order.d.ts +7 -3
- package/dist/schema/call/order.js +1 -1
- package/dist/schema/call/payment.d.ts +7 -3
- package/dist/schema/call/permission.d.ts +4 -0
- package/dist/schema/call/personal.d.ts +4 -0
- package/dist/schema/call/progress.d.ts +4 -0
- package/dist/schema/call/progress.js +1 -1
- package/dist/schema/call/proof.d.ts +8 -0
- package/dist/schema/call/proof.js +1 -1
- package/dist/schema/call/receipt.js +1 -1
- package/dist/schema/call/repository.d.ts +4 -0
- package/dist/schema/call/reward.d.ts +6 -2
- package/dist/schema/call/reward.js +1 -1
- package/dist/schema/call/semantic.d.ts +2 -2
- package/dist/schema/call/semantic.js +1 -1
- package/dist/schema/call/service.d.ts +21 -7
- package/dist/schema/call/service.js +1 -1
- package/dist/schema/call/treasury.d.ts +10 -6
- package/dist/schema/common/index.js +1 -1
- package/dist/schema/envelope-unify.d.ts +1 -0
- package/dist/schema/envelope-unify.js +1 -1
- package/dist/schema/evaluation/index.d.ts +43 -0
- package/dist/schema/evaluation/index.js +1 -1
- package/dist/schema/goal/index.d.ts +14 -2
- package/dist/schema/goal/planning.d.ts +18 -0
- package/dist/schema/goal/planning.js +1 -1
- package/dist/schema/intent-radar/index.d.ts +12 -0
- package/dist/schema/intent-radar/index.js +1 -1
- package/dist/schema/keeper/index.d.ts +1 -0
- package/dist/schema/local/index.d.ts +10 -0
- package/dist/schema/local/index.js +1 -1
- package/dist/schema/local/wip.js +1 -1
- package/dist/schema/messenger/index.d.ts +1 -0
- package/dist/schema/messenger/index.js +1 -1
- package/dist/schema/operations.d.ts +98 -13
- package/dist/schema/operations.js +1 -1
- package/dist/schema/persona/index.d.ts +22 -0
- package/dist/schema/query/bi.d.ts +28 -2
- package/dist/schema/query/bi.js +1 -1
- package/dist/schema/query/index.d.ts +67 -61
- package/dist/schema/query/index.js +1 -1
- package/dist/schema/schema-version.js +1 -1
- package/dist/schema/workflow/index.js +1 -1
- package/dist/schema-query-impl/index.d.ts +1 -0
- package/dist/schema-query-impl/index.js +1 -1
- package/dist/schemas/account_operation.output.json +2 -1
- package/dist/schemas/benchmark_migration_operation.output.json +74 -0
- package/dist/schemas/benchmark_migration_operation.schema.json +33 -1
- package/dist/schemas/bridge_operation.output.json +2 -1
- package/dist/schemas/bridge_operation.schema.json +40 -0
- package/dist/schemas/evaluation_operation.output.json +96 -0
- package/dist/schemas/evaluation_operation.schema.json +39 -0
- package/dist/schemas/goal_operation.schema.json +32 -0
- package/dist/schemas/guard2file.schema.json +8 -0
- package/dist/schemas/index.json +1 -1
- package/dist/schemas/intent_radar.output.json +10 -2
- package/dist/schemas/intent_radar.schema.json +5 -1
- package/dist/schemas/keeper_operation.output.json +2 -1
- package/dist/schemas/local_cache_operation.output.json +2 -1
- package/dist/schemas/local_history_operation.output.json +2 -1
- package/dist/schemas/local_info_operation.output.json +2 -1
- package/dist/schemas/local_mark_operation.output.json +2 -1
- package/dist/schemas/local_mark_operation.schema.json +10 -1
- package/dist/schemas/machineNode2file.schema.json +8 -0
- package/dist/schemas/messenger_operation.output.json +2 -1
- package/dist/schemas/messenger_operation.schema.json +2 -1
- package/dist/schemas/monitor_events.output.json +2 -1
- package/dist/schemas/monitor_subscription.output.json +2 -1
- package/dist/schemas/onchain_events.output.json +206 -13
- package/dist/schemas/onchain_events.schema.json +16 -0
- package/dist/schemas/onchain_operations.output.json +22 -3
- package/dist/schemas/onchain_operations.schema.json +982 -327
- package/dist/schemas/onchain_operations_allocation.schema.json +20 -13
- package/dist/schemas/onchain_operations_arbitration.schema.json +9 -1
- package/dist/schemas/onchain_operations_contact.schema.json +8 -0
- package/dist/schemas/onchain_operations_demand.schema.json +8 -0
- package/dist/schemas/onchain_operations_gen_passport.schema.json +8 -0
- package/dist/schemas/onchain_operations_gen_proof.schema.json +8 -0
- package/dist/schemas/onchain_operations_guard.schema.json +655 -115
- package/dist/schemas/onchain_operations_machine.schema.json +11 -3
- package/dist/schemas/onchain_operations_order.schema.json +14 -11
- package/dist/schemas/onchain_operations_payment.schema.json +12 -9
- package/dist/schemas/onchain_operations_permission.schema.json +8 -0
- package/dist/schemas/onchain_operations_personal.schema.json +8 -0
- package/dist/schemas/onchain_operations_progress.schema.json +9 -1
- package/dist/schemas/onchain_operations_proof.schema.json +9 -1
- package/dist/schemas/onchain_operations_repository.schema.json +8 -0
- package/dist/schemas/onchain_operations_reward.schema.json +14 -11
- package/dist/schemas/onchain_operations_service.schema.json +25 -12
- package/dist/schemas/onchain_operations_treasury.schema.json +17 -19
- package/dist/schemas/onchain_table_data.output.json +52 -10
- package/dist/schemas/persona_operation.output.json +57 -0
- package/dist/schemas/persona_operation.schema.json +9 -0
- package/dist/schemas/query_toolkit.output.json +326 -23
- package/dist/schemas/query_toolkit.schema.json +18 -5
- package/dist/schemas/wip_file.output.json +2 -2
- package/dist/schemas/wip_file.schema.json +2 -2
- package/dist/schemas/workflow_operation.schema.json +1 -1
- package/dist/tools/error-catalog.d.ts +17 -0
- package/dist/tools/error-catalog.js +1 -0
- package/dist/tools/handlers/benchmark-migration.d.ts +29 -8
- package/dist/tools/handlers/benchmark-migration.js +1 -1
- package/dist/tools/handlers/config.js +1 -1
- package/dist/tools/handlers/entry-edge-recipe.d.ts +101 -0
- package/dist/tools/handlers/entry-edge-recipe.js +1 -0
- package/dist/tools/handlers/escrow-deficit.d.ts +10 -0
- package/dist/tools/handlers/escrow-deficit.js +1 -0
- package/dist/tools/handlers/evaluation.js +1 -1
- package/dist/tools/handlers/fund-rail-recipe.d.ts +10 -0
- package/dist/tools/handlers/fund-rail-recipe.js +1 -0
- package/dist/tools/handlers/intent-radar.js +1 -1
- package/dist/tools/handlers/local.js +1 -1
- package/dist/tools/handlers/mark-namespace.d.ts +30 -0
- package/dist/tools/handlers/mark-namespace.js +1 -0
- package/dist/tools/handlers/messenger.js +1 -1
- package/dist/tools/handlers/onchain-name-registration.d.ts +1 -0
- package/dist/tools/handlers/onchain-name-registration.js +1 -1
- package/dist/tools/handlers/onchain-name-registration.spec.js +1 -1
- package/dist/tools/handlers/onchain.d.ts +40 -1
- package/dist/tools/handlers/onchain.js +1 -1
- package/dist/tools/handlers/publish-binding-echo.d.ts +22 -0
- package/dist/tools/handlers/publish-binding-echo.js +1 -0
- package/dist/tools/handlers/query.d.ts +1 -1
- package/dist/tools/handlers/query.js +1 -1
- package/dist/tools/handlers/review-chain.d.ts +1 -0
- package/dist/tools/handlers/review-chain.js +1 -1
- package/dist/tools/handlers/schema-query.js +1 -1
- package/dist/tools/handlers/stale-build-check.d.ts +9 -0
- package/dist/tools/handlers/stale-build-check.js +1 -0
- package/dist/tools/handlers/submission-assembly.d.ts +55 -0
- package/dist/tools/handlers/submission-assembly.js +1 -0
- package/dist/tools/handlers/wip.js +1 -1
- package/dist/tools/index.d.ts +1 -0
- package/dist/tools/index.js +1 -1
- package/dist/tools/move-fn-index.gen.js +1 -1
- package/dist/tools/publish-gate-state.d.ts +5 -0
- package/dist/tools/publish-gate-state.js +1 -0
- package/dist/tools/registry/business.js +1 -1
- package/dist/tools/registry/onchain.js +1 -1
- package/dist/tools/registry/query.js +1 -1
- package/dist/tools/retry.js +1 -1
- package/dist/tools/runtime-health.js +1 -1
- package/dist/tools/shared.js +1 -1
- package/dist/tools/upgrade-check.d.ts +1 -0
- package/dist/tools/upgrade-check.js +1 -1
- package/dist/tools/wip-verify-ledger.d.ts +2 -0
- package/dist/tools/wip-verify-ledger.js +1 -1
- package/dist/tools/wrap.d.ts +15 -1
- package/dist/tools/wrap.js +1 -1
- package/package.json +5 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
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\x20the\x20Order,\x20the\x20on-chain\x20purchase\x20entry)','order-bound\x20Allocation\x20creation\x20(splits\x20coin,\x20sets\x20payment_info.for_object=order,\x20on\x20the\x20order-bound\x20funding\x20path)'],'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':['the\x20allocation\x20release\x20(on-chain\x20allocation\x20entry)','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\x20on-chain\x20allocation\x20path\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(arbitrations\x20whitelist\x20+\x20E33\x20conflict\x20check\x20on\x20chain)','arbitration.compensate\x20->\x20order.compensate\x20writes\x20claimed_by','compensation_fund\x20split\x20->\x20public\x20transfer\x20to\x20order.owner\x20(on-chain\x20payout\x20to\x20the\x20order\x20owner)'],'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':['the\x20order\x27s\x20indemnity\x20accounting\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':0x126,'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(on-chain\x20allocation\x20rule)','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':0x157,'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(public\x20transfer\x20to\x20self.owner)'],'invariants':['only\x20order.owner\x20receives'],'sources':[{'file':'order.move','line':0x15c,'pattern':'owner_receive'}]},'reward_claim':{'kind':'exit','summary':'Reward\x20pool\x20exit\x201\x20(incentive):\x20guard+passport\x20gated\x20claim\x20transfers\x20coin\x20to\x20recipient.','path':['the\x20reward\x20claim\x20->\x20coin\x20to\x20recipient\x20(on-chain\x20reward\x20pool\x20exit)'],'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(the\x20on-chain\x20balance-recovery\x20rail),\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;\x20the\x20payment\x20receipt\x20is\x20minted\x20on\x20chain','unwrap=true\x20(single\x20PTB):\x20the\x20receipt\x20is\x20unwrapped\x20to\x20the\x20transaction\x20sender\x20in\x20the\x20same\x20transaction'],'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':0x2e5,'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(on-chain\x20quote\x20step)','the\x20buy\x20path\x20destroys\x20the\x20coupon\x20after\x20capturing\x20its\x20semantics\x20(on-chain\x20burn\x20at\x20purchase)'],'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\x20the\x20Order,\x20the\x20on-chain\x20purchase\x20entry)','order-bound\x20Allocation\x20creation\x20(splits\x20coin,\x20sets\x20payment_info.for_object=order,\x20on\x20the\x20order-bound\x20funding\x20path)'],'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':0x212,'pattern':'buy2_imp'},{'file':'service.move','line':0x1df,'pattern':'order_allocation'}]},'exit_alloc':{'kind':'exit','summary':'Escrow\x20exit\x201\x20(settlement\x20/\x20refund):\x20guard-matched\x20allocators\x20distribute\x20the\x20pool.','path':['the\x20allocation\x20release\x20(on-chain\x20allocation\x20entry)','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\x20on-chain\x20allocation\x20path\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':0x6bd,'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(arbitrations\x20whitelist\x20+\x20E33\x20conflict\x20check\x20on\x20chain)','arbitration.compensate\x20->\x20order.compensate\x20writes\x20claimed_by','compensation_fund\x20split\x20->\x20public\x20transfer\x20to\x20order.owner\x20(on-chain\x20payout\x20to\x20the\x20order\x20owner)'],'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':0x24c,'pattern':'compensation_claim'},{'file':'service.move','line':0x265,'pattern':'order::owner(order)'},{'file':'order.move','line':0x7c,'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':['the\x20order\x27s\x20indemnity\x20accounting\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':0x126,'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(on-chain\x20allocation\x20rule)','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':0x1df,'pattern':'order_allocation'},{'file':'order.move','line':0x157,'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(public\x20transfer\x20to\x20self.owner)'],'invariants':['only\x20order.owner\x20receives'],'sources':[{'file':'order.move','line':0x15c,'pattern':'owner_receive'}]},'reward_claim':{'kind':'exit','summary':'Reward\x20pool\x20exit\x201\x20(incentive):\x20guard+passport\x20gated\x20claim\x20transfers\x20coin\x20to\x20recipient.','path':['the\x20reward\x20claim\x20->\x20coin\x20to\x20recipient\x20(on-chain\x20reward\x20pool\x20exit)'],'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(the\x20on-chain\x20balance-recovery\x20rail),\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;\x20the\x20payment\x20receipt\x20is\x20minted\x20on\x20chain','unwrap=true\x20(single\x20PTB):\x20the\x20receipt\x20is\x20unwrapped\x20to\x20the\x20transaction\x20sender\x20in\x20the\x20same\x20transaction'],'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':0x2e5,'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(on-chain\x20quote\x20step)','the\x20buy\x20path\x20destroys\x20the\x20coupon\x20after\x20capturing\x20its\x20semantics\x20(on-chain\x20burn\x20at\x20purchase)'],'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':0x227,'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(invoked\x20on\x20every\x20guard\x20check)','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,\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':
|
|
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(invoked\x20on\x20every\x20guard\x20check)','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,\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':0x8f,'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':0x50,'pattern':'time:\x20u64'}]}];export const STABLE_TIME_QUERIES=[{'queryPrefix':'order.time','semantics':'Order\x20creation\x20time.\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':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.\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—\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\x20never\x20shared.\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':0x86,'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.\x20The\x20passport-based\x20id-data\x20removal\x20call\x20always\x20aborts\x20(A-8).','source':{'file':'repository.move','line':0x2db,'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—\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\x20never\x20shared.\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 +1 @@
|
|
|
1
|
-
import{getJudgmentDoc}from'../config/judgment.js';import{evaluateRuleBook}from'../config/rule-engine.js';import{COMPOSITION_VARIANTS,disclosuresFor,primitivesForVariant,isPathDependentTimeQuery}from'../chain-semantics/index.js';import{MAX_INDEMNITY_MULTIPLE,ONCE_SLOT_BYTES,TASK_BINDING_SLOT}from'../knowledge/onchain-constants.js';import{numericAmount}from'../knowledge/audit-rules.js';import{SKU_NAME_MAX_BYTES,skuNameByteLen}from'../knowledge/sku-name-gate.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;}const REPO_ROW_READ_TYPES=new Set(['query_repository_data_has','query_repository_data','query_repository_data_count_where','query_repository_data_sum_where','query_repository_data_sum_where_bound','query_repository_data_find_where','query_repository_data_keys_where']);function subtreeReadsRepositoryRow(a){if(Array['isArray'](a))return a['some'](subtreeReadsRepositoryRow);if(typeof a!=='object'||a===null)return![];const b=a,c=b['type'];if(typeof c==='string'&&REPO_ROW_READ_TYPES['has'](c))return!![];if(c==='query'){const d=b['query'];if(typeof d==='string'&&d['startsWith']('repository.data'))return!![];if(d===0x48e||d===0x48f||d===0x495||d===0x496||d===0x498||d===0x499)return!![];}return Object['values'](b)['some'](subtreeReadsRepositoryRow);}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);}const SYSTEM_ENTITY_ADDRESS='0xaab',WRITE_GUARD_PROMISE_RE=/\b(?:only\s+\w+|must\s+(?:be|bind)\w*|restrict\w*|whitelist\w*|allowlist\w*|allow\s+list\b|authoriz\w*|permissioned|vetted|pre-?approv\w*|approved\s+\w+)\b/i,WRITE_GUARD_TAUTOLOGY_DISCLOSURE_RE=/\b(?:tautolog\w*|self[- ]?report\w*|self[- ]?assert\w*)\b/i;function writeGuardLegClass(a,b){const c=new Map();if(Array['isArray'](b))for(const j of b){if(typeof j==='object'&&j!==null){const k=j;if(typeof k['identifier']==='number')c['set'](k['identifier'],k);}}const d=l=>typeof l==='object'&&l!==null&&l['type']==='context'&&l['context']==='Signer',e=l=>{if(Array['isArray'](l))return l['some'](e);if(typeof l!=='object'||l===null)return![];const m=l;if(m['type']==='context'&&m['context']==='Signer')return!![];return Object['values'](m)['some'](e);},f=l=>{if(typeof l!=='object'||l===null)return![];const m=l;if(m['type']==='identifier'){const n=c['get'](m['identifier']);if(n===undefined||n['b_submission']===!![])return![];const o=n['value'];return typeof o==='string'&&o['trim']()!==''&&!o['includes']('${');}if(m['type']==='constant'){const p=m['value'];if(typeof p!=='string'||p['includes']('${'))return![];if(p['trim']()['toLowerCase']()===SYSTEM_ENTITY_ADDRESS)return![];return!![];}if(m['type']==='query')return!![];return![];};let g=![];const h=(l,m)=>{if(Array['isArray'](l)){let u=![];for(const w of l)u=h(w,m)||u;return u;}if(typeof l!=='object'||l===null)return![];const n=l,o=n['type'];if(o==='logic_not'){const x=n['node']??(Array['isArray'](n['nodes'])?n['nodes'][0x0]:undefined);return x!==undefined?h(x,m+0x1):![];}if((o==='logic_and'||o==='logic_or')&&Array['isArray'](n['nodes'])){const y=n['nodes'];let z=![],A=!![];for(const B of y){const C=h(B,m);z=z||C;if(!C)A=![];}return o==='logic_and'?z:z&&A;}if(typeof o==='string'&&o['startsWith']('query')&&e(n)&&m%0x2===0x0)return g=!![],!![];const p=Array['isArray'](n['nodes'])?n['nodes']:undefined,q=p?.[0x0]??n['left'],r=p?.[0x1]??n['right'];if(o==='vec_contains_address'&&q!==undefined&&r!==undefined){const D=d(q)?r:d(r)?q:undefined;if(D===undefined||m%0x2!==0x0)return![];g=!![];const E=D,F=E['type']==='identifier'?c['get'](E['identifier']):undefined;if(F===undefined||F['b_submission']===!![])return![];const G=F['value'];if(Array['isArray'](G))return G['length']>0x0;if(typeof G!=='string'||G['trim']()===''||G['includes']('${'))return![];try{const H=JSON['parse'](G);return Array['isArray'](H)&&H['length']>0x0;}catch{return![];}}if(o==='logic_equal'&&q!==undefined&&r!==undefined){if(m%0x2!==0x0||!(d(q)||d(r)))return![];return g=!![],f(d(q)?r:q);}let s=![];for(const I of Object['values'](n)){if(typeof I==='object'&&I!==null)s=h(I,m)||s;}return s;},i=h(a,0x0);return{'hasSignerLeg':g,'hasBindingLeg':i};}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']:[];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':[],'finalRoleNodes':[],'cancelledNodes':[]};const d=[],e=[],h=o=>({'name':typeof o?.['name']==='string'?o['name']:'','roster':typeof o?.['namedOperator']==='string'?o['namedOperator']:typeof o?.['named_operator']==='string'?o['named_operator']:undefined,'perm':typeof o?.['permissionIndex']==='number'?o['permissionIndex']:typeof o?.['permission_index']==='number'?o['permission_index']:undefined}),i=[],j=[],k=[],l=[];for(const o of c){if(typeof o!=='object'||o===null)continue;const q=o,r=typeof q['name']==='string'?q['name']:undefined;if(r===undefined)continue;d['push'](r);const s=typeof q['role']==='string'?q['role']:undefined;if(s==='final'||s==='cancelled')k['push'](r);if(s==='cancelled')l['push'](r);if(q['optional']===!![])i['push'](r);const t=Array['isArray'](q['pairs'])?q['pairs']:[];for(const u of t){const v=u,w=v?.['prev_node'],x=Array['isArray'](v?.['forwards'])?v['forwards']:[],y=[],z=[],A=[];for(const B of x){const C=B,D=C?.['guard'];isRef(D)&&(y['push'](D['$ref']),j['push'](D['$ref']));if(typeof C?.['name']==='string')z['push'](C['name']);A['push'](h(C));}if(typeof w==='string')e['push']({'prev':w,'next':r,'guards':y,'forwardNames':z,'forwardRails':A});}}const m=b['params']['pairs'];if(Array['isArray'](m))for(const E of m){const F=E;if(typeof F?.['prev_node']==='string'&&typeof F?.['next_node']==='string'){const G=Array['isArray'](F['forwards'])?F['forwards']:[],H=[],I=[],J=[];for(const K of G){const L=K,M=L?.['guard'];isRef(M)&&(H['push'](M['$ref']),j['push'](M['$ref']));if(typeof L?.['name']==='string')I['push'](L['name']);J['push'](h(L));}e['push']({'prev':F['prev_node'],'next':F['next_node'],'guards':H,'forwardNames':I,'forwardRails':J});}}const n=new Set(e['filter'](N=>N['prev']!==''&&N['prev']!==N['next'])['map'](N=>N['prev']));return{'nodes':d,'edges':e,'terminals':d['filter'](N=>!n['has'](N)),'optionalNodes':i,'forwardGuardRefs':j,'finalRoleNodes':k,'cancelledNodes':l};}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;}function collectSlotQueries(a,b=[]){if(Array['isArray'](a)){for(const d of a)collectSlotQueries(d,b);return b;}if(typeof a!=='object'||a===null)return b;const c=a;if(c['type']==='query'&&typeof c['query']==='string'){const e=c['object'],f=typeof e==='object'&&e!==null?e:undefined;b['push']({'query':c['query'],'slot':typeof f?.['identifier']==='number'?f['identifier']:undefined,'witness':typeof f?.['convert_witness']==='string'?f['convert_witness']:undefined});}for(const g of Object['values'](c))collectSlotQueries(g,b);return b;}function tableRows(a){const b=a['params']['table'];if(!Array['isArray'](b))return[];return b['filter'](c=>typeof c==='object'&&c!==null);}function rowIdentifier(a){return typeof a['identifier']==='number'?a['identifier']:undefined;}function servicePinRowIds(a,b){const c=[],d=f=>{const g=f['object'];return f['type']==='query'&&f['query']==='order.service'&&typeof g==='object'&&g!==null&&g['identifier']===b;},e=f=>{if(Array['isArray'](f)){for(const i of f)e(i);return;}if(typeof f!=='object'||f===null)return;const g=f,h=g['nodes'];if(g['type']==='logic_equal'&&Array['isArray'](h)&&h['length']===0x2)for(const [j,k]of[[h[0x0],h[0x1]],[h[0x1],h[0x0]]]){if(typeof j!=='object'||j===null||typeof k!=='object'||k===null)continue;const l=k;d(j)&&l['type']==='identifier'&&typeof l['identifier']==='number'&&c['push'](l['identifier']);}for(const m of Object['values'](g))e(m);};return e(a),c;}function ownServiceIdentities(a){const b=new Set();for(const c of createsOf(a,'service')){b['add'](c['id']);const d=c['params']['name'];if(typeof d==='string')b['add'](d);}return b;}function pinIsExternal(a,b){if(typeof a==='string')return!b['has'](a);if(typeof a==='object'&&a!==null){const c=a;if(typeof c['$ref']==='string')return!b['has'](c['$ref']);const d=c['$late'];if(typeof d==='object'&&d!==null){const e=d['mark'];if(typeof e==='string')return!b['has'](e);}}return!![];}function guardCompositionShapes(a){const b=[],c=ownServiceIdentities(a),d=repositoryWriteGuardIds(a),e=writeOnceKeyedSlots(a);for(const f of createsOf(a,'guard')){const g=f['params']['root']??f['params']['logic'],h=collectSlotQueries(g),i=h['filter'](s=>s['query']['startsWith']('order.')),j=[...new Set(i['map'](s=>s['slot'])['filter'](t=>t!==undefined&&t!==HOST_ORDER_SLOT&&t!==TASK_BINDING_SLOT&&t!==ONCE_SLOT_BYTES))],k=tableRows(f),l=new Set(k['filter'](s=>s['b_submission']===![]&&s['value_type']==='Address')['map'](s=>rowIdentifier(s))['filter'](s=>s!==undefined)),m=j['flatMap'](t=>servicePinRowIds(g,t))['filter'](s=>l['has'](s)),n=[...new Set(i['filter'](s=>s['query']==='order.service')['map'](s=>s['slot'])['filter'](t=>t!==undefined))],o=new Map(k['map'](s=>[rowIdentifier(s),s['value']])),p=s=>s['flatMap'](t=>servicePinRowIds(g,t))['filter'](t=>l['has'](t)&&pinIsExternal(o['get'](t),c)),q=p(j)['length']>0x0||d['has'](f['id'])&&p(n)['length']>0x0,r=i['filter'](s=>s['query']==='order.owner')['map'](s=>s['slot']);b['push']({'stepId':f['id'],'foreignSlots':j,'paired':subtreeReadsRepositoryRow(g)||k['some'](s=>rowIdentifier(s)===ONCE_SLOT_BYTES&&s['b_submission']===!![])||j['some'](t=>e['get'](f['id'])?.['has'](t)),'pinned':m['length']>0x0,'pinnedRowIds':m,'procurementPin':q,'ownerCrossed':r['includes'](HOST_ORDER_SLOT)&&j['some'](t=>r['includes'](t))});}return b;}function repositoryPoliciesMerged(a){const b=new Map();for(const d of a['steps']){if(d['op']!=='configure'||d['method']!=='policies')continue;const e=d['target'],f=typeof e==='object'&&e!==null&&typeof e['$ref']==='string'?e['$ref']:undefined;if(f===undefined)continue;const g=d['params']['policy'];if(!Array['isArray'](g))continue;const h=b['get'](f)??[];h['push'](...g['filter'](i=>typeof i==='object'&&i!==null)),b['set'](f,h);}const c=[];for(const i of createsOf(a,'repository')){const j=Array['isArray'](i['params']['policies'])?i['params']['policies']:[];c['push']({'step':i,'policies':[...j,...b['get'](i['id'])??[]]});}return c;}function repositoryWriteGuardIds(a){const b=new Set();for(const {policies:c}of repositoryPoliciesMerged(a)){for(const d of c){if(typeof d!=='object'||d===null)continue;const e=d['write_guard'];if(!Array['isArray'](e))continue;for(const f of e){if(typeof f!=='object'||f===null)continue;const h=f['guard'];typeof h==='object'&&h!==null&&typeof h['$ref']==='string'&&b['add'](h['$ref']);}}}return b;}function writeOnceKeyedSlots(a){const b=new Map();for(const {policies:c}of repositoryPoliciesMerged(a)){for(const d of c){if(typeof d!=='object'||d===null)continue;const e=d;if(e['write_once']!==!![])continue;const f=e['write_guard'];if(!Array['isArray'](f))continue;for(const h of f){if(typeof h!=='object'||h===null)continue;const i=h,j=i['id_from_submission'];if(typeof j!=='number'||j===HOST_ORDER_SLOT)continue;const k=i['guard'];if(typeof k!=='object'||k===null)continue;const l=k['$ref'];if(typeof l!=='string')continue;const m=b['get'](l)??new Set();m['add'](j),b['set'](l,m);}}}return b;}function emittedPrimitives(a,b){const c=new Set();for(const d of createsOf(a,'guard')){const e=d['params']['root']??d['params']['logic'];if(subtreeReadsRepositoryRow(e))c['add']('P1');}if(b['some'](f=>f['foreignSlots']['length']>0x0))c['add']('P2');if(b['some'](f=>f['procurementPin']))c['add']('P3');for(const f of createsOf(a,'machine')){const g=f['params']['nodes'];if(!Array['isArray'](g))continue;if(JSON['stringify'](g)['includes']('retained_submission'))c['add']('P3');}if(maxDistinctGuardsPerTrack(a)>0x1)c['add']('P4');if(planHasFormulaSharing(a))c['add']('P5');if(createsOf(a,'reward')['length']>0x0)c['add']('P6');return c;}const HOST_ORDER_SLOT=0x0;function maxDistinctGuardsPerTrack(a){const b=new Map(),c=f=>{const h=f['guard'];if(h!==undefined)return JSON['stringify'](h);if(typeof f['guard_key']==='string')return'key:'+f['guard_key'];return'<unbound>';},d=f=>{if(typeof f==='object'&&f!==null&&!Array['isArray'](f)){const g=f;if(Array['isArray'](g['allocators']))f=g['allocators'];}if(!Array['isArray'](f))return;for(const h of f){if(typeof h!=='object'||h===null)continue;const i=h,j=typeof i['track']==='string'?i['track']:'settlement',k=b['get'](j);if(k===undefined)b['set'](j,new Set([c(i)]));else k['add'](c(i));}};for(const f of a['steps']){if(f['op']==='create'&&f['object']==='service')d(f['params']['order_allocators']);if(f['op']==='configure'&&f['method']==='order_allocators')d(f['params']['allocators']);}let e=0x0;for(const g of b['values']())e=Math['max'](e,g['size']);return e;}function planHasFormulaSharing(a){const b=c=>{if(typeof c==='object'&&c!==null&&!Array['isArray'](c)){const d=c;if(Array['isArray'](d['allocators']))c=d['allocators'];}if(!Array['isArray'](c))return![];return c['some'](e=>{if(typeof e!=='object'||e===null)return![];const f=e['sharing'];if(!Array['isArray'](f))return![];return f['some'](g=>{if(typeof g!=='object'||g===null)return![];const h=g;return h['mode']===0x4||h['formula']!==undefined;});});};for(const c of a['steps']){if(c['op']==='create'&&c['object']==='service'&&b(c['params']['order_allocators']))return!![];if(c['op']==='configure'&&c['method']==='order_allocators'&&b(c['params']['allocators']))return!![];}return![];}function thirdPartyLegs(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=typeof g['track']==='string'?g['track']:'settlement',i=Array['isArray'](g['sharing'])?g['sharing']:[];for(const j of i){if(typeof j!=='object'||j===null)continue;const k=j['who'];if(typeof k!=='object'||k===null)continue;const l=k;if(l['Entity']!==undefined)b['push']({'track':h,'kind':'Entity'});else{if(l['Signer']!==undefined)b['push']({'track':h,'kind':'Signer'});}}}};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 publicFaceStrings(a){const b=[],c={'service':['description','location'],'contact':['description','location'],'proof':['description','proof'],'repository':['description'],'demand':['description']};for(const d of a['steps']){if(d['op']!=='create')continue;const e=c[d['object']];if(e===undefined)continue;for(const h of e){const i=d['params'][h];if(typeof i==='string'&&i['length']>0x0)b['push']({'face':d['object']+'.'+h,'stepId':d['id'],'text':i});}const g=d['params']['sales'];if(Array['isArray'](g))for(const j of g){if(typeof j!=='object'||j===null)continue;const k=j;for(const l of['description','name','title']){const m=k[l];typeof m==='string'&&m['length']>0x0&&b['push']({'face':d['object']+'.sales.'+l,'stepId':d['id'],'text':m});}}}for(const n of a['steps']){if(n['op']!=='configure')continue;const o=JSON['stringify'](n['params']);if(o['includes']('\x22data\x22')){const p=n['params']['data'];typeof p==='string'&&p['length']>0x0&&b['push']({'face':'repository.data','stepId':n['id'],'text':p});}}return b;}const PII_PATTERNS=[{'kind':'email','re':/[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}/},{'kind':'street_number','re':/\b\d{1,6}\s+[A-Za-z\u00c0-\u024f\u4e00-\u9fff]+(?:\s+[A-Za-z\u00c0-\u024f\u4e00-\u9fff]+){0,3}\s+(?:st|street|rd|road|ave|avenue|blvd|ln|lane|dr|drive|way|ct|court|fl|floor|apt|unit|rm|room)\b/i},{'kind':'phone','re':/(?:\+\d{1,3}[\s.-]?)?(?:\(\d{2,4}\)[\s.-]?)?\d{3,4}[\s.-]?\d{4}(?:[\s.-]?\d{2,4})?/,'proseOnly':!![]},{'kind':'national_id','re':/\b\d{15}\b|\b\d{17}[\dXx]\b/,'proseOnly':!![]}];function firstPiiHit(a){for(const b of publicFaceStrings(a)){const c=b['face']!=='repository.data';for(const d of PII_PATTERNS){if(d['proseOnly']===!![]&&!c)continue;if(d['re']['test'](b['text']))return{'face':b['face'],'stepId':b['stepId'],'kind':d['kind']};}}return undefined;}const HASH_SHAPE=/^(?:[a-fA-F0-9]{32}|[a-fA-F0-9]{40}|[a-fA-F0-9]{64}|[A-Za-z0-9+/]{43}={0,1}|[A-Za-z0-9+/]{44})$/,TRACKING_SHAPE=/^(?:[A-Za-z]{2,4}[\s-]?\d{8,15}|\d{1,7}[\s-]\d{4,15})$/;function firstRawTrackingValue(a){for(const b of a['steps']){if(b['op']!=='configure')continue;const c=b['params']['data'];if(typeof c!=='string')continue;const d=c['trim']();if(d['length']===0x0||HASH_SHAPE['test'](d))continue;if(TRACKING_SHAPE['test'](d))return{'stepId':b['id'],'value':d};}return undefined;}function perOrderProofBinding(a){for(const b of createsOf(a,'proof')){const c=JSON['stringify'](b['params']['about']??'');if(c['includes']('order'))return b['id'];}for(const d of a['steps']){if(d['op']!=='configure')continue;if(d['method']!=='required_info'&&d['method']!=='required_info_bind')continue;if(JSON['stringify'](d['params'])['includes']('proof'))return d['id'];}return undefined;}function compositionFacts(a){const b=guardCompositionShapes(a),c=emittedPrimitives(a,b),d=b['filter'](t=>t['foreignSlots']['length']>0x0),e=thirdPartyLegs(a),f=c['has']('P6'),g=typeof a['inputs']['composition_variant']==='string'?a['inputs']['composition_variant']:undefined,h=g!==undefined&&g in COMPOSITION_VARIANTS,i=typeof a['inputs']['fulfillment_axis']==='string'?a['inputs']['fulfillment_axis']:undefined,j=i??(h?COMPOSITION_VARIANTS[g]['fulfillmentAxis']:undefined),k=j==='merchant_procured'||j==='user_procured'||j==='mixed',l=d['length']>0x0||k,m=e['length']>0x0||f,n=h?primitivesForVariant(g)['filter'](s=>!c['has'](s)):[],o=firstPiiHit(a),p={'composition_primitives_emitted':[...c]['sort']()['join'](',\x20'),'composition_cross_order_guard_count':d['length'],'third_party_fulfilment_present':l,'third_party_payout_leg_present':m,'third_party_leg_count':e['length'],'reward_pool_present':f,...j!==undefined?{'fulfillment_axis':j}:{},...g!==undefined?{'composition_variant':g,'composition_variant_known':h}:{}};if(d['length']>0x0){const s=d['find'](w=>!w['paired']),t=d['find'](w=>!w['pinned']),u=j!=='merchant_procured'&&j!=='mixed',v=u?d['find'](w=>!w['ownerCrossed']):undefined;p['first_cross_order_guard']=d[0x0]['stepId'],p['cross_order_slots_display']=d[0x0]['foreignSlots']['join'](',\x20');s!==undefined&&(p['first_cross_order_guard_unpaired']=s['stepId'],p['cross_order_unpaired_count']=d['filter'](w=>!w['paired'])['length']);if(t!==undefined)p['first_cross_order_guard_unpinned']=t['stepId'];if(v!==undefined)p['first_cross_order_guard_no_owner_cross']=v['stepId'];!u&&d['some'](w=>!w['ownerCrossed'])&&(p['cross_order_owner_tie_not_expressible']=!![]);}l&&!m&&(p['third_party_fulfilment_without_payout']=!![]);h&&n['length']>0x0&&(p['composition_variant_missing_primitives']=n['join'](',\x20'),p['composition_variant_missing_count']=n['length']);g==='V3'&&(p['composition_dual_refund_unblockable']=!![],p['composition_disclosure_count']=disclosuresFor('V3')['length']);o!==undefined&&(p['first_pii_public_face']=o['face'],p['first_pii_public_face_step']=o['stepId'],p['first_pii_kind']=o['kind']);const q=firstRawTrackingValue(a);q!==undefined&&(p['first_raw_tracking_value_step']=q['stepId'],p['first_raw_tracking_value']=q['value']);const r=perOrderProofBinding(a);if(r!==undefined)p['per_order_proof_binding_step']=r;return p;}export function planFacts(a){const b=new Map(createsOf(a,'guard')['map'](aM=>[aM['id'],guardProjection(aM)])),c=allocatorRows(a),d=machineProjection(a),f=createsOf(a,'service')['length']>0x0,h=createsOf(a,'repository')['length']>0x0,i=a['steps']['some'](aM=>{if(!(aM['op']==='create'&&aM['object']==='service'||aM['op']==='configure'&&aM['method']==='sales'))return![];const aN=aM['params']['sales'];return Array['isArray'](aN)&&aN['length']>0x0;}),j=new Set();for(const aM of c){const aN=aM['guardStep']===undefined?undefined:b['get'](aM['guardStep']);for(const aO of aN?.['acceptedNodes']??[])j['add'](aO);}const k=new Set(d?.['optionalNodes']??[]),l=(d?.['terminals']??[])['filter'](aP=>!k['has'](aP)),o=new Set(),q=new Set(c['map'](aP=>aP['guardStep'])['filter'](aP=>aP!==undefined));for(const aP of d?.['edges']??[]){if(aP['next']===''||aP['guards']['length']===0x0)continue;for(const aQ of aP['guards']){if(!q['has'](aQ))continue;if((b['get'](aQ)?.['acceptedNodes']['length']??0x0)===0x0)o['add'](aP['next']);}}const u=l['find'](aR=>!j['has'](aR)&&!o['has'](aR)),w=(d?.['finalRoleNodes']??[])['find'](aR=>!j['has'](aR)&&!o['has'](aR)),x=(d?.['edges']??[])['find'](aR=>(d?.['cancelledNodes']??[])['includes'](aR['prev'])&&(aR['forwardNames']['some'](aS=>/review|reward/i['test'](aS))||/review|reward/i['test'](aR['next']))),y=new Set([...d?.['finalRoleNodes']??[],...j,...o]),z=[[/settle|release|payout|\bband\b/i,'settle'],[/recover|award/i,'recover'],[/refund|return/i,'refund'],[/arb|indemnity|dispute/i,'arb']],A=aR=>{const aS=[aR['next'],...aR['forwardNames'],...aR['guards']['flatMap'](aT=>b['get'](aT)?.['queries']??[])];for(const [aT,aU]of z){if(aS['some'](aV=>aT['test'](aV)))return aU;}return undefined;};let B;for(const aR of d?.['edges']??[]){if(aR['next']===''||!y['has'](aR['next']))continue;for(const aS of aR['forwardRails']){const aT=aS['perm']!==undefined&&aS['perm']>0x0;typeof aS['roster']==='string'&&aS['roster']!==''&&!aT&&(B??=aR['prev']+'->'+aR['next']+'\x20(forward\x20'+aS['name']+')');}}const C=new Map();for(const aU of d?.['edges']??[]){if(aU['next']===''||!y['has'](aU['next']))continue;const aV=A(aU);if(aV===undefined)continue;for(const aW of aU['forwardRails']){if(typeof aW['perm']==='number'&&aW['perm']>0x0){const aX=C['get'](aW['perm'])??C['set'](aW['perm'],new Set())['get'](aW['perm']);aX['add'](aV);}}}const D=[...C['entries']()]['find'](([,aY])=>aY['size']>=0x2),E=a['pending_guards']??[],F=E['filter'](aY=>aY['site']==='allocator')['length'],G=E['filter'](aY=>aY['site']==='allocator'||aY['site']==='machine_edge'),H=E['filter'](aY=>aY['site']==='service_buy'),I=G[0x0]?.['key'],J=H[0x0]?.['key'],K=d?.['nodes']['find'](aY=>/return/i['test'](aY)),L=a['steps']['some'](aY=>{if(aY['op']==='configure'&&aY['method']==='arbitrations'){const aZ=aY['params']['objects'];return Array['isArray'](aZ)&&aZ['length']>0x0;}if(aY['op']==='create'&&aY['object']==='service'){const b0=aY['params']['arbitrations'];return Array['isArray'](b0)&&b0['length']>0x0;}return![];});let M,N=![];for(const aY of a['steps']){if(aY['op']==='configure'&&aY['method']==='compensation_fund_add'){N=!![];const aZ=numericAmount(aY['params']['balance']);if(aZ!==undefined)M=(M??0x0)+aZ;}}let O,P;const Q=b0=>{if(!Array['isArray'](b0))return;for(const b1 of b0){const b2=numericAmount(b1?.['price']);b2!==undefined&&b2>0x0&&(O=Math['max'](O??0x0,b2),P=P===undefined?b2:Math['min'](P,b2));}};for(const b0 of a['steps']){if(b0['op']==='create'&&b0['object']==='service')Q(b0['params']['sales']);if(b0['op']==='configure'&&b0['method']==='sales')Q(b0['params']['sales']);}const R=M!==undefined&&O!==undefined;let S,T=0x0,U=0x0;const V=b1=>{if(!Array['isArray'](b1))return;for(const b2 of b1){const b3=b2?.['name'];if(typeof b3!=='string'||b3==='')continue;const b4=skuNameByteLen(b3);b4>SKU_NAME_MAX_BYTES&&(U+=0x1,S===undefined&&(S=b3,T=b4));}};for(const b1 of a['steps']){if(b1['op']==='create'&&b1['object']==='service')V(b1['params']['sales']);if(b1['op']==='configure'&&b1['method']==='sales')V(b1['params']['sales']);}const W=createsOf(a,'reward')['length']>0x0;let X,Y;if(W)for(const b2 of a['steps']){if(b2['op']==='configure'&&b2['method']==='guard_add'){const b3=b2['params']['amount'];if(b3!==undefined&&b3!==null&&b3['type']==='Fixed'){const b4=numericAmount(b3['value']);if(b4!==undefined)X=Math['max'](X??0x0,b4);}}if(b2['op']==='configure'&&b2['method']==='coin_add'&&/^reward/['test'](b2['id'])){const b5=numericAmount(b2['params']['coin']);if(b5!==undefined)Y=(Y??0x0)+b5;}}const Z=X!==undefined&&P!==undefined,a0=/^(arb\.indemnity|arb\.order|arb\.status|order\.dispute)/,a1=/settled|refunded|reviewed|completed|closed|cancel/i;let a2;if(d!==undefined)for(const b6 of d['edges']){if(b6['next']===''||b6['guards']['length']===0x0)continue;if(!a1['test'](b6['prev']))continue;if(b6['guards']['some'](b7=>b['get'](b7)?.['queries']['some'](b8=>a0['test'](b8)))){a2=b6['prev'];break;}}const a3=a2!==undefined&&(!N||M===0x0),a4=new Map();for(const b7 of createsOf(a,'guard')){a4['set'](b7['id'],b7['params']['root']??b7['params']['logic']);}const a5=d?.['edges']??[],a6=b8=>b8['guards']['length']===0x0||b8['guards']['every'](b9=>{const ba=a4['get'](b9);return ba===undefined||guardWindowOpen(ba);});let a7;for(const b8 of a5){if(b8['prev']!==''||b8['next']==='')continue;const b9=a5['filter'](ba=>ba['prev']===b8['next']);if(b9['length']===0x0)continue;if(b9['every'](ba=>!a6(ba)))a7??=b8['next'];}const a8=c['some'](ba=>ba['guardStep']===undefined&&ba['guardKey']!==undefined),a9=a5['filter'](ba=>ba['guards']['length']>0x0&&ba['guards']['some'](bb=>b['get'](bb)?.['queries']['some'](bc=>a0['test'](bc))));let aa=![];if(a9['length']>0x0&&!a8){const ba=new Set(a9['map'](bd=>bd['next'])['filter'](bd=>bd!=='')),bb=new Set(a9['flatMap'](bd=>bd['guards'])),bc=new Set();for(const bd of c){const be=bd['guardStep']===undefined?undefined:b['get'](bd['guardStep']);if(be===undefined)continue;if(be['acceptedNodes']['length']>0x0){for(const bf of be['acceptedNodes'])bc['add'](bf);}else for(const bg of a5){bg['next']!==''&&bg['guards']['includes'](bd['guardStep'])&&bc['add'](bg['next']);}}for(const bh of c){const bi=bh['guardStep']===undefined?undefined:b['get'](bh['guardStep']);if(bi===undefined)continue;if(bi['queries']['some'](bj=>a0['test'](bj))||bb['has'](bh['guardStep'])){aa=!![];break;}}if(!aa)for(const bj of ba){if(bc['has'](bj)){aa=!![];break;}}}const ab=a9['length']>0x0&&!aa&&!a8,ac=a9[0x0]===undefined?undefined:a9[0x0]['prev']!==''?a9[0x0]['prev']:a9[0x0]['next'],ad=[];for(const bk of a['steps']){const bl=bk['op']==='create'&&bk['object']==='service',bm=bk['op']==='configure'&&bk['method']==='sales';if(!bl&&!bm)continue;const bn=bk['params'];if(typeof bn['description']==='string')ad['push'](bn['description']);if(!Array['isArray'](bn['sales']))continue;for(const bo of bn['sales']){if(typeof bo!=='object'||bo===null)continue;for(const bp of Object['values'](bo)){if(typeof bp==='string')ad['push'](bp);}}}const ae=ad['flatMap'](bq=>extractProseWindowPromises(bq)),af=collectEnforcedWindowMs(a),ag=ae['filter'](bq=>!af['has'](bq['ms'])),ah=[];for(const bq of ad){const br=UNANCHORED_RESTART_RE['exec'](bq);if(br)ah['push'](br[0x0]);}const ai=c['filter'](bs=>bs['track']==='refund'),aj=new Map();for(const bs of d?.['edges']??[]){for(const bt of bs['guards']){const bu=aj['get'](bt)??[];if(bs['prev']!=='')bu['push'](bs['prev']);if(bs['next']!=='')bu['push'](bs['next']);aj['set'](bt,bu);}}let ak,al=![];for(const bv of b['values']()){if(bv['queries']['some'](isPathDependentTimeQuery)){ak??=bv['stepId'];if(d!==undefined){const bw=[...bv['acceptedNodes'],...aj['get'](bv['stepId'])??[]];for(const bx of bw){if(pathCountCap2(d['edges'],bx)>=0x2){al=!![],ak=bv['stepId'];break;}}}}if(al)break;}const am=[...b['values']()]['flatMap'](by=>by['queries']);let an;for(const by of WRITE_ONLY_ENFORCEMENT_SOURCES){for(const bz of createsOf(a,by['object'])){if(by['extract'](bz)&&!am['some'](bA=>bA['startsWith'](by['coverQuery']))){an=by['param'];break;}}if(an!==undefined)break;}const ao=new Set();for(const bA of a['steps']){if(bA['op']==='create'&&bA['object']==='guard')continue;const bB=refsOf(bA['op']==='publish'?bA['target']:bA['params']);for(const bC of bB)ao['add'](bC);if(bA['op']==='configure'){for(const bD of refsOf(bA['target']))ao['add'](bD);}}const ap=[...b['keys']()]['find'](bE=>!ao['has'](bE)),aq=[...b['values']()]['find'](bE=>!h&&bE['queries']['some'](bF=>bF['startsWith']('repository.')))?.['stepId'];let ar;if(f&&d!==undefined)for(const bE of d['forwardGuardRefs']){const bF=b['get'](bE);if(bF===undefined)continue;const bG=bF['table']['some'](bH=>bH['identifier']===TASK_BINDING_SLOT&&bH['b_submission']===!![]);if(!bG){ar=bE;break;}}let as;for(const bH of c){if(bH['guardStep']===undefined||bH['identifierLegs']['length']===0x0)continue;const bI=b['get'](bH['guardStep']);if(bI===undefined)continue;for(const bJ of bH['identifierLegs']){const bK=bI['table']['find'](bL=>bL['identifier']===bJ);if(bK===undefined||bK['b_submission']!==!![]||bK['value_type']!=='Address'){as='slot\x20'+bJ+'\x20of\x20guard\x20\x27'+bH['guardStep']+'\x27';break;}}if(as!==undefined)break;}const at=new Set();for(const {policies:bL}of repositoryPoliciesMerged(a)){for(const bM of bL){const bN=bM?.['name'];if(typeof bN==='string')at['add'](bN);}}const au=[];if(at['size']>0x0)for(const bO of createsOf(a,'guard')){const bP=Array['isArray'](bO['params']['table'])?bO['params']['table']:[];for(const bQ of collectRepoWhereQueries(bO['params']['root']??bO['params']['logic'])){const bR=staticStringOperand(bQ['key'],bP);if(bR===undefined)continue;if(!isPlanLocalObjectOperand(bQ['object'],bP))continue;!at['has'](bR)&&au['push']('\x27'+bR+'\x27\x20in\x20guard\x20\x27'+bO['id']+'\x27');}}const av=new Set();for(const {policies:bS}of repositoryPoliciesMerged(a)){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')av['add'](bX);}}}let aw,ax=0x0;for(const bY of createsOf(a,'guard')){if(!av['has'](bY['id']))continue;rootNegatesRepoDataHas(bY['params']['root']??bY['params']['logic'])&&(ax++,aw??=bY['id']);}const ay=new Map(createsOf(a,'guard')['map'](bZ=>[bZ['id'],bZ]));let az,aA=0x0,aB,aC=0x0,aD;for(const {policies:bZ}of repositoryPoliciesMerged(a)){for(const c0 of bZ){const c1=c0,c2=c1['write_guard'];if(!Array['isArray'](c2))continue;const c3=typeof c1['id_from']==='string'?c1['id_from']['toLowerCase']():'none',c4=c3==='none'?'caller-keyed':c3+'-keyed',c5=typeof c1['description']==='string'?c1['description']:'';for(const c6 of c2){const c7=c6?.['guard'],c8=isRef(c7)?c7['$ref']:c7,c9=typeof c8==='string'?ay['get'](c8):undefined;if(c9===undefined)continue;const ca=writeGuardLegClass(c9['params']['root']??c9['params']['logic'],c9['params']['table']);if(!ca['hasSignerLeg']||ca['hasBindingLeg'])continue;const cb='guard\x20\x27'+c9['id']+'\x27\x20(policy\x20\x27'+String(c1['name']??'?')+'\x27,\x20'+c4+')';c3==='signer'||c3==='clock'?(aC++,aB??=cb):(aA++,az??=cb),WRITE_GUARD_PROMISE_RE['test'](c5)&&!WRITE_GUARD_TAUTOLOGY_DISCLOSURE_RE['test'](c5)&&(aD??=cb+'\x20—\x20its\x20description\x20promises\x20a\x20bound\x20writer\x20set\x20the\x20guard\x20legs\x20never\x20encode');}}}let aE,aF=0x0;for(const cc of createsOf(a,'service')){const cd=cc['params']['customer_required'];if(!Array['isArray'](cd)||cd['length']===0x0)continue;cc['params']['buy_guard']===undefined&&(aF++,aE??=cc['id']);}let aG,aH=0x0;for(const ce of d?.['edges']??[]){if(ce['prev']===''||ce['guards']['length']===0x0)continue;for(const cf of ce['guards']){const cg=b['get'](cf);if(cg===undefined||cg['acceptedNodes']['length']===0x0)continue;!cg['acceptedNodes']['includes'](ce['prev'])&&(aH++,aG??=cf+'\x20on\x20edge\x20'+ce['prev']+'->'+ce['next']+'\x20(guard\x20pins\x20progress.current\x20in\x20'+('['+cg['acceptedNodes']['join'](',\x20')+']\x20—\x20never\x20\x27'+ce['prev']+'\x27)'));}}let aI;if(d!==undefined){const ch=(d['edges']['find'](cj=>cj['prev']==='')??{'next':''})['next'],ci=new Set([...d['finalRoleNodes'],...d['optionalNodes']]);for(const cj of d['nodes']){if(ci['has'](cj)||cj===ch)continue;const ck=d['edges']['filter'](cm=>cm['prev']===cj&&cm['next']!==cj);if(ck['length']===0x0)continue;const cl=ck['some'](cm=>cm['guards']['length']===0x0||cm['guards']['some'](cn=>{const co=b['get'](cn);return co===undefined||co['acceptedNodes']['length']===0x0||co['acceptedNodes']['includes'](cj);}));if(!cl)aI??=cj;}}let aJ,aK=0x0;{const cm=new Set(d?.['forwardGuardRefs']??[]);for(const cn of d?.['edges']??[])for(const co of cn['guards'])cm['add'](co);for(const cp of c){const cq=/refund|settle|recover/i['test'](cp['track'])||/refund|settle|recover/i['test'](cp['guardKey']??'');if(!cq||cp['guardStep']===undefined)continue;const cs=b['get'](cp['guardStep']);if(cs===undefined)continue;const ct=cs['acceptedNodes']['length']>0x0||cm['has'](cp['guardStep'])||cs['queries']['includes']('order.dispute.open'),cu=cs['queries']['includes']('order.owner')||cs['queries']['includes']('order.agent\x20has')||cs['queries']['includes']('order.service');if(ct||cu)continue;aK++,aJ??=cp['track']+'\x20row\x20on\x20guard\x20\x27'+(cp['guardKey']??cp['guardStep'])+'\x27\x20('+cp['guardStep']+')\x20—\x20pins\x20no\x20progress\x20node,\x20rides\x20no\x20machine\x20edge,\x20references\x20no\x20order\x20identity\x20or\x20dispute\x20state';}}const aL=[];for(const cv of createsOf(a,'guard')){const cw=reachLegsOf(cv);aL['push'](...findReachContradictions(cv['id'],cw['legs'],cw['selfStrict']));}return{...compositionFacts(a),'has_service':f,'has_machine':d!==undefined,'has_repository':h,'sales_step_present':i,'allocator_row_count':c['length'],'refund_row_count':ai['length'],'terminal_count':l['length'],'terminal_nodes_display':l['join'](',\x20'),'pending_allocator_guard_count':F,'pending_guard_total':E['length'],...u===undefined?{}:{'first_uncovered_terminal':u},...w===undefined?{}:{'first_uncovered_final_node':w},...x===undefined?{}:{'first_cancelled_review_bridge':x['prev']+'\x20->\x20'+x['next']+(x['forwardNames']['length']>0x0?'\x20(forward\x20'+x['forwardNames']['join'](',\x20')+')':'')},...B===undefined?{}:{'first_roster_null_perm_edge':B},...D===undefined?{}:{'coarse_perm_bucket_index':D[0x0],'coarse_perm_bucket_classes':[...D[0x1]]['sort']()['join'](',\x20')},...aI===undefined?{}:{'first_pinned_away_exit_node':aI},'direction_blind_pay_edge_count':aK,...aJ===undefined?{}:{'first_direction_blind_pay_edge':aJ},...ak===undefined?{}:{'first_path_dependent_anchor':ak},'path_sensitive':al,...an===undefined?{}:{'first_write_only_unenforced_field':an},...ap===undefined?{}:{'first_orphan_guard':ap},...aq===undefined?{}:{'first_repo_query_without_repository':aq},'repo_write_once_guard_count':ax,...aw===undefined?{}:{'first_repo_write_once_guard':aw},'tautology_write_guard_count':aA,...az===undefined?{}:{'first_tautology_write_guard':az},'keyed_tautology_write_guard_count':aC,...aB===undefined?{}:{'first_keyed_tautology_write_guard':aB},...aD===undefined?{}:{'first_promise_gap_write_guard':aD},'customer_required_unbacked_count':aF,...aE===undefined?{}:{'first_customer_required_unbacked':aE},...ar===undefined?{}:{'first_edge_guard_missing_254':ar},'node_mismatched_guard_count':aH,...aG===undefined?{}:{'first_node_mismatched_guard':aG},'guard_reach_contradiction_count':aL['length'],...aL['length']>0x0?{'first_guard_reach_contradiction':aL[0x0],'guard_reach_contradiction_display':aL['join'](';\x20')}:{},...as===undefined?{}:{'first_alloc_slot_missing':as},...I===undefined?{}:{'first_pending_fund_guard':I,'pending_fund_guard_count':G['length'],'pending_fund_guard_keys_display':G['map'](cx=>cx['key'])['join'](',\x20')},...J===undefined?{}:{'first_pending_buy_guard':J,'pending_buy_guard_count':H['length'],'pending_buy_guard_keys_display':H['map'](cx=>cx['key'])['join'](',\x20')},'has_return_rail':K!==undefined,...K===undefined?{}:{'return_rail_node':K},'has_arbitration_binding':L,'fund_topup_present':N,...M===undefined?{}:{'fund_topup_amount':M},...R?{'fund_ceiling_breach':M<MAX_INDEMNITY_MULTIPLE*O,'fund_ceiling_basis':MAX_INDEMNITY_MULTIPLE+'x\x20the\x20highest\x20SKU\x20price','fund_concurrent_orders_coverable':Math['floor'](M/(MAX_INDEMNITY_MULTIPLE*O))}:{},'fund_ceiling_unverifiable':N&&!R,...X!==undefined?{'reward_bounty_amount':X,...Y!==undefined?{'reward_funding_amount':Y}:{},...Y!==undefined&&X>0x0?{'reward_max_claims':Math['floor'](Y/X)}:{},...Z?{'lowest_sku_price':P,'reward_scale_breach':X>0.5*P,'reward_scale_ratio_display':(X/P)['toFixed'](0x2)+'x\x20the\x20cheapest\x20SKU\x20price'}:{'reward_scale_unverifiable':!![]}}:{},...U>0x0?{'dead_sku_count':U,'first_dead_sku_name':S,'first_dead_sku_bytes':T}:{},...a3?{'first_arb_exit_node':a2,'fund_arb_route_unfunded':!![]}:{},...a7===undefined?{}:{'entry_no_open_exit':!![],'entry_strand_node':a7},...ab&&ac!==undefined?{'arb_promise_without_settle_rail':!![],'arb_promise_node':ac}:{},...a9['length']>0x0&&a8&&ac!==undefined?{'arb_key_plane_opaque':!![],'arb_key_plane_node':ac}:{},...ae['length']>0x0?{'prose_window_promise_count':ae['length'],'enforced_window_ms_display':[...af]['sort']((cx,cy)=>cx-cy)['map'](formatMs)['join'](',\x20')||'none',...ag['length']>0x0?{'prose_time_mismatch_count':ag['length'],'first_prose_time_mismatch':ag[0x0]['quote'],'prose_time_mismatch_display':ag['map'](cx=>cx['quote'])['join'](';\x20')}:{}}:{},...ah['length']>0x0?{'unanchored_window_promise_count':ah['length'],'first_unanchored_window_promise':ah[0x0]}:{},...at['size']>0x0?{'repo_policy_keys_display':[...at]['join'](',\x20'),...au['length']>0x0?{'repo_gate_key_unbacked_count':au['length'],'first_repo_gate_key_unbacked':au[0x0],'repo_gate_key_unbacked_display':au['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{COMPOSITION_VARIANTS,disclosuresFor,primitivesForVariant,isPathDependentTimeQuery}from'../chain-semantics/index.js';import{MAX_INDEMNITY_MULTIPLE,ONCE_SLOT_BYTES,TASK_BINDING_SLOT}from'../knowledge/onchain-constants.js';import{numericAmount}from'../knowledge/audit-rules.js';import{SKU_NAME_MAX_BYTES,skuNameByteLen}from'../knowledge/sku-name-gate.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_sum_where_bound_all','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;}const REPO_ROW_READ_TYPES=new Set(['query_repository_data_has','query_repository_data','query_repository_data_count_where','query_repository_data_sum_where','query_repository_data_sum_where_bound','query_repository_data_sum_where_bound_all','query_repository_data_find_where','query_repository_data_keys_where']);function subtreeReadsRepositoryRow(a){if(Array['isArray'](a))return a['some'](subtreeReadsRepositoryRow);if(typeof a!=='object'||a===null)return![];const b=a,c=b['type'];if(typeof c==='string'&&REPO_ROW_READ_TYPES['has'](c))return!![];if(c==='query'){const d=b['query'];if(typeof d==='string'&&d['startsWith']('repository.data'))return!![];if(d===0x48e||d===0x48f||d===0x495||d===0x496||d===0x498||d===0x499)return!![];}return Object['values'](b)['some'](subtreeReadsRepositoryRow);}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);}const SYSTEM_ENTITY_ADDRESS='0xaab',WRITE_GUARD_PROMISE_RE=/\b(?:only\s+\w+|must\s+(?:be|bind)\w*|restrict\w*|whitelist\w*|allowlist\w*|allow\s+list\b|authoriz\w*|permissioned|vetted|pre-?approv\w*|approved\s+\w+)\b/i,WRITE_GUARD_TAUTOLOGY_DISCLOSURE_RE=/\b(?:tautolog\w*|self[- ]?report\w*|self[- ]?assert\w*)\b/i;function writeGuardLegClass(a,b){const c=new Map();if(Array['isArray'](b))for(const j of b){if(typeof j==='object'&&j!==null){const k=j;if(typeof k['identifier']==='number')c['set'](k['identifier'],k);}}const d=l=>typeof l==='object'&&l!==null&&l['type']==='context'&&l['context']==='Signer',e=l=>{if(Array['isArray'](l))return l['some'](e);if(typeof l!=='object'||l===null)return![];const m=l;if(m['type']==='context'&&m['context']==='Signer')return!![];return Object['values'](m)['some'](e);},f=l=>{if(typeof l!=='object'||l===null)return![];const m=l;if(m['type']==='identifier'){const n=c['get'](m['identifier']);if(n===undefined||n['b_submission']===!![])return![];const o=n['value'];return typeof o==='string'&&o['trim']()!==''&&!o['includes']('${');}if(m['type']==='constant'){const p=m['value'];if(typeof p!=='string'||p['includes']('${'))return![];if(p['trim']()['toLowerCase']()===SYSTEM_ENTITY_ADDRESS)return![];return!![];}if(m['type']==='query')return!![];return![];};let g=![];const h=(l,m)=>{if(Array['isArray'](l)){let u=![];for(const w of l)u=h(w,m)||u;return u;}if(typeof l!=='object'||l===null)return![];const n=l,o=n['type'];if(o==='logic_not'){const x=n['node']??(Array['isArray'](n['nodes'])?n['nodes'][0x0]:undefined);return x!==undefined?h(x,m+0x1):![];}if((o==='logic_and'||o==='logic_or')&&Array['isArray'](n['nodes'])){const y=n['nodes'];let z=![],A=!![];for(const B of y){const C=h(B,m);z=z||C;if(!C)A=![];}return o==='logic_and'?z:z&&A;}if(typeof o==='string'&&o['startsWith']('query')&&e(n)&&m%0x2===0x0)return g=!![],!![];const p=Array['isArray'](n['nodes'])?n['nodes']:undefined,q=p?.[0x0]??n['left'],r=p?.[0x1]??n['right'];if(o==='vec_contains_address'&&q!==undefined&&r!==undefined){const D=d(q)?r:d(r)?q:undefined;if(D===undefined||m%0x2!==0x0)return![];g=!![];const E=D,F=E['type']==='identifier'?c['get'](E['identifier']):undefined;if(F===undefined||F['b_submission']===!![])return![];const G=F['value'];if(Array['isArray'](G))return G['length']>0x0;if(typeof G!=='string'||G['trim']()===''||G['includes']('${'))return![];try{const H=JSON['parse'](G);return Array['isArray'](H)&&H['length']>0x0;}catch{return![];}}if(o==='logic_equal'&&q!==undefined&&r!==undefined){if(m%0x2!==0x0||!(d(q)||d(r)))return![];return g=!![],f(d(q)?r:q);}let s=![];for(const I of Object['values'](n)){if(typeof I==='object'&&I!==null)s=h(I,m)||s;}return s;},i=h(a,0x0);return{'hasSignerLeg':g,'hasBindingLeg':i};}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']:[];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':[],'finalRoleNodes':[],'cancelledNodes':[]};const d=[],e=[],h=o=>({'name':typeof o?.['name']==='string'?o['name']:'','roster':typeof o?.['namedOperator']==='string'?o['namedOperator']:typeof o?.['named_operator']==='string'?o['named_operator']:undefined,'perm':typeof o?.['permissionIndex']==='number'?o['permissionIndex']:typeof o?.['permission_index']==='number'?o['permission_index']:undefined}),i=[],j=[],k=[],l=[];for(const o of c){if(typeof o!=='object'||o===null)continue;const q=o,r=typeof q['name']==='string'?q['name']:undefined;if(r===undefined)continue;d['push'](r);const s=typeof q['role']==='string'?q['role']:undefined;if(s==='final'||s==='cancelled')k['push'](r);if(s==='cancelled')l['push'](r);if(q['optional']===!![])i['push'](r);const t=Array['isArray'](q['pairs'])?q['pairs']:[];for(const u of t){const v=u,w=v?.['prev_node'],x=Array['isArray'](v?.['forwards'])?v['forwards']:[],y=[],z=[],A=[];for(const B of x){const C=B,D=C?.['guard'];isRef(D)&&(y['push'](D['$ref']),j['push'](D['$ref']));if(typeof C?.['name']==='string')z['push'](C['name']);A['push'](h(C));}if(typeof w==='string')e['push']({'prev':w,'next':r,'guards':y,'forwardNames':z,'forwardRails':A});}}const m=b['params']['pairs'];if(Array['isArray'](m))for(const E of m){const F=E;if(typeof F?.['prev_node']==='string'&&typeof F?.['next_node']==='string'){const G=Array['isArray'](F['forwards'])?F['forwards']:[],H=[],I=[],J=[];for(const K of G){const L=K,M=L?.['guard'];isRef(M)&&(H['push'](M['$ref']),j['push'](M['$ref']));if(typeof L?.['name']==='string')I['push'](L['name']);J['push'](h(L));}e['push']({'prev':F['prev_node'],'next':F['next_node'],'guards':H,'forwardNames':I,'forwardRails':J});}}const n=new Set(e['filter'](N=>N['prev']!==''&&N['prev']!==N['next'])['map'](N=>N['prev']));return{'nodes':d,'edges':e,'terminals':d['filter'](N=>!n['has'](N)),'optionalNodes':i,'forwardGuardRefs':j,'finalRoleNodes':k,'cancelledNodes':l};}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;}function collectSlotQueries(a,b=[]){if(Array['isArray'](a)){for(const d of a)collectSlotQueries(d,b);return b;}if(typeof a!=='object'||a===null)return b;const c=a;if(c['type']==='query'&&typeof c['query']==='string'){const e=c['object'],f=typeof e==='object'&&e!==null?e:undefined;b['push']({'query':c['query'],'slot':typeof f?.['identifier']==='number'?f['identifier']:undefined,'witness':typeof f?.['convert_witness']==='string'?f['convert_witness']:undefined});}for(const g of Object['values'](c))collectSlotQueries(g,b);return b;}function tableRows(a){const b=a['params']['table'];if(!Array['isArray'](b))return[];return b['filter'](c=>typeof c==='object'&&c!==null);}function rowIdentifier(a){return typeof a['identifier']==='number'?a['identifier']:undefined;}function servicePinRowIds(a,b){const c=[],d=f=>{const g=f['object'];return f['type']==='query'&&f['query']==='order.service'&&typeof g==='object'&&g!==null&&g['identifier']===b;},e=f=>{if(Array['isArray'](f)){for(const i of f)e(i);return;}if(typeof f!=='object'||f===null)return;const g=f,h=g['nodes'];if(g['type']==='logic_equal'&&Array['isArray'](h)&&h['length']===0x2)for(const [j,k]of[[h[0x0],h[0x1]],[h[0x1],h[0x0]]]){if(typeof j!=='object'||j===null||typeof k!=='object'||k===null)continue;const l=k;d(j)&&l['type']==='identifier'&&typeof l['identifier']==='number'&&c['push'](l['identifier']);}for(const m of Object['values'](g))e(m);};return e(a),c;}function ownServiceIdentities(a){const b=new Set();for(const c of createsOf(a,'service')){b['add'](c['id']);const d=c['params']['name'];if(typeof d==='string')b['add'](d);}return b;}function pinIsExternal(a,b){if(typeof a==='string')return!b['has'](a);if(typeof a==='object'&&a!==null){const c=a;if(typeof c['$ref']==='string')return!b['has'](c['$ref']);const d=c['$late'];if(typeof d==='object'&&d!==null){const e=d['mark'];if(typeof e==='string')return!b['has'](e);}}return!![];}function guardCompositionShapes(a){const b=[],c=ownServiceIdentities(a),d=repositoryWriteGuardIds(a),e=writeOnceKeyedSlots(a);for(const f of createsOf(a,'guard')){const g=f['params']['root']??f['params']['logic'],h=collectSlotQueries(g),i=h['filter'](s=>s['query']['startsWith']('order.')),j=[...new Set(i['map'](s=>s['slot'])['filter'](t=>t!==undefined&&t!==HOST_ORDER_SLOT&&t!==TASK_BINDING_SLOT&&t!==ONCE_SLOT_BYTES))],k=tableRows(f),l=new Set(k['filter'](s=>s['b_submission']===![]&&s['value_type']==='Address')['map'](s=>rowIdentifier(s))['filter'](s=>s!==undefined)),m=j['flatMap'](t=>servicePinRowIds(g,t))['filter'](s=>l['has'](s)),n=[...new Set(i['filter'](s=>s['query']==='order.service')['map'](s=>s['slot'])['filter'](t=>t!==undefined))],o=new Map(k['map'](s=>[rowIdentifier(s),s['value']])),p=s=>s['flatMap'](t=>servicePinRowIds(g,t))['filter'](t=>l['has'](t)&&pinIsExternal(o['get'](t),c)),q=p(j)['length']>0x0||d['has'](f['id'])&&p(n)['length']>0x0,r=i['filter'](s=>s['query']==='order.owner')['map'](s=>s['slot']);b['push']({'stepId':f['id'],'foreignSlots':j,'paired':subtreeReadsRepositoryRow(g)||k['some'](s=>rowIdentifier(s)===ONCE_SLOT_BYTES&&s['b_submission']===!![])||j['some'](t=>e['get'](f['id'])?.['has'](t)),'pinned':m['length']>0x0,'pinnedRowIds':m,'procurementPin':q,'ownerCrossed':r['includes'](HOST_ORDER_SLOT)&&j['some'](t=>r['includes'](t))});}return b;}function repositoryPoliciesMerged(a){const b=new Map();for(const d of a['steps']){if(d['op']!=='configure'||d['method']!=='policies')continue;const e=d['target'],f=typeof e==='object'&&e!==null&&typeof e['$ref']==='string'?e['$ref']:undefined;if(f===undefined)continue;const g=d['params']['policy'];if(!Array['isArray'](g))continue;const h=b['get'](f)??[];h['push'](...g['filter'](i=>typeof i==='object'&&i!==null)),b['set'](f,h);}const c=[];for(const i of createsOf(a,'repository')){const j=Array['isArray'](i['params']['policies'])?i['params']['policies']:[];c['push']({'step':i,'policies':[...j,...b['get'](i['id'])??[]]});}return c;}function repositoryWriteGuardIds(a){const b=new Set();for(const {policies:c}of repositoryPoliciesMerged(a)){for(const d of c){if(typeof d!=='object'||d===null)continue;const e=d['write_guard'];if(!Array['isArray'](e))continue;for(const f of e){if(typeof f!=='object'||f===null)continue;const h=f['guard'];typeof h==='object'&&h!==null&&typeof h['$ref']==='string'&&b['add'](h['$ref']);}}}return b;}function writeOnceKeyedSlots(a){const b=new Map();for(const {policies:c}of repositoryPoliciesMerged(a)){for(const d of c){if(typeof d!=='object'||d===null)continue;const e=d;if(e['write_once']!==!![])continue;const f=e['write_guard'];if(!Array['isArray'](f))continue;for(const h of f){if(typeof h!=='object'||h===null)continue;const i=h,j=i['id_from_submission'];if(typeof j!=='number'||j===HOST_ORDER_SLOT)continue;const k=i['guard'];if(typeof k!=='object'||k===null)continue;const l=k['$ref'];if(typeof l!=='string')continue;const m=b['get'](l)??new Set();m['add'](j),b['set'](l,m);}}}return b;}function emittedPrimitives(a,b){const c=new Set();for(const d of createsOf(a,'guard')){const e=d['params']['root']??d['params']['logic'];if(subtreeReadsRepositoryRow(e))c['add']('P1');}if(b['some'](f=>f['foreignSlots']['length']>0x0))c['add']('P2');if(b['some'](f=>f['procurementPin']))c['add']('P3');for(const f of createsOf(a,'machine')){const g=f['params']['nodes'];if(!Array['isArray'](g))continue;if(JSON['stringify'](g)['includes']('retained_submission'))c['add']('P3');}if(maxDistinctGuardsPerTrack(a)>0x1)c['add']('P4');if(planHasFormulaSharing(a))c['add']('P5');if(createsOf(a,'reward')['length']>0x0)c['add']('P6');return c;}const HOST_ORDER_SLOT=0x0;function maxDistinctGuardsPerTrack(a){const b=new Map(),c=f=>{const h=f['guard'];if(h!==undefined)return JSON['stringify'](h);if(typeof f['guard_key']==='string')return'key:'+f['guard_key'];return'<unbound>';},d=f=>{if(typeof f==='object'&&f!==null&&!Array['isArray'](f)){const g=f;if(Array['isArray'](g['allocators']))f=g['allocators'];}if(!Array['isArray'](f))return;for(const h of f){if(typeof h!=='object'||h===null)continue;const i=h,j=typeof i['track']==='string'?i['track']:'settlement',k=b['get'](j);if(k===undefined)b['set'](j,new Set([c(i)]));else k['add'](c(i));}};for(const f of a['steps']){if(f['op']==='create'&&f['object']==='service')d(f['params']['order_allocators']);if(f['op']==='configure'&&f['method']==='order_allocators')d(f['params']['allocators']);}let e=0x0;for(const g of b['values']())e=Math['max'](e,g['size']);return e;}function planHasFormulaSharing(a){const b=c=>{if(typeof c==='object'&&c!==null&&!Array['isArray'](c)){const d=c;if(Array['isArray'](d['allocators']))c=d['allocators'];}if(!Array['isArray'](c))return![];return c['some'](e=>{if(typeof e!=='object'||e===null)return![];const f=e['sharing'];if(!Array['isArray'](f))return![];return f['some'](g=>{if(typeof g!=='object'||g===null)return![];const h=g;return h['mode']===0x4||h['formula']!==undefined;});});};for(const c of a['steps']){if(c['op']==='create'&&c['object']==='service'&&b(c['params']['order_allocators']))return!![];if(c['op']==='configure'&&c['method']==='order_allocators'&&b(c['params']['allocators']))return!![];}return![];}function thirdPartyLegs(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=typeof g['track']==='string'?g['track']:'settlement',i=Array['isArray'](g['sharing'])?g['sharing']:[];for(const j of i){if(typeof j!=='object'||j===null)continue;const k=j['who'];if(typeof k!=='object'||k===null)continue;const l=k;if(l['Entity']!==undefined)b['push']({'track':h,'kind':'Entity'});else{if(l['Signer']!==undefined)b['push']({'track':h,'kind':'Signer'});}}}};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 publicFaceStrings(a){const b=[],c={'service':['description','location'],'contact':['description','location'],'proof':['description','proof'],'repository':['description'],'demand':['description']};for(const d of a['steps']){if(d['op']!=='create')continue;const e=c[d['object']];if(e===undefined)continue;for(const h of e){const i=d['params'][h];if(typeof i==='string'&&i['length']>0x0)b['push']({'face':d['object']+'.'+h,'stepId':d['id'],'text':i});}const g=d['params']['sales'];if(Array['isArray'](g))for(const j of g){if(typeof j!=='object'||j===null)continue;const k=j;for(const l of['description','name','title']){const m=k[l];typeof m==='string'&&m['length']>0x0&&b['push']({'face':d['object']+'.sales.'+l,'stepId':d['id'],'text':m});}}}for(const n of a['steps']){if(n['op']!=='configure')continue;const o=JSON['stringify'](n['params']);if(o['includes']('\x22data\x22')){const p=n['params']['data'];typeof p==='string'&&p['length']>0x0&&b['push']({'face':'repository.data','stepId':n['id'],'text':p});}}return b;}const PII_PATTERNS=[{'kind':'email','re':/[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}/},{'kind':'street_number','re':/\b\d{1,6}\s+[A-Za-z\u00c0-\u024f\u4e00-\u9fff]+(?:\s+[A-Za-z\u00c0-\u024f\u4e00-\u9fff]+){0,3}\s+(?:st|street|rd|road|ave|avenue|blvd|ln|lane|dr|drive|way|ct|court|fl|floor|apt|unit|rm|room)\b/i},{'kind':'phone','re':/(?:\+\d{1,3}[\s.-]?)?(?:\(\d{2,4}\)[\s.-]?)?\d{3,4}[\s.-]?\d{4}(?:[\s.-]?\d{2,4})?/,'proseOnly':!![]},{'kind':'national_id','re':/\b\d{15}\b|\b\d{17}[\dXx]\b/,'proseOnly':!![]}];function firstPiiHit(a){for(const b of publicFaceStrings(a)){const c=b['face']!=='repository.data';for(const d of PII_PATTERNS){if(d['proseOnly']===!![]&&!c)continue;if(d['re']['test'](b['text']))return{'face':b['face'],'stepId':b['stepId'],'kind':d['kind']};}}return undefined;}const HASH_SHAPE=/^(?:[a-fA-F0-9]{32}|[a-fA-F0-9]{40}|[a-fA-F0-9]{64}|[A-Za-z0-9+/]{43}={0,1}|[A-Za-z0-9+/]{44})$/,TRACKING_SHAPE=/^(?:[A-Za-z]{2,4}[\s-]?\d{8,15}|\d{1,7}[\s-]\d{4,15})$/;function firstRawTrackingValue(a){for(const b of a['steps']){if(b['op']!=='configure')continue;const c=b['params']['data'];if(typeof c!=='string')continue;const d=c['trim']();if(d['length']===0x0||HASH_SHAPE['test'](d))continue;if(TRACKING_SHAPE['test'](d))return{'stepId':b['id'],'value':d};}return undefined;}function perOrderProofBinding(a){for(const b of createsOf(a,'proof')){const c=JSON['stringify'](b['params']['about']??'');if(c['includes']('order'))return b['id'];}for(const d of a['steps']){if(d['op']!=='configure')continue;if(d['method']!=='required_info'&&d['method']!=='required_info_bind')continue;if(JSON['stringify'](d['params'])['includes']('proof'))return d['id'];}return undefined;}function compositionFacts(a){const b=guardCompositionShapes(a),c=emittedPrimitives(a,b),d=b['filter'](t=>t['foreignSlots']['length']>0x0),e=thirdPartyLegs(a),f=c['has']('P6'),g=typeof a['inputs']['composition_variant']==='string'?a['inputs']['composition_variant']:undefined,h=g!==undefined&&g in COMPOSITION_VARIANTS,i=typeof a['inputs']['fulfillment_axis']==='string'?a['inputs']['fulfillment_axis']:undefined,j=i??(h?COMPOSITION_VARIANTS[g]['fulfillmentAxis']:undefined),k=j==='merchant_procured'||j==='user_procured'||j==='mixed',l=d['length']>0x0||k,m=e['length']>0x0||f,n=h?primitivesForVariant(g)['filter'](s=>!c['has'](s)):[],o=firstPiiHit(a),p={'composition_primitives_emitted':[...c]['sort']()['join'](',\x20'),'composition_cross_order_guard_count':d['length'],'third_party_fulfilment_present':l,'third_party_payout_leg_present':m,'third_party_leg_count':e['length'],'reward_pool_present':f,...j!==undefined?{'fulfillment_axis':j}:{},...g!==undefined?{'composition_variant':g,'composition_variant_known':h}:{}};if(d['length']>0x0){const s=d['find'](w=>!w['paired']),t=d['find'](w=>!w['pinned']),u=j!=='merchant_procured'&&j!=='mixed',v=u?d['find'](w=>!w['ownerCrossed']):undefined;p['first_cross_order_guard']=d[0x0]['stepId'],p['cross_order_slots_display']=d[0x0]['foreignSlots']['join'](',\x20');s!==undefined&&(p['first_cross_order_guard_unpaired']=s['stepId'],p['cross_order_unpaired_count']=d['filter'](w=>!w['paired'])['length']);if(t!==undefined)p['first_cross_order_guard_unpinned']=t['stepId'];if(v!==undefined)p['first_cross_order_guard_no_owner_cross']=v['stepId'];!u&&d['some'](w=>!w['ownerCrossed'])&&(p['cross_order_owner_tie_not_expressible']=!![]);}l&&!m&&(p['third_party_fulfilment_without_payout']=!![]);h&&n['length']>0x0&&(p['composition_variant_missing_primitives']=n['join'](',\x20'),p['composition_variant_missing_count']=n['length']);g==='V3'&&(p['composition_dual_refund_unblockable']=!![],p['composition_disclosure_count']=disclosuresFor('V3')['length']);o!==undefined&&(p['first_pii_public_face']=o['face'],p['first_pii_public_face_step']=o['stepId'],p['first_pii_kind']=o['kind']);const q=firstRawTrackingValue(a);q!==undefined&&(p['first_raw_tracking_value_step']=q['stepId'],p['first_raw_tracking_value']=q['value']);const r=perOrderProofBinding(a);if(r!==undefined)p['per_order_proof_binding_step']=r;return p;}export function planFacts(a){const b=new Map(createsOf(a,'guard')['map'](aM=>[aM['id'],guardProjection(aM)])),c=allocatorRows(a),d=machineProjection(a),f=createsOf(a,'service')['length']>0x0,h=createsOf(a,'repository')['length']>0x0,i=a['steps']['some'](aM=>{if(!(aM['op']==='create'&&aM['object']==='service'||aM['op']==='configure'&&aM['method']==='sales'))return![];const aN=aM['params']['sales'];return Array['isArray'](aN)&&aN['length']>0x0;}),j=new Set();for(const aM of c){const aN=aM['guardStep']===undefined?undefined:b['get'](aM['guardStep']);for(const aO of aN?.['acceptedNodes']??[])j['add'](aO);}const k=new Set(d?.['optionalNodes']??[]),l=(d?.['terminals']??[])['filter'](aP=>!k['has'](aP)),o=new Set(),q=new Set(c['map'](aP=>aP['guardStep'])['filter'](aP=>aP!==undefined));for(const aP of d?.['edges']??[]){if(aP['next']===''||aP['guards']['length']===0x0)continue;for(const aQ of aP['guards']){if(!q['has'](aQ))continue;if((b['get'](aQ)?.['acceptedNodes']['length']??0x0)===0x0)o['add'](aP['next']);}}const u=l['find'](aR=>!j['has'](aR)&&!o['has'](aR)),w=(d?.['finalRoleNodes']??[])['find'](aR=>!j['has'](aR)&&!o['has'](aR)),x=(d?.['edges']??[])['find'](aR=>(d?.['cancelledNodes']??[])['includes'](aR['prev'])&&(aR['forwardNames']['some'](aS=>/review|reward/i['test'](aS))||/review|reward/i['test'](aR['next']))),y=new Set([...d?.['finalRoleNodes']??[],...j,...o]),z=[[/settle|release|payout|\bband\b/i,'settle'],[/recover|award/i,'recover'],[/refund|return/i,'refund'],[/arb|indemnity|dispute/i,'arb']],A=aR=>{const aS=[aR['next'],...aR['forwardNames'],...aR['guards']['flatMap'](aT=>b['get'](aT)?.['queries']??[])];for(const [aT,aU]of z){if(aS['some'](aV=>aT['test'](aV)))return aU;}return undefined;};let B;for(const aR of d?.['edges']??[]){if(aR['next']===''||!y['has'](aR['next']))continue;for(const aS of aR['forwardRails']){const aT=aS['perm']!==undefined&&aS['perm']>0x0;typeof aS['roster']==='string'&&aS['roster']!==''&&!aT&&(B??=aR['prev']+'->'+aR['next']+'\x20(forward\x20'+aS['name']+')');}}const C=new Map();for(const aU of d?.['edges']??[]){if(aU['next']===''||!y['has'](aU['next']))continue;const aV=A(aU);if(aV===undefined)continue;for(const aW of aU['forwardRails']){if(typeof aW['perm']==='number'&&aW['perm']>0x0){const aX=C['get'](aW['perm'])??C['set'](aW['perm'],new Set())['get'](aW['perm']);aX['add'](aV);}}}const D=[...C['entries']()]['find'](([,aY])=>aY['size']>=0x2),E=a['pending_guards']??[],F=E['filter'](aY=>aY['site']==='allocator')['length'],G=E['filter'](aY=>aY['site']==='allocator'||aY['site']==='machine_edge'),H=E['filter'](aY=>aY['site']==='service_buy'),I=G[0x0]?.['key'],J=H[0x0]?.['key'],K=d?.['nodes']['find'](aY=>/return/i['test'](aY)),L=a['steps']['some'](aY=>{if(aY['op']==='configure'&&aY['method']==='arbitrations'){const aZ=aY['params']['objects'];return Array['isArray'](aZ)&&aZ['length']>0x0;}if(aY['op']==='create'&&aY['object']==='service'){const b0=aY['params']['arbitrations'];return Array['isArray'](b0)&&b0['length']>0x0;}return![];});let M,N=![];for(const aY of a['steps']){if(aY['op']==='configure'&&aY['method']==='compensation_fund_add'){N=!![];const aZ=numericAmount(aY['params']['balance']);if(aZ!==undefined)M=(M??0x0)+aZ;}}let O,P;const Q=b0=>{if(!Array['isArray'](b0))return;for(const b1 of b0){const b2=numericAmount(b1?.['price']);b2!==undefined&&b2>0x0&&(O=Math['max'](O??0x0,b2),P=P===undefined?b2:Math['min'](P,b2));}};for(const b0 of a['steps']){if(b0['op']==='create'&&b0['object']==='service')Q(b0['params']['sales']);if(b0['op']==='configure'&&b0['method']==='sales')Q(b0['params']['sales']);}const R=M!==undefined&&O!==undefined;let S,T=0x0,U=0x0;const V=b1=>{if(!Array['isArray'](b1))return;for(const b2 of b1){const b3=b2?.['name'];if(typeof b3!=='string'||b3==='')continue;const b4=skuNameByteLen(b3);b4>SKU_NAME_MAX_BYTES&&(U+=0x1,S===undefined&&(S=b3,T=b4));}};for(const b1 of a['steps']){if(b1['op']==='create'&&b1['object']==='service')V(b1['params']['sales']);if(b1['op']==='configure'&&b1['method']==='sales')V(b1['params']['sales']);}const W=createsOf(a,'reward')['length']>0x0;let X,Y;if(W)for(const b2 of a['steps']){if(b2['op']==='configure'&&b2['method']==='guard_add'){const b3=b2['params']['amount'];if(b3!==undefined&&b3!==null&&b3['type']==='Fixed'){const b4=numericAmount(b3['value']);if(b4!==undefined)X=Math['max'](X??0x0,b4);}}if(b2['op']==='configure'&&b2['method']==='coin_add'&&/^reward/['test'](b2['id'])){const b5=numericAmount(b2['params']['coin']);if(b5!==undefined)Y=(Y??0x0)+b5;}}const Z=X!==undefined&&P!==undefined,a0=/^(arb\.indemnity|arb\.order|arb\.status|order\.dispute)/,a1=/settled|refunded|reviewed|completed|closed|cancel/i;let a2;if(d!==undefined)for(const b6 of d['edges']){if(b6['next']===''||b6['guards']['length']===0x0)continue;if(!a1['test'](b6['prev']))continue;if(b6['guards']['some'](b7=>b['get'](b7)?.['queries']['some'](b8=>a0['test'](b8)))){a2=b6['prev'];break;}}const a3=a2!==undefined&&(!N||M===0x0),a4=new Map();for(const b7 of createsOf(a,'guard')){a4['set'](b7['id'],b7['params']['root']??b7['params']['logic']);}const a5=d?.['edges']??[],a6=b8=>b8['guards']['length']===0x0||b8['guards']['every'](b9=>{const ba=a4['get'](b9);return ba===undefined||guardWindowOpen(ba);});let a7;for(const b8 of a5){if(b8['prev']!==''||b8['next']==='')continue;const b9=a5['filter'](ba=>ba['prev']===b8['next']);if(b9['length']===0x0)continue;if(b9['every'](ba=>!a6(ba)))a7??=b8['next'];}const a8=c['some'](ba=>ba['guardStep']===undefined&&ba['guardKey']!==undefined),a9=a5['filter'](ba=>ba['guards']['length']>0x0&&ba['guards']['some'](bb=>b['get'](bb)?.['queries']['some'](bc=>a0['test'](bc))));let aa=![];if(a9['length']>0x0&&!a8){const ba=new Set(a9['map'](bd=>bd['next'])['filter'](bd=>bd!=='')),bb=new Set(a9['flatMap'](bd=>bd['guards'])),bc=new Set();for(const bd of c){const be=bd['guardStep']===undefined?undefined:b['get'](bd['guardStep']);if(be===undefined)continue;if(be['acceptedNodes']['length']>0x0){for(const bf of be['acceptedNodes'])bc['add'](bf);}else for(const bg of a5){bg['next']!==''&&bg['guards']['includes'](bd['guardStep'])&&bc['add'](bg['next']);}}for(const bh of c){const bi=bh['guardStep']===undefined?undefined:b['get'](bh['guardStep']);if(bi===undefined)continue;if(bi['queries']['some'](bj=>a0['test'](bj))||bb['has'](bh['guardStep'])){aa=!![];break;}}if(!aa)for(const bj of ba){if(bc['has'](bj)){aa=!![];break;}}}const ab=a9['length']>0x0&&!aa&&!a8,ac=a9[0x0]===undefined?undefined:a9[0x0]['prev']!==''?a9[0x0]['prev']:a9[0x0]['next'],ad=[];for(const bk of a['steps']){const bl=bk['op']==='create'&&bk['object']==='service',bm=bk['op']==='configure'&&bk['method']==='sales';if(!bl&&!bm)continue;const bn=bk['params'];if(typeof bn['description']==='string')ad['push'](bn['description']);if(!Array['isArray'](bn['sales']))continue;for(const bo of bn['sales']){if(typeof bo!=='object'||bo===null)continue;for(const bp of Object['values'](bo)){if(typeof bp==='string')ad['push'](bp);}}}const ae=ad['flatMap'](bq=>extractProseWindowPromises(bq)),af=collectEnforcedWindowMs(a),ag=ae['filter'](bq=>!af['has'](bq['ms'])),ah=[];for(const bq of ad){const br=UNANCHORED_RESTART_RE['exec'](bq);if(br)ah['push'](br[0x0]);}const ai=c['filter'](bs=>bs['track']==='refund'),aj=new Map();for(const bs of d?.['edges']??[]){for(const bt of bs['guards']){const bu=aj['get'](bt)??[];if(bs['prev']!=='')bu['push'](bs['prev']);if(bs['next']!=='')bu['push'](bs['next']);aj['set'](bt,bu);}}let ak,al=![];for(const bv of b['values']()){if(bv['queries']['some'](isPathDependentTimeQuery)){ak??=bv['stepId'];if(d!==undefined){const bw=[...bv['acceptedNodes'],...aj['get'](bv['stepId'])??[]];for(const bx of bw){if(pathCountCap2(d['edges'],bx)>=0x2){al=!![],ak=bv['stepId'];break;}}}}if(al)break;}const am=[...b['values']()]['flatMap'](by=>by['queries']);let an;for(const by of WRITE_ONLY_ENFORCEMENT_SOURCES){for(const bz of createsOf(a,by['object'])){if(by['extract'](bz)&&!am['some'](bA=>bA['startsWith'](by['coverQuery']))){an=by['param'];break;}}if(an!==undefined)break;}const ao=new Set();for(const bA of a['steps']){if(bA['op']==='create'&&bA['object']==='guard')continue;const bB=refsOf(bA['op']==='publish'?bA['target']:bA['params']);for(const bC of bB)ao['add'](bC);if(bA['op']==='configure'){for(const bD of refsOf(bA['target']))ao['add'](bD);}}const ap=[...b['keys']()]['find'](bE=>!ao['has'](bE)),aq=[...b['values']()]['find'](bE=>!h&&bE['queries']['some'](bF=>bF['startsWith']('repository.')))?.['stepId'];let ar;if(f&&d!==undefined)for(const bE of d['forwardGuardRefs']){const bF=b['get'](bE);if(bF===undefined)continue;const bG=bF['table']['some'](bH=>bH['identifier']===TASK_BINDING_SLOT&&bH['b_submission']===!![]);if(!bG){ar=bE;break;}}let as;for(const bH of c){if(bH['guardStep']===undefined||bH['identifierLegs']['length']===0x0)continue;const bI=b['get'](bH['guardStep']);if(bI===undefined)continue;for(const bJ of bH['identifierLegs']){const bK=bI['table']['find'](bL=>bL['identifier']===bJ);if(bK===undefined||bK['b_submission']!==!![]||bK['value_type']!=='Address'){as='slot\x20'+bJ+'\x20of\x20guard\x20\x27'+bH['guardStep']+'\x27';break;}}if(as!==undefined)break;}const at=new Set();for(const {policies:bL}of repositoryPoliciesMerged(a)){for(const bM of bL){const bN=bM?.['name'];if(typeof bN==='string')at['add'](bN);}}const au=[];if(at['size']>0x0)for(const bO of createsOf(a,'guard')){const bP=Array['isArray'](bO['params']['table'])?bO['params']['table']:[];for(const bQ of collectRepoWhereQueries(bO['params']['root']??bO['params']['logic'])){const bR=staticStringOperand(bQ['key'],bP);if(bR===undefined)continue;if(!isPlanLocalObjectOperand(bQ['object'],bP))continue;!at['has'](bR)&&au['push']('\x27'+bR+'\x27\x20in\x20guard\x20\x27'+bO['id']+'\x27');}}const av=new Set();for(const {policies:bS}of repositoryPoliciesMerged(a)){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')av['add'](bX);}}}let aw,ax=0x0;for(const bY of createsOf(a,'guard')){if(!av['has'](bY['id']))continue;rootNegatesRepoDataHas(bY['params']['root']??bY['params']['logic'])&&(ax++,aw??=bY['id']);}const ay=new Map(createsOf(a,'guard')['map'](bZ=>[bZ['id'],bZ]));let az,aA=0x0,aB,aC=0x0,aD;for(const {policies:bZ}of repositoryPoliciesMerged(a)){for(const c0 of bZ){const c1=c0,c2=c1['write_guard'];if(!Array['isArray'](c2))continue;const c3=typeof c1['id_from']==='string'?c1['id_from']['toLowerCase']():'none',c4=c3==='none'?'caller-keyed':c3+'-keyed',c5=typeof c1['description']==='string'?c1['description']:'';for(const c6 of c2){const c7=c6?.['guard'],c8=isRef(c7)?c7['$ref']:c7,c9=typeof c8==='string'?ay['get'](c8):undefined;if(c9===undefined)continue;const ca=writeGuardLegClass(c9['params']['root']??c9['params']['logic'],c9['params']['table']);if(!ca['hasSignerLeg']||ca['hasBindingLeg'])continue;const cb='guard\x20\x27'+c9['id']+'\x27\x20(policy\x20\x27'+String(c1['name']??'?')+'\x27,\x20'+c4+')';c3==='signer'||c3==='clock'?(aC++,aB??=cb):(aA++,az??=cb),WRITE_GUARD_PROMISE_RE['test'](c5)&&!WRITE_GUARD_TAUTOLOGY_DISCLOSURE_RE['test'](c5)&&(aD??=cb+'\x20—\x20its\x20description\x20promises\x20a\x20bound\x20writer\x20set\x20the\x20guard\x20legs\x20never\x20encode');}}}let aE,aF=0x0;for(const cc of createsOf(a,'service')){const cd=cc['params']['customer_required'];if(!Array['isArray'](cd)||cd['length']===0x0)continue;cc['params']['buy_guard']===undefined&&(aF++,aE??=cc['id']);}let aG,aH=0x0;for(const ce of d?.['edges']??[]){if(ce['prev']===''||ce['guards']['length']===0x0)continue;for(const cf of ce['guards']){const cg=b['get'](cf);if(cg===undefined||cg['acceptedNodes']['length']===0x0)continue;!cg['acceptedNodes']['includes'](ce['prev'])&&(aH++,aG??=cf+'\x20on\x20edge\x20'+ce['prev']+'->'+ce['next']+'\x20(guard\x20pins\x20progress.current\x20in\x20'+('['+cg['acceptedNodes']['join'](',\x20')+']\x20—\x20never\x20\x27'+ce['prev']+'\x27)'));}}let aI;if(d!==undefined){const ch=(d['edges']['find'](cj=>cj['prev']==='')??{'next':''})['next'],ci=new Set([...d['finalRoleNodes'],...d['optionalNodes']]);for(const cj of d['nodes']){if(ci['has'](cj)||cj===ch)continue;const ck=d['edges']['filter'](cm=>cm['prev']===cj&&cm['next']!==cj);if(ck['length']===0x0)continue;const cl=ck['some'](cm=>cm['guards']['length']===0x0||cm['guards']['some'](cn=>{const co=b['get'](cn);return co===undefined||co['acceptedNodes']['length']===0x0||co['acceptedNodes']['includes'](cj);}));if(!cl)aI??=cj;}}let aJ,aK=0x0;{const cm=new Set(d?.['forwardGuardRefs']??[]);for(const cn of d?.['edges']??[])for(const co of cn['guards'])cm['add'](co);for(const cp of c){const cq=/refund|settle|recover/i['test'](cp['track'])||/refund|settle|recover/i['test'](cp['guardKey']??'');if(!cq||cp['guardStep']===undefined)continue;const cs=b['get'](cp['guardStep']);if(cs===undefined)continue;const ct=cs['acceptedNodes']['length']>0x0||cm['has'](cp['guardStep'])||cs['queries']['includes']('order.dispute.open'),cu=cs['queries']['includes']('order.owner')||cs['queries']['includes']('order.agent\x20has')||cs['queries']['includes']('order.service');if(ct||cu)continue;aK++,aJ??=cp['track']+'\x20row\x20on\x20guard\x20\x27'+(cp['guardKey']??cp['guardStep'])+'\x27\x20('+cp['guardStep']+')\x20—\x20pins\x20no\x20progress\x20node,\x20rides\x20no\x20machine\x20edge,\x20references\x20no\x20order\x20identity\x20or\x20dispute\x20state';}}const aL=[];for(const cv of createsOf(a,'guard')){const cw=reachLegsOf(cv);aL['push'](...findReachContradictions(cv['id'],cw['legs'],cw['selfStrict']));}return{...compositionFacts(a),'has_service':f,'has_machine':d!==undefined,'has_repository':h,'sales_step_present':i,'allocator_row_count':c['length'],'refund_row_count':ai['length'],'terminal_count':l['length'],'terminal_nodes_display':l['join'](',\x20'),'pending_allocator_guard_count':F,'pending_guard_total':E['length'],...u===undefined?{}:{'first_uncovered_terminal':u},...w===undefined?{}:{'first_uncovered_final_node':w},...x===undefined?{}:{'first_cancelled_review_bridge':x['prev']+'\x20->\x20'+x['next']+(x['forwardNames']['length']>0x0?'\x20(forward\x20'+x['forwardNames']['join'](',\x20')+')':'')},...B===undefined?{}:{'first_roster_null_perm_edge':B},...D===undefined?{}:{'coarse_perm_bucket_index':D[0x0],'coarse_perm_bucket_classes':[...D[0x1]]['sort']()['join'](',\x20')},...aI===undefined?{}:{'first_pinned_away_exit_node':aI},'direction_blind_pay_edge_count':aK,...aJ===undefined?{}:{'first_direction_blind_pay_edge':aJ},...ak===undefined?{}:{'first_path_dependent_anchor':ak},'path_sensitive':al,...an===undefined?{}:{'first_write_only_unenforced_field':an},...ap===undefined?{}:{'first_orphan_guard':ap},...aq===undefined?{}:{'first_repo_query_without_repository':aq},'repo_write_once_guard_count':ax,...aw===undefined?{}:{'first_repo_write_once_guard':aw},'tautology_write_guard_count':aA,...az===undefined?{}:{'first_tautology_write_guard':az},'keyed_tautology_write_guard_count':aC,...aB===undefined?{}:{'first_keyed_tautology_write_guard':aB},...aD===undefined?{}:{'first_promise_gap_write_guard':aD},'customer_required_unbacked_count':aF,...aE===undefined?{}:{'first_customer_required_unbacked':aE},...ar===undefined?{}:{'first_edge_guard_missing_254':ar},'node_mismatched_guard_count':aH,...aG===undefined?{}:{'first_node_mismatched_guard':aG},'guard_reach_contradiction_count':aL['length'],...aL['length']>0x0?{'first_guard_reach_contradiction':aL[0x0],'guard_reach_contradiction_display':aL['join'](';\x20')}:{},...as===undefined?{}:{'first_alloc_slot_missing':as},...I===undefined?{}:{'first_pending_fund_guard':I,'pending_fund_guard_count':G['length'],'pending_fund_guard_keys_display':G['map'](cx=>cx['key'])['join'](',\x20')},...J===undefined?{}:{'first_pending_buy_guard':J,'pending_buy_guard_count':H['length'],'pending_buy_guard_keys_display':H['map'](cx=>cx['key'])['join'](',\x20')},'has_return_rail':K!==undefined,...K===undefined?{}:{'return_rail_node':K},'has_arbitration_binding':L,'fund_topup_present':N,...M===undefined?{}:{'fund_topup_amount':M},...R?{'fund_ceiling_breach':M<MAX_INDEMNITY_MULTIPLE*O,'fund_ceiling_basis':MAX_INDEMNITY_MULTIPLE+'x\x20the\x20highest\x20SKU\x20price','fund_concurrent_orders_coverable':Math['floor'](M/(MAX_INDEMNITY_MULTIPLE*O))}:{},'fund_ceiling_unverifiable':N&&!R,...X!==undefined?{'reward_bounty_amount':X,...Y!==undefined?{'reward_funding_amount':Y}:{},...Y!==undefined&&X>0x0?{'reward_max_claims':Math['floor'](Y/X)}:{},...Z?{'lowest_sku_price':P,'reward_scale_breach':X>0.5*P,'reward_scale_ratio_display':(X/P)['toFixed'](0x2)+'x\x20the\x20cheapest\x20SKU\x20price'}:{'reward_scale_unverifiable':!![]}}:{},...U>0x0?{'dead_sku_count':U,'first_dead_sku_name':S,'first_dead_sku_bytes':T}:{},...a3?{'first_arb_exit_node':a2,'fund_arb_route_unfunded':!![]}:{},...a7===undefined?{}:{'entry_no_open_exit':!![],'entry_strand_node':a7},...ab&&ac!==undefined?{'arb_promise_without_settle_rail':!![],'arb_promise_node':ac}:{},...a9['length']>0x0&&a8&&ac!==undefined?{'arb_key_plane_opaque':!![],'arb_key_plane_node':ac}:{},...ae['length']>0x0?{'prose_window_promise_count':ae['length'],'enforced_window_ms_display':[...af]['sort']((cx,cy)=>cx-cy)['map'](formatMs)['join'](',\x20')||'none',...ag['length']>0x0?{'prose_time_mismatch_count':ag['length'],'first_prose_time_mismatch':ag[0x0]['quote'],'prose_time_mismatch_display':ag['map'](cx=>cx['quote'])['join'](';\x20')}:{}}:{},...ah['length']>0x0?{'unanchored_window_promise_count':ah['length'],'first_unanchored_window_promise':ah[0x0]}:{},...at['size']>0x0?{'repo_policy_keys_display':[...at]['join'](',\x20'),...au['length']>0x0?{'repo_gate_key_unbacked_count':au['length'],'first_repo_gate_key_unbacked':au[0x0],'repo_gate_key_unbacked_display':au['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};}
|
|
@@ -4,7 +4,7 @@ import type { SupplyChainEmission, SupplyChainPromise } from "./supply-chain-emi
|
|
|
4
4
|
export { normalizeInlineGuardTable } from "./guard-fill.js";
|
|
5
5
|
export type { ResolvedGuard } from "./guard-fill.js";
|
|
6
6
|
export { normalizeCurrency } from "./emit-phases.js";
|
|
7
|
-
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" | "settlement_window_merge"> & {
|
|
7
|
+
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" | "settlement_window_merge" | "experience_compensation_mode"> & {
|
|
8
8
|
build_notes?: string[];
|
|
9
9
|
};
|
|
10
10
|
export interface GuardSpec {
|
|
@@ -39,7 +39,7 @@ export type GuardResolution = {
|
|
|
39
39
|
kind: "declare";
|
|
40
40
|
reason: string;
|
|
41
41
|
};
|
|
42
|
-
export type CompileBlockerCode = "COMPILE_ORDER_DRIFT" | "MACHINE_EDGES_MISSING" | "SELECTOR_VALUE_UNKNOWN" | "EDGE_UNKNOWN_PREV" | "GUARD_CYCLE" | "RELEASE_EDGE_NO_IDENTITY" | "GUARD_KEY_UNKNOWN" | "GUARD_TEMPLATE_PARAMS" | "GUARD_PATTERN_UNKNOWN" | "GUARD_RESOLUTION_UNKNOWN" | "GUARD_OMIT_UNSUPPORTED" | "GUARD_DECLARE_UNSUPPORTED" | "GUARD_SLOT_UNKNOWN" | "GUARD_FOREIGN_SERVICE" | "GUARD_EMPTY_VEC_ROW" | "CURRENCY_UNRESOLVED" | "ALLOCATOR_VALUE_MISSING" | "ALLOCATOR_COMPLEMENT_INVALID" | "RATE_SUM_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_POLICY_WRITE_GUARD_REQUIRED" | "REPO_GUARD_SUBMISSION_ID_FORBIDDEN" | "REPO_GUARD_SUBMISSION_SLOT_UNKNOWN" | "RAIL_TERMINAL_UNCOVERED" | "RAIL_AWARD_EXIT_MISSING" | "RAIL_CLAIMED_BY_LEG" | "RAIL_NO_CALLER_IDENTITY_BOUND" | "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" | "FEE_PARAM_COUPLING_MISMATCH" | "WINDOW_MATH_MISMATCH" | "INCENTIVE_RATING_FLOOR_MISMATCH" | "INCENTIVE_WINDOW_MISMATCH" | "DAYS_SLOT_UNIT_MISMATCH" | "WINDOW_TRUNCATION_ZERO" | "MONEY_RAIL_CALLER_LEG_MISSING" | "CAMPAIGN_DEADLINE_CONFLICT" | "MERGED_LOCK_MISMATCH" | "SALE_ZERO_PRICE" | "CROWDFUNDING_DEADLINE_UNSET" | "CROWDFUNDING_DEADLINE_PAST" | "CROWDFUNDING_DEADLINE_IMMINENT" | "SUPPLY_CHAIN_PROMISE_INCOMPLETE" | "SUPPLY_CHAIN_GATE_TEMPLATE" | "SUPPLY_CHAIN_ACK_WITHOUT_DEADLINE" | "SUPPLY_CHAIN_PAYOUT_RATE" | "SUPPLY_CHAIN_ID_CONFLICT";
|
|
42
|
+
export type CompileBlockerCode = "COMPILE_ORDER_DRIFT" | "MACHINE_EDGES_MISSING" | "SELECTOR_VALUE_UNKNOWN" | "EDGE_UNKNOWN_PREV" | "GUARD_CYCLE" | "RELEASE_EDGE_NO_IDENTITY" | "GUARD_KEY_UNKNOWN" | "GUARD_TEMPLATE_PARAMS" | "GUARD_PATTERN_UNKNOWN" | "GUARD_RESOLUTION_UNKNOWN" | "GUARD_OMIT_UNSUPPORTED" | "GUARD_DECLARE_UNSUPPORTED" | "GUARD_SLOT_UNKNOWN" | "GUARD_FOREIGN_SERVICE" | "GUARD_EMPTY_VEC_ROW" | "CURRENCY_UNRESOLVED" | "ALLOCATOR_VALUE_MISSING" | "ALLOCATOR_COMPLEMENT_INVALID" | "RATE_SUM_INVALID" | "ALLOCATOR_FIX_UNSUPPORTED" | "FORMULA_SELECTOR_NOT_SUM_BOUND" | "FORMULA_ROW_KEY_NOT_ORDER" | "REVIEW_NODE_MISSING" | "REVIEW_REWARD_GUARD_MISSING" | "REVIEW_REWARD_UNFUNDED" | "EXPERIENCE_COMPENSATION_GUARD_MISSING" | "EXPERIENCE_COMPENSATION_AMOUNT_MISSING" | "EXPERIENCE_COMPENSATION_BELOW_CLAIM_GAS" | "EXPERIENCE_COMPENSATION_UNARMED" | "EXPERIENCE_COMPENSATION_UNFUNDED" | "REVIEW_REWARD_AMOUNT_MISSING" | "REVIEW_REWARD_EVIDENCE_NO_STAMP" | "COMPENSATION_FUND_REQUIRED" | "ARB_REFUND_WITHOUT_FUND" | "REVIEW_REWARD_UNARMED" | "REWARD_BELOW_CLAIM_GAS" | "AFTER_SALES_RAIL_MISSING" | "ACCEPTANCE_JUDGE_NOT_INDEPENDENT" | "ACCEPTANCE_REVISION_UNBOUNDED" | "INSTALLMENT_FUNDING_UNGATED" | "INSTALLMENT_DEPOSIT_STRANDED" | "REPO_GUARD_POLICY_MISSING" | "REPO_POLICY_WRITE_GUARD_REQUIRED" | "REPO_GUARD_SUBMISSION_ID_FORBIDDEN" | "REPO_GUARD_SUBMISSION_SLOT_UNKNOWN" | "RAIL_TERMINAL_UNCOVERED" | "RAIL_AWARD_EXIT_MISSING" | "RAIL_CLAIMED_BY_LEG" | "RAIL_NO_CALLER_IDENTITY_BOUND" | "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" | "FEE_PARAM_COUPLING_MISMATCH" | "WINDOW_MATH_MISMATCH" | "INCENTIVE_RATING_FLOOR_MISMATCH" | "INCENTIVE_WINDOW_MISMATCH" | "DAYS_SLOT_UNIT_MISMATCH" | "WINDOW_TRUNCATION_ZERO" | "WINDOW_UNIT_CONFLICT" | "WINDOW_MS_UNSUPPORTED" | "MONEY_RAIL_CALLER_LEG_MISSING" | "CAMPAIGN_DEADLINE_CONFLICT" | "MERGED_LOCK_MISMATCH" | "SALE_ZERO_PRICE" | "SALE_INPUT_UNKNOWN_FIELD" | "EMITTED_STEP_SHAPE_INVALID" | "FUND_RAIL_UNREACHABLE" | "CROWDFUNDING_DEADLINE_UNSET" | "CROWDFUNDING_DEADLINE_PAST" | "CROWDFUNDING_DEADLINE_IMMINENT" | "FEE_PARAM_UNLANDED" | "REWARD_WINDOW_UNRESOLVABLE" | "REFUND_GATE_POLARITY_MIX" | "SUPPLY_CHAIN_PROMISE_INCOMPLETE" | "SUPPLY_CHAIN_GATE_TEMPLATE" | "SUPPLY_CHAIN_ACK_WITHOUT_DEADLINE" | "SUPPLY_CHAIN_PAYOUT_RATE" | "SUPPLY_CHAIN_ID_CONFLICT";
|
|
43
43
|
export interface CompileBlocker {
|
|
44
44
|
code: CompileBlockerCode;
|
|
45
45
|
detail: string;
|
|
@@ -64,7 +64,7 @@ export interface AllocatorRowData {
|
|
|
64
64
|
track: "settlement" | "refund";
|
|
65
65
|
recipient: "entity" | "guard_identifier" | "signer";
|
|
66
66
|
recipient_key?: string;
|
|
67
|
-
mode: "amount" | "rate" | "surplus";
|
|
67
|
+
mode: "amount" | "rate" | "surplus" | "formula";
|
|
68
68
|
value?: string | number;
|
|
69
69
|
value_from?: string;
|
|
70
70
|
value_from_complement?: string;
|
|
@@ -72,5 +72,12 @@ export interface AllocatorRowData {
|
|
|
72
72
|
fix_from?: string;
|
|
73
73
|
guard_key?: string;
|
|
74
74
|
note?: string;
|
|
75
|
+
formula?: {
|
|
76
|
+
selector?: number;
|
|
77
|
+
repo?: string;
|
|
78
|
+
key?: string;
|
|
79
|
+
predicate?: unknown;
|
|
80
|
+
ids?: unknown[];
|
|
81
|
+
};
|
|
75
82
|
}
|
|
76
83
|
export declare function compileTemplate(template: CompilableTemplate, rawInputs: Record<string, JsonValue>, options?: CompileOptions): CompileResult;
|