@dataparade/cli 0.0.12 → 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 -20
- package/dist/src/config/resolve.d.ts +1 -1
- package/dist/src/config/resolve.js +75 -69
- 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 +4 -3
- package/dist/src/core/schema/scan-config.schema.js +18 -17
- package/dist/src/core/schema/scan-result.schema.d.ts +2 -456
- package/dist/src/core/schema/scan-result.schema.js +12 -240
- 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/php/dependency-manifests.d.ts +0 -10
- package/dist/src/analyzers/php/dependency-manifests.js +0 -117
- package/dist/src/analyzers/php/detector.d.ts +0 -3
- package/dist/src/analyzers/php/detector.js +0 -20
- package/dist/src/analyzers/php/index.d.ts +0 -2
- package/dist/src/analyzers/php/index.js +0 -11
- package/dist/src/analyzers/php/manifest-parsers.d.ts +0 -14
- package/dist/src/analyzers/php/manifest-parsers.js +0 -40
- package/dist/src/analyzers/php/parser.d.ts +0 -42
- package/dist/src/analyzers/php/parser.js +0 -297
- package/dist/src/analyzers/php/patterns.d.ts +0 -3
- package/dist/src/analyzers/php/patterns.js +0 -49
- package/dist/src/analyzers/php/php-detection-config.d.ts +0 -104
- package/dist/src/analyzers/php/php-detection-config.js +0 -192
- 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 -78
- 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 -168
- 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 -18
- package/dist/src/classifier/postprocessing.js +0 -565
- 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 -452
- 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 -497
- 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 -269
- 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 -32
- package/dist/src/patterns/config.js +0 -286
- 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/php.d.ts +0 -9
- package/dist/src/patterns/detectors/php.js +0 -466
- 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 -148
- 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/php/dependency-manifests.spec.d.ts +0 -1
- package/dist/tests/unit/analyzers/php/dependency-manifests.spec.js +0 -54
- package/dist/tests/unit/analyzers/php/parser.spec.d.ts +0 -1
- package/dist/tests/unit/analyzers/php/parser.spec.js +0 -128
- package/dist/tests/unit/analyzers/php/patterns.spec.d.ts +0 -1
- package/dist/tests/unit/analyzers/php/patterns.spec.js +0 -334
- 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 -1521
- 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/ingest/php-languages.spec.d.ts +0 -1
- package/dist/tests/unit/ingest/php-languages.spec.js +0 -40
- 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/php.md +0 -74
- package/patterns/php.patterns.yaml +0 -311
- 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 -182
- package/patterns/typescript.patterns.yaml +0 -361
|
@@ -3,13 +3,17 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.DATA_ACTION_MIN_CONFIDENCE = void 0;
|
|
6
7
|
exports.mergeAiProposals = mergeAiProposals;
|
|
7
8
|
const third_party_subtype_1 = require("./third-party-subtype");
|
|
8
|
-
const
|
|
9
|
+
const scanner_1 = require("@dataparade/scanner");
|
|
9
10
|
const path_1 = __importDefault(require("path"));
|
|
10
11
|
const util_1 = require("util");
|
|
12
|
+
const provider_contract_1 = require("./providers/provider-contract");
|
|
13
|
+
/** PRD §4.4 / task 2.2 — AI data-action assignments gated at ≥ 0.72. */
|
|
14
|
+
exports.DATA_ACTION_MIN_CONFIDENCE = 0.72;
|
|
11
15
|
const DEFAULT_THRESHOLDS = {
|
|
12
|
-
minComponentPatchConfidence:
|
|
16
|
+
minComponentPatchConfidence: exports.DATA_ACTION_MIN_CONFIDENCE,
|
|
13
17
|
minFlowPatchConfidence: 0.75,
|
|
14
18
|
minInsertFlowConfidence: 0.85,
|
|
15
19
|
};
|
|
@@ -121,6 +125,104 @@ function toProvenance(proposal, confidence) {
|
|
|
121
125
|
evidence: proposal.evidence,
|
|
122
126
|
};
|
|
123
127
|
}
|
|
128
|
+
function evidenceRefsForDataAction(patch) {
|
|
129
|
+
const fromProperty = patch.propertyEvidence?.[provider_contract_1.UI_DATA_ACTION_PROPERTY_KEY];
|
|
130
|
+
if (Array.isArray(fromProperty) && fromProperty.length > 0)
|
|
131
|
+
return fromProperty;
|
|
132
|
+
return patch.evidence;
|
|
133
|
+
}
|
|
134
|
+
function toSourceLocations(refs) {
|
|
135
|
+
return refs.map((ref) => ({
|
|
136
|
+
filePath: ref.filePath,
|
|
137
|
+
startLine: ref.startLine,
|
|
138
|
+
endLine: ref.endLine,
|
|
139
|
+
}));
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* Build an AI-sourced assignment for one verb.
|
|
143
|
+
* Relay uses topology corroboration so mergeOneAssignment may assert it (conservative-absence rule).
|
|
144
|
+
*/
|
|
145
|
+
function buildAiDataActionAssignment(action, patch) {
|
|
146
|
+
const refs = evidenceRefsForDataAction(patch);
|
|
147
|
+
const reason = refs
|
|
148
|
+
.map((r) => r.reason.trim())
|
|
149
|
+
.filter(Boolean)
|
|
150
|
+
.join("; ") || "ai enrichment evidence";
|
|
151
|
+
if (action === "relay") {
|
|
152
|
+
return {
|
|
153
|
+
action: "relay",
|
|
154
|
+
source: "ai",
|
|
155
|
+
confidence: patch.confidence.score,
|
|
156
|
+
status: "asserted",
|
|
157
|
+
evidence: {
|
|
158
|
+
kind: "pattern_rule",
|
|
159
|
+
description: reason,
|
|
160
|
+
corroboration: reason,
|
|
161
|
+
},
|
|
162
|
+
};
|
|
163
|
+
}
|
|
164
|
+
return {
|
|
165
|
+
action,
|
|
166
|
+
source: "ai",
|
|
167
|
+
confidence: patch.confidence.score,
|
|
168
|
+
status: "asserted",
|
|
169
|
+
evidence: toSourceLocations(refs),
|
|
170
|
+
};
|
|
171
|
+
}
|
|
172
|
+
function parseProposedDataActions(raw) {
|
|
173
|
+
if (raw == null)
|
|
174
|
+
return [];
|
|
175
|
+
const values = Array.isArray(raw) ? raw : [raw];
|
|
176
|
+
const out = [];
|
|
177
|
+
const seen = new Set();
|
|
178
|
+
for (const value of values) {
|
|
179
|
+
const action = (0, scanner_1.normalizeDataAction)(String(value));
|
|
180
|
+
if (!action || seen.has(action))
|
|
181
|
+
continue;
|
|
182
|
+
seen.add(action);
|
|
183
|
+
out.push(action);
|
|
184
|
+
}
|
|
185
|
+
return out;
|
|
186
|
+
}
|
|
187
|
+
/**
|
|
188
|
+
* Merge AI-proposed `data_action` verbs into set-valued `properties.dataActions`.
|
|
189
|
+
* Adds / promotes only; never removes deterministic or user assignments.
|
|
190
|
+
*/
|
|
191
|
+
function mergeDataActionProperties(component, patch, proposedRaw) {
|
|
192
|
+
if (!(0, scanner_1.componentMayCarryDataActions)(component.type)) {
|
|
193
|
+
return false;
|
|
194
|
+
}
|
|
195
|
+
if (patch.confidence.score < exports.DATA_ACTION_MIN_CONFIDENCE) {
|
|
196
|
+
return false;
|
|
197
|
+
}
|
|
198
|
+
const proposed = parseProposedDataActions(proposedRaw);
|
|
199
|
+
if (proposed.length === 0)
|
|
200
|
+
return false;
|
|
201
|
+
const refs = evidenceRefsForDataAction(patch);
|
|
202
|
+
if (refs.length === 0)
|
|
203
|
+
return false;
|
|
204
|
+
let merged = [...(0, scanner_1.readDataActions)(component)];
|
|
205
|
+
const before = JSON.stringify(merged);
|
|
206
|
+
for (const action of proposed) {
|
|
207
|
+
merged = (0, scanner_1.mergeOneAssignment)(merged, buildAiDataActionAssignment(action, patch));
|
|
208
|
+
}
|
|
209
|
+
merged.sort((a, b) => a.action.localeCompare(b.action));
|
|
210
|
+
if (JSON.stringify(merged) === before) {
|
|
211
|
+
return false;
|
|
212
|
+
}
|
|
213
|
+
component.properties = {
|
|
214
|
+
...component.properties,
|
|
215
|
+
dataActions: merged,
|
|
216
|
+
};
|
|
217
|
+
const primary = (0, scanner_1.selectPrimaryDataAction)(merged);
|
|
218
|
+
if (primary) {
|
|
219
|
+
component.properties.primaryDataAction = primary;
|
|
220
|
+
}
|
|
221
|
+
else {
|
|
222
|
+
delete component.properties.primaryDataAction;
|
|
223
|
+
}
|
|
224
|
+
return true;
|
|
225
|
+
}
|
|
124
226
|
function mergeComponentPatch(components, patch) {
|
|
125
227
|
const component = components.find((item) => item.id === patch.targetComponentId);
|
|
126
228
|
if (!component)
|
|
@@ -135,9 +237,19 @@ function mergeComponentPatch(components, patch) {
|
|
|
135
237
|
component.description = patch.setDescription;
|
|
136
238
|
changed = true;
|
|
137
239
|
}
|
|
240
|
+
const setProperties = patch.setProperties ?? {};
|
|
241
|
+
const dataActionRaw = setProperties[provider_contract_1.UI_DATA_ACTION_PROPERTY_KEY] ?? setProperties.dataActions;
|
|
242
|
+
if (dataActionRaw !== undefined) {
|
|
243
|
+
if (mergeDataActionProperties(component, patch, dataActionRaw)) {
|
|
244
|
+
changed = true;
|
|
245
|
+
}
|
|
246
|
+
}
|
|
138
247
|
const currentProperties = component.properties ?? {};
|
|
139
248
|
const nextProperties = { ...currentProperties };
|
|
140
|
-
for (const [key, value] of Object.entries(
|
|
249
|
+
for (const [key, value] of Object.entries(setProperties)) {
|
|
250
|
+
if (key === provider_contract_1.UI_DATA_ACTION_PROPERTY_KEY || key === "dataActions") {
|
|
251
|
+
continue;
|
|
252
|
+
}
|
|
141
253
|
const currentValue = currentProperties[key];
|
|
142
254
|
if (key === "inference_status" && value === "needs_review") {
|
|
143
255
|
continue;
|
|
@@ -310,7 +422,7 @@ function mergeAiProposals(components, dataFlows, proposals, thresholds = {}, opt
|
|
|
310
422
|
appliedProposalIds.push(id);
|
|
311
423
|
provenanceByTarget[targetKey] = toProvenance(resolvedProposal, resolvedProposal.confidence.score);
|
|
312
424
|
}
|
|
313
|
-
(0,
|
|
425
|
+
(0, scanner_1.sortDataFlowsDeterministically)(nextFlows);
|
|
314
426
|
return {
|
|
315
427
|
components: nextComponents,
|
|
316
428
|
dataFlows: nextFlows,
|
|
@@ -9,6 +9,7 @@ const fs_1 = __importDefault(require("fs"));
|
|
|
9
9
|
const path_1 = __importDefault(require("path"));
|
|
10
10
|
const yaml_1 = __importDefault(require("yaml"));
|
|
11
11
|
const zod_1 = require("zod");
|
|
12
|
+
const scanner_package_root_1 = require("../scanner-package-root");
|
|
12
13
|
const nonPiiSignalRuleSchema = zod_1.z.object({
|
|
13
14
|
id: zod_1.z.string().min(1),
|
|
14
15
|
category: zod_1.z.enum(["auth_artifacts", "usage_metadata", "telemetry", "content_files", "identifiers"]),
|
|
@@ -25,12 +26,7 @@ function clearNonPiiSignalRulesCacheForTest() {
|
|
|
25
26
|
cachedRules = undefined;
|
|
26
27
|
}
|
|
27
28
|
function getNonPiiSignalRulesPath() {
|
|
28
|
-
|
|
29
|
-
const distIndex = parts.lastIndexOf("dist");
|
|
30
|
-
const cliRoot = distIndex !== -1
|
|
31
|
-
? parts.slice(0, distIndex).join(path_1.default.sep)
|
|
32
|
-
: path_1.default.resolve(__dirname, "..", "..");
|
|
33
|
-
return path_1.default.join(cliRoot, "patterns", "non-pii-signals.rules.yaml");
|
|
29
|
+
return path_1.default.join((0, scanner_package_root_1.getScannerPackageRoot)(), "patterns", "non-pii-signals.rules.yaml");
|
|
34
30
|
}
|
|
35
31
|
function loadNonPiiSignalRules() {
|
|
36
32
|
if (cachedRules)
|
|
@@ -57,8 +57,8 @@ export declare const openAiProposalsResponseSchema: z.ZodObject<{
|
|
|
57
57
|
rpc: "rpc";
|
|
58
58
|
}>>;
|
|
59
59
|
setDirection: z.ZodOptional<z.ZodEnum<{
|
|
60
|
-
reverse: "reverse";
|
|
61
60
|
forward: "forward";
|
|
61
|
+
reverse: "reverse";
|
|
62
62
|
}>>;
|
|
63
63
|
setMethod: z.ZodOptional<z.ZodString>;
|
|
64
64
|
setEndpoint: z.ZodOptional<z.ZodString>;
|
|
@@ -9,6 +9,7 @@ const fs_1 = __importDefault(require("fs"));
|
|
|
9
9
|
const path_1 = __importDefault(require("path"));
|
|
10
10
|
const yaml_1 = __importDefault(require("yaml"));
|
|
11
11
|
const zod_1 = require("zod");
|
|
12
|
+
const scanner_package_root_1 = require("../scanner-package-root");
|
|
12
13
|
const piiSignalRuleSchema = zod_1.z.object({
|
|
13
14
|
id: zod_1.z.string().min(1),
|
|
14
15
|
category: zod_1.z.enum(["identifiers", "profile_data", "credentials"]),
|
|
@@ -23,12 +24,7 @@ function clearPiiSignalRulesCacheForTest() {
|
|
|
23
24
|
cachedRules = undefined;
|
|
24
25
|
}
|
|
25
26
|
function getPiiSignalRulesPath() {
|
|
26
|
-
|
|
27
|
-
const distIndex = parts.lastIndexOf("dist");
|
|
28
|
-
const cliRoot = distIndex !== -1
|
|
29
|
-
? parts.slice(0, distIndex).join(path_1.default.sep)
|
|
30
|
-
: path_1.default.resolve(__dirname, "..", "..");
|
|
31
|
-
return path_1.default.join(cliRoot, "patterns", "pii-signals.rules.yaml");
|
|
27
|
+
return path_1.default.join((0, scanner_package_root_1.getScannerPackageRoot)(), "patterns", "pii-signals.rules.yaml");
|
|
32
28
|
}
|
|
33
29
|
function loadPiiSignalRules() {
|
|
34
30
|
if (cachedRules)
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* so each provider can compose instructions without duplicating the full contract text.
|
|
4
4
|
*/
|
|
5
5
|
/** Shared system instructions for OpenAI, Anthropic, Gemini, and local/Ollama providers. */
|
|
6
|
-
export declare const AI_PROVIDER_SYSTEM_PROMPT = "You are enriching a DataParade data-flow scan. Respond with a JSON object matching the response schema: top-level key \"proposals\" (array). No markdown fences.\n\nPrimary goal: **only** populate node properties when each value is **directly supported** by code or config text in `relevantFileContents` (when present) or by explicit paths in `detectedFrom` / `sourceLocations` for that component. If support is weak, indirect, or guessed, **omit** the property. It is always valid to return **zero** proposals or a patch with **few** `setProperties` keys.\n\nUse **ComponentPatch only** in the proposals array (schema may list a flow variant for compatibility; omit it).\n\nComponentPatch (property filling):\n- kind: \"component_patch\"\n- targetComponentId: string (**must exactly equal one of the componentContext object keys / canonical component IDs**)\n- candidateType: match the user payload agent/candidates (usually \"third_party\" or \"node_property\")\n- setSubType: string \u2014 **required** when componentContext.subType is empty/null; use one taxonomy token: b2b_customer, saas_service, payment_processor, cloud_provider, api_provider, ai_provider, data_provider, government_regulator, partner, ad_network, professional_services, data_processor, other (snake_case). Omit setSubType only when componentContext already has subType.\n- setDescription?: string when helpful\n- setProperties: object with snake_case keys; **only** keys you can tie to cited evidence (see propertyEvidence)\n- propertyEvidence: **required**. Object whose keys are exactly the keys you put in setProperties; each value is a **non-empty** array of evidence rows: { \"filePath\", \"startLine\", \"endLine\", \"reason\" }. Every property must cite where in the repo that value comes from; different properties may cite different files or line ranges.\n- confidence: { \"score\": number 0.72\u20130.95 when patch is well supported, \"band\": \"high\" | \"medium\" | \"low\" }\n- evidence: optional legacy field; prefer propertyEvidence only.\n\nPrefer **one ComponentPatch per target component** when you have support \u2014 not a large speculative bag of guesses.\n\n**Do not emit FlowPatch proposals.** Connectivity comes from deterministic scan rules.\n\nRules:\n- Do not contradict propertiesSet unless fixing a clear error with cited proof.\n- `targetComponentId` must be a canonical component ID from componentContext keys only. Never emit file paths or folder names as targetComponentId.\n- **Anti-fabrication:** same as above \u2014 if the fact is not in the cited lines / excerpt text, omit the property.\n- Do not emit placeholder `setProperties` values (null, \"none\", empty arrays, empty strings), and do not set `inference_status`.\n\nsetProperties value shapes: use snake_case keys from sparsePropertyKeys. integration_method must be a string array (e.g. [\"api\"]), never a single string. authentication_method must be one string token (e.g. api_key, oauth_2_0), never an array. processing_purpose must be a string array of taxonomy tokens (authentication, security, analytics, service_provision, payment_processing, marketing, compliance, other, etc.)\u2014snake_case. Other multi-value fields must be string arrays, not comma-joined strings.";
|
|
6
|
+
export declare const AI_PROVIDER_SYSTEM_PROMPT = "You are enriching a DataParade data-flow scan. Respond with a JSON object matching the response schema: top-level key \"proposals\" (array). No markdown fences.\n\nPrimary goal: **only** populate node properties when each value is **directly supported** by code or config text in `relevantFileContents` (when present) or by explicit paths in `detectedFrom` / `sourceLocations` for that component. If support is weak, indirect, or guessed, **omit** the property. It is always valid to return **zero** proposals or a patch with **few** `setProperties` keys.\n\nUse **ComponentPatch only** in the proposals array (schema may list a flow variant for compatibility; omit it).\n\nComponentPatch (property filling):\n- kind: \"component_patch\"\n- targetComponentId: string (**must exactly equal one of the componentContext object keys / canonical component IDs**)\n- candidateType: match the user payload agent/candidates (usually \"third_party\" or \"node_property\")\n- setSubType: string \u2014 **required** when componentContext.subType is empty/null; use one taxonomy token: b2b_customer, saas_service, payment_processor, cloud_provider, api_provider, ai_provider, data_provider, government_regulator, partner, ad_network, professional_services, data_processor, other (snake_case). Omit setSubType only when componentContext already has subType.\n- setDescription?: string when helpful\n- setProperties: object with snake_case keys; **only** keys you can tie to cited evidence (see propertyEvidence)\n- propertyEvidence: **required**. Object whose keys are exactly the keys you put in setProperties; each value is a **non-empty** array of evidence rows: { \"filePath\", \"startLine\", \"endLine\", \"reason\" }. Every property must cite where in the repo that value comes from; different properties may cite different files or line ranges.\n- confidence: { \"score\": number 0.72\u20130.95 when patch is well supported, \"band\": \"high\" | \"medium\" | \"low\" }\n- evidence: optional legacy field; prefer propertyEvidence only.\n\nPrefer **one ComponentPatch per target component** when you have support \u2014 not a large speculative bag of guesses.\n\n**Do not emit FlowPatch proposals.** Connectivity comes from deterministic scan rules.\n\nRules:\n- Do not contradict propertiesSet unless fixing a clear error with cited proof.\n- `targetComponentId` must be a canonical component ID from componentContext keys only. Never emit file paths or folder names as targetComponentId.\n- **Anti-fabrication:** same as above \u2014 if the fact is not in the cited lines / excerpt text, omit the property.\n- Do not emit placeholder `setProperties` values (null, \"none\", empty arrays, empty strings), and do not set `inference_status`.\n\nsetProperties value shapes: use snake_case keys from sparsePropertyKeys. integration_method must be a string array (e.g. [\"api\"]), never a single string. authentication_method must be one string token (e.g. api_key, oauth_2_0), never an array. processing_purpose must be a string array of taxonomy tokens (authentication, security, analytics, service_provision, payment_processing, marketing, compliance, other, etc.)\u2014snake_case. data_action must be a string array of canonical privacy verbs (collect, generate, store, transform, use, combine, disclose, relay, display, log, delete); a node may have multiple verbs; never emit data_action for actors; propose relay only with cited corroboration. Other multi-value fields must be string arrays, not comma-joined strings.";
|
|
7
7
|
/**
|
|
8
8
|
* Anthropic has no server-side JSON schema for this path; truncated output yields invalid JSON.
|
|
9
9
|
* Reinforce brevity so the model completes a single well-formed object.
|
|
@@ -34,7 +34,7 @@ Rules:
|
|
|
34
34
|
- **Anti-fabrication:** same as above — if the fact is not in the cited lines / excerpt text, omit the property.
|
|
35
35
|
- Do not emit placeholder \`setProperties\` values (null, "none", empty arrays, empty strings), and do not set \`inference_status\`.
|
|
36
36
|
|
|
37
|
-
setProperties value shapes: use snake_case keys from sparsePropertyKeys. integration_method must be a string array (e.g. ["api"]), never a single string. authentication_method must be one string token (e.g. api_key, oauth_2_0), never an array. processing_purpose must be a string array of taxonomy tokens (authentication, security, analytics, service_provision, payment_processing, marketing, compliance, other, etc.)—snake_case. Other multi-value fields must be string arrays, not comma-joined strings.`;
|
|
37
|
+
setProperties value shapes: use snake_case keys from sparsePropertyKeys. integration_method must be a string array (e.g. ["api"]), never a single string. authentication_method must be one string token (e.g. api_key, oauth_2_0), never an array. processing_purpose must be a string array of taxonomy tokens (authentication, security, analytics, service_provision, payment_processing, marketing, compliance, other, etc.)—snake_case. data_action must be a string array of canonical privacy verbs (collect, generate, store, transform, use, combine, disclose, relay, display, log, delete); a node may have multiple verbs; never emit data_action for actors; propose relay only with cited corroboration. Other multi-value fields must be string arrays, not comma-joined strings.`;
|
|
38
38
|
/**
|
|
39
39
|
* Anthropic has no server-side JSON schema for this path; truncated output yields invalid JSON.
|
|
40
40
|
* Reinforce brevity so the model completes a single well-formed object.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ServiceSection } from "
|
|
1
|
+
import type { ServiceSection } from "@dataparade/scanner";
|
|
2
2
|
import type { DetectedComponent } from "../core/types/component";
|
|
3
3
|
import type { DetectedDataFlow } from "../core/types/data-flow";
|
|
4
4
|
import type { FileInfo } from "../core/types/file";
|
|
@@ -203,6 +203,10 @@ function buildProviderPromptPayload(input) {
|
|
|
203
203
|
"`integration_method` must always be an array of lowercase tokens (e.g. [\"api\"], [\"sdk\",\"api\"]); never a single string. " +
|
|
204
204
|
"`authentication_method` must be a single string token (e.g. \"api_key\", \"oauth_2_0\", \"openid_connect\", \"jwt\", \"saml\", \"mtls\", \"certificate\", \"basic_auth\", \"none\")—not an array—so it matches product dropdowns. " +
|
|
205
205
|
"`processing_purpose` must be a string array of **taxonomy** tokens the app lists (e.g. authentication, security, analytics, service_provision, payment_processing, marketing, compliance, other)—snake_case only, not sentences. " +
|
|
206
|
+
"`data_action` must be a string array of **canonical privacy verbs** only: collect, generate, store, transform, use, combine, disclose, relay, display, log, delete. " +
|
|
207
|
+
"A single asset or third_party node may carry **multiple** verbs at once (set-valued)—never collapse to one label. Actors never get `data_action` (omit for actor targets). " +
|
|
208
|
+
"Propose `relay` only when cited code/config corroborates passthrough/proxy/gateway behavior; otherwise omit relay. " +
|
|
209
|
+
"Cite `propertyEvidence.data_action` with filePath + line range + reason for every verb you assert. " +
|
|
206
210
|
"Other multi-value fields such as `data_categories_received`, `supported_export_formats`, `cloud_services_used`, `regions_availability_zones` must be string arrays, not one comma-joined string. " +
|
|
207
211
|
"Booleans must be true/false (not strings). Prefer enum-like values in lowercase snake_case (e.g. integration_status: \"active\"). " +
|
|
208
212
|
"For any field that corresponds to an app dropdown or multi-select, use the product's option tokens (snake_case / exact strings) — e.g. legal_basis: \"contractual_necessity\" not \"contract\"; pci_scope: \"saq_d\" not \"full\"; data_transfer_mechanism: \"standard_contractual_clauses\" not raw \"HTTPS\"; risk_rating and encrypt_at_rest must match allowed values.";
|
|
@@ -10,6 +10,7 @@ const fs_1 = __importDefault(require("fs"));
|
|
|
10
10
|
const path_1 = __importDefault(require("path"));
|
|
11
11
|
const yaml_1 = __importDefault(require("yaml"));
|
|
12
12
|
const zod_1 = require("zod");
|
|
13
|
+
const scanner_package_root_1 = require("../scanner-package-root");
|
|
13
14
|
const managedResourceSchema = zod_1.z.object({
|
|
14
15
|
kind: zod_1.z.enum(["database", "cache"]),
|
|
15
16
|
viaClients: zod_1.z.array(zod_1.z.string().min(1)).default([]),
|
|
@@ -89,12 +90,7 @@ function clearProviderTopologyRulesCacheForTest() {
|
|
|
89
90
|
cachedFallbackPolicy = undefined;
|
|
90
91
|
}
|
|
91
92
|
function getProviderTopologyRulesPath() {
|
|
92
|
-
|
|
93
|
-
const distIndex = parts.lastIndexOf("dist");
|
|
94
|
-
const cliRoot = distIndex !== -1
|
|
95
|
-
? parts.slice(0, distIndex).join(path_1.default.sep)
|
|
96
|
-
: path_1.default.resolve(__dirname, "..", "..");
|
|
97
|
-
return path_1.default.join(cliRoot, "patterns", "provider-topology.rules.yaml");
|
|
93
|
+
return path_1.default.join((0, scanner_package_root_1.getScannerPackageRoot)(), "patterns", "provider-topology.rules.yaml");
|
|
98
94
|
}
|
|
99
95
|
function loadProviderTopologyRules() {
|
|
100
96
|
if (cachedRules)
|
|
@@ -6,6 +6,12 @@ export interface ProposalsValidationContext {
|
|
|
6
6
|
allowedPathsByComponentId: Map<string, Set<string>>;
|
|
7
7
|
}
|
|
8
8
|
export declare function buildProposalsValidationContext(userPrompt: string): ProposalsValidationContext | null;
|
|
9
|
+
/** Canonical privacy verbs from `@dataparade/scanner` (PRD §4.1 / §4.4). */
|
|
10
|
+
export declare const UI_DATA_ACTION_ALLOWED: Set<string>;
|
|
11
|
+
/** Alias map mirrored from scanner taxonomy — single source of truth. */
|
|
12
|
+
export declare const UI_DATA_ACTION_ALIASES: Record<string, string>;
|
|
13
|
+
/** Proposable setProperties key for data-action verbs (PRD §4.4). */
|
|
14
|
+
export declare const UI_DATA_ACTION_PROPERTY_KEY = "data_action";
|
|
9
15
|
export declare function parseAgentFromPrompt(prompt: string): AiAgentName;
|
|
10
16
|
export declare function aiDebugEnabled(): boolean;
|
|
11
17
|
export interface StrictParseProposalsOptions {
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UI_DATA_ACTION_PROPERTY_KEY = exports.UI_DATA_ACTION_ALIASES = exports.UI_DATA_ACTION_ALLOWED = void 0;
|
|
3
4
|
exports.buildProposalsValidationContext = buildProposalsValidationContext;
|
|
4
5
|
exports.parseAgentFromPrompt = parseAgentFromPrompt;
|
|
5
6
|
exports.aiDebugEnabled = aiDebugEnabled;
|
|
6
7
|
exports.strictParseAndNormalizeProposals = strictParseAndNormalizeProposals;
|
|
8
|
+
const scanner_1 = require("@dataparade/scanner");
|
|
7
9
|
const openai_proposals_response_schema_1 = require("../openai-proposals-response.schema");
|
|
8
10
|
const scan_paths_1 = require("../scan-paths");
|
|
9
11
|
const scan_env_1 = require("../../config/scan-env");
|
|
@@ -277,6 +279,15 @@ const UI_PROCESSING_PURPOSE_ALIASES = {
|
|
|
277
279
|
storage: "data_storage",
|
|
278
280
|
backup: "backup_services",
|
|
279
281
|
};
|
|
282
|
+
/** Canonical privacy verbs from `@dataparade/scanner` (PRD §4.1 / §4.4). */
|
|
283
|
+
exports.UI_DATA_ACTION_ALLOWED = new Set(scanner_1.DATA_ACTIONS);
|
|
284
|
+
/** Alias map mirrored from scanner taxonomy — single source of truth. */
|
|
285
|
+
exports.UI_DATA_ACTION_ALIASES = {
|
|
286
|
+
...scanner_1.DATA_ACTION_ALIASES,
|
|
287
|
+
};
|
|
288
|
+
/** Proposable setProperties key for data-action verbs (PRD §4.4). */
|
|
289
|
+
exports.UI_DATA_ACTION_PROPERTY_KEY = "data_action";
|
|
290
|
+
const DATA_ACTION_INPUT_KEYS = new Set(["data_action", "dataActions"]);
|
|
280
291
|
function normalizeToken(value) {
|
|
281
292
|
return value
|
|
282
293
|
.trim()
|
|
@@ -314,6 +325,51 @@ function mapToAllowed(values, allowed, aliases) {
|
|
|
314
325
|
}
|
|
315
326
|
return out;
|
|
316
327
|
}
|
|
328
|
+
/**
|
|
329
|
+
* Normalize LLM-proposed data-action verbs to canonical tokens.
|
|
330
|
+
* Unknown verbs are dropped (no "other" verb in the taxonomy).
|
|
331
|
+
* Accepts `data_action` or camelCase `dataActions`; always emits `data_action`.
|
|
332
|
+
*/
|
|
333
|
+
function normalizeDataActionSetProperties(input) {
|
|
334
|
+
const normalized = { ...input };
|
|
335
|
+
const evidenceSourceByKey = {};
|
|
336
|
+
let sourceKey;
|
|
337
|
+
for (const key of DATA_ACTION_INPUT_KEYS) {
|
|
338
|
+
if (Object.prototype.hasOwnProperty.call(normalized, key)) {
|
|
339
|
+
sourceKey = key;
|
|
340
|
+
break;
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
if (!sourceKey) {
|
|
344
|
+
return { normalized, evidenceSourceByKey };
|
|
345
|
+
}
|
|
346
|
+
const values = toStringArray(normalized[sourceKey]);
|
|
347
|
+
const mapped = [];
|
|
348
|
+
const seen = new Set();
|
|
349
|
+
for (const value of values) {
|
|
350
|
+
const action = (0, scanner_1.normalizeDataAction)(value);
|
|
351
|
+
if (!action || !exports.UI_DATA_ACTION_ALLOWED.has(action))
|
|
352
|
+
continue;
|
|
353
|
+
if (seen.has(action))
|
|
354
|
+
continue;
|
|
355
|
+
seen.add(action);
|
|
356
|
+
mapped.push(action);
|
|
357
|
+
}
|
|
358
|
+
if (sourceKey !== exports.UI_DATA_ACTION_PROPERTY_KEY) {
|
|
359
|
+
delete normalized[sourceKey];
|
|
360
|
+
}
|
|
361
|
+
if (mapped.length > 0) {
|
|
362
|
+
normalized[exports.UI_DATA_ACTION_PROPERTY_KEY] = mapped;
|
|
363
|
+
if (sourceKey !== exports.UI_DATA_ACTION_PROPERTY_KEY) {
|
|
364
|
+
evidenceSourceByKey[exports.UI_DATA_ACTION_PROPERTY_KEY] = sourceKey;
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
else {
|
|
368
|
+
delete normalized[exports.UI_DATA_ACTION_PROPERTY_KEY];
|
|
369
|
+
delete normalized[sourceKey];
|
|
370
|
+
}
|
|
371
|
+
return { normalized, evidenceSourceByKey };
|
|
372
|
+
}
|
|
317
373
|
function normalizeThirdPartySetPropertiesForUi(input) {
|
|
318
374
|
const normalized = { ...input };
|
|
319
375
|
const evidenceSourceByKey = {};
|
|
@@ -421,8 +477,12 @@ function normalizeComponentPatch(p, ct, conf, defaults, validationCtx, reportDro
|
|
|
421
477
|
const thirdPartyNormalized = ct === "third_party"
|
|
422
478
|
? normalizeThirdPartySetPropertiesForUi(sanitizedSetProperties)
|
|
423
479
|
: { normalized: sanitizedSetProperties, evidenceSourceByKey: {} };
|
|
424
|
-
const
|
|
425
|
-
const
|
|
480
|
+
const dataActionNormalized = normalizeDataActionSetProperties(thirdPartyNormalized.normalized);
|
|
481
|
+
const normalizedSetProperties = dataActionNormalized.normalized;
|
|
482
|
+
const evidenceSourceByKey = {
|
|
483
|
+
...thirdPartyNormalized.evidenceSourceByKey,
|
|
484
|
+
...dataActionNormalized.evidenceSourceByKey,
|
|
485
|
+
};
|
|
426
486
|
const propKeys = Object.keys(normalizedSetProperties);
|
|
427
487
|
if (propKeys.length === 0) {
|
|
428
488
|
reportDrop?.("component_patch_setProperties_empty_after_sanitize", p);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { FileInfo } from "../core/types/file";
|
|
2
|
-
import { isSensitiveEnvPath } from "
|
|
2
|
+
import { isSensitiveEnvPath } from "@dataparade/scanner";
|
|
3
3
|
export { isSensitiveEnvPath };
|
|
4
4
|
/** True when file content must not be embedded in provider prompts. */
|
|
5
5
|
export declare function isSensitiveFileForAiPrompt(file: FileInfo): boolean;
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.isSensitiveEnvPath = void 0;
|
|
4
4
|
exports.isSensitiveFileForAiPrompt = isSensitiveFileForAiPrompt;
|
|
5
|
-
const
|
|
6
|
-
Object.defineProperty(exports, "isSensitiveEnvPath", { enumerable: true, get: function () { return
|
|
5
|
+
const scanner_1 = require("@dataparade/scanner");
|
|
6
|
+
Object.defineProperty(exports, "isSensitiveEnvPath", { enumerable: true, get: function () { return scanner_1.isSensitiveEnvPath; } });
|
|
7
7
|
/** True when file content must not be embedded in provider prompts. */
|
|
8
8
|
function isSensitiveFileForAiPrompt(file) {
|
|
9
|
-
return file.language === "env" || (0,
|
|
9
|
+
return file.language === "env" || (0, scanner_1.isSensitiveEnvPath)(file.path);
|
|
10
10
|
}
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.buildProposalTargetComponentIdRemap = buildProposalTargetComponentIdRemap;
|
|
4
4
|
exports.buildSharedHandlerAiFileIndex = buildSharedHandlerAiFileIndex;
|
|
5
5
|
exports.buildThirdPartyDataFlowSummary = buildThirdPartyDataFlowSummary;
|
|
6
|
-
const
|
|
6
|
+
const scanner_1 = require("@dataparade/scanner");
|
|
7
7
|
const scan_paths_1 = require("./scan-paths");
|
|
8
8
|
const pii_signal_rules_1 = require("./pii-signal-rules");
|
|
9
9
|
const non_pii_signal_rules_1 = require("./non-pii-signal-rules");
|
|
@@ -15,13 +15,13 @@ function buildProposalTargetComponentIdRemap(postAiComponents, finalComponents)
|
|
|
15
15
|
for (const component of finalComponents) {
|
|
16
16
|
if (component.type !== "third_party")
|
|
17
17
|
continue;
|
|
18
|
-
keyToFinalId.set((0,
|
|
18
|
+
keyToFinalId.set((0, scanner_1.stableComponentKey)(component), component.id);
|
|
19
19
|
}
|
|
20
20
|
const remap = new Map();
|
|
21
21
|
for (const component of postAiComponents) {
|
|
22
22
|
if (component.type !== "third_party")
|
|
23
23
|
continue;
|
|
24
|
-
const finalId = keyToFinalId.get((0,
|
|
24
|
+
const finalId = keyToFinalId.get((0, scanner_1.stableComponentKey)(component));
|
|
25
25
|
if (finalId)
|
|
26
26
|
remap.set(component.id, finalId);
|
|
27
27
|
}
|
|
@@ -4,7 +4,7 @@ exports.THIRD_PARTY_SUBTYPE_TAXONOMY = void 0;
|
|
|
4
4
|
exports.normalizeThirdPartySubType = normalizeThirdPartySubType;
|
|
5
5
|
exports.inferThirdPartySubType = inferThirdPartySubType;
|
|
6
6
|
exports.ensureThirdPartySubTypes = ensureThirdPartySubTypes;
|
|
7
|
-
const
|
|
7
|
+
const scanner_1 = require("@dataparade/scanner");
|
|
8
8
|
/**
|
|
9
9
|
* Canonical third-party subtypes (aligned with product thirdPartyTypes + classifier catalog).
|
|
10
10
|
* `ai_provider` is accepted from the classifier and mapped in the UI to api_provider.
|
|
@@ -97,7 +97,7 @@ function collectMatchCandidates(component) {
|
|
|
97
97
|
return out;
|
|
98
98
|
}
|
|
99
99
|
function inferFromClassifierCatalog(candidates) {
|
|
100
|
-
const { thirdParties } = (0,
|
|
100
|
+
const { thirdParties } = (0, scanner_1.loadClassifierConfig)();
|
|
101
101
|
let bestLen = 0;
|
|
102
102
|
let bestSubType;
|
|
103
103
|
for (const tp of thirdParties) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { RawFinding } from "../../core/types/detection";
|
|
2
2
|
import type { FileInfo } from "../../core/types/file";
|
|
3
|
-
import type { ServiceSection } from "
|
|
3
|
+
import type { ServiceSection } from "@dataparade/scanner";
|
|
4
4
|
import type { DetectedComponent } from "../../core/types/component";
|
|
5
5
|
import type { DetectedDataFlow } from "../../core/types/data-flow";
|
|
6
6
|
import type { AiInferenceCandidate, AiProposal } from "../types";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ServiceSection } from "
|
|
1
|
+
import type { ServiceSection } from "@dataparade/scanner";
|
|
2
2
|
import type { DetectedComponent } from "../core/types/component";
|
|
3
3
|
import type { RawFinding } from "../core/types/detection";
|
|
4
4
|
import type { DataFlowType, DetectedDataFlow } from "../core/types/data-flow";
|
package/dist/src/cli.js
CHANGED
|
@@ -53,7 +53,7 @@ const validate_scan_ai_1 = require("./config/validate-scan-ai");
|
|
|
53
53
|
const scan_sentry_1 = require("./observability/scan-sentry");
|
|
54
54
|
const telemetry_client_1 = require("./platform-api/telemetry-client");
|
|
55
55
|
const scan_config_schema_1 = require("./core/schema/scan-config.schema");
|
|
56
|
-
const
|
|
56
|
+
const scanner_1 = require("@dataparade/scanner");
|
|
57
57
|
function formatEvidence(detail) {
|
|
58
58
|
const evidence = detail.evidence;
|
|
59
59
|
if (!evidence || evidence.length === 0) {
|
|
@@ -178,7 +178,7 @@ function createProgram() {
|
|
|
178
178
|
const resolvedScanRoot = path_1.default.resolve(process.cwd(), rootPathArg);
|
|
179
179
|
let scanEntry;
|
|
180
180
|
try {
|
|
181
|
-
scanEntry = await (0,
|
|
181
|
+
scanEntry = await (0, scanner_1.resolveScanFilesystemEntry)(resolvedScanRoot);
|
|
182
182
|
}
|
|
183
183
|
catch (err) {
|
|
184
184
|
const message = err instanceof Error ? err.message : "Path does not exist.";
|
|
@@ -194,8 +194,9 @@ function createProgram() {
|
|
|
194
194
|
process.exitCode = 2;
|
|
195
195
|
return;
|
|
196
196
|
}
|
|
197
|
-
const [{
|
|
197
|
+
const [{ createDefaultScanConfiguration }, { runScanPipeline }, { buildDiagramGraphFromScanResult }] = await Promise.all([
|
|
198
198
|
Promise.resolve().then(() => __importStar(require("./core/pipeline/orchestrator"))),
|
|
199
|
+
Promise.resolve().then(() => __importStar(require("./core/pipeline/scan-pipeline"))),
|
|
199
200
|
Promise.resolve().then(() => __importStar(require("./core/pipeline/graph-mapping"))),
|
|
200
201
|
]);
|
|
201
202
|
if (isInteractive) {
|
|
@@ -346,7 +347,7 @@ function createProgram() {
|
|
|
346
347
|
// eslint-disable-next-line no-console
|
|
347
348
|
console.warn(`[scan] warnings:\n${warnings.map((w) => ` - ${w}`).join("\n")}`);
|
|
348
349
|
}
|
|
349
|
-
const { scanResult } = await
|
|
350
|
+
const { scanResult } = await runScanPipeline(resolvedScanRoot, config, (progress) => {
|
|
350
351
|
if (!isInteractive)
|
|
351
352
|
return;
|
|
352
353
|
// eslint-disable-next-line no-console
|
|
@@ -624,7 +625,7 @@ function createProgram() {
|
|
|
624
625
|
const resolvedRoot = path_1.default.resolve(process.cwd(), rootPathArg);
|
|
625
626
|
let configCwd = resolvedRoot;
|
|
626
627
|
try {
|
|
627
|
-
const scanEntry = await (0,
|
|
628
|
+
const scanEntry = await (0, scanner_1.resolveScanFilesystemEntry)(resolvedRoot);
|
|
628
629
|
configCwd = scanEntry.scanRootDir;
|
|
629
630
|
}
|
|
630
631
|
catch {
|
package/dist/src/config/file.js
CHANGED
|
@@ -9,20 +9,21 @@ const path_1 = __importDefault(require("path"));
|
|
|
9
9
|
const zod_1 = require("zod");
|
|
10
10
|
const types_1 = require("../ai-enrichment/types");
|
|
11
11
|
const fileLanguageEnum = zod_1.z.enum([
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
12
|
+
'typescript',
|
|
13
|
+
'javascript',
|
|
14
|
+
'json',
|
|
15
|
+
'yaml',
|
|
16
|
+
'env',
|
|
17
|
+
'python',
|
|
18
|
+
'cpp',
|
|
19
|
+
'csharp',
|
|
20
|
+
'go',
|
|
21
|
+
'php',
|
|
22
|
+
'rust',
|
|
23
|
+
'java',
|
|
24
|
+
'kotlin',
|
|
25
|
+
'terraform',
|
|
26
|
+
'dockerfile',
|
|
26
27
|
]);
|
|
27
28
|
const cliConfigFileSchema = zod_1.z
|
|
28
29
|
.object({
|
|
@@ -50,7 +51,7 @@ const cliConfigFileSchema = zod_1.z
|
|
|
50
51
|
aiBudgetTokens: zod_1.z.number().int().positive().optional(),
|
|
51
52
|
aiProviderConcurrency: zod_1.z.number().int().positive().optional(),
|
|
52
53
|
aiMaxCandidatesPerAgent: zod_1.z.number().int().min(0).optional(),
|
|
53
|
-
aiInferenceScope: zod_1.z.enum([
|
|
54
|
+
aiInferenceScope: zod_1.z.enum(['default', 'third_party_only']).optional(),
|
|
54
55
|
aiVerbose: zod_1.z.boolean().optional(),
|
|
55
56
|
aiToolLoopMaxRounds: zod_1.z.number().int().positive().optional(),
|
|
56
57
|
aiToolLoopMaxFiles: zod_1.z.number().int().positive().optional(),
|
|
@@ -59,22 +60,22 @@ const cliConfigFileSchema = zod_1.z
|
|
|
59
60
|
})
|
|
60
61
|
.strict();
|
|
61
62
|
function loadCliConfigFile(cwd) {
|
|
62
|
-
const configPath = path_1.default.join(cwd,
|
|
63
|
+
const configPath = path_1.default.join(cwd, 'dataparade.config.json');
|
|
63
64
|
if (!fs_1.default.existsSync(configPath)) {
|
|
64
65
|
return null;
|
|
65
66
|
}
|
|
66
|
-
const contents = fs_1.default.readFileSync(configPath,
|
|
67
|
+
const contents = fs_1.default.readFileSync(configPath, 'utf8');
|
|
67
68
|
try {
|
|
68
69
|
const parsed = JSON.parse(contents);
|
|
69
70
|
const result = cliConfigFileSchema.safeParse(parsed);
|
|
70
71
|
if (!result.success) {
|
|
71
|
-
const messages = result.error.issues.map((issue) => `${issue.path.join(
|
|
72
|
-
throw new Error(`Invalid dataparade.config.json:\n${messages.join(
|
|
72
|
+
const messages = result.error.issues.map((issue) => `${issue.path.join('.') || '<root>'}: ${issue.message}`);
|
|
73
|
+
throw new Error(`Invalid dataparade.config.json:\n${messages.join('\n')}`);
|
|
73
74
|
}
|
|
74
75
|
return { config: result.data, warnings: [] };
|
|
75
76
|
}
|
|
76
77
|
catch (err) {
|
|
77
|
-
const message = err instanceof Error ? err.message :
|
|
78
|
+
const message = err instanceof Error ? err.message : 'Unknown error parsing config file.';
|
|
78
79
|
throw new Error(`Failed to read dataparade.config.json: ${message}`);
|
|
79
80
|
}
|
|
80
81
|
}
|