@zxyycom/vibe-check 0.0.1
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 +21 -0
- package/README.md +154 -0
- package/dist/esm/check/check.mjs +5 -0
- package/dist/esm/check/check.mjs.map +1 -0
- package/dist/esm/check/descriptor-validation.mjs +37 -0
- package/dist/esm/check/descriptor-validation.mjs.map +1 -0
- package/dist/esm/check/descriptor.mjs +2 -0
- package/dist/esm/check/descriptor.mjs.map +1 -0
- package/dist/esm/check/inherited-collection.mjs +62 -0
- package/dist/esm/check/inherited-collection.mjs.map +1 -0
- package/dist/esm/check/options-snapshot.mjs +75 -0
- package/dist/esm/check/options-snapshot.mjs.map +1 -0
- package/dist/esm/check-settlement/fact-validation.mjs +216 -0
- package/dist/esm/check-settlement/fact-validation.mjs.map +1 -0
- package/dist/esm/check-settlement/facts.mjs +2 -0
- package/dist/esm/check-settlement/facts.mjs.map +1 -0
- package/dist/esm/check-settlement/outcome-normalization.mjs +80 -0
- package/dist/esm/check-settlement/outcome-normalization.mjs.map +1 -0
- package/dist/esm/check-settlement/record-store.mjs +59 -0
- package/dist/esm/check-settlement/record-store.mjs.map +1 -0
- package/dist/esm/check-settlement/session.mjs +179 -0
- package/dist/esm/check-settlement/session.mjs.map +1 -0
- package/dist/esm/data-boundary/canonical-data.mjs +159 -0
- package/dist/esm/data-boundary/canonical-data.mjs.map +1 -0
- package/dist/esm/data-boundary/canonical-json.mjs +2 -0
- package/dist/esm/data-boundary/canonical-json.mjs.map +1 -0
- package/dist/esm/data-boundary/closed-values.mjs +98 -0
- package/dist/esm/data-boundary/closed-values.mjs.map +1 -0
- package/dist/esm/data-boundary/value-shapes.mjs +13 -0
- package/dist/esm/data-boundary/value-shapes.mjs.map +1 -0
- package/dist/esm/finding-waivers/reconciliation.mjs +84 -0
- package/dist/esm/finding-waivers/reconciliation.mjs.map +1 -0
- package/dist/esm/index.mjs +26 -0
- package/dist/esm/index.mjs.map +1 -0
- package/dist/esm/machine-output/v4/atomic-publication.mjs +102 -0
- package/dist/esm/machine-output/v4/atomic-publication.mjs.map +1 -0
- package/dist/esm/machine-output/v4/freeze-publication-value.mjs +14 -0
- package/dist/esm/machine-output/v4/freeze-publication-value.mjs.map +1 -0
- package/dist/esm/machine-output/v4/projection.mjs +23 -0
- package/dist/esm/machine-output/v4/projection.mjs.map +1 -0
- package/dist/esm/machine-output/v4/publication-invariants.mjs +59 -0
- package/dist/esm/machine-output/v4/publication-invariants.mjs.map +1 -0
- package/dist/esm/machine-output/v4/publication-model.mjs +19 -0
- package/dist/esm/machine-output/v4/publication-model.mjs.map +1 -0
- package/dist/esm/machine-output/v4/publish.mjs +20 -0
- package/dist/esm/machine-output/v4/publish.mjs.map +1 -0
- package/dist/esm/machine-output/v4/records-fingerprint.mjs +9 -0
- package/dist/esm/machine-output/v4/records-fingerprint.mjs.map +1 -0
- package/dist/esm/machine-output/v4/schema-identities.mjs +8 -0
- package/dist/esm/machine-output/v4/schema-identities.mjs.map +1 -0
- package/dist/esm/machine-output/v4/schema.mjs +50 -0
- package/dist/esm/machine-output/v4/schema.mjs.map +1 -0
- package/dist/esm/machine-output/v4/serializers.mjs +9 -0
- package/dist/esm/machine-output/v4/serializers.mjs.map +1 -0
- package/dist/esm/machine-output/v4/validation-result.mjs +16 -0
- package/dist/esm/machine-output/v4/validation-result.mjs.map +1 -0
- package/dist/esm/machine-output/v4/validation.mjs +131 -0
- package/dist/esm/machine-output/v4/validation.mjs.map +1 -0
- package/dist/esm/package-checks/code-quality-findings/policy.mjs +49 -0
- package/dist/esm/package-checks/code-quality-findings/policy.mjs.map +1 -0
- package/dist/esm/package-checks/duplicate-detection/area-policy.mjs +71 -0
- package/dist/esm/package-checks/duplicate-detection/area-policy.mjs.map +1 -0
- package/dist/esm/package-checks/duplicate-detection/cache/cache-contract.mjs +2 -0
- package/dist/esm/package-checks/duplicate-detection/cache/cache-contract.mjs.map +1 -0
- package/dist/esm/package-checks/duplicate-detection/cache/identity.mjs +37 -0
- package/dist/esm/package-checks/duplicate-detection/cache/identity.mjs.map +1 -0
- package/dist/esm/package-checks/duplicate-detection/cache/key.mjs +38 -0
- package/dist/esm/package-checks/duplicate-detection/cache/key.mjs.map +1 -0
- package/dist/esm/package-checks/duplicate-detection/cache/payload.mjs +47 -0
- package/dist/esm/package-checks/duplicate-detection/cache/payload.mjs.map +1 -0
- package/dist/esm/package-checks/duplicate-detection/cache/store.mjs +44 -0
- package/dist/esm/package-checks/duplicate-detection/cache/store.mjs.map +1 -0
- package/dist/esm/package-checks/duplicate-detection/default-check.mjs +39 -0
- package/dist/esm/package-checks/duplicate-detection/default-check.mjs.map +1 -0
- package/dist/esm/package-checks/duplicate-detection/execution.mjs +124 -0
- package/dist/esm/package-checks/duplicate-detection/execution.mjs.map +1 -0
- package/dist/esm/package-checks/duplicate-detection/final-data.mjs +6 -0
- package/dist/esm/package-checks/duplicate-detection/final-data.mjs.map +1 -0
- package/dist/esm/package-checks/duplicate-detection/jscpd/availability.mjs +77 -0
- package/dist/esm/package-checks/duplicate-detection/jscpd/availability.mjs.map +1 -0
- package/dist/esm/package-checks/duplicate-detection/jscpd/command-path.mjs +6 -0
- package/dist/esm/package-checks/duplicate-detection/jscpd/command-path.mjs.map +1 -0
- package/dist/esm/package-checks/duplicate-detection/jscpd/command-resolution.mjs +87 -0
- package/dist/esm/package-checks/duplicate-detection/jscpd/command-resolution.mjs.map +1 -0
- package/dist/esm/package-checks/duplicate-detection/jscpd/json-report.mjs +94 -0
- package/dist/esm/package-checks/duplicate-detection/jscpd/json-report.mjs.map +1 -0
- package/dist/esm/package-checks/duplicate-detection/jscpd/scanner-contract.mjs +2 -0
- package/dist/esm/package-checks/duplicate-detection/jscpd/scanner-contract.mjs.map +1 -0
- package/dist/esm/package-checks/duplicate-detection/jscpd/scanner.mjs +180 -0
- package/dist/esm/package-checks/duplicate-detection/jscpd/scanner.mjs.map +1 -0
- package/dist/esm/package-checks/duplicate-detection/jscpd/scoped-fragments.mjs +10 -0
- package/dist/esm/package-checks/duplicate-detection/jscpd/scoped-fragments.mjs.map +1 -0
- package/dist/esm/package-checks/duplicate-detection/measurement-model.mjs +2 -0
- package/dist/esm/package-checks/duplicate-detection/measurement-model.mjs.map +1 -0
- package/dist/esm/package-checks/duplicate-detection/measurement.mjs +151 -0
- package/dist/esm/package-checks/duplicate-detection/measurement.mjs.map +1 -0
- package/dist/esm/package-checks/duplicate-detection/options-resolution.mjs +126 -0
- package/dist/esm/package-checks/duplicate-detection/options-resolution.mjs.map +1 -0
- package/dist/esm/package-checks/duplicate-detection/options-validation.mjs +60 -0
- package/dist/esm/package-checks/duplicate-detection/options-validation.mjs.map +1 -0
- package/dist/esm/package-checks/duplicate-detection/options.mjs +2 -0
- package/dist/esm/package-checks/duplicate-detection/options.mjs.map +1 -0
- package/dist/esm/package-checks/duplicate-detection/project-revision.mjs +5 -0
- package/dist/esm/package-checks/duplicate-detection/project-revision.mjs.map +1 -0
- package/dist/esm/package-checks/duplicate-detection/records.mjs +119 -0
- package/dist/esm/package-checks/duplicate-detection/records.mjs.map +1 -0
- package/dist/esm/package-checks/file-metrics/constructor.mjs +39 -0
- package/dist/esm/package-checks/file-metrics/constructor.mjs.map +1 -0
- package/dist/esm/package-checks/file-metrics/execution.mjs +170 -0
- package/dist/esm/package-checks/file-metrics/execution.mjs.map +1 -0
- package/dist/esm/package-checks/file-metrics/final-data.mjs +6 -0
- package/dist/esm/package-checks/file-metrics/final-data.mjs.map +1 -0
- package/dist/esm/package-checks/file-metrics/measurement-model.mjs +2 -0
- package/dist/esm/package-checks/file-metrics/measurement-model.mjs.map +1 -0
- package/dist/esm/package-checks/file-metrics/measurement.mjs +33 -0
- package/dist/esm/package-checks/file-metrics/measurement.mjs.map +1 -0
- package/dist/esm/package-checks/file-metrics/options-resolution.mjs +171 -0
- package/dist/esm/package-checks/file-metrics/options-resolution.mjs.map +1 -0
- package/dist/esm/package-checks/file-metrics/options-validation.mjs +82 -0
- package/dist/esm/package-checks/file-metrics/options-validation.mjs.map +1 -0
- package/dist/esm/package-checks/file-metrics/options.mjs +2 -0
- package/dist/esm/package-checks/file-metrics/options.mjs.map +1 -0
- package/dist/esm/package-checks/file-metrics/records.mjs +109 -0
- package/dist/esm/package-checks/file-metrics/records.mjs.map +1 -0
- package/dist/esm/package-checks/file-metrics/scc/availability.mjs +59 -0
- package/dist/esm/package-checks/file-metrics/scc/availability.mjs.map +1 -0
- package/dist/esm/package-checks/file-metrics/scc/csv.mjs +17 -0
- package/dist/esm/package-checks/file-metrics/scc/csv.mjs.map +1 -0
- package/dist/esm/package-checks/file-metrics/scc/parser.mjs +145 -0
- package/dist/esm/package-checks/file-metrics/scc/parser.mjs.map +1 -0
- package/dist/esm/package-checks/file-metrics/scc/scanner.mjs +54 -0
- package/dist/esm/package-checks/file-metrics/scc/scanner.mjs.map +1 -0
- package/dist/esm/package-checks/final-data-parsing.mjs +35 -0
- package/dist/esm/package-checks/final-data-parsing.mjs.map +1 -0
- package/dist/esm/package-checks/function-metrics/analysis.mjs +96 -0
- package/dist/esm/package-checks/function-metrics/analysis.mjs.map +1 -0
- package/dist/esm/package-checks/function-metrics/constructor.mjs +43 -0
- package/dist/esm/package-checks/function-metrics/constructor.mjs.map +1 -0
- package/dist/esm/package-checks/function-metrics/execution.mjs +178 -0
- package/dist/esm/package-checks/function-metrics/execution.mjs.map +1 -0
- package/dist/esm/package-checks/function-metrics/final-data.mjs +6 -0
- package/dist/esm/package-checks/function-metrics/final-data.mjs.map +1 -0
- package/dist/esm/package-checks/function-metrics/lizard/availability.mjs +64 -0
- package/dist/esm/package-checks/function-metrics/lizard/availability.mjs.map +1 -0
- package/dist/esm/package-checks/function-metrics/lizard/csv.mjs +17 -0
- package/dist/esm/package-checks/function-metrics/lizard/csv.mjs.map +1 -0
- package/dist/esm/package-checks/function-metrics/lizard/parser.mjs +138 -0
- package/dist/esm/package-checks/function-metrics/lizard/parser.mjs.map +1 -0
- package/dist/esm/package-checks/function-metrics/lizard/scanner.mjs +35 -0
- package/dist/esm/package-checks/function-metrics/lizard/scanner.mjs.map +1 -0
- package/dist/esm/package-checks/function-metrics/measurement-model.mjs +2 -0
- package/dist/esm/package-checks/function-metrics/measurement-model.mjs.map +1 -0
- package/dist/esm/package-checks/function-metrics/measurement.mjs +35 -0
- package/dist/esm/package-checks/function-metrics/measurement.mjs.map +1 -0
- package/dist/esm/package-checks/function-metrics/options-resolution.mjs +171 -0
- package/dist/esm/package-checks/function-metrics/options-resolution.mjs.map +1 -0
- package/dist/esm/package-checks/function-metrics/options-validation.mjs +71 -0
- package/dist/esm/package-checks/function-metrics/options-validation.mjs.map +1 -0
- package/dist/esm/package-checks/function-metrics/options.mjs +2 -0
- package/dist/esm/package-checks/function-metrics/options.mjs.map +1 -0
- package/dist/esm/package-checks/function-metrics/records.mjs +133 -0
- package/dist/esm/package-checks/function-metrics/records.mjs.map +1 -0
- package/dist/esm/package-checks/function-metrics/target-files.mjs +75 -0
- package/dist/esm/package-checks/function-metrics/target-files.mjs.map +1 -0
- package/dist/esm/package-checks/host-environment/error-message.mjs +4 -0
- package/dist/esm/package-checks/host-environment/error-message.mjs.map +1 -0
- package/dist/esm/package-checks/host-environment/filesystem.mjs +81 -0
- package/dist/esm/package-checks/host-environment/filesystem.mjs.map +1 -0
- package/dist/esm/package-checks/host-environment/git.mjs +51 -0
- package/dist/esm/package-checks/host-environment/git.mjs.map +1 -0
- package/dist/esm/package-checks/host-environment/path.mjs +18 -0
- package/dist/esm/package-checks/host-environment/path.mjs.map +1 -0
- package/dist/esm/package-checks/host-environment/process/command.mjs +13 -0
- package/dist/esm/package-checks/host-environment/process/command.mjs.map +1 -0
- package/dist/esm/package-checks/host-environment/process/contract.mjs +2 -0
- package/dist/esm/package-checks/host-environment/process/contract.mjs.map +1 -0
- package/dist/esm/package-checks/host-environment/process/env.mjs +19 -0
- package/dist/esm/package-checks/host-environment/process/env.mjs.map +1 -0
- package/dist/esm/package-checks/host-environment/process/failure.mjs +34 -0
- package/dist/esm/package-checks/host-environment/process/failure.mjs.map +1 -0
- package/dist/esm/package-checks/host-environment/process/result.mjs +33 -0
- package/dist/esm/package-checks/host-environment/process/result.mjs.map +1 -0
- package/dist/esm/package-checks/host-environment/process/runner.mjs +30 -0
- package/dist/esm/package-checks/host-environment/process/runner.mjs.map +1 -0
- package/dist/esm/package-checks/json-document/strict-document.mjs +163 -0
- package/dist/esm/package-checks/json-document/strict-document.mjs.map +1 -0
- package/dist/esm/package-checks/json-schema-validation/default-check.mjs +39 -0
- package/dist/esm/package-checks/json-schema-validation/default-check.mjs.map +1 -0
- package/dist/esm/package-checks/json-schema-validation/execution-stages.mjs +141 -0
- package/dist/esm/package-checks/json-schema-validation/execution-stages.mjs.map +1 -0
- package/dist/esm/package-checks/json-schema-validation/final-data.mjs +64 -0
- package/dist/esm/package-checks/json-schema-validation/final-data.mjs.map +1 -0
- package/dist/esm/package-checks/json-schema-validation/issue-collector.mjs +35 -0
- package/dist/esm/package-checks/json-schema-validation/issue-collector.mjs.map +1 -0
- package/dist/esm/package-checks/json-schema-validation/json-schema-validation.mjs +118 -0
- package/dist/esm/package-checks/json-schema-validation/json-schema-validation.mjs.map +1 -0
- package/dist/esm/package-checks/json-schema-validation/options-resolution.mjs +45 -0
- package/dist/esm/package-checks/json-schema-validation/options-resolution.mjs.map +1 -0
- package/dist/esm/package-checks/json-schema-validation/options-validation.mjs +212 -0
- package/dist/esm/package-checks/json-schema-validation/options-validation.mjs.map +1 -0
- package/dist/esm/package-checks/json-schema-validation/options.mjs +2 -0
- package/dist/esm/package-checks/json-schema-validation/options.mjs.map +1 -0
- package/dist/esm/package-checks/json-schema-validation/reference-resolver.mjs +128 -0
- package/dist/esm/package-checks/json-schema-validation/reference-resolver.mjs.map +1 -0
- package/dist/esm/package-checks/json-schema-validation/remote-response.mjs +71 -0
- package/dist/esm/package-checks/json-schema-validation/remote-response.mjs.map +1 -0
- package/dist/esm/package-checks/json-schema-validation/schema-engine.mjs +190 -0
- package/dist/esm/package-checks/json-schema-validation/schema-engine.mjs.map +1 -0
- package/dist/esm/package-checks/json-schema-validation/schema-policy.mjs +234 -0
- package/dist/esm/package-checks/json-schema-validation/schema-policy.mjs.map +1 -0
- package/dist/esm/package-checks/json-validation/default-check.mjs +39 -0
- package/dist/esm/package-checks/json-validation/default-check.mjs.map +1 -0
- package/dist/esm/package-checks/json-validation/final-data.mjs +27 -0
- package/dist/esm/package-checks/json-validation/final-data.mjs.map +1 -0
- package/dist/esm/package-checks/json-validation/json-validation.mjs +138 -0
- package/dist/esm/package-checks/json-validation/json-validation.mjs.map +1 -0
- package/dist/esm/package-checks/json-validation/options-resolution.mjs +33 -0
- package/dist/esm/package-checks/json-validation/options-resolution.mjs.map +1 -0
- package/dist/esm/package-checks/json-validation/options-validation.mjs +16 -0
- package/dist/esm/package-checks/json-validation/options-validation.mjs.map +1 -0
- package/dist/esm/package-checks/json-validation/options.mjs +2 -0
- package/dist/esm/package-checks/json-validation/options.mjs.map +1 -0
- package/dist/esm/package-checks/maintenance-reminders/assessment-results.mjs +73 -0
- package/dist/esm/package-checks/maintenance-reminders/assessment-results.mjs.map +1 -0
- package/dist/esm/package-checks/maintenance-reminders/final-data.mjs +153 -0
- package/dist/esm/package-checks/maintenance-reminders/final-data.mjs.map +1 -0
- package/dist/esm/package-checks/maintenance-reminders/maintenance-reminders.mjs +155 -0
- package/dist/esm/package-checks/maintenance-reminders/maintenance-reminders.mjs.map +1 -0
- package/dist/esm/package-checks/maintenance-reminders/maintenance-support.mjs +58 -0
- package/dist/esm/package-checks/maintenance-reminders/maintenance-support.mjs.map +1 -0
- package/dist/esm/package-checks/maintenance-reminders/measurement.mjs +125 -0
- package/dist/esm/package-checks/maintenance-reminders/measurement.mjs.map +1 -0
- package/dist/esm/package-checks/maintenance-reminders/options-validation.mjs +72 -0
- package/dist/esm/package-checks/maintenance-reminders/options-validation.mjs.map +1 -0
- package/dist/esm/package-checks/markdown-link-validation/default-check.mjs +55 -0
- package/dist/esm/package-checks/markdown-link-validation/default-check.mjs.map +1 -0
- package/dist/esm/package-checks/markdown-link-validation/execution.mjs +199 -0
- package/dist/esm/package-checks/markdown-link-validation/execution.mjs.map +1 -0
- package/dist/esm/package-checks/markdown-link-validation/filesystem-probes.mjs +109 -0
- package/dist/esm/package-checks/markdown-link-validation/filesystem-probes.mjs.map +1 -0
- package/dist/esm/package-checks/markdown-link-validation/final-data.mjs +28 -0
- package/dist/esm/package-checks/markdown-link-validation/final-data.mjs.map +1 -0
- package/dist/esm/package-checks/markdown-link-validation/local-resolution.mjs +158 -0
- package/dist/esm/package-checks/markdown-link-validation/local-resolution.mjs.map +1 -0
- package/dist/esm/package-checks/markdown-link-validation/local-resolver.mjs +17 -0
- package/dist/esm/package-checks/markdown-link-validation/local-resolver.mjs.map +1 -0
- package/dist/esm/package-checks/markdown-link-validation/markdown-parser.mjs +191 -0
- package/dist/esm/package-checks/markdown-link-validation/markdown-parser.mjs.map +1 -0
- package/dist/esm/package-checks/markdown-link-validation/options-resolution.mjs +83 -0
- package/dist/esm/package-checks/markdown-link-validation/options-resolution.mjs.map +1 -0
- package/dist/esm/package-checks/markdown-link-validation/options-validation.mjs +50 -0
- package/dist/esm/package-checks/markdown-link-validation/options-validation.mjs.map +1 -0
- package/dist/esm/package-checks/markdown-link-validation/options.mjs +2 -0
- package/dist/esm/package-checks/markdown-link-validation/options.mjs.map +1 -0
- package/dist/esm/package-checks/markdown-link-validation/records.mjs +32 -0
- package/dist/esm/package-checks/markdown-link-validation/records.mjs.map +1 -0
- package/dist/esm/package-checks/markdown-link-validation/resolver-engine.mjs +196 -0
- package/dist/esm/package-checks/markdown-link-validation/resolver-engine.mjs.map +1 -0
- package/dist/esm/package-checks/markdown-link-validation/target-descriptor.mjs +23 -0
- package/dist/esm/package-checks/markdown-link-validation/target-descriptor.mjs.map +1 -0
- package/dist/esm/package-checks/markdown-link-validation/traversal-result.mjs +41 -0
- package/dist/esm/package-checks/markdown-link-validation/traversal-result.mjs.map +1 -0
- package/dist/esm/package-checks/project-files/collection.mjs +142 -0
- package/dist/esm/package-checks/project-files/collection.mjs.map +1 -0
- package/dist/esm/package-checks/project-files/config-glob.mjs +11 -0
- package/dist/esm/package-checks/project-files/config-glob.mjs.map +1 -0
- package/dist/esm/package-checks/project-files/configuration.mjs +104 -0
- package/dist/esm/package-checks/project-files/configuration.mjs.map +1 -0
- package/dist/esm/package-checks/project-files/exact-input-measurement.mjs +24 -0
- package/dist/esm/package-checks/project-files/exact-input-measurement.mjs.map +1 -0
- package/dist/esm/package-checks/project-files/file-fingerprint.mjs +36 -0
- package/dist/esm/package-checks/project-files/file-fingerprint.mjs.map +1 -0
- package/dist/esm/package-checks/project-files/gitlink-revision.mjs +57 -0
- package/dist/esm/package-checks/project-files/gitlink-revision.mjs.map +1 -0
- package/dist/esm/package-checks/project-files/gitlink-worktree.mjs +72 -0
- package/dist/esm/package-checks/project-files/gitlink-worktree.mjs.map +1 -0
- package/dist/esm/package-checks/project-files/input-eligibility.mjs +13 -0
- package/dist/esm/package-checks/project-files/input-eligibility.mjs.map +1 -0
- package/dist/esm/package-checks/project-files/reported-path.mjs +30 -0
- package/dist/esm/package-checks/project-files/reported-path.mjs.map +1 -0
- package/dist/esm/package-checks/project-files/revision-paths.mjs +19 -0
- package/dist/esm/package-checks/project-files/revision-paths.mjs.map +1 -0
- package/dist/esm/package-checks/project-files/revision-worktree-files.mjs +102 -0
- package/dist/esm/package-checks/project-files/revision-worktree-files.mjs.map +1 -0
- package/dist/esm/project-definition/check-tree/authoring.mjs +242 -0
- package/dist/esm/project-definition/check-tree/authoring.mjs.map +1 -0
- package/dist/esm/project-definition/check-tree/materialization.mjs +50 -0
- package/dist/esm/project-definition/check-tree/materialization.mjs.map +1 -0
- package/dist/esm/project-definition/check-tree/resolution.mjs +60 -0
- package/dist/esm/project-definition/check-tree/resolution.mjs.map +1 -0
- package/dist/esm/project-definition/output-defaults.mjs +7 -0
- package/dist/esm/project-definition/output-defaults.mjs.map +1 -0
- package/dist/esm/project-definition/output-validation.mjs +44 -0
- package/dist/esm/project-definition/output-validation.mjs.map +1 -0
- package/dist/esm/project-definition/project-definition-validation.mjs +95 -0
- package/dist/esm/project-definition/project-definition-validation.mjs.map +1 -0
- package/dist/esm/project-definition/project-definition.mjs +92 -0
- package/dist/esm/project-definition/project-definition.mjs.map +1 -0
- package/dist/esm/project-run/aggregation.mjs +66 -0
- package/dist/esm/project-run/aggregation.mjs.map +1 -0
- package/dist/esm/project-run/check-execution/callback.mjs +70 -0
- package/dist/esm/project-run/check-execution/callback.mjs.map +1 -0
- package/dist/esm/project-run/check-execution/dependencies.mjs +50 -0
- package/dist/esm/project-run/check-execution/dependencies.mjs.map +1 -0
- package/dist/esm/project-run/check-execution/execution-finalization.mjs +103 -0
- package/dist/esm/project-run/check-execution/execution-finalization.mjs.map +1 -0
- package/dist/esm/project-run/check-execution/execution-settlement.mjs +90 -0
- package/dist/esm/project-run/check-execution/execution-settlement.mjs.map +1 -0
- package/dist/esm/project-run/check-execution/messages.mjs +38 -0
- package/dist/esm/project-run/check-execution/messages.mjs.map +1 -0
- package/dist/esm/project-run/check-execution/plan.mjs +35 -0
- package/dist/esm/project-run/check-execution/plan.mjs.map +1 -0
- package/dist/esm/project-run/check-execution/preflight-result.mjs +83 -0
- package/dist/esm/project-run/check-execution/preflight-result.mjs.map +1 -0
- package/dist/esm/project-run/check-execution/preflight.mjs +186 -0
- package/dist/esm/project-run/check-execution/preflight.mjs.map +1 -0
- package/dist/esm/project-run/check-execution/resolved-checks.mjs +168 -0
- package/dist/esm/project-run/check-execution/resolved-checks.mjs.map +1 -0
- package/dist/esm/project-run/check-execution/terminal-result.mjs +49 -0
- package/dist/esm/project-run/check-execution/terminal-result.mjs.map +1 -0
- package/dist/esm/project-run/completion.mjs +173 -0
- package/dist/esm/project-run/completion.mjs.map +1 -0
- package/dist/esm/project-run/controls/contract.mjs +2 -0
- package/dist/esm/project-run/controls/contract.mjs.map +1 -0
- package/dist/esm/project-run/controls/outputs-override-validation.mjs +61 -0
- package/dist/esm/project-run/controls/outputs-override-validation.mjs.map +1 -0
- package/dist/esm/project-run/controls/validation-result.mjs +2 -0
- package/dist/esm/project-run/controls/validation-result.mjs.map +1 -0
- package/dist/esm/project-run/controls/validation.mjs +156 -0
- package/dist/esm/project-run/controls/validation.mjs.map +1 -0
- package/dist/esm/project-run/diagnostic-logging/diagnostic-detail-rendering.mjs +182 -0
- package/dist/esm/project-run/diagnostic-logging/diagnostic-detail-rendering.mjs.map +1 -0
- package/dist/esm/project-run/diagnostic-logging/logger.mjs +242 -0
- package/dist/esm/project-run/diagnostic-logging/logger.mjs.map +1 -0
- package/dist/esm/project-run/invocation-creation.mjs +111 -0
- package/dist/esm/project-run/invocation-creation.mjs.map +1 -0
- package/dist/esm/project-run/invocation.mjs +195 -0
- package/dist/esm/project-run/invocation.mjs.map +1 -0
- package/dist/esm/project-run/machine-publication.mjs +16 -0
- package/dist/esm/project-run/machine-publication.mjs.map +1 -0
- package/dist/esm/project-run/output-configuration.mjs +17 -0
- package/dist/esm/project-run/output-configuration.mjs.map +1 -0
- package/dist/esm/project-run/output-status.mjs +43 -0
- package/dist/esm/project-run/output-status.mjs.map +1 -0
- package/dist/esm/project-run/progress-rendering/presentation.mjs +135 -0
- package/dist/esm/project-run/progress-rendering/presentation.mjs.map +1 -0
- package/dist/esm/project-run/progress-rendering/renderer-formatting.mjs +100 -0
- package/dist/esm/project-run/progress-rendering/renderer-formatting.mjs.map +1 -0
- package/dist/esm/project-run/progress-rendering/renderer-lifecycle.mjs +123 -0
- package/dist/esm/project-run/progress-rendering/renderer-lifecycle.mjs.map +1 -0
- package/dist/esm/project-run/progress-rendering/renderer.mjs +12 -0
- package/dist/esm/project-run/progress-rendering/renderer.mjs.map +1 -0
- package/dist/esm/project-run/project-context.mjs +8 -0
- package/dist/esm/project-run/project-context.mjs.map +1 -0
- package/dist/esm/project-run/result.mjs +54 -0
- package/dist/esm/project-run/result.mjs.map +1 -0
- package/dist/esm/project-run/run.mjs +23 -0
- package/dist/esm/project-run/run.mjs.map +1 -0
- package/dist/esm/project-run/task-scheduler/execution-state.mjs +66 -0
- package/dist/esm/project-run/task-scheduler/execution-state.mjs.map +1 -0
- package/dist/esm/project-run/task-scheduler/graph-validation.mjs +119 -0
- package/dist/esm/project-run/task-scheduler/graph-validation.mjs.map +1 -0
- package/dist/esm/project-run/task-scheduler/graph.mjs +116 -0
- package/dist/esm/project-run/task-scheduler/graph.mjs.map +1 -0
- package/dist/esm/project-run/task-scheduler/scheduler-admission-decision.mjs +82 -0
- package/dist/esm/project-run/task-scheduler/scheduler-admission-decision.mjs.map +1 -0
- package/dist/esm/project-run/task-scheduler/scheduler-blocker-summary.mjs +27 -0
- package/dist/esm/project-run/task-scheduler/scheduler-blocker-summary.mjs.map +1 -0
- package/dist/esm/project-run/task-scheduler/scheduler-decision-inspection.mjs +125 -0
- package/dist/esm/project-run/task-scheduler/scheduler-decision-inspection.mjs.map +1 -0
- package/dist/esm/project-run/task-scheduler/scheduler-decision-model.mjs +45 -0
- package/dist/esm/project-run/task-scheduler/scheduler-decision-model.mjs.map +1 -0
- package/dist/esm/project-run/task-scheduler/scheduler-decision.mjs +74 -0
- package/dist/esm/project-run/task-scheduler/scheduler-decision.mjs.map +1 -0
- package/dist/esm/project-run/task-scheduler/scheduler.mjs +147 -0
- package/dist/esm/project-run/task-scheduler/scheduler.mjs.map +1 -0
- package/docs/api-mechanics.md +205 -0
- package/docs/checks/duplicate-detection.md +195 -0
- package/docs/checks/file-metrics.md +229 -0
- package/docs/checks/function-metrics.md +222 -0
- package/docs/checks/json-schema-validation.md +190 -0
- package/docs/checks/json-validation.md +133 -0
- package/docs/checks/maintenance-reminders.md +158 -0
- package/docs/checks/markdown-link-validation.md +192 -0
- package/docs/examples/artifacts/mixed-outcomes/definition.ts +195 -0
- package/docs/examples/artifacts/mixed-outcomes/records.ndjson +2 -0
- package/docs/examples/artifacts/mixed-outcomes/run.json +70 -0
- package/docs/output.md +97 -0
- package/docs/schemas/vibe-check-record.schema.json +33 -0
- package/docs/schemas/vibe-check-run.schema.json +173 -0
- package/index.mjs +1 -0
- package/package.json +49 -0
- package/src/check/check.ts +497 -0
- package/src/check/descriptor-validation.ts +60 -0
- package/src/check/descriptor.ts +5 -0
- package/src/check/inherited-collection.ts +101 -0
- package/src/check/options-snapshot.ts +80 -0
- package/src/check-settlement/fact-validation.ts +289 -0
- package/src/check-settlement/facts.ts +27 -0
- package/src/check-settlement/outcome-normalization.ts +118 -0
- package/src/check-settlement/record-store.ts +73 -0
- package/src/check-settlement/session.ts +257 -0
- package/src/data-boundary/canonical-data.ts +188 -0
- package/src/data-boundary/canonical-json.ts +11 -0
- package/src/data-boundary/closed-values.ts +126 -0
- package/src/data-boundary/value-shapes.ts +15 -0
- package/src/finding-waivers/reconciliation.ts +176 -0
- package/src/index.ts +123 -0
- package/src/machine-output/v4/atomic-publication.ts +123 -0
- package/src/machine-output/v4/freeze-publication-value.ts +12 -0
- package/src/machine-output/v4/projection.ts +36 -0
- package/src/machine-output/v4/publication-invariants.ts +89 -0
- package/src/machine-output/v4/publication-model.ts +38 -0
- package/src/machine-output/v4/publish.ts +23 -0
- package/src/machine-output/v4/records-fingerprint.ts +12 -0
- package/src/machine-output/v4/schema-identities.ts +8 -0
- package/src/machine-output/v4/schema.ts +97 -0
- package/src/machine-output/v4/serializers.ts +18 -0
- package/src/machine-output/v4/validation-result.ts +59 -0
- package/src/machine-output/v4/validation.ts +166 -0
- package/src/package-checks/code-quality-findings/policy.ts +85 -0
- package/src/package-checks/duplicate-detection/area-policy.ts +103 -0
- package/src/package-checks/duplicate-detection/cache/cache-contract.ts +49 -0
- package/src/package-checks/duplicate-detection/cache/identity.ts +61 -0
- package/src/package-checks/duplicate-detection/cache/key.ts +46 -0
- package/src/package-checks/duplicate-detection/cache/payload.ts +78 -0
- package/src/package-checks/duplicate-detection/cache/store.ts +77 -0
- package/src/package-checks/duplicate-detection/default-check.ts +50 -0
- package/src/package-checks/duplicate-detection/execution.ts +168 -0
- package/src/package-checks/duplicate-detection/final-data.ts +10 -0
- package/src/package-checks/duplicate-detection/jscpd/availability.ts +137 -0
- package/src/package-checks/duplicate-detection/jscpd/command-path.ts +8 -0
- package/src/package-checks/duplicate-detection/jscpd/command-resolution.ts +112 -0
- package/src/package-checks/duplicate-detection/jscpd/json-report.ts +137 -0
- package/src/package-checks/duplicate-detection/jscpd/scanner-contract.ts +18 -0
- package/src/package-checks/duplicate-detection/jscpd/scanner.ts +257 -0
- package/src/package-checks/duplicate-detection/jscpd/scoped-fragments.ts +17 -0
- package/src/package-checks/duplicate-detection/measurement-model.ts +44 -0
- package/src/package-checks/duplicate-detection/measurement.ts +223 -0
- package/src/package-checks/duplicate-detection/options-resolution.ts +162 -0
- package/src/package-checks/duplicate-detection/options-validation.ts +75 -0
- package/src/package-checks/duplicate-detection/options.ts +72 -0
- package/src/package-checks/duplicate-detection/project-revision.ts +5 -0
- package/src/package-checks/duplicate-detection/records.ts +171 -0
- package/src/package-checks/file-metrics/constructor.ts +46 -0
- package/src/package-checks/file-metrics/execution.ts +233 -0
- package/src/package-checks/file-metrics/final-data.ts +10 -0
- package/src/package-checks/file-metrics/measurement-model.ts +10 -0
- package/src/package-checks/file-metrics/measurement.ts +52 -0
- package/src/package-checks/file-metrics/options-resolution.ts +213 -0
- package/src/package-checks/file-metrics/options-validation.ts +104 -0
- package/src/package-checks/file-metrics/options.ts +91 -0
- package/src/package-checks/file-metrics/records.ts +182 -0
- package/src/package-checks/file-metrics/scc/availability.ts +100 -0
- package/src/package-checks/file-metrics/scc/csv.ts +20 -0
- package/src/package-checks/file-metrics/scc/parser.ts +223 -0
- package/src/package-checks/file-metrics/scc/scanner.ts +68 -0
- package/src/package-checks/final-data-parsing.ts +49 -0
- package/src/package-checks/function-metrics/analysis.ts +138 -0
- package/src/package-checks/function-metrics/constructor.ts +55 -0
- package/src/package-checks/function-metrics/execution.ts +263 -0
- package/src/package-checks/function-metrics/final-data.ts +10 -0
- package/src/package-checks/function-metrics/lizard/availability.ts +90 -0
- package/src/package-checks/function-metrics/lizard/csv.ts +20 -0
- package/src/package-checks/function-metrics/lizard/parser.ts +179 -0
- package/src/package-checks/function-metrics/lizard/scanner.ts +62 -0
- package/src/package-checks/function-metrics/measurement-model.ts +30 -0
- package/src/package-checks/function-metrics/measurement.ts +57 -0
- package/src/package-checks/function-metrics/options-resolution.ts +215 -0
- package/src/package-checks/function-metrics/options-validation.ts +89 -0
- package/src/package-checks/function-metrics/options.ts +84 -0
- package/src/package-checks/function-metrics/records.ts +254 -0
- package/src/package-checks/function-metrics/target-files.ts +85 -0
- package/src/package-checks/host-environment/error-message.ts +3 -0
- package/src/package-checks/host-environment/filesystem.ts +110 -0
- package/src/package-checks/host-environment/git.ts +68 -0
- package/src/package-checks/host-environment/path.ts +20 -0
- package/src/package-checks/host-environment/process/command.ts +21 -0
- package/src/package-checks/host-environment/process/contract.ts +56 -0
- package/src/package-checks/host-environment/process/env.ts +25 -0
- package/src/package-checks/host-environment/process/failure.ts +40 -0
- package/src/package-checks/host-environment/process/result.ts +39 -0
- package/src/package-checks/host-environment/process/runner.ts +47 -0
- package/src/package-checks/json-document/strict-document.ts +209 -0
- package/src/package-checks/json-schema-validation/default-check.ts +54 -0
- package/src/package-checks/json-schema-validation/execution-stages.ts +230 -0
- package/src/package-checks/json-schema-validation/final-data.ts +115 -0
- package/src/package-checks/json-schema-validation/issue-collector.ts +43 -0
- package/src/package-checks/json-schema-validation/json-schema-validation.ts +191 -0
- package/src/package-checks/json-schema-validation/options-resolution.ts +61 -0
- package/src/package-checks/json-schema-validation/options-validation.ts +256 -0
- package/src/package-checks/json-schema-validation/options.ts +66 -0
- package/src/package-checks/json-schema-validation/reference-resolver.ts +165 -0
- package/src/package-checks/json-schema-validation/remote-response.ts +84 -0
- package/src/package-checks/json-schema-validation/schema-engine.ts +263 -0
- package/src/package-checks/json-schema-validation/schema-policy.ts +275 -0
- package/src/package-checks/json-validation/default-check.ts +48 -0
- package/src/package-checks/json-validation/final-data.ts +46 -0
- package/src/package-checks/json-validation/json-validation.ts +212 -0
- package/src/package-checks/json-validation/options-resolution.ts +50 -0
- package/src/package-checks/json-validation/options-validation.ts +27 -0
- package/src/package-checks/json-validation/options.ts +18 -0
- package/src/package-checks/maintenance-reminders/assessment-results.ts +117 -0
- package/src/package-checks/maintenance-reminders/final-data.ts +239 -0
- package/src/package-checks/maintenance-reminders/maintenance-reminders.ts +264 -0
- package/src/package-checks/maintenance-reminders/maintenance-support.ts +67 -0
- package/src/package-checks/maintenance-reminders/measurement.ts +183 -0
- package/src/package-checks/maintenance-reminders/options-validation.ts +88 -0
- package/src/package-checks/markdown-link-validation/default-check.ts +70 -0
- package/src/package-checks/markdown-link-validation/execution.ts +325 -0
- package/src/package-checks/markdown-link-validation/filesystem-probes.ts +127 -0
- package/src/package-checks/markdown-link-validation/final-data.ts +47 -0
- package/src/package-checks/markdown-link-validation/local-resolution.ts +306 -0
- package/src/package-checks/markdown-link-validation/local-resolver.ts +51 -0
- package/src/package-checks/markdown-link-validation/markdown-parser.ts +302 -0
- package/src/package-checks/markdown-link-validation/options-resolution.ts +114 -0
- package/src/package-checks/markdown-link-validation/options-validation.ts +72 -0
- package/src/package-checks/markdown-link-validation/options.ts +50 -0
- package/src/package-checks/markdown-link-validation/records.ts +77 -0
- package/src/package-checks/markdown-link-validation/resolver-engine.ts +276 -0
- package/src/package-checks/markdown-link-validation/target-descriptor.ts +34 -0
- package/src/package-checks/markdown-link-validation/traversal-result.ts +58 -0
- package/src/package-checks/project-files/collection.ts +199 -0
- package/src/package-checks/project-files/config-glob.ts +17 -0
- package/src/package-checks/project-files/configuration.ts +152 -0
- package/src/package-checks/project-files/exact-input-measurement.ts +38 -0
- package/src/package-checks/project-files/file-fingerprint.ts +46 -0
- package/src/package-checks/project-files/gitlink-revision.ts +82 -0
- package/src/package-checks/project-files/gitlink-worktree.ts +106 -0
- package/src/package-checks/project-files/input-eligibility.ts +21 -0
- package/src/package-checks/project-files/reported-path.ts +35 -0
- package/src/package-checks/project-files/revision-paths.ts +34 -0
- package/src/package-checks/project-files/revision-worktree-files.ts +148 -0
- package/src/project-definition/check-tree/authoring.ts +332 -0
- package/src/project-definition/check-tree/materialization.ts +56 -0
- package/src/project-definition/check-tree/resolution.ts +108 -0
- package/src/project-definition/output-defaults.ts +6 -0
- package/src/project-definition/output-validation.ts +54 -0
- package/src/project-definition/project-definition-validation.ts +123 -0
- package/src/project-definition/project-definition.ts +184 -0
- package/src/project-run/aggregation.ts +90 -0
- package/src/project-run/check-execution/callback.ts +106 -0
- package/src/project-run/check-execution/dependencies.ts +70 -0
- package/src/project-run/check-execution/execution-finalization.ts +177 -0
- package/src/project-run/check-execution/execution-settlement.ts +147 -0
- package/src/project-run/check-execution/messages.ts +46 -0
- package/src/project-run/check-execution/plan.ts +46 -0
- package/src/project-run/check-execution/preflight-result.ts +131 -0
- package/src/project-run/check-execution/preflight.ts +321 -0
- package/src/project-run/check-execution/resolved-checks.ts +285 -0
- package/src/project-run/check-execution/terminal-result.ts +74 -0
- package/src/project-run/completion.ts +263 -0
- package/src/project-run/controls/contract.ts +24 -0
- package/src/project-run/controls/outputs-override-validation.ts +86 -0
- package/src/project-run/controls/validation-result.ts +12 -0
- package/src/project-run/controls/validation.ts +176 -0
- package/src/project-run/diagnostic-logging/diagnostic-detail-rendering.ts +223 -0
- package/src/project-run/diagnostic-logging/logger.ts +325 -0
- package/src/project-run/invocation-creation.ts +160 -0
- package/src/project-run/invocation.ts +303 -0
- package/src/project-run/machine-publication.ts +23 -0
- package/src/project-run/output-configuration.ts +24 -0
- package/src/project-run/output-status.ts +69 -0
- package/src/project-run/progress-rendering/presentation.ts +189 -0
- package/src/project-run/progress-rendering/renderer-formatting.ts +141 -0
- package/src/project-run/progress-rendering/renderer-lifecycle.ts +152 -0
- package/src/project-run/progress-rendering/renderer.ts +68 -0
- package/src/project-run/project-context.ts +11 -0
- package/src/project-run/result.ts +175 -0
- package/src/project-run/run.ts +50 -0
- package/src/project-run/task-scheduler/execution-state.ts +153 -0
- package/src/project-run/task-scheduler/graph-validation.ts +176 -0
- package/src/project-run/task-scheduler/graph.ts +185 -0
- package/src/project-run/task-scheduler/scheduler-admission-decision.ts +177 -0
- package/src/project-run/task-scheduler/scheduler-blocker-summary.ts +42 -0
- package/src/project-run/task-scheduler/scheduler-decision-inspection.ts +199 -0
- package/src/project-run/task-scheduler/scheduler-decision-model.ts +158 -0
- package/src/project-run/task-scheduler/scheduler-decision.ts +103 -0
- package/src/project-run/task-scheduler/scheduler.ts +228 -0
- package/third-party-licenses/momoa-3.3.12-LICENSE +201 -0
- package/types/check/check.d.ts +350 -0
- package/types/check/descriptor-validation.d.ts +18 -0
- package/types/check/descriptor.d.ts +5 -0
- package/types/check/inherited-collection.d.ts +35 -0
- package/types/check/options-snapshot.d.ts +2 -0
- package/types/check-settlement/fact-validation.d.ts +14 -0
- package/types/check-settlement/facts.d.ts +19 -0
- package/types/check-settlement/outcome-normalization.d.ts +9 -0
- package/types/check-settlement/record-store.d.ts +14 -0
- package/types/check-settlement/session.d.ts +41 -0
- package/types/data-boundary/canonical-data.d.ts +13 -0
- package/types/data-boundary/canonical-json.d.ts +6 -0
- package/types/data-boundary/closed-values.d.ts +8 -0
- package/types/data-boundary/value-shapes.d.ts +4 -0
- package/types/finding-waivers/reconciliation.d.ts +66 -0
- package/types/index.d.ts +57 -0
- package/types/machine-output/v4/atomic-publication.d.ts +9 -0
- package/types/machine-output/v4/freeze-publication-value.d.ts +6 -0
- package/types/machine-output/v4/projection.d.ts +7 -0
- package/types/machine-output/v4/publication-invariants.d.ts +3 -0
- package/types/machine-output/v4/publication-model.d.ts +15 -0
- package/types/machine-output/v4/publish.d.ts +7 -0
- package/types/machine-output/v4/records-fingerprint.d.ts +4 -0
- package/types/machine-output/v4/schema-identities.d.ts +7 -0
- package/types/machine-output/v4/schema.d.ts +44 -0
- package/types/machine-output/v4/serializers.d.ts +6 -0
- package/types/machine-output/v4/validation-result.d.ts +26 -0
- package/types/machine-output/v4/validation.d.ts +6 -0
- package/types/package-checks/code-quality-findings/policy.d.ts +20 -0
- package/types/package-checks/duplicate-detection/area-policy.d.ts +3 -0
- package/types/package-checks/duplicate-detection/cache/cache-contract.d.ts +48 -0
- package/types/package-checks/duplicate-detection/cache/identity.d.ts +17 -0
- package/types/package-checks/duplicate-detection/cache/key.d.ts +4 -0
- package/types/package-checks/duplicate-detection/cache/payload.d.ts +4 -0
- package/types/package-checks/duplicate-detection/cache/store.d.ts +18 -0
- package/types/package-checks/duplicate-detection/default-check.d.ts +11 -0
- package/types/package-checks/duplicate-detection/execution.d.ts +11 -0
- package/types/package-checks/duplicate-detection/final-data.d.ts +5 -0
- package/types/package-checks/duplicate-detection/jscpd/availability.d.ts +19 -0
- package/types/package-checks/duplicate-detection/jscpd/command-path.d.ts +1 -0
- package/types/package-checks/duplicate-detection/jscpd/command-resolution.d.ts +23 -0
- package/types/package-checks/duplicate-detection/jscpd/json-report.d.ts +2 -0
- package/types/package-checks/duplicate-detection/jscpd/scanner-contract.d.ts +11 -0
- package/types/package-checks/duplicate-detection/jscpd/scanner.d.ts +21 -0
- package/types/package-checks/duplicate-detection/jscpd/scoped-fragments.d.ts +4 -0
- package/types/package-checks/duplicate-detection/measurement-model.d.ts +36 -0
- package/types/package-checks/duplicate-detection/measurement.d.ts +14 -0
- package/types/package-checks/duplicate-detection/options-resolution.d.ts +3 -0
- package/types/package-checks/duplicate-detection/options-validation.d.ts +1 -0
- package/types/package-checks/duplicate-detection/options.d.ts +65 -0
- package/types/package-checks/duplicate-detection/project-revision.d.ts +1 -0
- package/types/package-checks/duplicate-detection/records.d.ts +22 -0
- package/types/package-checks/file-metrics/constructor.d.ts +11 -0
- package/types/package-checks/file-metrics/execution.d.ts +11 -0
- package/types/package-checks/file-metrics/final-data.d.ts +5 -0
- package/types/package-checks/file-metrics/measurement-model.d.ts +12 -0
- package/types/package-checks/file-metrics/measurement.d.ts +13 -0
- package/types/package-checks/file-metrics/options-resolution.d.ts +3 -0
- package/types/package-checks/file-metrics/options-validation.d.ts +3 -0
- package/types/package-checks/file-metrics/options.d.ts +75 -0
- package/types/package-checks/file-metrics/records.d.ts +43 -0
- package/types/package-checks/file-metrics/scc/availability.d.ts +18 -0
- package/types/package-checks/file-metrics/scc/csv.d.ts +1 -0
- package/types/package-checks/file-metrics/scc/parser.d.ts +25 -0
- package/types/package-checks/file-metrics/scc/scanner.d.ts +14 -0
- package/types/package-checks/final-data-parsing.d.ts +9 -0
- package/types/package-checks/function-metrics/analysis.d.ts +10 -0
- package/types/package-checks/function-metrics/constructor.d.ts +11 -0
- package/types/package-checks/function-metrics/execution.d.ts +7 -0
- package/types/package-checks/function-metrics/final-data.d.ts +5 -0
- package/types/package-checks/function-metrics/lizard/availability.d.ts +11 -0
- package/types/package-checks/function-metrics/lizard/csv.d.ts +1 -0
- package/types/package-checks/function-metrics/lizard/parser.d.ts +17 -0
- package/types/package-checks/function-metrics/lizard/scanner.d.ts +15 -0
- package/types/package-checks/function-metrics/measurement-model.d.ts +26 -0
- package/types/package-checks/function-metrics/measurement.d.ts +21 -0
- package/types/package-checks/function-metrics/options-resolution.d.ts +3 -0
- package/types/package-checks/function-metrics/options-validation.d.ts +3 -0
- package/types/package-checks/function-metrics/options.d.ts +76 -0
- package/types/package-checks/function-metrics/records.d.ts +37 -0
- package/types/package-checks/function-metrics/target-files.d.ts +3 -0
- package/types/package-checks/host-environment/error-message.d.ts +1 -0
- package/types/package-checks/host-environment/filesystem.d.ts +19 -0
- package/types/package-checks/host-environment/git.d.ts +13 -0
- package/types/package-checks/host-environment/path.d.ts +3 -0
- package/types/package-checks/host-environment/process/command.d.ts +7 -0
- package/types/package-checks/host-environment/process/contract.d.ts +50 -0
- package/types/package-checks/host-environment/process/env.d.ts +16 -0
- package/types/package-checks/host-environment/process/failure.d.ts +4 -0
- package/types/package-checks/host-environment/process/result.d.ts +2 -0
- package/types/package-checks/host-environment/process/runner.d.ts +3 -0
- package/types/package-checks/json-document/strict-document.d.ts +35 -0
- package/types/package-checks/json-schema-validation/default-check.d.ts +11 -0
- package/types/package-checks/json-schema-validation/execution-stages.d.ts +27 -0
- package/types/package-checks/json-schema-validation/final-data.d.ts +15 -0
- package/types/package-checks/json-schema-validation/issue-collector.d.ts +12 -0
- package/types/package-checks/json-schema-validation/json-schema-validation.d.ts +42 -0
- package/types/package-checks/json-schema-validation/options-resolution.d.ts +3 -0
- package/types/package-checks/json-schema-validation/options-validation.d.ts +2 -0
- package/types/package-checks/json-schema-validation/options.d.ts +53 -0
- package/types/package-checks/json-schema-validation/reference-resolver.d.ts +23 -0
- package/types/package-checks/json-schema-validation/remote-response.d.ts +2 -0
- package/types/package-checks/json-schema-validation/schema-engine.d.ts +33 -0
- package/types/package-checks/json-schema-validation/schema-policy.d.ts +17 -0
- package/types/package-checks/json-validation/default-check.d.ts +11 -0
- package/types/package-checks/json-validation/final-data.d.ts +10 -0
- package/types/package-checks/json-validation/json-validation.d.ts +28 -0
- package/types/package-checks/json-validation/options-resolution.d.ts +3 -0
- package/types/package-checks/json-validation/options-validation.d.ts +2 -0
- package/types/package-checks/json-validation/options.d.ts +13 -0
- package/types/package-checks/maintenance-reminders/assessment-results.d.ts +10 -0
- package/types/package-checks/maintenance-reminders/final-data.d.ts +47 -0
- package/types/package-checks/maintenance-reminders/maintenance-reminders.d.ts +111 -0
- package/types/package-checks/maintenance-reminders/maintenance-support.d.ts +7 -0
- package/types/package-checks/maintenance-reminders/measurement.d.ts +10 -0
- package/types/package-checks/maintenance-reminders/options-validation.d.ts +3 -0
- package/types/package-checks/markdown-link-validation/default-check.d.ts +27 -0
- package/types/package-checks/markdown-link-validation/execution.d.ts +12 -0
- package/types/package-checks/markdown-link-validation/filesystem-probes.d.ts +10 -0
- package/types/package-checks/markdown-link-validation/final-data.d.ts +10 -0
- package/types/package-checks/markdown-link-validation/local-resolution.d.ts +92 -0
- package/types/package-checks/markdown-link-validation/local-resolver.d.ts +5 -0
- package/types/package-checks/markdown-link-validation/markdown-parser.d.ts +37 -0
- package/types/package-checks/markdown-link-validation/options-resolution.d.ts +3 -0
- package/types/package-checks/markdown-link-validation/options-validation.d.ts +2 -0
- package/types/package-checks/markdown-link-validation/options.d.ts +43 -0
- package/types/package-checks/markdown-link-validation/records.d.ts +37 -0
- package/types/package-checks/markdown-link-validation/resolver-engine.d.ts +15 -0
- package/types/package-checks/markdown-link-validation/target-descriptor.d.ts +5 -0
- package/types/package-checks/markdown-link-validation/traversal-result.d.ts +12 -0
- package/types/package-checks/project-files/collection.d.ts +9 -0
- package/types/package-checks/project-files/config-glob.d.ts +5 -0
- package/types/package-checks/project-files/configuration.d.ts +31 -0
- package/types/package-checks/project-files/exact-input-measurement.d.ts +12 -0
- package/types/package-checks/project-files/file-fingerprint.d.ts +7 -0
- package/types/package-checks/project-files/gitlink-revision.d.ts +9 -0
- package/types/package-checks/project-files/gitlink-worktree.d.ts +26 -0
- package/types/package-checks/project-files/input-eligibility.d.ts +7 -0
- package/types/package-checks/project-files/reported-path.d.ts +1 -0
- package/types/package-checks/project-files/revision-paths.d.ts +12 -0
- package/types/package-checks/project-files/revision-worktree-files.d.ts +5 -0
- package/types/project-definition/check-tree/authoring.d.ts +41 -0
- package/types/project-definition/check-tree/materialization.d.ts +4 -0
- package/types/project-definition/check-tree/resolution.d.ts +25 -0
- package/types/project-definition/output-defaults.d.ts +14 -0
- package/types/project-definition/output-validation.d.ts +3 -0
- package/types/project-definition/project-definition-validation.d.ts +6 -0
- package/types/project-definition/project-definition.d.ts +88 -0
- package/types/project-run/aggregation.d.ts +7 -0
- package/types/project-run/check-execution/callback.d.ts +24 -0
- package/types/project-run/check-execution/dependencies.d.ts +9 -0
- package/types/project-run/check-execution/execution-finalization.d.ts +18 -0
- package/types/project-run/check-execution/execution-settlement.d.ts +41 -0
- package/types/project-run/check-execution/messages.d.ts +3 -0
- package/types/project-run/check-execution/plan.d.ts +10 -0
- package/types/project-run/check-execution/preflight-result.d.ts +23 -0
- package/types/project-run/check-execution/preflight.d.ts +27 -0
- package/types/project-run/check-execution/resolved-checks.d.ts +51 -0
- package/types/project-run/check-execution/terminal-result.d.ts +27 -0
- package/types/project-run/completion.d.ts +14 -0
- package/types/project-run/controls/contract.d.ts +24 -0
- package/types/project-run/controls/outputs-override-validation.d.ts +3 -0
- package/types/project-run/controls/validation-result.d.ts +14 -0
- package/types/project-run/controls/validation.d.ts +3 -0
- package/types/project-run/diagnostic-logging/diagnostic-detail-rendering.d.ts +11 -0
- package/types/project-run/diagnostic-logging/logger.d.ts +33 -0
- package/types/project-run/invocation-creation.d.ts +12 -0
- package/types/project-run/invocation.d.ts +34 -0
- package/types/project-run/machine-publication.d.ts +10 -0
- package/types/project-run/output-configuration.d.ts +3 -0
- package/types/project-run/output-status.d.ts +21 -0
- package/types/project-run/progress-rendering/presentation.d.ts +28 -0
- package/types/project-run/progress-rendering/renderer-formatting.d.ts +23 -0
- package/types/project-run/progress-rendering/renderer-lifecycle.d.ts +24 -0
- package/types/project-run/progress-rendering/renderer.d.ts +44 -0
- package/types/project-run/project-context.d.ts +7 -0
- package/types/project-run/result.d.ts +99 -0
- package/types/project-run/run.d.ts +18 -0
- package/types/project-run/task-scheduler/execution-state.d.ts +67 -0
- package/types/project-run/task-scheduler/graph-validation.d.ts +11 -0
- package/types/project-run/task-scheduler/graph.d.ts +40 -0
- package/types/project-run/task-scheduler/scheduler-admission-decision.d.ts +8 -0
- package/types/project-run/task-scheduler/scheduler-blocker-summary.d.ts +4 -0
- package/types/project-run/task-scheduler/scheduler-decision-inspection.d.ts +24 -0
- package/types/project-run/task-scheduler/scheduler-decision-model.d.ts +94 -0
- package/types/project-run/task-scheduler/scheduler-decision.d.ts +8 -0
- package/types/project-run/task-scheduler/scheduler.d.ts +3 -0
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
import type { CheckExecutionContext, CheckMessage, CheckResult } from "../../check/check.ts";
|
|
2
|
+
import {
|
|
3
|
+
reconcileFindingWaivers,
|
|
4
|
+
type FindingWaiverReconciliation
|
|
5
|
+
} from "../../finding-waivers/reconciliation.ts";
|
|
6
|
+
import { collectProjectFileSets, requireProjectFileSet } from "../project-files/collection.ts";
|
|
7
|
+
import { settleFindings } from "../code-quality-findings/policy.ts";
|
|
8
|
+
import { measureFileMetrics, type FileMeasurementResult } from "./measurement.ts";
|
|
9
|
+
import type { FileMetricsExactInputSet } from "./measurement-model.ts";
|
|
10
|
+
import type {
|
|
11
|
+
FileMetricsFindingWaiver,
|
|
12
|
+
ResolvedFileMetricsCodeAreaOptions,
|
|
13
|
+
ResolvedFileMetricsOptions
|
|
14
|
+
} from "./options.ts";
|
|
15
|
+
import { isValidResolvedFileMetricsOptions } from "./options-validation.ts";
|
|
16
|
+
import {
|
|
17
|
+
buildFileRecordCandidates,
|
|
18
|
+
fileMetricsWaiverAuditRecord,
|
|
19
|
+
fileMetricsWaiverIdentity,
|
|
20
|
+
type FileRecordCandidate
|
|
21
|
+
} from "./records.ts";
|
|
22
|
+
import type { FileMetricsFinalData } from "./final-data.ts";
|
|
23
|
+
|
|
24
|
+
export const FILE_METRICS_CHECK_DEFINITION = {
|
|
25
|
+
checkId: "file-metrics",
|
|
26
|
+
displayName: "File metrics"
|
|
27
|
+
} as const;
|
|
28
|
+
|
|
29
|
+
/** `file-metrics` whole-Check unavailable outcome 的稳定 reason code。 */
|
|
30
|
+
export type FileMetricsUnavailableReasonCode =
|
|
31
|
+
| "external-dependency-unavailable"
|
|
32
|
+
| "external-execution-failed"
|
|
33
|
+
| "external-result-invalid"
|
|
34
|
+
| "invalid-options"
|
|
35
|
+
| "source-unavailable";
|
|
36
|
+
|
|
37
|
+
interface CollectedFileMetricsScope extends FileMetricsExactInputSet {
|
|
38
|
+
readonly areaIdsByPath: ReadonlyMap<string, readonly string[]>;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/** 使用 resolved area policy 和 scanner selection 执行一次完整的 file-metrics measurement。 */
|
|
42
|
+
export async function executeFileMetrics(
|
|
43
|
+
context: CheckExecutionContext<ResolvedFileMetricsOptions>
|
|
44
|
+
): Promise<CheckResult<FileMetricsFinalData>> {
|
|
45
|
+
if (!isValidResolvedFileMetricsOptions(context.options)) return unavailable("invalid-options");
|
|
46
|
+
|
|
47
|
+
let collectedScope: CollectedFileMetricsScope;
|
|
48
|
+
try {
|
|
49
|
+
collectedScope = collectAreaScope(context.project.root, context.options.codeAreas);
|
|
50
|
+
} catch {
|
|
51
|
+
return unavailable("source-unavailable");
|
|
52
|
+
}
|
|
53
|
+
if (collectedScope.approvedExactPaths.length === 0) {
|
|
54
|
+
return noEligibleInputResult(context);
|
|
55
|
+
}
|
|
56
|
+
const measurement = await measureFileMetrics(collectedScope, context.options.scanner);
|
|
57
|
+
if (measurement.kind !== "complete") return measurementFailureResult(measurement);
|
|
58
|
+
const candidates = buildFileRecordCandidates(measurement.metrics, {
|
|
59
|
+
areaIdsByPath: collectedScope.areaIdsByPath,
|
|
60
|
+
codeAreas: context.options.codeAreas
|
|
61
|
+
});
|
|
62
|
+
if (candidates === undefined) return unavailable("external-result-invalid");
|
|
63
|
+
const reconciliation = reconcileFileMetricWaivers(candidates, context.options.findingWaivers);
|
|
64
|
+
for (const finding of reconciliation.findings) {
|
|
65
|
+
const data =
|
|
66
|
+
finding.disposition === "waived"
|
|
67
|
+
? Object.freeze({
|
|
68
|
+
...finding.finding.data,
|
|
69
|
+
blocking: false,
|
|
70
|
+
waiver: Object.freeze({ reason: finding.waiver.reason })
|
|
71
|
+
})
|
|
72
|
+
: finding.finding.data;
|
|
73
|
+
context.records.report({ id: finding.finding.id }, data);
|
|
74
|
+
}
|
|
75
|
+
reportWaiverAuditRecords(context, reconciliation);
|
|
76
|
+
const settlement = settleFindings(
|
|
77
|
+
reconciliation.findings.map(({ disposition, finding }) => ({
|
|
78
|
+
actionable: disposition !== "waived",
|
|
79
|
+
blocking: finding.data.blocking
|
|
80
|
+
}))
|
|
81
|
+
);
|
|
82
|
+
return appendWaiverMessages(settlement, reconciliation);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
function noEligibleInputResult(
|
|
86
|
+
context: CheckExecutionContext<ResolvedFileMetricsOptions>
|
|
87
|
+
): CheckResult<FileMetricsFinalData> {
|
|
88
|
+
const reconciliation = reconcileFileMetricWaivers([], context.options.findingWaivers);
|
|
89
|
+
reportWaiverAuditRecords(context, reconciliation);
|
|
90
|
+
return appendWaiverMessages(
|
|
91
|
+
Object.freeze({ status: "not-applicable", reason: { code: "no-eligible-input" } }),
|
|
92
|
+
reconciliation
|
|
93
|
+
);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
function reconcileFileMetricWaivers(
|
|
97
|
+
candidates: readonly FileRecordCandidate[],
|
|
98
|
+
waivers: readonly FileMetricsFindingWaiver[]
|
|
99
|
+
): FindingWaiverReconciliation<FileRecordCandidate> {
|
|
100
|
+
return reconcileFindingWaivers({
|
|
101
|
+
findings: candidates,
|
|
102
|
+
identify: ({ data }) => ({ metric: data.metric, path: data.path }),
|
|
103
|
+
waivers
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
function reportWaiverAuditRecords(
|
|
108
|
+
context: CheckExecutionContext<ResolvedFileMetricsOptions>,
|
|
109
|
+
reconciliation: FindingWaiverReconciliation<FileRecordCandidate>
|
|
110
|
+
): void {
|
|
111
|
+
for (const audit of reconciliation.waiverAudits) {
|
|
112
|
+
const record = fileMetricsWaiverAuditRecord(audit);
|
|
113
|
+
if (record !== undefined) context.records.report({ id: record.id }, record.data);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
function appendWaiverMessages(
|
|
118
|
+
settlement: CheckResult<FileMetricsFinalData>,
|
|
119
|
+
reconciliation: FindingWaiverReconciliation<FileRecordCandidate>
|
|
120
|
+
): CheckResult<FileMetricsFinalData> {
|
|
121
|
+
const waiverMessages: CheckMessage[] = [];
|
|
122
|
+
for (const audit of reconciliation.waiverAudits) {
|
|
123
|
+
const identity = fileMetricsWaiverIdentity(audit.waiver);
|
|
124
|
+
switch (audit.status) {
|
|
125
|
+
case "applied":
|
|
126
|
+
waiverMessages.push(
|
|
127
|
+
Object.freeze({
|
|
128
|
+
code: "finding-waived",
|
|
129
|
+
level: "info",
|
|
130
|
+
message: `File metric finding for ${identity.path} was waived: ${audit.waiver.reason}`
|
|
131
|
+
})
|
|
132
|
+
);
|
|
133
|
+
break;
|
|
134
|
+
case "unused":
|
|
135
|
+
waiverMessages.push(
|
|
136
|
+
Object.freeze({
|
|
137
|
+
code: "unused-finding-waiver",
|
|
138
|
+
level: "warning",
|
|
139
|
+
message: `Configured file-metrics finding waiver for ${identity.path} matched no finding; remove it or update its identity. Reason: ${audit.waiver.reason}`
|
|
140
|
+
})
|
|
141
|
+
);
|
|
142
|
+
break;
|
|
143
|
+
case "overmatched":
|
|
144
|
+
waiverMessages.push(
|
|
145
|
+
Object.freeze({
|
|
146
|
+
code: "overmatched-finding-waiver",
|
|
147
|
+
level: "warning",
|
|
148
|
+
message: `Configured file-metrics finding waiver for ${identity.path} matched ${audit.matchCount} findings and was not applied; narrow its identity. Reason: ${audit.waiver.reason}`
|
|
149
|
+
})
|
|
150
|
+
);
|
|
151
|
+
break;
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
if (waiverMessages.length === 0) return settlement;
|
|
155
|
+
return Object.freeze({
|
|
156
|
+
...settlement,
|
|
157
|
+
messages: Object.freeze([...(settlement.messages ?? []), ...waiverMessages])
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
function collectAreaScope(
|
|
162
|
+
rootDir: string,
|
|
163
|
+
codeAreas: Readonly<Record<string, ResolvedFileMetricsCodeAreaOptions>>
|
|
164
|
+
): CollectedFileMetricsScope {
|
|
165
|
+
const areaIdsByPath = new Map<string, string[]>();
|
|
166
|
+
const filesByArea = collectProjectFileSets(
|
|
167
|
+
rootDir,
|
|
168
|
+
Object.fromEntries(Object.entries(codeAreas).map(([areaId, area]) => [areaId, area.files]))
|
|
169
|
+
);
|
|
170
|
+
for (const [areaId] of Object.entries(codeAreas)) {
|
|
171
|
+
for (const path of requireProjectFileSet(filesByArea, areaId)) {
|
|
172
|
+
const areaIds = areaIdsByPath.get(path);
|
|
173
|
+
if (areaIds === undefined) areaIdsByPath.set(path, [areaId]);
|
|
174
|
+
else areaIds.push(areaId);
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
const normalizedMembership = new Map<string, readonly string[]>();
|
|
179
|
+
for (const [path, areaIds] of areaIdsByPath) {
|
|
180
|
+
normalizedMembership.set(path, Object.freeze(areaIds.sort(compareText)));
|
|
181
|
+
}
|
|
182
|
+
return Object.freeze({
|
|
183
|
+
approvedExactPaths: Object.freeze([...normalizedMembership.keys()].sort(compareText)),
|
|
184
|
+
areaIdsByPath: normalizedMembership,
|
|
185
|
+
rootDir
|
|
186
|
+
});
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
function measurementFailureResult(
|
|
190
|
+
measurement: Exclude<FileMeasurementResult, { kind: "complete" }>
|
|
191
|
+
): CheckResult<FileMetricsFinalData> {
|
|
192
|
+
switch (measurement.kind) {
|
|
193
|
+
case "execution-failed":
|
|
194
|
+
return unavailable("external-execution-failed");
|
|
195
|
+
case "invalid-result":
|
|
196
|
+
return unavailable("external-result-invalid");
|
|
197
|
+
case "unavailable":
|
|
198
|
+
return unavailable("external-dependency-unavailable");
|
|
199
|
+
}
|
|
200
|
+
const exhaustiveMeasurement: never = measurement;
|
|
201
|
+
return exhaustiveMeasurement;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
function unavailable(code: FileMetricsUnavailableReasonCode): CheckResult<FileMetricsFinalData> {
|
|
205
|
+
return Object.freeze({
|
|
206
|
+
status: "unavailable",
|
|
207
|
+
reason: { code },
|
|
208
|
+
messages: Object.freeze([
|
|
209
|
+
Object.freeze({ code, level: "error" as const, message: unavailableMessage(code) })
|
|
210
|
+
])
|
|
211
|
+
});
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
function unavailableMessage(code: FileMetricsUnavailableReasonCode): string {
|
|
215
|
+
switch (code) {
|
|
216
|
+
case "invalid-options":
|
|
217
|
+
return "fileMetrics options are invalid; recreate the Check with fileMetrics(options) or restore its complete resolved options.";
|
|
218
|
+
case "source-unavailable":
|
|
219
|
+
return "File metrics could not collect its configured project files; check the project root, file permissions, and selected file source.";
|
|
220
|
+
case "external-dependency-unavailable":
|
|
221
|
+
return "The configured SCC command is unavailable or incompatible; install SCC 3.7.0 or configure a compatible executable.";
|
|
222
|
+
case "external-execution-failed":
|
|
223
|
+
return "SCC did not complete successfully; run the configured command directly and inspect its environment.";
|
|
224
|
+
case "external-result-invalid":
|
|
225
|
+
return "SCC output could not form a trusted complete result; check the executable version and CSV compatibility.";
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
function compareText(left: string, right: string): number {
|
|
230
|
+
if (left < right) return -1;
|
|
231
|
+
if (left > right) return 1;
|
|
232
|
+
return 0;
|
|
233
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { FindingSummary } from "../code-quality-findings/policy.ts";
|
|
2
|
+
import { parseFindingSummaryData } from "../final-data-parsing.ts";
|
|
3
|
+
|
|
4
|
+
/** `file-metrics` 在 passed/failed outcome 中发布的主数据。 */
|
|
5
|
+
export type FileMetricsFinalData = FindingSummary;
|
|
6
|
+
|
|
7
|
+
/** 验证并脱离一份 `file-metrics` canonical final-data object。 */
|
|
8
|
+
export function parseFileMetricsData(data: unknown): FileMetricsFinalData {
|
|
9
|
+
return parseFindingSummaryData(data, "fileMetrics");
|
|
10
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export interface FileMetric {
|
|
2
|
+
readonly codeLines: number;
|
|
3
|
+
readonly decisionTokens: Readonly<{ readonly source: "scc"; readonly value: number | null }>;
|
|
4
|
+
readonly path: string;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export interface FileMetricsExactInputSet {
|
|
8
|
+
readonly approvedExactPaths: readonly string[];
|
|
9
|
+
readonly rootDir: string;
|
|
10
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { acceptExactInputMeasurements } from "../project-files/exact-input-measurement.ts";
|
|
2
|
+
import type { FileMetric, FileMetricsExactInputSet } from "./measurement-model.ts";
|
|
3
|
+
import type { ResolvedFileMetricsScannerOptions } from "./options.ts";
|
|
4
|
+
import { checkScc } from "./scc/availability.ts";
|
|
5
|
+
import { scanWithScc } from "./scc/scanner.ts";
|
|
6
|
+
|
|
7
|
+
export type FileMeasurementResult = Readonly<
|
|
8
|
+
| { kind: "complete"; metrics: readonly FileMetric[] }
|
|
9
|
+
| { kind: "execution-failed" }
|
|
10
|
+
| { kind: "invalid-result" }
|
|
11
|
+
| { kind: "unavailable" }
|
|
12
|
+
>;
|
|
13
|
+
|
|
14
|
+
export async function measureFileMetrics(
|
|
15
|
+
exactInputs: FileMetricsExactInputSet,
|
|
16
|
+
scanner: ResolvedFileMetricsScannerOptions
|
|
17
|
+
): Promise<FileMeasurementResult> {
|
|
18
|
+
if (exactInputs.approvedExactPaths.length === 0) {
|
|
19
|
+
return Object.freeze({ kind: "complete", metrics: Object.freeze([]) });
|
|
20
|
+
}
|
|
21
|
+
const scannerAvailability = await checkScc(exactInputs.rootDir, scanner);
|
|
22
|
+
if (!scannerAvailability.available) {
|
|
23
|
+
return Object.freeze({ kind: "unavailable" });
|
|
24
|
+
}
|
|
25
|
+
return runFileScanner(exactInputs, scanner);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
function runFileScanner(
|
|
29
|
+
exactInputs: FileMetricsExactInputSet,
|
|
30
|
+
scanner: ResolvedFileMetricsScannerOptions
|
|
31
|
+
): FileMeasurementResult {
|
|
32
|
+
const scanResult = scanWithScc({
|
|
33
|
+
cwd: exactInputs.rootDir,
|
|
34
|
+
scanner,
|
|
35
|
+
includePaths: exactInputs.approvedExactPaths
|
|
36
|
+
});
|
|
37
|
+
if (!scanResult.ok) {
|
|
38
|
+
return Object.freeze({
|
|
39
|
+
kind: scanResult.reason === "execution" ? "execution-failed" : "invalid-result"
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
const acceptedMeasurements = acceptExactInputMeasurements(
|
|
43
|
+
scanResult.measurements,
|
|
44
|
+
exactInputs.approvedExactPaths
|
|
45
|
+
);
|
|
46
|
+
return acceptedMeasurements.ok
|
|
47
|
+
? Object.freeze({
|
|
48
|
+
kind: "complete",
|
|
49
|
+
metrics: Object.freeze([...acceptedMeasurements.payloads])
|
|
50
|
+
})
|
|
51
|
+
: Object.freeze({ kind: "invalid-result" });
|
|
52
|
+
}
|
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
import {
|
|
2
|
+
hasRequiredAndOptionalRecordKeys,
|
|
3
|
+
snapshotClosedArray,
|
|
4
|
+
snapshotClosedRecord
|
|
5
|
+
} from "../../data-boundary/closed-values.ts";
|
|
6
|
+
import {
|
|
7
|
+
resolveProjectFileSelection,
|
|
8
|
+
snapshotDefaultProjectFileSelection
|
|
9
|
+
} from "../project-files/configuration.ts";
|
|
10
|
+
import {
|
|
11
|
+
DEFAULT_FINDING_POLICY,
|
|
12
|
+
resolveFindingPolicy,
|
|
13
|
+
type FindingPolicy
|
|
14
|
+
} from "../code-quality-findings/policy.ts";
|
|
15
|
+
import { isNormalizedProjectRelativePath } from "../host-environment/path.ts";
|
|
16
|
+
import type {
|
|
17
|
+
FileMetricsFindingIdentity,
|
|
18
|
+
FileMetricsFindingWaiver,
|
|
19
|
+
ResolvedFileMetricsCodeAreaOptions,
|
|
20
|
+
ResolvedFileMetricsOptions
|
|
21
|
+
} from "./options.ts";
|
|
22
|
+
import { isValidResolvedFileMetricsOptions } from "./options-validation.ts";
|
|
23
|
+
|
|
24
|
+
const DEFAULT_EXECUTABLE = "scc";
|
|
25
|
+
const DEFAULT_MAXIMUM_CODE_LINES = 360;
|
|
26
|
+
const DEFAULT_ALLOWANCE_MAXIMUM_CODE_LINES = 600;
|
|
27
|
+
const DEFAULT_ALLOWANCE_MAXIMUM_DECISION_TOKENS = 12;
|
|
28
|
+
|
|
29
|
+
interface PolicyRecordKeys {
|
|
30
|
+
readonly optional?: readonly string[];
|
|
31
|
+
readonly required?: readonly string[];
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/** 校验 constructor input,并将所有可省略 policy 物化为完整、冻结的 Check options。 */
|
|
35
|
+
export function resolveFileMetricsOptions(
|
|
36
|
+
authoredOptions: unknown
|
|
37
|
+
): ResolvedFileMetricsOptions | undefined {
|
|
38
|
+
const input = snapshotPolicyRecord(authoredOptions, {
|
|
39
|
+
optional: ["codeAreas", "findingPolicy", "findingWaivers", "scanner"]
|
|
40
|
+
});
|
|
41
|
+
if (input === undefined) return undefined;
|
|
42
|
+
|
|
43
|
+
const findingPolicy = resolveFindingPolicy(input.findingPolicy, DEFAULT_FINDING_POLICY);
|
|
44
|
+
if (findingPolicy === undefined) return undefined;
|
|
45
|
+
const codeAreas = resolveCodeAreas(input.codeAreas, findingPolicy);
|
|
46
|
+
const findingWaivers = resolveFindingWaivers(input.findingWaivers);
|
|
47
|
+
const scanner = resolveScanner(input.scanner);
|
|
48
|
+
if (codeAreas === undefined || findingWaivers === undefined || scanner === undefined)
|
|
49
|
+
return undefined;
|
|
50
|
+
|
|
51
|
+
const options = Object.freeze({ codeAreas, findingWaivers, scanner });
|
|
52
|
+
return isValidResolvedFileMetricsOptions(options) ? options : undefined;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
function resolveFindingWaivers(value: unknown): readonly FileMetricsFindingWaiver[] | undefined {
|
|
56
|
+
if (value === undefined) return Object.freeze([]);
|
|
57
|
+
const candidates = snapshotClosedArray(value);
|
|
58
|
+
if (candidates === undefined) return undefined;
|
|
59
|
+
const waivers: FileMetricsFindingWaiver[] = [];
|
|
60
|
+
const seenIdentities = new Set<string>();
|
|
61
|
+
for (const candidate of candidates) {
|
|
62
|
+
const waiver = resolveFindingWaiver(candidate);
|
|
63
|
+
if (waiver === undefined) return undefined;
|
|
64
|
+
const identityKey = `${waiver.identity.metric}\u0000${waiver.identity.path}`;
|
|
65
|
+
if (seenIdentities.has(identityKey)) return undefined;
|
|
66
|
+
seenIdentities.add(identityKey);
|
|
67
|
+
waivers.push(waiver);
|
|
68
|
+
}
|
|
69
|
+
return Object.freeze(waivers);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
function resolveFindingWaiver(value: unknown): FileMetricsFindingWaiver | undefined {
|
|
73
|
+
const waiver = snapshotPolicyRecord(value, { required: ["identity", "reason"] });
|
|
74
|
+
if (waiver === undefined || !isNonEmptyString(waiver.reason)) return undefined;
|
|
75
|
+
const identity = resolveFindingIdentity(waiver.identity);
|
|
76
|
+
return identity === undefined ? undefined : Object.freeze({ identity, reason: waiver.reason });
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
function resolveFindingIdentity(value: unknown): FileMetricsFindingIdentity | undefined {
|
|
80
|
+
const identity = snapshotPolicyRecord(value, { required: ["metric", "path"] });
|
|
81
|
+
return identity === undefined ||
|
|
82
|
+
identity.metric !== "code-lines" ||
|
|
83
|
+
!isNormalizedProjectRelativePath(identity.path)
|
|
84
|
+
? undefined
|
|
85
|
+
: Object.freeze({ metric: "code-lines", path: identity.path });
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
function resolveCodeAreas(
|
|
89
|
+
value: unknown,
|
|
90
|
+
defaultFindingPolicy: FindingPolicy
|
|
91
|
+
): ResolvedFileMetricsOptions["codeAreas"] | undefined {
|
|
92
|
+
if (value === undefined) return Object.freeze({ project: defaultCodeArea(defaultFindingPolicy) });
|
|
93
|
+
const areas = snapshotClosedRecord(value);
|
|
94
|
+
if (areas === undefined || Object.keys(areas).length === 0) return undefined;
|
|
95
|
+
|
|
96
|
+
const resolvedEntries: Array<readonly [string, ResolvedFileMetricsCodeAreaOptions]> = [];
|
|
97
|
+
for (const [areaId, candidate] of Object.entries(areas)) {
|
|
98
|
+
if (!isNonEmptyString(areaId)) return undefined;
|
|
99
|
+
const area = resolveCodeArea(candidate, defaultFindingPolicy);
|
|
100
|
+
if (area === undefined) return undefined;
|
|
101
|
+
resolvedEntries.push([areaId, area]);
|
|
102
|
+
}
|
|
103
|
+
return Object.freeze(Object.fromEntries(resolvedEntries));
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
function defaultCodeArea(findingPolicy: FindingPolicy): ResolvedFileMetricsCodeAreaOptions {
|
|
107
|
+
return Object.freeze({
|
|
108
|
+
codeLines: defaultCodeLines(),
|
|
109
|
+
files: snapshotDefaultProjectFileSelection(),
|
|
110
|
+
findingPolicy
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
function resolveCodeArea(
|
|
115
|
+
value: unknown,
|
|
116
|
+
defaultFindingPolicy: FindingPolicy
|
|
117
|
+
): ResolvedFileMetricsCodeAreaOptions | undefined {
|
|
118
|
+
const area = snapshotPolicyRecord(value, {
|
|
119
|
+
optional: ["codeLines", "findingPolicy"],
|
|
120
|
+
required: ["files"]
|
|
121
|
+
});
|
|
122
|
+
if (area === undefined) return undefined;
|
|
123
|
+
const files = resolveProjectFileSelection(area.files);
|
|
124
|
+
const findingPolicy = resolveFindingPolicy(area.findingPolicy, defaultFindingPolicy);
|
|
125
|
+
const codeLines = resolveCodeLines(area.codeLines);
|
|
126
|
+
return files === undefined || findingPolicy === undefined || codeLines === undefined
|
|
127
|
+
? undefined
|
|
128
|
+
: Object.freeze({ codeLines, files, findingPolicy });
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
function resolveCodeLines(
|
|
132
|
+
value: unknown
|
|
133
|
+
): ResolvedFileMetricsCodeAreaOptions["codeLines"] | undefined {
|
|
134
|
+
if (value === undefined) return defaultCodeLines();
|
|
135
|
+
const codeLines = snapshotPolicyRecord(value, {
|
|
136
|
+
optional: ["lowDecisionTokenAllowance", "maximum"]
|
|
137
|
+
});
|
|
138
|
+
if (codeLines === undefined) return undefined;
|
|
139
|
+
const maximum = codeLines.maximum ?? DEFAULT_MAXIMUM_CODE_LINES;
|
|
140
|
+
const lowDecisionTokenAllowance = resolveAllowance(codeLines.lowDecisionTokenAllowance);
|
|
141
|
+
if (
|
|
142
|
+
!isPositiveSafeInteger(maximum) ||
|
|
143
|
+
lowDecisionTokenAllowance === undefined ||
|
|
144
|
+
lowDecisionTokenAllowance.maximumCodeLines <= maximum
|
|
145
|
+
) {
|
|
146
|
+
return undefined;
|
|
147
|
+
}
|
|
148
|
+
return Object.freeze({ lowDecisionTokenAllowance, maximum });
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
function defaultCodeLines(): ResolvedFileMetricsCodeAreaOptions["codeLines"] {
|
|
152
|
+
return Object.freeze({
|
|
153
|
+
lowDecisionTokenAllowance: Object.freeze({
|
|
154
|
+
maximumCodeLines: DEFAULT_ALLOWANCE_MAXIMUM_CODE_LINES,
|
|
155
|
+
maximumDecisionTokens: DEFAULT_ALLOWANCE_MAXIMUM_DECISION_TOKENS
|
|
156
|
+
}),
|
|
157
|
+
maximum: DEFAULT_MAXIMUM_CODE_LINES
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
function resolveAllowance(
|
|
162
|
+
value: unknown
|
|
163
|
+
): ResolvedFileMetricsCodeAreaOptions["codeLines"]["lowDecisionTokenAllowance"] | undefined {
|
|
164
|
+
if (value === undefined) return defaultCodeLines().lowDecisionTokenAllowance;
|
|
165
|
+
const allowance = snapshotPolicyRecord(value, {
|
|
166
|
+
optional: ["maximumCodeLines", "maximumDecisionTokens"]
|
|
167
|
+
});
|
|
168
|
+
if (allowance === undefined) return undefined;
|
|
169
|
+
const maximumCodeLines = allowance.maximumCodeLines ?? DEFAULT_ALLOWANCE_MAXIMUM_CODE_LINES;
|
|
170
|
+
const maximumDecisionTokens =
|
|
171
|
+
allowance.maximumDecisionTokens ?? DEFAULT_ALLOWANCE_MAXIMUM_DECISION_TOKENS;
|
|
172
|
+
if (
|
|
173
|
+
!isPositiveSafeInteger(maximumCodeLines) ||
|
|
174
|
+
!isNonNegativeSafeInteger(maximumDecisionTokens)
|
|
175
|
+
) {
|
|
176
|
+
return undefined;
|
|
177
|
+
}
|
|
178
|
+
return Object.freeze({ maximumCodeLines, maximumDecisionTokens });
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
function resolveScanner(value: unknown): ResolvedFileMetricsOptions["scanner"] | undefined {
|
|
182
|
+
if (value === undefined) return Object.freeze({ executable: DEFAULT_EXECUTABLE });
|
|
183
|
+
const scanner = snapshotPolicyRecord(value, { optional: ["executable"] });
|
|
184
|
+
if (scanner === undefined) return undefined;
|
|
185
|
+
const executable = scanner.executable ?? DEFAULT_EXECUTABLE;
|
|
186
|
+
return isNonEmptyString(executable) ? Object.freeze({ executable }) : undefined;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
function snapshotPolicyRecord(
|
|
190
|
+
value: unknown,
|
|
191
|
+
keys: PolicyRecordKeys
|
|
192
|
+
): Readonly<Record<string, unknown>> | undefined {
|
|
193
|
+
const record = snapshotClosedRecord(value);
|
|
194
|
+
return record !== undefined &&
|
|
195
|
+
hasRequiredAndOptionalRecordKeys(record, {
|
|
196
|
+
optional: keys.optional ?? [],
|
|
197
|
+
required: keys.required ?? []
|
|
198
|
+
})
|
|
199
|
+
? record
|
|
200
|
+
: undefined;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
function isPositiveSafeInteger(value: unknown): value is number {
|
|
204
|
+
return typeof value === "number" && Number.isSafeInteger(value) && value > 0;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
function isNonNegativeSafeInteger(value: unknown): value is number {
|
|
208
|
+
return typeof value === "number" && Number.isSafeInteger(value) && value >= 0;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
function isNonEmptyString(value: unknown): value is string {
|
|
212
|
+
return typeof value === "string" && value.length > 0;
|
|
213
|
+
}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { snapshotClosedArray, snapshotClosedRecord } from "../../data-boundary/closed-values.ts";
|
|
2
|
+
import { validProjectFileSelection } from "../project-files/configuration.ts";
|
|
3
|
+
import { validFindingPolicy } from "../code-quality-findings/policy.ts";
|
|
4
|
+
import { isNormalizedProjectRelativePath } from "../host-environment/path.ts";
|
|
5
|
+
import type { ResolvedFileMetricsOptions } from "./options.ts";
|
|
6
|
+
|
|
7
|
+
/** 验证 constructor 产物或普通对象组合形成的完整 file-metrics options。 */
|
|
8
|
+
export function isValidResolvedFileMetricsOptions(
|
|
9
|
+
resolvedOptions: unknown
|
|
10
|
+
): resolvedOptions is ResolvedFileMetricsOptions {
|
|
11
|
+
const options = exactRecord(resolvedOptions, ["codeAreas", "findingWaivers", "scanner"]);
|
|
12
|
+
return (
|
|
13
|
+
options !== undefined &&
|
|
14
|
+
isValidCodeAreas(options.codeAreas) &&
|
|
15
|
+
isValidFindingWaivers(options.findingWaivers) &&
|
|
16
|
+
isValidScanner(options.scanner)
|
|
17
|
+
);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
function isValidFindingWaivers(value: unknown): boolean {
|
|
21
|
+
const waivers = snapshotClosedArray(value);
|
|
22
|
+
if (waivers === undefined) return false;
|
|
23
|
+
const identities = new Set<string>();
|
|
24
|
+
for (const candidate of waivers) {
|
|
25
|
+
const waiver = exactRecord(candidate, ["identity", "reason"]);
|
|
26
|
+
const identity =
|
|
27
|
+
waiver === undefined ? undefined : exactRecord(waiver.identity, ["metric", "path"]);
|
|
28
|
+
if (
|
|
29
|
+
waiver === undefined ||
|
|
30
|
+
identity === undefined ||
|
|
31
|
+
identity.metric !== "code-lines" ||
|
|
32
|
+
!isNormalizedProjectRelativePath(identity.path) ||
|
|
33
|
+
!isNonEmptyString(waiver.reason)
|
|
34
|
+
) {
|
|
35
|
+
return false;
|
|
36
|
+
}
|
|
37
|
+
const identityKey = `${identity.metric}\u0000${identity.path}`;
|
|
38
|
+
if (identities.has(identityKey)) return false;
|
|
39
|
+
identities.add(identityKey);
|
|
40
|
+
}
|
|
41
|
+
return true;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
function isValidCodeAreas(value: unknown): boolean {
|
|
45
|
+
const codeAreas = snapshotClosedRecord(value);
|
|
46
|
+
if (codeAreas === undefined || Object.keys(codeAreas).length === 0) return false;
|
|
47
|
+
return Object.entries(codeAreas).every(
|
|
48
|
+
([areaId, candidate]) => areaId.length > 0 && isValidCodeArea(candidate)
|
|
49
|
+
);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
function isValidCodeArea(value: unknown): boolean {
|
|
53
|
+
const area = exactRecord(value, ["codeLines", "files", "findingPolicy"]);
|
|
54
|
+
return (
|
|
55
|
+
area !== undefined &&
|
|
56
|
+
validProjectFileSelection(area.files) &&
|
|
57
|
+
validFindingPolicy(area.findingPolicy) &&
|
|
58
|
+
isValidCodeLinePolicy(area.codeLines)
|
|
59
|
+
);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
function isValidCodeLinePolicy(value: unknown): boolean {
|
|
63
|
+
const policy = exactRecord(value, ["lowDecisionTokenAllowance", "maximum"]);
|
|
64
|
+
if (policy === undefined || !isPositiveSafeInteger(policy.maximum)) return false;
|
|
65
|
+
const allowance = exactRecord(policy.lowDecisionTokenAllowance, [
|
|
66
|
+
"maximumCodeLines",
|
|
67
|
+
"maximumDecisionTokens"
|
|
68
|
+
]);
|
|
69
|
+
return (
|
|
70
|
+
allowance !== undefined &&
|
|
71
|
+
isPositiveSafeInteger(allowance.maximumCodeLines) &&
|
|
72
|
+
allowance.maximumCodeLines > policy.maximum &&
|
|
73
|
+
isNonNegativeSafeInteger(allowance.maximumDecisionTokens)
|
|
74
|
+
);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
function isValidScanner(value: unknown): boolean {
|
|
78
|
+
const scanner = exactRecord(value, ["executable"]);
|
|
79
|
+
return scanner !== undefined && isNonEmptyString(scanner.executable);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
function exactRecord(
|
|
83
|
+
value: unknown,
|
|
84
|
+
keys: readonly string[]
|
|
85
|
+
): Readonly<Record<string, unknown>> | undefined {
|
|
86
|
+
const record = snapshotClosedRecord(value);
|
|
87
|
+
return record !== undefined &&
|
|
88
|
+
Object.keys(record).length === keys.length &&
|
|
89
|
+
keys.every((key) => Object.hasOwn(record, key))
|
|
90
|
+
? record
|
|
91
|
+
: undefined;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
function isPositiveSafeInteger(value: unknown): value is number {
|
|
95
|
+
return typeof value === "number" && Number.isSafeInteger(value) && value > 0;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
function isNonNegativeSafeInteger(value: unknown): value is number {
|
|
99
|
+
return typeof value === "number" && Number.isSafeInteger(value) && value >= 0;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
function isNonEmptyString(value: unknown): value is string {
|
|
103
|
+
return typeof value === "string" && value.length > 0;
|
|
104
|
+
}
|