@dataparade/cli 0.0.11 → 0.0.13
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/package.json +5 -8
- package/dist/src/ai-enrichment/candidate-selector.d.ts +1 -1
- package/dist/src/ai-enrichment/fallbacks.d.ts +2 -2
- package/dist/src/ai-enrichment/fallbacks.js +97 -80
- package/dist/src/ai-enrichment/merge-rules.d.ts +2 -0
- package/dist/src/ai-enrichment/merge-rules.js +116 -4
- package/dist/src/ai-enrichment/non-pii-signal-rules.js +2 -6
- package/dist/src/ai-enrichment/openai-proposals-response.schema.d.ts +1 -1
- package/dist/src/ai-enrichment/pii-signal-rules.js +2 -6
- package/dist/src/ai-enrichment/prompts/provider-enrichment-prompts.d.ts +1 -1
- package/dist/src/ai-enrichment/prompts/provider-enrichment-prompts.js +1 -1
- package/dist/src/ai-enrichment/provider-prompt.d.ts +1 -1
- package/dist/src/ai-enrichment/provider-prompt.js +4 -0
- package/dist/src/ai-enrichment/provider-topology-rules.js +2 -6
- package/dist/src/ai-enrichment/providers/provider-contract.d.ts +6 -0
- package/dist/src/ai-enrichment/providers/provider-contract.js +62 -2
- package/dist/src/ai-enrichment/sensitive-paths.d.ts +1 -1
- package/dist/src/ai-enrichment/sensitive-paths.js +3 -3
- package/dist/src/ai-enrichment/third-party-data-flow.js +3 -3
- package/dist/src/ai-enrichment/third-party-subtype.js +2 -2
- package/dist/src/ai-enrichment/tools/index.d.ts +1 -1
- package/dist/src/ai-enrichment/types.d.ts +1 -1
- package/dist/src/cli.js +6 -5
- package/dist/src/config/file.d.ts +1 -1
- package/dist/src/config/file.js +21 -19
- package/dist/src/config/resolve.d.ts +1 -1
- package/dist/src/config/resolve.js +75 -68
- package/dist/src/core/pipeline/graph-mapping.d.ts +1 -6
- package/dist/src/core/pipeline/graph-mapping.js +3 -314
- package/dist/src/core/pipeline/orchestrator-result.d.ts +1 -6
- package/dist/src/core/pipeline/orchestrator.d.ts +2 -26
- package/dist/src/core/pipeline/orchestrator.js +4 -77
- package/dist/src/core/pipeline/scan-pipeline.d.ts +2 -1
- package/dist/src/core/pipeline/scan-pipeline.js +39 -97
- package/dist/src/core/schema/index.d.ts +2 -2
- package/dist/src/core/schema/index.js +4 -2
- package/dist/src/core/schema/scan-config.schema.d.ts +5 -3
- package/dist/src/core/schema/scan-config.schema.js +18 -16
- package/dist/src/core/schema/scan-result.schema.d.ts +2 -455
- package/dist/src/core/schema/scan-result.schema.js +12 -239
- package/dist/src/core/types/component.d.ts +1 -18
- package/dist/src/core/types/component.js +15 -0
- package/dist/src/core/types/config.d.ts +1 -64
- package/dist/src/core/types/config.js +15 -0
- package/dist/src/core/types/data-flow.d.ts +1 -24
- package/dist/src/core/types/data-flow.js +15 -0
- package/dist/src/core/types/detection.d.ts +1 -12
- package/dist/src/core/types/detection.js +15 -17
- package/dist/src/core/types/file.d.ts +1 -14
- package/dist/src/core/types/file.js +15 -0
- package/dist/src/core/types/index.d.ts +1 -7
- package/dist/src/core/types/index.js +1 -7
- package/dist/src/core/types/progress.d.ts +1 -9
- package/dist/src/core/types/progress.js +15 -0
- package/dist/src/core/types/result.d.ts +1 -140
- package/dist/src/core/types/result.js +15 -0
- package/dist/src/evals/run-model-matrix.js +2 -1
- package/dist/src/platform-api/estimate-scan-footprint.js +9 -10
- package/dist/src/scanner-package-root.d.ts +2 -0
- package/dist/src/scanner-package-root.js +12 -0
- package/dist/tests/cli/cli.spec.js +18 -15
- package/dist/tests/unit/ai-enrichment/merge-rules.spec.js +246 -0
- package/dist/tests/unit/ai-enrichment/provider-contract.spec.js +78 -0
- package/dist/tests/unit/ai-enrichment/provider-prompt.spec.js +2 -0
- package/dist/tests/unit/ai-enrichment/third-party-data-flow.spec.js +2 -2
- package/dist/tests/unit/cli/scan-command-ai-flags.spec.js +5 -3
- package/dist/tests/unit/cli/scan-command-e2e-monorepo-app-plus-terraform.spec.js +2 -2
- package/dist/tests/unit/cli/scan-command-e2e-ts-sentry-route-env.spec.js +2 -1
- package/dist/tests/unit/cli/scan-command-exit-code.spec.js +7 -5
- package/dist/tests/unit/core/cpp-dotnet-scan.spec.js +4 -3
- package/dist/tests/unit/core/go-scan.spec.js +7 -6
- package/dist/tests/unit/core/graph-mapping.spec.js +2 -1
- package/dist/tests/unit/core/invariant-tests-dedupe-determinism.spec.js +7 -6
- package/dist/tests/unit/core/jvm-scan.spec.js +6 -5
- package/dist/tests/unit/core/no-source-code-leakage.spec.js +2 -1
- package/dist/tests/unit/core/orchestrator.spec.js +21 -20
- package/dist/tests/unit/core/output-json.spec.js +3 -2
- package/dist/tests/unit/core/parsing-error-handling-nonfatal.spec.js +2 -1
- package/dist/tests/unit/core/scan-result-language-stats.spec.js +2 -1
- package/dist/tests/unit/core/terraform-json-overlay.spec.js +2 -1
- package/dist/tests/unit/publish-manifest.spec.js +3 -2
- package/package.json +5 -8
- package/dist/src/analyzers/cpp/cpp-detection-config.d.ts +0 -73
- package/dist/src/analyzers/cpp/cpp-detection-config.js +0 -137
- package/dist/src/analyzers/cpp/dependency-manifests.d.ts +0 -8
- package/dist/src/analyzers/cpp/dependency-manifests.js +0 -130
- package/dist/src/analyzers/cpp/detector.d.ts +0 -3
- package/dist/src/analyzers/cpp/detector.js +0 -21
- package/dist/src/analyzers/cpp/index.d.ts +0 -2
- package/dist/src/analyzers/cpp/index.js +0 -11
- package/dist/src/analyzers/cpp/manifest-parsers.d.ts +0 -13
- package/dist/src/analyzers/cpp/manifest-parsers.js +0 -104
- package/dist/src/analyzers/cpp/parser.d.ts +0 -35
- package/dist/src/analyzers/cpp/parser.js +0 -206
- package/dist/src/analyzers/cpp/patterns.d.ts +0 -3
- package/dist/src/analyzers/cpp/patterns.js +0 -37
- package/dist/src/analyzers/csharp/csharp-detection-config.d.ts +0 -100
- package/dist/src/analyzers/csharp/csharp-detection-config.js +0 -160
- package/dist/src/analyzers/csharp/dependency-manifests.d.ts +0 -13
- package/dist/src/analyzers/csharp/dependency-manifests.js +0 -184
- package/dist/src/analyzers/csharp/detector.d.ts +0 -3
- package/dist/src/analyzers/csharp/detector.js +0 -21
- package/dist/src/analyzers/csharp/index.d.ts +0 -2
- package/dist/src/analyzers/csharp/index.js +0 -11
- package/dist/src/analyzers/csharp/manifest-parsers.d.ts +0 -34
- package/dist/src/analyzers/csharp/manifest-parsers.js +0 -130
- package/dist/src/analyzers/csharp/parser.d.ts +0 -48
- package/dist/src/analyzers/csharp/parser.js +0 -277
- package/dist/src/analyzers/csharp/patterns.d.ts +0 -3
- package/dist/src/analyzers/csharp/patterns.js +0 -57
- package/dist/src/analyzers/go/dependency-manifests.d.ts +0 -10
- package/dist/src/analyzers/go/dependency-manifests.js +0 -117
- package/dist/src/analyzers/go/detector.d.ts +0 -3
- package/dist/src/analyzers/go/detector.js +0 -21
- package/dist/src/analyzers/go/go-detection-config.d.ts +0 -97
- package/dist/src/analyzers/go/go-detection-config.js +0 -164
- package/dist/src/analyzers/go/index.d.ts +0 -2
- package/dist/src/analyzers/go/index.js +0 -11
- package/dist/src/analyzers/go/manifest-parsers.d.ts +0 -20
- package/dist/src/analyzers/go/manifest-parsers.js +0 -104
- package/dist/src/analyzers/go/parser.d.ts +0 -40
- package/dist/src/analyzers/go/parser.js +0 -186
- package/dist/src/analyzers/go/patterns.d.ts +0 -3
- package/dist/src/analyzers/go/patterns.js +0 -50
- package/dist/src/analyzers/jvm/dependency-manifests.d.ts +0 -16
- package/dist/src/analyzers/jvm/dependency-manifests.js +0 -205
- package/dist/src/analyzers/jvm/detector.d.ts +0 -3
- package/dist/src/analyzers/jvm/detector.js +0 -21
- package/dist/src/analyzers/jvm/index.d.ts +0 -9
- package/dist/src/analyzers/jvm/index.js +0 -18
- package/dist/src/analyzers/jvm/jvm-detection-config.d.ts +0 -136
- package/dist/src/analyzers/jvm/jvm-detection-config.js +0 -195
- package/dist/src/analyzers/jvm/manifest-parsers.d.ts +0 -61
- package/dist/src/analyzers/jvm/manifest-parsers.js +0 -246
- package/dist/src/analyzers/jvm/parser.d.ts +0 -54
- package/dist/src/analyzers/jvm/parser.js +0 -419
- package/dist/src/analyzers/jvm/patterns.d.ts +0 -3
- package/dist/src/analyzers/jvm/patterns.js +0 -64
- package/dist/src/analyzers/python/dependency-manifests.d.ts +0 -8
- package/dist/src/analyzers/python/dependency-manifests.js +0 -131
- package/dist/src/analyzers/python/detector.d.ts +0 -3
- package/dist/src/analyzers/python/detector.js +0 -22
- package/dist/src/analyzers/python/index.d.ts +0 -2
- package/dist/src/analyzers/python/index.js +0 -11
- package/dist/src/analyzers/python/manifest-parsers.d.ts +0 -3
- package/dist/src/analyzers/python/manifest-parsers.js +0 -134
- package/dist/src/analyzers/python/parser.d.ts +0 -27
- package/dist/src/analyzers/python/parser.js +0 -194
- package/dist/src/analyzers/python/patterns.d.ts +0 -8
- package/dist/src/analyzers/python/patterns.js +0 -51
- package/dist/src/analyzers/python/python-detection-config.d.ts +0 -93
- package/dist/src/analyzers/python/python-detection-config.js +0 -168
- package/dist/src/analyzers/registry.d.ts +0 -13
- package/dist/src/analyzers/registry.js +0 -75
- package/dist/src/analyzers/shared/c-family-calls.d.ts +0 -26
- package/dist/src/analyzers/shared/c-family-calls.js +0 -118
- package/dist/src/analyzers/shared/manifest-budgets.d.ts +0 -19
- package/dist/src/analyzers/shared/manifest-budgets.js +0 -21
- package/dist/src/analyzers/shared/manifest-fs.d.ts +0 -13
- package/dist/src/analyzers/shared/manifest-fs.js +0 -138
- package/dist/src/analyzers/shared/property-inference.d.ts +0 -8
- package/dist/src/analyzers/shared/property-inference.js +0 -165
- package/dist/src/analyzers/shared/strip-comments.d.ts +0 -32
- package/dist/src/analyzers/shared/strip-comments.js +0 -167
- package/dist/src/analyzers/terraform/detector.d.ts +0 -10
- package/dist/src/analyzers/terraform/detector.js +0 -198
- package/dist/src/analyzers/terraform/index.d.ts +0 -2
- package/dist/src/analyzers/terraform/index.js +0 -13
- package/dist/src/analyzers/terraform/parser.d.ts +0 -29
- package/dist/src/analyzers/terraform/parser.js +0 -202
- package/dist/src/analyzers/terraform/terraform-detection-config.d.ts +0 -48
- package/dist/src/analyzers/terraform/terraform-detection-config.js +0 -218
- package/dist/src/analyzers/terraform/terraform-exec.d.ts +0 -11
- package/dist/src/analyzers/terraform/terraform-exec.js +0 -35
- package/dist/src/analyzers/terraform/terraform-module-manifest.d.ts +0 -19
- package/dist/src/analyzers/terraform/terraform-module-manifest.js +0 -75
- package/dist/src/analyzers/terraform/terraform-show-json.d.ts +0 -15
- package/dist/src/analyzers/terraform/terraform-show-json.js +0 -188
- package/dist/src/analyzers/terraform/terraform-utility-resource.d.ts +0 -12
- package/dist/src/analyzers/terraform/terraform-utility-resource.js +0 -30
- package/dist/src/analyzers/types.d.ts +0 -5
- package/dist/src/analyzers/types.js +0 -2
- package/dist/src/analyzers/typescript/actor-detection.d.ts +0 -4
- package/dist/src/analyzers/typescript/actor-detection.js +0 -15
- package/dist/src/analyzers/typescript/dependency-manifests.d.ts +0 -9
- package/dist/src/analyzers/typescript/dependency-manifests.js +0 -131
- package/dist/src/analyzers/typescript/detector.d.ts +0 -3
- package/dist/src/analyzers/typescript/detector.js +0 -23
- package/dist/src/analyzers/typescript/index.d.ts +0 -2
- package/dist/src/analyzers/typescript/index.js +0 -11
- package/dist/src/analyzers/typescript/manifest-parsers.d.ts +0 -1
- package/dist/src/analyzers/typescript/manifest-parsers.js +0 -30
- package/dist/src/analyzers/typescript/parser.d.ts +0 -44
- package/dist/src/analyzers/typescript/parser.js +0 -287
- package/dist/src/analyzers/typescript/third-party-detection.d.ts +0 -4
- package/dist/src/analyzers/typescript/third-party-detection.js +0 -16
- package/dist/src/analyzers/typescript/typescript-detection-config.d.ts +0 -105
- package/dist/src/analyzers/typescript/typescript-detection-config.js +0 -219
- package/dist/src/analyzers/typescript/typescript-detection.d.ts +0 -11
- package/dist/src/analyzers/typescript/typescript-detection.js +0 -55
- package/dist/src/classifier/application-injection.d.ts +0 -12
- package/dist/src/classifier/application-injection.js +0 -335
- package/dist/src/classifier/classify.d.ts +0 -3
- package/dist/src/classifier/classify.js +0 -15
- package/dist/src/classifier/component-factory.d.ts +0 -3
- package/dist/src/classifier/component-factory.js +0 -488
- package/dist/src/classifier/config.d.ts +0 -38
- package/dist/src/classifier/config.js +0 -260
- package/dist/src/classifier/enhance-defaults.d.ts +0 -28
- package/dist/src/classifier/enhance-defaults.js +0 -369
- package/dist/src/classifier/enhance.d.ts +0 -13
- package/dist/src/classifier/enhance.js +0 -295
- package/dist/src/classifier/external-url-third-party.d.ts +0 -26
- package/dist/src/classifier/external-url-third-party.js +0 -195
- package/dist/src/classifier/grouping.d.ts +0 -1
- package/dist/src/classifier/grouping.js +0 -2
- package/dist/src/classifier/main-application-selection.d.ts +0 -41
- package/dist/src/classifier/main-application-selection.js +0 -222
- package/dist/src/classifier/naming.d.ts +0 -4
- package/dist/src/classifier/naming.js +0 -78
- package/dist/src/classifier/postprocessing.d.ts +0 -12
- package/dist/src/classifier/postprocessing.js +0 -510
- package/dist/src/classifier/sectioning.d.ts +0 -5
- package/dist/src/classifier/sectioning.js +0 -60
- package/dist/src/classifier/terraform-provider-hub.d.ts +0 -6
- package/dist/src/classifier/terraform-provider-hub.js +0 -38
- package/dist/src/config/actor-detection-config.d.ts +0 -21
- package/dist/src/config/actor-detection-config.js +0 -97
- package/dist/src/config/property-detection-config.d.ts +0 -27
- package/dist/src/config/property-detection-config.js +0 -355
- package/dist/src/config/third-party-detection-config.d.ts +0 -25
- package/dist/src/config/third-party-detection-config.js +0 -97
- package/dist/src/core/pipeline/classifier-phase.d.ts +0 -7
- package/dist/src/core/pipeline/classifier-phase.js +0 -78
- package/dist/src/core/pipeline/dataflow-phase.d.ts +0 -7
- package/dist/src/core/pipeline/dataflow-phase.js +0 -10
- package/dist/src/core/pipeline/diagram-layout/app-section-layout.d.ts +0 -7
- package/dist/src/core/pipeline/diagram-layout/app-section-layout.js +0 -74
- package/dist/src/core/pipeline/diagram-layout/constants.d.ts +0 -11
- package/dist/src/core/pipeline/diagram-layout/constants.js +0 -14
- package/dist/src/core/pipeline/diagram-layout/edge-handles.d.ts +0 -3
- package/dist/src/core/pipeline/diagram-layout/edge-handles.js +0 -26
- package/dist/src/core/pipeline/diagram-layout/managed-provider-layout.d.ts +0 -3
- package/dist/src/core/pipeline/diagram-layout/managed-provider-layout.js +0 -40
- package/dist/src/core/pipeline/diagram-layout/minimal-terraform-layout.d.ts +0 -6
- package/dist/src/core/pipeline/diagram-layout/minimal-terraform-layout.js +0 -53
- package/dist/src/core/pipeline/diagram-layout/section-helpers.d.ts +0 -30
- package/dist/src/core/pipeline/diagram-layout/section-helpers.js +0 -62
- package/dist/src/core/pipeline/diagram-layout/terraform-lane-layout.d.ts +0 -3
- package/dist/src/core/pipeline/diagram-layout/terraform-lane-layout.js +0 -109
- package/dist/src/core/pipeline/diagram-layout/types.d.ts +0 -2
- package/dist/src/core/pipeline/diagram-layout/types.js +0 -2
- package/dist/src/core/pipeline/infer-data-flow-protocol.d.ts +0 -7
- package/dist/src/core/pipeline/infer-data-flow-protocol.js +0 -39
- package/dist/src/core/pipeline/mixed-app-terraform-scan.d.ts +0 -13
- package/dist/src/core/pipeline/mixed-app-terraform-scan.js +0 -81
- package/dist/src/core/pipeline/resolve-path-under-scan-root.d.ts +0 -7
- package/dist/src/core/pipeline/resolve-path-under-scan-root.js +0 -55
- package/dist/src/core/pipeline/sorting.d.ts +0 -3
- package/dist/src/core/pipeline/sorting.js +0 -48
- package/dist/src/core/pipeline/stable-component-ids.d.ts +0 -15
- package/dist/src/core/pipeline/stable-component-ids.js +0 -68
- package/dist/src/core/pipeline/structural-scan.d.ts +0 -19
- package/dist/src/core/pipeline/structural-scan.js +0 -427
- package/dist/src/core/pipeline/terraform-flow-utils.d.ts +0 -6
- package/dist/src/core/pipeline/terraform-flow-utils.js +0 -32
- package/dist/src/core/pipeline/terraform-minimal-services.d.ts +0 -31
- package/dist/src/core/pipeline/terraform-minimal-services.js +0 -225
- package/dist/src/core/sectioning/discover-service-sections.d.ts +0 -80
- package/dist/src/core/sectioning/discover-service-sections.js +0 -494
- package/dist/src/core/sectioning/section-runtime.d.ts +0 -21
- package/dist/src/core/sectioning/section-runtime.js +0 -148
- package/dist/src/core/terraform/component-predicates.d.ts +0 -13
- package/dist/src/core/terraform/component-predicates.js +0 -71
- package/dist/src/data-flow/application-hub.d.ts +0 -7
- package/dist/src/data-flow/application-hub.js +0 -88
- package/dist/src/data-flow/dedupe.d.ts +0 -7
- package/dist/src/data-flow/dedupe.js +0 -92
- package/dist/src/data-flow/detect.d.ts +0 -16
- package/dist/src/data-flow/detect.js +0 -203
- package/dist/src/data-flow/detector.d.ts +0 -15
- package/dist/src/data-flow/detector.js +0 -18
- package/dist/src/data-flow/drop-cross-section-flows.d.ts +0 -8
- package/dist/src/data-flow/drop-cross-section-flows.js +0 -32
- package/dist/src/data-flow/ensure-actor-flow.d.ts +0 -16
- package/dist/src/data-flow/ensure-actor-flow.js +0 -101
- package/dist/src/data-flow/ensure-manifest-declared-flows.d.ts +0 -14
- package/dist/src/data-flow/ensure-manifest-declared-flows.js +0 -76
- package/dist/src/data-flow/ensure-section-api-flows.d.ts +0 -6
- package/dist/src/data-flow/ensure-section-api-flows.js +0 -57
- package/dist/src/data-flow/flow-builder.d.ts +0 -5
- package/dist/src/data-flow/flow-builder.js +0 -80
- package/dist/src/data-flow/import-graph.d.ts +0 -10
- package/dist/src/data-flow/import-graph.js +0 -147
- package/dist/src/data-flow/index.d.ts +0 -8
- package/dist/src/data-flow/index.js +0 -20
- package/dist/src/data-flow/internal-fetch.d.ts +0 -8
- package/dist/src/data-flow/internal-fetch.js +0 -209
- package/dist/src/data-flow/postprocess.d.ts +0 -9
- package/dist/src/data-flow/postprocess.js +0 -63
- package/dist/src/data-flow/rewire.d.ts +0 -10
- package/dist/src/data-flow/rewire.js +0 -93
- package/dist/src/data-flow/source-attribution.d.ts +0 -8
- package/dist/src/data-flow/source-attribution.js +0 -131
- package/dist/src/data-flow/source-resolution.d.ts +0 -13
- package/dist/src/data-flow/source-resolution.js +0 -61
- package/dist/src/data-flow/target-matching.d.ts +0 -21
- package/dist/src/data-flow/target-matching.js +0 -253
- package/dist/src/data-flow/terraform-flows.d.ts +0 -32
- package/dist/src/data-flow/terraform-flows.js +0 -170
- package/dist/src/ingest/file-system.d.ts +0 -17
- package/dist/src/ingest/file-system.js +0 -266
- package/dist/src/ingest/gitignore.d.ts +0 -12
- package/dist/src/ingest/gitignore.js +0 -127
- package/dist/src/ingest/sensitive-paths.d.ts +0 -2
- package/dist/src/ingest/sensitive-paths.js +0 -8
- package/dist/src/patterns/config.d.ts +0 -30
- package/dist/src/patterns/config.js +0 -255
- package/dist/src/patterns/detectors/cpp.d.ts +0 -8
- package/dist/src/patterns/detectors/cpp.js +0 -243
- package/dist/src/patterns/detectors/csharp.d.ts +0 -9
- package/dist/src/patterns/detectors/csharp.js +0 -385
- package/dist/src/patterns/detectors/go.d.ts +0 -9
- package/dist/src/patterns/detectors/go.js +0 -298
- package/dist/src/patterns/detectors/helpers.d.ts +0 -22
- package/dist/src/patterns/detectors/helpers.js +0 -73
- package/dist/src/patterns/detectors/jvm.d.ts +0 -15
- package/dist/src/patterns/detectors/jvm.js +0 -537
- package/dist/src/patterns/detectors/python.d.ts +0 -9
- package/dist/src/patterns/detectors/python.js +0 -499
- package/dist/src/patterns/detectors/typescript.d.ts +0 -10
- package/dist/src/patterns/detectors/typescript.js +0 -480
- package/dist/src/patterns/engine.d.ts +0 -58
- package/dist/src/patterns/engine.js +0 -141
- package/dist/src/patterns/flow-source-patterns.d.ts +0 -6
- package/dist/src/patterns/flow-source-patterns.js +0 -39
- package/dist/src/patterns/frontend-frameworks.d.ts +0 -4
- package/dist/src/patterns/frontend-frameworks.js +0 -25
- package/dist/src/patterns/scan-exclusions.d.ts +0 -14
- package/dist/src/patterns/scan-exclusions.js +0 -96
- package/dist/tests/unit/analyzers/cpp/dependency-manifests.spec.d.ts +0 -1
- package/dist/tests/unit/analyzers/cpp/dependency-manifests.spec.js +0 -66
- package/dist/tests/unit/analyzers/cpp/parser.spec.d.ts +0 -1
- package/dist/tests/unit/analyzers/cpp/parser.spec.js +0 -80
- package/dist/tests/unit/analyzers/cpp/patterns.spec.d.ts +0 -1
- package/dist/tests/unit/analyzers/cpp/patterns.spec.js +0 -141
- package/dist/tests/unit/analyzers/csharp/dependency-manifests.spec.d.ts +0 -1
- package/dist/tests/unit/analyzers/csharp/dependency-manifests.spec.js +0 -75
- package/dist/tests/unit/analyzers/csharp/parser.spec.d.ts +0 -1
- package/dist/tests/unit/analyzers/csharp/parser.spec.js +0 -118
- package/dist/tests/unit/analyzers/csharp/patterns.spec.d.ts +0 -1
- package/dist/tests/unit/analyzers/csharp/patterns.spec.js +0 -210
- package/dist/tests/unit/analyzers/go/dependency-manifests.spec.d.ts +0 -1
- package/dist/tests/unit/analyzers/go/dependency-manifests.spec.js +0 -96
- package/dist/tests/unit/analyzers/go/parser.spec.d.ts +0 -1
- package/dist/tests/unit/analyzers/go/parser.spec.js +0 -110
- package/dist/tests/unit/analyzers/go/patterns.spec.d.ts +0 -1
- package/dist/tests/unit/analyzers/go/patterns.spec.js +0 -239
- package/dist/tests/unit/analyzers/jvm/dependency-manifests.spec.d.ts +0 -1
- package/dist/tests/unit/analyzers/jvm/dependency-manifests.spec.js +0 -179
- package/dist/tests/unit/analyzers/jvm/parser.spec.d.ts +0 -1
- package/dist/tests/unit/analyzers/jvm/parser.spec.js +0 -195
- package/dist/tests/unit/analyzers/jvm/patterns.spec.d.ts +0 -1
- package/dist/tests/unit/analyzers/jvm/patterns.spec.js +0 -284
- package/dist/tests/unit/analyzers/python/parser.spec.d.ts +0 -1
- package/dist/tests/unit/analyzers/python/parser.spec.js +0 -104
- package/dist/tests/unit/analyzers/python/patterns.spec.d.ts +0 -1
- package/dist/tests/unit/analyzers/python/patterns.spec.js +0 -458
- package/dist/tests/unit/analyzers/registry.spec.d.ts +0 -1
- package/dist/tests/unit/analyzers/registry.spec.js +0 -234
- package/dist/tests/unit/analyzers/terraform/classifier-subtype-parity.spec.d.ts +0 -1
- package/dist/tests/unit/analyzers/terraform/classifier-subtype-parity.spec.js +0 -87
- package/dist/tests/unit/analyzers/terraform/detector.spec.d.ts +0 -1
- package/dist/tests/unit/analyzers/terraform/detector.spec.js +0 -110
- package/dist/tests/unit/analyzers/terraform/generated-provider-hints.spec.d.ts +0 -1
- package/dist/tests/unit/analyzers/terraform/generated-provider-hints.spec.js +0 -53
- package/dist/tests/unit/analyzers/terraform/parser.spec.d.ts +0 -1
- package/dist/tests/unit/analyzers/terraform/parser.spec.js +0 -56
- package/dist/tests/unit/analyzers/terraform/terraform-module-manifest.spec.d.ts +0 -1
- package/dist/tests/unit/analyzers/terraform/terraform-module-manifest.spec.js +0 -63
- package/dist/tests/unit/analyzers/terraform/terraform-utility-resource.spec.d.ts +0 -1
- package/dist/tests/unit/analyzers/terraform/terraform-utility-resource.spec.js +0 -19
- package/dist/tests/unit/analyzers/terraform-exec.spec.d.ts +0 -1
- package/dist/tests/unit/analyzers/terraform-exec.spec.js +0 -27
- package/dist/tests/unit/analyzers/terraform-show-json.spec.d.ts +0 -1
- package/dist/tests/unit/analyzers/terraform-show-json.spec.js +0 -77
- package/dist/tests/unit/analyzers/typescript/dependency-manifests.spec.d.ts +0 -1
- package/dist/tests/unit/analyzers/typescript/dependency-manifests.spec.js +0 -61
- package/dist/tests/unit/analyzers/typescript/detector.spec.d.ts +0 -1
- package/dist/tests/unit/analyzers/typescript/detector.spec.js +0 -413
- package/dist/tests/unit/analyzers/typescript/external-apis-auth0.spec.d.ts +0 -1
- package/dist/tests/unit/analyzers/typescript/external-apis-auth0.spec.js +0 -49
- package/dist/tests/unit/analyzers/typescript/external-apis-sentry.spec.d.ts +0 -1
- package/dist/tests/unit/analyzers/typescript/external-apis-sentry.spec.js +0 -27
- package/dist/tests/unit/analyzers/typescript/fixture-integration.spec.d.ts +0 -1
- package/dist/tests/unit/analyzers/typescript/fixture-integration.spec.js +0 -64
- package/dist/tests/unit/analyzers/typescript/parser.spec.d.ts +0 -1
- package/dist/tests/unit/analyzers/typescript/parser.spec.js +0 -99
- package/dist/tests/unit/analyzers/typescript/pattern-config.spec.d.ts +0 -1
- package/dist/tests/unit/analyzers/typescript/pattern-config.spec.js +0 -24
- package/dist/tests/unit/analyzers/typescript/property-detection.spec.d.ts +0 -1
- package/dist/tests/unit/analyzers/typescript/property-detection.spec.js +0 -160
- package/dist/tests/unit/classifier/classify.spec.d.ts +0 -1
- package/dist/tests/unit/classifier/classify.spec.js +0 -1453
- package/dist/tests/unit/classifier/enhance.spec.d.ts +0 -1
- package/dist/tests/unit/classifier/enhance.spec.js +0 -400
- package/dist/tests/unit/classifier/external-url-third-party.spec.d.ts +0 -1
- package/dist/tests/unit/classifier/external-url-third-party.spec.js +0 -83
- package/dist/tests/unit/classifier/frontend-framework-grouping.spec.d.ts +0 -1
- package/dist/tests/unit/classifier/frontend-framework-grouping.spec.js +0 -44
- package/dist/tests/unit/classifier/terraform-grouping.spec.d.ts +0 -1
- package/dist/tests/unit/classifier/terraform-grouping.spec.js +0 -96
- package/dist/tests/unit/config/property-detection-config.spec.d.ts +0 -1
- package/dist/tests/unit/config/property-detection-config.spec.js +0 -38
- package/dist/tests/unit/core/classifier-phase-regressions.spec.d.ts +0 -1
- package/dist/tests/unit/core/classifier-phase-regressions.spec.js +0 -68
- package/dist/tests/unit/core/cpp-dotnet-sections.spec.d.ts +0 -1
- package/dist/tests/unit/core/cpp-dotnet-sections.spec.js +0 -46
- package/dist/tests/unit/core/dependency-manifest-performance-budgets.spec.d.ts +0 -1
- package/dist/tests/unit/core/dependency-manifest-performance-budgets.spec.js +0 -66
- package/dist/tests/unit/core/dependency-manifest-toggles-confidence.spec.d.ts +0 -1
- package/dist/tests/unit/core/dependency-manifest-toggles-confidence.spec.js +0 -132
- package/dist/tests/unit/core/discover-service-sections.spec.d.ts +0 -1
- package/dist/tests/unit/core/discover-service-sections.spec.js +0 -204
- package/dist/tests/unit/core/infer-data-flow-protocol.spec.d.ts +0 -1
- package/dist/tests/unit/core/infer-data-flow-protocol.spec.js +0 -37
- package/dist/tests/unit/core/manifest-package-hub.spec.d.ts +0 -1
- package/dist/tests/unit/core/manifest-package-hub.spec.js +0 -53
- package/dist/tests/unit/core/monorepo-package-sections.spec.d.ts +0 -1
- package/dist/tests/unit/core/monorepo-package-sections.spec.js +0 -121
- package/dist/tests/unit/core/resolve-path-under-scan-root.spec.d.ts +0 -1
- package/dist/tests/unit/core/resolve-path-under-scan-root.spec.js +0 -54
- package/dist/tests/unit/core/section-discovery-excludes.spec.d.ts +0 -1
- package/dist/tests/unit/core/section-discovery-excludes.spec.js +0 -49
- package/dist/tests/unit/core/section-runtime.spec.d.ts +0 -1
- package/dist/tests/unit/core/section-runtime.spec.js +0 -166
- package/dist/tests/unit/core/stable-component-ids.spec.d.ts +0 -1
- package/dist/tests/unit/core/stable-component-ids.spec.js +0 -112
- package/dist/tests/unit/core/structural-scan.spec.d.ts +0 -1
- package/dist/tests/unit/core/structural-scan.spec.js +0 -83
- package/dist/tests/unit/core/terraform-minimal-services.spec.d.ts +0 -1
- package/dist/tests/unit/core/terraform-minimal-services.spec.js +0 -378
- package/dist/tests/unit/data-flow/application-hub.spec.d.ts +0 -1
- package/dist/tests/unit/data-flow/application-hub.spec.js +0 -48
- package/dist/tests/unit/data-flow/cross-section-terraform-bridge.spec.d.ts +0 -1
- package/dist/tests/unit/data-flow/cross-section-terraform-bridge.spec.js +0 -95
- package/dist/tests/unit/data-flow/dedupe.spec.d.ts +0 -1
- package/dist/tests/unit/data-flow/dedupe.spec.js +0 -134
- package/dist/tests/unit/data-flow/detector.spec.d.ts +0 -1
- package/dist/tests/unit/data-flow/detector.spec.js +0 -1254
- package/dist/tests/unit/data-flow/drop-cross-section-flows.spec.d.ts +0 -1
- package/dist/tests/unit/data-flow/drop-cross-section-flows.spec.js +0 -132
- package/dist/tests/unit/data-flow/ensure-actor-flow.spec.d.ts +0 -1
- package/dist/tests/unit/data-flow/ensure-actor-flow.spec.js +0 -233
- package/dist/tests/unit/data-flow/ensure-manifest-declared-flows.spec.d.ts +0 -1
- package/dist/tests/unit/data-flow/ensure-manifest-declared-flows.spec.js +0 -125
- package/dist/tests/unit/data-flow/ensure-section-api-flows.spec.d.ts +0 -1
- package/dist/tests/unit/data-flow/ensure-section-api-flows.spec.js +0 -40
- package/dist/tests/unit/data-flow/postprocess.spec.d.ts +0 -1
- package/dist/tests/unit/data-flow/postprocess.spec.js +0 -78
- package/dist/tests/unit/data-flow/rewire.spec.d.ts +0 -1
- package/dist/tests/unit/data-flow/rewire.spec.js +0 -194
- package/dist/tests/unit/data-flow/terraform-flows.spec.d.ts +0 -1
- package/dist/tests/unit/data-flow/terraform-flows.spec.js +0 -199
- package/dist/tests/unit/ingest/cpp-dotnet-languages.spec.d.ts +0 -1
- package/dist/tests/unit/ingest/cpp-dotnet-languages.spec.js +0 -56
- package/dist/tests/unit/ingest/env-exclusion.spec.d.ts +0 -1
- package/dist/tests/unit/ingest/env-exclusion.spec.js +0 -43
- package/dist/tests/unit/ingest/file-system.spec.d.ts +0 -1
- package/dist/tests/unit/ingest/file-system.spec.js +0 -180
- package/dist/tests/unit/ingest/gitignore.spec.d.ts +0 -1
- package/dist/tests/unit/ingest/gitignore.spec.js +0 -30
- package/dist/tests/unit/ingest/jvm-languages.spec.d.ts +0 -1
- package/dist/tests/unit/ingest/jvm-languages.spec.js +0 -47
- package/dist/tests/unit/patterns/scan-exclusions.spec.d.ts +0 -1
- package/dist/tests/unit/patterns/scan-exclusions.spec.js +0 -58
- package/patterns/README.md +0 -322
- package/patterns/actor.patterns.yaml +0 -51
- package/patterns/aws-terraform-catalog.snapshot.json +0 -1760
- package/patterns/aws-terraform-service-hints.generated.json +0 -1446
- package/patterns/azure-terraform-catalog.snapshot.json +0 -1195
- package/patterns/azure-terraform-service-hints.generated.json +0 -864
- package/patterns/classifier/actors.classifier.yaml +0 -17
- package/patterns/classifier/components.classifier.yaml +0 -110
- package/patterns/classifier/third-party.classifier.yaml +0 -169
- package/patterns/cpp.md +0 -176
- package/patterns/cpp.patterns.yaml +0 -314
- package/patterns/csharp.md +0 -211
- package/patterns/csharp.patterns.yaml +0 -375
- package/patterns/go.md +0 -211
- package/patterns/go.patterns.yaml +0 -429
- package/patterns/jvm.md +0 -160
- package/patterns/jvm.patterns.yaml +0 -884
- package/patterns/kubernetes-terraform-catalog.snapshot.json +0 -94
- package/patterns/kubernetes-terraform-service-hints.generated.json +0 -258
- package/patterns/non-pii-signals.rules.yaml +0 -84
- package/patterns/pii-signals.rules.yaml +0 -115
- package/patterns/property.patterns.yaml +0 -431
- package/patterns/provider-topology.rules.yaml +0 -765
- package/patterns/python.md +0 -211
- package/patterns/python.patterns.yaml +0 -337
- package/patterns/terraform.md +0 -37
- package/patterns/terraform.patterns.yaml +0 -495
- package/patterns/third-party.patterns.yaml +0 -172
- package/patterns/typescript.patterns.yaml +0 -361
|
@@ -1,140 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import type { DetectedDataFlow } from "./data-flow";
|
|
3
|
-
export interface LanguageParserStats {
|
|
4
|
-
language: string;
|
|
5
|
-
filesParsed: number;
|
|
6
|
-
functionsIndexed: number;
|
|
7
|
-
moduleLevelCallsIndexed: number;
|
|
8
|
-
warnings: string[];
|
|
9
|
-
}
|
|
10
|
-
export type ThirdPartyDataDirection = "outbound_to_third_party" | "inbound_from_third_party" | "bidirectional" | "unknown";
|
|
11
|
-
export type ThirdPartyDataCategory = "credentials" | "auth_artifacts" | "identifiers" | "content_files" | "telemetry" | "financial" | "health" | "profile_data" | "usage_metadata" | "unknown";
|
|
12
|
-
export interface ThirdPartyDataFlowEvidenceRef {
|
|
13
|
-
filePath: string;
|
|
14
|
-
startLine: number;
|
|
15
|
-
endLine: number;
|
|
16
|
-
reason: string;
|
|
17
|
-
}
|
|
18
|
-
export interface ThirdPartyDataFlowElement {
|
|
19
|
-
category: ThirdPartyDataCategory;
|
|
20
|
-
labels: string[];
|
|
21
|
-
}
|
|
22
|
-
export interface ThirdPartyDataFlowEntry {
|
|
23
|
-
componentId: string;
|
|
24
|
-
componentName: string;
|
|
25
|
-
service?: string;
|
|
26
|
-
capabilities: string[];
|
|
27
|
-
direction: ThirdPartyDataDirection;
|
|
28
|
-
dataShared: ThirdPartyDataFlowElement[];
|
|
29
|
-
confidence: number;
|
|
30
|
-
confidenceBand: "high" | "medium" | "low";
|
|
31
|
-
source: "provider" | "heuristic" | "provider_plus_heuristic";
|
|
32
|
-
notes?: string[];
|
|
33
|
-
evidence: ThirdPartyDataFlowEvidenceRef[];
|
|
34
|
-
}
|
|
35
|
-
export interface ThirdPartyDataFlowSummary {
|
|
36
|
-
entries: ThirdPartyDataFlowEntry[];
|
|
37
|
-
totals: {
|
|
38
|
-
thirdPartiesAnalyzed: number;
|
|
39
|
-
withDataShared: number;
|
|
40
|
-
};
|
|
41
|
-
}
|
|
42
|
-
/** Local heuristic enrichment (not counted as platform AI tokens). */
|
|
43
|
-
export interface StructuralEnrichmentSummary {
|
|
44
|
-
ran: true;
|
|
45
|
-
proposalsGenerated: number;
|
|
46
|
-
proposalsApplied: number;
|
|
47
|
-
proposalsRejected: number;
|
|
48
|
-
}
|
|
49
|
-
/** Populated when LLM inference ran for this scan. */
|
|
50
|
-
export interface AiInferenceSummary {
|
|
51
|
-
ran: true;
|
|
52
|
-
/** Candidates passed to the inference planner (before per-agent caps). */
|
|
53
|
-
candidatesConsidered: number;
|
|
54
|
-
/** Proposals produced (heuristic agents + provider); merge may reject many. */
|
|
55
|
-
proposalsGenerated: number;
|
|
56
|
-
proposalsApplied: number;
|
|
57
|
-
proposalsRejected: number;
|
|
58
|
-
/** Built-in rules inside the inference step (often duplicate pattern-detection fields). */
|
|
59
|
-
proposalsGeneratedHeuristic: number;
|
|
60
|
-
proposalsAppliedHeuristic: number;
|
|
61
|
-
/** Cloud model output (`provider_*` ids). */
|
|
62
|
-
proposalsGeneratedProvider: number;
|
|
63
|
-
proposalsAppliedProvider: number;
|
|
64
|
-
providerCalls: number;
|
|
65
|
-
inputTokens: number;
|
|
66
|
-
outputTokens: number;
|
|
67
|
-
totalTokens: number;
|
|
68
|
-
estimatedCostUsd?: number;
|
|
69
|
-
aiProvider: string;
|
|
70
|
-
aiModel: string;
|
|
71
|
-
thirdPartyPropertyCoverage?: {
|
|
72
|
-
autofilled: Record<string, number>;
|
|
73
|
-
suggested: Record<string, number>;
|
|
74
|
-
unknown: Record<string, number>;
|
|
75
|
-
};
|
|
76
|
-
thirdPartyDataFlow?: ThirdPartyDataFlowSummary;
|
|
77
|
-
agenticTrace?: Array<{
|
|
78
|
-
candidateId: string;
|
|
79
|
-
componentId?: string;
|
|
80
|
-
filesReviewed: string[];
|
|
81
|
-
rounds: number;
|
|
82
|
-
finalProposalCount: number;
|
|
83
|
-
toolCalls: Array<{
|
|
84
|
-
round: number;
|
|
85
|
-
action: string;
|
|
86
|
-
detail: string;
|
|
87
|
-
filesTouched?: string[];
|
|
88
|
-
stats?: Record<string, number>;
|
|
89
|
-
}>;
|
|
90
|
-
}>;
|
|
91
|
-
}
|
|
92
|
-
export interface AiInferenceProposalDetail {
|
|
93
|
-
id: string;
|
|
94
|
-
source: "heuristic" | "provider";
|
|
95
|
-
status: "applied" | "rejected";
|
|
96
|
-
rejectionReason?: string;
|
|
97
|
-
kind: "component_patch" | "flow_patch";
|
|
98
|
-
candidateType: string;
|
|
99
|
-
agent: string;
|
|
100
|
-
provider: string;
|
|
101
|
-
model: string;
|
|
102
|
-
confidence: number;
|
|
103
|
-
confidenceBand: "high" | "medium" | "low";
|
|
104
|
-
targetComponentId?: string;
|
|
105
|
-
targetFlowId?: string;
|
|
106
|
-
sourceComponentId?: string;
|
|
107
|
-
targetFlowComponentId?: string;
|
|
108
|
-
evidence: Array<{
|
|
109
|
-
filePath: string;
|
|
110
|
-
startLine: number;
|
|
111
|
-
endLine: number;
|
|
112
|
-
reason: string;
|
|
113
|
-
}>;
|
|
114
|
-
propertyChanges?: Array<{
|
|
115
|
-
key: string;
|
|
116
|
-
from: unknown;
|
|
117
|
-
to: unknown;
|
|
118
|
-
}>;
|
|
119
|
-
}
|
|
120
|
-
export interface TerraformScanSummary {
|
|
121
|
-
mode: "static_tf" | "json_overlay" | "json_only";
|
|
122
|
-
staticTfFiles: number;
|
|
123
|
-
jsonInputPath?: string;
|
|
124
|
-
jsonFindingsMerged: number;
|
|
125
|
-
}
|
|
126
|
-
export interface ScanResult {
|
|
127
|
-
components: DetectedComponent[];
|
|
128
|
-
dataFlows: DetectedDataFlow[];
|
|
129
|
-
filesScanned: number;
|
|
130
|
-
filesSkipped: number;
|
|
131
|
-
totalLines: number;
|
|
132
|
-
scanDurationMs: number;
|
|
133
|
-
warnings: string[];
|
|
134
|
-
errors: string[];
|
|
135
|
-
languageStats?: LanguageParserStats[];
|
|
136
|
-
structuralEnrichmentSummary?: StructuralEnrichmentSummary;
|
|
137
|
-
aiInferenceSummary?: AiInferenceSummary;
|
|
138
|
-
aiInferenceProposalDetails?: AiInferenceProposalDetail[];
|
|
139
|
-
terraformScanSummary?: TerraformScanSummary;
|
|
140
|
-
}
|
|
1
|
+
export * from "@dataparade/scanner";
|
|
@@ -1,2 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
2
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("@dataparade/scanner"), exports);
|
|
@@ -7,6 +7,7 @@ const node_fs_1 = __importDefault(require("node:fs"));
|
|
|
7
7
|
const node_path_1 = __importDefault(require("node:path"));
|
|
8
8
|
require("../config/load-cli-env");
|
|
9
9
|
const orchestrator_1 = require("../core/pipeline/orchestrator");
|
|
10
|
+
const scan_pipeline_1 = require("../core/pipeline/scan-pipeline");
|
|
10
11
|
const metrics_1 = require("./metrics");
|
|
11
12
|
function parseArg(flag) {
|
|
12
13
|
const idx = process.argv.indexOf(flag);
|
|
@@ -31,7 +32,7 @@ async function run() {
|
|
|
31
32
|
aiProvider: provider,
|
|
32
33
|
aiModel: model,
|
|
33
34
|
});
|
|
34
|
-
const result = await (0,
|
|
35
|
+
const result = await (0, scan_pipeline_1.runScanPipeline)(node_path_1.default.resolve(process.cwd(), fixturePath), config);
|
|
35
36
|
report.push({
|
|
36
37
|
model,
|
|
37
38
|
provider,
|
|
@@ -36,14 +36,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
36
36
|
exports.estimateScanFootprint = estimateScanFootprint;
|
|
37
37
|
const fs_1 = require("fs");
|
|
38
38
|
const path = __importStar(require("path"));
|
|
39
|
-
const
|
|
40
|
-
const scan_exclusions_1 = require("../patterns/scan-exclusions");
|
|
39
|
+
const scanner_1 = require("@dataparade/scanner");
|
|
41
40
|
const MAX_FILES_TO_MEASURE = 50_000;
|
|
42
41
|
function normalizeUserPattern(pattern) {
|
|
43
|
-
return (0,
|
|
42
|
+
return (0, scanner_1.toPosixPath)(pattern.replace(/^\.\/+/, "").trim());
|
|
44
43
|
}
|
|
45
44
|
function isExcludedByUserPatterns(relativePath, isDirectory, excludePaths) {
|
|
46
|
-
const rel = (0,
|
|
45
|
+
const rel = (0, scanner_1.toPosixPath)(relativePath);
|
|
47
46
|
for (const rawPattern of excludePaths) {
|
|
48
47
|
const pattern = normalizeUserPattern(rawPattern);
|
|
49
48
|
if (!pattern)
|
|
@@ -53,7 +52,7 @@ function isExcludedByUserPatterns(relativePath, isDirectory, excludePaths) {
|
|
|
53
52
|
if (rel === prefix || rel.startsWith(`${prefix}/`))
|
|
54
53
|
return true;
|
|
55
54
|
}
|
|
56
|
-
const regex = (0,
|
|
55
|
+
const regex = (0, scanner_1.gitignorePatternToRegex)(pattern, isDirectory);
|
|
57
56
|
if (regex.test(rel))
|
|
58
57
|
return true;
|
|
59
58
|
}
|
|
@@ -62,7 +61,7 @@ function isExcludedByUserPatterns(relativePath, isDirectory, excludePaths) {
|
|
|
62
61
|
async function walkFootprint(currentDir, rootDir, accumulatedRules, excludePaths, state) {
|
|
63
62
|
if (state.capped)
|
|
64
63
|
return;
|
|
65
|
-
const rules = await (0,
|
|
64
|
+
const rules = await (0, scanner_1.gitignoreRulesForDir)(currentDir, accumulatedRules);
|
|
66
65
|
let entries;
|
|
67
66
|
try {
|
|
68
67
|
entries = await fs_1.promises.readdir(currentDir, { withFileTypes: true });
|
|
@@ -74,15 +73,15 @@ async function walkFootprint(currentDir, rootDir, accumulatedRules, excludePaths
|
|
|
74
73
|
if (state.capped)
|
|
75
74
|
return;
|
|
76
75
|
const entryPath = path.join(currentDir, entry.name);
|
|
77
|
-
const relativePath = (0,
|
|
76
|
+
const relativePath = (0, scanner_1.toPosixPath)(path.relative(rootDir, entryPath));
|
|
78
77
|
if (entry.isDirectory()) {
|
|
79
|
-
if ((0,
|
|
78
|
+
if ((0, scanner_1.shouldSkipDirectoryName)(entry.name))
|
|
80
79
|
continue;
|
|
81
80
|
if (relativePath &&
|
|
82
81
|
isExcludedByUserPatterns(relativePath, true, excludePaths)) {
|
|
83
82
|
continue;
|
|
84
83
|
}
|
|
85
|
-
if ((0,
|
|
84
|
+
if ((0, scanner_1.isPathIgnored)(entryPath, true, rules))
|
|
86
85
|
continue;
|
|
87
86
|
await walkFootprint(entryPath, rootDir, rules, excludePaths, state);
|
|
88
87
|
}
|
|
@@ -91,7 +90,7 @@ async function walkFootprint(currentDir, rootDir, accumulatedRules, excludePaths
|
|
|
91
90
|
isExcludedByUserPatterns(relativePath, false, excludePaths)) {
|
|
92
91
|
continue;
|
|
93
92
|
}
|
|
94
|
-
if ((0,
|
|
93
|
+
if ((0, scanner_1.isPathIgnored)(entryPath, false, rules))
|
|
95
94
|
continue;
|
|
96
95
|
try {
|
|
97
96
|
const stat = await fs_1.promises.stat(entryPath);
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.getScannerPackageRoot = getScannerPackageRoot;
|
|
7
|
+
const path_1 = __importDefault(require("path"));
|
|
8
|
+
/** Absolute path to the installed `@dataparade/scanner` package root. */
|
|
9
|
+
function getScannerPackageRoot() {
|
|
10
|
+
const scannerMain = require.resolve("@dataparade/scanner");
|
|
11
|
+
return path_1.default.join(path_1.default.dirname(scannerMain), "..", "..");
|
|
12
|
+
}
|
|
@@ -7,6 +7,8 @@ const child_process_1 = require("child_process");
|
|
|
7
7
|
const fs_1 = require("fs");
|
|
8
8
|
const path_1 = __importDefault(require("path"));
|
|
9
9
|
const cliDistPath = path_1.default.join(__dirname, "../../dist/bin/cli.js");
|
|
10
|
+
const cliCwd = path_1.default.join(__dirname, "../../");
|
|
11
|
+
const scanFixturePath = path_1.default.join(cliCwd, "tests/fixtures/typescript-basic");
|
|
10
12
|
describe("CLI", () => {
|
|
11
13
|
beforeAll(() => {
|
|
12
14
|
if (!(0, fs_1.existsSync)(cliDistPath)) {
|
|
@@ -14,12 +16,17 @@ describe("CLI", () => {
|
|
|
14
16
|
}
|
|
15
17
|
});
|
|
16
18
|
it("scan <path> writes a dataflow.json wrapper to the current directory and exits 0", () => {
|
|
17
|
-
const result = (0, child_process_1.spawnSync)("node", [
|
|
19
|
+
const result = (0, child_process_1.spawnSync)("node", [
|
|
20
|
+
cliDistPath,
|
|
21
|
+
"scan",
|
|
22
|
+
scanFixturePath,
|
|
23
|
+
"--no-ai-inference",
|
|
24
|
+
"--skip-auto-upload",
|
|
25
|
+
], {
|
|
18
26
|
encoding: "utf-8",
|
|
19
|
-
cwd:
|
|
27
|
+
cwd: cliCwd,
|
|
20
28
|
});
|
|
21
29
|
expect(result.status).toBe(0);
|
|
22
|
-
const cliCwd = path_1.default.join(__dirname, "../../");
|
|
23
30
|
const outputPath = path_1.default.join(cliCwd, "dataflow.json");
|
|
24
31
|
const exists = (0, fs_1.existsSync)(outputPath);
|
|
25
32
|
expect(exists).toBe(true);
|
|
@@ -30,13 +37,11 @@ describe("CLI", () => {
|
|
|
30
37
|
expect(Array.isArray(dataflow.graph.nodes)).toBe(true);
|
|
31
38
|
expect(Array.isArray(dataflow.graph.edges)).toBe(true);
|
|
32
39
|
});
|
|
33
|
-
it("scan
|
|
34
|
-
const cliCwd = path_1.default.join(__dirname, "../../");
|
|
35
|
-
const frontendPath = "../frontend";
|
|
40
|
+
it("scan fixture produces a dataflow.json wrapper with at least one node", () => {
|
|
36
41
|
const result = (0, child_process_1.spawnSync)("node", [
|
|
37
42
|
cliDistPath,
|
|
38
43
|
"scan",
|
|
39
|
-
|
|
44
|
+
scanFixturePath,
|
|
40
45
|
"--no-ai-inference",
|
|
41
46
|
"--skip-auto-upload",
|
|
42
47
|
], {
|
|
@@ -50,14 +55,12 @@ describe("CLI", () => {
|
|
|
50
55
|
expect(Array.isArray(dataflow.graph.nodes)).toBe(true);
|
|
51
56
|
expect(dataflow.graph.nodes.length).toBeGreaterThan(0);
|
|
52
57
|
});
|
|
53
|
-
it("scan
|
|
54
|
-
const
|
|
55
|
-
const frontendPath = "../frontend";
|
|
56
|
-
const outputFile = "scan-frontend-summary.json";
|
|
58
|
+
it("scan fixture --output writes a dataflow.json wrapper to the given file and prints a short message", () => {
|
|
59
|
+
const outputFile = "scan-fixture-summary.json";
|
|
57
60
|
const result = (0, child_process_1.spawnSync)("node", [
|
|
58
61
|
cliDistPath,
|
|
59
62
|
"scan",
|
|
60
|
-
|
|
63
|
+
scanFixturePath,
|
|
61
64
|
"--output",
|
|
62
65
|
outputFile,
|
|
63
66
|
"--no-ai-inference",
|
|
@@ -76,7 +79,7 @@ describe("CLI", () => {
|
|
|
76
79
|
it("unknown command shows usage and exits non-zero", () => {
|
|
77
80
|
const result = (0, child_process_1.spawnSync)("node", [cliDistPath, "unknowncommand"], {
|
|
78
81
|
encoding: "utf-8",
|
|
79
|
-
cwd:
|
|
82
|
+
cwd: cliCwd,
|
|
80
83
|
});
|
|
81
84
|
expect(result.status).not.toBe(0);
|
|
82
85
|
expect(result.stderr).toMatch(/Unknown command|error|usage|Usage/i);
|
|
@@ -84,7 +87,7 @@ describe("CLI", () => {
|
|
|
84
87
|
it("--help shows usage", () => {
|
|
85
88
|
const result = (0, child_process_1.spawnSync)("node", [cliDistPath, "--help"], {
|
|
86
89
|
encoding: "utf-8",
|
|
87
|
-
cwd:
|
|
90
|
+
cwd: cliCwd,
|
|
88
91
|
});
|
|
89
92
|
expect(result.status).toBe(0);
|
|
90
93
|
expect(result.stdout).toContain("dataparade");
|
|
@@ -93,7 +96,7 @@ describe("CLI", () => {
|
|
|
93
96
|
it("scan --help shows scan usage", () => {
|
|
94
97
|
const result = (0, child_process_1.spawnSync)("node", [cliDistPath, "scan", "--help"], {
|
|
95
98
|
encoding: "utf-8",
|
|
96
|
-
cwd:
|
|
99
|
+
cwd: cliCwd,
|
|
97
100
|
});
|
|
98
101
|
expect(result.status).toBe(0);
|
|
99
102
|
expect(result.stdout).toMatch(/scan|path/i);
|
|
@@ -419,4 +419,250 @@ describe("ai-enrichment merge rules", () => {
|
|
|
419
419
|
expect(backend?.properties.inference_status).toBeUndefined();
|
|
420
420
|
expect(backend?.properties.cloud_services_used).toEqual(["aws"]);
|
|
421
421
|
});
|
|
422
|
+
it("merges AI data_action verbs into dataActions without removing deterministic assignments", () => {
|
|
423
|
+
const components = makeBaseComponents();
|
|
424
|
+
components[1].properties = {
|
|
425
|
+
dataActions: [
|
|
426
|
+
{
|
|
427
|
+
action: "store",
|
|
428
|
+
source: "deterministic",
|
|
429
|
+
confidence: 1,
|
|
430
|
+
status: "asserted",
|
|
431
|
+
evidence: {
|
|
432
|
+
kind: "storage_subtype",
|
|
433
|
+
description: "database subtype",
|
|
434
|
+
},
|
|
435
|
+
},
|
|
436
|
+
{
|
|
437
|
+
action: "disclose",
|
|
438
|
+
source: "user",
|
|
439
|
+
confidence: 1,
|
|
440
|
+
status: "asserted",
|
|
441
|
+
evidence: [
|
|
442
|
+
{
|
|
443
|
+
filePath: "src/backend.ts",
|
|
444
|
+
startLine: 1,
|
|
445
|
+
endLine: 2,
|
|
446
|
+
reason: "user confirmed outbound share",
|
|
447
|
+
},
|
|
448
|
+
],
|
|
449
|
+
},
|
|
450
|
+
],
|
|
451
|
+
primaryDataAction: "store",
|
|
452
|
+
};
|
|
453
|
+
const proposals = [
|
|
454
|
+
{
|
|
455
|
+
id: "p_data_actions",
|
|
456
|
+
proposal: {
|
|
457
|
+
kind: "component_patch",
|
|
458
|
+
targetComponentId: "asset_backend",
|
|
459
|
+
candidateType: "node_property",
|
|
460
|
+
setProperties: {
|
|
461
|
+
data_action: ["log", "store"],
|
|
462
|
+
},
|
|
463
|
+
propertyEvidence: {
|
|
464
|
+
data_action: [
|
|
465
|
+
{
|
|
466
|
+
filePath: "src/backend.ts",
|
|
467
|
+
startLine: 40,
|
|
468
|
+
endLine: 42,
|
|
469
|
+
reason: "logger.info email",
|
|
470
|
+
},
|
|
471
|
+
],
|
|
472
|
+
},
|
|
473
|
+
confidence: { score: 0.88, band: "high" },
|
|
474
|
+
evidence: [
|
|
475
|
+
{
|
|
476
|
+
filePath: "src/backend.ts",
|
|
477
|
+
startLine: 40,
|
|
478
|
+
endLine: 42,
|
|
479
|
+
reason: "logger.info email",
|
|
480
|
+
},
|
|
481
|
+
],
|
|
482
|
+
provider: "openai",
|
|
483
|
+
model: "x",
|
|
484
|
+
agent: "propertyAgent",
|
|
485
|
+
},
|
|
486
|
+
},
|
|
487
|
+
];
|
|
488
|
+
const result = (0, merge_rules_1.mergeAiProposals)(components, makeBaseFlows(), proposals);
|
|
489
|
+
const backend = result.components.find((c) => c.id === "asset_backend");
|
|
490
|
+
const actions = backend?.properties.dataActions;
|
|
491
|
+
expect(result.appliedProposalIds).toEqual(["p_data_actions"]);
|
|
492
|
+
expect(actions?.map((a) => a.action).sort()).toEqual([
|
|
493
|
+
"disclose",
|
|
494
|
+
"log",
|
|
495
|
+
"store",
|
|
496
|
+
]);
|
|
497
|
+
expect(actions?.find((a) => a.action === "store")?.source).toBe("deterministic");
|
|
498
|
+
expect(actions?.find((a) => a.action === "disclose")?.source).toBe("user");
|
|
499
|
+
expect(actions?.find((a) => a.action === "log")?.source).toBe("ai");
|
|
500
|
+
expect(backend?.properties.data_action).toBeUndefined();
|
|
501
|
+
expect(backend?.properties.primaryDataAction).toBeDefined();
|
|
502
|
+
});
|
|
503
|
+
it("rejects data_action merge below 0.72 confidence and leaves deterministic verbs intact", () => {
|
|
504
|
+
const components = makeBaseComponents();
|
|
505
|
+
components[1].properties = {
|
|
506
|
+
dataActions: [
|
|
507
|
+
{
|
|
508
|
+
action: "store",
|
|
509
|
+
source: "deterministic",
|
|
510
|
+
confidence: 1,
|
|
511
|
+
status: "asserted",
|
|
512
|
+
evidence: {
|
|
513
|
+
kind: "storage_subtype",
|
|
514
|
+
description: "database subtype",
|
|
515
|
+
},
|
|
516
|
+
},
|
|
517
|
+
],
|
|
518
|
+
};
|
|
519
|
+
const proposals = [
|
|
520
|
+
{
|
|
521
|
+
id: "p_low_da",
|
|
522
|
+
proposal: {
|
|
523
|
+
kind: "component_patch",
|
|
524
|
+
targetComponentId: "asset_backend",
|
|
525
|
+
candidateType: "node_property",
|
|
526
|
+
setProperties: {
|
|
527
|
+
data_action: ["log"],
|
|
528
|
+
},
|
|
529
|
+
confidence: { score: 0.71, band: "medium" },
|
|
530
|
+
evidence: [
|
|
531
|
+
{
|
|
532
|
+
filePath: "src/backend.ts",
|
|
533
|
+
startLine: 1,
|
|
534
|
+
endLine: 1,
|
|
535
|
+
reason: "weak log guess",
|
|
536
|
+
},
|
|
537
|
+
],
|
|
538
|
+
provider: "openai",
|
|
539
|
+
model: "x",
|
|
540
|
+
agent: "propertyAgent",
|
|
541
|
+
},
|
|
542
|
+
},
|
|
543
|
+
];
|
|
544
|
+
const result = (0, merge_rules_1.mergeAiProposals)(components, makeBaseFlows(), proposals);
|
|
545
|
+
const backend = result.components.find((c) => c.id === "asset_backend");
|
|
546
|
+
expect(result.appliedProposalIds).toEqual([]);
|
|
547
|
+
expect(result.rejectedProposalIds).toEqual([
|
|
548
|
+
{
|
|
549
|
+
proposalId: "p_low_da",
|
|
550
|
+
reason: "confidence_below_threshold:0.72",
|
|
551
|
+
},
|
|
552
|
+
]);
|
|
553
|
+
expect(backend?.properties.dataActions).toEqual([
|
|
554
|
+
{
|
|
555
|
+
action: "store",
|
|
556
|
+
source: "deterministic",
|
|
557
|
+
confidence: 1,
|
|
558
|
+
status: "asserted",
|
|
559
|
+
evidence: {
|
|
560
|
+
kind: "storage_subtype",
|
|
561
|
+
description: "database subtype",
|
|
562
|
+
},
|
|
563
|
+
},
|
|
564
|
+
]);
|
|
565
|
+
});
|
|
566
|
+
it("does not write dataActions onto actor nodes", () => {
|
|
567
|
+
const components = [
|
|
568
|
+
{
|
|
569
|
+
id: "actor_user",
|
|
570
|
+
name: "End User",
|
|
571
|
+
type: "actor",
|
|
572
|
+
confidence: 0.9,
|
|
573
|
+
detectedFrom: [],
|
|
574
|
+
sourceLocations: [],
|
|
575
|
+
properties: {},
|
|
576
|
+
},
|
|
577
|
+
];
|
|
578
|
+
const proposals = [
|
|
579
|
+
{
|
|
580
|
+
id: "p_actor_da",
|
|
581
|
+
proposal: {
|
|
582
|
+
kind: "component_patch",
|
|
583
|
+
targetComponentId: "actor_user",
|
|
584
|
+
candidateType: "node_property",
|
|
585
|
+
setProperties: {
|
|
586
|
+
data_action: ["collect"],
|
|
587
|
+
},
|
|
588
|
+
confidence: { score: 0.9, band: "high" },
|
|
589
|
+
evidence: [
|
|
590
|
+
{
|
|
591
|
+
filePath: "src/ui.ts",
|
|
592
|
+
startLine: 1,
|
|
593
|
+
endLine: 2,
|
|
594
|
+
reason: "form submit",
|
|
595
|
+
},
|
|
596
|
+
],
|
|
597
|
+
provider: "openai",
|
|
598
|
+
model: "x",
|
|
599
|
+
agent: "propertyAgent",
|
|
600
|
+
},
|
|
601
|
+
},
|
|
602
|
+
];
|
|
603
|
+
const result = (0, merge_rules_1.mergeAiProposals)(components, [], proposals);
|
|
604
|
+
expect(result.appliedProposalIds).toEqual([]);
|
|
605
|
+
expect(result.rejectedProposalIds).toEqual([
|
|
606
|
+
{ proposalId: "p_actor_da", reason: "no_meaningful_changes" },
|
|
607
|
+
]);
|
|
608
|
+
expect(result.components[0]?.properties.dataActions).toBeUndefined();
|
|
609
|
+
});
|
|
610
|
+
it("promotes a deterministic relay candidate when AI supplies corroboration", () => {
|
|
611
|
+
const components = makeBaseComponents();
|
|
612
|
+
components[0].properties = {
|
|
613
|
+
dataActions: [
|
|
614
|
+
{
|
|
615
|
+
action: "relay",
|
|
616
|
+
source: "deterministic",
|
|
617
|
+
confidence: 0.6,
|
|
618
|
+
status: "candidate",
|
|
619
|
+
evidence: {
|
|
620
|
+
kind: "relay_topology",
|
|
621
|
+
description: "in-degree and out-degree without store",
|
|
622
|
+
},
|
|
623
|
+
},
|
|
624
|
+
],
|
|
625
|
+
};
|
|
626
|
+
const proposals = [
|
|
627
|
+
{
|
|
628
|
+
id: "p_relay",
|
|
629
|
+
proposal: {
|
|
630
|
+
kind: "component_patch",
|
|
631
|
+
targetComponentId: "asset_frontend",
|
|
632
|
+
candidateType: "node_property",
|
|
633
|
+
setProperties: {
|
|
634
|
+
data_action: ["relay"],
|
|
635
|
+
},
|
|
636
|
+
propertyEvidence: {
|
|
637
|
+
data_action: [
|
|
638
|
+
{
|
|
639
|
+
filePath: "src/proxy.ts",
|
|
640
|
+
startLine: 8,
|
|
641
|
+
endLine: 12,
|
|
642
|
+
reason: "express proxy middleware passthrough",
|
|
643
|
+
},
|
|
644
|
+
],
|
|
645
|
+
},
|
|
646
|
+
confidence: { score: 0.9, band: "high" },
|
|
647
|
+
evidence: [
|
|
648
|
+
{
|
|
649
|
+
filePath: "src/proxy.ts",
|
|
650
|
+
startLine: 8,
|
|
651
|
+
endLine: 12,
|
|
652
|
+
reason: "express proxy middleware passthrough",
|
|
653
|
+
},
|
|
654
|
+
],
|
|
655
|
+
provider: "openai",
|
|
656
|
+
model: "x",
|
|
657
|
+
agent: "propertyAgent",
|
|
658
|
+
},
|
|
659
|
+
},
|
|
660
|
+
];
|
|
661
|
+
const result = (0, merge_rules_1.mergeAiProposals)(components, makeBaseFlows(), proposals);
|
|
662
|
+
const frontend = result.components.find((c) => c.id === "asset_frontend");
|
|
663
|
+
const relay = frontend?.properties.dataActions?.find((a) => a.action === "relay");
|
|
664
|
+
expect(result.appliedProposalIds).toEqual(["p_relay"]);
|
|
665
|
+
expect(relay?.status).toBe("asserted");
|
|
666
|
+
expect(relay?.source).toBe("ai");
|
|
667
|
+
});
|
|
422
668
|
});
|
|
@@ -241,4 +241,82 @@ describe("strictParseAndNormalizeProposals / propertyEvidence", () => {
|
|
|
241
241
|
expect(out[0].propertyEvidence?.cloud_provider).toHaveLength(1);
|
|
242
242
|
}
|
|
243
243
|
});
|
|
244
|
+
it("normalizes data_action aliases, keeps multi-verb sets, and drops unknowns", () => {
|
|
245
|
+
const raw = {
|
|
246
|
+
proposals: [
|
|
247
|
+
{
|
|
248
|
+
kind: "component_patch",
|
|
249
|
+
targetComponentId: "c1",
|
|
250
|
+
candidateType: "third_party",
|
|
251
|
+
setProperties: {
|
|
252
|
+
data_action: ["persist", "share", "log", "not_a_verb", "store"],
|
|
253
|
+
},
|
|
254
|
+
confidence: { score: 0.9, band: "high" },
|
|
255
|
+
propertyEvidence: {
|
|
256
|
+
data_action: [
|
|
257
|
+
{ filePath: "a.ts", startLine: 1, endLine: 1, reason: "pg INSERT + stripe + logger" },
|
|
258
|
+
],
|
|
259
|
+
},
|
|
260
|
+
},
|
|
261
|
+
],
|
|
262
|
+
};
|
|
263
|
+
const userPrompt = JSON.stringify({
|
|
264
|
+
relevantFileContents: { "a.ts": "line" },
|
|
265
|
+
componentContext: {
|
|
266
|
+
c1: {
|
|
267
|
+
detectedFrom: [{ filePath: "a.ts", pattern: "p" }],
|
|
268
|
+
sourceLocations: [],
|
|
269
|
+
},
|
|
270
|
+
},
|
|
271
|
+
});
|
|
272
|
+
const out = (0, provider_contract_1.strictParseAndNormalizeProposals)(raw, defaults, {
|
|
273
|
+
debugLabel: "test",
|
|
274
|
+
userPrompt,
|
|
275
|
+
});
|
|
276
|
+
expect(out).toHaveLength(1);
|
|
277
|
+
if (out[0]?.kind === "component_patch") {
|
|
278
|
+
expect(out[0].setProperties.data_action).toEqual(["store", "disclose", "log"]);
|
|
279
|
+
expect(out[0].setProperties.dataActions).toBeUndefined();
|
|
280
|
+
expect(out[0].propertyEvidence?.data_action).toHaveLength(1);
|
|
281
|
+
}
|
|
282
|
+
});
|
|
283
|
+
it("rewrites camelCase dataActions to data_action for node_property patches", () => {
|
|
284
|
+
const raw = {
|
|
285
|
+
proposals: [
|
|
286
|
+
{
|
|
287
|
+
kind: "component_patch",
|
|
288
|
+
targetComponentId: "asset_1",
|
|
289
|
+
candidateType: "node_property",
|
|
290
|
+
setProperties: {
|
|
291
|
+
dataActions: ["cache", "transmit"],
|
|
292
|
+
},
|
|
293
|
+
confidence: { score: 0.88, band: "high" },
|
|
294
|
+
propertyEvidence: {
|
|
295
|
+
dataActions: [
|
|
296
|
+
{ filePath: "db.ts", startLine: 2, endLine: 4, reason: "redis set + outbound post" },
|
|
297
|
+
],
|
|
298
|
+
},
|
|
299
|
+
},
|
|
300
|
+
],
|
|
301
|
+
};
|
|
302
|
+
const userPrompt = JSON.stringify({
|
|
303
|
+
relevantFileContents: { "db.ts": "line1\nline2\nline3\nline4" },
|
|
304
|
+
componentContext: {
|
|
305
|
+
asset_1: {
|
|
306
|
+
detectedFrom: [{ filePath: "db.ts", pattern: "p" }],
|
|
307
|
+
sourceLocations: [],
|
|
308
|
+
},
|
|
309
|
+
},
|
|
310
|
+
});
|
|
311
|
+
const out = (0, provider_contract_1.strictParseAndNormalizeProposals)(raw, defaults, {
|
|
312
|
+
debugLabel: "test",
|
|
313
|
+
userPrompt,
|
|
314
|
+
});
|
|
315
|
+
expect(out).toHaveLength(1);
|
|
316
|
+
if (out[0]?.kind === "component_patch") {
|
|
317
|
+
expect(out[0].setProperties.data_action).toEqual(["store", "disclose"]);
|
|
318
|
+
expect(out[0].setProperties.dataActions).toBeUndefined();
|
|
319
|
+
expect(out[0].propertyEvidence?.data_action).toHaveLength(1);
|
|
320
|
+
}
|
|
321
|
+
});
|
|
244
322
|
});
|