@zxyycom/vibe-check 0.0.2 → 0.0.3
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/README.md +36 -5
- package/dist/esm/check/check.mjs +4 -0
- package/dist/esm/check/check.mjs.map +1 -1
- package/dist/esm/check/flag-enablement.mjs +32 -0
- package/dist/esm/check/flag-enablement.mjs.map +1 -0
- package/dist/esm/check/handoff-provider-identity.mjs +18 -0
- package/dist/esm/check/handoff-provider-identity.mjs.map +1 -0
- package/dist/esm/check/inherited-collection.mjs +1 -1
- package/dist/esm/check/inherited-collection.mjs.map +1 -1
- package/dist/esm/check/project-changes.mjs +2 -0
- package/dist/esm/check/project-changes.mjs.map +1 -0
- package/dist/esm/check/project-context.mjs +2 -0
- package/dist/esm/check/project-context.mjs.map +1 -0
- package/dist/esm/check-settlement/facts.mjs.map +1 -1
- package/dist/esm/check-settlement/record-store.mjs +1 -1
- package/dist/esm/check-settlement/record-store.mjs.map +1 -1
- package/dist/esm/data-boundary/canonical-data.mjs +36 -7
- package/dist/esm/data-boundary/canonical-data.mjs.map +1 -1
- package/dist/esm/data-boundary/canonical-json.mjs.map +1 -1
- package/dist/esm/data-boundary/closed-values.mjs +28 -4
- package/dist/esm/data-boundary/closed-values.mjs.map +1 -1
- package/dist/esm/{package-checks/project-files → data-boundary}/config-glob.mjs +3 -3
- package/dist/esm/data-boundary/config-glob.mjs.map +1 -0
- package/dist/esm/data-boundary/project-path.mjs +19 -0
- package/dist/esm/data-boundary/project-path.mjs.map +1 -0
- package/dist/esm/index.mjs +12 -5
- package/dist/esm/index.mjs.map +1 -1
- package/dist/esm/machine-output/v4/atomic-publication.mjs +4 -1
- package/dist/esm/machine-output/v4/atomic-publication.mjs.map +1 -1
- package/dist/esm/package-checks/check-authoring.mjs +69 -0
- package/dist/esm/package-checks/check-authoring.mjs.map +1 -0
- package/dist/esm/package-checks/code-quality-findings/finding-waiver-authoring.mjs.map +1 -1
- package/dist/esm/package-checks/code-quality-findings/finding-waiver-evidence.mjs.map +1 -1
- package/dist/esm/package-checks/command-check/command-check.mjs +55 -0
- package/dist/esm/package-checks/command-check/command-check.mjs.map +1 -0
- package/dist/esm/package-checks/command-check/contract.mjs +2 -0
- package/dist/esm/package-checks/command-check/contract.mjs.map +1 -0
- package/dist/esm/package-checks/command-check/execution.mjs +134 -0
- package/dist/esm/package-checks/command-check/execution.mjs.map +1 -0
- package/dist/esm/package-checks/command-check/options.mjs +284 -0
- package/dist/esm/package-checks/command-check/options.mjs.map +1 -0
- package/dist/esm/package-checks/command-check/transcript.mjs +26 -0
- package/dist/esm/package-checks/command-check/transcript.mjs.map +1 -0
- package/dist/esm/package-checks/duplicate-detection/default-check.mjs +9 -11
- package/dist/esm/package-checks/duplicate-detection/default-check.mjs.map +1 -1
- package/dist/esm/package-checks/duplicate-detection/execution.mjs +2 -4
- package/dist/esm/package-checks/duplicate-detection/execution.mjs.map +1 -1
- package/dist/esm/package-checks/duplicate-detection/finding-messages.mjs +1 -1
- package/dist/esm/package-checks/duplicate-detection/finding-messages.mjs.map +1 -1
- package/dist/esm/package-checks/duplicate-detection/jscpd/availability.mjs +1 -1
- package/dist/esm/package-checks/duplicate-detection/jscpd/availability.mjs.map +1 -1
- package/dist/esm/package-checks/duplicate-detection/options.mjs.map +1 -1
- package/dist/esm/package-checks/duplicate-detection/records.mjs.map +1 -1
- package/dist/esm/package-checks/file-metrics/constructor.mjs +9 -11
- package/dist/esm/package-checks/file-metrics/constructor.mjs.map +1 -1
- package/dist/esm/package-checks/file-metrics/execution.mjs +2 -4
- package/dist/esm/package-checks/file-metrics/execution.mjs.map +1 -1
- package/dist/esm/package-checks/file-metrics/finding-messages.mjs +1 -1
- package/dist/esm/package-checks/file-metrics/finding-messages.mjs.map +1 -1
- package/dist/esm/package-checks/file-metrics/options.mjs.map +1 -1
- package/dist/esm/package-checks/file-metrics/records.mjs.map +1 -1
- package/dist/esm/package-checks/file-metrics/scc/availability.mjs +1 -1
- package/dist/esm/package-checks/file-metrics/scc/availability.mjs.map +1 -1
- package/dist/esm/package-checks/file-metrics/scc/batch-planner.mjs +38 -0
- package/dist/esm/package-checks/file-metrics/scc/batch-planner.mjs.map +1 -0
- package/dist/esm/package-checks/file-metrics/scc/logical-scan-resources.mjs +35 -0
- package/dist/esm/package-checks/file-metrics/scc/logical-scan-resources.mjs.map +1 -0
- package/dist/esm/package-checks/file-metrics/scc/scanner.mjs +102 -29
- package/dist/esm/package-checks/file-metrics/scc/scanner.mjs.map +1 -1
- package/dist/esm/package-checks/function-metrics/analysis.mjs +7 -2
- package/dist/esm/package-checks/function-metrics/analysis.mjs.map +1 -1
- package/dist/esm/package-checks/function-metrics/analyzer/analysis-model.mjs +1 -1
- package/dist/esm/package-checks/function-metrics/analyzer/analysis-model.mjs.map +1 -1
- package/dist/esm/package-checks/function-metrics/analyzer/extensions/lizardcomplextags.mjs +1 -3
- package/dist/esm/package-checks/function-metrics/analyzer/extensions/lizardcomplextags.mjs.map +1 -1
- package/dist/esm/package-checks/function-metrics/analyzer/extensions/protocol.mjs.map +1 -1
- package/dist/esm/package-checks/function-metrics/analyzer/pipeline.mjs +3 -2
- package/dist/esm/package-checks/function-metrics/analyzer/pipeline.mjs.map +1 -1
- package/dist/esm/package-checks/function-metrics/analyzer/readers/erlang.mjs +6 -6
- package/dist/esm/package-checks/function-metrics/analyzer/readers/erlang.mjs.map +1 -1
- package/dist/esm/package-checks/function-metrics/analyzer/readers/fortran.mjs +1 -1
- package/dist/esm/package-checks/function-metrics/analyzer/readers/fortran.mjs.map +1 -1
- package/dist/esm/package-checks/function-metrics/analyzer/readers/objc.mjs +9 -3
- package/dist/esm/package-checks/function-metrics/analyzer/readers/objc.mjs.map +1 -1
- package/dist/esm/package-checks/function-metrics/analyzer/readers/php-states.mjs +12 -7
- package/dist/esm/package-checks/function-metrics/analyzer/readers/php-states.mjs.map +1 -1
- package/dist/esm/package-checks/function-metrics/analyzer/readers/plsql.mjs +6 -6
- package/dist/esm/package-checks/function-metrics/analyzer/readers/plsql.mjs.map +1 -1
- package/dist/esm/package-checks/function-metrics/analyzer/readers/python.mjs +5 -3
- package/dist/esm/package-checks/function-metrics/analyzer/readers/python.mjs.map +1 -1
- package/dist/esm/package-checks/function-metrics/analyzer/readers/r.mjs +2 -0
- package/dist/esm/package-checks/function-metrics/analyzer/readers/r.mjs.map +1 -1
- package/dist/esm/package-checks/function-metrics/analyzer/readers/ttcn.mjs +9 -3
- package/dist/esm/package-checks/function-metrics/analyzer/readers/ttcn.mjs.map +1 -1
- package/dist/esm/package-checks/function-metrics/analyzer/readers/typescript.mjs +9 -3
- package/dist/esm/package-checks/function-metrics/analyzer/readers/typescript.mjs.map +1 -1
- package/dist/esm/package-checks/function-metrics/analyzer/readers/zig.mjs +3 -1
- package/dist/esm/package-checks/function-metrics/analyzer/readers/zig.mjs.map +1 -1
- package/dist/esm/package-checks/function-metrics/analyzer/shared/code-reader.mjs +3 -1
- package/dist/esm/package-checks/function-metrics/analyzer/shared/code-reader.mjs.map +1 -1
- package/dist/esm/package-checks/function-metrics/analyzer/shared/js-style-regex.mjs +12 -5
- package/dist/esm/package-checks/function-metrics/analyzer/shared/js-style-regex.mjs.map +1 -1
- package/dist/esm/package-checks/function-metrics/analyzer-worker-port.mjs +20 -8
- package/dist/esm/package-checks/function-metrics/analyzer-worker-port.mjs.map +1 -1
- package/dist/esm/package-checks/function-metrics/constructor.mjs +9 -11
- package/dist/esm/package-checks/function-metrics/constructor.mjs.map +1 -1
- package/dist/esm/package-checks/function-metrics/execution.mjs +2 -4
- package/dist/esm/package-checks/function-metrics/execution.mjs.map +1 -1
- package/dist/esm/package-checks/function-metrics/finding-messages.mjs +1 -1
- package/dist/esm/package-checks/function-metrics/finding-messages.mjs.map +1 -1
- package/dist/esm/package-checks/function-metrics/measurement.mjs +3 -1
- package/dist/esm/package-checks/function-metrics/measurement.mjs.map +1 -1
- package/dist/esm/package-checks/function-metrics/options.mjs.map +1 -1
- package/dist/esm/package-checks/function-metrics/records.mjs.map +1 -1
- package/dist/esm/package-checks/host-environment/git.mjs +11 -0
- package/dist/esm/package-checks/host-environment/git.mjs.map +1 -1
- package/dist/esm/package-checks/host-environment/path.mjs +1 -17
- package/dist/esm/package-checks/host-environment/path.mjs.map +1 -1
- package/dist/esm/package-checks/host-environment/process/contract.mjs.map +1 -1
- package/dist/esm/package-checks/host-environment/process/result.mjs +43 -17
- package/dist/esm/package-checks/host-environment/process/result.mjs.map +1 -1
- package/dist/esm/package-checks/host-environment/process/runner.mjs +7 -5
- package/dist/esm/package-checks/host-environment/process/runner.mjs.map +1 -1
- package/dist/esm/package-checks/json-schema-validation/default-check.mjs +9 -11
- package/dist/esm/package-checks/json-schema-validation/default-check.mjs.map +1 -1
- package/dist/esm/package-checks/json-schema-validation/options.mjs.map +1 -1
- package/dist/esm/package-checks/json-schema-validation/reference-resolver.mjs +6 -2
- package/dist/esm/package-checks/json-schema-validation/reference-resolver.mjs.map +1 -1
- package/dist/esm/package-checks/json-schema-validation/schema-policy.mjs +11 -3
- package/dist/esm/package-checks/json-schema-validation/schema-policy.mjs.map +1 -1
- package/dist/esm/package-checks/json-validation/default-check.mjs +9 -11
- package/dist/esm/package-checks/json-validation/default-check.mjs.map +1 -1
- package/dist/esm/package-checks/json-validation/options.mjs.map +1 -1
- package/dist/esm/package-checks/local-cache-options.mjs +28 -0
- package/dist/esm/package-checks/local-cache-options.mjs.map +1 -0
- package/dist/esm/package-checks/maintenance-reminders/maintenance-reminders.mjs +37 -45
- package/dist/esm/package-checks/maintenance-reminders/maintenance-reminders.mjs.map +1 -1
- package/dist/esm/package-checks/maintenance-reminders/maintenance-support.mjs +3 -1
- package/dist/esm/package-checks/maintenance-reminders/maintenance-support.mjs.map +1 -1
- package/dist/esm/package-checks/markdown-link-validation/default-check.mjs +19 -33
- package/dist/esm/package-checks/markdown-link-validation/default-check.mjs.map +1 -1
- package/dist/esm/package-checks/markdown-link-validation/execution.mjs +1 -1
- package/dist/esm/package-checks/markdown-link-validation/execution.mjs.map +1 -1
- package/dist/esm/package-checks/markdown-link-validation/finding-messages.mjs +1 -1
- package/dist/esm/package-checks/markdown-link-validation/finding-messages.mjs.map +1 -1
- package/dist/esm/package-checks/markdown-link-validation/markdown-parser.mjs +1 -3
- package/dist/esm/package-checks/markdown-link-validation/markdown-parser.mjs.map +1 -1
- package/dist/esm/package-checks/markdown-link-validation/options-resolution.mjs +3 -18
- package/dist/esm/package-checks/markdown-link-validation/options-resolution.mjs.map +1 -1
- package/dist/esm/package-checks/markdown-link-validation/options-validation.mjs +2 -14
- package/dist/esm/package-checks/markdown-link-validation/options-validation.mjs.map +1 -1
- package/dist/esm/package-checks/markdown-link-validation/options.mjs.map +1 -1
- package/dist/esm/package-checks/markdown-link-validation/parse-facts-cache-payload.mjs +4 -5
- package/dist/esm/package-checks/markdown-link-validation/parse-facts-cache-payload.mjs.map +1 -1
- package/dist/esm/package-checks/markdown-lint/adapter.mjs +125 -0
- package/dist/esm/package-checks/markdown-lint/adapter.mjs.map +1 -0
- package/dist/esm/package-checks/markdown-lint/default-check.mjs +37 -0
- package/dist/esm/package-checks/markdown-lint/default-check.mjs.map +1 -0
- package/dist/esm/package-checks/markdown-lint/execution.mjs +202 -0
- package/dist/esm/package-checks/markdown-lint/execution.mjs.map +1 -0
- package/dist/esm/package-checks/markdown-lint/final-data.mjs +16 -0
- package/dist/esm/package-checks/markdown-lint/final-data.mjs.map +1 -0
- package/dist/esm/package-checks/markdown-lint/finding-messages.mjs +72 -0
- package/dist/esm/package-checks/markdown-lint/finding-messages.mjs.map +1 -0
- package/dist/esm/package-checks/markdown-lint/finding-waiver-identity.mjs +41 -0
- package/dist/esm/package-checks/markdown-lint/finding-waiver-identity.mjs.map +1 -0
- package/dist/esm/package-checks/markdown-lint/findings-cache.mjs +110 -0
- package/dist/esm/package-checks/markdown-lint/findings-cache.mjs.map +1 -0
- package/dist/esm/package-checks/markdown-lint/options-resolution.mjs +74 -0
- package/dist/esm/package-checks/markdown-lint/options-resolution.mjs.map +1 -0
- package/dist/esm/package-checks/markdown-lint/options-validation.mjs +41 -0
- package/dist/esm/package-checks/markdown-lint/options-validation.mjs.map +1 -0
- package/dist/esm/package-checks/markdown-lint/options.mjs +13 -0
- package/dist/esm/package-checks/markdown-lint/options.mjs.map +1 -0
- package/dist/esm/package-checks/markdown-lint/records.mjs +65 -0
- package/dist/esm/package-checks/markdown-lint/records.mjs.map +1 -0
- package/dist/esm/package-checks/markdown-lint/unavailable-reasons.mjs +14 -0
- package/dist/esm/package-checks/markdown-lint/unavailable-reasons.mjs.map +1 -0
- package/dist/esm/package-checks/project-files/collection.mjs +23 -19
- package/dist/esm/package-checks/project-files/collection.mjs.map +1 -1
- package/dist/esm/package-checks/project-files/configuration.mjs +1 -1
- package/dist/esm/package-checks/project-files/configuration.mjs.map +1 -1
- package/dist/esm/package-checks/project-files/gitlink-revision.mjs +2 -5
- package/dist/esm/package-checks/project-files/gitlink-revision.mjs.map +1 -1
- package/dist/esm/package-checks/project-files/gitlink-worktree.mjs +22 -6
- package/dist/esm/package-checks/project-files/gitlink-worktree.mjs.map +1 -1
- package/dist/esm/package-checks/project-files/public-collection.mjs +1 -1
- package/dist/esm/package-checks/project-files/public-collection.mjs.map +1 -1
- package/dist/esm/package-checks/project-files/revision-paths.mjs +3 -3
- package/dist/esm/package-checks/project-files/revision-paths.mjs.map +1 -1
- package/dist/esm/package-checks/project-files/revision-worktree-files.mjs +11 -15
- package/dist/esm/package-checks/project-files/revision-worktree-files.mjs.map +1 -1
- package/dist/esm/package-checks/secret-detection/default-check.mjs +9 -11
- package/dist/esm/package-checks/secret-detection/default-check.mjs.map +1 -1
- package/dist/esm/package-checks/secret-detection/execution.mjs +2 -2
- package/dist/esm/package-checks/secret-detection/execution.mjs.map +1 -1
- package/dist/esm/package-checks/secret-detection/input-preparation.mjs +46 -7
- package/dist/esm/package-checks/secret-detection/input-preparation.mjs.map +1 -1
- package/dist/esm/package-checks/secret-detection/options.mjs.map +1 -1
- package/dist/esm/package-checks/secret-detection/records.mjs.map +1 -1
- package/dist/esm/package-checks/secret-detection/secretlint/adapter.mjs +3 -4
- package/dist/esm/package-checks/secret-detection/secretlint/adapter.mjs.map +1 -1
- package/dist/esm/package-tools/admission-policy/define-admission-policy.mjs +10 -0
- package/dist/esm/package-tools/admission-policy/define-admission-policy.mjs.map +1 -0
- package/dist/esm/{cache → package-tools/cache}/cache-json-by-key.mjs +13 -14
- package/dist/esm/package-tools/cache/cache-json-by-key.mjs.map +1 -0
- package/dist/esm/package-tools/finding-presentation/finding-presentation.mjs.map +1 -0
- package/dist/esm/{finding-waivers → package-tools/finding-waivers}/reconciliation.mjs +14 -5
- package/dist/esm/package-tools/finding-waivers/reconciliation.mjs.map +1 -0
- package/dist/esm/package-tools/learned-critical-path/critical-path-ranking.mjs.map +1 -0
- package/dist/esm/package-tools/learned-critical-path/duration-model/bounded-history.mjs.map +1 -0
- package/dist/esm/{learned-critical-path → package-tools/learned-critical-path}/duration-model/prediction.mjs +2 -2
- package/dist/esm/package-tools/learned-critical-path/duration-model/prediction.mjs.map +1 -0
- package/dist/esm/{learned-critical-path → package-tools/learned-critical-path}/duration-model/preparation.mjs +4 -2
- package/dist/esm/package-tools/learned-critical-path/duration-model/preparation.mjs.map +1 -0
- package/dist/esm/package-tools/learned-critical-path/duration-model/recording.mjs.map +1 -0
- package/dist/esm/{learned-critical-path → package-tools/learned-critical-path}/duration-model/storage.mjs +8 -8
- package/dist/esm/package-tools/learned-critical-path/duration-model/storage.mjs.map +1 -0
- package/dist/esm/{learned-critical-path → package-tools/learned-critical-path}/selection-layers.mjs +1 -2
- package/dist/esm/package-tools/learned-critical-path/selection-layers.mjs.map +1 -0
- package/dist/esm/package-tools/learned-critical-path/static-decision.mjs.map +1 -0
- package/dist/esm/{learned-critical-path → package-tools/learned-critical-path}/strategy.mjs +3 -3
- package/dist/esm/package-tools/learned-critical-path/strategy.mjs.map +1 -0
- package/dist/esm/project-definition/check-tree/authoring.mjs +8 -5
- package/dist/esm/project-definition/check-tree/authoring.mjs.map +1 -1
- package/dist/esm/project-definition/check-tree/check-fields-authoring.mjs +79 -66
- package/dist/esm/project-definition/check-tree/check-fields-authoring.mjs.map +1 -1
- package/dist/esm/project-definition/check-tree/flag-conditions.mjs +71 -0
- package/dist/esm/project-definition/check-tree/flag-conditions.mjs.map +1 -0
- package/dist/esm/project-definition/check-tree/materialization.mjs +13 -8
- package/dist/esm/project-definition/check-tree/materialization.mjs.map +1 -1
- package/dist/esm/project-definition/check-tree/resolution.mjs +7 -6
- package/dist/esm/project-definition/check-tree/resolution.mjs.map +1 -1
- package/dist/esm/project-definition/declarative-snapshot.mjs +2 -1
- package/dist/esm/project-definition/declarative-snapshot.mjs.map +1 -1
- package/dist/esm/project-definition/project-changes.mjs +70 -0
- package/dist/esm/project-definition/project-changes.mjs.map +1 -0
- package/dist/esm/project-definition/project-definition-validation.mjs +40 -8
- package/dist/esm/project-definition/project-definition-validation.mjs.map +1 -1
- package/dist/esm/project-definition/project-definition.mjs +22 -15
- package/dist/esm/project-definition/project-definition.mjs.map +1 -1
- package/dist/esm/project-definition/scheduler-policy.mjs.map +1 -1
- package/dist/esm/project-run/admission-strategy-provider/custom-strategy-preparation.mjs +9 -6
- package/dist/esm/project-run/admission-strategy-provider/custom-strategy-preparation.mjs.map +1 -1
- package/dist/esm/project-run/admission-strategy-provider/prepared-admission-strategy.mjs.map +1 -1
- package/dist/esm/project-run/aggregation.mjs +42 -59
- package/dist/esm/project-run/aggregation.mjs.map +1 -1
- package/dist/esm/project-run/changes/git.mjs +161 -0
- package/dist/esm/project-run/changes/git.mjs.map +1 -0
- package/dist/esm/project-run/check-execution/admitted-check-execution.mjs +41 -0
- package/dist/esm/project-run/check-execution/admitted-check-execution.mjs.map +1 -0
- package/dist/esm/project-run/check-execution/callback.mjs +3 -2
- package/dist/esm/project-run/check-execution/callback.mjs.map +1 -1
- package/dist/esm/project-run/check-execution/dependencies.mjs +80 -5
- package/dist/esm/project-run/check-execution/dependencies.mjs.map +1 -1
- package/dist/esm/project-run/check-execution/execution-finalization.mjs +5 -3
- package/dist/esm/project-run/check-execution/execution-finalization.mjs.map +1 -1
- package/dist/esm/project-run/check-execution/execution-settlement.mjs +37 -16
- package/dist/esm/project-run/check-execution/execution-settlement.mjs.map +1 -1
- package/dist/esm/project-run/check-execution/flag-controls.mjs +15 -7
- package/dist/esm/project-run/check-execution/flag-controls.mjs.map +1 -1
- package/dist/esm/project-run/check-execution/lifecycle.mjs.map +1 -1
- package/dist/esm/project-run/check-execution/{preflight-result.mjs → preparation-result.mjs} +24 -24
- package/dist/esm/project-run/check-execution/preparation-result.mjs.map +1 -0
- package/dist/esm/project-run/check-execution/{preflight.mjs → preparation.mjs} +52 -52
- package/dist/esm/project-run/check-execution/preparation.mjs.map +1 -0
- package/dist/esm/project-run/check-execution/ready-check-execution.mjs +71 -0
- package/dist/esm/project-run/check-execution/ready-check-execution.mjs.map +1 -0
- package/dist/esm/project-run/check-execution/resolved-checks.mjs +27 -164
- package/dist/esm/project-run/check-execution/resolved-checks.mjs.map +1 -1
- package/dist/esm/project-run/check-execution/scheduled-check-run.mjs +79 -0
- package/dist/esm/project-run/check-execution/scheduled-check-run.mjs.map +1 -0
- package/dist/esm/project-run/check-execution/terminal-result.mjs +70 -25
- package/dist/esm/project-run/check-execution/terminal-result.mjs.map +1 -1
- package/dist/esm/project-run/completion/completion.mjs +18 -1
- package/dist/esm/project-run/completion/completion.mjs.map +1 -1
- package/dist/esm/project-run/controls/contract.mjs.map +1 -1
- package/dist/esm/project-run/controls/validation.mjs +7 -54
- package/dist/esm/project-run/controls/validation.mjs.map +1 -1
- package/dist/esm/project-run/diagnostic-logging/diagnostic-detail-rendering.mjs +3 -3
- package/dist/esm/project-run/diagnostic-logging/diagnostic-detail-rendering.mjs.map +1 -1
- package/dist/esm/project-run/diagnostic-logging/observation-rendering.mjs +1 -1
- package/dist/esm/project-run/diagnostic-logging/observation-rendering.mjs.map +1 -1
- package/dist/esm/project-run/invocation/candidate.mjs +17 -13
- package/dist/esm/project-run/invocation/candidate.mjs.map +1 -1
- package/dist/esm/project-run/invocation/candidates.mjs +26 -0
- package/dist/esm/project-run/invocation/candidates.mjs.map +1 -0
- package/dist/esm/project-run/invocation/creation.mjs +7 -3
- package/dist/esm/project-run/invocation/creation.mjs.map +1 -1
- package/dist/esm/project-run/invocation/execution.mjs +98 -0
- package/dist/esm/project-run/invocation/execution.mjs.map +1 -0
- package/dist/esm/project-run/invocation/run.mjs +13 -112
- package/dist/esm/project-run/invocation/run.mjs.map +1 -1
- package/dist/esm/project-run/invocation/scheduler.mjs +13 -6
- package/dist/esm/project-run/invocation/scheduler.mjs.map +1 -1
- package/dist/esm/project-run/outputs/status.mjs +12 -12
- package/dist/esm/project-run/outputs/status.mjs.map +1 -1
- package/dist/esm/project-run/progress-rendering/presentation.mjs +31 -11
- package/dist/esm/project-run/progress-rendering/presentation.mjs.map +1 -1
- package/dist/esm/project-run/progress-rendering/renderer-formatting.mjs +11 -4
- package/dist/esm/project-run/progress-rendering/renderer-formatting.mjs.map +1 -1
- package/dist/esm/project-run/progress-rendering/renderer-lifecycle.mjs +20 -6
- package/dist/esm/project-run/progress-rendering/renderer-lifecycle.mjs.map +1 -1
- package/dist/esm/project-run/progress-rendering/renderer.mjs +6 -2
- package/dist/esm/project-run/progress-rendering/renderer.mjs.map +1 -1
- package/dist/esm/project-run/project-context.mjs +2 -1
- package/dist/esm/project-run/project-context.mjs.map +1 -1
- package/dist/esm/project-run/result.mjs +2 -2
- package/dist/esm/project-run/result.mjs.map +1 -1
- package/dist/esm/project-run/run.mjs.map +1 -1
- package/dist/esm/project-run/task-scheduler/admission-core/compiled-graph-lookup.mjs +45 -0
- package/dist/esm/project-run/task-scheduler/admission-core/compiled-graph-lookup.mjs.map +1 -0
- package/dist/esm/project-run/task-scheduler/admission-core/compiled-graph.mjs +9 -4
- package/dist/esm/project-run/task-scheduler/admission-core/compiled-graph.mjs.map +1 -1
- package/dist/esm/project-run/task-scheduler/admission-core/selection-query.mjs +3 -5
- package/dist/esm/project-run/task-scheduler/admission-core/selection-query.mjs.map +1 -1
- package/dist/esm/project-run/task-scheduler/admission-core/selection-seed.mjs +25 -8
- package/dist/esm/project-run/task-scheduler/admission-core/selection-seed.mjs.map +1 -1
- package/dist/esm/project-run/task-scheduler/admission-core/selection-transition.mjs +8 -8
- package/dist/esm/project-run/task-scheduler/admission-core/selection-transition.mjs.map +1 -1
- package/dist/esm/project-run/task-scheduler/execution-state.mjs.map +1 -1
- package/dist/esm/project-run/task-scheduler/measurement/diagnostics.mjs +8 -4
- package/dist/esm/project-run/task-scheduler/measurement/diagnostics.mjs.map +1 -1
- package/dist/esm/project-run/task-scheduler/measurement/timing.mjs +12 -6
- package/dist/esm/project-run/task-scheduler/measurement/timing.mjs.map +1 -1
- package/dist/esm/project-run/task-scheduler/scheduler-observation.mjs +3 -1
- package/dist/esm/project-run/task-scheduler/scheduler-observation.mjs.map +1 -1
- package/dist/esm/project-run/task-scheduler/scheduler-terminal-measurement.mjs +17 -17
- package/dist/esm/project-run/task-scheduler/scheduler-terminal-measurement.mjs.map +1 -1
- package/dist/esm/project-run/task-scheduler/scheduler.mjs +18 -6
- package/dist/esm/project-run/task-scheduler/scheduler.mjs.map +1 -1
- package/docs/api-mechanics.md +147 -28
- package/docs/changelog.md +145 -2
- package/docs/checks/duplicate-detection.md +22 -3
- package/docs/checks/file-metrics.md +25 -6
- package/docs/checks/function-metrics.md +21 -2
- package/docs/checks/json-schema-validation.md +25 -4
- package/docs/checks/json-validation.md +24 -5
- package/docs/checks/maintenance-reminders.md +30 -6
- package/docs/checks/markdown-link-validation.md +24 -4
- package/docs/checks/markdown-lint.md +167 -0
- package/docs/checks/secret-detection.md +31 -7
- package/docs/examples/artifacts/mixed-outcomes/definition.ts +10 -10
- package/docs/guides/building-project-gate.md +706 -0
- package/docs/guides/callbacks.md +81 -22
- package/docs/guides/check-dependencies.md +41 -10
- package/docs/guides/collecting-project-files.md +7 -7
- package/docs/guides/command-check.md +155 -0
- package/docs/guides/data-boundaries.md +140 -0
- package/docs/guides/extending-check-lifecycle.md +77 -25
- package/docs/guides/finding-waivers.md +43 -1
- package/docs/guides/learned-scheduling.md +1 -1
- package/docs/guides/run-outputs.md +35 -9
- package/docs/guides/scheduling.md +15 -15
- package/docs/output.md +6 -5
- package/package.json +2 -1
- package/src/check/check.ts +332 -92
- package/src/check/flag-enablement.ts +76 -0
- package/src/check/handoff-provider-identity.ts +34 -0
- package/src/check/inherited-collection.ts +1 -1
- package/src/check/project-changes.ts +14 -0
- package/src/check/project-context.ts +11 -0
- package/src/check-settlement/facts.ts +1 -1
- package/src/check-settlement/record-store.ts +1 -1
- package/src/data-boundary/canonical-data.ts +36 -9
- package/src/data-boundary/canonical-json.ts +18 -1
- package/src/data-boundary/closed-values.ts +26 -6
- package/src/data-boundary/config-glob.ts +17 -0
- package/src/data-boundary/project-path.ts +21 -0
- package/src/index.ts +72 -11
- package/src/machine-output/v4/atomic-publication.ts +3 -1
- package/src/package-checks/check-authoring.ts +136 -0
- package/src/package-checks/code-quality-findings/finding-waiver-authoring.ts +1 -1
- package/src/package-checks/code-quality-findings/finding-waiver-evidence.ts +1 -1
- package/src/package-checks/command-check/command-check.ts +152 -0
- package/src/package-checks/command-check/contract.ts +168 -0
- package/src/package-checks/command-check/execution.ts +211 -0
- package/src/package-checks/command-check/options.ts +331 -0
- package/src/package-checks/command-check/transcript.ts +35 -0
- package/src/package-checks/duplicate-detection/default-check.ts +37 -6
- package/src/package-checks/duplicate-detection/execution.ts +2 -4
- package/src/package-checks/duplicate-detection/finding-messages.ts +2 -2
- package/src/package-checks/duplicate-detection/jscpd/availability.ts +1 -1
- package/src/package-checks/duplicate-detection/options.ts +6 -3
- package/src/package-checks/duplicate-detection/records.ts +1 -1
- package/src/package-checks/file-metrics/constructor.ts +29 -6
- package/src/package-checks/file-metrics/execution.ts +2 -4
- package/src/package-checks/file-metrics/finding-messages.ts +1 -1
- package/src/package-checks/file-metrics/options.ts +6 -3
- package/src/package-checks/file-metrics/records.ts +1 -1
- package/src/package-checks/file-metrics/scc/availability.ts +1 -1
- package/src/package-checks/file-metrics/scc/batch-planner.ts +56 -0
- package/src/package-checks/file-metrics/scc/logical-scan-resources.ts +59 -0
- package/src/package-checks/file-metrics/scc/scanner.ts +134 -32
- package/src/package-checks/function-metrics/analysis.ts +7 -2
- package/src/package-checks/function-metrics/analyzer/analysis-model.ts +1 -1
- package/src/package-checks/function-metrics/analyzer/extension-output.ts +14 -6
- package/src/package-checks/function-metrics/analyzer/extensions/lizardcomplextags.ts +1 -3
- package/src/package-checks/function-metrics/analyzer/extensions/protocol.ts +3 -3
- package/src/package-checks/function-metrics/analyzer/pipeline.ts +4 -2
- package/src/package-checks/function-metrics/analyzer/readers/erlang.ts +6 -6
- package/src/package-checks/function-metrics/analyzer/readers/fortran.ts +1 -1
- package/src/package-checks/function-metrics/analyzer/readers/objc.ts +9 -3
- package/src/package-checks/function-metrics/analyzer/readers/php-states.ts +14 -7
- package/src/package-checks/function-metrics/analyzer/readers/plsql.ts +8 -4
- package/src/package-checks/function-metrics/analyzer/readers/python.ts +4 -3
- package/src/package-checks/function-metrics/analyzer/readers/r.ts +2 -1
- package/src/package-checks/function-metrics/analyzer/readers/ttcn.ts +9 -3
- package/src/package-checks/function-metrics/analyzer/readers/typescript.ts +9 -3
- package/src/package-checks/function-metrics/analyzer/readers/zig.ts +2 -1
- package/src/package-checks/function-metrics/analyzer/shared/code-reader.ts +3 -1
- package/src/package-checks/function-metrics/analyzer/shared/js-style-regex.ts +10 -5
- package/src/package-checks/function-metrics/analyzer-worker-port.ts +20 -6
- package/src/package-checks/function-metrics/constructor.ts +30 -7
- package/src/package-checks/function-metrics/execution.ts +2 -4
- package/src/package-checks/function-metrics/finding-messages.ts +2 -2
- package/src/package-checks/function-metrics/measurement.ts +3 -1
- package/src/package-checks/function-metrics/options.ts +6 -3
- package/src/package-checks/function-metrics/records.ts +1 -1
- package/src/package-checks/host-environment/git.ts +11 -0
- package/src/package-checks/host-environment/path.ts +1 -20
- package/src/package-checks/host-environment/process/contract.ts +17 -9
- package/src/package-checks/host-environment/process/result.ts +48 -20
- package/src/package-checks/host-environment/process/runner.ts +8 -4
- package/src/package-checks/json-schema-validation/default-check.ts +38 -5
- package/src/package-checks/json-schema-validation/options.ts +4 -1
- package/src/package-checks/json-schema-validation/reference-resolver.ts +6 -2
- package/src/package-checks/json-schema-validation/schema-policy.ts +10 -5
- package/src/package-checks/json-validation/default-check.ts +27 -6
- package/src/package-checks/json-validation/options.ts +4 -1
- package/src/package-checks/local-cache-options.ts +40 -0
- package/src/package-checks/maintenance-reminders/maintenance-reminders.ts +89 -9
- package/src/package-checks/maintenance-reminders/maintenance-support.ts +3 -3
- package/src/package-checks/markdown-link-validation/default-check.ts +48 -5
- package/src/package-checks/markdown-link-validation/execution.ts +1 -1
- package/src/package-checks/markdown-link-validation/finding-messages.ts +1 -1
- package/src/package-checks/markdown-link-validation/markdown-parser.ts +1 -5
- package/src/package-checks/markdown-link-validation/options-resolution.ts +2 -19
- package/src/package-checks/markdown-link-validation/options-validation.ts +2 -17
- package/src/package-checks/markdown-link-validation/options.ts +6 -7
- package/src/package-checks/markdown-link-validation/parse-facts-cache-payload.ts +4 -5
- package/src/package-checks/markdown-lint/adapter.ts +167 -0
- package/src/package-checks/markdown-lint/default-check.ts +92 -0
- package/src/package-checks/markdown-lint/execution.ts +266 -0
- package/src/package-checks/markdown-lint/final-data.ts +33 -0
- package/src/package-checks/markdown-lint/finding-messages.ts +87 -0
- package/src/package-checks/markdown-lint/finding-waiver-identity.ts +54 -0
- package/src/package-checks/markdown-lint/findings-cache.ts +141 -0
- package/src/package-checks/markdown-lint/options-resolution.ts +102 -0
- package/src/package-checks/markdown-lint/options-validation.ts +50 -0
- package/src/package-checks/markdown-lint/options.ts +82 -0
- package/src/package-checks/markdown-lint/records.ts +132 -0
- package/src/package-checks/markdown-lint/unavailable-reasons.ts +33 -0
- package/src/package-checks/project-files/collection.ts +38 -22
- package/src/package-checks/project-files/config-glob.ts +1 -17
- package/src/package-checks/project-files/configuration.ts +1 -1
- package/src/package-checks/project-files/gitlink-revision.ts +4 -6
- package/src/package-checks/project-files/gitlink-worktree.ts +35 -7
- package/src/package-checks/project-files/public-collection.ts +1 -1
- package/src/package-checks/project-files/revision-paths.ts +3 -3
- package/src/package-checks/project-files/revision-worktree-files.ts +16 -16
- package/src/package-checks/secret-detection/default-check.ts +29 -6
- package/src/package-checks/secret-detection/execution.ts +2 -2
- package/src/package-checks/secret-detection/input-preparation.ts +64 -7
- package/src/package-checks/secret-detection/options.ts +5 -2
- package/src/package-checks/secret-detection/records.ts +1 -1
- package/src/package-checks/secret-detection/secretlint/adapter.ts +3 -4
- package/src/package-tools/admission-policy/define-admission-policy.ts +54 -0
- package/src/{cache → package-tools/cache}/cache-json-by-key.ts +13 -17
- package/src/{check → package-tools/finding-presentation}/finding-presentation.ts +3 -1
- package/src/{finding-waivers → package-tools/finding-waivers}/reconciliation.ts +16 -8
- package/src/{learned-critical-path → package-tools/learned-critical-path}/duration-model/prediction.ts +5 -2
- package/src/{learned-critical-path → package-tools/learned-critical-path}/duration-model/preparation.ts +5 -3
- package/src/{learned-critical-path → package-tools/learned-critical-path}/duration-model/recording.ts +5 -4
- package/src/{learned-critical-path → package-tools/learned-critical-path}/duration-model/storage.ts +9 -10
- package/src/{learned-critical-path → package-tools/learned-critical-path}/selection-layers.ts +2 -3
- package/src/{learned-critical-path → package-tools/learned-critical-path}/static-decision.ts +1 -1
- package/src/{learned-critical-path → package-tools/learned-critical-path}/strategy.ts +7 -4
- package/src/project-definition/check-tree/authoring.ts +15 -8
- package/src/project-definition/check-tree/check-fields-authoring.ts +106 -91
- package/src/project-definition/check-tree/flag-conditions.ts +99 -0
- package/src/project-definition/check-tree/materialization.ts +12 -8
- package/src/project-definition/check-tree/resolution.ts +13 -15
- package/src/project-definition/declarative-snapshot.ts +9 -2
- package/src/project-definition/project-changes.ts +112 -0
- package/src/project-definition/project-definition-validation.ts +58 -10
- package/src/project-definition/project-definition.ts +41 -68
- package/src/project-definition/scheduler-policy.ts +6 -3
- package/src/project-run/admission-strategy-provider/custom-strategy-preparation.ts +11 -8
- package/src/project-run/admission-strategy-provider/prepared-admission-strategy.ts +2 -2
- package/src/project-run/aggregation.ts +51 -74
- package/src/project-run/changes/git.ts +206 -0
- package/src/project-run/check-execution/admitted-check-execution.ts +62 -0
- package/src/project-run/check-execution/callback.ts +3 -2
- package/src/project-run/check-execution/dependencies.ts +120 -6
- package/src/project-run/check-execution/execution-finalization.ts +6 -4
- package/src/project-run/check-execution/execution-settlement.ts +88 -29
- package/src/project-run/check-execution/flag-controls.ts +22 -8
- package/src/project-run/check-execution/lifecycle.ts +14 -6
- package/src/project-run/check-execution/{preflight-result.ts → preparation-result.ts} +34 -32
- package/src/project-run/check-execution/{preflight.ts → preparation.ts} +92 -84
- package/src/project-run/check-execution/ready-check-execution.ts +97 -0
- package/src/project-run/check-execution/resolved-checks.ts +40 -219
- package/src/project-run/check-execution/scheduled-check-run.ts +119 -0
- package/src/project-run/check-execution/terminal-result.ts +108 -29
- package/src/project-run/completion/completion.ts +17 -3
- package/src/project-run/controls/contract.ts +6 -16
- package/src/project-run/controls/validation.ts +7 -60
- package/src/project-run/diagnostic-logging/diagnostic-detail-rendering.ts +1 -2
- package/src/project-run/diagnostic-logging/observation-rendering.ts +1 -1
- package/src/project-run/invocation/candidate.ts +28 -15
- package/src/project-run/invocation/candidates.ts +56 -0
- package/src/project-run/invocation/creation.ts +7 -3
- package/src/project-run/invocation/execution.ts +136 -0
- package/src/project-run/invocation/run.ts +15 -179
- package/src/project-run/invocation/scheduler.ts +13 -6
- package/src/project-run/outputs/status.ts +15 -15
- package/src/project-run/progress-rendering/presentation.ts +35 -13
- package/src/project-run/progress-rendering/renderer-formatting.ts +20 -7
- package/src/project-run/progress-rendering/renderer-lifecycle.ts +23 -6
- package/src/project-run/progress-rendering/renderer.ts +10 -4
- package/src/project-run/project-context.ts +8 -4
- package/src/project-run/result.ts +5 -5
- package/src/project-run/run.ts +1 -1
- package/src/project-run/task-scheduler/admission-core/compiled-graph-lookup.ts +71 -0
- package/src/project-run/task-scheduler/admission-core/compiled-graph.ts +9 -4
- package/src/project-run/task-scheduler/admission-core/selection-query.ts +6 -4
- package/src/project-run/task-scheduler/admission-core/selection-seed.ts +36 -6
- package/src/project-run/task-scheduler/admission-core/selection-transition.ts +17 -8
- package/src/project-run/task-scheduler/execution-state.ts +4 -4
- package/src/project-run/task-scheduler/measurement/diagnostics.ts +10 -4
- package/src/project-run/task-scheduler/measurement/timing.ts +13 -5
- package/src/project-run/task-scheduler/scheduler-observation.ts +3 -1
- package/src/project-run/task-scheduler/scheduler-terminal-measurement.ts +24 -22
- package/src/project-run/task-scheduler/scheduler.ts +23 -6
- package/types/check/check.d.ts +178 -67
- package/types/check/flag-enablement.d.ts +42 -0
- package/types/check/handoff-provider-identity.d.ts +12 -0
- package/types/check/project-changes.d.ts +13 -0
- package/types/check/project-context.d.ts +10 -0
- package/types/check-settlement/facts.d.ts +1 -1
- package/types/data-boundary/canonical-data.d.ts +28 -5
- package/types/data-boundary/canonical-json.d.ts +18 -1
- package/types/data-boundary/closed-values.d.ts +17 -1
- package/types/data-boundary/config-glob.d.ts +5 -0
- package/types/data-boundary/project-path.d.ts +4 -0
- package/types/index.d.ts +27 -11
- package/types/package-checks/check-authoring.d.ts +45 -0
- package/types/package-checks/code-quality-findings/finding-waiver-authoring.d.ts +1 -1
- package/types/package-checks/code-quality-findings/finding-waiver-evidence.d.ts +1 -1
- package/types/package-checks/command-check/command-check.d.ts +48 -0
- package/types/package-checks/command-check/contract.d.ts +108 -0
- package/types/package-checks/command-check/execution.d.ts +7 -0
- package/types/package-checks/command-check/options.d.ts +11 -0
- package/types/package-checks/command-check/transcript.d.ts +8 -0
- package/types/package-checks/duplicate-detection/default-check.d.ts +5 -2
- package/types/package-checks/duplicate-detection/finding-messages.d.ts +1 -1
- package/types/package-checks/duplicate-detection/options.d.ts +4 -3
- package/types/package-checks/duplicate-detection/records.d.ts +1 -1
- package/types/package-checks/file-metrics/constructor.d.ts +5 -2
- package/types/package-checks/file-metrics/options.d.ts +4 -3
- package/types/package-checks/file-metrics/records.d.ts +1 -1
- package/types/package-checks/file-metrics/scc/batch-planner.d.ts +18 -0
- package/types/package-checks/file-metrics/scc/logical-scan-resources.d.ts +14 -0
- package/types/package-checks/function-metrics/analyzer/extensions/protocol.d.ts +3 -3
- package/types/package-checks/function-metrics/constructor.d.ts +5 -2
- package/types/package-checks/function-metrics/finding-messages.d.ts +1 -1
- package/types/package-checks/function-metrics/options.d.ts +4 -3
- package/types/package-checks/function-metrics/records.d.ts +1 -1
- package/types/package-checks/host-environment/git.d.ts +2 -0
- package/types/package-checks/host-environment/path.d.ts +1 -3
- package/types/package-checks/host-environment/process/contract.d.ts +17 -9
- package/types/package-checks/json-schema-validation/default-check.d.ts +4 -1
- package/types/package-checks/json-schema-validation/options.d.ts +2 -1
- package/types/package-checks/json-validation/default-check.d.ts +4 -1
- package/types/package-checks/json-validation/options.d.ts +2 -1
- package/types/package-checks/local-cache-options.d.ts +9 -0
- package/types/package-checks/maintenance-reminders/maintenance-reminders.d.ts +11 -2
- package/types/package-checks/markdown-link-validation/default-check.d.ts +4 -1
- package/types/package-checks/markdown-link-validation/options.d.ts +4 -7
- package/types/package-checks/markdown-lint/adapter.d.ts +10 -0
- package/types/package-checks/markdown-lint/default-check.d.ts +37 -0
- package/types/package-checks/markdown-lint/execution.d.ts +24 -0
- package/types/package-checks/markdown-lint/final-data.d.ts +8 -0
- package/types/package-checks/markdown-lint/finding-messages.d.ts +6 -0
- package/types/package-checks/markdown-lint/finding-waiver-identity.d.ts +3 -0
- package/types/package-checks/markdown-lint/findings-cache.d.ts +17 -0
- package/types/package-checks/markdown-lint/options-resolution.d.ts +3 -0
- package/types/package-checks/markdown-lint/options-validation.d.ts +2 -0
- package/types/package-checks/markdown-lint/options.d.ts +65 -0
- package/types/package-checks/markdown-lint/records.d.ts +39 -0
- package/types/package-checks/markdown-lint/unavailable-reasons.d.ts +3 -0
- package/types/package-checks/secret-detection/default-check.d.ts +4 -1
- package/types/package-checks/secret-detection/options.d.ts +3 -2
- package/types/package-tools/admission-policy/define-admission-policy.d.ts +26 -0
- package/types/{check → package-tools/finding-presentation}/finding-presentation.d.ts +3 -1
- package/types/{finding-waivers → package-tools/finding-waivers}/reconciliation.d.ts +3 -3
- package/types/{learned-critical-path → package-tools/learned-critical-path}/duration-model/prediction.d.ts +2 -2
- package/types/{learned-critical-path → package-tools/learned-critical-path}/duration-model/preparation.d.ts +1 -1
- package/types/{learned-critical-path → package-tools/learned-critical-path}/duration-model/recording.d.ts +1 -1
- package/types/{learned-critical-path → package-tools/learned-critical-path}/selection-layers.d.ts +1 -1
- package/types/{learned-critical-path → package-tools/learned-critical-path}/static-decision.d.ts +1 -1
- package/types/{learned-critical-path → package-tools/learned-critical-path}/strategy.d.ts +1 -1
- package/types/project-definition/check-tree/authoring.d.ts +5 -3
- package/types/project-definition/check-tree/check-fields-authoring.d.ts +12 -7
- package/types/project-definition/check-tree/flag-conditions.d.ts +5 -0
- package/types/project-definition/check-tree/resolution.d.ts +6 -4
- package/types/project-definition/declarative-snapshot.d.ts +4 -1
- package/types/project-definition/project-changes.d.ts +30 -0
- package/types/project-definition/project-definition.d.ts +15 -30
- package/types/project-definition/scheduler-policy.d.ts +3 -3
- package/types/project-run/admission-strategy-provider/prepared-admission-strategy.d.ts +2 -2
- package/types/project-run/aggregation.d.ts +8 -6
- package/types/project-run/changes/git.d.ts +14 -0
- package/types/project-run/check-execution/admitted-check-execution.d.ts +18 -0
- package/types/project-run/check-execution/dependencies.d.ts +3 -0
- package/types/project-run/check-execution/execution-finalization.d.ts +1 -1
- package/types/project-run/check-execution/execution-settlement.d.ts +15 -7
- package/types/project-run/check-execution/flag-controls.d.ts +1 -1
- package/types/project-run/check-execution/lifecycle.d.ts +9 -5
- package/types/project-run/check-execution/{preflight-result.d.ts → preparation-result.d.ts} +3 -3
- package/types/project-run/check-execution/{preflight.d.ts → preparation.d.ts} +10 -9
- package/types/project-run/check-execution/ready-check-execution.d.ts +18 -0
- package/types/project-run/check-execution/resolved-checks.d.ts +12 -13
- package/types/project-run/check-execution/scheduled-check-run.d.ts +10 -0
- package/types/project-run/check-execution/terminal-result.d.ts +13 -1
- package/types/project-run/completion/completion.d.ts +3 -1
- package/types/project-run/controls/contract.d.ts +6 -16
- package/types/project-run/invocation/candidates.d.ts +8 -0
- package/types/project-run/invocation/execution.d.ts +5 -0
- package/types/project-run/invocation/run.d.ts +2 -2
- package/types/project-run/outputs/status.d.ts +4 -4
- package/types/project-run/progress-rendering/presentation.d.ts +4 -3
- package/types/project-run/progress-rendering/renderer-formatting.d.ts +5 -2
- package/types/project-run/progress-rendering/renderer-lifecycle.d.ts +2 -0
- package/types/project-run/progress-rendering/renderer.d.ts +4 -2
- package/types/project-run/project-context.d.ts +3 -3
- package/types/project-run/result.d.ts +3 -3
- package/types/project-run/run.d.ts +1 -1
- package/types/project-run/task-scheduler/admission-core/compiled-graph-lookup.d.ts +10 -0
- package/types/project-run/task-scheduler/execution-state.d.ts +4 -4
- package/types/project-run/task-scheduler/measurement/diagnostics.d.ts +2 -2
- package/types/project-run/task-scheduler/scheduler-terminal-measurement.d.ts +1 -1
- package/dist/esm/cache/cache-json-by-key.mjs.map +0 -1
- package/dist/esm/check/finding-presentation.mjs.map +0 -1
- package/dist/esm/finding-waivers/reconciliation.mjs.map +0 -1
- package/dist/esm/learned-critical-path/duration-model/bounded-history.mjs.map +0 -1
- package/dist/esm/learned-critical-path/duration-model/prediction.mjs.map +0 -1
- package/dist/esm/learned-critical-path/duration-model/preparation.mjs.map +0 -1
- package/dist/esm/learned-critical-path/duration-model/recording.mjs.map +0 -1
- package/dist/esm/learned-critical-path/duration-model/storage.mjs.map +0 -1
- package/dist/esm/learned-critical-path/selection-layers.mjs.map +0 -1
- package/dist/esm/learned-critical-path/static-decision.mjs.map +0 -1
- package/dist/esm/learned-critical-path/strategy.mjs.map +0 -1
- package/dist/esm/package-checks/project-files/config-glob.mjs.map +0 -1
- package/dist/esm/project-run/check-execution/preflight-result.mjs.map +0 -1
- package/dist/esm/project-run/check-execution/preflight.mjs.map +0 -1
- package/dist/esm/project-run/task-scheduler/critical-path-ranking.mjs.map +0 -1
- package/types/package-checks/project-files/config-glob.d.ts +0 -5
- /package/dist/esm/{check → package-tools/finding-presentation}/finding-presentation.mjs +0 -0
- /package/dist/esm/{project-run/task-scheduler → package-tools/learned-critical-path}/critical-path-ranking.mjs +0 -0
- /package/dist/esm/{learned-critical-path → package-tools/learned-critical-path}/duration-model/bounded-history.mjs +0 -0
- /package/dist/esm/{learned-critical-path → package-tools/learned-critical-path}/duration-model/recording.mjs +0 -0
- /package/dist/esm/{learned-critical-path → package-tools/learned-critical-path}/static-decision.mjs +0 -0
- /package/src/{project-run/task-scheduler → package-tools/learned-critical-path}/critical-path-ranking.ts +0 -0
- /package/src/{learned-critical-path → package-tools/learned-critical-path}/duration-model/bounded-history.ts +0 -0
- /package/types/{cache → package-tools/cache}/cache-json-by-key.d.ts +0 -0
- /package/types/{project-run/task-scheduler → package-tools/learned-critical-path}/critical-path-ranking.d.ts +0 -0
- /package/types/{learned-critical-path → package-tools/learned-critical-path}/duration-model/bounded-history.d.ts +0 -0
- /package/types/{learned-critical-path → package-tools/learned-critical-path}/duration-model/storage.d.ts +0 -0
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
import { lint } from "markdownlint/promise";
|
|
2
|
+
|
|
3
|
+
import { snapshotClosedArray, snapshotClosedRecord } from "../../data-boundary/closed-values.ts";
|
|
4
|
+
import { MARKDOWN_LINT_RULE_NAMES, type MarkdownLintRuleName } from "./options.ts";
|
|
5
|
+
|
|
6
|
+
const FRONT_MATTER =
|
|
7
|
+
/((^---[^\S\r\n\u2028\u2029]*$[\s\S]+?^---\s*)|(^\+\+\+[^\S\r\n\u2028\u2029]*$[\s\S]+?^(\+\+\+|\.\.\.)\s*)|(^\{[^\S\r\n\u2028\u2029]*$[\s\S]+?^\}\s*))(\r\n|\r|\n|$)/m;
|
|
8
|
+
|
|
9
|
+
const BACKEND_BY_RULE: Readonly<Record<MarkdownLintRuleName, string>> = {
|
|
10
|
+
"heading-increment": "MD001",
|
|
11
|
+
"no-reversed-links": "MD011",
|
|
12
|
+
"no-missing-space-atx": "MD018",
|
|
13
|
+
"fenced-code-language": "MD040",
|
|
14
|
+
"no-empty-links": "MD042",
|
|
15
|
+
"no-alt-text": "MD045",
|
|
16
|
+
"link-fragments": "MD051",
|
|
17
|
+
"reference-links-images": "MD052",
|
|
18
|
+
"table-column-count": "MD056"
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export interface MarkdownLintBackendFinding {
|
|
22
|
+
readonly lineNumber: number;
|
|
23
|
+
readonly range: readonly [number, number] | null;
|
|
24
|
+
readonly rule: MarkdownLintRuleName;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/** Runs the fixed markdownlint Promise strings API and validates its raw protocol. */
|
|
28
|
+
export async function lintMarkdownString(
|
|
29
|
+
sourcePath: string,
|
|
30
|
+
sourceText: string,
|
|
31
|
+
rules: readonly MarkdownLintRuleName[]
|
|
32
|
+
): Promise<readonly MarkdownLintBackendFinding[] | "backend-failed" | "backend-protocol-invalid"> {
|
|
33
|
+
let raw: unknown;
|
|
34
|
+
try {
|
|
35
|
+
raw = await lint({
|
|
36
|
+
config: backendConfiguration(rules),
|
|
37
|
+
frontMatter: FRONT_MATTER,
|
|
38
|
+
noInlineConfig: true,
|
|
39
|
+
strings: { [sourcePath]: sourceText }
|
|
40
|
+
});
|
|
41
|
+
} catch {
|
|
42
|
+
return "backend-failed";
|
|
43
|
+
}
|
|
44
|
+
return parseBackendFindings(raw, sourcePath, sourceText, rules);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
function backendConfiguration(
|
|
48
|
+
rules: readonly MarkdownLintRuleName[]
|
|
49
|
+
): Readonly<Record<string, unknown>> {
|
|
50
|
+
const configuration: Record<string, unknown> = { default: false };
|
|
51
|
+
for (const rule of rules) configuration[BACKEND_BY_RULE[rule]] = configurationFor(rule);
|
|
52
|
+
if (rules.includes("reference-links-images") && !rules.includes("heading-increment")) {
|
|
53
|
+
configuration.MD001 = configurationFor("heading-increment");
|
|
54
|
+
}
|
|
55
|
+
return configuration;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
function configurationFor(rule: MarkdownLintRuleName): unknown {
|
|
59
|
+
switch (rule) {
|
|
60
|
+
case "heading-increment":
|
|
61
|
+
return { front_matter_title: "^\\s*title\\s*[:=]" };
|
|
62
|
+
case "fenced-code-language":
|
|
63
|
+
return { allowed_languages: [], language_only: false };
|
|
64
|
+
case "link-fragments":
|
|
65
|
+
return { ignore_case: false, ignored_pattern: "" };
|
|
66
|
+
case "reference-links-images":
|
|
67
|
+
return { ignored_labels: ["x"], shortcut_syntax: false };
|
|
68
|
+
case "no-reversed-links":
|
|
69
|
+
case "no-missing-space-atx":
|
|
70
|
+
case "no-empty-links":
|
|
71
|
+
case "no-alt-text":
|
|
72
|
+
case "table-column-count":
|
|
73
|
+
return true;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
function parseBackendFindings(
|
|
78
|
+
value: unknown,
|
|
79
|
+
sourcePath: string,
|
|
80
|
+
sourceText: string,
|
|
81
|
+
selectedRules: readonly MarkdownLintRuleName[]
|
|
82
|
+
): readonly MarkdownLintBackendFinding[] | "backend-protocol-invalid" {
|
|
83
|
+
const result = snapshotClosedRecord(value);
|
|
84
|
+
if (
|
|
85
|
+
result === undefined ||
|
|
86
|
+
Object.keys(result).length !== 1 ||
|
|
87
|
+
!Object.hasOwn(result, sourcePath) ||
|
|
88
|
+
!Array.isArray(result[sourcePath])
|
|
89
|
+
)
|
|
90
|
+
return "backend-protocol-invalid";
|
|
91
|
+
const lines = sourceText.split(/\r\n|\r|\n/u);
|
|
92
|
+
const findings: MarkdownLintBackendFinding[] = [];
|
|
93
|
+
for (const rawFinding of result[sourcePath]) {
|
|
94
|
+
const finding = parseBackendFinding(rawFinding, lines);
|
|
95
|
+
if (finding === undefined) return "backend-protocol-invalid";
|
|
96
|
+
if (selectedRules.includes(finding.rule)) findings.push(finding);
|
|
97
|
+
}
|
|
98
|
+
return Object.freeze(findings);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
function parseBackendFinding(
|
|
102
|
+
value: unknown,
|
|
103
|
+
lines: readonly string[]
|
|
104
|
+
): MarkdownLintBackendFinding | undefined {
|
|
105
|
+
const fields = validatedBackendFindingFields(value, lines);
|
|
106
|
+
if (fields === undefined) return undefined;
|
|
107
|
+
const range = parseMarkdownLintRange(fields.errorRange, fields.line);
|
|
108
|
+
return range === undefined
|
|
109
|
+
? undefined
|
|
110
|
+
: Object.freeze({ lineNumber: fields.lineNumber, range, rule: fields.rule });
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
function validatedBackendFindingFields(
|
|
114
|
+
value: unknown,
|
|
115
|
+
lines: readonly string[]
|
|
116
|
+
):
|
|
117
|
+
| Readonly<{
|
|
118
|
+
readonly errorRange: unknown;
|
|
119
|
+
readonly line: string;
|
|
120
|
+
readonly lineNumber: number;
|
|
121
|
+
readonly rule: MarkdownLintRuleName;
|
|
122
|
+
}>
|
|
123
|
+
| undefined {
|
|
124
|
+
const finding = snapshotClosedRecord(value);
|
|
125
|
+
if (finding === undefined) return undefined;
|
|
126
|
+
const ruleNames = finding.ruleNames;
|
|
127
|
+
const lineNumber = finding.lineNumber;
|
|
128
|
+
if (
|
|
129
|
+
!Array.isArray(ruleNames) ||
|
|
130
|
+
typeof ruleNames[0] !== "string" ||
|
|
131
|
+
typeof lineNumber !== "number"
|
|
132
|
+
)
|
|
133
|
+
return undefined;
|
|
134
|
+
if (!Number.isSafeInteger(lineNumber) || lineNumber < 1 || lineNumber > lines.length)
|
|
135
|
+
return undefined;
|
|
136
|
+
const rule = ruleForBackend(ruleNames[0]);
|
|
137
|
+
const line = lines[lineNumber - 1];
|
|
138
|
+
return rule === undefined || line === undefined
|
|
139
|
+
? undefined
|
|
140
|
+
: Object.freeze({ errorRange: finding.errorRange, line, lineNumber, rule });
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
function ruleForBackend(backendRule: string): MarkdownLintRuleName | undefined {
|
|
144
|
+
return MARKDOWN_LINT_RULE_NAMES.find((rule) => BACKEND_BY_RULE[rule] === backendRule);
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
/** Validates one backend or restored-cache range against the current source line. */
|
|
148
|
+
export function parseMarkdownLintRange(
|
|
149
|
+
value: unknown,
|
|
150
|
+
line: string
|
|
151
|
+
): readonly [number, number] | null | undefined {
|
|
152
|
+
if (value === null) return null;
|
|
153
|
+
const range = snapshotClosedArray(value);
|
|
154
|
+
if (range?.length !== 2) return undefined;
|
|
155
|
+
const [column, length] = range;
|
|
156
|
+
if (
|
|
157
|
+
typeof column !== "number" ||
|
|
158
|
+
typeof length !== "number" ||
|
|
159
|
+
!Number.isSafeInteger(column) ||
|
|
160
|
+
!Number.isSafeInteger(length) ||
|
|
161
|
+
column < 1 ||
|
|
162
|
+
length < 1 ||
|
|
163
|
+
column - 1 + length > line.length
|
|
164
|
+
)
|
|
165
|
+
return undefined;
|
|
166
|
+
return Object.freeze([column, length] as const);
|
|
167
|
+
}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { defineCheck, type TypedCheckWithOptions } from "../../check/check.ts";
|
|
2
|
+
import {
|
|
3
|
+
resolvePackageCheckAuthoringInput,
|
|
4
|
+
type PackageCheckIdentityInput
|
|
5
|
+
} from "../check-authoring.ts";
|
|
6
|
+
import { MARKDOWN_LINT_CHECK_DEFINITION, executeMarkdownLint } from "./execution.ts";
|
|
7
|
+
import { parseMarkdownLintData } from "./final-data.ts";
|
|
8
|
+
import type { MarkdownLintOptions, ResolvedMarkdownLintOptions } from "./options.ts";
|
|
9
|
+
import { resolveMarkdownLintOptions } from "./options-resolution.ts";
|
|
10
|
+
import { validMarkdownLintOptions } from "./options-validation.ts";
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* 构造使用稳定闭合规则与受限输入的 Markdown 结构检查。
|
|
14
|
+
* 精确 findingWaivers 只在完整 traversal 后应用;原 Finding、计数与缓存 facts 保留。
|
|
15
|
+
*
|
|
16
|
+
* @param options - 省略时采用八项 recommended 规则;非空 rules 数组完整替换该集合。
|
|
17
|
+
* @returns 使用默认或指定 checkId 的 typed Check,携带完整冻结 options、parser 与执行逻辑。
|
|
18
|
+
* @throws {TypeError} options 含未知字段、未知/重复规则、非法 limits 或 findingWaivers 时抛出。
|
|
19
|
+
* @example 最小用法
|
|
20
|
+
* ```ts
|
|
21
|
+
* import { defineConfig, markdownLint, run } from "@zxyycom/vibe-check";
|
|
22
|
+
*
|
|
23
|
+
* const check = markdownLint({ findingPolicy: "blocking" });
|
|
24
|
+
* const definition = defineConfig({
|
|
25
|
+
* checks: [check],
|
|
26
|
+
* outputs: {
|
|
27
|
+
* diagnosticLogging: { enabled: false },
|
|
28
|
+
* machinePublication: { enabled: false },
|
|
29
|
+
* progressRendering: { enabled: false }
|
|
30
|
+
* }
|
|
31
|
+
* });
|
|
32
|
+
*
|
|
33
|
+
* const result = await run(definition);
|
|
34
|
+
* if (result.kind !== "completed") throw new Error(`Run did not complete: ${result.kind}`);
|
|
35
|
+
* const outcome = result.snapshot.checks.find(({ checkId }) => checkId === check.checkId)?.outcome;
|
|
36
|
+
* if (outcome?.status !== "passed" && outcome?.status !== "not-applicable") {
|
|
37
|
+
* throw new Error(`Markdown lint did not pass: ${outcome?.status ?? "no outcome"}`);
|
|
38
|
+
* }
|
|
39
|
+
* if (outcome.status === "not-applicable") console.warn("No Markdown input selected; no lint evidence.");
|
|
40
|
+
* ```
|
|
41
|
+
*/
|
|
42
|
+
export function markdownLint(
|
|
43
|
+
options?: MarkdownLintOptions<"markdown-lint">
|
|
44
|
+
): TypedCheckWithOptions<
|
|
45
|
+
"markdown-lint",
|
|
46
|
+
ResolvedMarkdownLintOptions,
|
|
47
|
+
typeof parseMarkdownLintData
|
|
48
|
+
>;
|
|
49
|
+
export function markdownLint<const Id extends string>(
|
|
50
|
+
options: MarkdownLintOptions<Id> & PackageCheckIdentityInput<Id>
|
|
51
|
+
): TypedCheckWithOptions<Id, ResolvedMarkdownLintOptions, typeof parseMarkdownLintData>;
|
|
52
|
+
export function markdownLint(
|
|
53
|
+
options: MarkdownLintOptions
|
|
54
|
+
): TypedCheckWithOptions<string, ResolvedMarkdownLintOptions, typeof parseMarkdownLintData>;
|
|
55
|
+
export function markdownLint(
|
|
56
|
+
options: MarkdownLintOptions = {}
|
|
57
|
+
): TypedCheckWithOptions<string, ResolvedMarkdownLintOptions, typeof parseMarkdownLintData> {
|
|
58
|
+
const input = resolvePackageCheckAuthoringInput(
|
|
59
|
+
options,
|
|
60
|
+
["files", "findingPolicy", "findingWaivers", "rules", "limits", "cache"],
|
|
61
|
+
MARKDOWN_LINT_CHECK_DEFINITION
|
|
62
|
+
);
|
|
63
|
+
if (input === undefined) {
|
|
64
|
+
throw new TypeError("markdownLint options must match the documented closed policy");
|
|
65
|
+
}
|
|
66
|
+
const resolvedOptions = resolveMarkdownLintOptions(input.domainOptions);
|
|
67
|
+
if (resolvedOptions === undefined) {
|
|
68
|
+
throw new TypeError("markdownLint options must match the documented closed policy");
|
|
69
|
+
}
|
|
70
|
+
return defineCheck({
|
|
71
|
+
...input.definition,
|
|
72
|
+
execute: executeMarkdownLint,
|
|
73
|
+
parseData: parseMarkdownLintData,
|
|
74
|
+
prepare: (preparedOptions) =>
|
|
75
|
+
validMarkdownLintOptions(preparedOptions)
|
|
76
|
+
? { status: "success", preparedOptions }
|
|
77
|
+
: {
|
|
78
|
+
status: "failure",
|
|
79
|
+
action: "block",
|
|
80
|
+
reason: { code: "invalid-options" },
|
|
81
|
+
messages: [
|
|
82
|
+
{
|
|
83
|
+
code: "invalid-options",
|
|
84
|
+
level: "error",
|
|
85
|
+
message:
|
|
86
|
+
"markdownLint options are invalid; recreate the Check with markdownLint(options) or restore its complete resolved options."
|
|
87
|
+
}
|
|
88
|
+
]
|
|
89
|
+
},
|
|
90
|
+
options: resolvedOptions
|
|
91
|
+
});
|
|
92
|
+
}
|
|
@@ -0,0 +1,266 @@
|
|
|
1
|
+
import path from "node:path";
|
|
2
|
+
import { realpath } from "node:fs/promises";
|
|
3
|
+
|
|
4
|
+
import type { CheckExecutionContext, CheckResult } from "../../check/check.ts";
|
|
5
|
+
import { appendCheckMessages } from "../../package-tools/finding-presentation/finding-presentation.ts";
|
|
6
|
+
import { reconcileFindingWaivers } from "../../package-tools/finding-waivers/reconciliation.ts";
|
|
7
|
+
import { reportFindingWaiverAudits } from "../code-quality-findings/finding-waiver-evidence.ts";
|
|
8
|
+
import { collectProjectFiles } from "../project-files/collection.ts";
|
|
9
|
+
import { partitionProjectFilesByEligibility } from "../project-files/input-eligibility.ts";
|
|
10
|
+
import {
|
|
11
|
+
probeRootContainedPath,
|
|
12
|
+
readRegularFile
|
|
13
|
+
} from "../markdown-link-validation/filesystem-probes.ts";
|
|
14
|
+
import { isRootRelativePath } from "../markdown-link-validation/local-resolution.ts";
|
|
15
|
+
import type { MarkdownLintBackendFinding } from "./adapter.ts";
|
|
16
|
+
import type { MarkdownLintFinalData } from "./final-data.ts";
|
|
17
|
+
import { lintMarkdownWithCache } from "./findings-cache.ts";
|
|
18
|
+
import { markdownLintFindingMessages, markdownLintWaiverMessages } from "./finding-messages.ts";
|
|
19
|
+
import type { ResolvedMarkdownLintOptions } from "./options.ts";
|
|
20
|
+
import { validMarkdownLintOptions } from "./options-validation.ts";
|
|
21
|
+
import {
|
|
22
|
+
buildMarkdownLintInputRejectedRecord,
|
|
23
|
+
markdownLintFindingIdentity,
|
|
24
|
+
markdownLintWaiverAuditRecord,
|
|
25
|
+
orderedMarkdownLintCandidates,
|
|
26
|
+
type MarkdownLintRecordCandidate
|
|
27
|
+
} from "./records.ts";
|
|
28
|
+
import {
|
|
29
|
+
markdownLintUnavailableMessage,
|
|
30
|
+
type MarkdownLintUnavailableReason
|
|
31
|
+
} from "./unavailable-reasons.ts";
|
|
32
|
+
|
|
33
|
+
export type { MarkdownLintUnavailableReason } from "./unavailable-reasons.ts";
|
|
34
|
+
|
|
35
|
+
export const MARKDOWN_LINT_CHECK_DEFINITION = {
|
|
36
|
+
checkId: "markdown-lint",
|
|
37
|
+
displayName: "Markdown lint"
|
|
38
|
+
} as const;
|
|
39
|
+
|
|
40
|
+
type Traversal =
|
|
41
|
+
| Readonly<{
|
|
42
|
+
readonly kind: "complete";
|
|
43
|
+
readonly candidates: readonly MarkdownLintRecordCandidate[];
|
|
44
|
+
readonly sourceFileCount: number;
|
|
45
|
+
}>
|
|
46
|
+
| Readonly<{ readonly kind: "unavailable"; readonly reason: MarkdownLintUnavailableReason }>;
|
|
47
|
+
|
|
48
|
+
/** Executes one bounded, ordered lint pass over the exact selected Markdown source paths. */
|
|
49
|
+
export async function executeMarkdownLint(
|
|
50
|
+
context: CheckExecutionContext<ResolvedMarkdownLintOptions>
|
|
51
|
+
): Promise<CheckResult<MarkdownLintFinalData>> {
|
|
52
|
+
return validMarkdownLintOptions(context.options)
|
|
53
|
+
? executeResolvedMarkdownLint(context)
|
|
54
|
+
: unavailable("invalid-options");
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
async function executeResolvedMarkdownLint(
|
|
58
|
+
context: CheckExecutionContext<ResolvedMarkdownLintOptions>
|
|
59
|
+
): Promise<CheckResult<MarkdownLintFinalData>> {
|
|
60
|
+
if (context.signal.aborted) return unavailable("cancelled");
|
|
61
|
+
const discovered = discoverSources(context);
|
|
62
|
+
if (discovered.kind === "unavailable") return unavailable(discovered.reason);
|
|
63
|
+
if (discovered.selectedPathCount === 0) {
|
|
64
|
+
return Object.freeze({ status: "not-applicable", reason: { code: "no-eligible-input" } });
|
|
65
|
+
}
|
|
66
|
+
for (const rejectedPath of discovered.rejectedPaths) {
|
|
67
|
+
const record = buildMarkdownLintInputRejectedRecord(rejectedPath);
|
|
68
|
+
context.records.report({ id: record.id }, record.data);
|
|
69
|
+
}
|
|
70
|
+
const root = await canonicalProjectRoot(context.project.root);
|
|
71
|
+
if (root === undefined) return unavailable("project-root-unavailable");
|
|
72
|
+
const traversal = await traverseSources(
|
|
73
|
+
discovered.sourcePaths,
|
|
74
|
+
root,
|
|
75
|
+
context.options,
|
|
76
|
+
context.signal
|
|
77
|
+
);
|
|
78
|
+
if (traversal.kind === "unavailable")
|
|
79
|
+
return appendRejected(unavailable(traversal.reason), discovered.rejectedPaths.length);
|
|
80
|
+
if (context.signal.aborted)
|
|
81
|
+
return appendRejected(unavailable("cancelled"), discovered.rejectedPaths.length);
|
|
82
|
+
return publishMarkdownLintTraversal(context, traversal, discovered.rejectedPaths);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/** Reconciles only a complete traversal, then publishes all evidence and the live policy outcome. */
|
|
86
|
+
export function publishMarkdownLintTraversal(
|
|
87
|
+
context: CheckExecutionContext<ResolvedMarkdownLintOptions>,
|
|
88
|
+
traversal: Extract<Traversal, { readonly kind: "complete" }>,
|
|
89
|
+
rejectedPaths: readonly string[]
|
|
90
|
+
): CheckResult<MarkdownLintFinalData> {
|
|
91
|
+
const reconciliation = reconcileFindingWaivers({
|
|
92
|
+
findings: traversal.candidates,
|
|
93
|
+
identify: markdownLintFindingIdentity,
|
|
94
|
+
waivers: context.options.findingWaivers
|
|
95
|
+
});
|
|
96
|
+
const actionable: MarkdownLintRecordCandidate[] = [];
|
|
97
|
+
for (const finding of reconciliation.findings) {
|
|
98
|
+
const data =
|
|
99
|
+
finding.disposition === "waived"
|
|
100
|
+
? Object.freeze({
|
|
101
|
+
...finding.finding.data,
|
|
102
|
+
waiver: Object.freeze({ reason: finding.waiver.reason })
|
|
103
|
+
})
|
|
104
|
+
: finding.finding.data;
|
|
105
|
+
context.records.report({ id: finding.finding.id }, data);
|
|
106
|
+
if (finding.disposition !== "waived") actionable.push(finding.finding);
|
|
107
|
+
}
|
|
108
|
+
reportFindingWaiverAudits(context, reconciliation, markdownLintWaiverAuditRecord);
|
|
109
|
+
const findingCount = traversal.candidates.length + rejectedPaths.length;
|
|
110
|
+
const blocking = context.options.findingPolicy === "blocking";
|
|
111
|
+
const result: CheckResult<MarkdownLintFinalData> = Object.freeze({
|
|
112
|
+
status: actionable.length > 0 && blocking ? "failed" : "passed",
|
|
113
|
+
data: Object.freeze({
|
|
114
|
+
sourceFileCount: traversal.sourceFileCount,
|
|
115
|
+
findingCount,
|
|
116
|
+
rejectedInputCount: rejectedPaths.length
|
|
117
|
+
})
|
|
118
|
+
});
|
|
119
|
+
return appendCheckMessages(result, [
|
|
120
|
+
...markdownLintFindingMessages(
|
|
121
|
+
actionable,
|
|
122
|
+
rejectedPaths,
|
|
123
|
+
// Preserve legacy summaries without waivers; fully waived lint must not make rejected-input summaries errors.
|
|
124
|
+
blocking && (reconciliation.waiverAudits.length === 0 || actionable.length > 0)
|
|
125
|
+
),
|
|
126
|
+
...markdownLintWaiverMessages(reconciliation)
|
|
127
|
+
]);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
function discoverSources(context: CheckExecutionContext<ResolvedMarkdownLintOptions>):
|
|
131
|
+
| Readonly<{
|
|
132
|
+
readonly kind: "complete";
|
|
133
|
+
readonly sourcePaths: readonly string[];
|
|
134
|
+
readonly rejectedPaths: readonly string[];
|
|
135
|
+
readonly selectedPathCount: number;
|
|
136
|
+
}>
|
|
137
|
+
| Readonly<{ readonly kind: "unavailable"; readonly reason: "source-unavailable" }> {
|
|
138
|
+
try {
|
|
139
|
+
const selectedPaths = collectProjectFiles(context.project.root, context.options.files);
|
|
140
|
+
const partition = partitionProjectFilesByEligibility(selectedPaths, isMarkdownPath);
|
|
141
|
+
return Object.freeze({
|
|
142
|
+
kind: "complete" as const,
|
|
143
|
+
sourcePaths: partition.acceptedPaths,
|
|
144
|
+
rejectedPaths: partition.rejectedPaths,
|
|
145
|
+
selectedPathCount: selectedPaths.length
|
|
146
|
+
});
|
|
147
|
+
} catch {
|
|
148
|
+
return Object.freeze({ kind: "unavailable" as const, reason: "source-unavailable" as const });
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
async function canonicalProjectRoot(projectRoot: string): Promise<string | undefined> {
|
|
153
|
+
try {
|
|
154
|
+
return await realpath(projectRoot);
|
|
155
|
+
} catch {
|
|
156
|
+
return undefined;
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
async function traverseSources(
|
|
161
|
+
sourcePaths: readonly string[],
|
|
162
|
+
rootPath: string,
|
|
163
|
+
options: ResolvedMarkdownLintOptions,
|
|
164
|
+
signal: AbortSignal
|
|
165
|
+
): Promise<Traversal> {
|
|
166
|
+
const rawFindings: Array<
|
|
167
|
+
Readonly<{ readonly path: string; readonly finding: MarkdownLintBackendFinding }>
|
|
168
|
+
> = [];
|
|
169
|
+
let sourceFileCount = 0;
|
|
170
|
+
for (const sourcePath of sourcePaths) {
|
|
171
|
+
if (signal.aborted) return unavailableTraversal("cancelled");
|
|
172
|
+
const source = await readMarkdownSource(rootPath, sourcePath, options.limits.maxMarkdownBytes);
|
|
173
|
+
if (!source.ok) return unavailableTraversal(source.reason);
|
|
174
|
+
const text = source.text;
|
|
175
|
+
if (signal.aborted) return unavailableTraversal("cancelled");
|
|
176
|
+
const linted = await lintMarkdownWithCache({
|
|
177
|
+
sourcePath,
|
|
178
|
+
sourceText: text,
|
|
179
|
+
rules: options.rules,
|
|
180
|
+
cache: options.cache,
|
|
181
|
+
signal
|
|
182
|
+
});
|
|
183
|
+
const findings = typeof linted === "string" ? linted : linted.findings;
|
|
184
|
+
if (typeof findings === "string") return unavailableTraversal(findings);
|
|
185
|
+
if (signal.aborted) return unavailableTraversal("cancelled");
|
|
186
|
+
sourceFileCount += 1;
|
|
187
|
+
for (const finding of findings) rawFindings.push(Object.freeze({ path: sourcePath, finding }));
|
|
188
|
+
if (rawFindings.length > options.limits.maxFindings)
|
|
189
|
+
return unavailableTraversal("finding-limit-exceeded");
|
|
190
|
+
}
|
|
191
|
+
return Object.freeze({
|
|
192
|
+
kind: "complete" as const,
|
|
193
|
+
candidates: orderedMarkdownLintCandidates(rawFindings, options.rules),
|
|
194
|
+
sourceFileCount
|
|
195
|
+
});
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
async function readMarkdownSource(
|
|
199
|
+
rootPath: string,
|
|
200
|
+
rootRelativePath: string,
|
|
201
|
+
maxBytes: number
|
|
202
|
+
): Promise<
|
|
203
|
+
| Readonly<{ readonly ok: true; readonly text: string }>
|
|
204
|
+
| Readonly<{ readonly ok: false; readonly reason: "source-too-large" | "source-unavailable" }>
|
|
205
|
+
> {
|
|
206
|
+
if (!isRootRelativePath(rootPath, rootRelativePath))
|
|
207
|
+
return Object.freeze({ ok: false, reason: "source-unavailable" });
|
|
208
|
+
const candidatePath = path.resolve(rootPath, rootRelativePath);
|
|
209
|
+
const probe = await probeRootContainedPath(rootPath, candidatePath);
|
|
210
|
+
if (probe.kind !== "contained") return Object.freeze({ ok: false, reason: "source-unavailable" });
|
|
211
|
+
const source = await readRegularFile(probe.absolutePath, maxBytes);
|
|
212
|
+
if (!source.ok)
|
|
213
|
+
return Object.freeze({
|
|
214
|
+
ok: false,
|
|
215
|
+
reason: source.reason === "too-large" ? "source-too-large" : "source-unavailable"
|
|
216
|
+
});
|
|
217
|
+
try {
|
|
218
|
+
return Object.freeze({
|
|
219
|
+
ok: true as const,
|
|
220
|
+
text: new TextDecoder("utf-8", { fatal: true }).decode(source.bytes)
|
|
221
|
+
});
|
|
222
|
+
} catch {
|
|
223
|
+
return Object.freeze({ ok: false, reason: "source-unavailable" });
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
function isMarkdownPath(filePath: string): boolean {
|
|
228
|
+
const extension = path.extname(filePath).toLowerCase();
|
|
229
|
+
return extension === ".md" || extension === ".markdown";
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
function unavailableTraversal(reason: MarkdownLintUnavailableReason): Traversal {
|
|
233
|
+
return Object.freeze({ kind: "unavailable" as const, reason });
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
function unavailable(reason: MarkdownLintUnavailableReason): CheckResult<MarkdownLintFinalData> {
|
|
237
|
+
return Object.freeze({
|
|
238
|
+
status: "unavailable",
|
|
239
|
+
reason: { code: reason },
|
|
240
|
+
messages: Object.freeze([
|
|
241
|
+
Object.freeze({
|
|
242
|
+
code: reason,
|
|
243
|
+
level: "error" as const,
|
|
244
|
+
message: markdownLintUnavailableMessage(reason)
|
|
245
|
+
})
|
|
246
|
+
])
|
|
247
|
+
});
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
function appendRejected(
|
|
251
|
+
result: CheckResult<MarkdownLintFinalData>,
|
|
252
|
+
rejectedInputCount: number
|
|
253
|
+
): CheckResult<MarkdownLintFinalData> {
|
|
254
|
+
if (rejectedInputCount === 0) return result;
|
|
255
|
+
return Object.freeze({
|
|
256
|
+
...result,
|
|
257
|
+
messages: Object.freeze([
|
|
258
|
+
...(result.messages ?? []),
|
|
259
|
+
Object.freeze({
|
|
260
|
+
code: "input-rejected",
|
|
261
|
+
level: "warning" as const,
|
|
262
|
+
message: `${rejectedInputCount} selected markdownLint input file(s) were rejected because only .md/.markdown paths are supported; inspect this Check's Records and narrow files.include/exclude.`
|
|
263
|
+
})
|
|
264
|
+
])
|
|
265
|
+
});
|
|
266
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import {
|
|
2
|
+
exactFinalDataRecord,
|
|
3
|
+
invalidFinalData,
|
|
4
|
+
nonNegativeSafeInteger
|
|
5
|
+
} from "../final-data-parsing.ts";
|
|
6
|
+
|
|
7
|
+
/** 已完成 `markdownLint` execution 的 canonical final data。 */
|
|
8
|
+
export interface MarkdownLintFinalData {
|
|
9
|
+
readonly sourceFileCount: number;
|
|
10
|
+
readonly findingCount: number;
|
|
11
|
+
readonly rejectedInputCount: number;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/** 解析并验证 `markdownLint` 完成结果中的 canonical final data。 */
|
|
15
|
+
export function parseMarkdownLintData(data: unknown): MarkdownLintFinalData {
|
|
16
|
+
const value = exactFinalDataRecord(
|
|
17
|
+
data,
|
|
18
|
+
["sourceFileCount", "findingCount", "rejectedInputCount"],
|
|
19
|
+
"markdownLint"
|
|
20
|
+
);
|
|
21
|
+
const sourceFileCount = nonNegativeSafeInteger(value.sourceFileCount);
|
|
22
|
+
const findingCount = nonNegativeSafeInteger(value.findingCount);
|
|
23
|
+
const rejectedInputCount = nonNegativeSafeInteger(value.rejectedInputCount);
|
|
24
|
+
if (
|
|
25
|
+
sourceFileCount === undefined ||
|
|
26
|
+
findingCount === undefined ||
|
|
27
|
+
rejectedInputCount === undefined ||
|
|
28
|
+
findingCount < rejectedInputCount
|
|
29
|
+
) {
|
|
30
|
+
throw invalidFinalData("markdownLint");
|
|
31
|
+
}
|
|
32
|
+
return Object.freeze({ sourceFileCount, findingCount, rejectedInputCount });
|
|
33
|
+
}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import type { CheckMessage } from "../../check/check.ts";
|
|
2
|
+
import { presentCheckFindings } from "../../package-tools/finding-presentation/finding-presentation.ts";
|
|
3
|
+
import type {
|
|
4
|
+
FindingWaiverAudit,
|
|
5
|
+
FindingWaiverReconciliation
|
|
6
|
+
} from "../../package-tools/finding-waivers/reconciliation.ts";
|
|
7
|
+
import { markdownLintWaiverIdentity, type MarkdownLintRecordCandidate } from "./records.ts";
|
|
8
|
+
|
|
9
|
+
const SUMMARY: Readonly<Record<MarkdownLintRecordCandidate["data"]["rule"], string>> = {
|
|
10
|
+
"heading-increment": "heading levels may increase by only one level",
|
|
11
|
+
"no-reversed-links": "reversed link syntax is not supported",
|
|
12
|
+
"no-missing-space-atx": "ATX heading markers require a following space",
|
|
13
|
+
"fenced-code-language": "fenced code blocks require a language",
|
|
14
|
+
"no-empty-links": "links require a non-empty destination",
|
|
15
|
+
"no-alt-text": "images require alternative text",
|
|
16
|
+
"link-fragments": "same-document fragments must match a heading",
|
|
17
|
+
"reference-links-images": "reference links and images require a definition",
|
|
18
|
+
"table-column-count": "pipe table rows must have a consistent column count"
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export function markdownLintFindingMessages(
|
|
22
|
+
candidates: readonly MarkdownLintRecordCandidate[],
|
|
23
|
+
rejectedPaths: readonly string[],
|
|
24
|
+
blocking: boolean
|
|
25
|
+
): readonly CheckMessage[] {
|
|
26
|
+
const findings = [
|
|
27
|
+
...candidates.map((candidate) => Object.freeze({ kind: "lint" as const, candidate })),
|
|
28
|
+
...rejectedPaths.map((path) => Object.freeze({ kind: "rejected" as const, path }))
|
|
29
|
+
];
|
|
30
|
+
return presentCheckFindings({
|
|
31
|
+
findings,
|
|
32
|
+
limit: 10,
|
|
33
|
+
message: (finding) => {
|
|
34
|
+
if (finding.kind === "rejected") {
|
|
35
|
+
return Object.freeze({
|
|
36
|
+
code: "finding-detail",
|
|
37
|
+
level: "warning" as const,
|
|
38
|
+
message: `${finding.path}: selected input is not a supported Markdown source.`
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
const { path, range, rule } = finding.candidate.data;
|
|
42
|
+
return Object.freeze({
|
|
43
|
+
code: "finding-detail",
|
|
44
|
+
level: blocking ? ("error" as const) : ("warning" as const),
|
|
45
|
+
message: `${path}:${range.start.line}:${range.start.column} ${rule}: ${SUMMARY[rule]}.`
|
|
46
|
+
});
|
|
47
|
+
},
|
|
48
|
+
omittedMessage: ({ omittedCount }) =>
|
|
49
|
+
Object.freeze({
|
|
50
|
+
code: "findings-omitted",
|
|
51
|
+
level: blocking ? ("error" as const) : ("warning" as const),
|
|
52
|
+
message: `${omittedCount} additional Markdown lint finding(s) were not shown; inspect this Check's Records for the complete set.`
|
|
53
|
+
})
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/** Explains every configured waiver without turning accepted findings into error messages. */
|
|
58
|
+
export function markdownLintWaiverMessages(
|
|
59
|
+
reconciliation: FindingWaiverReconciliation<MarkdownLintRecordCandidate>
|
|
60
|
+
): readonly CheckMessage[] {
|
|
61
|
+
return Object.freeze(reconciliation.waiverAudits.map(markdownLintWaiverMessage));
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
function markdownLintWaiverMessage(audit: FindingWaiverAudit): CheckMessage {
|
|
65
|
+
const { path, rule, range } = markdownLintWaiverIdentity(audit.waiver);
|
|
66
|
+
const subject = `${path}:${range.start.line}:${range.start.column}-${range.end.column} ${rule}`;
|
|
67
|
+
switch (audit.status) {
|
|
68
|
+
case "applied":
|
|
69
|
+
return Object.freeze({
|
|
70
|
+
code: "finding-waived",
|
|
71
|
+
level: "info",
|
|
72
|
+
message: `Markdown lint finding for ${subject} was waived: ${audit.waiver.reason}`
|
|
73
|
+
});
|
|
74
|
+
case "unused":
|
|
75
|
+
return Object.freeze({
|
|
76
|
+
code: "unused-finding-waiver",
|
|
77
|
+
level: "warning",
|
|
78
|
+
message: `Configured markdown-lint finding waiver for ${subject} matched no finding; remove it or update its identity. Reason: ${audit.waiver.reason}`
|
|
79
|
+
});
|
|
80
|
+
case "overmatched":
|
|
81
|
+
return Object.freeze({
|
|
82
|
+
code: "overmatched-finding-waiver",
|
|
83
|
+
level: "warning",
|
|
84
|
+
message: `Configured markdown-lint finding waiver for ${subject} matched ${audit.matchCount} findings and was not applied; inspect the duplicate identities. Reason: ${audit.waiver.reason}`
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
}
|