@wowok/agent-mcp 3.3.9 → 3.4.1
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/README.md +8 -0
- package/dist/chain-semantics/composition-truth.d.ts +102 -0
- package/dist/chain-semantics/composition-truth.js +1 -0
- 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/index.d.ts +1 -0
- package/dist/chain-semantics/index.js +1 -1
- package/dist/chain-semantics/object-graph.js +1 -1
- package/dist/composition/audit.js +1 -1
- package/dist/composition/blueprint-view.d.ts +3 -3
- package/dist/composition/blueprint-view.js +1 -1
- package/dist/composition/compile.d.ts +26 -4
- package/dist/composition/compile.js +1 -1
- package/dist/composition/emit-phases.d.ts +206 -0
- package/dist/composition/emit-phases.js +1 -0
- package/dist/composition/generate.d.ts +40 -0
- package/dist/composition/generate.js +1 -0
- package/dist/composition/guard-fill.d.ts +44 -0
- package/dist/composition/guard-fill.js +1 -0
- package/dist/composition/inflight.d.ts +26 -2
- package/dist/composition/inflight.js +1 -1
- package/dist/composition/input-normalize.d.ts +15 -0
- package/dist/composition/input-normalize.js +1 -0
- package/dist/composition/materialize.d.ts +22 -13
- package/dist/composition/materialize.js +1 -1
- package/dist/composition/mode-gates.d.ts +35 -0
- package/dist/composition/mode-gates.js +1 -0
- package/dist/composition/param-disclosure.d.ts +61 -0
- package/dist/composition/param-disclosure.js +1 -0
- package/dist/composition/plan-retry-ledger.d.ts +21 -0
- package/dist/composition/plan-retry-ledger.js +1 -0
- package/dist/composition/plan.d.ts +17 -2
- package/dist/composition/plan.js +1 -1
- package/dist/composition/product-card.d.ts +94 -0
- package/dist/composition/product-card.js +1 -0
- package/dist/composition/supply-chain-emit.d.ts +46 -0
- package/dist/composition/supply-chain-emit.js +1 -0
- package/dist/config/config-audit.spec.js +1 -1
- package/dist/config/config-warnings.d.ts +2 -0
- package/dist/config/config-warnings.js +1 -0
- package/dist/config/exposure.d.ts +2 -2
- package/dist/config/judgment.d.ts +31 -5
- package/dist/config/judgment.js +1 -1
- package/dist/config/judgment.spec.js +1 -1
- package/dist/config/match-policy-file.d.ts +34 -0
- package/dist/config/match-policy-file.js +1 -0
- package/dist/config/match-policy-file.spec.d.ts +1 -0
- package/dist/config/match-policy-file.spec.js +1 -0
- package/dist/config/rule-engine.d.ts +5 -5
- package/dist/config/rule-engine.js +1 -1
- package/dist/config/runtime.d.ts +0 -1
- package/dist/config/runtime.js +1 -1
- package/dist/config/severity.d.ts +0 -2
- package/dist/config/severity.js +1 -1
- package/dist/config/store-policy.spec.js +1 -1
- package/dist/config/template-params.d.ts +42 -0
- package/dist/config/template-params.js +1 -0
- package/dist/config/template-params.spec.d.ts +1 -0
- package/dist/config/template-params.spec.js +1 -0
- package/dist/customer/account-events.js +1 -1
- package/dist/data/api/api.spec.js +1 -1
- package/dist/data/api/cli.js +1 -1
- package/dist/data/api/server.d.ts +1 -0
- package/dist/data/api/server.js +1 -1
- package/dist/data/projection/store.d.ts +3 -1
- package/dist/data/projection/store.js +1 -1
- package/dist/data/projection/types.d.ts +32 -0
- package/dist/data/sync/cdc.d.ts +1 -2
- package/dist/data/sync/cdc.js +1 -1
- package/dist/data/sync/cdc.spec.js +1 -1
- package/dist/data/sync/store.d.ts +5 -0
- package/dist/data/sync/store.js +1 -1
- package/dist/data/sync/types.d.ts +2 -0
- package/dist/evaluation/acceptance.d.ts +8 -0
- package/dist/evaluation/acceptance.js +1 -1
- package/dist/evaluation/builtins/demand-match.js +1 -1
- package/dist/evaluation/builtins/graph-service.spec.js +1 -1
- package/dist/evaluation/capability.d.ts +2 -0
- package/dist/evaluation/category-match-rules.d.ts +0 -1
- package/dist/evaluation/category-match-rules.js +1 -1
- package/dist/evaluation/composer.d.ts +25 -0
- package/dist/evaluation/composer.js +1 -1
- package/dist/evaluation/engine.js +1 -1
- package/dist/evaluation/extract.d.ts +7 -0
- package/dist/evaluation/extract.js +1 -1
- package/dist/evaluation/game-strategy.d.ts +0 -3
- package/dist/evaluation/game-strategy.js +1 -1
- package/dist/evaluation/guard-scan.js +1 -1
- package/dist/evaluation/match-operation.d.ts +9 -0
- package/dist/evaluation/match-operation.js +1 -1
- package/dist/evaluation/match-policy-resolver.d.ts +9 -0
- package/dist/evaluation/match-policy-resolver.js +1 -0
- package/dist/evaluation/match-policy.d.ts +3 -1
- package/dist/evaluation/match-policy.js +1 -1
- package/dist/evaluation/region.d.ts +0 -6
- package/dist/evaluation/region.js +1 -1
- package/dist/evaluation/standards.d.ts +2 -1
- package/dist/evaluation/standards.js +1 -1
- package/dist/evaluation/structured-lines.d.ts +8 -0
- package/dist/evaluation/structured-lines.js +1 -0
- package/dist/evaluation/types.d.ts +6 -0
- package/dist/experience/realtime-feedback.js +1 -1
- package/dist/extensions/capability-manifest.d.ts +1 -0
- package/dist/extensions/capability-manifest.js +1 -1
- package/dist/extensions/capability.d.ts +91 -0
- package/dist/extensions/capability.js +1 -0
- package/dist/extensions/industry-audit.spec.js +1 -1
- package/dist/extensions/industry-pack.d.ts +13 -0
- package/dist/extensions/industry-pack.js +1 -1
- package/dist/extensions/modes.js +1 -1
- package/dist/extensions/registry.d.ts +0 -2
- package/dist/extensions/registry.js +1 -1
- package/dist/goal/GoalEngine.js +1 -1
- package/dist/graph/onchain/analyze.js +1 -1
- package/dist/graph/onchain/expand.js +1 -1
- package/dist/graph/onchain/exposure.js +1 -1
- package/dist/graph/onchain/facts.js +1 -1
- package/dist/graph/onchain/order-status.d.ts +0 -1
- package/dist/graph/onchain/order-status.js +1 -1
- package/dist/harness/recover.js +1 -1
- package/dist/harness/verify.d.ts +0 -3
- package/dist/harness/verify.js +1 -1
- package/dist/index.js +1 -1
- package/dist/intent/types.d.ts +0 -1
- package/dist/intent/types.js +1 -1
- package/dist/keeper/detectors.js +1 -1
- package/dist/keeper/types.d.ts +0 -1
- package/dist/keeper/types.js +1 -1
- package/dist/knowledge/allocation-risk.d.ts +1 -0
- package/dist/knowledge/allocation-risk.js +1 -1
- package/dist/knowledge/allocation-templates.js +1 -1
- package/dist/knowledge/allocator-rail-verifier.d.ts +6 -1
- package/dist/knowledge/allocator-rail-verifier.js +1 -1
- package/dist/knowledge/arb-fund-facts.d.ts +1 -0
- package/dist/knowledge/arb-fund-facts.js +1 -1
- package/dist/knowledge/arbitration-ledger.js +1 -1
- package/dist/knowledge/arbitration-puzzle.js +1 -1
- package/dist/knowledge/arbitration-risk.d.ts +1 -0
- package/dist/knowledge/arbitration-risk.js +1 -1
- package/dist/knowledge/audit-rules.d.ts +2 -2
- package/dist/knowledge/audit-rules.js +1 -1
- package/dist/knowledge/baselines/judgment-baselines.json +21 -2
- package/dist/knowledge/baselines/rules/allocation.json +6 -6
- package/dist/knowledge/baselines/rules/arb.json +2 -2
- package/dist/knowledge/baselines/rules/guard.json +11 -11
- package/dist/knowledge/baselines/rules/oracle.json +120 -0
- package/dist/knowledge/baselines/rules/order.json +1 -1
- package/dist/knowledge/baselines/rules/plan.json +385 -18
- package/dist/knowledge/baselines/rules/progress.json +20 -2
- package/dist/knowledge/baselines/semantic-facts.js +1 -1
- package/dist/knowledge/builtin-templates.d.ts +25 -1
- package/dist/knowledge/builtin-templates.js +1 -1
- package/dist/knowledge/catalog-facts.d.ts +4 -0
- package/dist/knowledge/catalog-facts.js +1 -0
- package/dist/knowledge/commission-landing.js +1 -1
- package/dist/knowledge/component-schema.d.ts +64 -0
- package/dist/knowledge/component-schema.js +1 -0
- package/dist/knowledge/contact-templates.d.ts +0 -1
- package/dist/knowledge/contact-templates.js +1 -1
- package/dist/knowledge/dynamic-pricing.js +1 -1
- package/dist/knowledge/entity-recipient-guard.js +1 -1
- package/dist/knowledge/event-semantics.js +1 -1
- package/dist/knowledge/fee-param-bindings.d.ts +26 -0
- package/dist/knowledge/fee-param-bindings.js +1 -0
- package/dist/knowledge/fund-layer.d.ts +1 -0
- package/dist/knowledge/fund-layer.js +1 -1
- package/dist/knowledge/game-scenarios.js +1 -1
- package/dist/knowledge/getting-started.d.ts +2 -2
- package/dist/knowledge/getting-started.js +1 -1
- package/dist/knowledge/guard-anchor-reach.js +1 -1
- package/dist/knowledge/guard-binding-table.d.ts +52 -0
- package/dist/knowledge/guard-binding-table.js +1 -0
- package/dist/knowledge/guard-binding-verifier.d.ts +30 -0
- package/dist/knowledge/guard-binding-verifier.js +1 -0
- package/dist/knowledge/guard-bindings.js +1 -1
- package/dist/knowledge/guard-blueprint.d.ts +68 -0
- package/dist/knowledge/guard-blueprint.js +1 -0
- 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.d.ts +24 -0
- package/dist/knowledge/guard-host-context.js +1 -0
- package/dist/knowledge/guard-ledger.js +1 -1
- package/dist/knowledge/guard-lint.d.ts +1 -0
- package/dist/knowledge/guard-lint.js +1 -1
- package/dist/knowledge/guard-node-gates.d.ts +3 -0
- 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-submission-prompt.d.ts +11 -0
- package/dist/knowledge/guard-submission-prompt.js +1 -1
- package/dist/knowledge/guard-templates.d.ts +1 -1
- package/dist/knowledge/guard-templates.js +1 -1
- package/dist/knowledge/guard-translation.js +1 -1
- package/dist/knowledge/index.d.ts +1 -1
- package/dist/knowledge/index.js +1 -1
- package/dist/knowledge/industry-generalizer.d.ts +6 -1
- package/dist/knowledge/industry-generalizer.js +1 -1
- package/dist/knowledge/industry-registry.js +1 -1
- package/dist/knowledge/industry-strategy.js +1 -1
- package/dist/knowledge/jsonrpc-enum.d.ts +52 -3
- package/dist/knowledge/jsonrpc-enum.js +1 -1
- package/dist/knowledge/knob-docs.d.ts +5 -0
- package/dist/knowledge/knob-docs.js +1 -0
- package/dist/knowledge/machine-templates.js +1 -1
- package/dist/knowledge/machine-topology.js +1 -1
- package/dist/knowledge/machine-translation.js +1 -1
- package/dist/knowledge/object-dependency.d.ts +31 -0
- package/dist/knowledge/object-dependency.js +1 -0
- package/dist/knowledge/onchain-constants.d.ts +4 -0
- package/dist/knowledge/onchain-constants.js +1 -1
- package/dist/knowledge/order-ledger.js +1 -1
- package/dist/knowledge/param-schema.d.ts +93 -0
- package/dist/knowledge/param-schema.js +1 -0
- package/dist/knowledge/param-tiers.d.ts +25 -0
- package/dist/knowledge/param-tiers.js +1 -0
- package/dist/knowledge/passport-ledger.d.ts +1 -1
- package/dist/knowledge/passport-ledger.js +1 -1
- package/dist/knowledge/path-oracle/coverage.d.ts +16 -0
- package/dist/knowledge/path-oracle/coverage.js +1 -0
- package/dist/knowledge/path-oracle/index.d.ts +5 -0
- package/dist/knowledge/path-oracle/index.js +1 -0
- package/dist/knowledge/path-oracle/products/food-delivery.d.ts +2 -0
- package/dist/knowledge/path-oracle/products/food-delivery.js +1 -0
- package/dist/knowledge/path-oracle/schema.d.ts +188 -0
- package/dist/knowledge/path-oracle/schema.js +1 -0
- package/dist/knowledge/pattern-resolutions.d.ts +108 -0
- package/dist/knowledge/pattern-resolutions.js +1 -0
- package/dist/knowledge/progress-ledger.js +1 -1
- package/dist/knowledge/progress-risk.js +1 -1
- package/dist/knowledge/projection.spec.js +1 -1
- package/dist/knowledge/protocol-facts.js +1 -1
- package/dist/knowledge/requirement-families.d.ts +13 -0
- package/dist/knowledge/requirement-families.js +1 -0
- package/dist/knowledge/reward-ledger.js +1 -1
- package/dist/knowledge/safety-rules.js +1 -1
- package/dist/knowledge/scenario-modes.d.ts +2 -0
- package/dist/knowledge/scenario-modes.js +1 -1
- package/dist/knowledge/scenario-topology.js +1 -1
- package/dist/knowledge/semantic-ir.d.ts +4 -0
- package/dist/knowledge/semantic-ir.js +1 -1
- package/dist/knowledge/service-allocation-semantics.js +1 -1
- package/dist/knowledge/service-ledger.d.ts +1 -1
- package/dist/knowledge/service-ledger.js +1 -1
- package/dist/knowledge/service-templates.js +1 -1
- package/dist/knowledge/sku-name-gate.d.ts +17 -0
- package/dist/knowledge/sku-name-gate.js +1 -0
- package/dist/knowledge/strategy-manuals.d.ts +1 -1
- package/dist/knowledge/strategy-manuals.js +1 -1
- package/dist/knowledge/supply-chain.d.ts +9 -0
- package/dist/knowledge/supply-chain.js +1 -1
- package/dist/knowledge/template-loader.d.ts +114 -6
- package/dist/knowledge/template-loader.js +1 -1
- package/dist/knowledge/template-nav.d.ts +9 -0
- package/dist/knowledge/template-nav.js +1 -0
- package/dist/knowledge/template-prose.d.ts +1 -1
- package/dist/knowledge/template-registry.js +1 -1
- package/dist/knowledge/template-scanner.d.ts +95 -0
- package/dist/knowledge/template-scanner.js +1 -1
- package/dist/knowledge/template-test-profiles.d.ts +17 -0
- package/dist/knowledge/template-test-profiles.js +1 -0
- package/dist/knowledge/template-validation.d.ts +1 -0
- package/dist/knowledge/template-validation.js +1 -1
- package/dist/knowledge/tools-reference.js +1 -1
- package/dist/knowledge/treasury-templates.js +1 -1
- package/dist/knowledge/workflow-guidance.d.ts +5 -0
- package/dist/knowledge/workflow-guidance.js +1 -1
- package/dist/monitor/MonitorLoop.js +1 -1
- package/dist/participation/radar-core.js +1 -1
- package/dist/participation/time-window.d.ts +37 -0
- package/dist/participation/time-window.js +1 -0
- package/dist/persona/address-format.d.ts +0 -1
- package/dist/persona/address-format.js +1 -1
- package/dist/persona/bridge.js +1 -1
- package/dist/persona/index.d.ts +0 -2
- package/dist/persona/index.js +1 -1
- package/dist/persona/model.js +1 -1
- package/dist/persona/persona-audit.spec.js +1 -1
- package/dist/persona/types.d.ts +6 -0
- package/dist/playbooks/service-build/business-puzzle.js +1 -1
- package/dist/playbooks/service-build/game-theory.d.ts +2 -2
- package/dist/playbooks/service-build/intent-analyzer.js +1 -1
- package/dist/playbooks/service-build/machine-panorama.d.ts +1 -0
- package/dist/playbooks/service-build/machine-panorama.js +1 -1
- package/dist/playbooks/service-build/merchant-guide.d.ts +52 -22
- package/dist/playbooks/service-build/merchant-guide.js +1 -1
- package/dist/playbooks/service-build/migration-planner.d.ts +2 -0
- package/dist/playbooks/service-build/migration-planner.js +1 -1
- package/dist/playbooks/service-build/mode-actions.js +1 -1
- package/dist/playbooks/service-build/object-panorama.d.ts +8 -0
- package/dist/playbooks/service-build/object-panorama.js +1 -1
- package/dist/playbooks/service-build/participation-radar.d.ts +1 -0
- package/dist/playbooks/service-build/participation-radar.js +1 -1
- package/dist/playbooks/service-build/relationship-profile.js +1 -1
- package/dist/playbooks/service-build/reverse-mapping.d.ts +6 -0
- package/dist/playbooks/service-build/reverse-mapping.js +1 -1
- package/dist/playbooks/service-build/service-panorama.d.ts +2 -0
- package/dist/playbooks/service-build/service-panorama.js +1 -1
- package/dist/playbooks/service-build/service-quote.js +1 -1
- package/dist/playbooks/service-build/service-quote.spec.js +1 -1
- package/dist/playbooks/service-build/workflow-design-assessment.d.ts +10 -1
- package/dist/playbooks/service-build/workflow-design-assessment.js +1 -1
- package/dist/relationship/registry.js +1 -1
- package/dist/review/index.js +1 -1
- package/dist/review/repository.js +1 -1
- package/dist/runtime/instance-registry.d.ts +7 -1
- package/dist/runtime/instance-registry.js +1 -1
- package/dist/safety/confirm-gate.js +1 -1
- package/dist/schema/benchmark-migration/index.d.ts +106 -0
- package/dist/schema/benchmark-migration/index.js +1 -1
- package/dist/schema/call/allocation.d.ts +15 -6
- package/dist/schema/call/allocation.js +1 -1
- package/dist/schema/call/arbitration.js +1 -1
- package/dist/schema/call/base.d.ts +264 -0
- package/dist/schema/call/base.js +1 -1
- package/dist/schema/call/bridge.d.ts +34 -6
- package/dist/schema/call/demand.d.ts +15 -6
- package/dist/schema/call/demand.js +1 -1
- package/dist/schema/call/error-codes.d.ts +1 -1
- package/dist/schema/call/error-codes.js +1 -1
- package/dist/schema/call/guard.d.ts +8 -8
- package/dist/schema/call/guard.js +1 -1
- package/dist/schema/call/handler.d.ts +3 -0
- package/dist/schema/call/handler.js +1 -1
- package/dist/schema/call/machine.d.ts +32 -8
- package/dist/schema/call/machine.js +1 -1
- package/dist/schema/call/order.d.ts +26 -8
- package/dist/schema/call/order.js +1 -1
- package/dist/schema/call/payment.d.ts +20 -8
- package/dist/schema/call/payment.js +1 -1
- package/dist/schema/call/permission-handler.js +1 -1
- package/dist/schema/call/permission.d.ts +330 -114
- package/dist/schema/call/permission.js +1 -1
- package/dist/schema/call/personal.d.ts +10 -4
- package/dist/schema/call/personal.js +1 -1
- package/dist/schema/call/progress.d.ts +16 -4
- package/dist/schema/call/reward.d.ts +10 -4
- package/dist/schema/call/reward.js +1 -1
- package/dist/schema/call/semantic.d.ts +1 -0
- package/dist/schema/call/semantic.js +1 -1
- package/dist/schema/call/service.d.ts +131 -43
- package/dist/schema/call/service.js +1 -1
- package/dist/schema/call/treasury.d.ts +15 -6
- package/dist/schema/call/treasury.js +1 -1
- package/dist/schema/common/index.js +1 -1
- package/dist/schema/config/index.d.ts +61 -0
- package/dist/schema/config/index.js +1 -1
- package/dist/schema/envelope-unify.d.ts +4 -0
- package/dist/schema/envelope-unify.js +1 -0
- package/dist/schema/evaluation/index.d.ts +224 -19
- package/dist/schema/evaluation/index.js +1 -1
- package/dist/schema/goal/index.d.ts +47 -0
- package/dist/schema/goal/planning.d.ts +116 -1
- package/dist/schema/goal/planning.js +1 -1
- package/dist/schema/industry-pack/index.d.ts +166 -6
- package/dist/schema/industry-pack/index.js +1 -1
- package/dist/schema/industry-pack/modes.d.ts +6 -6
- package/dist/schema/keeper/index.d.ts +26 -0
- package/dist/schema/local/index.d.ts +157 -0
- package/dist/schema/local/index.js +1 -1
- package/dist/schema/local/wip.d.ts +6 -0
- package/dist/schema/local/wip.js +1 -1
- package/dist/schema/messenger/index.d.ts +28 -0
- package/dist/schema/messenger/index.js +1 -1
- package/dist/schema/operations.d.ts +343 -84
- package/dist/schema/operations.js +1 -1
- package/dist/schema/persona/index.d.ts +2907 -640
- package/dist/schema/persona/index.js +1 -1
- package/dist/schema/query/bi.d.ts +251 -4
- package/dist/schema/query/bi.js +1 -1
- package/dist/schema/query/index.d.ts +271 -78
- package/dist/schema/query/index.js +1 -1
- package/dist/schema/schema-query/index.d.ts +1 -1
- package/dist/schema/schema-query/index.js +1 -1
- package/dist/schema/schema-version.js +1 -1
- package/dist/schema/utils/permission-machine-check.d.ts +2 -0
- package/dist/schema/utils/permission-machine-check.js +1 -1
- package/dist/schema/watch/index.d.ts +16 -0
- package/dist/schema/watch/index.js +1 -1
- package/dist/schema/workflow/index.d.ts +2 -2
- package/dist/schema/workflow/index.js +1 -1
- package/dist/schema-query-impl/index.d.ts +1 -1
- package/dist/schema-query-impl/index.js +1 -1
- package/dist/schemas/account_operation.output.json +98 -2
- package/dist/schemas/benchmark_migration_operation.output.json +341 -12
- package/dist/schemas/benchmark_migration_operation.schema.json +42 -3
- package/dist/schemas/bridge_operation.output.json +98 -2
- package/dist/schemas/bridge_operation.schema.json +5 -5
- package/dist/schemas/config_operation.output.json +352 -0
- package/dist/schemas/config_operation.schema.json +20 -2
- package/dist/schemas/evaluation_operation.output.json +586 -4
- package/dist/schemas/evaluation_operation.schema.json +194 -3
- package/dist/schemas/goal_operation.schema.json +183 -0
- package/dist/schemas/guard2file.schema.json +1 -1
- package/dist/schemas/index.json +1 -1
- package/dist/schemas/industry_pack_operation.output.json +771 -1
- package/dist/schemas/industry_pack_operation.schema.json +28 -4
- package/dist/schemas/keeper_operation.output.json +96 -2
- package/dist/schemas/local_cache_operation.output.json +98 -2
- package/dist/schemas/local_history_operation.output.json +98 -2
- package/dist/schemas/local_info_operation.output.json +98 -2
- package/dist/schemas/local_mark_operation.output.json +98 -2
- package/dist/schemas/machineNode2file.schema.json +1 -1
- package/dist/schemas/messenger_operation.output.json +107 -2
- package/dist/schemas/messenger_operation.schema.json +41 -34
- package/dist/schemas/monitor_events.output.json +96 -2
- package/dist/schemas/monitor_subscription.output.json +96 -2
- package/dist/schemas/onchain_events.output.json +108 -14
- package/dist/schemas/onchain_operations.output.json +326 -11
- package/dist/schemas/onchain_operations.schema.json +1343 -734
- package/dist/schemas/onchain_operations_allocation.schema.json +35 -19
- package/dist/schemas/onchain_operations_arbitration.schema.json +16 -8
- package/dist/schemas/onchain_operations_contact.schema.json +12 -4
- package/dist/schemas/onchain_operations_demand.schema.json +33 -17
- package/dist/schemas/onchain_operations_gen_passport.schema.json +12 -4
- package/dist/schemas/onchain_operations_gen_proof.schema.json +1 -1
- package/dist/schemas/onchain_operations_guard.schema.json +297 -111
- package/dist/schemas/onchain_operations_machine.schema.json +56 -39
- package/dist/schemas/onchain_operations_order.schema.json +67 -42
- package/dist/schemas/onchain_operations_payment.schema.json +27 -12
- package/dist/schemas/onchain_operations_permission.schema.json +363 -232
- package/dist/schemas/onchain_operations_personal.schema.json +43 -28
- package/dist/schemas/onchain_operations_progress.schema.json +49 -32
- package/dist/schemas/onchain_operations_proof.schema.json +12 -4
- package/dist/schemas/onchain_operations_repository.schema.json +17 -8
- package/dist/schemas/onchain_operations_reward.schema.json +36 -20
- package/dist/schemas/onchain_operations_service.schema.json +230 -130
- package/dist/schemas/onchain_operations_treasury.schema.json +36 -20
- package/dist/schemas/onchain_table_data.output.json +276 -19
- package/dist/schemas/onchain_table_data.schema.json +104 -64
- package/dist/schemas/persona_operation.output.json +7752 -0
- package/dist/schemas/persona_operation.schema.json +1232 -4
- package/dist/schemas/query_toolkit.output.json +1054 -146
- package/dist/schemas/query_toolkit.schema.json +144 -13
- package/dist/schemas/schema_query.schema.json +1 -1
- package/dist/schemas/watch_operation.output.json +86 -3
- package/dist/schemas/wip_file.output.json +8 -0
- package/dist/schemas/workflow_operation.schema.json +5 -4
- package/dist/schemas/wowok_buildin_info.schema.json +1 -1
- package/dist/task/playbook.js +1 -1
- package/dist/tools/handlers/benchmark-migration.d.ts +12 -3
- package/dist/tools/handlers/benchmark-migration.js +1 -1
- package/dist/tools/handlers/config.js +1 -1
- package/dist/tools/handlers/evaluation.js +1 -1
- package/dist/tools/handlers/evaluation.spec.js +1 -1
- package/dist/tools/handlers/industry-pack.js +1 -1
- package/dist/tools/handlers/messenger.js +1 -1
- package/dist/tools/handlers/onchain.d.ts +24 -0
- package/dist/tools/handlers/onchain.js +1 -1
- package/dist/tools/handlers/persona.js +1 -1
- package/dist/tools/handlers/query.d.ts +8 -0
- package/dist/tools/handlers/query.js +1 -1
- package/dist/tools/handlers/winner-derivation.d.ts +20 -0
- package/dist/tools/handlers/winner-derivation.js +1 -0
- package/dist/tools/handlers/wip-upload.js +1 -1
- package/dist/tools/index.d.ts +1 -0
- package/dist/tools/index.js +1 -1
- package/dist/tools/registry/business.js +1 -1
- package/dist/tools/registry/config.js +1 -1
- package/dist/tools/registry/evaluation.js +1 -1
- package/dist/tools/registry/identity.js +1 -1
- package/dist/tools/registry/onchain.js +1 -1
- package/dist/tools/registry/query.js +1 -1
- package/dist/tools/sanitize-output.js +1 -1
- package/dist/tools/sanitize-output.spec.js +1 -1
- package/dist/tools/transport-integrity.d.ts +7 -0
- package/dist/tools/transport-integrity.js +1 -0
- package/dist/tools/types.d.ts +1 -0
- package/dist/tools/upgrade-check.d.ts +22 -0
- package/dist/tools/upgrade-check.js +1 -1
- package/dist/tools/wrap.d.ts +6 -1
- package/dist/tools/wrap.js +1 -1
- package/package.json +7 -6
- package/dist/extensions/business-modules.d.ts +0 -54
- package/dist/extensions/business-modules.js +0 -1
- package/dist/schemas/guard-templates.json +0 -379
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{classifyFeeParam}from'./param-tiers.js';export const PARAM_TAGS=['pricing','deposit','payout','settlement','window','cancel','return','review','dispute','logistics','membership','capacity','flow','staff','risk','growth','compliance'];const TAG_SET=new Set(PARAM_TAGS),TAG_RULES=[['pricing',/(_bps$|_price$|_usd$|_amount$|^min_|_fee$|_fee_|_cost$|^commission|^attributed_|^offsite_|^base_commission)/],['deposit',/(deposit|_floor_|escrow|prepay|balance_)/],['payout',/(payout|release|settle|settlement|remit)/],['settlement',/(settle|settlement|_release_|monthly_rent|threshold|commission|service_fee|_share_bps|retain_bps|_tip_bps)/],['window',/(_hours$|_days$|_ms$|_window$|_timeout|_deadline|_period|_grace|_term_|_nights$|_lead_)/],['cancel',/(cancel|withdraw|expire|no_show|no_fault)/],['return',/(return|refund|restock|replenish)/],['review',/(review|rating|reward|revision)/],['dispute',/(dispute|arbit|appeal|claim|triage|objection|defect_report)/],['logistics',/(ship|deliver|transit|pickup|dropoff|courier|dispatch|fulfil|handover|meet|auto_confirm|processing_time|production_lead)/],['membership',/(member|subscription|period_days|renewal|tier|quota)/],['capacity',/(_count$|_sessions$|_months$|_nights$|_allocators$|_rounds|_segment|_term_|_quota)/],['flow',/(_mode$|_line$|_type$|_policy$|_tier|_variant$|^storefront|^deposit_exit|^logistics|^crowdfunding|^installment|^acceptance|^after_sales)/],['staff',/(staff|operator|agent|role|permission|collaborator|roster)/],['risk',/(cap|_pool$|indemnity|penalty|forfeit|bond|guarantee|insurance)/],['growth',/(affiliate|referral|bounty|reward|promo|voucher|coupon|attributed_|offsite_)/],['compliance',/(privacy|consent|disclosure|age|kyc|passport|license|required_info)/]];export function tagsFor(a){const b=[];for(const [c,d]of TAG_RULES)if(d['test'](a))b['push'](c);return b;}const UNIT_BY_SUFFIX=[['_bps','bps'],['_usd','usd'],['_ms','ms'],['_hours','hours'],['_days','days'],['_months','months'],['_nights','nights'],['_count','count'],['_rounds','count'],['_sessions','count'],['_allocators','count']];export function unitFor(a){for(const [b,c]of UNIT_BY_SUFFIX)if(a['endsWith'](b))return c;return'unitless';}const UNIT_HINTS={'bps':'basis\x20points\x20(100\x20bps\x20=\x201%)','usd':'US\x20dollars','ms':'milliseconds','hours':'hours','days':'days','months':'months','nights':'nights','count':'a\x20whole\x20number','unitless':'a\x20plain\x20number','mist':'raw\x20amount\x20in\x20MIST\x20(1\x20WOW\x20=\x2010^9\x20MIST)'};export function unitHint(a){return UNIT_HINTS[a]??UNIT_HINTS['unitless'];}const PARAM_MEANINGS={'acceptance_timeout_hours':'Hours\x20the\x20supplier\x20has\x20to\x20accept\x20an\x20order\x20before\x20it\x20lapses.','after_sales_scope':'After-sales\x20money\x20scope\x20for\x20a\x20short/bad\x20delivery:\x20\x27full_refund\x27\x20(default)\x20refunds\x20the\x20whole\x20pledge\x20on\x20either\x20remedy\x20path;\x20\x27partial_refund\x27\x20refunds\x20in\x20full\x20only\x20when\x20goods\x20return\x20and\x20pays\x20the\x20declared\x20fixed\x20shortfall\x20compensation\x20on\x20the\x20refund-only\x20path.','allocator_threshold':'Formula\x20the\x20settlement\x20threshold\x20must\x20satisfy\x20(prose\x20directive,\x20not\x20a\x20setting).','annual_plan_usd':'Annual\x20membership\x20price\x20in\x20USD.','appeal_window_days':'Days\x20after\x20a\x20ruling\x20during\x20which\x20it\x20can\x20still\x20be\x20appealed.','arb_indemnity_floor_bps':'Floor,\x20in\x20basis\x20points\x20of\x20the\x20escrow,\x20reserved\x20for\x20arbitrator\x20compensation.','arb_payout_pairing':'How\x20a\x20buyer-won\x20ruling\x20combines\x20the\x20principal\x20refund\x20with\x20the\x20compensation:\x20\x27either\x27\x20pays\x20one\x20and\x20closes\x20the\x20other\x20rail,\x20\x27stacked\x27\x20pays\x20both\x20(the\x20stacked\x20money\x20rail\x20is\x20declared\x20only,\x20so\x20the\x20escrow\x20still\x20settles\x20under\x20\x27either\x27).','arbitration_fee_usd':'Flat\x20USD\x20fee\x20charged\x20to\x20open\x20an\x20arbitration\x20case.','attributed_commission_rate_bps':'Take\x20rate\x20charged\x20on\x20sales\x20traced\x20to\x20an\x20attributed\x20channel.','auto_confirm_days':'Days\x20of\x20buyer\x20silence\x20after\x20delivery\x20before\x20the\x20order\x20auto-completes\x20and\x20settlement\x20opens.','auto_confirm_hours':'Hours\x20of\x20buyer\x20silence\x20after\x20delivery\x20before\x20the\x20order\x20auto-completes.','balance_amount':'Remaining\x20amount\x20collected\x20in\x20the\x20balance\x20stage\x20(deposit\x20plus\x20balance\x20pricing).','balance_window_days':'Days\x20the\x20buyer\x20has\x20to\x20pay\x20the\x20remaining\x20balance\x20after\x20the\x20deposit.','base_commission_rate_bps':'Base\x20take\x20rate\x20before\x20channel-attribution\x20adjustments.','bounty_high_hunter_bps':'Hunter\x27s\x20share\x20of\x20the\x20high-severity\x20bounty\x20pool,\x20in\x20basis\x20points;\x20the\x20sponsoring\x20company\x20receives\x20the\x20complement\x20(10000\x20minus\x20this).','bounty_medium_hunter_bps':'Hunter\x27s\x20share\x20of\x20the\x20medium-severity\x20bounty\x20pool,\x20in\x20basis\x20points;\x20the\x20sponsoring\x20company\x20receives\x20the\x20complement\x20(10000\x20minus\x20this).','bounty_low_hunter_bps':'Hunter\x27s\x20share\x20of\x20the\x20low-severity\x20bounty\x20pool,\x20in\x20basis\x20points;\x20the\x20sponsoring\x20company\x20receives\x20the\x20complement\x20(10000\x20minus\x20this).','campaign_deadline_ms':'Unix\x20epoch\x20milliseconds\x20at\x20which\x20the\x20campaign\x20closes.\x20Generation\x20DERIVES\x20it\x20from\x20campaign_duration_days\x20when\x20the\x20operator\x20answered\x20the\x20length\x20(build\x20instant\x20+\x20N\x20days,\x20recorded\x20on\x20the\x20plan);\x20pass\x20it\x20directly\x20only\x20when\x20the\x20close\x20date\x20is\x20fixed.','campaign_duration_days':'Running\x20days\x20from\x20launch\x20to\x20campaign\x20close.\x20The\x20unit\x20the\x20operator\x20answers\x20in;\x20generation\x20converts\x20it\x20into\x20the\x20absolute\x20campaign_deadline_ms\x20every\x20chain\x20deadline\x20gate\x20reads.','cancel_tier_1_boundary_hours':'Notice\x20before\x20the\x20service\x20start\x20at\x20which\x20tier\x201\x20begins,\x20in\x20hours\x20(cancelling\x20further\x20out\x20pays\x20the\x20tier-1\x20charge).','cancel_tier_2_boundary_hours':'Notice\x20before\x20the\x20service\x20start\x20at\x20which\x20tier\x202\x20begins,\x20in\x20hours.','cancel_tier_3_boundary_hours':'Notice\x20before\x20the\x20service\x20start\x20at\x20which\x20tier\x203\x20(the\x20no-show\x20band)\x20begins,\x20in\x20hours.','cancel_tier_1_charge_bps':'Cancellation\x20charge\x20for\x20the\x20earliest\x20band\x20(most\x20notice),\x20in\x20basis\x20points\x20of\x20the\x20order\x20amount;\x20the\x20buyer\x20is\x20refunded\x20the\x20complement.','cancel_tier_2_charge_bps':'Cancellation\x20charge\x20for\x20the\x20middle-early\x20band,\x20in\x20basis\x20points\x20of\x20the\x20order\x20amount;\x20the\x20buyer\x20is\x20refunded\x20the\x20complement.','cancel_tier_3_charge_bps':'Cancellation\x20charge\x20for\x20the\x20middle-late\x20band,\x20in\x20basis\x20points\x20of\x20the\x20order\x20amount;\x20the\x20buyer\x20is\x20refunded\x20the\x20complement.','cancel_tier_4_charge_bps':'Cancellation\x20charge\x20for\x20the\x20last-minute\x20(no-show)\x20band,\x20in\x20basis\x20points\x20of\x20the\x20order\x20amount;\x20the\x20buyer\x20is\x20refunded\x20the\x20complement.','service_start_ms':'Unix\x20epoch\x20milliseconds\x20of\x20the\x20service/departure\x20start,\x20shared\x20by\x20every\x20order\x20of\x20that\x20service;\x20the\x20cancellation\x20bands\x20measure\x20notice\x20against\x20it.','cancellation_policy':'Prose\x20cancellation\x20policy;\x20the\x20enforceable\x20values\x20are\x20the\x20cancel-window\x20keys.','claim_window_days':'Days\x20after\x20delivery\x20in\x20which\x20the\x20buyer\x20can\x20file\x20a\x20dispute\x20before\x20settlement\x20opens.','claim_window_hours':'Hours\x20of\x20the\x20dispute-filing\x20window\x20after\x20delivery.','claim_window_open_min_hold_hours':'Hours\x20after\x20delivery\x20before\x20the\x20keeper\x20may\x20open\x20the\x20dispute\x20window\x20—\x20the\x20claim\x20clock\x20cannot\x20start\x20at\x20the\x20delivery\x20instant.','dispatch_window_hours':'Hours\x20after\x20the\x20order\x20sits\x20ready\x20in\x20which\x20a\x20rostered\x20rider\x20must\x20pick\x20it\x20up;\x20elapsed\x20with\x20no\x20pickup,\x20the\x20platform\x20force-cancels\x20penalty-free\x20into\x20the\x20full-refund\x20terminal\x20(capacity\x20shortage\x20is\x20the\x20platform\x27s\x20fulfillment\x20failure).','co_holder_bps':'Share,\x20in\x20basis\x20points,\x20held\x20by\x20a\x20co-holder\x20of\x20the\x20asset\x20or\x20right.','commission_rate_bps':'Platform\x20take\x20rate\x20per\x20settled\x20order,\x20in\x20basis\x20points\x20(0\x20keeps\x20the\x20merchant\x20the\x20full\x20amount).','confirm_timeout_hours':'Hours\x20the\x20merchant\x20has\x20to\x20confirm\x20an\x20order\x20before\x20it\x20auto-cancels.','confirm_window_hours':'Window,\x20in\x20hours,\x20for\x20confirming\x20the\x20order\x20or\x20handover.','contract_fee_large_usd':'Flat\x20contract\x20fee\x20for\x20large\x20engagements.','contract_fee_small_usd':'Flat\x20contract\x20fee\x20for\x20small\x20engagements.','contract_fee_tier_boundary_usd':'Contract\x20value,\x20in\x20USD,\x20separating\x20the\x20small\x20from\x20the\x20large\x20fee\x20tier.','courier_fee':'Courier\x20delivery\x20fee.','courier_tip_bps':'Rider\x20tip\x20or\x20incentive,\x20in\x20basis\x20points\x20of\x20the\x20order\x20value.','course_price_usd':'Price\x20of\x20one\x20course\x20seat\x20in\x20USD.','creator_settlement_retain_bps':'Share\x20of\x20each\x20settlement\x20the\x20creator\x20keeps\x20(the\x20rest\x20funds\x20platform\x20and\x20fee\x20legs).','damage_max_amount':'Maximum\x20damage\x20compensation\x20payable\x20out\x20of\x20the\x20escrow.','defect_report_window_hours':'Hours\x20after\x20delivery\x20in\x20which\x20a\x20defect\x20or\x20damage\x20must\x20be\x20reported.','delivery_window_days':'Promised\x20delivery\x20window\x20in\x20days.','deposit_amount':'Up-front\x20deposit\x20collected\x20at\x20order\x20time\x20(the\x20rest\x20is\x20collected\x20later).','deposit_exit_policy':'Prose\x20policy\x20for\x20exiting\x20or\x20refunding\x20the\x20deposit.','deposit_refund_days':'Days\x20after\x20checkout\x20within\x20which\x20the\x20deposit\x20is\x20refunded.','digital_product_fee_bps':'Fee\x20rate\x20charged\x20on\x20digital\x20product\x20sales.','digital_product_fee_max_usd':'Cap\x20on\x20the\x20digital\x20product\x20fee,\x20in\x20USD.','digital_product_fee_min_usd':'Floor\x20on\x20the\x20digital\x20product\x20fee,\x20in\x20USD.','dispute_timeout_days':'Days\x20after\x20a\x20dispute\x20is\x20filed\x20before\x20it\x20escalates\x20or\x20defaults.','dispute_window_days':'Days\x20after\x20delivery\x20to\x20escalate\x20a\x20complaint\x20to\x20arbitration.','early_exit_penalty_amount':'Flat\x20penalty\x20charged\x20on\x20early\x20termination.','early_exit_penalty_months':'Months\x20of\x20rent\x20charged\x20as\x20the\x20early-exit\x20penalty.','errand_line':'Errand\x20service\x20line;\x20this\x20selector\x20changes\x20which\x20rails\x20the\x20machine\x20installs.','escrow_release_days':'Days\x20the\x20escrow\x20holds\x20before\x20the\x20funds\x20release\x20to\x20the\x20merchant.','evaluation_window_days':'Days\x20allowed\x20to\x20evaluate\x20a\x20submitted\x20deliverable.','evidence_window_hours':'Hours\x20to\x20submit\x20evidence\x20once\x20a\x20dispute\x20is\x20open.','free_cancel_hours':'Hours\x20after\x20purchase\x20during\x20which\x20cancellation\x20is\x20free\x20(full\x20refund).','full_price':'List\x20price\x20before\x20discounts\x20or\x20the\x20deposit\x20split.','funding_threshold':'Amount\x20that\x20must\x20be\x20raised\x20for\x20the\x20campaign\x20to\x20succeed.','grace_days':'Grace\x20period\x20in\x20days\x20before\x20a\x20late\x20payment\x20counts\x20as\x20a\x20breach.','host_rate_bps':'Host\x20payout\x20share\x20of\x20the\x20booking\x20value,\x20in\x20basis\x20points.','incumbent_take_bps':'Take\x20rate\x20of\x20the\x20incumbent\x20platform\x20(comparison\x20only).','inspection_deadline_hours':'Hours\x20to\x20complete\x20the\x20inspection\x20after\x20handover.','inspection_window_days':'Days\x20of\x20inspection\x20window\x20after\x20delivery.','instant_cancel_hours':'Hours\x20within\x20which\x20cancellation\x20takes\x20effect\x20immediately.','institution_share_bps':'Share\x20of\x20course\x20revenue\x20paid\x20to\x20the\x20institution.','kill_fee_bps':'Fee\x20kept\x20from\x20the\x20escrow\x20when\x20the\x20buyer\x20cancels\x20after\x20acceptance.','kill_fee_buyer_bps':'Late-cancellation\x20fee\x20charged\x20to\x20the\x20buyer.','layer2_segment_amounts':'Segment\x20amounts\x20of\x20the\x20second\x20allocation\x20layer\x20(directive\x20formula).','leader_commission_bps':'Commission\x20paid\x20to\x20the\x20group\x20leader\x20on\x20each\x20member\x20order.','lease_months':'Lease\x20length\x20in\x20months.','max_months':'Longest\x20subscription\x20or\x20lease\x20term,\x20in\x20months.','max_sessions':'Maximum\x20sessions\x20included\x20in\x20the\x20plan.','membership_price':'Membership\x20price\x20per\x20period.','merchant_service_fee_bps':'Incumbent\x20marketplace\x27s\x20merchant-side\x20service\x20fee\x20(benchmark,\x20comparison\x20only).\x20WoWok\x20is\x20DIRECT\x20SALES\x20here:\x20this\x20store\x20pays\x20no\x20platform\x20commission,\x20so\x20the\x20shipped\x20value\x20is\x200\x20and\x20no\x20money\x20rail\x20reads\x20it\x20—\x20set\x20it\x20only\x20if\x20YOU\x20are\x20the\x20aggregator\x20charging\x20your\x20own\x20sellers.','min_balance':'Minimum\x20balance\x20that\x20must\x20remain\x20(directive\x20floor).','min_booking_amount':'Minimum\x20bookable\x20amount\x20(directive\x20floor).','min_contract_usd':'Minimum\x20contract\x20value\x20in\x20USD\x20(directive\x20floor).','min_course_price_usd':'Minimum\x20course\x20price\x20in\x20USD\x20(directive\x20floor).','min_monthly_rent_usd':'Minimum\x20monthly\x20rent\x20in\x20USD\x20(directive\x20floor).','min_order_price':'Minimum\x20order\x20price\x20(directive\x20floor).','min_sku_price':'Minimum\x20SKU\x20price\x20(directive\x20floor).','min_term_price':'Minimum\x20price\x20per\x20term:\x20the\x20numeric\x20floor\x20the\x20settlement\x20fixed\x20legs\x20must\x20fit\x20under\x20(per-session\x20releases\x20count\x20the\x20whole\x20term).','min_term_price_usd':'Minimum\x20price\x20per\x20term\x20in\x20USD\x20(directive\x20floor).','max_discount_bps':'Ceiling\x20on\x20any\x20coupon\x20the\x20merchant\x20may\x20issue\x20against\x20this\x20shape,\x20in\x20basis\x20points\x20—\x20derived\x20from\x20how\x20much\x20the\x20fixed\x20legs\x20leave\x20above\x20the\x20price\x20floor.','month_release_day':'Day\x20of\x20the\x20month\x20on\x20which\x20the\x20monthly\x20release\x20runs.','monthly_allocators':'Monthly\x20allocators\x20to\x20open,\x20one\x20per\x20release\x20period.','monthly_rent_amount':'Monthly\x20rent\x20amount.','no_fault_exit_days':'Days\x20of\x20notice\x20required\x20for\x20a\x20no-fault\x20exit.','no_show_floor_hours':'Hours\x20after\x20which\x20a\x20no-show\x20releases\x20the\x20slot\x20with\x20a\x20floor\x20charge.','objection_window_hours':'Hours\x20to\x20object\x20after\x20a\x20proposal\x20or\x20claim.','offsite_ads_rate_bps':'Take\x20rate\x20on\x20off-site\x20advertising-attributed\x20sales.','partner_share_bps':'Share\x20of\x20revenue\x20paid\x20to\x20the\x20partner.','payment_fee_bps':'Payment\x20processing\x20fee\x20in\x20basis\x20points.','per_session_release':'Amount\x20released\x20per\x20completed\x20session.','period_days':'Length\x20of\x20one\x20billing\x20period\x20in\x20days.','pickup_window_hours':'Hours\x20within\x20which\x20pickup\x20must\x20be\x20completed.','platform_commission_bps':'Platform\x20take\x20rate\x20per\x20settled\x20order,\x20in\x20basis\x20points\x20(0\x20keeps\x20the\x20merchant\x20the\x20full\x20amount).','platform_commission_rate_bps':'Platform\x20take\x20rate\x20per\x20settled\x20order,\x20in\x20basis\x20points.','platform_fee_rate_bps':'Platform\x20fee\x20rate\x20applied\x20to\x20the\x20order\x20value,\x20in\x20basis\x20points.','platform_rate_bps':'Platform\x20rate\x20applied\x20to\x20the\x20order\x20value,\x20in\x20basis\x20points.','platform_rate_cap_bps':'Upper\x20bound\x20on\x20the\x20platform\x20take\x20rate.','platform_share_bps':'Share\x20of\x20the\x20order\x20kept\x20by\x20the\x20platform.','platform_take_bps':'Platform\x20take\x20per\x20settled\x20order,\x20in\x20basis\x20points.','platform_tool_fee_bps':'Fee\x20for\x20using\x20the\x20platform\x20tooling,\x20in\x20basis\x20points.','point_type':'Point\x20or\x20credit\x20type\x20used\x20by\x20the\x20loyalty\x20ledger.','preferred_property_rate_bps':'Commission\x20rate\x20applied\x20to\x20preferred\x20properties.','prepay_cap':'Cap\x20on\x20the\x20amount\x20that\x20may\x20be\x20prepaid.','primary_holder_bps':'Share\x20held\x20by\x20the\x20primary\x20rights\x20holder.','processing_time_days':'Days\x20the\x20supplier\x20takes\x20to\x20process\x20the\x20request.','producer_bps':'Share\x20paid\x20to\x20the\x20producer.','production_lead_days':'Days\x20needed\x20to\x20produce\x20the\x20item\x20before\x20it\x20ships.','property_rate_bps':'Commission\x20rate\x20on\x20property\x20bookings.','protection_cap_usd':'Maximum\x20buyer-protection\x20payout\x20in\x20USD.','publisher_bps':'Share\x20paid\x20to\x20the\x20publisher.','refund_window_days':'Days\x20after\x20delivery\x20in\x20which\x20a\x20refund\x20may\x20be\x20requested.','renewal_reminder_days':'Days\x20before\x20renewal\x20to\x20send\x20the\x20reminder.','required_info_enforcement':'Whether\x20missing\x20required\x20buyer\x20info\x20blocks\x20the\x20order\x20(on/off).','requirements_timeout_hours':'Hours\x20the\x20buyer\x20has\x20to\x20supply\x20missing\x20requirements\x20before\x20the\x20order\x20lapses.','response_timeout_hours':'Hours\x20a\x20seller\x20has\x20to\x20grant\x20or\x20decline\x20a\x20cancel\x20request\x20before\x20a\x20keeper\x20auto-cancels\x20it\x20in\x20the\x20buyer\x27s\x20favour\x20(full\x20refund).','refund_response_hours':'Hours\x20a\x20seller\x20has\x20to\x20grant\x20or\x20decline\x20a\x20refund\x20request\x20before\x20a\x20keeper\x20auto-refunds\x20the\x20buyer\x20in\x20full\x20(the\x20refund-request\x20twin\x20of\x20the\x20cancel\x20clock).','reserve_days':'Days\x20a\x20reserve\x20is\x20held\x20back\x20from\x20the\x20payout.','restock_confirm_days':'Days\x20to\x20confirm\x20restocking\x20after\x20a\x20return\x20arrives.','restock_on_refund':'Restock\x20rule\x20applied\x20when\x20a\x20refund\x20completes\x20(directive).','return_notice_days':'Days\x20of\x20notice\x20required\x20before\x20returning\x20the\x20item.','return_transit_days':'Days\x20allowed\x20for\x20the\x20returned\x20item\x20to\x20travel\x20back.','return_window_days':'Days\x20after\x20delivery\x20in\x20which\x20the\x20buyer\x20may\x20return\x20the\x20item.','return_window_hours':'Hours\x20after\x20delivery\x20in\x20which\x20the\x20buyer\x20may\x20return\x20the\x20item.','review_reward_per_claim':'Bounty\x20paid\x20for\x20one\x20accepted\x20review\x20claim.','review_reward_pool':'Total\x20pool\x20that\x20funds\x20review\x20rewards.','review_window_days':'Days\x20after\x20completion\x20in\x20which\x20a\x20review\x20may\x20be\x20submitted.','revision_rounds_max':'Maximum\x20revision\x20rounds\x20included\x20in\x20the\x20price.','reward_claim_closes_after_days':'Days\x20after\x20completion\x20when\x20the\x20review-reward\x20claim\x20closes.','reward_claim_opens_after_days':'Days\x20after\x20the\x20after-sales\x20window\x20before\x20the\x20review-reward\x20bounty\x20becomes\x20claimable.','segment_count':'Number\x20of\x20allocation\x20segments.','service_fee_rate_bps':'Service\x20fee\x20rate\x20charged\x20on\x20the\x20order.','session_count':'Number\x20of\x20sessions\x20included\x20in\x20the\x20plan.','settle_hours':'Hours\x20after\x20the\x20settlement\x20window\x20opens\x20before\x20funds\x20reach\x20the\x20merchant.','settlement_days':'Days\x20between\x20order\x20completion\x20and\x20settlement\x20to\x20the\x20merchant.','settlement_delay_days':'Delay\x20in\x20days\x20applied\x20to\x20the\x20payout.','setting_lock_days':'Days\x20during\x20which\x20a\x20setting\x20is\x20locked\x20after\x20the\x20order\x20is\x20placed.','shortfall_refund_amount':'Fixed\x20shortfall\x20compensation\x20in\x20absolute\x20chain\x20units,\x20paid\x20instead\x20of\x20the\x20whole\x20pledge\x20on\x20the\x20refund-only\x20bad-item\x20path\x20when\x20after_sales_scope\x20is\x20\x27partial_refund\x27;\x20the\x20listing\x20price\x20must\x20exceed\x20it\x20(minimum\x20order\x20amount\x20discipline).','stay_nights':'Nights\x20per\x20stay.','storefront_mode':'Storefront\x20shape;\x20this\x20selector\x20changes\x20the\x20generated\x20storefront\x20topology.','submission_window_days':'Days\x20to\x20submit\x20the\x20deliverable.','subscription_monthly_usd':'Monthly\x20subscription\x20price\x20in\x20USD.','term_count':'Number\x20of\x20terms\x20or\x20invoices\x20in\x20the\x20contract.','term_price':'Price\x20charged\x20per\x20term.','term_price_usd':'Price\x20charged\x20per\x20term\x20in\x20USD.','threshold':'Escrow\x20amount\x20that\x20triggers\x20the\x20next\x20stage.','tier5_guest_bps':'Cancellation\x20tier\x205:\x20share\x20charged\x20to\x20the\x20guest.','tier5_host_bps':'Cancellation\x20tier\x205:\x20share\x20paid\x20to\x20the\x20host.','tier6_guest_bps':'Cancellation\x20tier\x206:\x20share\x20charged\x20to\x20the\x20guest.','tier6_host_bps':'Cancellation\x20tier\x206:\x20share\x20paid\x20to\x20the\x20host.','triage_window_days':'Days\x20to\x20triage\x20a\x20report\x20before\x20it\x20escalates.','tuition_usd':'Tuition\x20per\x20enrollment\x20in\x20USD.','unclaimed_exit':'What\x20happens\x20to\x20an\x20order\x20the\x20buyer\x20never\x20collects:\x20refund_buyer\x20(default)\x20returns\x20the\x20principal\x20in\x20full\x20after\x20the\x20pickup\x20window,\x20settle_merchant\x20opens\x20the\x20serial\x20claim\x20window\x20and\x20settles\x20to\x20the\x20supplier\x20with\x20the\x20buyer\x20keeping\x20a\x20late-appeal\x20refund\x20route.','withdrawal_window_days':'Days\x20during\x20which\x20withdrawal\x20is\x20allowed.'};export const CURATED_MEANING_COUNT=Object['keys'](PARAM_MEANINGS)['length'];const KIND_WORD={'money':'amount','ratio':'rate','duration':'duration','count':'count','enum':'option','flag':'on/off\x20switch','text':'text','list':'list\x20of\x20values'};export function paramMeaning(a,b,c,d){const e=PARAM_MEANINGS[a];if(e!==undefined)return e;const f=d['length']>0x0?'\x20on\x20the\x20'+d['join']('/')+'\x20facet':'';return'Not\x20yet\x20described\x20—\x20a\x20'+KIND_WORD[b]+(c!=='unitless'?'\x20in\x20'+c:'')+f+'.';}export const PARAM_ALIASES=[['take\x20rate',['platform_commission_bps','platform_commission_rate_bps','platform_take_bps','platform_fee_rate_bps','platform_rate_bps','commission_rate_bps','merchant_service_fee_bps','incumbent_take_bps']],['commission',['platform_commission_bps','commission_rate_bps','leader_commission_bps','attributed_commission_rate_bps']],['get\x20paid',['settle_hours','settlement_days','settlement_delay_days','escrow_release_days','month_release_day']],['payout',['settle_hours','settlement_days','settlement_delay_days','escrow_release_days','reserve_days']],['refund',['return_window_days','refund_window_days','deposit_refund_days','free_cancel_hours']],['cancel',['free_cancel_hours','instant_cancel_hours','kill_fee_bps','cancel_tier_1_charge_bps','cancel_tier_2_charge_bps','cancel_tier_3_charge_bps','cancel_tier_4_charge_bps']],['dispute',['claim_window_days','dispute_window_days','dispute_timeout_days','arbitration_fee_usd']],['deposit',['deposit_amount','balance_amount','prepay_cap']],['tip',['courier_tip_bps','courier_fee']],['reward',['review_reward_pool','review_reward_per_claim','reward_claim_opens_after_days','reward_claim_closes_after_days']],['bounty',['bounty_high_hunter_bps','bounty_medium_hunter_bps','bounty_low_hunter_bps']],['hunter\x20share',['bounty_high_hunter_bps','bounty_medium_hunter_bps','bounty_low_hunter_bps']],['review',['review_window_days','review_reward_per_claim','review_reward_pool']],['rent',['monthly_rent_amount','lease_months','early_exit_penalty_months']],['delivery',['delivery_window_days','courier_fee','pickup_window_hours']],['membership',['membership_price','subscription_monthly_usd','annual_plan_usd','period_days']],['commission\x20cap',['platform_rate_cap_bps','protection_cap_usd']],['fee',['arbitration_fee_usd','payment_fee_bps','courier_fee','platform_tool_fee_bps']],['how\x20much\x20do\x20i\x20keep',['platform_commission_bps','platform_take_bps','platform_share_bps','commission_rate_bps']],['late\x20fee',['kill_fee_bps','early_exit_penalty_months','cancel_tier_4_charge_bps']],['no\x20show',['no_show_floor_hours']],['holdback',['reserve_days','creator_settlement_retain_bps','setting_lock_days']],['minimum\x20order',['min_order_price','min_contract_usd','min_course_price_usd','min_booking_amount','min_sku_price']],['campaign\x20length',['campaign_duration_days']],['arbitration\x20fee',['arbitration_fee_usd']],['dispute\x20window',['dispute_window_days','dispute_timeout_days','claim_window_days']],['late\x20delivery',['delivery_window_days','auto_confirm_days','auto_confirm_hours']],['plan\x20price',['subscription_monthly_usd','annual_plan_usd','membership_price']],['renewal\x20reminder',['renewal_reminder_days']],['shipping\x20deadline',['processing_time_days','delivery_window_days']],['down\x20payment',['deposit_amount','balance_amount','deposit_refund_days']],['balance\x20due',['balance_amount','balance_window_days']],['notice\x20period',['return_notice_days','no_fault_exit_days','early_exit_penalty_months']],['guest\x20count',['tier5_guest_bps','tier6_guest_bps']],['tiered\x20pricing',['tier5_guest_bps','tier6_guest_bps']],['cancellation\x20charge',['cancel_tier_1_charge_bps','cancel_tier_2_charge_bps','cancel_tier_3_charge_bps','cancel_tier_4_charge_bps']],['money\x20released',['settle_hours','settlement_days','settlement_delay_days','escrow_release_days','month_release_day','reserve_days']],['release\x20the\x20money',['settle_hours','settlement_days','settlement_delay_days','escrow_release_days','month_release_day','reserve_days']]];const MAX_BY_UNIT={'hours':{'max':0x2238,'hint':'0..8760\x20(one\x20year;\x200\x20=\x20unset)'},'days':{'max':0x16d,'hint':'0..365\x20(one\x20year;\x200\x20=\x20unset)'},'months':{'max':0x3c,'hint':'0..60\x20(five\x20years)'},'nights':{'max':0x16d,'hint':'0..365\x20nights'},'ms':{'max':0x3bb2cc3d800,'hint':'milliseconds;\x20absolute\x20deadlines\x20may\x20be\x20epoch\x20ms\x20(up\x20to\x20year\x202100)'},'count':{'max':0x186a0,'hint':'0\x20or\x20more,\x20whole\x20numbers'}},PARAM_RANGE_OVERRIDES={'stay_nights':{'min':0x1,'max':0x16d,'hint':'1..365\x20nights'},'period_days':{'min':0x1,'max':0x16e,'hint':'1..366\x20days\x20(a\x20monthly\x20period\x20is\x2030,\x20a\x20leap\x20year\x20366)'},'lease_months':{'min':0x1,'max':0x78,'hint':'1..120\x20months'},'max_months':{'min':0x1,'max':0x78,'hint':'1..120\x20months'},'month_release_day':{'min':0x1,'max':0x1f,'hint':'1..31\x20(a\x20day\x20of\x20the\x20month)'},'revision_rounds_max':{'min':0x0,'max':0x64,'hint':'0..100\x20rounds'}};export function boundsFor(a,b,c){if(a==='enum'||a==='flag'||a==='text'||a==='list')return undefined;if(b==='bps')return{'min':0x0,'max':0x2710,'hint':'0..10000\x20(100\x20bps\x20=\x201%)'};if(c!==undefined&&PARAM_RANGE_OVERRIDES[c]!==undefined)return PARAM_RANGE_OVERRIDES[c];if(a==='money')return{'min':0x0,'hint':'0\x20or\x20more'};const d=MAX_BY_UNIT[b];if(a==='count')return{'min':0x0,'max':MAX_BY_UNIT['count']['max'],'hint':MAX_BY_UNIT['count']['hint']};if(a==='duration'){if(d!==undefined)return{'min':0x0,'max':d['max'],'hint':d['hint']};return{'min':0x0,'hint':'0\x20or\x20more\x20in\x20the\x20row\x27s\x20unit\x20(0\x20=\x20unset)'};}return undefined;}export function kindFor(a,b,c,d){if(c)return'enum';if(typeof b==='string'){if(/^(on|off|true|false)$/i['test'](b))return'flag';if(/^\s*-?\d+(?:\.\d+)?(?:\s*\/\s*-?\d+(?:\.\d+)?)+\s*$/['test'](b))return'list';return'enum';}const e=unitFor(a);if(e==='usd')return'money';if(e==='bps')return'ratio';if(e==='hours'||e==='days'||e==='ms'||e==='months'||e==='nights')return'duration';if(e==='count')return'count';if(d['includes']('pricing')||/amount|price|pool|cap|threshold|fee|cost|rent|reward|_per_claim|_release$|_retain|_tip$|tuition|balance|prepay|_share/['test'](a))return'money';return'count';}export function paramSchema(a){const b=new Set((a['conditional_guards']??[])['map'](e=>e['param'])),d=new Map();for(const e of a['conditional_guards']??[]){if(e['values']===undefined)continue;const f=d['get'](e['param'])??[];for(const g of e['values'])if(!f['includes'](g))f['push'](g);d['set'](e['param'],f);}return Object['entries'](a['fee_params'])['map'](([h,i])=>{const j=b['has'](h),k=classifyFeeParam(h,i,j),l=tagsFor(h),m=kindFor(h,i,j,l),n=unitFor(h),o=m==='money'&&n==='unitless'?'mist':n;return{'key':h,'tier':k['tier'],'tier_name':k['tier_name'],'group':k['group'],'tags':l,'kind':m,'unit':o,'unit_hint':unitHint(o),'meaning':paramMeaning(h,m,o,l),'type':typeof i==='number'?'number':'string','default':i,'bounds':boundsFor(m,o,h),'allowed':d['get'](h)??[],'disclosure':k['disclosure'],'selector':j,'settable_by':'merchant'};})['sort']((h,i)=>h['tier']-i['tier']||h['key']['localeCompare'](i['key']));}export function resolveUserInputQuestions(a){const b=new Map(paramSchema(a)['map'](c=>[c['key'],c]));return(a['user_input_specs']??[])['map'](c=>{const d=b['get'](c['param_key']);if(d===undefined)throw new Error('user_input_spec\x20\x27'+c['question']+'\x27\x20binds\x20undeclared\x20fee_param\x20\x27'+c['param_key']+'\x27\x20—\x20declare\x20the\x20key\x20in\x20fee_params\x20first');return{'question':c['question'],'param_key':c['param_key'],...c['note']!==undefined?{'note':c['note']}:{},'default':d['default'],'unit_hint':d['unit_hint'],'meaning':d['meaning'],...d['bounds']!==undefined?{'bounds':d['bounds']}:{},'allowed':d['allowed']};});}const STOPWORDS=new Set(['the','a','an','of','for','to','how','what','is','my','can','i','set','and','in','on','do','per','each']),WORD_SYNONYMS={'shipping':'ship','shipment':'ship','shipped':'ship','delivery':'deliver','deliveries':'deliver','restocking':'restock','restocked':'restock','renewals':'renewal'};function singular(a){if(a['length']<=0x3)return a;if(a['endsWith']('ies'))return a['slice'](0x0,-0x3)+'y';if(/(?:ses|xes|zes|ches|shes)$/['test'](a))return a['slice'](0x0,-0x2);if(a['endsWith']('s')&&!a['endsWith']('ss'))return a['slice'](0x0,-0x1);return a;}function canon(a){return WORD_SYNONYMS[a]??WORD_SYNONYMS[singular(a)]??singular(a);}function tokens(a){return a['toLowerCase']()['split'](/[^a-z0-9]+/)['filter'](b=>b['length']>0x1&&!STOPWORDS['has'](b))['map'](canon);}function keyWords(a){return a['toLowerCase']()['split'](/[^a-z0-9]+/)['filter'](b=>b['length']>0x1)['map'](canon);}const MIN_SCORE=0x4;export function matchParams(a,b,c=0x5){const d=tokens(a);if(d['length']===0x0)return[];const e=d['every'](m=>TAG_SET['has'](m))&&!b['some'](m=>keyWords(m['key'])['some'](n=>d['includes'](n))),f=a['toLowerCase']()['replace'](/[^a-z0-9]+/g,'_'),g='\x20'+a['toLowerCase']()['replace'](/[^a-z0-9]+/g,'\x20')['trim']()+'\x20',h=g['trim']()['split']('\x20')[0x0]??'',i=new Set(),j=[];for(const [m,n]of PARAM_ALIASES){if(!g['includes']('\x20'+m+'\x20')&&!g['includes']('\x20'+m+'s\x20'))continue;if(!m['includes']('\x20')&&m!==h)continue;j['push'](m);for(const o of n)i['add'](o);}const l=[];for(const p of b){if(p['disclosure']==='hidden')continue;let r=0x0;const s=[],u=new Set(),v=keyWords(p['key']);(p['key']===f||f['includes'](p['key']))&&(r+=0xa,s['push']('key:'+p['key']));for(const w of d){(v['includes'](w)||p['key']['includes']('_'+w))&&(r+=0x3,u['add'](w),s['push']('key-word:'+w)),p['tags']['includes'](w)&&(r+=0x2,u['add'](w),s['push']('tag:'+w));}i['has'](p['key'])&&(r+=0x6,s['push'](...j['map'](x=>'alias:'+x)));e&&d['every'](x=>p['tags']['includes'](x))&&(r+=0x4,s['push']('facet:'+d['join']('+')));if(p['meaning']!==undefined){const x=p['meaning']['toLowerCase']();let y=0x0;for(const z of d){if(y>=0x2)break;if(u['has'](z))continue;x['includes'](z)&&(r+=0x1,y++,s['push']('meaning:'+z));}}if(r<MIN_SCORE)continue;l['push']({'row':p,'score':r+0x1,'reasons':[...new Set(s)]});}return e?l['sort']((A,B)=>A['row']['tier']-B['row']['tier']||B['score']-A['score']||A['row']['key']['localeCompare'](B['row']['key'])):l['sort']((A,B)=>B['score']-A['score']||A['row']['key']['localeCompare'](B['row']['key'])),l['slice'](0x0,c);}export function searchTemplates(a,b,c,d=0x8){const e=[];for(const f of b){for(const g of matchParams(a,c(f),0x2)){e['push']({'template':f['id'],'key':g['row']['key'],'tier':g['row']['tier'],'disclosure':g['row']['disclosure'],'score':g['score']});}}return e['sort']((h,i)=>i['score']-h['score']||h['template']['localeCompare'](i['template'])),e['slice'](0x0,d);}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export type ParamTier = 1 | 2 | 3 | 4 | 5;
|
|
2
|
+
export type ParamDisclosure = "knob" | "card" | "hidden";
|
|
3
|
+
export type ParamGroup = "sales" | "flow" | "funds" | "staff" | "supplier";
|
|
4
|
+
export interface ParamClass {
|
|
5
|
+
tier: ParamTier;
|
|
6
|
+
tier_name: string;
|
|
7
|
+
group: ParamGroup;
|
|
8
|
+
disclosure: ParamDisclosure;
|
|
9
|
+
}
|
|
10
|
+
export declare const TIER_NAMES: Record<ParamTier, string>;
|
|
11
|
+
export declare function classifyFeeParam(key: string, value: number | string, selector?: boolean): ParamClass;
|
|
12
|
+
export interface ParamRow extends ParamClass {
|
|
13
|
+
key: string;
|
|
14
|
+
value: number | string;
|
|
15
|
+
type: "number" | "string";
|
|
16
|
+
selector: boolean;
|
|
17
|
+
}
|
|
18
|
+
export interface ParamSource {
|
|
19
|
+
fee_params: Record<string, number | string>;
|
|
20
|
+
conditional_guards?: {
|
|
21
|
+
param: string;
|
|
22
|
+
values?: string[];
|
|
23
|
+
}[];
|
|
24
|
+
}
|
|
25
|
+
export declare function describeFeeParams(t: ParamSource): ParamRow[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const TIER_NAMES={0x1:'money\x20&\x20admission',0x2:'time\x20&\x20payout',0x3:'flow\x20switch',0x4:'role\x20&\x20permission',0x5:'disclosure\x20&\x20copy'};const BENCHMARK_KEYS=new Set(['incumbent_take_bps','merchant_service_fee_bps','platform_rate_cap_bps']),BUILD_PRESCRIPTION_KEYS=new Set(['creator_settlement_retain_bps']),DIRECTIVE_KEYS=new Set(['allocator_threshold','min_sku_price','min_balance','min_term_price_usd','min_term_price','min_monthly_rent_usd','min_booking_amount','min_course_price_usd','layer2_segment_amounts','restock_on_refund']),MONEY_RE=/(_bps$|_usd$|_amount$|_threshold$|^threshold$|^deposit|_cap$|_cap_usd$|_fee$|_fee_|_price$|_pool$|_per_claim$|_cost$|_rent$|_rate$|_share$|_release$)/,TIME_RE=/(_hours$|_days$|_ms$|_timeout$|_window$|_deadline$|^period_|_months$|_nights$|_rounds_max$|_count$|_sessions$|_allocators$|_day$)/;function moneyOrTime(a){if(TIME_RE['test'](a))return 0x2;if(MONEY_RE['test'](a))return 0x1;return 0x5;}export function classifyFeeParam(a,b,c=![]){const d=g=>TIER_NAMES[g];if(c)return{'tier':0x3,'tier_name':d(0x3),'group':'flow','disclosure':'knob'};if(DIRECTIVE_KEYS['has'](a)||typeof b==='string')return{'tier':0x5,'tier_name':d(0x5),'group':'flow','disclosure':'hidden'};const e=moneyOrTime(a);if(BENCHMARK_KEYS['has'](a))return{'tier':e,'tier_name':d(e),'group':'sales','disclosure':'card'};if(BUILD_PRESCRIPTION_KEYS['has'](a))return{'tier':e,'tier_name':d(e),'group':'funds','disclosure':'card'};const f=e===0x1?/_price$|_usd$|_fee|_bps$|_cost$/['test'](a)?'sales':'funds':e===0x2?'funds':'flow';return{'tier':e,'tier_name':d(e),'group':f,'disclosure':'knob'};}export function describeFeeParams(a){const b=new Set((a['conditional_guards']??[])['map'](d=>d['param']));return Object['entries'](a['fee_params'])['map'](([c,d])=>{const e=b['has'](c);return{...classifyFeeParam(c,d,e),'key':c,'value':d,'type':typeof d==='number'?'number':'string','selector':e};})['sort']((c,d)=>c['tier']-d['tier']||c['key']['localeCompare'](d['key']));}
|
|
@@ -34,7 +34,7 @@ export declare const PASSPORT_ERROR_CODES: {
|
|
|
34
34
|
};
|
|
35
35
|
export declare const PASSPORT_VERIFY_MODES: {
|
|
36
36
|
readonly verify: {
|
|
37
|
-
readonly sdk_entry: "verify (passport
|
|
37
|
+
readonly sdk_entry: "verify (passport verification entry)";
|
|
38
38
|
readonly on_false: "returns false — no abort; the evidence card is still minted and the result recorded";
|
|
39
39
|
readonly use_when: "the false branch is handled downstream (guard rails read the recorded result)";
|
|
40
40
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{MAX_GUARD_COUNT_PASSPORT,MAX_SUBMISSION_SIZE_PASSPORT}from'@wowok/wowok';export{MAX_GUARD_COUNT_PASSPORT};export{MAX_SUBMISSION_SIZE_PASSPORT};export const PASSPORT_ERROR_CODES={'E_GUARD_COUNT_EXCEEDED':0x1,'E_RELIES_GUARD_NOT_ADDED':0x2,'E_SUBMISSION_SIZE_EXCEEDED':0x3,'E_HAS_VERIFIED':0x4,'E_NOT_VERIFIED':0x5,'E_NOT_IMPACK_GUARD':0x6,'E_VERIFY_FAILED':0x7,'E_TX_NOT_MATCH':0x8,'E_IMPACK_GUARD_NOT_FOUND':0x9,'E_SUBMISSION_NOT_FOUND':0xa,'E_DIGEST_NOT_MATCH':0xb};export const PASSPORT_VERIFY_MODES={'verify':{'sdk_entry':'verify\x20(passport.ts)','on_false':'returns\x20false\x20—\x20no\x20abort;\x20the\x20evidence\x20card\x20is\x20still\x20minted\x20and\x20the\x20result\x20recorded','use_when':'the\x20false\x20branch\x20is\x20handled\x20downstream\x20(guard\x20rails\x20read\x20the\x20recorded\x20result)'},'verify_strict':{'sdk_entry':'verify_strict\x20(SDK\x20public\x20API)','on_false':'aborts\x20E_VERIFY_FAILED\x20=\x207\x20and\x20the\x20transaction\x20rolls\x20back','use_when':'the\x20transaction\x20must\x20NOT\x20succeed\x20on\x20a\x20failed\x20verification'}};export const PASSPORT_SCENARIOS=[{'id':'passport_service_buy','name':'Service\x20buy\x20with\x20Passport\x20(verify\x20buy_guard)','consumer_object':'Service','sdk_entry':'passport-verified\x20buy','passport_purpose':'Verify\x20customer\x27s\x20eligibility\x20to\x20buy\x20(buy_guard)','typical_impack':'impack','uses_relies':![],'lifecycle_stage':'use','participants':['customer','merchant'],'risk_notes':['tx_hash\x20binding\x20requires\x20Passport\x20creation\x20+\x20buy\x20in\x20the\x20same\x20transaction','Service.buy_guard\x20is\x20typically\x20configured\x20as\x20impack=true'],'dependencies':['Service','Guard']},{'id':'passport_arbitration_compensation','name':'Order\x20arbitration\x20compensation\x20(verify\x20arb\x20permission)','consumer_object':'Order','sdk_entry':'arb_claim_compensation_with_passport','passport_purpose':'Verify\x20customer\x27s\x20right\x20to\x20claim\x20arbitration\x20compensation','typical_impack':'impack','uses_relies':![],'lifecycle_stage':'use','participants':['customer','arbitrator'],'risk_notes':['Compensation\x20is\x20one-shot\x20—\x20Passport.tx_hash\x20prevents\x20replay','The\x20impack\x20Guard\x20is\x20hard-verified\x20(E_VERIFY_FAILED\x20if\x20mismatch)'],'dependencies':['Order','Arbitration','Guard']},{'id':'passport_progress_next','name':'Progress\x20advance\x20(verify\x20Forward.guard)','consumer_object':'Progress','sdk_entry':'passport-verified\x20node\x20advance','passport_purpose':'Verify\x20that\x20the\x20next\x20node\x27s\x20Forward.guard\x20passes\x20before\x20advancing','typical_impack':'impack','uses_relies':!![],'lifecycle_stage':'use','participants':['customer','merchant'],'risk_notes':['Forward.guard\x20may\x20have\x20relies\x20on\x20previous\x20node\x20Guards\x20(AND/OR\x20logic)','Relies\x20Guards\x20MUST\x20be\x20added\x20in\x20topological\x20order\x20(E_RELIES_GUARD_NOT_ADDED)'],'dependencies':['Progress','Machine','Guard']},{'id':'passport_arbitration_dispute','name':'Arbitration\x20dispute\x20(verify\x20usage_guard)','consumer_object':'Arbitration','sdk_entry':'passport-verified\x20dispute','passport_purpose':'Verify\x20usage_guard\x20before\x20opening\x20a\x20dispute\x20case','typical_impack':'impack','uses_relies':![],'lifecycle_stage':'use','participants':['customer','arbitrator'],'risk_notes':['Arbitration.usage_guard\x20determines\x20who\x20may\x20open\x20disputes','Dispute\x20must\x20be\x20filed\x20within\x20the\x20same\x20transaction\x20that\x20created\x20the\x20Passport'],'dependencies':['Arbitration','Guard']},{'id':'passport_arbitration_vote','name':'Arbitration\x20vote\x20(resolve\x20VoteValue::GuardIdentifier\x20weight)','consumer_object':'Arbitration','sdk_entry':'passport-verified\x20vote','passport_purpose':'Resolve\x20voting\x20weight\x20from\x20Passport\x20submission\x20(GuardIdentifier)','typical_impack':'impack','uses_relies':![],'lifecycle_stage':'use','participants':['arbitrator'],'risk_notes':['Voting\x20weight\x20is\x20read\x20from\x20the\x20Passport\x20submission\x20for\x20the\x20(guard,\x20identifier)\x20pair','Identifier\x20type\x20must\x20match\x20the\x20voting_guard\x27s\x20expected\x20type'],'dependencies':['Arbitration','Guard']},{'id':'passport_reward_claim','name':'Reward\x20claim\x20(verify\x20Guard\x20+\x20resolve\x20recipient/amount)','consumer_object':'Reward','sdk_entry':'claim_with_passport','passport_purpose':'Verify\x20claim\x20eligibility\x20and\x20resolve\x20dynamic\x20recipient/amount\x20from\x20submission','typical_impack':'impack','uses_relies':![],'lifecycle_stage':'use','participants':['customer'],'risk_notes':['Guard\x20may\x20use\x20GuardIdentifier\x20to\x20dynamically\x20resolve\x20recipient\x20address','Claim\x20is\x20one-shot\x20per\x20Passport\x20(tx_hash\x20binding\x20prevents\x20replay)'],'dependencies':['Reward','Guard']},{'id':'passport_permission_assert','name':'Permission\x20assert\x20(Guard\x20verification\x20replaces\x20owner\x20check)','consumer_object':'Permission','sdk_entry':'passport-verified\x20assert','passport_purpose':'Use\x20Guard\x20verification\x20as\x20a\x20dynamic\x20substitute\x20for\x20static\x20owner/admin\x20check','typical_impack':'impack','uses_relies':!![],'lifecycle_stage':'use','participants':['customer','platform'],'risk_notes':['Allows\x20composing\x20multi-factor\x20authorization\x20via\x20relies\x20logic','Permission\x20assert\x20bypass\x20requires\x20the\x20Passport\x20to\x20be\x20verified\x20in\x20the\x20same\x20tx'],'dependencies':['Permission','Guard']},{'id':'passport_allocation_alloc','name':'Allocation\x20distribute\x20(verify\x20alloc\x20permission\x20via\x20Guard)','consumer_object':'Allocation','sdk_entry':'alloc_with_passport','passport_purpose':'Verify\x20the\x20caller\x27s\x20right\x20to\x20trigger\x20allocation\x20distribution','typical_impack':'impack','uses_relies':![],'lifecycle_stage':'use','participants':['customer','merchant'],'risk_notes':['Caller-specified\x20guard:\x20Passport\x20must\x20contain\x20the\x20specific\x20Guard\x20referenced\x20by\x20alloc_by_guard','Hard\x20verification\x20applies\x20(E_VERIFY_FAILED\x20if\x20the\x20impack\x20Guard\x20fails)'],'dependencies':['Allocation','Guard']},{'id':'passport_treasury_withdraw','name':'Treasury\x20withdraw\x20(verify\x20withdraw\x20permission)','consumer_object':'Treasury','sdk_entry':'passport-verified\x20withdraw','passport_purpose':'Verify\x20the\x20caller\x27s\x20right\x20to\x20withdraw\x20funds\x20from\x20Treasury','typical_impack':'impack','uses_relies':![],'lifecycle_stage':'use','participants':['customer','platform'],'risk_notes':['Treasury\x20withdraw\x20is\x20high-value\x20—\x20strongly\x20recommend\x20multi-Guard\x20relies\x20(AND)','Guard\x20should\x20bind\x20Signer\x20to\x20prevent\x20unauthorized\x20withdraw'],'dependencies':['Treasury','Guard']},{'id':'passport_repository_query','name':'Repository\x20query\x20(verify\x20read\x20permission\x20+\x20extract\x20data)','consumer_object':'Repository','sdk_entry':'query_with_passport','passport_purpose':'Verify\x20read\x20permission\x20and\x20extract\x20submission\x20data\x20for\x20repository\x20write','typical_impack':'impack','uses_relies':![],'lifecycle_stage':'use','participants':['customer','merchant'],'risk_notes':['Repository\x20policies\x20may\x20extract\x20data\x20from\x20Passport\x20submission\x20(quote_guard\x20pattern)','Submitted\x20data\x20must\x20be\x20≤\x20256\x20bytes\x20per\x20submission\x20entry'],'dependencies':['Repository','Guard']},{'id':'passport_demand_submit','name':'Demand\x20submit\x20(verify\x20demand\x20permission)','consumer_object':'Demand','sdk_entry':'demand_with_passport','passport_purpose':'Verify\x20the\x20caller\x27s\x20right\x20to\x20submit\x20or\x20match\x20a\x20Demand','typical_impack':'impack','uses_relies':![],'lifecycle_stage':'use','participants':['customer','merchant'],'risk_notes':['Demand.guard\x20may\x20filter\x20which\x20submissions\x20are\x20eligible\x20for\x20matching','Demand\x20uses\x20MAX_GUARD_COUNT_DEMAND=20\x20(separate\x20constant,\x20do\x20not\x20confuse)'],'dependencies':['Demand','Guard']}];export const PASSPORT_LEDGER_VERSION='1.0.0';export function getAllScenarios(){return[...PASSPORT_SCENARIOS];}export function getScenariosCount(){return PASSPORT_SCENARIOS['length'];}export function findScenarioById(a){return PASSPORT_SCENARIOS['find'](b=>b['id']===a);}export function getScenariosByConsumer(a){return PASSPORT_SCENARIOS['filter'](b=>b['consumer_object']===a);}export function getScenariosUsingRelies(){return PASSPORT_SCENARIOS['filter'](a=>a['uses_relies']);}export function inferScenarioFromIntent(a){const b=a['toLowerCase']();if(b['includes']('buy')||b['includes']('purchase')||b['includes']('service'))return findScenarioById('passport_service_buy');if(b['includes']('compensation')||b['includes']('compensate')||b['includes']('arb_claim'))return findScenarioById('passport_arbitration_compensation');if(b['includes']('progress')||b['includes']('advance')||b['includes']('next'))return findScenarioById('passport_progress_next');if(b['includes']('dispute')||b['includes']('grievance'))return findScenarioById('passport_arbitration_dispute');if(b['includes']('vote')||b['includes']('ballot')||b['includes']('voting'))return findScenarioById('passport_arbitration_vote');if(b['includes']('reward')||b['includes']('claim')||b['includes']('redeem')||b['includes']('bonus'))return findScenarioById('passport_reward_claim');if(b['includes']('permission')||b['includes']('assert')||b['includes']('authorize'))return findScenarioById('passport_permission_assert');if(b['includes']('alloc')||b['includes']('distribute')||b['includes']('distribution'))return findScenarioById('passport_allocation_alloc');if(b['includes']('withdraw')||b['includes']('extract')||b['includes']('treasury'))return findScenarioById('passport_treasury_withdraw');if(b['includes']('repository')||b['includes']('query')||b['includes']('lookup'))return findScenarioById('passport_repository_query');if(b['includes']('demand')||b['includes']('requirement'))return findScenarioById('passport_demand_submit');return undefined;}export function impackRoleFromBoolean(a){return a?'impack':'non_impack';}export function impackRoleToBoolean(a){return a==='impack';}export function reliesLogicFromBoolean(a){return a?'AND':'OR';}export function reliesLogicToBoolean(a){return a==='AND';}export function getErrorName(a){for(const [b,d]of Object['entries'](PASSPORT_ERROR_CODES)){if(d===a)return b;}return undefined;}export function getErrorDescription(a){const b={0x1:'Guard\x20count\x20exceeds\x20MAX_GUARD_COUNT_PASSPORT\x20(20)',0x2:'Relied\x20Guard\x20not\x20yet\x20added\x20to\x20Passport\x20(topological\x20order\x20required)',0x3:'Submission\x20serialized\x20size\x20exceeds\x20MAX_SUBMISSION_SIZE_PASSPORT\x20(256\x20bytes)',0x4:'Passport\x20already\x20verified\x20—\x20verify\x20is\x20one-time,\x20configuration\x20is\x20now\x20immutable',0x5:'result()\x20called\x20before\x20verify()\x20—\x20Passport\x20has\x20not\x20been\x20verified\x20yet',0x6:'Hard\x20verification\x20called\x20on\x20a\x20non-impack\x20Guard\x20—\x20only\x20impack\x20Guards\x20can\x20be\x20hard-verified',0x7:'Guard\x20/\x20Permission\x20hard-verification\x20called\x20when\x20the\x20overall\x20result=false',0x8:'result()\x20called\x20from\x20a\x20different\x20transaction\x20—\x20tx_hash\x20does\x20not\x20match\x20current\x20tx',0x9:'verify()\x20found\x20no\x20impack\x20Guard\x20—\x20at\x20least\x201\x20impack=true\x20Guard\x20is\x20required',0xa:'No\x20submission\x20entry\x20found\x20for\x20the\x20(guard,\x20identifier)\x20pair',0xb:'Guard\x20add\x20/\x20verify\x20/\x20Guard\x20clear\x20called\x20from\x20a\x20different\x20transaction\x20—\x20tx_hash\x20mismatch'};return b[a];}
|
|
1
|
+
import{MAX_GUARD_COUNT_PASSPORT,MAX_SUBMISSION_SIZE_PASSPORT}from'@wowok/wowok';export{MAX_GUARD_COUNT_PASSPORT};export{MAX_SUBMISSION_SIZE_PASSPORT};export const PASSPORT_ERROR_CODES={'E_GUARD_COUNT_EXCEEDED':0x1,'E_RELIES_GUARD_NOT_ADDED':0x2,'E_SUBMISSION_SIZE_EXCEEDED':0x3,'E_HAS_VERIFIED':0x4,'E_NOT_VERIFIED':0x5,'E_NOT_IMPACK_GUARD':0x6,'E_VERIFY_FAILED':0x7,'E_TX_NOT_MATCH':0x8,'E_IMPACK_GUARD_NOT_FOUND':0x9,'E_SUBMISSION_NOT_FOUND':0xa,'E_DIGEST_NOT_MATCH':0xb};export const PASSPORT_VERIFY_MODES={'verify':{'sdk_entry':'verify\x20(passport\x20verification\x20entry)','on_false':'returns\x20false\x20—\x20no\x20abort;\x20the\x20evidence\x20card\x20is\x20still\x20minted\x20and\x20the\x20result\x20recorded','use_when':'the\x20false\x20branch\x20is\x20handled\x20downstream\x20(guard\x20rails\x20read\x20the\x20recorded\x20result)'},'verify_strict':{'sdk_entry':'verify_strict\x20(SDK\x20public\x20API)','on_false':'aborts\x20E_VERIFY_FAILED\x20=\x207\x20and\x20the\x20transaction\x20rolls\x20back','use_when':'the\x20transaction\x20must\x20NOT\x20succeed\x20on\x20a\x20failed\x20verification'}};export const PASSPORT_SCENARIOS=[{'id':'passport_service_buy','name':'Service\x20buy\x20with\x20Passport\x20(verify\x20buy_guard)','consumer_object':'Service','sdk_entry':'passport-verified\x20buy','passport_purpose':'Verify\x20customer\x27s\x20eligibility\x20to\x20buy\x20(buy_guard)','typical_impack':'impack','uses_relies':![],'lifecycle_stage':'use','participants':['customer','merchant'],'risk_notes':['tx_hash\x20binding\x20requires\x20Passport\x20creation\x20+\x20buy\x20in\x20the\x20same\x20transaction','Service.buy_guard\x20is\x20typically\x20configured\x20as\x20impack=true'],'dependencies':['Service','Guard']},{'id':'passport_arbitration_compensation','name':'Order\x20arbitration\x20compensation\x20(verify\x20arb\x20permission)','consumer_object':'Order','sdk_entry':'arb_claim_compensation_with_passport','passport_purpose':'Verify\x20customer\x27s\x20right\x20to\x20claim\x20arbitration\x20compensation','typical_impack':'impack','uses_relies':![],'lifecycle_stage':'use','participants':['customer','arbitrator'],'risk_notes':['Compensation\x20is\x20one-shot\x20—\x20Passport.tx_hash\x20prevents\x20replay','The\x20impack\x20Guard\x20is\x20hard-verified\x20(E_VERIFY_FAILED\x20if\x20mismatch)'],'dependencies':['Order','Arbitration','Guard']},{'id':'passport_progress_next','name':'Progress\x20advance\x20(verify\x20Forward.guard)','consumer_object':'Progress','sdk_entry':'passport-verified\x20node\x20advance','passport_purpose':'Verify\x20that\x20the\x20next\x20node\x27s\x20Forward.guard\x20passes\x20before\x20advancing','typical_impack':'impack','uses_relies':!![],'lifecycle_stage':'use','participants':['customer','merchant'],'risk_notes':['Forward.guard\x20may\x20have\x20relies\x20on\x20previous\x20node\x20Guards\x20(AND/OR\x20logic)','Relies\x20Guards\x20MUST\x20be\x20added\x20in\x20topological\x20order\x20(E_RELIES_GUARD_NOT_ADDED)'],'dependencies':['Progress','Machine','Guard']},{'id':'passport_arbitration_dispute','name':'Arbitration\x20dispute\x20(verify\x20usage_guard)','consumer_object':'Arbitration','sdk_entry':'passport-verified\x20dispute','passport_purpose':'Verify\x20usage_guard\x20before\x20opening\x20a\x20dispute\x20case','typical_impack':'impack','uses_relies':![],'lifecycle_stage':'use','participants':['customer','arbitrator'],'risk_notes':['Arbitration.usage_guard\x20determines\x20who\x20may\x20open\x20disputes','Dispute\x20must\x20be\x20filed\x20within\x20the\x20same\x20transaction\x20that\x20created\x20the\x20Passport'],'dependencies':['Arbitration','Guard']},{'id':'passport_arbitration_vote','name':'Arbitration\x20vote\x20(resolve\x20VoteValue::GuardIdentifier\x20weight)','consumer_object':'Arbitration','sdk_entry':'passport-verified\x20vote','passport_purpose':'Resolve\x20voting\x20weight\x20from\x20Passport\x20submission\x20(GuardIdentifier)','typical_impack':'impack','uses_relies':![],'lifecycle_stage':'use','participants':['arbitrator'],'risk_notes':['Voting\x20weight\x20is\x20read\x20from\x20the\x20Passport\x20submission\x20for\x20the\x20(guard,\x20identifier)\x20pair','Identifier\x20type\x20must\x20match\x20the\x20voting_guard\x27s\x20expected\x20type'],'dependencies':['Arbitration','Guard']},{'id':'passport_reward_claim','name':'Reward\x20claim\x20(verify\x20Guard\x20+\x20resolve\x20recipient/amount)','consumer_object':'Reward','sdk_entry':'claim_with_passport','passport_purpose':'Verify\x20claim\x20eligibility\x20and\x20resolve\x20dynamic\x20recipient/amount\x20from\x20submission','typical_impack':'impack','uses_relies':![],'lifecycle_stage':'use','participants':['customer'],'risk_notes':['Guard\x20may\x20use\x20GuardIdentifier\x20to\x20dynamically\x20resolve\x20recipient\x20address','Claim\x20is\x20one-shot\x20per\x20Passport\x20(tx_hash\x20binding\x20prevents\x20replay)'],'dependencies':['Reward','Guard']},{'id':'passport_permission_assert','name':'Permission\x20assert\x20(Guard\x20verification\x20replaces\x20owner\x20check)','consumer_object':'Permission','sdk_entry':'passport-verified\x20assert','passport_purpose':'Use\x20Guard\x20verification\x20as\x20a\x20dynamic\x20substitute\x20for\x20static\x20owner/admin\x20check','typical_impack':'impack','uses_relies':!![],'lifecycle_stage':'use','participants':['customer','platform'],'risk_notes':['Allows\x20composing\x20multi-factor\x20authorization\x20via\x20relies\x20logic','Permission\x20assert\x20bypass\x20requires\x20the\x20Passport\x20to\x20be\x20verified\x20in\x20the\x20same\x20tx'],'dependencies':['Permission','Guard']},{'id':'passport_allocation_alloc','name':'Allocation\x20distribute\x20(verify\x20alloc\x20permission\x20via\x20Guard)','consumer_object':'Allocation','sdk_entry':'alloc_with_passport','passport_purpose':'Verify\x20the\x20caller\x27s\x20right\x20to\x20trigger\x20allocation\x20distribution','typical_impack':'impack','uses_relies':![],'lifecycle_stage':'use','participants':['customer','merchant'],'risk_notes':['Caller-specified\x20guard:\x20Passport\x20must\x20contain\x20the\x20specific\x20Guard\x20referenced\x20by\x20alloc_by_guard','Hard\x20verification\x20applies\x20(E_VERIFY_FAILED\x20if\x20the\x20impack\x20Guard\x20fails)'],'dependencies':['Allocation','Guard']},{'id':'passport_treasury_withdraw','name':'Treasury\x20withdraw\x20(verify\x20withdraw\x20permission)','consumer_object':'Treasury','sdk_entry':'passport-verified\x20withdraw','passport_purpose':'Verify\x20the\x20caller\x27s\x20right\x20to\x20withdraw\x20funds\x20from\x20Treasury','typical_impack':'impack','uses_relies':![],'lifecycle_stage':'use','participants':['customer','platform'],'risk_notes':['Treasury\x20withdraw\x20is\x20high-value\x20—\x20strongly\x20recommend\x20multi-Guard\x20relies\x20(AND)','Guard\x20should\x20bind\x20Signer\x20to\x20prevent\x20unauthorized\x20withdraw'],'dependencies':['Treasury','Guard']},{'id':'passport_repository_query','name':'Repository\x20query\x20(verify\x20read\x20permission\x20+\x20extract\x20data)','consumer_object':'Repository','sdk_entry':'query_with_passport','passport_purpose':'Verify\x20read\x20permission\x20and\x20extract\x20submission\x20data\x20for\x20repository\x20write','typical_impack':'impack','uses_relies':![],'lifecycle_stage':'use','participants':['customer','merchant'],'risk_notes':['Repository\x20policies\x20may\x20extract\x20data\x20from\x20Passport\x20submission\x20(quote_guard\x20pattern)','Submitted\x20data\x20must\x20be\x20≤\x204096\x20bytes\x20per\x20submission\x20entry\x20(fits\x20a\x20100-address\x20roster\x20witness)'],'dependencies':['Repository','Guard']},{'id':'passport_demand_submit','name':'Demand\x20submit\x20(verify\x20demand\x20permission)','consumer_object':'Demand','sdk_entry':'demand_with_passport','passport_purpose':'Verify\x20the\x20caller\x27s\x20right\x20to\x20submit\x20or\x20match\x20a\x20Demand','typical_impack':'impack','uses_relies':![],'lifecycle_stage':'use','participants':['customer','merchant'],'risk_notes':['Demand.guard\x20may\x20filter\x20which\x20submissions\x20are\x20eligible\x20for\x20matching','Demand\x20uses\x20MAX_GUARD_COUNT_DEMAND=20\x20(separate\x20constant,\x20do\x20not\x20confuse)'],'dependencies':['Demand','Guard']}];export const PASSPORT_LEDGER_VERSION='1.0.0';export function getAllScenarios(){return[...PASSPORT_SCENARIOS];}export function getScenariosCount(){return PASSPORT_SCENARIOS['length'];}export function findScenarioById(a){return PASSPORT_SCENARIOS['find'](b=>b['id']===a);}export function getScenariosByConsumer(a){return PASSPORT_SCENARIOS['filter'](b=>b['consumer_object']===a);}export function getScenariosUsingRelies(){return PASSPORT_SCENARIOS['filter'](a=>a['uses_relies']);}export function inferScenarioFromIntent(a){const b=a['toLowerCase']();if(b['includes']('buy')||b['includes']('purchase')||b['includes']('service'))return findScenarioById('passport_service_buy');if(b['includes']('compensation')||b['includes']('compensate')||b['includes']('arb_claim'))return findScenarioById('passport_arbitration_compensation');if(b['includes']('progress')||b['includes']('advance')||b['includes']('next'))return findScenarioById('passport_progress_next');if(b['includes']('dispute')||b['includes']('grievance'))return findScenarioById('passport_arbitration_dispute');if(b['includes']('vote')||b['includes']('ballot')||b['includes']('voting'))return findScenarioById('passport_arbitration_vote');if(b['includes']('reward')||b['includes']('claim')||b['includes']('redeem')||b['includes']('bonus'))return findScenarioById('passport_reward_claim');if(b['includes']('permission')||b['includes']('assert')||b['includes']('authorize'))return findScenarioById('passport_permission_assert');if(b['includes']('alloc')||b['includes']('distribute')||b['includes']('distribution'))return findScenarioById('passport_allocation_alloc');if(b['includes']('withdraw')||b['includes']('extract')||b['includes']('treasury'))return findScenarioById('passport_treasury_withdraw');if(b['includes']('repository')||b['includes']('query')||b['includes']('lookup'))return findScenarioById('passport_repository_query');if(b['includes']('demand')||b['includes']('requirement'))return findScenarioById('passport_demand_submit');return undefined;}export function impackRoleFromBoolean(a){return a?'impack':'non_impack';}export function impackRoleToBoolean(a){return a==='impack';}export function reliesLogicFromBoolean(a){return a?'AND':'OR';}export function reliesLogicToBoolean(a){return a==='AND';}export function getErrorName(a){for(const [b,d]of Object['entries'](PASSPORT_ERROR_CODES)){if(d===a)return b;}return undefined;}export function getErrorDescription(a){const b={0x1:'Guard\x20count\x20exceeds\x20MAX_GUARD_COUNT_PASSPORT\x20(20)',0x2:'Relied\x20Guard\x20not\x20yet\x20added\x20to\x20Passport\x20(topological\x20order\x20required)',0x3:'Submission\x20serialized\x20size\x20exceeds\x20MAX_SUBMISSION_SIZE_PASSPORT\x20(4096\x20bytes)',0x4:'Passport\x20already\x20verified\x20—\x20verify\x20is\x20one-time,\x20configuration\x20is\x20now\x20immutable',0x5:'result()\x20called\x20before\x20verify()\x20—\x20Passport\x20has\x20not\x20been\x20verified\x20yet',0x6:'Hard\x20verification\x20called\x20on\x20a\x20non-impack\x20Guard\x20—\x20only\x20impack\x20Guards\x20can\x20be\x20hard-verified',0x7:'Guard\x20/\x20Permission\x20hard-verification\x20called\x20when\x20the\x20overall\x20result=false',0x8:'result()\x20called\x20from\x20a\x20different\x20transaction\x20—\x20tx_hash\x20does\x20not\x20match\x20current\x20tx',0x9:'verify()\x20found\x20no\x20impack\x20Guard\x20—\x20at\x20least\x201\x20impack=true\x20Guard\x20is\x20required',0xa:'No\x20submission\x20entry\x20found\x20for\x20the\x20(guard,\x20identifier)\x20pair',0xb:'Guard\x20add\x20/\x20verify\x20/\x20Guard\x20clear\x20called\x20from\x20a\x20different\x20transaction\x20—\x20tx_hash\x20mismatch'};return b[a];}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { Severity } from "../../config/severity.js";
|
|
2
|
+
import { type IndustryTemplate } from "../template-loader.js";
|
|
3
|
+
import type { OracleCoverage, OracleInvariant, OracleStep } from "./schema.js";
|
|
4
|
+
export declare function computeOracleCoverage(t: IndustryTemplate, oracleSteps: OracleStep[], oracleInvariants: OracleInvariant[], oracleVersion: string): OracleCoverage;
|
|
5
|
+
export declare function oracleDisclosureBlockersFor(templateId: string): string[];
|
|
6
|
+
export interface OracleFinding {
|
|
7
|
+
rule_id: string;
|
|
8
|
+
severity: Severity;
|
|
9
|
+
title: string;
|
|
10
|
+
detail: string;
|
|
11
|
+
suggestion: string;
|
|
12
|
+
}
|
|
13
|
+
export declare function oracleCoverageFindings(t: IndustryTemplate): {
|
|
14
|
+
findings: OracleFinding[];
|
|
15
|
+
coverage?: OracleCoverage;
|
|
16
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{getJudgmentDoc}from'../../config/judgment.js';import{evaluateRuleBook}from'../../config/rule-engine.js';import{getTemplate}from'../template-loader.js';import{oracleFor}from'./index.js';function disclosureCorpus(a){return JSON['stringify']([a['build_notes'],a['trust_mechanisms'],a['keeper_dependencies'],a['keeper_duty']??[],a['user_inputs'],a['user_input_specs']?.['map'](b=>b['question']+'\x20'+b['param_key']+'\x20'+(b['note']??''))??[],a['differences'],a['key_risk']]);}function probeHits(a,b){try{return new RegExp(a,'i')['test'](b);}catch{return![];}}function readShape(a){return a['machine_shape']['map'](b=>({'name':b['name'],'from':(b['from']??[])['map'](c=>{if(typeof c==='string')return{'prev':'','forward':c,'guardKey':''};const d=c;return{'prev':typeof d['prev']==='string'?d['prev']:'','forward':typeof d['forward']==='string'?d['forward']:'','guardKey':typeof d['guard_key']==='string'?d['guard_key']:''};})}));}function matchFootprint(a,b){const c=b['chainFootprint'];if(!c||c['node']===undefined&&c['forward']===undefined)return{'matched':![],'guardKeys':''};if(c['node']!==undefined&&c['forward']!==undefined){const e=a['find'](g=>g['name']===c['node']),f=(e?.['from']??[])['filter'](g=>g['forward']===c['forward']&&(c['prev']===undefined||g['prev']===c['prev']));return{'matched':f['length']>0x0,'guardKeys':f['map'](g=>g['guardKey'])['join']('\x20')};}if(c['node']!==undefined){const g=a['find'](i=>i['name']===c['node']),h=g?.['from']??[];return{'matched':g!==undefined,'guardKeys':h['map'](i=>i['guardKey'])['join']('\x20')};}const d=a['flatMap'](i=>i['from'])['filter'](i=>i['forward']===c['forward']);return{'matched':d['length']>0x0,'guardKeys':d['map'](i=>i['guardKey'])['join']('\x20')};}function templateHasForward(a,b){return a['some'](c=>c['from']['some'](d=>d['forward']===b));}function invariantViolated(a,b,c){const d=c['violation'];if(!d)return![];if(d['requiresFeeParamNonZero']!==undefined){const e=a['fee_params'][d['requiresFeeParamNonZero']];if(typeof e!=='number'||!(e>0x0))return![];}if(d['whileMissingForward']!==undefined&&templateHasForward(b,d['whileMissingForward']))return![];return!![];}export function computeOracleCoverage(a,b,c,d){const e=readShape(a),f=disclosureCorpus(a),g=[],h=[];let i=0x0,j=0x0,k=0x0,l=0x0,n=0x0,o=0x0,p=0x0,q=0x0;const r=(w,x,y)=>{const z={'step_id':w['id'],'status':x,'reason':y};g['push'](z);const A=w['class']!=='offchain'&&w['onchain']!=='not_applicable';A&&(i+=0x1,x==='covered'||x==='partial'||x==='disclosed'?j+=0x1:h['push'](z));if(w['guardKeyProbe']!==undefined&&(x==='covered'||x==='partial')){if(w['guardProbeKind']==='feature'){n+=0x1;if(x==='covered')o+=0x1;}else{k+=0x1;if(x==='covered')l+=0x1;}}if(w['disclosureProbe']!==undefined||w['onchain']==='disclosure_only'||w['onchain']==='unresolvable'){p+=0x1;if(x==='disclosed')q+=0x1;}};for(const w of b){if(w['class']==='offchain'){r(w,'excluded','offchain\x20step\x20—\x20outside\x20every\x20chain-coverage\x20number');continue;}if(w['onchain']==='not_applicable'){if(w['disclosureProbe']!==undefined){const y=probeHits(w['disclosureProbe'],f);r(w,y?'disclosed':'disclosure_missing',y?'semantics-inverted\x20step\x20—\x20the\x20difference\x20is\x20disclosed':'semantics-inverted\x20step\x20—\x20the\x20on-chain\x20difference\x20is\x20NOT\x20disclosed');}else w['chainFootprint']?.['forward']!==undefined&&templateHasForward(e,w['chainFootprint']['forward'])?r(w,'na_redundant','marked\x20not_applicable\x20yet\x20the\x20template\x20ships\x20the\x20footprint\x20anyway'):r(w,'excluded','not\x20applicable\x20—\x20chain\x20semantics\x20eliminate\x20the\x20step');continue;}if(w['onchain']==='disclosure_only'||w['onchain']==='unresolvable'){const z=w['disclosureProbe'],A=z!==undefined?probeHits(z,f):![];r(w,A?'disclosed':'disclosure_missing',A?'not\x20chain-enforceable\x20—\x20disclosed\x20in\x20the\x20template\x20text':z===undefined?'not\x20chain-enforceable\x20—\x20the\x20oracle\x20declares\x20no\x20disclosure\x20probe':'not\x20chain-enforceable\x20and\x20NOT\x20disclosed\x20(probe\x20miss)');continue;}const x=matchFootprint(e,w);if(!x['matched']){r(w,'missing','no\x20chain\x20footprint\x20in\x20the\x20machine\x20shape');continue;}if(w['gapPredicate']?.['probe']!==undefined&&!probeHits(w['gapPredicate']['probe'],f)){r(w,'gap_undisclosed','the\x20path\x20exists\x20but\x20its\x20known\x20semantic\x20gap\x20is\x20NOT\x20disclosed');continue;}if(w['guardKeyProbe']!==undefined&&!probeHits(w['guardKeyProbe'],x['guardKeys'])){r(w,'partial','path\x20exists\x20but\x20the\x20guard\x20surface\x20misses\x20(guard-key\x20probe\x20miss)');continue;}r(w,'covered','chain\x20footprint\x20matches\x20the\x20machine\x20shape');}const u=c['filter'](B=>invariantViolated(a,e,B))['map'](B=>B['id']),v=(B,C)=>C===0x0?0x1:B/C;return{'product_ref':a['product_ref']??'','oracle_version':d,'chain_relevant':i,'path_coverage':v(j,i),'guard_coverage':v(l,k),'feature_guard_coverage':v(o,n),'disclosure_coverage':v(q,p),'invariant_hits':u,'steps':g,'uncovered':h};}export function oracleDisclosureBlockersFor(a){let b;try{b=getTemplate(a);}catch{return[];}if(!b?.['product_ref'])return[];const c=oracleFor(b['product_ref']);if(!c)return[];const d=computeOracleCoverage(b,c['steps'],c['invariants'],c['oracleVersion']);return d['steps']['filter'](e=>e['status']==='disclosure_missing')['map'](e=>e['step_id']);}function oracleRuleBook(){const a=getJudgmentDoc()['rules']['domains']['oracle'];if(!a)throw new Error('factory\x20rule\x20pack\x20\x27oracle\x27\x20missing\x20—\x20broken\x20installation');return a['rules'];}function oracleFacts(a){return{'product_ref':a['product_ref'],'oracle_version':a['oracle_version'],'path_coverage':a['path_coverage'],'guard_coverage':a['guard_coverage'],'feature_guard_coverage':a['feature_guard_coverage'],'disclosure_coverage':a['disclosure_coverage'],'invariant_hit_count':a['invariant_hits']['length'],'invariant_hits':a['invariant_hits']['join'](',\x20'),'na_redundant_count':a['steps']['filter'](b=>b['status']==='na_redundant')['length'],'uncovered_count':a['uncovered']['length'],'uncovered_step_ids':a['uncovered']['map'](b=>b['step_id'])['join'](',\x20')};}export function oracleCoverageFindings(a){if(!a['product_ref'])return{'findings':[]};const b=oracleFor(a['product_ref']);if(!b)return{'findings':[]};const c=computeOracleCoverage(a,b['steps'],b['invariants'],b['oracleVersion']),{findings:d}=evaluateRuleBook(oracleRuleBook(),oracleFacts(c));return{'findings':d['map'](e=>({'rule_id':e['rule_id'],'severity':e['level'],'title':e['title'],'detail':e['description'],'suggestion':e['mitigation']??''})),'coverage':c};}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { type ProductOracle } from "./schema.js";
|
|
2
|
+
export * from "./schema.js";
|
|
3
|
+
export { computeOracleCoverage, oracleCoverageFindings, oracleDisclosureBlockersFor, type OracleFinding, } from "./coverage.js";
|
|
4
|
+
export declare function oracleFor(productRef: string): ProductOracle | undefined;
|
|
5
|
+
export declare function allProductOracles(): ProductOracle[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{ProductOracleSchema}from'./schema.js';import{FOOD_DELIVERY_ORACLE}from'./products/food-delivery.js';export*from'./schema.js';export{computeOracleCoverage,oracleCoverageFindings,oracleDisclosureBlockersFor}from'./coverage.js';const REGISTRY=Object['freeze'](Object['fromEntries']([FOOD_DELIVERY_ORACLE]['map'](a=>{const b=ProductOracleSchema['parse'](a);return[b['productRef'],b];})));export function oracleFor(a){return REGISTRY[a];}export function allProductOracles(){return Object['values'](REGISTRY);}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const FOOD_DELIVERY_ORACLE={'productRef':'meituan-waimai','products':['meituan-waimai','uber-eats','doordash'],'oracleVersion':'1.1.0','steps':[{'id':'M1','class':'offchain','name':'Browse\x20and\x20search\x20restaurants','actor':'buyer','precondition':[],'onchain':'not_applicable','commercialSemantics':'Storefront\x20discovery\x20is\x20a\x20pure\x20off-chain\x20concern;\x20the\x20chain\x20holds\x20no\x20catalog.','evidence':[]},{'id':'M2','class':'offchain','name':'Cart\x20assembly','actor':'buyer','precondition':['M1'],'onchain':'not_applicable','commercialSemantics':'Item\x20selection\x20and\x20quantity\x20edits\x20happen\x20in\x20the\x20client;\x20the\x20chain\x20sees\x20only\x20the\x20final\x20total.','evidence':[]},{'id':'M3','class':'offchain','name':'Promotion\x20/\x20coupon\x20application','actor':'platform','precondition':['M2'],'onchain':'not_applicable','commercialSemantics':'Discounts\x20are\x20priced\x20into\x20the\x20payable\x20total\x20before\x20escrow;\x20see\x20E28\x20for\x20the\x20mispricing\x20remedy.','evidence':[]},{'id':'M4','class':'offchain','name':'Delivery\x20address\x20entry','actor':'buyer','precondition':['M2'],'onchain':'not_applicable','commercialSemantics':'Address\x20privacy\x20is\x20an\x20off-chain\x20concern\x20on\x20this\x20template\x20(Service.customer_required\x20is\x20declarative-only;\x20no\x20required_info\x20surface\x20ships).','evidence':[]},{'id':'M5','class':'offchain','name':'Delivery\x20option\x20selection','actor':'buyer','precondition':['M4'],'onchain':'not_applicable','commercialSemantics':'Delivery\x20mode\x20(courier\x20vs\x20pickup)\x20is\x20chosen\x20off-chain;\x20this\x20template\x27s\x20shape\x20is\x20courier.','evidence':[]},{'id':'M6','class':'main','name':'Pay\x20and\x20escrow\x20(meal\x20+\x20packaging\x20+\x20delivery\x20fee\x20in\x20one\x20total)','actor':'buyer','precondition':['M5'],'onchain':'expressible','chainFootprint':{'node':'paid','forward':'Enter','prev':'','moneyEffect':'escrow_in'},'commercialSemantics':'One\x20atomic\x20buy:\x20quote\x20+\x20payment\x20+\x20escrow\x20in\x20a\x20single\x20transaction;\x20the\x20delivery\x20fee\x20rides\x20the\x20order\x20total.','evidence':[]},{'id':'M7','class':'main','name':'Restaurant\x20accepts\x20the\x20order\x20(prep\x20slot)','actor':'merchant','precondition':['M6'],'onchain':'expressible','chainFootprint':{'node':'accepted','forward':'AcceptOrder','prev':'paid','identity':'permission_index','moneyEffect':'none'},'commercialSemantics':'Merchant\x20acceptance\x20commits\x20the\x20order;\x20after\x20it\x20a\x20buyer\x20cancel\x20is\x20a\x20fee-bearing\x20kill\x20(E5)\x20and\x20a\x20merchant\x20reject\x20is\x20a\x20full\x20refund\x20(E2).','evidence':[{'file':'machine.move','line':0x5f,'pattern':'namedOperator,\x20permissionIndex,\x20and\x20guard\x20participate'}]},{'id':'M8','class':'main','name':'Meal\x20packed\x20and\x20sealed\x20(handover\x20evidence\x20row)','actor':'merchant','precondition':['M7'],'onchain':'expressible','chainFootprint':{'node':'ready','forward':'MarkReady','prev':'accepted','moneyEffect':'none'},'commercialSemantics':'Kitchen\x20readiness\x20is\x20attested\x20by\x20a\x20merchant-staff\x20evidence\x20row\x20(bag-seal\x20code)\x20keyed\x20to\x20the\x20order\x20before\x20the\x20order\x20is\x20offered\x20to\x20riders.','guardKeyProbe':'ready_evidence','evidence':[]},{'id':'M9','class':'main','name':'Platform\x20dispatches\x20the\x20order\x20to\x20a\x20rider','actor':'platform','precondition':['M8'],'onchain':'disclosure_only','chainFootprint':{'moneyEffect':'none'},'commercialSemantics':'Dispatch\x20is\x20an\x20off-chain\x20keeper\x20decision;\x20its\x20only\x20chain\x20footprint\x20is\x20the\x20per-order\x20namedOperator\x20roster\x20(permission\x20index\x20221).','disclosureProbe':'DISPATCH\x20IS\x20OFF-CHAIN','evidence':[]},{'id':'M10','class':'main','name':'Rider\x20arrives\x20at\x20the\x20restaurant','actor':'fulfiller','precondition':['M9'],'onchain':'expressible','chainFootprint':{'node':'picked_up'},'commercialSemantics':'Rider\x20arrival\x20has\x20no\x20independent\x20node;\x20it\x20is\x20implicit\x20in\x20the\x20pickup\x20handover\x20(acceptable\x20modeling).','evidence':[]},{'id':'M11','class':'main','name':'Rider\x20picks\x20up\x20with\x20handover\x20verification','actor':'fulfiller','precondition':['M10'],'onchain':'expressible','chainFootprint':{'node':'picked_up','forward':'PickupOrder','prev':'ready','identity':'named_operator','moneyEffect':'none'},'commercialSemantics':'Only\x20a\x20rostered\x20rider\x20may\x20advance\x20the\x20pickup;\x20the\x20guard\x20re-asserts\x20the\x20roster\x20predicate\x20and\x20requires\x20the\x20merchant\x20staff\x27s\x20handover\x20row.','guardKeyProbe':'pickup_evidence','evidence':[{'file':'progress.move','line':0x10a,'pattern':'fun\x20IsNamedOperator'}]},{'id':'M12','class':'main','name':'In-transit\x20real-time\x20location','actor':'platform','precondition':['M11'],'onchain':'unresolvable','commercialSemantics':'Live\x20rider\x20location\x20and\x20ETA\x20are\x20app\x20features;\x20the\x20chain\x20has\x20no\x20location/ETA\x20oracle.','unresolvableRef':'S7','disclosureProbe':'ETA\x20\x5c/\x20ROUTE|DISTANCE\x20ORACLE','evidence':[]},{'id':'M13','class':'main','name':'Rider\x20delivers\x20the\x20order\x20(drop-off\x20attested)','actor':'fulfiller','precondition':['M11'],'onchain':'expressible_with_gap','chainFootprint':{'node':'delivered','forward':'DeliverOrder','prev':'picked_up','identity':'named_operator','moneyEffect':'none'},'commercialSemantics':'Delivery\x20is\x20attested\x20by\x20the\x20rostered\x20rider\x27s\x20forward\x20plus\x20a\x20merchant-staff\x20drop-off\x20evidence\x20row;\x20the\x20chain\x20has\x20no\x20parcel\x20oracle,\x20so\x20\x27delivered\x27\x20rests\x20on\x20these\x20two\x20credentials\x20(see\x20E18\x20for\x20the\x20fake-delivery\x20residual).','guardKeyProbe':'deliver_evidence','gapPredicate':{'probe':'parcel\x20oracle|handover\x20evidence'},'evidence':[{'file':'progress.move','line':0x10a,'pattern':'fun\x20IsNamedOperator'}]},{'id':'M14','class':'main','name':'Buyer\x20confirms\x20receipt\x20/\x20silence\x20fallback\x20opens\x20the\x20claim\x20window','actor':'buyer','precondition':['M13'],'onchain':'expressible','chainFootprint':{'node':'claim_window','forward':'ConfirmReceipt','prev':'delivered','identity':'order_holder','moneyEffect':'none'},'commercialSemantics':'Buyer-first\x20confirmation\x20with\x20a\x20keeper\x20silence\x20fallback\x20(auto_confirm_hours)\x20—\x20a\x20silent\x20buyer\x20can\x20never\x20strand\x20the\x20escrow\x20at\x20delivered.','evidence':[]},{'id':'M15','class':'post','name':'Buyer\x20reviews\x20the\x20order','actor':'buyer','precondition':['M16'],'onchain':'expressible','chainFootprint':{'node':'reviewed','forward':'SubmitReview','prev':'completed','identity':'order_holder','moneyEffect':'none'},'commercialSemantics':'Post-settlement\x20review\x20rail,\x20money-free\x20by\x20topology;\x20reward\x20cashback\x20is\x20an\x20explicit\x20opt-in,\x20off\x20by\x20default.','evidence':[]},{'id':'M16','class':'post','name':'Merchant\x20settlement\x20after\x20the\x20claim\x20window\x20elapses','actor':'platform','precondition':['M14'],'onchain':'expressible','chainFootprint':{'node':'completed','forward':'SettleAfterWindow','prev':'claim_window','moneyEffect':'release'},'commercialSemantics':'Serial\x20claim\x20window\x20(TPL-09):\x20settlement\x20opens\x20only\x20after\x20the\x20filing\x20window\x20closed;\x20the\x20goods\x20allocator\x20pays\x20the\x20restaurant\x20and\x20the\x20platform\x20legs.','guardKeyProbe':'settle_window_gate','evidence':[]},{'id':'M17','class':'post','name':'Rider\x20paid\x20per\x20order','actor':'platform','precondition':['M16'],'onchain':'expressible','chainFootprint':{'moneyEffect':'reward'},'commercialSemantics':'Per-order\x20rider\x20pay\x20IS\x20chain-expressible\x20(an\x20Entity\x20or\x20Signer\x20allocator\x20leg\x20bypasses\x20the\x20for_object\x20lock;\x20T-06\x20proven\x20live),\x20but\x20the\x20shipped\x20shape\x20keeps\x20rider\x20pay\x20as\x20OFF-CHAIN\x20platform\x20payroll\x20—\x20the\x20platform\x20Rate-0\x20leg\x20pays\x20nothing.\x20No\x20rider-pay\x20leg\x20or\x20Reward\x20claim\x20ships:\x20the\x20escrow\x20never\x20pays\x20the\x20courier.','evidence':[{'file':'allocation.move','line':0x274,'pattern':'tx_context::sender'}]},{'id':'E1','class':'exception','name':'Payment\x20timeout\x20/\x20failure','actor':'buyer','precondition':['M5'],'onchain':'not_applicable','commercialSemantics':'buy2\x20is\x20atomic\x20—\x20quote,\x20payment\x20and\x20escrow\x20commit\x20or\x20abort\x20together;\x20there\x20is\x20no\x20paid-but-unescrowed\x20state\x20to\x20time\x20out.','evidence':[]},{'id':'E2','class':'exception','name':'Merchant\x20rejects\x20the\x20order\x20before\x20acceptance\x20(full\x20refund)','actor':'merchant','precondition':['M6'],'onchain':'expressible','chainFootprint':{'node':'closed_cancel','forward':'RejectOrder','prev':'paid','identity':'permission_index','moneyEffect':'refund'},'commercialSemantics':'Sold-out\x20/\x20closing\x20merchant\x20rejects;\x20the\x20order-anchored\x20full-refund\x20rail\x20returns\x20the\x20whole\x20escrow.','evidence':[]},{'id':'E3','class':'exception','name':'Merchant\x20fails\x20to\x20accept\x20in\x20time\x20(auto-cancel\x20full\x20refund)','actor':'keeper','precondition':['M6'],'onchain':'expressible','chainFootprint':{'forward':'TimeoutAccept','moneyEffect':'refund'},'commercialSemantics':'Real\x20products\x20auto-cancel\x20and\x20fully\x20refund\x20when\x20no\x20merchant\x20accepts\x20within\x20a\x20deadline;\x20this\x20template\x20has\x20NO\x20accept-timeout\x20edge\x20(auto_confirm\x20only\x20guards\x20post-delivery\x20silence).','evidence':[]},{'id':'E4','class':'exception','name':'Buyer\x20cancels\x20before\x20acceptance\x20(free\x20full\x20refund)','actor':'buyer','precondition':['M6'],'onchain':'expressible','chainFootprint':{'node':'closed_cancel','forward':'CancelBeforeAccept','prev':'paid','identity':'order_holder','moneyEffect':'refund'},'commercialSemantics':'No-prep\x20cancel\x20is\x20free;\x20the\x20full\x20escrow\x20returns\x20order-anchored.','evidence':[]},{'id':'E5','class':'exception','name':'Buyer\x20cancels\x20after\x20acceptance\x20(fee-bearing\x20kill)','actor':'buyer','precondition':['M7'],'onchain':'expressible','chainFootprint':{'node':'closed_kill','forward':'CancelAfterAccept','prev':'accepted','identity':'order_holder','moneyEffect':'refund'},'commercialSemantics':'The\x20kitchen\x20already\x20started:\x20kill_fee_bps\x20(benchmark\x205%)\x20compensates\x20the\x20restaurant,\x20the\x20complement\x20returns\x20to\x20the\x20buyer.','evidence':[]},{'id':'E6','class':'exception','name':'Merchant\x20refuses\x20a\x20mid-prep\x20buyer\x20cancel','actor':'merchant','precondition':['E5'],'onchain':'expressible','chainFootprint':{'forward':'RejectCancel','moneyEffect':'none'},'commercialSemantics':'Some\x20products\x20let\x20the\x20merchant\x20decline\x20a\x20cancel\x20request\x20once\x20cooking\x20started\x20(consent-gated\x20cancel);\x20this\x20template\x20has\x20no\x20such\x20negotiation\x20edge\x20—\x20the\x20buyer\x27s\x20kill\x20always\x20executes.','evidence':[]},{'id':'E7','class':'exception','name':'Prep\x20timeout\x20(penalty-free\x20cancel\x20plus\x20lateness\x20compensation)','actor':'keeper','precondition':['M7'],'onchain':'expressible','chainFootprint':{'forward':'ReadyTimeoutCancel','moneyEffect':'refund'},'commercialSemantics':'If\x20the\x20restaurant\x20misses\x20its\x20prep\x20deadline\x20the\x20buyer\x20can\x20cancel\x20penalty-free\x20(and\x20real\x20products\x20add\x20a\x20lateness\x20voucher);\x20this\x20template\x20has\x20NO\x20ready-timeout\x20edge.','evidence':[]},{'id':'E8','class':'exception','name':'No\x20rider\x20accepts\x20(capacity\x20shortage)\x20—\x20buyer\x20cancels\x20penalty-free','actor':'platform','precondition':['M8'],'onchain':'expressible','chainFootprint':{'forward':'CancelForNoCapacity','moneyEffect':'refund'},'commercialSemantics':'Capacity\x20shortage\x20is\x20NOT\x20the\x20buyer\x27s\x20fault:\x20real\x20products\x20waive\x20the\x20cancel\x20fee\x20when\x20no\x20rider\x20picked\x20up\x20within\x20the\x20promised\x20dispatch\x20window.\x20CURED\x20(K3\x20Batch\x2010,\x20261031):\x20the\x20template\x20ships\x20CancelForNoCapacity\x20—\x20the\x20platform\x20(keeper\x20slot\x201002)\x20force-cancels\x20penalty-free\x20into\x20the\x20full-refund\x20terminal\x20once\x20dispatch_window_hours\x20elapse\x20on\x20the\x20ready\x20entry\x20with\x20no\x20rostered\x20pickup;\x20the\x205%\x20kill\x20stays\x20reserved\x20for\x20BUYER-initiated\x20post-acceptance\x20cancels.','evidence':[]},{'id':'E9','class':'exception','name':'Rider\x20cancels\x20/\x20is\x20reassigned\x20(re-dispatch)','actor':'platform','precondition':['M9'],'onchain':'disclosure_only','chainFootprint':{'moneyEffect':'none'},'commercialSemantics':'Re-dispatch\x20is\x20an\x20off-chain\x20keeper\x20duty;\x20the\x20chain\x20never\x20fabricates\x20delivery\x20state\x20to\x20cover\x20a\x20dead\x20rider.','disclosureProbe':'re-dispatch','evidence':[]},{'id':'E10','class':'exception','name':'Rider\x20arrives\x20but\x20food\x20is\x20not\x20ready\x20(wait\x20/\x20escalate\x20/\x20cancel)','actor':'fulfiller','precondition':['M10'],'onchain':'expressible','chainFootprint':{'forward':'ReportMerchantNotReady','moneyEffect':'none'},'commercialSemantics':'Rider-side\x20wait/escalation\x20when\x20the\x20merchant\x20misses\x20the\x20prep\x20slot;\x20this\x20template\x20expresses\x20no\x20rider-side\x20complaint\x20surface.','evidence':[]},{'id':'E11','class':'exception','name':'Partial\x20stock-out\x20(partial\x20refund\x20/\x20substitution\x20/\x20cancel)','actor':'merchant','precondition':['M7'],'onchain':'expressible','chainFootprint':{'forward':'PartialRefund','moneyEffect':'refund'},'commercialSemantics':'A\x20chain-enforced\x20partial-remedy\x20branch\x20IS\x20expressible\x20(consent\x20repository\x20+\x20byte-equality\x20acceptance\x20+\x20existence-verified\x20refund\x20leg)\x20but\x20ships\x20only\x20as\x20an\x20OPT-IN\x20build\x20note\x20—\x20no\x20default\x20partial-refund\x20rail\x20exists.','evidence':[]},{'id':'E12','class':'exception','name':'Spillage\x20/\x20damage\x20in\x20transit\x20(photo\x20evidence,\x20full\x20or\x20partial\x20refund)','actor':'fulfiller','precondition':['M11'],'onchain':'expressible','chainFootprint':{'node':'claim_filed','forward':'ReportTransitLoss','prev':'picked_up','identity':'order_holder','moneyEffect':'none'},'commercialSemantics':'In-transit\x20loss\x20routes\x20into\x20the\x20dispute\x20waypoint\x20(identity-only\x20by\x20design\x20mid-transit);\x20the\x20remedy\x20is\x20the\x20buyer\x27s\x20arbitration\x20case\x20into\x20the\x20full-refund\x20rail.','guardKeyProbe':'report_loss','evidence':[]},{'id':'E13','class':'exception','name':'Wrong\x20/\x20missing\x20items\x20(redelivery\x20or\x20refund)','actor':'merchant','precondition':['M13'],'onchain':'expressible','chainFootprint':{'forward':'Redeliver','moneyEffect':'none'},'commercialSemantics':'Redelivery\x20has\x20no\x20path\x20(machine\x20freeze\x20—\x20a\x20post-publish\x20re-delivery\x20rail\x20cannot\x20be\x20added);\x20the\x20buyer\x27s\x20only\x20remedies\x20are\x20dispute/arbitration\x20or\x20the\x20return\x20rail.','evidence':[]},{'id':'E14','class':'exception','name':'Food-safety\x20violation\x20(full\x20refund\x20plus\x20high-multiple\x20compensation)','actor':'merchant','precondition':['M13'],'onchain':'expressible_with_gap','chainFootprint':{'node':'claim_filed','moneyEffect':'compensate'},'commercialSemantics':'Statutory\x20food-safety\x20compensation\x20(price\x20x10\x20or\x20loss\x20x3,\x20floor\x201000\x20CNY)\x20routes\x20through\x20arbitration;\x20the\x20chain\x20caps\x20indemnity\x20at\x203x\x20the\x20order\x20amount\x20and\x20hard-binds\x20the\x20payee\x20to\x20order.owner\x20—\x20the\x20statutory\x20multiple\x20is\x20unreachable\x20on-chain.','gapPredicate':{'probe':'tenfold|10x|MAX_INDEMNITY|statutory|food.safety'},'evidence':[{'file':'arb.move','line':0x15,'pattern':'MAX_INDEMNITY_MULTIPLE:u64\x20=\x203'}]},{'id':'E15','class':'exception','name':'Late-delivery\x20compensation\x20(on-time\x20guarantee)','actor':'fulfiller','precondition':['M13'],'onchain':'expressible_with_gap','chainFootprint':{'node':'completed','forward':'SettleAfterWindow','prev':'claim_window','moneyEffect':'release','guardLegs':['payment.info.for\x20==\x20the\x20order\x20anchored\x20at\x20protocol\x20slot\x20254\x20(one\x20order)','payment.info.remark\x20==\x20the\x20versioned\x20clause\x20marker\x20(one\x20matter)','order.owner\x20==\x20the\x20submitted\x20beneficiary\x20address,\x20and\x20payment.recipient\x20has\x20that\x20address\x20(payee\x20closure)','payment.amount\x20>=\x20the\x20clause\x20penalty\x20(amount\x20closure)','protocol\x20slot\x20255\x20==\x20progress.history\x20count,\x20so\x20the\x20proof\x20burns\x20after\x20one\x20verification\x20(one\x20time)','settlement\x20leg\x20becomes\x20logic_or(on-time\x20evidence\x20row,\x20compensation\x20voucher)\x20—\x20a\x20late\x20order\x20rests\x20at\x20the\x20window\x20with\x20funds\x20intact\x20until\x20the\x20voucher\x20verifies']},'commercialSemantics':'Punctuality\x20products\x20pay\x20the\x20buyer\x20when\x20the\x20order\x20is\x20late.\x20Industry\x20equilibrium\x20is\x20a\x20small,\x20no-application-required,\x20proactive\x20payout:\x20SF\x20Express\x20since\x202025-12-01\x20self-pays\x2020-30%\x20of\x20the\x20shipping\x20fee\x20in\x20tiers\x20for\x20its\x20own\x20delays\x20with\x20zero\x20rider\x20pass-through,\x20and\x20JD\x20instant\x20delivery\x20auto-issues\x20a\x20voucher\x20past\x2010/20\x20minutes.\x20The\x20chain\x20cannot\x20DEDUCT\x20that\x20amount\x20from\x20anyone,\x20but\x20it\x20does\x20not\x20need\x20to:\x20Payment\x20is\x20immutable\x20and\x20self-authenticating,\x20so\x20a\x20forward\x20guard\x20can\x20verify\x20a\x20voluntarily\x20minted\x20compensation\x20voucher\x20and\x20refuse\x20to\x20settle\x20until\x20it\x20exists.\x20Non-payment\x20therefore\x20costs\x20the\x20liable\x20party\x20more\x20than\x20payment\x20—\x20the\x20order\x20rests\x20with\x20funds\x20intact\x20and\x20the\x20buyer\x20keeps\x20the\x20arbitration\x20rail\x20(up\x20to\x203x\x20plus\x20the\x20compensation\x20fund).','gapPredicate':{'probe':'voluntar(y|ily)[^\x22]{0,80}(payment|payout|compensat|mint)|compensation\x20voucher|payment\x20voucher|refus[^\x22]{0,40}settle|settlement[^\x22]{0,40}voucher'},'guardKeyProbe':'penalty_marker|sla_penalty|penalty_payment|on_time_gate','guardProbeKind':'feature','evidence':[{'file':'payment.move','line':0x72,'pattern':'public\x20fun\x20new_singleton'},{'file':'payment.move','line':0x42,'pattern':'public\x20struct\x20PaymentInfo\x20has\x20copy,\x20drop,\x20store\x20{'},{'file':'payment.move','line':0xb7,'pattern':'transfer::freeze_object(payment);'},{'file':'allocation.move','line':0x214,'pattern':'E_ONCE_TRIGGERED'}]},{'id':'E16','class':'exception','name':'Wrong\x20address\x20/\x20unreachable\x20buyer\x20(wait,\x20return,\x20partial\x20deduction)','actor':'buyer','precondition':['M11'],'onchain':'expressible','chainFootprint':{'forward':'ReturnToSender','moneyEffect':'refund'},'commercialSemantics':'Failed-contact\x20flows\x20end\x20in\x20a\x20return-to-sender\x20with\x20a\x20partial\x20deduction;\x20this\x20template\x20has\x20no\x20such\x20path\x20—\x20a\x20buyer\x20unreachable\x20at\x20the\x20door\x20strands\x20the\x20order\x20at\x20delivered\x20until\x20the\x20silence\x20fallback.','evidence':[]},{'id':'E17','class':'exception','name':'Buyer\x20rejects\x20at\x20the\x20door\x20(refund\x20minus\x20delivery\x20fee)','actor':'buyer','precondition':['M13'],'onchain':'expressible','chainFootprint':{'node':'return_requested','forward':'RequestReturn','prev':'delivered','identity':'order_holder','moneyEffect':'none'},'commercialSemantics':'T-02\x20after-sales\x20rail:\x20a\x20buyer\x20rejects\x20the\x20delivered\x20order\x20inside\x20the\x20return\x20window;\x20the\x20merchant\x20confirms\x20(full\x20refund)\x20or\x20rejects\x20(resume),\x20and\x20the\x20buyer\x20can\x20self-withdraw.\x20The\x20fee\x20shape\x20is\x20a\x20Rate\x20split\x20(kill_fee_bps),\x20not\x20a\x20delivery-fee\x20deduction\x20—\x20semantically\x20adjacent,\x20disclosed.','evidence':[]},{'id':'E18','class':'exception','name':'Fake\x20delivery\x20(rider\x20marks\x20delivered\x20without\x20delivering)','actor':'fulfiller','precondition':['M11'],'onchain':'expressible_with_gap','chainFootprint':{'node':'delivered','forward':'DeliverOrder','prev':'picked_up','identity':'named_operator','moneyEffect':'none'},'commercialSemantics':'DM-P1\x20hardened\x20the\x20handover:\x20only\x20a\x20rostered\x20rider\x20can\x20advance,\x20and\x20the\x20guard\x20re-asserts\x20the\x20roster\x20predicate\x20plus\x20an\x20order-keyed\x20merchant-staff\x20drop-off\x20row.\x20The\x20chain\x20still\x20has\x20no\x20parcel\x20oracle\x20—\x20a\x20colluding\x20staff\x20writer\x20+\x20rostered\x20rider\x20can\x20still\x20fake\x20the\x20row;\x20the\x20residual\x20risk\x20is\x20disclosure-bounded.','guardKeyProbe':'deliver_evidence','gapPredicate':{'probe':'parcel\x20oracle|handover\x20evidence'},'evidence':[{'file':'progress.move','line':0x10a,'pattern':'fun\x20IsNamedOperator'}]},{'id':'E19','class':'exception','name':'Contactless-delivery\x20loss\x20(left\x20at\x20the\x20door,\x20buyer\x20never\x20received)','actor':'arbitrator','precondition':['M13'],'onchain':'expressible','chainFootprint':{'forward':'ReportContactlessLoss','moneyEffect':'none'},'commercialSemantics':'A\x20dedicated\x20non-receipt\x20declaration\x20after\x20a\x20contactless\x20drop-off;\x20this\x20template\x20routes\x20the\x20case\x20only\x20through\x20the\x20generic\x20dispute\x20filing\x20(FileDispute)\x20once\x20the\x20claim\x20window\x20opened\x20—\x20no\x20contactless-specific\x20surface.','evidence':[]},{'id':'E20','class':'remedy','name':'Refund\x20refused\x20(escalate\x20to\x20third-party\x20arbitration)','actor':'buyer','precondition':['M14'],'onchain':'expressible','chainFootprint':{'node':'claim_filed','forward':'FileDispute','prev':'claim_window','moneyEffect':'none'},'commercialSemantics':'Dispute\x20filing\x20is\x20alive\x20only\x20INSIDE\x20the\x20serial\x20claim\x20window;\x20the\x20venue\x20is\x20an\x20independent\x20third-party\x20Arbitration\x20object.','evidence':[]},{'id':'E21','class':'remedy','name':'Arbitrator\x20rules\x20for\x20the\x20buyer\x20(refund\x20executes)','actor':'arbitrator','precondition':['E20'],'onchain':'expressible','chainFootprint':{'node':'closed_cancel','forward':'ArbRefund','prev':'claim_filed','identity':'permission_index','moneyEffect':'refund'},'commercialSemantics':'A\x20buyer-won\x20ruling\x20with\x20non-zero\x20indemnity\x20re-routes\x20the\x20order\x20into\x20the\x20full-refund\x20rail.','guardKeyProbe':'arb_refund','evidence':[]},{'id':'E22','class':'remedy','name':'Arbitrator\x20dismisses\x20the\x20claim\x20(order\x20resumes)','actor':'arbitrator','precondition':['E20'],'onchain':'expressible','chainFootprint':{'node':'delivered','forward':'ResumeAfterDismissal','prev':'claim_filed','identity':'permission_index','moneyEffect':'none'},'commercialSemantics':'A\x20merchant-favor\x20ruling\x20resumes\x20the\x20order\x20at\x20delivered\x20with\x20re-anchored\x20silence\x20windows.','guardKeyProbe':'arb_dismissed_resume','evidence':[]},{'id':'E23','class':'remedy','name':'Arbitration\x20timeout\x20deemed\x20favorable\x20to\x20the\x20buyer','actor':'platform','precondition':['E20'],'onchain':'not_applicable','commercialSemantics':'Real\x20products\x20deem\x20an\x20unraveled\x20case\x20buyer-favorable;\x20on-chain\x20the\x20semantics\x20INVERT\x20—\x2030\x20days\x20of\x20arbitrator\x20silence\x20means\x20the\x20recorded\x20ruling\x20is\x20ACCEPTED\x20and\x20executes\x20as-is.\x20The\x20difference\x20must\x20be\x20disclosed.','disclosureProbe':'30.day|silence[^\x22]{0,80}(accept|arb)|ruling[^\x22]{0,80}silence','evidence':[]},{'id':'E24','class':'post','name':'Merchant\x20appeals\x20a\x20malicious\x20review\x20(removal)','actor':'merchant','precondition':['M15'],'onchain':'expressible_with_gap','chainFootprint':{'forward':'AppealReview','moneyEffect':'none'},'commercialSemantics':'Review\x20removal\x20on-chain\x20would\x20be\x20an\x20overwrite\x20of\x20a\x20kernel-owned\x20repository\x20row\x20—\x20constrained\x20by\x20write_once\x20policy;\x20no\x20appeal/removal\x20surface\x20exists\x20on\x20this\x20template.','gapPredicate':{'probe':'write_once|review[^\x22]{0,80}(edit|remov|appeal)|(edit|remov|appeal)[^\x22]{0,80}review'},'evidence':[]},{'id':'E25','class':'post','name':'Review\x20edit\x20window','actor':'buyer','precondition':['M15'],'onchain':'expressible_with_gap','chainFootprint':{'forward':'EditReview','moneyEffect':'none'},'commercialSemantics':'Whether\x20a\x20review\x20may\x20be\x20edited\x20depends\x20on\x20the\x20review\x20repository\x27s\x20write_once\x20policy;\x20no\x20explicit\x20edit\x20window\x20is\x20declared\x20on\x20this\x20template.','gapPredicate':{'probe':'write_once|review[^\x22]{0,80}(edit|remov|appeal)|(edit|remov|appeal)[^\x22]{0,80}review'},'evidence':[]},{'id':'E26','class':'exception','name':'Store\x20delisted\x20while\x20orders\x20are\x20open\x20(mass\x20refund)','actor':'platform','precondition':['M6'],'onchain':'expressible','chainFootprint':{'forward':'DelistRefund','moneyEffect':'refund'},'commercialSemantics':'A\x20delisting\x20refund\x20rail\x20is\x20expressible\x20(B-1/F-2\x20family)\x20but\x20this\x20template\x20ships\x20none\x20—\x20open\x20orders\x20ride\x20only\x20their\x20per-order\x20rails.','evidence':[]},{'id':'E27','class':'exception','name':'Duplicate\x20order\x20(cancel\x20one\x20of\x20two\x20identical\x20orders)','actor':'buyer','precondition':['M6'],'onchain':'not_applicable','commercialSemantics':'Orders\x20are\x20independent\x20objects;\x20the\x20buyer\x20cancels\x20the\x20duplicate\x20through\x20the\x20normal\x20cancel\x20rails\x20(E4/E5).','evidence':[]},{'id':'E28','class':'exception','name':'Mispriced\x20promotion\x20(price-difference\x20refund)','actor':'platform','precondition':['M3'],'onchain':'expressible_with_gap','chainFootprint':{'forward':'RefundPriceDiff','moneyEffect':'refund'},'commercialSemantics':'No\x20price-difference\x20rail;\x20known\x20chain\x20defect\x20A-4\x20makes\x20it\x20worse\x20—\x20a\x20coupon\x20below\x20benchmark\x20changes\x20no\x20price\x20yet\x20the\x20voucher\x20is\x20still\x20burned.','gapPredicate':{'probe':'price.?difference|coupon[^\x22]{0,80}(burn|wasted)|burned[^\x22]{0,80}coupon'},'evidence':[]},{'id':'E29','class':'exception','name':'Scheduled-order\x20tiered\x20cancellation\x20fees','actor':'buyer','precondition':['M6'],'onchain':'expressible_with_gap','chainFootprint':{'forward':'ScheduledKill','moneyEffect':'refund'},'commercialSemantics':'Scheduled\x20(pre-order)\x20meals\x20use\x20time-graded\x20cancel\x20fees;\x20kill_fee_bps\x20is\x20a\x20single\x20flat\x20rate\x20—\x20no\x20tiers,\x20no\x20scheduled-order\x20shape.','gapPredicate':{'probe':'tiered|scheduled|appointment'},'evidence':[]},{'id':'E30','class':'exception','name':'Rider\x20accident\x20/\x20personal-injury\x20insurance','actor':'platform','precondition':['M9'],'onchain':'unresolvable','commercialSemantics':'Rider\x20injury\x20coverage\x20is\x20an\x20insurance\x20product;\x20the\x20chain\x20has\x20no\x20insurance\x20primitive\x20—\x20coverage\x20is\x20an\x20off-chain\x20policy\x20under\x20platform-work\x20and\x20traffic\x20law.','unresolvableRef':'S10','disclosureProbe':'accident[^\x22]{0,80}insurance|insurance[^\x22]{0,80}rider|injury','evidence':[]},{'id':'E31','class':'post','name':'Post-delivery\x20tip\x20top-up','actor':'buyer','precondition':['M16'],'onchain':'expressible','chainFootprint':{'forward':'AddTip','moneyEffect':'reward'},'commercialSemantics':'A\x20post-delivery\x20tip\x20is\x20expressible\x20(Reward\x20claim,\x20P6),\x20but\x20courier_tip_bps\x20is\x20DISCLOSURE-ONLY\x20and\x20rides\x20the\x20order\x20total\x20—\x20no\x20independent\x20post-delivery\x20tip\x20funding\x20path\x20ships.','evidence':[]},{'id':'E32','class':'exception','name':'Membership\x20free-delivery\x20not\x20applied\x20(delivery-fee\x20rebate)','actor':'platform','precondition':['M6'],'onchain':'expressible','chainFootprint':{'forward':'DeliveryFeeRebate','moneyEffect':'refund'},'commercialSemantics':'Cross-template\x20membership\x20linkage\x20(subscription/delivery-membership)\x20has\x20no\x20on-chain\x20grouping\x20(S2)\x20—\x20the\x20rebate\x20must\x20be\x20an\x20independent\x20order-level\x20remedy.','evidence':[]}],'invariants':[{'id':'INV-FD-1','statement':'Food-safety\x20compensation\x20must\x20reach\x20price\x20x10\x20or\x20loss\x20x3\x20with\x20a\x201000\x20CNY\x20floor\x20(China\x20Food\x20Safety\x20Law\x20art.\x20148).','jurisdiction':'CN','chainConflict':'The\x20chain\x20caps\x20arbitration\x20indemnity\x20at\x203x\x20the\x20order\x20amount\x20(the\x20MAX_INDEMNITY_MULTIPLE\x20constant)\x20and\x20hard-binds\x20the\x20payee\x20to\x20order.owner\x20—\x20the\x20statutory\x20multiple\x20and\x20the\x20small-claim\x20floor\x20are\x20unreachable\x20on-chain.\x20Options:\x20disclose\x20the\x203x\x20cap\x20and\x20pursue\x20the\x20statutory\x20remainder\x20off-chain;\x20pre-fund\x20a\x20Reward\x20pool\x20for\x20the\x20difference;\x20or\x20raise\x20the\x20chain\x20cap\x20(protocol\x20upgrade,\x20affects\x20every\x20published\x20Service\x27s\x20exposure).','evidence':[{'file':'arb.move','line':0x15,'pattern':'MAX_INDEMNITY_MULTIPLE:u64\x20=\x203'}]},{'id':'INV-FD-2','statement':'A\x20cancel\x20caused\x20by\x20capacity\x20shortage\x20(no\x20rider\x20accepted)\x20must\x20be\x20free\x20for\x20the\x20buyer\x20—\x20the\x20fulfillment\x20failure\x20is\x20not\x20the\x20buyer\x27s\x20fault.','chainConflict':'None\x20—\x20this\x20is\x20pure\x20business\x20semantics\x20and\x20the\x20fix\x20is\x20zero-chain-change:\x20add\x20a\x20CancelForNoCapacity\x20edge\x20into\x20the\x20full-refund\x20terminal,\x20guarded\x20on\x20\x27still\x20pre-pickup\x27\x20plus\x20a\x20clock\x20past\x20the\x20promised\x20dispatch\x20window.','violation':{'requiresFeeParamNonZero':'kill_fee_bps','whileMissingForward':'CancelForNoCapacity'}},{'id':'INV-FD-3','statement':'Rider\x20pay\x20is\x20off-chain\x20platform\x20payroll\x20in\x20the\x20shipped\x20shape;\x20nothing\x20on\x20chain\x20pays\x20the\x20courier\x20per\x20order.','chainConflict':'The\x20platform\x20Rate-0\x20allocator\x20leg\x20pays\x20nothing\x20(it\x20shares\x20the\x20settlement\x20rail\x20as\x20an\x20order\x20anchor).\x20Builders\x20who\x20misread\x20it\x20as\x20\x27the\x20platform\x20pays\x20riders\x20from\x20escrow\x27\x20are\x20wrong:\x20direct\x20per-order\x20rider\x20pay\x20requires\x20an\x20explicit\x20Entity/Signer\x20leg\x20(the\x20on-chain\x20allocation\x20Entity/Signer\x20payout\x20path)\x20or\x20a\x20Reward\x20claim.\x20EU\x20note:\x20platform-set\x20pay\x20+\x20dispatch\x20roster\x20+\x20electronic\x20monitoring\x20hit\x20the\x20Platform\x20Work\x20Directive\x20presumptive-employment\x20criteria\x20—\x20in\x20EU\x20builds\x20riders\x20must\x20quote\x20their\x20own\x20price\x20or\x20the\x20merchant_managed\x20variant\x20is\x20used.'}]};
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import type { SourceAnchor } from "../../chain-semantics/index.js";
|
|
3
|
+
export type PathClass = "main" | "exception" | "remedy" | "post" | "offchain";
|
|
4
|
+
export type OnchainStatus = "expressible" | "expressible_with_gap" | "disclosure_only" | "not_applicable" | "unresolvable";
|
|
5
|
+
export type OracleActor = "buyer" | "merchant" | "fulfiller" | "platform" | "arbitrator" | "keeper";
|
|
6
|
+
export declare const OracleStepSchema: z.ZodObject<{
|
|
7
|
+
id: z.ZodString;
|
|
8
|
+
class: z.ZodEnum<{
|
|
9
|
+
exception: "exception";
|
|
10
|
+
remedy: "remedy";
|
|
11
|
+
main: "main";
|
|
12
|
+
post: "post";
|
|
13
|
+
offchain: "offchain";
|
|
14
|
+
}>;
|
|
15
|
+
name: z.ZodString;
|
|
16
|
+
actor: z.ZodEnum<{
|
|
17
|
+
merchant: "merchant";
|
|
18
|
+
arbitrator: "arbitrator";
|
|
19
|
+
buyer: "buyer";
|
|
20
|
+
platform: "platform";
|
|
21
|
+
fulfiller: "fulfiller";
|
|
22
|
+
keeper: "keeper";
|
|
23
|
+
}>;
|
|
24
|
+
precondition: z.ZodArray<z.ZodString>;
|
|
25
|
+
onchain: z.ZodEnum<{
|
|
26
|
+
not_applicable: "not_applicable";
|
|
27
|
+
expressible: "expressible";
|
|
28
|
+
expressible_with_gap: "expressible_with_gap";
|
|
29
|
+
disclosure_only: "disclosure_only";
|
|
30
|
+
unresolvable: "unresolvable";
|
|
31
|
+
}>;
|
|
32
|
+
chainFootprint: z.ZodOptional<z.ZodObject<{
|
|
33
|
+
node: z.ZodOptional<z.ZodString>;
|
|
34
|
+
forward: z.ZodOptional<z.ZodString>;
|
|
35
|
+
prev: z.ZodOptional<z.ZodString>;
|
|
36
|
+
identity: z.ZodOptional<z.ZodEnum<{
|
|
37
|
+
order_holder: "order_holder";
|
|
38
|
+
permission_index: "permission_index";
|
|
39
|
+
named_operator: "named_operator";
|
|
40
|
+
signer: "signer";
|
|
41
|
+
}>>;
|
|
42
|
+
guardLegs: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
43
|
+
moneyEffect: z.ZodOptional<z.ZodEnum<{
|
|
44
|
+
refund: "refund";
|
|
45
|
+
reward: "reward";
|
|
46
|
+
release: "release";
|
|
47
|
+
none: "none";
|
|
48
|
+
compensate: "compensate";
|
|
49
|
+
escrow_in: "escrow_in";
|
|
50
|
+
}>>;
|
|
51
|
+
}, z.core.$strict>>;
|
|
52
|
+
commercialSemantics: z.ZodString;
|
|
53
|
+
unresolvableRef: z.ZodOptional<z.ZodString>;
|
|
54
|
+
disclosureProbe: z.ZodOptional<z.ZodString>;
|
|
55
|
+
guardKeyProbe: z.ZodOptional<z.ZodString>;
|
|
56
|
+
guardProbeKind: z.ZodOptional<z.ZodEnum<{
|
|
57
|
+
safety: "safety";
|
|
58
|
+
feature: "feature";
|
|
59
|
+
}>>;
|
|
60
|
+
gapPredicate: z.ZodOptional<z.ZodObject<{
|
|
61
|
+
probe: z.ZodOptional<z.ZodString>;
|
|
62
|
+
}, z.core.$strict>>;
|
|
63
|
+
evidence: z.ZodArray<z.ZodObject<{
|
|
64
|
+
file: z.ZodString;
|
|
65
|
+
line: z.ZodNumber;
|
|
66
|
+
pattern: z.ZodString;
|
|
67
|
+
}, z.core.$strip>>;
|
|
68
|
+
}, z.core.$strict>;
|
|
69
|
+
export type OracleStep = z.infer<typeof OracleStepSchema>;
|
|
70
|
+
export declare const OracleInvariantSchema: z.ZodObject<{
|
|
71
|
+
id: z.ZodString;
|
|
72
|
+
statement: z.ZodString;
|
|
73
|
+
jurisdiction: z.ZodOptional<z.ZodString>;
|
|
74
|
+
chainConflict: z.ZodOptional<z.ZodString>;
|
|
75
|
+
evidence: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
76
|
+
file: z.ZodString;
|
|
77
|
+
line: z.ZodNumber;
|
|
78
|
+
pattern: z.ZodString;
|
|
79
|
+
}, z.core.$strip>>>;
|
|
80
|
+
violation: z.ZodOptional<z.ZodObject<{
|
|
81
|
+
requiresFeeParamNonZero: z.ZodOptional<z.ZodString>;
|
|
82
|
+
whileMissingForward: z.ZodOptional<z.ZodString>;
|
|
83
|
+
}, z.core.$strict>>;
|
|
84
|
+
}, z.core.$strict>;
|
|
85
|
+
export type OracleInvariant = z.infer<typeof OracleInvariantSchema>;
|
|
86
|
+
export declare const ProductOracleSchema: z.ZodObject<{
|
|
87
|
+
productRef: z.ZodString;
|
|
88
|
+
products: z.ZodArray<z.ZodString>;
|
|
89
|
+
oracleVersion: z.ZodString;
|
|
90
|
+
steps: z.ZodArray<z.ZodObject<{
|
|
91
|
+
id: z.ZodString;
|
|
92
|
+
class: z.ZodEnum<{
|
|
93
|
+
exception: "exception";
|
|
94
|
+
remedy: "remedy";
|
|
95
|
+
main: "main";
|
|
96
|
+
post: "post";
|
|
97
|
+
offchain: "offchain";
|
|
98
|
+
}>;
|
|
99
|
+
name: z.ZodString;
|
|
100
|
+
actor: z.ZodEnum<{
|
|
101
|
+
merchant: "merchant";
|
|
102
|
+
arbitrator: "arbitrator";
|
|
103
|
+
buyer: "buyer";
|
|
104
|
+
platform: "platform";
|
|
105
|
+
fulfiller: "fulfiller";
|
|
106
|
+
keeper: "keeper";
|
|
107
|
+
}>;
|
|
108
|
+
precondition: z.ZodArray<z.ZodString>;
|
|
109
|
+
onchain: z.ZodEnum<{
|
|
110
|
+
not_applicable: "not_applicable";
|
|
111
|
+
expressible: "expressible";
|
|
112
|
+
expressible_with_gap: "expressible_with_gap";
|
|
113
|
+
disclosure_only: "disclosure_only";
|
|
114
|
+
unresolvable: "unresolvable";
|
|
115
|
+
}>;
|
|
116
|
+
chainFootprint: z.ZodOptional<z.ZodObject<{
|
|
117
|
+
node: z.ZodOptional<z.ZodString>;
|
|
118
|
+
forward: z.ZodOptional<z.ZodString>;
|
|
119
|
+
prev: z.ZodOptional<z.ZodString>;
|
|
120
|
+
identity: z.ZodOptional<z.ZodEnum<{
|
|
121
|
+
order_holder: "order_holder";
|
|
122
|
+
permission_index: "permission_index";
|
|
123
|
+
named_operator: "named_operator";
|
|
124
|
+
signer: "signer";
|
|
125
|
+
}>>;
|
|
126
|
+
guardLegs: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
127
|
+
moneyEffect: z.ZodOptional<z.ZodEnum<{
|
|
128
|
+
refund: "refund";
|
|
129
|
+
reward: "reward";
|
|
130
|
+
release: "release";
|
|
131
|
+
none: "none";
|
|
132
|
+
compensate: "compensate";
|
|
133
|
+
escrow_in: "escrow_in";
|
|
134
|
+
}>>;
|
|
135
|
+
}, z.core.$strict>>;
|
|
136
|
+
commercialSemantics: z.ZodString;
|
|
137
|
+
unresolvableRef: z.ZodOptional<z.ZodString>;
|
|
138
|
+
disclosureProbe: z.ZodOptional<z.ZodString>;
|
|
139
|
+
guardKeyProbe: z.ZodOptional<z.ZodString>;
|
|
140
|
+
guardProbeKind: z.ZodOptional<z.ZodEnum<{
|
|
141
|
+
safety: "safety";
|
|
142
|
+
feature: "feature";
|
|
143
|
+
}>>;
|
|
144
|
+
gapPredicate: z.ZodOptional<z.ZodObject<{
|
|
145
|
+
probe: z.ZodOptional<z.ZodString>;
|
|
146
|
+
}, z.core.$strict>>;
|
|
147
|
+
evidence: z.ZodArray<z.ZodObject<{
|
|
148
|
+
file: z.ZodString;
|
|
149
|
+
line: z.ZodNumber;
|
|
150
|
+
pattern: z.ZodString;
|
|
151
|
+
}, z.core.$strip>>;
|
|
152
|
+
}, z.core.$strict>>;
|
|
153
|
+
invariants: z.ZodArray<z.ZodObject<{
|
|
154
|
+
id: z.ZodString;
|
|
155
|
+
statement: z.ZodString;
|
|
156
|
+
jurisdiction: z.ZodOptional<z.ZodString>;
|
|
157
|
+
chainConflict: z.ZodOptional<z.ZodString>;
|
|
158
|
+
evidence: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
159
|
+
file: z.ZodString;
|
|
160
|
+
line: z.ZodNumber;
|
|
161
|
+
pattern: z.ZodString;
|
|
162
|
+
}, z.core.$strip>>>;
|
|
163
|
+
violation: z.ZodOptional<z.ZodObject<{
|
|
164
|
+
requiresFeeParamNonZero: z.ZodOptional<z.ZodString>;
|
|
165
|
+
whileMissingForward: z.ZodOptional<z.ZodString>;
|
|
166
|
+
}, z.core.$strict>>;
|
|
167
|
+
}, z.core.$strict>>;
|
|
168
|
+
}, z.core.$strict>;
|
|
169
|
+
export type ProductOracle = z.infer<typeof ProductOracleSchema>;
|
|
170
|
+
export type StepCoverageStatus = "covered" | "partial" | "missing" | "disclosed" | "disclosure_missing" | "gap_undisclosed" | "excluded" | "na_redundant";
|
|
171
|
+
export interface StepCoverage {
|
|
172
|
+
step_id: string;
|
|
173
|
+
status: StepCoverageStatus;
|
|
174
|
+
reason: string;
|
|
175
|
+
}
|
|
176
|
+
export interface OracleCoverage {
|
|
177
|
+
product_ref: string;
|
|
178
|
+
oracle_version: string;
|
|
179
|
+
chain_relevant: number;
|
|
180
|
+
path_coverage: number;
|
|
181
|
+
guard_coverage: number;
|
|
182
|
+
feature_guard_coverage: number;
|
|
183
|
+
disclosure_coverage: number;
|
|
184
|
+
invariant_hits: string[];
|
|
185
|
+
steps: StepCoverage[];
|
|
186
|
+
uncovered: StepCoverage[];
|
|
187
|
+
}
|
|
188
|
+
export type { SourceAnchor };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{z}from'zod';export const OracleStepSchema=z['object']({'id':z['string']()['min'](0x1),'class':z['enum'](['main','exception','remedy','post','offchain']),'name':z['string']()['min'](0x1),'actor':z['enum'](['buyer','merchant','fulfiller','platform','arbitrator','keeper']),'precondition':z['array'](z['string']()),'onchain':z['enum'](['expressible','expressible_with_gap','disclosure_only','not_applicable','unresolvable']),'chainFootprint':z['object']({'node':z['string']()['optional'](),'forward':z['string']()['optional'](),'prev':z['string']()['optional'](),'identity':z['enum'](['permission_index','named_operator','order_holder','signer'])['optional'](),'guardLegs':z['array'](z['string']())['optional'](),'moneyEffect':z['enum'](['escrow_in','release','refund','compensate','reward','none'])['optional']()})['strict']()['optional'](),'commercialSemantics':z['string']()['min'](0x1),'unresolvableRef':z['string']()['optional'](),'disclosureProbe':z['string']()['optional'](),'guardKeyProbe':z['string']()['optional'](),'guardProbeKind':z['enum'](['safety','feature'])['optional'](),'gapPredicate':z['object']({'probe':z['string']()['optional']()})['strict']()['optional'](),'evidence':z['array'](z['object']({'file':z['string'](),'line':z['number']()['int']()['positive'](),'pattern':z['string']()}))})['strict']();export const OracleInvariantSchema=z['object']({'id':z['string']()['min'](0x1),'statement':z['string']()['min'](0x1),'jurisdiction':z['string']()['optional'](),'chainConflict':z['string']()['optional'](),'evidence':z['array'](z['object']({'file':z['string'](),'line':z['number']()['int']()['positive'](),'pattern':z['string']()}))['optional'](),'violation':z['object']({'requiresFeeParamNonZero':z['string']()['optional'](),'whileMissingForward':z['string']()['optional']()})['strict']()['optional']()})['strict']();export const ProductOracleSchema=z['object']({'productRef':z['string']()['min'](0x1),'products':z['array'](z['string']()['min'](0x1))['min'](0x1),'oracleVersion':z['string']()['min'](0x1),'steps':z['array'](OracleStepSchema)['min'](0x1),'invariants':z['array'](OracleInvariantSchema)})['strict']();
|