@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,179 @@
|
|
|
1
|
+
import type { FunctionMetric } from "../measurement-model.ts";
|
|
2
|
+
import type { ExactInputMeasurement } from "../../project-files/exact-input-measurement.ts";
|
|
3
|
+
import { errorMessage } from "../../host-environment/error-message.ts";
|
|
4
|
+
import { parseCsvRows } from "./csv.ts";
|
|
5
|
+
import { normalizeScannerReportedPath } from "../../project-files/reported-path.ts";
|
|
6
|
+
|
|
7
|
+
export type LizardParseResult =
|
|
8
|
+
| {
|
|
9
|
+
readonly measurements: readonly ExactInputMeasurement<FunctionMetric>[];
|
|
10
|
+
readonly ok: true;
|
|
11
|
+
}
|
|
12
|
+
| {
|
|
13
|
+
readonly error: string;
|
|
14
|
+
readonly ok: false;
|
|
15
|
+
readonly reason: "invalid-result";
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
const LIZARD_COLUMNS = {
|
|
19
|
+
nloc: 0,
|
|
20
|
+
ccn: 1,
|
|
21
|
+
parameterCount: 3,
|
|
22
|
+
filePath: 6,
|
|
23
|
+
functionName: 7,
|
|
24
|
+
startLine: 9,
|
|
25
|
+
endLine: 10
|
|
26
|
+
} as const;
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* 将 Lizard CSV 输出解析为 FunctionMetric 数组。
|
|
30
|
+
*
|
|
31
|
+
* Lizard 1.23 CSV 列(--csv):
|
|
32
|
+
* NLOC,CCN,token count,parameter count,length,location,file path,function name,long name,start line,end line
|
|
33
|
+
*/
|
|
34
|
+
export function parseLizardCSV(csv: string, cwd: string): LizardParseResult {
|
|
35
|
+
try {
|
|
36
|
+
const measurements: ExactInputMeasurement<FunctionMetric>[] = [];
|
|
37
|
+
|
|
38
|
+
for (const [index, row] of lizardDataRows(parseCsvRows(csv)).entries()) {
|
|
39
|
+
const measurement = functionMetricFromLizardRow(row, cwd);
|
|
40
|
+
if (!measurement) {
|
|
41
|
+
throw new Error(`invalid Lizard 1.23 CSV row ${index + 1}`);
|
|
42
|
+
}
|
|
43
|
+
measurements.push(measurement);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
measurements.sort((a, b) => compareFunctionMetrics(a.payload, b.payload));
|
|
47
|
+
|
|
48
|
+
return { ok: true, measurements };
|
|
49
|
+
} catch (error: unknown) {
|
|
50
|
+
return {
|
|
51
|
+
ok: false,
|
|
52
|
+
error: `Failed to parse lizard CSV: ${errorMessage(error)}`,
|
|
53
|
+
reason: "invalid-result"
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
function lizardDataRows(rows: string[][]): string[][] {
|
|
59
|
+
const header = rows[0] ?? [];
|
|
60
|
+
return isLizard123Header(header) ? rows.slice(1) : rows;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
function functionMetricFromLizardRow(
|
|
64
|
+
parts: string[],
|
|
65
|
+
cwd: string
|
|
66
|
+
): ExactInputMeasurement<FunctionMetric> | null {
|
|
67
|
+
if (parts.length < 11) {
|
|
68
|
+
return null;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
const values = parseLizardMetricValues(parts);
|
|
72
|
+
if (!values) {
|
|
73
|
+
return null;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
const filePath = (parts[LIZARD_COLUMNS.filePath] ?? "").trim();
|
|
77
|
+
if (filePath.length === 0 || values.endLine < values.startLine) {
|
|
78
|
+
return null;
|
|
79
|
+
}
|
|
80
|
+
const sourcePath = normalizeScannerReportedPath(filePath, cwd);
|
|
81
|
+
|
|
82
|
+
return {
|
|
83
|
+
sourcePaths: [sourcePath],
|
|
84
|
+
payload: {
|
|
85
|
+
name: parts[LIZARD_COLUMNS.functionName] || "unknown",
|
|
86
|
+
file: sourcePath,
|
|
87
|
+
startLine: values.startLine,
|
|
88
|
+
endLine: values.endLine,
|
|
89
|
+
lines: values.nloc,
|
|
90
|
+
parameterCount: values.parameterCount,
|
|
91
|
+
cyclomaticComplexity: {
|
|
92
|
+
value: values.ccn,
|
|
93
|
+
source: "lizard"
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
interface LizardMetricValues {
|
|
100
|
+
readonly ccn: number | null;
|
|
101
|
+
readonly endLine: number;
|
|
102
|
+
readonly nloc: number;
|
|
103
|
+
readonly parameterCount: number;
|
|
104
|
+
readonly startLine: number;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
function parseLizardMetricValues(parts: string[]): LizardMetricValues | null {
|
|
108
|
+
const ccnText = parts[LIZARD_COLUMNS.ccn].trim();
|
|
109
|
+
const ccn = ccnText === "" ? null : parseInteger(ccnText, 0);
|
|
110
|
+
const endLine = parseInteger(parts[LIZARD_COLUMNS.endLine], 1);
|
|
111
|
+
const nloc = parseInteger(parts[LIZARD_COLUMNS.nloc], 0);
|
|
112
|
+
const parameterCount = parseInteger(parts[LIZARD_COLUMNS.parameterCount], 0);
|
|
113
|
+
const startLine = parseInteger(parts[LIZARD_COLUMNS.startLine], 1);
|
|
114
|
+
|
|
115
|
+
if (
|
|
116
|
+
(ccnText !== "" && ccn === null) ||
|
|
117
|
+
endLine === null ||
|
|
118
|
+
nloc === null ||
|
|
119
|
+
parameterCount === null ||
|
|
120
|
+
startLine === null
|
|
121
|
+
) {
|
|
122
|
+
return null;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
return {
|
|
126
|
+
ccn,
|
|
127
|
+
endLine,
|
|
128
|
+
nloc,
|
|
129
|
+
parameterCount,
|
|
130
|
+
startLine
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
function compareFunctionMetrics(a: FunctionMetric, b: FunctionMetric): number {
|
|
135
|
+
for (const comparison of functionMetricComparisons(a, b)) {
|
|
136
|
+
if (comparison !== 0) return comparison;
|
|
137
|
+
}
|
|
138
|
+
return 0;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
function functionMetricComparisons(a: FunctionMetric, b: FunctionMetric): readonly number[] {
|
|
142
|
+
return [
|
|
143
|
+
compareText(a.file, b.file),
|
|
144
|
+
a.startLine - b.startLine,
|
|
145
|
+
a.endLine - b.endLine,
|
|
146
|
+
compareText(a.name, b.name),
|
|
147
|
+
a.lines - b.lines,
|
|
148
|
+
(a.cyclomaticComplexity.value ?? -1) - (b.cyclomaticComplexity.value ?? -1),
|
|
149
|
+
a.parameterCount - b.parameterCount
|
|
150
|
+
];
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
function compareText(left: string, right: string): number {
|
|
154
|
+
if (left < right) return -1;
|
|
155
|
+
if (left > right) return 1;
|
|
156
|
+
return 0;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
function parseInteger(value: string | undefined, minimum: number): number | null {
|
|
160
|
+
const text = (value ?? "").trim();
|
|
161
|
+
if (!/^\d+$/.test(text)) {
|
|
162
|
+
return null;
|
|
163
|
+
}
|
|
164
|
+
const parsed = Number(text);
|
|
165
|
+
return Number.isSafeInteger(parsed) && parsed >= minimum ? parsed : null;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
function isLizard123Header(parts: string[]): boolean {
|
|
169
|
+
return (
|
|
170
|
+
parts.length >= 11 &&
|
|
171
|
+
parts[LIZARD_COLUMNS.nloc] === "NLOC" &&
|
|
172
|
+
parts[LIZARD_COLUMNS.ccn] === "CCN" &&
|
|
173
|
+
parts[LIZARD_COLUMNS.parameterCount] === "parameter count" &&
|
|
174
|
+
parts[LIZARD_COLUMNS.filePath] === "file path" &&
|
|
175
|
+
parts[LIZARD_COLUMNS.functionName] === "function name" &&
|
|
176
|
+
parts[LIZARD_COLUMNS.startLine] === "start line" &&
|
|
177
|
+
parts[LIZARD_COLUMNS.endLine] === "end line"
|
|
178
|
+
);
|
|
179
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/** 对 approved exact paths 执行 adapter-owned Lizard CSV 协议。 */
|
|
2
|
+
|
|
3
|
+
import { errorMessage } from "../../host-environment/error-message.ts";
|
|
4
|
+
import { runProcessSync } from "../../host-environment/process/command.ts";
|
|
5
|
+
import type { ResolvedFunctionMetricsScannerOptions } from "../options.ts";
|
|
6
|
+
import { parseLizardCSV, type LizardParseResult } from "./parser.ts";
|
|
7
|
+
|
|
8
|
+
export type LizardScanResult =
|
|
9
|
+
| LizardParseResult
|
|
10
|
+
| Readonly<{
|
|
11
|
+
error: string;
|
|
12
|
+
ok: false;
|
|
13
|
+
reason: "execution";
|
|
14
|
+
}>;
|
|
15
|
+
|
|
16
|
+
interface ScanWithLizardOptions {
|
|
17
|
+
readonly cwd: string;
|
|
18
|
+
readonly dependency: ResolvedFunctionMetricsScannerOptions;
|
|
19
|
+
readonly files: readonly string[];
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export function scanWithLizard({
|
|
23
|
+
files,
|
|
24
|
+
cwd,
|
|
25
|
+
dependency
|
|
26
|
+
}: ScanWithLizardOptions): LizardScanResult {
|
|
27
|
+
try {
|
|
28
|
+
if (files.length === 0) return { ok: true, measurements: [] };
|
|
29
|
+
|
|
30
|
+
const child = runProcessSync({
|
|
31
|
+
args: [...files, "--csv"],
|
|
32
|
+
command: dependency.executable,
|
|
33
|
+
cwd,
|
|
34
|
+
timeout: 300_000
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
if (child.signal !== null) {
|
|
38
|
+
return failedLizardScan(
|
|
39
|
+
`lizard signal ${child.signal}: ${(child.stderr || child.stdout || "no output").trim()}`
|
|
40
|
+
);
|
|
41
|
+
}
|
|
42
|
+
if (child.error) {
|
|
43
|
+
return failedLizardScan(`lizard process error: ${child.error.message}`);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
if (child.status !== 0) {
|
|
47
|
+
const stderr = (child.stderr || "").trim();
|
|
48
|
+
const stdout = (child.stdout || "").trim();
|
|
49
|
+
return failedLizardScan(
|
|
50
|
+
`lizard ${child.status === null ? "invalid process state" : `exit ${child.status}`}: ${stderr || stdout || "no output"}`
|
|
51
|
+
);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
return parseLizardCSV(child.stdout || "", cwd);
|
|
55
|
+
} catch (error: unknown) {
|
|
56
|
+
return failedLizardScan(`lizard adapter error: ${errorMessage(error)}`);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
function failedLizardScan(error: string): LizardScanResult {
|
|
61
|
+
return Object.freeze({ error, ok: false, reason: "execution" });
|
|
62
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { FindingPolicy } from "../code-quality-findings/policy.ts";
|
|
2
|
+
import type { ResolvedFunctionMetricsLimits } from "./options.ts";
|
|
3
|
+
|
|
4
|
+
export interface MetricValue {
|
|
5
|
+
readonly source: "lizard";
|
|
6
|
+
readonly value: number | null;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export interface FunctionMetric {
|
|
10
|
+
readonly cyclomaticComplexity: MetricValue;
|
|
11
|
+
readonly endLine: number;
|
|
12
|
+
readonly file: string;
|
|
13
|
+
readonly lines: number;
|
|
14
|
+
readonly name: string;
|
|
15
|
+
readonly parameterCount: number;
|
|
16
|
+
readonly startLine: number;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export interface FunctionMetricsAreaInput {
|
|
20
|
+
readonly approvedExactPaths: readonly string[];
|
|
21
|
+
readonly codeArea: string;
|
|
22
|
+
readonly findingPolicy: FindingPolicy;
|
|
23
|
+
readonly limits: ResolvedFunctionMetricsLimits;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export interface FunctionMetricsExactInputSet {
|
|
27
|
+
readonly approvedExactPaths: readonly string[];
|
|
28
|
+
readonly areas: readonly FunctionMetricsAreaInput[];
|
|
29
|
+
readonly rootDir: string;
|
|
30
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { acceptExactInputMeasurements } from "../project-files/exact-input-measurement.ts";
|
|
2
|
+
import { checkLizard } from "./lizard/availability.ts";
|
|
3
|
+
import { scanWithLizard } from "./lizard/scanner.ts";
|
|
4
|
+
import type { FunctionMetric, FunctionMetricsExactInputSet } from "./measurement-model.ts";
|
|
5
|
+
import type { ResolvedFunctionMetricsScannerOptions } from "./options.ts";
|
|
6
|
+
|
|
7
|
+
export type FunctionMeasurementResult = Readonly<
|
|
8
|
+
| { kind: "cancelled" }
|
|
9
|
+
| { kind: "complete"; metrics: readonly FunctionMetric[] }
|
|
10
|
+
| { kind: "execution-failed" }
|
|
11
|
+
| { kind: "invalid-result" }
|
|
12
|
+
| { kind: "unavailable" }
|
|
13
|
+
>;
|
|
14
|
+
|
|
15
|
+
interface FunctionMeasurementInput {
|
|
16
|
+
readonly dependency: ResolvedFunctionMetricsScannerOptions;
|
|
17
|
+
readonly input: FunctionMetricsExactInputSet;
|
|
18
|
+
readonly signal: AbortSignal;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export async function measureFunctionMetrics({
|
|
22
|
+
dependency,
|
|
23
|
+
input,
|
|
24
|
+
signal
|
|
25
|
+
}: FunctionMeasurementInput): Promise<FunctionMeasurementResult> {
|
|
26
|
+
if (signal.aborted) return Object.freeze({ kind: "cancelled" });
|
|
27
|
+
if (input.approvedExactPaths.length === 0) {
|
|
28
|
+
return Object.freeze({ kind: "complete", metrics: Object.freeze([]) });
|
|
29
|
+
}
|
|
30
|
+
const availability = await checkLizard(input.rootDir, dependency);
|
|
31
|
+
if (signal.aborted) return Object.freeze({ kind: "cancelled" });
|
|
32
|
+
if (!availability.available) {
|
|
33
|
+
return Object.freeze({ kind: "unavailable" });
|
|
34
|
+
}
|
|
35
|
+
const measurement = runFunctionScanner(input, dependency);
|
|
36
|
+
return signal.aborted ? Object.freeze({ kind: "cancelled" }) : measurement;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
function runFunctionScanner(
|
|
40
|
+
input: FunctionMetricsExactInputSet,
|
|
41
|
+
dependency: ResolvedFunctionMetricsScannerOptions
|
|
42
|
+
): FunctionMeasurementResult {
|
|
43
|
+
const result = scanWithLizard({
|
|
44
|
+
cwd: input.rootDir,
|
|
45
|
+
dependency,
|
|
46
|
+
files: input.approvedExactPaths
|
|
47
|
+
});
|
|
48
|
+
if (!result.ok) {
|
|
49
|
+
return Object.freeze({
|
|
50
|
+
kind: result.reason === "execution" ? "execution-failed" : "invalid-result"
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
const accepted = acceptExactInputMeasurements(result.measurements, input.approvedExactPaths);
|
|
54
|
+
return accepted.ok
|
|
55
|
+
? Object.freeze({ kind: "complete", metrics: Object.freeze([...accepted.payloads]) })
|
|
56
|
+
: Object.freeze({ kind: "invalid-result" });
|
|
57
|
+
}
|
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
import {
|
|
2
|
+
hasRequiredAndOptionalRecordKeys,
|
|
3
|
+
snapshotClosedRecord
|
|
4
|
+
} from "../../data-boundary/closed-values.ts";
|
|
5
|
+
import {
|
|
6
|
+
defaultProjectFileSelection,
|
|
7
|
+
resolveProjectFileSelection,
|
|
8
|
+
snapshotProjectFileSelection
|
|
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 {
|
|
16
|
+
type ResolvedFunctionMetricsCodeAreaOptions,
|
|
17
|
+
type ResolvedFunctionMetricsLimits,
|
|
18
|
+
type ResolvedFunctionMetricsOptions
|
|
19
|
+
} from "./options.ts";
|
|
20
|
+
import { validResolvedFunctionMetricsOptions } from "./options-validation.ts";
|
|
21
|
+
import { LIZARD_SUPPORTED_FILE_GLOBS } from "./target-files.ts";
|
|
22
|
+
|
|
23
|
+
const DEFAULT_LIZARD_EXECUTABLE = "lizard";
|
|
24
|
+
const DEFAULT_CODE_LINE_MAXIMUM = 60;
|
|
25
|
+
const DEFAULT_LOW_COMPLEXITY_CODE_LINE_MAXIMUM = 180;
|
|
26
|
+
const DEFAULT_LOW_COMPLEXITY_BELOW = 6;
|
|
27
|
+
const DEFAULT_CYCLOMATIC_COMPLEXITY_MAXIMUM = 12;
|
|
28
|
+
const DEFAULT_PARAMETER_MAXIMUM = 6;
|
|
29
|
+
const DEFAULT_FILES = Object.freeze({
|
|
30
|
+
exclude: defaultProjectFileSelection.exclude,
|
|
31
|
+
include: LIZARD_SUPPORTED_FILE_GLOBS,
|
|
32
|
+
source: defaultProjectFileSelection.source
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
interface PolicyRecordKeys {
|
|
36
|
+
readonly optional?: readonly string[];
|
|
37
|
+
readonly required?: readonly string[];
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/** 校验 constructor input,并物化完整、冻结的 function-metrics options。 */
|
|
41
|
+
export function resolveFunctionMetricsOptions(
|
|
42
|
+
value: unknown
|
|
43
|
+
): ResolvedFunctionMetricsOptions | undefined {
|
|
44
|
+
const input = snapshotPolicyRecord(value, {
|
|
45
|
+
optional: ["codeAreas", "findingPolicy", "scanner"]
|
|
46
|
+
});
|
|
47
|
+
if (input === undefined) return undefined;
|
|
48
|
+
|
|
49
|
+
const findingPolicy = resolveFindingPolicy(input.findingPolicy, DEFAULT_FINDING_POLICY);
|
|
50
|
+
if (findingPolicy === undefined) return undefined;
|
|
51
|
+
const codeAreas = resolveCodeAreas(input.codeAreas, findingPolicy);
|
|
52
|
+
const scanner = resolveScanner(input.scanner);
|
|
53
|
+
if (codeAreas === undefined || scanner === undefined) return undefined;
|
|
54
|
+
|
|
55
|
+
const options = Object.freeze({ codeAreas, scanner });
|
|
56
|
+
return validResolvedFunctionMetricsOptions(options) ? options : undefined;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
function resolveCodeAreas(
|
|
60
|
+
value: unknown,
|
|
61
|
+
defaultFindingPolicy: FindingPolicy
|
|
62
|
+
): ResolvedFunctionMetricsOptions["codeAreas"] | undefined {
|
|
63
|
+
if (value === undefined) {
|
|
64
|
+
return Object.freeze({ project: defaultCodeArea(defaultFindingPolicy) });
|
|
65
|
+
}
|
|
66
|
+
const areas = snapshotClosedRecord(value);
|
|
67
|
+
if (areas === undefined || Object.keys(areas).length === 0) return undefined;
|
|
68
|
+
|
|
69
|
+
const resolvedEntries: Array<readonly [string, ResolvedFunctionMetricsCodeAreaOptions]> = [];
|
|
70
|
+
for (const [areaId, candidate] of Object.entries(areas)) {
|
|
71
|
+
if (!nonEmptyString(areaId)) return undefined;
|
|
72
|
+
const area = resolveCodeArea(candidate, defaultFindingPolicy);
|
|
73
|
+
if (area === undefined) return undefined;
|
|
74
|
+
resolvedEntries.push([areaId, area]);
|
|
75
|
+
}
|
|
76
|
+
return Object.freeze(Object.fromEntries(resolvedEntries));
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
function defaultCodeArea(findingPolicy: FindingPolicy): ResolvedFunctionMetricsCodeAreaOptions {
|
|
80
|
+
return Object.freeze({
|
|
81
|
+
files: snapshotProjectFileSelection(DEFAULT_FILES),
|
|
82
|
+
findingPolicy,
|
|
83
|
+
limits: defaultLimits()
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
function resolveCodeArea(
|
|
88
|
+
value: unknown,
|
|
89
|
+
defaultFindingPolicy: FindingPolicy
|
|
90
|
+
): ResolvedFunctionMetricsCodeAreaOptions | undefined {
|
|
91
|
+
const area = snapshotPolicyRecord(value, {
|
|
92
|
+
optional: ["findingPolicy", "limits"],
|
|
93
|
+
required: ["files"]
|
|
94
|
+
});
|
|
95
|
+
if (area === undefined) return undefined;
|
|
96
|
+
const files = resolveProjectFileSelection(area.files, DEFAULT_FILES);
|
|
97
|
+
const findingPolicy = resolveFindingPolicy(area.findingPolicy, defaultFindingPolicy);
|
|
98
|
+
const limits = resolveLimits(area.limits);
|
|
99
|
+
return files === undefined || findingPolicy === undefined || limits === undefined
|
|
100
|
+
? undefined
|
|
101
|
+
: Object.freeze({ files, findingPolicy, limits });
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
function resolveLimits(value: unknown): ResolvedFunctionMetricsLimits | undefined {
|
|
105
|
+
if (value === undefined) return defaultLimits();
|
|
106
|
+
const limits = snapshotPolicyRecord(value, {
|
|
107
|
+
optional: ["codeLines", "cyclomaticComplexity", "parameters"]
|
|
108
|
+
});
|
|
109
|
+
if (limits === undefined) return undefined;
|
|
110
|
+
const codeLines = resolveCodeLineLimits(limits.codeLines);
|
|
111
|
+
const cyclomaticComplexity = resolveMaximum(
|
|
112
|
+
limits.cyclomaticComplexity,
|
|
113
|
+
DEFAULT_CYCLOMATIC_COMPLEXITY_MAXIMUM
|
|
114
|
+
);
|
|
115
|
+
const parameters = resolveMaximum(limits.parameters, DEFAULT_PARAMETER_MAXIMUM);
|
|
116
|
+
if (codeLines === undefined || cyclomaticComplexity === undefined || parameters === undefined) {
|
|
117
|
+
return undefined;
|
|
118
|
+
}
|
|
119
|
+
return Object.freeze({ codeLines, cyclomaticComplexity, parameters });
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
function resolveCodeLineLimits(
|
|
123
|
+
value: unknown
|
|
124
|
+
): ResolvedFunctionMetricsLimits["codeLines"] | undefined {
|
|
125
|
+
if (value === undefined) return defaultLimits().codeLines;
|
|
126
|
+
const codeLines = snapshotPolicyRecord(value, {
|
|
127
|
+
optional: ["lowComplexityAllowance", "maximum"]
|
|
128
|
+
});
|
|
129
|
+
if (codeLines === undefined) return undefined;
|
|
130
|
+
const maximum = codeLines.maximum ?? DEFAULT_CODE_LINE_MAXIMUM;
|
|
131
|
+
const allowance = resolveLowComplexityAllowance(codeLines.lowComplexityAllowance);
|
|
132
|
+
if (!positiveSafeInteger(maximum) || allowance === undefined || allowance.maximum < maximum) {
|
|
133
|
+
return undefined;
|
|
134
|
+
}
|
|
135
|
+
return Object.freeze({ lowComplexityAllowance: allowance, maximum });
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
function resolveLowComplexityAllowance(
|
|
139
|
+
value: unknown
|
|
140
|
+
): ResolvedFunctionMetricsLimits["codeLines"]["lowComplexityAllowance"] | undefined {
|
|
141
|
+
if (value === undefined) {
|
|
142
|
+
return Object.freeze({
|
|
143
|
+
cyclomaticComplexityBelow: DEFAULT_LOW_COMPLEXITY_BELOW,
|
|
144
|
+
maximum: DEFAULT_LOW_COMPLEXITY_CODE_LINE_MAXIMUM
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
const allowance = snapshotPolicyRecord(value, {
|
|
148
|
+
optional: ["cyclomaticComplexityBelow", "maximum"]
|
|
149
|
+
});
|
|
150
|
+
if (allowance === undefined) return undefined;
|
|
151
|
+
const cyclomaticComplexityBelow =
|
|
152
|
+
allowance.cyclomaticComplexityBelow ?? DEFAULT_LOW_COMPLEXITY_BELOW;
|
|
153
|
+
const maximum = allowance.maximum ?? DEFAULT_LOW_COMPLEXITY_CODE_LINE_MAXIMUM;
|
|
154
|
+
return positiveSafeInteger(cyclomaticComplexityBelow) && positiveSafeInteger(maximum)
|
|
155
|
+
? Object.freeze({ cyclomaticComplexityBelow, maximum })
|
|
156
|
+
: undefined;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
function resolveMaximum(
|
|
160
|
+
value: unknown,
|
|
161
|
+
fallback: number
|
|
162
|
+
): Readonly<{ readonly maximum: number }> | undefined {
|
|
163
|
+
if (value === undefined) return Object.freeze({ maximum: fallback });
|
|
164
|
+
const input = snapshotPolicyRecord(value, { optional: ["maximum"] });
|
|
165
|
+
if (input === undefined) return undefined;
|
|
166
|
+
const maximum = input.maximum ?? fallback;
|
|
167
|
+
return positiveSafeInteger(maximum) ? Object.freeze({ maximum }) : undefined;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
function defaultLimits(): ResolvedFunctionMetricsLimits {
|
|
171
|
+
return Object.freeze({
|
|
172
|
+
codeLines: Object.freeze({
|
|
173
|
+
lowComplexityAllowance: Object.freeze({
|
|
174
|
+
cyclomaticComplexityBelow: DEFAULT_LOW_COMPLEXITY_BELOW,
|
|
175
|
+
maximum: DEFAULT_LOW_COMPLEXITY_CODE_LINE_MAXIMUM
|
|
176
|
+
}),
|
|
177
|
+
maximum: DEFAULT_CODE_LINE_MAXIMUM
|
|
178
|
+
}),
|
|
179
|
+
cyclomaticComplexity: Object.freeze({ maximum: DEFAULT_CYCLOMATIC_COMPLEXITY_MAXIMUM }),
|
|
180
|
+
parameters: Object.freeze({ maximum: DEFAULT_PARAMETER_MAXIMUM })
|
|
181
|
+
});
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
function resolveScanner(value: unknown): ResolvedFunctionMetricsOptions["scanner"] | undefined {
|
|
185
|
+
if (value === undefined) return Object.freeze({ executable: DEFAULT_LIZARD_EXECUTABLE });
|
|
186
|
+
const scanner = snapshotPolicyRecord(value, { optional: ["executable"] });
|
|
187
|
+
if (scanner === undefined) return undefined;
|
|
188
|
+
const executable = scanner.executable ?? DEFAULT_LIZARD_EXECUTABLE;
|
|
189
|
+
return nonEmptyString(executable) ? Object.freeze({ executable }) : undefined;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
function snapshotPolicyRecord(
|
|
193
|
+
value: unknown,
|
|
194
|
+
keys: PolicyRecordKeys
|
|
195
|
+
): Readonly<Record<string, unknown>> | undefined {
|
|
196
|
+
const record = snapshotClosedRecord(value);
|
|
197
|
+
if (
|
|
198
|
+
record === undefined ||
|
|
199
|
+
!hasRequiredAndOptionalRecordKeys(record, {
|
|
200
|
+
optional: keys.optional ?? [],
|
|
201
|
+
required: keys.required ?? []
|
|
202
|
+
})
|
|
203
|
+
) {
|
|
204
|
+
return undefined;
|
|
205
|
+
}
|
|
206
|
+
return record;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
function positiveSafeInteger(value: unknown): value is number {
|
|
210
|
+
return typeof value === "number" && Number.isSafeInteger(value) && value > 0;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
function nonEmptyString(value: unknown): value is string {
|
|
214
|
+
return typeof value === "string" && value.length > 0;
|
|
215
|
+
}
|
|
@@ -0,0 +1,89 @@
|
|
|
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
|
+
import type { ResolvedFunctionMetricsOptions } from "./options.ts";
|
|
5
|
+
|
|
6
|
+
/** 验证 constructor 已物化的完整 function-metrics options。 */
|
|
7
|
+
export function validResolvedFunctionMetricsOptions(
|
|
8
|
+
value: unknown
|
|
9
|
+
): value is ResolvedFunctionMetricsOptions {
|
|
10
|
+
const options = exactRecord(value, ["codeAreas", "scanner"]);
|
|
11
|
+
return (
|
|
12
|
+
options !== undefined && validCodeAreas(options.codeAreas) && validScanner(options.scanner)
|
|
13
|
+
);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
function validCodeAreas(value: unknown): boolean {
|
|
17
|
+
const areas = snapshotClosedRecord(value);
|
|
18
|
+
if (areas === undefined || Object.keys(areas).length === 0) return false;
|
|
19
|
+
return Object.entries(areas).every(([areaId, candidate]) => {
|
|
20
|
+
const area = exactRecord(candidate, ["files", "findingPolicy", "limits"]);
|
|
21
|
+
return (
|
|
22
|
+
nonEmptyString(areaId) &&
|
|
23
|
+
area !== undefined &&
|
|
24
|
+
validProjectFileSelection(area.files) &&
|
|
25
|
+
validFindingPolicy(area.findingPolicy) &&
|
|
26
|
+
validLimits(area.limits)
|
|
27
|
+
);
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
function validLimits(value: unknown): boolean {
|
|
32
|
+
const limits = exactRecord(value, ["codeLines", "cyclomaticComplexity", "parameters"]);
|
|
33
|
+
if (limits === undefined) return false;
|
|
34
|
+
const codeLineLimits = codeLineLimitsFrom(limits.codeLines);
|
|
35
|
+
const cyclomaticComplexity = maximumLimitFrom(limits.cyclomaticComplexity);
|
|
36
|
+
const parameters = maximumLimitFrom(limits.parameters);
|
|
37
|
+
return (
|
|
38
|
+
codeLineLimits !== undefined &&
|
|
39
|
+
cyclomaticComplexity !== undefined &&
|
|
40
|
+
parameters !== undefined &&
|
|
41
|
+
positiveSafeInteger(cyclomaticComplexity.maximum) &&
|
|
42
|
+
positiveSafeInteger(parameters.maximum)
|
|
43
|
+
);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
function codeLineLimitsFrom(value: unknown): Readonly<Record<string, unknown>> | undefined {
|
|
47
|
+
const codeLines = exactRecord(value, ["lowComplexityAllowance", "maximum"]);
|
|
48
|
+
const allowance = exactRecord(codeLines?.lowComplexityAllowance, [
|
|
49
|
+
"cyclomaticComplexityBelow",
|
|
50
|
+
"maximum"
|
|
51
|
+
]);
|
|
52
|
+
return codeLines !== undefined &&
|
|
53
|
+
allowance !== undefined &&
|
|
54
|
+
positiveSafeInteger(codeLines.maximum) &&
|
|
55
|
+
positiveSafeInteger(allowance.maximum) &&
|
|
56
|
+
allowance.maximum >= codeLines.maximum &&
|
|
57
|
+
positiveSafeInteger(allowance.cyclomaticComplexityBelow)
|
|
58
|
+
? codeLines
|
|
59
|
+
: undefined;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
function maximumLimitFrom(value: unknown): Readonly<Record<string, unknown>> | undefined {
|
|
63
|
+
return exactRecord(value, ["maximum"]);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
function validScanner(value: unknown): boolean {
|
|
67
|
+
const scanner = exactRecord(value, ["executable"]);
|
|
68
|
+
return scanner !== undefined && nonEmptyString(scanner.executable);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
function exactRecord(
|
|
72
|
+
value: unknown,
|
|
73
|
+
keys: readonly string[]
|
|
74
|
+
): Readonly<Record<string, unknown>> | undefined {
|
|
75
|
+
const record = snapshotClosedRecord(value);
|
|
76
|
+
return record !== undefined &&
|
|
77
|
+
Object.keys(record).length === keys.length &&
|
|
78
|
+
keys.every((key) => Object.hasOwn(record, key))
|
|
79
|
+
? record
|
|
80
|
+
: undefined;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
function positiveSafeInteger(value: unknown): value is number {
|
|
84
|
+
return typeof value === "number" && Number.isSafeInteger(value) && value > 0;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
function nonEmptyString(value: unknown): value is string {
|
|
88
|
+
return typeof value === "string" && value.length > 0;
|
|
89
|
+
}
|