@wowok/agent-mcp 3.1.2 → 3.1.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/config/config-audit.spec.d.ts +1 -0
- package/dist/config/config-audit.spec.js +1 -0
- package/dist/config/exposure.d.ts +108 -0
- package/dist/config/exposure.js +1 -0
- package/dist/config/index.d.ts +2 -0
- package/dist/config/index.js +1 -1
- package/dist/config/judgment.d.ts +1228 -0
- package/dist/config/judgment.js +1 -0
- package/dist/config/judgment.spec.d.ts +1 -0
- package/dist/config/judgment.spec.js +1 -0
- package/dist/config/rule-engine.d.ts +299 -0
- package/dist/config/rule-engine.js +1 -0
- package/dist/config/rule-engine.spec.d.ts +1 -0
- package/dist/config/rule-engine.spec.js +1 -0
- package/dist/config/runtime.js +1 -1
- package/dist/config/severity.d.ts +7 -0
- package/dist/config/severity.js +1 -0
- package/dist/customer/index.d.ts +3 -9
- package/dist/customer/index.js +1 -1
- package/dist/customer/industry-risks.d.ts +3 -17
- package/dist/customer/industry-risks.js +1 -1
- package/dist/customer/order-monitor.d.ts +3 -1
- package/dist/customer/order-monitor.js +1 -1
- package/dist/customer/types.d.ts +1 -165
- package/dist/customer/types.js +1 -1
- package/dist/customer/user-preferences.d.ts +0 -49
- package/dist/customer/user-preferences.js +1 -1
- package/dist/evaluation/acceptance.d.ts +1 -0
- package/dist/evaluation/acceptance.js +1 -1
- package/dist/evaluation/arbitration-game.js +1 -1
- package/dist/evaluation/architecture.spec.d.ts +1 -0
- package/dist/evaluation/architecture.spec.js +1 -0
- package/dist/evaluation/builtins/demand-match.js +1 -1
- package/dist/evaluation/builtins/graph-service.d.ts +16 -0
- package/dist/evaluation/builtins/graph-service.js +1 -0
- package/dist/evaluation/builtins/graph-service.spec.d.ts +1 -0
- package/dist/evaluation/builtins/graph-service.spec.js +1 -0
- package/dist/evaluation/builtins/index.d.ts +1 -1
- package/dist/evaluation/builtins/index.js +1 -1
- package/dist/evaluation/builtins/purity.spec.d.ts +1 -0
- package/dist/evaluation/builtins/purity.spec.js +1 -0
- package/dist/evaluation/engine.js +1 -1
- package/dist/evaluation/facets/catalog.d.ts +19 -0
- package/dist/evaluation/facets/catalog.js +1 -0
- package/dist/evaluation/game-strategy.d.ts +2 -2
- package/dist/evaluation/game-strategy.js +1 -1
- package/dist/evaluation/guard-scan.d.ts +10 -0
- package/dist/evaluation/guard-scan.js +1 -0
- package/dist/evaluation/match-operation.d.ts +2 -2
- package/dist/evaluation/match-operation.js +1 -1
- package/dist/evaluation/standards.d.ts +9 -0
- package/dist/evaluation/standards.js +1 -0
- package/dist/evaluation/standards.spec.d.ts +1 -0
- package/dist/evaluation/standards.spec.js +1 -0
- package/dist/evaluation/types.d.ts +11 -1
- package/dist/experience/realtime-feedback.js +1 -1
- package/dist/extensions/business-modules.js +1 -1
- package/dist/extensions/custom-registry-file.js +1 -1
- package/dist/extensions/index.d.ts +1 -1
- package/dist/extensions/index.js +1 -1
- package/dist/extensions/industry-audit.spec.d.ts +1 -0
- package/dist/extensions/industry-audit.spec.js +1 -0
- package/dist/extensions/industry-layers.d.ts +14 -5
- package/dist/extensions/industry-layers.js +1 -1
- package/dist/extensions/industry-pack.d.ts +2 -0
- package/dist/extensions/industry-pack.js +1 -1
- package/dist/extensions/mode-evaluator.js +1 -1
- package/dist/extensions/modes.js +1 -1
- package/dist/graph/onchain/analyze.d.ts +16 -1
- package/dist/graph/onchain/analyze.js +1 -1
- package/dist/graph/onchain/analyze.spec.js +1 -1
- package/dist/graph/onchain/dataplane.d.ts +1 -1
- package/dist/graph/onchain/dataplane.js +1 -1
- package/dist/graph/onchain/edge-batch.spec.d.ts +1 -0
- package/dist/graph/onchain/edge-batch.spec.js +1 -0
- package/dist/graph/onchain/edge-schema.d.ts +11 -2
- package/dist/graph/onchain/edge-schema.js +1 -1
- package/dist/graph/onchain/entity-profile.spec.d.ts +1 -0
- package/dist/graph/onchain/entity-profile.spec.js +1 -0
- package/dist/graph/onchain/event-history.spec.d.ts +1 -0
- package/dist/graph/onchain/event-history.spec.js +1 -0
- package/dist/graph/onchain/expand.js +1 -1
- package/dist/graph/onchain/exploration.d.ts +28 -0
- package/dist/graph/onchain/exploration.js +1 -0
- package/dist/graph/onchain/exploration.spec.d.ts +1 -0
- package/dist/graph/onchain/exploration.spec.js +1 -0
- package/dist/graph/onchain/exposure.d.ts +18 -0
- package/dist/graph/onchain/exposure.js +1 -0
- package/dist/graph/onchain/exposure.spec.d.ts +1 -0
- package/dist/graph/onchain/exposure.spec.js +1 -0
- package/dist/graph/onchain/extract-deep.spec.d.ts +1 -0
- package/dist/graph/onchain/extract-deep.spec.js +1 -0
- package/dist/graph/onchain/extract.d.ts +11 -3
- package/dist/graph/onchain/extract.js +1 -1
- package/dist/graph/onchain/facet-projection.d.ts +99 -0
- package/dist/graph/onchain/facet-projection.js +1 -0
- package/dist/graph/onchain/facet-projection.spec.d.ts +1 -0
- package/dist/graph/onchain/facet-projection.spec.js +1 -0
- package/dist/graph/onchain/facts.d.ts +103 -0
- package/dist/graph/onchain/facts.js +1 -0
- package/dist/graph/onchain/facts.spec.d.ts +1 -0
- package/dist/graph/onchain/facts.spec.js +1 -0
- package/dist/graph/onchain/field-manifest.d.ts +29 -0
- package/dist/graph/onchain/field-manifest.js +1 -0
- package/dist/graph/onchain/field-manifest.spec.d.ts +1 -0
- package/dist/graph/onchain/field-manifest.spec.js +1 -0
- package/dist/graph/onchain/fixtures.d.ts +80 -0
- package/dist/graph/onchain/fixtures.js +1 -0
- package/dist/graph/onchain/fixtures.spec.d.ts +1 -0
- package/dist/graph/onchain/fixtures.spec.js +1 -0
- package/dist/graph/onchain/graph-policy.spec.d.ts +1 -0
- package/dist/graph/onchain/graph-policy.spec.js +1 -0
- package/dist/graph/onchain/index.d.ts +14 -2
- package/dist/graph/onchain/index.js +1 -1
- package/dist/graph/onchain/interest.js +1 -1
- package/dist/graph/onchain/interest.spec.js +1 -1
- package/dist/graph/onchain/label-lint.spec.d.ts +1 -0
- package/dist/graph/onchain/label-lint.spec.js +1 -0
- package/dist/graph/onchain/names.d.ts +23 -0
- package/dist/graph/onchain/names.js +1 -0
- package/dist/graph/onchain/names.spec.d.ts +1 -0
- package/dist/graph/onchain/names.spec.js +1 -0
- package/dist/graph/onchain/onchain.spec.js +1 -1
- package/dist/graph/onchain/policy.d.ts +8 -0
- package/dist/graph/onchain/policy.js +1 -0
- package/dist/graph/onchain/proposal-graph.d.ts +11 -0
- package/dist/graph/onchain/proposal-graph.js +1 -0
- package/dist/graph/onchain/proposal-graph.spec.d.ts +1 -0
- package/dist/graph/onchain/proposal-graph.spec.js +1 -0
- package/dist/graph/onchain/sdk-batch.d.ts +5 -1
- package/dist/graph/onchain/sdk-batch.js +1 -1
- package/dist/graph/onchain/strategy.d.ts +16 -0
- package/dist/graph/onchain/strategy.js +1 -1
- package/dist/graph/onchain/strategy.spec.js +1 -1
- package/dist/graph/onchain/synthesis.d.ts +20 -0
- package/dist/graph/onchain/synthesis.js +1 -0
- package/dist/graph/onchain/synthesis.spec.d.ts +1 -0
- package/dist/graph/onchain/synthesis.spec.js +1 -0
- package/dist/graph/onchain/table-ledger.spec.d.ts +1 -0
- package/dist/graph/onchain/table-ledger.spec.js +1 -0
- package/dist/graph/onchain/types.d.ts +57 -7
- package/dist/graph/onchain/viewport.d.ts +1 -0
- package/dist/graph/onchain/viewport.js +1 -1
- package/dist/harness/index.d.ts +1 -5
- package/dist/harness/index.js +1 -1
- package/dist/harness/verify.d.ts +6 -1
- package/dist/harness/verify.js +1 -1
- package/dist/index.js +1 -1
- package/dist/keeper/keeper.spec.js +1 -1
- package/dist/knowledge/alloc-audit-policy.spec.d.ts +1 -0
- package/dist/knowledge/alloc-audit-policy.spec.js +1 -0
- package/dist/knowledge/allocation-ledger.js +1 -1
- package/dist/knowledge/allocation-puzzle.d.ts +1 -1
- package/dist/knowledge/allocation-puzzle.js +1 -1
- package/dist/knowledge/allocation-risk.d.ts +4 -3
- package/dist/knowledge/allocation-risk.js +1 -1
- package/dist/knowledge/allocation-templates.js +1 -1
- package/dist/knowledge/arb-risk.d.ts +6 -6
- package/dist/knowledge/arb-risk.js +1 -1
- package/dist/knowledge/arbitration-ledger.d.ts +4 -4
- package/dist/knowledge/arbitration-ledger.js +1 -1
- package/dist/knowledge/arbitration-puzzle.d.ts +1 -1
- package/dist/knowledge/arbitration-puzzle.js +1 -1
- package/dist/knowledge/arbitration-risk.d.ts +4 -3
- package/dist/knowledge/arbitration-risk.js +1 -1
- package/dist/knowledge/arbitration-templates.js +1 -1
- package/dist/knowledge/baselines/guard-lint-baseline.spec.d.ts +1 -0
- package/dist/knowledge/baselines/guard-lint-baseline.spec.js +1 -0
- package/dist/knowledge/baselines/judgment-baselines.json +289 -0
- package/dist/knowledge/baselines/risk-baselines.spec.d.ts +1 -0
- package/dist/knowledge/baselines/risk-baselines.spec.js +1 -0
- package/dist/knowledge/baselines/risk-cases.d.ts +8 -0
- package/dist/knowledge/baselines/risk-cases.js +1 -0
- package/dist/knowledge/baselines/rules/alloc_audit.json +290 -0
- package/dist/knowledge/baselines/rules/allocation.json +492 -0
- package/dist/knowledge/baselines/rules/arb.json +155 -0
- package/dist/knowledge/baselines/rules/arbitration.json +366 -0
- package/dist/knowledge/baselines/rules/bridge.json +197 -0
- package/dist/knowledge/baselines/rules/contact.json +152 -0
- package/dist/knowledge/baselines/rules/demand.json +158 -0
- package/dist/knowledge/baselines/rules/graph.json +453 -0
- package/dist/knowledge/baselines/rules/guard.json +981 -0
- package/dist/knowledge/baselines/rules/machine.json +706 -0
- package/dist/knowledge/baselines/rules/order.json +549 -0
- package/dist/knowledge/baselines/rules/payment.json +205 -0
- package/dist/knowledge/baselines/rules/permission.json +330 -0
- package/dist/knowledge/baselines/rules/personal.json +139 -0
- package/dist/knowledge/baselines/rules/progress.json +346 -0
- package/dist/knowledge/baselines/rules/proof.json +158 -0
- package/dist/knowledge/baselines/rules/registrar.json +159 -0
- package/dist/knowledge/baselines/rules/repository.json +244 -0
- package/dist/knowledge/baselines/rules/resource.json +117 -0
- package/dist/knowledge/baselines/rules/reward.json +471 -0
- package/dist/knowledge/baselines/rules/service.json +595 -0
- package/dist/knowledge/baselines/rules/treasury.json +440 -0
- package/dist/knowledge/baselines/rules/util.json +101 -0
- package/dist/knowledge/bridge-risk.d.ts +6 -6
- package/dist/knowledge/bridge-risk.js +1 -1
- package/dist/knowledge/builtin-templates.d.ts +26 -0
- package/dist/knowledge/builtin-templates.js +1 -0
- package/dist/knowledge/contact-risk.d.ts +6 -6
- package/dist/knowledge/contact-risk.js +1 -1
- package/dist/knowledge/contract-invariants.d.ts +1 -0
- package/dist/knowledge/contract-invariants.js +1 -1
- package/dist/knowledge/demand-risk.d.ts +6 -6
- package/dist/knowledge/demand-risk.js +1 -1
- package/dist/knowledge/event-semantics.js +1 -1
- package/dist/knowledge/facts-sync.spec.d.ts +1 -0
- package/dist/knowledge/facts-sync.spec.js +1 -0
- package/dist/knowledge/getting-started.js +1 -1
- package/dist/knowledge/guard-design-patterns.js +1 -1
- package/dist/knowledge/guard-eval.d.ts +15 -0
- package/dist/knowledge/guard-eval.js +1 -0
- package/dist/knowledge/guard-eval.spec.d.ts +1 -0
- package/dist/knowledge/guard-eval.spec.js +1 -0
- package/dist/knowledge/guard-field-cognition.d.ts +1 -1
- package/dist/knowledge/guard-field-cognition.js +1 -1
- package/dist/knowledge/guard-ledger.js +1 -1
- package/dist/knowledge/guard-lint.d.ts +1 -1
- package/dist/knowledge/guard-lint.js +1 -1
- package/dist/knowledge/guard-risk.d.ts +7 -19
- package/dist/knowledge/guard-risk.js +1 -1
- package/dist/knowledge/guard-templates.js +1 -1
- package/dist/knowledge/guard-translation.js +1 -1
- package/dist/knowledge/index.d.ts +51 -45
- package/dist/knowledge/index.js +1 -1
- package/dist/knowledge/industry-registry.js +1 -1
- package/dist/knowledge/industry-rule-node.d.ts +7 -0
- package/dist/knowledge/industry-rule-node.js +1 -0
- package/dist/knowledge/industry-strategy.js +1 -1
- package/dist/knowledge/jsonrpc-enum.js +1 -1
- package/dist/knowledge/machine-ledger.js +1 -1
- package/dist/knowledge/machine-risk.d.ts +4 -7
- package/dist/knowledge/machine-risk.js +1 -1
- package/dist/knowledge/machine-templates.js +1 -1
- package/dist/knowledge/machine-translation.js +1 -1
- package/dist/knowledge/migration-preflight.js +1 -1
- package/dist/knowledge/operation-dictionary.js +1 -1
- package/dist/knowledge/order-ledger.js +1 -1
- package/dist/knowledge/order-puzzle.d.ts +3 -3
- package/dist/knowledge/order-puzzle.js +1 -1
- package/dist/knowledge/order-risk.d.ts +7 -12
- package/dist/knowledge/order-risk.js +1 -1
- package/dist/knowledge/order-templates.js +1 -1
- package/dist/knowledge/passport-ledger.js +1 -1
- package/dist/knowledge/passport-templates.js +1 -1
- package/dist/knowledge/payment-risk.d.ts +8 -7
- package/dist/knowledge/payment-risk.js +1 -1
- package/dist/knowledge/payment-tracker.js +1 -1
- package/dist/knowledge/permission-ledger.js +1 -1
- package/dist/knowledge/permission-puzzle.d.ts +12 -12
- package/dist/knowledge/permission-puzzle.js +1 -1
- package/dist/knowledge/permission-risk.d.ts +4 -10
- package/dist/knowledge/permission-risk.js +1 -1
- package/dist/knowledge/permission-templates.js +1 -1
- package/dist/knowledge/personal-risk.d.ts +6 -6
- package/dist/knowledge/personal-risk.js +1 -1
- package/dist/knowledge/progress-ledger.js +1 -1
- package/dist/knowledge/progress-puzzle.d.ts +2 -2
- package/dist/knowledge/progress-puzzle.js +1 -1
- package/dist/knowledge/progress-risk.d.ts +4 -3
- package/dist/knowledge/progress-risk.js +1 -1
- package/dist/knowledge/progress-templates.js +1 -1
- package/dist/knowledge/proof-risk.d.ts +6 -6
- package/dist/knowledge/proof-risk.js +1 -1
- package/dist/knowledge/puzzle-projections.d.ts +11 -0
- package/dist/knowledge/puzzle-projections.js +1 -0
- package/dist/knowledge/recipient-constraint.d.ts +20 -1
- package/dist/knowledge/recipient-constraint.js +1 -1
- package/dist/knowledge/registrar-risk.d.ts +6 -6
- package/dist/knowledge/registrar-risk.js +1 -1
- package/dist/knowledge/repository-risk.d.ts +7 -7
- package/dist/knowledge/repository-risk.js +1 -1
- package/dist/knowledge/resource-risk.d.ts +6 -6
- package/dist/knowledge/resource-risk.js +1 -1
- package/dist/knowledge/reward-ledger.d.ts +1 -1
- package/dist/knowledge/reward-ledger.js +1 -1
- package/dist/knowledge/reward-puzzle.d.ts +2 -2
- package/dist/knowledge/reward-puzzle.js +1 -1
- package/dist/knowledge/reward-risk.d.ts +5 -6
- package/dist/knowledge/reward-risk.js +1 -1
- package/dist/knowledge/rule-node-analyzers.d.ts +43 -0
- package/dist/knowledge/rule-node-analyzers.js +1 -0
- package/dist/knowledge/rule-node-analyzers.spec.d.ts +1 -0
- package/dist/knowledge/rule-node-analyzers.spec.js +1 -0
- package/dist/knowledge/rule-outcome.d.ts +5 -0
- package/dist/knowledge/rule-outcome.js +1 -0
- package/dist/knowledge/safety-rules.js +1 -1
- package/dist/knowledge/scenario-modes.d.ts +2 -2
- package/dist/knowledge/scenario-modes.js +1 -1
- package/dist/knowledge/scenario-topology.js +1 -1
- package/dist/knowledge/service-allocator-audit-node.js +1 -1
- package/dist/knowledge/service-ledger.js +1 -1
- package/dist/knowledge/service-puzzle.d.ts +2 -2
- package/dist/knowledge/service-puzzle.js +1 -1
- package/dist/knowledge/service-risk-node.js +1 -1
- package/dist/knowledge/service-risk.d.ts +4 -4
- package/dist/knowledge/service-risk.js +1 -1
- package/dist/knowledge/service-templates.js +1 -1
- package/dist/knowledge/strategy-manuals.d.ts +1 -1
- package/dist/knowledge/strategy-manuals.js +1 -1
- package/dist/knowledge/template-loader.d.ts +84 -0
- package/dist/knowledge/template-loader.js +1 -0
- package/dist/knowledge/template-loader.spec.d.ts +1 -0
- package/dist/knowledge/template-loader.spec.js +1 -0
- package/dist/knowledge/template-registry.js +1 -1
- package/dist/knowledge/template-scanner.d.ts +17 -0
- package/dist/knowledge/template-scanner.js +1 -0
- package/dist/knowledge/template-scanner.spec.d.ts +1 -0
- package/dist/knowledge/template-scanner.spec.js +1 -0
- package/dist/knowledge/tools-reference.js +1 -1
- package/dist/knowledge/treasury-ledger.d.ts +1 -1
- package/dist/knowledge/treasury-ledger.js +1 -1
- package/dist/knowledge/treasury-puzzle.d.ts +3 -3
- package/dist/knowledge/treasury-puzzle.js +1 -1
- package/dist/knowledge/treasury-risk.d.ts +6 -4
- package/dist/knowledge/treasury-risk.js +1 -1
- package/dist/knowledge/treasury-templates.js +1 -1
- package/dist/knowledge/util-risk.d.ts +6 -6
- package/dist/knowledge/util-risk.js +1 -1
- package/dist/knowledge/workflow-guidance.d.ts +4 -0
- package/dist/knowledge/workflow-guidance.js +1 -1
- package/dist/knowledge/workspace-lists.js +1 -1
- package/dist/monitor/MonitorLoop.js +1 -1
- package/dist/participation/arbitrator-interest.js +1 -1
- package/dist/participation/radar-core.js +1 -1
- package/dist/persona/analyzer.js +1 -1
- package/dist/persona/bridge.js +1 -1
- package/dist/persona/facet-profile.d.ts +33 -0
- package/dist/persona/facet-profile.js +1 -0
- package/dist/persona/index.js +1 -1
- package/dist/persona/model.d.ts +2 -1
- package/dist/persona/model.js +1 -1
- package/dist/persona/persona-audit.spec.d.ts +1 -0
- package/dist/persona/persona-audit.spec.js +1 -0
- package/dist/persona/topology-focus.d.ts +2 -2
- package/dist/persona/topology-focus.js +1 -1
- package/dist/persona/types.d.ts +14 -0
- package/dist/playbooks/service-build/business-puzzle.js +1 -1
- package/dist/playbooks/service-build/facet-money.d.ts +33 -0
- package/dist/playbooks/service-build/facet-money.js +1 -0
- package/dist/playbooks/service-build/facet-money.spec.d.ts +1 -0
- package/dist/playbooks/service-build/facet-money.spec.js +1 -0
- package/dist/playbooks/service-build/machine-panorama.d.ts +20 -0
- package/dist/playbooks/service-build/machine-panorama.js +1 -1
- package/dist/playbooks/service-build/merchant-guide.d.ts +2 -2
- package/dist/playbooks/service-build/migration-planner.d.ts +43 -0
- package/dist/playbooks/service-build/migration-planner.js +1 -0
- package/dist/playbooks/service-build/object-panorama.d.ts +65 -24
- 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/pipeline-actions.d.ts +3 -3
- package/dist/playbooks/service-build/pipeline-actions.js +1 -1
- package/dist/playbooks/service-build/reverse-mapping.d.ts +1 -0
- package/dist/playbooks/service-build/reverse-mapping.js +1 -1
- package/dist/playbooks/service-build/risk-aggregator.d.ts +4 -2
- package/dist/playbooks/service-build/risk-aggregator.js +1 -1
- package/dist/playbooks/service-build/semantic-graph.js +1 -1
- package/dist/playbooks/service-build/service-panorama.d.ts +56 -9
- package/dist/playbooks/service-build/service-panorama.js +1 -1
- package/dist/playbooks/service-build/topology-evaluation.spec.d.ts +1 -0
- package/dist/playbooks/service-build/topology-evaluation.spec.js +1 -0
- package/dist/playbooks/service-build/topology-query.d.ts +13 -2
- package/dist/playbooks/service-build/topology-query.js +1 -1
- package/dist/playbooks/service-build/workflow-design-assessment.d.ts +2 -2
- package/dist/playbooks/service-build/workflow-design-assessment.js +1 -1
- package/dist/relationship/registry.js +1 -1
- package/dist/review/arb.d.ts +0 -2
- package/dist/review/arb.js +1 -1
- package/dist/review/machine.js +1 -1
- package/dist/review/order.d.ts +0 -1
- package/dist/review/order.js +1 -1
- package/dist/review/service.js +1 -1
- package/dist/review/types.d.ts +7 -0
- package/dist/role/profiles.js +1 -1
- package/dist/rules.d.ts +1 -2
- package/dist/rules.js +1 -1
- package/dist/safety/confirm-gate.js +1 -1
- package/dist/schema/benchmark-migration/index.d.ts +207 -0
- package/dist/schema/benchmark-migration/index.js +1 -0
- package/dist/schema/call/allocation.d.ts +1 -1
- package/dist/schema/call/allocation.js +1 -1
- package/dist/schema/call/arbitration.d.ts +1 -1
- package/dist/schema/call/arbitration.js +1 -1
- package/dist/schema/call/base.d.ts +3374 -670
- package/dist/schema/call/base.js +1 -1
- package/dist/schema/call/contact.d.ts +1 -1
- package/dist/schema/call/demand.d.ts +1 -1
- package/dist/schema/call/guard.d.ts +3 -3
- package/dist/schema/call/handler.js +1 -1
- package/dist/schema/call/machine.d.ts +5 -5
- package/dist/schema/call/order.d.ts +3 -3
- package/dist/schema/call/payment.js +1 -1
- package/dist/schema/call/permission-handler.d.ts +1 -1
- package/dist/schema/call/permission-handler.js +1 -1
- package/dist/schema/call/permission.d.ts +16 -16
- package/dist/schema/call/permission.js +1 -1
- package/dist/schema/call/personal.d.ts +8 -8
- package/dist/schema/call/personal.js +1 -1
- package/dist/schema/call/progress.d.ts +3 -3
- package/dist/schema/call/receipt.d.ts +28 -0
- package/dist/schema/call/receipt.js +1 -0
- package/dist/schema/call/repository.d.ts +11 -11
- package/dist/schema/call/repository.js +1 -1
- package/dist/schema/call/reward.d.ts +1 -1
- package/dist/schema/call/semantic-customer-advice.spec.d.ts +1 -0
- package/dist/schema/call/semantic-customer-advice.spec.js +1 -0
- package/dist/schema/call/semantic.d.ts +5 -2
- package/dist/schema/call/semantic.js +1 -1
- package/dist/schema/call/service.d.ts +7 -7
- package/dist/schema/call/service.js +1 -1
- package/dist/schema/call/treasury.d.ts +1 -1
- package/dist/schema/call/treasury.js +1 -1
- package/dist/schema/common/index.d.ts +6 -6
- package/dist/schema/common/index.js +1 -1
- package/dist/schema/config/index.d.ts +50 -1
- package/dist/schema/config/index.js +1 -1
- package/dist/schema/evaluation/index.d.ts +307 -213
- package/dist/schema/evaluation/index.js +1 -1
- package/dist/schema/goal/index.d.ts +6 -6
- package/dist/schema/goal/planning.d.ts +17 -17
- package/dist/schema/goal/planning.js +1 -1
- package/dist/schema/index.d.ts +1 -1
- package/dist/schema/index.js +1 -1
- package/dist/schema/industry-pack/index.d.ts +1 -1
- package/dist/schema/interaction/index.d.ts +1 -1
- package/dist/schema/keeper/index.d.ts +1 -1
- package/dist/schema/local/index.js +1 -1
- package/dist/schema/messenger/index.d.ts +26 -26
- package/dist/schema/operations.d.ts +59 -43
- package/dist/schema/operations.js +1 -1
- package/dist/schema/persona/index.d.ts +4732 -24
- package/dist/schema/persona/index.js +1 -1
- package/dist/schema/query/bi.d.ts +830 -10
- package/dist/schema/query/bi.js +1 -1
- package/dist/schema/query/index.d.ts +44 -44
- package/dist/schema/query/index.js +1 -1
- package/dist/schema/schema-version.js +1 -1
- package/dist/schema/workflow/index.d.ts +1 -1
- package/dist/schema/workspace/index.d.ts +2 -2
- package/dist/schema-query-impl/index.d.ts +9 -0
- package/dist/schema-query-impl/index.js +1 -1
- package/dist/schemas/account_operation.output.json +1 -1
- package/dist/schemas/benchmark_migration_operation.output.json +793 -0
- package/dist/schemas/benchmark_migration_operation.schema.json +83 -0
- package/dist/schemas/bridge_operation.output.json +1 -1
- package/dist/schemas/bridge_operation.schema.json +5 -5
- package/dist/schemas/config_operation.output.json +252 -0
- package/dist/schemas/config_operation.schema.json +21 -1
- package/dist/schemas/evaluation_operation.output.json +702 -162
- package/dist/schemas/evaluation_operation.schema.json +0 -429
- package/dist/schemas/goal_operation.schema.json +8 -8
- package/dist/schemas/guard2file.schema.json +1 -1
- package/dist/schemas/index.json +7 -7
- package/dist/schemas/keeper_operation.output.json +1 -1
- package/dist/schemas/local_history_operation.output.json +1 -1
- package/dist/schemas/local_info_operation.output.json +1 -1
- package/dist/schemas/local_mark_operation.output.json +1 -1
- package/dist/schemas/machineNode2file.schema.json +1 -1
- package/dist/schemas/messenger_operation.output.json +1 -1
- package/dist/schemas/messenger_operation.schema.json +24 -12
- package/dist/schemas/monitor_events.output.json +1 -1
- package/dist/schemas/monitor_subscription.output.json +1 -1
- package/dist/schemas/onchain_events.output.json +2 -2
- package/dist/schemas/onchain_operations.output.json +6359 -3724
- package/dist/schemas/onchain_operations.schema.json +191 -141
- package/dist/schemas/onchain_operations_allocation.schema.json +13 -11
- package/dist/schemas/onchain_operations_arbitration.schema.json +10 -8
- package/dist/schemas/onchain_operations_contact.schema.json +7 -5
- package/dist/schemas/onchain_operations_demand.schema.json +7 -5
- package/dist/schemas/onchain_operations_gen_passport.schema.json +5 -3
- package/dist/schemas/onchain_operations_gen_proof.schema.json +1 -1
- package/dist/schemas/onchain_operations_guard.schema.json +5 -3
- package/dist/schemas/onchain_operations_machine.schema.json +22 -18
- package/dist/schemas/onchain_operations_order.schema.json +11 -7
- package/dist/schemas/onchain_operations_payment.schema.json +3 -3
- package/dist/schemas/onchain_operations_permission.schema.json +19 -11
- package/dist/schemas/onchain_operations_personal.schema.json +16 -10
- package/dist/schemas/onchain_operations_progress.schema.json +11 -7
- package/dist/schemas/onchain_operations_proof.schema.json +5 -3
- package/dist/schemas/onchain_operations_repository.schema.json +12 -8
- package/dist/schemas/onchain_operations_reward.schema.json +11 -9
- package/dist/schemas/onchain_operations_service.schema.json +28 -22
- package/dist/schemas/onchain_operations_treasury.schema.json +13 -11
- package/dist/schemas/onchain_table_data.output.json +88 -88
- package/dist/schemas/persona_operation.output.json +15875 -1
- package/dist/schemas/persona_operation.schema.json +3056 -478
- package/dist/schemas/query_toolkit.output.json +1325 -212
- package/dist/schemas/query_toolkit.schema.json +60 -2
- package/dist/schemas/workflow_operation.schema.json +4 -2
- package/dist/strategy/metrics.js +1 -1
- package/dist/strategy/scorecard.js +1 -1
- package/dist/tools/handlers/benchmark-migration.d.ts +2 -0
- package/dist/tools/handlers/benchmark-migration.js +1 -0
- package/dist/tools/handlers/bridge.js +1 -1
- package/dist/tools/handlers/config.js +1 -1
- package/dist/tools/handlers/dispatch-expectations.d.ts +3 -0
- package/dist/tools/handlers/dispatch-expectations.js +1 -0
- package/dist/tools/handlers/evaluation.js +1 -1
- package/dist/tools/handlers/industry-pack.js +1 -1
- package/dist/tools/handlers/onchain.js +1 -1
- package/dist/tools/handlers/query.js +1 -1
- package/dist/tools/handlers/schema-query.js +1 -1
- package/dist/tools/index.js +1 -1
- package/dist/tools/move-fn-index.gen.d.ts +3 -0
- package/dist/tools/move-fn-index.gen.js +1 -0
- package/dist/tools/registry/business.js +1 -1
- package/dist/tools/registry/config.js +1 -1
- package/dist/tools/registry/evaluation.d.ts +2 -0
- package/dist/tools/registry/evaluation.js +1 -0
- package/dist/tools/registry/onchain.js +1 -1
- package/dist/tools/registry/query.js +1 -1
- package/dist/tools/sanitize-output.d.ts +3 -0
- package/dist/tools/sanitize-output.js +1 -0
- package/dist/tools/sanitize-output.spec.d.ts +1 -0
- package/dist/tools/sanitize-output.spec.js +1 -0
- package/dist/tools/shared.d.ts +0 -1
- package/dist/tools/shared.js +1 -1
- package/dist/tools/wrap.js +1 -1
- package/package.json +9 -3
- package/dist/customer/customer-advice.d.ts +0 -32
- package/dist/customer/customer-advice.js +0 -1
- package/dist/customer/info-puzzle.d.ts +0 -146
- package/dist/customer/info-puzzle.js +0 -1
- package/dist/customer/order-strategy.d.ts +0 -17
- package/dist/customer/order-strategy.js +0 -1
- package/dist/customer/preorder-compare.d.ts +0 -24
- package/dist/customer/preorder-compare.js +0 -1
- package/dist/customer/reminder-system.d.ts +0 -42
- package/dist/customer/reminder-system.js +0 -1
- package/dist/customer/risk-assessment.d.ts +0 -13
- package/dist/customer/risk-assessment.js +0 -1
- package/dist/evaluation/builtins/service-risk.d.ts +0 -7
- package/dist/evaluation/builtins/service-risk.js +0 -1
- package/dist/knowledge/trust-metrics.d.ts +0 -66
- package/dist/knowledge/trust-metrics.js +0 -1
- package/dist/schema/trust/index.d.ts +0 -334
- package/dist/schema/trust/index.js +0 -1
- package/dist/schemas/trust_score.output.json +0 -847
- package/dist/schemas/trust_score.schema.json +0 -364
- package/dist/tools/handlers/trust.d.ts +0 -16
- package/dist/tools/handlers/trust.js +0 -1
- package/dist/tools/registry/trust.d.ts +0 -2
- package/dist/tools/registry/trust.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { IndustryServicePuzzle } from "./types.js";
|
|
2
2
|
import { CUSTOMER_INTELLIGENCE_VERSION } from "./types.js";
|
|
3
3
|
import type { Industry } from "./user-preferences.js";
|
|
4
4
|
export type IndustryNeedTier = "common" | "personalized" | "advanced";
|
|
@@ -6,7 +6,7 @@ export interface IndustryNeed {
|
|
|
6
6
|
id: string;
|
|
7
7
|
tier: IndustryNeedTier;
|
|
8
8
|
description: string;
|
|
9
|
-
satisfied: (puzzle:
|
|
9
|
+
satisfied: (puzzle: IndustryServicePuzzle) => boolean;
|
|
10
10
|
advice?: string;
|
|
11
11
|
}
|
|
12
12
|
export interface IndustryRiskCheck {
|
|
@@ -14,27 +14,13 @@ export interface IndustryRiskCheck {
|
|
|
14
14
|
industry: Industry;
|
|
15
15
|
description: string;
|
|
16
16
|
weight: number;
|
|
17
|
-
passed: (puzzle:
|
|
17
|
+
passed: (puzzle: IndustryServicePuzzle) => boolean;
|
|
18
18
|
advice?: string;
|
|
19
19
|
}
|
|
20
|
-
export interface IndustryRiskResult {
|
|
21
|
-
industry: Industry;
|
|
22
|
-
checks: RiskCheck[];
|
|
23
|
-
needs: IndustryNeed[];
|
|
24
|
-
unmet_needs: IndustryNeed[];
|
|
25
|
-
score_adjustment: number;
|
|
26
|
-
summary: string;
|
|
27
|
-
}
|
|
28
20
|
export declare function _setRegistryLookup(fn: ((industry: string) => {
|
|
29
21
|
risk_checks?: IndustryRiskCheck[];
|
|
30
22
|
needs?: IndustryNeed[];
|
|
31
23
|
} | undefined) | null): void;
|
|
32
24
|
export declare function getIndustryRiskChecks(industry: Industry): IndustryRiskCheck[];
|
|
33
25
|
export declare function getIndustryNeeds(industry: Industry): IndustryNeed[];
|
|
34
|
-
export declare function checkIndustryNeeds(puzzle: InfoPuzzle, industry: Industry): {
|
|
35
|
-
met: IndustryNeed[];
|
|
36
|
-
unmet: IndustryNeed[];
|
|
37
|
-
};
|
|
38
|
-
export declare function assessIndustryRisks(puzzle: InfoPuzzle, industry: Industry): IndustryRiskResult;
|
|
39
|
-
export declare function inferIndustry(puzzle: InfoPuzzle): Industry | undefined;
|
|
40
26
|
export { CUSTOMER_INTELLIGENCE_VERSION };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{CUSTOMER_INTELLIGENCE_VERSION}from'./types.js';const hasRefundPath=a=>a['workflow_analysis']?.['has_refund_path']??![],hasArbitrationPath=a=>a['workflow_analysis']?.['has_arbitration_path']??![],hasMilestoneNodes=a=>a['workflow_analysis']?.['has_milestone_nodes']??![],hasMessenger=a=>a['trust_signals']?.['has_messenger']??![],compensationCoversOrder=a=>a['fund_safety']?.['compensation_covers_order']??![],lockDurationSafe=a=>a['fund_safety']?.['lock_duration_safe']??![],userOperableForwards=a=>a['workflow_analysis']?.['user_operable_forwards']??0x0,wipVerified=a=>a['service_basics']['wip_verified']===!![],hasCompensationFund=a=>a['service_basics']['compensation_fund_balance']>0x0n,deadEndCount=a=>a['workflow_analysis']?.['dead_end_nodes']?.['length']??0x0,totalNodes=a=>a['workflow_analysis']?.['total_nodes']??0x0,trustScore=a=>a['trust_signals']?.['trust_score']??0x0,reviewTotal=a=>a['trust_signals']?.['review_total']??0x0,merchantTotalOrders=a=>a['merchant_behavior']?.['total_orders']??0x0,repeatBuyerRate=a=>a['merchant_behavior']?.['repeat_buyer_rate']??0x0,disputeRate=a=>a['merchant_behavior']?.['dispute_rate']??0x1,INDUSTRY_RISK_CHECKS={'freelance':[{'id':'fr_wip_verified','industry':'freelance','dimension':'trust','description':'WIP\x20hash\x20verified\x20(work\x20traceable)','weight':0x1e,'passed':wipVerified,'advice':'⚠️\x20WIP\x20not\x20verified:\x20freelance\x20deliverables\x20cannot\x20be\x20traced.\x20Recommend\x20asking\x20the\x20merchant\x20to\x20provide\x20a\x20WIP\x20hash\x20and\x20write\x20it\x20into\x20WTS.'},{'id':'fr_milestone_nodes','industry':'freelance','dimension':'workflow','description':'Has\x20milestone\x20nodes\x20(phased\x20acceptance)','weight':0x19,'passed':hasMilestoneNodes,'advice':'⚠️\x20No\x20milestone\x20nodes:\x20delivery\x20is\x20completed\x20in\x20one\x20go\x20without\x20intermediate\x20acceptance.\x20Recommend\x20asking\x20the\x20merchant\x20to\x20add\x20phased\x20delivery\x20nodes.'},{'id':'fr_refund_path','industry':'freelance','dimension':'workflow','description':'Has\x20refund\x20path','weight':0x19,'passed':hasRefundPath,'advice':'⚠️\x20No\x20refund\x20path:\x20if\x20freelance\x20order\x20delivery\x20is\x20not\x20satisfactory,\x20funds\x20are\x20hard\x20to\x20recover.'},{'id':'fr_response_time','industry':'freelance','dimension':'trust','description':'Messenger\x20configured\x20(communication\x20response\x20guarantee)','weight':0x14,'passed':hasMessenger,'advice':'⚠️\x20Messenger\x20not\x20configured:\x20cannot\x20conduct\x20requirement\x20confirmation\x20and\x20revision\x20communication.'}],'rental':[{'id':'rt_compensation_full','industry':'rental','dimension':'fund','description':'Compensation\x20fully\x20covers\x20order\x20amount','weight':0x1e,'passed':compensationCoversOrder,'advice':'🔴\x20Compensation\x20not\x20fully\x20covered:\x20insufficient\x20payout\x20when\x20rental\x20item\x20is\x20damaged.\x20Recommend\x20choosing\x20a\x20merchant\x20with\x20sufficient\x20compensation\x20fund.'},{'id':'rt_lock_duration','industry':'rental','dimension':'fund','description':'Lock\x20duration\x20safe\x20(compensation\x20cannot\x20be\x20withdrawn\x20by\x20merchant\x20at\x20any\x20time)','weight':0x19,'passed':lockDurationSafe,'advice':'⚠️\x20Lock\x20duration\x20not\x20safe:\x20merchant\x20may\x20withdraw\x20compensation\x20at\x20any\x20time,\x20deposit\x20safety\x20not\x20guaranteed.'},{'id':'rt_arbitration','industry':'rental','dimension':'workflow','description':'Arbitration\x20configured\x20(damage\x20dispute\x20resolution)','weight':0x19,'passed':hasArbitrationPath,'advice':'⚠️\x20Arbitration\x20not\x20configured:\x20no\x20third-party\x20ruling\x20channel\x20for\x20rental\x20damage\x20disputes.'},{'id':'rt_user_operable','industry':'rental','dimension':'workflow','description':'Has\x20user-operable\x20path\x20(return/confirm)','weight':0x14,'passed':a=>userOperableForwards(a)>0x0,'advice':'🔴\x20No\x20user-operable\x20path:\x20return\x20process\x20relies\x20entirely\x20on\x20merchant,\x20may\x20be\x20maliciously\x20delayed.'}],'education':[{'id':'ed_refund_path','industry':'education','dimension':'workflow','description':'Has\x20refund\x20path\x20(refund\x20guarantee)','weight':0x1e,'passed':hasRefundPath,'advice':'🔴\x20No\x20refund\x20path:\x20course\x20refund\x20not\x20guaranteed,\x20recommend\x20asking\x20the\x20merchant\x20to\x20configure\x20a\x20refund\x20Allocator.'},{'id':'ed_compensation','industry':'education','dimension':'fund','description':'Has\x20compensation\x20fund','weight':0x19,'passed':hasCompensationFund,'advice':'⚠️\x20No\x20compensation\x20fund:\x20no\x20automatic\x20compensation\x20source\x20when\x20course\x20service\x20quality\x20is\x20not\x20up\x20to\x20standard.'},{'id':'ed_arbitration','industry':'education','dimension':'workflow','description':'Arbitration\x20configured','weight':0x19,'passed':hasArbitrationPath,'advice':'⚠️\x20Arbitration\x20not\x20configured:\x20no\x20resolution\x20channel\x20for\x20course\x20quality\x20disputes.'},{'id':'ed_long_cycle_ok','industry':'education','dimension':'workflow','description':'Long\x20cycle\x20acceptable\x20(education\x20industry\x20allows\x20long\x20cycles,\x20over\x2090\x20days\x20needs\x20attention)','weight':0x14,'passed':()=>!![],'advice':'ℹ️\x20Long\x20delivery\x20cycles\x20are\x20normal\x20in\x20education,\x20but\x20if\x20the\x20actual\x20cycle\x20exceeds\x2090\x20days,\x20recommend\x20periodically\x20checking\x20learning\x20progress\x20and\x20lesson\x20consumption.'}],'travel':[{'id':'tr_urgent_delivery','industry':'travel','dimension':'workflow','description':'Urgent\x20delivery\x20configuration\x20(needs\x20milestone\x20nodes\x20for\x20phased\x20acceptance)','weight':0x1e,'passed':hasMilestoneNodes,'advice':'⚠️\x20No\x20milestone\x20nodes:\x20travel\x20itinerary\x20has\x20no\x20phased\x20acceptance,\x20recommend\x20setting\x20nodes\x20by\x20itinerary\x20stage.'},{'id':'tr_compensation_full','industry':'travel','dimension':'fund','description':'Compensation\x20fully\x20covers\x20(breach\x20compensation)','weight':0x19,'passed':compensationCoversOrder,'advice':'🔴\x20Compensation\x20not\x20fully\x20covered:\x20insufficient\x20payout\x20when\x20itinerary\x20breaches.'},{'id':'tr_refund_path','industry':'travel','dimension':'workflow','description':'Has\x20refund\x20path\x20(itinerary\x20change/cancellation)','weight':0x19,'passed':hasRefundPath,'advice':'⚠️\x20No\x20refund\x20path:\x20funds\x20hard\x20to\x20recover\x20when\x20itinerary\x20changes\x20or\x20cancels\x20due\x20to\x20force\x20majeure.'},{'id':'tr_messenger','industry':'travel','dimension':'trust','description':'Messenger\x20configured\x20(emergency\x20communication)','weight':0x14,'passed':hasMessenger,'advice':'⚠️\x20Messenger\x20not\x20configured:\x20cannot\x20immediately\x20contact\x20merchant\x20during\x20travel\x20emergencies.'}],'subscription':[{'id':'sub_no_lockin','industry':'subscription','dimension':'workflow','description':'No\x20long-term\x20lock-in\x20(no\x20dead-end\x20nodes,\x20can\x20exit)','weight':0x1e,'passed':a=>deadEndCount(a)===0x0,'advice':'🔴\x20Dead-end\x20nodes\x20exist:\x20subscription\x20may\x20be\x20locked\x20and\x20unable\x20to\x20exit,\x20auto-renewal\x20trap\x20exists.'},{'id':'sub_refund_path','industry':'subscription','dimension':'workflow','description':'Has\x20refund\x20path\x20(exit\x20mechanism)','weight':0x19,'passed':hasRefundPath,'advice':'⚠️\x20No\x20refund\x20path:\x20remaining\x20cycle\x20fees\x20hard\x20to\x20recover\x20after\x20subscription\x20exit.'},{'id':'sub_user_operable','industry':'subscription','dimension':'workflow','description':'Has\x20user-operable\x20path\x20(pause/downgrade/cancel)','weight':0x19,'passed':a=>userOperableForwards(a)>0x0,'advice':'🔴\x20No\x20user-operable\x20path:\x20subscription\x20status\x20entirely\x20controlled\x20by\x20merchant,\x20cannot\x20pause\x20or\x20cancel\x20independently.'},{'id':'sub_compensation_optional','industry':'subscription','dimension':'fund','description':'Compensation\x20optional\x20(not\x20mandatory\x20for\x20subscription\x20industry)','weight':0x14,'passed':()=>!![],'advice':'ℹ️\x20Compensation\x20is\x20not\x20mandatory\x20for\x20subscription\x20industry;\x20having\x20it\x20is\x20better.'}],'retail':[{'id':'ret_wip_verified','industry':'retail','dimension':'trust','description':'WIP\x20verified\x20(authenticity/logistics\x20traceable)','weight':0x19,'passed':wipVerified,'advice':'⚠️\x20WIP\x20not\x20verified:\x20product\x20traceability\x20info\x20missing,\x20recommend\x20confirming\x20authenticity\x20guarantee.'},{'id':'ret_compensation_full','industry':'retail','dimension':'fund','description':'Compensation\x20fully\x20covers','weight':0x19,'passed':compensationCoversOrder,'advice':'⚠️\x20Compensation\x20not\x20fully\x20covered:\x20insufficient\x20payout\x20for\x20return/exchange\x20disputes.'},{'id':'ret_refund_path','industry':'retail','dimension':'workflow','description':'Has\x20refund\x20path\x20(return/exchange)','weight':0x19,'passed':hasRefundPath,'advice':'🔴\x20No\x20refund\x20path:\x20return/exchange\x20not\x20guaranteed.'},{'id':'ret_arbitration','industry':'retail','dimension':'workflow','description':'Arbitration\x20configured','weight':0x19,'passed':hasArbitrationPath,'advice':'⚠️\x20Arbitration\x20not\x20configured:\x20no\x20third-party\x20ruling\x20for\x20return/exchange\x20disputes.'}]};function commonNeeds(){return[{'id':'need_arbitration','tier':'common','description':'Arbitration\x20configured\x20(dispute\x20resolution\x20channel)','satisfied':hasArbitrationPath,'advice':'Arbitration\x20not\x20configured:\x20no\x20third-party\x20resolution\x20channel\x20for\x20disputes.'},{'id':'need_refund_path','tier':'common','description':'Has\x20refund\x20path','satisfied':hasRefundPath,'advice':'No\x20refund\x20path:\x20funds\x20hard\x20to\x20recover\x20when\x20delivery\x20fails.'},{'id':'need_user_operable','tier':'common','description':'Has\x20user-operable\x20Forward','satisfied':a=>userOperableForwards(a)>0x0,'advice':'No\x20user-operable\x20steps\x20in\x20workflow,\x20order\x20progress\x20depends\x20entirely\x20on\x20merchant.'},{'id':'need_messenger','tier':'common','description':'Messenger\x20configured','satisfied':hasMessenger,'advice':'Merchant\x20has\x20no\x20Messenger\x20channel,\x20cannot\x20negotiate\x20or\x20conduct\x20after-sales\x20communication.'}];}const INDUSTRY_NEEDS={'freelance':[...commonNeeds(),{'id':'need_wip_verified','tier':'personalized','description':'WIP\x20verified\x20(work\x20IP\x20traceable)','satisfied':wipVerified,'advice':'WIP\x20not\x20verified:\x20IP\x20ownership\x20and\x20originality\x20of\x20work\x20cannot\x20be\x20traced.'},{'id':'need_milestone_nodes','tier':'personalized','description':'Milestone\x20nodes\x20(phased\x20feedback)','satisfied':hasMilestoneNodes,'advice':'No\x20milestone\x20nodes:\x20lack\x20of\x20phased\x20feedback\x20and\x20revision\x20round\x20control.'},{'id':'need_merchant_history','tier':'advanced','description':'Merchant\x20history\x20≥3\x20orders\x20(fulfillment\x20experience)','satisfied':a=>merchantTotalOrders(a)>=0x3,'advice':'Merchant\x20history\x20orders\x20less\x20than\x203:\x20fulfillment\x20experience\x20is\x20limited.'}],'rental':[...commonNeeds(),{'id':'need_lock_duration_safe','tier':'personalized','description':'Lock\x20duration\x20safe\x20(deposit\x20cannot\x20be\x20withdrawn)','satisfied':lockDurationSafe,'advice':'Lock\x20duration\x20not\x20safe:\x20deposit\x20may\x20be\x20withdrawn\x20by\x20merchant\x20at\x20any\x20time.'},{'id':'need_compensation_full','tier':'personalized','description':'Compensation\x20fully\x20covers','satisfied':compensationCoversOrder,'advice':'Compensation\x20not\x20fully\x20covered:\x20insufficient\x20payout\x20for\x20rental\x20item\x20damage.'},{'id':'need_merchant_history','tier':'advanced','description':'Merchant\x20history\x20≥5\x20orders\x20(rental\x20experience)','satisfied':a=>merchantTotalOrders(a)>=0x5,'advice':'Merchant\x20history\x20orders\x20less\x20than\x205:\x20rental\x20service\x20experience\x20limited.'}],'education':[...commonNeeds(),{'id':'need_has_compensation','tier':'personalized','description':'Has\x20compensation\x20fund\x20(course\x20quality\x20guarantee)','satisfied':hasCompensationFund,'advice':'No\x20compensation\x20fund:\x20no\x20compensation\x20source\x20when\x20course\x20quality\x20is\x20not\x20up\x20to\x20standard.'},{'id':'need_long_cycle_ok','tier':'personalized','description':'Long\x20cycle\x20acceptable','satisfied':()=>!![],'advice':'Long\x20cycles\x20are\x20normal\x20in\x20education;\x20recommend\x20tracking\x20lesson\x20consumption\x20and\x20attendance.'},{'id':'need_high_reputation','tier':'advanced','description':'High\x20reputation\x20score\x20(trust_score\x20≥70)','satisfied':a=>trustScore(a)>=0x46,'advice':'Merchant\x20reputation\x20score\x20below\x2070:\x20course\x20reputation\x20may\x20be\x20poor.'}],'travel':[...commonNeeds(),{'id':'need_urgent_delivery','tier':'personalized','description':'Urgent\x20delivery\x20configuration\x20(milestone\x20phasing)','satisfied':hasMilestoneNodes,'advice':'No\x20milestone\x20nodes:\x20itinerary\x20has\x20no\x20phased\x20acceptance,\x20urgent\x20delivery\x20guarantee\x20insufficient.'},{'id':'need_compensation_full','tier':'personalized','description':'Compensation\x20fully\x20covers\x20(breach\x20compensation)','satisfied':compensationCoversOrder,'advice':'Compensation\x20not\x20fully\x20covered:\x20insufficient\x20payout\x20for\x20itinerary\x20breach.'},{'id':'need_high_reputation','tier':'advanced','description':'High\x20reputation\x20score\x20(trust_score\x20≥70)','satisfied':a=>trustScore(a)>=0x46,'advice':'Merchant\x20reputation\x20score\x20below\x2070:\x20travel\x20service\x20reputation\x20may\x20be\x20poor.'}],'subscription':[...commonNeeds(),{'id':'need_no_lockin','tier':'personalized','description':'No\x20long-term\x20lock-in\x20(no\x20dead-end\x20nodes)','satisfied':a=>deadEndCount(a)===0x0,'advice':'Dead-end\x20nodes\x20exist:\x20subscription\x20may\x20be\x20locked,\x20auto-renewal\x20trap\x20exists.'},{'id':'need_low_dispute','tier':'personalized','description':'Low\x20dispute\x20rate\x20(≤15%,\x20stable\x20content\x20quality)','satisfied':a=>disputeRate(a)<=0.15,'advice':'Dispute\x20rate\x20is\x20high:\x20subscription\x20content\x20quality\x20may\x20be\x20unstable.'},{'id':'need_repeat_rate','tier':'advanced','description':'Repeat\x20buyer\x20rate\x20≥20%\x20(strong\x20subscription\x20renewal\x20willingness)','satisfied':a=>repeatBuyerRate(a)>=0.2,'advice':'Repeat\x20buyer\x20rate\x20below\x2020%:\x20subscription\x20renewal\x20willingness\x20is\x20weak,\x20service\x20may\x20not\x20be\x20worth\x20long-term\x20subscription.'}],'retail':[...commonNeeds(),{'id':'need_wip_verified','tier':'personalized','description':'WIP\x20verified\x20(authenticity/logistics\x20traceability)','satisfied':wipVerified,'advice':'WIP\x20not\x20verified:\x20product\x20authenticity\x20and\x20logistics\x20traceability\x20info\x20missing.'},{'id':'need_compensation_full','tier':'personalized','description':'Compensation\x20fully\x20covers','satisfied':compensationCoversOrder,'advice':'Compensation\x20not\x20fully\x20covered:\x20insufficient\x20payout\x20for\x20return/exchange\x20disputes.'},{'id':'need_high_reputation','tier':'advanced','description':'High\x20reputation\x20score\x20(trust_score\x20≥70)','satisfied':a=>trustScore(a)>=0x46,'advice':'Merchant\x20reputation\x20score\x20below\x2070:\x20product\x20or\x20service\x20reputation\x20may\x20be\x20poor.'}]};let _registryLookup=null;export function _setRegistryLookup(a){_registryLookup=a;}export function getIndustryRiskChecks(a){if(_registryLookup){const b=_registryLookup(a);if(b?.['risk_checks'])return b['risk_checks'];}return INDUSTRY_RISK_CHECKS[a];}export function getIndustryNeeds(a){if(_registryLookup){const b=_registryLookup(a);if(b?.['needs'])return b['needs'];}return INDUSTRY_NEEDS[a];}export function checkIndustryNeeds(a,b){const c=getIndustryNeeds(b),d=[],e=[];for(const f of c){if(f['satisfied'](a))d['push'](f);else e['push'](f);}return{'met':d,'unmet':e};}export function assessIndustryRisks(a,b){const c=INDUSTRY_RISK_CHECKS[b],d=c['reduce']((p,q)=>p+q['weight'],0x0),e=c['map'](p=>{const q=p['passed'](a);return{'id':p['id'],'dimension':p['dimension'],'description':p['description'],'weight':p['weight'],'passed':q,'advice':q?undefined:p['advice']};}),f=e['reduce']((p,q)=>p+(q['passed']?q['weight']:0x0),0x0),g=d>0x0?f/d:0x0,h=Math['round']((g-0.5)*0x14),i=Math['max'](-0xa,Math['min'](0xa,h)),j=getIndustryNeeds(b),{met:k,unmet:l}=checkIndustryNeeds(a,b),m=e['filter'](p=>p['passed'])['length'],n=i>=0x0?'+':'',o=b+'\x20industry\x20risk\x20check:\x20'+m+'\x20checks\x20passed\x20out\x20of\x20'+e['length']+('\x20(pass\x20rate\x20'+Math['round'](g*0x64)+'%);\x20'+k['length']+'\x20needs\x20satisfied\x20out\x20of\x20'+j['length']+';')+('\x20Score\x20adjustment\x20'+n+i+'.');return{'industry':b,'checks':e,'needs':j,'unmet_needs':l,'score_adjustment':i,'summary':o};}export function inferIndustry(a){const b=a['service_basics'];if(b['price_raw']<0x3b9aca00n&&b['has_wip'])return'retail';if(b['compensation_lock_duration']>0x7)return'rental';if(reviewTotal(a)>0x32)return'retail';if(totalNodes(a)>0xa)return'education';return'freelance';}export{CUSTOMER_INTELLIGENCE_VERSION};
|
|
1
|
+
import{CUSTOMER_INTELLIGENCE_VERSION}from'./types.js';const hasRefundPath=a=>a['workflow_analysis']?.['has_refund_path']??![],hasArbitrationPath=a=>a['workflow_analysis']?.['has_arbitration_path']??![],hasMilestoneNodes=a=>a['workflow_analysis']?.['has_milestone_nodes']??![],hasMessenger=a=>a['trust_signals']?.['has_messenger']??![],compensationCoversOrder=a=>a['fund_safety']?.['compensation_covers_order']??![],lockDurationSafe=a=>a['fund_safety']?.['lock_duration_safe']??![],userOperableForwards=a=>a['workflow_analysis']?.['user_operable_forwards']??0x0,wipVerified=a=>a['service_basics']['wip_verified']===!![],hasCompensationFund=a=>a['service_basics']['compensation_fund_balance']>0x0n,deadEndCount=a=>a['workflow_analysis']?.['dead_end_nodes']?.['length']??0x0,trustScore=a=>a['trust_signals']?.['trust_score']??0x0,merchantTotalOrders=a=>a['merchant_behavior']?.['total_orders']??0x0,repeatBuyerRate=a=>a['merchant_behavior']?.['repeat_buyer_rate']??0x0,disputeRate=a=>a['merchant_behavior']?.['dispute_rate']??0x1,INDUSTRY_RISK_CHECKS={'freelance':[{'id':'fr_wip_verified','industry':'freelance','dimension':'trust','description':'WIP\x20hash\x20verified\x20(work\x20traceable)','weight':0x1e,'passed':wipVerified,'advice':'⚠️\x20WIP\x20not\x20verified:\x20freelance\x20deliverables\x20cannot\x20be\x20traced.\x20Recommend\x20asking\x20the\x20merchant\x20to\x20provide\x20a\x20WIP\x20hash\x20and\x20write\x20it\x20into\x20WTS.'},{'id':'fr_milestone_nodes','industry':'freelance','dimension':'workflow','description':'Has\x20milestone\x20nodes\x20(phased\x20acceptance)','weight':0x19,'passed':hasMilestoneNodes,'advice':'⚠️\x20No\x20milestone\x20nodes:\x20delivery\x20is\x20completed\x20in\x20one\x20go\x20without\x20intermediate\x20acceptance.\x20Recommend\x20asking\x20the\x20merchant\x20to\x20add\x20phased\x20delivery\x20nodes.'},{'id':'fr_refund_path','industry':'freelance','dimension':'workflow','description':'Has\x20refund\x20path','weight':0x19,'passed':hasRefundPath,'advice':'⚠️\x20No\x20refund\x20path:\x20if\x20freelance\x20order\x20delivery\x20is\x20not\x20satisfactory,\x20funds\x20are\x20hard\x20to\x20recover.'},{'id':'fr_response_time','industry':'freelance','dimension':'trust','description':'Messenger\x20configured\x20(communication\x20response\x20guarantee)','weight':0x14,'passed':hasMessenger,'advice':'⚠️\x20Messenger\x20not\x20configured:\x20cannot\x20conduct\x20requirement\x20confirmation\x20and\x20revision\x20communication.'}],'rental':[{'id':'rt_compensation_full','industry':'rental','dimension':'fund','description':'Compensation\x20fully\x20covers\x20order\x20amount','weight':0x1e,'passed':compensationCoversOrder,'advice':'🔴\x20Compensation\x20not\x20fully\x20covered:\x20insufficient\x20payout\x20when\x20rental\x20item\x20is\x20damaged.\x20Recommend\x20choosing\x20a\x20merchant\x20with\x20sufficient\x20compensation\x20fund.'},{'id':'rt_lock_duration','industry':'rental','dimension':'fund','description':'Lock\x20duration\x20safe\x20(compensation\x20cannot\x20be\x20withdrawn\x20by\x20merchant\x20at\x20any\x20time)','weight':0x19,'passed':lockDurationSafe,'advice':'⚠️\x20Lock\x20duration\x20not\x20safe:\x20merchant\x20may\x20withdraw\x20compensation\x20at\x20any\x20time,\x20deposit\x20safety\x20not\x20guaranteed.'},{'id':'rt_arbitration','industry':'rental','dimension':'workflow','description':'Arbitration\x20configured\x20(damage\x20dispute\x20resolution)','weight':0x19,'passed':hasArbitrationPath,'advice':'⚠️\x20Arbitration\x20not\x20configured:\x20no\x20third-party\x20ruling\x20channel\x20for\x20rental\x20damage\x20disputes.'},{'id':'rt_user_operable','industry':'rental','dimension':'workflow','description':'Has\x20user-operable\x20path\x20(return/confirm)','weight':0x14,'passed':a=>userOperableForwards(a)>0x0,'advice':'🔴\x20No\x20user-operable\x20path:\x20return\x20process\x20relies\x20entirely\x20on\x20merchant,\x20may\x20be\x20maliciously\x20delayed.'}],'education':[{'id':'ed_refund_path','industry':'education','dimension':'workflow','description':'Has\x20refund\x20path\x20(refund\x20guarantee)','weight':0x1e,'passed':hasRefundPath,'advice':'🔴\x20No\x20refund\x20path:\x20course\x20refund\x20not\x20guaranteed,\x20recommend\x20asking\x20the\x20merchant\x20to\x20configure\x20a\x20refund\x20Allocator.'},{'id':'ed_compensation','industry':'education','dimension':'fund','description':'Has\x20compensation\x20fund','weight':0x19,'passed':hasCompensationFund,'advice':'⚠️\x20No\x20compensation\x20fund:\x20no\x20automatic\x20compensation\x20source\x20when\x20course\x20service\x20quality\x20is\x20not\x20up\x20to\x20standard.'},{'id':'ed_arbitration','industry':'education','dimension':'workflow','description':'Arbitration\x20configured','weight':0x19,'passed':hasArbitrationPath,'advice':'⚠️\x20Arbitration\x20not\x20configured:\x20no\x20resolution\x20channel\x20for\x20course\x20quality\x20disputes.'},{'id':'ed_long_cycle_ok','industry':'education','dimension':'workflow','description':'Long\x20cycle\x20acceptable\x20(education\x20industry\x20allows\x20long\x20cycles,\x20over\x2090\x20days\x20needs\x20attention)','weight':0x14,'passed':()=>!![],'advice':'ℹ️\x20Long\x20delivery\x20cycles\x20are\x20normal\x20in\x20education,\x20but\x20if\x20the\x20actual\x20cycle\x20exceeds\x2090\x20days,\x20recommend\x20periodically\x20checking\x20learning\x20progress\x20and\x20lesson\x20consumption.'}],'travel':[{'id':'tr_urgent_delivery','industry':'travel','dimension':'workflow','description':'Urgent\x20delivery\x20configuration\x20(needs\x20milestone\x20nodes\x20for\x20phased\x20acceptance)','weight':0x1e,'passed':hasMilestoneNodes,'advice':'⚠️\x20No\x20milestone\x20nodes:\x20travel\x20itinerary\x20has\x20no\x20phased\x20acceptance,\x20recommend\x20setting\x20nodes\x20by\x20itinerary\x20stage.'},{'id':'tr_compensation_full','industry':'travel','dimension':'fund','description':'Compensation\x20fully\x20covers\x20(breach\x20compensation)','weight':0x19,'passed':compensationCoversOrder,'advice':'🔴\x20Compensation\x20not\x20fully\x20covered:\x20insufficient\x20payout\x20when\x20itinerary\x20breaches.'},{'id':'tr_refund_path','industry':'travel','dimension':'workflow','description':'Has\x20refund\x20path\x20(itinerary\x20change/cancellation)','weight':0x19,'passed':hasRefundPath,'advice':'⚠️\x20No\x20refund\x20path:\x20funds\x20hard\x20to\x20recover\x20when\x20itinerary\x20changes\x20or\x20cancels\x20due\x20to\x20force\x20majeure.'},{'id':'tr_messenger','industry':'travel','dimension':'trust','description':'Messenger\x20configured\x20(emergency\x20communication)','weight':0x14,'passed':hasMessenger,'advice':'⚠️\x20Messenger\x20not\x20configured:\x20cannot\x20immediately\x20contact\x20merchant\x20during\x20travel\x20emergencies.'}],'subscription':[{'id':'sub_no_lockin','industry':'subscription','dimension':'workflow','description':'No\x20long-term\x20lock-in\x20(no\x20dead-end\x20nodes,\x20can\x20exit)','weight':0x1e,'passed':a=>deadEndCount(a)===0x0,'advice':'🔴\x20Dead-end\x20nodes\x20exist:\x20subscription\x20may\x20be\x20locked\x20and\x20unable\x20to\x20exit,\x20auto-renewal\x20trap\x20exists.'},{'id':'sub_refund_path','industry':'subscription','dimension':'workflow','description':'Has\x20refund\x20path\x20(exit\x20mechanism)','weight':0x19,'passed':hasRefundPath,'advice':'⚠️\x20No\x20refund\x20path:\x20remaining\x20cycle\x20fees\x20hard\x20to\x20recover\x20after\x20subscription\x20exit.'},{'id':'sub_user_operable','industry':'subscription','dimension':'workflow','description':'Has\x20user-operable\x20path\x20(pause/downgrade/cancel)','weight':0x19,'passed':a=>userOperableForwards(a)>0x0,'advice':'🔴\x20No\x20user-operable\x20path:\x20subscription\x20status\x20entirely\x20controlled\x20by\x20merchant,\x20cannot\x20pause\x20or\x20cancel\x20independently.'},{'id':'sub_compensation_optional','industry':'subscription','dimension':'fund','description':'Compensation\x20optional\x20(not\x20mandatory\x20for\x20subscription\x20industry)','weight':0x14,'passed':()=>!![],'advice':'ℹ️\x20Compensation\x20is\x20not\x20mandatory\x20for\x20subscription\x20industry;\x20having\x20it\x20is\x20better.'}],'retail':[{'id':'ret_wip_verified','industry':'retail','dimension':'trust','description':'WIP\x20verified\x20(authenticity/logistics\x20traceable)','weight':0x19,'passed':wipVerified,'advice':'⚠️\x20WIP\x20not\x20verified:\x20product\x20traceability\x20info\x20missing,\x20recommend\x20confirming\x20authenticity\x20guarantee.'},{'id':'ret_compensation_full','industry':'retail','dimension':'fund','description':'Compensation\x20fully\x20covers','weight':0x19,'passed':compensationCoversOrder,'advice':'⚠️\x20Compensation\x20not\x20fully\x20covered:\x20insufficient\x20payout\x20for\x20return/exchange\x20disputes.'},{'id':'ret_refund_path','industry':'retail','dimension':'workflow','description':'Has\x20refund\x20path\x20(return/exchange)','weight':0x19,'passed':hasRefundPath,'advice':'🔴\x20No\x20refund\x20path:\x20return/exchange\x20not\x20guaranteed.'},{'id':'ret_arbitration','industry':'retail','dimension':'workflow','description':'Arbitration\x20configured','weight':0x19,'passed':hasArbitrationPath,'advice':'⚠️\x20Arbitration\x20not\x20configured:\x20no\x20third-party\x20ruling\x20for\x20return/exchange\x20disputes.'}]};function commonNeeds(){return[{'id':'need_arbitration','tier':'common','description':'Arbitration\x20configured\x20(dispute\x20resolution\x20channel)','satisfied':hasArbitrationPath,'advice':'Arbitration\x20not\x20configured:\x20no\x20third-party\x20resolution\x20channel\x20for\x20disputes.'},{'id':'need_refund_path','tier':'common','description':'Has\x20refund\x20path','satisfied':hasRefundPath,'advice':'No\x20refund\x20path:\x20funds\x20hard\x20to\x20recover\x20when\x20delivery\x20fails.'},{'id':'need_user_operable','tier':'common','description':'Has\x20user-operable\x20Forward','satisfied':a=>userOperableForwards(a)>0x0,'advice':'No\x20user-operable\x20steps\x20in\x20workflow,\x20order\x20progress\x20depends\x20entirely\x20on\x20merchant.'},{'id':'need_messenger','tier':'common','description':'Messenger\x20configured','satisfied':hasMessenger,'advice':'Merchant\x20has\x20no\x20Messenger\x20channel,\x20cannot\x20negotiate\x20or\x20conduct\x20after-sales\x20communication.'}];}const INDUSTRY_NEEDS={'freelance':[...commonNeeds(),{'id':'need_wip_verified','tier':'personalized','description':'WIP\x20verified\x20(work\x20IP\x20traceable)','satisfied':wipVerified,'advice':'WIP\x20not\x20verified:\x20IP\x20ownership\x20and\x20originality\x20of\x20work\x20cannot\x20be\x20traced.'},{'id':'need_milestone_nodes','tier':'personalized','description':'Milestone\x20nodes\x20(phased\x20feedback)','satisfied':hasMilestoneNodes,'advice':'No\x20milestone\x20nodes:\x20lack\x20of\x20phased\x20feedback\x20and\x20revision\x20round\x20control.'},{'id':'need_merchant_history','tier':'advanced','description':'Merchant\x20history\x20≥3\x20orders\x20(fulfillment\x20experience)','satisfied':a=>merchantTotalOrders(a)>=0x3,'advice':'Merchant\x20history\x20orders\x20less\x20than\x203:\x20fulfillment\x20experience\x20is\x20limited.'}],'rental':[...commonNeeds(),{'id':'need_lock_duration_safe','tier':'personalized','description':'Lock\x20duration\x20safe\x20(deposit\x20cannot\x20be\x20withdrawn)','satisfied':lockDurationSafe,'advice':'Lock\x20duration\x20not\x20safe:\x20deposit\x20may\x20be\x20withdrawn\x20by\x20merchant\x20at\x20any\x20time.'},{'id':'need_compensation_full','tier':'personalized','description':'Compensation\x20fully\x20covers','satisfied':compensationCoversOrder,'advice':'Compensation\x20not\x20fully\x20covered:\x20insufficient\x20payout\x20for\x20rental\x20item\x20damage.'},{'id':'need_merchant_history','tier':'advanced','description':'Merchant\x20history\x20≥5\x20orders\x20(rental\x20experience)','satisfied':a=>merchantTotalOrders(a)>=0x5,'advice':'Merchant\x20history\x20orders\x20less\x20than\x205:\x20rental\x20service\x20experience\x20limited.'}],'education':[...commonNeeds(),{'id':'need_has_compensation','tier':'personalized','description':'Has\x20compensation\x20fund\x20(course\x20quality\x20guarantee)','satisfied':hasCompensationFund,'advice':'No\x20compensation\x20fund:\x20no\x20compensation\x20source\x20when\x20course\x20quality\x20is\x20not\x20up\x20to\x20standard.'},{'id':'need_long_cycle_ok','tier':'personalized','description':'Long\x20cycle\x20acceptable','satisfied':()=>!![],'advice':'Long\x20cycles\x20are\x20normal\x20in\x20education;\x20recommend\x20tracking\x20lesson\x20consumption\x20and\x20attendance.'},{'id':'need_high_reputation','tier':'advanced','description':'High\x20reputation\x20score\x20(trust_score\x20≥70)','satisfied':a=>trustScore(a)>=0x46,'advice':'Merchant\x20reputation\x20score\x20below\x2070:\x20course\x20reputation\x20may\x20be\x20poor.'}],'travel':[...commonNeeds(),{'id':'need_urgent_delivery','tier':'personalized','description':'Urgent\x20delivery\x20configuration\x20(milestone\x20phasing)','satisfied':hasMilestoneNodes,'advice':'No\x20milestone\x20nodes:\x20itinerary\x20has\x20no\x20phased\x20acceptance,\x20urgent\x20delivery\x20guarantee\x20insufficient.'},{'id':'need_compensation_full','tier':'personalized','description':'Compensation\x20fully\x20covers\x20(breach\x20compensation)','satisfied':compensationCoversOrder,'advice':'Compensation\x20not\x20fully\x20covered:\x20insufficient\x20payout\x20for\x20itinerary\x20breach.'},{'id':'need_high_reputation','tier':'advanced','description':'High\x20reputation\x20score\x20(trust_score\x20≥70)','satisfied':a=>trustScore(a)>=0x46,'advice':'Merchant\x20reputation\x20score\x20below\x2070:\x20travel\x20service\x20reputation\x20may\x20be\x20poor.'}],'subscription':[...commonNeeds(),{'id':'need_no_lockin','tier':'personalized','description':'No\x20long-term\x20lock-in\x20(no\x20dead-end\x20nodes)','satisfied':a=>deadEndCount(a)===0x0,'advice':'Dead-end\x20nodes\x20exist:\x20subscription\x20may\x20be\x20locked,\x20auto-renewal\x20trap\x20exists.'},{'id':'need_low_dispute','tier':'personalized','description':'Low\x20dispute\x20rate\x20(≤15%,\x20stable\x20content\x20quality)','satisfied':a=>disputeRate(a)<=0.15,'advice':'Dispute\x20rate\x20is\x20high:\x20subscription\x20content\x20quality\x20may\x20be\x20unstable.'},{'id':'need_repeat_rate','tier':'advanced','description':'Repeat\x20buyer\x20rate\x20≥20%\x20(strong\x20subscription\x20renewal\x20willingness)','satisfied':a=>repeatBuyerRate(a)>=0.2,'advice':'Repeat\x20buyer\x20rate\x20below\x2020%:\x20subscription\x20renewal\x20willingness\x20is\x20weak,\x20service\x20may\x20not\x20be\x20worth\x20long-term\x20subscription.'}],'retail':[...commonNeeds(),{'id':'need_wip_verified','tier':'personalized','description':'WIP\x20verified\x20(authenticity/logistics\x20traceability)','satisfied':wipVerified,'advice':'WIP\x20not\x20verified:\x20product\x20authenticity\x20and\x20logistics\x20traceability\x20info\x20missing.'},{'id':'need_compensation_full','tier':'personalized','description':'Compensation\x20fully\x20covers','satisfied':compensationCoversOrder,'advice':'Compensation\x20not\x20fully\x20covered:\x20insufficient\x20payout\x20for\x20return/exchange\x20disputes.'},{'id':'need_high_reputation','tier':'advanced','description':'High\x20reputation\x20score\x20(trust_score\x20≥70)','satisfied':a=>trustScore(a)>=0x46,'advice':'Merchant\x20reputation\x20score\x20below\x2070:\x20product\x20or\x20service\x20reputation\x20may\x20be\x20poor.'}]};let _registryLookup=null;export function _setRegistryLookup(a){_registryLookup=a;}export function getIndustryRiskChecks(a){if(_registryLookup){const b=_registryLookup(a);if(b?.['risk_checks'])return b['risk_checks'];}return INDUSTRY_RISK_CHECKS[a];}export function getIndustryNeeds(a){if(_registryLookup){const b=_registryLookup(a);if(b?.['needs'])return b['needs'];}return INDUSTRY_NEEDS[a];}export{CUSTOMER_INTELLIGENCE_VERSION};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import type { RiskLevel } from "./types.js";
|
|
2
2
|
import { CUSTOMER_INTELLIGENCE_VERSION } from "./types.js";
|
|
3
|
+
import { type MonitorSection } from "../config/judgment.js";
|
|
3
4
|
import { type TokenDisplayHint } from "../knowledge/fund-layer.js";
|
|
4
|
-
export type AlertSeverity = "
|
|
5
|
+
export type AlertSeverity = "critical" | "high" | "info";
|
|
5
6
|
export type AlertCategory = "progress_stall" | "compensation_drop" | "compensation_insufficient" | "messenger_timeout" | "user_action_required" | "review_window" | "arb_window" | "refund_received" | "anomaly";
|
|
6
7
|
export interface MonitorAlert {
|
|
7
8
|
id: string;
|
|
@@ -63,6 +64,7 @@ export interface MonitorThresholds {
|
|
|
63
64
|
review_window_closing_days?: number;
|
|
64
65
|
arb_window_closing_days?: number;
|
|
65
66
|
}
|
|
67
|
+
export type MonitorEscalation = MonitorSection["escalation"];
|
|
66
68
|
export declare function monitorOrder(ctx: OrderMonitorContext): MonitorAlert[];
|
|
67
69
|
export declare function sortAlerts(alerts: MonitorAlert[]): MonitorAlert[];
|
|
68
70
|
export { CUSTOMER_INTELLIGENCE_VERSION };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{CUSTOMER_INTELLIGENCE_VERSION}from'./types.js';import{formatAmountText}from'../knowledge/fund-layer.js';const DEFAULT_THRESHOLDS={'progress_stall_hours':0x0,'compensation_drop_ratio':0.3,'compensation_coverage_min':0x1,'messenger_timeout_hours':0x18,'review_window_closing_days':0x3,'arb_window_closing_days':0x3};export function monitorOrder(a){const b=[],c={...DEFAULT_THRESHOLDS,...a['thresholds']??{}},d=a['current'];if(d['completed'])return b['push'](...detectPostCompletionAlerts(d,c)),sortAlerts(b);if(d['refunded'])return b['push']({'id':'refund_received','category':'refund_received','severity':'info','title':'Refund\x20received','message':'Order\x20'+d['order_id']+'\x20refund\x20has\x20been\x20received','timestamp':d['now'],'order_id':d['order_id'],'service_id':d['service_id']}),sortAlerts(b);return b['push'](...detectProgressStall(d,a['previous'],c)),b['push'](...detectCompensationChange(d,a['previous'],c)),b['push'](...detectMessengerTimeout(d,c)),d['pending_user_action']&&b['push']({'id':'user_action_required','category':'user_action_required','severity':'info','title':'Waiting\x20for\x20user\x20action','message':'Order\x20'+d['order_id']+'\x20advanced\x20to\x20node\x20'+(d['current_node']??'unknown')+';\x20your\x20action\x20is\x20required\x20to\x20continue','action':'View\x20the\x20Machine\x20node\x20requirements\x20and\x20submit\x20the\x20corresponding\x20Guard\x20submission','timestamp':d['now'],'order_id':d['order_id'],'service_id':d['service_id'],'node':d['current_node']}),sortAlerts(b);}function detectProgressStall(a,b,c){const d=[];if(!a['current_node'])return d;const e=a['last_progress_at']??a['created_at'],f=a['now']-e,g=f/0x36ee80,h=a['expected_progress_hours']??0x18,i=c['progress_stall_hours']>0x0?c['progress_stall_hours']:h*0x2;if(g>i){const j=g>i*0x2?'critical':'warning';d['push']({'id':'progress_stall','category':'progress_stall','severity':j,'title':j==='critical'?'Order\x20severely\x20stalled':'Order\x20progress\x20stalled','message':'Order\x20has\x20been\x20stuck\x20at\x20node\x20'+a['current_node']+'\x20for\x20over\x20'+Math['round'](g)+'\x20hours\x20(expected\x20'+h+'\x20hours)','action':j==='critical'?'Recommend\x20contacting\x20the\x20merchant\x20immediately\x20via\x20Messenger;\x20if\x20the\x20merchant\x20remains\x20unresponsive,\x20consider\x20initiating\x20arbitration':'Recommend\x20contacting\x20the\x20merchant\x20via\x20Messenger\x20to\x20ask\x20about\x20progress','timestamp':a['now'],'order_id':a['order_id'],'service_id':a['service_id'],'node':a['current_node'],'metric':{'label':'Stall\x20duration','value':Math['round'](g),'threshold':Math['round'](i),'unit':'hours'}});}if(b&&b['previous_node']===a['current_node']){const k=a['now']-b['snapshot_at'],l=k/0x36ee80;l>h&&d['push']({'id':'node_unchanged','category':'progress_stall','severity':'warning','title':'Node\x20unchanged','message':'Since\x20the\x20last\x20check\x20('+Math['round'](l)+'\x20hours),\x20the\x20order\x20is\x20still\x20at\x20'+a['current_node'],'action':'Confirm\x20whether\x20this\x20is\x20expected;\x20if\x20not,\x20contact\x20the\x20merchant','timestamp':a['now'],'order_id':a['order_id'],'service_id':a['service_id'],'node':a['current_node'],'metric':{'label':'Node\x20stay\x20duration','value':Math['round'](l),'threshold':Math['round'](h),'unit':'hours'}});}return d;}function detectCompensationChange(a,b,c){const d=[];if(a['compensation_balance']===undefined)return d;if(a['order_amount']!==undefined&&a['order_amount']>0x0n){const e=Number(a['compensation_balance']*0x64n/a['order_amount'])/0x64;if(e<c['compensation_coverage_min']){const f=e<0.5?'critical':'warning';d['push']({'id':'compensation_insufficient','category':'compensation_insufficient','severity':f,'title':'Compensation\x20fund\x20coverage\x20insufficient','message':'Merchant\x20compensation\x20fund\x20covers\x20only\x20'+Math['round'](e*0x64)+'%\x20of\x20the\x20order\x20amount\x20(required\x20'+Math['round'](c['compensation_coverage_min']*0x64)+'%):\x20fund\x20'+formatAmountText(a['compensation_balance'],a['token']?.['decimals'],a['token']?.['symbol'])+'\x20vs\x20order\x20'+formatAmountText(a['order_amount'],a['token']?.['decimals'],a['token']?.['symbol']),'action':'Require\x20the\x20merchant\x20to\x20top\x20up\x20the\x20compensation\x20fund\x20before\x20ordering,\x20or\x20negotiate\x20higher\x20coverage\x20via\x20Messenger','timestamp':a['now'],'order_id':a['order_id'],'service_id':a['service_id'],'metric':{'label':'Compensation\x20coverage','value':Math['round'](e*0x64),'threshold':Math['round'](c['compensation_coverage_min']*0x64),'unit':'%'}});}}if(b&&b['previous_compensation_balance']!==undefined){const g=b['previous_compensation_balance'];if(g>0x0n&&a['compensation_balance']<g){const h=Number((g-a['compensation_balance'])*0x64n/g)/0x64;if(h>=c['compensation_drop_ratio']){const i=h>=0.5?'critical':'warning';d['push']({'id':'compensation_drop','category':'compensation_drop','severity':i,'title':'Compensation\x20fund\x20balance\x20dropped\x20significantly','message':'Merchant\x20compensation\x20fund\x20dropped\x20from\x20'+formatAmountText(g,a['token']?.['decimals'],a['token']?.['symbol'])+'\x20to\x20'+formatAmountText(a['compensation_balance'],a['token']?.['decimals'],a['token']?.['symbol'])+'\x20(down\x20'+Math['round'](h*0x64)+'%)','action':'Immediately\x20ask\x20the\x20merchant\x20for\x20the\x20reason;\x20if\x20it\x20keeps\x20dropping,\x20the\x20merchant\x20may\x20be\x20processing\x20payouts\x20for\x20other\x20orders,\x20which\x20is\x20a\x20risk','timestamp':a['now'],'order_id':a['order_id'],'service_id':a['service_id'],'metric':{'label':'Compensation\x20drop\x20ratio','value':Math['round'](h*0x64),'threshold':Math['round'](c['compensation_drop_ratio']*0x64),'unit':'%'}});}}}return d;}function detectMessengerTimeout(a,b){const c=[];if(a['has_messenger']===![])return c['push']({'id':'no_messenger_channel','category':'messenger_timeout','severity':'info','title':'Merchant\x20has\x20no\x20Messenger\x20channel','message':'Merchant\x20has\x20not\x20configured\x20Messenger;\x20no\x20way\x20to\x20negotiate\x20online\x20or\x20get\x20post-sale\x20support','action':'Confirm\x20other\x20contact\x20methods\x20before\x20ordering;\x20recommend\x20requiring\x20the\x20merchant\x20to\x20configure\x20Messenger','timestamp':a['now'],'order_id':a['order_id'],'service_id':a['service_id']}),c;if(a['last_user_message_at']&&!a['last_merchant_reply_at']){const d=a['now']-a['last_user_message_at'],e=d/0x36ee80;if(e>b['messenger_timeout_hours']){const f=e>b['messenger_timeout_hours']*0x2?'critical':'warning';c['push']({'id':'messenger_unanswered','category':'messenger_timeout','severity':f,'title':'Merchant\x20Messenger\x20no\x20reply','message':'Merchant\x20has\x20not\x20replied\x20to\x20your\x20Messenger\x20message\x20for\x20'+Math['round'](e)+'\x20hours','action':a['has_arbitration']?'Consider\x20initiating\x20an\x20arbitration\x20application\x20(arbitration\x20window\x20is\x20limited)':'Merchant\x20has\x20no\x20arbitration\x20configured;\x20recommend\x20urging\x20via\x20other\x20contact\x20methods;\x20if\x20there\x20is\x20no\x20response,\x20funds\x20may\x20be\x20frozen','timestamp':a['now'],'order_id':a['order_id'],'service_id':a['service_id'],'metric':{'label':'No-reply\x20duration','value':Math['round'](e),'threshold':Math['round'](b['messenger_timeout_hours']),'unit':'hours'}});}}if(a['last_merchant_reply_at']&&a['last_user_message_at']&&a['last_user_message_at']>a['last_merchant_reply_at']){const g=a['now']-a['last_user_message_at'],h=g/0x36ee80;h>b['messenger_timeout_hours']&&c['push']({'id':'messenger_re_unanswered','category':'messenger_timeout','severity':'warning','title':'Merchant\x20did\x20not\x20reply\x20again','message':'The\x20merchant\x20has\x20not\x20replied\x20to\x20your\x20message\x20from\x20'+Math['round'](h)+'\x20hours\x20ago','action':'Send\x20a\x20follow-up\x20message;\x20if\x20the\x20merchant\x20remains\x20unresponsive,\x20consider\x20arbitration','timestamp':a['now'],'order_id':a['order_id'],'service_id':a['service_id'],'metric':{'label':'Re-no-reply\x20duration','value':Math['round'](h),'threshold':Math['round'](b['messenger_timeout_hours']),'unit':'hours'}});}return c;}function detectPostCompletionAlerts(a,b){const c=[];return a['review_window_days']!==undefined&&a['review_window_days']>0x0&&(a['review_window_days']<=b['review_window_closing_days']?c['push']({'id':'review_window_closing','category':'review_window','severity':'info','title':'Review\x20window\x20about\x20to\x20close','message':'The\x20review\x20window\x20will\x20close\x20in\x20'+a['review_window_days']+'\x20day(s)','action':'Submit\x20a\x20review\x20as\x20soon\x20as\x20possible\x20(evidence\x20can\x20be\x20submitted\x20together\x20if\x20available)','timestamp':a['now'],'order_id':a['order_id'],'service_id':a['service_id'],'metric':{'label':'Remaining\x20days','value':a['review_window_days'],'threshold':b['review_window_closing_days'],'unit':'days'}}):c['push']({'id':'review_reminder','category':'review_window','severity':'info','title':'Order\x20completed','message':'Order\x20completed;\x20review\x20window\x20has\x20'+a['review_window_days']+'\x20day(s)\x20remaining','action':'Submit\x20a\x20review\x20to\x20help\x20other\x20users\x20decide','timestamp':a['now'],'order_id':a['order_id'],'service_id':a['service_id']})),a['arb_window_days']!==undefined&&a['arb_window_days']>0x0&&(a['arb_window_days']<=b['arb_window_closing_days']&&c['push']({'id':'arb_window_closing','category':'arb_window','severity':'warning','title':'Arbitration\x20application\x20window\x20about\x20to\x20close','message':'The\x20arbitration\x20application\x20window\x20will\x20close\x20in\x20'+a['arb_window_days']+'\x20day(s)','action':'If\x20there\x20are\x20unresolved\x20disputes,\x20initiate\x20an\x20arbitration\x20application\x20immediately','timestamp':a['now'],'order_id':a['order_id'],'service_id':a['service_id'],'metric':{'label':'Remaining\x20days','value':a['arb_window_days'],'threshold':b['arb_window_closing_days'],'unit':'days'}})),c;}export function sortAlerts(a){const b={'critical':0x3,'warning':0x2,'info':0x1};return[...a]['sort']((c,d)=>b[d['severity']]-b[c['severity']]);}export{CUSTOMER_INTELLIGENCE_VERSION};
|
|
1
|
+
import{CUSTOMER_INTELLIGENCE_VERSION}from'./types.js';import{severityRank}from'../config/severity.js';import{getJudgmentDoc}from'../config/judgment.js';import{formatAmountText}from'../knowledge/fund-layer.js';function monitorParams(){return getJudgmentDoc()['monitor'];}export function monitorOrder(a){const b=[],c=monitorParams(),d={...c['thresholds'],...a['thresholds']??{}},e=c['escalation'],f=a['current'];if(f['completed'])return b['push'](...detectPostCompletionAlerts(f,d)),sortAlerts(b);if(f['refunded'])return b['push']({'id':'refund_received','category':'refund_received','severity':'info','title':'Refund\x20received','message':'Order\x20'+f['order_id']+'\x20refund\x20has\x20been\x20received','timestamp':f['now'],'order_id':f['order_id'],'service_id':f['service_id']}),sortAlerts(b);return b['push'](...detectProgressStall(f,a['previous'],d,e)),b['push'](...detectCompensationChange(f,a['previous'],d,e)),b['push'](...detectMessengerTimeout(f,d,e)),f['pending_user_action']&&b['push']({'id':'user_action_required','category':'user_action_required','severity':'info','title':'Waiting\x20for\x20user\x20action','message':'Order\x20'+f['order_id']+'\x20advanced\x20to\x20node\x20'+(f['current_node']??'unknown')+';\x20your\x20action\x20is\x20required\x20to\x20continue','action':'View\x20the\x20Machine\x20node\x20requirements\x20and\x20submit\x20the\x20corresponding\x20Guard\x20submission','timestamp':f['now'],'order_id':f['order_id'],'service_id':f['service_id'],'node':f['current_node']}),sortAlerts(b);}function detectProgressStall(a,b,c,d){const e=[];if(!a['current_node'])return e;const f=a['last_progress_at']??a['created_at'],g=a['now']-f,h=g/0x36ee80,i=a['expected_progress_hours']??d['default_expected_progress_hours'],j=c['progress_stall_hours']>0x0?c['progress_stall_hours']:i*d['stall_expected_multiplier'];if(h>j){const k=h>j*d['stall_escalation_multiplier']?'critical':'high';e['push']({'id':'progress_stall','category':'progress_stall','severity':k,'title':k==='critical'?'Order\x20severely\x20stalled':'Order\x20progress\x20stalled','message':'Order\x20has\x20been\x20stuck\x20at\x20node\x20'+a['current_node']+'\x20for\x20over\x20'+Math['round'](h)+'\x20hours\x20(expected\x20'+i+'\x20hours)','action':k==='critical'?'Recommend\x20contacting\x20the\x20merchant\x20immediately\x20via\x20Messenger;\x20if\x20the\x20merchant\x20remains\x20unresponsive,\x20consider\x20initiating\x20arbitration':'Recommend\x20contacting\x20the\x20merchant\x20via\x20Messenger\x20to\x20ask\x20about\x20progress','timestamp':a['now'],'order_id':a['order_id'],'service_id':a['service_id'],'node':a['current_node'],'metric':{'label':'Stall\x20duration','value':Math['round'](h),'threshold':Math['round'](j),'unit':'hours'}});}if(b&&b['previous_node']===a['current_node']){const l=a['now']-b['snapshot_at'],m=l/0x36ee80;m>i&&e['push']({'id':'node_unchanged','category':'progress_stall','severity':'high','title':'Node\x20unchanged','message':'Since\x20the\x20last\x20check\x20('+Math['round'](m)+'\x20hours),\x20the\x20order\x20is\x20still\x20at\x20'+a['current_node'],'action':'Confirm\x20whether\x20this\x20is\x20expected;\x20if\x20not,\x20contact\x20the\x20merchant','timestamp':a['now'],'order_id':a['order_id'],'service_id':a['service_id'],'node':a['current_node'],'metric':{'label':'Node\x20stay\x20duration','value':Math['round'](m),'threshold':Math['round'](i),'unit':'hours'}});}return e;}function detectCompensationChange(a,b,c,d){const e=[];if(a['compensation_balance']===undefined)return e;if(a['order_amount']!==undefined&&a['order_amount']>0x0n){const f=Number(a['compensation_balance']*0x64n/a['order_amount'])/0x64;if(f<c['compensation_coverage_min']){const g=f<d['ratio_critical_threshold']?'critical':'high';e['push']({'id':'compensation_insufficient','category':'compensation_insufficient','severity':g,'title':'Compensation\x20fund\x20coverage\x20insufficient','message':'Merchant\x20compensation\x20fund\x20covers\x20only\x20'+Math['round'](f*0x64)+'%\x20of\x20the\x20order\x20amount\x20(required\x20'+Math['round'](c['compensation_coverage_min']*0x64)+'%):\x20fund\x20'+formatAmountText(a['compensation_balance'],a['token']?.['decimals'],a['token']?.['symbol'])+'\x20vs\x20order\x20'+formatAmountText(a['order_amount'],a['token']?.['decimals'],a['token']?.['symbol']),'action':'Require\x20the\x20merchant\x20to\x20top\x20up\x20the\x20compensation\x20fund\x20before\x20ordering,\x20or\x20negotiate\x20higher\x20coverage\x20via\x20Messenger','timestamp':a['now'],'order_id':a['order_id'],'service_id':a['service_id'],'metric':{'label':'Compensation\x20coverage','value':Math['round'](f*0x64),'threshold':Math['round'](c['compensation_coverage_min']*0x64),'unit':'%'}});}}if(b&&b['previous_compensation_balance']!==undefined){const h=b['previous_compensation_balance'];if(h>0x0n&&a['compensation_balance']<h){const i=Number((h-a['compensation_balance'])*0x64n/h)/0x64;if(i>=c['compensation_drop_ratio']){const j=i>=d['ratio_critical_threshold']?'critical':'high';e['push']({'id':'compensation_drop','category':'compensation_drop','severity':j,'title':'Compensation\x20fund\x20balance\x20dropped\x20significantly','message':'Merchant\x20compensation\x20fund\x20dropped\x20from\x20'+formatAmountText(h,a['token']?.['decimals'],a['token']?.['symbol'])+'\x20to\x20'+formatAmountText(a['compensation_balance'],a['token']?.['decimals'],a['token']?.['symbol'])+'\x20(down\x20'+Math['round'](i*0x64)+'%)','action':'Immediately\x20ask\x20the\x20merchant\x20for\x20the\x20reason;\x20if\x20it\x20keeps\x20dropping,\x20the\x20merchant\x20may\x20be\x20processing\x20payouts\x20for\x20other\x20orders,\x20which\x20is\x20a\x20risk','timestamp':a['now'],'order_id':a['order_id'],'service_id':a['service_id'],'metric':{'label':'Compensation\x20drop\x20ratio','value':Math['round'](i*0x64),'threshold':Math['round'](c['compensation_drop_ratio']*0x64),'unit':'%'}});}}}return e;}function detectMessengerTimeout(a,b,c){const d=[];if(a['has_messenger']===![])return d['push']({'id':'no_messenger_channel','category':'messenger_timeout','severity':'info','title':'Merchant\x20has\x20no\x20Messenger\x20channel','message':'Merchant\x20has\x20not\x20configured\x20Messenger;\x20no\x20way\x20to\x20negotiate\x20online\x20or\x20get\x20post-sale\x20support','action':'Confirm\x20other\x20contact\x20methods\x20before\x20ordering;\x20recommend\x20requiring\x20the\x20merchant\x20to\x20configure\x20Messenger','timestamp':a['now'],'order_id':a['order_id'],'service_id':a['service_id']}),d;if(a['last_user_message_at']&&!a['last_merchant_reply_at']){const e=a['now']-a['last_user_message_at'],f=e/0x36ee80;if(f>b['messenger_timeout_hours']){const g=f>b['messenger_timeout_hours']*c['messenger_escalation_multiplier']?'critical':'high';d['push']({'id':'messenger_unanswered','category':'messenger_timeout','severity':g,'title':'Merchant\x20Messenger\x20no\x20reply','message':'Merchant\x20has\x20not\x20replied\x20to\x20your\x20Messenger\x20message\x20for\x20'+Math['round'](f)+'\x20hours','action':a['has_arbitration']?'Consider\x20initiating\x20an\x20arbitration\x20application\x20(arbitration\x20window\x20is\x20limited)':'Merchant\x20has\x20no\x20arbitration\x20configured;\x20recommend\x20urging\x20via\x20other\x20contact\x20methods;\x20if\x20there\x20is\x20no\x20response,\x20funds\x20may\x20be\x20frozen','timestamp':a['now'],'order_id':a['order_id'],'service_id':a['service_id'],'metric':{'label':'No-reply\x20duration','value':Math['round'](f),'threshold':Math['round'](b['messenger_timeout_hours']),'unit':'hours'}});}}if(a['last_merchant_reply_at']&&a['last_user_message_at']&&a['last_user_message_at']>a['last_merchant_reply_at']){const h=a['now']-a['last_user_message_at'],i=h/0x36ee80;i>b['messenger_timeout_hours']&&d['push']({'id':'messenger_re_unanswered','category':'messenger_timeout','severity':'high','title':'Merchant\x20did\x20not\x20reply\x20again','message':'The\x20merchant\x20has\x20not\x20replied\x20to\x20your\x20message\x20from\x20'+Math['round'](i)+'\x20hours\x20ago','action':'Send\x20a\x20follow-up\x20message;\x20if\x20the\x20merchant\x20remains\x20unresponsive,\x20consider\x20arbitration','timestamp':a['now'],'order_id':a['order_id'],'service_id':a['service_id'],'metric':{'label':'Re-no-reply\x20duration','value':Math['round'](i),'threshold':Math['round'](b['messenger_timeout_hours']),'unit':'hours'}});}return d;}function detectPostCompletionAlerts(a,b){const c=[];return a['review_window_days']!==undefined&&a['review_window_days']>0x0&&(a['review_window_days']<=b['review_window_closing_days']?c['push']({'id':'review_window_closing','category':'review_window','severity':'info','title':'Review\x20window\x20about\x20to\x20close','message':'The\x20review\x20window\x20will\x20close\x20in\x20'+a['review_window_days']+'\x20day(s)','action':'Submit\x20a\x20review\x20as\x20soon\x20as\x20possible\x20(evidence\x20can\x20be\x20submitted\x20together\x20if\x20available)','timestamp':a['now'],'order_id':a['order_id'],'service_id':a['service_id'],'metric':{'label':'Remaining\x20days','value':a['review_window_days'],'threshold':b['review_window_closing_days'],'unit':'days'}}):c['push']({'id':'review_reminder','category':'review_window','severity':'info','title':'Order\x20completed','message':'Order\x20completed;\x20review\x20window\x20has\x20'+a['review_window_days']+'\x20day(s)\x20remaining','action':'Submit\x20a\x20review\x20to\x20help\x20other\x20users\x20decide','timestamp':a['now'],'order_id':a['order_id'],'service_id':a['service_id']})),a['arb_window_days']!==undefined&&a['arb_window_days']>0x0&&(a['arb_window_days']<=b['arb_window_closing_days']&&c['push']({'id':'arb_window_closing','category':'arb_window','severity':'high','title':'Arbitration\x20application\x20window\x20about\x20to\x20close','message':'The\x20arbitration\x20application\x20window\x20will\x20close\x20in\x20'+a['arb_window_days']+'\x20day(s)','action':'If\x20there\x20are\x20unresolved\x20disputes,\x20initiate\x20an\x20arbitration\x20application\x20immediately','timestamp':a['now'],'order_id':a['order_id'],'service_id':a['service_id'],'metric':{'label':'Remaining\x20days','value':a['arb_window_days'],'threshold':b['arb_window_closing_days'],'unit':'days'}})),c;}export function sortAlerts(a){return[...a]['sort']((c,d)=>severityRank(d['severity'])-severityRank(c['severity']));}export{CUSTOMER_INTELLIGENCE_VERSION};
|
package/dist/customer/types.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
export type PuzzleDepth = "browse" | "evaluate" | "preorder" | "monitor";
|
|
2
1
|
export interface ServiceBasics {
|
|
3
2
|
service_id: string;
|
|
4
3
|
name: string;
|
|
@@ -82,131 +81,16 @@ export interface MerchantBehavior {
|
|
|
82
81
|
like_ratio: number;
|
|
83
82
|
};
|
|
84
83
|
}
|
|
85
|
-
export interface
|
|
86
|
-
similar_services_count: number;
|
|
87
|
-
avg_price: bigint;
|
|
88
|
-
min_price: bigint;
|
|
89
|
-
max_price: bigint;
|
|
90
|
-
price_percentile: number;
|
|
91
|
-
supply_demand_ratio: number;
|
|
92
|
-
}
|
|
93
|
-
export type UserMetricEvaluatorType = "threshold" | "ratio" | "boolean" | "presence" | "regex_match" | "custom_query";
|
|
94
|
-
export interface UserMetric {
|
|
95
|
-
name: string;
|
|
96
|
-
label: string;
|
|
97
|
-
evaluator: UserMetricEvaluatorType;
|
|
98
|
-
params: {
|
|
99
|
-
path?: string;
|
|
100
|
-
threshold?: number | string;
|
|
101
|
-
invert?: boolean;
|
|
102
|
-
min?: number;
|
|
103
|
-
max?: number;
|
|
104
|
-
pattern?: string;
|
|
105
|
-
query_key?: string;
|
|
106
|
-
};
|
|
107
|
-
weight: number;
|
|
108
|
-
advice_on_fail?: string;
|
|
109
|
-
advice_on_pass?: string;
|
|
110
|
-
}
|
|
111
|
-
export interface UserMetricsConfig {
|
|
112
|
-
version: number;
|
|
113
|
-
source_file?: string;
|
|
114
|
-
metrics: UserMetric[];
|
|
115
|
-
adjustment_cap?: number;
|
|
116
|
-
}
|
|
117
|
-
export interface UserMetricResult {
|
|
118
|
-
name: string;
|
|
119
|
-
label: string;
|
|
120
|
-
passed: boolean;
|
|
121
|
-
score: number;
|
|
122
|
-
observed_value?: string | number | boolean;
|
|
123
|
-
weight: number;
|
|
124
|
-
advice?: string;
|
|
125
|
-
}
|
|
126
|
-
export interface UserMetricsResult {
|
|
127
|
-
metrics: UserMetricResult[];
|
|
128
|
-
score: number;
|
|
129
|
-
adjustment: number;
|
|
130
|
-
source_file?: string;
|
|
131
|
-
evaluated_at: number;
|
|
132
|
-
}
|
|
133
|
-
export interface ServiceNestingEvaluation {
|
|
134
|
-
depth_reached: number;
|
|
135
|
-
truncated: boolean;
|
|
136
|
-
bindings: {
|
|
137
|
-
machine?: {
|
|
138
|
-
object_id: string;
|
|
139
|
-
published: boolean;
|
|
140
|
-
risk_level: "low" | "medium" | "high" | "critical";
|
|
141
|
-
issues: string[];
|
|
142
|
-
};
|
|
143
|
-
arbitrations: Array<{
|
|
144
|
-
object_id: string;
|
|
145
|
-
voting_guard_count: number;
|
|
146
|
-
fee_balance: string;
|
|
147
|
-
paused: boolean;
|
|
148
|
-
risk_level: "low" | "medium" | "high" | "critical";
|
|
149
|
-
issues: string[];
|
|
150
|
-
}>;
|
|
151
|
-
rewards: Array<{
|
|
152
|
-
object_id: string;
|
|
153
|
-
balance: string;
|
|
154
|
-
guard_count: number;
|
|
155
|
-
risk_level: "low" | "medium" | "high" | "critical";
|
|
156
|
-
issues: string[];
|
|
157
|
-
}>;
|
|
158
|
-
repositories: Array<{
|
|
159
|
-
object_id: string;
|
|
160
|
-
risk_level: "low" | "medium" | "high" | "critical";
|
|
161
|
-
issues: string[];
|
|
162
|
-
}>;
|
|
163
|
-
};
|
|
164
|
-
overall_risk_level: "low" | "medium" | "high" | "critical";
|
|
165
|
-
overall_risk_score: number;
|
|
166
|
-
total_bindings_evaluated: number;
|
|
167
|
-
evaluated_at: number;
|
|
168
|
-
}
|
|
169
|
-
export interface InfoPuzzle {
|
|
84
|
+
export interface IndustryServicePuzzle {
|
|
170
85
|
service_id: string;
|
|
171
86
|
service_basics: ServiceBasics;
|
|
172
87
|
workflow_analysis?: WorkflowAnalysis;
|
|
173
88
|
fund_safety?: FundSafety;
|
|
174
89
|
trust_signals?: TrustSignals;
|
|
175
90
|
merchant_behavior?: MerchantBehavior;
|
|
176
|
-
market_context?: MarketContext;
|
|
177
|
-
user_metrics?: UserMetricsResult;
|
|
178
|
-
service_nesting?: ServiceNestingEvaluation;
|
|
179
|
-
completeness: number;
|
|
180
|
-
gaps: string[];
|
|
181
|
-
assembled_at: number;
|
|
182
91
|
}
|
|
183
92
|
export type RiskDimensionName = "workflow" | "fund" | "trust" | "behavior";
|
|
184
|
-
export interface RiskCheck {
|
|
185
|
-
id: string;
|
|
186
|
-
dimension: RiskDimensionName;
|
|
187
|
-
description: string;
|
|
188
|
-
weight: number;
|
|
189
|
-
passed: boolean;
|
|
190
|
-
advice?: string;
|
|
191
|
-
}
|
|
192
|
-
export interface RiskDimensionScore {
|
|
193
|
-
name: RiskDimensionName;
|
|
194
|
-
score: number;
|
|
195
|
-
max_score: number;
|
|
196
|
-
checks: RiskCheck[];
|
|
197
|
-
}
|
|
198
93
|
export type RiskLevel = "low" | "medium_low" | "medium_high" | "high";
|
|
199
|
-
export interface RiskScore {
|
|
200
|
-
total: number;
|
|
201
|
-
base_total: number;
|
|
202
|
-
level: RiskLevel;
|
|
203
|
-
dimensions: RiskDimensionScore[];
|
|
204
|
-
user_metrics_adjustment?: number;
|
|
205
|
-
service_nesting_risk?: number;
|
|
206
|
-
service_nesting_level?: "low" | "medium" | "high" | "critical";
|
|
207
|
-
red_flags: string[];
|
|
208
|
-
advice: string[];
|
|
209
|
-
}
|
|
210
94
|
export interface UserPreferences {
|
|
211
95
|
price_sensitivity: "low" | "medium" | "high";
|
|
212
96
|
budget_range?: {
|
|
@@ -237,52 +121,4 @@ export interface UserPreferences {
|
|
|
237
121
|
preferred_tokens: string[];
|
|
238
122
|
preferred_merchants: string[];
|
|
239
123
|
}
|
|
240
|
-
export type ReminderPriority = "required" | "recommended" | "info" | "reminder";
|
|
241
|
-
export interface Reminder {
|
|
242
|
-
id: string;
|
|
243
|
-
stage: "browse" | "evaluate" | "preorder" | "in_progress" | "complete" | "after_sale";
|
|
244
|
-
priority: ReminderPriority;
|
|
245
|
-
message: string;
|
|
246
|
-
action?: string;
|
|
247
|
-
}
|
|
248
|
-
export type GameScenario = "info_asymmetry" | "fund_safety" | "refund_dispute" | "arbitration_fairness" | "pricing" | "delivery_sla" | "quality_verification" | "after_sales";
|
|
249
|
-
export interface GameStrategy {
|
|
250
|
-
scenario: GameScenario;
|
|
251
|
-
merchant_tactic: string;
|
|
252
|
-
user_strategy: string;
|
|
253
|
-
nash_equilibrium: string;
|
|
254
|
-
}
|
|
255
|
-
export interface CustomerAdvice {
|
|
256
|
-
risk_score?: number;
|
|
257
|
-
risk_level?: RiskLevel;
|
|
258
|
-
recommendations: string[];
|
|
259
|
-
reminders: Reminder[];
|
|
260
|
-
preference_match?: {
|
|
261
|
-
score: number;
|
|
262
|
-
matches: string[];
|
|
263
|
-
mismatches: string[];
|
|
264
|
-
};
|
|
265
|
-
}
|
|
266
124
|
export declare const CUSTOMER_INTELLIGENCE_VERSION = 1;
|
|
267
|
-
export declare const RISK_LEVELS: readonly [{
|
|
268
|
-
readonly min: 85;
|
|
269
|
-
readonly level: "low";
|
|
270
|
-
readonly label: "Low risk";
|
|
271
|
-
readonly color: "🟢";
|
|
272
|
-
}, {
|
|
273
|
-
readonly min: 70;
|
|
274
|
-
readonly level: "medium_low";
|
|
275
|
-
readonly label: "Medium-low risk";
|
|
276
|
-
readonly color: "🟡";
|
|
277
|
-
}, {
|
|
278
|
-
readonly min: 50;
|
|
279
|
-
readonly level: "medium_high";
|
|
280
|
-
readonly label: "Medium-high risk";
|
|
281
|
-
readonly color: "🟠";
|
|
282
|
-
}, {
|
|
283
|
-
readonly min: 0;
|
|
284
|
-
readonly level: "high";
|
|
285
|
-
readonly label: "High risk";
|
|
286
|
-
readonly color: "🔴";
|
|
287
|
-
}];
|
|
288
|
-
export declare const RISK_DIMENSION_MAX: Record<RiskDimensionName, number>;
|
package/dist/customer/types.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const CUSTOMER_INTELLIGENCE_VERSION=0x1;
|
|
1
|
+
export const CUSTOMER_INTELLIGENCE_VERSION=0x1;
|
|
@@ -16,55 +16,6 @@ export declare function _setRegistryLookup(fn: ((industry: string) => {
|
|
|
16
16
|
preference_template?: IndustryTemplate;
|
|
17
17
|
} | undefined) | null): void;
|
|
18
18
|
export declare function getIndustryTemplate(industry: Industry): IndustryTemplate;
|
|
19
|
-
export interface OrderHistoryEntry {
|
|
20
|
-
service_id: string;
|
|
21
|
-
service_owner?: string;
|
|
22
|
-
industry?: string;
|
|
23
|
-
price: bigint;
|
|
24
|
-
avg_market_price: bigint;
|
|
25
|
-
used_discount: boolean;
|
|
26
|
-
used_referral: boolean;
|
|
27
|
-
has_arbitration: boolean;
|
|
28
|
-
has_compensation: boolean;
|
|
29
|
-
risk_score_at_purchase?: number;
|
|
30
|
-
used_messenger: boolean;
|
|
31
|
-
messenger_messages?: number;
|
|
32
|
-
completed: boolean;
|
|
33
|
-
has_dispute: boolean;
|
|
34
|
-
timestamp: number;
|
|
35
|
-
}
|
|
36
|
-
export interface PreferenceInference {
|
|
37
|
-
preferences: UserPreferences;
|
|
38
|
-
confidence: Record<keyof UserPreferences, number>;
|
|
39
|
-
signals: string[];
|
|
40
|
-
}
|
|
41
|
-
export declare function inferPreferences(history: OrderHistoryEntry[], basePrefs?: UserPreferences): PreferenceInference;
|
|
42
|
-
export interface ServiceForMatching {
|
|
43
|
-
service_id: string;
|
|
44
|
-
price: bigint;
|
|
45
|
-
token_type: string;
|
|
46
|
-
avg_market_price?: bigint;
|
|
47
|
-
estimated_cycle_days?: number;
|
|
48
|
-
estimated_response_hours?: number;
|
|
49
|
-
merchant_region?: string;
|
|
50
|
-
merchant_order_history_count: number;
|
|
51
|
-
merchant_age: "established" | "emerging" | "unknown";
|
|
52
|
-
has_arbitration: boolean;
|
|
53
|
-
has_compensation_fund: boolean;
|
|
54
|
-
has_reward_activity: boolean;
|
|
55
|
-
has_discount: boolean;
|
|
56
|
-
risk_score: number;
|
|
57
|
-
trust_score: number;
|
|
58
|
-
requires_messenger: boolean;
|
|
59
|
-
after_sales_support_level: "full" | "basic" | "minimal";
|
|
60
|
-
}
|
|
61
|
-
export interface PreferenceMatchResult {
|
|
62
|
-
score: number;
|
|
63
|
-
matches: string[];
|
|
64
|
-
mismatches: string[];
|
|
65
|
-
warnings: string[];
|
|
66
|
-
}
|
|
67
|
-
export declare function matchServiceToPreferences(service: ServiceForMatching, prefs: UserPreferences): PreferenceMatchResult;
|
|
68
19
|
export declare function mergePreferences(inferred: UserPreferences, manual: Partial<UserPreferences>): UserPreferences;
|
|
69
20
|
export declare function validatePreferences(prefs: UserPreferences): string[];
|
|
70
21
|
export { CUSTOMER_INTELLIGENCE_VERSION };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{CUSTOMER_INTELLIGENCE_VERSION}from'./types.js';export const SUPPORTED_INDUSTRIES=['freelance','rental','education','travel','subscription','retail'];const INDUSTRY_TEMPLATES={'freelance':{'max_acceptable_cycle':0x1e,'response_time_expectation':0x4,'require_arbitration':!![],'require_compensation_fund':!![],'risk_appetite':'balanced','delivery_speed_priority':'normal','after_sales_expectation':'full'},'rental':{'max_acceptable_cycle':0x7,'response_time_expectation':0x8,'require_arbitration':!![],'require_compensation_fund':!![],'risk_appetite':'conservative','delivery_speed_priority':'normal','after_sales_expectation':'full'},'education':{'max_acceptable_cycle':0x5a,'response_time_expectation':0x18,'require_arbitration':!![],'require_compensation_fund':!![],'risk_appetite':'conservative','delivery_speed_priority':'flexible','after_sales_expectation':'full'},'travel':{'max_acceptable_cycle':0xe,'response_time_expectation':0x2,'require_arbitration':!![],'require_compensation_fund':!![],'risk_appetite':'conservative','delivery_speed_priority':'urgent','after_sales_expectation':'full'},'subscription':{'max_acceptable_cycle':0x1e,'response_time_expectation':0x18,'require_arbitration':![],'require_compensation_fund':![],'risk_appetite':'aggressive','delivery_speed_priority':'normal','after_sales_expectation':'basic'},'retail':{'max_acceptable_cycle':0x7,'response_time_expectation':0x8,'require_arbitration':!![],'require_compensation_fund':!![],'risk_appetite':'balanced','delivery_speed_priority':'normal','after_sales_expectation':'full'}},BASE_DEFAULTS={'price_sensitivity':'medium','value_orientation':'balanced','discount_sensitivity':0.3,'delivery_speed_priority':'normal','max_acceptable_cycle':0xe,'response_time_expectation':0x8,'merchant_preference':'neutral','min_order_history':0x3,'bargain_hunting':0.3,'reward_seeking':![],'referral_participation':![],'communication_style':'friendly','transparency_demand':0.5,'after_sales_expectation':'basic','risk_appetite':'balanced','min_trust_score':0x32,'require_arbitration':!![],'require_compensation_fund':!![],'preferred_industries':[],'preferred_tokens':['0x2::wow::WOW'],'preferred_merchants':[]};export function getDefaultPreferences(a){if(!a||!INDUSTRY_TEMPLATES[a])return{...BASE_DEFAULTS};const b=INDUSTRY_TEMPLATES[a];return{...BASE_DEFAULTS,'max_acceptable_cycle':b['max_acceptable_cycle'],'response_time_expectation':b['response_time_expectation'],'require_arbitration':b['require_arbitration'],'require_compensation_fund':b['require_compensation_fund'],'risk_appetite':b['risk_appetite'],'delivery_speed_priority':b['delivery_speed_priority'],'after_sales_expectation':b['after_sales_expectation']};}let _registryLookup=null;export function _setRegistryLookup(a){_registryLookup=a;}export function getIndustryTemplate(a){if(_registryLookup){const b=_registryLookup(a);if(b?.['preference_template'])return{...b['preference_template']};}return{...INDUSTRY_TEMPLATES[a]};}export function inferPreferences(a,b){const c={...b??getDefaultPreferences()},d={},e=[];if(a['length']<0x3)return e['push']('history='+a['length']+'\x20<\x203,\x20keeping\x20default\x20preferences'),{'preferences':c,'confidence':d,'signals':e};const f=a['filter'](r=>r['avg_market_price']>0x0n&&r['price']<r['avg_market_price']*0x5an/0x64n);if(f['length']>=0x3)c['price_sensitivity']='high',c['value_orientation']='budget',d['price_sensitivity']=0.8,d['value_orientation']=0.7,e['push']('Consecutive\x20'+f['length']+'\x20picks\x20of\x20Service\x20priced\x2010%+\x20below\x20average\x20→\x20price_sensitivity=high');else f['length']>=0x1&&(c['price_sensitivity']='medium',d['price_sensitivity']=0.5,e['push'](f['length']+'\x20low-price\x20picks\x20→\x20price_sensitivity=medium'));const g=a['filter'](r=>r['used_discount']);g['length']>=0x2&&(c['discount_sensitivity']=0.8,d['discount_sensitivity']=0.85,e['push']('Used\x20discount\x20'+g['length']+'\x20times\x20→\x20discount_sensitivity=0.8'));a['some'](r=>r['used_referral'])&&(c['referral_participation']=!![],d['referral_participation']=0x1,e['push']('Has\x20used\x20a\x20referral\x20code\x20→\x20referral_participation=true'));(g['length']>=0x2||a['some'](r=>r['used_referral']))&&(c['reward_seeking']=!![],d['reward_seeking']=0.75,e['push']('Reward\x20behavior\x20detected\x20→\x20reward_seeking=true'));const i=g['length']+(a['some'](r=>r['used_referral'])?0x1:0x0);if(i>=0x3)c['bargain_hunting']=0.8,d['bargain_hunting']=0.8;else i>=0x1&&(c['bargain_hunting']=0.5,d['bargain_hunting']=0.6);const j=new Map();for(const r of a){r['industry']&&j['set'](r['industry'],(j['get'](r['industry'])??0x0)+0x1);}const k=Array['from'](j['entries']())['filter'](([,s])=>s>=0x1)['sort']((s,t)=>t[0x1]-s[0x1])['slice'](0x0,0x3)['map'](([s])=>s);k['length']>0x0&&(c['preferred_industries']=k,d['preferred_industries']=Math['min'](0x1,(j['get'](k[0x0])??0x0)/0x5),e['push']('Preferred\x20industries:\x20'+k['join'](',\x20')));const l=a['filter'](s=>s['has_arbitration']);if(l['length']>=0x3&&l['length']===a['length'])c['require_arbitration']=!![],d['require_arbitration']=0.85,e['push']('100%\x20of\x20historical\x20orders\x20picked\x20Services\x20with\x20arbitration\x20→\x20require_arbitration=true\x20(confirmed)');else l['length']<a['length']/0x2&&(c['require_arbitration']=![],d['require_arbitration']=0.5,e['push'](l['length']+'/'+a['length']+'\x20orders\x20had\x20arbitration\x20→\x20require_arbitration=false'));const m=a['filter'](s=>s['has_compensation']);if(m['length']>=0x3&&m['length']===a['length'])c['require_compensation_fund']=!![],d['require_compensation_fund']=0.85,e['push']('100%\x20of\x20historical\x20orders\x20had\x20compensation\x20fund\x20→\x20require_compensation_fund=true\x20(confirmed)');else m['length']<a['length']/0x2&&(c['require_compensation_fund']=![],d['require_compensation_fund']=0.5);const n=a['map'](s=>s['risk_score_at_purchase'])['filter'](t=>typeof t==='number');if(n['length']>=0x5){const s=Math['min'](...n);if(s>=0x46)c['risk_appetite']='conservative',c['min_trust_score']=0x46,d['risk_appetite']=0.8,d['min_trust_score']=0.7,e['push']('Lowest\x20risk\x20score\x20in\x20history\x20'+s+'\x20≥\x2070\x20→\x20risk_appetite=conservative');else s<0x32&&(c['risk_appetite']='aggressive',c['min_trust_score']=Math['max'](0x0,s-0xa),d['risk_appetite']=0.7,e['push']('Lowest\x20risk\x20score\x20in\x20history\x20'+s+'\x20<\x2050\x20→\x20risk_appetite=aggressive'));}const o=a['filter'](t=>t['used_messenger']);if(o['length']>=0x2){const t=o['reduce']((u,v)=>u+(v['messenger_messages']??0x0),0x0)/o['length'];if(t>=0xa)c['communication_style']='formal',d['communication_style']=0.6,e['push']('Average\x20'+t['toFixed'](0x1)+'\x20Messenger\x20messages\x20→\x20communication_style=formal');else t<=0x3&&(c['communication_style']='casual',d['communication_style']=0.5,e['push']('Average\x20'+t['toFixed'](0x1)+'\x20Messenger\x20messages\x20→\x20communication_style=casual'));c['transparency_demand']=Math['min'](0x1,t/0x14),d['transparency_demand']=0.6;}const p=a['filter'](u=>u['has_dispute'])['length'];p>0x0&&(c['transparency_demand']=Math['max'](c['transparency_demand'],0.7),c['after_sales_expectation']='full',d['transparency_demand']=Math['max'](d['transparency_demand']??0x0,0.7),d['after_sales_expectation']=0.7,e['push'](p+'\x20disputes\x20→\x20transparency_demand\x20increased,\x20after_sales=full'));const q=new Map();for(const u of a){u['service_owner']&&q['set'](u['service_owner'],(q['get'](u['service_owner'])??0x0)+0x1);}return c['preferred_merchants']=Array['from'](q['entries']())['filter'](([,v])=>v>=0x2)['sort']((v,w)=>w[0x1]-v[0x1])['slice'](0x0,0x5)['map'](([v])=>v),c['preferred_merchants']['length']>0x0&&(d['preferred_merchants']=0.8,e['push']('Patronized\x20'+c['preferred_merchants']['length']+'\x20merchants\x20≥2\x20times')),{'preferences':c,'confidence':d,'signals':e};}export function matchServiceToPreferences(a,b){const c=[],d=[],e=[];let f=0x0,g=0x0;g+=0x19;if(b['budget_range']){if(a['price']>=b['budget_range']['min']&&a['price']<=b['budget_range']['max'])f+=0x14,c['push']('Price\x20within\x20budget\x20range');else a['price']<b['budget_range']['min']?(f+=0xf,c['push']('Price\x20below\x20budget\x20minimum')):d['push']('Price\x20exceeds\x20budget\x20maximum');}else{if(a['avg_market_price']&&a['avg_market_price']>0x0n){const k=Number(a['price']*0x64n/a['avg_market_price'])/0x64;if(b['price_sensitivity']==='high'){if(k<=0.9)f+=0x19,c['push']('Price\x20is\x20'+((0x1-k)*0x64|0x0)+'%\x20below\x20average\x20(bonus\x20for\x20high-sensitivity\x20user)');else k<=1.1?(f+=0xf,c['push']('Price\x20on\x20par\x20with\x20average')):d['push']('Price\x20is\x20'+((k-0x1)*0x64|0x0)+'%\x20above\x20average\x20(high-sensitivity\x20user)');}else{if(b['price_sensitivity']==='low')f+=0x14,c['push']('Low\x20price\x20sensitivity');else{if(k<=0x1)f+=0x14,c['push']('Price\x20not\x20above\x20average');else k<=1.2?f+=0xc:d['push']('Price\x20significantly\x20above\x20average');}}}else f+=0xc;}g+=0xf;const h=a['estimated_cycle_days']??0x0;if(h>0x0){if(h<=b['max_acceptable_cycle']){f+=0xa,c['push']('Delivery\x20cycle\x20'+h+'\x20days\x20≤\x20expected\x20'+b['max_acceptable_cycle']+'\x20days');if(b['delivery_speed_priority']==='urgent'&&h<=Math['max'](0x1,b['max_acceptable_cycle']/0x3))f+=0x5,c['push']('Urgent\x20delivery\x20need\x20satisfied');else b['delivery_speed_priority']==='urgent'&&e['push']('Urgent\x20delivery\x20need\x20but\x20cycle\x20is\x20long');}else d['push']('Delivery\x20cycle\x20'+h+'\x20days\x20>\x20expected\x20'+b['max_acceptable_cycle']+'\x20days');}else f+=0x7;g+=0xa;if(b['preferred_region']){if(a['merchant_region']&&a['merchant_region']===b['preferred_region'])f+=0xa,c['push']('Merchant\x20region\x20'+a['merchant_region']+'\x20matches\x20preference');else a['merchant_region']?d['push']('Merchant\x20region\x20'+a['merchant_region']+'\x20does\x20not\x20match\x20preference\x20'+b['preferred_region']):f+=0x5;}else f+=0x7;g+=0xa;a['merchant_order_history_count']>=b['min_order_history']?(f+=0x7,c['push']('Merchant\x20history\x20'+a['merchant_order_history_count']+'\x20orders\x20≥\x20required\x20'+b['min_order_history']+'\x20orders')):d['push']('Merchant\x20history\x20'+a['merchant_order_history_count']+'\x20orders\x20<\x20required\x20'+b['min_order_history']+'\x20orders');if(b['merchant_preference']!=='neutral'){if(a['merchant_age']===b['merchant_preference'])f+=0x3,c['push']('Merchant\x20type\x20'+a['merchant_age']+'\x20matches\x20preference');else a['merchant_age']!=='unknown'&&d['push']('Merchant\x20type\x20'+a['merchant_age']+'\x20≠\x20preference\x20'+b['merchant_preference']);}else f+=0x3;g+=0xf;let i=0x0;a['has_reward_activity']&&(i+=0x8,c['push']('Has\x20Reward\x20activity'));a['has_discount']&&(i+=0x7,c['push']('Has\x20discount'));if(b['bargain_hunting']>=0.7&&i===0x0)d['push']('User\x20has\x20high\x20bargain_hunting\x20but\x20no\x20Reward/discount');else{if(b['bargain_hunting']<0.3){if(i===0x0)i=0xa;else i=Math['min'](i,0x5);}else b['bargain_hunting']<0.7&&i===0x0&&(i=0x5);}f+=i,g+=0xa;if(a['after_sales_support_level']===b['after_sales_expectation'])f+=0x5,c['push']('After-sales\x20support\x20'+a['after_sales_support_level']+'\x20matches\x20expectation');else b['after_sales_expectation']==='full'&&a['after_sales_support_level']==='basic'||b['after_sales_expectation']==='full'&&a['after_sales_support_level']==='minimal'||b['after_sales_expectation']==='basic'&&a['after_sales_support_level']==='minimal'?d['push']('After-sales\x20support\x20'+a['after_sales_support_level']+'\x20<\x20expectation\x20'+b['after_sales_expectation']):f+=0x3;if(b['transparency_demand']>=0.7&&a['requires_messenger'])f+=0x5,c['push']('Merchant\x20supports\x20Messenger\x20communication\x20(high\x20transparency\x20demand)');else b['transparency_demand']>=0.7&&!a['requires_messenger']?d['push']('High\x20transparency\x20demand\x20but\x20merchant\x20has\x20no\x20Messenger'):f+=0x3;g+=0xf;a['risk_score']>=b['min_trust_score']?(f+=0x8,c['push']('Risk\x20score\x20'+a['risk_score']+'\x20≥\x20required\x20'+b['min_trust_score'])):d['push']('Risk\x20score\x20'+a['risk_score']+'\x20<\x20required\x20'+b['min_trust_score']);b['require_arbitration']?a['has_arbitration']?(f+=0x4,c['push']('Arbitration\x20configured')):(d['push']('User\x20requires\x20arbitration\x20but\x20Service\x20is\x20not\x20configured'),e['push']('⚠️\x20No\x20arbitration:\x20user\x20preference\x20requires\x20arbitration\x20as\x20mandatory')):f+=0x4;b['require_compensation_fund']?a['has_compensation_fund']?(f+=0x3,c['push']('Has\x20compensation\x20fund')):(d['push']('User\x20requires\x20compensation\x20fund\x20but\x20Service\x20has\x20none'),e['push']('⚠️\x20No\x20compensation\x20fund:\x20user\x20preference\x20requires\x20it\x20as\x20mandatory')):f+=0x3;const j=g>0x0?Math['round'](f/g*0x64):0x0;return{'score':j,'matches':c,'mismatches':d,'warnings':e};}export function mergePreferences(a,b){return{...a,...b};}export function validatePreferences(a){const b=[];return a['budget_range']&&a['budget_range']['min']>a['budget_range']['max']&&b['push']('budget_range.min\x20>\x20budget_range.max'),(a['discount_sensitivity']<0x0||a['discount_sensitivity']>0x1)&&b['push']('discount_sensitivity\x20must\x20be\x20in\x20[0,1]'),(a['bargain_hunting']<0x0||a['bargain_hunting']>0x1)&&b['push']('bargain_hunting\x20must\x20be\x20in\x20[0,1]'),(a['transparency_demand']<0x0||a['transparency_demand']>0x1)&&b['push']('transparency_demand\x20must\x20be\x20in\x20[0,1]'),(a['min_trust_score']<0x0||a['min_trust_score']>0x64)&&b['push']('min_trust_score\x20must\x20be\x20in\x20[0,100]'),a['max_acceptable_cycle']<0x0&&b['push']('max_acceptable_cycle\x20must\x20be\x20≥\x200'),a['response_time_expectation']<0x0&&b['push']('response_time_expectation\x20must\x20be\x20≥\x200'),b;}export{CUSTOMER_INTELLIGENCE_VERSION};
|
|
1
|
+
import{CUSTOMER_INTELLIGENCE_VERSION}from'./types.js';export const SUPPORTED_INDUSTRIES=['freelance','rental','education','travel','subscription','retail'];const INDUSTRY_TEMPLATES={'freelance':{'max_acceptable_cycle':0x1e,'response_time_expectation':0x4,'require_arbitration':!![],'require_compensation_fund':!![],'risk_appetite':'balanced','delivery_speed_priority':'normal','after_sales_expectation':'full'},'rental':{'max_acceptable_cycle':0x7,'response_time_expectation':0x8,'require_arbitration':!![],'require_compensation_fund':!![],'risk_appetite':'conservative','delivery_speed_priority':'normal','after_sales_expectation':'full'},'education':{'max_acceptable_cycle':0x5a,'response_time_expectation':0x18,'require_arbitration':!![],'require_compensation_fund':!![],'risk_appetite':'conservative','delivery_speed_priority':'flexible','after_sales_expectation':'full'},'travel':{'max_acceptable_cycle':0xe,'response_time_expectation':0x2,'require_arbitration':!![],'require_compensation_fund':!![],'risk_appetite':'conservative','delivery_speed_priority':'urgent','after_sales_expectation':'full'},'subscription':{'max_acceptable_cycle':0x1e,'response_time_expectation':0x18,'require_arbitration':![],'require_compensation_fund':![],'risk_appetite':'aggressive','delivery_speed_priority':'normal','after_sales_expectation':'basic'},'retail':{'max_acceptable_cycle':0x7,'response_time_expectation':0x8,'require_arbitration':!![],'require_compensation_fund':!![],'risk_appetite':'balanced','delivery_speed_priority':'normal','after_sales_expectation':'full'}},BASE_DEFAULTS={'price_sensitivity':'medium','value_orientation':'balanced','discount_sensitivity':0.3,'delivery_speed_priority':'normal','max_acceptable_cycle':0xe,'response_time_expectation':0x8,'merchant_preference':'neutral','min_order_history':0x3,'bargain_hunting':0.3,'reward_seeking':![],'referral_participation':![],'communication_style':'friendly','transparency_demand':0.5,'after_sales_expectation':'basic','risk_appetite':'balanced','min_trust_score':0x32,'require_arbitration':!![],'require_compensation_fund':!![],'preferred_industries':[],'preferred_tokens':['0x2::wow::WOW'],'preferred_merchants':[]};export function getDefaultPreferences(a){if(!a||!INDUSTRY_TEMPLATES[a])return{...BASE_DEFAULTS};const b=INDUSTRY_TEMPLATES[a];return{...BASE_DEFAULTS,'max_acceptable_cycle':b['max_acceptable_cycle'],'response_time_expectation':b['response_time_expectation'],'require_arbitration':b['require_arbitration'],'require_compensation_fund':b['require_compensation_fund'],'risk_appetite':b['risk_appetite'],'delivery_speed_priority':b['delivery_speed_priority'],'after_sales_expectation':b['after_sales_expectation']};}let _registryLookup=null;export function _setRegistryLookup(a){_registryLookup=a;}export function getIndustryTemplate(a){if(_registryLookup){const b=_registryLookup(a);if(b?.['preference_template'])return{...b['preference_template']};}return{...INDUSTRY_TEMPLATES[a]};}export function mergePreferences(a,b){return{...a,...b};}export function validatePreferences(a){const b=[];return a['budget_range']&&a['budget_range']['min']>a['budget_range']['max']&&b['push']('budget_range.min\x20>\x20budget_range.max'),(a['discount_sensitivity']<0x0||a['discount_sensitivity']>0x1)&&b['push']('discount_sensitivity\x20must\x20be\x20in\x20[0,1]'),(a['bargain_hunting']<0x0||a['bargain_hunting']>0x1)&&b['push']('bargain_hunting\x20must\x20be\x20in\x20[0,1]'),(a['transparency_demand']<0x0||a['transparency_demand']>0x1)&&b['push']('transparency_demand\x20must\x20be\x20in\x20[0,1]'),(a['min_trust_score']<0x0||a['min_trust_score']>0x64)&&b['push']('min_trust_score\x20must\x20be\x20in\x20[0,100]'),a['max_acceptable_cycle']<0x0&&b['push']('max_acceptable_cycle\x20must\x20be\x20≥\x200'),a['response_time_expectation']<0x0&&b['push']('response_time_expectation\x20must\x20be\x20≥\x200'),b;}export{CUSTOMER_INTELLIGENCE_VERSION};
|
|
@@ -15,6 +15,7 @@ export declare function summarizeAcceptance(records: PresenterAcceptanceRecord[]
|
|
|
15
15
|
export declare function presenterHistoryFromEntities(entities: Record<string, unknown>): PresenterAcceptanceRecord[];
|
|
16
16
|
export interface AcceptanceRuleOptions {
|
|
17
17
|
weight: number;
|
|
18
|
+
weightOf?: () => number;
|
|
18
19
|
dimension?: string;
|
|
19
20
|
redFlag?: {
|
|
20
21
|
below: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export const PRESENTER_HISTORY_KEY='presenter_history';export function summarizeAcceptance(a){const b=a['map'](d=>d['acceptance_score'])['filter'](d=>typeof d==='number'&&Number['isFinite'](d))['map'](d=>Math['max'](0x0,Math['min'](0x64,d)));if(b['length']===0x0)return{'score':null,'rated':0x0,'total':a['length'],'average':null};const c=b['reduce']((d,e)=>d+e,0x0)/b['length'];return{'score':Math['round'](c),'rated':b['length'],'total':a['length'],'average':Math['round'](c*0x64)/0x64};}export function presenterHistoryFromEntities(a){const b=a[PRESENTER_HISTORY_KEY];if(!Array['isArray'](b))return[];return b['filter'](c=>typeof c==='object'&&c!==null&&c['acceptance_score']!==undefined);}export function createAcceptanceRule(a,b){return{'id':'acceptance','description':'Presenter\x20historical\x20acceptance\x20score\x20backflow\x20(demand-side\x20feedback)','dimension':b['dimension']??'acceptance','weight'
|
|
1
|
+
export const PRESENTER_HISTORY_KEY='presenter_history';export function summarizeAcceptance(a){const b=a['map'](d=>d['acceptance_score'])['filter'](d=>typeof d==='number'&&Number['isFinite'](d))['map'](d=>Math['max'](0x0,Math['min'](0x64,d)));if(b['length']===0x0)return{'score':null,'rated':0x0,'total':a['length'],'average':null};const c=b['reduce']((d,e)=>d+e,0x0)/b['length'];return{'score':Math['round'](c),'rated':b['length'],'total':a['length'],'average':Math['round'](c*0x64)/0x64};}export function presenterHistoryFromEntities(a){const b=a[PRESENTER_HISTORY_KEY];if(!Array['isArray'](b))return[];return b['filter'](c=>typeof c==='object'&&c!==null&&c['acceptance_score']!==undefined);}export function createAcceptanceRule(a,b){return{'id':'acceptance','description':'Presenter\x20historical\x20acceptance\x20score\x20backflow\x20(demand-side\x20feedback)','dimension':b['dimension']??'acceptance',get 'weight'(){return b['weightOf']?.()??b['weight'];},'evaluation_ids':[a],'evaluate':c=>{const d=b['weightOf']?.()??b['weight'],e=summarizeAcceptance(presenterHistoryFromEntities(c['entities']));if(e['score']===null)return{'score':0x32,'weight':d,'reason':e['total']>0x0?'acceptance:\x20'+e['total']+'\x20presentation(s),\x20none\x20rated\x20(neutral)':'acceptance:\x20no\x20history\x20(neutral)'};const f=b['redFlag']!==undefined&&e['rated']>=b['redFlag']['minRated']&&e['average']!==null&&e['average']<b['redFlag']['below'];return{'score':e['score'],'weight':d,'reason':'acceptance\x20avg\x20'+e['average']+'\x20over\x20'+e['rated']+'\x20rated\x20presentation(s)','red_flag':f||undefined};}};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{appetiteMultiplier}from'./game-strategy.js';
|
|
1
|
+
import{getJudgmentDoc}from'../config/judgment.js';import{appetiteMultiplier}from'./game-strategy.js';function arbParams(){return getJudgmentDoc()['game']['arb'];}const ARB_MOVE_SEMANTICS={'Principal_confirming':[{'action':'principal\x20confirm','perspective':'customer','gain':['case_advanced'],'risk':[],'payoff':'confirm\x20the\x20proposition\x20to\x20move\x20to\x20arbitrator\x20confirmation','base_risk':'low'},{'action':'proposition\x20update','perspective':'customer','gain':[],'risk':['case_extended'],'payoff':'modify\x20the\x20proposition\x20before\x20confirming\x20(extends\x20the\x20case)','base_risk':'medium'}],'Arbitrator_confirming':[{'action':'confirm','perspective':'arbitrator','gain':['case_advanced'],'risk':[],'payoff':'confirm\x20to\x20open\x20voting','base_risk':'low'},{'action':'reset','perspective':'arbitrator','gain':[],'risk':['case_extended'],'payoff':'reset\x20back\x20to\x20principal\x20confirmation\x20(extends\x20the\x20case)','base_risk':'high'}],'Voting':[{'action':'vote','perspective':'arbitrator','gain':['case_advanced'],'risk':[],'payoff':'vote\x20before\x20the\x20deadline','base_risk':'low'},{'action':'deadline\x20change','perspective':'arbitrator','gain':[],'risk':['case_extended'],'payoff':'adjust\x20or\x20clear\x20the\x20voting\x20window\x20(prolongs\x20or\x20reopens\x20the\x20case)','base_risk':'medium'}],'Arbitrated':[{'action':'objection','perspective':'customer','gain':['reversal_chance'],'risk':[],'payoff':'object\x20the\x20ruling\x20(only\x20window\x20to\x20overturn)','base_risk':'medium'},{'action':'accept','perspective':'customer','gain':['case_closed'],'risk':['adverse_ruling'],'payoff':'accept\x20and\x20await\x20compensation','base_risk':'low'},{'action':'arb_withdraw','perspective':'all','gain':['fees_received','case_closed'],'risk':[],'payoff':'withdraw\x20the\x20fee\x20balance\x2030\x20days\x20after\x20the\x20ruling\x20(closes\x20the\x20case)','base_risk':'low'}],'Objectionable':[{'action':'reset','perspective':'arbitrator','gain':['case_advanced'],'risk':['case_extended'],'payoff':'reset\x20to\x20re-review\x20(extends\x20the\x20case)','base_risk':'medium'},{'action':'arb_withdraw','perspective':'all','gain':['fees_received','case_closed'],'risk':[],'payoff':'withdraw\x20the\x20fee\x20balance\x2030\x20days\x20after\x20the\x20ruling\x20(closes\x20the\x20case)','base_risk':'low'}],'Finished':[{'action':'arb_withdraw','perspective':'all','gain':['fees_received','case_closed'],'risk':[],'payoff':'withdraw\x20fees\x20/\x20compensation','base_risk':'low'}],'Withdrawn':[{'action':'done','perspective':'all','gain':['case_closed'],'risk':[],'payoff':'case\x20closed','base_risk':'low'}]};function dedupe(a){return Array['from'](new Set(a));}function resolveArbInterests(a,b){const c=arbParams(),d=c['role_interests'][a]??{'prefer':[],'avoid':[],'sensitivity':0x1},e=d['sensitivity']*appetiteMultiplier(b?.['risk_appetite']),f=[...d['prefer']],g=[...d['avoid']];for(const h of b?.['requirements']??[]){const i=h['toLowerCase'](),j=new RegExp(c['forbid_pattern'],'i')['test'](i);for(const k of c['keyword_rules']){if(k['when_forbidden']!==j)continue;k['keywords']['some'](l=>i['includes'](l['toLowerCase']()))&&(k['anchor']==='prefer'?f:g)['push'](k['effect']);}}return{'prefer':dedupe(f),'avoid':dedupe(g),'sensitivity':e};}function scoreMove(a,b,c){const {scoring:d}=arbParams(),e=resolveArbInterests(b,c),f=a['gain']['filter'](k=>e['prefer']['includes'](k)),g=a['risk']['filter'](k=>e['avoid']['includes'](k)),h=f['length']*d['per_gain'],i=Math['round'](g['length']*d['per_risk']*e['sensitivity']),j=Math['max'](0x0,Math['min'](0x64,d['base']+h-i));return{'favorability':j,'gain_score':h,'risk_score':i};}export function evaluateArbGame(a,b,c){const d=ARB_MOVE_SEMANTICS[a]??[],e=d['filter'](g=>g['perspective']==='all'||g['perspective']===b),f=e['map'](g=>{const h=scoreMove(g,b,c);return{'action':g['action'],'favorability':h['favorability'],'gain_score':h['gain_score'],'risk_score':h['risk_score'],'is_optimal':![],'payoff_note':g['payoff'],'risk':g['base_risk']};})['sort']((g,h)=>h['favorability']-g['favorability']);return f['length']>0x0&&(f[0x0]['is_optimal']=!![]),{'status':a,'perspective':b,'actions':f,'summary':f['length']===0x0?'No\x20recommended\x20moves\x20for\x20'+b+'\x20in\x20status\x20\x27'+a+'\x27':'Optimal\x20for\x20'+b+'\x20in\x20\x27'+a+'\x27:\x20\x27'+f[0x0]['action']+'\x27\x20('+f[0x0]['payoff_note']+')'};}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{describe,expect,it}from'vitest';import{dirname,join}from'node:path';import{fileURLToPath}from'node:url';import{ENTRYPOINT}from'@wowok/wowok';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{RETENTION_RANK}from'../graph/onchain/analyze.js';import{EVALUATION_SERVICE_INTENTS,resolveExpansionStrategy,withEvaluationBundle}from'../graph/onchain/strategy.js';import{projectEvaluationFacts}from'../graph/onchain/facts.js';import{registerGraphServiceEvaluations}from'./builtins/graph-service.js';import{importSourcesOf,listRuntimeSources,namedSdkImportsOf,onchainIoCalls,SDK_CONSTANT_ALLOWLIST}from'./guard-scan.js';const EVAL_DIR=dirname(fileURLToPath(import.meta.url)),GRAPH_ONCHAIN_DIR=join(EVAL_DIR,'..','graph','onchain'),DATA_PLANE_IMPLS=new Set(['sdk-dataplane.ts','sdk-batch.ts']),CONFIDENCES=new Set(['exact','bounded','windowed','derived']);describe('Task\x2017\x20engine\x20purity\x20architecture\x20guard\x20(TR-17.1)',()=>{it('(a)\x20evaluation/\x20runtime\x20files:\x20relative\x20imports\x20only,\x20no\x20chain-IO\x20entry',async()=>{const a=await import('../playbooks/service-build/topology-query.js');expect(typeof a['evaluateServiceFromGraph'])['toBe']('function');const b=listRuntimeSources(EVAL_DIR);expect(b['length'])['toBeGreaterThan'](0x0);for(const {file:c,text:d}of b){for(const e of importSourcesOf(d)){if(e['startsWith']('.'))continue;if(e['startsWith']('node:'))continue;if(e==='@wowok/wowok'){const f=namedSdkImportsOf(d)['filter'](g=>!SDK_CONSTANT_ALLOWLIST['has'](g));expect(f,c+'\x20imports\x20non-constant\x20SDK\x20symbols:\x20'+f['join'](',\x20'))['toEqual']([]);continue;}throw new Error(c+'\x20imports\x20non-relative\x20module\x20\x22'+e+'\x22\x20—\x20evaluation\x20must\x20stay\x20pure');}expect(onchainIoCalls(d),c+'\x20performs\x20chain\x20IO')['toEqual']([]);}}),it('(b)\x20every\x20projected\x20Fact\x20carries\x20provenance\x20(path/retention/confidence)',async()=>{registerGraphServiceEvaluations();const a=withEvaluationBundle(resolveExpansionStrategy({'intents':[...EVALUATION_SERVICE_INTENTS]})),b=await expandTopology(new FakeDataPlane(fullServiceState()),{'network':ENTRYPOINT['Mainnet'],'seed':FULL['svc'],'budget':a['budget'],'edges':a['edges']}),c=buildViewport(b,FULL['svc'],'neutral'),d=projectEvaluationFacts(c,FULL['svc'],runAnalyzers(c));expect(d['facts']['length'])['toBeGreaterThan'](0x0);for(const e of d['facts']){const f=e['provenance'];expect(f,e['dimension']+'/'+e['key']+'\x20has\x20no\x20provenance')['toBeDefined'](),expect(Array['isArray'](f['path'])&&f['path']['length']>0x0,e['dimension']+'/'+e['key']+'\x20provenance.path\x20empty')['toBe'](!![]),expect(f['path']['every'](g=>typeof g==='string'&&g!==''),e['dimension']+'/'+e['key']+'\x20provenance.path\x20has\x20non-string\x20segments')['toBe'](!![]),expect(RETENTION_RANK[f['retention']],e['dimension']+'/'+e['key']+'\x20unknown\x20retention\x20'+f['retention'])['toBeDefined'](),expect(CONFIDENCES['has'](f['confidence']),e['dimension']+'/'+e['key']+'\x20unknown\x20confidence\x20'+f['confidence'])['toBe'](!![]);}for(const g of d['slots']){expect(typeof g['slot'])['toBe']('string'),expect(['present','empty','gap'])['toContain'](g['state']);}}),it('(c)\x20graph/onchain\x20chain\x20IO\x20lives\x20only\x20in\x20the\x20DataPlane\x20implementations',()=>{const a=listRuntimeSources(GRAPH_ONCHAIN_DIR);expect(a['length'])['toBeGreaterThan'](0x0);const b=a['filter'](({file:c,text:d})=>!DATA_PLANE_IMPLS['has'](c)&&onchainIoCalls(d)['length']>0x0)['map'](({file:c})=>c);expect(b,'evaluation\x20fetch\x20path\x20leaked\x20outside\x20the\x20DataPlane\x20implementations:\x20'+b['join'](',\x20'))['toEqual']([]);}),it('red-light:\x20the\x20scanners\x20flag\x20violation\x20samples',()=>{expect(onchainIoCalls('const\x20p\x20=\x20new\x20SdkDataPlane(net);\x20await\x20query_table({...});'))['toEqual'](expect['arrayContaining'](['SdkDataPlane\x20construction','SDK\x20query\x20call'])),expect(onchainIoCalls('const\x20names\x20=\x20await\x20LocalMark.Instance().get_many_address(x);'))['toEqual'](expect['arrayContaining'](['LocalMark\x20store\x20access'])),expect(namedSdkImportsOf('import\x20{\x20LocalMark\x20}\x20from\x20\x22@wowok/wowok\x22;'))['toEqual'](['LocalMark']),expect(onchainIoCalls('//\x20pulled\x20by\x20the\x20handler\x20via\x20query_arbs\x0aexport\x20const\x20K\x20=\x201;'))['toEqual']([]);});});
|