@wowok/agent-mcp 3.4.0 → 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/fund-flow.js +1 -1
- package/dist/chain-semantics/index.d.ts +1 -0
- package/dist/chain-semantics/index.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 +24 -3
- 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 +20 -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 +18 -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.js +1 -1
- 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 +7 -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/data/api/api.spec.js +1 -1
- package/dist/data/api/server.js +1 -1
- package/dist/data/projection/store.d.ts +2 -1
- package/dist/data/projection/store.js +1 -1
- package/dist/data/projection/types.d.ts +22 -0
- package/dist/data/sync/cdc.d.ts +1 -2
- package/dist/data/sync/cdc.js +1 -1
- 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/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/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/allocator-rail-verifier.d.ts +6 -1
- package/dist/knowledge/allocator-rail-verifier.js +1 -1
- package/dist/knowledge/arbitration-ledger.js +1 -1
- package/dist/knowledge/arbitration-puzzle.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/oracle.json +120 -0
- package/dist/knowledge/baselines/rules/plan.json +384 -17
- package/dist/knowledge/baselines/rules/progress.json +20 -2
- package/dist/knowledge/builtin-templates.d.ts +12 -1
- package/dist/knowledge/builtin-templates.js +1 -1
- package/dist/knowledge/component-schema.js +1 -1
- 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/fee-param-bindings.js +1 -1
- 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.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-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/jsonrpc-enum.d.ts +38 -0
- package/dist/knowledge/jsonrpc-enum.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 +2 -0
- package/dist/knowledge/onchain-constants.js +1 -1
- package/dist/knowledge/param-schema.d.ts +23 -0
- package/dist/knowledge/param-schema.js +1 -1
- package/dist/knowledge/param-tiers.js +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 +2 -0
- package/dist/knowledge/pattern-resolutions.js +1 -1
- 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/scenario-modes.d.ts +1 -0
- package/dist/knowledge/scenario-modes.js +1 -1
- package/dist/knowledge/semantic-ir.d.ts +4 -0
- package/dist/knowledge/semantic-ir.js +1 -1
- package/dist/knowledge/service-ledger.d.ts +1 -1
- package/dist/knowledge/service-ledger.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/supply-chain.d.ts +9 -0
- package/dist/knowledge/supply-chain.js +1 -1
- package/dist/knowledge/template-loader.d.ts +14 -6
- package/dist/knowledge/template-loader.js +1 -1
- package/dist/knowledge/template-nav.d.ts +3 -1
- package/dist/knowledge/template-nav.js +1 -1
- package/dist/knowledge/template-prose.d.ts +1 -1
- package/dist/knowledge/template-registry.js +1 -1
- package/dist/knowledge/template-scanner.d.ts +62 -0
- package/dist/knowledge/template-scanner.js +1 -1
- package/dist/knowledge/template-test-profiles.js +1 -1
- package/dist/knowledge/tools-reference.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.js +1 -1
- 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.js +1 -1
- package/dist/playbooks/service-build/merchant-guide.d.ts +50 -23
- 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.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 +1 -0
- package/dist/playbooks/service-build/service-panorama.js +1 -1
- package/dist/playbooks/service-build/service-quote.js +1 -1
- package/dist/playbooks/service-build/service-quote.spec.js +1 -1
- package/dist/playbooks/service-build/workflow-design-assessment.d.ts +10 -1
- package/dist/playbooks/service-build/workflow-design-assessment.js +1 -1
- package/dist/review/index.js +1 -1
- package/dist/review/repository.js +1 -1
- package/dist/safety/confirm-gate.js +1 -1
- package/dist/schema/benchmark-migration/index.d.ts +104 -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/base.d.ts +256 -0
- package/dist/schema/call/base.js +1 -1
- package/dist/schema/call/bridge.d.ts +32 -6
- package/dist/schema/call/demand.d.ts +15 -6
- package/dist/schema/call/demand.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 +128 -40
- 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 +216 -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 +115 -1
- package/dist/schema/goal/planning.js +1 -1
- package/dist/schema/industry-pack/index.d.ts +137 -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 +137 -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 +26 -0
- package/dist/schema/operations.d.ts +342 -83
- 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 +145 -4
- package/dist/schema/query/bi.js +1 -1
- package/dist/schema/query/index.d.ts +266 -73
- 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 +94 -0
- package/dist/schemas/benchmark_migration_operation.output.json +338 -9
- package/dist/schemas/benchmark_migration_operation.schema.json +26 -1
- package/dist/schemas/bridge_operation.output.json +94 -0
- 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 +570 -4
- package/dist/schemas/evaluation_operation.schema.json +194 -3
- package/dist/schemas/goal_operation.schema.json +183 -0
- package/dist/schemas/index.json +1 -1
- package/dist/schemas/industry_pack_operation.output.json +621 -0
- package/dist/schemas/industry_pack_operation.schema.json +20 -2
- package/dist/schemas/keeper_operation.output.json +94 -0
- package/dist/schemas/local_cache_operation.output.json +94 -0
- package/dist/schemas/local_history_operation.output.json +94 -0
- package/dist/schemas/local_info_operation.output.json +94 -0
- package/dist/schemas/local_mark_operation.output.json +94 -0
- package/dist/schemas/messenger_operation.output.json +94 -0
- package/dist/schemas/monitor_events.output.json +94 -0
- package/dist/schemas/monitor_subscription.output.json +94 -0
- package/dist/schemas/onchain_events.output.json +94 -0
- package/dist/schemas/onchain_operations.output.json +313 -1
- package/dist/schemas/onchain_operations.schema.json +1248 -664
- package/dist/schemas/onchain_operations_allocation.schema.json +30 -15
- package/dist/schemas/onchain_operations_arbitration.schema.json +9 -2
- package/dist/schemas/onchain_operations_contact.schema.json +8 -1
- package/dist/schemas/onchain_operations_demand.schema.json +29 -14
- package/dist/schemas/onchain_operations_gen_passport.schema.json +8 -1
- package/dist/schemas/onchain_operations_guard.schema.json +290 -105
- package/dist/schemas/onchain_operations_machine.schema.json +49 -34
- package/dist/schemas/onchain_operations_order.schema.json +63 -40
- package/dist/schemas/onchain_operations_payment.schema.json +26 -11
- package/dist/schemas/onchain_operations_permission.schema.json +362 -235
- package/dist/schemas/onchain_operations_personal.schema.json +27 -15
- package/dist/schemas/onchain_operations_progress.schema.json +45 -30
- package/dist/schemas/onchain_operations_proof.schema.json +8 -1
- package/dist/schemas/onchain_operations_repository.schema.json +8 -1
- package/dist/schemas/onchain_operations_reward.schema.json +32 -17
- package/dist/schemas/onchain_operations_service.schema.json +221 -124
- package/dist/schemas/onchain_operations_treasury.schema.json +32 -17
- package/dist/schemas/onchain_table_data.output.json +258 -6
- package/dist/schemas/onchain_table_data.schema.json +92 -52
- 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 +756 -116
- package/dist/schemas/query_toolkit.schema.json +138 -7
- package/dist/schemas/schema_query.schema.json +1 -1
- package/dist/schemas/watch_operation.output.json +83 -0
- package/dist/schemas/wip_file.output.json +8 -0
- package/dist/schemas/workflow_operation.schema.json +2 -2
- package/dist/tools/handlers/benchmark-migration.d.ts +11 -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/onchain.d.ts +20 -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/query.js +1 -1
- package/dist/tools/transport-integrity.d.ts +7 -0
- package/dist/tools/transport-integrity.js +1 -0
- package/dist/tools/upgrade-check.js +1 -1
- package/dist/tools/wrap.d.ts +5 -0
- package/dist/tools/wrap.js +1 -1
- package/package.json +2 -2
- 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
|
@@ -1 +1 @@
|
|
|
1
|
-
import{describe,it,expect,vi,beforeEach}from'vitest';const {sdkMocks}=vi['hoisted'](()=>({'sdkMocks':{'network_get':vi['fn'](),'localMarkList':vi['fn'](),'query_objects':vi['fn'](),'query_serviceContext':vi['fn'](),'resolveAddress':vi['fn']()}}));vi['mock']('@wowok/wowok',async a=>{const b=await a();return{...b,'Config':{'Instance':()=>({'network_get':sdkMocks['network_get']})},'LocalMark':{'Instance':()=>({'list':sdkMocks['localMarkList']})},'query_objects':sdkMocks['query_objects'],'query_serviceContext':sdkMocks['query_serviceContext']};}),vi['mock']('../../tools/handlers/name-resolution.js',()=>({'resolveAddress':sdkMocks['resolveAddress']})),vi['mock']('./facet-money.js',()=>({'formatMoneyAnnotation':async a=>({'display':a})}));import{handleServiceQuote}from'./service-quote.js';const SVC='0x'+'1'['repeat'](0x40),COUPON='0x'+'2'['repeat'](0x40),OTHER_SVC='0x'+'3'['repeat'](0x40),BUYER='0x'+'b'['repeat'](0x40),FLEXIBLE='Flexible\x20—\x20canal\x20view\x20double',LIST_TOTAL=0x35a4e900n;function makeCoupon(a={}){const b=Date['now']();return{'object':COUPON,'name':'bk3t-promo15','discount_type':0x0,'off':0x5dc,'benchmark':null,'time_start':b-0x5265c00,'time_end':b+0x5265c00,'service':SVC,'transferable':![],'owner':{'AddressOwner':BUYER},...a};}function quoteInput(a={}){return{'query_type':'service_quote','service_address':'bk3t-canal-stay','items':[{'name':FLEXIBLE,'quantity':0x1}],'context_network':'mainnet',...a};}beforeEach(()=>{vi['clearAllMocks'](),sdkMocks['network_get']['mockResolvedValue']('mainnet'),sdkMocks['localMarkList']['mockResolvedValue']([{'name':'bk3t-canal-stay'}]),sdkMocks['query_serviceContext']['mockResolvedValue']({'service':{'type_raw':'Service<0x2::wow::WOW>','sales':[{'name':FLEXIBLE,'price':{'balance':LIST_TOTAL['toString']()},'suspension':![]}]}}),sdkMocks['resolveAddress']['mockImplementation'](async a=>{if(a==='bk3t-canal-stay')return SVC;if(a==='bk3t-promo15'||a===COUPON)return COUPON;throw new Error('unresolvable:\x20'+a);}),sdkMocks['query_objects']['mockResolvedValue']({'objects':[makeCoupon()]});}),describe('service_quote\x20discount\x20pricing\x20(F-10)',()=>{it('no\x20discount\x20requested\x20→\x20undiscounted\x20total,\x20discount\x20block\x20null\x20(pre-fix\x20behavior\x20preserved)',async()=>{const a=await handleServiceQuote(quoteInput());expect(a['discount'])['toBeNull'](),expect(a['total_pay']['balance'])['toBe'](LIST_TOTAL['toString']());}),it('RATES\x20coupon\x20applies\x20with\x20integer\x20floor\x20division\x20—\x20reproduces\x20the\x20live\x20order\x20C\x20number',async()=>{const a=await handleServiceQuote(quoteInput({'discount':'bk3t-promo15'}));expect(a['discount'])['not']['toBeNull'](),expect(a['discount']['type'])['toBe']('rates'),expect(a['discount']['applied'])['toBe'](!![]),expect(a['discount']['list_total'])['toBe']('900000000'),expect(a['discount']['final_total'])['toBe']('765000000'),expect(a['total_pay']['balance'])['toBe']('765000000'),expect(a['total_pay']['note'])['toContain']('FLOOR\x20semantics'),expect(a['discount']['owned_by'])['toBe'](BUYER),expect(a['discount']['ownership_note'])['toContain']('owned\x20by\x20'+BUYER),expect(a['discount']['ownership_note'])['toContain']('only\x20the\x20holder\x20can\x20redeem'),expect(a['discount']['ownership_note'])['toContain']('cannot\x20be\x20applied\x20to\x20your\x20order'),expect(a['discount']['ownership_note'])['toContain']('Refunds\x20settle\x20the\x20post-coupon\x20amount\x20only');}),it('MINUS\x20coupon\x20subtracts\x20a\x20fixed\x20amount\x20and\x20clamps\x20at\x20zero',async()=>{sdkMocks['query_objects']['mockResolvedValue']({'objects':[makeCoupon({'discount_type':0x1,'off':0x5f5e100})]});const a=await handleServiceQuote(quoteInput({'discount':COUPON}));expect(a['discount']['type'])['toBe']('minus'),expect(a['discount']['final_total'])['toBe']('800000000'),sdkMocks['query_objects']['mockResolvedValue']({'objects':[makeCoupon({'discount_type':0x1,'off':0x77359400})]});const b=await handleServiceQuote(quoteInput({'discount':COUPON}));expect(b['discount']['final_total'])['toBe']('0'),expect(b['discount']['note'])['toContain']('DEAD\x20BASKET'),expect(b['discount']['note'])['toContain']('REFUSES\x20zero-total'),expect(b['discount']['note'])['toContain']('allow_zero_total'),expect(b['discount']['note'])['toContain']('NOT\x20unlock\x20this\x20buy'),sdkMocks['query_objects']['mockResolvedValue']({'objects':[makeCoupon({'discount_type':0x1,'off':0x5f5e100})]});const c=await handleServiceQuote(quoteInput({'discount':COUPON}));expect(c['discount']['note'])['toContain']('Discounted\x20total\x20shown\x20—\x20order_new.buy.total_pay.balance\x20must\x20be\x20>=\x20this\x20final_total'),expect(c['discount']['note'])['toContain']('BURN-ON-USE'),expect(c['discount']['note'])['toContain']('CANCELLATION\x20REFUNDS\x20THE\x20DISCOUNTED\x20AMOUNT\x20ONLY');}),it('unmet\x20benchmark\x20→\x20applied:false\x20+\x20attach\x20warning,\x20total\x20stays\x20at\x20list\x20price\x20(NOT\x20thrown)',async()=>{sdkMocks['query_objects']['mockResolvedValue']({'objects':[makeCoupon({'benchmark':(LIST_TOTAL+0x1n)['toString']()})]});const a=await handleServiceQuote(quoteInput({'discount':COUPON}));expect(a['discount']['applied'])['toBe'](![]),expect(a['discount']['benchmark_met'])['toBe'](![]),expect(a['total_pay']['balance'])['toBe'](LIST_TOTAL['toString']()),expect(a['discount']['note'])['toContain']('REJECTS'),expect(a['discount']['note'])['toContain']('coupon\x20preserved');}),it('benchmark\x20exactly\x20met\x20→\x20applies\x20(chain\x20uses\x20>=)',async()=>{sdkMocks['query_objects']['mockResolvedValue']({'objects':[makeCoupon({'benchmark':LIST_TOTAL['toString']()})]});const a=await handleServiceQuote(quoteInput({'discount':COUPON}));expect(a['discount']['applied'])['toBe'](!![]),expect(a['discount']['final_total'])['toBe']('765000000');}),it('benchmark\x20None\x20always\x20applies\x20(corrected\x20old\x20docs\x20claim)',async()=>{const a=await handleServiceQuote(quoteInput({'discount':COUPON}));expect(a['discount']['benchmark'])['toBeNull'](),expect(a['discount']['applied'])['toBe'](!![]);}),it('coupon\x20bound\x20to\x20another\x20service\x20→\x20rejected\x20like\x20the\x20chain\x20abort\x20(E_SERVICE_DISCOUNT_NOT_MATCH)',async()=>{sdkMocks['query_objects']['mockResolvedValue']({'objects':[makeCoupon({'service':OTHER_SVC})]}),await expect(handleServiceQuote(quoteInput({'discount':COUPON})))['rejects']['toThrow'](/E_SERVICE_DISCOUNT_NOT_MATCH/);}),it('coupon\x20outside\x20its\x20time\x20window\x20→\x20rejected\x20like\x20the\x20chain\x20abort\x20(E_DISCOUNT_TIME_INVALID)',async()=>{const a=Date['now']();sdkMocks['query_objects']['mockResolvedValue']({'objects':[makeCoupon({'time_start':a+0x3e8,'time_end':a+0x186a0})]}),await expect(handleServiceQuote(quoteInput({'discount':COUPON})))['rejects']['toThrow'](/E_DISCOUNT_TIME_INVALID/);}),it('KB-02\x20attribution:\x20owner\x20unwraps\x20from\x20the\x20ObjectOwner\x20enum\x20shapes\x20and\x20stays\x20fail-soft\x20when\x20unreadable',async()=>{sdkMocks['query_objects']['mockResolvedValue']({'objects':[makeCoupon({'owner':{'ObjectOwner':BUYER}})]});const a=await handleServiceQuote(quoteInput({'discount':COUPON}));expect(a['discount']['owned_by'])['toBe'](BUYER),sdkMocks['query_objects']['mockResolvedValue']({'objects':[makeCoupon({'owner':BUYER})]});const b=await handleServiceQuote(quoteInput({'discount':COUPON}));expect(b['discount']['owned_by'])['toBe'](BUYER),sdkMocks['query_objects']['mockResolvedValue']({'objects':[makeCoupon({'owner':undefined})]});const c=await handleServiceQuote(quoteInput({'discount':COUPON}));expect(c['discount']['owned_by'])['toBeNull'](),expect(c['discount']['ownership_note'])['toContain']('could\x20not\x20be\x20read'),expect(c['discount']['ownership_note'])['toContain']('only\x20the\x20holder\x20can\x20redeem'),expect(c['discount']['ownership_note'])['toContain']('have\x20the\x20owner\x20transfer\x20it\x20first');}),it('unknown\x20coupon\x20object\x20→\x20clear\x20rejection,\x20never\x20a\x20silent\x20full-price\x20quote',async()=>{sdkMocks['query_objects']['mockResolvedValue']({'objects':[]}),await expect(handleServiceQuote(quoteInput({'discount':COUPON})))['rejects']['toThrow'](/not found/);}),it('paused\x20service\x20(bs29\x20R-16)\x20→\x20paused:true\x20+\x20PAUSED\x20warning\x20on\x20the\x20total_pay\x20note',async()=>{sdkMocks['query_serviceContext']['mockResolvedValue']({'service':{'type_raw':'Service<0x2::wow::WOW>','paused':!![],'sales':[{'name':FLEXIBLE,'price':{'balance':LIST_TOTAL['toString']()},'suspension':![]}]}});const a=await handleServiceQuote(quoteInput());expect(a['paused'])['toBe'](!![]),expect(a['total_pay']['note'])['toContain']('SERVICE\x20PAUSED'),expect(a['total_pay']['note'])['toContain']('pause:false'),expect(a['total_pay']['balance'])['toBe'](LIST_TOTAL['toString']()),sdkMocks['query_serviceContext']['mockResolvedValue']({'service':{'type_raw':'Service<0x2::wow::WOW>','bPaused':!![],'sales':[{'name':FLEXIBLE,'price':{'balance':LIST_TOTAL['toString']()},'suspension':![]}]}});const b=await handleServiceQuote(quoteInput());expect(b['paused'])['toBe'](!![]);});});const REWARD='0x'+'4'['repeat'](0x40),CLAIM_GUARD='0x'+'5'['repeat'](0x40);function makeReward(a={}){return{'object':REWARD,'description':'5-star\x20review\x20reward','balance':'500000000','record_count':0x3,'guards':[{'guard':CLAIM_GUARD,'amount':{'type':0x1,'value':'100000000'},'expiration_time':Date['now']()+0x5265c00}],...a};}function svcWithRewards(...a){sdkMocks['query_serviceContext']['mockResolvedValue']({'service':{'type_raw':'Service<0x2::wow::WOW>','sales':[{'name':FLEXIBLE,'price':{'balance':LIST_TOTAL['toString']()},'suspension':![]}],'rewards':a}});}describe('service_quote\x20reward\x20terms\x20(review\x20component\x20b2-5)',()=>{it('no\x20rewards\x20on\x20the\x20Service\x20→\x20reward_terms\x20null',async()=>{const a=await handleServiceQuote(quoteInput());expect(a['reward_terms'])['toBeNull']();}),it('fixed\x20amount\x20+\x20live\x20window\x20→\x20terms\x20with\x20coverage\x20estimate,\x20expired:false,\x20no\x20gaps',async()=>{svcWithRewards(REWARD),sdkMocks['query_objects']['mockResolvedValue']({'objects':[makeReward()]});const a=await handleServiceQuote(quoteInput());expect(a['reward_terms'])['not']['toBeNull']();const b=a['reward_terms']['rewards'][0x0];expect(b['reward'])['toBe'](REWARD),expect(b['description'])['toBe']('5-star\x20review\x20reward'),expect(b['pool_balance'])['toBe']('500000000'),expect(b['record_count'])['toBe'](0x3),expect(b['claims'][0x0]['guard'])['toBe'](CLAIM_GUARD),expect(b['claims'][0x0]['amount_type'])['toBe']('fixed'),expect(b['claims'][0x0]['amount'])['toBe']('100000000'),expect(b['claims'][0x0]['expired'])['toBe'](![]),expect(b['coverage'])['toMatch'](/~5 further claim/),expect(a['reward_terms']['data_gaps'])['toEqual']([]),expect(a['total_pay']['balance'])['toBe'](LIST_TOTAL['toString']());}),it('empty\x20pool\x20→\x20EMPTY\x20coverage\x20warning;\x20expired\x20window\x20→\x20expired:true',async()=>{svcWithRewards(REWARD),sdkMocks['query_objects']['mockResolvedValue']({'objects':[makeReward({'balance':'0','guards':[{'guard':CLAIM_GUARD,'amount':{'type':0x1,'value':'100000000'},'expiration_time':Date['now']()-0x3e8}]})]});const a=await handleServiceQuote(quoteInput()),b=a['reward_terms']['rewards'][0x0];expect(b['claims'][0x0]['expired'])['toBe'](!![]),expect(b['coverage'])['toContain']('EMPTY'),expect(b['coverage'])['toContain']('E_INSUFFICIENT_BALANCE');}),it('guard_submission\x20amount\x20→\x20coverage\x20null\x20(guard-decided),\x20amount\x20carries\x20the\x20submission\x20identifier',async()=>{svcWithRewards(REWARD),sdkMocks['query_objects']['mockResolvedValue']({'objects':[makeReward({'guards':[{'guard':CLAIM_GUARD,'amount':{'type':0x0,'value':0x7}}]})]});const a=await handleServiceQuote(quoteInput()),b=a['reward_terms']['rewards'][0x0];expect(b['claims'][0x0]['amount_type'])['toBe']('guard_submission'),expect(b['claims'][0x0]['amount'])['toContain']('7'),expect(b['claims'][0x0]['amount_display'])['toBeNull'](),expect(b['coverage'])['toBeNull']();}),it('no\x20window\x20set\x20→\x20expiration\x20null\x20and\x20expired\x20null\x20(claimable\x20until\x20guard\x20removal)',async()=>{svcWithRewards(REWARD),sdkMocks['query_objects']['mockResolvedValue']({'objects':[makeReward({'guards':[{'guard':CLAIM_GUARD,'amount':{'type':0x1,'value':'100000000'}}]})]});const a=await handleServiceQuote(quoteInput()),b=a['reward_terms']['rewards'][0x0]['claims'][0x0];expect(b['expiration_time'])['toBeNull'](),expect(b['expiration_display'])['toBeNull'](),expect(b['expired'])['toBeNull'](),expect(b['claim_window'])['toBeNull'](),expect(b['claim_state'])['toBe']('unknown');}),it('R-09\x20claim\x20window\x20decodes\x20from\x20the\x20guard\x27s\x20Clock\x20comparison\x20(order.time\x20+\x20600s\x20upper)',async()=>{svcWithRewards(REWARD);const a={'object':CLAIM_GUARD,'root':[{'type':'logic_as_u256_lesser_or_equal','nodes':[{'type':'context','context':'Clock'},{'type':'calc_number_add','nodes':[{'type':'query','query':'order.time'},{'type':'identifier','identifier':'600000'}]}]}],'table':[{'identifier':'600000','b_submission':![],'value':0x927c0}]};sdkMocks['query_objects']['mockResolvedValueOnce']({'objects':[makeReward()]})['mockResolvedValueOnce']({'objects':[a]});const b=await handleServiceQuote(quoteInput()),d=b['reward_terms']['rewards'][0x0]['claims'][0x0];expect(d['claim_window'])['toEqual']({'opens_after_s':null,'closes_after_s':0x258,'anchor':'order.time'}),expect(d['min_rating'])['toBeNull'](),expect(d['claim_state'])['toBe']('open_window'),expect(d['claim_state_note'])['toContain']('Claimable\x20at\x20the\x20anchor\x20event'),expect(b['reward_terms']['data_gaps'])['toEqual']([]);}),it('bsw4\x20F-11\x20claim_state:\x20opens\x2014d\x20+\x20a\x20further\x2014d\x20span\x20→\x20delayed_window\x20with\x20buyer-language\x20note',async()=>{svcWithRewards(REWARD);const a={'object':CLAIM_GUARD,'root':[{'type':'logic_as_u256_greater_or_equal','nodes':[{'type':'context','context':'Clock'},{'type':'calc_number_add','nodes':[{'type':'query_progress_history_time'},{'type':'calc_number_multiply','nodes':[{'type':'identifier','identifier':'5'},{'type':'identifier','identifier':'13'}]}]}]},{'type':'logic_as_u256_lesser_or_equal','nodes':[{'type':'context','context':'Clock'},{'type':'calc_number_add','nodes':[{'type':'query_progress_history_time'},{'type':'calc_number_multiply','nodes':[{'type':'identifier','identifier':'5'},{'type':'identifier','identifier':'13'}]},{'type':'calc_number_multiply','nodes':[{'type':'identifier','identifier':'12'},{'type':'identifier','identifier':'13'}]}]}]}],'table':[{'identifier':'5','b_submission':![],'value':0xe},{'identifier':'12','b_submission':![],'value':0xe},{'identifier':'13','b_submission':![],'value':0x5265c00}]};sdkMocks['query_objects']['mockResolvedValueOnce']({'objects':[makeReward()]})['mockResolvedValueOnce']({'objects':[a]});const b=await handleServiceQuote(quoteInput()),d=b['reward_terms']['rewards'][0x0]['claims'][0x0];expect(d['claim_window'])['toEqual']({'opens_after_s':0x127500,'closes_after_s':0x24ea00,'anchor':'progress.history.time'}),expect(d['claim_state'])['toBe']('delayed_window'),expect(d['claim_state_note'])['toContain']('Opens\x2014\x20day(s)'),expect(d['claim_state_note'])['toContain']('a\x20further\x2014\x20day(s)'),expect(d['claim_state_note'])['toContain']('hard\x20deadline\x2028\x20day(s)');}),it('bsw4\x20F-11\x20claim_state:\x20opens-only\x20guard\x20(v76\x20archetype)\x20→\x20delayed_open_ended,\x20NEVER-closes\x20disclosed',async()=>{svcWithRewards(REWARD);const a={'object':CLAIM_GUARD,'root':[{'type':'logic_as_u256_greater_or_equal','nodes':[{'type':'context','context':'Clock'},{'type':'calc_number_add','nodes':[{'type':'query_progress_history_time'},{'type':'identifier','identifier':'5'}]}]}],'table':[{'identifier':'5','b_submission':![],'value':0x48190800}]};sdkMocks['query_objects']['mockResolvedValueOnce']({'objects':[makeReward()]})['mockResolvedValueOnce']({'objects':[a]});const b=await handleServiceQuote(quoteInput()),d=b['reward_terms']['rewards'][0x0]['claims'][0x0];expect(d['claim_state'])['toBe']('delayed_open_ended'),expect(d['claim_state_note'])['toContain']('NEVER\x20closes'),expect(d['claim_state_note'])['toContain']('bsw4\x20F-11');}),it('unreadable\x20reward\x20object\x20→\x20data_gaps\x20note,\x20quote\x20still\x20succeeds\x20(fail-soft)',async()=>{svcWithRewards(REWARD),sdkMocks['query_objects']['mockResolvedValue']({'objects':[]});const a=await handleServiceQuote(quoteInput());expect(a['reward_terms'])['not']['toBeNull'](),expect(a['reward_terms']['rewards'])['toEqual']([]),expect(a['reward_terms']['data_gaps'][0x0])['toContain'](REWARD),expect(a['total_pay']['balance'])['toBe'](LIST_TOTAL['toString']());}),it('reward\x20lookup\x20throws\x20→\x20whole\x20lookup\x20degrades\x20to\x20one\x20gap\x20note,\x20never\x20thrown',async()=>{svcWithRewards(REWARD),sdkMocks['query_objects']['mockRejectedValue'](new Error('rpc\x20down'));const a=await handleServiceQuote(quoteInput());expect(a['reward_terms']['rewards'])['toEqual']([]),expect(a['reward_terms']['data_gaps'][0x0])['toContain']('rpc\x20down'),expect(a['total_pay']['balance'])['toBe'](LIST_TOTAL['toString']());}),it('unstamped\x20claim\x20guard\x20→\x20replay_scope\x20once_per_recipient_guard\x20with\x20abort\x2013\x20+\x20254\x20note',async()=>{svcWithRewards(REWARD),sdkMocks['query_objects']['mockResolvedValue']({'objects':[makeReward()]});const a=await handleServiceQuote(quoteInput()),b=a['reward_terms']['rewards'][0x0]['replay_scope'];expect(b['scope'])['toBe']('once_per_recipient_guard'),expect(b['detail'])['toContain']('for\x20LIFE'),expect(b['detail'])['toContain']('abort\x2013'),expect(b['detail'])['toContain']('E_CLAIM_ALREADY_MADE'),expect(b['per_order_note'])['toContain']('254'),expect(b['per_order_note'])['toContain']('store_from_id');}),it('store_from_id=0\x20→\x20replay_scope\x20once_per_order',async()=>{svcWithRewards(REWARD),sdkMocks['query_objects']['mockResolvedValue']({'objects':[makeReward({'guards':[{'guard':CLAIM_GUARD,'amount':{'type':0x1,'value':'100000000'},'store_from_id':0x0}]})]});const a=await handleServiceQuote(quoteInput()),b=a['reward_terms']['rewards'][0x0]['replay_scope'];expect(b['scope'])['toBe']('once_per_order'),expect(b['detail'])['toContain']('per\x20(recipient,\x20guard,\x20order)');}),it('stamp\x20on\x20a\x20non-Order\x20slot\x20→\x20replay_scope\x20once_per_stamp\x20(no\x20overclaim)',async()=>{svcWithRewards(REWARD),sdkMocks['query_objects']['mockResolvedValue']({'objects':[makeReward({'guards':[{'guard':CLAIM_GUARD,'amount':{'type':0x1,'value':'100000000'},'store_from_id':0x2}]})]});const a=await handleServiceQuote(quoteInput()),b=a['reward_terms']['rewards'][0x0]['replay_scope'];expect(b['scope'])['toBe']('once_per_stamp'),expect(b['detail'])['toContain']('slots:\x202'),expect(b['detail'])['toContain']('per-ORDER\x20only\x20when');}),it('mixed\x20stamped/unstamped\x20guards\x20→\x20replay_scope\x20mixed;\x20no\x20guards\x20→\x20unknown',async()=>{svcWithRewards(REWARD),sdkMocks['query_objects']['mockResolvedValue']({'objects':[makeReward({'guards':[{'guard':CLAIM_GUARD,'amount':{'type':0x1,'value':'1'},'store_from_id':0x0},{'guard':'0x'+'6'['repeat'](0x40),'amount':{'type':0x1,'value':'1'}}]})]});const a=await handleServiceQuote(quoteInput());expect(a['reward_terms']['rewards'][0x0]['replay_scope']['scope'])['toBe']('mixed'),expect(a['reward_terms']['rewards'][0x0]['replay_scope']['detail'])['toContain']('1\x20of\x202'),sdkMocks['query_objects']['mockResolvedValue']({'objects':[makeReward({'guards':[]})]});const b=await handleServiceQuote(quoteInput());expect(b['reward_terms']['rewards'][0x0]['replay_scope']['scope'])['toBe']('unknown');});});function ratingFloorGuard(a={}){return{'object':CLAIM_GUARD,'root':{'type':'logic_and','nodes':[{'type':'logic_as_u256_greater_or_equal','nodes':[{'type':'query','query':'repository.data.rating'},{'type':'identifier','identifier':'4'}]}]},'table':[{'identifier':0x4,'b_submission':![],'value':0x4}],...a};}function mockRewardThenGuard(a){sdkMocks['query_objects']['mockResolvedValueOnce']({'objects':[makeReward()]})['mockResolvedValueOnce']({'objects':[a]});}describe('service_quote\x20min_rating\x20signal\x20detection\x20(R2-02)',()=>{it('UTF-8\x20byte-array\x20rating\x20key\x20→\x20the\x20floor\x20decodes\x20(NOT\x20null)',async()=>{svcWithRewards(REWARD),mockRewardThenGuard(ratingFloorGuard({'rating_key':[0x72,0x61,0x74,0x69,0x6e,0x67]}));const a=await handleServiceQuote(quoteInput()),b=a['reward_terms']['rewards'][0x0]['claims'][0x0];expect(b['min_rating'])['toBe']('>=\x204'),expect(a['reward_terms']['data_gaps'])['toEqual']([]);}),it('hex-encoded\x20rating\x20key\x20→\x20the\x20floor\x20decodes\x20(NOT\x20null)',async()=>{svcWithRewards(REWARD),mockRewardThenGuard(ratingFloorGuard({'rating_key_hex':'726174696e67'}));const a=await handleServiceQuote(quoteInput());expect(a['reward_terms']['rewards'][0x0]['claims'][0x0]['min_rating'])['toBe']('>=\x204');}),it('base64-encoded\x20rating\x20key\x20→\x20the\x20floor\x20decodes\x20(NOT\x20null)',async()=>{svcWithRewards(REWARD),mockRewardThenGuard(ratingFloorGuard({'rating_key_b64':'cmF0aW5n'}));const a=await handleServiceQuote(quoteInput());expect(a['reward_terms']['rewards'][0x0]['claims'][0x0]['min_rating'])['toBe']('>=\x204');}),it('ddmc2\x20F-09:\x20AGGREGATE\x20gate\x20count_where(rating\x20>=\x204)\x20>=\x201\x20decodes\x20the\x20INNER\x20floor\x20(>=\x204),\x20the\x20OUTER\x20row\x20count\x20rides\x20min_rows',async()=>{svcWithRewards(REWARD),mockRewardThenGuard({'object':CLAIM_GUARD,'root':{'type':'logic_and','nodes':[{'type':'logic_as_u256_greater_or_equal','nodes':[{'type':'query','query':'query_repository_data_count_where','object':{'identifier':0x0},'key':{'identifier':0x2},'where':{'kind':'gte','value':'4'}},{'type':'identifier','identifier':0x1}]}]},'table':[{'identifier':0x0,'b_submission':![],'value_type':'Address'},{'identifier':0x1,'b_submission':![],'value':0x1},{'identifier':0x2,'b_submission':![],'value_type':'String','value':'rating'}]});const a=await handleServiceQuote(quoteInput()),b=a['reward_terms']['rewards'][0x0]['claims'][0x0];expect(b['min_rating'])['toBe']('>=\x204'),expect(b['min_rows'])['toBe'](0x1);}),it('ddmc2\x20F-09\x20twin:\x20a\x20NON-numeric\x20aggregate\x20where\x20(addressEq\x20referral\x20count)\x20is\x20NOT\x20a\x20rating\x20floor\x20—\x20min_rating\x20unknown,\x20min_rows\x20still\x20surfaced',async()=>{svcWithRewards(REWARD),mockRewardThenGuard({'object':CLAIM_GUARD,'root':{'type':'logic_and','nodes':[{'type':'logic_as_u256_greater_or_equal','nodes':[{'type':'query','query':'query_repository_data_count_where','object':{'identifier':0x0},'key':{'identifier':0x2},'where':{'kind':'addressEq','identifier':0x3}},{'type':'identifier','identifier':0x1}]}]},'table':[{'identifier':0x0,'b_submission':![],'value_type':'Address'},{'identifier':0x1,'b_submission':![],'value':0x3},{'identifier':0x2,'b_submission':![],'value_type':'String','value':'rating'},{'identifier':0x3,'b_submission':![],'value_type':'Address'}]});const a=await handleServiceQuote(quoteInput()),b=a['reward_terms']['rewards'][0x0]['claims'][0x0];expect(b['min_rating'])['toBe']('unknown'),expect(b['min_rows'])['toBe'](0x3);}),it('no\x20rating\x20signal\x20at\x20all\x20→\x20min_rating\x20stays\x20null\x20(unconditional,\x20NOT\x20unknown)',async()=>{svcWithRewards(REWARD),mockRewardThenGuard(ratingFloorGuard());const a=await handleServiceQuote(quoteInput()),b=a['reward_terms']['rewards'][0x0]['claims'][0x0];expect(b['min_rating'])['toBeNull'](),expect(a['reward_terms']['data_gaps'])['toEqual']([]);}),it('rating\x20signal\x20present\x20but\x20the\x20structure\x20is\x20not\x20a\x20decodable\x20floor\x20→\x20unknown\x20+\x20data_gaps\x20disclosure',async()=>{svcWithRewards(REWARD),mockRewardThenGuard({'object':CLAIM_GUARD,'root':{'type':'logic_and','nodes':[{'type':'logic_equal','nodes':[{'type':'query','query':'repository.data.rating'},{'type':'identifier','identifier':'4'}]}]},'table':[{'identifier':0x4,'b_submission':![],'value':0x4}],'rating_key':[0x72,0x61,0x74,0x69,0x6e,0x67]});const a=await handleServiceQuote(quoteInput()),b=a['reward_terms']['rewards'][0x0]['claims'][0x0];expect(b['min_rating'])['toBe']('unknown'),expect(a['reward_terms']['data_gaps']['some'](d=>d['includes']('min_rating=unknown')))['toBe'](!![]);});}),describe('service_quote\x20stock\x20disclosure\x20(S4-03\x20/\x20F-20)',()=>{function a(b,c=![]){sdkMocks['query_serviceContext']['mockResolvedValue']({'service':{'type_raw':'Service<0x2::wow::WOW>','sales':[{'name':FLEXIBLE,'price':{'balance':LIST_TOTAL['toString']()},'suspension':c,'stock':b}]}});}it('stock\x20below\x20quantity\x20→\x20stock_ok:false\x20+\x20STOCK\x20SHORT\x20warning\x20(the\x20buy\x20WILL\x20abort)',async()=>{a({'balance':'2'});const b=await handleServiceQuote(quoteInput({'items':[{'name':FLEXIBLE,'quantity':0x3}]}));expect(b['items'][0x0]['stock'])['toBe']('2'),expect(b['items'][0x0]['stock_ok'])['toBe'](![]),expect(b['total_pay']['note'])['toContain']('STOCK\x20SHORT'),expect(b['total_pay']['note'])['toContain']('E_STOCK_NOT_ENOUGH'),expect(b['total_pay']['note'])['toContain']('asked\x203,\x20stock\x202'),expect(b['total_pay']['balance'])['toBe']((LIST_TOTAL*0x3n)['toString']());}),it('stock\x20at/above\x20quantity\x20→\x20stock_ok:true,\x20no\x20false\x20alarm\x20on\x20the\x20note',async()=>{a({'balance':'10'});const b=await handleServiceQuote(quoteInput());expect(b['items'][0x0]['stock'])['toBe']('10'),expect(b['items'][0x0]['stock_ok'])['toBe'](!![]),expect(b['total_pay']['note'])['not']['toContain']('STOCK\x20SHORT');}),it('plain-number\x20stock\x20(unwrapped\x20transport)\x20decodes\x20the\x20same',async()=>{a('0');const b=await handleServiceQuote(quoteInput());expect(b['items'][0x0]['stock'])['toBe']('0'),expect(b['items'][0x0]['stock_ok'])['toBe'](![]),expect(b['total_pay']['note'])['toContain']('STOCK\x20SHORT');}),it('unreadable\x20stock\x20→\x20null/null\x20(honest\x20gap,\x20never\x20a\x20fabricated\x20ok\x20or\x20a\x20false\x20alarm)',async()=>{a(undefined);const b=await handleServiceQuote(quoteInput());expect(b['items'][0x0]['stock'])['toBeNull'](),expect(b['items'][0x0]['stock_ok'])['toBeNull'](),expect(b['total_pay']['note'])['not']['toContain']('STOCK\x20SHORT');});});function svcWithFund(a){sdkMocks['query_serviceContext']['mockResolvedValue']({'service':{'type_raw':'Service<0x2::wow::WOW>','sales':[{'name':FLEXIBLE,'price':{'balance':LIST_TOTAL['toString']()},'suspension':![]}],'compensation_fund':a}});}describe('service_quote\x20compensation_fund_coverage\x20(b6-11)',()=>{it('no\x20fund\x20→\x20covered:false\x20with\x20the\x20no-protection\x20disclosure\x20(never\x20blocked)',async()=>{const a=await handleServiceQuote(quoteInput());expect(a['compensation_fund_coverage'])['not']['toBeNull'](),expect(a['compensation_fund_coverage']['fund_balance'])['toBe']('0'),expect(a['compensation_fund_coverage']['required_for_this_basket'])['toBe']('2700000000'),expect(a['compensation_fund_coverage']['covered'])['toBe'](![]),expect(a['compensation_fund_coverage']['note'])['toContain']('WITHOUT\x20a\x20compensation\x20fund'),expect(a['compensation_fund_coverage']['note'])['toContain']('never\x20blocked');}),it('fund\x20at/over\x203x\x20the\x20basket\x20→\x20covered:true',async()=>{svcWithFund('2700000000');const a=await handleServiceQuote(quoteInput());expect(a['compensation_fund_coverage']['covered'])['toBe'](!![]),expect(a['compensation_fund_coverage']['note'])['toContain']('payable\x20from\x20the\x20pool');}),it('fund\x20short\x20→\x20covered:false\x20and\x20the\x20note\x20names\x20the\x20warning\x20+\x20error\x20code\x20anchor',async()=>{svcWithFund('100000000');const a=await handleServiceQuote(quoteInput());expect(a['compensation_fund_coverage']['covered'])['toBe'](![]),expect(a['compensation_fund_coverage']['note'])['toContain']('PROCEEDS\x20with\x20a\x20warning'),expect(a['compensation_fund_coverage']['note'])['toContain']('compensation_fund_below_order_ceiling'),expect(a['compensation_fund_coverage']['note'])['toContain']('compensation_fund_add');}),it('shortfall\x20states\x20the\x20exact\x20top-up\x20(required\x20-\x20fund;\x20etsy-gf\x20R1:\x20no\x20reader\x20subtraction)',async()=>{svcWithFund('1000000000');const a=await handleServiceQuote(quoteInput());expect(a['compensation_fund_coverage']['shortfall'])['toBe']('1700000000'),expect(a['compensation_fund_coverage']['note'])['toContain']('by'),svcWithFund('2700000000');const b=await handleServiceQuote(quoteInput());expect(b['compensation_fund_coverage']['shortfall'])['toBe']('0'),svcWithFund('0');const c=await handleServiceQuote(quoteInput());expect(c['compensation_fund_coverage']['shortfall'])['toBe']('2700000000');}),it('F-OF2-06:\x20max_coverable_order\x20names\x20the\x20storefront\x20price\x20cap\x20(fund/3)\x20in\x20every\x20fund\x20state',async()=>{const a=await handleServiceQuote(quoteInput());expect(a['compensation_fund_coverage']['max_coverable_order'])['toBe']('0'),svcWithFund('2700000000');const b=await handleServiceQuote(quoteInput());expect(b['compensation_fund_coverage']['max_coverable_order'])['toBe']('900000000'),expect(b['compensation_fund_coverage']['note'])['toContain']('ceiling'),svcWithFund('1000000000');const c=await handleServiceQuote(quoteInput());expect(c['compensation_fund_coverage']['max_coverable_order'])['toBe']('333333333'),expect(c['compensation_fund_coverage']['note'])['toContain']('orders\x20above');}),it('required\x20base\x20is\x20the\x20DISCOUNTED\x20total\x20(what\x20the\x20order\x20actually\x20pays)',async()=>{svcWithFund('2295000000');const a=await handleServiceQuote(quoteInput({'discount':'bk3t-promo15'}));expect(a['total_pay']['balance'])['toBe']('765000000'),expect(a['compensation_fund_coverage']['required_for_this_basket'])['toBe']('2295000000'),expect(a['compensation_fund_coverage']['covered'])['toBe'](!![]);});}),describe('service_quote\x20dispute\x20filing\x20boundary\x20(ddmc2\x20F-02)',()=>{function a(b){sdkMocks['query_serviceContext']['mockResolvedValue']({'service':{'type_raw':'Service<0x2::wow::WOW>','sales':[{'name':FLEXIBLE,'price':{'balance':LIST_TOTAL['toString']()},'suspension':![]}],'arbitrations':b}});}it('arbitration-bound\x20Service\x20→\x20DISPUTE\x20FILING\x20BOUNDARY\x20on\x20the\x20total\x20note\x20(with\x20the\x20real-case\x20self-defense)',async()=>{a(['0xabc']);const b=await handleServiceQuote(quoteInput());expect(b['total_pay']['note'])['toContain']('DISPUTE\x20FILING\x20BOUNDARY'),expect(b['total_pay']['note'])['toContain']('does\x20NOT\x20require\x20an\x20arbitration\x20case'),expect(b['total_pay']['note'])['toContain']('append-only'),expect(b['total_pay']['note'])['toContain']('Arbitration.dispute');}),it('no\x20arbitration\x20binding\x20→\x20no\x20dispute\x20disclosure\x20(nothing\x20to\x20wedge)',async()=>{a([]);const b=await handleServiceQuote(quoteInput());expect(b['total_pay']['note'])['not']['toContain']('DISPUTE\x20FILING\x20BOUNDARY');}),it('missing/unordered\x20arbitrations\x20field\x20→\x20no\x20false\x20disclosure',async()=>{a(undefined);const b=await handleServiceQuote(quoteInput());expect(b['total_pay']['note'])['not']['toContain']('DISPUTE\x20FILING\x20BOUNDARY');});});
|
|
1
|
+
import{describe,it,expect,vi,beforeEach}from'vitest';const {sdkMocks}=vi['hoisted'](()=>({'sdkMocks':{'network_get':vi['fn'](),'localMarkList':vi['fn'](),'query_objects':vi['fn'](),'query_serviceContext':vi['fn'](),'queryTableItem_RepositoryData':vi['fn'](),'resolveAddress':vi['fn']()}}));vi['mock']('@wowok/wowok',async a=>{const b=await a();return{...b,'Config':{'Instance':()=>({'network_get':sdkMocks['network_get']})},'LocalMark':{'Instance':()=>({'list':sdkMocks['localMarkList']})},'query_objects':sdkMocks['query_objects'],'query_serviceContext':sdkMocks['query_serviceContext'],'queryTableItem_RepositoryData':sdkMocks['queryTableItem_RepositoryData']};}),vi['mock']('../../tools/handlers/name-resolution.js',()=>({'resolveAddress':sdkMocks['resolveAddress']})),vi['mock']('./facet-money.js',()=>({'formatMoneyAnnotation':async a=>({'display':a})}));import{handleServiceQuote}from'./service-quote.js';const SVC='0x'+'1'['repeat'](0x40),COUPON='0x'+'2'['repeat'](0x40),OTHER_SVC='0x'+'3'['repeat'](0x40),BUYER='0x'+'b'['repeat'](0x40),FLEXIBLE='Flexible\x20—\x20canal\x20view\x20double',LIST_TOTAL=0x35a4e900n;function makeCoupon(a={}){const b=Date['now']();return{'object':COUPON,'name':'bk3t-promo15','discount_type':0x0,'off':0x5dc,'benchmark':null,'time_start':b-0x5265c00,'time_end':b+0x5265c00,'service':SVC,'transferable':![],'owner':{'AddressOwner':BUYER},...a};}function quoteInput(a={}){return{'query_type':'service_quote','service_address':'bk3t-canal-stay','items':[{'name':FLEXIBLE,'quantity':0x1}],'context_network':'mainnet',...a};}beforeEach(()=>{vi['clearAllMocks'](),sdkMocks['network_get']['mockResolvedValue']('mainnet'),sdkMocks['localMarkList']['mockResolvedValue']([{'name':'bk3t-canal-stay'}]),sdkMocks['query_serviceContext']['mockResolvedValue']({'service':{'type_raw':'Service<0x2::wow::WOW>','sales':[{'name':FLEXIBLE,'price':{'balance':LIST_TOTAL['toString']()},'suspension':![]}]}}),sdkMocks['resolveAddress']['mockImplementation'](async a=>{if(a==='bk3t-canal-stay')return SVC;if(a==='bk3t-promo15'||a===COUPON)return COUPON;throw new Error('unresolvable:\x20'+a);}),sdkMocks['query_objects']['mockResolvedValue']({'objects':[makeCoupon()]});}),describe('service_quote\x20discount\x20pricing\x20(F-10)',()=>{it('no\x20discount\x20requested\x20→\x20undiscounted\x20total,\x20discount\x20block\x20null\x20(pre-fix\x20behavior\x20preserved)',async()=>{const a=await handleServiceQuote(quoteInput());expect(a['discount'])['toBeNull'](),expect(a['total_pay']['balance'])['toBe'](LIST_TOTAL['toString']());}),it('RATES\x20coupon\x20applies\x20with\x20integer\x20floor\x20division\x20—\x20reproduces\x20the\x20live\x20order\x20C\x20number',async()=>{const a=await handleServiceQuote(quoteInput({'discount':'bk3t-promo15'}));expect(a['discount'])['not']['toBeNull'](),expect(a['discount']['type'])['toBe']('rates'),expect(a['discount']['applied'])['toBe'](!![]),expect(a['discount']['list_total'])['toBe']('900000000'),expect(a['discount']['final_total'])['toBe']('765000000'),expect(a['total_pay']['balance'])['toBe']('765000000'),expect(a['total_pay']['note'])['toContain']('FLOOR\x20semantics'),expect(a['discount']['owned_by'])['toBe'](BUYER),expect(a['discount']['ownership_note'])['toContain']('owned\x20by\x20'+BUYER),expect(a['discount']['ownership_note'])['toContain']('only\x20the\x20holder\x20can\x20redeem'),expect(a['discount']['ownership_note'])['toContain']('cannot\x20be\x20applied\x20to\x20your\x20order'),expect(a['discount']['ownership_note'])['toContain']('Refunds\x20settle\x20the\x20post-coupon\x20amount\x20only');}),it('MINUS\x20coupon\x20subtracts\x20a\x20fixed\x20amount\x20and\x20clamps\x20at\x20zero',async()=>{sdkMocks['query_objects']['mockResolvedValue']({'objects':[makeCoupon({'discount_type':0x1,'off':0x5f5e100})]});const a=await handleServiceQuote(quoteInput({'discount':COUPON}));expect(a['discount']['type'])['toBe']('minus'),expect(a['discount']['final_total'])['toBe']('800000000'),sdkMocks['query_objects']['mockResolvedValue']({'objects':[makeCoupon({'discount_type':0x1,'off':0x77359400})]});const b=await handleServiceQuote(quoteInput({'discount':COUPON}));expect(b['discount']['final_total'])['toBe']('0'),expect(b['discount']['note'])['toContain']('DEAD\x20BASKET'),expect(b['discount']['note'])['toContain']('REFUSES\x20zero-total'),expect(b['discount']['note'])['toContain']('allow_zero_total'),expect(b['discount']['note'])['toContain']('NOT\x20unlock\x20this\x20buy'),sdkMocks['query_objects']['mockResolvedValue']({'objects':[makeCoupon({'discount_type':0x1,'off':0x5f5e100})]});const c=await handleServiceQuote(quoteInput({'discount':COUPON}));expect(c['discount']['note'])['toContain']('Discounted\x20total\x20shown\x20—\x20order_new.buy.total_pay.balance\x20must\x20be\x20>=\x20this\x20final_total'),expect(c['discount']['note'])['toContain']('BURN-ON-USE'),expect(c['discount']['note'])['toContain']('CANCELLATION\x20REFUNDS\x20THE\x20DISCOUNTED\x20AMOUNT\x20ONLY');}),it('unmet\x20benchmark\x20→\x20applied:false\x20+\x20attach\x20warning,\x20total\x20stays\x20at\x20list\x20price\x20(NOT\x20thrown)',async()=>{sdkMocks['query_objects']['mockResolvedValue']({'objects':[makeCoupon({'benchmark':(LIST_TOTAL+0x1n)['toString']()})]});const a=await handleServiceQuote(quoteInput({'discount':COUPON}));expect(a['discount']['applied'])['toBe'](![]),expect(a['discount']['benchmark_met'])['toBe'](![]),expect(a['total_pay']['balance'])['toBe'](LIST_TOTAL['toString']()),expect(a['discount']['note'])['toContain']('REJECTS'),expect(a['discount']['note'])['toContain']('coupon\x20preserved');}),it('benchmark\x20exactly\x20met\x20→\x20applies\x20(chain\x20uses\x20>=)',async()=>{sdkMocks['query_objects']['mockResolvedValue']({'objects':[makeCoupon({'benchmark':LIST_TOTAL['toString']()})]});const a=await handleServiceQuote(quoteInput({'discount':COUPON}));expect(a['discount']['applied'])['toBe'](!![]),expect(a['discount']['final_total'])['toBe']('765000000');}),it('benchmark\x20None\x20always\x20applies\x20(corrected\x20old\x20docs\x20claim)',async()=>{const a=await handleServiceQuote(quoteInput({'discount':COUPON}));expect(a['discount']['benchmark'])['toBeNull'](),expect(a['discount']['applied'])['toBe'](!![]);}),it('coupon\x20bound\x20to\x20another\x20service\x20→\x20rejected\x20like\x20the\x20chain\x20abort\x20(E_SERVICE_DISCOUNT_NOT_MATCH)',async()=>{sdkMocks['query_objects']['mockResolvedValue']({'objects':[makeCoupon({'service':OTHER_SVC})]}),await expect(handleServiceQuote(quoteInput({'discount':COUPON})))['rejects']['toThrow'](/E_SERVICE_DISCOUNT_NOT_MATCH/);}),it('coupon\x20outside\x20its\x20time\x20window\x20→\x20rejected\x20like\x20the\x20chain\x20abort\x20(E_DISCOUNT_TIME_INVALID)',async()=>{const a=Date['now']();sdkMocks['query_objects']['mockResolvedValue']({'objects':[makeCoupon({'time_start':a+0x3e8,'time_end':a+0x186a0})]}),await expect(handleServiceQuote(quoteInput({'discount':COUPON})))['rejects']['toThrow'](/E_DISCOUNT_TIME_INVALID/);}),it('KB-02\x20attribution:\x20owner\x20unwraps\x20from\x20the\x20ObjectOwner\x20enum\x20shapes\x20and\x20stays\x20fail-soft\x20when\x20unreadable',async()=>{sdkMocks['query_objects']['mockResolvedValue']({'objects':[makeCoupon({'owner':{'ObjectOwner':BUYER}})]});const a=await handleServiceQuote(quoteInput({'discount':COUPON}));expect(a['discount']['owned_by'])['toBe'](BUYER),sdkMocks['query_objects']['mockResolvedValue']({'objects':[makeCoupon({'owner':BUYER})]});const b=await handleServiceQuote(quoteInput({'discount':COUPON}));expect(b['discount']['owned_by'])['toBe'](BUYER),sdkMocks['query_objects']['mockResolvedValue']({'objects':[makeCoupon({'owner':undefined})]});const c=await handleServiceQuote(quoteInput({'discount':COUPON}));expect(c['discount']['owned_by'])['toBeNull'](),expect(c['discount']['ownership_note'])['toContain']('could\x20not\x20be\x20read'),expect(c['discount']['ownership_note'])['toContain']('only\x20the\x20holder\x20can\x20redeem'),expect(c['discount']['ownership_note'])['toContain']('have\x20the\x20owner\x20transfer\x20it\x20first');}),it('unknown\x20coupon\x20object\x20→\x20clear\x20rejection,\x20never\x20a\x20silent\x20full-price\x20quote',async()=>{sdkMocks['query_objects']['mockResolvedValue']({'objects':[]}),await expect(handleServiceQuote(quoteInput({'discount':COUPON})))['rejects']['toThrow'](/not found/);}),it('paused\x20service\x20(bs29\x20R-16)\x20→\x20paused:true\x20+\x20PAUSED\x20warning\x20on\x20the\x20total_pay\x20note',async()=>{sdkMocks['query_serviceContext']['mockResolvedValue']({'service':{'type_raw':'Service<0x2::wow::WOW>','paused':!![],'sales':[{'name':FLEXIBLE,'price':{'balance':LIST_TOTAL['toString']()},'suspension':![]}]}});const a=await handleServiceQuote(quoteInput());expect(a['paused'])['toBe'](!![]),expect(a['total_pay']['note'])['toContain']('SERVICE\x20PAUSED'),expect(a['total_pay']['note'])['toContain']('pause:false'),expect(a['total_pay']['balance'])['toBe'](LIST_TOTAL['toString']()),sdkMocks['query_serviceContext']['mockResolvedValue']({'service':{'type_raw':'Service<0x2::wow::WOW>','bPaused':!![],'sales':[{'name':FLEXIBLE,'price':{'balance':LIST_TOTAL['toString']()},'suspension':![]}]}});const b=await handleServiceQuote(quoteInput());expect(b['paused'])['toBe'](!![]);});});const REWARD='0x'+'4'['repeat'](0x40),CLAIM_GUARD='0x'+'5'['repeat'](0x40);function makeReward(a={}){return{'object':REWARD,'description':'5-star\x20review\x20reward','balance':'500000000','record_count':0x3,'guards':[{'guard':CLAIM_GUARD,'amount':{'type':0x1,'value':'100000000'},'expiration_time':Date['now']()+0x5265c00}],...a};}function svcWithRewards(...a){sdkMocks['query_serviceContext']['mockResolvedValue']({'service':{'type_raw':'Service<0x2::wow::WOW>','sales':[{'name':FLEXIBLE,'price':{'balance':LIST_TOTAL['toString']()},'suspension':![]}],'rewards':a}});}describe('service_quote\x20reward\x20terms\x20(review\x20component\x20b2-5)',()=>{it('no\x20rewards\x20on\x20the\x20Service\x20→\x20reward_terms\x20null',async()=>{const a=await handleServiceQuote(quoteInput());expect(a['reward_terms'])['toBeNull']();}),it('fixed\x20amount\x20+\x20live\x20window\x20→\x20terms\x20with\x20coverage\x20estimate,\x20expired:false,\x20no\x20gaps',async()=>{svcWithRewards(REWARD),sdkMocks['query_objects']['mockResolvedValue']({'objects':[makeReward()]});const a=await handleServiceQuote(quoteInput());expect(a['reward_terms'])['not']['toBeNull']();const b=a['reward_terms']['rewards'][0x0];expect(b['reward'])['toBe'](REWARD),expect(b['description'])['toBe']('5-star\x20review\x20reward'),expect(b['pool_balance'])['toBe']('500000000'),expect(b['record_count'])['toBe'](0x3),expect(b['claims'][0x0]['guard'])['toBe'](CLAIM_GUARD),expect(b['claims'][0x0]['amount_type'])['toBe']('fixed'),expect(b['claims'][0x0]['amount'])['toBe']('100000000'),expect(b['claims'][0x0]['expired'])['toBe'](![]),expect(b['coverage'])['toMatch'](/~5 further claim/),expect(a['reward_terms']['data_gaps'])['toEqual']([]),expect(a['total_pay']['balance'])['toBe'](LIST_TOTAL['toString']());}),it('empty\x20pool\x20→\x20EMPTY\x20coverage\x20warning;\x20expired\x20window\x20→\x20expired:true',async()=>{svcWithRewards(REWARD),sdkMocks['query_objects']['mockResolvedValue']({'objects':[makeReward({'balance':'0','guards':[{'guard':CLAIM_GUARD,'amount':{'type':0x1,'value':'100000000'},'expiration_time':Date['now']()-0x3e8}]})]});const a=await handleServiceQuote(quoteInput()),b=a['reward_terms']['rewards'][0x0];expect(b['claims'][0x0]['expired'])['toBe'](!![]),expect(b['coverage'])['toContain']('EMPTY'),expect(b['coverage'])['toContain']('E_INSUFFICIENT_BALANCE');}),it('guard_submission\x20amount\x20→\x20coverage\x20null\x20(guard-decided),\x20amount\x20carries\x20the\x20submission\x20identifier',async()=>{svcWithRewards(REWARD),sdkMocks['query_objects']['mockResolvedValue']({'objects':[makeReward({'guards':[{'guard':CLAIM_GUARD,'amount':{'type':0x0,'value':0x7}}]})]});const a=await handleServiceQuote(quoteInput()),b=a['reward_terms']['rewards'][0x0];expect(b['claims'][0x0]['amount_type'])['toBe']('guard_submission'),expect(b['claims'][0x0]['amount'])['toContain']('7'),expect(b['claims'][0x0]['amount_display'])['toBeNull'](),expect(b['coverage'])['toBeNull']();}),it('no\x20window\x20set\x20→\x20expiration\x20null\x20and\x20expired\x20null\x20(claimable\x20until\x20guard\x20removal)',async()=>{svcWithRewards(REWARD),sdkMocks['query_objects']['mockResolvedValue']({'objects':[makeReward({'guards':[{'guard':CLAIM_GUARD,'amount':{'type':0x1,'value':'100000000'}}]})]});const a=await handleServiceQuote(quoteInput()),b=a['reward_terms']['rewards'][0x0]['claims'][0x0];expect(b['expiration_time'])['toBeNull'](),expect(b['expiration_display'])['toBeNull'](),expect(b['expired'])['toBeNull'](),expect(b['claim_window'])['toBeNull'](),expect(b['claim_state'])['toBe']('unknown');}),it('R-09\x20claim\x20window\x20decodes\x20from\x20the\x20guard\x27s\x20Clock\x20comparison\x20(order.time\x20+\x20600s\x20upper)',async()=>{svcWithRewards(REWARD);const a={'object':CLAIM_GUARD,'root':[{'type':'logic_as_u256_lesser_or_equal','nodes':[{'type':'context','context':'Clock'},{'type':'calc_number_add','nodes':[{'type':'query','query':'order.time'},{'type':'identifier','identifier':'600000'}]}]}],'table':[{'identifier':'600000','b_submission':![],'value':0x927c0}]};sdkMocks['query_objects']['mockResolvedValueOnce']({'objects':[makeReward()]})['mockResolvedValueOnce']({'objects':[a]});const b=await handleServiceQuote(quoteInput()),d=b['reward_terms']['rewards'][0x0]['claims'][0x0];expect(d['claim_window'])['toEqual']({'opens_after_s':null,'closes_after_s':0x258,'anchor':'order.time'}),expect(d['min_rating'])['toBeNull'](),expect(d['claim_state'])['toBe']('open_window'),expect(d['claim_state_note'])['toContain']('Claimable\x20at\x20the\x20anchor\x20event'),expect(b['reward_terms']['data_gaps'])['toEqual']([]);}),it('bsw4\x20F-11\x20claim_state:\x20opens\x2014d\x20+\x20a\x20further\x2014d\x20span\x20→\x20delayed_window\x20with\x20buyer-language\x20note',async()=>{svcWithRewards(REWARD);const a={'object':CLAIM_GUARD,'root':[{'type':'logic_as_u256_greater_or_equal','nodes':[{'type':'context','context':'Clock'},{'type':'calc_number_add','nodes':[{'type':'query_progress_history_time'},{'type':'calc_number_multiply','nodes':[{'type':'identifier','identifier':'5'},{'type':'identifier','identifier':'13'}]}]}]},{'type':'logic_as_u256_lesser_or_equal','nodes':[{'type':'context','context':'Clock'},{'type':'calc_number_add','nodes':[{'type':'query_progress_history_time'},{'type':'calc_number_multiply','nodes':[{'type':'identifier','identifier':'5'},{'type':'identifier','identifier':'13'}]},{'type':'calc_number_multiply','nodes':[{'type':'identifier','identifier':'12'},{'type':'identifier','identifier':'13'}]}]}]}],'table':[{'identifier':'5','b_submission':![],'value':0xe},{'identifier':'12','b_submission':![],'value':0xe},{'identifier':'13','b_submission':![],'value':0x5265c00}]};sdkMocks['query_objects']['mockResolvedValueOnce']({'objects':[makeReward()]})['mockResolvedValueOnce']({'objects':[a]});const b=await handleServiceQuote(quoteInput()),d=b['reward_terms']['rewards'][0x0]['claims'][0x0];expect(d['claim_window'])['toEqual']({'opens_after_s':0x127500,'closes_after_s':0x24ea00,'anchor':'progress.history.time'}),expect(d['claim_state'])['toBe']('delayed_window'),expect(d['claim_state_note'])['toContain']('Opens\x2014\x20day(s)'),expect(d['claim_state_note'])['toContain']('a\x20further\x2014\x20day(s)'),expect(d['claim_state_note'])['toContain']('hard\x20deadline\x2028\x20day(s)');}),it('bsw4\x20F-11\x20claim_state:\x20opens-only\x20guard\x20(v76\x20archetype)\x20→\x20delayed_open_ended,\x20NEVER-closes\x20disclosed',async()=>{svcWithRewards(REWARD);const a={'object':CLAIM_GUARD,'root':[{'type':'logic_as_u256_greater_or_equal','nodes':[{'type':'context','context':'Clock'},{'type':'calc_number_add','nodes':[{'type':'query_progress_history_time'},{'type':'identifier','identifier':'5'}]}]}],'table':[{'identifier':'5','b_submission':![],'value':0x48190800}]};sdkMocks['query_objects']['mockResolvedValueOnce']({'objects':[makeReward()]})['mockResolvedValueOnce']({'objects':[a]});const b=await handleServiceQuote(quoteInput()),d=b['reward_terms']['rewards'][0x0]['claims'][0x0];expect(d['claim_state'])['toBe']('delayed_open_ended'),expect(d['claim_state_note'])['toContain']('NEVER\x20closes'),expect(d['claim_state_note'])['toContain']('bsw4\x20F-11');}),it('ddmc4\x20B-33:\x20rating_floor\x20/\x20opens_after_days\x20/\x20closes_after_days\x20/\x20per_order_limit\x20surface\x20from\x20the\x20decoded\x20guard',async()=>{svcWithRewards(REWARD);const a={'object':CLAIM_GUARD,'root':[{'type':'logic_as_u256_greater_or_equal','nodes':[{'type':'context','context':'Clock'},{'type':'calc_number_add','nodes':[{'type':'query_progress_history_time'},{'type':'calc_number_multiply','nodes':[{'type':'identifier','identifier':'5'},{'type':'identifier','identifier':'13'}]}]}]},{'type':'logic_as_u256_lesser_or_equal','nodes':[{'type':'context','context':'Clock'},{'type':'calc_number_add','nodes':[{'type':'query_progress_history_time'},{'type':'calc_number_multiply','nodes':[{'type':'identifier','identifier':'5'},{'type':'identifier','identifier':'13'}]},{'type':'calc_number_multiply','nodes':[{'type':'identifier','identifier':'12'},{'type':'identifier','identifier':'13'}]}]}]},{'type':'logic_as_u256_greater_or_equal','nodes':[{'type':'query','query':'repository.data','object':{'identifier':0x9},'parameters':[]},{'type':'identifier','identifier':'4'}]}],'table':[{'identifier':0x5,'b_submission':![],'value':0xe},{'identifier':0xc,'b_submission':![],'value':0xe},{'identifier':0xd,'b_submission':![],'value':0x5265c00},{'identifier':0x4,'b_submission':![],'value':0x4},{'identifier':0x9,'b_submission':![],'value_type':'String','value':'rating'}]};sdkMocks['query_objects']['mockResolvedValueOnce']({'objects':[makeReward({'guards':[{'guard':CLAIM_GUARD,'amount':{'type':0x1,'value':'100000000'},'store_from_id':0x0}]})]})['mockResolvedValueOnce']({'objects':[a]});const b=await handleServiceQuote(quoteInput()),c=b['reward_terms']['rewards'][0x0];expect(c['rating_floor'])['toBe'](0x4),expect(c['opens_after_days'])['toBe'](0xe),expect(c['closes_after_days'])['toBe'](0xe),expect(c['per_order_limit'])['toBe'](0x1);}),it('ddmc4\x20B-33:\x20undecoded\x20faces\x20stay\x20null\x20(no\x20rating\x20leg,\x20no\x20day\x20window,\x20unstamped\x20claim)\x20—\x20never\x20a\x20fabricated\x20number',async()=>{svcWithRewards(REWARD),sdkMocks['query_objects']['mockResolvedValue']({'objects':[makeReward()]});const a=await handleServiceQuote(quoteInput()),b=a['reward_terms']['rewards'][0x0];expect(b['rating_floor'])['toBeNull'](),expect(b['opens_after_days'])['toBeNull'](),expect(b['closes_after_days'])['toBeNull'](),expect(b['per_order_limit'])['toBeNull']();}),it('unreadable\x20reward\x20object\x20→\x20data_gaps\x20note,\x20quote\x20still\x20succeeds\x20(fail-soft)',async()=>{svcWithRewards(REWARD),sdkMocks['query_objects']['mockResolvedValue']({'objects':[]});const a=await handleServiceQuote(quoteInput());expect(a['reward_terms'])['not']['toBeNull'](),expect(a['reward_terms']['rewards'])['toEqual']([]),expect(a['reward_terms']['data_gaps'][0x0])['toContain'](REWARD),expect(a['total_pay']['balance'])['toBe'](LIST_TOTAL['toString']());}),it('reward\x20lookup\x20throws\x20→\x20whole\x20lookup\x20degrades\x20to\x20one\x20gap\x20note,\x20never\x20thrown',async()=>{svcWithRewards(REWARD),sdkMocks['query_objects']['mockRejectedValue'](new Error('rpc\x20down'));const a=await handleServiceQuote(quoteInput());expect(a['reward_terms']['rewards'])['toEqual']([]),expect(a['reward_terms']['data_gaps'][0x0])['toContain']('rpc\x20down'),expect(a['total_pay']['balance'])['toBe'](LIST_TOTAL['toString']());}),it('unstamped\x20claim\x20guard\x20→\x20replay_scope\x20once_per_recipient_guard\x20with\x20abort\x2013\x20+\x20254\x20note',async()=>{svcWithRewards(REWARD),sdkMocks['query_objects']['mockResolvedValue']({'objects':[makeReward()]});const a=await handleServiceQuote(quoteInput()),b=a['reward_terms']['rewards'][0x0]['replay_scope'];expect(b['scope'])['toBe']('once_per_recipient_guard'),expect(b['detail'])['toContain']('for\x20LIFE'),expect(b['detail'])['toContain']('abort\x2013'),expect(b['detail'])['toContain']('E_CLAIM_ALREADY_MADE'),expect(b['per_order_note'])['toContain']('254'),expect(b['per_order_note'])['toContain']('store_from_id');}),it('store_from_id=0\x20→\x20replay_scope\x20once_per_order',async()=>{svcWithRewards(REWARD),sdkMocks['query_objects']['mockResolvedValue']({'objects':[makeReward({'guards':[{'guard':CLAIM_GUARD,'amount':{'type':0x1,'value':'100000000'},'store_from_id':0x0}]})]});const a=await handleServiceQuote(quoteInput()),b=a['reward_terms']['rewards'][0x0]['replay_scope'];expect(b['scope'])['toBe']('once_per_order'),expect(b['detail'])['toContain']('once\x20key\x20is\x20(guard,\x20order)'),expect(b['detail'])['toContain']('E_CLAIM_ALREADY_MADE');}),it('stamp\x20on\x20a\x20non-Order\x20slot\x20→\x20replay_scope\x20once_per_stamp\x20(no\x20overclaim)',async()=>{svcWithRewards(REWARD),sdkMocks['query_objects']['mockResolvedValue']({'objects':[makeReward({'guards':[{'guard':CLAIM_GUARD,'amount':{'type':0x1,'value':'100000000'},'store_from_id':0x2}]})]});const a=await handleServiceQuote(quoteInput()),b=a['reward_terms']['rewards'][0x0]['replay_scope'];expect(b['scope'])['toBe']('once_per_stamp'),expect(b['detail'])['toContain']('slots:\x202'),expect(b['detail'])['toContain']('per-ORDER\x20only\x20when');}),it('mixed\x20stamped/unstamped\x20guards\x20→\x20replay_scope\x20mixed;\x20no\x20guards\x20→\x20unknown',async()=>{svcWithRewards(REWARD),sdkMocks['query_objects']['mockResolvedValue']({'objects':[makeReward({'guards':[{'guard':CLAIM_GUARD,'amount':{'type':0x1,'value':'1'},'store_from_id':0x0},{'guard':'0x'+'6'['repeat'](0x40),'amount':{'type':0x1,'value':'1'}}]})]});const a=await handleServiceQuote(quoteInput());expect(a['reward_terms']['rewards'][0x0]['replay_scope']['scope'])['toBe']('mixed'),expect(a['reward_terms']['rewards'][0x0]['replay_scope']['detail'])['toContain']('1\x20of\x202'),sdkMocks['query_objects']['mockResolvedValue']({'objects':[makeReward({'guards':[]})]});const b=await handleServiceQuote(quoteInput());expect(b['reward_terms']['rewards'][0x0]['replay_scope']['scope'])['toBe']('unknown');});});function ratingFloorGuard(a={}){return{'object':CLAIM_GUARD,'root':{'type':'logic_and','nodes':[{'type':'logic_as_u256_greater_or_equal','nodes':[{'type':'query','query':'repository.data.rating'},{'type':'identifier','identifier':'4'}]}]},'table':[{'identifier':0x4,'b_submission':![],'value':0x4}],...a};}function mockRewardThenGuard(a){sdkMocks['query_objects']['mockResolvedValueOnce']({'objects':[makeReward()]})['mockResolvedValueOnce']({'objects':[a]});}describe('service_quote\x20min_rating\x20signal\x20detection\x20(R2-02)',()=>{it('UTF-8\x20byte-array\x20rating\x20key\x20→\x20the\x20floor\x20decodes\x20(NOT\x20null)',async()=>{svcWithRewards(REWARD),mockRewardThenGuard(ratingFloorGuard({'rating_key':[0x72,0x61,0x74,0x69,0x6e,0x67]}));const a=await handleServiceQuote(quoteInput()),b=a['reward_terms']['rewards'][0x0]['claims'][0x0];expect(b['min_rating'])['toBe']('>=\x204'),expect(a['reward_terms']['data_gaps'])['toEqual']([]);}),it('hex-encoded\x20rating\x20key\x20→\x20the\x20floor\x20decodes\x20(NOT\x20null)',async()=>{svcWithRewards(REWARD),mockRewardThenGuard(ratingFloorGuard({'rating_key_hex':'726174696e67'}));const a=await handleServiceQuote(quoteInput());expect(a['reward_terms']['rewards'][0x0]['claims'][0x0]['min_rating'])['toBe']('>=\x204');}),it('base64-encoded\x20rating\x20key\x20→\x20the\x20floor\x20decodes\x20(NOT\x20null)',async()=>{svcWithRewards(REWARD),mockRewardThenGuard(ratingFloorGuard({'rating_key_b64':'cmF0aW5n'}));const a=await handleServiceQuote(quoteInput());expect(a['reward_terms']['rewards'][0x0]['claims'][0x0]['min_rating'])['toBe']('>=\x204');}),it('ddmc2\x20F-09:\x20AGGREGATE\x20gate\x20count_where(rating\x20>=\x204)\x20>=\x201\x20decodes\x20the\x20INNER\x20floor\x20(>=\x204),\x20the\x20OUTER\x20row\x20count\x20rides\x20min_rows',async()=>{svcWithRewards(REWARD),mockRewardThenGuard({'object':CLAIM_GUARD,'root':{'type':'logic_and','nodes':[{'type':'logic_as_u256_greater_or_equal','nodes':[{'type':'query','query':'query_repository_data_count_where','object':{'identifier':0x0},'key':{'identifier':0x2},'where':{'kind':'gte','value':'4'}},{'type':'identifier','identifier':0x1}]}]},'table':[{'identifier':0x0,'b_submission':![],'value_type':'Address'},{'identifier':0x1,'b_submission':![],'value':0x1},{'identifier':0x2,'b_submission':![],'value_type':'String','value':'rating'}]});const a=await handleServiceQuote(quoteInput()),b=a['reward_terms']['rewards'][0x0]['claims'][0x0];expect(b['min_rating'])['toBe']('>=\x204'),expect(b['min_rows'])['toBe'](0x1);}),it('ddmc2\x20F-09\x20twin:\x20a\x20NON-numeric\x20aggregate\x20where\x20(addressEq\x20referral\x20count)\x20is\x20NOT\x20a\x20rating\x20floor\x20—\x20min_rating\x20unknown,\x20min_rows\x20still\x20surfaced',async()=>{svcWithRewards(REWARD),mockRewardThenGuard({'object':CLAIM_GUARD,'root':{'type':'logic_and','nodes':[{'type':'logic_as_u256_greater_or_equal','nodes':[{'type':'query','query':'query_repository_data_count_where','object':{'identifier':0x0},'key':{'identifier':0x2},'where':{'kind':'addressEq','identifier':0x3}},{'type':'identifier','identifier':0x1}]}]},'table':[{'identifier':0x0,'b_submission':![],'value_type':'Address'},{'identifier':0x1,'b_submission':![],'value':0x3},{'identifier':0x2,'b_submission':![],'value_type':'String','value':'rating'},{'identifier':0x3,'b_submission':![],'value_type':'Address'}]});const a=await handleServiceQuote(quoteInput()),b=a['reward_terms']['rewards'][0x0]['claims'][0x0];expect(b['min_rating'])['toBe']('unknown'),expect(b['min_rows'])['toBe'](0x3);}),it('no\x20rating\x20signal\x20at\x20all\x20→\x20min_rating\x20stays\x20null\x20(unconditional,\x20NOT\x20unknown)',async()=>{svcWithRewards(REWARD),mockRewardThenGuard(ratingFloorGuard());const a=await handleServiceQuote(quoteInput()),b=a['reward_terms']['rewards'][0x0]['claims'][0x0];expect(b['min_rating'])['toBeNull'](),expect(a['reward_terms']['data_gaps'])['toEqual']([]);}),it('rating\x20signal\x20present\x20but\x20the\x20structure\x20is\x20not\x20a\x20decodable\x20floor\x20→\x20unknown\x20+\x20data_gaps\x20disclosure',async()=>{svcWithRewards(REWARD),mockRewardThenGuard({'object':CLAIM_GUARD,'root':{'type':'logic_and','nodes':[{'type':'logic_equal','nodes':[{'type':'query','query':'repository.data.rating'},{'type':'identifier','identifier':'4'}]}]},'table':[{'identifier':0x4,'b_submission':![],'value':0x4}],'rating_key':[0x72,0x61,0x74,0x69,0x6e,0x67]});const a=await handleServiceQuote(quoteInput()),b=a['reward_terms']['rewards'][0x0]['claims'][0x0];expect(b['min_rating'])['toBe']('unknown'),expect(a['reward_terms']['data_gaps']['some'](d=>d['includes']('min_rating=unknown')))['toBe'](!![]);});}),describe('service_quote\x20unreadable_legs\x20(W5-11③)',()=>{it('find_where\x20+\x20vec_contains\x20membership\x20gate\x20→\x20min_rating\x20unknown\x20AND\x20the\x20leg\x20named',async()=>{svcWithRewards(REWARD),mockRewardThenGuard({'object':CLAIM_GUARD,'root':{'type':'logic_and','nodes':[{'type':'vec_contains_address','nodes':[{'type':'query','query':'query_repository_data_find_where','object':{'identifier':0x0},'key':{'identifier':0x2},'where':{'kind':'gte','value':'4'}},{'type':'identifier','identifier':0x3}]}]},'table':[{'identifier':0x0,'b_submission':![],'value_type':'Address'},{'identifier':0x2,'b_submission':![],'value_type':'String','value':'rating'},{'identifier':0x3,'b_submission':![],'value_type':'Address'}]});const a=await handleServiceQuote(quoteInput()),b=a['reward_terms']['rewards'][0x0]['claims'][0x0];expect(b['min_rating'])['toBe']('unknown'),expect(b['unreadable_legs'])['toHaveLength'](0x1),expect(b['unreadable_legs'][0x0])['toContain']('vec_contains_address'),expect(b['unreadable_legs'][0x0])['toContain']('find_where'),expect(b['unreadable_legs'][0x0])['toContain']('not\x20statically\x20decodable');}),it('a\x20decoded\x20numeric\x20floor\x20leaves\x20unreadable_legs\x20null\x20(the\x20leg\x20DID\x20decode)',async()=>{svcWithRewards(REWARD),mockRewardThenGuard(ratingFloorGuard({'rating_key':[0x72,0x61,0x74,0x69,0x6e,0x67]}));const a=await handleServiceQuote(quoteInput()),b=a['reward_terms']['rewards'][0x0]['claims'][0x0];expect(b['min_rating'])['toBe']('>=\x204'),expect(b['unreadable_legs'])['toBeNull']();}),it('an\x20unknown\x20shape\x20with\x20NO\x20recognized\x20membership\x20leg\x20stays\x20unknown\x20with\x20unreadable_legs\x20null\x20(no\x20noise)',async()=>{svcWithRewards(REWARD),mockRewardThenGuard({'object':CLAIM_GUARD,'root':{'type':'logic_and','nodes':[{'type':'logic_equal','nodes':[{'type':'query','query':'repository.data.rating'},{'type':'identifier','identifier':'4'}]}]},'table':[{'identifier':0x4,'b_submission':![],'value':0x4}],'rating_key':[0x72,0x61,0x74,0x69,0x6e,0x67]});const a=await handleServiceQuote(quoteInput()),b=a['reward_terms']['rewards'][0x0]['claims'][0x0];expect(b['min_rating'])['toBe']('unknown'),expect(b['unreadable_legs'])['toBeNull']();});}),describe('service_quote\x20stock\x20disclosure\x20(S4-03\x20/\x20F-20)',()=>{function a(b,c=![]){sdkMocks['query_serviceContext']['mockResolvedValue']({'service':{'type_raw':'Service<0x2::wow::WOW>','sales':[{'name':FLEXIBLE,'price':{'balance':LIST_TOTAL['toString']()},'suspension':c,'stock':b}]}});}it('stock\x20below\x20quantity\x20→\x20stock_ok:false\x20+\x20STOCK\x20SHORT\x20warning\x20(the\x20buy\x20WILL\x20abort)',async()=>{a({'balance':'2'});const b=await handleServiceQuote(quoteInput({'items':[{'name':FLEXIBLE,'quantity':0x3}]}));expect(b['items'][0x0]['stock'])['toBe']('2'),expect(b['items'][0x0]['stock_ok'])['toBe'](![]),expect(b['total_pay']['note'])['toContain']('STOCK\x20SHORT'),expect(b['total_pay']['note'])['toContain']('E_STOCK_NOT_ENOUGH'),expect(b['total_pay']['note'])['toContain']('asked\x203,\x20stock\x202'),expect(b['total_pay']['balance'])['toBe']((LIST_TOTAL*0x3n)['toString']());}),it('stock\x20at/above\x20quantity\x20→\x20stock_ok:true,\x20no\x20false\x20alarm\x20on\x20the\x20note',async()=>{a({'balance':'10'});const b=await handleServiceQuote(quoteInput());expect(b['items'][0x0]['stock'])['toBe']('10'),expect(b['items'][0x0]['stock_ok'])['toBe'](!![]),expect(b['total_pay']['note'])['not']['toContain']('STOCK\x20SHORT');}),it('plain-number\x20stock\x20(unwrapped\x20transport)\x20decodes\x20the\x20same',async()=>{a('0');const b=await handleServiceQuote(quoteInput());expect(b['items'][0x0]['stock'])['toBe']('0'),expect(b['items'][0x0]['stock_ok'])['toBe'](![]),expect(b['total_pay']['note'])['toContain']('STOCK\x20SHORT');}),it('unreadable\x20stock\x20→\x20null/null\x20(honest\x20gap,\x20never\x20a\x20fabricated\x20ok\x20or\x20a\x20false\x20alarm)',async()=>{a(undefined);const b=await handleServiceQuote(quoteInput());expect(b['items'][0x0]['stock'])['toBeNull'](),expect(b['items'][0x0]['stock_ok'])['toBeNull'](),expect(b['total_pay']['note'])['not']['toContain']('STOCK\x20SHORT');});});function svcWithFund(a){sdkMocks['query_serviceContext']['mockResolvedValue']({'service':{'type_raw':'Service<0x2::wow::WOW>','sales':[{'name':FLEXIBLE,'price':{'balance':LIST_TOTAL['toString']()},'suspension':![]}],'compensation_fund':a}});}describe('service_quote\x20compensation_fund_coverage\x20(b6-11)',()=>{it('no\x20fund\x20→\x20covered:false\x20with\x20the\x20no-protection\x20disclosure\x20(never\x20blocked)',async()=>{const a=await handleServiceQuote(quoteInput());expect(a['compensation_fund_coverage'])['not']['toBeNull'](),expect(a['compensation_fund_coverage']['fund_balance'])['toBe']('0'),expect(a['compensation_fund_coverage']['required_for_this_basket'])['toBe']('2700000000'),expect(a['compensation_fund_coverage']['covered'])['toBe'](![]),expect(a['compensation_fund_coverage']['note'])['toContain']('WITHOUT\x20a\x20compensation\x20fund'),expect(a['compensation_fund_coverage']['note'])['toContain']('never\x20blocked');}),it('fund\x20at/over\x203x\x20the\x20basket\x20→\x20covered:true',async()=>{svcWithFund('2700000000');const a=await handleServiceQuote(quoteInput());expect(a['compensation_fund_coverage']['covered'])['toBe'](!![]),expect(a['compensation_fund_coverage']['note'])['toContain']('payable\x20from\x20the\x20pool');}),it('fund\x20short\x20→\x20covered:false\x20and\x20the\x20note\x20names\x20the\x20warning\x20+\x20error\x20code\x20anchor',async()=>{svcWithFund('100000000');const a=await handleServiceQuote(quoteInput());expect(a['compensation_fund_coverage']['covered'])['toBe'](![]),expect(a['compensation_fund_coverage']['note'])['toContain']('PROCEEDS\x20with\x20a\x20warning'),expect(a['compensation_fund_coverage']['note'])['toContain']('compensation_fund_below_order_ceiling'),expect(a['compensation_fund_coverage']['note'])['toContain']('compensation_fund_add');}),it('shortfall\x20states\x20the\x20exact\x20top-up\x20(required\x20-\x20fund;\x20etsy-gf\x20R1:\x20no\x20reader\x20subtraction)',async()=>{svcWithFund('1000000000');const a=await handleServiceQuote(quoteInput());expect(a['compensation_fund_coverage']['shortfall'])['toBe']('1700000000'),expect(a['compensation_fund_coverage']['note'])['toContain']('by'),svcWithFund('2700000000');const b=await handleServiceQuote(quoteInput());expect(b['compensation_fund_coverage']['shortfall'])['toBe']('0'),svcWithFund('0');const c=await handleServiceQuote(quoteInput());expect(c['compensation_fund_coverage']['shortfall'])['toBe']('2700000000');}),it('F-OF2-06:\x20max_coverable_order\x20names\x20the\x20storefront\x20price\x20cap\x20(fund/3)\x20in\x20every\x20fund\x20state',async()=>{const a=await handleServiceQuote(quoteInput());expect(a['compensation_fund_coverage']['max_coverable_order'])['toBe']('0'),svcWithFund('2700000000');const b=await handleServiceQuote(quoteInput());expect(b['compensation_fund_coverage']['max_coverable_order'])['toBe']('900000000'),expect(b['compensation_fund_coverage']['note'])['toContain']('ceiling'),svcWithFund('1000000000');const c=await handleServiceQuote(quoteInput());expect(c['compensation_fund_coverage']['max_coverable_order'])['toBe']('333333333'),expect(c['compensation_fund_coverage']['note'])['toContain']('orders\x20above');}),it('required\x20base\x20is\x20the\x20DISCOUNTED\x20total\x20(what\x20the\x20order\x20actually\x20pays)',async()=>{svcWithFund('2295000000');const a=await handleServiceQuote(quoteInput({'discount':'bk3t-promo15'}));expect(a['total_pay']['balance'])['toBe']('765000000'),expect(a['compensation_fund_coverage']['required_for_this_basket'])['toBe']('2295000000'),expect(a['compensation_fund_coverage']['covered'])['toBe'](!![]);});}),describe('service_quote\x20dispute\x20filing\x20boundary\x20(ddmc2\x20F-02)',()=>{function a(b){sdkMocks['query_serviceContext']['mockResolvedValue']({'service':{'type_raw':'Service<0x2::wow::WOW>','sales':[{'name':FLEXIBLE,'price':{'balance':LIST_TOTAL['toString']()},'suspension':![]}],'arbitrations':b}});}it('arbitration-bound\x20Service\x20→\x20DISPUTE\x20FILING\x20BOUNDARY\x20on\x20the\x20total\x20note\x20(with\x20the\x20real-case\x20self-defense)',async()=>{a(['0xabc']);const b=await handleServiceQuote(quoteInput());expect(b['total_pay']['note'])['toContain']('DISPUTE\x20FILING\x20BOUNDARY'),expect(b['total_pay']['note'])['toContain']('does\x20NOT\x20require\x20an\x20arbitration\x20case'),expect(b['total_pay']['note'])['toContain']('append-only'),expect(b['total_pay']['note'])['toContain']('Arbitration.dispute');}),it('no\x20arbitration\x20binding\x20→\x20no\x20dispute\x20disclosure\x20(nothing\x20to\x20wedge)',async()=>{a([]);const b=await handleServiceQuote(quoteInput());expect(b['total_pay']['note'])['not']['toContain']('DISPUTE\x20FILING\x20BOUNDARY');}),it('missing/unordered\x20arbitrations\x20field\x20→\x20no\x20false\x20disclosure',async()=>{a(undefined);const b=await handleServiceQuote(quoteInput());expect(b['total_pay']['note'])['not']['toContain']('DISPUTE\x20FILING\x20BOUNDARY');});}),describe('service_quote\x20buyable\x20verdict\x20(F-RQ-01)',()=>{const a='行李门到门转运服务七十二小时送达超时全额赔付保障条款'['slice'](0x0,0x1e),b='x'['repeat'](0x50);function c(...d){sdkMocks['query_serviceContext']['mockResolvedValue']({'service':{'type_raw':'Service<0x2::wow::WOW>','sales':d['map'](e=>({'price':{'balance':LIST_TOTAL['toString']()},'suspension':![],...e}))}});}it('over-limit\x20CJK\x20name\x20(90\x20bytes)\x20→\x20line\x20buyable:false\x20+\x20UNBUYABLE\x20BASKET,\x20price\x20still\x20quoted',async()=>{c({'name':a,'stock':{'balance':'9'}});const d=await handleServiceQuote(quoteInput({'items':[{'name':a,'quantity':0x1}]}));expect(d['items'][0x0]['stock_ok'])['toBe'](!![]),expect(d['items'][0x0]['buyable'])['toBe'](![]),expect(d['items'][0x0]['buyable_blockers'][0x0])['toContain']('64-byte'),expect(d['buyable']['purchasable'])['toBe'](![]),expect(d['buyable']['blocked_items'])['toEqual']([a]),expect(d['buyable']['note'])['toContain']('UNBUYABLE\x20SKU\x20NAME'),expect(d['buyable']['note'])['toContain']('abort\x201'),expect(d['buyable']['note'])['toContain']('NEW\x20SKU'),expect(d['total_pay']['note'])['toContain']('UNBUYABLE\x20BASKET'),expect(d['total_pay']['balance'])['toBe'](LIST_TOTAL['toString']());}),it('over-limit\x20ASCII\x20name\x20(80\x20bytes)\x20→\x20same\x20verdict\x20(byte-length,\x20not\x20char-count)',async()=>{c({'name':b,'stock':{'balance':'9'}});const d=await handleServiceQuote(quoteInput({'items':[{'name':b,'quantity':0x1}]}));expect(d['items'][0x0]['buyable'])['toBe'](![]),expect(d['items'][0x0]['buyable_blockers'][0x0])['toContain']('80\x20bytes');}),it('64\x20bytes\x20exactly\x20→\x20buyable:true\x20(the\x20limit\x20is\x20inclusive)',async()=>{const d='y'['repeat'](0x40);c({'name':d,'stock':{'balance':'9'}});const e=await handleServiceQuote(quoteInput({'items':[{'name':d,'quantity':0x1}]}));expect(e['items'][0x0]['buyable'])['toBe'](!![]),expect(e['buyable']['purchasable'])['toBe'](!![]),expect(e['buyable']['note'])['toContain']('Every\x20line\x20passes'),expect(e['total_pay']['note'])['not']['toContain']('UNBUYABLE');}),it('suspended\x20sale\x20→\x20buyable:false\x20with\x20the\x20suspension\x20blocker',async()=>{c({'name':FLEXIBLE,'suspension':!![],'stock':{'balance':'9'}});const d=await handleServiceQuote(quoteInput());expect(d['items'][0x0]['buyable'])['toBe'](![]),expect(d['items'][0x0]['buyable_blockers'][0x0])['toContain']('suspended'),expect(d['buyable']['purchasable'])['toBe'](![]);}),it('unreadable\x20stock\x20+\x20ok\x20name\x20→\x20buyable\x20null\x20(honest\x20unknown,\x20basket\x20null)',async()=>{c({'name':FLEXIBLE});const d=await handleServiceQuote(quoteInput());expect(d['items'][0x0]['buyable'])['toBeNull'](),expect(d['buyable']['purchasable'])['toBeNull'](),expect(d['buyable']['note'])['toContain']('verify\x20before\x20checkout');}),it('one\x20dead\x20SKU\x20among\x20healthy\x20ones\x20→\x20only\x20the\x20dead\x20line\x20is\x20blocked',async()=>{c({'name':FLEXIBLE,'stock':{'balance':'9'}},{'name':b,'stock':{'balance':'9'}});const d=await handleServiceQuote(quoteInput({'items':[{'name':FLEXIBLE,'quantity':0x1}]}));expect(d['items'][0x0]['buyable'])['toBe'](!![]),expect(d['buyable']['purchasable'])['toBe'](!![]),expect(d['buyable']['blocked_items'])['toEqual']([]);});}),describe('service_quote\x20W5-22\x20CAMPAIGN_CLOSED\x20probe',()=>{const a='0x'+'9'['repeat'](0x40),b='0x'+'4'['repeat'](0x40),c='0x'+'5'['repeat'](0x40);function d(f){sdkMocks['query_serviceContext']['mockResolvedValue']({'service':{'type_raw':'Service<0x2::wow::WOW>','buy_guard':a,'sales':[{'name':FLEXIBLE,'price':{'balance':LIST_TOTAL['toString']()},'suspension':![],'stock':{'balance':'9'}}]}}),sdkMocks['query_objects']['mockResolvedValue']({'objects':[{'object':a,'root':f,'table':[{'identifier':0x0,'b_submission':![],'value_type':'Address','value':b},{'identifier':0x1,'b_submission':![],'value_type':'String','value':'next_cycle_deadline'},{'identifier':0x2,'b_submission':![],'value_type':'Address','value':c}]}]});}const e=()=>({'type':'logic_as_u256_lesser_or_equal','nodes':[{'type':'context','context':'Clock'},{'type':'query','query':'repository.data','object':{'identifier':0x0},'parameters':[{'type':'identifier','identifier':0x1},{'type':'identifier','identifier':0x2}]}]});it('past\x20deadline\x20→\x20basket\x20purchasable:false,\x20CAMPAIGN_CLOSED\x20on\x20the\x20basket\x20AND\x20every\x20line',async()=>{d(e()),sdkMocks['queryTableItem_RepositoryData']['mockResolvedValue']({'entity':c,'name':'next_cycle_deadline','value':new Uint8Array(0x8),'data':{'value_type':'U64','value':(Date['now']()-0x36ee80)['toString']()}});const f=await handleServiceQuote(quoteInput());expect(f['buyable']['purchasable'])['toBe'](![]),expect(f['buyable']['note'])['toContain']('CAMPAIGN_CLOSED'),expect(f['items'][0x0]['buyable'])['toBe'](![]),expect(f['items'][0x0]['buyable_blockers']['join'](';\x20'))['toContain']('CAMPAIGN_CLOSED'),expect(f['total_pay']['note'])['toContain']('CAMPAIGN\x20WINDOW\x20(CLOSED)'),expect(sdkMocks['queryTableItem_RepositoryData'])['toHaveBeenCalledWith'](expect['objectContaining']({'parent':b,'name':'next_cycle_deadline','entity':c}));}),it('future\x20deadline\x20→\x20window\x20OPEN\x20disclosed,\x20basket\x20stays\x20purchasable',async()=>{d(e()),sdkMocks['queryTableItem_RepositoryData']['mockResolvedValue']({'entity':c,'name':'next_cycle_deadline','value':new Uint8Array(0x8),'data':{'value_type':'U64','value':(Date['now']()+0x36ee80)['toString']()}});const f=await handleServiceQuote(quoteInput());expect(f['buyable']['purchasable'])['toBe'](!![]),expect(f['buyable']['note'])['not']['toContain']('CAMPAIGN_CLOSED'),expect(f['total_pay']['note'])['toContain']('CAMPAIGN\x20WINDOW\x20(OPEN)');}),it('deadline\x20as\x20RAW\x20BCS\x20u64\x20little-endian\x20bytes\x20decodes\x20too',async()=>{d(e());const f=Date['now']()-0x3e8,g=new Uint8Array(0x8);let h=BigInt(f);for(let k=0x0;k<0x8;k++){g[k]=Number(h&0xffn),h>>=0x8n;}sdkMocks['queryTableItem_RepositoryData']['mockResolvedValue']({'entity':c,'name':'next_cycle_deadline','value':g,'data':{'value_type':'U64','value':g}});const j=await handleServiceQuote(quoteInput());expect(j['buyable']['purchasable'])['toBe'](![]),expect(j['buyable']['note'])['toContain']('CAMPAIGN_CLOSED');}),it('UNSEEDED\x20row\x20(query\x20returns\x20undefined)\x20→\x20closed-by-refusal\x20with\x20the\x20seed\x20hint',async()=>{d(e()),sdkMocks['queryTableItem_RepositoryData']['mockResolvedValue'](undefined);const f=await handleServiceQuote(quoteInput());expect(f['buyable']['purchasable'])['toBe'](![]),expect(f['buyable']['note'])['toContain']('NOT\x20seeded'),expect(f['buyable']['note'])['toContain']('fail-closed');}),it('a\x20DIFFERENT\x20policy\x20key\x20is\x20not\x20the\x20recognized\x20shape\x20—\x20the\x20probe\x20claims\x20nothing',async()=>{const f=e();sdkMocks['query_serviceContext']['mockResolvedValue']({'service':{'type_raw':'Service<0x2::wow::WOW>','buy_guard':a,'sales':[{'name':FLEXIBLE,'price':{'balance':LIST_TOTAL['toString']()},'suspension':![],'stock':{'balance':'9'}}]}}),sdkMocks['query_objects']['mockResolvedValue']({'objects':[{'object':a,'root':f,'table':[{'identifier':0x0,'b_submission':![],'value_type':'Address','value':b},{'identifier':0x1,'b_submission':![],'value_type':'String','value':'vendor_season_end'},{'identifier':0x2,'b_submission':![],'value_type':'Address','value':c}]}]}),sdkMocks['queryTableItem_RepositoryData']['mockResolvedValue'](undefined);const g=await handleServiceQuote(quoteInput());expect(g['buyable']['purchasable'])['toBe'](!![]),expect(g['buyable']['note'])['not']['toContain']('CAMPAIGN_CLOSED'),expect(sdkMocks['queryTableItem_RepositoryData'])['not']['toHaveBeenCalled']();}),it('no\x20buy_guard\x20→\x20no\x20probe,\x20zero\x20extra\x20reads\x20(legacy\x20storefronts\x20unaffected)',async()=>{const f=await handleServiceQuote(quoteInput());expect(f['buyable']['purchasable'])['toBeNull'](),expect(sdkMocks['query_objects'])['not']['toHaveBeenCalled'](),expect(sdkMocks['queryTableItem_RepositoryData'])['not']['toHaveBeenCalled']();});});
|
|
@@ -21,4 +21,13 @@ export interface WorkflowDesignAssessment {
|
|
|
21
21
|
score: number;
|
|
22
22
|
summary: string;
|
|
23
23
|
}
|
|
24
|
-
export
|
|
24
|
+
export interface DesignCoverageGap {
|
|
25
|
+
id: string;
|
|
26
|
+
label: string;
|
|
27
|
+
severity: "critical" | "medium" | "info";
|
|
28
|
+
message: string;
|
|
29
|
+
fix: string;
|
|
30
|
+
}
|
|
31
|
+
export declare function assessWorkflowDesign(graph: Blueprint, coverage?: {
|
|
32
|
+
gaps: DesignCoverageGap[];
|
|
33
|
+
}): WorkflowDesignAssessment;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{checkGameTheoryConstraints}from'./game-theory.js';const VALUE_DIMENSION_CARRIERS=[{'dimension':'escrow_quality','carrier':'has_order_allocators','via':'edge','desc':'funds\x20locked\x20in\x20contract,\x20released\x20by\x20guard'},{'dimension':'proof_integrity','carrier':'repository','via':'node','desc':'tamper-proof\x20delivery\x20evidence'},{'dimension':'arbitration_fairness','carrier':'arbitration','via':'node','desc':'independent\x20dispute\x20resolution'},{'dimension':'permission_safety','carrier':'permission','via':'node','desc':'governance\x20+\x20forward\x20authorization'},{'dimension':'content_commitment','carrier':'guard','via':'node','desc':'delivery\x20verification\x20rules'}];function detectRefundBypass(a){const b=[],c=a['some'](e=>/refund|cancel|disput/i['test'](e['id'])),d=a['some'](e=>/arbitr/i['test'](e['id'])||e['type']==='arbitration');return c&&!d&&b['push']({'kind':'business_loophole','severity':'critical','message':'A\x20refund/cancel\x20path\x20exists\x20but\x20no\x20Arbitration\x20node\x20is\x20present\x20—\x20refunds\x20would\x20bypass\x20independent\x20dispute\x20review.','fix':'Add\x20an\x20Arbitration\x20node\x20(independent\x20Permission)\x20so\x20the\x20refund\x20path\x20routes\x20through\x20dispute\x20resolution.'}),b;}function detectMissingAcceptTimeout(a,b){const c=[],d=a['some'](f=>/complet|accept|finaliz|done/i['test'](f['id'])),e=b['some'](f=>/timeout|time_guard|accept_timeout/i['test'](f['relation']))||a['some'](f=>/timeout|time_guard/i['test'](f['id']));return d&&!e&&c['push']({'kind':'semantic_loophole','severity':'medium','message':'A\x20completion/accept\x20path\x20exists\x20without\x20an\x20accept-timeout\x20mechanism\x20—\x20customer\x20silence\x20could\x20stall\x20settlement\x20indefinitely.','fix':'Adopt\x20accept_timeout_protection:\x20add\x20a\x20time_guard\x20on\x20the\x20accept\x20forward\x20so\x20silence\x20advances\x20the\x20order.'}),c;}function checkIntentConsistency(a){const b=[],{businessIntent:c}=a,d=new Set(a['nodes']['map'](h=>h['type'])),e=new Set(a['edges']['map'](h=>h['relation']));b['push']({'id':'intent_core_service','dimension':'intent','passed':d['has']('service'),'severity':'critical','message':d['has']('service')?'Core\x20Service\x20node\x20present\x20—\x20merchant\x20intent\x20has\x20a\x20structural\x20home.':'No\x20Service\x20node\x20in\x20the\x20blueprint\x20—\x20merchant\x20intent\x20has\x20no\x20structural\x20home.','fix':d['has']('service')?undefined:'Add\x20a\x20Service\x20node\x20to\x20the\x20blueprint.'});if(c['roles']['arbitrators']){const h=d['has']('arbitration');b['push']({'id':'intent_arbitrator','dimension':'intent','passed':h,'severity':'medium','message':h?'Declared\x20arbitrator\x20role\x20has\x20an\x20Arbitration\x20carrier\x20object.':'Declared\x20arbitrator\x20role\x20has\x20no\x20Arbitration\x20carrier\x20object\x20in\x20the\x20blueprint.','fix':h?undefined:'Add\x20an\x20Arbitration\x20object\x20to\x20the\x20blueprint.'});}const f=c['deliverables']??[];f['length']>0x0&&!d['has']('repository')&&!d['has']('proof')&&b['push']({'id':'intent_deliverable','dimension':'intent','passed':![],'severity':'info','message':f['length']+'\x20deliverable(s)\x20declared\x20but\x20no\x20Repository/Proof\x20carrier\x20—\x20delivery\x20evidence\x20has\x20no\x20on-chain\x20home.','fix':'Bind\x20a\x20Repository\x20(and\x20optionally\x20Proof)\x20to\x20store\x20delivery\x20hashes.'});const g=c['payment']?.['model']??'';return/milestone|escrow/i['test'](g)&&!e['has']('has_order_allocators')&&b['push']({'id':'intent_payment','dimension':'intent','passed':![],'severity':'critical','message':'Milestone/escrow\x20payment\x20declared\x20but\x20no\x20order_allocators\x20binding\x20—\x20funds\x20have\x20no\x20release\x20gate.','fix':'Bind\x20order_allocators\x20(Allocation)\x20so\x20funds\x20release\x20per\x20verified\x20milestone.'}),b;}function checkValueCoverage(a){const b=new Set(a['nodes']['map'](d=>d['type'])),c=new Set(a['edges']['map'](d=>d['relation']));return VALUE_DIMENSION_CARRIERS['map'](d=>{const e=d['via']==='node'?b['has'](d['carrier']):c['has'](d['carrier']),f=d['dimension']==='escrow_quality'||d['dimension']==='arbitration_fairness';return{'id':'value_'+d['dimension'],'dimension':'value','passed':e,'severity':f?'critical':'info','message':e?d['dimension']+':\x20'+d['carrier']+'\x20present\x20('+d['desc']+').':d['dimension']+':\x20missing\x20'+d['carrier']+'\x20carrier\x20('+d['desc']+').','fix':e?undefined:'Add\x20a\x20'+d['carrier']+'\x20binding\x20to\x20cover\x20'+d['dimension']+'.'};});}export function assessWorkflowDesign(a){const
|
|
1
|
+
import{checkGameTheoryConstraints}from'./game-theory.js';const VALUE_DIMENSION_CARRIERS=[{'dimension':'escrow_quality','carrier':'has_order_allocators','via':'edge','desc':'funds\x20locked\x20in\x20contract,\x20released\x20by\x20guard'},{'dimension':'proof_integrity','carrier':'repository','via':'node','desc':'tamper-proof\x20delivery\x20evidence'},{'dimension':'arbitration_fairness','carrier':'arbitration','via':'node','desc':'independent\x20dispute\x20resolution'},{'dimension':'permission_safety','carrier':'permission','via':'node','desc':'governance\x20+\x20forward\x20authorization'},{'dimension':'content_commitment','carrier':'guard','via':'node','desc':'delivery\x20verification\x20rules'}];function detectRefundBypass(a){const b=[],c=a['some'](e=>/refund|cancel|disput/i['test'](e['id'])),d=a['some'](e=>/arbitr/i['test'](e['id'])||e['type']==='arbitration');return c&&!d&&b['push']({'kind':'business_loophole','severity':'critical','message':'A\x20refund/cancel\x20path\x20exists\x20but\x20no\x20Arbitration\x20node\x20is\x20present\x20—\x20refunds\x20would\x20bypass\x20independent\x20dispute\x20review.','fix':'Add\x20an\x20Arbitration\x20node\x20(independent\x20Permission)\x20so\x20the\x20refund\x20path\x20routes\x20through\x20dispute\x20resolution.'}),b;}function detectMissingAcceptTimeout(a,b){const c=[],d=a['some'](f=>/complet|accept|finaliz|done/i['test'](f['id'])),e=b['some'](f=>/timeout|time_guard|accept_timeout/i['test'](f['relation']))||a['some'](f=>/timeout|time_guard/i['test'](f['id']));return d&&!e&&c['push']({'kind':'semantic_loophole','severity':'medium','message':'A\x20completion/accept\x20path\x20exists\x20without\x20an\x20accept-timeout\x20mechanism\x20—\x20customer\x20silence\x20could\x20stall\x20settlement\x20indefinitely.','fix':'Adopt\x20accept_timeout_protection:\x20add\x20a\x20time_guard\x20on\x20the\x20accept\x20forward\x20so\x20silence\x20advances\x20the\x20order.'}),c;}function checkIntentConsistency(a){const b=[],{businessIntent:c}=a,d=new Set(a['nodes']['map'](h=>h['type'])),e=new Set(a['edges']['map'](h=>h['relation']));b['push']({'id':'intent_core_service','dimension':'intent','passed':d['has']('service'),'severity':'critical','message':d['has']('service')?'Core\x20Service\x20node\x20present\x20—\x20merchant\x20intent\x20has\x20a\x20structural\x20home.':'No\x20Service\x20node\x20in\x20the\x20blueprint\x20—\x20merchant\x20intent\x20has\x20no\x20structural\x20home.','fix':d['has']('service')?undefined:'Add\x20a\x20Service\x20node\x20to\x20the\x20blueprint.'});if(c['roles']['arbitrators']){const h=d['has']('arbitration');b['push']({'id':'intent_arbitrator','dimension':'intent','passed':h,'severity':'medium','message':h?'Declared\x20arbitrator\x20role\x20has\x20an\x20Arbitration\x20carrier\x20object.':'Declared\x20arbitrator\x20role\x20has\x20no\x20Arbitration\x20carrier\x20object\x20in\x20the\x20blueprint.','fix':h?undefined:'Add\x20an\x20Arbitration\x20object\x20to\x20the\x20blueprint.'});}const f=c['deliverables']??[];f['length']>0x0&&!d['has']('repository')&&!d['has']('proof')&&b['push']({'id':'intent_deliverable','dimension':'intent','passed':![],'severity':'info','message':f['length']+'\x20deliverable(s)\x20declared\x20but\x20no\x20Repository/Proof\x20carrier\x20—\x20delivery\x20evidence\x20has\x20no\x20on-chain\x20home.','fix':'Bind\x20a\x20Repository\x20(and\x20optionally\x20Proof)\x20to\x20store\x20delivery\x20hashes.'});const g=c['payment']?.['model']??'';return/milestone|escrow/i['test'](g)&&!e['has']('has_order_allocators')&&b['push']({'id':'intent_payment','dimension':'intent','passed':![],'severity':'critical','message':'Milestone/escrow\x20payment\x20declared\x20but\x20no\x20order_allocators\x20binding\x20—\x20funds\x20have\x20no\x20release\x20gate.','fix':'Bind\x20order_allocators\x20(Allocation)\x20so\x20funds\x20release\x20per\x20verified\x20milestone.'}),b;}function checkValueCoverage(a){const b=new Set(a['nodes']['map'](d=>d['type'])),c=new Set(a['edges']['map'](d=>d['relation']));return VALUE_DIMENSION_CARRIERS['map'](d=>{const e=d['via']==='node'?b['has'](d['carrier']):c['has'](d['carrier']),f=d['dimension']==='escrow_quality'||d['dimension']==='arbitration_fairness';return{'id':'value_'+d['dimension'],'dimension':'value','passed':e,'severity':f?'critical':'info','message':e?d['dimension']+':\x20'+d['carrier']+'\x20present\x20('+d['desc']+').':d['dimension']+':\x20missing\x20'+d['carrier']+'\x20carrier\x20('+d['desc']+').','fix':e?undefined:'Add\x20a\x20'+d['carrier']+'\x20binding\x20to\x20cover\x20'+d['dimension']+'.'};});}export function assessWorkflowDesign(a,b){const c=checkGameTheoryConstraints(a,a['businessIntent']),d=checkIntentConsistency(a),e=checkValueCoverage(a),f=c['results']['map'](o=>({'id':'game_'+o['scenario'],'dimension':'game','passed':o['covered'],'severity':o['scenario']==='merchant_may_abandon'?'critical':'medium','message':o['covered']?'Covered:\x20'+o['conflict']:'EXPOSED:\x20'+o['conflict'],'fix':o['covered']?undefined:o['recommendation']})),g=[...detectRefundBypass(a['nodes']),...detectMissingAcceptTimeout(a['nodes'],a['edges'])],h=(b?.['gaps']??[])['map'](o=>({'id':'coverage_'+o['id'],'dimension':'intent','passed':![],'severity':o['severity'],'message':o['message'],'fix':o['fix']})),i=[...d,...f,...e,...h],j=i['filter'](o=>!o['passed']&&o['severity']==='critical')['length'],k=i['filter'](o=>!o['passed'])['length'],l=Math['max'](0x0,Math['min'](0x64,0x64-j*0x14-k*0x5)),m=h['length']>0x0?'\x20Coverage\x20gaps:\x20'+h['length']+'\x20unbacked\x20promise(s)/dropped\x20module(s)\x20—\x20see\x20coverage_*\x20checks.':'',n=(j>0x0?'Design\x20NOT\x20ready:\x20'+j+'\x20critical\x20+\x20'+k+'\x20total\x20open\x20loop(s).':k>0x0?'Design\x20mostly\x20sound:\x20'+k+'\x20open\x20loop(s),\x20no\x20critical.':'Design\x20sound:\x20intent,\x20game\x20and\x20value\x20all\x20covered.')+m;return{'checks':i,'findings':g,'game_coverage':c,'score':l,'summary':n};}
|
package/dist/review/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{objectTypeFromAddress,ObjectType}from'@wowok/wowok';import{resolveAddress as
|
|
1
|
+
import{objectTypeFromAddress,ObjectType}from'@wowok/wowok';import{resolveAddress as a446a}from'../tools/handlers/name-resolution.js';import{handleObjectPanorama}from'../playbooks/service-build/object-panorama.js';import{handleServicePanorama}from'../playbooks/service-build/service-panorama.js';import{handleMachinePanorama}from'../playbooks/service-build/machine-panorama.js';import{assembleOrderReview}from'./order.js';import{assembleServiceReview}from'./service.js';import{assembleMachineReview}from'./machine.js';import{assembleArbReview}from'./arb.js';import{assembleDemandReview}from'./demand.js';import{assembleRepositoryReview}from'./repository.js';import{assembleProgressReview}from'./progress.js';export const REVIEW_PACK_TYPES=['Order','Service','Arb','Demand','Repository','Progress','Machine'];export async function handleReviewPack(a){const b=a['object_address'];if(!b)throw new Error('\x27object_address\x27\x20is\x20required\x20for\x20review_pack');const c=await a446a(b,'object_address'),d=objectTypeFromAddress(c);if(d===ObjectType['Order']){const g=await handleObjectPanorama(a);if(g['object_type']!=='Order')throw new Error('review_pack:\x20expected\x20an\x20Order,\x20resolved\x20to\x20'+g['object_type']);return assembleOrderReview(g);}if(d===ObjectType['Service']){const h=await handleServicePanorama({...a,'service_address':c});return assembleServiceReview(h);}if(d===ObjectType['Machine']){const i=await handleMachinePanorama({...a,'object_address':c});if(i['machineAddress']?.['toLowerCase']()!==c['toLowerCase']())throw new Error('review_pack:\x20expected\x20a\x20Machine,\x20resolved\x20to\x20'+i['machineAddress']);return assembleMachineReview(i);}const e={[ObjectType['Arb']]:assembleArbReview,[ObjectType['Demand']]:assembleDemandReview,[ObjectType['Repository']]:assembleRepositoryReview,[ObjectType['Progress']]:assembleProgressReview},f=d?e[d]:undefined;if(f){const j=await handleObjectPanorama(a);if(j['object_type']!==d)throw new Error('review_pack:\x20expected\x20a\x20'+d+',\x20resolved\x20to\x20'+j['object_type']);return f(j);}throw new Error('review_pack:\x20unsupported\x20object\x20type\x20\x27'+(d??'unknown')+'\x27\x20—\x20supported:\x20'+REVIEW_PACK_TYPES['join'](',\x20')+'.\x20Other\x20types\x20keep\x20object_panorama\x20/\x20machine_panorama\x20/\x20service_panorama.');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export function assembleRepositoryReview(a){const b=a['fields'],c=[{'label':'Data','tip':'Records\x20stored\x20in\x20this\x20repository\x27s\x20on-chain\x20table\x20(ParentTable<DataKey,\x20vector<u8>>).','value':b['data_count']!=null?{'t':'text','v':String(b['data_count']),'tone':'strong'}:null}],d={'kind':'core','title':'Permission','rows':b['permission']?[{'label':'Permission','ref':{'address':b['permission'],'obj_type':'Permission'}}]:[]},e={'kind':'items','title':'Policies\x20('+a['policies']['length']+')','empty':'No\x20write\x20policies\x20—\x20the\x20repository\x20accepts\x20no\x20governed\x20data\x20writes.','items':a['policies']['map']((
|
|
1
|
+
export function assembleRepositoryReview(a){const b=a['fields'],c=[{'label':'Data','tip':'Records\x20stored\x20in\x20this\x20repository\x27s\x20on-chain\x20table\x20(ParentTable<DataKey,\x20vector<u8>>).','value':b['data_count']!=null?{'t':'text','v':String(b['data_count']),'tone':'strong'}:null}],d={'kind':'core','title':'Permission','rows':b['permission']?[{'label':'Permission','ref':{'address':b['permission'],'obj_type':'Permission'}}]:[]},e={'kind':'items','title':'Policies\x20('+a['policies']['length']+')','empty':'No\x20write\x20policies\x20—\x20the\x20repository\x20accepts\x20no\x20governed\x20data\x20writes.','items':a['policies']['map']((k,l)=>({'name':'#'+(l+0x1)+'\x20'+k['name'],'meta':[...k['id_from']!=null?[{'label':'id\x20from','value':String(k['id_from']),'tip':'The\x20passport\x20submission\x20field\x20the\x20record\x20id\x20is\x20taken\x20from.'}]:[],...k['value_type']!=null?[{'label':'value\x20type','value':String(k['value_type']),'tip':'The\x20BCS\x20value\x20type\x20data\x20writes\x20must\x20match.'}]:[],{'label':'write\x20guards','value':String(k['write_guards']),'tip':'Guards\x20that\x20must\x20pass\x20before\x20a\x20data\x20write\x20under\x20this\x20policy\x20is\x20accepted.'},...k['quote_guard']?[{'label':'quote','value':k['quote_guard'],'tip':'The\x20guard\x20consulted\x20when\x20quoting\x20this\x20policy\x27s\x20data.'}]:[],...k['write_once']?[{'label':'write\x20once','value':'on','tip':'A\x20record\x20already\x20written\x20under\x20this\x20policy\x20cannot\x20be\x20overwritten:\x20a\x20second\x20write\x20to\x20the\x20same\x20id\x20aborts\x20with\x20repository\x20error\x2024\x20(E_POLICY_WRITE_ONCE_CONFLICT).'}]:[]],'note':k['description']??undefined}))},g=a['data_entries']['count'],h={'kind':'items','title':g!=null?'Data\x20entries\x20('+g+')':'Data\x20entries','empty':g===0x0?'No\x20data\x20written\x20yet\x20—\x20reviews/evidence\x20rows\x20appear\x20here\x20once\x20written.':g==null?'Contents\x20not\x20readable\x20in\x20this\x20pass\x20(count\x20unknown)\x20—\x20verify\x20via\x20onchain_table.':'No\x20rows\x20in\x20the\x20preview\x20window\x20—\x20read\x20the\x20full\x20table\x20via\x20onchain_table.','items':a['data_entries']['items']['map']((k,l)=>{const m=k['value']??'',n=m['length']>0xf0?m['slice'](0x0,0xf0)+'…\x20(truncated\x20—\x20full\x20value\x20on\x20onchain_table)':m;return{'name':k['name']??'#'+(l+0x1),'meta':[...k['entity']!=null?[{'label':'entity','value':k['entity'],'tip':'The\x20writer\x20entity\x20this\x20row\x20is\x20keyed\x20under\x20(DataKey\x20=\x20{entity,\x20name}).'}]:[],...k['value_type']!=null?[{'label':'value\x20type','value':k['value_type'],'tip':'The\x20BCS\x20type\x20of\x20the\x20stored\x20value.'}]:[]],'note':n!==''?n:undefined};})},i={'kind':'items','title':'Rewards\x20('+a['rewards']['length']+')','empty':'No\x20Reward\x20objects\x20back\x20this\x20Repository\x20yet.','items':a['rewards']['map']((k,l)=>({'name':'#'+(l+0x1),'ref':{'address':k,'obj_type':'Reward'},'meta':[]}))},j={'kind':'fields','columns':0x2,'fields':[{'label':'UM','tip':'Update\x20Manager\x20(repository.um)\x20—\x20a\x20Contact\x20designated\x20as\x20this\x20Repository\x27s\x20customer-service\x20/\x20update\x20channel.','value':b['um']?{'t':'addr','v':b['um'],'obj_type':'Contact'}:null},{'label':'Permission','tip':'The\x20Permission\x20list\x20gating\x20administration\x20operations\x20(description\x20/\x20policies\x20/\x20rewards\x20/\x20owner_receive\x20/\x20um).','value':b['permission']?{'t':'addr','v':b['permission'],'obj_type':'Permission'}:null},{'label':'Data','tip':'Records\x20stored\x20in\x20this\x20repository\x27s\x20on-chain\x20table.','value':b['data_count']!=null?{'t':'text','v':String(b['data_count']),'tone':'strong'}:null}]};return{'action':'review_pack','object_type':'Repository','head':{'address':a['object'],'network':a['network'],'name':a['head']['name'],'description':a['head']['description'],'tags':a['head']['tags'],'last_active_ms':null,'badges':[],'info_rows':[c]},'sections':[d,e,h,i,j],'data_gaps':a['data_gaps']};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{CONFIRMATION_RULES,resolveOverrideId}from'../knowledge/safety-rules.js';import{isEnabled as
|
|
1
|
+
import{CONFIRMATION_RULES,resolveOverrideId}from'../knowledge/safety-rules.js';import{isEnabled as a462a}from'../config/index.js';import{isPlanPreapproved}from'../goal/plan-approval.js';export function isConfirmGateEnabled(){return a462a('confirm_gate');}const internalErrorCounts={};function logInternalError(a,b){const c=a;internalErrorCounts[c]=(internalErrorCounts[c]??0x0)+0x1;const d=internalErrorCounts[c];console['warn']('[ConfirmGate]\x20internal_error\x20context=\x22'+a+'\x22\x20count='+d+'\x20error='+(b instanceof Error?b['message']:String(b)));}export function getFailMode(a){switch(a){case'irreversible':case'publish':case'amount':return'closed';case'standard':case'none':default:return'open';}}function buildInternalErrorResult(a,b,c){const d=b instanceof Error?b['message']:b!==undefined?String(b):undefined;return{'pass':![],'level':'irreversible','preview':{'level':'irreversible','operation':a,'irreversible':!![],'warnings':[...c?['ConfirmGate\x20rule\x20\x27'+c+'\x27\x20matched\x20but\x20its\x20preview\x20could\x20not\x20be\x20generated.']:['An\x20error\x20occurred\x20while\x20matching\x20confirmation\x20rules.'],...d!==undefined?['Reason:\x20'+d]:[],'The\x20operation\x20was\x20NOT\x20executed.\x20Review\x20the\x20parameters\x20for\x20malformed\x20values\x20(e.g.\x20decimal\x20amounts\x20instead\x20of\x20smallest-unit\x20integers)\x20before\x20confirming.']},'rule_id':'internal_error'};}function emitGuardQuietNotice(a,b,c,d,f){try{const g=f['preview'](a,b,c),h=['[ConfirmGate]\x20guard\x20CREATE\x20proceeded\x20WITHOUT\x20interactive\x20confirmation\x20(confirm_mode:\x20'+d+').','\x20\x20Object:\x20'+String(g['object']??'(unnamed)')+'\x20\x20Network:\x20'+String(g['network']??'?'),...(g['warnings']??[])['map'](i=>'\x20\x20-\x20'+i),'\x20\x20Immutable\x20after\x20creation\x20—\x20changes\x20require\x20a\x20NEW\x20guard\x20+\x20rebind.\x20Verify\x20with\x20analyze_guard_semantics\x20after\x20creation.'];console['warn'](h['join']('\x0a'));}catch(i){console['warn']('[ConfirmGate]\x20guard\x20CREATE\x20proceeded\x20in\x20'+d+'\x20mode\x20(manifest\x20unavailable:\x20'+(i instanceof Error?i['message']:String(i))+')');}}export function confirmGate(a,b,c,d,f,g){if(!isConfirmGateEnabled())return{'pass':!![]};if(c?.['confirmed']===!![])return{'pass':!![]};if(c?.['dry_run']===!![])return{'pass':!![]};let h,i=null;try{h=CONFIRMATION_RULES['find'](n=>{try{return n['when'](a,b,c);}catch(o){logInternalError('rule_when:'+n['id'],o);if(getFailMode(n['level'])==='closed')throw o;return![];}});}catch(n){i=n;}if(i)return logInternalError('rule_search',i),buildInternalErrorResult(a,i);if(!h)return{'pass':!![]};if(getFailMode(h['level'])==='open'&&isPlanPreapproved(c))return{'pass':!![]};const j=resolveOverrideId(h['id'],a),k=j?f?.[j]:undefined;if(k==='auto')return{'pass':!![]};const l=c?.['confirm_mode']==='quiet'||c?.['confirm_mode']==='streamlined'?c['confirm_mode']:'full';if(l!=='full'&&k!=='block'&&getFailMode(h['level'])==='open')return{'pass':!![]};if(h['id']==='guard_create_immutable'&&l!=='full'&&k!=='block')return emitGuardQuietNotice(a,b,c,l,h),{'pass':!![]};if(k!=='block'&&g?.['intent_bypass']!==![]&&h['bypass_on_explicit_intent']&&d&&d['length']>0x0){const o=d['map'](q=>q['toLowerCase']()),p=h['bypass_on_explicit_intent']['some'](q=>o['some'](r=>r['includes'](q['toLowerCase']())));if(p)return{'pass':!![]};}let m;try{m=h['preview'](a,b,c);}catch(q){logInternalError('rule_preview:'+h['id'],q);if(getFailMode(h['level'])==='closed')return buildInternalErrorResult(a,q,h['id']);return{'pass':!![]};}return{'pass':![],'level':h['level'],'preview':m,'rule_id':h['id']};}export function isExplicitlyConfirmed(a){return a?.['confirmed']===!![];}
|
|
@@ -136,6 +136,11 @@ export declare const BenchmarkMigrationSchema: z.ZodObject<{
|
|
|
136
136
|
plan: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
137
137
|
completed_steps: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
138
138
|
previous_outputs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
139
|
+
resume_from_step: z.ZodOptional<z.ZodString>;
|
|
140
|
+
retry_override: z.ZodOptional<z.ZodObject<{
|
|
141
|
+
step_id: z.ZodString;
|
|
142
|
+
note: z.ZodString;
|
|
143
|
+
}, z.core.$strip>>;
|
|
139
144
|
env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
140
145
|
accounts: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
141
146
|
timeout_ms: z.ZodOptional<z.ZodNumber>;
|
|
@@ -202,12 +207,18 @@ export declare const BenchmarkMigrationOutputSchema: z.ZodObject<{
|
|
|
202
207
|
stale_build: z.ZodObject<{
|
|
203
208
|
stale: z.ZodBoolean;
|
|
204
209
|
known: z.ZodBoolean;
|
|
210
|
+
actionable: z.ZodBoolean;
|
|
205
211
|
lag_minutes: z.ZodNullable<z.ZodNumber>;
|
|
206
212
|
detail: z.ZodString;
|
|
207
213
|
}, z.core.$strip>;
|
|
208
214
|
verdict: z.ZodObject<{
|
|
209
215
|
buildable: z.ZodBoolean;
|
|
210
216
|
blockers: z.ZodArray<z.ZodString>;
|
|
217
|
+
status: z.ZodEnum<{
|
|
218
|
+
UNVERIFIED: "UNVERIFIED";
|
|
219
|
+
READY: "READY";
|
|
220
|
+
BLOCKED: "BLOCKED";
|
|
221
|
+
}>;
|
|
211
222
|
}, z.core.$strip>;
|
|
212
223
|
next_action: z.ZodString;
|
|
213
224
|
semantic_ir_digest: z.ZodOptional<z.ZodString>;
|
|
@@ -238,13 +249,29 @@ export declare const BenchmarkMigrationOutputSchema: z.ZodObject<{
|
|
|
238
249
|
suggestion: z.ZodString;
|
|
239
250
|
}, z.core.$strip>>;
|
|
240
251
|
red_flags: z.ZodArray<z.ZodString>;
|
|
252
|
+
drift: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
253
|
+
compile_dry_run: z.ZodObject<{
|
|
254
|
+
status: z.ZodEnum<{
|
|
255
|
+
blocked: "blocked";
|
|
256
|
+
ready: "ready";
|
|
257
|
+
unverified: "unverified";
|
|
258
|
+
unavailable: "unavailable";
|
|
259
|
+
}>;
|
|
260
|
+
buildable: z.ZodOptional<z.ZodBoolean>;
|
|
261
|
+
blockers: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
262
|
+
note: z.ZodString;
|
|
263
|
+
}, z.core.$strip>;
|
|
241
264
|
}, z.core.$strip>;
|
|
242
265
|
stale_build: z.ZodObject<{
|
|
243
266
|
stale: z.ZodBoolean;
|
|
244
267
|
known: z.ZodBoolean;
|
|
268
|
+
actionable: z.ZodBoolean;
|
|
245
269
|
lag_minutes: z.ZodNullable<z.ZodNumber>;
|
|
246
270
|
detail: z.ZodString;
|
|
247
271
|
}, z.core.$strip>;
|
|
272
|
+
buildable: z.ZodBoolean;
|
|
273
|
+
build_blockers: z.ZodArray<z.ZodString>;
|
|
274
|
+
next_action: z.ZodString;
|
|
248
275
|
}, z.core.$strip>, z.ZodObject<{
|
|
249
276
|
next_action: z.ZodString;
|
|
250
277
|
semantic_ir_digest: z.ZodOptional<z.ZodString>;
|
|
@@ -299,12 +326,41 @@ export declare const BenchmarkMigrationOutputSchema: z.ZodObject<{
|
|
|
299
326
|
passed: z.ZodBoolean;
|
|
300
327
|
findings: z.ZodArray<z.ZodString>;
|
|
301
328
|
}, z.core.$strip>;
|
|
329
|
+
requirement_coverage: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
330
|
+
family: z.ZodEnum<{
|
|
331
|
+
discount: "discount";
|
|
332
|
+
fulfillment: "fulfillment";
|
|
333
|
+
after_sales: "after_sales";
|
|
334
|
+
review_incentive: "review_incentive";
|
|
335
|
+
privacy_channel: "privacy_channel";
|
|
336
|
+
}>;
|
|
337
|
+
label: z.ZodString;
|
|
338
|
+
status: z.ZodEnum<{
|
|
339
|
+
mapped: "mapped";
|
|
340
|
+
unmapped: "unmapped";
|
|
341
|
+
blocker: "blocker";
|
|
342
|
+
}>;
|
|
343
|
+
evidence: z.ZodString;
|
|
344
|
+
target: z.ZodOptional<z.ZodString>;
|
|
345
|
+
note: z.ZodString;
|
|
346
|
+
}, z.core.$strict>>>;
|
|
302
347
|
network: z.ZodEnum<{
|
|
303
348
|
testnet: "testnet";
|
|
304
349
|
mainnet: "mainnet";
|
|
305
350
|
localnet: "localnet";
|
|
306
351
|
}>;
|
|
307
352
|
}, z.core.$strip>;
|
|
353
|
+
buildable: z.ZodOptional<z.ZodBoolean>;
|
|
354
|
+
build_blockers: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
355
|
+
compile_dry_run: z.ZodOptional<z.ZodObject<{
|
|
356
|
+
status: z.ZodEnum<{
|
|
357
|
+
blocked: "blocked";
|
|
358
|
+
ready: "ready";
|
|
359
|
+
unverified: "unverified";
|
|
360
|
+
unavailable: "unavailable";
|
|
361
|
+
}>;
|
|
362
|
+
note: z.ZodString;
|
|
363
|
+
}, z.core.$strip>>;
|
|
308
364
|
inference_source: z.ZodOptional<z.ZodEnum<{
|
|
309
365
|
keywords: "keywords";
|
|
310
366
|
semantic_ir: "semantic_ir";
|
|
@@ -361,6 +417,24 @@ export declare const BenchmarkMigrationOutputSchema: z.ZodObject<{
|
|
|
361
417
|
passed: z.ZodBoolean;
|
|
362
418
|
findings: z.ZodArray<z.ZodString>;
|
|
363
419
|
}, z.core.$strip>;
|
|
420
|
+
requirement_coverage: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
421
|
+
family: z.ZodEnum<{
|
|
422
|
+
discount: "discount";
|
|
423
|
+
fulfillment: "fulfillment";
|
|
424
|
+
after_sales: "after_sales";
|
|
425
|
+
review_incentive: "review_incentive";
|
|
426
|
+
privacy_channel: "privacy_channel";
|
|
427
|
+
}>;
|
|
428
|
+
label: z.ZodString;
|
|
429
|
+
status: z.ZodEnum<{
|
|
430
|
+
mapped: "mapped";
|
|
431
|
+
unmapped: "unmapped";
|
|
432
|
+
blocker: "blocker";
|
|
433
|
+
}>;
|
|
434
|
+
evidence: z.ZodString;
|
|
435
|
+
target: z.ZodOptional<z.ZodString>;
|
|
436
|
+
note: z.ZodString;
|
|
437
|
+
}, z.core.$strict>>>;
|
|
364
438
|
network: z.ZodEnum<{
|
|
365
439
|
testnet: "testnet";
|
|
366
440
|
mainnet: "mainnet";
|
|
@@ -372,6 +446,17 @@ export declare const BenchmarkMigrationOutputSchema: z.ZodObject<{
|
|
|
372
446
|
unmapped_count: z.ZodNumber;
|
|
373
447
|
manual_review_count: z.ZodNumber;
|
|
374
448
|
risk_passed: z.ZodBoolean;
|
|
449
|
+
buildable: z.ZodOptional<z.ZodBoolean>;
|
|
450
|
+
build_blockers: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
451
|
+
compile_dry_run: z.ZodOptional<z.ZodObject<{
|
|
452
|
+
status: z.ZodEnum<{
|
|
453
|
+
blocked: "blocked";
|
|
454
|
+
ready: "ready";
|
|
455
|
+
unverified: "unverified";
|
|
456
|
+
unavailable: "unavailable";
|
|
457
|
+
}>;
|
|
458
|
+
note: z.ZodString;
|
|
459
|
+
}, z.core.$strip>>;
|
|
375
460
|
}, z.core.$strip>;
|
|
376
461
|
next_action: z.ZodString;
|
|
377
462
|
}, z.core.$strip>, z.ZodObject<{
|
|
@@ -403,6 +488,11 @@ export declare const BenchmarkMigrationOutputSchema: z.ZodObject<{
|
|
|
403
488
|
verdict: z.ZodObject<{
|
|
404
489
|
buildable: z.ZodBoolean;
|
|
405
490
|
blockers: z.ZodArray<z.ZodString>;
|
|
491
|
+
status: z.ZodEnum<{
|
|
492
|
+
UNVERIFIED: "UNVERIFIED";
|
|
493
|
+
READY: "READY";
|
|
494
|
+
BLOCKED: "BLOCKED";
|
|
495
|
+
}>;
|
|
406
496
|
}, z.core.$strip>;
|
|
407
497
|
next_action: z.ZodString;
|
|
408
498
|
semantic_ir_digest: z.ZodOptional<z.ZodString>;
|
|
@@ -421,6 +511,20 @@ export declare const BenchmarkMigrationOutputSchema: z.ZodObject<{
|
|
|
421
511
|
outputs: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
422
512
|
preflight: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
423
513
|
readback: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
514
|
+
resume: z.ZodOptional<z.ZodObject<{
|
|
515
|
+
completed_steps: z.ZodArray<z.ZodString>;
|
|
516
|
+
previous_outputs: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
517
|
+
}, z.core.$strip>>;
|
|
518
|
+
repeated_failures: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
519
|
+
step_id: z.ZodString;
|
|
520
|
+
consecutive_rounds: z.ZodNumber;
|
|
521
|
+
error: z.ZodString;
|
|
522
|
+
}, z.core.$strip>>>;
|
|
523
|
+
retry_prohibited: z.ZodOptional<z.ZodBoolean>;
|
|
524
|
+
retry_override_applied: z.ZodOptional<z.ZodObject<{
|
|
525
|
+
step_id: z.ZodString;
|
|
526
|
+
note: z.ZodString;
|
|
527
|
+
}, z.core.$strip>>;
|
|
424
528
|
next_action: z.ZodString;
|
|
425
529
|
}, z.core.$strip>], "action">;
|
|
426
530
|
}, z.core.$strict>;
|