@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,188 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Shared utilities for stripping string literal and comment
|
|
3
|
+
* content from source code. Used by fitness checks to avoid false positives
|
|
4
|
+
* from patterns appearing inside string literals or comments.
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Strip string literal contents from a single line.
|
|
8
|
+
* Replaces content inside '...', "...", and `...` with empty strings.
|
|
9
|
+
* Used by checks for per-line pattern matching to avoid false positives
|
|
10
|
+
* from patterns appearing inside string literals.
|
|
11
|
+
*/
|
|
12
|
+
export function stripStringLiterals(line) {
|
|
13
|
+
return line
|
|
14
|
+
.replaceAll(/'(?:[^'\\]|\\.)*'/g, "''")
|
|
15
|
+
.replaceAll(/"(?:[^"\\]|\\.)*"/g, '""')
|
|
16
|
+
.replaceAll(/`(?:[^`\\]|\\.)*`/gs, '``');
|
|
17
|
+
}
|
|
18
|
+
/** Shared regex patterns for string literal replacement */
|
|
19
|
+
const SINGLE_QUOTE_RE = /'(?:[^'\\]|\\.)*'/g;
|
|
20
|
+
const DOUBLE_QUOTE_RE = /"(?:[^"\\]|\\.)*"/g;
|
|
21
|
+
const BACKTICK_RE = /`(?:[^`\\]|\\.)*`/gs;
|
|
22
|
+
/**
|
|
23
|
+
* Strip string literals and single-line comments from full file content.
|
|
24
|
+
* Used by checks for quick-filter gates to avoid matching keywords
|
|
25
|
+
* that only appear in documentation strings or comments.
|
|
26
|
+
*/
|
|
27
|
+
/**
|
|
28
|
+
* Check if a position in a line is inside a string literal.
|
|
29
|
+
* Scans characters before the match position for unescaped quotes/backticks.
|
|
30
|
+
* Used by checks to avoid false positives from suggestion/description text.
|
|
31
|
+
*/
|
|
32
|
+
export function isInsideStringLiteral(line, matchIndex) {
|
|
33
|
+
let inSingle = false;
|
|
34
|
+
let inDouble = false;
|
|
35
|
+
let inTemplate = false;
|
|
36
|
+
let escaped = false;
|
|
37
|
+
for (let i = 0; i < matchIndex; i++) {
|
|
38
|
+
const ch = line[i];
|
|
39
|
+
if (escaped) {
|
|
40
|
+
escaped = false;
|
|
41
|
+
continue;
|
|
42
|
+
}
|
|
43
|
+
if (ch === '\\' && (inSingle || inDouble || inTemplate)) {
|
|
44
|
+
escaped = true;
|
|
45
|
+
continue;
|
|
46
|
+
}
|
|
47
|
+
if (ch === "'" && !inDouble && !inTemplate)
|
|
48
|
+
inSingle = !inSingle;
|
|
49
|
+
else if (ch === '"' && !inSingle && !inTemplate)
|
|
50
|
+
inDouble = !inDouble;
|
|
51
|
+
else if (ch === '`' && !inSingle && !inDouble)
|
|
52
|
+
inTemplate = !inTemplate;
|
|
53
|
+
}
|
|
54
|
+
return inSingle || inDouble || inTemplate;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Strip string literals and single-line comments from full file content.
|
|
58
|
+
* Used by checks for quick-filter gates to avoid matching keywords
|
|
59
|
+
* that only appear in documentation strings or comments.
|
|
60
|
+
*/
|
|
61
|
+
export function stripStringsAndComments(content) {
|
|
62
|
+
// Strip string literals first
|
|
63
|
+
let result = content
|
|
64
|
+
.replaceAll(SINGLE_QUOTE_RE, "''")
|
|
65
|
+
.replaceAll(DOUBLE_QUOTE_RE, '""')
|
|
66
|
+
.replaceAll(BACKTICK_RE, '``');
|
|
67
|
+
// Strip single-line comments (after string stripping to avoid matching // inside strings)
|
|
68
|
+
// eslint-disable-next-line sonarjs/slow-regex -- .*$ anchored to line end; linear scan
|
|
69
|
+
result = result.replaceAll(/\/\/.*$/gm, '');
|
|
70
|
+
return result;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Strip strings, single-line comments, AND block comments while preserving
|
|
74
|
+
* BOTH character positions and line numbers. Each stripped character is
|
|
75
|
+
* replaced with a space (non-newline) so the output has identical length
|
|
76
|
+
* and line offsets to the input. Use this when downstream processing
|
|
77
|
+
* needs to map a match index back to a line number in the ORIGINAL
|
|
78
|
+
* source — `stripStringsAndComments` collapses string literals to empty
|
|
79
|
+
* pairs, which shifts indexes and breaks `getLineNumber(content, idx)`.
|
|
80
|
+
*
|
|
81
|
+
* Strips:
|
|
82
|
+
* - Single-quoted, double-quoted, and template-literal string contents
|
|
83
|
+
* - Single-line `// ...` comments (to end of line)
|
|
84
|
+
* - Block `/* ... *\/` comments (including JSDoc `/** ... *\/`)
|
|
85
|
+
*
|
|
86
|
+
* Preserves: newlines, total character count, character positions of
|
|
87
|
+
* code OUTSIDE these regions.
|
|
88
|
+
*/
|
|
89
|
+
// eslint-disable-next-line sonarjs/cognitive-complexity -- token-state-machine: single-pass tokenizer, branches reflect quote/comment state
|
|
90
|
+
export function stripStringsAndCommentsPreservingPositions(content) {
|
|
91
|
+
const out = [];
|
|
92
|
+
let i = 0;
|
|
93
|
+
let inSingle = false;
|
|
94
|
+
let inDouble = false;
|
|
95
|
+
let inTemplate = false;
|
|
96
|
+
let inLineComment = false;
|
|
97
|
+
let inBlockComment = false;
|
|
98
|
+
let escaped = false;
|
|
99
|
+
while (i < content.length) {
|
|
100
|
+
const ch = content[i];
|
|
101
|
+
const next = content[i + 1];
|
|
102
|
+
// Inside any string: blank out chars (preserve newlines) until terminator.
|
|
103
|
+
if (inSingle || inDouble || inTemplate) {
|
|
104
|
+
if (escaped) {
|
|
105
|
+
out.push(ch === '\n' ? '\n' : ' ');
|
|
106
|
+
escaped = false;
|
|
107
|
+
i++;
|
|
108
|
+
continue;
|
|
109
|
+
}
|
|
110
|
+
if (ch === '\\') {
|
|
111
|
+
out.push(' ');
|
|
112
|
+
escaped = true;
|
|
113
|
+
i++;
|
|
114
|
+
continue;
|
|
115
|
+
}
|
|
116
|
+
if ((ch === "'" && inSingle) || (ch === '"' && inDouble) || (ch === '`' && inTemplate)) {
|
|
117
|
+
// Keep terminator for symmetry — replace with space too. The
|
|
118
|
+
// string itself is gone; outer code doesn't care about the quote.
|
|
119
|
+
out.push(' ');
|
|
120
|
+
inSingle = inDouble = inTemplate = false;
|
|
121
|
+
i++;
|
|
122
|
+
continue;
|
|
123
|
+
}
|
|
124
|
+
out.push(ch === '\n' ? '\n' : ' ');
|
|
125
|
+
i++;
|
|
126
|
+
continue;
|
|
127
|
+
}
|
|
128
|
+
// Inside line comment: blank to end of line.
|
|
129
|
+
if (inLineComment) {
|
|
130
|
+
if (ch === '\n') {
|
|
131
|
+
inLineComment = false;
|
|
132
|
+
out.push('\n');
|
|
133
|
+
}
|
|
134
|
+
else {
|
|
135
|
+
out.push(' ');
|
|
136
|
+
}
|
|
137
|
+
i++;
|
|
138
|
+
continue;
|
|
139
|
+
}
|
|
140
|
+
// Inside block comment: blank until `*/`.
|
|
141
|
+
if (inBlockComment) {
|
|
142
|
+
if (ch === '*' && next === '/') {
|
|
143
|
+
out.push(' ');
|
|
144
|
+
inBlockComment = false;
|
|
145
|
+
i += 2;
|
|
146
|
+
continue;
|
|
147
|
+
}
|
|
148
|
+
out.push(ch === '\n' ? '\n' : ' ');
|
|
149
|
+
i++;
|
|
150
|
+
continue;
|
|
151
|
+
}
|
|
152
|
+
// Outside any region: detect openers.
|
|
153
|
+
if (ch === '/' && next === '/') {
|
|
154
|
+
out.push(' ');
|
|
155
|
+
inLineComment = true;
|
|
156
|
+
i += 2;
|
|
157
|
+
continue;
|
|
158
|
+
}
|
|
159
|
+
if (ch === '/' && next === '*') {
|
|
160
|
+
out.push(' ');
|
|
161
|
+
inBlockComment = true;
|
|
162
|
+
i += 2;
|
|
163
|
+
continue;
|
|
164
|
+
}
|
|
165
|
+
if (ch === "'") {
|
|
166
|
+
out.push(' ');
|
|
167
|
+
inSingle = true;
|
|
168
|
+
i++;
|
|
169
|
+
continue;
|
|
170
|
+
}
|
|
171
|
+
if (ch === '"') {
|
|
172
|
+
out.push(' ');
|
|
173
|
+
inDouble = true;
|
|
174
|
+
i++;
|
|
175
|
+
continue;
|
|
176
|
+
}
|
|
177
|
+
if (ch === '`') {
|
|
178
|
+
out.push(' ');
|
|
179
|
+
inTemplate = true;
|
|
180
|
+
i++;
|
|
181
|
+
continue;
|
|
182
|
+
}
|
|
183
|
+
out.push(ch);
|
|
184
|
+
i++;
|
|
185
|
+
}
|
|
186
|
+
return out.join('');
|
|
187
|
+
}
|
|
188
|
+
//# sourceMappingURL=strip-literals.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"strip-literals.js","sourceRoot":"","sources":["../../src/framework/strip-literals.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;;GAKG;AACH,MAAM,UAAU,mBAAmB,CAAC,IAAY;IAC9C,OAAO,IAAI;SACR,UAAU,CAAC,oBAAoB,EAAE,IAAI,CAAC;SACtC,UAAU,CAAC,oBAAoB,EAAE,IAAI,CAAC;SACtC,UAAU,CAAC,qBAAqB,EAAE,IAAI,CAAC,CAAA;AAC5C,CAAC;AAED,2DAA2D;AAC3D,MAAM,eAAe,GAAG,oBAAoB,CAAA;AAC5C,MAAM,eAAe,GAAG,oBAAoB,CAAA;AAC5C,MAAM,WAAW,GAAG,qBAAqB,CAAA;AAEzC;;;;GAIG;AACH;;;;GAIG;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CAAA;YACpB,CAAC,IAAI,CAAC,CAAA;YACN,SAAQ;QACV,CAAC;QACD,IAAI,EAAE,KAAK,GAAG,IAAI,IAAI,KAAK,GAAG,EAAE,CAAC;YAC/B,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;YACd,cAAc,GAAG,IAAI,CAAA;YACrB,CAAC,IAAI,CAAC,CAAA;YACN,SAAQ;QACV,CAAC;QACD,IAAI,EAAE,KAAK,GAAG,EAAE,CAAC;YACf,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;YACb,QAAQ,GAAG,IAAI,CAAA;YACf,CAAC,EAAE,CAAA;YACH,SAAQ;QACV,CAAC;QACD,IAAI,EAAE,KAAK,GAAG,EAAE,CAAC;YACf,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;YACb,QAAQ,GAAG,IAAI,CAAA;YACf,CAAC,EAAE,CAAA;YACH,SAAQ;QACV,CAAC;QACD,IAAI,EAAE,KAAK,GAAG,EAAE,CAAC;YACf,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;YACb,UAAU,GAAG,IAAI,CAAA;YACjB,CAAC,EAAE,CAAA;YACH,SAAQ;QACV,CAAC;QAED,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;QACZ,CAAC,EAAE,CAAA;IACL,CAAC;IAED,OAAO,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;AACrB,CAAC"}
|
package/dist/gate.d.ts
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Architecture-gate primitive — pre/post-fix regression detection.
|
|
3
|
+
*
|
|
4
|
+
* Operations:
|
|
5
|
+
* - saveBaseline(output, path) — persist current SARIF as the baseline
|
|
6
|
+
* - compareToBaseline(output, path) — diff current SARIF against baseline
|
|
7
|
+
* - renderGateCompareOutput(result) — pretty-print the diff for stdout
|
|
8
|
+
*
|
|
9
|
+
* Wired into the `fit` command via `--gate-save` and `--gate-compare` flags
|
|
10
|
+
* (see commands/fit.ts and index.ts).
|
|
11
|
+
*
|
|
12
|
+
* The baseline is opensip-tools' own SARIF document (built via buildSarifLog),
|
|
13
|
+
* persisted as a file. Diffs match by (filePath, ruleId, message) — line
|
|
14
|
+
* numbers are intentionally NOT in the matching key so unrelated line shifts
|
|
15
|
+
* don't register as added/resolved violations.
|
|
16
|
+
*/
|
|
17
|
+
import type { CliOutput } from '@opensip-tools/contracts';
|
|
18
|
+
/** A single violation as it appears in the gate diff. */
|
|
19
|
+
interface GateViolation {
|
|
20
|
+
/** sha256(filePath + '\n' + ruleId + '\n' + message) — opaque identity */
|
|
21
|
+
readonly hash: string;
|
|
22
|
+
readonly ruleId: string;
|
|
23
|
+
readonly message: string;
|
|
24
|
+
readonly filePath: string;
|
|
25
|
+
/** Line number — informational only, NOT used in identity */
|
|
26
|
+
readonly line?: number;
|
|
27
|
+
readonly severity: 'error' | 'warning';
|
|
28
|
+
}
|
|
29
|
+
/** Result of comparing current state to a saved baseline. */
|
|
30
|
+
export interface GateCompareResult {
|
|
31
|
+
readonly baselinePath: string;
|
|
32
|
+
/** Violations present now but not in baseline. */
|
|
33
|
+
readonly added: readonly GateViolation[];
|
|
34
|
+
/** Violations present in baseline but not now. */
|
|
35
|
+
readonly resolved: readonly GateViolation[];
|
|
36
|
+
/** Violations present in both. */
|
|
37
|
+
readonly unchanged: readonly GateViolation[];
|
|
38
|
+
/** True iff `added` is non-empty — the gate decision. */
|
|
39
|
+
readonly degraded: boolean;
|
|
40
|
+
}
|
|
41
|
+
/** Thrown when --gate-compare is invoked but the baseline file doesn't exist. */
|
|
42
|
+
export declare class GateBaselineMissingError extends Error {
|
|
43
|
+
readonly baselinePath: string;
|
|
44
|
+
constructor(baselinePath: string);
|
|
45
|
+
}
|
|
46
|
+
/** Thrown when the baseline file exists but isn't a parseable SARIF document. */
|
|
47
|
+
export declare class GateBaselineInvalidError extends Error {
|
|
48
|
+
readonly baselinePath: string;
|
|
49
|
+
constructor(baselinePath: string, reason: string);
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Default location for the baseline file when --baseline is not
|
|
53
|
+
* specified. Lives under the per-project gitignored runtime dir.
|
|
54
|
+
*/
|
|
55
|
+
export declare const DEFAULT_BASELINE_PATH = "opensip-tools/.runtime/baseline.sarif";
|
|
56
|
+
/**
|
|
57
|
+
* Persist the current run's findings as a baseline SARIF document.
|
|
58
|
+
* Creates parent directories as needed. Overwrites any existing baseline.
|
|
59
|
+
*/
|
|
60
|
+
export declare function saveBaseline(output: CliOutput, baselinePath: string): void;
|
|
61
|
+
/**
|
|
62
|
+
* Compare current findings against a saved baseline. Returns a structured
|
|
63
|
+
* diff of added / resolved / unchanged violations.
|
|
64
|
+
*
|
|
65
|
+
* @throws {GateBaselineMissingError} when the baseline file doesn't exist
|
|
66
|
+
* @throws {GateBaselineInvalidError} when the baseline isn't valid SARIF
|
|
67
|
+
*/
|
|
68
|
+
export declare function compareToBaseline(output: CliOutput, baselinePath: string): GateCompareResult;
|
|
69
|
+
/**
|
|
70
|
+
* Pretty-print a gate compare result for stdout. Caller sets the exit code.
|
|
71
|
+
*/
|
|
72
|
+
export declare function renderGateCompareOutput(result: GateCompareResult): string;
|
|
73
|
+
export {};
|
|
74
|
+
//# sourceMappingURL=gate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gate.d.ts","sourceRoot":"","sources":["../src/gate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAUH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAM1D,yDAAyD;AACzD,UAAU,aAAa;IACrB,0EAA0E;IAC1E,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,6DAA6D;IAC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
|
|
5
|
+
* - saveBaseline(output, path) — persist current SARIF as the baseline
|
|
6
|
+
* - compareToBaseline(output, path) — diff current SARIF against baseline
|
|
7
|
+
* - renderGateCompareOutput(result) — pretty-print the diff for stdout
|
|
8
|
+
*
|
|
9
|
+
* Wired into the `fit` command via `--gate-save` and `--gate-compare` flags
|
|
10
|
+
* (see commands/fit.ts and index.ts).
|
|
11
|
+
*
|
|
12
|
+
* The baseline is opensip-tools' own SARIF document (built via buildSarifLog),
|
|
13
|
+
* persisted as a file. Diffs match by (filePath, ruleId, message) — line
|
|
14
|
+
* numbers are intentionally NOT in the matching key so unrelated line shifts
|
|
15
|
+
* don't register as added/resolved violations.
|
|
16
|
+
*/
|
|
17
|
+
import { createHash } from 'node:crypto';
|
|
18
|
+
import { existsSync, mkdirSync, readFileSync, writeFileSync } from 'node:fs';
|
|
19
|
+
import { dirname } from 'node:path';
|
|
20
|
+
import { logger } from '@opensip-tools/core';
|
|
21
|
+
import { buildSarifLog } from './sarif.js';
|
|
22
|
+
/** Thrown when --gate-compare is invoked but the baseline file doesn't exist. */
|
|
23
|
+
export class GateBaselineMissingError extends Error {
|
|
24
|
+
baselinePath;
|
|
25
|
+
constructor(baselinePath) {
|
|
26
|
+
super(`Gate baseline not found at ${baselinePath}. ` +
|
|
27
|
+
`Run \`opensip-tools fit --gate-save\` first to create one, ` +
|
|
28
|
+
`or pass --baseline <path> if it lives elsewhere.`);
|
|
29
|
+
this.name = 'GateBaselineMissingError';
|
|
30
|
+
this.baselinePath = baselinePath;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
/** Thrown when the baseline file exists but isn't a parseable SARIF document. */
|
|
34
|
+
export class GateBaselineInvalidError extends Error {
|
|
35
|
+
baselinePath;
|
|
36
|
+
constructor(baselinePath, reason) {
|
|
37
|
+
super(`Gate baseline at ${baselinePath} is invalid: ${reason}`);
|
|
38
|
+
this.name = 'GateBaselineInvalidError';
|
|
39
|
+
this.baselinePath = baselinePath;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
// ---------------------------------------------------------------------------
|
|
43
|
+
// Default baseline path
|
|
44
|
+
// ---------------------------------------------------------------------------
|
|
45
|
+
/**
|
|
46
|
+
* Default location for the baseline file when --baseline is not
|
|
47
|
+
* specified. Lives under the per-project gitignored runtime dir.
|
|
48
|
+
*/
|
|
49
|
+
export const DEFAULT_BASELINE_PATH = 'opensip-tools/.runtime/baseline.sarif';
|
|
50
|
+
// ---------------------------------------------------------------------------
|
|
51
|
+
// saveBaseline
|
|
52
|
+
// ---------------------------------------------------------------------------
|
|
53
|
+
/**
|
|
54
|
+
* Persist the current run's findings as a baseline SARIF document.
|
|
55
|
+
* Creates parent directories as needed. Overwrites any existing baseline.
|
|
56
|
+
*/
|
|
57
|
+
export function saveBaseline(output, baselinePath) {
|
|
58
|
+
const sarif = buildSarifLog(output);
|
|
59
|
+
const dir = dirname(baselinePath);
|
|
60
|
+
// mkdirSync with recursive: true is idempotent — no need to check existsSync first.
|
|
61
|
+
mkdirSync(dir, { recursive: true });
|
|
62
|
+
writeFileSync(baselinePath, JSON.stringify(sarif, null, 2), 'utf8');
|
|
63
|
+
const findingCount = output.checks.reduce((n, c) => n + c.findings.length, 0);
|
|
64
|
+
logger.info({
|
|
65
|
+
evt: 'cli.gate.save.complete',
|
|
66
|
+
module: 'cli:gate',
|
|
67
|
+
baselinePath,
|
|
68
|
+
findingCount,
|
|
69
|
+
checkCount: output.checks.length,
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
// ---------------------------------------------------------------------------
|
|
73
|
+
// compareToBaseline
|
|
74
|
+
// ---------------------------------------------------------------------------
|
|
75
|
+
/**
|
|
76
|
+
* Compare current findings against a saved baseline. Returns a structured
|
|
77
|
+
* diff of added / resolved / unchanged violations.
|
|
78
|
+
*
|
|
79
|
+
* @throws {GateBaselineMissingError} when the baseline file doesn't exist
|
|
80
|
+
* @throws {GateBaselineInvalidError} when the baseline isn't valid SARIF
|
|
81
|
+
*/
|
|
82
|
+
export function compareToBaseline(output, baselinePath) {
|
|
83
|
+
if (!existsSync(baselinePath)) {
|
|
84
|
+
throw new GateBaselineMissingError(baselinePath);
|
|
85
|
+
}
|
|
86
|
+
const baselineRaw = readFileSync(baselinePath, 'utf8');
|
|
87
|
+
let baselineDoc;
|
|
88
|
+
try {
|
|
89
|
+
baselineDoc = JSON.parse(baselineRaw);
|
|
90
|
+
}
|
|
91
|
+
catch (error) {
|
|
92
|
+
const reason = error instanceof Error ? error.message : String(error);
|
|
93
|
+
throw new GateBaselineInvalidError(baselinePath, `not valid JSON (${reason})`);
|
|
94
|
+
}
|
|
95
|
+
const baselineViolations = extractViolationsFromSarif(baselineDoc, baselinePath);
|
|
96
|
+
const currentViolations = extractViolationsFromCliOutput(output);
|
|
97
|
+
const baselineByHash = new Map(baselineViolations.map((v) => [v.hash, v]));
|
|
98
|
+
const currentByHash = new Map(currentViolations.map((v) => [v.hash, v]));
|
|
99
|
+
const added = [];
|
|
100
|
+
const unchanged = [];
|
|
101
|
+
for (const [hash, v] of currentByHash) {
|
|
102
|
+
if (baselineByHash.has(hash)) {
|
|
103
|
+
unchanged.push(v);
|
|
104
|
+
}
|
|
105
|
+
else {
|
|
106
|
+
added.push(v);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
const resolved = [];
|
|
110
|
+
for (const [hash, v] of baselineByHash) {
|
|
111
|
+
if (!currentByHash.has(hash)) {
|
|
112
|
+
resolved.push(v);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
const result = {
|
|
116
|
+
baselinePath,
|
|
117
|
+
added,
|
|
118
|
+
resolved,
|
|
119
|
+
unchanged,
|
|
120
|
+
degraded: added.length > 0,
|
|
121
|
+
};
|
|
122
|
+
logger.info({
|
|
123
|
+
evt: 'cli.gate.compare.complete',
|
|
124
|
+
module: 'cli:gate',
|
|
125
|
+
baselinePath,
|
|
126
|
+
addedCount: added.length,
|
|
127
|
+
resolvedCount: resolved.length,
|
|
128
|
+
unchangedCount: unchanged.length,
|
|
129
|
+
degraded: result.degraded,
|
|
130
|
+
});
|
|
131
|
+
return result;
|
|
132
|
+
}
|
|
133
|
+
// ---------------------------------------------------------------------------
|
|
134
|
+
// renderGateCompareOutput
|
|
135
|
+
// ---------------------------------------------------------------------------
|
|
136
|
+
/**
|
|
137
|
+
* Pretty-print a gate compare result for stdout. Caller sets the exit code.
|
|
138
|
+
*/
|
|
139
|
+
// eslint-disable-next-line sonarjs/cognitive-complexity -- multi-section diff renderer: added/removed/changed sections each shape output; flatter form would scatter formatting
|
|
140
|
+
export function renderGateCompareOutput(result) {
|
|
141
|
+
const lines = ['opensip-tools gate compare', ''];
|
|
142
|
+
if (result.added.length > 0) {
|
|
143
|
+
lines.push(`Added (${result.added.length}):`);
|
|
144
|
+
for (const v of sortViolations(result.added)) {
|
|
145
|
+
lines.push(` ✗ ${v.ruleId.padEnd(40)} ${formatLocation(v)}`);
|
|
146
|
+
if (v.message && v.message !== v.ruleId) {
|
|
147
|
+
lines.push(` ${truncate(v.message, 120)}`);
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
lines.push('');
|
|
151
|
+
}
|
|
152
|
+
if (result.resolved.length > 0) {
|
|
153
|
+
lines.push(`Resolved (${result.resolved.length}):`);
|
|
154
|
+
for (const v of sortViolations(result.resolved)) {
|
|
155
|
+
lines.push(` ✓ ${v.ruleId.padEnd(40)} ${formatLocation(v)}`);
|
|
156
|
+
}
|
|
157
|
+
lines.push('');
|
|
158
|
+
}
|
|
159
|
+
if (result.unchanged.length > 0) {
|
|
160
|
+
lines.push(`Unchanged (${result.unchanged.length}):`);
|
|
161
|
+
// Truncate unchanged list — usually long and not actionable.
|
|
162
|
+
const sample = sortViolations(result.unchanged).slice(0, 5);
|
|
163
|
+
for (const v of sample) {
|
|
164
|
+
lines.push(` · ${v.ruleId.padEnd(40)} ${formatLocation(v)}`);
|
|
165
|
+
}
|
|
166
|
+
if (result.unchanged.length > sample.length) {
|
|
167
|
+
lines.push(` · ... and ${result.unchanged.length - sample.length} more`);
|
|
168
|
+
}
|
|
169
|
+
lines.push('');
|
|
170
|
+
}
|
|
171
|
+
if (result.degraded) {
|
|
172
|
+
lines.push(`✗ DEGRADED — ${result.added.length} new violation${result.added.length === 1 ? '' : 's'}`);
|
|
173
|
+
}
|
|
174
|
+
else if (result.resolved.length > 0) {
|
|
175
|
+
lines.push(`✓ IMPROVED — ${result.resolved.length} violation${result.resolved.length === 1 ? '' : 's'} resolved, none added`);
|
|
176
|
+
}
|
|
177
|
+
else {
|
|
178
|
+
lines.push(`✓ STABLE — no change`);
|
|
179
|
+
}
|
|
180
|
+
return lines.join('\n');
|
|
181
|
+
}
|
|
182
|
+
// ---------------------------------------------------------------------------
|
|
183
|
+
// Internal helpers
|
|
184
|
+
// ---------------------------------------------------------------------------
|
|
185
|
+
function hashViolation(filePath, ruleId, message) {
|
|
186
|
+
return createHash('sha256').update(`${filePath}\n${ruleId}\n${message}`).digest('hex');
|
|
187
|
+
}
|
|
188
|
+
function extractViolationsFromCliOutput(output) {
|
|
189
|
+
const violations = [];
|
|
190
|
+
for (const check of output.checks) {
|
|
191
|
+
for (const f of check.findings) {
|
|
192
|
+
const filePath = f.filePath ?? '';
|
|
193
|
+
violations.push({
|
|
194
|
+
hash: hashViolation(filePath, f.ruleId, f.message),
|
|
195
|
+
ruleId: f.ruleId,
|
|
196
|
+
message: f.message,
|
|
197
|
+
filePath,
|
|
198
|
+
line: f.line,
|
|
199
|
+
severity: f.severity,
|
|
200
|
+
});
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
return violations;
|
|
204
|
+
}
|
|
205
|
+
function extractViolationsFromSarif(doc, baselinePath) {
|
|
206
|
+
if (typeof doc !== 'object' || doc === null) {
|
|
207
|
+
throw new GateBaselineInvalidError(baselinePath, 'top-level value is not an object');
|
|
208
|
+
}
|
|
209
|
+
const sarif = doc;
|
|
210
|
+
if (sarif.runs === undefined || !Array.isArray(sarif.runs)) {
|
|
211
|
+
throw new GateBaselineInvalidError(baselinePath, 'missing or non-array `runs`');
|
|
212
|
+
}
|
|
213
|
+
const runs = sarif.runs;
|
|
214
|
+
const violations = [];
|
|
215
|
+
for (const run of runs) {
|
|
216
|
+
const results = run.results;
|
|
217
|
+
if (results === undefined)
|
|
218
|
+
continue;
|
|
219
|
+
for (const result of results) {
|
|
220
|
+
const ruleId = result.ruleId ?? '';
|
|
221
|
+
const message = result.message?.text ?? '';
|
|
222
|
+
const loc = result.locations?.[0]?.physicalLocation;
|
|
223
|
+
const filePath = loc?.artifactLocation?.uri ?? '';
|
|
224
|
+
const line = loc?.region?.startLine;
|
|
225
|
+
const severity = result.level === 'error' ? 'error' : 'warning';
|
|
226
|
+
violations.push({
|
|
227
|
+
hash: hashViolation(filePath, ruleId, message),
|
|
228
|
+
ruleId,
|
|
229
|
+
message,
|
|
230
|
+
filePath,
|
|
231
|
+
line,
|
|
232
|
+
severity,
|
|
233
|
+
});
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
return violations;
|
|
237
|
+
}
|
|
238
|
+
function formatLocation(v) {
|
|
239
|
+
if (!v.filePath)
|
|
240
|
+
return '(no location)';
|
|
241
|
+
return v.line == null ? v.filePath : `${v.filePath}:${v.line}`;
|
|
242
|
+
}
|
|
243
|
+
function sortViolations(vs) {
|
|
244
|
+
return [...vs].sort((a, b) => {
|
|
245
|
+
if (a.ruleId !== b.ruleId)
|
|
246
|
+
return a.ruleId.localeCompare(b.ruleId);
|
|
247
|
+
if (a.filePath !== b.filePath)
|
|
248
|
+
return a.filePath.localeCompare(b.filePath);
|
|
249
|
+
return (a.line ?? 0) - (b.line ?? 0);
|
|
250
|
+
});
|
|
251
|
+
}
|
|
252
|
+
function truncate(s, max) {
|
|
253
|
+
if (s.length <= max)
|
|
254
|
+
return s;
|
|
255
|
+
return s.slice(0, max - 1) + '…';
|
|
256
|
+
}
|
|
257
|
+
//# sourceMappingURL=gate.js.map
|
package/dist/gate.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
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}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
export { defineCheck } from './framework/define-check.js';
|
|
2
|
+
export { CheckRegistry, defaultRegistry } from './framework/registry.js';
|
|
3
|
+
export { registerChecks } from './framework/register-helpers.js';
|
|
4
|
+
export type { CheckViolation, CheckScope, FileAccessor, CheckConcern, CheckLanguage } from './framework/check-config.js';
|
|
5
|
+
export type { Check, CheckConfig, ResolvedScope } from './framework/check-types.js';
|
|
6
|
+
export { isCheck } from './framework/check-types.js';
|
|
7
|
+
export type { ExecutionContext, RunOptions } from './framework/execution-context.js';
|
|
8
|
+
export { getLineNumber, extractSnippet, isAPIFile } from './framework/result-builder.js';
|
|
9
|
+
export { parseSource, walkNodes, getLineNumber as getASTLineNumber, getIdentifierName, getPropertyChain, isInStringLiteral, isLiteral, isPropertyAccess, } from './framework/ast-utilities.js';
|
|
10
|
+
export { execAbortable } from './framework/abortable-exec.js';
|
|
11
|
+
export { fileCache, DEFAULT_PREWARM_PATTERNS } from './framework/file-cache.js';
|
|
12
|
+
export { buildImportGraph, findStronglyConnectedComponents } from './framework/import-graph.js';
|
|
13
|
+
export type { ImportGraph } from './framework/import-graph.js';
|
|
14
|
+
export { isInsideStringLiteral, stripStringLiterals, stripStringsAndComments, stripStringsAndCommentsPreservingPositions } from './framework/strip-literals.js';
|
|
15
|
+
export { filterContent, clearFilterCache } from './framework/content-filter.js';
|
|
16
|
+
export type { FilteredContent } from './framework/content-filter.js';
|
|
17
|
+
import * as _ts from 'typescript';
|
|
18
|
+
export { _ts as ts };
|
|
19
|
+
export type { Finding, Severity, FindingSeverity, ToolOutput, CheckResult, CheckInfo, CheckResultMetadata, ItemType } from './types/findings.js';
|
|
20
|
+
export { createResultWithSignals, createErrorResult, createPassingResult, CheckInfoFactory } from './types/findings.js';
|
|
21
|
+
export { FitnessRecipeService } from './recipes/service.js';
|
|
22
|
+
export type { FitnessRecipeServiceConfig, FitnessRecipeServiceCallbacks, CheckSummary } from './recipes/service-types.js';
|
|
23
|
+
export type { FitnessRecipeResult, RecipeCheckResult, RecipeCheckConfigMap } from './recipes/types.js';
|
|
24
|
+
export { builtInRecipesByName } from './recipes/built-in-recipes.js';
|
|
25
|
+
export { defaultRecipeRegistry, FitnessRecipeRegistry } from './recipes/registry.js';
|
|
26
|
+
export { getCheckConfig, setCurrentRecipeCheckConfig, clearCurrentRecipeCheckConfig } from './recipes/check-config.js';
|
|
27
|
+
export { loadTargetsConfig, resolveTargetFiles } from './targets/index.js';
|
|
28
|
+
export type { TargetsConfig } from './targets/types.js';
|
|
29
|
+
export { TargetRegistry } from './targets/target-registry.js';
|
|
30
|
+
export { buildScopeBasedFileMap } from './framework/scope-resolver.js';
|
|
31
|
+
export { loadSignalersConfig } from './signalers/index.js';
|
|
32
|
+
export type { SignalersConfig } from './signalers/types.js';
|
|
33
|
+
export { loadPlugin, loadAllPlugins } from './plugins/loader.js';
|
|
34
|
+
export type { FitPluginExports } from './plugins/types.js';
|
|
35
|
+
export { discoverCheckPackages, readCheckPackageMetadata, readCheckPackagePreferences, } from './plugins/check-package-discovery.js';
|
|
36
|
+
export type { CheckPackageDiscoveryOptions, DiscoveredCheckPackage, CheckPackageMetadata, } from './plugins/check-package-discovery.js';
|
|
37
|
+
export { fitnessTool } from './tool.js';
|
|
38
|
+
export { executeFit, ensureChecksLoaded, getDisplayName, getEnabledCheckCount, getIcon, getPluginLoadErrors, setPreLoadHook, formatDuration, formatValidatedColumn, } from './cli/fit.js';
|
|
39
|
+
export type { PreLoadHook } from './cli/fit.js';
|
|
40
|
+
export { openDashboard } from './cli/dashboard.js';
|
|
41
|
+
export { listChecks } from './cli/list-checks.js';
|
|
42
|
+
export { listRecipes } from './cli/list-recipes.js';
|
|
43
|
+
export { saveBaseline, compareToBaseline, renderGateCompareOutput, GateBaselineMissingError, GateBaselineInvalidError, DEFAULT_BASELINE_PATH, } from './gate.js';
|
|
44
|
+
export type { GateCompareResult } from './gate.js';
|
|
45
|
+
export { buildSarifLog, chunkSarifRuns, reportToCloud } from './sarif.js';
|
|
46
|
+
export type { ReportResult } from './sarif.js';
|
|
47
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAC1D,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AACzE,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AAGjE,YAAY,EAAE,cAAc,EAAE,UAAU,EAAE,YAAY,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AACzH,YAAY,EAAE,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AACpF,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AACrD,YAAY,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAC;AAGrF,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AACzF,OAAO,EACL,WAAW,EAAE,SAAS,EACtB,aAAa,IAAI,gBAAgB,EACjC,iBAAiB,EAAE,gBAAgB,EACnC,iBAAiB,EACjB,SAAS,EAAE,gBAAgB,GAC5B,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAE9D,OAAO,EAAE,SAAS,EAAE,wBAAwB,EAAE,MAAM,2BAA2B,CAAC;AAChF,OAAO,EAAE,gBAAgB,EAAE,+BAA+B,EAAE,MAAM,6BAA6B,CAAC;AAChG,YAAY,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,uBAAuB,EAAE,0CAA0C,EAAE,MAAM,+BAA+B,CAAC;AAChK,OAAO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BAAqB,CAAC;AACjE,YAAY,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAG3D,OAAO,EACL,qBAAqB,EACrB,wBAAwB,EACxB,2BAA2B,GAC5B,MAAM,sCAAsC,CAAC;AAC9C,YAAY,EACV,4BAA4B,EAC5B,sBAAsB,EACtB,oBAAoB,GACrB,MAAM,sCAAsC,CAAC;AAG9C,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAKxC,OAAO,EACL,UAAU,EACV,kBAAkB,EAClB,cAAc,EACd,oBAAoB,EACpB,OAAO,EACP,mBAAmB,EACnB,cAAc,EACd,cAAc,EACd,qBAAqB,GACtB,MAAM,cAAc,CAAC;AACtB,YAAY,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAKpD,OAAO,EACL,YAAY,EACZ,iBAAiB,EACjB,uBAAuB,EACvB,wBAAwB,EACxB,wBAAwB,EACxB,qBAAqB,GACtB,MAAM,WAAW,CAAC;AACnB,YAAY,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAC1E,YAAY,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
// Framework — check definition API
|
|
2
|
+
export { defineCheck } from './framework/define-check.js';
|
|
3
|
+
export { CheckRegistry, defaultRegistry } from './framework/registry.js';
|
|
4
|
+
export { registerChecks } from './framework/register-helpers.js';
|
|
5
|
+
export { isCheck } from './framework/check-types.js';
|
|
6
|
+
// Framework utilities used by checks
|
|
7
|
+
export { getLineNumber, extractSnippet, isAPIFile } from './framework/result-builder.js';
|
|
8
|
+
export { parseSource, walkNodes, getLineNumber as getASTLineNumber, getIdentifierName, getPropertyChain, isInStringLiteral, isLiteral, isPropertyAccess, } from './framework/ast-utilities.js';
|
|
9
|
+
export { execAbortable } from './framework/abortable-exec.js';
|
|
10
|
+
// File cache (used by checks for content access; tests may seed/clear).
|
|
11
|
+
export { fileCache, DEFAULT_PREWARM_PATTERNS } from './framework/file-cache.js';
|
|
12
|
+
export { buildImportGraph, findStronglyConnectedComponents } from './framework/import-graph.js';
|
|
13
|
+
export { isInsideStringLiteral, stripStringLiterals, stripStringsAndComments, stripStringsAndCommentsPreservingPositions } from './framework/strip-literals.js';
|
|
14
|
+
export { filterContent, clearFilterCache } from './framework/content-filter.js';
|
|
15
|
+
// Re-export TypeScript compiler API for AST-based checks. The typescript module
|
|
16
|
+
// uses `export =`, so `export * as ts from 'typescript'` is invalid; the
|
|
17
|
+
// import-then-rename-export form works under esModuleInterop.
|
|
18
|
+
/* eslint-disable unicorn/prefer-export-from -- `export * as ts from 'typescript'` is invalid (the module uses `export =`); the namespace import + named export is the only working shape */
|
|
19
|
+
import * as _ts from 'typescript';
|
|
20
|
+
export { _ts as ts };
|
|
21
|
+
export { createResultWithSignals, createErrorResult, createPassingResult, CheckInfoFactory } from './types/findings.js';
|
|
22
|
+
// Recipe service
|
|
23
|
+
export { FitnessRecipeService } from './recipes/service.js';
|
|
24
|
+
export { builtInRecipesByName } from './recipes/built-in-recipes.js';
|
|
25
|
+
export { defaultRecipeRegistry, FitnessRecipeRegistry } from './recipes/registry.js';
|
|
26
|
+
export { getCheckConfig, setCurrentRecipeCheckConfig, clearCurrentRecipeCheckConfig } from './recipes/check-config.js';
|
|
27
|
+
// Targets and signalers
|
|
28
|
+
export { loadTargetsConfig, resolveTargetFiles } from './targets/index.js';
|
|
29
|
+
export { TargetRegistry } from './targets/target-registry.js';
|
|
30
|
+
export { buildScopeBasedFileMap } from './framework/scope-resolver.js';
|
|
31
|
+
export { loadSignalersConfig } from './signalers/index.js';
|
|
32
|
+
// Plugin loader (fitness owns the dispatcher; lang plugins also flow through
|
|
33
|
+
// it because lang adapter loading currently shares the same orchestration).
|
|
34
|
+
export { loadPlugin, loadAllPlugins } from './plugins/loader.js';
|
|
35
|
+
// Check-package discovery (fitness-specific — scans @opensip-tools/checks-* packages).
|
|
36
|
+
export { discoverCheckPackages, readCheckPackageMetadata, readCheckPackagePreferences, } from './plugins/check-package-discovery.js';
|
|
37
|
+
// Tool plugin export — fitness as a Tool.
|
|
38
|
+
export { fitnessTool } from './tool.js';
|
|
39
|
+
// CLI command implementations — re-exported for the Phase 2 CLI which
|
|
40
|
+
// still drives commands directly. Phase 4 will collapse these behind
|
|
41
|
+
// the Tool contract.
|
|
42
|
+
export { executeFit, ensureChecksLoaded, getDisplayName, getEnabledCheckCount, getIcon, getPluginLoadErrors, setPreLoadHook, formatDuration, formatValidatedColumn, } from './cli/fit.js';
|
|
43
|
+
export { openDashboard } from './cli/dashboard.js';
|
|
44
|
+
export { listChecks } from './cli/list-checks.js';
|
|
45
|
+
export { listRecipes } from './cli/list-recipes.js';
|
|
46
|
+
// Architecture-gate primitives (baseline save / compare) and SARIF
|
|
47
|
+
// upload — both operate on fitness's CliOutput. Wired into the `fit`
|
|
48
|
+
// subcommand by the tool's register() handler.
|
|
49
|
+
export { saveBaseline, compareToBaseline, renderGateCompareOutput, GateBaselineMissingError, GateBaselineInvalidError, DEFAULT_BASELINE_PATH, } from './gate.js';
|
|
50
|
+
export { buildSarifLog, chunkSarifRuns, reportToCloud } from './sarif.js';
|
|
51
|
+
//# sourceMappingURL=index.js.map
|