@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,136 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
Check,
|
|
3
|
+
CheckFlagEnablement,
|
|
4
|
+
CheckResourceClaims,
|
|
5
|
+
InheritableCheckCollection
|
|
6
|
+
} from "../check/check.ts";
|
|
7
|
+
import { snapshotClosedArray, snapshotClosedPolicyRecord } from "../data-boundary/closed-values.ts";
|
|
8
|
+
import { parseFlagEnablementControl } from "../project-definition/check-tree/check-fields-authoring.ts";
|
|
9
|
+
import { parseCheckScheduling } from "../project-definition/check-tree/scheduling-authoring.ts";
|
|
10
|
+
|
|
11
|
+
/** 固定身份随包 Check 构造器与领域 policy 并列接收的项目声明字段;Project Definition 保留语义校验所有权。 */
|
|
12
|
+
export interface PackageCheckAuthoringOptions<Id extends string = string> {
|
|
13
|
+
/** Overrides the constructor's package default identity. */
|
|
14
|
+
readonly checkId?: Id;
|
|
15
|
+
/** Overrides the constructor's package default presentation name. */
|
|
16
|
+
readonly displayName?: string;
|
|
17
|
+
readonly enabledByFlags?: CheckFlagEnablement;
|
|
18
|
+
readonly checks?: readonly Check[];
|
|
19
|
+
readonly dependsOn?: InheritableCheckCollection<string>;
|
|
20
|
+
readonly observes?: InheritableCheckCollection<string>;
|
|
21
|
+
readonly maxParallel?: number;
|
|
22
|
+
readonly admissionPriority?: number;
|
|
23
|
+
readonly mutex?: InheritableCheckCollection<string>;
|
|
24
|
+
readonly resourceClaims?: CheckResourceClaims;
|
|
25
|
+
/** `false` explicitly restores the package default of rendering quiet passed rows. */
|
|
26
|
+
readonly omitQuietPassedRow?: boolean;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/** 自定义随包 Check identity 时必须声明与返回类型一致的 runtime `checkId`。 */
|
|
30
|
+
export type PackageCheckIdentityInput<Id extends string> = Readonly<{ readonly checkId: Id }>;
|
|
31
|
+
|
|
32
|
+
const PACKAGE_CHECK_AUTHORING_KEYS = [
|
|
33
|
+
"admissionPriority",
|
|
34
|
+
"checkId",
|
|
35
|
+
"checks",
|
|
36
|
+
"dependsOn",
|
|
37
|
+
"displayName",
|
|
38
|
+
"enabledByFlags",
|
|
39
|
+
"maxParallel",
|
|
40
|
+
"mutex",
|
|
41
|
+
"observes",
|
|
42
|
+
"omitQuietPassedRow",
|
|
43
|
+
"resourceClaims"
|
|
44
|
+
] as const;
|
|
45
|
+
|
|
46
|
+
type PackageCheckDefinition<Id extends string> = Readonly<{
|
|
47
|
+
readonly checkId: Id;
|
|
48
|
+
readonly displayName: string;
|
|
49
|
+
readonly enabledByFlags?: CheckFlagEnablement;
|
|
50
|
+
readonly checks?: readonly Check[];
|
|
51
|
+
readonly dependsOn?: InheritableCheckCollection<string>;
|
|
52
|
+
readonly observes?: InheritableCheckCollection<string>;
|
|
53
|
+
readonly maxParallel?: number;
|
|
54
|
+
readonly admissionPriority?: number;
|
|
55
|
+
readonly mutex?: InheritableCheckCollection<string>;
|
|
56
|
+
readonly resourceClaims?: CheckResourceClaims;
|
|
57
|
+
readonly omitQuietPassedRow?: true;
|
|
58
|
+
}>;
|
|
59
|
+
|
|
60
|
+
/** 对一个 closed 构造输入执行安全 shape 校验,并分流领域 policy 与普通 Check 声明字段。 */
|
|
61
|
+
export function resolvePackageCheckAuthoringInput<const Id extends string>(
|
|
62
|
+
input: PackageCheckAuthoringOptions<Id> & object,
|
|
63
|
+
domainKeys: readonly string[],
|
|
64
|
+
defaults: Readonly<{
|
|
65
|
+
readonly checkId: string;
|
|
66
|
+
readonly displayName: string;
|
|
67
|
+
readonly omitQuietPassedRow?: true;
|
|
68
|
+
}>
|
|
69
|
+
):
|
|
70
|
+
| Readonly<{
|
|
71
|
+
readonly definition: PackageCheckDefinition<Id>;
|
|
72
|
+
readonly domainOptions: Readonly<Record<string, unknown>>;
|
|
73
|
+
}>
|
|
74
|
+
| undefined {
|
|
75
|
+
const snapshot = snapshotClosedPolicyRecord(input, {
|
|
76
|
+
optional: [...domainKeys, ...PACKAGE_CHECK_AUTHORING_KEYS]
|
|
77
|
+
});
|
|
78
|
+
if (snapshot === undefined) return undefined;
|
|
79
|
+
|
|
80
|
+
const checkId = snapshot.checkId ?? defaults.checkId;
|
|
81
|
+
const displayName = snapshot.displayName ?? defaults.displayName;
|
|
82
|
+
if (!isNonEmptyString(checkId) || !isNonEmptyString(displayName)) return undefined;
|
|
83
|
+
if (
|
|
84
|
+
(snapshot.omitQuietPassedRow !== undefined &&
|
|
85
|
+
typeof snapshot.omitQuietPassedRow !== "boolean") ||
|
|
86
|
+
!hasSafeProjectFieldShapes(snapshot)
|
|
87
|
+
) {
|
|
88
|
+
return undefined;
|
|
89
|
+
}
|
|
90
|
+
const omitQuietPassedRow =
|
|
91
|
+
snapshot.omitQuietPassedRow === undefined
|
|
92
|
+
? defaults.omitQuietPassedRow === true
|
|
93
|
+
: snapshot.omitQuietPassedRow === true;
|
|
94
|
+
|
|
95
|
+
const domainOptions = Object.freeze(
|
|
96
|
+
Object.fromEntries(
|
|
97
|
+
domainKeys.flatMap((key) => (Object.hasOwn(snapshot, key) ? [[key, snapshot[key]]] : []))
|
|
98
|
+
)
|
|
99
|
+
);
|
|
100
|
+
const definition = Object.freeze({
|
|
101
|
+
...(snapshot.admissionPriority === undefined
|
|
102
|
+
? {}
|
|
103
|
+
: { admissionPriority: snapshot.admissionPriority }),
|
|
104
|
+
...(snapshot.checks === undefined ? {} : { checks: snapshot.checks }),
|
|
105
|
+
...(snapshot.dependsOn === undefined ? {} : { dependsOn: snapshot.dependsOn }),
|
|
106
|
+
...(snapshot.enabledByFlags === undefined ? {} : { enabledByFlags: snapshot.enabledByFlags }),
|
|
107
|
+
...(snapshot.maxParallel === undefined ? {} : { maxParallel: snapshot.maxParallel }),
|
|
108
|
+
...(snapshot.mutex === undefined ? {} : { mutex: snapshot.mutex }),
|
|
109
|
+
...(snapshot.observes === undefined ? {} : { observes: snapshot.observes }),
|
|
110
|
+
...(omitQuietPassedRow ? { omitQuietPassedRow: true as const } : {}),
|
|
111
|
+
...(snapshot.resourceClaims === undefined ? {} : { resourceClaims: snapshot.resourceClaims }),
|
|
112
|
+
// Runtime defaults are strings; constructor signatures bind this field to the input literal type.
|
|
113
|
+
// oxlint-disable-next-line typescript/no-unsafe-type-assertion -- The runtime default is fixed by the constructor, while the public signature retains an input literal ID.
|
|
114
|
+
checkId: checkId as Id,
|
|
115
|
+
displayName
|
|
116
|
+
}) satisfies PackageCheckDefinition<Id>;
|
|
117
|
+
return Object.freeze({ definition, domainOptions });
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
function hasSafeProjectFieldShapes(
|
|
121
|
+
input: Readonly<Record<string, unknown>>
|
|
122
|
+
): input is Readonly<Record<string, unknown>> & PackageCheckAuthoringOptions {
|
|
123
|
+
const scheduling = parseCheckScheduling(input);
|
|
124
|
+
if (scheduling === undefined) return false;
|
|
125
|
+
if (
|
|
126
|
+
input.enabledByFlags !== undefined &&
|
|
127
|
+
parseFlagEnablementControl(input.enabledByFlags) === undefined
|
|
128
|
+
) {
|
|
129
|
+
return false;
|
|
130
|
+
}
|
|
131
|
+
return input.checks === undefined || snapshotClosedArray(input.checks) !== undefined;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
function isNonEmptyString(value: unknown): value is string {
|
|
135
|
+
return typeof value === "string" && value.length > 0;
|
|
136
|
+
}
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
snapshotClosedPolicyRecord
|
|
5
5
|
} from "../../data-boundary/closed-values.ts";
|
|
6
6
|
import { isNonEmptyString } from "../../data-boundary/value-shapes.ts";
|
|
7
|
-
import type { FindingWaiver } from "../../finding-waivers/reconciliation.ts";
|
|
7
|
+
import type { FindingWaiver } from "../../package-tools/finding-waivers/reconciliation.ts";
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* Snapshots the shared closed waiver envelope while leaving identity grammar to the producing Check.
|
|
@@ -5,7 +5,7 @@ import { canonicalJsonBytes } from "../../data-boundary/canonical-data.ts";
|
|
|
5
5
|
import type {
|
|
6
6
|
FindingWaiverAudit,
|
|
7
7
|
FindingWaiverReconciliation
|
|
8
|
-
} from "../../finding-waivers/reconciliation.ts";
|
|
8
|
+
} from "../../package-tools/finding-waivers/reconciliation.ts";
|
|
9
9
|
|
|
10
10
|
interface CodeQualityFindingCandidate {
|
|
11
11
|
readonly data: Readonly<{ readonly blocking: boolean }>;
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
import { executeCommandCheck } from "./execution.ts";
|
|
2
|
+
import type { Check, CheckDataParser } from "../../check/check.ts";
|
|
3
|
+
import { resolveCommandCheckInput } from "./options.ts";
|
|
4
|
+
import type {
|
|
5
|
+
AfterCommand,
|
|
6
|
+
AfterCommandExecution,
|
|
7
|
+
CommandCheck,
|
|
8
|
+
CommandCheckInput,
|
|
9
|
+
CommandCheckWithAfterCommand,
|
|
10
|
+
ResolvedCommandCheckOptions,
|
|
11
|
+
TypedCommandCheck
|
|
12
|
+
} from "./contract.ts";
|
|
13
|
+
|
|
14
|
+
export type {
|
|
15
|
+
AfterCommand,
|
|
16
|
+
AfterCommandContext,
|
|
17
|
+
AfterCommandExecution,
|
|
18
|
+
CommandCheckWithAfterCommand,
|
|
19
|
+
CommandEnvironmentContext,
|
|
20
|
+
CommandEnvironmentResolver,
|
|
21
|
+
CompletedCommand,
|
|
22
|
+
CommandCheck,
|
|
23
|
+
CommandCheckEnvironment,
|
|
24
|
+
CommandCheckFinalData,
|
|
25
|
+
CommandCheckInput,
|
|
26
|
+
CommandCheckOutput,
|
|
27
|
+
CommandCheckUnavailableReasonCode,
|
|
28
|
+
TypedCommandCheck
|
|
29
|
+
} from "./contract.ts";
|
|
30
|
+
|
|
31
|
+
type CommandCheckImplementationInput = CommandCheckInput<string, AfterCommand | undefined>;
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* 构造一个单一 no-shell executable 的 ordinary Check。
|
|
35
|
+
*
|
|
36
|
+
* @remarks constructor 会闭合并冻结 command-owned options;ordinary selection、relation 与 scheduling fields 仍按普通 Check lifecycle 传递。默认 exact-empty environment 与 discard output 不会把 ambient variables、child stdout/stderr 或 native error text 发布到 Check facts。`output: { mode: "transcript" }` 仅在 invocation 授予此 Check artifact directory 时,将 raw stdout/stderr 写入固定 `process.log`。
|
|
37
|
+
* @example 以 process.execPath 构造无 shell command Check
|
|
38
|
+
* ```ts
|
|
39
|
+
* import { commandCheck, defineConfig, run } from "@zxyycom/vibe-check";
|
|
40
|
+
*
|
|
41
|
+
* const nodeProbe = commandCheck({
|
|
42
|
+
* checkId: "node-probe",
|
|
43
|
+
* displayName: "Node probe",
|
|
44
|
+
* executable: process.execPath,
|
|
45
|
+
* arguments: ["--eval", "process.exit(0)"],
|
|
46
|
+
* timeoutMs: 5_000,
|
|
47
|
+
* outputByteLimit: 64 * 1024
|
|
48
|
+
* });
|
|
49
|
+
*
|
|
50
|
+
* const definition = defineConfig({
|
|
51
|
+
* checks: [nodeProbe],
|
|
52
|
+
* outputs: {
|
|
53
|
+
* diagnosticLogging: { enabled: false },
|
|
54
|
+
* machinePublication: { enabled: false },
|
|
55
|
+
* progressRendering: { enabled: false }
|
|
56
|
+
* }
|
|
57
|
+
* });
|
|
58
|
+
*
|
|
59
|
+
* const result = await run(definition);
|
|
60
|
+
* if (result.kind !== "completed") throw new Error(`Run did not complete: ${result.kind}`);
|
|
61
|
+
* const outcome = result.snapshot.checks.find(
|
|
62
|
+
* ({ checkId }) => checkId === nodeProbe.checkId
|
|
63
|
+
* )?.outcome;
|
|
64
|
+
* if (outcome?.status !== "passed" || outcome.data.exitCode !== 0) {
|
|
65
|
+
* throw new Error("Node probe did not produce the expected passed outcome");
|
|
66
|
+
* }
|
|
67
|
+
* ```
|
|
68
|
+
*/
|
|
69
|
+
export function commandCheck<const Id extends string, const FinalData extends object>(
|
|
70
|
+
input: CommandCheckInput<
|
|
71
|
+
Id,
|
|
72
|
+
Readonly<{
|
|
73
|
+
readonly execute: AfterCommandExecution<FinalData>;
|
|
74
|
+
readonly parseData?: never;
|
|
75
|
+
}>
|
|
76
|
+
>
|
|
77
|
+
): CommandCheckWithAfterCommand<Id, FinalData>;
|
|
78
|
+
export function commandCheck<const Id extends string, const Parser extends CheckDataParser>(
|
|
79
|
+
input: CommandCheckInput<
|
|
80
|
+
Id,
|
|
81
|
+
Readonly<{
|
|
82
|
+
readonly execute: AfterCommandExecution<NoInfer<ReturnType<Parser>>>;
|
|
83
|
+
readonly parseData: Parser;
|
|
84
|
+
}>
|
|
85
|
+
>
|
|
86
|
+
): TypedCommandCheck<Id, Parser>;
|
|
87
|
+
export function commandCheck<const Id extends string>(
|
|
88
|
+
input: CommandCheckInput<Id>
|
|
89
|
+
): CommandCheck<Id>;
|
|
90
|
+
export function commandCheck(input: CommandCheckImplementationInput): Check {
|
|
91
|
+
const commandInput = input;
|
|
92
|
+
const resolved = resolveCommandCheckInput(input);
|
|
93
|
+
if (resolved === undefined) {
|
|
94
|
+
throw new TypeError(
|
|
95
|
+
"commandCheck input must match the documented closed command and ordinary Check authoring policy"
|
|
96
|
+
);
|
|
97
|
+
}
|
|
98
|
+
return {
|
|
99
|
+
...(commandInput.admissionPriority === undefined
|
|
100
|
+
? {}
|
|
101
|
+
: { admissionPriority: commandInput.admissionPriority }),
|
|
102
|
+
...(commandInput.checks === undefined ? {} : { checks: commandInput.checks }),
|
|
103
|
+
...(commandInput.dependsOn === undefined ? {} : { dependsOn: commandInput.dependsOn }),
|
|
104
|
+
...(commandInput.enabledByFlags === undefined
|
|
105
|
+
? {}
|
|
106
|
+
: { enabledByFlags: commandInput.enabledByFlags }),
|
|
107
|
+
...(commandInput.maxParallel === undefined ? {} : { maxParallel: commandInput.maxParallel }),
|
|
108
|
+
...(commandInput.mutex === undefined ? {} : { mutex: commandInput.mutex }),
|
|
109
|
+
...(commandInput.observes === undefined ? {} : { observes: commandInput.observes }),
|
|
110
|
+
...(commandInput.omitQuietPassedRow === undefined
|
|
111
|
+
? {}
|
|
112
|
+
: { omitQuietPassedRow: commandInput.omitQuietPassedRow }),
|
|
113
|
+
...(commandInput.resourceClaims === undefined
|
|
114
|
+
? {}
|
|
115
|
+
: { resourceClaims: commandInput.resourceClaims }),
|
|
116
|
+
checkId: commandInput.checkId,
|
|
117
|
+
displayName: commandInput.displayName,
|
|
118
|
+
execute: (context: Parameters<CommandCheck["execute"]>[0]) =>
|
|
119
|
+
executeCommandCheck(context, {
|
|
120
|
+
afterCommand: resolved.afterCommand,
|
|
121
|
+
resolveEnvironment: resolved.resolveEnvironment
|
|
122
|
+
}),
|
|
123
|
+
options: resolved.options,
|
|
124
|
+
prepare: (options: ResolvedCommandCheckOptions) =>
|
|
125
|
+
isRevalidatedCommandOptions(options, commandInput.checkId, commandInput.displayName)
|
|
126
|
+
? { status: "success", preparedOptions: options }
|
|
127
|
+
: { status: "failure", action: "block", reason: { code: "invalid-options" } },
|
|
128
|
+
...(resolved.afterCommand?.parseData === undefined
|
|
129
|
+
? {}
|
|
130
|
+
: { parseData: resolved.afterCommand.parseData })
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
function isRevalidatedCommandOptions<Id extends string>(
|
|
135
|
+
options: ResolvedCommandCheckOptions,
|
|
136
|
+
checkId: Id,
|
|
137
|
+
displayName: string
|
|
138
|
+
): boolean {
|
|
139
|
+
return (
|
|
140
|
+
resolveCommandCheckInput({
|
|
141
|
+
checkId,
|
|
142
|
+
displayName,
|
|
143
|
+
executable: options.executable,
|
|
144
|
+
arguments: options.arguments,
|
|
145
|
+
environment: options.environment,
|
|
146
|
+
output: options.output,
|
|
147
|
+
outputByteLimit: options.outputByteLimit,
|
|
148
|
+
timeoutMs: options.timeoutMs,
|
|
149
|
+
...(options.workingDirectory === null ? {} : { workingDirectory: options.workingDirectory })
|
|
150
|
+
}) !== undefined
|
|
151
|
+
);
|
|
152
|
+
}
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
Check,
|
|
3
|
+
CheckDataParser,
|
|
4
|
+
CheckDependencies,
|
|
5
|
+
CheckExecutionContext,
|
|
6
|
+
CheckFlagEnablement,
|
|
7
|
+
CheckProjectContext,
|
|
8
|
+
CheckResourceClaims,
|
|
9
|
+
CheckResult,
|
|
10
|
+
CheckWithOptions,
|
|
11
|
+
DeepReadonly,
|
|
12
|
+
InheritableCheckCollection,
|
|
13
|
+
TypedCheckWithOptions
|
|
14
|
+
} from "../../check/check.ts";
|
|
15
|
+
|
|
16
|
+
/** command Check 的显式环境策略;默认 exact-empty,避免定义时读取 ambient environment。 */
|
|
17
|
+
export type CommandCheckEnvironment =
|
|
18
|
+
| Readonly<{
|
|
19
|
+
readonly mode: "exact";
|
|
20
|
+
readonly variables?: Readonly<Record<string, string>>;
|
|
21
|
+
}>
|
|
22
|
+
| Readonly<{
|
|
23
|
+
readonly mode: "inherit";
|
|
24
|
+
readonly overrides?: Readonly<Record<string, string | null>>;
|
|
25
|
+
}>;
|
|
26
|
+
|
|
27
|
+
/** child stdout/stderr 的处理边界;默认 discard。 */
|
|
28
|
+
export type CommandCheckOutput = Readonly<{ readonly mode: "discard" | "transcript" }>;
|
|
29
|
+
|
|
30
|
+
/** command 以 numeric exit status 结束时发布的唯一 final data。 */
|
|
31
|
+
export interface CommandCheckFinalData {
|
|
32
|
+
/** child process 的 numeric exit status。 */
|
|
33
|
+
readonly exitCode: number;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/** 已完整结束且只在 invocation-local callback 中可见的 child material。 */
|
|
37
|
+
export interface CompletedCommand {
|
|
38
|
+
readonly exitCode: number;
|
|
39
|
+
readonly stderr: string;
|
|
40
|
+
readonly stdout: string;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/** spawn 前 environment resolver 可读取的最小 invocation context。 */
|
|
44
|
+
export interface CommandEnvironmentContext {
|
|
45
|
+
readonly dependencies: CheckDependencies;
|
|
46
|
+
readonly options: DeepReadonly<ResolvedCommandCheckOptions>;
|
|
47
|
+
readonly project: CheckProjectContext;
|
|
48
|
+
readonly signal: AbortSignal;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/** 完整 command 后 caller-owned settlement 可读取的 context。 */
|
|
52
|
+
export type AfterCommandContext = CheckExecutionContext<ResolvedCommandCheckOptions> &
|
|
53
|
+
Readonly<{ readonly command: CompletedCommand }>;
|
|
54
|
+
|
|
55
|
+
/** 完整 command 的 caller-owned settlement callback。 */
|
|
56
|
+
export type AfterCommandExecution<FinalData extends object = object> = (
|
|
57
|
+
this: void,
|
|
58
|
+
context: AfterCommandContext
|
|
59
|
+
) => CheckResult<FinalData> | Promise<CheckResult<FinalData>>;
|
|
60
|
+
|
|
61
|
+
/** command 完成后的可选 caller-owned settlement 与 typed-provider parser。 */
|
|
62
|
+
export type AfterCommand<FinalData extends object = object> = Readonly<{
|
|
63
|
+
readonly execute: AfterCommandExecution<FinalData>;
|
|
64
|
+
readonly parseData?: CheckDataParser | undefined;
|
|
65
|
+
}>;
|
|
66
|
+
|
|
67
|
+
/** spawn 前解析此次 command closed environment policy 的 callback。 */
|
|
68
|
+
export type CommandEnvironmentResolver = (
|
|
69
|
+
this: void,
|
|
70
|
+
context: CommandEnvironmentContext
|
|
71
|
+
) => CommandCheckEnvironment | Promise<CommandCheckEnvironment>;
|
|
72
|
+
|
|
73
|
+
/** command Check 自己产生的 stable unavailable reason code。 */
|
|
74
|
+
export type CommandCheckUnavailableReasonCode =
|
|
75
|
+
| "command-environment-resolution-failed"
|
|
76
|
+
| "command-output-limit-exceeded"
|
|
77
|
+
| "command-start-failed"
|
|
78
|
+
| "command-terminated-by-signal"
|
|
79
|
+
| "command-timeout"
|
|
80
|
+
| "command-transcript-unavailable"
|
|
81
|
+
| "invalid-options";
|
|
82
|
+
|
|
83
|
+
/** `commandCheck` 的 closed authoring input;ordinary Check composition fields 原样交由 Core 处理。 */
|
|
84
|
+
interface CommandCheckBaseInput<Id extends string> {
|
|
85
|
+
readonly checkId: Id;
|
|
86
|
+
readonly displayName: string;
|
|
87
|
+
readonly executable: string;
|
|
88
|
+
readonly arguments?: readonly string[];
|
|
89
|
+
readonly workingDirectory?: string;
|
|
90
|
+
readonly timeoutMs: number;
|
|
91
|
+
readonly outputByteLimit: number;
|
|
92
|
+
readonly output?: CommandCheckOutput;
|
|
93
|
+
readonly enabledByFlags?: CheckFlagEnablement;
|
|
94
|
+
readonly checks?: readonly Check[];
|
|
95
|
+
readonly dependsOn?: InheritableCheckCollection<string>;
|
|
96
|
+
readonly observes?: InheritableCheckCollection<string>;
|
|
97
|
+
readonly maxParallel?: number;
|
|
98
|
+
readonly admissionPriority?: number;
|
|
99
|
+
readonly mutex?: InheritableCheckCollection<string>;
|
|
100
|
+
readonly resourceClaims?: CheckResourceClaims;
|
|
101
|
+
readonly omitQuietPassedRow?: true;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/** Static environment 与 invocation-time resolver 互斥;两者都省略时使用 exact-empty。 */
|
|
105
|
+
export type CommandCheckInput<
|
|
106
|
+
Id extends string = string,
|
|
107
|
+
After extends AfterCommand | undefined = undefined
|
|
108
|
+
> = CommandCheckBaseInput<Id> &
|
|
109
|
+
(
|
|
110
|
+
| Readonly<{
|
|
111
|
+
readonly environment?: CommandCheckEnvironment;
|
|
112
|
+
readonly resolveEnvironment?: never;
|
|
113
|
+
}>
|
|
114
|
+
| Readonly<{
|
|
115
|
+
readonly environment?: never;
|
|
116
|
+
readonly resolveEnvironment: CommandEnvironmentResolver;
|
|
117
|
+
}>
|
|
118
|
+
) &
|
|
119
|
+
(After extends undefined
|
|
120
|
+
? Readonly<{ readonly afterCommand?: undefined }>
|
|
121
|
+
: Readonly<{ readonly afterCommand: After }>);
|
|
122
|
+
|
|
123
|
+
/** command constructor materializes、冻结并在 preparation 再次验证的内部完整 options。 */
|
|
124
|
+
export interface ResolvedCommandCheckOptions {
|
|
125
|
+
readonly arguments: readonly string[];
|
|
126
|
+
readonly environment:
|
|
127
|
+
| Readonly<{ readonly mode: "exact"; readonly variables: Readonly<Record<string, string>> }>
|
|
128
|
+
| Readonly<{
|
|
129
|
+
readonly mode: "inherit";
|
|
130
|
+
readonly overrides: Readonly<Record<string, string | null>>;
|
|
131
|
+
}>;
|
|
132
|
+
readonly executable: string;
|
|
133
|
+
readonly output: Readonly<{ readonly mode: "discard" | "transcript" }>;
|
|
134
|
+
readonly outputByteLimit: number;
|
|
135
|
+
readonly timeoutMs: number;
|
|
136
|
+
/** `null` 表示 execution 时使用 invocation project root。 */
|
|
137
|
+
readonly workingDirectory: string | null;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
/** 可放入普通 Project Definition 的 process-backed Check。 */
|
|
141
|
+
export type CommandCheck<Id extends string = string> = CheckWithOptions<
|
|
142
|
+
Id,
|
|
143
|
+
ResolvedCommandCheckOptions
|
|
144
|
+
> &
|
|
145
|
+
Readonly<{
|
|
146
|
+
execute(
|
|
147
|
+
this: void,
|
|
148
|
+
context: CheckExecutionContext<ResolvedCommandCheckOptions>
|
|
149
|
+
): CheckResult<CommandCheckFinalData> | Promise<CheckResult<CommandCheckFinalData>>;
|
|
150
|
+
}>;
|
|
151
|
+
|
|
152
|
+
/** 带 caller-owned completion callback 的 ordinary command Check。 */
|
|
153
|
+
export type CommandCheckWithAfterCommand<Id extends string, FinalData extends object> = Omit<
|
|
154
|
+
CheckWithOptions<Id, ResolvedCommandCheckOptions>,
|
|
155
|
+
"execute"
|
|
156
|
+
> &
|
|
157
|
+
Readonly<{
|
|
158
|
+
execute(
|
|
159
|
+
this: void,
|
|
160
|
+
context: CheckExecutionContext<ResolvedCommandCheckOptions>
|
|
161
|
+
): CheckResult<FinalData> | Promise<CheckResult<FinalData>>;
|
|
162
|
+
}>;
|
|
163
|
+
|
|
164
|
+
/** 带 caller-owned completion callback 与 parser 的 typed-provider command Check。 */
|
|
165
|
+
export type TypedCommandCheck<
|
|
166
|
+
Id extends string,
|
|
167
|
+
Parser extends CheckDataParser
|
|
168
|
+
> = TypedCheckWithOptions<Id, ResolvedCommandCheckOptions, Parser>;
|
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
import { isAbsolute, resolve } from "node:path";
|
|
2
|
+
|
|
3
|
+
import type { CheckExecutionContext, CheckResult } from "../../check/check.ts";
|
|
4
|
+
import { runProcess } from "../host-environment/process.ts";
|
|
5
|
+
import { isValidResolvedCommandCheckOptions, resolveCommandCheckEnvironment } from "./options.ts";
|
|
6
|
+
import { closedTranscript, runningTranscript, writeCommandTranscript } from "./transcript.ts";
|
|
7
|
+
import type {
|
|
8
|
+
AfterCommand,
|
|
9
|
+
CommandCheckFinalData,
|
|
10
|
+
CommandEnvironmentResolver,
|
|
11
|
+
CommandCheckUnavailableReasonCode,
|
|
12
|
+
ResolvedCommandCheckOptions
|
|
13
|
+
} from "./contract.ts";
|
|
14
|
+
|
|
15
|
+
type CommandProcessResult = Awaited<ReturnType<typeof runProcess>> &
|
|
16
|
+
Readonly<{ readonly isCanceled?: true; readonly isMaxBuffer?: true; readonly timedOut?: true }>;
|
|
17
|
+
|
|
18
|
+
/** Executes one validated no-shell command and releases all child material after optional transcript persistence. */
|
|
19
|
+
export async function executeCommandCheck(
|
|
20
|
+
context: CheckExecutionContext<ResolvedCommandCheckOptions>,
|
|
21
|
+
executionExtensions: Readonly<{
|
|
22
|
+
readonly afterCommand?: AfterCommand | undefined;
|
|
23
|
+
readonly resolveEnvironment?: CommandEnvironmentResolver | undefined;
|
|
24
|
+
}> = {}
|
|
25
|
+
): Promise<CheckResult> {
|
|
26
|
+
if (!isValidResolvedCommandCheckOptions(context.options)) return unavailable("invalid-options");
|
|
27
|
+
|
|
28
|
+
const environment = await resolveExecutionEnvironment(
|
|
29
|
+
context,
|
|
30
|
+
executionExtensions.resolveEnvironment
|
|
31
|
+
);
|
|
32
|
+
if (environment === undefined) return unavailable("command-environment-resolution-failed");
|
|
33
|
+
|
|
34
|
+
return executeResolvedCommand(context, environment, executionExtensions.afterCommand);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/** Runs one resolved command, preserving requested transcripts before caller-owned settlement. */
|
|
38
|
+
async function executeResolvedCommand(
|
|
39
|
+
context: CheckExecutionContext<ResolvedCommandCheckOptions>,
|
|
40
|
+
environment: ResolvedCommandCheckOptions["environment"],
|
|
41
|
+
afterCommand: AfterCommand | undefined
|
|
42
|
+
): Promise<CheckResult> {
|
|
43
|
+
const { options } = context;
|
|
44
|
+
if (!(await writeRunningCommandTranscript(context.artifactDirectory, options.output.mode))) {
|
|
45
|
+
return unavailable("command-transcript-unavailable");
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
const result = await runProcess({
|
|
49
|
+
args: options.arguments,
|
|
50
|
+
cancelSignal: context.signal,
|
|
51
|
+
command: options.executable,
|
|
52
|
+
cwd: resolveWorkingDirectory(options.workingDirectory, context.project.root),
|
|
53
|
+
env: executionEnvironment(environment),
|
|
54
|
+
extendEnv: false,
|
|
55
|
+
label: "command Check",
|
|
56
|
+
maxBuffer: options.outputByteLimit,
|
|
57
|
+
timeout: options.timeoutMs
|
|
58
|
+
});
|
|
59
|
+
const terminal = terminalResult(result);
|
|
60
|
+
if (
|
|
61
|
+
!(await writeClosedCommandTranscript(
|
|
62
|
+
context.artifactDirectory,
|
|
63
|
+
options.output.mode,
|
|
64
|
+
terminal.status,
|
|
65
|
+
result
|
|
66
|
+
))
|
|
67
|
+
) {
|
|
68
|
+
return unavailable("command-transcript-unavailable");
|
|
69
|
+
}
|
|
70
|
+
return settleCommandResult(context, result, terminal.result, afterCommand);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/** Writes the running marker only where output policy and artifact capability both allow it. */
|
|
74
|
+
async function writeRunningCommandTranscript(
|
|
75
|
+
artifactDirectory: string | null,
|
|
76
|
+
outputMode: ResolvedCommandCheckOptions["output"]["mode"]
|
|
77
|
+
): Promise<boolean> {
|
|
78
|
+
if (outputMode === "discard") return true;
|
|
79
|
+
return (
|
|
80
|
+
artifactDirectory !== null && writeCommandTranscript(artifactDirectory, runningTranscript())
|
|
81
|
+
);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/** Replaces the running marker with final child material before any caller-owned callback observes it. */
|
|
85
|
+
async function writeClosedCommandTranscript(
|
|
86
|
+
artifactDirectory: string | null,
|
|
87
|
+
outputMode: ResolvedCommandCheckOptions["output"]["mode"],
|
|
88
|
+
status: "passed" | "failed" | "unavailable",
|
|
89
|
+
result: CommandProcessResult
|
|
90
|
+
): Promise<boolean> {
|
|
91
|
+
if (outputMode === "discard") return true;
|
|
92
|
+
return (
|
|
93
|
+
artifactDirectory !== null &&
|
|
94
|
+
writeCommandTranscript(
|
|
95
|
+
artifactDirectory,
|
|
96
|
+
closedTranscript({ status, stderr: result.stderr, stdout: result.stdout })
|
|
97
|
+
)
|
|
98
|
+
);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/** Lets the caller settle only complete numeric exits; all other terminal causes remain Product-owned. */
|
|
102
|
+
function settleCommandResult(
|
|
103
|
+
context: CheckExecutionContext<ResolvedCommandCheckOptions>,
|
|
104
|
+
result: CommandProcessResult,
|
|
105
|
+
defaultResult: CheckResult<CommandCheckFinalData>,
|
|
106
|
+
afterCommand: AfterCommand | undefined
|
|
107
|
+
): CheckResult | Promise<CheckResult> {
|
|
108
|
+
if (afterCommand === undefined || !isCompleteCommandResult(result)) return defaultResult;
|
|
109
|
+
return afterCommand.execute(
|
|
110
|
+
Object.freeze({
|
|
111
|
+
...context,
|
|
112
|
+
command: Object.freeze({
|
|
113
|
+
exitCode: result.status,
|
|
114
|
+
stderr: result.stderr,
|
|
115
|
+
stdout: result.stdout
|
|
116
|
+
})
|
|
117
|
+
})
|
|
118
|
+
);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
async function resolveExecutionEnvironment(
|
|
122
|
+
context: CheckExecutionContext<ResolvedCommandCheckOptions>,
|
|
123
|
+
resolver: CommandEnvironmentResolver | undefined
|
|
124
|
+
): Promise<ResolvedCommandCheckOptions["environment"] | undefined> {
|
|
125
|
+
if (resolver === undefined) return context.options.environment;
|
|
126
|
+
try {
|
|
127
|
+
const environment = await resolver(
|
|
128
|
+
Object.freeze({
|
|
129
|
+
dependencies: context.dependencies,
|
|
130
|
+
options: context.options,
|
|
131
|
+
project: context.project,
|
|
132
|
+
signal: context.signal
|
|
133
|
+
})
|
|
134
|
+
);
|
|
135
|
+
return resolveCommandCheckEnvironment(environment);
|
|
136
|
+
} catch {
|
|
137
|
+
return undefined;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
function resolveWorkingDirectory(workingDirectory: string | null, projectRoot: string): string {
|
|
142
|
+
if (workingDirectory === null) return projectRoot;
|
|
143
|
+
if (isAbsolute(workingDirectory)) return workingDirectory;
|
|
144
|
+
return resolve(projectRoot, workingDirectory);
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
function executionEnvironment(
|
|
148
|
+
environment: ResolvedCommandCheckOptions["environment"]
|
|
149
|
+
): NodeJS.ProcessEnv {
|
|
150
|
+
if (environment.mode === "exact") return { ...environment.variables };
|
|
151
|
+
const inherited: NodeJS.ProcessEnv = { ...process.env };
|
|
152
|
+
for (const [name, value] of Object.entries(environment.overrides)) {
|
|
153
|
+
if (value === null) delete inherited[name];
|
|
154
|
+
else inherited[name] = value;
|
|
155
|
+
}
|
|
156
|
+
return inherited;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
function isCompleteCommandResult(result: CommandProcessResult): result is CommandProcessResult & {
|
|
160
|
+
readonly status: number;
|
|
161
|
+
} {
|
|
162
|
+
return (
|
|
163
|
+
typeof result.status === "number" &&
|
|
164
|
+
result.isCanceled !== true &&
|
|
165
|
+
result.isMaxBuffer !== true &&
|
|
166
|
+
result.timedOut !== true &&
|
|
167
|
+
result.signal === null
|
|
168
|
+
);
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
function terminalResult(result: CommandProcessResult): Readonly<{
|
|
172
|
+
readonly result: CheckResult<CommandCheckFinalData>;
|
|
173
|
+
readonly status: "passed" | "failed" | "unavailable";
|
|
174
|
+
}> {
|
|
175
|
+
if (typeof result.status === "number" && result.status !== 0) {
|
|
176
|
+
return completedTerminal("failed", result.status);
|
|
177
|
+
}
|
|
178
|
+
if (result.isCanceled === true) return unavailableTerminal("command-terminated-by-signal");
|
|
179
|
+
if (result.timedOut === true) return unavailableTerminal("command-timeout");
|
|
180
|
+
if (result.isMaxBuffer === true) return unavailableTerminal("command-output-limit-exceeded");
|
|
181
|
+
if (result.signal !== null) return unavailableTerminal("command-terminated-by-signal");
|
|
182
|
+
if (result.status === 0) {
|
|
183
|
+
return completedTerminal("passed", 0);
|
|
184
|
+
}
|
|
185
|
+
return unavailableTerminal("command-start-failed");
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
function completedTerminal(
|
|
189
|
+
status: "passed" | "failed",
|
|
190
|
+
exitCode: number
|
|
191
|
+
): Readonly<{
|
|
192
|
+
readonly result: CheckResult<CommandCheckFinalData>;
|
|
193
|
+
readonly status: "passed" | "failed";
|
|
194
|
+
}> {
|
|
195
|
+
const result: CheckResult<CommandCheckFinalData> =
|
|
196
|
+
status === "passed"
|
|
197
|
+
? Object.freeze({ status: "passed" as const, data: Object.freeze({ exitCode }) })
|
|
198
|
+
: Object.freeze({ status: "failed" as const, data: Object.freeze({ exitCode }) });
|
|
199
|
+
return Object.freeze({ result, status });
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
function unavailableTerminal(code: CommandCheckUnavailableReasonCode): Readonly<{
|
|
203
|
+
readonly result: CheckResult<CommandCheckFinalData>;
|
|
204
|
+
readonly status: "unavailable";
|
|
205
|
+
}> {
|
|
206
|
+
return Object.freeze({ result: unavailable(code), status: "unavailable" });
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
function unavailable(code: CommandCheckUnavailableReasonCode): CheckResult<CommandCheckFinalData> {
|
|
210
|
+
return Object.freeze({ status: "unavailable", reason: Object.freeze({ code }) });
|
|
211
|
+
}
|