@dataparade/cli 0.0.12 → 0.0.14
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 +4 -4
- package/dist/src/ai-enrichment/candidate-selector.js +37 -32
- package/dist/src/ai-enrichment/fallbacks.d.ts +2 -2
- package/dist/src/ai-enrichment/fallbacks.js +227 -83
- package/dist/src/ai-enrichment/merge-rules.d.ts +5 -3
- package/dist/src/ai-enrichment/merge-rules.js +225 -35
- 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 +2 -2
- package/dist/src/ai-enrichment/prompts/provider-enrichment-prompts.js +4 -4
- package/dist/src/ai-enrichment/property-priority.d.ts +5 -0
- package/dist/src/ai-enrichment/property-priority.js +23 -0
- package/dist/src/ai-enrichment/provider-prompt.d.ts +5 -5
- package/dist/src/ai-enrichment/provider-prompt.js +24 -15
- 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/red-flags.d.ts +46 -0
- package/dist/src/ai-enrichment/red-flags.js +365 -0
- 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-evidence.d.ts +3 -3
- package/dist/src/ai-enrichment/third-party-evidence.js +96 -93
- 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.d.ts +1 -1
- package/dist/src/cli.js +161 -143
- 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 +9 -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 +4 -3
- package/dist/src/core/pipeline/scan-pipeline.js +82 -128
- 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/output/json.d.ts +11 -3
- package/dist/src/output/json.js +10 -5
- 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/candidate-selector.spec.js +80 -49
- package/dist/tests/unit/ai-enrichment/fallbacks.spec.js +78 -0
- package/dist/tests/unit/ai-enrichment/merge-rules.spec.js +658 -166
- package/dist/tests/unit/ai-enrichment/provider-contract.spec.js +78 -0
- package/dist/tests/unit/ai-enrichment/provider-prompt.spec.js +80 -75
- package/dist/tests/unit/ai-enrichment/red-flags.spec.js +227 -0
- package/dist/tests/unit/ai-enrichment/third-party-data-flow.spec.js +2 -2
- package/dist/tests/unit/ai-enrichment/third-party-evidence.spec.js +38 -34
- package/dist/tests/unit/cli/scan-command-ai-flags.spec.js +5 -3
- package/dist/tests/unit/cli/scan-command-e2e-backend-lambda-orphan.spec.js +60 -0
- package/dist/tests/unit/cli/scan-command-e2e-monorepo-app-plus-terraform.spec.js +2 -2
- package/dist/tests/unit/cli/scan-command-e2e-occupied-section-hubs.spec.js +58 -0
- package/dist/tests/unit/cli/scan-command-e2e-ruby-basic.spec.js +46 -0
- 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/cli/scan-quota-flow.spec.js +8 -0
- 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.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/fixtures/e2e-ts-sample/db-client-import.d.ts +0 -2
- package/dist/tests/fixtures/e2e-ts-sample/db-client-import.js +0 -8
- package/dist/tests/fixtures/e2e-ts-sample/db.d.ts +0 -3
- package/dist/tests/fixtures/e2e-ts-sample/db.js +0 -7
- package/dist/tests/fixtures/e2e-ts-sample/external-api.d.ts +0 -1
- package/dist/tests/fixtures/e2e-ts-sample/external-api.js +0 -18
- package/dist/tests/fixtures/e2e-ts-sample/pg-client.d.ts +0 -3
- package/dist/tests/fixtures/e2e-ts-sample/pg-client.js +0 -7
- package/dist/tests/fixtures/e2e-ts-sample/server.d.ts +0 -14
- package/dist/tests/fixtures/e2e-ts-sample/server.js +0 -4
- package/dist/tests/fixtures/e2e-ts-sentry-route-env/server.js +0 -24
- package/dist/tests/fixtures/ingest-basic/src/index.d.ts +0 -1
- package/dist/tests/fixtures/ingest-basic/src/index.js +0 -6
- package/dist/tests/fixtures/mixed-language-basic/api.d.ts +0 -2
- package/dist/tests/fixtures/mixed-language-basic/api.js +0 -12
- package/dist/tests/fixtures/monorepo-app-plus-terraform/packages/app/app/route.d.ts +0 -1
- package/dist/tests/fixtures/monorepo-app-plus-terraform/packages/app/app/route.js +0 -6
- package/dist/tests/fixtures/monorepo-front-back-sections/backend/app/route.d.ts +0 -1
- package/dist/tests/fixtures/monorepo-front-back-sections/backend/app/route.js +0 -6
- package/dist/tests/fixtures/monorepo-front-back-sections/frontend/app/route.d.ts +0 -1
- package/dist/tests/fixtures/monorepo-front-back-sections/frontend/app/route.js +0 -7
- package/dist/tests/fixtures/typescript-basic/app/route.d.ts +0 -1
- package/dist/tests/fixtures/typescript-basic/app/route.js +0 -7
- package/dist/tests/fixtures/typescript-basic/db-client-import.d.ts +0 -2
- package/dist/tests/fixtures/typescript-basic/db-client-import.js +0 -8
- package/dist/tests/fixtures/typescript-basic/db.d.ts +0 -3
- package/dist/tests/fixtures/typescript-basic/db.js +0 -7
- package/dist/tests/fixtures/typescript-basic/external-api.d.ts +0 -1
- package/dist/tests/fixtures/typescript-basic/external-api.js +0 -18
- package/dist/tests/fixtures/typescript-basic/pg-client.d.ts +0 -3
- package/dist/tests/fixtures/typescript-basic/pg-client.js +0 -7
- package/dist/tests/fixtures/typescript-basic/server.d.ts +0 -14
- package/dist/tests/fixtures/typescript-basic/server.js +0 -4
- package/dist/tests/fixtures/typescript-dependency-manifests-basic/src/index.d.ts +0 -0
- package/dist/tests/fixtures/typescript-dependency-manifests-basic/src/index.js +0 -2
- package/dist/tests/unit/analyzers/cpp/dependency-manifests.spec.js +0 -66
- 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
- /package/dist/{src/classifier/grouping.d.ts → tests/unit/ai-enrichment/red-flags.spec.d.ts} +0 -0
- /package/dist/tests/{fixtures/e2e-ts-sentry-route-env/server.d.ts → unit/cli/scan-command-e2e-backend-lambda-orphan.spec.d.ts} +0 -0
- /package/dist/tests/unit/{analyzers/cpp/dependency-manifests.spec.d.ts → cli/scan-command-e2e-occupied-section-hubs.spec.d.ts} +0 -0
- /package/dist/tests/unit/{analyzers/cpp/parser.spec.d.ts → cli/scan-command-e2e-ruby-basic.spec.d.ts} +0 -0
|
@@ -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,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import type { DiagramGraphJsonSchema } from
|
|
2
|
-
import { type DataflowWrapperSchema } from
|
|
3
|
-
import type { ScanResult } from
|
|
1
|
+
import type { DiagramGraphJsonSchema } from '../core/schema';
|
|
2
|
+
import { type DataflowWrapperSchema } from '../core/schema/dataflow-wrapper.schema';
|
|
3
|
+
import type { ScanResult } from '../core/types';
|
|
4
|
+
import type { ScanRedFlag } from '../ai-enrichment/red-flags';
|
|
4
5
|
export interface BuildDataflowWrapperOptions {
|
|
5
6
|
/**
|
|
6
7
|
* Optional schema version to embed in the wrapper.
|
|
@@ -12,6 +13,11 @@ export interface BuildDataflowWrapperOptions {
|
|
|
12
13
|
schemaVersion?: string;
|
|
13
14
|
/** Assessment / project name shown in the dashboard import preview. */
|
|
14
15
|
projectName?: string;
|
|
16
|
+
/**
|
|
17
|
+
* Connectivity RED flags from the CLI soft gate (after repair).
|
|
18
|
+
* Written under `metadata.redFlags` (passthrough metadata schema).
|
|
19
|
+
*/
|
|
20
|
+
redFlags?: ScanRedFlag[];
|
|
15
21
|
}
|
|
16
22
|
/**
|
|
17
23
|
* Assemble the top-level `dataflow.json` wrapper object from a scan result and graph.
|
|
@@ -39,6 +45,8 @@ export interface WriteDataflowJsonOptions {
|
|
|
39
45
|
schemaVersion?: string;
|
|
40
46
|
/** Assessment / project name stored in wrapper metadata for upload and preview. */
|
|
41
47
|
projectName?: string;
|
|
48
|
+
/** Optional connectivity RED flags for `metadata.redFlags`. */
|
|
49
|
+
redFlags?: ScanRedFlag[];
|
|
42
50
|
}
|
|
43
51
|
/**
|
|
44
52
|
* Validate and write a `dataflow.json` wrapper to disk.
|
package/dist/src/output/json.js
CHANGED
|
@@ -14,7 +14,7 @@ const dataflow_wrapper_schema_1 = require("../core/schema/dataflow-wrapper.schem
|
|
|
14
14
|
* just constructs a value that can then be validated and written by callers.
|
|
15
15
|
*/
|
|
16
16
|
function buildDataflowWrapper(scanResult, graph, options = {}) {
|
|
17
|
-
const schemaVersion = options.schemaVersion ??
|
|
17
|
+
const schemaVersion = options.schemaVersion ?? '1.0';
|
|
18
18
|
const projectName = options.projectName?.trim();
|
|
19
19
|
const metadata = {
|
|
20
20
|
componentsCount: scanResult.components.length,
|
|
@@ -28,7 +28,11 @@ function buildDataflowWrapper(scanResult, graph, options = {}) {
|
|
|
28
28
|
scanResult.aiInferenceSummary;
|
|
29
29
|
}
|
|
30
30
|
if (scanResult.terraformScanSummary) {
|
|
31
|
-
metadata.terraform =
|
|
31
|
+
metadata.terraform =
|
|
32
|
+
scanResult.terraformScanSummary;
|
|
33
|
+
}
|
|
34
|
+
if (options.redFlags && options.redFlags.length > 0) {
|
|
35
|
+
metadata.redFlags = options.redFlags;
|
|
32
36
|
}
|
|
33
37
|
return {
|
|
34
38
|
schemaVersion,
|
|
@@ -49,16 +53,17 @@ function buildDataflowWrapper(scanResult, graph, options = {}) {
|
|
|
49
53
|
* can emit a non-zero exit code.
|
|
50
54
|
*/
|
|
51
55
|
function writeDataflowJson(options) {
|
|
52
|
-
const { scanResult, graph, outputPath, schemaVersion, projectName } = options;
|
|
56
|
+
const { scanResult, graph, outputPath, schemaVersion, projectName, redFlags, } = options;
|
|
53
57
|
const wrapper = buildDataflowWrapper(scanResult, graph, {
|
|
54
58
|
schemaVersion,
|
|
55
59
|
projectName,
|
|
60
|
+
redFlags,
|
|
56
61
|
});
|
|
57
62
|
const validation = (0, dataflow_wrapper_schema_1.validateDataflowJson)(wrapper);
|
|
58
63
|
if (!validation.ok) {
|
|
59
|
-
const messages = validation.errors.join(
|
|
64
|
+
const messages = validation.errors.join('; ');
|
|
60
65
|
throw new Error(`Invalid dataflow.json wrapper: ${messages}`);
|
|
61
66
|
}
|
|
62
67
|
const json = JSON.stringify(validation.value, null, 2);
|
|
63
|
-
fs_1.default.writeFileSync(outputPath, json,
|
|
68
|
+
fs_1.default.writeFileSync(outputPath, json, 'utf8');
|
|
64
69
|
}
|
|
@@ -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);
|
|
@@ -1,106 +1,137 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const candidate_selector_1 = require("../../../src/ai-enrichment/candidate-selector");
|
|
4
|
-
describe(
|
|
5
|
-
it(
|
|
4
|
+
describe('ai-enrichment candidate selector', () => {
|
|
5
|
+
it('selects third-party, sparse property, flow direction, and missing interaction candidates', () => {
|
|
6
6
|
const sections = [
|
|
7
7
|
{
|
|
8
|
-
id:
|
|
9
|
-
label:
|
|
10
|
-
role:
|
|
11
|
-
sectionDir:
|
|
12
|
-
manifestPaths: [
|
|
8
|
+
id: 'frontend',
|
|
9
|
+
label: 'frontend',
|
|
10
|
+
role: 'service',
|
|
11
|
+
sectionDir: 'frontend',
|
|
12
|
+
manifestPaths: ['frontend/package.json'],
|
|
13
13
|
},
|
|
14
14
|
{
|
|
15
|
-
id:
|
|
16
|
-
label:
|
|
17
|
-
role:
|
|
18
|
-
sectionDir:
|
|
19
|
-
manifestPaths: [
|
|
15
|
+
id: 'backend',
|
|
16
|
+
label: 'backend',
|
|
17
|
+
role: 'service',
|
|
18
|
+
sectionDir: 'backend',
|
|
19
|
+
manifestPaths: ['backend/package.json'],
|
|
20
20
|
},
|
|
21
21
|
];
|
|
22
22
|
const components = [
|
|
23
23
|
{
|
|
24
|
-
id:
|
|
25
|
-
name:
|
|
26
|
-
type:
|
|
24
|
+
id: 'tp_1',
|
|
25
|
+
name: 'Stripe',
|
|
26
|
+
type: 'third_party',
|
|
27
27
|
confidence: 0.9,
|
|
28
28
|
detectedFrom: [],
|
|
29
29
|
sourceLocations: [],
|
|
30
|
-
properties: { section_id:
|
|
30
|
+
properties: { section_id: 'backend', dpa_signed: null },
|
|
31
31
|
},
|
|
32
32
|
{
|
|
33
|
-
id:
|
|
34
|
-
name:
|
|
35
|
-
type:
|
|
33
|
+
id: 'app_1',
|
|
34
|
+
name: 'Backend',
|
|
35
|
+
type: 'asset',
|
|
36
36
|
confidence: 0.95,
|
|
37
37
|
detectedFrom: [],
|
|
38
38
|
sourceLocations: [],
|
|
39
|
-
properties: { section_id:
|
|
39
|
+
properties: { section_id: 'backend', encryption_at_rest: null },
|
|
40
40
|
},
|
|
41
41
|
{
|
|
42
|
-
id:
|
|
43
|
-
name:
|
|
44
|
-
type:
|
|
42
|
+
id: 'actor_1',
|
|
43
|
+
name: 'Customer',
|
|
44
|
+
type: 'actor',
|
|
45
45
|
confidence: 0.7,
|
|
46
46
|
detectedFrom: [],
|
|
47
47
|
sourceLocations: [],
|
|
48
|
-
properties: { section_id:
|
|
48
|
+
properties: { section_id: 'frontend' },
|
|
49
49
|
},
|
|
50
50
|
];
|
|
51
51
|
const flows = [
|
|
52
52
|
{
|
|
53
|
-
id:
|
|
54
|
-
sourceComponentId:
|
|
55
|
-
targetComponentId:
|
|
56
|
-
type:
|
|
53
|
+
id: 'flow_1',
|
|
54
|
+
sourceComponentId: 'app_1',
|
|
55
|
+
targetComponentId: 'actor_1',
|
|
56
|
+
type: 'api_call',
|
|
57
57
|
confidence: 0.6,
|
|
58
58
|
},
|
|
59
59
|
];
|
|
60
|
-
const candidates = (0, candidate_selector_1.selectInferenceCandidates)({
|
|
60
|
+
const candidates = (0, candidate_selector_1.selectInferenceCandidates)({
|
|
61
|
+
components,
|
|
62
|
+
dataFlows: flows,
|
|
63
|
+
sections,
|
|
64
|
+
});
|
|
61
65
|
const candidateTypes = candidates.map((candidate) => candidate.candidateType);
|
|
62
|
-
expect(candidateTypes).toContain(
|
|
63
|
-
expect(candidateTypes).toContain(
|
|
64
|
-
expect(candidateTypes).toContain(
|
|
65
|
-
expect(candidateTypes).toContain(
|
|
66
|
+
expect(candidateTypes).toContain('third_party');
|
|
67
|
+
expect(candidateTypes).toContain('node_property');
|
|
68
|
+
expect(candidateTypes).toContain('flow_direction');
|
|
69
|
+
expect(candidateTypes).toContain('missing_interaction');
|
|
66
70
|
});
|
|
67
|
-
it(
|
|
71
|
+
it('third_party_only returns one third_party candidate per third-party and skips assets', () => {
|
|
68
72
|
const components = [
|
|
69
73
|
{
|
|
70
|
-
id:
|
|
71
|
-
name:
|
|
72
|
-
type:
|
|
74
|
+
id: 'tp_a',
|
|
75
|
+
name: 'Stripe',
|
|
76
|
+
type: 'third_party',
|
|
73
77
|
confidence: 0.9,
|
|
74
78
|
detectedFrom: [],
|
|
75
79
|
sourceLocations: [],
|
|
76
|
-
properties: { section_id:
|
|
80
|
+
properties: { section_id: 'backend', subType: 'payments' },
|
|
77
81
|
},
|
|
78
82
|
{
|
|
79
|
-
id:
|
|
80
|
-
name:
|
|
81
|
-
type:
|
|
83
|
+
id: 'tp_b',
|
|
84
|
+
name: 'Sentry',
|
|
85
|
+
type: 'third_party',
|
|
82
86
|
confidence: 0.85,
|
|
83
87
|
detectedFrom: [],
|
|
84
88
|
sourceLocations: [],
|
|
85
|
-
properties: { section_id:
|
|
89
|
+
properties: { section_id: 'backend' },
|
|
86
90
|
},
|
|
87
91
|
{
|
|
88
|
-
id:
|
|
89
|
-
name:
|
|
90
|
-
type:
|
|
92
|
+
id: 'app_1',
|
|
93
|
+
name: 'API',
|
|
94
|
+
type: 'asset',
|
|
91
95
|
confidence: 0.95,
|
|
92
96
|
detectedFrom: [],
|
|
93
97
|
sourceLocations: [],
|
|
94
|
-
properties: { section_id:
|
|
98
|
+
properties: { section_id: 'backend', encryption_at_rest: null },
|
|
95
99
|
},
|
|
96
100
|
];
|
|
97
101
|
const candidates = (0, candidate_selector_1.selectInferenceCandidates)({
|
|
98
102
|
components,
|
|
99
103
|
dataFlows: [],
|
|
100
|
-
inferenceScope:
|
|
104
|
+
inferenceScope: 'third_party_only',
|
|
101
105
|
});
|
|
102
106
|
expect(candidates).toHaveLength(2);
|
|
103
|
-
expect(candidates.every((c) => c.candidateType ===
|
|
104
|
-
expect(new Set(candidates.map((c) => c.componentId))).toEqual(new Set([
|
|
107
|
+
expect(candidates.every((c) => c.candidateType === 'third_party')).toBe(true);
|
|
108
|
+
expect(new Set(candidates.map((c) => c.componentId))).toEqual(new Set(['tp_a', 'tp_b']));
|
|
109
|
+
});
|
|
110
|
+
it('puts Tier 1 property keys first in bounded missingFields', () => {
|
|
111
|
+
const properties = Object.fromEntries(Array.from({ length: 40 }, (_, index) => [
|
|
112
|
+
`z_field_${String(index).padStart(2, '0')}`,
|
|
113
|
+
null,
|
|
114
|
+
]));
|
|
115
|
+
properties.encrypt_at_rest = null;
|
|
116
|
+
properties.authentication_method = null;
|
|
117
|
+
const candidates = (0, candidate_selector_1.selectInferenceCandidates)({
|
|
118
|
+
components: [
|
|
119
|
+
{
|
|
120
|
+
id: 'asset_1',
|
|
121
|
+
name: 'API',
|
|
122
|
+
type: 'asset',
|
|
123
|
+
confidence: 0.9,
|
|
124
|
+
detectedFrom: [],
|
|
125
|
+
sourceLocations: [],
|
|
126
|
+
properties,
|
|
127
|
+
},
|
|
128
|
+
],
|
|
129
|
+
dataFlows: [],
|
|
130
|
+
});
|
|
131
|
+
const propertyCandidate = candidates.find((candidate) => candidate.candidateType === 'node_property');
|
|
132
|
+
expect(propertyCandidate?.missingFields.slice(0, 2)).toEqual([
|
|
133
|
+
'authentication_method',
|
|
134
|
+
'encrypt_at_rest',
|
|
135
|
+
]);
|
|
105
136
|
});
|
|
106
137
|
});
|