@wowok/agent-mcp 3.4.3 → 3.4.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/.build-stamp.json +3 -3
- package/dist/build-stamp.js +1 -0
- package/dist/chain-semantics/composition-truth.js +1 -1
- package/dist/chain-semantics/eval-order.js +1 -1
- package/dist/chain-semantics/freeze-map.js +1 -1
- package/dist/chain-semantics/fund-flow.js +1 -1
- package/dist/chain-semantics/object-graph.js +1 -1
- package/dist/composition/audit.js +1 -1
- package/dist/composition/compile.js +1 -1
- package/dist/composition/emit-phases.js +1 -1
- package/dist/composition/generate.js +1 -1
- package/dist/composition/guard-fill.js +1 -1
- package/dist/composition/input-normalize.js +1 -1
- package/dist/composition/materialize.js +1 -1
- package/dist/composition/mode-gates.js +1 -1
- package/dist/composition/plan.js +1 -1
- package/dist/composition/product-card.js +1 -1
- package/dist/composition/shape-expand.js +1 -0
- package/dist/config/judgment.js +1 -1
- package/dist/config/template-params.js +1 -1
- package/dist/data/sync/cdc.js +1 -1
- package/dist/data/sync/graphql-source.js +1 -1
- package/dist/evaluation/engine.js +1 -1
- package/dist/experience/realtime-feedback.js +1 -1
- package/dist/graph/onchain/expand.js +1 -1
- package/dist/graph/onchain/exposure.js +1 -1
- package/dist/graph/onchain/sdk-batch.js +1 -1
- package/dist/harness/entry-ignite-selfheal.js +1 -0
- package/dist/harness/forward-leg-preflight.js +1 -0
- package/dist/harness/recover.js +1 -1
- package/dist/keeper/detectors.js +1 -1
- package/dist/knowledge/allocator-rail-verifier.js +1 -1
- package/dist/knowledge/arb-operation-face.js +1 -0
- package/dist/knowledge/arbitration-rail-verifier.js +1 -1
- package/dist/knowledge/arbitration-templates.js +1 -1
- package/dist/knowledge/audit-rules.d.ts +15 -0
- package/dist/knowledge/audit-rules.js +1 -1
- package/dist/knowledge/baselines/rules/alloc_audit.json.good +310 -0
- package/dist/knowledge/baselines/rules/allocation.json.good +568 -0
- package/dist/knowledge/baselines/rules/arb.json.good +174 -0
- package/dist/knowledge/baselines/rules/arbitration.json.good +393 -0
- package/dist/knowledge/baselines/rules/bridge.json.good +197 -0
- package/dist/knowledge/baselines/rules/contact.json.good +152 -0
- package/dist/knowledge/baselines/rules/demand.json.good +158 -0
- package/dist/knowledge/baselines/rules/graph.json.good +534 -0
- package/dist/knowledge/baselines/rules/guard.json +18 -5
- package/dist/knowledge/baselines/rules/guard.json.good +1192 -0
- package/dist/knowledge/baselines/rules/machine.json.good +734 -0
- package/dist/knowledge/baselines/rules/oracle.json +1 -1
- package/dist/knowledge/baselines/rules/oracle.json.good +120 -0
- package/dist/knowledge/baselines/rules/order.json.good +549 -0
- package/dist/knowledge/baselines/rules/payment.json.good +205 -0
- package/dist/knowledge/baselines/rules/permission.json.good +330 -0
- package/dist/knowledge/baselines/rules/personal.json.good +139 -0
- package/dist/knowledge/baselines/rules/plan.json +343 -1
- package/dist/knowledge/baselines/rules/plan.json.good +1187 -0
- package/dist/knowledge/baselines/rules/progress.json.good +364 -0
- package/dist/knowledge/baselines/rules/proof.json.good +158 -0
- package/dist/knowledge/baselines/rules/registrar.json.good +159 -0
- package/dist/knowledge/baselines/rules/repository.json.good +244 -0
- package/dist/knowledge/baselines/rules/resource.json.good +117 -0
- package/dist/knowledge/baselines/rules/reward.json +10 -10
- package/dist/knowledge/baselines/rules/reward.json.good +586 -0
- package/dist/knowledge/baselines/rules/service.json.good +595 -0
- package/dist/knowledge/baselines/rules/treasury.json.good +440 -0
- package/dist/knowledge/baselines/rules/util.json.good +101 -0
- package/dist/knowledge/builtin-templates.d.ts +13 -1
- package/dist/knowledge/builtin-templates.js +1 -1
- package/dist/knowledge/chain-query-registry.js +1 -1
- package/dist/knowledge/discount-threshold.js +1 -1
- package/dist/knowledge/fee-param-bindings.js +1 -1
- package/dist/knowledge/fund-layer.d.ts +2 -0
- package/dist/knowledge/fund-layer.js +1 -1
- package/dist/knowledge/getting-started.js +1 -1
- package/dist/knowledge/guard-binding-table.js +1 -1
- package/dist/knowledge/guard-binding-verifier.js +1 -1
- package/dist/knowledge/guard-create-preflight.js +1 -0
- package/dist/knowledge/guard-field-cognition.js +1 -1
- package/dist/knowledge/guard-host-context.js +1 -1
- package/dist/knowledge/guard-leg-eval.js +1 -0
- package/dist/knowledge/guard-node-gates.js +1 -1
- package/dist/knowledge/guard-puzzle.js +1 -1
- package/dist/knowledge/guard-quality.js +1 -0
- package/dist/knowledge/guard-render.js +1 -1
- package/dist/knowledge/guard-risk.js +1 -1
- package/dist/knowledge/guard-semantic-walk.js +1 -0
- package/dist/knowledge/guard-templates.d.ts +1 -0
- package/dist/knowledge/guard-templates.js +1 -1
- package/dist/knowledge/guard-translation.js +1 -1
- package/dist/knowledge/index.js +1 -1
- package/dist/knowledge/industry-registry.js +1 -1
- package/dist/knowledge/jsonrpc-enum.js +1 -1
- package/dist/knowledge/param-schema.js +1 -1
- package/dist/knowledge/param-tiers.js +1 -1
- package/dist/knowledge/path-oracle/coverage.js +1 -1
- package/dist/knowledge/path-oracle/index.js +1 -1
- package/dist/knowledge/path-oracle/products/airbnb.js +1 -0
- package/dist/knowledge/path-oracle/products/algora.js +1 -0
- package/dist/knowledge/path-oracle/products/alibaba-1688.js +1 -0
- package/dist/knowledge/path-oracle/products/amazon.js +1 -0
- package/dist/knowledge/path-oracle/products/beatstars.js +1 -0
- package/dist/knowledge/path-oracle/products/booking-com.js +1 -0
- package/dist/knowledge/path-oracle/products/contra.js +1 -0
- package/dist/knowledge/path-oracle/products/costco.js +1 -0
- package/dist/knowledge/path-oracle/products/coursera.js +1 -0
- package/dist/knowledge/path-oracle/products/duoduo-maicai.js +1 -0
- package/dist/knowledge/path-oracle/products/etsy.js +1 -0
- package/dist/knowledge/path-oracle/products/food-delivery.js +1 -1
- package/dist/knowledge/path-oracle/products/gamefound.js +1 -0
- package/dist/knowledge/path-oracle/products/gofundme.js +1 -0
- package/dist/knowledge/path-oracle/products/hackerone.js +1 -0
- package/dist/knowledge/path-oracle/products/kickstarter.js +1 -0
- package/dist/knowledge/path-oracle/products/klook.js +1 -0
- package/dist/knowledge/path-oracle/products/ninety-nine-designs.js +1 -0
- package/dist/knowledge/path-oracle/products/onlyfans.js +1 -0
- package/dist/knowledge/path-oracle/products/patreon.js +1 -0
- package/dist/knowledge/path-oracle/products/pinduoduo-kuaituantuan.js +1 -0
- package/dist/knowledge/path-oracle/products/royalty-exchange.js +1 -0
- package/dist/knowledge/path-oracle/products/shansong.js +1 -0
- package/dist/knowledge/path-oracle/products/taobao-presale.js +1 -0
- package/dist/knowledge/path-oracle/products/upwork-catalog.js +1 -0
- package/dist/knowledge/path-oracle/products/upwork.js +1 -0
- package/dist/knowledge/path-oracle/products/yuanfudao.js +1 -0
- package/dist/knowledge/path-oracle/products/ziroom.js +1 -0
- package/dist/knowledge/pattern-resolutions.js +1 -1
- package/dist/knowledge/product-detail-source.js +1 -1
- package/dist/knowledge/product-doc-b5.js +1 -1
- package/dist/knowledge/product-doc-facets.js +1 -0
- package/dist/knowledge/projection.js +1 -1
- package/dist/knowledge/publish-gate.js +1 -1
- package/dist/knowledge/publish-surface-contract.js +1 -1
- package/dist/knowledge/recipient-constraint.d.ts +20 -0
- package/dist/knowledge/recipient-constraint.js +1 -1
- package/dist/knowledge/rule-declaration-types.d.ts +13 -0
- package/dist/knowledge/rule-declaration-types.js +1 -0
- package/dist/knowledge/rule-declarations.js +1 -0
- package/dist/knowledge/scenario-modes.d.ts +6 -0
- package/dist/knowledge/scenario-topology.js +1 -1
- package/dist/knowledge/template-loader.js +1 -1
- package/dist/knowledge/template-prose.js +1 -1
- package/dist/knowledge/template-registry.js +1 -1
- package/dist/knowledge/template-scanner.js +1 -1
- package/dist/knowledge/tools-reference.js +1 -1
- package/dist/monitor/MonitorLoop.js +1 -1
- package/dist/playbooks/service-build/business-puzzle.js +1 -1
- package/dist/playbooks/service-build/machine-panorama.js +1 -1
- package/dist/playbooks/service-build/merchant-guide.js +1 -1
- package/dist/playbooks/service-build/object-panorama.js +1 -1
- package/dist/playbooks/service-build/participation-radar.js +1 -1
- package/dist/playbooks/service-build/relationship-profile.js +1 -1
- package/dist/playbooks/service-build/service-panorama.js +1 -1
- package/dist/playbooks/service-build/service-quote.js +1 -1
- package/dist/review/index.js +1 -1
- package/dist/review/service.js +1 -1
- package/dist/safety/confirm-gate.js +1 -1
- package/dist/schema/benchmark-migration/index.d.ts +9 -0
- package/dist/schema/benchmark-migration/index.js +1 -1
- package/dist/schema/call/arbitration.d.ts +8 -0
- package/dist/schema/call/arbitration.js +1 -1
- package/dist/schema/call/base.d.ts +8 -0
- package/dist/schema/call/base.js +1 -1
- package/dist/schema/call/bridge.d.ts +2 -0
- package/dist/schema/call/error-codes.d.ts +1 -1
- package/dist/schema/call/error-codes.js +1 -1
- package/dist/schema/call/handler.d.ts +2 -1
- package/dist/schema/call/handler.js +1 -1
- package/dist/schema/call/order.d.ts +10 -0
- package/dist/schema/call/permission-handler.js +1 -1
- package/dist/schema/call/permission.js +1 -1
- package/dist/schema/call/progress.d.ts +15 -0
- package/dist/schema/call/progress.js +1 -1
- package/dist/schema/call/receipt.d.ts +1 -0
- package/dist/schema/call/receipt.js +1 -1
- package/dist/schema/call/repository.d.ts +12 -0
- package/dist/schema/call/repository.js +1 -1
- 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 +5 -3
- package/dist/schema/call/service.js +1 -1
- package/dist/schema/common/index.js +1 -1
- package/dist/schema/envelope-unify.js +1 -1
- package/dist/schema/goal/index.d.ts +23 -0
- package/dist/schema/goal/planning.js +1 -1
- package/dist/schema/industry-pack/index.d.ts +2 -2
- package/dist/schema/local/index.d.ts +20 -0
- package/dist/schema/local/index.js +1 -1
- package/dist/schema/local/wip.d.ts +4 -0
- package/dist/schema/local/wip.js +1 -1
- package/dist/schema/messenger/index.d.ts +5 -0
- package/dist/schema/messenger/index.js +1 -1
- package/dist/schema/operations.d.ts +944 -1
- package/dist/schema/operations.js +1 -1
- package/dist/schema/query/bi.js +1 -1
- package/dist/schema/query/index.d.ts +5 -5
- package/dist/schema/query/index.js +1 -1
- package/dist/schema/schema-version.js +1 -1
- package/dist/schema/workspace/index.d.ts +2 -2
- package/dist/schema-query-impl/index.js +1 -1
- package/dist/schemas/account_operation.schema.json +1 -257
- package/dist/schemas/ask_user.schema.json +1 -78
- package/dist/schemas/benchmark_migration_operation.schema.json +1 -626
- package/dist/schemas/bridge_operation.schema.json +1 -1069
- package/dist/schemas/config_operation.schema.json +1 -82
- package/dist/schemas/employee_operation.schema.json +1 -319
- package/dist/schemas/evaluation_operation.schema.json +1 -3932
- package/dist/schemas/goal_operation.schema.json +1 -1650
- package/dist/schemas/guard2file.schema.json +1 -137
- package/dist/schemas/index.json +1 -285
- package/dist/schemas/industry_pack_operation.schema.json +1 -582
- package/dist/schemas/intent_radar.schema.json +1 -155
- package/dist/schemas/keeper_operation.schema.json +1 -364
- package/dist/schemas/local_cache_operation.schema.json +1 -116
- package/dist/schemas/local_history_operation.schema.json +1 -105
- package/dist/schemas/local_info_operation.schema.json +1 -140
- package/dist/schemas/local_mark_operation.schema.json +1 -124
- package/dist/schemas/machineNode2file.schema.json +1 -137
- package/dist/schemas/messenger_operation.schema.json +1 -2068
- package/dist/schemas/monitor_events.schema.json +1 -87
- package/dist/schemas/monitor_subscription.schema.json +1 -327
- package/dist/schemas/onchain_events.schema.json +1 -207
- package/dist/schemas/onchain_operations.schema.json +1 -28699
- package/dist/schemas/onchain_operations_allocation.schema.json +1 -1376
- package/dist/schemas/onchain_operations_arbitration.schema.json +1 -1355
- package/dist/schemas/onchain_operations_contact.schema.json +1 -988
- package/dist/schemas/onchain_operations_demand.schema.json +1 -1146
- package/dist/schemas/onchain_operations_gen_passport.schema.json +1 -663
- package/dist/schemas/onchain_operations_gen_proof.schema.json +1 -180
- package/dist/schemas/onchain_operations_guard.schema.json +1 -8518
- package/dist/schemas/onchain_operations_machine.schema.json +1 -1879
- package/dist/schemas/onchain_operations_order.schema.json +1 -1121
- package/dist/schemas/onchain_operations_payment.schema.json +1 -316
- package/dist/schemas/onchain_operations_permission.schema.json +1 -1036
- package/dist/schemas/onchain_operations_personal.schema.json +1 -1463
- package/dist/schemas/onchain_operations_progress.schema.json +1 -1041
- package/dist/schemas/onchain_operations_proof.schema.json +1 -750
- package/dist/schemas/onchain_operations_repository.schema.json +1 -2046
- package/dist/schemas/onchain_operations_reward.schema.json +1 -1286
- package/dist/schemas/onchain_operations_service.schema.json +1 -2602
- package/dist/schemas/onchain_operations_treasury.schema.json +1 -1527
- package/dist/schemas/onchain_table_data.schema.json +1 -1146
- package/dist/schemas/permission_operation.schema.json +1 -43
- package/dist/schemas/persona_operation.schema.json +1 -10424
- package/dist/schemas/query_toolkit.schema.json +1 -1867
- package/dist/schemas/schema_query.schema.json +1 -116
- package/dist/schemas/service_clone_operation.schema.json +1 -49
- package/dist/schemas/settle_sweep.schema.json +1 -0
- package/dist/schemas/strategy_review_operation.schema.json +1 -66
- package/dist/schemas/verify_guard_dry_run.schema.json +1 -0
- package/dist/schemas/watch_operation.schema.json +1 -145
- package/dist/schemas/wip_file.schema.json +1 -299
- package/dist/schemas/workflow_operation.schema.json +1 -722
- package/dist/schemas/workspace_operation.schema.json +1 -104
- package/dist/schemas/wowok_buildin_info.schema.json +1 -758
- package/dist/tools/handlers/benchmark-migration.js +1 -1
- package/dist/tools/handlers/config.js +1 -1
- package/dist/tools/handlers/entry-edge-recipe.js +1 -1
- package/dist/tools/handlers/file-export.js +1 -1
- package/dist/tools/handlers/local.js +1 -1
- package/dist/tools/handlers/messenger.js +1 -1
- package/dist/tools/handlers/onchain.js +1 -1
- package/dist/tools/handlers/pending-settlement-recipe.js +1 -0
- package/dist/tools/handlers/plan-recovery.js +1 -0
- package/dist/tools/handlers/query.js +1 -1
- package/dist/tools/handlers/repository-row-id.js +1 -0
- package/dist/tools/handlers/review-chain.js +1 -1
- package/dist/tools/handlers/settle-sweep.js +1 -0
- package/dist/tools/handlers/stale-build-check.js +1 -1
- package/dist/tools/handlers/submission-assembly.js +1 -1
- package/dist/tools/handlers/verify-guard-dry-run.js +1 -0
- package/dist/tools/handlers/wip-upload.js +1 -1
- package/dist/tools/index.d.ts +3 -1
- package/dist/tools/index.js +1 -1
- package/dist/tools/move-fn-index.gen.js +1 -1
- package/dist/tools/publish-gate-state.js +1 -1
- package/dist/tools/registry/business.js +1 -1
- package/dist/tools/registry/onchain.js +1 -1
- package/dist/tools/shared.js +1 -1
- package/dist/tools/types.d.ts +1 -1
- package/dist/tools/wrap.js +1 -1
- package/package.json +11 -4
- package/dist/chain-semantics/composition-truth.d.ts +0 -102
- package/dist/chain-semantics/eval-order.d.ts +0 -17
- package/dist/chain-semantics/field-capability.d.ts +0 -11
- package/dist/chain-semantics/freeze-map.d.ts +0 -11
- package/dist/chain-semantics/fund-flow.d.ts +0 -10
- package/dist/chain-semantics/guard-verbs.d.ts +0 -22
- package/dist/chain-semantics/index.d.ts +0 -12
- package/dist/chain-semantics/object-graph.d.ts +0 -18
- package/dist/communication/evidence.d.ts +0 -6
- package/dist/communication/message-cursors.d.ts +0 -35
- package/dist/communication/proof-reuse.d.ts +0 -9
- package/dist/communication/wts-attestation.d.ts +0 -39
- package/dist/composition/audit.d.ts +0 -15
- package/dist/composition/blueprint-view.d.ts +0 -63
- package/dist/composition/compile.d.ts +0 -83
- package/dist/composition/emit-phases.d.ts +0 -234
- package/dist/composition/generate.d.ts +0 -40
- package/dist/composition/guard-fill.d.ts +0 -52
- package/dist/composition/inflight.d.ts +0 -86
- package/dist/composition/input-normalize.d.ts +0 -15
- package/dist/composition/materialize.d.ts +0 -78
- package/dist/composition/mode-gates.d.ts +0 -35
- package/dist/composition/param-disclosure.d.ts +0 -61
- package/dist/composition/plan-retry-ledger.d.ts +0 -37
- package/dist/composition/plan.d.ts +0 -121
- package/dist/composition/product-card.d.ts +0 -94
- package/dist/composition/reflux.d.ts +0 -28
- package/dist/composition/supply-chain-emit.d.ts +0 -46
- package/dist/config/config-audit.spec.d.ts +0 -1
- package/dist/config/config-audit.spec.js +0 -1
- package/dist/config/config-warnings.d.ts +0 -2
- package/dist/config/index.d.ts +0 -4
- package/dist/config/judgment.spec.d.ts +0 -1
- package/dist/config/judgment.spec.js +0 -1
- package/dist/config/match-policy-file.d.ts +0 -34
- package/dist/config/match-policy-file.spec.d.ts +0 -1
- package/dist/config/match-policy-file.spec.js +0 -1
- package/dist/config/rule-engine.spec.d.ts +0 -1
- package/dist/config/rule-engine.spec.js +0 -1
- package/dist/config/runtime.d.ts +0 -29
- package/dist/config/store-policy.d.ts +0 -14
- package/dist/config/store-policy.spec.d.ts +0 -1
- package/dist/config/store-policy.spec.js +0 -1
- package/dist/config/template-params.d.ts +0 -42
- package/dist/config/template-params.spec.d.ts +0 -1
- package/dist/config/template-params.spec.js +0 -1
- package/dist/customer/account-events.d.ts +0 -32
- package/dist/data/api/api.spec.d.ts +0 -1
- package/dist/data/api/api.spec.js +0 -1
- package/dist/data/api/cli.d.ts +0 -1
- package/dist/data/api/head.d.ts +0 -16
- package/dist/data/api/head.spec.d.ts +0 -1
- package/dist/data/api/head.spec.js +0 -1
- package/dist/data/api/index.d.ts +0 -2
- package/dist/data/api/match.d.ts +0 -69
- package/dist/data/api/match.spec.d.ts +0 -1
- package/dist/data/api/match.spec.js +0 -1
- package/dist/data/api/server.d.ts +0 -13
- package/dist/data/projection/cli.d.ts +0 -1
- package/dist/data/projection/edges.d.ts +0 -8
- package/dist/data/projection/edges.spec.d.ts +0 -1
- package/dist/data/projection/edges.spec.js +0 -1
- package/dist/data/projection/facets.d.ts +0 -18
- package/dist/data/projection/facets.spec.d.ts +0 -1
- package/dist/data/projection/facets.spec.js +0 -1
- package/dist/data/projection/facts.d.ts +0 -40
- package/dist/data/projection/index.d.ts +0 -6
- package/dist/data/projection/project.d.ts +0 -10
- package/dist/data/projection/projection.spec.d.ts +0 -1
- package/dist/data/projection/projection.spec.js +0 -1
- package/dist/data/projection/schema.d.ts +0 -1
- package/dist/data/projection/store.d.ts +0 -51
- package/dist/data/projection/types.d.ts +0 -169
- package/dist/data/sync/cdc.d.ts +0 -33
- package/dist/data/sync/cdc.spec.d.ts +0 -1
- package/dist/data/sync/cdc.spec.js +0 -1
- package/dist/data/sync/graphql-source.d.ts +0 -16
- package/dist/data/sync/index.d.ts +0 -5
- package/dist/data/sync/reconciler.d.ts +0 -14
- package/dist/data/sync/reconciler.spec.d.ts +0 -1
- package/dist/data/sync/reconciler.spec.js +0 -1
- package/dist/data/sync/schema.d.ts +0 -1
- package/dist/data/sync/store.d.ts +0 -24
- package/dist/data/sync/sync.spec.d.ts +0 -1
- package/dist/data/sync/sync.spec.js +0 -1
- package/dist/data/sync/synchronizer.d.ts +0 -10
- package/dist/data/sync/types.d.ts +0 -164
- package/dist/evaluation/acceptance.d.ts +0 -33
- package/dist/evaluation/architecture.spec.d.ts +0 -1
- package/dist/evaluation/architecture.spec.js +0 -1
- package/dist/evaluation/builtins/arbitration-score.d.ts +0 -42
- package/dist/evaluation/builtins/demand-match.d.ts +0 -16
- package/dist/evaluation/builtins/graph-service.spec.d.ts +0 -1
- package/dist/evaluation/builtins/graph-service.spec.js +0 -1
- package/dist/evaluation/builtins/index.d.ts +0 -4
- package/dist/evaluation/builtins/purity.spec.d.ts +0 -1
- package/dist/evaluation/builtins/purity.spec.js +0 -1
- package/dist/evaluation/composer.d.ts +0 -38
- package/dist/evaluation/facets/catalog.d.ts +0 -19
- package/dist/evaluation/gap.d.ts +0 -2
- package/dist/evaluation/guard-scan.d.ts +0 -10
- package/dist/evaluation/index.d.ts +0 -14
- package/dist/evaluation/injection.d.ts +0 -6
- package/dist/evaluation/location-match.d.ts +0 -42
- package/dist/evaluation/match-operation.d.ts +0 -23
- package/dist/evaluation/match-policy-resolver.d.ts +0 -9
- package/dist/evaluation/match-policy.spec.d.ts +0 -1
- package/dist/evaluation/match-policy.spec.js +0 -1
- package/dist/evaluation/path-reasoning.d.ts +0 -37
- package/dist/evaluation/standards.d.ts +0 -11
- package/dist/evaluation/standards.spec.d.ts +0 -1
- package/dist/evaluation/standards.spec.js +0 -1
- package/dist/evaluation/structured-lines.d.ts +0 -8
- package/dist/evaluation/user-injection.d.ts +0 -6
- package/dist/experience/experience-reuse.d.ts +0 -10
- package/dist/experience/index.d.ts +0 -7
- package/dist/experience/persistence-config.d.ts +0 -6
- package/dist/experience/persistence.d.ts +0 -21
- package/dist/experience/realtime-feedback.d.ts +0 -5
- package/dist/experience/user-profile.d.ts +0 -25
- package/dist/extensions/capability.d.ts +0 -91
- package/dist/extensions/industry-audit.spec.d.ts +0 -1
- package/dist/extensions/industry-audit.spec.js +0 -1
- package/dist/goal/GoalClassifier.d.ts +0 -17
- package/dist/goal/GoalEngine.d.ts +0 -175
- package/dist/goal/GoalStore.d.ts +0 -27
- package/dist/goal/next-steps.d.ts +0 -12
- package/dist/goal/plan-approval.d.ts +0 -5
- package/dist/goal/pursue.d.ts +0 -18
- package/dist/graph/base.d.ts +0 -8
- package/dist/graph/onchain/analyze.d.ts +0 -59
- package/dist/graph/onchain/analyze.spec.d.ts +0 -1
- package/dist/graph/onchain/analyze.spec.js +0 -1
- package/dist/graph/onchain/anti-cheat.d.ts +0 -69
- package/dist/graph/onchain/anti-cheat.spec.d.ts +0 -1
- package/dist/graph/onchain/anti-cheat.spec.js +0 -1
- package/dist/graph/onchain/dataplane.d.ts +0 -44
- package/dist/graph/onchain/edge-batch.spec.d.ts +0 -1
- package/dist/graph/onchain/edge-batch.spec.js +0 -1
- package/dist/graph/onchain/edge-schema.d.ts +0 -69
- package/dist/graph/onchain/entity-profile.spec.d.ts +0 -1
- package/dist/graph/onchain/entity-profile.spec.js +0 -1
- package/dist/graph/onchain/event-history.spec.d.ts +0 -1
- package/dist/graph/onchain/event-history.spec.js +0 -1
- package/dist/graph/onchain/expand.d.ts +0 -4
- package/dist/graph/onchain/exploration.d.ts +0 -28
- package/dist/graph/onchain/exploration.spec.d.ts +0 -1
- package/dist/graph/onchain/exploration.spec.js +0 -1
- package/dist/graph/onchain/exposure.d.ts +0 -18
- package/dist/graph/onchain/exposure.spec.d.ts +0 -1
- package/dist/graph/onchain/exposure.spec.js +0 -1
- package/dist/graph/onchain/extract-deep.spec.d.ts +0 -1
- package/dist/graph/onchain/extract-deep.spec.js +0 -1
- package/dist/graph/onchain/extract.d.ts +0 -29
- package/dist/graph/onchain/facet-projection.d.ts +0 -99
- package/dist/graph/onchain/facet-projection.spec.d.ts +0 -1
- package/dist/graph/onchain/facet-projection.spec.js +0 -1
- package/dist/graph/onchain/facts.spec.d.ts +0 -1
- package/dist/graph/onchain/facts.spec.js +0 -1
- package/dist/graph/onchain/field-manifest.d.ts +0 -29
- package/dist/graph/onchain/field-manifest.spec.d.ts +0 -1
- package/dist/graph/onchain/field-manifest.spec.js +0 -1
- package/dist/graph/onchain/fixtures.d.ts +0 -80
- package/dist/graph/onchain/fixtures.spec.d.ts +0 -1
- package/dist/graph/onchain/fixtures.spec.js +0 -1
- package/dist/graph/onchain/graph-policy.spec.d.ts +0 -1
- package/dist/graph/onchain/graph-policy.spec.js +0 -1
- package/dist/graph/onchain/index.d.ts +0 -29
- package/dist/graph/onchain/interest.d.ts +0 -10
- package/dist/graph/onchain/interest.spec.d.ts +0 -1
- package/dist/graph/onchain/interest.spec.js +0 -1
- package/dist/graph/onchain/label-lint.spec.d.ts +0 -1
- package/dist/graph/onchain/label-lint.spec.js +0 -1
- package/dist/graph/onchain/names.d.ts +0 -23
- package/dist/graph/onchain/names.spec.d.ts +0 -1
- package/dist/graph/onchain/names.spec.js +0 -1
- package/dist/graph/onchain/object-held-receipts.d.ts +0 -20
- package/dist/graph/onchain/object-held-receipts.spec.d.ts +0 -1
- package/dist/graph/onchain/object-held-receipts.spec.js +0 -1
- package/dist/graph/onchain/onchain.spec.d.ts +0 -1
- package/dist/graph/onchain/onchain.spec.js +0 -1
- package/dist/graph/onchain/policy.d.ts +0 -8
- package/dist/graph/onchain/project-relationship.d.ts +0 -3
- package/dist/graph/onchain/proposal-graph.d.ts +0 -11
- package/dist/graph/onchain/proposal-graph.spec.d.ts +0 -1
- package/dist/graph/onchain/proposal-graph.spec.js +0 -1
- package/dist/graph/onchain/sdk-batch.d.ts +0 -129
- package/dist/graph/onchain/sdk-dataplane.d.ts +0 -44
- package/dist/graph/onchain/strategy.spec.d.ts +0 -1
- package/dist/graph/onchain/strategy.spec.js +0 -1
- package/dist/graph/onchain/synthesis.d.ts +0 -20
- package/dist/graph/onchain/synthesis.spec.d.ts +0 -1
- package/dist/graph/onchain/synthesis.spec.js +0 -1
- package/dist/graph/onchain/table-ledger.spec.d.ts +0 -1
- package/dist/graph/onchain/table-ledger.spec.js +0 -1
- package/dist/graph/onchain/viewport.d.ts +0 -6
- package/dist/harness/auto-escalation.d.ts +0 -15
- package/dist/intent/enrich.d.ts +0 -1
- package/dist/intent/index.d.ts +0 -23
- package/dist/intent/matcher.d.ts +0 -2
- package/dist/intent/store.d.ts +0 -19
- package/dist/intent/types.d.ts +0 -32
- package/dist/keeper/KeeperScan.d.ts +0 -41
- package/dist/keeper/KeeperStore.d.ts +0 -43
- package/dist/keeper/detectors.d.ts +0 -42
- package/dist/keeper/keeper.spec.d.ts +0 -1
- package/dist/keeper/keeper.spec.js +0 -1
- package/dist/keeper/types.d.ts +0 -67
- package/dist/knowledge/account-marks.d.ts +0 -36
- package/dist/knowledge/allocation-ledger.d.ts +0 -75
- package/dist/knowledge/allocation-puzzle.d.ts +0 -138
- package/dist/knowledge/allocation-risk.d.ts +0 -82
- package/dist/knowledge/allocation-templates.d.ts +0 -38
- package/dist/knowledge/allocator-rail-verifier.d.ts +0 -59
- package/dist/knowledge/anti-cheat.d.ts +0 -2
- package/dist/knowledge/arb-fund-facts.d.ts +0 -51
- package/dist/knowledge/arb-risk.d.ts +0 -39
- package/dist/knowledge/arbitration-puzzle.d.ts +0 -84
- package/dist/knowledge/arbitration-rail-verifier.d.ts +0 -35
- package/dist/knowledge/arbitration-risk.d.ts +0 -114
- package/dist/knowledge/arbitration-templates.d.ts +0 -39
- package/dist/knowledge/arbitration-venue-order.d.ts +0 -25
- package/dist/knowledge/baselines/guard-lint-baseline.spec.d.ts +0 -1
- package/dist/knowledge/baselines/guard-lint-baseline.spec.js +0 -1
- package/dist/knowledge/baselines/risk-baselines.spec.d.ts +0 -1
- package/dist/knowledge/baselines/risk-baselines.spec.js +0 -1
- package/dist/knowledge/baselines/risk-cases.d.ts +0 -8
- package/dist/knowledge/baselines/semantic-facts.d.ts +0 -12
- package/dist/knowledge/bridge-risk.d.ts +0 -36
- package/dist/knowledge/catalog-facts.d.ts +0 -4
- package/dist/knowledge/chain-query-registry.d.ts +0 -14
- package/dist/knowledge/commission-landing.d.ts +0 -26
- package/dist/knowledge/component-schema.d.ts +0 -64
- package/dist/knowledge/contact-risk.d.ts +0 -32
- package/dist/knowledge/contact-templates.d.ts +0 -26
- package/dist/knowledge/contract-invariants.d.ts +0 -54
- package/dist/knowledge/demand-risk.d.ts +0 -30
- package/dist/knowledge/discount-threshold.d.ts +0 -26
- package/dist/knowledge/dynamic-pricing.d.ts +0 -29
- package/dist/knowledge/entity-recipient-guard.d.ts +0 -21
- package/dist/knowledge/event-semantics.d.ts +0 -23
- package/dist/knowledge/evidence-review.d.ts +0 -35
- package/dist/knowledge/fee-param-bindings.d.ts +0 -28
- package/dist/knowledge/flywheel-loop.d.ts +0 -41
- package/dist/knowledge/game-scenarios.d.ts +0 -21
- package/dist/knowledge/getting-started.d.ts +0 -37
- package/dist/knowledge/goal-completion.d.ts +0 -31
- package/dist/knowledge/guard-anchor-reach.d.ts +0 -19
- package/dist/knowledge/guard-binding-table.d.ts +0 -52
- package/dist/knowledge/guard-binding-verifier.d.ts +0 -37
- package/dist/knowledge/guard-bindings.d.ts +0 -21
- package/dist/knowledge/guard-blueprint.d.ts +0 -68
- package/dist/knowledge/guard-design-patterns.d.ts +0 -38
- package/dist/knowledge/guard-eval.d.ts +0 -15
- package/dist/knowledge/guard-field-cognition.d.ts +0 -48
- package/dist/knowledge/guard-host-context.d.ts +0 -24
- package/dist/knowledge/guard-ledger.d.ts +0 -19
- package/dist/knowledge/guard-leg-map.d.ts +0 -5
- package/dist/knowledge/guard-lint.d.ts +0 -79
- package/dist/knowledge/guard-node-gates.d.ts +0 -9
- package/dist/knowledge/guard-puzzle.d.ts +0 -188
- package/dist/knowledge/guard-render.d.ts +0 -71
- package/dist/knowledge/guard-risk.d.ts +0 -71
- package/dist/knowledge/guard-submission-brief.d.ts +0 -94
- package/dist/knowledge/guard-submission-prompt.d.ts +0 -63
- package/dist/knowledge/guard-translation.d.ts +0 -58
- package/dist/knowledge/index.d.ts +0 -299
- package/dist/knowledge/industry-evolution.d.ts +0 -82
- package/dist/knowledge/industry-generalizer.d.ts +0 -63
- package/dist/knowledge/industry-rule-node.d.ts +0 -7
- package/dist/knowledge/industry-strategy.d.ts +0 -91
- package/dist/knowledge/intent-metrics.d.ts +0 -43
- package/dist/knowledge/jsonrpc-enum.d.ts +0 -102
- package/dist/knowledge/knob-docs.d.ts +0 -5
- package/dist/knowledge/machine-fork-watch.d.ts +0 -9
- package/dist/knowledge/machine-ledger.d.ts +0 -42
- package/dist/knowledge/machine-puzzle.d.ts +0 -206
- package/dist/knowledge/machine-risk.d.ts +0 -72
- package/dist/knowledge/machine-templates.d.ts +0 -92
- package/dist/knowledge/machine-topology.d.ts +0 -116
- package/dist/knowledge/machine-translation.d.ts +0 -96
- package/dist/knowledge/market-metrics.d.ts +0 -34
- package/dist/knowledge/market-operations.d.ts +0 -46
- package/dist/knowledge/migration-preflight.d.ts +0 -27
- package/dist/knowledge/object-dependency.d.ts +0 -31
- package/dist/knowledge/operation-dictionary.d.ts +0 -18
- package/dist/knowledge/order-ledger.d.ts +0 -69
- package/dist/knowledge/order-puzzle.d.ts +0 -162
- package/dist/knowledge/order-risk.d.ts +0 -62
- package/dist/knowledge/order-templates.d.ts +0 -50
- package/dist/knowledge/param-schema.d.ts +0 -93
- package/dist/knowledge/param-tiers.d.ts +0 -27
- package/dist/knowledge/passport-ledger.d.ts +0 -60
- package/dist/knowledge/passport-templates.d.ts +0 -40
- package/dist/knowledge/path-oracle/coverage.d.ts +0 -16
- package/dist/knowledge/path-oracle/index.d.ts +0 -5
- package/dist/knowledge/path-oracle/products/food-delivery.d.ts +0 -2
- package/dist/knowledge/path-oracle/schema.d.ts +0 -188
- package/dist/knowledge/pattern-resolutions.d.ts +0 -110
- package/dist/knowledge/payment-risk.d.ts +0 -38
- package/dist/knowledge/payment-tracker.d.ts +0 -63
- package/dist/knowledge/permission-ledger.d.ts +0 -49
- package/dist/knowledge/permission-puzzle.d.ts +0 -122
- package/dist/knowledge/permission-risk.d.ts +0 -70
- package/dist/knowledge/permission-templates.d.ts +0 -38
- package/dist/knowledge/personal-risk.d.ts +0 -36
- package/dist/knowledge/product-detail-source.d.ts +0 -37
- package/dist/knowledge/product-doc-b5.d.ts +0 -16
- package/dist/knowledge/progress-ledger.d.ts +0 -63
- package/dist/knowledge/progress-puzzle.d.ts +0 -82
- package/dist/knowledge/progress-risk.d.ts +0 -75
- package/dist/knowledge/progress-templates.d.ts +0 -38
- package/dist/knowledge/projection.d.ts +0 -54
- package/dist/knowledge/projection.spec.d.ts +0 -1
- package/dist/knowledge/projection.spec.js +0 -1
- package/dist/knowledge/proof-risk.d.ts +0 -33
- package/dist/knowledge/protocol-facts.d.ts +0 -17
- package/dist/knowledge/publish-gate.d.ts +0 -20
- package/dist/knowledge/publish-readiness.d.ts +0 -25
- package/dist/knowledge/publish-surface-contract.d.ts +0 -16
- package/dist/knowledge/puzzle-projections.d.ts +0 -11
- package/dist/knowledge/rail-exit-satisfiability.d.ts +0 -25
- package/dist/knowledge/registrar-risk.d.ts +0 -34
- package/dist/knowledge/release-sentinel.d.ts +0 -12
- package/dist/knowledge/repository-risk.d.ts +0 -46
- package/dist/knowledge/repository-write-semantics.d.ts +0 -27
- package/dist/knowledge/reputation-rules.d.ts +0 -36
- package/dist/knowledge/requirement-families.d.ts +0 -13
- package/dist/knowledge/resource-risk.d.ts +0 -32
- package/dist/knowledge/reward-ledger.d.ts +0 -97
- package/dist/knowledge/reward-puzzle.d.ts +0 -98
- package/dist/knowledge/reward-risk.d.ts +0 -86
- package/dist/knowledge/reward-templates.d.ts +0 -25
- package/dist/knowledge/rule-node-analyzers.d.ts +0 -49
- package/dist/knowledge/rule-outcome.d.ts +0 -5
- package/dist/knowledge/scenario-topology.d.ts +0 -48
- package/dist/knowledge/semantic-ir.d.ts +0 -136
- package/dist/knowledge/service-allocation-semantics.d.ts +0 -36
- package/dist/knowledge/service-allocator-audit-node.d.ts +0 -3
- package/dist/knowledge/service-ledger.d.ts +0 -87
- package/dist/knowledge/service-puzzle.d.ts +0 -158
- package/dist/knowledge/service-risk-node.d.ts +0 -3
- package/dist/knowledge/service-risk.d.ts +0 -110
- package/dist/knowledge/service-templates.d.ts +0 -41
- package/dist/knowledge/settlement-semantics.d.ts +0 -1
- package/dist/knowledge/strategy-manuals.d.ts +0 -15
- package/dist/knowledge/supply-chain.d.ts +0 -35
- package/dist/knowledge/template-index.d.ts +0 -19
- package/dist/knowledge/template-loader.d.ts +0 -425
- package/dist/knowledge/template-nav.d.ts +0 -9
- package/dist/knowledge/template-prose.d.ts +0 -50
- package/dist/knowledge/template-registry.d.ts +0 -48
- package/dist/knowledge/template-scanner.d.ts +0 -158
- package/dist/knowledge/template-test-profiles.d.ts +0 -17
- package/dist/knowledge/template-validation.d.ts +0 -3
- package/dist/knowledge/tools-reference.d.ts +0 -17
- package/dist/knowledge/treasury-ledger.d.ts +0 -42
- package/dist/knowledge/treasury-puzzle.d.ts +0 -163
- package/dist/knowledge/treasury-risk.d.ts +0 -88
- package/dist/knowledge/treasury-templates.d.ts +0 -38
- package/dist/knowledge/universal-template.d.ts +0 -22
- package/dist/knowledge/util-risk.d.ts +0 -30
- package/dist/knowledge/workflow-guidance.d.ts +0 -194
- package/dist/knowledge/workspace-lists.d.ts +0 -61
- package/dist/monitor/SuggestionBridge.spec.d.ts +0 -1
- package/dist/monitor/SuggestionBridge.spec.js +0 -1
- package/dist/participation/arbitrator-interest.d.ts +0 -22
- package/dist/participation/demander-interest.d.ts +0 -23
- package/dist/participation/employee-kpi.d.ts +0 -37
- package/dist/participation/employee-kpi.spec.d.ts +0 -1
- package/dist/participation/employee-kpi.spec.js +0 -1
- package/dist/participation/employee-store.d.ts +0 -16
- package/dist/participation/game-context.d.ts +0 -25
- package/dist/participation/index.d.ts +0 -2
- package/dist/participation/node-action-advisor.d.ts +0 -68
- package/dist/participation/time-window.d.ts +0 -48
- package/dist/persona/facet-profile.d.ts +0 -33
- package/dist/persona/persona-audit.spec.d.ts +0 -1
- package/dist/persona/persona-audit.spec.js +0 -1
- package/dist/playbooks/service-build/business-puzzle.d.ts +0 -48
- package/dist/playbooks/service-build/context-assembly.d.ts +0 -32
- package/dist/playbooks/service-build/facet-money.d.ts +0 -33
- package/dist/playbooks/service-build/facet-money.spec.d.ts +0 -1
- package/dist/playbooks/service-build/facet-money.spec.js +0 -1
- package/dist/playbooks/service-build/game-theory.d.ts +0 -47
- package/dist/playbooks/service-build/index.d.ts +0 -15
- package/dist/playbooks/service-build/intent-analyzer.d.ts +0 -72
- package/dist/playbooks/service-build/machine-nodes.d.ts +0 -27
- package/dist/playbooks/service-build/machine-panorama.d.ts +0 -71
- package/dist/playbooks/service-build/merchant-guide.d.ts +0 -382
- package/dist/playbooks/service-build/migration-planner.d.ts +0 -61
- package/dist/playbooks/service-build/mode-actions.d.ts +0 -260
- package/dist/playbooks/service-build/object-panorama.d.ts +0 -317
- package/dist/playbooks/service-build/object-type.d.ts +0 -1
- package/dist/playbooks/service-build/participation-radar.d.ts +0 -20
- package/dist/playbooks/service-build/pipeline-actions.d.ts +0 -108
- package/dist/playbooks/service-build/process.d.ts +0 -6
- package/dist/playbooks/service-build/relationship-profile.d.ts +0 -3
- package/dist/playbooks/service-build/reverse-mapping-nk4.spec.d.ts +0 -1
- package/dist/playbooks/service-build/reverse-mapping-nk4.spec.js +0 -1
- package/dist/playbooks/service-build/reverse-mapping-refund-p0-5.spec.d.ts +0 -1
- package/dist/playbooks/service-build/reverse-mapping-refund-p0-5.spec.js +0 -1
- package/dist/playbooks/service-build/reverse-mapping.d.ts +0 -66
- package/dist/playbooks/service-build/risk-aggregator.d.ts +0 -59
- package/dist/playbooks/service-build/service-panorama.d.ts +0 -229
- package/dist/playbooks/service-build/service-quote.d.ts +0 -2
- package/dist/playbooks/service-build/service-quote.spec.d.ts +0 -1
- package/dist/playbooks/service-build/service-quote.spec.js +0 -1
- package/dist/playbooks/service-build/topology-evaluation.spec.d.ts +0 -1
- package/dist/playbooks/service-build/topology-evaluation.spec.js +0 -1
- package/dist/playbooks/service-build/topology-query.d.ts +0 -25
- package/dist/playbooks/service-build/workflow-design-assessment.d.ts +0 -33
- package/dist/relationship/derivation.d.ts +0 -95
- package/dist/relationship/derivation.spec.d.ts +0 -1
- package/dist/relationship/derivation.spec.js +0 -1
- package/dist/relationship/incentive.d.ts +0 -38
- package/dist/relationship/index.d.ts +0 -4
- package/dist/relationship/registry.d.ts +0 -13
- package/dist/relationship/types.d.ts +0 -45
- package/dist/review/arb.d.ts +0 -4
- package/dist/review/demand.d.ts +0 -3
- package/dist/review/index.d.ts +0 -3
- package/dist/review/machine.d.ts +0 -3
- package/dist/review/order.d.ts +0 -8
- package/dist/review/progress.d.ts +0 -3
- package/dist/review/repository.d.ts +0 -3
- package/dist/review/service.d.ts +0 -5
- package/dist/review/types.d.ts +0 -163
- package/dist/role/derivation.d.ts +0 -35
- package/dist/role/index.d.ts +0 -6
- package/dist/role/intent.d.ts +0 -23
- package/dist/role/model.d.ts +0 -9
- package/dist/role/profiles.d.ts +0 -26
- package/dist/role/resolution.d.ts +0 -27
- package/dist/runtime/instance-registry.d.ts +0 -14
- package/dist/safety/index.d.ts +0 -3
- package/dist/schema/call/permission-handler.d.ts +0 -5
- package/dist/schema/call/semantic-customer-advice.spec.d.ts +0 -1
- package/dist/schema/call/semantic-customer-advice.spec.js +0 -1
- package/dist/schema/common/tokentype-short-probe.spec.d.ts +0 -1
- package/dist/schema/common/tokentype-short-probe.spec.js +0 -1
- package/dist/schema/envelope-unify.d.ts +0 -5
- package/dist/schema/goal/planning.d.ts +0 -742
- package/dist/schema/industry-pack/modes.d.ts +0 -447
- package/dist/schema/query/bi.d.ts +0 -3369
- package/dist/schema/utils/guard-query-utils.d.ts +0 -18
- package/dist/schema/utils/permission-index-utils.d.ts +0 -2
- package/dist/schema/utils/skills-recommendation.d.ts +0 -2
- package/dist/schema-query-impl/index.d.ts +0 -83
- package/dist/schemas/account_operation.output.json +0 -3869
- package/dist/schemas/ask_user.output.json +0 -54
- package/dist/schemas/benchmark_migration_operation.output.json +0 -1669
- package/dist/schemas/bridge_operation.output.json +0 -1548
- package/dist/schemas/config_operation.output.json +0 -896
- package/dist/schemas/employee_operation.output.json +0 -307
- package/dist/schemas/evaluation_operation.output.json +0 -4716
- package/dist/schemas/guard2file.output.json +0 -83
- package/dist/schemas/industry_pack_operation.output.json +0 -2985
- package/dist/schemas/intent_radar.output.json +0 -326
- package/dist/schemas/keeper_operation.output.json +0 -1441
- package/dist/schemas/local_cache_operation.output.json +0 -1718
- package/dist/schemas/local_history_operation.output.json +0 -1644
- package/dist/schemas/local_info_operation.output.json +0 -1530
- package/dist/schemas/local_mark_operation.output.json +0 -1622
- package/dist/schemas/machineNode2file.output.json +0 -88
- package/dist/schemas/messenger_operation.output.json +0 -4692
- package/dist/schemas/monitor_events.output.json +0 -1602
- package/dist/schemas/monitor_subscription.output.json +0 -1629
- package/dist/schemas/onchain_events.output.json +0 -4053
- package/dist/schemas/onchain_operations.output.json +0 -7788
- package/dist/schemas/onchain_table_data.output.json +0 -11868
- package/dist/schemas/permission_operation.output.json +0 -205
- package/dist/schemas/persona_operation.output.json +0 -64612
- package/dist/schemas/query_toolkit.output.json +0 -28302
- package/dist/schemas/schema_query.output.json +0 -81
- package/dist/schemas/service_clone_operation.output.json +0 -247
- package/dist/schemas/strategy_review_operation.output.json +0 -532
- package/dist/schemas/watch_operation.output.json +0 -930
- package/dist/schemas/wip_file.output.json +0 -360
- package/dist/schemas/workflow_operation.output.json +0 -422
- package/dist/schemas/workspace_operation.output.json +0 -477
- package/dist/schemas/wowok_buildin_info.output.json +0 -2477
- package/dist/strategy/collectors.d.ts +0 -66
- package/dist/strategy/collectors.spec.d.ts +0 -1
- package/dist/strategy/collectors.spec.js +0 -1
- package/dist/strategy/index.d.ts +0 -5
- package/dist/strategy/metrics.d.ts +0 -20
- package/dist/strategy/review.d.ts +0 -48
- package/dist/strategy/scorecard.d.ts +0 -32
- package/dist/strategy/store.d.ts +0 -26
- package/dist/task/ProcessStore.d.ts +0 -98
- package/dist/task/playbook.d.ts +0 -11
- package/dist/task/substep-trace.d.ts +0 -91
- package/dist/tools/build-fingerprint.d.ts +0 -28
- package/dist/tools/error-catalog.d.ts +0 -17
- package/dist/tools/handlers/ask-user.d.ts +0 -3
- package/dist/tools/handlers/benchmark-migration.d.ts +0 -121
- package/dist/tools/handlers/bridge.d.ts +0 -8
- package/dist/tools/handlers/config.d.ts +0 -2
- package/dist/tools/handlers/dispatch-expectations.d.ts +0 -2
- package/dist/tools/handlers/dispatch-expectations.spec.d.ts +0 -1
- package/dist/tools/handlers/dispatch-expectations.spec.js +0 -1
- package/dist/tools/handlers/employee.d.ts +0 -8
- package/dist/tools/handlers/employee.spec.d.ts +0 -1
- package/dist/tools/handlers/employee.spec.js +0 -1
- package/dist/tools/handlers/entry-edge-recipe.d.ts +0 -101
- package/dist/tools/handlers/escrow-deficit.d.ts +0 -10
- package/dist/tools/handlers/evaluation.d.ts +0 -2
- package/dist/tools/handlers/evaluation.spec.d.ts +0 -1
- package/dist/tools/handlers/evaluation.spec.js +0 -1
- package/dist/tools/handlers/file-export.d.ts +0 -3
- package/dist/tools/handlers/fund-rail-recipe.d.ts +0 -10
- package/dist/tools/handlers/goal.d.ts +0 -4
- package/dist/tools/handlers/industry-pack.d.ts +0 -3
- package/dist/tools/handlers/intent-radar.d.ts +0 -2
- package/dist/tools/handlers/keeper.d.ts +0 -12
- package/dist/tools/handlers/local.d.ts +0 -6
- package/dist/tools/handlers/mark-namespace.d.ts +0 -30
- package/dist/tools/handlers/messenger.d.ts +0 -24
- package/dist/tools/handlers/monitor.d.ts +0 -26
- package/dist/tools/handlers/name-resolution.d.ts +0 -4
- package/dist/tools/handlers/name-resolution.spec.d.ts +0 -1
- package/dist/tools/handlers/name-resolution.spec.js +0 -1
- package/dist/tools/handlers/network.d.ts +0 -1
- package/dist/tools/handlers/onchain-name-registration.d.ts +0 -49
- package/dist/tools/handlers/onchain-name-registration.spec.d.ts +0 -1
- package/dist/tools/handlers/onchain-name-registration.spec.js +0 -1
- package/dist/tools/handlers/onchain.d.ts +0 -132
- package/dist/tools/handlers/permission.d.ts +0 -2
- package/dist/tools/handlers/persona.d.ts +0 -4
- package/dist/tools/handlers/publish-binding-echo.d.ts +0 -22
- package/dist/tools/handlers/review-chain.d.ts +0 -19
- package/dist/tools/handlers/schema-query.d.ts +0 -2
- package/dist/tools/handlers/service-clone.d.ts +0 -20
- package/dist/tools/handlers/stale-build-check.d.ts +0 -9
- package/dist/tools/handlers/strategy-review.d.ts +0 -2
- package/dist/tools/handlers/submission-assembly.d.ts +0 -55
- package/dist/tools/handlers/watch.d.ts +0 -2
- package/dist/tools/handlers/winner-derivation.d.ts +0 -20
- package/dist/tools/handlers/wip-upload.d.ts +0 -22
- package/dist/tools/handlers/wip.d.ts +0 -2
- package/dist/tools/handlers/workflow.d.ts +0 -2
- package/dist/tools/handlers/workspace.d.ts +0 -4
- package/dist/tools/move-fn-index.gen.d.ts +0 -3
- package/dist/tools/publish-gate-state.d.ts +0 -5
- package/dist/tools/registry/agent.d.ts +0 -2
- package/dist/tools/registry/bridge.d.ts +0 -2
- package/dist/tools/registry/business.d.ts +0 -2
- package/dist/tools/registry/config.d.ts +0 -2
- package/dist/tools/registry/evaluation.d.ts +0 -2
- package/dist/tools/registry/files.d.ts +0 -2
- package/dist/tools/registry/identity.d.ts +0 -2
- package/dist/tools/registry/interaction.d.ts +0 -2
- package/dist/tools/registry/local.d.ts +0 -2
- package/dist/tools/registry/messenger.d.ts +0 -2
- package/dist/tools/registry/monitor.d.ts +0 -2
- package/dist/tools/registry/onchain.d.ts +0 -2
- package/dist/tools/registry/query.d.ts +0 -2
- package/dist/tools/retry.d.ts +0 -8
- package/dist/tools/rules-hook.d.ts +0 -5
- package/dist/tools/runtime-health.d.ts +0 -10
- package/dist/tools/sanitize-description-roundtrip.spec.d.ts +0 -1
- package/dist/tools/sanitize-description-roundtrip.spec.js +0 -1
- package/dist/tools/sanitize-output.d.ts +0 -4
- package/dist/tools/sanitize-output.spec.d.ts +0 -1
- package/dist/tools/sanitize-output.spec.js +0 -1
- package/dist/tools/shared.d.ts +0 -20
- package/dist/tools/transport-integrity.d.ts +0 -7
- package/dist/tools/upgrade-check.d.ts +0 -75
- package/dist/tools/wip-deploy-assist.d.ts +0 -34
- package/dist/tools/wip-verify-ledger.d.ts +0 -16
- package/dist/tools/wrap.d.ts +0 -45
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
export type JsonValue = string | number | boolean | null | JsonValue[] | {
|
|
2
|
-
[k: string]: JsonValue;
|
|
3
|
-
};
|
|
4
|
-
export type StepId = string;
|
|
5
|
-
export interface RefExpr {
|
|
6
|
-
$ref: StepId;
|
|
7
|
-
path?: string;
|
|
8
|
-
}
|
|
9
|
-
export type LateQuery = {
|
|
10
|
-
by: "local_name";
|
|
11
|
-
mark: string;
|
|
12
|
-
} | {
|
|
13
|
-
by: "address";
|
|
14
|
-
address: string;
|
|
15
|
-
} | {
|
|
16
|
-
by: "env_signer";
|
|
17
|
-
};
|
|
18
|
-
export interface LateExpr {
|
|
19
|
-
$late: LateQuery;
|
|
20
|
-
}
|
|
21
|
-
export type ResolvedValue = JsonValue | RefExpr | LateExpr;
|
|
22
|
-
export type ResolvedParams = Record<string, ResolvedValue>;
|
|
23
|
-
export declare function isRef(v: ResolvedValue): v is RefExpr;
|
|
24
|
-
export declare function isLate(v: ResolvedValue): v is LateExpr;
|
|
25
|
-
export declare const P: (o: Record<string, unknown>) => ResolvedParams;
|
|
26
|
-
export declare function ref(stepId: string): RefExpr;
|
|
27
|
-
export declare function collectLateMarks(node: unknown, out?: Set<string>): Set<string>;
|
|
28
|
-
export declare function collectRecipientLateMarks(plan: Plan, out?: Set<string>): Set<string>;
|
|
29
|
-
export declare function collectAddressSlotBareNames(plan: Plan, out?: Set<string>): Set<string>;
|
|
30
|
-
export declare const CREATABLE_OBJECTS: {
|
|
31
|
-
readonly permission: "Permission";
|
|
32
|
-
readonly guard: "Guard";
|
|
33
|
-
readonly repository: "Repository";
|
|
34
|
-
readonly machine: "Machine";
|
|
35
|
-
readonly service: "Service<T>";
|
|
36
|
-
readonly arbitration: "Arbitration<T>";
|
|
37
|
-
readonly treasury: "Treasury<T>";
|
|
38
|
-
readonly reward: "Reward<T>";
|
|
39
|
-
readonly demand: "Demand";
|
|
40
|
-
readonly contact: "Contact";
|
|
41
|
-
readonly proof: "Proof";
|
|
42
|
-
readonly resource: "Resource";
|
|
43
|
-
};
|
|
44
|
-
export type CreatableKind = keyof typeof CREATABLE_OBJECTS;
|
|
45
|
-
export declare const PUBLISHABLE_KINDS: readonly ["service", "machine"];
|
|
46
|
-
interface StepBase {
|
|
47
|
-
id: StepId;
|
|
48
|
-
notes?: string;
|
|
49
|
-
account?: string;
|
|
50
|
-
}
|
|
51
|
-
export interface CreateStep extends StepBase {
|
|
52
|
-
op: "create";
|
|
53
|
-
object: CreatableKind;
|
|
54
|
-
params: ResolvedParams;
|
|
55
|
-
}
|
|
56
|
-
export interface ConfigureStep extends StepBase {
|
|
57
|
-
op: "configure";
|
|
58
|
-
target: RefExpr | LateExpr;
|
|
59
|
-
method: string;
|
|
60
|
-
params: ResolvedParams;
|
|
61
|
-
requires?: StepId[];
|
|
62
|
-
}
|
|
63
|
-
export interface PreflightEntry {
|
|
64
|
-
check: string;
|
|
65
|
-
status: "pending" | "pass" | "fail";
|
|
66
|
-
detail?: string;
|
|
67
|
-
}
|
|
68
|
-
export interface PublishStep extends StepBase {
|
|
69
|
-
op: "publish";
|
|
70
|
-
target: RefExpr;
|
|
71
|
-
preflight: PreflightEntry[];
|
|
72
|
-
}
|
|
73
|
-
export type PlanStep = CreateStep | ConfigureStep | PublishStep;
|
|
74
|
-
export interface PendingGuard {
|
|
75
|
-
key: string;
|
|
76
|
-
template_id: string;
|
|
77
|
-
host: string;
|
|
78
|
-
site: "allocator" | "machine_edge" | "service_buy";
|
|
79
|
-
purpose: string;
|
|
80
|
-
}
|
|
81
|
-
export interface Plan {
|
|
82
|
-
version: 1;
|
|
83
|
-
intent: string;
|
|
84
|
-
templateId?: string;
|
|
85
|
-
template_digest?: string;
|
|
86
|
-
inputs: Record<string, JsonValue>;
|
|
87
|
-
steps: PlanStep[];
|
|
88
|
-
external_refs?: string[];
|
|
89
|
-
pending_guards?: PendingGuard[];
|
|
90
|
-
derived_params?: DerivedParam[];
|
|
91
|
-
runtime_writes?: RuntimeWriteStep[];
|
|
92
|
-
}
|
|
93
|
-
export interface RuntimeWriteStep {
|
|
94
|
-
repository: RefExpr;
|
|
95
|
-
policy: string;
|
|
96
|
-
id_from: "none" | "signer" | "clock";
|
|
97
|
-
shape: "single_value" | "items";
|
|
98
|
-
call: {
|
|
99
|
-
data_add: Record<string, unknown>;
|
|
100
|
-
};
|
|
101
|
-
notes: string;
|
|
102
|
-
}
|
|
103
|
-
export interface DerivedParam {
|
|
104
|
-
param: string;
|
|
105
|
-
from: string;
|
|
106
|
-
input: number;
|
|
107
|
-
value: number;
|
|
108
|
-
at_ms: number;
|
|
109
|
-
note: string;
|
|
110
|
-
}
|
|
111
|
-
export declare function refsOf(value: unknown, out?: Set<StepId>): Set<StepId>;
|
|
112
|
-
export declare function stepById(plan: Plan, id: StepId): PlanStep | undefined;
|
|
113
|
-
export declare function createsOf(plan: Plan, kind: CreatableKind): CreateStep[];
|
|
114
|
-
export declare function resolveValue(value: ResolvedValue, outputs: ReadonlyMap<StepId, string>, resolveLate: (q: LateQuery) => string): JsonValue | string;
|
|
115
|
-
export interface PlanIssue {
|
|
116
|
-
code: "PLAN_DUP_STEP" | "PLAN_UNKNOWN_KIND" | "PLAN_REF_UNKNOWN" | "PLAN_REF_FORWARD" | "PLAN_PUBLISH_TARGET" | "PLAN_PROSE_GUARD" | "PLAN_MACHINE_NODES" | "PLAN_REQUIRES_UNKNOWN" | "PLAN_GUARD_PLACEHOLDER" | "PLAN_GUARD_EMPTY_VEC" | "PLAN_GUARD_ZERO_ADDR" | "PLAN_LOGIC_ARITY" | "PLAN_NAME_COLLISION" | "PLAN_LATE_EMPTY_MARK" | "PLAN_NAME_REF_ORPHAN";
|
|
117
|
-
step?: StepId;
|
|
118
|
-
detail: string;
|
|
119
|
-
}
|
|
120
|
-
export declare function validatePlan(plan: Plan): PlanIssue[];
|
|
121
|
-
export {};
|
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
export interface CardEvidence {
|
|
2
|
-
source: string;
|
|
3
|
-
detail: string;
|
|
4
|
-
}
|
|
5
|
-
export interface CardAlignment {
|
|
6
|
-
template_id: string;
|
|
7
|
-
industry: string;
|
|
8
|
-
variant: string;
|
|
9
|
-
product_ref: string;
|
|
10
|
-
archetype: "leader" | "challenger";
|
|
11
|
-
phase: 1 | 2 | 3;
|
|
12
|
-
one_liner: string;
|
|
13
|
-
evidence: CardEvidence[];
|
|
14
|
-
}
|
|
15
|
-
export interface CardFundSpeed {
|
|
16
|
-
key: string;
|
|
17
|
-
value: number | string;
|
|
18
|
-
landing_line: string;
|
|
19
|
-
evidence: CardEvidence[];
|
|
20
|
-
}
|
|
21
|
-
export interface CardVsTraditional {
|
|
22
|
-
dimension: string;
|
|
23
|
-
wowok: string;
|
|
24
|
-
traditional: null;
|
|
25
|
-
wowok_evidence: string[];
|
|
26
|
-
}
|
|
27
|
-
export interface CardFeatures {
|
|
28
|
-
flow: string[];
|
|
29
|
-
fund_speed: CardFundSpeed | null;
|
|
30
|
-
model: string[];
|
|
31
|
-
vs_traditional: CardVsTraditional[];
|
|
32
|
-
}
|
|
33
|
-
export interface CardCost {
|
|
34
|
-
platform_fee: {
|
|
35
|
-
bps: number;
|
|
36
|
-
cap_bps: number | null;
|
|
37
|
-
self_platform: string;
|
|
38
|
-
evidence: CardEvidence[];
|
|
39
|
-
};
|
|
40
|
-
gas_objects_estimate: {
|
|
41
|
-
value: number;
|
|
42
|
-
basis: string;
|
|
43
|
-
};
|
|
44
|
-
compensation_fund: {
|
|
45
|
-
policy: "allowed" | "forbidden";
|
|
46
|
-
note: string;
|
|
47
|
-
};
|
|
48
|
-
keeper_dependencies: string[];
|
|
49
|
-
}
|
|
50
|
-
export interface CardParams {
|
|
51
|
-
total: number;
|
|
52
|
-
editable: number;
|
|
53
|
-
live: number;
|
|
54
|
-
groups: Array<{
|
|
55
|
-
group: string;
|
|
56
|
-
tier: number;
|
|
57
|
-
count: number;
|
|
58
|
-
}>;
|
|
59
|
-
full_rows_via: string;
|
|
60
|
-
}
|
|
61
|
-
export interface CardRisks {
|
|
62
|
-
key_risk: string;
|
|
63
|
-
differences: string[];
|
|
64
|
-
user_inputs: string[];
|
|
65
|
-
capability_risks: string[];
|
|
66
|
-
capability_risks_note: string;
|
|
67
|
-
}
|
|
68
|
-
export interface ProductCard {
|
|
69
|
-
alignment: CardAlignment;
|
|
70
|
-
features: CardFeatures;
|
|
71
|
-
cost: CardCost;
|
|
72
|
-
params: CardParams;
|
|
73
|
-
risks: CardRisks;
|
|
74
|
-
templates_version: number;
|
|
75
|
-
}
|
|
76
|
-
export interface ProductCardSummary {
|
|
77
|
-
template_id: string;
|
|
78
|
-
industry: string;
|
|
79
|
-
product_ref: string;
|
|
80
|
-
archetype: string;
|
|
81
|
-
one_liner: string;
|
|
82
|
-
cost_headline: {
|
|
83
|
-
platform_fee_bps: number;
|
|
84
|
-
gas_objects_estimate: number;
|
|
85
|
-
compensation_fund: "allowed" | "forbidden";
|
|
86
|
-
};
|
|
87
|
-
params: {
|
|
88
|
-
total: number;
|
|
89
|
-
editable: number;
|
|
90
|
-
};
|
|
91
|
-
templates_version: number;
|
|
92
|
-
}
|
|
93
|
-
export declare function productCard(templateId: string): ProductCard;
|
|
94
|
-
export declare function productCards(industry?: string): ProductCardSummary[];
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { type Severity } from "../config/severity.js";
|
|
2
|
-
import { type PlanAuditResult } from "./audit.js";
|
|
3
|
-
import { type Plan } from "./plan.js";
|
|
4
|
-
export declare const SEVERITY_WEIGHT: Readonly<Record<Severity, number>>;
|
|
5
|
-
export declare function auditScore(audit: PlanAuditResult): number;
|
|
6
|
-
export interface PlanPatch {
|
|
7
|
-
rule_id: string;
|
|
8
|
-
kind: string;
|
|
9
|
-
stepId: string;
|
|
10
|
-
detail: string;
|
|
11
|
-
}
|
|
12
|
-
export interface RefluxBlock {
|
|
13
|
-
rule_id: string;
|
|
14
|
-
level: Severity;
|
|
15
|
-
title: string;
|
|
16
|
-
detail: string;
|
|
17
|
-
}
|
|
18
|
-
export interface RefluxOptions {
|
|
19
|
-
maxIterations?: number;
|
|
20
|
-
}
|
|
21
|
-
export interface RefluxResult {
|
|
22
|
-
plan: Plan;
|
|
23
|
-
applied: PlanPatch[];
|
|
24
|
-
blocks: RefluxBlock[];
|
|
25
|
-
iterations: number;
|
|
26
|
-
audit: PlanAuditResult;
|
|
27
|
-
}
|
|
28
|
-
export declare function reflux(plan: Plan, options?: RefluxOptions): RefluxResult;
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import type { DerivedParam, PlanStep } from "./plan.js";
|
|
2
|
-
import type { PrimitiveId } from "../chain-semantics/index.js";
|
|
3
|
-
export type ProcurementAxis = "merchant_procured" | "user_procured";
|
|
4
|
-
export type CompositionForm = "rendezvous" | "submission";
|
|
5
|
-
export interface SupplyChainPromise {
|
|
6
|
-
sub_service: string;
|
|
7
|
-
axis: ProcurementAxis;
|
|
8
|
-
service_name?: string;
|
|
9
|
-
done_node: string;
|
|
10
|
-
done_node_alt?: string;
|
|
11
|
-
done_node_alt2?: string;
|
|
12
|
-
form?: CompositionForm;
|
|
13
|
-
fact_key?: string;
|
|
14
|
-
ack_key?: string;
|
|
15
|
-
ack_window_days?: number;
|
|
16
|
-
payout_to?: string;
|
|
17
|
-
payout_rate?: number;
|
|
18
|
-
repository?: string;
|
|
19
|
-
repository_name?: string;
|
|
20
|
-
service_step_id?: string;
|
|
21
|
-
id_prefix?: string;
|
|
22
|
-
}
|
|
23
|
-
export interface EmissionBlocker {
|
|
24
|
-
code: "SUPPLY_CHAIN_PROMISE_INCOMPLETE" | "SUPPLY_CHAIN_GATE_TEMPLATE" | "SUPPLY_CHAIN_ACK_WITHOUT_DEADLINE" | "SUPPLY_CHAIN_PAYOUT_RATE";
|
|
25
|
-
detail: string;
|
|
26
|
-
}
|
|
27
|
-
export interface SupplyChainHandoff {
|
|
28
|
-
repository: string;
|
|
29
|
-
writes: {
|
|
30
|
-
policy: string;
|
|
31
|
-
row_id: string;
|
|
32
|
-
value: string;
|
|
33
|
-
write_guard: string;
|
|
34
|
-
submissions: string;
|
|
35
|
-
}[];
|
|
36
|
-
}
|
|
37
|
-
export interface SupplyChainEmission {
|
|
38
|
-
steps: PlanStep[];
|
|
39
|
-
inputs: Record<string, string>;
|
|
40
|
-
primitives: PrimitiveId[];
|
|
41
|
-
notes: string[];
|
|
42
|
-
blockers: EmissionBlocker[];
|
|
43
|
-
handoff?: SupplyChainHandoff;
|
|
44
|
-
derived_params?: DerivedParam[];
|
|
45
|
-
}
|
|
46
|
-
export declare function emitSupplyChainPromise(promise: SupplyChainPromise): SupplyChainEmission;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{afterEach,beforeEach,describe,expect,it}from'vitest';import{existsSync,mkdtempSync,rmSync,writeFileSync}from'node:fs';import{tmpdir}from'node:os';import{join}from'node:path';import{ENTRYPOINT}from'@wowok/wowok';import{clearJudgmentLayers,clearJudgmentOverride,clearJudgmentOverrides,getJudgmentDoc,judgmentDisableTrace,judgmentLayerError,judgmentStatus,patchUserJudgmentDoc,setJudgmentIndustryOverlay,setJudgmentOverride,setJudgmentPersonaFragment}from'./judgment.js';import{checkUtilRisks}from'../knowledge/util-risk.js';import{appetiteMultiplier,evaluateOutcome,resolveInterests}from'../evaluation/game-strategy.js';import{evaluateArbGame}from'../evaluation/arbitration-game.js';import{registerDemandMatchEvaluation,matchDemandToServices}from'../evaluation/builtins/demand-match.js';import{extractDemandCapability}from'../evaluation/extract.js';import{monitorOrder}from'../customer/order-monitor.js';import{ModeEvaluator}from'../extensions/mode-evaluator.js';import{mergedBaselinesOverlay,registerIndustryBaselines}from'../extensions/industry-layers.js';import{scoreScorecard}from'../strategy/scorecard.js';import{FakeDataPlane}from'../graph/onchain/dataplane.js';import{expandTopology}from'../graph/onchain/expand.js';import{FULL,fullServiceState}from'../graph/onchain/fixtures.js';import{buildViewport}from'../graph/onchain/viewport.js';import{runAnalyzers}from'../graph/onchain/analyze.js';import{EVALUATION_SERVICE_INTENTS,resolveExpansionStrategy,withEvaluationBundle}from'../graph/onchain/strategy.js';import{projectEvaluationFacts}from'../graph/onchain/facts.js';import{evaluateGraphServiceFacts,registerGraphServiceEvaluations}from'../evaluation/builtins/graph-service.js';let configDir;function writeUserDoc(a){writeFileSync(join(configDir,'judgment.json'),JSON['stringify'](a,null,0x2),'utf-8');}beforeEach(()=>{configDir=mkdtempSync(join(tmpdir(),'wowok-config-audit-')),process['env']['WOWOK_CONFIG_DIR']=configDir,registerDemandMatchEvaluation();}),afterEach(()=>{delete process['env']['WOWOK_CONFIG_DIR'];if(existsSync(configDir))rmSync(configDir,{'recursive':!![],'force':!![]});clearJudgmentOverrides(),clearJudgmentLayers();});async function projectFixture(){registerGraphServiceEvaluations();const a=withEvaluationBundle(resolveExpansionStrategy({'intents':[...EVALUATION_SERVICE_INTENTS]})),b=await expandTopology(new FakeDataPlane(fullServiceState()),{'network':ENTRYPOINT['Mainnet'],'seed':FULL['svc'],'edges':a['edges'],'budget':a['budget']}),c=buildViewport(b,FULL['svc'],'neutral');return projectEvaluationFacts(c,FULL['svc'],runAnalyzers(c));}const demandCap=extractDemandCapability({'object':'0xdemand','location':'Shanghai','description':'need\x20a\x20freelance\x20designer'},{'industry':'freelance','price_max':0x96n,'keywords':['design','logo'],'capabilities':{'has_arbitration':!![],'has_refund_path':!![],'has_milestone_nodes':![],'has_compensation_fund':![],'has_wip_verification':!![],'has_messenger':![],'has_buy_guard':![],'has_dynamic_pricing':![],'is_published':!![],'is_paused':![]}}),inRegionService={'object':'0xgood','location':'Shanghai','description':'freelance\x20logo\x20design','sales':[{'price':'100','wip_hash':'abc'}],'arbitrations':['0xarb'],'compensation_fund':'500','bPublished':!![],'bPaused':![]},breakdownOf=(a,b)=>a['breakdown']['find'](c=>c['rule_id']===b);describe('config\x20audit\x20—\x20evaluation\x20section',()=>{it('1.\x20weights.trust_reviews\x20flows\x20into\x20the\x20aggregated\x20trust\x20total\x20(user\x20doc\x20channel)',async()=>{const a=await projectFixture(),b=await evaluateGraphServiceFacts(a);expect(b['trust']['breakdown']['find'](d=>d['rule_id']==='trust_reviews')['weight'])['toBe'](0x23),writeUserDoc({'version':0x1,'evaluation':{'weights':{'trust_reviews':0x46}}});const c=await evaluateGraphServiceFacts(a);expect(c['trust']['breakdown']['find'](d=>d['rule_id']==='trust_reviews')['weight'])['toBe'](0x46),expect(c['trust']['total'])['toBe'](0x2f);}),it('2.\x20severity_deduction.critical\x2050→5\x20lifts\x20the\x20risk-side\x20rule\x20score\x20(session\x20override)',async()=>{const a=await projectFixture(),b=await evaluateGraphServiceFacts(a);expect(b['risk']['breakdown']['find'](d=>d['rule_id']==='risk_fund')['score'])['toBe'](0x19),expect(setJudgmentOverride('evaluation.severity_deduction.critical',0x5))['toEqual']({'ok':!![]});const c=await evaluateGraphServiceFacts(a);expect(c['risk']['breakdown']['find'](d=>d['rule_id']==='risk_fund')['score'])['toBe'](0x46),expect(c['risk']['breakdown']['find'](d=>d['rule_id']==='risk_trust')['score'])['toBe'](0x41),expect(c['risk']['total'])['toBe'](0x56);}),it('3.\x20level_bands\x20first\x20band\x20min\x2085→30\x20flips\x20the\x20level\x20of\x20an\x20unchanged\x20score\x20(session\x20override)',async()=>{const a=await projectFixture(),b=await evaluateGraphServiceFacts(a);expect(b['trust']['total'])['toBe'](0x31),expect(b['trust']['level'])['toBe']('high'),setJudgmentOverride('evaluation.level_bands',[{'min':0x1e,'level':'low'},{'min':0x46,'level':'medium_low'},{'min':0x32,'level':'medium_high'},{'min':0x0,'level':'high'}]);const c=await evaluateGraphServiceFacts(a);expect(c['trust']['total'])['toBe'](0x31),expect(c['trust']['level'])['toBe']('low');}),it('4.\x20grade_words.trust\x20first\x20band\x20min\x2070→20\x20flips\x20the\x20rendered\x20grade\x20word\x20(session\x20override)',async()=>{const a=await projectFixture(),b=await evaluateGraphServiceFacts(a);expect(b['trust']['summary'])['toContain']('grade:\x20weak'),setJudgmentOverride('evaluation.grade_words.trust',[{'min':0x14,'word':'strong'},{'min':0x32,'word':'fair'},{'min':0x0,'word':'weak'}]);const c=await evaluateGraphServiceFacts(a);expect(c['trust']['summary'])['toContain']('grade:\x20strong');}),it('5.\x20dimensions.<id>.label\x20retune\x20reaches\x20the\x20live\x20summary\x20rendering\x20(industry\x20overlay\x20channel)',async()=>{const a=await projectFixture(),b=await evaluateGraphServiceFacts(a);expect(b['trust']['summary'])['toContain']('weakest\x20Fund\x20safety'),setJudgmentIndustryOverlay({'evaluation':{'dimensions':{'trust_fund_safety':{'label':'Fund\x20Cushion','description':'audit\x20retune'}}}},'pack:audit');const c=await evaluateGraphServiceFacts(a);expect(c['trust']['summary'])['toContain']('weakest\x20Fund\x20Cushion'),expect(c['trust']['breakdown']['find'](d=>d['rule_id']==='trust_fund_safety')['dimension'])['toBe']('Fund\x20Cushion');});}),describe('config\x20audit\x20—\x20game\x20section',()=>{it('6.\x20scoring.base\x2060→80\x20lifts\x20every\x20net\x20score\x20(judgment_doc_patch\x20channel)',()=>{expect(evaluateOutcome('refund','customer')['net_score'])['toBe'](0x50);const a=patchUserJudgmentDoc({'game':{'scoring':{'base':0x50}}});expect(a['applied'])['toBe'](!![]),expect(evaluateOutcome('refund','customer')['net_score'])['toBe'](0x64);}),it('7.\x20appetite_multipliers.conservative\x201.5→0.6\x20changes\x20the\x20conservative\x20sensitivity\x20result\x20(session\x20override)',()=>{const a=evaluateOutcome('refund','merchant',{'risk_appetite':'conservative'});expect(a['risk_score'])['toBe'](0x4b),expect(a['net_score'])['toBe'](0x0),setJudgmentOverride('game.appetite_multipliers.conservative',0.6);const b=evaluateOutcome('refund','merchant',{'risk_appetite':'conservative'});expect(b['risk_score'])['toBe'](0x1e),expect(b['net_score'])['toBe'](0x1e),expect(appetiteMultiplier('conservative'))['toBe'](0.6);}),it('8.\x20role_interests.customer.prefer\x20+\x20node_advanced\x20adds\x20a\x20gain\x20(industry\x20overlay\x20channel)',()=>{const a=evaluateOutcome('advance','customer');expect(a['gains'])['toEqual']([]),expect(a['net_score'])['toBe'](0x3c),setJudgmentIndustryOverlay({'game':{'role_interests':{'customer':{'prefer':['fund_returned_to_buyer','node_advanced'],'avoid':[],'sensitivity':0x1}}}},'pack:audit');const b=evaluateOutcome('advance','customer');expect(b['gains'])['toEqual'](['node_advanced']),expect(b['net_score'])['toBe'](0x50);}),it('9.\x20a\x20new\x20keyword_rules\x20entry\x20re-anchors\x20prefer\x20on\x20a\x20matching\x20requirement\x20(user\x20doc\x20channel)',()=>{const a=resolveInterests('system',{'requirements':['please\x20test\x20it']});expect(a['prefer'])['toEqual']([]),writeUserDoc({'version':0x1,'game':{'keyword_rules':[{'id':'kw_audit_testing','keywords':['test'],'effect':'node_advanced','anchor':'prefer','when_forbidden':![]}]}});const b=resolveInterests('system',{'requirements':['please\x20test\x20it']});expect(b['prefer'])['toEqual'](['node_advanced']);}),it('10.\x20forbid_pattern\x20rewritten\x20to\x20a\x20non-matching\x20pattern\x20disarms\x20when_forbidden\x20rules\x20(user\x20doc\x20channel)',()=>{const a=resolveInterests('neutral',{'requirements':['never\x20arbitration']});expect(a['avoid'])['toContain']('arbitration_review_triggered'),writeUserDoc({'version':0x1,'game':{'forbid_pattern':'zzz_never_matches'}});const b=resolveInterests('neutral',{'requirements':['never\x20arbitration']});expect(b['avoid'])['toEqual']([]);});}),describe('config\x20audit\x20—\x20game.arb\x20section\x20(7-state\x20game)',()=>{it('11.\x20arb.scoring.per_gain\x2020→40\x20moves\x20the\x20favorability\x20of\x20a\x201-gain\x20move\x20(session\x20override)',()=>{const a=evaluateArbGame('Voting','arbitrator');expect(a['actions'][0x0]?.['gain_score'])['toBe'](0x14),expect(a['actions'][0x0]?.['favorability'])['toBe'](0x50),setJudgmentOverride('game.arb.scoring.per_gain',0x28);const b=evaluateArbGame('Voting','arbitrator');expect(b['actions'][0x0]?.['gain_score'])['toBe'](0x28),expect(b['actions'][0x0]?.['favorability'])['toBe'](0x64);}),it('12.\x20a\x20new\x20arb\x20keyword_rules\x20entry\x20re-anchors\x20a\x20perspective\x27s\x20prefer\x20(user\x20doc\x20channel)',()=>{const a=evaluateArbGame('Principal_confirming','customer',{'requirements':['expedite\x20please']});expect(a['actions'][0x0]?.['gain_score'])['toBe'](0x0),expect(a['actions'][0x0]?.['favorability'])['toBe'](0x3c),writeUserDoc({'version':0x1,'game':{'arb':{'keyword_rules':[{'id':'arb_kw_audit_expedite','keywords':['expedite'],'effect':'case_advanced','anchor':'prefer','when_forbidden':![]}]}}});const b=evaluateArbGame('Principal_confirming','customer',{'requirements':['expedite\x20please']});expect(b['actions'][0x0]?.['gain_score'])['toBe'](0x14),expect(b['actions'][0x0]?.['favorability'])['toBe'](0x50);});}),describe('config\x20audit\x20—\x20match\x20section',()=>{it('13.\x20region_scores.exact\x20100→50\x20halves\x20the\x20region\x20rule\x20score\x20(session\x20override)',async()=>{const [a]=await matchDemandToServices(demandCap,[inRegionService]);expect(breakdownOf(a['result'],'region')['score'])['toBe'](0x64),setJudgmentOverride('match.region_scores.exact',0x32);const [b]=await matchDemandToServices(demandCap,[inRegionService]);expect(breakdownOf(b['result'],'region')['score'])['toBe'](0x32),expect(b['result']['total'])['toBeLessThan'](a['result']['total']);}),it('14.\x20weights.capabilities\x2030→60\x20raises\x20its\x20renormalized\x20share\x20(session\x20override)',async()=>{const [a]=await matchDemandToServices(demandCap,[inRegionService]);expect(breakdownOf(a['result'],'capabilities')['weight'])['toBe'](0x1e),expect(a['result']['total'])['toBe'](0x47),setJudgmentOverride('match.weights.capabilities',0x3c);const [b]=await matchDemandToServices(demandCap,[inRegionService]);expect(breakdownOf(b['result'],'capabilities')['weight'])['toBe'](0x3c),expect(breakdownOf(b['result'],'region')['weight'])['toBe'](0xf),expect(b['result']['total'])['toBe'](0x4d);}),it('15.\x20trust_bands\x20second\x20band\x20score\x2060→10\x20(extracted\x20trust_score\x20is\x2050\x20→\x20band\x20#2)\x20(session\x20override)',async()=>{const [a]=await matchDemandToServices(demandCap,[inRegionService]);expect(breakdownOf(a['result'],'trust')['score'])['toBe'](0x3c),setJudgmentOverride('match.trust_bands',[{'min':0x4b,'score':0x64},{'min':0x32,'score':0xa},{'min':0x19,'score':0x1e},{'min':0x0,'score':0x0}]);const [b]=await matchDemandToServices(demandCap,[inRegionService]);expect(breakdownOf(b['result'],'trust')['score'])['toBe'](0xa);}),it('16.\x20neutral_score\x2050→10\x20changes\x20unknown-signal\x20scoring\x20(user\x20doc\x20channel)',async()=>{const a=extractDemandCapability({'object':'0xdemand','location':'Shanghai','description':'anything'},{'industry':'freelance','price_max':0x96n,'keywords':[],'capabilities':{'has_arbitration':![],'has_refund_path':![],'has_milestone_nodes':![],'has_compensation_fund':![],'has_wip_verification':![],'has_messenger':![],'has_buy_guard':![],'has_dynamic_pricing':![],'is_published':![],'is_paused':![]}}),[b]=await matchDemandToServices(a,[inRegionService]);expect(breakdownOf(b['result'],'tags')['score'])['toBe'](0x32),writeUserDoc({'version':0x1,'match':{'neutral_score':0xa}});const [c]=await matchDemandToServices(a,[inRegionService]);expect(breakdownOf(c['result'],'tags')['score'])['toBe'](0xa);}),it('17.\x20price_over_budget_tolerance_pct\x2010→100\x20turns\x20a\x20rejection\x20into\x20a\x20partial\x20score\x20(session\x20override)',async()=>{const a={...inRegionService,'object':'0xpricey','sales':[{'price':'200','wip_hash':'x'}]},[b]=await matchDemandToServices(demandCap,[a]);expect(breakdownOf(b['result'],'price')['score'])['toBe'](0x0),setJudgmentOverride('match.price_over_budget_tolerance_pct',0x64);const [c]=await matchDemandToServices(demandCap,[a]);expect(breakdownOf(c['result'],'price')['score'])['toBe'](0x32);}),it('18.\x20top_n\x205→2\x20caps\x20the\x20returned\x20candidate\x20count\x20(session\x20override)',async()=>{const a=[inRegionService,{...inRegionService,'object':'0xb'},{...inRegionService,'object':'0xc'}];expect((await matchDemandToServices(demandCap,a))['length'])['toBe'](0x3),setJudgmentOverride('match.top_n',0x2),expect((await matchDemandToServices(demandCap,a))['length'])['toBe'](0x2);});}),describe('config\x20audit\x20—\x20monitor\x20section',()=>{const a=0x36ee80,b=c=>({'order_id':'0xorder','service_id':'0xservice','created_at':0x64*a,'now':0x64*a,...c});it('19.\x20messenger_timeout_hours\x2024→1\x20surfaces\x20the\x20timeout\x20finding\x20(user\x20doc\x20hot\x20reload)',()=>{const c=b({'last_user_message_at':0x62*a,'has_messenger':!![]});expect(monitorOrder({'current':c})['map'](f=>f['id']))['not']['toContain']('messenger_unanswered'),writeUserDoc({'version':0x1,'monitor':{'thresholds':{'messenger_timeout_hours':0x1}}});const d=monitorOrder({'current':c}),e=d['find'](f=>f['id']==='messenger_unanswered');expect(e?.['severity'])['toBe']('high');}),it('20.\x20escalation.stall_escalation_multiplier\x202→1\x20moves\x20the\x20critical\x20escalation\x20point\x20(session\x20override)',()=>{const c=b({'current_node':'Pay','last_progress_at':0x14*a}),d=monitorOrder({'current':c})['find'](f=>f['id']==='progress_stall');expect(d?.['severity'])['toBe']('high'),setJudgmentOverride('monitor.escalation.stall_escalation_multiplier',0x1);const e=monitorOrder({'current':c})['find'](f=>f['id']==='progress_stall');expect(e?.['severity'])['toBe']('critical');}),it('21.\x20compensation_coverage_min\x201.0→5\x20surfaces\x20the\x20insufficient-coverage\x20finding\x20(session\x20override)',()=>{const c=b({'compensation_balance':0x12cn,'order_amount':0x64n});expect(monitorOrder({'current':c})['map'](e=>e['id']))['not']['toContain']('compensation_insufficient'),setJudgmentOverride('monitor.thresholds.compensation_coverage_min',0x5);const d=monitorOrder({'current':c})['find'](e=>e['id']==='compensation_insufficient');expect(d?.['severity'])['toBe']('high');}),it('22.\x20explicit\x20MonitorThresholds\x20argument\x20wins\x20over\x20the\x20document\x20(caller\x20precedence)',()=>{const c=b({'last_user_message_at':0x62*a,'has_messenger':!![]});setJudgmentOverride('monitor.thresholds.messenger_timeout_hours',0x1),expect(monitorOrder({'current':c})['map'](d=>d['id']))['toContain']('messenger_unanswered'),expect(monitorOrder({'current':c,'thresholds':{'messenger_timeout_hours':0x48}})['map'](d=>d['id']))['not']['toContain']('messenger_unanswered'),clearJudgmentOverride('monitor.thresholds.messenger_timeout_hours');});}),describe('config\x20audit\x20—\x20mode\x20section',()=>{it('23.\x20appetite_thresholds.conservative.max_risk\x2030→99\x20flips\x20the\x20risk\x20recommendation\x20(session\x20override)',()=>{const a={'getCard':f=>({'constraints':{},'risk_profile':{'funds_risk':'medium'}})},b=new ModeEvaluator(a),c={'name':'audit_mode','traits':[],'machine_shape':{},'capabilities_used':['cap_audit'],'risk_appetite':'conservative','risk_constraints':{}},d=b['evaluateMode'](c);expect(d['risk_score'])['toBe'](0x3c),expect(d['recommendations']['join']('\x0a'))['toContain']('exceeds\x20conservative\x20mode\x20threshold\x2030'),setJudgmentOverride('mode.appetite_thresholds.conservative.max_risk',0x63);const e=b['evaluateMode'](c);expect(e['risk_score'])['toBe'](0x3c),expect(e['recommendations']['join']('\x0a'))['not']['toContain']('exceeds');});}),describe('config\x20audit\x20—\x20scorecard\x20section',()=>{function a(c){return{'account':'0xshop','industry':'education','network':'testnet','collected_at':0x0,'metrics':c,'unavailable':[],'errors':[]};}const b=(c,d)=>({'id':c,'source':'market_operations','status':'ok','value':d,'collected_at':0x0});it('24.\x20metrics.order_count.good_threshold\x2020→1\x20drives\x20the\x20metric\x20to\x20full\x20score\x20(session\x20override)',()=>{const d=a([b('order_count',0x1)]),e=scoreScorecard(d,'balanced');expect(e['metric_scores'][0x0]?.['score'])['toBe'](0x0),expect(e['overall'])['toBe'](0x0),setJudgmentOverride('scorecard.metrics.order_count.good_threshold',0x1);const f=scoreScorecard(d,'balanced');expect(f['metric_scores'][0x0]?.['score'])['toBe'](0x64),expect(f['overall'])['toBe'](0x64);}),it('25.\x20metrics.completion_rate.weight\x20posture\x20retune\x20changes\x20the\x20normalized\x20overall\x20(session\x20override)',()=>{const d=a([b('order_count',0x5),b('completion_rate',0.75)]),e=scoreScorecard(d,'margin');expect(e['metric_scores'][0x1]?.['weight'])['toBe'](0.15),expect(e['overall'])['toBe'](0x26),setJudgmentOverride('scorecard.metrics.completion_rate.weight',{'volume':0.15,'balanced':0.2,'margin':0.9});const f=scoreScorecard(d,'margin');expect(f['metric_scores'][0x1]?.['weight'])['toBe'](0.9),expect(f['overall'])['toBe'](0x2f);}),it('26.\x20shop_evidence_metrics\x20cleared\x20→\x20market-only\x20evidence\x20yields\x20a\x20null\x20overall\x20(session\x20override)',()=>{const d=a([b('order_count',0x14),b('supply_demand_ratio',0x2)]),e=scoreScorecard(d,'balanced');expect(e['overall'])['toBe'](0x5e),setJudgmentOverride('scorecard.shop_evidence_metrics',[]);const f=scoreScorecard(d,'balanced');expect(f['overall'])['toBeNull']();});}),describe('config\x20audit\x20—\x20rules\x20section\x20(declarative\x20rule\x20book)',()=>{it('27.\x20a\x20retuned\x20case\x20level\x20low→high\x20changes\x20the\x20finding\x20severity\x20(user\x20doc\x20channel)',()=>{const a=checkUtilRisks({'large_util_import':!![]})['find'](c=>c['id']==='R-UTIL-03');expect(a?.['level'])['toBe']('low'),writeUserDoc({'version':0x1,'rules':{'domains':{'util':{'rules':[{'rule_id':'R-UTIL-03','cases':[{'when':{'field':'large_util_import','op':'eq','value':!![]},'level':'high','title':'AUDIT:\x20util\x20import\x20retuned\x20to\x20high','description':'Audit-rewritten\x20description\x20for\x20R-UTIL-03.'}]}]}}}});const b=checkUtilRisks({'large_util_import':!![]})['find'](c=>c['id']==='R-UTIL-03');expect(b?.['level'])['toBe']('high'),expect(b?.['title'])['toContain']('AUDIT');}),it('28.\x20enabled:false\x20via\x20the\x20industry\x20layer\x20silences\x20the\x20finding\x20AND\x20leaves\x20a\x20disable\x20trace',()=>{expect(checkUtilRisks({'large_util_import':!![],'expects_util_events':!![]})['map'](a=>a['id']))['toEqual'](['R-UTIL-03','R-UTIL-04']),expect(setJudgmentIndustryOverlay({'rules':{'domains':{'util':{'rules':[{'rule_id':'R-UTIL-03','enabled':![]}]}}}},'pack:audit')['ok'])['toBe'](!![]),expect(checkUtilRisks({'large_util_import':!![],'expects_util_events':!![]})['map'](a=>a['id']))['toEqual'](['R-UTIL-04']),expect(judgmentDisableTrace())['toEqual']([{'layer':'pack:audit','domain':'util','rule_id':'R-UTIL-03'}]);}),it('29.\x20case.title/description\x20rewording\x20is\x20visible\x20in\x20the\x20finding\x20text\x20(user\x20doc\x20channel)',()=>{const a=checkUtilRisks({'bcs_manually_synced':!![]})['find'](c=>c['id']==='R-UTIL-05');expect(a?.['title'])['toContain']('SDK\x20BCS\x20structures\x20must\x20stay\x20in\x20sync'),writeUserDoc({'version':0x1,'rules':{'domains':{'util':{'rules':[{'rule_id':'R-UTIL-05','cases':[{'when':{'field':'bcs_manually_synced','op':'eq','value':!![]},'level':'medium','title':'AUDIT:\x20hand-maintained\x20BCS\x20layouts\x20drift\x20from\x20Move\x20structs','description':'Audit-rewritten\x20description\x20for\x20R-UTIL-05.'}]}]}}}});const b=checkUtilRisks({'bcs_manually_synced':!![]})['find'](c=>c['id']==='R-UTIL-05');expect(b?.['title'])['toContain']('AUDIT:\x20hand-maintained\x20BCS'),expect(b?.['description'])['toContain']('Audit-rewritten\x20description\x20for\x20R-UTIL-05.');});}),describe('config\x20audit\x20—\x20layer\x20chain\x20and\x20composition',()=>{it('30.\x20precedence\x20chain:\x20industry\x20X=61\x20<\x20user\x20doc\x20X=63\x20<\x20persona\x20X=62,\x20unwinding\x20in\x20reverse',()=>{expect(getJudgmentDoc()['game']['scoring']['base'])['toBe'](0x3c),setJudgmentIndustryOverlay({'game':{'scoring':{'base':0x3d}}},'pack:x'),expect(getJudgmentDoc()['game']['scoring']['base'])['toBe'](0x3d),writeUserDoc({'version':0x1,'game':{'scoring':{'base':0x3f}}}),expect(getJudgmentDoc()['game']['scoring']['base'])['toBe'](0x3f),setJudgmentPersonaFragment({'game':{'scoring':{'base':0x3e}}},'persona:y'),expect(getJudgmentDoc()['game']['scoring']['base'])['toBe'](0x3e),expect(evaluateOutcome('refund','customer')['net_score'])['toBe'](0x52),rmSync(join(configDir,'judgment.json')),expect(getJudgmentDoc()['game']['scoring']['base'])['toBe'](0x3e),setJudgmentPersonaFragment(null),expect(getJudgmentDoc()['game']['scoring']['base'])['toBe'](0x3d),setJudgmentIndustryOverlay(null),expect(getJudgmentDoc()['game']['scoring']['base'])['toBe'](0x3c);}),it('31.\x20mergedBaselinesOverlay:\x20the\x20later\x20industry\x20in\x20the\x20list\x20wins,\x20and\x20the\x20merged\x20overlay\x20drives\x20the\x20engine',()=>{registerIndustryBaselines({'category':'audit-a','fragment':{'monitor':{'thresholds':{'messenger_timeout_hours':0x1}}}}),registerIndustryBaselines({'category':'audit-b','fragment':{'monitor':{'thresholds':{'messenger_timeout_hours':0x2}}}});const a=mergedBaselinesOverlay(['audit-a','audit-b']);expect(a['monitor']?.['thresholds']?.['messenger_timeout_hours'])['toBe'](0x2),expect(setJudgmentIndustryOverlay(mergedBaselinesOverlay(['audit-a','audit-b']),'merged:audit')['ok'])['toBe'](!![]),expect(getJudgmentDoc()['monitor']['thresholds']['messenger_timeout_hours'])['toBe'](0x2);const b=0x36ee80,c={'order_id':'0xorder','service_id':'0xs','created_at':0x64*b,'now':0x64*b,'last_user_message_at':98.5*b,'has_messenger':!![]};expect(monitorOrder({'current':c})['map'](d=>d['id']))['not']['toContain']('messenger_unanswered');}),it('32.\x20an\x20invalid\x20persona\x20fragment\x20is\x20rejected,\x20the\x20layer\x20error\x20is\x20visible,\x20the\x20last\x20good\x20stays\x20in\x20force',()=>{expect(setJudgmentPersonaFragment({'game':{'scoring':{'base':0x46}}},'persona:audit')['ok'])['toBe'](!![]),expect(getJudgmentDoc()['game']['scoring']['base'])['toBe'](0x46);const a=setJudgmentPersonaFragment({'game':{'scoring':{'bse':0x1}}},'persona:audit');expect(a['ok'])['toBe'](![]),expect(judgmentLayerError('persona'))['toContain']('bse'),expect(judgmentStatus()['layer_errors']['persona'])['toContain']('bse'),expect(getJudgmentDoc()['game']['scoring']['base'])['toBe'](0x46);}),it('33.\x20severity_deduction\x20×\x20level_bands\x20combo:\x20a\x20big\x20deduction\x20pushes\x20the\x20score\x20across\x20a\x20band\x20boundary',async()=>{const a=await projectFixture(),b=await evaluateGraphServiceFacts(a);expect(b['risk']['total'])['toBe'](0x4a),expect(b['risk']['level'])['toBe']('medium_low'),setJudgmentOverride('evaluation.severity_deduction.high',0x50);const c=await evaluateGraphServiceFacts(a);expect(c['risk']['total'])['toBe'](0x39),expect(c['risk']['level'])['toBe']('medium_high');});}),describe('config\x20audit\x20—\x20rejection\x20semantics',()=>{it('34a.\x20user-document\x20guardrails:\x20typoed\x20weight,\x20invented\x20rule\x20id,\x20non-enum\x20severity\x20word',()=>{writeUserDoc({'version':0x1,'evaluation':{'weights':{'trust_revews':0x32}}}),getJudgmentDoc(),expect(judgmentStatus()['last_reload_error'])['toContain']('unknown\x20dimension\x20\x27trust_revews\x27'),expect(getJudgmentDoc()['evaluation']['weights']['trust_reviews'])['toBe'](0x23),writeUserDoc({'version':0x1,'rules':{'domains':{'service':{'rules':[{'rule_id':'R-S-9-99','enabled':![]}]}}}}),getJudgmentDoc(),expect(judgmentStatus()['last_reload_error'])['toContain']('unknown\x20rule\x20\x27R-S-9-99\x27'),writeUserDoc({'version':0x1,'evaluation':{'severity_deduction':{'warning':0x19}}}),getJudgmentDoc(),expect(judgmentStatus()['last_reload_error'])['toMatch'](/warning/i),expect(getJudgmentDoc()['evaluation']['severity_deduction']['critical'])['toBe'](0x32);}),it('34b.\x20judgment_set\x20guardrails:\x20type\x20mismatch\x20and\x20unknown\x20path\x20are\x20rejected',()=>{expect(setJudgmentOverride('evaluation.weights.trust_reviews','high')['ok'])['toBe'](![]),expect(setJudgmentOverride('evaluation.weights.does_not_exist',0x1)['ok'])['toBe'](![]),expect(getJudgmentDoc()['evaluation']['weights']['trust_reviews'])['toBe'](0x23);});});
|
package/dist/config/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{afterEach,beforeEach,describe,expect,it}from'vitest';import{existsSync,mkdtempSync,readFileSync,rmSync,statSync,writeFileSync}from'node:fs';import{tmpdir}from'node:os';import{join}from'node:path';import{EXPECTED_JUDGMENT_VERSION,clearJudgmentOverride,clearJudgmentOverrides,clearJudgmentLayers,getJudgmentDoc,judgmentDisableTrace,judgmentLayerError,judgmentOverrides,judgmentStatus,mergeJudgmentValues,patchUserJudgmentDoc,readUserJudgmentDocView,setJudgmentIndustryOverlay,setJudgmentOverride,setJudgmentPersonaFragment,userJudgmentDocPath}from'./judgment.js';import{defaultWeights}from'../evaluation/standards.js';import{checkUtilRisks}from'../knowledge/util-risk.js';import{appetiteMultiplier,evaluateOutcome,interestsOf,resolveInterests}from'../evaluation/game-strategy.js';import{monitorOrder}from'../customer/order-monitor.js';import{scoreMetricValue,scoreScorecard}from'../strategy/scorecard.js';import{evaluateArbGame}from'../evaluation/arbitration-game.js';let configDir;function userDocPath(){return join(configDir,'judgment.json');}function writeUserDoc(a){writeFileSync(userDocPath(),JSON['stringify'](a,null,0x2),'utf-8');}function userDocText(){return readFileSync(userDocPath(),'utf-8');}beforeEach(()=>{configDir=mkdtempSync(join(tmpdir(),'wowok-judgment-')),process['env']['WOWOK_CONFIG_DIR']=configDir;}),afterEach(()=>{delete process['env']['WOWOK_CONFIG_DIR'];if(existsSync(configDir))rmSync(configDir,{'recursive':!![],'force':!![]});clearJudgmentOverrides(),clearJudgmentLayers();}),describe('judgment\x20baselines\x20—\x20factory\x20document',()=>{it('loads\x20the\x20factory\x20document\x20with\x20every\x20section\x20present',()=>{const a=getJudgmentDoc();expect(a['version'])['toBe'](EXPECTED_JUDGMENT_VERSION),expect(a['evaluation']['weights']['trust_reviews'])['toBe'](0x23),expect(a['evaluation']['severity_deduction']['critical'])['toBe'](0x32),expect(Object['keys'](a['game']['role_interests']))['toContain']('customer'),expect(a['game']['appetite_multipliers']['conservative'])['toBe'](1.5),expect(a['match']['region_scores']['exact'])['toBe'](0x64),expect(a['match']['top_n'])['toBe'](0x5),expect(a['monitor']['thresholds']['messenger_timeout_hours'])['toBe'](0x18),expect(a['mode']['appetite_thresholds']['balanced'])['toEqual']({'max_risk':0x3c,'min_benefit':0x3c}),expect(Object['keys'](a['scorecard']['metrics']))['toContain']('order_count'),expect(a['scorecard']['metrics']['order_count']?.['good_threshold'])['toBe'](0x14),expect(a['scorecard']['shop_evidence_metrics'])['toContain']('completion_rate'),expect(Object['keys'](a['rules']['domains']))['toContain']('util');}),it('reports\x20a\x20healthy\x20status\x20with\x20the\x20user\x20document\x20absent',()=>{const a=judgmentStatus();expect(a['user_doc_loaded'])['toBe'](![]),expect(a['last_reload_error'])['toBeNull'](),expect(a['user_path'])['toBe'](userJudgmentDocPath()),expect(a['sections']['evaluation'])['toBeGreaterThan'](0x0);});}),describe('judgment\x20baselines\x20—\x20user\x20document\x20(hot\x20reload\x20+\x20merge)',()=>{it('merges\x20user\x20keys\x20over\x20the\x20factory\x20at\x20key\x20granularity\x20(no\x20deletion)',()=>{writeUserDoc({'version':0x1,'evaluation':{'weights':{'trust_reviews':0x2d}}});const a=getJudgmentDoc();expect(a['evaluation']['weights']['trust_reviews'])['toBe'](0x2d),expect(a['evaluation']['weights']['trust_arbitration'])['toBe'](0x14),expect(a['evaluation']['dimensions']['trust_reviews']?.['label'])['toBe']('Reputation'),expect(a['evaluation']['severity_deduction']['high'])['toBe'](0x19),expect(a['evaluation']['level_bands'][0x0])['toEqual']({'min':0x55,'level':'low'});}),it('reflects\x20a\x20document\x20edit\x20on\x20the\x20next\x20read\x20—\x20no\x20restart\x20(Q6)',()=>{writeUserDoc({'version':0x1,'evaluation':{'weights':{'trust_reviews':0x2d}}}),expect(getJudgmentDoc()['evaluation']['weights']['trust_reviews'])['toBe'](0x2d),writeUserDoc({'version':0x1,'evaluation':{'weights':{'trust_reviews':0x32}}}),expect(defaultWeights()['trust_reviews'])['toBe'](0x32);}),it('keeps\x20the\x20last\x20good\x20document\x20when\x20an\x20edit\x20is\x20invalid\x20(parse\x20error)',()=>{writeUserDoc({'version':0x1,'evaluation':{'weights':{'trust_reviews':0x2d}}}),expect(getJudgmentDoc()['evaluation']['weights']['trust_reviews'])['toBe'](0x2d),writeFileSync(userDocPath(),'{\x20not\x20json','utf-8');const a=getJudgmentDoc();expect(a['evaluation']['weights']['trust_reviews'])['toBe'](0x2d);const b=judgmentStatus();expect(b['last_reload_error'])['toBeTruthy'](),expect(b['user_doc_loaded'])['toBe'](!![]);}),it('rejects\x20unknown\x20keys\x20and\x20wrong\x20section\x20shapes\x20loudly',()=>{writeUserDoc({'version':0x1,'evaluation':{'weights':{'trust_reviews':0x2d,'typoed_weight':0x1}}}),getJudgmentDoc(),expect(judgmentStatus()['last_reload_error'])['toMatch'](/unknown dimension 'typoed_weight'/),expect(getJudgmentDoc()['evaluation']['weights']['trust_reviews'])['toBe'](0x2d),writeUserDoc({'version':0x1,'evaluation':{'severity_deduction':{'warning':0x19}}}),getJudgmentDoc(),expect(judgmentStatus()['last_reload_error'])['toMatch'](/warning/i),expect(getJudgmentDoc()['evaluation']['severity_deduction']['critical'])['toBe'](0x32);}),it('gates\x20on\x20the\x20document\x20version',()=>{writeUserDoc({'version':0x63,'evaluation':{'weights':{'trust_reviews':0x2d}}}),getJudgmentDoc(),expect(judgmentStatus()['last_reload_error'])['toMatch'](/version/),expect(getJudgmentDoc()['evaluation']['weights']['trust_reviews'])['toBe'](0x2d);}),it('recovers\x20when\x20the\x20invalid\x20edit\x20is\x20fixed,\x20and\x20unloads\x20when\x20the\x20file\x20is\x20removed',()=>{writeUserDoc({'version':0x63}),getJudgmentDoc(),expect(judgmentStatus()['last_reload_error'])['toMatch'](/version/),writeUserDoc({'version':0x1,'evaluation':{'weights':{'trust_reviews':0x2a}}}),expect(getJudgmentDoc()['evaluation']['weights']['trust_reviews'])['toBe'](0x2a),expect(judgmentStatus()['last_reload_error'])['toBeNull'](),rmSync(userDocPath()),expect(getJudgmentDoc()['evaluation']['weights']['trust_reviews'])['toBe'](0x23);const a=judgmentStatus();expect(a['user_doc_loaded'])['toBe'](![]),expect(a['last_reload_error'])['toBeNull']();});}),describe('judgment\x20baselines\x20—\x20user\x20document\x20patch\x20channel\x20(judgment_doc_patch)',()=>{it('merges\x20a\x20patch\x20into\x20the\x20user\x20document\x20and\x20the\x20change\x20is\x20in\x20force\x20immediately',()=>{const a=patchUserJudgmentDoc({'evaluation':{'weights':{'trust_reviews':0x2d}}});expect(a['applied'])['toBe'](!![]),expect(a['user_path'])['toBe'](userJudgmentDocPath()),expect(a['backup_path'])['toBeNull'](),expect(a['changed'])['toEqual']([{'path':'evaluation.weights.trust_reviews','old':null,'new':0x2d}]),expect(getJudgmentDoc()['evaluation']['weights']['trust_reviews'])['toBe'](0x2d);const b=JSON['parse'](userDocText());expect(b['version'])['toBe'](EXPECTED_JUDGMENT_VERSION);}),it('reads\x20the\x20legacy\x20judgment-baselines.json\x20and\x20writes\x20the\x20new\x20judgment.json\x20on\x20patch',()=>{const a=join(configDir,'judgment-baselines.json');writeFileSync(a,JSON['stringify']({'version':0x1,'evaluation':{'weights':{'trust_reviews':0x2d}}},null,0x2),'utf-8'),expect(getJudgmentDoc()['evaluation']['weights']['trust_reviews'])['toBe'](0x2d);const b=patchUserJudgmentDoc({'evaluation':{'weights':{'trust_reviews':0x32}}});expect(b['user_path'])['toBe'](userDocPath()),expect(existsSync(userDocPath()))['toBe'](!![]),expect(JSON['parse'](readFileSync(a,'utf-8')))['toEqual']({'version':0x1,'evaluation':{'weights':{'trust_reviews':0x2d}}}),expect(getJudgmentDoc()['evaluation']['weights']['trust_reviews'])['toBe'](0x32),expect(judgmentStatus()['user_doc_loaded'])['toBe'](!![]);}),it('reports\x20old\x20values\x20from\x20the\x20CURRENT\x20user\x20document\x20and\x20backs\x20it\x20up',()=>{patchUserJudgmentDoc({'evaluation':{'weights':{'trust_reviews':0x2d}}});const a=patchUserJudgmentDoc({'evaluation':{'weights':{'trust_reviews':0x32}}});expect(a['changed'])['toEqual']([{'path':'evaluation.weights.trust_reviews','old':0x2d,'new':0x32}]),expect(a['backup_path'])['toBeTruthy'](),expect(existsSync(a['backup_path']))['toBe'](!![]);const b=JSON['parse'](readFileSync(a['backup_path'],'utf-8'));expect(b['evaluation']?.['weights']?.['trust_reviews'])['toBe'](0x2d),expect(getJudgmentDoc()['evaluation']['weights']['trust_reviews'])['toBe'](0x32);}),it('rejects\x20a\x20patch\x20without\x20touching\x20the\x20file',()=>{writeUserDoc({'version':0x1,'evaluation':{'weights':{'trust_reviews':0x2d}}}),expect(()=>patchUserJudgmentDoc({'evaluation':{'weights':{'typoed_weight':0x1}}}))['toThrow'](/unknown dimension 'typoed_weight'/),expect(()=>patchUserJudgmentDoc({'rules':{'domains':{'util':{'rules':[{'rule_id':'INVENTED','enabled':![]}]}}}}))['toThrow'](/unknown rule|not a valid judgment fragment|INVENTED/i),expect(()=>patchUserJudgmentDoc({'version':0x63}))['toThrow'](/version/);const a=JSON['parse'](userDocText());expect(a['evaluation']?.['weights']?.['trust_reviews'])['toBe'](0x2d),expect(judgmentStatus()['last_reload_error'])['toBeNull']();}),it('refuses\x20to\x20patch\x20on\x20top\x20of\x20a\x20hand-broken\x20user\x20document',()=>{writeFileSync(userDocPath(),'{\x20not\x20json','utf-8'),expect(()=>getJudgmentDoc())['not']['toThrow'](),expect(()=>patchUserJudgmentDoc({'evaluation':{'weights':{'trust_reviews':0x2d}}}))['toThrow'](/not a valid judgment document/);}),it('is\x20a\x20no-op\x20when\x20the\x20patch\x20would\x20change\x20nothing',()=>{patchUserJudgmentDoc({'evaluation':{'weights':{'trust_reviews':0x2d}}});const a=statSync(userDocPath())['mtimeMs'],b=patchUserJudgmentDoc({'evaluation':{'weights':{'trust_reviews':0x2d}}});expect(b['changed'])['toEqual']([]),expect(b['backup_path'])['toBeNull'](),expect(statSync(userDocPath())['mtimeMs'])['toBe'](a);});}),describe('judgment\x20baselines\x20—\x20editable\x20view\x20(judgment_doc_read)',()=>{it('serves\x20the\x20full\x20factory\x20document\x20when\x20no\x20user\x20document\x20exists',()=>{const a=readUserJudgmentDocView();expect(a['exists'])['toBe'](![]),expect(a['user_path'])['toBe'](userJudgmentDocPath()),expect(a['version'])['toBe'](EXPECTED_JUDGMENT_VERSION);const b=a['doc'];expect(b['version'])['toBe'](EXPECTED_JUDGMENT_VERSION),expect(b['evaluation']?.['weights']?.['trust_reviews'])['toBe'](0x23),expect(Object['keys'](b['rules']?.['domains']??{}))['toContain']('util');}),it('serves\x20the\x20current\x20user\x20document\x20once\x20one\x20exists,\x20and\x20survives\x20a\x20hot\x20reload',()=>{writeUserDoc({'version':0x1,'evaluation':{'weights':{'trust_reviews':0x2d}}}),getJudgmentDoc();const a=readUserJudgmentDocView();expect(a['exists'])['toBe'](!![]);const b=a['doc'];expect(b['evaluation']?.['weights']?.['trust_reviews'])['toBe'](0x2d),expect(Object['keys'](b['evaluation']?.['weights']??{}))['toEqual'](['trust_reviews']),writeUserDoc({'version':0x1,'evaluation':{'weights':{'trust_reviews':0x32}}}),expect(readUserJudgmentDocView()['doc']['evaluation']?.['weights']?.['trust_reviews'])['toBe'](0x32);}),it('round-trips:\x20the\x20factory\x20view\x20can\x20be\x20saved\x20back\x20as\x20a\x20valid\x20user\x20document',()=>{const a=readUserJudgmentDocView(),{version:b,...c}=a['doc'];expect(()=>patchUserJudgmentDoc(c))['not']['toThrow'](),expect(existsSync(userDocPath()))['toBe'](!![]);const d=readUserJudgmentDocView();expect(d['exists'])['toBe'](!![]);});}),describe('judgment\x20baselines\x20—\x20session\x20runtime\x20overrides',()=>{it('overrides\x20one\x20value\x20above\x20the\x20user\x20document,\x20type-checked',()=>{writeUserDoc({'version':0x1,'evaluation':{'weights':{'trust_reviews':0x2d}}}),getJudgmentDoc();const a=setJudgmentOverride('evaluation.weights.trust_reviews',0x3c);expect(a)['toEqual']({'ok':!![]}),expect(getJudgmentDoc()['evaluation']['weights']['trust_reviews'])['toBe'](0x3c),expect(judgmentOverrides())['toEqual']([{'path':'evaluation.weights.trust_reviews','value':0x3c}]),expect(setJudgmentOverride('evaluation.weights.trust_reviews','high')['ok'])['toBe'](![]),expect(setJudgmentOverride('evaluation.weights.does_not_exist',0x1)['ok'])['toBe'](![]),expect(setJudgmentOverride('bogus.weight',0x1)['ok'])['toBe'](![]),expect(clearJudgmentOverride('evaluation.weights.trust_reviews'))['toBe'](!![]),expect(getJudgmentDoc()['evaluation']['weights']['trust_reviews'])['toBe'](0x2d);}),it('clears\x20all\x20overrides\x20at\x20once',()=>{writeUserDoc({'version':0x1,'evaluation':{'weights':{'trust_reviews':0x2d}}}),getJudgmentDoc(),setJudgmentOverride('evaluation.weights.trust_reviews',0x3c),setJudgmentOverride('evaluation.severity_deduction.critical',0x28),expect(clearJudgmentOverrides())['toBe'](0x2),expect(getJudgmentDoc()['evaluation']['weights']['trust_reviews'])['toBe'](0x2d),expect(getJudgmentDoc()['evaluation']['severity_deduction']['critical'])['toBe'](0x32);});}),describe('judgment\x20baselines\x20—\x20rules\x20namespace\x20(declarative\x20rule\x20book)',()=>{it('loads\x20the\x20util\x20factory\x20pack\x20and\x20evaluates\x20through\x20the\x20live\x20book',()=>{const a=getJudgmentDoc();expect(a['rules']['domains']['util']?.['rules']['map'](c=>c['rule_id']))['toEqual'](['R-UTIL-01','R-UTIL-02','R-UTIL-03','R-UTIL-04','R-UTIL-05']);const b=Object['values'](a['rules']['domains'])['reduce']((c,e)=>c+e['rules']['length'],0x0);expect(b)['toBeGreaterThan'](0x0),expect(judgmentStatus()['sections']['rules'])['toBe'](b),expect(checkUtilRisks({'large_util_import':!![]})['map'](c=>c['id']))['toEqual'](['R-UTIL-03']);}),it('disables\x20a\x20factory\x20rule\x20via\x20a\x20disable-only\x20override\x20—\x20silent\x20+\x20trace\x20(Q12)',()=>{writeUserDoc({'version':0x1,'rules':{'domains':{'util':{'rules':[{'rule_id':'R-UTIL-03','enabled':![]}]}}}}),getJudgmentDoc(),expect(checkUtilRisks({'large_util_import':!![],'expects_util_events':!![]})['map'](b=>b['id']))['toEqual'](['R-UTIL-04']);const a=getJudgmentDoc()['rules']['domains']['util']?.['rules']['find'](b=>b['rule_id']==='R-UTIL-03');expect(a?.['enabled'])['toBe'](![]),expect(a?.['cases']['length'])['toBeGreaterThan'](0x0);}),it('rejects\x20an\x20invented\x20domain\x20with\x20a\x20loud\x20error',()=>{writeUserDoc({'version':0x1,'rules':{'domains':{'typoed_domain':{'rules':[]}}}}),getJudgmentDoc(),expect(judgmentStatus()['last_reload_error'])['toContain']('unknown\x20domain\x20\x27typoed_domain\x27');}),it('rejects\x20an\x20invented\x20rule\x20id\x20inside\x20a\x20known\x20domain',()=>{writeUserDoc({'version':0x1,'rules':{'domains':{'service':{'rules':[{'rule_id':'R-S-9-99','enabled':![]}]}}}}),getJudgmentDoc(),expect(judgmentStatus()['last_reload_error'])['toContain']('unknown\x20rule\x20\x27R-S-9-99\x27');});}),describe('judgment\x20baselines\x20—\x20merge\x20kernel',()=>{it('merges\x20plain\x20objects\x20recursively\x20and\x20replaces\x20non-id\x20arrays',()=>{const a=mergeJudgmentValues({'a':{'x':0x1,'y':0x2},'bands':[{'min':0x1,'level':'l'}]},{'a':{'y':0x3},'bands':[{'min':0x0,'level':'zero'}]});expect(a['a'])['toEqual']({'x':0x1,'y':0x3}),expect(a['bands'])['toEqual']([{'min':0x0,'level':'zero'}]);}),it('merges\x20id-bearing\x20arrays\x20by\x20entry\x20id\x20and\x20never\x20deletes\x20base\x20entries',()=>{const a=mergeJudgmentValues({'rules':[{'rule_id':'r1','severity':'high'},{'rule_id':'r2','severity':'low'}]},{'rules':[{'rule_id':'r1','severity':'critical'},{'rule_id':'r3','severity':'medium'}]}),b=new Map(a['rules']['map'](c=>[c['rule_id'],c['severity']]));expect(b['get']('r1'))['toBe']('critical'),expect(b['get']('r2'))['toBe']('low'),expect(b['get']('r3'))['toBe']('medium'),expect(a['rules'])['toHaveLength'](0x3);});}),describe('judgment\x20baselines\x20—\x20phase-3\x20sections\x20(game\x20/\x20match\x20/\x20monitor\x20/\x20mode)',()=>{it('game:\x20a\x20session\x20override\x20to\x20the\x20scoring\x20constants\x20flows\x20into\x20evaluateOutcome\x20hot',()=>{expect(evaluateOutcome('refund','customer')['net_score'])['toBe'](0x50);const a=setJudgmentOverride('game.scoring.per_gain',0x28);expect(a)['toEqual']({'ok':!![]}),expect(evaluateOutcome('refund','customer')['net_score'])['toBe'](0x64),clearJudgmentOverride('game.scoring.per_gain'),expect(evaluateOutcome('refund','customer')['net_score'])['toBe'](0x50);}),it('game:\x20appetite\x20multipliers\x20are\x20live\x20data\x20(Q8\x20numeric\x20rail)',()=>{expect(appetiteMultiplier('conservative'))['toBe'](1.5),setJudgmentOverride('game.appetite_multipliers.conservative',2.5),expect(appetiteMultiplier('conservative'))['toBe'](2.5);const a={'risk_appetite':'conservative','requirements':['never\x20arbitrate']},b=resolveInterests('customer',a);expect(b['sensitivity'])['toBeCloseTo'](2.5,0x5),clearJudgmentOverride('game.appetite_multipliers.conservative'),expect(appetiteMultiplier('conservative'))['toBe'](1.5);}),it('game:\x20a\x20user\x20document\x20can\x20retune\x20one\x20role\x27s\x20anchors\x20(key-granularity)',()=>{writeUserDoc({'version':0x1,'game':{'role_interests':{'customer':{'prefer':['node_advanced'],'avoid':[],'sensitivity':0x1}}}}),expect(interestsOf('customer')['prefer'])['toEqual'](['node_advanced']),expect(interestsOf('merchant')['prefer'])['toEqual'](['fund_released_to_merchant']);}),it('game:\x20the\x20Q5\x20keyword\x20dictionary\x20is\x20data\x20—\x20a\x20user\x20rule\x20lands\x20hot',()=>{writeUserDoc({'version':0x1,'game':{'keyword_rules':[{'id':'kw_testing','keywords':['testing'],'effect':'node_advanced','anchor':'prefer','when_forbidden':![]}]}});const a=resolveInterests('arbitrator',{'requirements':['testing\x20please']});expect(a['prefer'])['toContain']('node_advanced'),expect(resolveInterests('arbitrator',{'requirements':['milestone\x20based']})['prefer'])['toContain']('node_advanced');}),it('game:\x20invented\x20vocabulary\x20is\x20rejected\x20loudly\x20(roles\x20/\x20outcomes\x20/\x20keyword\x20effects)',()=>{writeUserDoc({'version':0x1,'game':{'role_interests':{'custmr':{'prefer':[],'avoid':[],'sensitivity':0x1}}}}),getJudgmentDoc(),expect(judgmentStatus()['last_reload_error'])['toContain']('unknown\x20role\x20\x27custmr\x27'),writeUserDoc({'version':0x1,'game':{'outcome_semantics':{'frozen':['fund_frozen']}}}),getJudgmentDoc(),expect(judgmentStatus()['last_reload_error'])['toContain']('unknown\x20outcome\x20\x27frozen\x27'),writeUserDoc({'version':0x1,'game':{'keyword_rules':[{'id':'kw_bad','keywords':['x'],'effect':'fund_frozen_forever','anchor':'avoid','when_forbidden':!![]}]}}),getJudgmentDoc(),expect(judgmentStatus()['last_reload_error'])['toContain']('unknown\x20effect\x20\x27fund_frozen_forever\x27');}),it('monitor:\x20a\x20threshold\x20override\x20changes\x20monitorOrder\x20behavior\x20hot',()=>{const a=0x36ee80,b=0x64*a,c={'order_id':'0xorder','service_id':'0xservice','created_at':b-0x2*a,'now':b,'last_user_message_at':b-0x2*a,'has_messenger':!![],'has_arbitration':![]};expect(monitorOrder({'current':c})['map'](g=>g['id']))['not']['toContain']('messenger_unanswered'),setJudgmentOverride('monitor.thresholds.messenger_timeout_hours',0x1);const d=monitorOrder({'current':c}),e=d['find'](g=>g['id']==='messenger_unanswered');expect(e?.['severity'])['toBe']('high'),setJudgmentOverride('monitor.escalation.messenger_escalation_multiplier',1.5),expect(monitorOrder({'current':c})['find'](g=>g['id']==='messenger_unanswered')?.['severity'])['toBe']('critical'),clearJudgmentOverrides();const f=monitorOrder({'current':c,'thresholds':{'messenger_timeout_hours':0x1}});expect(f['find'](g=>g['id']==='messenger_unanswered')?.['severity'])['toBe']('high');}),it('match\x20and\x20mode:\x20parameter\x20overrides\x20land\x20in\x20the\x20effective\x20document',()=>{setJudgmentOverride('match.neutral_score',0x1e),setJudgmentOverride('match.top_n',0x3),setJudgmentOverride('mode.appetite_thresholds.aggressive',{'max_risk':0x5a,'min_benefit':0x46});const a=getJudgmentDoc();expect(a['match']['neutral_score'])['toBe'](0x1e),expect(a['match']['top_n'])['toBe'](0x3),expect(a['mode']['appetite_thresholds']['aggressive'])['toEqual']({'max_risk':0x5a,'min_benefit':0x46}),expect(a['match']['region_scores']['exact'])['toBe'](0x64),expect(a['mode']['appetite_thresholds']['balanced'])['toEqual']({'max_risk':0x3c,'min_benefit':0x3c});});}),describe('judgment\x20baselines\x20—\x20scorecard\x20section\x20(Q7\x20one\x20scoring\x20document)',()=>{function a(b){return{'account':'0xshop','industry':'education','network':'testnet','collected_at':0x0,'metrics':[{'id':'order_count','source':'market_operations','status':'ok','value':b,'collected_at':0x0}],'unavailable':[],'errors':[]};}it('scorecard:\x20anchor\x20override\x20changes\x20scoreMetricValue\x20hot',()=>{expect(scoreMetricValue('order_count',12.5))['toBe'](0x32),setJudgmentOverride('scorecard.metrics.order_count.good_threshold',0xf),expect(scoreMetricValue('order_count',12.5))['toBe'](0x4b),clearJudgmentOverride('scorecard.metrics.order_count.good_threshold'),expect(scoreMetricValue('order_count',12.5))['toBe'](0x32);}),it('scorecard:\x20posture\x20weight\x20override\x20flows\x20into\x20scoreScorecard\x20hot',()=>{const b=scoreScorecard(a(12.5),'margin')['metric_scores'][0x0]['weight'];expect(b)['toBe'](0.05),setJudgmentOverride('scorecard.metrics.order_count.weight',{'volume':0.2,'balanced':0.15,'margin':0.5}),expect(scoreScorecard(a(12.5),'margin')['metric_scores'][0x0]['weight'])['toBe'](0.5),clearJudgmentOverride('scorecard.metrics.order_count.weight');}),it('scorecard:\x20shop-evidence\x20gate\x20set\x20is\x20live\x20data',()=>{writeUserDoc({'version':0x1,'scorecard':{'shop_evidence_metrics':['order_count']}}),expect(getJudgmentDoc()['scorecard']['shop_evidence_metrics'])['toEqual'](['order_count']);}),it('scorecard:\x20invented\x20metric\x20ids\x20are\x20rejected\x20loudly',()=>{writeUserDoc({'version':0x1,'scorecard':{'metrics':{'ordr_count':{'good_threshold':0x1}}}}),getJudgmentDoc(),expect(judgmentStatus()['last_reload_error'])['toContain']('unknown\x20metric\x20\x27ordr_count\x27'),writeUserDoc({'version':0x1,'scorecard':{'shop_evidence_metrics':['phantom_metric']}}),getJudgmentDoc(),expect(judgmentStatus()['last_reload_error'])['toContain']('unknown\x20metric\x20\x27phantom_metric\x27');});}),describe('judgment\x20baselines\x20—\x20persona\x20+\x20industry\x20layers\x20(Q4/Q12)',()=>{it('layers\x20merge\x20in\x20precedence\x20order:\x20factory\x20<\x20industry\x20pack\x20<\x20user\x20document\x20<\x20persona',()=>{expect(getJudgmentDoc()['monitor']['thresholds']['messenger_timeout_hours'])['toBe'](0x18),setJudgmentIndustryOverlay({'monitor':{'thresholds':{'messenger_timeout_hours':0x6}}},'pack:education'),expect(getJudgmentDoc()['monitor']['thresholds']['messenger_timeout_hours'])['toBe'](0x6),writeUserDoc({'version':0x1,'monitor':{'thresholds':{'messenger_timeout_hours':0x30}}}),expect(getJudgmentDoc()['monitor']['thresholds']['messenger_timeout_hours'])['toBe'](0x30),setJudgmentPersonaFragment({'monitor':{'thresholds':{'messenger_timeout_hours':0xc}}},'persona'),expect(getJudgmentDoc()['monitor']['thresholds']['messenger_timeout_hours'])['toBe'](0xc),expect(getJudgmentDoc()['monitor']['thresholds']['progress_stall_hours'])['toBe'](0x0);const a=judgmentStatus();expect(a['industry_overlay_loaded'])['toBe'](!![]),expect(a['persona_fragment_loaded'])['toBe'](!![]),expect(a['layer_errors']['persona'])['toBeNull'](),expect(a['layer_errors']['industry'])['toBeNull']();}),it('persona\x20fragment:\x20invalid\x20edit\x20is\x20rejected,\x20last\x20good\x20stays\x20in\x20force,\x20null\x20clears',()=>{setJudgmentPersonaFragment({'game':{'scoring':{'base':0x46}}}),expect(getJudgmentDoc()['game']['scoring']['base'])['toBe'](0x46);const a=setJudgmentPersonaFragment({'game':{'scoring':{'bse':0x1}}});expect(a['ok'])['toBe'](![]),expect(judgmentLayerError('persona'))['toContain']('bse'),expect(getJudgmentDoc()['game']['scoring']['base'])['toBe'](0x46),setJudgmentPersonaFragment(null),expect(judgmentLayerError('persona'))['toBeNull'](),expect(getJudgmentDoc()['game']['scoring']['base'])['toBe'](0x3c);}),it('industry\x20pack:\x20disabling\x20a\x20factory\x20rule\x20leaves\x20a\x20trace\x20and\x20lands\x20in\x20the\x20book\x20(Q12)',()=>{const a=getJudgmentDoc()['rules']['domains']['util']?.['rules'][0x0]?.['rule_id'];expect(a)['toBeTruthy']();const b=setJudgmentIndustryOverlay({'rules':{'domains':{'util':{'rules':[{'rule_id':a,'enabled':![]}]}}}},'pack:education');expect(b['ok'])['toBe'](!![]);const c=getJudgmentDoc()['rules']['domains']['util']?.['rules']['find'](d=>d['rule_id']===a);expect(c?.['enabled'])['toBe'](![]),expect(judgmentDisableTrace())['toEqual']([{'layer':'pack:education','domain':'util','rule_id':a}]),setJudgmentIndustryOverlay({'rules':{'domains':{'util':{'rules':[{'rule_id':a,'enabled':!![]}]}}}},'pack:education'),expect(judgmentDisableTrace())['toEqual']([]);}),it('layers\x20cannot\x20invent\x20rule\x20ids\x20or\x20vocabulary',()=>{const a=setJudgmentIndustryOverlay({'rules':{'domains':{'util':{'rules':[{'rule_id':'R-X-0-99','enabled':![]}]}}}});expect(a['ok'])['toBe'](![]),expect(judgmentLayerError('industry'))['toContain']('unknown\x20rule\x20\x27R-X-0-99\x27'),expect(judgmentStatus()['industry_overlay_loaded'])['toBe'](![]);const b=setJudgmentPersonaFragment({'game':{'role_interests':{'custmr':{'prefer':[],'avoid':[],'sensitivity':0x1}}}});expect(b['ok'])['toBe'](![]),expect(judgmentLayerError('persona'))['toContain']('unknown\x20role\x20\x27custmr\x27');});}),describe('judgment\x20baselines\x20—\x20arb\x20game\x20tunables\x20(game.arb)',()=>{it('factory\x20anchors\x20are\x20live\x20and\x20scoring\x20retunes\x20hot',()=>{expect(getJudgmentDoc()['game']['arb']['scoring'])['toEqual']({'base':0x3c,'per_gain':0x14,'per_risk':0x19}),expect(evaluateArbGame('Finished','arbitrator')['actions'][0x0]?.['gain_score'])['toBe'](0x28),writeUserDoc({'version':0x1,'game':{'arb':{'scoring':{'base':0x3c,'per_gain':0x28,'per_risk':0x19}}}}),expect(evaluateArbGame('Finished','arbitrator')['actions'][0x0]?.['gain_score'])['toBe'](0x50),expect(getJudgmentDoc()['game']['arb']['effect_semantics']['reversal_chance'])['toBeTruthy']();}),it('arb\x20game:\x20invented\x20perspectives\x20and\x20effects\x20are\x20rejected\x20loudly',()=>{writeUserDoc({'version':0x1,'game':{'arb':{'role_interests':{'judge':{'prefer':[],'avoid':[],'sensitivity':0x1}}}}}),getJudgmentDoc(),expect(judgmentStatus()['last_reload_error'])['toContain']('unknown\x20perspective\x20\x27judge\x27'),expect(getJudgmentDoc()['game']['arb']['scoring']['per_gain'])['toBe'](0x28),writeUserDoc({'version':0x1,'game':{'arb':{'keyword_rules':[{'id':'kw_x','keywords':['x'],'effect':'case_won','anchor':'prefer','when_forbidden':![]}]}}}),getJudgmentDoc(),expect(judgmentStatus()['last_reload_error'])['toContain']('unknown\x20effect\x20\x27case_won\x27');});});
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import type { MatchPolicy } from "../evaluation/match-policy.js";
|
|
2
|
-
export type MatchPolicyDirection = "demand_to_supply" | "supply_to_demand";
|
|
3
|
-
export interface MatchPolicyFileState {
|
|
4
|
-
path: string;
|
|
5
|
-
exists: boolean;
|
|
6
|
-
error: string | null;
|
|
7
|
-
comment?: string;
|
|
8
|
-
demand_to_supply?: MatchPolicy;
|
|
9
|
-
supply_to_demand?: MatchPolicy;
|
|
10
|
-
}
|
|
11
|
-
export declare function matchPolicyFilePath(): string;
|
|
12
|
-
export declare function getMatchPolicyFile(): MatchPolicyFileState;
|
|
13
|
-
export declare function resetMatchPolicyFileCache(): void;
|
|
14
|
-
export interface MatchPolicyPatchChange {
|
|
15
|
-
path: string;
|
|
16
|
-
old: unknown;
|
|
17
|
-
new: unknown;
|
|
18
|
-
}
|
|
19
|
-
export interface MatchPolicyPatchResult {
|
|
20
|
-
applied: true;
|
|
21
|
-
path: string;
|
|
22
|
-
backup_path: string | null;
|
|
23
|
-
changed: MatchPolicyPatchChange[];
|
|
24
|
-
error: string | null;
|
|
25
|
-
warnings: string[];
|
|
26
|
-
}
|
|
27
|
-
export interface MatchPolicyClearResult {
|
|
28
|
-
cleared: boolean;
|
|
29
|
-
path: string;
|
|
30
|
-
scope: "file" | MatchPolicyDirection;
|
|
31
|
-
backup_path: string | null;
|
|
32
|
-
}
|
|
33
|
-
export declare function patchMatchPolicyFile(patch: unknown): MatchPolicyPatchResult;
|
|
34
|
-
export declare function clearMatchPolicyFile(direction?: MatchPolicyDirection): MatchPolicyClearResult;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{afterEach,beforeEach,describe,expect,it}from'vitest';import*as a35a from'node:fs';import*as a35b from'node:os';import*as a35c from'node:path';import{clearMatchPolicyFile,getMatchPolicyFile,matchPolicyFilePath,patchMatchPolicyFile,resetMatchPolicyFileCache}from'./match-policy-file.js';let dir,prevConfigDir;beforeEach(()=>{dir=a35a['mkdtempSync'](a35c['join'](a35b['tmpdir'](),'wowok-match-policy-file-')),prevConfigDir=process['env']['WOWOK_CONFIG_DIR'],process['env']['WOWOK_CONFIG_DIR']=dir,resetMatchPolicyFileCache();}),afterEach(()=>{if(prevConfigDir===undefined)delete process['env']['WOWOK_CONFIG_DIR'];else process['env']['WOWOK_CONFIG_DIR']=prevConfigDir;resetMatchPolicyFileCache(),a35a['rmSync'](dir,{'recursive':!![],'force':!![]});});function fileText(){return a35a['readFileSync'](matchPolicyFilePath(),'utf-8');}describe('match-policy.json\x20—\x20patch\x20channel',()=>{it('creates\x20the\x20file\x20when\x20absent,\x20stamps\x20the\x20kernel\x20version,\x20and\x20is\x20in\x20force\x20immediately',()=>{const a=patchMatchPolicyFile({'demand_to_supply':{'policy_id':'my_buy','weights':{'region':0x1e}}});expect(a['applied'])['toBe'](!![]),expect(a['path'])['toBe'](matchPolicyFilePath()),expect(a['backup_path'])['toBeNull'](),expect(a['error'])['toBeNull'](),expect(a['changed'])['toEqual']([{'path':'demand_to_supply.policy_id','old':null,'new':'my_buy'},{'path':'demand_to_supply.weights.region','old':null,'new':0x1e}]);const b=getMatchPolicyFile();expect(b['exists'])['toBe'](!![]),expect(b['error'])['toBeNull'](),expect(b['demand_to_supply']?.['policy_id'])['toBe']('my_buy'),expect(b['demand_to_supply']?.['direction'])['toBe']('demand_to_supply');const c=JSON['parse'](fileText());expect(c['version'])['toBe'](0x1);}),it('deep-merges\x20at\x20key\x20granularity\x20and\x20reports\x20old\x20values\x20from\x20the\x20CURRENT\x20file',()=>{patchMatchPolicyFile({'demand_to_supply':{'policy_id':'my_buy','weights':{'region':0x1e,'trust':0xa}},'supply_to_demand':{'policy_id':'my_supply'}});const a=patchMatchPolicyFile({'demand_to_supply':{'weights':{'region':0x28}}});expect(a['backup_path'])['toBeTruthy']();const b=getMatchPolicyFile();expect(b['demand_to_supply']?.['weights'])['toEqual']({'region':0x28,'trust':0xa}),expect(b['supply_to_demand']?.['policy_id'])['toBe']('my_supply'),expect(a['changed'])['toEqual']([{'path':'demand_to_supply.weights.region','old':0x1e,'new':0x28}]);const c=JSON['parse'](a35a['readFileSync'](a['backup_path'],'utf-8'));expect(c['demand_to_supply']?.['weights']?.['region'])['toBe'](0x1e);}),it('rejects\x20a\x20bad\x20patch\x20loudly\x20without\x20touching\x20the\x20file',()=>{patchMatchPolicyFile({'demand_to_supply':{'policy_id':'my_buy'}});const a=fileText();expect(()=>patchMatchPolicyFile({'version':0x63}))['toThrow'](/unknown key/i),expect(()=>patchMatchPolicyFile({'demand_to_supply':{'policy_id':'my_buy','weights':{'region':'high'}}}))['toThrow'](/weights\.region/i),expect(()=>patchMatchPolicyFile({'supply_to_demand':'nope'}))['toThrow'](/policy object/),expect(fileText())['toBe'](a);}),it('never\x20patches\x20over\x20an\x20unreadable\x20existing\x20file',()=>{a35a['writeFileSync'](matchPolicyFilePath(),'{\x20not\x20json','utf-8'),expect(()=>patchMatchPolicyFile({'demand_to_supply':{'policy_id':'my_buy'}}))['toThrow'](/not a valid match-policy document.*by hand first/s);}),it('a\x20no-op\x20patch\x20skips\x20the\x20write\x20entirely',()=>{patchMatchPolicyFile({'demand_to_supply':{'policy_id':'my_buy'}});const a=fileText(),b=patchMatchPolicyFile({'demand_to_supply':{'policy_id':'my_buy'}});expect(b['changed'])['toEqual']([]),expect(b['backup_path'])['toBeNull'](),expect(fileText())['toBe'](a);});}),describe('match-policy.json\x20—\x20clear\x20channel',()=>{it('removes\x20one\x20direction;\x20an\x20empty\x20remainder\x20deletes\x20the\x20file',()=>{patchMatchPolicyFile({'demand_to_supply':{'policy_id':'my_buy'},'supply_to_demand':{'policy_id':'my_supply'}});const a=clearMatchPolicyFile('demand_to_supply');expect(a['cleared'])['toBe'](!![]),expect(a['scope'])['toBe']('demand_to_supply'),expect(a['backup_path'])['toBeTruthy']();const b=getMatchPolicyFile();expect(b['exists'])['toBe'](!![]),expect(b['demand_to_supply'])['toBeUndefined'](),expect(b['supply_to_demand']?.['policy_id'])['toBe']('my_supply');const c=clearMatchPolicyFile('supply_to_demand');expect(c['cleared'])['toBe'](!![]),expect(a35a['existsSync'](matchPolicyFilePath()))['toBe'](![]),expect(getMatchPolicyFile()['exists'])['toBe'](![]);}),it('removes\x20the\x20whole\x20file\x20when\x20no\x20direction\x20is\x20given',()=>{patchMatchPolicyFile({'supply_to_demand':{'policy_id':'my_supply'}});const a=clearMatchPolicyFile();expect(a['cleared'])['toBe'](!![]),expect(a['scope'])['toBe']('file'),expect(a['backup_path'])['toBeTruthy'](),expect(a35a['existsSync'](matchPolicyFilePath()))['toBe'](![]),expect(getMatchPolicyFile())['toMatchObject']({'exists':![],'error':null});}),it('clearing\x20an\x20absent\x20file\x20is\x20an\x20honest\x20no-op',()=>{expect(clearMatchPolicyFile())['toMatchObject']({'cleared':![],'scope':'file','backup_path':null}),expect(clearMatchPolicyFile('demand_to_supply'))['toMatchObject']({'cleared':![],'scope':'demand_to_supply','backup_path':null});}),it('refuses\x20to\x20partially\x20clear\x20an\x20unreadable\x20file',()=>{patchMatchPolicyFile({'demand_to_supply':{'policy_id':'my_buy'}}),a35a['writeFileSync'](matchPolicyFilePath(),'{\x20broken','utf-8'),expect(()=>clearMatchPolicyFile('demand_to_supply'))['toThrow'](/unreadable.*WHOLE file/s);const a=clearMatchPolicyFile();expect(a['cleared'])['toBe'](!![]),expect(a35a['existsSync'](matchPolicyFilePath()))['toBe'](![]);});});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{describe,expect,it}from'vitest';import{evaluateCondition,evaluateRuleBook,interpolate,RuleDomainPackSchema,RuleEntrySchema}from'./rule-engine.js';const F={'count':0x3c,'name':'Hero\x20SKU','tags':['vip','beta'],'nested':{'deep':0x5},'empty':'','zero':0x0,'list':[],'flag':!![]},leaf=(a,b,c,d)=>({'field':a,'op':b,...c!==undefined?{'value':c}:{},...d?{'flags':d}:{}});function entry(a,b,c='medium',d={}){return RuleEntrySchema['parse']({'rule_id':a,'cases':[{'when':b,'level':c,'title':'t\x20'+a,'description':'d\x20'+a,...d}]});}describe('leaf\x20operators',()=>{it('present\x20/\x20missing',()=>{expect(evaluateCondition(leaf('count','present'),F))['toBe'](!![]),expect(evaluateCondition(leaf('absent','present'),F))['toBe'](![]),expect(evaluateCondition(leaf('absent','missing'),F))['toBe'](!![]),expect(evaluateCondition(leaf('nested.deep','present'),F))['toBe'](!![]),expect(evaluateCondition(leaf('nested.absent','missing'),F))['toBe'](!![]);}),it('truthy\x20/\x20falsy\x20follow\x20JS\x20semantics\x20with\x20empty-array\x20falsy',()=>{expect(evaluateCondition(leaf('flag','truthy'),F))['toBe'](!![]),expect(evaluateCondition(leaf('empty','truthy'),F))['toBe'](![]),expect(evaluateCondition(leaf('zero','truthy'),F))['toBe'](![]),expect(evaluateCondition(leaf('list','truthy'),F))['toBe'](![]),expect(evaluateCondition(leaf('tags','truthy'),F))['toBe'](!![]),expect(evaluateCondition(leaf('zero','falsy'),F))['toBe'](!![]),expect(evaluateCondition(leaf('absent','falsy'),F))['toBe'](!![]);}),it('eq\x20/\x20neq\x20are\x20strict',()=>{expect(evaluateCondition(leaf('count','eq',0x3c),F))['toBe'](!![]),expect(evaluateCondition(leaf('count','eq','60'),F))['toBe'](![]),expect(evaluateCondition(leaf('count','neq','60'),F))['toBe'](!![]);}),it('numeric\x20comparisons\x20coerce\x20numeric\x20strings,\x20refuse\x20the\x20rest',()=>{expect(evaluateCondition(leaf('count','gt',0x3b),F))['toBe'](!![]),expect(evaluateCondition(leaf('count','gte',0x3c),F))['toBe'](!![]),expect(evaluateCondition(leaf('count','lt',0x3d),F))['toBe'](!![]),expect(evaluateCondition(leaf('count','lte',0x3c),F))['toBe'](!![]),expect(evaluateCondition(leaf('name','gt',0x0),F))['toBe'](![]),expect(evaluateCondition(leaf('absent','gt',0x0),F))['toBe'](![]);}),it('in\x20/\x20nin\x20membership',()=>{expect(evaluateCondition(leaf('name','in',['Hero\x20SKU','X']),F))['toBe'](!![]),expect(evaluateCondition(leaf('name','nin',['X']),F))['toBe'](!![]),expect(evaluateCondition(leaf('name','in',['X']),F))['toBe'](![]);}),it('contains\x20works\x20on\x20arrays\x20and\x20strings',()=>{expect(evaluateCondition(leaf('tags','contains','vip'),F))['toBe'](!![]),expect(evaluateCondition(leaf('name','contains','SKU'),F))['toBe'](!![]),expect(evaluateCondition(leaf('tags','contains','nope'),F))['toBe'](![]),expect(evaluateCondition(leaf('count','contains',0x3c),F))['toBe'](![]);}),it('matches\x20uses\x20case-insensitive\x20by\x20default\x20and\x20honors\x20flags',()=>{expect(evaluateCondition(leaf('name','matches','^hero'),F))['toBe'](!![]),expect(evaluateCondition(leaf('name','matches','^hero','s'),F))['toBe'](![]);}),it('size\x20checks\x20array/string\x20length',()=>{expect(evaluateCondition(leaf('tags','size',0x2),F))['toBe'](!![]),expect(evaluateCondition(leaf('name','size',0x8),F))['toBe'](!![]),expect(evaluateCondition(leaf('tags','size',0x3),F))['toBe'](![]);});}),describe('combinators',()=>{it('all\x20/\x20any\x20/\x20not',()=>{const a={'all':[leaf('count','gt',0x0),leaf('flag','truthy')]},b={'any':[leaf('absent','present'),leaf('flag','truthy')]};expect(evaluateCondition(a,F))['toBe'](!![]),expect(evaluateCondition(b,F))['toBe'](!![]),expect(evaluateCondition({'not':leaf('flag','truthy')},F))['toBe'](![]),expect(evaluateCondition({'all':[]},F))['toBe'](!![]),expect(evaluateCondition({'any':[]},F))['toBe'](![]);}),it('nested\x20combinators',()=>{const a={'all':[leaf('count','gte',0x3c),{'not':{'any':[leaf('name','eq','X'),leaf('flag','falsy')]}}]};expect(evaluateCondition(a,F))['toBe'](!![]);});}),describe('interpolate',()=>{it('substitutes\x20facts\x20and\x20JSON-stringifies\x20objects',()=>{expect(interpolate('have\x20${count}\x20of\x20${name}',F))['toBe']('have\x2060\x20of\x20Hero\x20SKU'),expect(interpolate('deep=${nested.deep}',F))['toBe']('deep=5'),expect(interpolate('tags=${tags}',F))['toBe']('tags=[\x22vip\x22,\x22beta\x22]');}),it('leaves\x20the\x20literal\x20token\x20for\x20an\x20absent\x20fact',()=>{expect(interpolate('value\x20${absent}\x20stays',F))['toBe']('value\x20${absent}\x20stays');});}),describe('evaluateRuleBook',()=>{it('fires\x20the\x20FIRST\x20satisfied\x20case\x20only',()=>{const a=[entry('R1',leaf('count','gt',0x64),'high'),{'rule_id':'R2','cases':[{'when':leaf('count','gt',0x64),'level':'critical','title':'extreme','description':'e'},{'when':leaf('count','gt',0x32),'level':'medium','title':'moderate','description':'m'}]}],b=evaluateRuleBook(a,F);expect(b['findings'])['toHaveLength'](0x1),expect(b['findings'][0x0]['rule_id'])['toBe']('R2'),expect(b['findings'][0x0]['level'])['toBe']('medium'),expect(b['findings'][0x0]['title'])['toBe']('moderate');}),it('a\x20rule\x20with\x20no\x20satisfied\x20case\x20stays\x20silent',()=>{const a=evaluateRuleBook([entry('R1',leaf('count','gt',0x3e8))],F);expect(a['findings'])['toHaveLength'](0x0);}),it('interpolates\x20text\x20fields\x20from\x20facts',()=>{const a=[entry('R1',leaf('count','gt',0x32),'high',{'description':'count\x20is\x20${count}\x20for\x20${name}','evidence':'count=${count}'})],b=evaluateRuleBook(a,F);expect(b['findings'][0x0]['description'])['toBe']('count\x20is\x2060\x20for\x20Hero\x20SKU'),expect(b['findings'][0x0]['evidence'])['toBe']('count=60');}),it('disabled\x20rules\x20leave\x20a\x20trace\x20and\x20never\x20fire\x20(Q12)',()=>{const a=[entry('R1',leaf('count','gt',0x0))];a[0x0]['enabled']=![];const b=evaluateRuleBook(a,F);expect(b['findings'])['toHaveLength'](0x0),expect(b['disabled_traces'])['toEqual'](['R1']);}),it('document\x20order\x20defines\x20finding\x20order',()=>{const a=[entry('RB',leaf('flag','truthy')),entry('RA',leaf('flag','truthy'))],b=evaluateRuleBook(a,F);expect(b['findings']['map'](c=>c['rule_id']))['toEqual'](['RB','RA']);});}),describe('schemas',()=>{it('accepts\x20a\x20well-formed\x20domain\x20pack',()=>{const a={'comment':'demo','facts':{'count':'item\x20count'},'rules':[{'rule_id':'R-1','dimension':'structural','trigger':'count\x20too\x20big','cases':[{'when':{'field':'count','op':'gt','value':0x32},'level':'high','title':'Too\x20many','description':'count\x20${count}'}]}]};expect(RuleDomainPackSchema['safeParse'](a)['success'])['toBe'](!![]);}),it('rejects\x20legacy\x20severity\x20words\x20and\x20unknown\x20keys',()=>{const a={'rules':[{'rule_id':'R-1','cases':[{'when':{'field':'x','op':'present'},'level':'warning','title':'t','description':'d'}]}]};expect(RuleDomainPackSchema['safeParse'](a)['success'])['toBe'](![]);const b={'rules':[{'rule_id':'R-1','hacker':!![],'cases':[{'when':{'field':'x','op':'present'},'level':'low','title':'t','description':'d'}]}]};expect(RuleEntrySchema['safeParse'](b['rules'][0x0])['success'])['toBe'](![]);}),it('rejects\x20an\x20empty\x20cases\x20list',()=>{expect(RuleEntrySchema['safeParse']({'rule_id':'R-1','cases':[]})['success'])['toBe'](![]);});});
|
package/dist/config/runtime.d.ts
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
export type ServiceName = "confirm_gate" | "harness" | "semantic_rich" | "experience_layer" | "customer_intelligence" | "order_monitor" | "industry_evolution";
|
|
2
|
-
export type HarnessTier = "off" | "lightweight" | "full";
|
|
3
|
-
interface ServiceMeta {
|
|
4
|
-
name: ServiceName;
|
|
5
|
-
description: string;
|
|
6
|
-
defaultEnabled: boolean;
|
|
7
|
-
envVar: string;
|
|
8
|
-
remindOnToggle: boolean;
|
|
9
|
-
}
|
|
10
|
-
export declare const SERVICE_REGISTRY: ServiceMeta[];
|
|
11
|
-
export declare function getHarnessTier(): HarnessTier;
|
|
12
|
-
export declare function setHarnessTier(tier: HarnessTier): void;
|
|
13
|
-
export declare function isEnabled(service: ServiceName): boolean;
|
|
14
|
-
export declare function setEnabled(service: ServiceName, enabled: boolean): void;
|
|
15
|
-
export declare function toggle(service: ServiceName): boolean;
|
|
16
|
-
export declare function reset(service: ServiceName): void;
|
|
17
|
-
export interface ServiceStatus {
|
|
18
|
-
name: ServiceName;
|
|
19
|
-
enabled: boolean;
|
|
20
|
-
defaultEnabled: boolean;
|
|
21
|
-
description: string;
|
|
22
|
-
overridden: boolean;
|
|
23
|
-
envVar: string;
|
|
24
|
-
reminder?: string;
|
|
25
|
-
}
|
|
26
|
-
export declare function listServices(): ServiceStatus[];
|
|
27
|
-
export declare function getServiceInfo(service: ServiceName): ServiceStatus | undefined;
|
|
28
|
-
export declare const RUNTIME_CONFIG_VERSION = 1;
|
|
29
|
-
export {};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
export interface StoreDualPayoutPolicy {
|
|
2
|
-
preauthorized: boolean;
|
|
3
|
-
authorized_at?: string;
|
|
4
|
-
note?: string;
|
|
5
|
-
network?: string;
|
|
6
|
-
}
|
|
7
|
-
export declare function getStoreDualPayoutPolicy(account: string): StoreDualPayoutPolicy | undefined;
|
|
8
|
-
export declare function isDualPayoutPreauthorized(account?: string): boolean;
|
|
9
|
-
export declare function setStoreDualPayoutPreauthorization(account: string, input: {
|
|
10
|
-
confirm: boolean;
|
|
11
|
-
note?: string;
|
|
12
|
-
network?: string;
|
|
13
|
-
}): StoreDualPayoutPolicy;
|
|
14
|
-
export declare function clearStoreDualPayoutPreauthorization(account: string): boolean;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{mkdtempSync,writeFileSync}from'fs';import{tmpdir}from'os';import{join}from'path';import{describe,expect,it,beforeEach}from'vitest';import{getStoreDualPayoutPolicy,setStoreDualPayoutPreauthorization,clearStoreDualPayoutPreauthorization,isDualPayoutPreauthorized}from'./store-policy.js';const ACC='0xABCdef1234567890abcdef1234567890abcdef12';describe('store-policy\x20D-1\x20ledger',()=>{let a;beforeEach(()=>{a=mkdtempSync(join(tmpdir(),'wowok-store-policy-')),process['env']['WOWOK_CONFIG_DIR']=a;}),it('set\x20WITHOUT\x20confirm\x20throws\x20and\x20records\x20nothing',()=>{expect(()=>setStoreDualPayoutPreauthorization(ACC,{'confirm':![]}))['toThrow'](/confirm=true/),expect(()=>setStoreDualPayoutPreauthorization(ACC,{}))['toThrow'](/confirm=true/),expect(getStoreDualPayoutPolicy(ACC))['toBeUndefined']();}),it('set\x20with\x20confirm:true\x20persists\x20and\x20get\x20roundtrips\x20(case-insensitive\x20key)',()=>{const b=setStoreDualPayoutPreauthorization(ACC,{'confirm':!![],'note':'merchant\x20standing\x20netting','network':'mainnet'});expect(b['preauthorized'])['toBe'](!![]),expect(b['authorized_at'])['toBeTruthy'](),expect(b['note'])['toBe']('merchant\x20standing\x20netting'),expect(getStoreDualPayoutPolicy(ACC['toLowerCase']())?.['preauthorized'])['toBe'](!![]),expect(getStoreDualPayoutPolicy(ACC['toUpperCase']())?.['preauthorized'])['toBe'](!![]),expect(isDualPayoutPreauthorized(ACC))['toBe'](!![]);}),it('unconfigured\x20account\x20→\x20not\x20preauthorized\x20(safe\x20hard-block\x20default)',()=>{expect(getStoreDualPayoutPolicy(ACC))['toBeUndefined'](),expect(isDualPayoutPreauthorized(ACC))['toBe'](![]),expect(isDualPayoutPreauthorized(undefined))['toBe'](![]),expect(isDualPayoutPreauthorized(''))['toBe'](![]);}),it('clear\x20removes\x20an\x20existing\x20record\x20(true)\x20and\x20reports\x20false\x20when\x20absent',()=>{setStoreDualPayoutPreauthorization(ACC,{'confirm':!![]}),expect(clearStoreDualPayoutPreauthorization(ACC['toUpperCase']()))['toBe'](!![]),expect(getStoreDualPayoutPolicy(ACC))['toBeUndefined'](),expect(isDualPayoutPreauthorized(ACC))['toBe'](![]),expect(clearStoreDualPayoutPreauthorization(ACC))['toBe'](![]);}),it('corrupt\x20policy\x20file\x20→\x20fail-soft\x20to\x20not-preauthorized\x20(never\x20crashes\x20the\x20gate\x20read)',()=>{writeFileSync(join(a,'store-policies.json'),'{not\x20json\x20at\x20all','utf-8'),expect(getStoreDualPayoutPolicy(ACC))['toBeUndefined'](),expect(isDualPayoutPreauthorized(ACC))['toBe'](![]),setStoreDualPayoutPreauthorization(ACC,{'confirm':!![]}),expect(isDualPayoutPreauthorized(ACC))['toBe'](!![]);});});
|