@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,49 @@
|
|
|
1
|
+
import {
|
|
2
|
+
hasExactPlainRecordKeys,
|
|
3
|
+
snapshotClosedArray,
|
|
4
|
+
snapshotClosedRecord
|
|
5
|
+
} from "../data-boundary/closed-values.ts";
|
|
6
|
+
import type { FindingSummary } from "./code-quality-findings/policy.ts";
|
|
7
|
+
|
|
8
|
+
/** Parses the final-data shape shared by the three area-based quality Checks. */
|
|
9
|
+
export function parseFindingSummaryData(data: unknown, checkName: string): FindingSummary {
|
|
10
|
+
const summary = exactFinalDataRecord(data, ["blockingFindingCount", "findingCount"], checkName);
|
|
11
|
+
const blockingFindingCount = nonNegativeSafeInteger(summary.blockingFindingCount);
|
|
12
|
+
const findingCount = nonNegativeSafeInteger(summary.findingCount);
|
|
13
|
+
if (
|
|
14
|
+
blockingFindingCount === undefined ||
|
|
15
|
+
findingCount === undefined ||
|
|
16
|
+
blockingFindingCount > findingCount
|
|
17
|
+
) {
|
|
18
|
+
throw invalidFinalData(checkName);
|
|
19
|
+
}
|
|
20
|
+
return Object.freeze({ blockingFindingCount, findingCount });
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/** Returns a detached exact record or rejects an unsupported final-data shape. */
|
|
24
|
+
export function exactFinalDataRecord(
|
|
25
|
+
data: unknown,
|
|
26
|
+
keys: readonly string[],
|
|
27
|
+
checkName: string
|
|
28
|
+
): Readonly<Record<string, unknown>> {
|
|
29
|
+
const record = snapshotClosedRecord(data);
|
|
30
|
+
if (record === undefined || !hasExactPlainRecordKeys(record, keys)) {
|
|
31
|
+
throw invalidFinalData(checkName);
|
|
32
|
+
}
|
|
33
|
+
return record;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/** Returns a detached closed array or rejects an unsupported final-data shape. */
|
|
37
|
+
export function finalDataArray(data: unknown, checkName: string): readonly unknown[] {
|
|
38
|
+
const items = snapshotClosedArray(data);
|
|
39
|
+
if (items === undefined) throw invalidFinalData(checkName);
|
|
40
|
+
return items;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export function nonNegativeSafeInteger(value: unknown): number | undefined {
|
|
44
|
+
return typeof value === "number" && Number.isSafeInteger(value) && value >= 0 ? value : undefined;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export function invalidFinalData(checkName: string): TypeError {
|
|
48
|
+
return new TypeError(`${checkName} final data does not match the supported package contract`);
|
|
49
|
+
}
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import type { FunctionMetric } from "./measurement-model.ts";
|
|
2
|
+
import { canonicalJsonBytes } from "../../data-boundary/canonical-data.ts";
|
|
3
|
+
|
|
4
|
+
export interface FunctionMetricInstance {
|
|
5
|
+
readonly metric: FunctionMetric;
|
|
6
|
+
readonly semanticSubject: string;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export interface FunctionMetricAnalysis {
|
|
10
|
+
readonly instances: readonly FunctionMetricInstance[];
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export function analyzeFunctionMetrics(
|
|
14
|
+
metrics: readonly FunctionMetric[]
|
|
15
|
+
): FunctionMetricAnalysis | undefined {
|
|
16
|
+
const metricsByIdentity = groupValidMetrics(metrics);
|
|
17
|
+
if (metricsByIdentity === undefined) {
|
|
18
|
+
return undefined;
|
|
19
|
+
}
|
|
20
|
+
const instances: FunctionMetricInstance[] = [];
|
|
21
|
+
for (const group of metricsByIdentity.values()) {
|
|
22
|
+
const sortedGroup = [...group].sort(compareFunctionInstances);
|
|
23
|
+
instances.push(...createFunctionInstances(sortedGroup));
|
|
24
|
+
}
|
|
25
|
+
instances.sort((left, right) => compareText(left.semanticSubject, right.semanticSubject));
|
|
26
|
+
return Object.freeze({ instances: Object.freeze(instances) });
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
function groupValidMetrics(
|
|
30
|
+
metrics: readonly FunctionMetric[]
|
|
31
|
+
): Map<string, FunctionMetric[]> | undefined {
|
|
32
|
+
const groups = new Map<string, FunctionMetric[]>();
|
|
33
|
+
for (const metric of metrics) {
|
|
34
|
+
if (!isValidFunctionMetric(metric)) {
|
|
35
|
+
return undefined;
|
|
36
|
+
}
|
|
37
|
+
const key = functionIdentityKey(metric);
|
|
38
|
+
const group = groups.get(key) ?? [];
|
|
39
|
+
group.push(metric);
|
|
40
|
+
groups.set(key, group);
|
|
41
|
+
}
|
|
42
|
+
return groups;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
function createFunctionInstances(sortedGroup: readonly FunctionMetric[]): FunctionMetricInstance[] {
|
|
46
|
+
return sortedGroup.map((metric, index) =>
|
|
47
|
+
Object.freeze({
|
|
48
|
+
metric,
|
|
49
|
+
semanticSubject:
|
|
50
|
+
isStableFunctionName(metric.name) && sortedGroup.length === 1
|
|
51
|
+
? functionSubject(metric)
|
|
52
|
+
: ambiguousFunctionSubject(metric, index + 1)
|
|
53
|
+
})
|
|
54
|
+
);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
function isValidFunctionMetric(metric: FunctionMetric): boolean {
|
|
58
|
+
return (
|
|
59
|
+
typeof metric.file === "string" &&
|
|
60
|
+
metric.file.length > 0 &&
|
|
61
|
+
typeof metric.name === "string" &&
|
|
62
|
+
metric.name.length > 0 &&
|
|
63
|
+
hasValidFunctionLocation(metric) &&
|
|
64
|
+
hasValidFunctionMeasurements(metric)
|
|
65
|
+
);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
function hasValidFunctionLocation(metric: FunctionMetric): boolean {
|
|
69
|
+
return (
|
|
70
|
+
Number.isSafeInteger(metric.startLine) &&
|
|
71
|
+
metric.startLine >= 1 &&
|
|
72
|
+
Number.isSafeInteger(metric.endLine) &&
|
|
73
|
+
metric.endLine >= metric.startLine
|
|
74
|
+
);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
function hasValidFunctionMeasurements(metric: FunctionMetric): boolean {
|
|
78
|
+
const complexity = metric.cyclomaticComplexity.value;
|
|
79
|
+
return (
|
|
80
|
+
Number.isSafeInteger(metric.lines) &&
|
|
81
|
+
metric.lines >= 0 &&
|
|
82
|
+
Number.isSafeInteger(metric.parameterCount) &&
|
|
83
|
+
metric.parameterCount >= 0 &&
|
|
84
|
+
(complexity === null || isValidComplexity(complexity))
|
|
85
|
+
);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
function isValidComplexity(complexity: number): boolean {
|
|
89
|
+
return Number.isSafeInteger(complexity) && complexity >= 0;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
function functionSubject(metric: Pick<FunctionMetric, "file" | "name">): string {
|
|
93
|
+
const identity = new TextDecoder().decode(
|
|
94
|
+
canonicalJsonBytes({
|
|
95
|
+
file: metric.file,
|
|
96
|
+
name: metric.name
|
|
97
|
+
})
|
|
98
|
+
);
|
|
99
|
+
return `function:${identity}`;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
function ambiguousFunctionSubject(
|
|
103
|
+
metric: Pick<FunctionMetric, "file" | "name">,
|
|
104
|
+
occurrence: number
|
|
105
|
+
): string {
|
|
106
|
+
const identity = new TextDecoder().decode(
|
|
107
|
+
canonicalJsonBytes({
|
|
108
|
+
file: metric.file,
|
|
109
|
+
name: metric.name,
|
|
110
|
+
occurrence
|
|
111
|
+
})
|
|
112
|
+
);
|
|
113
|
+
return `function-instance:${identity}`;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
function functionIdentityKey(metric: Pick<FunctionMetric, "file" | "name">): string {
|
|
117
|
+
return `${metric.file}\u0000${metric.name}`;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
function compareFunctionInstances(left: FunctionMetric, right: FunctionMetric): number {
|
|
121
|
+
return (
|
|
122
|
+
left.startLine - right.startLine ||
|
|
123
|
+
left.endLine - right.endLine ||
|
|
124
|
+
left.lines - right.lines ||
|
|
125
|
+
(left.cyclomaticComplexity.value ?? -1) - (right.cyclomaticComplexity.value ?? -1) ||
|
|
126
|
+
left.parameterCount - right.parameterCount
|
|
127
|
+
);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
export function isStableFunctionName(name: string): boolean {
|
|
131
|
+
return name.trim() !== "" && name !== "(anonymous)" && name !== "unknown";
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
function compareText(left: string, right: string): number {
|
|
135
|
+
if (left < right) return -1;
|
|
136
|
+
if (left > right) return 1;
|
|
137
|
+
return 0;
|
|
138
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { defineCheck, type TypedCheckWithOptions } from "../../check/check.ts";
|
|
2
|
+
import { executeFunctionMetrics } from "./execution.ts";
|
|
3
|
+
import { parseFunctionMetricsData } from "./final-data.ts";
|
|
4
|
+
import type { FunctionMetricsOptions, ResolvedFunctionMetricsOptions } from "./options.ts";
|
|
5
|
+
import { resolveFunctionMetricsOptions } from "./options-resolution.ts";
|
|
6
|
+
import { validResolvedFunctionMetricsOptions } from "./options-validation.ts";
|
|
7
|
+
|
|
8
|
+
const FUNCTION_METRICS_CHECK_DEFINITION = {
|
|
9
|
+
checkId: "function-metrics",
|
|
10
|
+
displayName: "Function metrics"
|
|
11
|
+
} as const;
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* 使用可省略的区域、阈值与 finding policy 构造一个完整 function-metrics Check。
|
|
15
|
+
*
|
|
16
|
+
* @param options - 省略字段由 package 补齐;显式 files 数组完整替换对应字段的默认数组。
|
|
17
|
+
* @returns 固定 `function-metrics` identity、完整冻结 options、preflight 与 execution。
|
|
18
|
+
* @throws {TypeError} input 含未知字段、空 area、非法 finding policy、非法 limit 或空 executable 时抛出。
|
|
19
|
+
*/
|
|
20
|
+
export function functionMetrics(
|
|
21
|
+
options: FunctionMetricsOptions = {}
|
|
22
|
+
): TypedCheckWithOptions<
|
|
23
|
+
"function-metrics",
|
|
24
|
+
ResolvedFunctionMetricsOptions,
|
|
25
|
+
typeof parseFunctionMetricsData
|
|
26
|
+
> {
|
|
27
|
+
const resolvedOptions = resolveFunctionMetricsOptions(options);
|
|
28
|
+
if (resolvedOptions === undefined) {
|
|
29
|
+
throw new TypeError(
|
|
30
|
+
"functionMetrics options must use the documented closed policy: a non-empty area map, recognized finding policies, positive safe-integer limits, and a non-empty scanner executable"
|
|
31
|
+
);
|
|
32
|
+
}
|
|
33
|
+
return defineCheck({
|
|
34
|
+
...FUNCTION_METRICS_CHECK_DEFINITION,
|
|
35
|
+
execution: executeFunctionMetrics,
|
|
36
|
+
parseData: parseFunctionMetricsData,
|
|
37
|
+
preflight: (preparedOptions) =>
|
|
38
|
+
validResolvedFunctionMetricsOptions(preparedOptions)
|
|
39
|
+
? { status: "success", preparedOptions }
|
|
40
|
+
: {
|
|
41
|
+
status: "failure",
|
|
42
|
+
action: "block",
|
|
43
|
+
reason: { code: "invalid-options" },
|
|
44
|
+
messages: [
|
|
45
|
+
{
|
|
46
|
+
code: "invalid-options",
|
|
47
|
+
level: "error",
|
|
48
|
+
message:
|
|
49
|
+
"functionMetrics options are invalid; recreate the Check with functionMetrics(options) or restore its complete resolved options."
|
|
50
|
+
}
|
|
51
|
+
]
|
|
52
|
+
},
|
|
53
|
+
options: resolvedOptions
|
|
54
|
+
});
|
|
55
|
+
}
|
|
@@ -0,0 +1,263 @@
|
|
|
1
|
+
import type { CheckExecutionContext, CheckMessage, CheckResult } from "../../check/check.ts";
|
|
2
|
+
import { collectProjectFileSets, requireProjectFileSet } from "../project-files/collection.ts";
|
|
3
|
+
import { partitionProjectFilesByEligibility } from "../project-files/input-eligibility.ts";
|
|
4
|
+
import { settleFindings } from "../code-quality-findings/policy.ts";
|
|
5
|
+
import { analyzeFunctionMetrics } from "./analysis.ts";
|
|
6
|
+
import { measureFunctionMetrics, type FunctionMeasurementResult } from "./measurement.ts";
|
|
7
|
+
import type {
|
|
8
|
+
FunctionMetricsAreaInput,
|
|
9
|
+
FunctionMetricsExactInputSet
|
|
10
|
+
} from "./measurement-model.ts";
|
|
11
|
+
import type {
|
|
12
|
+
ResolvedFunctionMetricsCodeAreaOptions,
|
|
13
|
+
ResolvedFunctionMetricsOptions
|
|
14
|
+
} from "./options.ts";
|
|
15
|
+
import { validResolvedFunctionMetricsOptions } from "./options-validation.ts";
|
|
16
|
+
import {
|
|
17
|
+
buildFunctionInputRejectedCandidates,
|
|
18
|
+
buildFunctionRecordCandidates,
|
|
19
|
+
type FunctionInputRejectedCandidate,
|
|
20
|
+
type FunctionRecordCandidate
|
|
21
|
+
} from "./records.ts";
|
|
22
|
+
import { isLizardTarget } from "./target-files.ts";
|
|
23
|
+
import type { FunctionMetricsFinalData } from "./final-data.ts";
|
|
24
|
+
|
|
25
|
+
/** `function-metrics` whole-Check unavailable outcome 的稳定 reason code。 */
|
|
26
|
+
export type FunctionMetricsUnavailableReasonCode =
|
|
27
|
+
| "cancelled"
|
|
28
|
+
| "external-dependency-unavailable"
|
|
29
|
+
| "external-execution-failed"
|
|
30
|
+
| "external-result-invalid"
|
|
31
|
+
| "invalid-options"
|
|
32
|
+
| "source-unavailable";
|
|
33
|
+
|
|
34
|
+
/** Default Check callback;一次扫描完整 area exact-input union。 */
|
|
35
|
+
export async function executeFunctionMetrics(
|
|
36
|
+
context: CheckExecutionContext<ResolvedFunctionMetricsOptions>
|
|
37
|
+
): Promise<CheckResult<FunctionMetricsFinalData>> {
|
|
38
|
+
if (!validResolvedFunctionMetricsOptions(context.options)) return unavailable("invalid-options");
|
|
39
|
+
if (context.signal.aborted) return unavailable("cancelled");
|
|
40
|
+
|
|
41
|
+
let prepared: PreparedFunctionInputs;
|
|
42
|
+
try {
|
|
43
|
+
prepared = prepareFunctionInputs(context.project.root, context.options.codeAreas);
|
|
44
|
+
} catch {
|
|
45
|
+
return unavailable("source-unavailable");
|
|
46
|
+
}
|
|
47
|
+
if (context.signal.aborted) return unavailable("cancelled");
|
|
48
|
+
return executePreparedFunctionMetrics(context, prepared);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
async function executePreparedFunctionMetrics(
|
|
52
|
+
context: CheckExecutionContext<ResolvedFunctionMetricsOptions>,
|
|
53
|
+
prepared: PreparedFunctionInputs
|
|
54
|
+
): Promise<CheckResult<FunctionMetricsFinalData>> {
|
|
55
|
+
if (prepared.selectedPathCount === 0) {
|
|
56
|
+
return Object.freeze({ status: "not-applicable", reason: { code: "no-eligible-input" } });
|
|
57
|
+
}
|
|
58
|
+
reportInputRejections(context, prepared.rejectedCandidates);
|
|
59
|
+
if (prepared.exactInput.approvedExactPaths.length === 0) {
|
|
60
|
+
return settleFunctionFindings([], prepared.rejectedCandidates);
|
|
61
|
+
}
|
|
62
|
+
const measurement = await measureFunctionMetrics({
|
|
63
|
+
dependency: context.options.scanner,
|
|
64
|
+
input: prepared.exactInput,
|
|
65
|
+
signal: context.signal
|
|
66
|
+
});
|
|
67
|
+
if (measurement.kind !== "complete") {
|
|
68
|
+
return appendInputRejectedMessage(
|
|
69
|
+
directMeasurementFailure(measurement),
|
|
70
|
+
prepared.rejectedCandidates.length
|
|
71
|
+
);
|
|
72
|
+
}
|
|
73
|
+
const analysis = analyzeFunctionMetrics(measurement.metrics);
|
|
74
|
+
if (analysis === undefined) {
|
|
75
|
+
return appendInputRejectedMessage(
|
|
76
|
+
unavailable("external-result-invalid"),
|
|
77
|
+
prepared.rejectedCandidates.length
|
|
78
|
+
);
|
|
79
|
+
}
|
|
80
|
+
const candidates = buildFunctionRecordCandidates(analysis, prepared.exactInput.areas);
|
|
81
|
+
if (candidates === undefined) {
|
|
82
|
+
return appendInputRejectedMessage(
|
|
83
|
+
unavailable("external-result-invalid"),
|
|
84
|
+
prepared.rejectedCandidates.length
|
|
85
|
+
);
|
|
86
|
+
}
|
|
87
|
+
for (const candidate of candidates) {
|
|
88
|
+
context.records.report({ id: candidate.id }, candidate.data);
|
|
89
|
+
}
|
|
90
|
+
return settleFunctionFindings(candidates, prepared.rejectedCandidates);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
interface PreparedFunctionInputs {
|
|
94
|
+
readonly exactInput: FunctionMetricsExactInputSet;
|
|
95
|
+
readonly rejectedCandidates: readonly FunctionInputRejectedCandidate[];
|
|
96
|
+
readonly selectedPathCount: number;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
function prepareFunctionInputs(
|
|
100
|
+
rootDir: string,
|
|
101
|
+
codeAreas: ResolvedFunctionMetricsOptions["codeAreas"]
|
|
102
|
+
): PreparedFunctionInputs {
|
|
103
|
+
const collected = collectAreaInputs(rootDir, codeAreas);
|
|
104
|
+
return Object.freeze({
|
|
105
|
+
exactInput: Object.freeze({
|
|
106
|
+
approvedExactPaths: Object.freeze(
|
|
107
|
+
uniqueSorted(collected.areas.flatMap((area) => area.approvedExactPaths))
|
|
108
|
+
),
|
|
109
|
+
areas: collected.areas,
|
|
110
|
+
rootDir
|
|
111
|
+
}),
|
|
112
|
+
rejectedCandidates: buildFunctionInputRejectedCandidates(
|
|
113
|
+
new Map(
|
|
114
|
+
[...collected.rejectedCodeAreasByPath].map(([path, matchingAreas]) => [
|
|
115
|
+
path,
|
|
116
|
+
Object.freeze(matchingAreas)
|
|
117
|
+
])
|
|
118
|
+
)
|
|
119
|
+
),
|
|
120
|
+
selectedPathCount: collected.selectedPaths.size
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
interface CollectedFunctionAreaInputs {
|
|
125
|
+
readonly areas: readonly FunctionMetricsAreaInput[];
|
|
126
|
+
readonly rejectedCodeAreasByPath: ReadonlyMap<string, readonly string[]>;
|
|
127
|
+
readonly selectedPaths: ReadonlySet<string>;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
function collectAreaInputs(
|
|
131
|
+
rootDir: string,
|
|
132
|
+
codeAreas: Readonly<Record<string, ResolvedFunctionMetricsCodeAreaOptions>>
|
|
133
|
+
): CollectedFunctionAreaInputs {
|
|
134
|
+
const areas: FunctionMetricsAreaInput[] = [];
|
|
135
|
+
const rejectedCodeAreasByPath = new Map<string, string[]>();
|
|
136
|
+
const selectedPaths = new Set<string>();
|
|
137
|
+
const orderedPolicies = Object.entries(codeAreas).sort(([left], [right]) =>
|
|
138
|
+
compareText(left, right)
|
|
139
|
+
);
|
|
140
|
+
const filesByArea = collectProjectFileSets(
|
|
141
|
+
rootDir,
|
|
142
|
+
Object.fromEntries(orderedPolicies.map(([areaId, policy]) => [areaId, policy.files]))
|
|
143
|
+
);
|
|
144
|
+
for (const [codeArea, policy] of orderedPolicies) {
|
|
145
|
+
const selectedForArea = requireProjectFileSet(filesByArea, codeArea);
|
|
146
|
+
for (const path of selectedForArea) selectedPaths.add(path);
|
|
147
|
+
const partition = partitionProjectFilesByEligibility(selectedForArea, isLizardTarget);
|
|
148
|
+
for (const path of partition.rejectedPaths) {
|
|
149
|
+
const matchingAreas = rejectedCodeAreasByPath.get(path) ?? [];
|
|
150
|
+
matchingAreas.push(codeArea);
|
|
151
|
+
rejectedCodeAreasByPath.set(path, matchingAreas);
|
|
152
|
+
}
|
|
153
|
+
if (partition.acceptedPaths.length === 0) continue;
|
|
154
|
+
areas.push(
|
|
155
|
+
Object.freeze({
|
|
156
|
+
approvedExactPaths: partition.acceptedPaths,
|
|
157
|
+
codeArea,
|
|
158
|
+
findingPolicy: policy.findingPolicy,
|
|
159
|
+
limits: policy.limits
|
|
160
|
+
})
|
|
161
|
+
);
|
|
162
|
+
}
|
|
163
|
+
return Object.freeze({
|
|
164
|
+
areas: Object.freeze(areas),
|
|
165
|
+
rejectedCodeAreasByPath,
|
|
166
|
+
selectedPaths
|
|
167
|
+
});
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
function reportInputRejections(
|
|
171
|
+
context: CheckExecutionContext<ResolvedFunctionMetricsOptions>,
|
|
172
|
+
candidates: readonly FunctionInputRejectedCandidate[]
|
|
173
|
+
): void {
|
|
174
|
+
for (const candidate of candidates) {
|
|
175
|
+
context.records.report({ id: candidate.id }, candidate.data);
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
function settleFunctionFindings(
|
|
180
|
+
metricCandidates: readonly FunctionRecordCandidate[],
|
|
181
|
+
rejectedCandidates: readonly FunctionInputRejectedCandidate[]
|
|
182
|
+
): CheckResult<FunctionMetricsFinalData> {
|
|
183
|
+
const settlement = settleFindings([
|
|
184
|
+
...metricCandidates.map((candidate) => ({
|
|
185
|
+
actionable: true,
|
|
186
|
+
blocking: candidate.data.blocking
|
|
187
|
+
})),
|
|
188
|
+
...rejectedCandidates.map(() => ({ actionable: false, blocking: false }))
|
|
189
|
+
]);
|
|
190
|
+
return appendInputRejectedMessage(settlement, rejectedCandidates.length);
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
function appendInputRejectedMessage(
|
|
194
|
+
result: CheckResult<FunctionMetricsFinalData>,
|
|
195
|
+
rejectedInputCount: number
|
|
196
|
+
): CheckResult<FunctionMetricsFinalData> {
|
|
197
|
+
if (rejectedInputCount === 0) return result;
|
|
198
|
+
const message: CheckMessage = Object.freeze({
|
|
199
|
+
code: "input-rejected",
|
|
200
|
+
level: "warning",
|
|
201
|
+
message: `${rejectedInputCount} selected functionMetrics input file(s) were rejected because their file type is unsupported; inspect this Check's Records and narrow files.include/exclude.`
|
|
202
|
+
});
|
|
203
|
+
return Object.freeze({
|
|
204
|
+
...result,
|
|
205
|
+
messages: Object.freeze([...(result.messages ?? []), message])
|
|
206
|
+
});
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
function directMeasurementFailure(
|
|
210
|
+
measurement: Exclude<FunctionMeasurementResult, { kind: "complete" }>
|
|
211
|
+
): CheckResult<FunctionMetricsFinalData> {
|
|
212
|
+
switch (measurement.kind) {
|
|
213
|
+
case "cancelled":
|
|
214
|
+
return unavailable("cancelled");
|
|
215
|
+
case "execution-failed":
|
|
216
|
+
return unavailable("external-execution-failed");
|
|
217
|
+
case "invalid-result":
|
|
218
|
+
return unavailable("external-result-invalid");
|
|
219
|
+
case "unavailable":
|
|
220
|
+
return unavailable("external-dependency-unavailable");
|
|
221
|
+
}
|
|
222
|
+
const exhaustiveMeasurement: never = measurement;
|
|
223
|
+
return exhaustiveMeasurement;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
function unavailable(
|
|
227
|
+
code: FunctionMetricsUnavailableReasonCode
|
|
228
|
+
): CheckResult<FunctionMetricsFinalData> {
|
|
229
|
+
return Object.freeze({
|
|
230
|
+
status: "unavailable",
|
|
231
|
+
reason: { code },
|
|
232
|
+
messages: Object.freeze([
|
|
233
|
+
Object.freeze({ code, level: "error" as const, message: unavailableMessage(code) })
|
|
234
|
+
])
|
|
235
|
+
});
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
function unavailableMessage(code: FunctionMetricsUnavailableReasonCode): string {
|
|
239
|
+
switch (code) {
|
|
240
|
+
case "invalid-options":
|
|
241
|
+
return "functionMetrics options are invalid; recreate the Check with functionMetrics(options) or restore its complete resolved options.";
|
|
242
|
+
case "cancelled":
|
|
243
|
+
return "Function metrics was cancelled before it could form a complete result; inspect the caller's cancellation reason and retry if appropriate.";
|
|
244
|
+
case "source-unavailable":
|
|
245
|
+
return "Function metrics could not collect its configured project files; check the project root, file permissions, and selected file source.";
|
|
246
|
+
case "external-dependency-unavailable":
|
|
247
|
+
return "The configured Lizard command is unavailable or incompatible; install Lizard 1.23.0 or configure a compatible executable.";
|
|
248
|
+
case "external-execution-failed":
|
|
249
|
+
return "Lizard did not complete successfully; run the configured command directly and inspect its environment.";
|
|
250
|
+
case "external-result-invalid":
|
|
251
|
+
return "Lizard output could not form a trusted complete result; check the executable version and CSV compatibility.";
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
function uniqueSorted(values: readonly string[]): string[] {
|
|
256
|
+
return [...new Set(values)].sort(compareText);
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
function compareText(left: string, right: string): number {
|
|
260
|
+
if (left < right) return -1;
|
|
261
|
+
if (left > right) return 1;
|
|
262
|
+
return 0;
|
|
263
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { FindingSummary } from "../code-quality-findings/policy.ts";
|
|
2
|
+
import { parseFindingSummaryData } from "../final-data-parsing.ts";
|
|
3
|
+
|
|
4
|
+
/** `function-metrics` 在 passed/failed outcome 中发布的主数据。 */
|
|
5
|
+
export type FunctionMetricsFinalData = FindingSummary;
|
|
6
|
+
|
|
7
|
+
/** 验证并脱离一份 `function-metrics` canonical final-data object。 */
|
|
8
|
+
export function parseFunctionMetricsData(data: unknown): FunctionMetricsFinalData {
|
|
9
|
+
return parseFindingSummaryData(data, "functionMetrics");
|
|
10
|
+
}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { errorMessage } from "../../host-environment/error-message.ts";
|
|
2
|
+
import { runProcess } from "../../host-environment/process/command.ts";
|
|
3
|
+
import type { ResolvedFunctionMetricsScannerOptions } from "../options.ts";
|
|
4
|
+
|
|
5
|
+
type LizardAvailability = Readonly<
|
|
6
|
+
| {
|
|
7
|
+
readonly available: true;
|
|
8
|
+
readonly version: string;
|
|
9
|
+
}
|
|
10
|
+
| {
|
|
11
|
+
readonly available: false;
|
|
12
|
+
readonly error: string;
|
|
13
|
+
readonly reason: "contract-error" | "execution-error" | "tool-unavailable";
|
|
14
|
+
}
|
|
15
|
+
>;
|
|
16
|
+
|
|
17
|
+
interface UnavailableLizardInput {
|
|
18
|
+
readonly error: string;
|
|
19
|
+
readonly reason: Extract<LizardAvailability, { available: false }>["reason"];
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
type ToolCommandResult = Awaited<ReturnType<typeof runProcess>>;
|
|
23
|
+
|
|
24
|
+
export async function checkLizard(
|
|
25
|
+
rootDir: string,
|
|
26
|
+
dependency: ResolvedFunctionMetricsScannerOptions
|
|
27
|
+
): Promise<LizardAvailability> {
|
|
28
|
+
try {
|
|
29
|
+
const result = await runProcess({
|
|
30
|
+
args: ["--version"],
|
|
31
|
+
command: dependency.executable,
|
|
32
|
+
cwd: rootDir
|
|
33
|
+
});
|
|
34
|
+
return availabilityFromVersionResult(result);
|
|
35
|
+
} catch (error: unknown) {
|
|
36
|
+
return unavailableLizard({
|
|
37
|
+
error: `lizard version error: ${errorMessage(error)}`,
|
|
38
|
+
reason: "execution-error"
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
function availabilityFromVersionResult(result: ToolCommandResult): LizardAvailability {
|
|
44
|
+
if (result.signal !== null) {
|
|
45
|
+
const output = commandOutput(result);
|
|
46
|
+
return unavailableLizard({
|
|
47
|
+
error: `lizard --version failed, signal ${result.signal}${output ? `: ${output}` : ""}`,
|
|
48
|
+
reason: "execution-error"
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
if (result.error) return processErrorAvailability(result.error);
|
|
52
|
+
const output = commandOutput(result);
|
|
53
|
+
if (result.status !== 0) {
|
|
54
|
+
return unavailableLizard({
|
|
55
|
+
error: `lizard --version failed, ${processTermination(result)}${output ? `: ${output}` : ""}`,
|
|
56
|
+
reason: "execution-error"
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
if (output === "") {
|
|
60
|
+
return unavailableLizard({
|
|
61
|
+
error: "lizard --version returned empty output",
|
|
62
|
+
reason: "contract-error"
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
return Object.freeze({ available: true, version: output });
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
function processErrorAvailability(error: Error): LizardAvailability {
|
|
69
|
+
const isMissingTool = Object.hasOwn(error, "code") && Reflect.get(error, "code") === "ENOENT";
|
|
70
|
+
return unavailableLizard({
|
|
71
|
+
error: isMissingTool
|
|
72
|
+
? `lizard command unavailable: ${error.message}`
|
|
73
|
+
: `lizard version error: ${error.message}`,
|
|
74
|
+
reason: isMissingTool ? "tool-unavailable" : "execution-error"
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
function unavailableLizard({ error, reason }: UnavailableLizardInput): LizardAvailability {
|
|
79
|
+
return Object.freeze({ available: false, error, reason });
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
function commandOutput(result: ToolCommandResult): string {
|
|
83
|
+
return (result.stdout || "").trim() || (result.stderr || "").trim();
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
function processTermination(result: ToolCommandResult): string {
|
|
87
|
+
return typeof result.status === "number"
|
|
88
|
+
? `exit ${result.status}`
|
|
89
|
+
: `signal ${result.signal || "unknown"}`;
|
|
90
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { parse } from "csv-parse/sync";
|
|
2
|
+
|
|
3
|
+
export function parseCsvRows(csv: string): string[][] {
|
|
4
|
+
const records: unknown = parse(csv, {
|
|
5
|
+
bom: true,
|
|
6
|
+
relax_column_count: true,
|
|
7
|
+
skip_empty_lines: true,
|
|
8
|
+
trim: true
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
if (!Array.isArray(records) || !records.every(isStringRow)) {
|
|
12
|
+
throw new Error("CSV parser returned non-string rows");
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
return records;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
function isStringRow(value: unknown): value is string[] {
|
|
19
|
+
return Array.isArray(value) && value.every((item) => typeof item === "string");
|
|
20
|
+
}
|