@opensip-tools/fitness 1.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +4 -0
- package/.turbo/turbo-typecheck.log +4 -0
- package/LICENSE +21 -0
- package/dist/__tests__/gate.test.d.ts +13 -0
- package/dist/__tests__/gate.test.d.ts.map +1 -0
- package/dist/__tests__/gate.test.js +422 -0
- package/dist/__tests__/gate.test.js.map +1 -0
- package/dist/__tests__/sarif.test.d.ts +2 -0
- package/dist/__tests__/sarif.test.d.ts.map +1 -0
- package/dist/__tests__/sarif.test.js +169 -0
- package/dist/__tests__/sarif.test.js.map +1 -0
- package/dist/cli/dashboard.d.ts +6 -0
- package/dist/cli/dashboard.d.ts.map +1 -0
- package/dist/cli/dashboard.js +77 -0
- package/dist/cli/dashboard.js.map +1 -0
- package/dist/cli/fit.d.ts +37 -0
- package/dist/cli/fit.d.ts.map +1 -0
- package/dist/cli/fit.js +539 -0
- package/dist/cli/fit.js.map +1 -0
- package/dist/cli/list-checks.d.ts +6 -0
- package/dist/cli/list-checks.d.ts.map +1 -0
- package/dist/cli/list-checks.js +23 -0
- package/dist/cli/list-checks.js.map +1 -0
- package/dist/cli/list-recipes.d.ts +6 -0
- package/dist/cli/list-recipes.d.ts.map +1 -0
- package/dist/cli/list-recipes.js +31 -0
- package/dist/cli/list-recipes.js.map +1 -0
- package/dist/framework/__tests__/ast-utilities.test.d.ts +2 -0
- package/dist/framework/__tests__/ast-utilities.test.d.ts.map +1 -0
- package/dist/framework/__tests__/ast-utilities.test.js +153 -0
- package/dist/framework/__tests__/ast-utilities.test.js.map +1 -0
- package/dist/framework/__tests__/check-config.test.d.ts +2 -0
- package/dist/framework/__tests__/check-config.test.d.ts.map +1 -0
- package/dist/framework/__tests__/check-config.test.js +56 -0
- package/dist/framework/__tests__/check-config.test.js.map +1 -0
- package/dist/framework/__tests__/command-executor.test.d.ts +2 -0
- package/dist/framework/__tests__/command-executor.test.d.ts.map +1 -0
- package/dist/framework/__tests__/command-executor.test.js +71 -0
- package/dist/framework/__tests__/command-executor.test.js.map +1 -0
- package/dist/framework/__tests__/content-filter-dispatch.test.d.ts +2 -0
- package/dist/framework/__tests__/content-filter-dispatch.test.d.ts.map +1 -0
- package/dist/framework/__tests__/content-filter-dispatch.test.js +104 -0
- package/dist/framework/__tests__/content-filter-dispatch.test.js.map +1 -0
- package/dist/framework/__tests__/content-filter.test.d.ts +2 -0
- package/dist/framework/__tests__/content-filter.test.d.ts.map +1 -0
- package/dist/framework/__tests__/content-filter.test.js +126 -0
- package/dist/framework/__tests__/content-filter.test.js.map +1 -0
- package/dist/framework/__tests__/define-check.test.d.ts +2 -0
- package/dist/framework/__tests__/define-check.test.d.ts.map +1 -0
- package/dist/framework/__tests__/define-check.test.js +155 -0
- package/dist/framework/__tests__/define-check.test.js.map +1 -0
- package/dist/framework/__tests__/directive-inventory.test.d.ts +2 -0
- package/dist/framework/__tests__/directive-inventory.test.d.ts.map +1 -0
- package/dist/framework/__tests__/directive-inventory.test.js +44 -0
- package/dist/framework/__tests__/directive-inventory.test.js.map +1 -0
- package/dist/framework/__tests__/execution-context.test.d.ts +2 -0
- package/dist/framework/__tests__/execution-context.test.d.ts.map +1 -0
- package/dist/framework/__tests__/execution-context.test.js +62 -0
- package/dist/framework/__tests__/execution-context.test.js.map +1 -0
- package/dist/framework/__tests__/file-accessor.test.d.ts +2 -0
- package/dist/framework/__tests__/file-accessor.test.d.ts.map +1 -0
- package/dist/framework/__tests__/file-accessor.test.js +106 -0
- package/dist/framework/__tests__/file-accessor.test.js.map +1 -0
- package/dist/framework/__tests__/file-cache.test.d.ts +2 -0
- package/dist/framework/__tests__/file-cache.test.d.ts.map +1 -0
- package/dist/framework/__tests__/file-cache.test.js +122 -0
- package/dist/framework/__tests__/file-cache.test.js.map +1 -0
- package/dist/framework/__tests__/import-graph.test.d.ts +15 -0
- package/dist/framework/__tests__/import-graph.test.d.ts.map +1 -0
- package/dist/framework/__tests__/import-graph.test.js +164 -0
- package/dist/framework/__tests__/import-graph.test.js.map +1 -0
- package/dist/framework/__tests__/path-matcher.test.d.ts +2 -0
- package/dist/framework/__tests__/path-matcher.test.d.ts.map +1 -0
- package/dist/framework/__tests__/path-matcher.test.js +113 -0
- package/dist/framework/__tests__/path-matcher.test.js.map +1 -0
- package/dist/framework/__tests__/register-helpers.test.d.ts +2 -0
- package/dist/framework/__tests__/register-helpers.test.d.ts.map +1 -0
- package/dist/framework/__tests__/register-helpers.test.js +42 -0
- package/dist/framework/__tests__/register-helpers.test.js.map +1 -0
- package/dist/framework/__tests__/registry.test.d.ts +2 -0
- package/dist/framework/__tests__/registry.test.d.ts.map +1 -0
- package/dist/framework/__tests__/registry.test.js +208 -0
- package/dist/framework/__tests__/registry.test.js.map +1 -0
- package/dist/framework/__tests__/result-builder.test.d.ts +2 -0
- package/dist/framework/__tests__/result-builder.test.d.ts.map +1 -0
- package/dist/framework/__tests__/result-builder.test.js +153 -0
- package/dist/framework/__tests__/result-builder.test.js.map +1 -0
- package/dist/framework/__tests__/scope-resolver.test.d.ts +2 -0
- package/dist/framework/__tests__/scope-resolver.test.d.ts.map +1 -0
- package/dist/framework/__tests__/scope-resolver.test.js +140 -0
- package/dist/framework/__tests__/scope-resolver.test.js.map +1 -0
- package/dist/framework/__tests__/severity-mapping.test.d.ts +2 -0
- package/dist/framework/__tests__/severity-mapping.test.d.ts.map +1 -0
- package/dist/framework/__tests__/severity-mapping.test.js +42 -0
- package/dist/framework/__tests__/severity-mapping.test.js.map +1 -0
- package/dist/framework/__tests__/strip-literals.test.d.ts +2 -0
- package/dist/framework/__tests__/strip-literals.test.d.ts.map +1 -0
- package/dist/framework/__tests__/strip-literals.test.js +87 -0
- package/dist/framework/__tests__/strip-literals.test.js.map +1 -0
- package/dist/framework/abortable-exec.d.ts +34 -0
- package/dist/framework/abortable-exec.d.ts.map +1 -0
- package/dist/framework/abortable-exec.js +136 -0
- package/dist/framework/abortable-exec.js.map +1 -0
- package/dist/framework/ast-utilities.d.ts +41 -0
- package/dist/framework/ast-utilities.d.ts.map +1 -0
- package/dist/framework/ast-utilities.js +106 -0
- package/dist/framework/ast-utilities.js.map +1 -0
- package/dist/framework/check-config.d.ts +171 -0
- package/dist/framework/check-config.d.ts.map +1 -0
- package/dist/framework/check-config.js +114 -0
- package/dist/framework/check-config.js.map +1 -0
- package/dist/framework/check-types.d.ts +57 -0
- package/dist/framework/check-types.d.ts.map +1 -0
- package/dist/framework/check-types.js +35 -0
- package/dist/framework/check-types.js.map +1 -0
- package/dist/framework/command-executor.d.ts +25 -0
- package/dist/framework/command-executor.d.ts.map +1 -0
- package/dist/framework/command-executor.js +63 -0
- package/dist/framework/command-executor.js.map +1 -0
- package/dist/framework/constants.d.ts +9 -0
- package/dist/framework/constants.d.ts.map +1 -0
- package/dist/framework/constants.js +16 -0
- package/dist/framework/constants.js.map +1 -0
- package/dist/framework/content-filter.d.ts +33 -0
- package/dist/framework/content-filter.d.ts.map +1 -0
- package/dist/framework/content-filter.js +236 -0
- package/dist/framework/content-filter.js.map +1 -0
- package/dist/framework/define-check.d.ts +38 -0
- package/dist/framework/define-check.d.ts.map +1 -0
- package/dist/framework/define-check.js +252 -0
- package/dist/framework/define-check.js.map +1 -0
- package/dist/framework/directive-inventory.d.ts +34 -0
- package/dist/framework/directive-inventory.d.ts.map +1 -0
- package/dist/framework/directive-inventory.js +77 -0
- package/dist/framework/directive-inventory.js.map +1 -0
- package/dist/framework/directive-parsing.d.ts +20 -0
- package/dist/framework/directive-parsing.d.ts.map +1 -0
- package/dist/framework/directive-parsing.js +121 -0
- package/dist/framework/directive-parsing.js.map +1 -0
- package/dist/framework/execution-context.d.ts +95 -0
- package/dist/framework/execution-context.d.ts.map +1 -0
- package/dist/framework/execution-context.js +122 -0
- package/dist/framework/execution-context.js.map +1 -0
- package/dist/framework/file-accessor.d.ts +20 -0
- package/dist/framework/file-accessor.d.ts.map +1 -0
- package/dist/framework/file-accessor.js +122 -0
- package/dist/framework/file-accessor.js.map +1 -0
- package/dist/framework/file-cache.d.ts +70 -0
- package/dist/framework/file-cache.d.ts.map +1 -0
- package/dist/framework/file-cache.js +178 -0
- package/dist/framework/file-cache.js.map +1 -0
- package/dist/framework/file-type-filter.d.ts +11 -0
- package/dist/framework/file-type-filter.d.ts.map +1 -0
- package/dist/framework/file-type-filter.js +21 -0
- package/dist/framework/file-type-filter.js.map +1 -0
- package/dist/framework/ignore-processing.d.ts +22 -0
- package/dist/framework/ignore-processing.d.ts.map +1 -0
- package/dist/framework/ignore-processing.js +241 -0
- package/dist/framework/ignore-processing.js.map +1 -0
- package/dist/framework/import-graph.d.ts +51 -0
- package/dist/framework/import-graph.d.ts.map +1 -0
- package/dist/framework/import-graph.js +216 -0
- package/dist/framework/import-graph.js.map +1 -0
- package/dist/framework/memory-profiler.d.ts +53 -0
- package/dist/framework/memory-profiler.d.ts.map +1 -0
- package/dist/framework/memory-profiler.js +92 -0
- package/dist/framework/memory-profiler.js.map +1 -0
- package/dist/framework/parse-cache.d.ts +23 -0
- package/dist/framework/parse-cache.d.ts.map +1 -0
- package/dist/framework/parse-cache.js +37 -0
- package/dist/framework/parse-cache.js.map +1 -0
- package/dist/framework/path-matcher.d.ts +86 -0
- package/dist/framework/path-matcher.d.ts.map +1 -0
- package/dist/framework/path-matcher.js +138 -0
- package/dist/framework/path-matcher.js.map +1 -0
- package/dist/framework/register-helpers.d.ts +10 -0
- package/dist/framework/register-helpers.d.ts.map +1 -0
- package/dist/framework/register-helpers.js +17 -0
- package/dist/framework/register-helpers.js.map +1 -0
- package/dist/framework/registry.d.ts +41 -0
- package/dist/framework/registry.d.ts.map +1 -0
- package/dist/framework/registry.js +103 -0
- package/dist/framework/registry.js.map +1 -0
- package/dist/framework/result-builder.d.ts +74 -0
- package/dist/framework/result-builder.d.ts.map +1 -0
- package/dist/framework/result-builder.js +154 -0
- package/dist/framework/result-builder.js.map +1 -0
- package/dist/framework/scope-resolver.d.ts +23 -0
- package/dist/framework/scope-resolver.d.ts.map +1 -0
- package/dist/framework/scope-resolver.js +201 -0
- package/dist/framework/scope-resolver.js.map +1 -0
- package/dist/framework/severity-mapping.d.ts +13 -0
- package/dist/framework/severity-mapping.d.ts.map +1 -0
- package/dist/framework/severity-mapping.js +51 -0
- package/dist/framework/severity-mapping.js.map +1 -0
- package/dist/framework/strip-literals.d.ts +48 -0
- package/dist/framework/strip-literals.d.ts.map +1 -0
- package/dist/framework/strip-literals.js +188 -0
- package/dist/framework/strip-literals.js.map +1 -0
- package/dist/gate.d.ts +74 -0
- package/dist/gate.d.ts.map +1 -0
- package/dist/gate.js +257 -0
- package/dist/gate.js.map +1 -0
- package/dist/index.d.ts +47 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +51 -0
- package/dist/index.js.map +1 -0
- package/dist/plugins/__tests__/check-package-discovery.test.d.ts +2 -0
- package/dist/plugins/__tests__/check-package-discovery.test.d.ts.map +1 -0
- package/dist/plugins/__tests__/check-package-discovery.test.js +170 -0
- package/dist/plugins/__tests__/check-package-discovery.test.js.map +1 -0
- package/dist/plugins/__tests__/lang-domain.test.d.ts +2 -0
- package/dist/plugins/__tests__/lang-domain.test.d.ts.map +1 -0
- package/dist/plugins/__tests__/lang-domain.test.js +171 -0
- package/dist/plugins/__tests__/lang-domain.test.js.map +1 -0
- package/dist/plugins/__tests__/loader.test.d.ts +2 -0
- package/dist/plugins/__tests__/loader.test.d.ts.map +1 -0
- package/dist/plugins/__tests__/loader.test.js +194 -0
- package/dist/plugins/__tests__/loader.test.js.map +1 -0
- package/dist/plugins/check-package-discovery.d.ts +73 -0
- package/dist/plugins/check-package-discovery.d.ts.map +1 -0
- package/dist/plugins/check-package-discovery.js +212 -0
- package/dist/plugins/check-package-discovery.js.map +1 -0
- package/dist/plugins/loader.d.ts +31 -0
- package/dist/plugins/loader.d.ts.map +1 -0
- package/dist/plugins/loader.js +290 -0
- package/dist/plugins/loader.js.map +1 -0
- package/dist/plugins/types.d.ts +23 -0
- package/dist/plugins/types.d.ts.map +1 -0
- package/dist/plugins/types.js +9 -0
- package/dist/plugins/types.js.map +1 -0
- package/dist/recipes/__tests__/built-in-recipes.test.d.ts +2 -0
- package/dist/recipes/__tests__/built-in-recipes.test.d.ts.map +1 -0
- package/dist/recipes/__tests__/built-in-recipes.test.js +93 -0
- package/dist/recipes/__tests__/built-in-recipes.test.js.map +1 -0
- package/dist/recipes/__tests__/check-config.test.d.ts +5 -0
- package/dist/recipes/__tests__/check-config.test.d.ts.map +1 -0
- package/dist/recipes/__tests__/check-config.test.js +37 -0
- package/dist/recipes/__tests__/check-config.test.js.map +1 -0
- package/dist/recipes/__tests__/check-resolution.test.d.ts +2 -0
- package/dist/recipes/__tests__/check-resolution.test.d.ts.map +1 -0
- package/dist/recipes/__tests__/check-resolution.test.js +135 -0
- package/dist/recipes/__tests__/check-resolution.test.js.map +1 -0
- package/dist/recipes/__tests__/registry.test.d.ts +2 -0
- package/dist/recipes/__tests__/registry.test.d.ts.map +1 -0
- package/dist/recipes/__tests__/registry.test.js +97 -0
- package/dist/recipes/__tests__/registry.test.js.map +1 -0
- package/dist/recipes/__tests__/retry.test.d.ts +2 -0
- package/dist/recipes/__tests__/retry.test.d.ts.map +1 -0
- package/dist/recipes/__tests__/retry.test.js +75 -0
- package/dist/recipes/__tests__/retry.test.js.map +1 -0
- package/dist/recipes/__tests__/service.test.d.ts +11 -0
- package/dist/recipes/__tests__/service.test.d.ts.map +1 -0
- package/dist/recipes/__tests__/service.test.js +482 -0
- package/dist/recipes/__tests__/service.test.js.map +1 -0
- package/dist/recipes/built-in-recipes.d.ts +14 -0
- package/dist/recipes/built-in-recipes.d.ts.map +1 -0
- package/dist/recipes/built-in-recipes.js +247 -0
- package/dist/recipes/built-in-recipes.js.map +1 -0
- package/dist/recipes/check-config.d.ts +40 -0
- package/dist/recipes/check-config.d.ts.map +1 -0
- package/dist/recipes/check-config.js +61 -0
- package/dist/recipes/check-config.js.map +1 -0
- package/dist/recipes/check-resolution.d.ts +21 -0
- package/dist/recipes/check-resolution.d.ts.map +1 -0
- package/dist/recipes/check-resolution.js +121 -0
- package/dist/recipes/check-resolution.js.map +1 -0
- package/dist/recipes/check-result-processor.d.ts +51 -0
- package/dist/recipes/check-result-processor.d.ts.map +1 -0
- package/dist/recipes/check-result-processor.js +158 -0
- package/dist/recipes/check-result-processor.js.map +1 -0
- package/dist/recipes/parallel-execution.d.ts +33 -0
- package/dist/recipes/parallel-execution.d.ts.map +1 -0
- package/dist/recipes/parallel-execution.js +142 -0
- package/dist/recipes/parallel-execution.js.map +1 -0
- package/dist/recipes/registry.d.ts +81 -0
- package/dist/recipes/registry.d.ts.map +1 -0
- package/dist/recipes/registry.js +131 -0
- package/dist/recipes/registry.js.map +1 -0
- package/dist/recipes/retry.d.ts +25 -0
- package/dist/recipes/retry.d.ts.map +1 -0
- package/dist/recipes/retry.js +44 -0
- package/dist/recipes/retry.js.map +1 -0
- package/dist/recipes/sequential-execution.d.ts +10 -0
- package/dist/recipes/sequential-execution.d.ts.map +1 -0
- package/dist/recipes/sequential-execution.js +122 -0
- package/dist/recipes/sequential-execution.js.map +1 -0
- package/dist/recipes/service-types.d.ts +84 -0
- package/dist/recipes/service-types.d.ts.map +1 -0
- package/dist/recipes/service-types.js +8 -0
- package/dist/recipes/service-types.js.map +1 -0
- package/dist/recipes/service.d.ts +71 -0
- package/dist/recipes/service.d.ts.map +1 -0
- package/dist/recipes/service.js +331 -0
- package/dist/recipes/service.js.map +1 -0
- package/dist/recipes/types.d.ts +154 -0
- package/dist/recipes/types.d.ts.map +1 -0
- package/dist/recipes/types.js +54 -0
- package/dist/recipes/types.js.map +1 -0
- package/dist/sarif.d.ts +34 -0
- package/dist/sarif.d.ts.map +1 -0
- package/dist/sarif.js +192 -0
- package/dist/sarif.js.map +1 -0
- package/dist/signalers/__tests__/loader.test.d.ts +2 -0
- package/dist/signalers/__tests__/loader.test.d.ts.map +1 -0
- package/dist/signalers/__tests__/loader.test.js +74 -0
- package/dist/signalers/__tests__/loader.test.js.map +1 -0
- package/dist/signalers/index.d.ts +8 -0
- package/dist/signalers/index.d.ts.map +1 -0
- package/dist/signalers/index.js +9 -0
- package/dist/signalers/index.js.map +1 -0
- package/dist/signalers/loader.d.ts +24 -0
- package/dist/signalers/loader.d.ts.map +1 -0
- package/dist/signalers/loader.js +108 -0
- package/dist/signalers/loader.js.map +1 -0
- package/dist/signalers/schema.d.ts +288 -0
- package/dist/signalers/schema.d.ts.map +1 -0
- package/dist/signalers/schema.js +99 -0
- package/dist/signalers/schema.js.map +1 -0
- package/dist/signalers/types.d.ts +13 -0
- package/dist/signalers/types.d.ts.map +1 -0
- package/dist/signalers/types.js +5 -0
- package/dist/signalers/types.js.map +1 -0
- package/dist/targets/__tests__/loader.test.d.ts +2 -0
- package/dist/targets/__tests__/loader.test.d.ts.map +1 -0
- package/dist/targets/__tests__/loader.test.js +127 -0
- package/dist/targets/__tests__/loader.test.js.map +1 -0
- package/dist/targets/__tests__/resolver.test.d.ts +2 -0
- package/dist/targets/__tests__/resolver.test.d.ts.map +1 -0
- package/dist/targets/__tests__/resolver.test.js +54 -0
- package/dist/targets/__tests__/resolver.test.js.map +1 -0
- package/dist/targets/__tests__/target-registry.test.d.ts +2 -0
- package/dist/targets/__tests__/target-registry.test.d.ts.map +1 -0
- package/dist/targets/__tests__/target-registry.test.js +89 -0
- package/dist/targets/__tests__/target-registry.test.js.map +1 -0
- package/dist/targets/index.d.ts +10 -0
- package/dist/targets/index.d.ts.map +1 -0
- package/dist/targets/index.js +12 -0
- package/dist/targets/index.js.map +1 -0
- package/dist/targets/loader.d.ts +19 -0
- package/dist/targets/loader.d.ts.map +1 -0
- package/dist/targets/loader.js +159 -0
- package/dist/targets/loader.js.map +1 -0
- package/dist/targets/resolver.d.ts +19 -0
- package/dist/targets/resolver.d.ts.map +1 -0
- package/dist/targets/resolver.js +37 -0
- package/dist/targets/resolver.js.map +1 -0
- package/dist/targets/target-registry.d.ts +61 -0
- package/dist/targets/target-registry.d.ts.map +1 -0
- package/dist/targets/target-registry.js +93 -0
- package/dist/targets/target-registry.js.map +1 -0
- package/dist/targets/types.d.ts +85 -0
- package/dist/targets/types.d.ts.map +1 -0
- package/dist/targets/types.js +5 -0
- package/dist/targets/types.js.map +1 -0
- package/dist/tool.d.ts +17 -0
- package/dist/tool.d.ts.map +1 -0
- package/dist/tool.js +282 -0
- package/dist/tool.js.map +1 -0
- package/dist/types/findings.d.ts +117 -0
- package/dist/types/findings.d.ts.map +1 -0
- package/dist/types/findings.js +93 -0
- package/dist/types/findings.js.map +1 -0
- package/dist/types/severity.d.ts +15 -0
- package/dist/types/severity.d.ts.map +1 -0
- package/dist/types/severity.js +36 -0
- package/dist/types/severity.js.map +1 -0
- package/package.json +45 -0
- package/src/__tests__/gate.test.ts +537 -0
- package/src/__tests__/sarif.test.ts +201 -0
- package/src/cli/dashboard.ts +93 -0
- package/src/cli/fit.ts +612 -0
- package/src/cli/list-checks.ts +32 -0
- package/src/cli/list-recipes.ts +38 -0
- package/src/framework/__tests__/ast-utilities.test.ts +157 -0
- package/src/framework/__tests__/check-config.test.ts +65 -0
- package/src/framework/__tests__/command-executor.test.ts +79 -0
- package/src/framework/__tests__/content-filter-dispatch.test.ts +132 -0
- package/src/framework/__tests__/content-filter.test.ts +136 -0
- package/src/framework/__tests__/define-check.test.ts +180 -0
- package/src/framework/__tests__/directive-inventory.test.ts +53 -0
- package/src/framework/__tests__/execution-context.test.ts +80 -0
- package/src/framework/__tests__/file-accessor.test.ts +121 -0
- package/src/framework/__tests__/file-cache.test.ts +142 -0
- package/src/framework/__tests__/import-graph.test.ts +282 -0
- package/src/framework/__tests__/path-matcher.test.ts +130 -0
- package/src/framework/__tests__/register-helpers.test.ts +51 -0
- package/src/framework/__tests__/registry.test.ts +243 -0
- package/src/framework/__tests__/result-builder.test.ts +178 -0
- package/src/framework/__tests__/scope-resolver.test.ts +208 -0
- package/src/framework/__tests__/severity-mapping.test.ts +50 -0
- package/src/framework/__tests__/strip-literals.test.ts +109 -0
- package/src/framework/abortable-exec.ts +177 -0
- package/src/framework/ast-utilities.ts +112 -0
- package/src/framework/check-config.ts +339 -0
- package/src/framework/check-types.ts +77 -0
- package/src/framework/command-executor.ts +100 -0
- package/src/framework/constants.ts +16 -0
- package/src/framework/content-filter.ts +288 -0
- package/src/framework/define-check.ts +336 -0
- package/src/framework/directive-inventory.ts +110 -0
- package/src/framework/directive-parsing.ts +152 -0
- package/src/framework/execution-context.ts +247 -0
- package/src/framework/file-accessor.ts +171 -0
- package/src/framework/file-cache.ts +220 -0
- package/src/framework/file-type-filter.ts +25 -0
- package/src/framework/ignore-processing.ts +350 -0
- package/src/framework/import-graph.ts +280 -0
- package/src/framework/memory-profiler.ts +145 -0
- package/src/framework/parse-cache.ts +38 -0
- package/src/framework/path-matcher.ts +191 -0
- package/src/framework/register-helpers.ts +20 -0
- package/src/framework/registry.ts +125 -0
- package/src/framework/result-builder.ts +225 -0
- package/src/framework/scope-resolver.ts +262 -0
- package/src/framework/severity-mapping.ts +56 -0
- package/src/framework/strip-literals.ts +200 -0
- package/src/gate.ts +337 -0
- package/src/index.ts +110 -0
- package/src/plugins/__tests__/check-package-discovery.test.ts +204 -0
- package/src/plugins/__tests__/lang-domain.test.ts +198 -0
- package/src/plugins/__tests__/loader.test.ts +226 -0
- package/src/plugins/check-package-discovery.ts +242 -0
- package/src/plugins/loader.ts +327 -0
- package/src/plugins/types.ts +25 -0
- package/src/recipes/__tests__/built-in-recipes.test.ts +107 -0
- package/src/recipes/__tests__/check-config.test.ts +51 -0
- package/src/recipes/__tests__/check-resolution.test.ts +185 -0
- package/src/recipes/__tests__/registry.test.ts +115 -0
- package/src/recipes/__tests__/retry.test.ts +83 -0
- package/src/recipes/__tests__/service.test.ts +572 -0
- package/src/recipes/built-in-recipes.ts +273 -0
- package/src/recipes/check-config.ts +64 -0
- package/src/recipes/check-resolution.ts +169 -0
- package/src/recipes/check-result-processor.ts +258 -0
- package/src/recipes/parallel-execution.ts +220 -0
- package/src/recipes/registry.ts +192 -0
- package/src/recipes/retry.ts +69 -0
- package/src/recipes/sequential-execution.ts +139 -0
- package/src/recipes/service-types.ts +105 -0
- package/src/recipes/service.ts +400 -0
- package/src/recipes/types.ts +247 -0
- package/src/sarif.ts +232 -0
- package/src/signalers/__tests__/loader.test.ts +99 -0
- package/src/signalers/index.ts +9 -0
- package/src/signalers/loader.ts +141 -0
- package/src/signalers/schema.ts +117 -0
- package/src/signalers/types.ts +15 -0
- package/src/targets/__tests__/loader.test.ts +170 -0
- package/src/targets/__tests__/resolver.test.ts +74 -0
- package/src/targets/__tests__/target-registry.test.ts +103 -0
- package/src/targets/index.ts +13 -0
- package/src/targets/loader.ts +214 -0
- package/src/targets/resolver.ts +44 -0
- package/src/targets/target-registry.ts +111 -0
- package/src/targets/types.ts +89 -0
- package/src/tool.ts +302 -0
- package/src/types/findings.ts +239 -0
- package/src/types/severity.ts +39 -0
- package/tsconfig.json +8 -0
- package/vitest.config.ts +33 -0
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
import { describe, it, expect } from 'vitest';
|
|
2
|
+
|
|
3
|
+
import { buildSarifLog, chunkSarifRuns } from '../sarif.js';
|
|
4
|
+
|
|
5
|
+
import type { CliOutput } from '@opensip-tools/contracts';
|
|
6
|
+
|
|
7
|
+
function makeSampleOutput(): CliOutput {
|
|
8
|
+
return {
|
|
9
|
+
version: '1.0',
|
|
10
|
+
tool: 'fit',
|
|
11
|
+
timestamp: '2026-03-31T00:00:00.000Z',
|
|
12
|
+
score: 85,
|
|
13
|
+
passed: true,
|
|
14
|
+
summary: { total: 2, passed: 1, failed: 1, errors: 2, warnings: 1 },
|
|
15
|
+
durationMs: 1500,
|
|
16
|
+
checks: [
|
|
17
|
+
{
|
|
18
|
+
checkSlug: 'no-console-log',
|
|
19
|
+
passed: false,
|
|
20
|
+
durationMs: 100,
|
|
21
|
+
findings: [
|
|
22
|
+
{
|
|
23
|
+
ruleId: 'no-console-log',
|
|
24
|
+
message: 'console.log found',
|
|
25
|
+
severity: 'error',
|
|
26
|
+
filePath: 'src/index.ts',
|
|
27
|
+
line: 42,
|
|
28
|
+
column: 5,
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
ruleId: 'no-console-log',
|
|
32
|
+
message: 'console.warn found',
|
|
33
|
+
severity: 'warning',
|
|
34
|
+
filePath: 'src/utils.ts',
|
|
35
|
+
line: 10,
|
|
36
|
+
suggestion: 'Use a logger',
|
|
37
|
+
},
|
|
38
|
+
],
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
checkSlug: 'require-error-handling',
|
|
42
|
+
passed: true,
|
|
43
|
+
durationMs: 80,
|
|
44
|
+
findings: [],
|
|
45
|
+
},
|
|
46
|
+
],
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
describe('buildSarifLog', () => {
|
|
51
|
+
it('returns SARIF 2.1.0 structure', () => {
|
|
52
|
+
const sarif = buildSarifLog(makeSampleOutput());
|
|
53
|
+
|
|
54
|
+
expect(sarif.version).toBe('2.1.0');
|
|
55
|
+
expect(sarif.$schema).toContain('sarif-schema-2.1.0');
|
|
56
|
+
expect(Array.isArray(sarif.runs)).toBe(true);
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
it('creates one run per check with findings', () => {
|
|
60
|
+
const sarif = buildSarifLog(makeSampleOutput());
|
|
61
|
+
const runs = sarif.runs as Record<string, unknown>[];
|
|
62
|
+
|
|
63
|
+
// Only 1 check has findings (no-console-log); require-error-handling has 0
|
|
64
|
+
expect(runs).toHaveLength(1);
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
it('uses check slug as tool driver name', () => {
|
|
68
|
+
const sarif = buildSarifLog(makeSampleOutput());
|
|
69
|
+
const runs = sarif.runs as { tool: { driver: { name: string } } }[];
|
|
70
|
+
|
|
71
|
+
expect(runs[0].tool.driver.name).toBe('no-console-log');
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
it('includes file locations in results', () => {
|
|
75
|
+
const sarif = buildSarifLog(makeSampleOutput());
|
|
76
|
+
const runs = sarif.runs as { results: Record<string, unknown>[] }[];
|
|
77
|
+
const results = runs[0].results;
|
|
78
|
+
|
|
79
|
+
expect(results).toHaveLength(2);
|
|
80
|
+
|
|
81
|
+
// First result has full location
|
|
82
|
+
const first = results[0] as { locations: { physicalLocation: { artifactLocation: { uri: string }; region: { startLine?: number; startColumn?: number } } }[] };
|
|
83
|
+
expect(first.locations[0].physicalLocation.artifactLocation.uri).toBe('src/index.ts');
|
|
84
|
+
expect(first.locations[0].physicalLocation.region.startLine).toBe(42);
|
|
85
|
+
expect(first.locations[0].physicalLocation.region.startColumn).toBe(5);
|
|
86
|
+
});
|
|
87
|
+
|
|
88
|
+
it('maps severity to SARIF levels', () => {
|
|
89
|
+
const sarif = buildSarifLog(makeSampleOutput());
|
|
90
|
+
const runs = sarif.runs as { results: { level: string }[] }[];
|
|
91
|
+
const results = runs[0].results;
|
|
92
|
+
|
|
93
|
+
expect(results[0].level).toBe('error');
|
|
94
|
+
expect(results[1].level).toBe('warning');
|
|
95
|
+
});
|
|
96
|
+
|
|
97
|
+
it('includes suggestions as fixes', () => {
|
|
98
|
+
const sarif = buildSarifLog(makeSampleOutput());
|
|
99
|
+
const runs = sarif.runs as { results: Record<string, unknown>[] }[];
|
|
100
|
+
const second = runs[0].results[1] as { fixes: { description: { text: string } }[] };
|
|
101
|
+
|
|
102
|
+
expect(second.fixes[0].description.text).toBe('Use a logger');
|
|
103
|
+
});
|
|
104
|
+
|
|
105
|
+
it('includes rule IDs in driver rules', () => {
|
|
106
|
+
const sarif = buildSarifLog(makeSampleOutput());
|
|
107
|
+
const runs = sarif.runs as { tool: { driver: { rules: { id: string }[] } } }[];
|
|
108
|
+
|
|
109
|
+
const ruleIds = runs[0].tool.driver.rules.map((r) => r.id);
|
|
110
|
+
expect(ruleIds).toContain('no-console-log');
|
|
111
|
+
});
|
|
112
|
+
|
|
113
|
+
it('returns empty runs for output with no findings', () => {
|
|
114
|
+
const output = makeSampleOutput();
|
|
115
|
+
// Clear all findings
|
|
116
|
+
const cleanOutput: CliOutput = {
|
|
117
|
+
...output,
|
|
118
|
+
checks: output.checks.map((ch) => ({ ...ch, findings: [] })),
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
const sarif = buildSarifLog(cleanOutput);
|
|
122
|
+
const runs = sarif.runs as unknown[];
|
|
123
|
+
expect(runs).toHaveLength(0);
|
|
124
|
+
});
|
|
125
|
+
});
|
|
126
|
+
|
|
127
|
+
// ─── chunkSarifRuns ───────────────────────────────────────────────
|
|
128
|
+
|
|
129
|
+
function makeRun(name: string, findingCount: number) {
|
|
130
|
+
return {
|
|
131
|
+
tool: {
|
|
132
|
+
driver: {
|
|
133
|
+
name,
|
|
134
|
+
version: '1.0.0',
|
|
135
|
+
rules: [{ id: name }],
|
|
136
|
+
},
|
|
137
|
+
},
|
|
138
|
+
results: Array.from({ length: findingCount }, (_, i) => ({
|
|
139
|
+
ruleId: name,
|
|
140
|
+
message: { text: `finding ${i}` },
|
|
141
|
+
level: 'warning',
|
|
142
|
+
})),
|
|
143
|
+
};
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
describe('chunkSarifRuns', () => {
|
|
147
|
+
it('returns empty array for empty runs', () => {
|
|
148
|
+
expect(chunkSarifRuns([])).toEqual([]);
|
|
149
|
+
});
|
|
150
|
+
|
|
151
|
+
it('keeps small runs in a single chunk', () => {
|
|
152
|
+
const runs = [makeRun('a', 100), makeRun('b', 200)];
|
|
153
|
+
const chunks = chunkSarifRuns(runs, 500);
|
|
154
|
+
expect(chunks).toHaveLength(1);
|
|
155
|
+
expect(chunks[0]).toHaveLength(2);
|
|
156
|
+
});
|
|
157
|
+
|
|
158
|
+
it('splits into multiple chunks when findings exceed limit', () => {
|
|
159
|
+
const runs = [makeRun('a', 300), makeRun('b', 300)];
|
|
160
|
+
const chunks = chunkSarifRuns(runs, 500);
|
|
161
|
+
expect(chunks).toHaveLength(2);
|
|
162
|
+
expect(chunks[0][0].results).toHaveLength(300);
|
|
163
|
+
expect(chunks[1][0].results).toHaveLength(300);
|
|
164
|
+
});
|
|
165
|
+
|
|
166
|
+
it('splits a single large run across multiple chunks', () => {
|
|
167
|
+
const runs = [makeRun('big', 1200)];
|
|
168
|
+
const chunks = chunkSarifRuns(runs, 500);
|
|
169
|
+
expect(chunks).toHaveLength(3);
|
|
170
|
+
expect(chunks[0][0].results).toHaveLength(500);
|
|
171
|
+
expect(chunks[1][0].results).toHaveLength(500);
|
|
172
|
+
expect(chunks[2][0].results).toHaveLength(200);
|
|
173
|
+
// Each split chunk preserves the tool driver name
|
|
174
|
+
for (const chunk of chunks) {
|
|
175
|
+
expect(chunk[0].tool.driver.name).toBe('big');
|
|
176
|
+
}
|
|
177
|
+
});
|
|
178
|
+
|
|
179
|
+
it('preserves total finding count across all chunks', () => {
|
|
180
|
+
const runs = [makeRun('a', 450), makeRun('b', 300), makeRun('c', 750)];
|
|
181
|
+
const chunks = chunkSarifRuns(runs, 500);
|
|
182
|
+
const total = chunks.reduce(
|
|
183
|
+
(sum, chunk) => sum + chunk.reduce((s, r) => s + r.results.length, 0),
|
|
184
|
+
0,
|
|
185
|
+
);
|
|
186
|
+
expect(total).toBe(1500);
|
|
187
|
+
});
|
|
188
|
+
|
|
189
|
+
it('packs multiple small runs into one chunk up to the limit', () => {
|
|
190
|
+
const runs = [makeRun('a', 100), makeRun('b', 100), makeRun('c', 100), makeRun('d', 100), makeRun('e', 100)];
|
|
191
|
+
const chunks = chunkSarifRuns(runs, 500);
|
|
192
|
+
expect(chunks).toHaveLength(1);
|
|
193
|
+
expect(chunks[0]).toHaveLength(5);
|
|
194
|
+
});
|
|
195
|
+
|
|
196
|
+
it('starts a new chunk when next run would exceed limit', () => {
|
|
197
|
+
const runs = [makeRun('a', 400), makeRun('b', 400)];
|
|
198
|
+
const chunks = chunkSarifRuns(runs, 500);
|
|
199
|
+
expect(chunks).toHaveLength(2);
|
|
200
|
+
});
|
|
201
|
+
});
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* dashboard command — generate HTML report and open in browser
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { execFileSync } from 'node:child_process';
|
|
6
|
+
import { writeFileSync } from 'node:fs';
|
|
7
|
+
import { join } from 'node:path';
|
|
8
|
+
|
|
9
|
+
import {
|
|
10
|
+
loadSessions,
|
|
11
|
+
getReportsDir,
|
|
12
|
+
generateDashboardHtml,
|
|
13
|
+
type CheckCatalogEntry,
|
|
14
|
+
type RecipeCatalogEntry,
|
|
15
|
+
type DashboardResult,
|
|
16
|
+
} from '@opensip-tools/contracts';
|
|
17
|
+
|
|
18
|
+
import { defaultRegistry } from '../framework/registry.js';
|
|
19
|
+
import { defaultRecipeRegistry } from '../recipes/registry.js';
|
|
20
|
+
|
|
21
|
+
import { ensureChecksLoaded, getDisplayName, getIcon } from './fit.js';
|
|
22
|
+
|
|
23
|
+
// ---------------------------------------------------------------------------
|
|
24
|
+
// openDashboard
|
|
25
|
+
// ---------------------------------------------------------------------------
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* "built-in" vs "community" classification for the dashboard catalog.
|
|
29
|
+
* Anything registered under the @opensip-tools/ scope is first-party;
|
|
30
|
+
* anything else (loose plugin file, third-party npm package) is
|
|
31
|
+
* community. We no longer match a single magic package name — the
|
|
32
|
+
* scope rule keeps working when checks-builtin is split into multiple
|
|
33
|
+
* first-party packages (checks-typescript, checks-universal, etc).
|
|
34
|
+
*/
|
|
35
|
+
const FIRST_PARTY_SCOPE = '@opensip-tools/';
|
|
36
|
+
|
|
37
|
+
function classifyCheckSource(namespace: string | undefined): 'built-in' | 'community' {
|
|
38
|
+
return namespace?.startsWith(FIRST_PARTY_SCOPE) ? 'built-in' : 'community';
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export async function openDashboard(projectDir?: string): Promise<DashboardResult> {
|
|
42
|
+
await ensureChecksLoaded(projectDir);
|
|
43
|
+
|
|
44
|
+
const sessions = loadSessions(20);
|
|
45
|
+
|
|
46
|
+
const catalog: CheckCatalogEntry[] = defaultRegistry.list().map(check => {
|
|
47
|
+
const namespace = defaultRegistry.getNamespace(check.config.slug);
|
|
48
|
+
return {
|
|
49
|
+
slug: check.config.slug,
|
|
50
|
+
name: getDisplayName(check.config.slug),
|
|
51
|
+
icon: getIcon(check.config.slug),
|
|
52
|
+
description: check.config.description,
|
|
53
|
+
longDescription: check.config.longDescription,
|
|
54
|
+
tags: [...(check.config.tags ?? [])],
|
|
55
|
+
confidence: check.config.confidence ?? 'medium',
|
|
56
|
+
source: classifyCheckSource(namespace),
|
|
57
|
+
};
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
// Collect recipe catalog
|
|
61
|
+
const recipes: RecipeCatalogEntry[] = [...defaultRecipeRegistry.getAllRecipes()].map(r => ({
|
|
62
|
+
name: r.name,
|
|
63
|
+
displayName: r.displayName,
|
|
64
|
+
description: r.description,
|
|
65
|
+
tags: [...(r.tags ?? [])],
|
|
66
|
+
selectorType: r.checks.type,
|
|
67
|
+
mode: r.execution.mode,
|
|
68
|
+
timeout: r.execution.timeout ?? 30_000,
|
|
69
|
+
}));
|
|
70
|
+
|
|
71
|
+
const html = generateDashboardHtml(sessions, catalog, recipes);
|
|
72
|
+
const reportPath = join(getReportsDir(), 'latest.html');
|
|
73
|
+
writeFileSync(reportPath, html, 'utf8');
|
|
74
|
+
|
|
75
|
+
// Try to open in browser
|
|
76
|
+
let opened = false;
|
|
77
|
+
try {
|
|
78
|
+
const platform = process.platform;
|
|
79
|
+
const execOpts = { timeout: 5000 };
|
|
80
|
+
if (platform === 'darwin') execFileSync('open', [reportPath], execOpts);
|
|
81
|
+
else if (platform === 'linux') execFileSync('xdg-open', [reportPath], execOpts);
|
|
82
|
+
else if (platform === 'win32') execFileSync('cmd', ['/c', 'start', '', reportPath], execOpts);
|
|
83
|
+
opened = true;
|
|
84
|
+
} catch {
|
|
85
|
+
// Could not open — user will need to open manually
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
return {
|
|
89
|
+
type: 'dashboard',
|
|
90
|
+
path: reportPath,
|
|
91
|
+
opened,
|
|
92
|
+
};
|
|
93
|
+
}
|