@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,256 @@
|
|
|
1
|
+
import {
|
|
2
|
+
hasExactPlainRecordKeys,
|
|
3
|
+
snapshotClosedArray,
|
|
4
|
+
snapshotClosedRecord
|
|
5
|
+
} from "../../data-boundary/closed-values.ts";
|
|
6
|
+
import { validProjectFileSelection } from "../project-files/configuration.ts";
|
|
7
|
+
import type { ResolvedJsonSchemaValidationOptions } from "./options.ts";
|
|
8
|
+
|
|
9
|
+
function exactRecord(
|
|
10
|
+
value: unknown,
|
|
11
|
+
keys: readonly string[]
|
|
12
|
+
): Readonly<Record<string, unknown>> | undefined {
|
|
13
|
+
const record = snapshotClosedRecord(value);
|
|
14
|
+
return record !== undefined && hasExactPlainRecordKeys(record, keys) ? record : undefined;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
function positiveSafeInteger(value: unknown): value is number {
|
|
18
|
+
return typeof value === "number" && Number.isSafeInteger(value) && value > 0;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export function validJsonSchemaValidationOptions(
|
|
22
|
+
candidateOptions: unknown
|
|
23
|
+
): candidateOptions is ResolvedJsonSchemaValidationOptions {
|
|
24
|
+
const options = exactRecord(candidateOptions, [
|
|
25
|
+
"files",
|
|
26
|
+
"maximumBytes",
|
|
27
|
+
"schemaIdentity",
|
|
28
|
+
"referenceResolution",
|
|
29
|
+
"schemas",
|
|
30
|
+
"bindings"
|
|
31
|
+
]);
|
|
32
|
+
if (
|
|
33
|
+
options === undefined ||
|
|
34
|
+
!validProjectFileSelection(options.files) ||
|
|
35
|
+
!positiveSafeInteger(options.maximumBytes) ||
|
|
36
|
+
!validJsonSchemaIdentity(options.schemaIdentity) ||
|
|
37
|
+
!validJsonSchemaReferenceResolution(options.referenceResolution)
|
|
38
|
+
) {
|
|
39
|
+
return false;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
const schemas = snapshotClosedArray(options.schemas);
|
|
43
|
+
const bindings = snapshotClosedArray(options.bindings);
|
|
44
|
+
const declaredSchemaIds = schemas === undefined ? undefined : validatedSchemaRegistryIds(schemas);
|
|
45
|
+
return (
|
|
46
|
+
bindings !== undefined &&
|
|
47
|
+
declaredSchemaIds !== undefined &&
|
|
48
|
+
validJsonSchemaBindings(bindings, declaredSchemaIds)
|
|
49
|
+
);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
function validJsonSchemaIdentity(candidateIdentity: unknown): boolean {
|
|
53
|
+
const identity = exactRecord(candidateIdentity, ["mode"]);
|
|
54
|
+
return (
|
|
55
|
+
identity !== undefined &&
|
|
56
|
+
(identity.mode === "require-match" ||
|
|
57
|
+
identity.mode === "configuration-authoritative" ||
|
|
58
|
+
identity.mode === "document-authoritative")
|
|
59
|
+
);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
function validJsonSchemaReferenceResolution(candidateResolution: unknown): boolean {
|
|
63
|
+
const referenceResolution = snapshotClosedRecord(candidateResolution);
|
|
64
|
+
if (referenceResolution === undefined || typeof referenceResolution.mode !== "string") {
|
|
65
|
+
return false;
|
|
66
|
+
}
|
|
67
|
+
if (referenceResolution.mode === "offline") {
|
|
68
|
+
return exactRecord(referenceResolution, ["mode"]) !== undefined;
|
|
69
|
+
}
|
|
70
|
+
if (referenceResolution.mode !== "allowlisted") return false;
|
|
71
|
+
|
|
72
|
+
const allowlisted = exactRecord(referenceResolution, ["mode", "sources"]);
|
|
73
|
+
const sources = allowlisted === undefined ? undefined : snapshotClosedArray(allowlisted.sources);
|
|
74
|
+
return sources !== undefined && sources.length > 0 && validJsonSchemaReferenceSources(sources);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
function validJsonSchemaReferenceSources(sources: readonly unknown[]): boolean {
|
|
78
|
+
const sourceIds = new Set<string>();
|
|
79
|
+
const sourceLocations = new Set<string>();
|
|
80
|
+
let bundledCatalogCount = 0;
|
|
81
|
+
for (const sourceCandidate of sources) {
|
|
82
|
+
const source = validatedReferenceSource(sourceCandidate);
|
|
83
|
+
if (source === undefined) return false;
|
|
84
|
+
if (source.kind === "bundled") {
|
|
85
|
+
bundledCatalogCount += 1;
|
|
86
|
+
if (bundledCatalogCount > 1) return false;
|
|
87
|
+
continue;
|
|
88
|
+
}
|
|
89
|
+
if (sourceIds.has(source.id) || sourceLocations.has(source.location)) return false;
|
|
90
|
+
sourceIds.add(source.id);
|
|
91
|
+
sourceLocations.add(source.location);
|
|
92
|
+
}
|
|
93
|
+
return true;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
function validatedReferenceSource(sourceCandidate: unknown) {
|
|
97
|
+
const source = snapshotClosedRecord(sourceCandidate);
|
|
98
|
+
if (source === undefined || typeof source.kind !== "string") return undefined;
|
|
99
|
+
if (source.kind === "bundled")
|
|
100
|
+
return validBundledSource(source) ? { kind: "bundled" as const } : undefined;
|
|
101
|
+
if (source.kind !== "https") return undefined;
|
|
102
|
+
const httpsSource = validatedHttpsSource(source);
|
|
103
|
+
return httpsSource === undefined ? undefined : { kind: "https" as const, ...httpsSource };
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
function validBundledSource(source: Readonly<Record<string, unknown>>): boolean {
|
|
107
|
+
return exactRecord(source, ["kind", "catalog"])?.catalog === "json-schema-2020-12";
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
function validatedHttpsSource(source: Readonly<Record<string, unknown>>) {
|
|
111
|
+
const httpsSource = exactRecord(source, ["kind", "id", "origin", "pathPrefix"]);
|
|
112
|
+
if (
|
|
113
|
+
httpsSource === undefined ||
|
|
114
|
+
!safeAbsoluteIdentifier(httpsSource.id) ||
|
|
115
|
+
!safeHttpsOrigin(httpsSource.origin) ||
|
|
116
|
+
!safePathPrefix(httpsSource.pathPrefix)
|
|
117
|
+
)
|
|
118
|
+
return undefined;
|
|
119
|
+
return { id: httpsSource.id, location: `${httpsSource.origin}\n${httpsSource.pathPrefix}` };
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
/** Returns declared IDs only after the whole schema registry satisfies its closed authoring invariant. */
|
|
123
|
+
function validatedSchemaRegistryIds(schemas: readonly unknown[]): ReadonlySet<string> | undefined {
|
|
124
|
+
const declaredSchemaIds = new Set<string>();
|
|
125
|
+
const schemaPaths = new Set<string>();
|
|
126
|
+
for (const schemaCandidate of schemas) {
|
|
127
|
+
const schemaRecord = exactRecord(schemaCandidate, ["id", "path"]);
|
|
128
|
+
if (
|
|
129
|
+
schemaRecord === undefined ||
|
|
130
|
+
!safeAbsoluteIdentifier(schemaRecord.id) ||
|
|
131
|
+
!normalizedProjectJsonPath(schemaRecord.path) ||
|
|
132
|
+
declaredSchemaIds.has(schemaRecord.id) ||
|
|
133
|
+
schemaPaths.has(schemaRecord.path)
|
|
134
|
+
) {
|
|
135
|
+
return undefined;
|
|
136
|
+
}
|
|
137
|
+
declaredSchemaIds.add(schemaRecord.id);
|
|
138
|
+
schemaPaths.add(schemaRecord.path);
|
|
139
|
+
}
|
|
140
|
+
return declaredSchemaIds;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
function validJsonSchemaBindings(
|
|
144
|
+
bindings: readonly unknown[],
|
|
145
|
+
declaredSchemaIds: ReadonlySet<string>
|
|
146
|
+
): boolean {
|
|
147
|
+
const bindingIds = new Set<string>();
|
|
148
|
+
const bindingTargets = new Set<string>();
|
|
149
|
+
for (const bindingCandidate of bindings) {
|
|
150
|
+
const bindingRecord = exactRecord(bindingCandidate, ["id", "instancePath", "schemaId"]);
|
|
151
|
+
if (
|
|
152
|
+
bindingRecord === undefined ||
|
|
153
|
+
!safeBindingId(bindingRecord.id) ||
|
|
154
|
+
!normalizedProjectJsonPath(bindingRecord.instancePath) ||
|
|
155
|
+
typeof bindingRecord.schemaId !== "string" ||
|
|
156
|
+
!declaredSchemaIds.has(bindingRecord.schemaId) ||
|
|
157
|
+
bindingIds.has(bindingRecord.id)
|
|
158
|
+
) {
|
|
159
|
+
return false;
|
|
160
|
+
}
|
|
161
|
+
const bindingTarget = `${bindingRecord.instancePath}\n${bindingRecord.schemaId}`;
|
|
162
|
+
if (bindingTargets.has(bindingTarget)) return false;
|
|
163
|
+
bindingIds.add(bindingRecord.id);
|
|
164
|
+
bindingTargets.add(bindingTarget);
|
|
165
|
+
}
|
|
166
|
+
return true;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
function safeAbsoluteIdentifier(identifier: unknown): identifier is string {
|
|
170
|
+
if (!boundedNonEmptyString(identifier, 256)) return false;
|
|
171
|
+
try {
|
|
172
|
+
const url = new URL(identifier);
|
|
173
|
+
return safeIdentifierUrl(url, identifier);
|
|
174
|
+
} catch {
|
|
175
|
+
return false;
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
function safeIdentifierUrl(url: URL, identifier: string): boolean {
|
|
180
|
+
return (
|
|
181
|
+
(url.protocol === "https:" || url.protocol === "urn:") &&
|
|
182
|
+
url.username.length === 0 &&
|
|
183
|
+
url.password.length === 0 &&
|
|
184
|
+
url.search.length === 0 &&
|
|
185
|
+
url.hash.length === 0 &&
|
|
186
|
+
url.href === identifier
|
|
187
|
+
);
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
function safeHttpsOrigin(origin: unknown): origin is string {
|
|
191
|
+
if (!boundedNonEmptyString(origin, 200)) return false;
|
|
192
|
+
try {
|
|
193
|
+
const url = new URL(origin);
|
|
194
|
+
return safeHttpsOriginUrl(url, origin);
|
|
195
|
+
} catch {
|
|
196
|
+
return false;
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
function safeHttpsOriginUrl(url: URL, origin: string): boolean {
|
|
201
|
+
return (
|
|
202
|
+
url.protocol === "https:" &&
|
|
203
|
+
url.hostname.length > 0 &&
|
|
204
|
+
url.username.length === 0 &&
|
|
205
|
+
url.password.length === 0 &&
|
|
206
|
+
url.search.length === 0 &&
|
|
207
|
+
url.hash.length === 0 &&
|
|
208
|
+
url.pathname === "/" &&
|
|
209
|
+
url.origin === origin
|
|
210
|
+
);
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
function safePathPrefix(pathPrefix: unknown): pathPrefix is string {
|
|
214
|
+
if (!validPathPrefixSyntax(pathPrefix)) return false;
|
|
215
|
+
const segments = pathPrefix.split("/");
|
|
216
|
+
return segments.every(
|
|
217
|
+
(segment, index) => index === 0 || segment === "" || (segment !== "." && segment !== "..")
|
|
218
|
+
);
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
function validPathPrefixSyntax(pathPrefix: unknown): pathPrefix is string {
|
|
222
|
+
return (
|
|
223
|
+
boundedNonEmptyString(pathPrefix, 256) &&
|
|
224
|
+
pathPrefix.startsWith("/") &&
|
|
225
|
+
(pathPrefix === "/" || pathPrefix.endsWith("/")) &&
|
|
226
|
+
!pathPrefix.includes("\\") &&
|
|
227
|
+
!pathPrefix.includes("?") &&
|
|
228
|
+
!pathPrefix.includes("#") &&
|
|
229
|
+
!pathPrefix.includes("//")
|
|
230
|
+
);
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
function boundedNonEmptyString(value: unknown, maximumLength: number): value is string {
|
|
234
|
+
return typeof value === "string" && value.length > 0 && value.length <= maximumLength;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
function normalizedProjectJsonPath(projectPath: unknown): projectPath is string {
|
|
238
|
+
if (
|
|
239
|
+
typeof projectPath !== "string" ||
|
|
240
|
+
projectPath.length === 0 ||
|
|
241
|
+
projectPath.length > 512 ||
|
|
242
|
+
!projectPath.endsWith(".json") ||
|
|
243
|
+
projectPath.startsWith("/") ||
|
|
244
|
+
projectPath.includes("\\") ||
|
|
245
|
+
projectPath.includes("\u0000")
|
|
246
|
+
) {
|
|
247
|
+
return false;
|
|
248
|
+
}
|
|
249
|
+
return projectPath
|
|
250
|
+
.split("/")
|
|
251
|
+
.every((segment) => segment.length > 0 && segment !== "." && segment !== "..");
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
function safeBindingId(bindingId: unknown): bindingId is string {
|
|
255
|
+
return typeof bindingId === "string" && /^[A-Za-z0-9][A-Za-z0-9_.-]{0,127}$/u.test(bindingId);
|
|
256
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
ProjectFileSelection,
|
|
3
|
+
ProjectFileSelectionOptions
|
|
4
|
+
} from "../project-files/configuration.ts";
|
|
5
|
+
|
|
6
|
+
export type JsonSchemaIdentityMode =
|
|
7
|
+
| "require-match"
|
|
8
|
+
| "configuration-authoritative"
|
|
9
|
+
| "document-authoritative";
|
|
10
|
+
|
|
11
|
+
export interface JsonSchemaIdentity {
|
|
12
|
+
readonly mode: JsonSchemaIdentityMode;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export type JsonSchemaReferenceSource =
|
|
16
|
+
| Readonly<{ readonly kind: "bundled"; readonly catalog: "json-schema-2020-12" }>
|
|
17
|
+
| Readonly<{
|
|
18
|
+
readonly kind: "https";
|
|
19
|
+
readonly id: string;
|
|
20
|
+
readonly origin: string;
|
|
21
|
+
readonly pathPrefix: string;
|
|
22
|
+
}>;
|
|
23
|
+
|
|
24
|
+
export type JsonSchemaReferenceResolution =
|
|
25
|
+
| Readonly<{ readonly mode: "offline" }>
|
|
26
|
+
| Readonly<{
|
|
27
|
+
readonly mode: "allowlisted";
|
|
28
|
+
readonly sources: readonly JsonSchemaReferenceSource[];
|
|
29
|
+
}>;
|
|
30
|
+
|
|
31
|
+
export interface RegisteredJsonSchema {
|
|
32
|
+
readonly id: string;
|
|
33
|
+
readonly path: string;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export interface JsonSchemaInstanceBinding {
|
|
37
|
+
readonly id: string;
|
|
38
|
+
readonly instancePath: string;
|
|
39
|
+
readonly schemaId: string;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/** `jsonSchemaValidation(options?)` 接受的可省略 authoring policy。 */
|
|
43
|
+
export interface JsonSchemaValidationOptions {
|
|
44
|
+
/** schema/instance declarations 必须属于的 repository-file selection。 */
|
|
45
|
+
readonly files?: ProjectFileSelectionOptions;
|
|
46
|
+
/** 每个 local schema/instance document 允许的最大 raw byte 数;省略时为 1 MiB。 */
|
|
47
|
+
readonly maximumBytes?: number;
|
|
48
|
+
/** 整个 Check 共用的 schema root identity 规则;不得按 schema 混用。 */
|
|
49
|
+
readonly schemaIdentity?: JsonSchemaIdentity;
|
|
50
|
+
/** 默认离线;额外 schema source 必须显式 allowlist。 */
|
|
51
|
+
readonly referenceResolution?: JsonSchemaReferenceResolution;
|
|
52
|
+
/** 显式注册的 schema resources;ID 是 binding 和 public fact 使用的安全 authoring identity。 */
|
|
53
|
+
readonly schemas?: readonly RegisteredJsonSchema[];
|
|
54
|
+
/** 明确把一个由本 Check file selection 批准的 instance path 绑定到已声明 schema。 */
|
|
55
|
+
readonly bindings?: readonly JsonSchemaInstanceBinding[];
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/** `json-schema-validation` execution 消费的完整、冻结 options。 */
|
|
59
|
+
export interface ResolvedJsonSchemaValidationOptions {
|
|
60
|
+
readonly files: ProjectFileSelection;
|
|
61
|
+
readonly maximumBytes: number;
|
|
62
|
+
readonly schemaIdentity: JsonSchemaIdentity;
|
|
63
|
+
readonly referenceResolution: JsonSchemaReferenceResolution;
|
|
64
|
+
readonly schemas: readonly RegisteredJsonSchema[];
|
|
65
|
+
readonly bindings: readonly JsonSchemaInstanceBinding[];
|
|
66
|
+
}
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
import type { AnySchemaObject } from "ajv";
|
|
2
|
+
|
|
3
|
+
import type { ResolvedJsonSchemaValidationOptions } from "./options.ts";
|
|
4
|
+
import type { SchemaCompileReason } from "./schema-engine.ts";
|
|
5
|
+
import { inspectSchemaPolicy, isJsonObject } from "./schema-policy.ts";
|
|
6
|
+
import { inspectStrictJsonBytes } from "../json-document/strict-document.ts";
|
|
7
|
+
import { normalizeRemoteReference, readBoundedResponse } from "./remote-response.ts";
|
|
8
|
+
|
|
9
|
+
interface ControlledResolverInput {
|
|
10
|
+
readonly referenceResolution: ResolvedJsonSchemaValidationOptions["referenceResolution"];
|
|
11
|
+
readonly signal: AbortSignal;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
const MAX_REMOTE_RESPONSE_BYTES = 1_048_576;
|
|
15
|
+
const REMOTE_TIMEOUT_MS = 5_000;
|
|
16
|
+
|
|
17
|
+
export class ControlledReferenceResolver {
|
|
18
|
+
readonly #cache = new Map<string, Promise<AnySchemaObject>>();
|
|
19
|
+
#loadQueue: Promise<void> = Promise.resolve();
|
|
20
|
+
readonly #allowedHttpsSources: readonly Readonly<{
|
|
21
|
+
readonly origin: string;
|
|
22
|
+
readonly pathPrefix: string;
|
|
23
|
+
}>[];
|
|
24
|
+
readonly #resolverInput: ControlledResolverInput;
|
|
25
|
+
|
|
26
|
+
constructor(input: ControlledResolverInput) {
|
|
27
|
+
this.#resolverInput = input;
|
|
28
|
+
this.#allowedHttpsSources =
|
|
29
|
+
input.referenceResolution.mode === "allowlisted"
|
|
30
|
+
? Object.freeze(
|
|
31
|
+
input.referenceResolution.sources.flatMap((source) =>
|
|
32
|
+
source.kind === "https"
|
|
33
|
+
? [Object.freeze({ origin: source.origin, pathPrefix: source.pathPrefix })]
|
|
34
|
+
: []
|
|
35
|
+
)
|
|
36
|
+
)
|
|
37
|
+
: Object.freeze([]);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
load(referenceUri: string): Promise<AnySchemaObject> {
|
|
41
|
+
let normalizedReferenceUri: string;
|
|
42
|
+
try {
|
|
43
|
+
normalizedReferenceUri = normalizeRemoteReference(referenceUri);
|
|
44
|
+
} catch {
|
|
45
|
+
return Promise.reject(new ReferenceResolutionFailure("unapproved-reference"));
|
|
46
|
+
}
|
|
47
|
+
const cached = this.#cache.get(normalizedReferenceUri);
|
|
48
|
+
if (cached !== undefined) return cached;
|
|
49
|
+
const loading = this.queueLoad(normalizedReferenceUri);
|
|
50
|
+
this.#cache.set(normalizedReferenceUri, loading);
|
|
51
|
+
return loading;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
private queueLoad(referenceUri: string): Promise<AnySchemaObject> {
|
|
55
|
+
const loading = this.#loadQueue.then(
|
|
56
|
+
() => this.loadUncached(referenceUri),
|
|
57
|
+
() => this.loadUncached(referenceUri)
|
|
58
|
+
);
|
|
59
|
+
this.#loadQueue = loading.then(
|
|
60
|
+
() => undefined,
|
|
61
|
+
() => undefined
|
|
62
|
+
);
|
|
63
|
+
return loading;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
private async loadUncached(referenceUri: string): Promise<AnySchemaObject> {
|
|
67
|
+
if (!this.isAllowedReference(referenceUri))
|
|
68
|
+
throw new ReferenceResolutionFailure("unapproved-reference");
|
|
69
|
+
if (this.#resolverInput.signal.aborted) throw new ReferenceTransportFailure();
|
|
70
|
+
const controller = new AbortController();
|
|
71
|
+
const abortForCaller = (): void => controller.abort();
|
|
72
|
+
this.#resolverInput.signal.addEventListener("abort", abortForCaller, { once: true });
|
|
73
|
+
const timeout = setTimeout(() => controller.abort(), REMOTE_TIMEOUT_MS);
|
|
74
|
+
try {
|
|
75
|
+
return await this.loadWithController(referenceUri, controller);
|
|
76
|
+
} catch (error) {
|
|
77
|
+
if (
|
|
78
|
+
error instanceof ReferenceResolutionFailure ||
|
|
79
|
+
error instanceof ReferenceTransportFailure
|
|
80
|
+
) {
|
|
81
|
+
throw error;
|
|
82
|
+
}
|
|
83
|
+
throw new ReferenceTransportFailure();
|
|
84
|
+
} finally {
|
|
85
|
+
clearTimeout(timeout);
|
|
86
|
+
this.#resolverInput.signal.removeEventListener("abort", abortForCaller);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
private async loadWithController(
|
|
91
|
+
referenceUri: string,
|
|
92
|
+
controller: AbortController
|
|
93
|
+
): Promise<AnySchemaObject> {
|
|
94
|
+
const response = await fetchSchemaResponse(referenceUri, controller.signal);
|
|
95
|
+
assertAllowedResponse(response);
|
|
96
|
+
if (this.#resolverInput.signal.aborted) throw new ReferenceTransportFailure();
|
|
97
|
+
const bytes = await readBoundedResponse(
|
|
98
|
+
response,
|
|
99
|
+
MAX_REMOTE_RESPONSE_BYTES,
|
|
100
|
+
this.#resolverInput.signal
|
|
101
|
+
);
|
|
102
|
+
return schemaFromRemoteBytes(bytes, referenceUri);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
private isAllowedReference(referenceUri: string): boolean {
|
|
106
|
+
let url: URL;
|
|
107
|
+
try {
|
|
108
|
+
url = new URL(referenceUri);
|
|
109
|
+
} catch {
|
|
110
|
+
return false;
|
|
111
|
+
}
|
|
112
|
+
return this.#allowedHttpsSources.some(
|
|
113
|
+
(source) =>
|
|
114
|
+
url.origin === source.origin &&
|
|
115
|
+
(source.pathPrefix === "/" || url.pathname.startsWith(source.pathPrefix))
|
|
116
|
+
);
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
async function fetchSchemaResponse(referenceUri: string, signal: AbortSignal): Promise<Response> {
|
|
121
|
+
if (typeof globalThis.fetch !== "function") throw new ReferenceTransportFailure();
|
|
122
|
+
return globalThis.fetch(referenceUri, {
|
|
123
|
+
credentials: "omit",
|
|
124
|
+
method: "GET",
|
|
125
|
+
redirect: "manual",
|
|
126
|
+
signal
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
function assertAllowedResponse(response: Response): void {
|
|
131
|
+
if (response.redirected || (response.status >= 300 && response.status < 400)) {
|
|
132
|
+
throw new ReferenceResolutionFailure("unapproved-reference");
|
|
133
|
+
}
|
|
134
|
+
if (response.ok) return;
|
|
135
|
+
if (response.status >= 500) throw new ReferenceTransportFailure();
|
|
136
|
+
throw new ReferenceResolutionFailure("unapproved-reference");
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
function schemaFromRemoteBytes(
|
|
140
|
+
bytes: Uint8Array | "too-large",
|
|
141
|
+
referenceUri: string
|
|
142
|
+
): AnySchemaObject {
|
|
143
|
+
if (bytes === "too-large") throw new ReferenceResolutionFailure("remote-document-invalid");
|
|
144
|
+
const document = inspectStrictJsonBytes(bytes);
|
|
145
|
+
if (document.kind !== "valid" || !isJsonObject(document.jsonValue)) {
|
|
146
|
+
throw new ReferenceResolutionFailure("remote-document-invalid");
|
|
147
|
+
}
|
|
148
|
+
if (document.jsonValue.$id !== referenceUri) {
|
|
149
|
+
throw new ReferenceResolutionFailure("remote-schema-id-mismatch");
|
|
150
|
+
}
|
|
151
|
+
const referenceReason = inspectSchemaPolicy(document.jsonValue);
|
|
152
|
+
if (referenceReason !== undefined) throw new ReferenceResolutionFailure(referenceReason);
|
|
153
|
+
return document.jsonValue;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
export class ReferenceResolutionFailure extends Error {
|
|
157
|
+
readonly reason: SchemaCompileReason;
|
|
158
|
+
|
|
159
|
+
constructor(reason: SchemaCompileReason) {
|
|
160
|
+
super(reason);
|
|
161
|
+
this.reason = reason;
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
export class ReferenceTransportFailure extends Error {}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
export async function readBoundedResponse(
|
|
2
|
+
response: Response,
|
|
3
|
+
maximumBytes: number,
|
|
4
|
+
signal: AbortSignal
|
|
5
|
+
): Promise<Uint8Array | "too-large"> {
|
|
6
|
+
if (declaredResponseIsTooLarge(response, maximumBytes)) return "too-large";
|
|
7
|
+
const reader = response.body?.getReader();
|
|
8
|
+
if (reader === undefined) return new Uint8Array();
|
|
9
|
+
|
|
10
|
+
const chunks = await readResponseChunks(reader, maximumBytes, signal);
|
|
11
|
+
return chunks === "too-large" ? chunks : assembleResponseBytes(chunks);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
function declaredResponseIsTooLarge(response: Response, maximumBytes: number): boolean {
|
|
15
|
+
const length = response.headers.get("content-length");
|
|
16
|
+
return length !== null && /^\d+$/u.test(length) && Number(length) > maximumBytes;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
async function readResponseChunks(
|
|
20
|
+
reader: ReadableStreamDefaultReader<Uint8Array>,
|
|
21
|
+
maximumBytes: number,
|
|
22
|
+
signal: AbortSignal
|
|
23
|
+
): Promise<readonly Uint8Array[] | "too-large"> {
|
|
24
|
+
const chunks: Uint8Array[] = [];
|
|
25
|
+
let total = 0;
|
|
26
|
+
try {
|
|
27
|
+
while (true) {
|
|
28
|
+
if (signal.aborted) throw transportFailure();
|
|
29
|
+
const chunk = await reader.read();
|
|
30
|
+
if (chunk.done) break;
|
|
31
|
+
total += chunk.value.byteLength;
|
|
32
|
+
if (total > maximumBytes) {
|
|
33
|
+
await cancelRejectedReader(reader);
|
|
34
|
+
return "too-large";
|
|
35
|
+
}
|
|
36
|
+
chunks.push(chunk.value);
|
|
37
|
+
}
|
|
38
|
+
return chunks;
|
|
39
|
+
} catch {
|
|
40
|
+
throw transportFailure();
|
|
41
|
+
} finally {
|
|
42
|
+
reader.releaseLock();
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
async function cancelRejectedReader(
|
|
47
|
+
reader: ReadableStreamDefaultReader<Uint8Array>
|
|
48
|
+
): Promise<void> {
|
|
49
|
+
try {
|
|
50
|
+
await reader.cancel();
|
|
51
|
+
} catch {
|
|
52
|
+
// The bounded response has already been rejected; cancellation detail is not a transport fact.
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
function assembleResponseBytes(chunks: readonly Uint8Array[]): Uint8Array {
|
|
57
|
+
const responseBytes = new Uint8Array(
|
|
58
|
+
chunks.reduce((total, chunk) => total + chunk.byteLength, 0)
|
|
59
|
+
);
|
|
60
|
+
let offset = 0;
|
|
61
|
+
for (const chunk of chunks) {
|
|
62
|
+
responseBytes.set(chunk, offset);
|
|
63
|
+
offset += chunk.byteLength;
|
|
64
|
+
}
|
|
65
|
+
return responseBytes;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
function transportFailure(): Error {
|
|
69
|
+
return new Error("remote response transport failed");
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export function normalizeRemoteReference(referenceUri: string): string {
|
|
73
|
+
const url = new URL(referenceUri);
|
|
74
|
+
if (
|
|
75
|
+
url.protocol !== "https:" ||
|
|
76
|
+
url.username.length > 0 ||
|
|
77
|
+
url.password.length > 0 ||
|
|
78
|
+
url.search.length > 0 ||
|
|
79
|
+
url.hash.length > 0
|
|
80
|
+
) {
|
|
81
|
+
throw new TypeError("unapproved remote reference");
|
|
82
|
+
}
|
|
83
|
+
return url.href;
|
|
84
|
+
}
|