@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
|
@@ -3,12 +3,11 @@ import type { MeaninglessCheckWarning } from "./check-tree/authoring.ts";
|
|
|
3
3
|
import type { CheckDescriptor } from "../check/descriptor.ts";
|
|
4
4
|
import type {
|
|
5
5
|
Check,
|
|
6
|
-
|
|
7
|
-
CheckFlagEnablement,
|
|
8
|
-
CheckPreflight,
|
|
6
|
+
CheckPreparation,
|
|
9
7
|
CheckResourceClaims,
|
|
10
|
-
|
|
8
|
+
CheckFlagEnablement
|
|
11
9
|
} from "../check/check.ts";
|
|
10
|
+
import type { HandoffProviderIdentity } from "../check/handoff-provider-identity.ts";
|
|
12
11
|
import { DEFAULT_PROJECT_OUTPUTS, resolveProgressRenderingOutput } from "./output-defaults.ts";
|
|
13
12
|
import type {
|
|
14
13
|
ProgressRenderingOutput,
|
|
@@ -19,6 +18,11 @@ import {
|
|
|
19
18
|
EMPTY_RESOURCE_UNIT_MAPPING,
|
|
20
19
|
snapshotResourceUnitMapping
|
|
21
20
|
} from "./resource-unit-mapping.ts";
|
|
21
|
+
import {
|
|
22
|
+
parseProjectChangesConfiguration,
|
|
23
|
+
type NormalizedProjectChangesConfiguration,
|
|
24
|
+
type ProjectChangesConfiguration
|
|
25
|
+
} from "./project-changes.ts";
|
|
22
26
|
export { createDeclarativeFingerprint } from "./declarative-snapshot.ts";
|
|
23
27
|
|
|
24
28
|
/** 一次 Project Run 的明确输出配置。 */
|
|
@@ -92,7 +96,7 @@ export type {
|
|
|
92
96
|
SchedulerMeasurementAdmission,
|
|
93
97
|
SchedulerMeasurementContext,
|
|
94
98
|
SchedulerMeasurementEffect,
|
|
95
|
-
|
|
99
|
+
SchedulerTerminalEffect,
|
|
96
100
|
SchedulerMeasurementIntervalContribution,
|
|
97
101
|
SchedulerMeasurementPeakCounts,
|
|
98
102
|
SchedulerMeasurementTiming,
|
|
@@ -103,10 +107,7 @@ export type {
|
|
|
103
107
|
} from "./scheduler-policy.ts";
|
|
104
108
|
import type {
|
|
105
109
|
AdmissionPolicy,
|
|
106
|
-
CustomAdmissionStrategy,
|
|
107
|
-
CustomAdmissionPreparationContext,
|
|
108
110
|
DeclarativeSchedulerPolicy,
|
|
109
|
-
PreparedCustomAdmissionStrategy,
|
|
110
111
|
SchedulerPolicy
|
|
111
112
|
} from "./scheduler-policy.ts";
|
|
112
113
|
|
|
@@ -119,12 +120,15 @@ import type {
|
|
|
119
120
|
export interface ProjectDefinition {
|
|
120
121
|
readonly apiVersion: "1";
|
|
121
122
|
readonly checks: readonly Check[];
|
|
123
|
+
/** 可选的静态 Git comparison 与本次 Run 的 change-flag regions。 */
|
|
124
|
+
readonly changes?: ProjectChangesConfiguration;
|
|
122
125
|
readonly outputs: ProjectOutputs;
|
|
123
126
|
readonly scheduler: SchedulerPolicy;
|
|
124
127
|
}
|
|
125
128
|
type ProjectDefinitionInput = Readonly<{
|
|
126
129
|
apiVersion?: "1";
|
|
127
130
|
checks?: readonly Check[];
|
|
131
|
+
changes?: ProjectChangesConfiguration;
|
|
128
132
|
outputs?: Partial<{
|
|
129
133
|
machinePublication: Partial<ProjectOutputs["machinePublication"]>;
|
|
130
134
|
progressRendering: Partial<ProjectOutputs["progressRendering"]>;
|
|
@@ -150,26 +154,30 @@ export interface NormalizedCheckDeclaration {
|
|
|
150
154
|
readonly admissionPriority: number;
|
|
151
155
|
readonly definition: CheckDescriptor;
|
|
152
156
|
readonly dependsOn: readonly string[];
|
|
157
|
+
/** Definition 已验证、snapshot 并冻结的单一 recursive flag-condition control。 */
|
|
153
158
|
readonly enabledByFlags?: CheckFlagEnablement;
|
|
154
159
|
readonly maxParallel: number;
|
|
155
160
|
readonly mutex: readonly string[];
|
|
156
161
|
readonly observes: readonly string[];
|
|
157
162
|
readonly options: object;
|
|
158
163
|
readonly resourceClaims: CheckResourceClaims;
|
|
159
|
-
readonly
|
|
164
|
+
readonly omitQuietPassedRow: boolean;
|
|
160
165
|
}
|
|
161
166
|
export interface NormalizedCheck extends NormalizedCheckDeclaration {
|
|
162
|
-
readonly
|
|
163
|
-
readonly
|
|
167
|
+
readonly execute: NonNullable<Check["execute"]>;
|
|
168
|
+
readonly handoff?: HandoffProviderIdentity;
|
|
169
|
+
readonly prepare?: CheckPreparation;
|
|
164
170
|
}
|
|
165
171
|
export interface DeclarativeProjectSnapshot {
|
|
166
172
|
readonly apiVersion: "1";
|
|
167
173
|
readonly checks: readonly NormalizedCheckDeclaration[];
|
|
174
|
+
readonly changes?: NormalizedProjectChangesConfiguration;
|
|
168
175
|
readonly outputs: DeclarativeProjectOutputs;
|
|
169
176
|
readonly scheduler: DeclarativeSchedulerPolicy;
|
|
170
177
|
}
|
|
171
178
|
export interface NormalizedProjectDefinition {
|
|
172
179
|
readonly checks: readonly NormalizedCheck[];
|
|
180
|
+
readonly changes?: NormalizedProjectChangesConfiguration;
|
|
173
181
|
readonly declarative: DeclarativeProjectSnapshot;
|
|
174
182
|
readonly definitionWarnings: readonly DefinitionWarning[];
|
|
175
183
|
/** Runtime scheduler policy;custom callback 保留在此处。 */
|
|
@@ -178,54 +186,6 @@ export interface NormalizedProjectDefinition {
|
|
|
178
186
|
const STATIC_ADMISSION_POLICY: AdmissionPolicy = Object.freeze({
|
|
179
187
|
kind: "static"
|
|
180
188
|
});
|
|
181
|
-
type ExactAdmissionPolicy<T extends AdmissionPolicy> =
|
|
182
|
-
T extends Readonly<{ readonly kind: "static" }>
|
|
183
|
-
? T & Record<Exclude<keyof T, "kind">, never>
|
|
184
|
-
: T extends Readonly<{ readonly kind: "custom" }>
|
|
185
|
-
? T &
|
|
186
|
-
Record<Exclude<keyof T, "kind" | "strategy">, never> &
|
|
187
|
-
Readonly<{
|
|
188
|
-
readonly strategy: ExactCustomAdmissionStrategy<T["strategy"]>;
|
|
189
|
-
}>
|
|
190
|
-
: never;
|
|
191
|
-
|
|
192
|
-
type ExactCustomAdmissionStrategy<T extends CustomAdmissionStrategy> =
|
|
193
|
-
T extends Readonly<{ readonly kind: "simple" }>
|
|
194
|
-
? T & Record<Exclude<keyof T, "kind" | "decide">, never>
|
|
195
|
-
: T extends Readonly<{ readonly kind: "prepared" }>
|
|
196
|
-
? T &
|
|
197
|
-
Record<Exclude<keyof T, "kind" | "prepare">, never> &
|
|
198
|
-
Readonly<{ readonly prepare: ExactCustomPreparation<T["prepare"]> }>
|
|
199
|
-
: never;
|
|
200
|
-
|
|
201
|
-
type ExactCustomPreparation<T> = T extends (
|
|
202
|
-
this: void,
|
|
203
|
-
context: CustomAdmissionPreparationContext
|
|
204
|
-
) => infer Result
|
|
205
|
-
? (this: void, context: CustomAdmissionPreparationContext) => ExactCustomPreparationResult<Result>
|
|
206
|
-
: never;
|
|
207
|
-
|
|
208
|
-
type ExactCustomPreparationResult<T> =
|
|
209
|
-
T extends Promise<unknown>
|
|
210
|
-
? Promise<ExactPreparedCustomAdmissionStrategy<Awaited<T>>>
|
|
211
|
-
: ExactPreparedCustomAdmissionStrategy<T>;
|
|
212
|
-
|
|
213
|
-
type ExactPreparedCustomAdmissionStrategy<T> = T extends PreparedCustomAdmissionStrategy
|
|
214
|
-
? T & Record<Exclude<keyof T, "decide" | "complete">, never>
|
|
215
|
-
: never;
|
|
216
|
-
|
|
217
|
-
/**
|
|
218
|
-
* 保留 closed admission policy literal 的 TypeScript inference,不创建额外运行语义。
|
|
219
|
-
*
|
|
220
|
-
* @remarks inline policy 与此 helper 的结果完全等价。custom simple `decide` 同步运行;prepared
|
|
221
|
-
* strategy 为每个 graph-ready Run 解析独立 closure,调用方负责其 trusted host callback 的可重入性。
|
|
222
|
-
*/
|
|
223
|
-
export function defineAdmissionPolicy<const T extends AdmissionPolicy>(
|
|
224
|
-
policy: ExactAdmissionPolicy<T>
|
|
225
|
-
): T {
|
|
226
|
-
return policy;
|
|
227
|
-
}
|
|
228
|
-
|
|
229
189
|
/** 使用 Product 默认输出创建普通 Project Definition。 */
|
|
230
190
|
export function defineConfig<const T extends ProjectDefinitionInput>(
|
|
231
191
|
value: T & Record<Exclude<keyof T, keyof ProjectDefinitionInput>, never>
|
|
@@ -233,6 +193,7 @@ export function defineConfig<const T extends ProjectDefinitionInput>(
|
|
|
233
193
|
return {
|
|
234
194
|
apiVersion: value.apiVersion ?? "1",
|
|
235
195
|
checks: value.checks ?? [],
|
|
196
|
+
...(value.changes === undefined ? {} : { changes: value.changes }),
|
|
236
197
|
outputs: {
|
|
237
198
|
machinePublication: {
|
|
238
199
|
directory:
|
|
@@ -255,7 +216,7 @@ export function defineConfig<const T extends ProjectDefinitionInput>(
|
|
|
255
216
|
scheduler: {
|
|
256
217
|
admissionPolicy: value.scheduler?.admissionPolicy ?? STATIC_ADMISSION_POLICY,
|
|
257
218
|
maxParallel: value.scheduler?.maxParallel ?? 4,
|
|
258
|
-
|
|
219
|
+
terminalEffects: value.scheduler?.terminalEffects ?? [],
|
|
259
220
|
resourceCapacities: value.scheduler?.resourceCapacities ?? EMPTY_RESOURCE_UNIT_MAPPING
|
|
260
221
|
}
|
|
261
222
|
};
|
|
@@ -272,12 +233,23 @@ export function normalizeProjectDefinition(
|
|
|
272
233
|
if (tree === undefined)
|
|
273
234
|
throw new TypeError("Project Definition Check tree failed closed normalization");
|
|
274
235
|
const checks = Object.freeze(tree.leaves.map(normalizeCheck));
|
|
236
|
+
const changes =
|
|
237
|
+
definition.changes === undefined
|
|
238
|
+
? undefined
|
|
239
|
+
: parseProjectChangesConfiguration(definition.changes);
|
|
240
|
+
if (definition.changes !== undefined && changes === undefined) {
|
|
241
|
+
throw new TypeError("Project Definition changes failed closed normalization");
|
|
242
|
+
}
|
|
243
|
+
const { changes: _authoredChanges, ...baseDefinition } = definition;
|
|
244
|
+
const normalizedDefinition = Object.freeze({
|
|
245
|
+
...baseDefinition,
|
|
246
|
+
...(changes === undefined ? {} : { changes }),
|
|
247
|
+
scheduler
|
|
248
|
+
});
|
|
275
249
|
return Object.freeze({
|
|
276
250
|
checks,
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
checks
|
|
280
|
-
),
|
|
251
|
+
...(changes === undefined ? {} : { changes }),
|
|
252
|
+
declarative: createDeclarativeProjectSnapshot(normalizedDefinition, checks),
|
|
281
253
|
definitionWarnings: tree.warnings,
|
|
282
254
|
scheduler
|
|
283
255
|
});
|
|
@@ -288,14 +260,15 @@ function normalizeCheck(leaf: ResolvedCheckTreeLeaf): NormalizedCheck {
|
|
|
288
260
|
definition: leaf.definition,
|
|
289
261
|
dependsOn: leaf.dependsOn,
|
|
290
262
|
...(leaf.enabledByFlags === undefined ? {} : { enabledByFlags: leaf.enabledByFlags }),
|
|
291
|
-
|
|
263
|
+
execute: leaf.execute,
|
|
264
|
+
...(leaf.handoff === undefined ? {} : { handoff: leaf.handoff }),
|
|
292
265
|
maxParallel: leaf.maxParallel,
|
|
293
266
|
mutex: leaf.mutex,
|
|
294
267
|
observes: leaf.observes,
|
|
295
268
|
options: leaf.options,
|
|
296
|
-
...(leaf.
|
|
269
|
+
...(leaf.prepare === undefined ? {} : { prepare: leaf.prepare }),
|
|
297
270
|
resourceClaims: leaf.resourceClaims,
|
|
298
|
-
|
|
271
|
+
omitQuietPassedRow: leaf.omitQuietPassedRow
|
|
299
272
|
});
|
|
300
273
|
}
|
|
301
274
|
function normalizeSchedulerPolicy(policy: SchedulerPolicy): SchedulerPolicy {
|
|
@@ -315,7 +288,7 @@ function normalizeSchedulerPolicy(policy: SchedulerPolicy): SchedulerPolicy {
|
|
|
315
288
|
return Object.freeze({
|
|
316
289
|
admissionPolicy,
|
|
317
290
|
maxParallel: policy.maxParallel,
|
|
318
|
-
|
|
291
|
+
terminalEffects: Object.freeze([...policy.terminalEffects]),
|
|
319
292
|
resourceCapacities
|
|
320
293
|
});
|
|
321
294
|
}
|
|
@@ -202,7 +202,10 @@ export interface PreparedCustomAdmissionStrategy {
|
|
|
202
202
|
/** Scheduler 每轮同步调用;不得返回 Promise 或 thenable。 */
|
|
203
203
|
readonly decide: (this: void, context: AdmissionPolicyContext) => AdmissionProposal;
|
|
204
204
|
/** Scheduler 的 generic Hooks 完成后,才以 sealed terminal context 调用一次。 */
|
|
205
|
-
readonly
|
|
205
|
+
readonly terminalEffect?: (
|
|
206
|
+
this: void,
|
|
207
|
+
context: SchedulerMeasurementContext
|
|
208
|
+
) => void | Promise<void>;
|
|
206
209
|
}
|
|
207
210
|
|
|
208
211
|
/** custom 的 closed authoring grammar。 */
|
|
@@ -525,7 +528,7 @@ export interface SchedulerMeasurementContext {
|
|
|
525
528
|
}
|
|
526
529
|
|
|
527
530
|
/** 一次 terminal Scheduler measurement 的 caller-owned sync/async consumer。 */
|
|
528
|
-
export type
|
|
531
|
+
export type SchedulerTerminalEffect =
|
|
529
532
|
| ((this: void, context: SchedulerMeasurementContext) => void)
|
|
530
533
|
| ((this: void, context: SchedulerMeasurementContext) => Promise<void>);
|
|
531
534
|
|
|
@@ -536,7 +539,7 @@ export interface SchedulerPolicy {
|
|
|
536
539
|
/** 同时 running 的 root Check 上限。 */
|
|
537
540
|
readonly maxParallel: number;
|
|
538
541
|
/** terminal measurement 的 caller-owned consumers,按配置顺序调用。 */
|
|
539
|
-
readonly
|
|
542
|
+
readonly terminalEffects: readonly SchedulerTerminalEffect[];
|
|
540
543
|
/** 本次 Definition 中可由 Check 原子占用的 named resource 总 units。 */
|
|
541
544
|
readonly resourceCapacities: Readonly<Record<string, number>>;
|
|
542
545
|
}
|
|
@@ -35,18 +35,18 @@ async function prepareCustomStrategy(
|
|
|
35
35
|
throw new AdmissionStrategyPreparationFailure();
|
|
36
36
|
}
|
|
37
37
|
const record = snapshotClosedPolicyRecord(prepared, {
|
|
38
|
-
optional: ["
|
|
38
|
+
optional: ["terminalEffect"],
|
|
39
39
|
required: ["decide"]
|
|
40
40
|
});
|
|
41
41
|
if (record === undefined || !isPreparedCustomDecision(record.decide)) {
|
|
42
42
|
throw new AdmissionStrategyPreparationFailure();
|
|
43
43
|
}
|
|
44
|
-
if (record.
|
|
44
|
+
if (record.terminalEffect !== undefined && !isPreparedCustomCompletion(record.terminalEffect)) {
|
|
45
45
|
throw new AdmissionStrategyPreparationFailure();
|
|
46
46
|
}
|
|
47
47
|
return Object.freeze({
|
|
48
48
|
decide: record.decide,
|
|
49
|
-
...(record.
|
|
49
|
+
...(record.terminalEffect === undefined ? {} : { terminalEffect: record.terminalEffect })
|
|
50
50
|
});
|
|
51
51
|
}
|
|
52
52
|
|
|
@@ -58,21 +58,24 @@ function isPreparedCustomDecision(
|
|
|
58
58
|
|
|
59
59
|
function isPreparedCustomCompletion(
|
|
60
60
|
value: unknown
|
|
61
|
-
): value is NonNullable<PreparedCustomAdmissionStrategy["
|
|
61
|
+
): value is NonNullable<PreparedCustomAdmissionStrategy["terminalEffect"]> {
|
|
62
62
|
return typeof value === "function";
|
|
63
63
|
}
|
|
64
64
|
|
|
65
65
|
function preparedCustomAdmissionStrategy(
|
|
66
|
-
strategy: Pick<PreparedCustomAdmissionStrategy, "decide" | "
|
|
66
|
+
strategy: Pick<PreparedCustomAdmissionStrategy, "decide" | "terminalEffect">
|
|
67
67
|
): PreparedAdmissionStrategy {
|
|
68
68
|
const completion =
|
|
69
|
-
strategy.
|
|
69
|
+
strategy.terminalEffect === undefined
|
|
70
70
|
? Object.freeze({ kind: "none" as const })
|
|
71
|
-
: Object.freeze({
|
|
71
|
+
: Object.freeze({
|
|
72
|
+
kind: "terminal-effect" as const,
|
|
73
|
+
terminalEffect: strategy.terminalEffect
|
|
74
|
+
});
|
|
72
75
|
return Object.freeze({
|
|
73
76
|
admissionPolicy: admissionSelectionPolicyFor(strategy.decide),
|
|
74
77
|
completion,
|
|
75
|
-
requiresTerminalMeasurement: completion.kind === "
|
|
78
|
+
requiresTerminalMeasurement: completion.kind === "terminal-effect"
|
|
76
79
|
});
|
|
77
80
|
}
|
|
78
81
|
|
|
@@ -12,8 +12,8 @@ export type PreparedAdmissionStrategyCompletion =
|
|
|
12
12
|
readonly complete: (context: InternalAdmissionStrategyCompleteContext) => Promise<void>;
|
|
13
13
|
}>
|
|
14
14
|
| Readonly<{
|
|
15
|
-
readonly kind: "
|
|
16
|
-
readonly
|
|
15
|
+
readonly kind: "terminal-effect";
|
|
16
|
+
readonly terminalEffect: (context: SchedulerMeasurementContext) => void | Promise<void>;
|
|
17
17
|
}>;
|
|
18
18
|
|
|
19
19
|
/** The invocation-scoped handoff from an admission provider to Scheduler and terminal delivery. */
|
|
@@ -1,95 +1,72 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
RunControlDiagnostic,
|
|
3
|
-
RunControlValidationResult
|
|
4
|
-
} from "./controls/validation-result.ts";
|
|
5
|
-
import type { CheckAggregate, CheckAggregation } from "./controls/contract.ts";
|
|
6
1
|
import type { CoreCheck, CoreSnapshot } from "../check-settlement/facts.ts";
|
|
2
|
+
import type { CheckAggregate, CheckAggregation } from "./controls/contract.ts";
|
|
7
3
|
|
|
8
|
-
|
|
4
|
+
/** Identifies a callback failure so the invocation boundary can close outputs before rethrowing it. */
|
|
5
|
+
export class CheckAggregationFailure extends Error {
|
|
6
|
+
readonly originalError: Error;
|
|
9
7
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
checkIds: readonly string[]
|
|
14
|
-
): RunControlValidationResult<CheckAggregation | undefined> {
|
|
15
|
-
if (aggregation === undefined) return Object.freeze({ ok: true, value: undefined });
|
|
16
|
-
if (aggregation.checks === "all" || aggregation.checks === "effective") {
|
|
17
|
-
return Object.freeze({ ok: true, value: aggregation });
|
|
8
|
+
public constructor(originalError: Error) {
|
|
9
|
+
super("Check aggregation failed", { cause: originalError });
|
|
10
|
+
this.originalError = originalError;
|
|
18
11
|
}
|
|
19
|
-
const knownCheckIds = new Set(checkIds);
|
|
20
|
-
const selectedCheckIds = new Set<string>();
|
|
21
|
-
for (const checkId of aggregation.checks) {
|
|
22
|
-
if (!knownCheckIds.has(checkId) || selectedCheckIds.has(checkId)) {
|
|
23
|
-
return invalidControls("controls.checkAggregation.checks");
|
|
24
|
-
}
|
|
25
|
-
selectedCheckIds.add(checkId);
|
|
26
|
-
}
|
|
27
|
-
return Object.freeze({ ok: true, value: aggregation });
|
|
28
12
|
}
|
|
29
13
|
|
|
30
|
-
/**
|
|
31
|
-
export function
|
|
14
|
+
/** Builds the canonical ordered, read-only effective Check list and derives its invocation aggregate. */
|
|
15
|
+
export function aggregateEffectiveChecks(
|
|
32
16
|
snapshot: CoreSnapshot,
|
|
33
|
-
|
|
34
|
-
|
|
17
|
+
effectiveCheckIds: readonly string[],
|
|
18
|
+
aggregation: CheckAggregation | undefined
|
|
35
19
|
): CheckAggregate {
|
|
36
|
-
const
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
return aggregateSelectedStatuses(
|
|
41
|
-
statuses.filter(
|
|
42
|
-
(status): status is Exclude<AggregateStatus, "unavailable"> =>
|
|
43
|
-
status !== null && status !== "unavailable"
|
|
44
|
-
),
|
|
45
|
-
aggregation
|
|
46
|
-
);
|
|
20
|
+
const checks = effectiveChecks(snapshot, effectiveCheckIds);
|
|
21
|
+
return aggregation === undefined
|
|
22
|
+
? strictAggregate(checks)
|
|
23
|
+
: invokeAggregation(aggregation, checks);
|
|
47
24
|
}
|
|
48
25
|
|
|
49
|
-
function
|
|
26
|
+
function effectiveChecks(
|
|
50
27
|
snapshot: CoreSnapshot,
|
|
51
|
-
selection: CheckAggregation["checks"],
|
|
52
28
|
effectiveCheckIds: readonly string[]
|
|
53
29
|
): readonly CoreCheck[] {
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
return selectedCheckIds.map((checkId) => {
|
|
57
|
-
const check = snapshot.checks.find((candidate) => candidate.checkId === checkId);
|
|
58
|
-
if (check === undefined) throw new TypeError("Aggregation selection was not validated");
|
|
59
|
-
return check;
|
|
60
|
-
});
|
|
30
|
+
const effectiveCheckIdSet = new Set(effectiveCheckIds);
|
|
31
|
+
return Object.freeze(snapshot.checks.filter((check) => effectiveCheckIdSet.has(check.checkId)));
|
|
61
32
|
}
|
|
62
33
|
|
|
63
|
-
function
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
return check.outcome.status;
|
|
68
|
-
case "unavailable": {
|
|
69
|
-
if (aggregation.unavailable === "propagate") return "unavailable";
|
|
70
|
-
return aggregation.unavailable === "fail" ? "failed" : null;
|
|
71
|
-
}
|
|
72
|
-
case "not-applicable": {
|
|
73
|
-
if (aggregation.notApplicable === "pass") return "passed";
|
|
74
|
-
return aggregation.notApplicable === "fail" ? "failed" : null;
|
|
75
|
-
}
|
|
76
|
-
}
|
|
34
|
+
function strictAggregate(checks: readonly CoreCheck[]): CheckAggregate {
|
|
35
|
+
return checks.length > 0 && checks.every((check) => check.outcome.status === "passed")
|
|
36
|
+
? "passed"
|
|
37
|
+
: "failed";
|
|
77
38
|
}
|
|
78
39
|
|
|
79
|
-
function
|
|
80
|
-
|
|
81
|
-
|
|
40
|
+
function invokeAggregation(
|
|
41
|
+
aggregation: CheckAggregation,
|
|
42
|
+
checks: readonly CoreCheck[]
|
|
82
43
|
): CheckAggregate {
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
44
|
+
let aggregate: unknown;
|
|
45
|
+
try {
|
|
46
|
+
aggregate = aggregation(checks);
|
|
47
|
+
} catch (error) {
|
|
48
|
+
throw new CheckAggregationFailure(errorFromThrownValue(error));
|
|
49
|
+
}
|
|
50
|
+
if (isCheckAggregate(aggregate)) return aggregate;
|
|
51
|
+
discardPromiseRejection(aggregate);
|
|
52
|
+
throw new CheckAggregationFailure(
|
|
53
|
+
new TypeError("Check aggregation must synchronously return a CheckAggregate")
|
|
54
|
+
);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
function isCheckAggregate(value: unknown): value is CheckAggregate {
|
|
58
|
+
return (
|
|
59
|
+
value === "passed" ||
|
|
60
|
+
value === "failed" ||
|
|
61
|
+
value === "not-applicable" ||
|
|
62
|
+
value === "unavailable"
|
|
63
|
+
);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
function discardPromiseRejection(value: unknown): void {
|
|
67
|
+
if (value instanceof Promise) void value.catch(() => undefined);
|
|
86
68
|
}
|
|
87
69
|
|
|
88
|
-
function
|
|
89
|
-
|
|
90
|
-
kind: "invalid-run-controls",
|
|
91
|
-
path,
|
|
92
|
-
reason: "invalid-value"
|
|
93
|
-
});
|
|
94
|
-
return Object.freeze({ ok: false, error });
|
|
70
|
+
function errorFromThrownValue(value: unknown): Error {
|
|
71
|
+
return value instanceof Error ? value : new Error("Check aggregation threw a non-Error value");
|
|
95
72
|
}
|
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
import { isAbsolute, relative, resolve, sep } from "node:path";
|
|
2
|
+
|
|
3
|
+
import { execaSync } from "execa";
|
|
4
|
+
|
|
5
|
+
import { matchesAnyConfigGlob } from "../../data-boundary/config-glob.ts";
|
|
6
|
+
import { isNormalizedProjectRelativePath } from "../../data-boundary/project-path.ts";
|
|
7
|
+
import type { ProjectChanges } from "../../check/check.ts";
|
|
8
|
+
import type { NormalizedProjectChangesConfiguration } from "../../project-definition/project-changes.ts";
|
|
9
|
+
|
|
10
|
+
export const CHANGE_FLAG_PREFIX = "vibe-check:change:";
|
|
11
|
+
export const GIT_CHANGES_UNAVAILABLE_CODE = "git-changes-unavailable";
|
|
12
|
+
|
|
13
|
+
export type PreparedProjectChanges = Readonly<{
|
|
14
|
+
readonly effectiveFlags: readonly string[];
|
|
15
|
+
readonly projectChanges: ProjectChanges;
|
|
16
|
+
}>;
|
|
17
|
+
|
|
18
|
+
/** Prepares one configured Git change snapshot before Run flag selection. */
|
|
19
|
+
export function prepareProjectChanges(
|
|
20
|
+
input: Readonly<{
|
|
21
|
+
readonly callerFlags: readonly string[];
|
|
22
|
+
readonly changes: NormalizedProjectChangesConfiguration;
|
|
23
|
+
readonly projectRoot: string;
|
|
24
|
+
}>
|
|
25
|
+
): PreparedProjectChanges {
|
|
26
|
+
const declaredFlags = declaredChangeFlags(input.changes);
|
|
27
|
+
try {
|
|
28
|
+
const paths = collectGitChangedPaths(input.projectRoot, input.changes.source.compareWith);
|
|
29
|
+
const projectChanges = matchedProjectChanges(paths, input.changes);
|
|
30
|
+
return Object.freeze({
|
|
31
|
+
effectiveFlags: combineFlags(
|
|
32
|
+
input.callerFlags,
|
|
33
|
+
projectChanges.files.flatMap(({ flags }) => flags)
|
|
34
|
+
),
|
|
35
|
+
projectChanges
|
|
36
|
+
});
|
|
37
|
+
} catch {
|
|
38
|
+
return Object.freeze({
|
|
39
|
+
effectiveFlags: combineFlags(input.callerFlags, declaredFlags),
|
|
40
|
+
projectChanges: Object.freeze({
|
|
41
|
+
ok: false,
|
|
42
|
+
reason: Object.freeze({ code: GIT_CHANGES_UNAVAILABLE_CODE })
|
|
43
|
+
})
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
function declaredChangeFlags(changes: NormalizedProjectChangesConfiguration): readonly string[] {
|
|
49
|
+
return Object.freeze(
|
|
50
|
+
Object.keys(changes.flags)
|
|
51
|
+
.sort(compareText)
|
|
52
|
+
.map((flagId) => `${CHANGE_FLAG_PREFIX}${flagId}`)
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
function collectGitChangedPaths(projectRoot: string, compareWith: string): readonly string[] {
|
|
57
|
+
const root = resolve(projectRoot);
|
|
58
|
+
const repositoryRoot = gitText(root, ["rev-parse", "--show-toplevel"]);
|
|
59
|
+
if (!isProjectRootInRepository(root, resolve(repositoryRoot))) {
|
|
60
|
+
throw new Error("project root is outside the Git repository");
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
const committed = gitNameStatus(root, [
|
|
64
|
+
"diff",
|
|
65
|
+
"--relative",
|
|
66
|
+
"--name-status",
|
|
67
|
+
"-z",
|
|
68
|
+
"--find-renames",
|
|
69
|
+
`${compareWith}...HEAD`
|
|
70
|
+
]);
|
|
71
|
+
const staged = gitNameStatus(root, [
|
|
72
|
+
"diff",
|
|
73
|
+
"--cached",
|
|
74
|
+
"--relative",
|
|
75
|
+
"--name-status",
|
|
76
|
+
"-z",
|
|
77
|
+
"--find-renames"
|
|
78
|
+
]);
|
|
79
|
+
const unstaged = gitNameStatus(root, [
|
|
80
|
+
"diff",
|
|
81
|
+
"--relative",
|
|
82
|
+
"--name-status",
|
|
83
|
+
"-z",
|
|
84
|
+
"--find-renames"
|
|
85
|
+
]);
|
|
86
|
+
const untracked = gitNulPaths(root, [
|
|
87
|
+
"ls-files",
|
|
88
|
+
"--others",
|
|
89
|
+
"--exclude-standard",
|
|
90
|
+
"-z",
|
|
91
|
+
"--",
|
|
92
|
+
"."
|
|
93
|
+
]);
|
|
94
|
+
return Object.freeze(
|
|
95
|
+
[
|
|
96
|
+
...new Set([...committed, ...staged, ...unstaged, ...untracked].map(normalizedChangedPath))
|
|
97
|
+
].sort(compareText)
|
|
98
|
+
);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
function isProjectRootInRepository(projectRoot: string, repositoryRoot: string): boolean {
|
|
102
|
+
const fromRepository = relative(repositoryRoot, projectRoot);
|
|
103
|
+
return (
|
|
104
|
+
!isAbsolute(fromRepository) && fromRepository !== ".." && !fromRepository.startsWith(`..${sep}`)
|
|
105
|
+
);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
function gitText(cwd: string, args: readonly string[]): string {
|
|
109
|
+
const text = gitOutput(cwd, args).trim();
|
|
110
|
+
if (text.length === 0) throw new Error("Git command returned no text");
|
|
111
|
+
return text;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
function gitOutput(cwd: string, args: readonly string[]): string {
|
|
115
|
+
const result = execaSync("git", args, {
|
|
116
|
+
cwd,
|
|
117
|
+
encoding: "utf8",
|
|
118
|
+
reject: false,
|
|
119
|
+
stripFinalNewline: false,
|
|
120
|
+
windowsHide: true
|
|
121
|
+
});
|
|
122
|
+
if (result.failed || result.exitCode !== 0) throw new Error("Git command failed");
|
|
123
|
+
if (typeof result.stdout !== "string") throw new Error("Git command returned non-text output");
|
|
124
|
+
return result.stdout;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
function gitNameStatus(cwd: string, args: readonly string[]): readonly string[] {
|
|
128
|
+
return parseGitNameStatus(gitOutput(cwd, args));
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
function gitNulPaths(cwd: string, args: readonly string[]): readonly string[] {
|
|
132
|
+
return gitOutput(cwd, args)
|
|
133
|
+
.split("\0")
|
|
134
|
+
.filter((path) => path.length > 0);
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
/** Parses Git's `--name-status -z` protocol without line or tab splitting. */
|
|
138
|
+
function parseGitNameStatus(stdout: string): readonly string[] {
|
|
139
|
+
const tokens = stdout.split("\0");
|
|
140
|
+
if (tokens.at(-1) === "") tokens.pop();
|
|
141
|
+
const paths: string[] = [];
|
|
142
|
+
for (let index = 0; index < tokens.length;) {
|
|
143
|
+
const entry = parseGitNameStatusEntry(tokens, index);
|
|
144
|
+
paths.push(...entry.paths);
|
|
145
|
+
index = entry.nextIndex;
|
|
146
|
+
}
|
|
147
|
+
return Object.freeze(paths);
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
function parseGitNameStatusEntry(
|
|
151
|
+
tokens: readonly string[],
|
|
152
|
+
statusIndex: number
|
|
153
|
+
): Readonly<{ readonly nextIndex: number; readonly paths: readonly string[] }> {
|
|
154
|
+
const status = tokens[statusIndex];
|
|
155
|
+
if (status === undefined || !isNameStatus(status))
|
|
156
|
+
throw new Error("invalid Git name-status output");
|
|
157
|
+
const pathCount = nameStatusPathCount(status);
|
|
158
|
+
const paths = tokens.slice(statusIndex + 1, statusIndex + 1 + pathCount);
|
|
159
|
+
if (paths.length !== pathCount || paths.some((path) => path.length === 0))
|
|
160
|
+
throw new Error("missing Git changed path");
|
|
161
|
+
return Object.freeze({ nextIndex: statusIndex + 1 + pathCount, paths: Object.freeze(paths) });
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
function nameStatusPathCount(status: string): 1 | 2 {
|
|
165
|
+
return status.startsWith("R") || status.startsWith("C") ? 2 : 1;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
function isNameStatus(value: string): boolean {
|
|
169
|
+
return /^(?:[ACDMRTUXB][0-9]*|[RC][0-9]+)$/u.test(value);
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
function normalizedChangedPath(path: string): string {
|
|
173
|
+
if (!isNormalizedProjectRelativePath(path)) throw new Error("invalid Git project-relative path");
|
|
174
|
+
return path;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
function matchedProjectChanges(
|
|
178
|
+
paths: readonly string[],
|
|
179
|
+
changes: NormalizedProjectChangesConfiguration
|
|
180
|
+
): Extract<ProjectChanges, { readonly ok: true }> {
|
|
181
|
+
const regions = Object.entries(changes.flags).sort(([left], [right]) => compareText(left, right));
|
|
182
|
+
const files = paths.flatMap((path) => {
|
|
183
|
+
const flags = regions.flatMap(([flagId, region]) =>
|
|
184
|
+
matchesRegion(path, region) ? [`${CHANGE_FLAG_PREFIX}${flagId}`] : []
|
|
185
|
+
);
|
|
186
|
+
return flags.length === 0 ? [] : [Object.freeze({ flags: Object.freeze(flags), path })];
|
|
187
|
+
});
|
|
188
|
+
return Object.freeze({ ok: true, files: Object.freeze(files) });
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
function matchesRegion(
|
|
192
|
+
path: string,
|
|
193
|
+
region: NormalizedProjectChangesConfiguration["flags"][string]
|
|
194
|
+
): boolean {
|
|
195
|
+
return matchesAnyConfigGlob(path, region.include) && !matchesAnyConfigGlob(path, region.exclude);
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
function combineFlags(...sets: readonly (readonly string[])[]): readonly string[] {
|
|
199
|
+
return Object.freeze([...new Set(sets.flat())].sort(compareText));
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
function compareText(left: string, right: string): number {
|
|
203
|
+
if (left < right) return -1;
|
|
204
|
+
if (left > right) return 1;
|
|
205
|
+
return 0;
|
|
206
|
+
}
|