@opensip-cli/fitness 0.1.0
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/LICENSE +202 -0
- package/NOTICE +8 -0
- package/README.md +31 -0
- package/dist/__tests__/baseline-plane.test.d.ts +12 -0
- package/dist/__tests__/baseline-plane.test.d.ts.map +1 -0
- package/dist/__tests__/baseline-plane.test.js +63 -0
- package/dist/__tests__/baseline-plane.test.js.map +1 -0
- package/dist/__tests__/check-utils.test.d.ts +10 -0
- package/dist/__tests__/check-utils.test.d.ts.map +1 -0
- package/dist/__tests__/check-utils.test.js +193 -0
- package/dist/__tests__/check-utils.test.js.map +1 -0
- package/dist/__tests__/fingerprint-parity.test.d.ts +14 -0
- package/dist/__tests__/fingerprint-parity.test.d.ts.map +1 -0
- package/dist/__tests__/fingerprint-parity.test.js +59 -0
- package/dist/__tests__/fingerprint-parity.test.js.map +1 -0
- package/dist/__tests__/fit-execute-opts.test.d.ts +15 -0
- package/dist/__tests__/fit-execute-opts.test.d.ts.map +1 -0
- package/dist/__tests__/fit-execute-opts.test.js +124 -0
- package/dist/__tests__/fit-execute-opts.test.js.map +1 -0
- package/dist/__tests__/public-api.test.d.ts +19 -0
- package/dist/__tests__/public-api.test.d.ts.map +1 -0
- package/dist/__tests__/public-api.test.js +85 -0
- package/dist/__tests__/public-api.test.js.map +1 -0
- package/dist/__tests__/tool.test.d.ts +10 -0
- package/dist/__tests__/tool.test.d.ts.map +1 -0
- package/dist/__tests__/tool.test.js +57 -0
- package/dist/__tests__/tool.test.js.map +1 -0
- package/dist/baseline-strategy.d.ts +21 -0
- package/dist/baseline-strategy.d.ts.map +1 -0
- package/dist/baseline-strategy.js +21 -0
- package/dist/baseline-strategy.js.map +1 -0
- package/dist/check-utils/display.d.ts +52 -0
- package/dist/check-utils/display.d.ts.map +1 -0
- package/dist/check-utils/display.js +66 -0
- package/dist/check-utils/display.js.map +1 -0
- package/dist/check-utils/index.d.ts +17 -0
- package/dist/check-utils/index.d.ts.map +1 -0
- package/dist/check-utils/index.js +13 -0
- package/dist/check-utils/index.js.map +1 -0
- package/dist/check-utils/path-matching.d.ts +40 -0
- package/dist/check-utils/path-matching.d.ts.map +1 -0
- package/dist/check-utils/path-matching.js +38 -0
- package/dist/check-utils/path-matching.js.map +1 -0
- package/dist/check-utils/source-analysis.d.ts +36 -0
- package/dist/check-utils/source-analysis.d.ts.map +1 -0
- package/dist/check-utils/source-analysis.js +44 -0
- package/dist/check-utils/source-analysis.js.map +1 -0
- package/dist/check-utils/test-helpers.d.ts +57 -0
- package/dist/check-utils/test-helpers.d.ts.map +1 -0
- package/dist/check-utils/test-helpers.js +71 -0
- package/dist/check-utils/test-helpers.js.map +1 -0
- package/dist/cli/__tests__/fit-gate-mode.test.d.ts +14 -0
- package/dist/cli/__tests__/fit-gate-mode.test.d.ts.map +1 -0
- package/dist/cli/__tests__/fit-gate-mode.test.js +110 -0
- package/dist/cli/__tests__/fit-gate-mode.test.js.map +1 -0
- package/dist/cli/__tests__/fit-modes-live.test.d.ts +13 -0
- package/dist/cli/__tests__/fit-modes-live.test.d.ts.map +1 -0
- package/dist/cli/__tests__/fit-modes-live.test.js +182 -0
- package/dist/cli/__tests__/fit-modes-live.test.js.map +1 -0
- package/dist/cli/__tests__/report-data.test.d.ts +12 -0
- package/dist/cli/__tests__/report-data.test.d.ts.map +1 -0
- package/dist/cli/__tests__/report-data.test.js +113 -0
- package/dist/cli/__tests__/report-data.test.js.map +1 -0
- package/dist/cli/fit/__tests__/display-fold.test.d.ts +8 -0
- package/dist/cli/fit/__tests__/display-fold.test.d.ts.map +1 -0
- package/dist/cli/fit/__tests__/display-fold.test.js +87 -0
- package/dist/cli/fit/__tests__/display-fold.test.js.map +1 -0
- package/dist/cli/fit/__tests__/gate-resolved-config.test.d.ts +16 -0
- package/dist/cli/fit/__tests__/gate-resolved-config.test.d.ts.map +1 -0
- package/dist/cli/fit/__tests__/gate-resolved-config.test.js +62 -0
- package/dist/cli/fit/__tests__/gate-resolved-config.test.js.map +1 -0
- package/dist/cli/fit/check-loader.d.ts +37 -0
- package/dist/cli/fit/check-loader.d.ts.map +1 -0
- package/dist/cli/fit/check-loader.js +154 -0
- package/dist/cli/fit/check-loader.js.map +1 -0
- package/dist/cli/fit/config-loader.d.ts +55 -0
- package/dist/cli/fit/config-loader.d.ts.map +1 -0
- package/dist/cli/fit/config-loader.js +107 -0
- package/dist/cli/fit/config-loader.js.map +1 -0
- package/dist/cli/fit/display-registry.d.ts +19 -0
- package/dist/cli/fit/display-registry.d.ts.map +1 -0
- package/dist/cli/fit/display-registry.js +33 -0
- package/dist/cli/fit/display-registry.js.map +1 -0
- package/dist/cli/fit/envelope-view.d.ts +49 -0
- package/dist/cli/fit/envelope-view.d.ts.map +1 -0
- package/dist/cli/fit/envelope-view.js +85 -0
- package/dist/cli/fit/envelope-view.js.map +1 -0
- package/dist/cli/fit/fit-aux-command-specs.d.ts +35 -0
- package/dist/cli/fit/fit-aux-command-specs.d.ts.map +1 -0
- package/dist/cli/fit/fit-aux-command-specs.js +110 -0
- package/dist/cli/fit/fit-aux-command-specs.js.map +1 -0
- package/dist/cli/fit/fit-command-spec.d.ts +24 -0
- package/dist/cli/fit/fit-command-spec.d.ts.map +1 -0
- package/dist/cli/fit/fit-command-spec.js +131 -0
- package/dist/cli/fit/fit-command-spec.js.map +1 -0
- package/dist/cli/fit/gate-compare-render.d.ts +13 -0
- package/dist/cli/fit/gate-compare-render.d.ts.map +1 -0
- package/dist/cli/fit/gate-compare-render.js +87 -0
- package/dist/cli/fit/gate-compare-render.js.map +1 -0
- package/dist/cli/fit/recipe-selector.d.ts +53 -0
- package/dist/cli/fit/recipe-selector.d.ts.map +1 -0
- package/dist/cli/fit/recipe-selector.js +106 -0
- package/dist/cli/fit/recipe-selector.js.map +1 -0
- package/dist/cli/fit/recipe-selector.test.d.ts +2 -0
- package/dist/cli/fit/recipe-selector.test.d.ts.map +1 -0
- package/dist/cli/fit/recipe-selector.test.js +69 -0
- package/dist/cli/fit/recipe-selector.test.js.map +1 -0
- package/dist/cli/fit/resolved-fitness-config.d.ts +48 -0
- package/dist/cli/fit/resolved-fitness-config.d.ts.map +1 -0
- package/dist/cli/fit/resolved-fitness-config.js +46 -0
- package/dist/cli/fit/resolved-fitness-config.js.map +1 -0
- package/dist/cli/fit/result-builders.d.ts +91 -0
- package/dist/cli/fit/result-builders.d.ts.map +1 -0
- package/dist/cli/fit/result-builders.js +206 -0
- package/dist/cli/fit/result-builders.js.map +1 -0
- package/dist/cli/fit-list.d.ts +7 -0
- package/dist/cli/fit-list.d.ts.map +1 -0
- package/dist/cli/fit-list.js +24 -0
- package/dist/cli/fit-list.js.map +1 -0
- package/dist/cli/fit-modes.d.ts +42 -0
- package/dist/cli/fit-modes.d.ts.map +1 -0
- package/dist/cli/fit-modes.js +322 -0
- package/dist/cli/fit-modes.js.map +1 -0
- package/dist/cli/fit-recipes.d.ts +7 -0
- package/dist/cli/fit-recipes.d.ts.map +1 -0
- package/dist/cli/fit-recipes.js +34 -0
- package/dist/cli/fit-recipes.js.map +1 -0
- package/dist/cli/fit-runner-views.d.ts +33 -0
- package/dist/cli/fit-runner-views.d.ts.map +1 -0
- package/dist/cli/fit-runner-views.js +92 -0
- package/dist/cli/fit-runner-views.js.map +1 -0
- package/dist/cli/fit-runner.d.ts +44 -0
- package/dist/cli/fit-runner.d.ts.map +1 -0
- package/dist/cli/fit-runner.js +250 -0
- package/dist/cli/fit-runner.js.map +1 -0
- package/dist/cli/fit-worker.d.ts +26 -0
- package/dist/cli/fit-worker.d.ts.map +1 -0
- package/dist/cli/fit-worker.js +67 -0
- package/dist/cli/fit-worker.js.map +1 -0
- package/dist/cli/fit.d.ts +74 -0
- package/dist/cli/fit.d.ts.map +1 -0
- package/dist/cli/fit.js +149 -0
- package/dist/cli/fit.js.map +1 -0
- package/dist/cli/report-data.d.ts +44 -0
- package/dist/cli/report-data.d.ts.map +1 -0
- package/dist/cli/report-data.js +89 -0
- package/dist/cli/report-data.js.map +1 -0
- package/dist/config/__tests__/fitness-config-schema.test.d.ts +6 -0
- package/dist/config/__tests__/fitness-config-schema.test.d.ts.map +1 -0
- package/dist/config/__tests__/fitness-config-schema.test.js +37 -0
- package/dist/config/__tests__/fitness-config-schema.test.js.map +1 -0
- package/dist/config/fitness-config-schema.d.ts +48 -0
- package/dist/config/fitness-config-schema.d.ts.map +1 -0
- package/dist/config/fitness-config-schema.js +62 -0
- package/dist/config/fitness-config-schema.js.map +1 -0
- package/dist/framework/__tests__/abortable-exec.test.d.ts +9 -0
- package/dist/framework/__tests__/abortable-exec.test.d.ts.map +1 -0
- package/dist/framework/__tests__/abortable-exec.test.js +102 -0
- package/dist/framework/__tests__/abortable-exec.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__/check-types.test.d.ts +2 -0
- package/dist/framework/__tests__/check-types.test.d.ts.map +1 -0
- package/dist/framework/__tests__/check-types.test.js +76 -0
- package/dist/framework/__tests__/check-types.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 +110 -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 +122 -0
- package/dist/framework/__tests__/content-filter-dispatch.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 +402 -0
- package/dist/framework/__tests__/define-check.test.js.map +1 -0
- package/dist/framework/__tests__/define-regex-list-check.test.d.ts +15 -0
- package/dist/framework/__tests__/define-regex-list-check.test.d.ts.map +1 -0
- package/dist/framework/__tests__/define-regex-list-check.test.js +299 -0
- package/dist/framework/__tests__/define-regex-list-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 +111 -0
- package/dist/framework/__tests__/directive-inventory.test.js.map +1 -0
- package/dist/framework/__tests__/directive-parsing.test.d.ts +13 -0
- package/dist/framework/__tests__/directive-parsing.test.d.ts.map +1 -0
- package/dist/framework/__tests__/directive-parsing.test.js +86 -0
- package/dist/framework/__tests__/directive-parsing.test.js.map +1 -0
- package/dist/framework/__tests__/execution-context.globalexcludes-parity.test.d.ts +2 -0
- package/dist/framework/__tests__/execution-context.globalexcludes-parity.test.d.ts.map +1 -0
- package/dist/framework/__tests__/execution-context.globalexcludes-parity.test.js +56 -0
- package/dist/framework/__tests__/execution-context.globalexcludes-parity.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 +140 -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__/file-type-filter.test.d.ts +9 -0
- package/dist/framework/__tests__/file-type-filter.test.d.ts.map +1 -0
- package/dist/framework/__tests__/file-type-filter.test.js +39 -0
- package/dist/framework/__tests__/file-type-filter.test.js.map +1 -0
- package/dist/framework/__tests__/ignore-processing.test.d.ts +11 -0
- package/dist/framework/__tests__/ignore-processing.test.d.ts.map +1 -0
- package/dist/framework/__tests__/ignore-processing.test.js +175 -0
- package/dist/framework/__tests__/ignore-processing.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__/memory-profiler.test.d.ts +9 -0
- package/dist/framework/__tests__/memory-profiler.test.d.ts.map +1 -0
- package/dist/framework/__tests__/memory-profiler.test.js +108 -0
- package/dist/framework/__tests__/memory-profiler.test.js.map +1 -0
- package/dist/framework/__tests__/parse-cache.test.d.ts +9 -0
- package/dist/framework/__tests__/parse-cache.test.d.ts.map +1 -0
- package/dist/framework/__tests__/parse-cache.test.js +51 -0
- package/dist/framework/__tests__/parse-cache.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 +51 -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 +211 -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-registry.test.d.ts +8 -0
- package/dist/framework/__tests__/scope-registry.test.d.ts.map +1 -0
- package/dist/framework/__tests__/scope-registry.test.js +156 -0
- package/dist/framework/__tests__/scope-registry.test.js.map +1 -0
- package/dist/framework/__tests__/scope-resolver.golden.test.d.ts +2 -0
- package/dist/framework/__tests__/scope-resolver.golden.test.d.ts.map +1 -0
- package/dist/framework/__tests__/scope-resolver.golden.test.js +105 -0
- package/dist/framework/__tests__/scope-resolver.golden.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 +150 -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 +74 -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 +143 -0
- package/dist/framework/abortable-exec.js.map +1 -0
- package/dist/framework/check-config.d.ts +175 -0
- package/dist/framework/check-config.d.ts.map +1 -0
- package/dist/framework/check-config.js +115 -0
- package/dist/framework/check-config.js.map +1 -0
- package/dist/framework/check-types.d.ts +82 -0
- package/dist/framework/check-types.d.ts.map +1 -0
- package/dist/framework/check-types.js +63 -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/comment-openers.d.ts +11 -0
- package/dist/framework/comment-openers.d.ts.map +1 -0
- package/dist/framework/comment-openers.js +11 -0
- package/dist/framework/comment-openers.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/define-check.d.ts +38 -0
- package/dist/framework/define-check.d.ts.map +1 -0
- package/dist/framework/define-check.js +296 -0
- package/dist/framework/define-check.js.map +1 -0
- package/dist/framework/define-regex-list-check.d.ts +160 -0
- package/dist/framework/define-regex-list-check.d.ts.map +1 -0
- package/dist/framework/define-regex-list-check.js +177 -0
- package/dist/framework/define-regex-list-check.js.map +1 -0
- package/dist/framework/directive-inventory.d.ts +37 -0
- package/dist/framework/directive-inventory.d.ts.map +1 -0
- package/dist/framework/directive-inventory.js +82 -0
- package/dist/framework/directive-inventory.js.map +1 -0
- package/dist/framework/directive-parsing.d.ts +23 -0
- package/dist/framework/directive-parsing.d.ts.map +1 -0
- package/dist/framework/directive-parsing.js +39 -0
- package/dist/framework/directive-parsing.js.map +1 -0
- package/dist/framework/execution-context.d.ts +98 -0
- package/dist/framework/execution-context.d.ts.map +1 -0
- package/dist/framework/execution-context.js +145 -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 +199 -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 +36 -0
- package/dist/framework/ignore-processing.d.ts.map +1 -0
- package/dist/framework/ignore-processing.js +172 -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 +217 -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 +24 -0
- package/dist/framework/parse-cache.d.ts.map +1 -0
- package/dist/framework/parse-cache.js +41 -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 +11 -0
- package/dist/framework/register-helpers.d.ts.map +1 -0
- package/dist/framework/register-helpers.js +19 -0
- package/dist/framework/register-helpers.js.map +1 -0
- package/dist/framework/registry.d.ts +51 -0
- package/dist/framework/registry.d.ts.map +1 -0
- package/dist/framework/registry.js +131 -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-registry.d.ts +38 -0
- package/dist/framework/scope-registry.d.ts.map +1 -0
- package/dist/framework/scope-registry.js +77 -0
- package/dist/framework/scope-registry.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 +102 -0
- package/dist/framework/scope-resolver.js.map +1 -0
- package/dist/framework/severity-mapping.d.ts +17 -0
- package/dist/framework/severity-mapping.d.ts.map +1 -0
- package/dist/framework/severity-mapping.js +71 -0
- package/dist/framework/severity-mapping.js.map +1 -0
- package/dist/framework/strip-literals.d.ts +73 -0
- package/dist/framework/strip-literals.d.ts.map +1 -0
- package/dist/framework/strip-literals.js +213 -0
- package/dist/framework/strip-literals.js.map +1 -0
- package/dist/index.d.ts +47 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +64 -0
- package/dist/index.js.map +1 -0
- package/dist/internal.d.ts +17 -0
- package/dist/internal.d.ts.map +1 -0
- package/dist/internal.js +17 -0
- package/dist/internal.js.map +1 -0
- package/dist/persistence/session-payload.d.ts +68 -0
- package/dist/persistence/session-payload.d.ts.map +1 -0
- package/dist/persistence/session-payload.js +78 -0
- package/dist/persistence/session-payload.js.map +1 -0
- package/dist/persistence/session-payload.test.d.ts +11 -0
- package/dist/persistence/session-payload.test.d.ts.map +1 -0
- package/dist/persistence/session-payload.test.js +80 -0
- package/dist/persistence/session-payload.test.js.map +1 -0
- package/dist/persistence/session-replay.d.ts +14 -0
- package/dist/persistence/session-replay.d.ts.map +1 -0
- package/dist/persistence/session-replay.js +85 -0
- package/dist/persistence/session-replay.js.map +1 -0
- package/dist/persistence/session-replay.test.d.ts +10 -0
- package/dist/persistence/session-replay.test.d.ts.map +1 -0
- package/dist/persistence/session-replay.test.js +171 -0
- package/dist/persistence/session-replay.test.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 +48 -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 +192 -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 +271 -0
- package/dist/plugins/__tests__/loader.test.js.map +1 -0
- package/dist/plugins/check-package-discovery.d.ts +19 -0
- package/dist/plugins/check-package-discovery.d.ts.map +1 -0
- package/dist/plugins/check-package-discovery.js +34 -0
- package/dist/plugins/check-package-discovery.js.map +1 -0
- package/dist/plugins/loader.d.ts +32 -0
- package/dist/plugins/loader.d.ts.map +1 -0
- package/dist/plugins/loader.js +198 -0
- package/dist/plugins/loader.js.map +1 -0
- package/dist/plugins/types.d.ts +29 -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 +12 -0
- package/dist/recipes/__tests__/check-config.test.d.ts.map +1 -0
- package/dist/recipes/__tests__/check-config.test.js +90 -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 +160 -0
- package/dist/recipes/__tests__/check-resolution.test.js.map +1 -0
- package/dist/recipes/__tests__/execution-branches.test.d.ts +10 -0
- package/dist/recipes/__tests__/execution-branches.test.d.ts.map +1 -0
- package/dist/recipes/__tests__/execution-branches.test.js +612 -0
- package/dist/recipes/__tests__/execution-branches.test.js.map +1 -0
- package/dist/recipes/__tests__/execution-paths.test.d.ts +10 -0
- package/dist/recipes/__tests__/execution-paths.test.d.ts.map +1 -0
- package/dist/recipes/__tests__/execution-paths.test.js +280 -0
- package/dist/recipes/__tests__/execution-paths.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 +89 -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__/run-one-check.test.d.ts +14 -0
- package/dist/recipes/__tests__/run-one-check.test.d.ts.map +1 -0
- package/dist/recipes/__tests__/run-one-check.test.js +182 -0
- package/dist/recipes/__tests__/run-one-check.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 +572 -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 +241 -0
- package/dist/recipes/built-in-recipes.js.map +1 -0
- package/dist/recipes/check-config.d.ts +56 -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 +36 -0
- package/dist/recipes/check-resolution.d.ts.map +1 -0
- package/dist/recipes/check-resolution.js +81 -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 +197 -0
- package/dist/recipes/check-result-processor.js.map +1 -0
- package/dist/recipes/parallel-execution.d.ts +38 -0
- package/dist/recipes/parallel-execution.d.ts.map +1 -0
- package/dist/recipes/parallel-execution.js +61 -0
- package/dist/recipes/parallel-execution.js.map +1 -0
- package/dist/recipes/registry.d.ts +47 -0
- package/dist/recipes/registry.d.ts.map +1 -0
- package/dist/recipes/registry.js +70 -0
- package/dist/recipes/registry.js.map +1 -0
- package/dist/recipes/retry.d.ts +29 -0
- package/dist/recipes/retry.d.ts.map +1 -0
- package/dist/recipes/retry.js +23 -0
- package/dist/recipes/retry.js.map +1 -0
- package/dist/recipes/run-one-check.d.ts +59 -0
- package/dist/recipes/run-one-check.d.ts.map +1 -0
- package/dist/recipes/run-one-check.js +174 -0
- package/dist/recipes/run-one-check.js.map +1 -0
- package/dist/recipes/sequential-execution.d.ts +12 -0
- package/dist/recipes/sequential-execution.d.ts.map +1 -0
- package/dist/recipes/sequential-execution.js +48 -0
- package/dist/recipes/sequential-execution.js.map +1 -0
- package/dist/recipes/service-types.d.ts +87 -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 +73 -0
- package/dist/recipes/service.d.ts.map +1 -0
- package/dist/recipes/service.js +438 -0
- package/dist/recipes/service.js.map +1 -0
- package/dist/recipes/types.d.ts +155 -0
- package/dist/recipes/types.d.ts.map +1 -0
- package/dist/recipes/types.js +56 -0
- package/dist/recipes/types.js.map +1 -0
- package/dist/scaffold/config-block.d.ts +17 -0
- package/dist/scaffold/config-block.d.ts.map +1 -0
- package/dist/scaffold/config-block.js +30 -0
- package/dist/scaffold/config-block.js.map +1 -0
- package/dist/scaffold/examples.d.ts +30 -0
- package/dist/scaffold/examples.d.ts.map +1 -0
- package/dist/scaffold/examples.js +129 -0
- package/dist/scaffold/examples.js.map +1 -0
- package/dist/scope-augmentation.d.ts +77 -0
- package/dist/scope-augmentation.d.ts.map +1 -0
- package/dist/scope-augmentation.js +31 -0
- package/dist/scope-augmentation.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 +141 -0
- package/dist/signalers/__tests__/loader.test.js.map +1 -0
- package/dist/signalers/__tests__/violation-to-signal.test.d.ts +2 -0
- package/dist/signalers/__tests__/violation-to-signal.test.d.ts.map +1 -0
- package/dist/signalers/__tests__/violation-to-signal.test.js +59 -0
- package/dist/signalers/__tests__/violation-to-signal.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 +30 -0
- package/dist/signalers/loader.d.ts.map +1 -0
- package/dist/signalers/loader.js +120 -0
- package/dist/signalers/loader.js.map +1 -0
- package/dist/signalers/schema.d.ts +60 -0
- package/dist/signalers/schema.d.ts.map +1 -0
- package/dist/signalers/schema.js +74 -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/signalers/violation-to-signal.d.ts +38 -0
- package/dist/signalers/violation-to-signal.d.ts.map +1 -0
- package/dist/signalers/violation-to-signal.js +43 -0
- package/dist/signalers/violation-to-signal.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 +190 -0
- package/dist/targets/__tests__/loader.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 +182 -0
- package/dist/targets/__tests__/target-registry.test.js.map +1 -0
- package/dist/targets/index.d.ts +18 -0
- package/dist/targets/index.d.ts.map +1 -0
- package/dist/targets/index.js +21 -0
- package/dist/targets/index.js.map +1 -0
- package/dist/targets/loader.d.ts +27 -0
- package/dist/targets/loader.d.ts.map +1 -0
- package/dist/targets/loader.js +178 -0
- package/dist/targets/loader.js.map +1 -0
- package/dist/targets/target-registry.d.ts +41 -0
- package/dist/targets/target-registry.d.ts.map +1 -0
- package/dist/targets/target-registry.js +71 -0
- package/dist/targets/target-registry.js.map +1 -0
- package/dist/targets/types.d.ts +14 -0
- package/dist/targets/types.d.ts.map +1 -0
- package/dist/targets/types.js +14 -0
- package/dist/targets/types.js.map +1 -0
- package/dist/tool.d.ts +61 -0
- package/dist/tool.d.ts.map +1 -0
- package/dist/tool.js +260 -0
- package/dist/tool.js.map +1 -0
- package/dist/types/findings.d.ts +113 -0
- package/dist/types/findings.d.ts.map +1 -0
- package/dist/types/findings.js +89 -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 +33 -0
- package/dist/types/severity.js.map +1 -0
- package/package.json +137 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* executeFit boundary test (ADR-0028 — worker-safe, persistence-free engine).
|
|
3
|
+
*
|
|
4
|
+
* `executeFit` does NOT touch the datastore: it returns the envelope + the run's
|
|
5
|
+
* (host timing removed). The CALLER (modes / live runner with ToolCliContext) persists
|
|
6
|
+
* via the `cli.runSession.record` seam (or legacy persistFitSession for some tests).
|
|
7
|
+
* thread (the datastore handle cannot cross the worker boundary). These tests
|
|
8
|
+
* lock both halves: the engine is pure-compute, and the explicit persist writes
|
|
9
|
+
* exactly one session. `onProgress` wiring is also covered.
|
|
10
|
+
*
|
|
11
|
+
* Implementation note: the fixture is a minimal tmp project with just
|
|
12
|
+
* `opensip-cli.config.yml`.
|
|
13
|
+
*/
|
|
14
|
+
export {};
|
|
15
|
+
//# sourceMappingURL=fit-execute-opts.test.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fit-execute-opts.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/fit-execute-opts.test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG"}
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* executeFit boundary test (ADR-0028 — worker-safe, persistence-free engine).
|
|
3
|
+
*
|
|
4
|
+
* `executeFit` does NOT touch the datastore: it returns the envelope + the run's
|
|
5
|
+
* (host timing removed). The CALLER (modes / live runner with ToolCliContext) persists
|
|
6
|
+
* via the `cli.runSession.record` seam (or legacy persistFitSession for some tests).
|
|
7
|
+
* thread (the datastore handle cannot cross the worker boundary). These tests
|
|
8
|
+
* lock both halves: the engine is pure-compute, and the explicit persist writes
|
|
9
|
+
* exactly one session. `onProgress` wiring is also covered.
|
|
10
|
+
*
|
|
11
|
+
* Implementation note: the fixture is a minimal tmp project with just
|
|
12
|
+
* `opensip-cli.config.yml`.
|
|
13
|
+
*/
|
|
14
|
+
import { mkdirSync, mkdtempSync, rmSync, writeFileSync } from 'node:fs';
|
|
15
|
+
import { tmpdir } from 'node:os';
|
|
16
|
+
import { join } from 'node:path';
|
|
17
|
+
import { LanguageRegistry, RunScope, generatePrefixedId, runWithScope } from '@opensip-cli/core';
|
|
18
|
+
import { DataStoreFactory } from '@opensip-cli/datastore';
|
|
19
|
+
import { SessionRepo } from '@opensip-cli/session-store';
|
|
20
|
+
import { afterEach, beforeEach, describe, expect, it } from 'vitest';
|
|
21
|
+
import { buildFitnessSessionPayload } from '../cli/fit/result-builders.js';
|
|
22
|
+
import { executeFit } from '../cli/fit.js';
|
|
23
|
+
import { fitnessTool } from '../tool.js';
|
|
24
|
+
let projectDir;
|
|
25
|
+
let datastore;
|
|
26
|
+
beforeEach(() => {
|
|
27
|
+
projectDir = mkdtempSync(join(tmpdir(), 'opensip-fit-opts-'));
|
|
28
|
+
// Minimal config — at least one target so executeFit doesn't short
|
|
29
|
+
// out on a missing config error.
|
|
30
|
+
writeFileSync(join(projectDir, 'opensip-cli.config.yml'), `targets:
|
|
31
|
+
source:
|
|
32
|
+
description: minimal
|
|
33
|
+
languages: [typescript]
|
|
34
|
+
concerns: [backend]
|
|
35
|
+
include:
|
|
36
|
+
- "src/**/*.ts"
|
|
37
|
+
`);
|
|
38
|
+
mkdirSync(join(projectDir, 'src'));
|
|
39
|
+
writeFileSync(join(projectDir, 'src', 'index.ts'), 'export const x = 1;\n');
|
|
40
|
+
datastore = DataStoreFactory.open({ backend: 'memory' });
|
|
41
|
+
});
|
|
42
|
+
afterEach(() => {
|
|
43
|
+
datastore.close();
|
|
44
|
+
rmSync(projectDir, { recursive: true, force: true });
|
|
45
|
+
});
|
|
46
|
+
function makeArgs(cwd) {
|
|
47
|
+
return {
|
|
48
|
+
json: false,
|
|
49
|
+
list: false,
|
|
50
|
+
recipes: false,
|
|
51
|
+
verbose: false,
|
|
52
|
+
debug: false,
|
|
53
|
+
quiet: true,
|
|
54
|
+
open: false,
|
|
55
|
+
cwd,
|
|
56
|
+
exclude: [],
|
|
57
|
+
gateSave: false,
|
|
58
|
+
gateCompare: false,
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
function withFitScope(fn) {
|
|
62
|
+
// executeFit reads `currentScope()?.languages` and the fitness subscope
|
|
63
|
+
// (`scope.fitness.{checks,recipes,load}`) — wrap each call in a fresh scope
|
|
64
|
+
// carrying both an (empty) language registry and fitness's contributed
|
|
65
|
+
// registries so check loading + recipe selection resolve.
|
|
66
|
+
const scope = new RunScope({ languages: new LanguageRegistry() });
|
|
67
|
+
Object.assign(scope, fitnessTool.contributeScope?.() ?? {});
|
|
68
|
+
return runWithScope(scope, fn);
|
|
69
|
+
}
|
|
70
|
+
describe('executeFit — persistence-free boundary (ADR-0028)', () => {
|
|
71
|
+
it('returns an envelope + durationMs and does NOT persist on its own', async () => {
|
|
72
|
+
const fitResult = await withFitScope(() => executeFit(makeArgs(projectDir)));
|
|
73
|
+
// Sanity — executeFit shouldn't error on a minimal project.
|
|
74
|
+
expect(fitResult.result.type).not.toBe('error');
|
|
75
|
+
expect(fitResult.envelope).toBeDefined();
|
|
76
|
+
// timing removed from executeFit return (Phase 3.1 host-owned); the top-level
|
|
77
|
+
// result no longer carries duration/startedAt. (Test updated in Task 3.4.)
|
|
78
|
+
expect(fitResult.durationMs).toBeUndefined();
|
|
79
|
+
expect(fitResult.startedAt).toBeUndefined();
|
|
80
|
+
// The engine is pure-compute now: nothing was written.
|
|
81
|
+
const sessions = new SessionRepo(datastore).list({ tool: 'fit' });
|
|
82
|
+
expect(sessions.length).toBe(0);
|
|
83
|
+
});
|
|
84
|
+
it('a fit session contribution persisted via SessionRepo writes exactly one row', async () => {
|
|
85
|
+
const args = makeArgs(projectDir);
|
|
86
|
+
const fitResult = await withFitScope(() => executeFit(args));
|
|
87
|
+
expect(fitResult.envelope).toBeDefined();
|
|
88
|
+
const envelope = fitResult.envelope;
|
|
89
|
+
// host-owned-run-timing Phase 3 removed the production `persistFitSession`
|
|
90
|
+
// helper — the host run plane owns persistence. This test-only write mirrors
|
|
91
|
+
// the row the host writes from the tool's returned ToolSessionContribution.
|
|
92
|
+
new SessionRepo(datastore).save({
|
|
93
|
+
id: generatePrefixedId('fit'),
|
|
94
|
+
tool: 'fit',
|
|
95
|
+
startedAt: '1970-01-01T00:00:00.000Z',
|
|
96
|
+
completedAt: '1970-01-01T00:00:00.000Z',
|
|
97
|
+
cwd: args.cwd,
|
|
98
|
+
recipe: envelope.recipe,
|
|
99
|
+
score: envelope.verdict.score,
|
|
100
|
+
passed: envelope.verdict.passed,
|
|
101
|
+
durationMs: 0,
|
|
102
|
+
payload: buildFitnessSessionPayload(envelope),
|
|
103
|
+
});
|
|
104
|
+
const sessions = new SessionRepo(datastore).list({ tool: 'fit' });
|
|
105
|
+
expect(sessions.length).toBe(1);
|
|
106
|
+
expect(sessions[0]?.tool).toBe('fit');
|
|
107
|
+
expect(sessions[0]?.cwd).toBe(projectDir);
|
|
108
|
+
});
|
|
109
|
+
it('invokes onProgress when supplied', async () => {
|
|
110
|
+
const calls = [];
|
|
111
|
+
const fitResult = await withFitScope(() => executeFit(makeArgs(projectDir), {
|
|
112
|
+
onProgress: (completed, total) => {
|
|
113
|
+
calls.push({ completed, total });
|
|
114
|
+
},
|
|
115
|
+
}));
|
|
116
|
+
expect(fitResult.result.type).not.toBe('error');
|
|
117
|
+
// Even with zero registered checks the recipe service may yield no
|
|
118
|
+
// tick, so the contract is "accepts the callback without throwing".
|
|
119
|
+
// Stronger assertions are exercised by the FitView integration in
|
|
120
|
+
// the CLI package; here we only need to prove the opt is wired.
|
|
121
|
+
expect(Array.isArray(calls)).toBe(true);
|
|
122
|
+
});
|
|
123
|
+
});
|
|
124
|
+
//# sourceMappingURL=fit-execute-opts.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fit-execute-opts.test.js","sourceRoot":"","sources":["../../src/__tests__/fit-execute-opts.test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACxE,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjG,OAAO,EAAE,gBAAgB,EAAkB,MAAM,wBAAwB,CAAC;AAC1E,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AACzD,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAErE,OAAO,EAAE,0BAA0B,EAAE,MAAM,+BAA+B,CAAC;AAC3E,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAIzC,IAAI,UAAkB,CAAC;AACvB,IAAI,SAAoB,CAAC;AAEzB,UAAU,CAAC,GAAG,EAAE;IACd,UAAU,GAAG,WAAW,CAAC,IAAI,CAAC,MAAM,EAAE,EAAE,mBAAmB,CAAC,CAAC,CAAC;IAC9D,mEAAmE;IACnE,iCAAiC;IACjC,aAAa,CACX,IAAI,CAAC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AkE;QAClE,gEAAgE;QAChE,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC1C,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Export-surface lock for `@opensip-cli/fitness`.
|
|
3
|
+
*
|
|
4
|
+
* The public barrel is the marketplace contract surface documented in
|
|
5
|
+
* `docs/public/10-concepts/04-contract-surfaces.md`: the check / recipe /
|
|
6
|
+
* plugin authoring API plus `fitnessTool`. This test pins the exact set of
|
|
7
|
+
* **runtime (value) exports** so the barrel cannot silently re-grow to leak
|
|
8
|
+
* engine internals (registries, recipe service, gate primitives,
|
|
9
|
+
* `FitBaselineRepo`, CLI handlers, …) — the regression the round-4 boundary
|
|
10
|
+
* audit found and ADR-0013 curated away.
|
|
11
|
+
*
|
|
12
|
+
* Scope note: type-only exports are erased at runtime and cannot be asserted
|
|
13
|
+
* here. They are governed by the barrel source plus the dependency-cruiser
|
|
14
|
+
* `no-cross-package-internal` rule. Adding a *value* export to the barrel is a
|
|
15
|
+
* deliberate minor-version act and must be reflected in EXPECTED below (and in
|
|
16
|
+
* the contract-surfaces doc); removing one is a major change.
|
|
17
|
+
*/
|
|
18
|
+
export {};
|
|
19
|
+
//# sourceMappingURL=public-api.test.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"public-api.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/public-api.test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG"}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Export-surface lock for `@opensip-cli/fitness`.
|
|
3
|
+
*
|
|
4
|
+
* The public barrel is the marketplace contract surface documented in
|
|
5
|
+
* `docs/public/10-concepts/04-contract-surfaces.md`: the check / recipe /
|
|
6
|
+
* plugin authoring API plus `fitnessTool`. This test pins the exact set of
|
|
7
|
+
* **runtime (value) exports** so the barrel cannot silently re-grow to leak
|
|
8
|
+
* engine internals (registries, recipe service, gate primitives,
|
|
9
|
+
* `FitBaselineRepo`, CLI handlers, …) — the regression the round-4 boundary
|
|
10
|
+
* audit found and ADR-0013 curated away.
|
|
11
|
+
*
|
|
12
|
+
* Scope note: type-only exports are erased at runtime and cannot be asserted
|
|
13
|
+
* here. They are governed by the barrel source plus the dependency-cruiser
|
|
14
|
+
* `no-cross-package-internal` rule. Adding a *value* export to the barrel is a
|
|
15
|
+
* deliberate minor-version act and must be reflected in EXPECTED below (and in
|
|
16
|
+
* the contract-surfaces doc); removing one is a major change.
|
|
17
|
+
*/
|
|
18
|
+
import { describe, expect, it } from 'vitest';
|
|
19
|
+
import * as barrel from '../index.js';
|
|
20
|
+
/** The complete, intended set of runtime value exports. Keep alphabetised. */
|
|
21
|
+
const EXPECTED_VALUE_EXPORTS = [
|
|
22
|
+
'applyCheckDisplay',
|
|
23
|
+
'buildImportGraph',
|
|
24
|
+
'clearCurrentRecipeCheckConfig',
|
|
25
|
+
'collectCheckObjects',
|
|
26
|
+
'createPathMatcher',
|
|
27
|
+
'defineCheck',
|
|
28
|
+
'defineRecipe',
|
|
29
|
+
'defineRegexListCheck',
|
|
30
|
+
'execAbortable',
|
|
31
|
+
'extractSnippet',
|
|
32
|
+
'fileCache',
|
|
33
|
+
'findStronglyConnectedComponents',
|
|
34
|
+
'fitnessTool',
|
|
35
|
+
'getCheckConfig',
|
|
36
|
+
'getCheckDisplayName',
|
|
37
|
+
'getCheckIcon',
|
|
38
|
+
'getLineNumber',
|
|
39
|
+
'isAPIFile',
|
|
40
|
+
'isCheck',
|
|
41
|
+
'isCommentLine',
|
|
42
|
+
'isInsideStringLiteral',
|
|
43
|
+
'isTestFile',
|
|
44
|
+
'makeDisplayHelpers',
|
|
45
|
+
'readPackageVersion',
|
|
46
|
+
'setCurrentRecipeCheckConfig',
|
|
47
|
+
'stripStringLiterals',
|
|
48
|
+
'stripStringsAndComments',
|
|
49
|
+
'stripStringsAndCommentsPreservingPositions',
|
|
50
|
+
'tool',
|
|
51
|
+
'FITNESS_CONTRACT_VERSION',
|
|
52
|
+
].sort();
|
|
53
|
+
describe('@opensip-cli/fitness public barrel', () => {
|
|
54
|
+
it('exposes exactly the curated value-export surface', () => {
|
|
55
|
+
const actual = Object.keys(barrel)
|
|
56
|
+
.filter((k) => barrel[k] !== undefined)
|
|
57
|
+
.sort();
|
|
58
|
+
expect(actual).toEqual(EXPECTED_VALUE_EXPORTS);
|
|
59
|
+
});
|
|
60
|
+
it('exposes `fitnessTool` (and its `tool` alias) as the Tool descriptor', () => {
|
|
61
|
+
expect(barrel.fitnessTool).toBeDefined();
|
|
62
|
+
expect(barrel.fitnessTool.metadata.name).toBe('fitness');
|
|
63
|
+
expect(barrel.fitnessTool.metadata.id).toBe('afd68bd3-ff3c-4935-a5b6-76d8fc7a5224');
|
|
64
|
+
expect(barrel.tool).toBe(barrel.fitnessTool);
|
|
65
|
+
});
|
|
66
|
+
it('does NOT leak engine internals through the barrel', () => {
|
|
67
|
+
// Spot-check the worst former offenders: a persistence repo, the recipe
|
|
68
|
+
// service, the registries, and a CLI handler must not be reachable here.
|
|
69
|
+
for (const leak of [
|
|
70
|
+
'FitBaselineRepo',
|
|
71
|
+
'FitnessRecipeService',
|
|
72
|
+
'FitnessRecipeRegistry',
|
|
73
|
+
'defaultRegistry',
|
|
74
|
+
'CheckRegistry',
|
|
75
|
+
'TargetRegistry',
|
|
76
|
+
'listChecks',
|
|
77
|
+
'saveBaseline',
|
|
78
|
+
'compareToBaseline',
|
|
79
|
+
'ensureChecksLoaded',
|
|
80
|
+
]) {
|
|
81
|
+
expect(barrel).not.toHaveProperty(leak);
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
});
|
|
85
|
+
//# sourceMappingURL=public-api.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"public-api.test.js","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S,CAAC,CAAC;QACzD,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,sCAAsC,CAAC,CAAC;QACpF,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;IAC/C,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,mDAAmD,EAAE,GAAG,EAAE;QAC3D,wEAAwE;QACxE,yEAAyE;QACzE,KAAK,MAAM,IAAI,IAAI;YACjB,iBAAiB;YACjB,sBAAsB;YACtB,uBAAuB;YACvB,iBAAiB;YACjB,eAAe;YACf,gBAAgB;YAChB,YAAY;YACZ,cAAc;YACd,mBAAmB;YACnB,oBAAoB;SACrB,EAAE,CAAC;YACF,MAAM,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;QAC1C,CAAC;IACH,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tool contract conformance test for fitnessTool.
|
|
3
|
+
*
|
|
4
|
+
* Mirrors the graph + simulation tests: catches version-drift between
|
|
5
|
+
* `metadata.version` and package.json. Before tools/lib/package-version
|
|
6
|
+
* existed, both fields were hardcoded literals that drifted silently
|
|
7
|
+
* across releases.
|
|
8
|
+
*/
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=tool.test.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tool.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/tool.test.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tool contract conformance test for fitnessTool.
|
|
3
|
+
*
|
|
4
|
+
* Mirrors the graph + simulation tests: catches version-drift between
|
|
5
|
+
* `metadata.version` and package.json. Before tools/lib/package-version
|
|
6
|
+
* existed, both fields were hardcoded literals that drifted silently
|
|
7
|
+
* across releases.
|
|
8
|
+
*/
|
|
9
|
+
import { readFileSync } from 'node:fs';
|
|
10
|
+
import { dirname, resolve } from 'node:path';
|
|
11
|
+
import { fileURLToPath } from 'node:url';
|
|
12
|
+
import { describe, expect, it } from 'vitest';
|
|
13
|
+
import { fitnessTool } from '../tool.js';
|
|
14
|
+
const HERE = dirname(fileURLToPath(import.meta.url));
|
|
15
|
+
const PKG = JSON.parse(readFileSync(resolve(HERE, '../../package.json'), 'utf8'));
|
|
16
|
+
describe('fitnessTool contract conformance', () => {
|
|
17
|
+
it("metadata.name is the human key 'fitness'; id is the stable UUID", () => {
|
|
18
|
+
expect(fitnessTool.metadata.name).toBe('fitness');
|
|
19
|
+
expect(fitnessTool.metadata.id).toBe('afd68bd3-ff3c-4935-a5b6-76d8fc7a5224');
|
|
20
|
+
});
|
|
21
|
+
it('metadata.version matches package.json', () => {
|
|
22
|
+
expect(fitnessTool.metadata.version).toBe(PKG.version);
|
|
23
|
+
});
|
|
24
|
+
it('metadata.description is non-empty', () => {
|
|
25
|
+
expect(fitnessTool.metadata.description.length).toBeGreaterThan(0);
|
|
26
|
+
});
|
|
27
|
+
it('commands list includes fit, fit-list, fit-recipes', () => {
|
|
28
|
+
const names = fitnessTool.commands.map((c) => c.name);
|
|
29
|
+
expect(names).toEqual(expect.arrayContaining(['fit', 'fit-list', 'fit-recipes']));
|
|
30
|
+
});
|
|
31
|
+
it("does not own the cross-tool 'report' command", () => {
|
|
32
|
+
const names = fitnessTool.commands.map((c) => c.name);
|
|
33
|
+
expect(names).not.toContain('report');
|
|
34
|
+
expect(names).not.toContain('dashboard');
|
|
35
|
+
});
|
|
36
|
+
it('contributes report data via the Tool.collectReportData seam', () => {
|
|
37
|
+
expect(typeof fitnessTool.collectReportData).toBe('function');
|
|
38
|
+
});
|
|
39
|
+
it('declares its command surface via commandSpecs (Phase 4), not register()', () => {
|
|
40
|
+
expect(Array.isArray(fitnessTool.commandSpecs)).toBe(true);
|
|
41
|
+
const specNames = (fitnessTool.commandSpecs ?? []).map((s) => s.name);
|
|
42
|
+
expect(specNames).toEqual([
|
|
43
|
+
'fit',
|
|
44
|
+
'fit-list',
|
|
45
|
+
'fit-recipes',
|
|
46
|
+
'fit-baseline-export',
|
|
47
|
+
// [internal] headless run forked by the live view (ADR-0028).
|
|
48
|
+
'fit-run-worker',
|
|
49
|
+
]);
|
|
50
|
+
});
|
|
51
|
+
it('fit-list / fit-recipes do not expose pre-GA legacy aliases', () => {
|
|
52
|
+
const byName = new Map((fitnessTool.commandSpecs ?? []).map((s) => [s.name, s]));
|
|
53
|
+
expect(byName.get('fit-list')?.aliases ?? []).toEqual([]);
|
|
54
|
+
expect(byName.get('fit-recipes')?.aliases ?? []).toEqual([]);
|
|
55
|
+
});
|
|
56
|
+
});
|
|
57
|
+
//# sourceMappingURL=tool.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tool.test.js","sourceRoot":"","sources":["../../src/__tests__/tool.test.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAE9C,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAEzC,MAAM,IAAI,GAAG,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AACrD,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,OAAO,CAAC,IAAI,EAAE,oBAAoB,CAAC,EAAE,MAAM,CAAC,CAE/E,CAAC;AAEF,QAAQ,CAAC,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+1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview fitness's fingerprint strategy for the host baseline/ratchet
|
|
3
|
+
* plane (ADR-0036).
|
|
4
|
+
*
|
|
5
|
+
* fitness's identity is `sha256(filePath\nruleId\nmessage)` — it INCLUDES the
|
|
6
|
+
* message but EXCLUDES line/column, so an unrelated line-shift (code added above
|
|
7
|
+
* a finding) does not re-key the baseline and flap the ratchet. This is the
|
|
8
|
+
* opposite policy from graph's location-based key (which excludes message because
|
|
9
|
+
* several graph rules embed run-varying counts in their message), and both are
|
|
10
|
+
* correct for their domain (ADR-0036: per-tool strategy, not a global algorithm).
|
|
11
|
+
*
|
|
12
|
+
* Byte-preserved from the pre-ADR-0036 `DEFAULT_VIOLATION_IDENTITY`
|
|
13
|
+
* (`gate.ts`), now keyed off the `Signal` (the plane's currency) instead of a
|
|
14
|
+
* `GateViolation` — the same three fields `extractViolationsFromEnvelope` read.
|
|
15
|
+
* A `fingerprint-parity.test.ts` pins byte-equality against that oracle before
|
|
16
|
+
* the old gate is deleted.
|
|
17
|
+
*/
|
|
18
|
+
import type { FingerprintStrategy } from '@opensip-cli/core';
|
|
19
|
+
/** fitness's message-hash baseline identity: `sha256(filePath\nruleId\nmessage)`. */
|
|
20
|
+
export declare const fitnessFingerprintStrategy: FingerprintStrategy;
|
|
21
|
+
//# sourceMappingURL=baseline-strategy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"baseline-strategy.d.ts","sourceRoot":"","sources":["../src/baseline-strategy.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAIH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAE7D,qFAAqF;AACrF,eAAO,MAAM,0BAA0B,EAAE,mBAC8C,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview fitness's fingerprint strategy for the host baseline/ratchet
|
|
3
|
+
* plane (ADR-0036).
|
|
4
|
+
*
|
|
5
|
+
* fitness's identity is `sha256(filePath\nruleId\nmessage)` — it INCLUDES the
|
|
6
|
+
* message but EXCLUDES line/column, so an unrelated line-shift (code added above
|
|
7
|
+
* a finding) does not re-key the baseline and flap the ratchet. This is the
|
|
8
|
+
* opposite policy from graph's location-based key (which excludes message because
|
|
9
|
+
* several graph rules embed run-varying counts in their message), and both are
|
|
10
|
+
* correct for their domain (ADR-0036: per-tool strategy, not a global algorithm).
|
|
11
|
+
*
|
|
12
|
+
* Byte-preserved from the pre-ADR-0036 `DEFAULT_VIOLATION_IDENTITY`
|
|
13
|
+
* (`gate.ts`), now keyed off the `Signal` (the plane's currency) instead of a
|
|
14
|
+
* `GateViolation` — the same three fields `extractViolationsFromEnvelope` read.
|
|
15
|
+
* A `fingerprint-parity.test.ts` pins byte-equality against that oracle before
|
|
16
|
+
* the old gate is deleted.
|
|
17
|
+
*/
|
|
18
|
+
import { createHash } from 'node:crypto';
|
|
19
|
+
/** fitness's message-hash baseline identity: `sha256(filePath\nruleId\nmessage)`. */
|
|
20
|
+
export const fitnessFingerprintStrategy = (s) => createHash('sha256').update(`${s.filePath}\n${s.ruleId}\n${s.message}`).digest('hex');
|
|
21
|
+
//# sourceMappingURL=baseline-strategy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"baseline-strategy.js","sourceRoot":"","sources":["../src/baseline-strategy.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAIzC,qFAAqF;AACrF,MAAM,CAAC,MAAM,0BAA0B,GAAwB,CAAC,CAAC,EAAE,EAAE,CACnE,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,QAAQ,KAAK,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Shared display-lookup helpers for fitness check packs.
|
|
3
|
+
*
|
|
4
|
+
* Each check pack contributes its own slug -> [icon, displayName] map; these
|
|
5
|
+
* helpers do the lookup against that map with a sensible fallback. Previously
|
|
6
|
+
* each pack carried a byte-identical copy of this lookup logic — surfaced by
|
|
7
|
+
* the graph tool's duplicated-function-body rule.
|
|
8
|
+
*/
|
|
9
|
+
import type { Check } from '../framework/check-types.js';
|
|
10
|
+
import type { CheckDisplayEntry } from '../plugins/types.js';
|
|
11
|
+
/**
|
|
12
|
+
* Fold a pack's `slug -> [icon, displayName]` map ONTO its checks (§5.3 fold):
|
|
13
|
+
* each check whose slug has an entry gets `icon`/`displayName` set on its
|
|
14
|
+
* `config`, so display travels WITH the check and there is no separate
|
|
15
|
+
* per-process display sidecar/singleton. Checks with no entry pass through
|
|
16
|
+
* unchanged (consumers fall back to a default icon + kebab-to-title-case).
|
|
17
|
+
*
|
|
18
|
+
* `check.config` is pure metadata — the check's `run`/`getScope`/`getMatcher`
|
|
19
|
+
* closures capture the original author config, not `check.config` — so adding
|
|
20
|
+
* display to `check.config` is execution-safe.
|
|
21
|
+
*/
|
|
22
|
+
export declare function applyCheckDisplay(checks: readonly Check[], displayMap: Readonly<Record<string, CheckDisplayEntry>>): Check[];
|
|
23
|
+
/**
|
|
24
|
+
* Get the icon for a check by slug. Falls back to the magnifying-glass emoji
|
|
25
|
+
* when the slug isn't present in the supplied display map.
|
|
26
|
+
*/
|
|
27
|
+
export declare function getCheckIcon(displayMap: Readonly<Record<string, CheckDisplayEntry>>, checkSlug: string): string;
|
|
28
|
+
/**
|
|
29
|
+
* Get the display name for a check by slug. Falls back to kebab-to-title-case
|
|
30
|
+
* conversion of the slug itself when no entry exists in the display map.
|
|
31
|
+
*/
|
|
32
|
+
export declare function getCheckDisplayName(displayMap: Readonly<Record<string, CheckDisplayEntry>>, checkSlug: string): string;
|
|
33
|
+
/**
|
|
34
|
+
* Display helpers bound to a single check pack's display map.
|
|
35
|
+
*/
|
|
36
|
+
export interface DisplayHelpers {
|
|
37
|
+
/** Get the icon for a check by slug. Falls back to the magnifying-glass emoji. */
|
|
38
|
+
getCheckIcon: (checkSlug: string) => string;
|
|
39
|
+
/** Get the display name for a check by slug. Falls back to kebab-to-title-case. */
|
|
40
|
+
getCheckDisplayName: (checkSlug: string) => string;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Binds the shared display-lookup logic to a per-pack `CHECK_DISPLAY` map,
|
|
44
|
+
* returning slug-only `getCheckIcon` / `getCheckDisplayName` closures.
|
|
45
|
+
*
|
|
46
|
+
* Each check pack owns its own display data but the binding wrapper was
|
|
47
|
+
* previously byte-identical across packs (flagged by the graph tool's
|
|
48
|
+
* duplicated-function-body rule); this factory keeps the data/logic split
|
|
49
|
+
* intact while erasing the wrapper twin.
|
|
50
|
+
*/
|
|
51
|
+
export declare function makeDisplayHelpers(displayMap: Readonly<Record<string, CheckDisplayEntry>>): DisplayHelpers;
|
|
52
|
+
//# sourceMappingURL=display.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"display.d.ts","sourceRoot":"","sources":["../../src/check-utils/display.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,6BAA6B,CAAC;AACzD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAE7D;;;;;;;;;;GAUG;AACH,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,SAAS,KAAK,EAAE,EACxB,UAAU,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAC,GACtD,KAAK,EAAE,CAMT;AAKD;;;GAGG;AACH,wBAAgB,YAAY,CAC1B,UAAU,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAC,EACvD,SAAS,EAAE,MAAM,GAChB,MAAM,CAGR;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CACjC,UAAU,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAC,EACvD,SAAS,EAAE,MAAM,GAChB,MAAM,CAOR;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,kFAAkF;IAClF,YAAY,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,MAAM,CAAC;IAC5C,mFAAmF;IACnF,mBAAmB,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,MAAM,CAAC;CACpD;AAED;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAChC,UAAU,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAC,GACtD,cAAc,CAKhB"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Shared display-lookup helpers for fitness check packs.
|
|
3
|
+
*
|
|
4
|
+
* Each check pack contributes its own slug -> [icon, displayName] map; these
|
|
5
|
+
* helpers do the lookup against that map with a sensible fallback. Previously
|
|
6
|
+
* each pack carried a byte-identical copy of this lookup logic — surfaced by
|
|
7
|
+
* the graph tool's duplicated-function-body rule.
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* Fold a pack's `slug -> [icon, displayName]` map ONTO its checks (§5.3 fold):
|
|
11
|
+
* each check whose slug has an entry gets `icon`/`displayName` set on its
|
|
12
|
+
* `config`, so display travels WITH the check and there is no separate
|
|
13
|
+
* per-process display sidecar/singleton. Checks with no entry pass through
|
|
14
|
+
* unchanged (consumers fall back to a default icon + kebab-to-title-case).
|
|
15
|
+
*
|
|
16
|
+
* `check.config` is pure metadata — the check's `run`/`getScope`/`getMatcher`
|
|
17
|
+
* closures capture the original author config, not `check.config` — so adding
|
|
18
|
+
* display to `check.config` is execution-safe.
|
|
19
|
+
*/
|
|
20
|
+
export function applyCheckDisplay(checks, displayMap) {
|
|
21
|
+
return checks.map((check) => {
|
|
22
|
+
const entry = displayMap[check.config.slug];
|
|
23
|
+
if (!entry)
|
|
24
|
+
return check;
|
|
25
|
+
return { ...check, config: { ...check.config, icon: entry[0], displayName: entry[1] } };
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
/** Default fallback icon when a slug isn't in the display map. */
|
|
29
|
+
const DEFAULT_ICON = '🔍';
|
|
30
|
+
/**
|
|
31
|
+
* Get the icon for a check by slug. Falls back to the magnifying-glass emoji
|
|
32
|
+
* when the slug isn't present in the supplied display map.
|
|
33
|
+
*/
|
|
34
|
+
export function getCheckIcon(displayMap, checkSlug) {
|
|
35
|
+
const display = displayMap[checkSlug];
|
|
36
|
+
return display ? display[0] : DEFAULT_ICON;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Get the display name for a check by slug. Falls back to kebab-to-title-case
|
|
40
|
+
* conversion of the slug itself when no entry exists in the display map.
|
|
41
|
+
*/
|
|
42
|
+
export function getCheckDisplayName(displayMap, checkSlug) {
|
|
43
|
+
const display = displayMap[checkSlug];
|
|
44
|
+
if (display)
|
|
45
|
+
return display[1];
|
|
46
|
+
return checkSlug
|
|
47
|
+
.split('-')
|
|
48
|
+
.map((word) => word.charAt(0).toUpperCase() + word.slice(1))
|
|
49
|
+
.join(' ');
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Binds the shared display-lookup logic to a per-pack `CHECK_DISPLAY` map,
|
|
53
|
+
* returning slug-only `getCheckIcon` / `getCheckDisplayName` closures.
|
|
54
|
+
*
|
|
55
|
+
* Each check pack owns its own display data but the binding wrapper was
|
|
56
|
+
* previously byte-identical across packs (flagged by the graph tool's
|
|
57
|
+
* duplicated-function-body rule); this factory keeps the data/logic split
|
|
58
|
+
* intact while erasing the wrapper twin.
|
|
59
|
+
*/
|
|
60
|
+
export function makeDisplayHelpers(displayMap) {
|
|
61
|
+
return {
|
|
62
|
+
getCheckIcon: (checkSlug) => getCheckIcon(displayMap, checkSlug),
|
|
63
|
+
getCheckDisplayName: (checkSlug) => getCheckDisplayName(displayMap, checkSlug),
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
//# sourceMappingURL=display.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"display.js","sourceRoot":"","sources":["../../src/check-utils/display.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAKH;;;;;;;;;;GAUG;AACH,MAAM,UAAU,iBAAiB,CAC/B,MAAwB,EACxB,UAAuD;IAEvD,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE;QAC1B,MAAM,KAAK,GAAG,UAAU,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QAC5C,IAAI,CAAC,KAAK;YAAE,OAAO,KAAK,CAAC;QACzB,OAAO,EAAE,GAAG,KAAK,EAAE,MAAM,EAAE,EAAE,GAAG,KAAK,CAAC,MAAM,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;IAC1F,CAAC,CAAC,CAAC;AACL,CAAC;AAED,kEAAkE;AAClE,MAAM,YAAY,GAAG,IAAI,CAAC;AAE1B;;;GAGG;AACH,MAAM,UAAU,YAAY,CAC1B,UAAuD,EACvD,SAAiB;IAEjB,MAAM,OAAO,GAAG,UAAU,CAAC,SAAS,CAAC,CAAC;IACtC,OAAO,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC;AAC7C,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,mBAAmB,CACjC,UAAuD,EACvD,SAAiB;IAEjB,MAAM,OAAO,GAAG,UAAU,CAAC,SAAS,CAAC,CAAC;IACtC,IAAI,OAAO;QAAE,OAAO,OAAO,CAAC,CAAC,CAAC,CAAC;IAC/B,OAAO,SAAS;SACb,KAAK,CAAC,GAAG,CAAC;SACV,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;SAC3D,IAAI,CAAC,GAAG,CAAC,CAAC;AACf,CAAC;AAYD;;;;;;;;GAQG;AACH,MAAM,UAAU,kBAAkB,CAChC,UAAuD;IAEvD,OAAO;QACL,YAAY,EAAE,CAAC,SAAS,EAAE,EAAE,CAAC,YAAY,CAAC,UAAU,EAAE,SAAS,CAAC;QAChE,mBAAmB,EAAE,CAAC,SAAS,EAAE,EAAE,CAAC,mBAAmB,CAAC,UAAU,EAAE,SAAS,CAAC;KAC/E,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Shared utilities for check authors.
|
|
3
|
+
*
|
|
4
|
+
* These helpers were previously copy-pasted between check packs
|
|
5
|
+
* (@opensip-cli/checks-typescript and @opensip-cli/checks-universal).
|
|
6
|
+
* Both packs depend on @opensip-cli/fitness, so the engine is the
|
|
7
|
+
* natural shared home.
|
|
8
|
+
*/
|
|
9
|
+
export { isCommentLine } from './source-analysis.js';
|
|
10
|
+
export type { IsCommentLineOptions } from './source-analysis.js';
|
|
11
|
+
export { isTestFile } from './test-helpers.js';
|
|
12
|
+
export type { IsTestFileOptions } from './test-helpers.js';
|
|
13
|
+
export { applyCheckDisplay, getCheckDisplayName, getCheckIcon, makeDisplayHelpers, } from './display.js';
|
|
14
|
+
export type { DisplayHelpers } from './display.js';
|
|
15
|
+
export { createPathMatcher } from './path-matching.js';
|
|
16
|
+
export type { PathPattern } from './path-matching.js';
|
|
17
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/check-utils/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,YAAY,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAEjE,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,YAAY,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAE3D,OAAO,EACL,iBAAiB,EACjB,mBAAmB,EACnB,YAAY,EACZ,kBAAkB,GACnB,MAAM,cAAc,CAAC;AACtB,YAAY,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAEnD,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACvD,YAAY,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Shared utilities for check authors.
|
|
3
|
+
*
|
|
4
|
+
* These helpers were previously copy-pasted between check packs
|
|
5
|
+
* (@opensip-cli/checks-typescript and @opensip-cli/checks-universal).
|
|
6
|
+
* Both packs depend on @opensip-cli/fitness, so the engine is the
|
|
7
|
+
* natural shared home.
|
|
8
|
+
*/
|
|
9
|
+
export { isCommentLine } from './source-analysis.js';
|
|
10
|
+
export { isTestFile } from './test-helpers.js';
|
|
11
|
+
export { applyCheckDisplay, getCheckDisplayName, getCheckIcon, makeDisplayHelpers, } from './display.js';
|
|
12
|
+
export { createPathMatcher } from './path-matching.js';
|
|
13
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/check-utils/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAGrD,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAG/C,OAAO,EACL,iBAAiB,EACjB,mBAAmB,EACnB,YAAY,EACZ,kBAAkB,GACnB,MAAM,cAAc,CAAC;AAGtB,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Path matching utilities for fitness checks.
|
|
3
|
+
*
|
|
4
|
+
* Factory function for creating path matchers that work with both string
|
|
5
|
+
* patterns (using `includes`) and RegExp patterns (using `test`). Previously
|
|
6
|
+
* each check pack carried a byte-identical copy of this helper — surfaced by
|
|
7
|
+
* the graph tool's duplicated-function-body rule. Both packs depend on
|
|
8
|
+
* @opensip-cli/fitness, so the engine is the natural shared home.
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* A path pattern can be a string (for includes matching) or a RegExp (for test matching).
|
|
12
|
+
*/
|
|
13
|
+
export type PathPattern = string | RegExp;
|
|
14
|
+
/**
|
|
15
|
+
* Creates a path matcher function from an array of patterns.
|
|
16
|
+
*
|
|
17
|
+
* String patterns match using `path.includes(pattern)`.
|
|
18
|
+
* RegExp patterns match using `pattern.test(path)`.
|
|
19
|
+
*
|
|
20
|
+
* @param patterns - Array of string or RegExp patterns to match against
|
|
21
|
+
* @returns A function that returns true if the path matches any pattern
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* ```typescript
|
|
25
|
+
* // String patterns (includes matching)
|
|
26
|
+
* const isExcluded = createPathMatcher(['/__tests__/', '/node_modules/']);
|
|
27
|
+
* isExcluded('/src/__tests__/foo.ts'); // true
|
|
28
|
+
*
|
|
29
|
+
* // RegExp patterns (test matching)
|
|
30
|
+
* const isTestFile = createPathMatcher([/\.test\.ts$/, /\.spec\.ts$/]);
|
|
31
|
+
* isTestFile('foo.test.ts'); // true
|
|
32
|
+
*
|
|
33
|
+
* // Mixed patterns
|
|
34
|
+
* const isIgnored = createPathMatcher(['/dist/', /node_modules/]);
|
|
35
|
+
* isIgnored('/project/dist/bundle.js'); // true
|
|
36
|
+
* isIgnored('/project/node_modules/lodash/index.js'); // true
|
|
37
|
+
* ```
|
|
38
|
+
*/
|
|
39
|
+
export declare function createPathMatcher(patterns: readonly PathPattern[]): (path: string) => boolean;
|
|
40
|
+
//# sourceMappingURL=path-matching.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"path-matching.d.ts","sourceRoot":"","sources":["../../src/check-utils/path-matching.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,MAAM,CAAC;AAE1C;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,SAAS,WAAW,EAAE,GAAG,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAE7F"}
|