@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,162 @@
|
|
|
1
|
+
import {
|
|
2
|
+
hasRequiredAndOptionalRecordKeys,
|
|
3
|
+
snapshotClosedRecord
|
|
4
|
+
} from "../../data-boundary/closed-values.ts";
|
|
5
|
+
import {
|
|
6
|
+
resolveProjectFileSelection,
|
|
7
|
+
snapshotDefaultProjectFileSelection
|
|
8
|
+
} from "../project-files/configuration.ts";
|
|
9
|
+
import {
|
|
10
|
+
DEFAULT_FINDING_POLICY,
|
|
11
|
+
resolveFindingPolicy,
|
|
12
|
+
type FindingPolicy
|
|
13
|
+
} from "../code-quality-findings/policy.ts";
|
|
14
|
+
import { DEFAULT_JSCPD_COMMAND } from "./jscpd/command-resolution.ts";
|
|
15
|
+
import type {
|
|
16
|
+
DuplicateDetectionScannerCommand,
|
|
17
|
+
ResolvedDuplicateDetectionCodeAreaOptions,
|
|
18
|
+
ResolvedDuplicateDetectionOptions,
|
|
19
|
+
ResolvedDuplicateDetectionScannerOptions
|
|
20
|
+
} from "./options.ts";
|
|
21
|
+
import { validResolvedDuplicateDetectionOptions } from "./options-validation.ts";
|
|
22
|
+
|
|
23
|
+
const DEFAULT_CACHE_DIRECTORY = ".cache/vibe-check";
|
|
24
|
+
const DEFAULT_MINIMUM_LINES = 4;
|
|
25
|
+
const DEFAULT_MINIMUM_TOKENS = 100;
|
|
26
|
+
|
|
27
|
+
interface PolicyRecordKeys {
|
|
28
|
+
readonly optional?: readonly string[];
|
|
29
|
+
readonly required?: readonly string[];
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/** 校验 constructor input,并将所有可省略 policy 物化为完整、冻结的 Check options。 */
|
|
33
|
+
export function resolveDuplicateDetectionOptions(
|
|
34
|
+
value: unknown
|
|
35
|
+
): ResolvedDuplicateDetectionOptions | undefined {
|
|
36
|
+
const input = snapshotPolicyRecord(value, {
|
|
37
|
+
optional: ["cache", "codeAreas", "findingPolicy", "scanner"]
|
|
38
|
+
});
|
|
39
|
+
if (input === undefined) return undefined;
|
|
40
|
+
|
|
41
|
+
const cache = resolveCache(input.cache);
|
|
42
|
+
const findingPolicy = resolveFindingPolicy(input.findingPolicy, DEFAULT_FINDING_POLICY);
|
|
43
|
+
if (findingPolicy === undefined) return undefined;
|
|
44
|
+
const codeAreas = resolveCodeAreas(input.codeAreas, findingPolicy);
|
|
45
|
+
const scanner = resolveScanner(input.scanner);
|
|
46
|
+
if (cache === undefined || codeAreas === undefined || scanner === undefined) return undefined;
|
|
47
|
+
|
|
48
|
+
const options = Object.freeze({ cache, codeAreas, scanner });
|
|
49
|
+
return validResolvedDuplicateDetectionOptions(options) ? options : undefined;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
function resolveCache(value: unknown): ResolvedDuplicateDetectionOptions["cache"] | undefined {
|
|
53
|
+
if (value === undefined) {
|
|
54
|
+
return Object.freeze({ directory: DEFAULT_CACHE_DIRECTORY, enabled: true });
|
|
55
|
+
}
|
|
56
|
+
const cache = snapshotPolicyRecord(value, { optional: ["directory", "enabled"] });
|
|
57
|
+
if (cache === undefined) return undefined;
|
|
58
|
+
const directory = cache.directory ?? DEFAULT_CACHE_DIRECTORY;
|
|
59
|
+
const enabled = cache.enabled ?? true;
|
|
60
|
+
if (!nonEmptyString(directory) || typeof enabled !== "boolean") return undefined;
|
|
61
|
+
return Object.freeze({ directory, enabled });
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
function resolveCodeAreas(
|
|
65
|
+
value: unknown,
|
|
66
|
+
defaultFindingPolicy: FindingPolicy
|
|
67
|
+
): ResolvedDuplicateDetectionOptions["codeAreas"] | undefined {
|
|
68
|
+
if (value === undefined) {
|
|
69
|
+
return Object.freeze({ project: defaultCodeArea(defaultFindingPolicy) });
|
|
70
|
+
}
|
|
71
|
+
const areas = snapshotClosedRecord(value);
|
|
72
|
+
if (areas === undefined || Object.keys(areas).length === 0) return undefined;
|
|
73
|
+
|
|
74
|
+
const resolvedEntries: Array<readonly [string, ResolvedDuplicateDetectionCodeAreaOptions]> = [];
|
|
75
|
+
for (const [areaId, candidate] of Object.entries(areas)) {
|
|
76
|
+
if (!nonEmptyString(areaId)) return undefined;
|
|
77
|
+
const area = resolveCodeArea(candidate, defaultFindingPolicy);
|
|
78
|
+
if (area === undefined) return undefined;
|
|
79
|
+
resolvedEntries.push([areaId, area]);
|
|
80
|
+
}
|
|
81
|
+
return Object.freeze(Object.fromEntries(resolvedEntries));
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
function defaultCodeArea(findingPolicy: FindingPolicy): ResolvedDuplicateDetectionCodeAreaOptions {
|
|
85
|
+
return Object.freeze({
|
|
86
|
+
files: snapshotDefaultProjectFileSelection(),
|
|
87
|
+
findingPolicy,
|
|
88
|
+
minimumLines: DEFAULT_MINIMUM_LINES,
|
|
89
|
+
minimumTokens: DEFAULT_MINIMUM_TOKENS
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
function resolveCodeArea(
|
|
94
|
+
value: unknown,
|
|
95
|
+
defaultFindingPolicy: FindingPolicy
|
|
96
|
+
): ResolvedDuplicateDetectionCodeAreaOptions | undefined {
|
|
97
|
+
const area = snapshotPolicyRecord(value, {
|
|
98
|
+
optional: ["findingPolicy", "minimumLines", "minimumTokens"],
|
|
99
|
+
required: ["files"]
|
|
100
|
+
});
|
|
101
|
+
if (area === undefined) return undefined;
|
|
102
|
+
const files = resolveProjectFileSelection(area.files);
|
|
103
|
+
const findingPolicy = resolveFindingPolicy(area.findingPolicy, defaultFindingPolicy);
|
|
104
|
+
const minimumLines = area.minimumLines ?? DEFAULT_MINIMUM_LINES;
|
|
105
|
+
const minimumTokens = area.minimumTokens ?? DEFAULT_MINIMUM_TOKENS;
|
|
106
|
+
if (
|
|
107
|
+
files === undefined ||
|
|
108
|
+
findingPolicy === undefined ||
|
|
109
|
+
!positiveSafeInteger(minimumLines) ||
|
|
110
|
+
!positiveSafeInteger(minimumTokens)
|
|
111
|
+
) {
|
|
112
|
+
return undefined;
|
|
113
|
+
}
|
|
114
|
+
return Object.freeze({ files, findingPolicy, minimumLines, minimumTokens });
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
function resolveScanner(value: unknown): ResolvedDuplicateDetectionScannerOptions | undefined {
|
|
118
|
+
if (value === undefined) return Object.freeze({ command: DEFAULT_JSCPD_COMMAND });
|
|
119
|
+
const scanner = snapshotPolicyRecord(value, { optional: ["command"] });
|
|
120
|
+
if (scanner === undefined) return undefined;
|
|
121
|
+
const command = resolveScannerCommand(scanner.command);
|
|
122
|
+
return command === undefined ? undefined : Object.freeze({ command });
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
function resolveScannerCommand(value: unknown): DuplicateDetectionScannerCommand | undefined {
|
|
126
|
+
if (value === undefined) return DEFAULT_JSCPD_COMMAND;
|
|
127
|
+
const command = snapshotClosedRecord(value);
|
|
128
|
+
if (command?.kind === "package") {
|
|
129
|
+
return Object.keys(command).length === 1 ? DEFAULT_JSCPD_COMMAND : undefined;
|
|
130
|
+
}
|
|
131
|
+
if (command?.kind !== "custom") return undefined;
|
|
132
|
+
const custom = snapshotPolicyRecord(command, { required: ["executable", "kind"] });
|
|
133
|
+
if (custom === undefined || custom.kind !== "custom" || !nonEmptyString(custom.executable)) {
|
|
134
|
+
return undefined;
|
|
135
|
+
}
|
|
136
|
+
return Object.freeze({ executable: custom.executable, kind: "custom" });
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
function snapshotPolicyRecord(
|
|
140
|
+
value: unknown,
|
|
141
|
+
keys: PolicyRecordKeys
|
|
142
|
+
): Readonly<Record<string, unknown>> | undefined {
|
|
143
|
+
const record = snapshotClosedRecord(value);
|
|
144
|
+
if (
|
|
145
|
+
record === undefined ||
|
|
146
|
+
!hasRequiredAndOptionalRecordKeys(record, {
|
|
147
|
+
optional: keys.optional ?? [],
|
|
148
|
+
required: keys.required ?? []
|
|
149
|
+
})
|
|
150
|
+
) {
|
|
151
|
+
return undefined;
|
|
152
|
+
}
|
|
153
|
+
return record;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
function positiveSafeInteger(value: unknown): value is number {
|
|
157
|
+
return typeof value === "number" && Number.isSafeInteger(value) && value > 0;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
function nonEmptyString(value: unknown): value is string {
|
|
161
|
+
return typeof value === "string" && value.length > 0;
|
|
162
|
+
}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { 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
|
+
|
|
5
|
+
function exactRecord(
|
|
6
|
+
value: unknown,
|
|
7
|
+
keys: readonly string[]
|
|
8
|
+
): Readonly<Record<string, unknown>> | undefined {
|
|
9
|
+
const record = snapshotClosedRecord(value);
|
|
10
|
+
return record !== undefined &&
|
|
11
|
+
Object.keys(record).length === keys.length &&
|
|
12
|
+
keys.every((key) => Object.hasOwn(record, key))
|
|
13
|
+
? record
|
|
14
|
+
: undefined;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
function positiveSafeInteger(value: unknown): value is number {
|
|
18
|
+
return typeof value === "number" && Number.isSafeInteger(value) && value > 0;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function nonEmptyString(value: unknown): value is string {
|
|
22
|
+
return typeof value === "string" && value.length > 0;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export function validResolvedDuplicateDetectionOptions(value: object): boolean {
|
|
26
|
+
const options = exactRecord(value, ["cache", "codeAreas", "scanner"]);
|
|
27
|
+
return (
|
|
28
|
+
options !== undefined &&
|
|
29
|
+
validDuplicateCache(options.cache) &&
|
|
30
|
+
validDuplicateCodeAreas(options.codeAreas) &&
|
|
31
|
+
validDuplicateDetectionScanner(options.scanner)
|
|
32
|
+
);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
function validDuplicateCodeAreas(value: unknown): boolean {
|
|
36
|
+
const areas = snapshotClosedRecord(value);
|
|
37
|
+
if (areas === undefined || Object.keys(areas).length === 0) return false;
|
|
38
|
+
return Object.entries(areas).every(([areaId, candidate]) => {
|
|
39
|
+
const area = exactRecord(candidate, [
|
|
40
|
+
"files",
|
|
41
|
+
"findingPolicy",
|
|
42
|
+
"minimumLines",
|
|
43
|
+
"minimumTokens"
|
|
44
|
+
]);
|
|
45
|
+
return (
|
|
46
|
+
nonEmptyString(areaId) &&
|
|
47
|
+
area !== undefined &&
|
|
48
|
+
validProjectFileSelection(area.files) &&
|
|
49
|
+
validFindingPolicy(area.findingPolicy) &&
|
|
50
|
+
positiveSafeInteger(area.minimumLines) &&
|
|
51
|
+
positiveSafeInteger(area.minimumTokens)
|
|
52
|
+
);
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
function validDuplicateDetectionScanner(value: unknown): boolean {
|
|
57
|
+
const scanner = exactRecord(value, ["command"]);
|
|
58
|
+
return scanner !== undefined && validJscpdCommand(scanner.command);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
function validJscpdCommand(value: unknown): boolean {
|
|
62
|
+
const record = snapshotClosedRecord(value);
|
|
63
|
+
if (record?.kind === "package") {
|
|
64
|
+
return Object.keys(record).length === 1;
|
|
65
|
+
}
|
|
66
|
+
const command = exactRecord(value, ["executable", "kind"]);
|
|
67
|
+
return command?.kind === "custom" && nonEmptyString(command.executable);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
function validDuplicateCache(value: unknown): boolean {
|
|
71
|
+
const cache = exactRecord(value, ["directory", "enabled"]);
|
|
72
|
+
return (
|
|
73
|
+
cache !== undefined && nonEmptyString(cache.directory) && typeof cache.enabled === "boolean"
|
|
74
|
+
);
|
|
75
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
ProjectFileSelection,
|
|
3
|
+
ProjectFileSelectionOptions
|
|
4
|
+
} from "../project-files/configuration.ts";
|
|
5
|
+
import type { FindingPolicy } from "../code-quality-findings/policy.ts";
|
|
6
|
+
|
|
7
|
+
export type DuplicateDetectionScannerCommand =
|
|
8
|
+
/** 使用随 `@zxyycom/vibe-check` 安装的 jscpd。 */
|
|
9
|
+
| Readonly<{ readonly kind: "package" }>
|
|
10
|
+
/** 显式授权另一个 jscpd 命令。 */
|
|
11
|
+
| Readonly<{
|
|
12
|
+
/** 项目已授权且直接接受 jscpd CLI 参数的非空命令。 */
|
|
13
|
+
readonly executable: string;
|
|
14
|
+
readonly kind: "custom";
|
|
15
|
+
}>;
|
|
16
|
+
|
|
17
|
+
/** `duplicateDetection` 构造函数可省略的缓存策略。 */
|
|
18
|
+
export interface DuplicateDetectionCacheOptions {
|
|
19
|
+
/** 省略时为 `.cache/vibe-check`;相对路径以项目根目录解析。 */
|
|
20
|
+
readonly directory?: string;
|
|
21
|
+
/** 省略时启用。 */
|
|
22
|
+
readonly enabled?: boolean;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/** `duplicateDetection` 构造函数可省略的 scanner 策略。 */
|
|
26
|
+
export interface DuplicateDetectionScannerOptions {
|
|
27
|
+
/** 省略时使用随 `@zxyycom/vibe-check` 安装的 jscpd。 */
|
|
28
|
+
readonly command?: DuplicateDetectionScannerCommand;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/** 重复代码区域可省略并由构造函数补齐的文件策略。 */
|
|
32
|
+
export type DuplicateDetectionFileOptions = ProjectFileSelectionOptions;
|
|
33
|
+
|
|
34
|
+
/** 可独立选择文件、阈值和 finding policy 的重复代码区域。 */
|
|
35
|
+
export interface DuplicateDetectionCodeAreaOptions {
|
|
36
|
+
/** 显式区域必须声明本字段;其中各子字段可省略并使用 package 默认值。 */
|
|
37
|
+
readonly files: DuplicateDetectionFileOptions;
|
|
38
|
+
/** 省略时继承顶层 `findingPolicy`。 */
|
|
39
|
+
readonly findingPolicy?: FindingPolicy;
|
|
40
|
+
/** 省略时为 `4`。 */
|
|
41
|
+
readonly minimumLines?: number;
|
|
42
|
+
/** 省略时为 `100`。 */
|
|
43
|
+
readonly minimumTokens?: number;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/** `duplicateDetection(options?)` 接受并补齐默认值的公开策略。 */
|
|
47
|
+
export interface DuplicateDetectionOptions {
|
|
48
|
+
/** 省略时建立默认 `project` 区域;显式映射必须非空。 */
|
|
49
|
+
readonly codeAreas?: Readonly<Record<string, DuplicateDetectionCodeAreaOptions>>;
|
|
50
|
+
readonly cache?: DuplicateDetectionCacheOptions;
|
|
51
|
+
/** 省略时为 `non-blocking`;区域可局部覆盖。 */
|
|
52
|
+
readonly findingPolicy?: FindingPolicy;
|
|
53
|
+
readonly scanner?: DuplicateDetectionScannerOptions;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/** 构造函数生成并由 Check preflight/execution 消费的完整 options。 */
|
|
57
|
+
export interface ResolvedDuplicateDetectionOptions {
|
|
58
|
+
readonly cache: Readonly<{ readonly directory: string; readonly enabled: boolean }>;
|
|
59
|
+
readonly codeAreas: Readonly<Record<string, ResolvedDuplicateDetectionCodeAreaOptions>>;
|
|
60
|
+
readonly scanner: ResolvedDuplicateDetectionScannerOptions;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export interface ResolvedDuplicateDetectionCodeAreaOptions {
|
|
64
|
+
readonly files: ProjectFileSelection;
|
|
65
|
+
readonly findingPolicy: FindingPolicy;
|
|
66
|
+
readonly minimumLines: number;
|
|
67
|
+
readonly minimumTokens: number;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export interface ResolvedDuplicateDetectionScannerOptions {
|
|
71
|
+
readonly command: DuplicateDetectionScannerCommand;
|
|
72
|
+
}
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
import { createHash } from "node:crypto";
|
|
2
|
+
|
|
3
|
+
import { canonicalJsonBytes } from "../../data-boundary/canonical-data.ts";
|
|
4
|
+
import { isBlockingFinding, type FindingPolicy } from "../code-quality-findings/policy.ts";
|
|
5
|
+
import type { DuplicateCodeFragment, DuplicateCodeLocation } from "./measurement-model.ts";
|
|
6
|
+
import type { ResolvedDuplicateDetectionOptions } from "./options.ts";
|
|
7
|
+
|
|
8
|
+
/** 一条可信重复片段 supplemental Record 的 data。 */
|
|
9
|
+
export type DuplicateDetectionRecordData = Readonly<{
|
|
10
|
+
readonly blocking: boolean;
|
|
11
|
+
readonly codeAreas: readonly string[];
|
|
12
|
+
readonly lineCount: number;
|
|
13
|
+
readonly locations: readonly Readonly<{
|
|
14
|
+
readonly endLine: number;
|
|
15
|
+
readonly path: string;
|
|
16
|
+
readonly startLine: number;
|
|
17
|
+
}>[];
|
|
18
|
+
readonly metric: "duplicate-tokens";
|
|
19
|
+
readonly tokenCount: number;
|
|
20
|
+
}>;
|
|
21
|
+
|
|
22
|
+
export interface DuplicateRecordCandidate {
|
|
23
|
+
readonly data: DuplicateDetectionRecordData;
|
|
24
|
+
readonly id: string;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/** Builds Check-owned supplemental facts without adding a Product record catalog. */
|
|
28
|
+
export function buildDuplicateRecordCandidates(
|
|
29
|
+
fragments: readonly DuplicateCodeFragment[],
|
|
30
|
+
codeAreas: ResolvedDuplicateDetectionOptions["codeAreas"]
|
|
31
|
+
): readonly DuplicateRecordCandidate[] | undefined {
|
|
32
|
+
const ids = duplicateIdsInOrder(fragments);
|
|
33
|
+
if (ids === undefined) return undefined;
|
|
34
|
+
|
|
35
|
+
const candidates: DuplicateRecordCandidate[] = [];
|
|
36
|
+
for (const [index, fragment] of fragments.entries()) {
|
|
37
|
+
const candidate = createDuplicateRecordCandidate(fragment, ids[index], codeAreas);
|
|
38
|
+
if (candidate === undefined) return undefined;
|
|
39
|
+
candidates.push(candidate);
|
|
40
|
+
}
|
|
41
|
+
candidates.sort((left, right) => compareText(left.id, right.id));
|
|
42
|
+
return Object.freeze(candidates);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
function createDuplicateRecordCandidate(
|
|
46
|
+
fragment: DuplicateCodeFragment,
|
|
47
|
+
id: string | undefined,
|
|
48
|
+
configuredAreas: ResolvedDuplicateDetectionOptions["codeAreas"]
|
|
49
|
+
): DuplicateRecordCandidate | undefined {
|
|
50
|
+
if (!isValidDuplicateFragment(fragment) || id === undefined) return undefined;
|
|
51
|
+
|
|
52
|
+
const locations = sortedLocations(fragment.locations);
|
|
53
|
+
const codeAreas = uniqueSorted(fragment.codeAreas);
|
|
54
|
+
if (codeAreas.length === 0 || !sameStrings(codeAreas, fragment.codeAreas)) return undefined;
|
|
55
|
+
const findingPolicies: FindingPolicy[] = [];
|
|
56
|
+
for (const areaId of codeAreas) {
|
|
57
|
+
const area = configuredAreas[areaId];
|
|
58
|
+
if (area === undefined) return undefined;
|
|
59
|
+
findingPolicies.push(area.findingPolicy);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
return Object.freeze({
|
|
63
|
+
id,
|
|
64
|
+
data: Object.freeze({
|
|
65
|
+
blocking: isBlockingFinding(findingPolicies),
|
|
66
|
+
codeAreas: Object.freeze(codeAreas),
|
|
67
|
+
lineCount: fragment.lineCount,
|
|
68
|
+
locations: Object.freeze(
|
|
69
|
+
locations.map((location) =>
|
|
70
|
+
Object.freeze({
|
|
71
|
+
endLine: location.endLine,
|
|
72
|
+
path: location.path,
|
|
73
|
+
startLine: location.startLine
|
|
74
|
+
})
|
|
75
|
+
)
|
|
76
|
+
),
|
|
77
|
+
metric: "duplicate-tokens",
|
|
78
|
+
tokenCount: fragment.tokenCount
|
|
79
|
+
})
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export function isValidDuplicateFragment(fragment: DuplicateCodeFragment): boolean {
|
|
84
|
+
return (
|
|
85
|
+
hasValidFragmentMeasurements(fragment) &&
|
|
86
|
+
Array.isArray(fragment.locations) &&
|
|
87
|
+
fragment.locations.length >= 2 &&
|
|
88
|
+
fragment.locations.every(isValidLocation) &&
|
|
89
|
+
Array.isArray(fragment.codeAreas) &&
|
|
90
|
+
fragment.codeAreas.every(nonEmptyString)
|
|
91
|
+
);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
function hasValidFragmentMeasurements(fragment: DuplicateCodeFragment): boolean {
|
|
95
|
+
return (
|
|
96
|
+
nonNegativeSafeInteger(fragment.id) &&
|
|
97
|
+
nonNegativeSafeInteger(fragment.lineCount) &&
|
|
98
|
+
nonNegativeSafeInteger(fragment.tokenCount)
|
|
99
|
+
);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
function nonNegativeSafeInteger(value: number): boolean {
|
|
103
|
+
return Number.isSafeInteger(value) && value >= 0;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
function isValidLocation(location: DuplicateCodeLocation): boolean {
|
|
107
|
+
const validPath = typeof location.path === "string" && location.path.length > 0;
|
|
108
|
+
const validLines =
|
|
109
|
+
Number.isSafeInteger(location.startLine) &&
|
|
110
|
+
location.startLine >= 1 &&
|
|
111
|
+
Number.isSafeInteger(location.endLine) &&
|
|
112
|
+
location.endLine >= location.startLine;
|
|
113
|
+
return validPath && validLines;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
function nonEmptyString(value: unknown): value is string {
|
|
117
|
+
return typeof value === "string" && value.length > 0;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
function sameStrings(left: readonly string[], right: readonly string[]): boolean {
|
|
121
|
+
return left.length === right.length && left.every((value, index) => value === right[index]);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
function duplicateIdsInOrder(
|
|
125
|
+
fragments: readonly DuplicateCodeFragment[]
|
|
126
|
+
): readonly string[] | undefined {
|
|
127
|
+
const occurrences = new Map<string, number>();
|
|
128
|
+
const ids: string[] = [];
|
|
129
|
+
for (const fragment of fragments) {
|
|
130
|
+
if (!isValidDuplicateFragment(fragment)) return undefined;
|
|
131
|
+
const fingerprint = duplicateFingerprint(fragment);
|
|
132
|
+
const occurrence = (occurrences.get(fingerprint) ?? 0) + 1;
|
|
133
|
+
occurrences.set(fingerprint, occurrence);
|
|
134
|
+
ids.push(`duplicate-fragment/v1/sha256:${fingerprint}/occurrence:${occurrence}`);
|
|
135
|
+
}
|
|
136
|
+
return Object.freeze(ids);
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
function duplicateFingerprint(fragment: DuplicateCodeFragment): string {
|
|
140
|
+
return createHash("sha256")
|
|
141
|
+
.update(
|
|
142
|
+
canonicalJsonBytes({
|
|
143
|
+
lineCount: fragment.lineCount,
|
|
144
|
+
paths: uniqueSorted(fragment.locations.map((location) => location.path)),
|
|
145
|
+
tokenCount: fragment.tokenCount
|
|
146
|
+
})
|
|
147
|
+
)
|
|
148
|
+
.digest("hex");
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
function sortedLocations(locations: readonly DuplicateCodeLocation[]): DuplicateCodeLocation[] {
|
|
152
|
+
return [...locations].sort((left, right) =>
|
|
153
|
+
compareText(locationSortKey(left), locationSortKey(right))
|
|
154
|
+
);
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
function locationSortKey(location: DuplicateCodeLocation): string {
|
|
158
|
+
const startLine = String(location.startLine).padStart(12, "0");
|
|
159
|
+
const endLine = String(location.endLine).padStart(12, "0");
|
|
160
|
+
return `${location.path}\u0000${startLine}\u0000${endLine}`;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
function uniqueSorted(values: readonly string[]): string[] {
|
|
164
|
+
return [...new Set(values)].sort(compareText);
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
function compareText(left: string, right: string): number {
|
|
168
|
+
if (left < right) return -1;
|
|
169
|
+
if (left > right) return 1;
|
|
170
|
+
return 0;
|
|
171
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { defineCheck, type TypedCheckWithOptions } from "../../check/check.ts";
|
|
2
|
+
import { FILE_METRICS_CHECK_DEFINITION, executeFileMetrics } from "./execution.ts";
|
|
3
|
+
import { parseFileMetricsData } from "./final-data.ts";
|
|
4
|
+
import type { FileMetricsOptions, ResolvedFileMetricsOptions } from "./options.ts";
|
|
5
|
+
import { resolveFileMetricsOptions } from "./options-resolution.ts";
|
|
6
|
+
import { isValidResolvedFileMetricsOptions } from "./options-validation.ts";
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* 使用可省略的区域、代码行与 scanner policy 构造一个完整 file-metrics Check。
|
|
10
|
+
*
|
|
11
|
+
* @param options - 省略字段由 package 补齐;显式 files 数组作为对应字段的完整替换值。
|
|
12
|
+
* @returns 固定 `file-metrics` identity、完整冻结 options、preflight 与 execution。
|
|
13
|
+
* @throws {TypeError} input 含未知字段、空 area、非法代码行 policy、非法 waiver 或空 executable 时抛出。
|
|
14
|
+
*/
|
|
15
|
+
export function fileMetrics(
|
|
16
|
+
options: FileMetricsOptions = {}
|
|
17
|
+
): TypedCheckWithOptions<"file-metrics", ResolvedFileMetricsOptions, typeof parseFileMetricsData> {
|
|
18
|
+
const resolvedOptions = resolveFileMetricsOptions(options);
|
|
19
|
+
if (resolvedOptions === undefined) {
|
|
20
|
+
throw new TypeError(
|
|
21
|
+
"fileMetrics options must match the documented closed { codeAreas?, findingPolicy?, findingWaivers?, scanner? } constructor policy"
|
|
22
|
+
);
|
|
23
|
+
}
|
|
24
|
+
return defineCheck({
|
|
25
|
+
...FILE_METRICS_CHECK_DEFINITION,
|
|
26
|
+
execution: executeFileMetrics,
|
|
27
|
+
parseData: parseFileMetricsData,
|
|
28
|
+
preflight: (preparedOptions) =>
|
|
29
|
+
isValidResolvedFileMetricsOptions(preparedOptions)
|
|
30
|
+
? { status: "success", preparedOptions }
|
|
31
|
+
: {
|
|
32
|
+
status: "failure",
|
|
33
|
+
action: "block",
|
|
34
|
+
reason: { code: "invalid-options" },
|
|
35
|
+
messages: [
|
|
36
|
+
{
|
|
37
|
+
code: "invalid-options",
|
|
38
|
+
level: "error",
|
|
39
|
+
message:
|
|
40
|
+
"fileMetrics options are invalid; recreate the Check with fileMetrics(options) or restore its complete resolved options."
|
|
41
|
+
}
|
|
42
|
+
]
|
|
43
|
+
},
|
|
44
|
+
options: resolvedOptions
|
|
45
|
+
});
|
|
46
|
+
}
|