@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,56 @@
|
|
|
1
|
+
const TERMINAL_NUL_CODE_UNITS = 1;
|
|
2
|
+
|
|
3
|
+
/** SCC adapter 的私有 Windows argv 传输上限;不属于 scanner options。 */
|
|
4
|
+
export const SCC_BATCH_COMMAND_LINE_CEILING = 28_000;
|
|
5
|
+
|
|
6
|
+
export type SccBatchPlan =
|
|
7
|
+
| { readonly batches: readonly (readonly string[])[]; readonly ok: true }
|
|
8
|
+
| { readonly error: string; readonly ok: false };
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* 返回 Windows command-line serialization 的保守 UTF-16 code-unit 上界。
|
|
12
|
+
*
|
|
13
|
+
* 每个 argument 都按最多双倍转义并保留一对引号,arguments 之间保留一个分隔符,
|
|
14
|
+
* 最后保留 CreateProcessW 所需的终止 NUL。
|
|
15
|
+
*/
|
|
16
|
+
export function estimateSccCommandLineCodeUnits(argumentsToEstimate: readonly string[]): number {
|
|
17
|
+
return argumentsToEstimate.reduce(
|
|
18
|
+
(total, argument, index) => total + (index === 0 ? 0 : 1) + 2 * argument.length + 2,
|
|
19
|
+
TERMINAL_NUL_CODE_UNITS
|
|
20
|
+
);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/** 将已批准的 exact paths 按固定 SCC protocol 稳定地切为可传输 batches。 */
|
|
24
|
+
export function planSccBatches(
|
|
25
|
+
executable: string,
|
|
26
|
+
fixedArguments: readonly string[],
|
|
27
|
+
includePaths: readonly string[],
|
|
28
|
+
ceiling = SCC_BATCH_COMMAND_LINE_CEILING
|
|
29
|
+
): SccBatchPlan {
|
|
30
|
+
const batches: string[][] = [];
|
|
31
|
+
let currentBatch: string[] = [];
|
|
32
|
+
|
|
33
|
+
for (const includePath of includePaths) {
|
|
34
|
+
const singlePathArguments = [executable, ...fixedArguments, includePath];
|
|
35
|
+
if (estimateSccCommandLineCodeUnits(singlePathArguments) > ceiling) {
|
|
36
|
+
return {
|
|
37
|
+
ok: false,
|
|
38
|
+
error: `scc exact path cannot fit command-line ceiling ${ceiling}: ${JSON.stringify(includePath)}`
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
const candidateBatch = [...currentBatch, includePath];
|
|
43
|
+
if (
|
|
44
|
+
currentBatch.length > 0 &&
|
|
45
|
+
estimateSccCommandLineCodeUnits([executable, ...fixedArguments, ...candidateBatch]) > ceiling
|
|
46
|
+
) {
|
|
47
|
+
batches.push(currentBatch);
|
|
48
|
+
currentBatch = [includePath];
|
|
49
|
+
continue;
|
|
50
|
+
}
|
|
51
|
+
currentBatch = candidateBatch;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
if (currentBatch.length > 0) batches.push(currentBatch);
|
|
55
|
+
return { ok: true, batches };
|
|
56
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { DEFAULT_PROCESS_MAX_BUFFER_BYTES } from "../../host-environment/process.ts";
|
|
2
|
+
|
|
3
|
+
export const SCC_LOGICAL_SCAN_TIMEOUT_MS = 300_000;
|
|
4
|
+
const NANOSECONDS_PER_MILLISECOND = 1_000_000n;
|
|
5
|
+
|
|
6
|
+
export interface SccLogicalScanResources {
|
|
7
|
+
readonly deadlineNanoseconds: bigint;
|
|
8
|
+
stderrRemainingBytes: number;
|
|
9
|
+
stdoutRemainingBytes: number;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
/** 为一次 logical SCC scan 建立共享 deadline 与 stdout/stderr 预算。 */
|
|
13
|
+
export function beginSccLogicalScanResources(
|
|
14
|
+
startedNanoseconds: bigint,
|
|
15
|
+
timeoutMilliseconds = SCC_LOGICAL_SCAN_TIMEOUT_MS,
|
|
16
|
+
outputBudgetBytes = DEFAULT_PROCESS_MAX_BUFFER_BYTES
|
|
17
|
+
): SccLogicalScanResources {
|
|
18
|
+
return {
|
|
19
|
+
deadlineNanoseconds:
|
|
20
|
+
startedNanoseconds + BigInt(timeoutMilliseconds) * NANOSECONDS_PER_MILLISECOND,
|
|
21
|
+
stderrRemainingBytes: outputBudgetBytes,
|
|
22
|
+
stdoutRemainingBytes: outputBudgetBytes
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/** 计算下一个 batch 可使用的完整毫秒数;deadline 到期时不再启动 process。 */
|
|
27
|
+
export function remainingSccBatchTimeoutMs(
|
|
28
|
+
resources: SccLogicalScanResources,
|
|
29
|
+
nowNanoseconds: bigint
|
|
30
|
+
): number | null {
|
|
31
|
+
const remainingNanoseconds = resources.deadlineNanoseconds - nowNanoseconds;
|
|
32
|
+
const remainingMilliseconds = Number(remainingNanoseconds / NANOSECONDS_PER_MILLISECOND);
|
|
33
|
+
return remainingMilliseconds > 0 ? remainingMilliseconds : null;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/** 以两个 stream 中较小的余量限制本次 process 的 maxBuffer。 */
|
|
37
|
+
export function remainingSccBatchMaxBuffer(resources: SccLogicalScanResources): number | null {
|
|
38
|
+
const remainingBytes = Math.min(resources.stdoutRemainingBytes, resources.stderrRemainingBytes);
|
|
39
|
+
return remainingBytes > 0 ? remainingBytes : null;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/** 记录一次 process 的 UTF-8 output;任一 stream 超出完整 logical-scan 预算即失败。 */
|
|
43
|
+
export function consumeSccProcessOutput(
|
|
44
|
+
resources: SccLogicalScanResources,
|
|
45
|
+
stdout: string,
|
|
46
|
+
stderr: string
|
|
47
|
+
): boolean {
|
|
48
|
+
const stdoutBytes = Buffer.byteLength(stdout, "utf8");
|
|
49
|
+
const stderrBytes = Buffer.byteLength(stderr, "utf8");
|
|
50
|
+
if (
|
|
51
|
+
stdoutBytes > resources.stdoutRemainingBytes ||
|
|
52
|
+
stderrBytes > resources.stderrRemainingBytes
|
|
53
|
+
) {
|
|
54
|
+
return false;
|
|
55
|
+
}
|
|
56
|
+
resources.stdoutRemainingBytes -= stdoutBytes;
|
|
57
|
+
resources.stderrRemainingBytes -= stderrBytes;
|
|
58
|
+
return true;
|
|
59
|
+
}
|
|
@@ -5,12 +5,23 @@
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import { errorMessage } from "../../host-environment/error-message.ts";
|
|
8
|
-
import { runProcessSync } from "../../host-environment/process.ts";
|
|
8
|
+
import { runProcessSync, type ProcessResult } from "../../host-environment/process.ts";
|
|
9
|
+
import { acceptExactInputMeasurements } from "../../project-files/exact-input-measurement.ts";
|
|
10
|
+
import type { ExactInputMeasurement } from "../../project-files/exact-input-measurement.ts";
|
|
11
|
+
import type { FileMetric } from "../measurement-model.ts";
|
|
9
12
|
import type { ResolvedFileMetricsScannerOptions } from "../options.ts";
|
|
13
|
+
import { planSccBatches } from "./batch-planner.ts";
|
|
14
|
+
import {
|
|
15
|
+
beginSccLogicalScanResources,
|
|
16
|
+
consumeSccProcessOutput,
|
|
17
|
+
remainingSccBatchMaxBuffer,
|
|
18
|
+
remainingSccBatchTimeoutMs,
|
|
19
|
+
type SccLogicalScanResources
|
|
20
|
+
} from "./logical-scan-resources.ts";
|
|
10
21
|
import { parseSccCSV, type SccScanResult } from "./parser.ts";
|
|
11
22
|
|
|
12
23
|
const SCC_BY_FILE_ARGUMENTS = Object.freeze(["--no-config", "--by-file", "--format", "csv"]);
|
|
13
|
-
|
|
24
|
+
type SccMeasurement = ExactInputMeasurement<FileMetric>;
|
|
14
25
|
|
|
15
26
|
interface ScanWithSccOptions {
|
|
16
27
|
readonly cwd: string;
|
|
@@ -22,38 +33,19 @@ export function scanWithScc({ cwd, includePaths, scanner }: ScanWithSccOptions):
|
|
|
22
33
|
try {
|
|
23
34
|
if (includePaths.length === 0) return { ok: true, measurements: [] };
|
|
24
35
|
|
|
25
|
-
const
|
|
36
|
+
const batchPlan = planSccBatches(scanner.executable, SCC_BY_FILE_ARGUMENTS, includePaths);
|
|
37
|
+
if (!batchPlan.ok) return { ok: false, error: batchPlan.error, reason: "execution" };
|
|
26
38
|
|
|
27
|
-
const
|
|
28
|
-
|
|
29
|
-
command: scanner.executable,
|
|
30
|
-
cwd,
|
|
31
|
-
timeout: SCC_SCAN_TIMEOUT_MS
|
|
32
|
-
});
|
|
39
|
+
const logicalScanResources = beginSccLogicalScanResources(process.hrtime.bigint());
|
|
40
|
+
const measurements: SccMeasurement[] = [];
|
|
33
41
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
reason: "execution"
|
|
39
|
-
};
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
if (commandResult.status !== 0) {
|
|
43
|
-
const stderr = (commandResult.stderr || "").trim();
|
|
44
|
-
const stdout = (commandResult.stdout || "").trim();
|
|
45
|
-
const termination =
|
|
46
|
-
commandResult.status === null
|
|
47
|
-
? `signal ${commandResult.signal ?? "unknown"}`
|
|
48
|
-
: `exit ${commandResult.status}`;
|
|
49
|
-
return {
|
|
50
|
-
ok: false,
|
|
51
|
-
error: `scc ${termination}: ${stderr || stdout || "no output"}`,
|
|
52
|
-
reason: "execution"
|
|
53
|
-
};
|
|
42
|
+
for (const batch of batchPlan.batches) {
|
|
43
|
+
const batchResult = scanSccBatch({ batch, cwd, logicalScanResources, scanner });
|
|
44
|
+
if (!batchResult.ok) return batchResult;
|
|
45
|
+
measurements.push(...batchResult.measurements);
|
|
54
46
|
}
|
|
55
47
|
|
|
56
|
-
return
|
|
48
|
+
return mergeSccBatchMeasurements(measurements);
|
|
57
49
|
} catch (error: unknown) {
|
|
58
50
|
return {
|
|
59
51
|
ok: false,
|
|
@@ -63,6 +55,116 @@ export function scanWithScc({ cwd, includePaths, scanner }: ScanWithSccOptions):
|
|
|
63
55
|
}
|
|
64
56
|
}
|
|
65
57
|
|
|
66
|
-
function
|
|
67
|
-
|
|
58
|
+
function scanSccBatch({
|
|
59
|
+
batch,
|
|
60
|
+
cwd,
|
|
61
|
+
logicalScanResources,
|
|
62
|
+
scanner
|
|
63
|
+
}: {
|
|
64
|
+
readonly batch: readonly string[];
|
|
65
|
+
readonly cwd: string;
|
|
66
|
+
readonly logicalScanResources: SccLogicalScanResources;
|
|
67
|
+
readonly scanner: ResolvedFileMetricsScannerOptions;
|
|
68
|
+
}): SccScanResult {
|
|
69
|
+
const remainingTimeoutMs = remainingSccBatchTimeoutMs(
|
|
70
|
+
logicalScanResources,
|
|
71
|
+
process.hrtime.bigint()
|
|
72
|
+
);
|
|
73
|
+
if (remainingTimeoutMs === null) return expiredSccDeadline();
|
|
74
|
+
const remainingMaxBufferBytes = remainingSccBatchMaxBuffer(logicalScanResources);
|
|
75
|
+
if (remainingMaxBufferBytes === null) return exhaustedSccOutputBudget();
|
|
76
|
+
|
|
77
|
+
const commandResult = runProcessSync({
|
|
78
|
+
args: [...SCC_BY_FILE_ARGUMENTS, ...batch],
|
|
79
|
+
command: scanner.executable,
|
|
80
|
+
cwd,
|
|
81
|
+
maxBuffer: remainingMaxBufferBytes,
|
|
82
|
+
timeout: remainingTimeoutMs
|
|
83
|
+
});
|
|
84
|
+
const processFailure = sccBatchProcessFailure(commandResult, logicalScanResources);
|
|
85
|
+
if (processFailure !== null) return processFailure;
|
|
86
|
+
return parseAcceptedSccBatch(commandResult.stdout, cwd, batch);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
function expiredSccDeadline(): SccScanResult {
|
|
90
|
+
return {
|
|
91
|
+
ok: false,
|
|
92
|
+
error: "scc logical scan exceeded its shared timeout before the next batch",
|
|
93
|
+
reason: "execution"
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
function exhaustedSccOutputBudget(): SccScanResult {
|
|
98
|
+
return {
|
|
99
|
+
ok: false,
|
|
100
|
+
error: "scc logical scan exhausted its cumulative output budget before the next batch",
|
|
101
|
+
reason: "execution"
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
function sccBatchProcessFailure(
|
|
106
|
+
commandResult: ProcessResult,
|
|
107
|
+
logicalScanResources: SccLogicalScanResources
|
|
108
|
+
): SccScanResult | null {
|
|
109
|
+
if (!consumeSccProcessOutput(logicalScanResources, commandResult.stdout, commandResult.stderr)) {
|
|
110
|
+
return {
|
|
111
|
+
ok: false,
|
|
112
|
+
error: "scc logical scan exceeded its cumulative stdout or stderr output budget",
|
|
113
|
+
reason: "execution"
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
if (commandResult.error) {
|
|
117
|
+
return {
|
|
118
|
+
ok: false,
|
|
119
|
+
error: `scc process error: ${commandResult.error.message}`,
|
|
120
|
+
reason: "execution"
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
if (commandResult.status === 0) return null;
|
|
124
|
+
|
|
125
|
+
const output = commandResult.stderr.trim() || commandResult.stdout.trim() || "no output";
|
|
126
|
+
const termination =
|
|
127
|
+
commandResult.status === null
|
|
128
|
+
? `signal ${commandResult.signal ?? "unknown"}`
|
|
129
|
+
: `exit ${commandResult.status}`;
|
|
130
|
+
return { ok: false, error: `scc ${termination}: ${output}`, reason: "execution" };
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
function parseAcceptedSccBatch(
|
|
134
|
+
stdout: string,
|
|
135
|
+
cwd: string,
|
|
136
|
+
batch: readonly string[]
|
|
137
|
+
): SccScanResult {
|
|
138
|
+
const parsed = parseSccCSV(stdout, cwd);
|
|
139
|
+
if (!parsed.ok) return parsed;
|
|
140
|
+
const acceptedMeasurements = acceptExactInputMeasurements(parsed.measurements, batch);
|
|
141
|
+
return acceptedMeasurements.ok
|
|
142
|
+
? parsed
|
|
143
|
+
: { ok: false, error: acceptedMeasurements.error, reason: "invalid-result" };
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
function mergeSccBatchMeasurements(measurements: readonly SccMeasurement[]): SccScanResult {
|
|
147
|
+
const measuredPaths = new Set<string>();
|
|
148
|
+
for (const measurement of measurements) {
|
|
149
|
+
if (measuredPaths.has(measurement.payload.path)) {
|
|
150
|
+
return {
|
|
151
|
+
ok: false,
|
|
152
|
+
error: `scc returned duplicate measurement path ${JSON.stringify(measurement.payload.path)}`,
|
|
153
|
+
reason: "invalid-result"
|
|
154
|
+
};
|
|
155
|
+
}
|
|
156
|
+
measuredPaths.add(measurement.payload.path);
|
|
157
|
+
}
|
|
158
|
+
return {
|
|
159
|
+
ok: true,
|
|
160
|
+
measurements: [...measurements].sort((left, right) =>
|
|
161
|
+
compareText(left.payload.path, right.payload.path)
|
|
162
|
+
)
|
|
163
|
+
};
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
function compareText(left: string, right: string): number {
|
|
167
|
+
if (left < right) return -1;
|
|
168
|
+
if (left > right) return 1;
|
|
169
|
+
return 0;
|
|
68
170
|
}
|
|
@@ -174,9 +174,14 @@ function compareComplexityContributors(
|
|
|
174
174
|
): number {
|
|
175
175
|
const commonLength = Math.min(left.length, right.length);
|
|
176
176
|
for (let index = 0; index < commonLength; index += 1) {
|
|
177
|
-
const
|
|
177
|
+
const leftContributor = left[index];
|
|
178
|
+
const rightContributor = right[index];
|
|
179
|
+
if (leftContributor === undefined || rightContributor === undefined) {
|
|
180
|
+
throw new Error(`Complexity contributor index is out of range: ${index}`);
|
|
181
|
+
}
|
|
182
|
+
const lineDifference = leftContributor.line - rightContributor.line;
|
|
178
183
|
if (lineDifference !== 0) return lineDifference;
|
|
179
|
-
const tokenDifference = compareText(
|
|
184
|
+
const tokenDifference = compareText(leftContributor.token, rightContributor.token);
|
|
180
185
|
if (tokenDifference !== 0) return tokenDifference;
|
|
181
186
|
}
|
|
182
187
|
return left.length - right.length;
|
|
@@ -270,7 +270,7 @@ export class FunctionInfo extends Nesting {
|
|
|
270
270
|
public get parameters(): string[] {
|
|
271
271
|
return this.fullParameters.flatMap((parameter) => {
|
|
272
272
|
const match = /([\p{L}\p{N}_]+)(\s=.*)?(\s:.*)?$/u.exec(parameter);
|
|
273
|
-
return match?.[1] ? [match[1]] : [];
|
|
273
|
+
return match?.[1] !== undefined ? [match[1]] : [];
|
|
274
274
|
});
|
|
275
275
|
}
|
|
276
276
|
|
|
@@ -13,9 +13,9 @@ import { AttributeError, FileInformation, FunctionInfo } from "./analysis-model.
|
|
|
13
13
|
import { isPythonWhitespace } from "./shared/code-reader.ts";
|
|
14
14
|
|
|
15
15
|
export interface OutputSchemeItem {
|
|
16
|
-
caption?: string;
|
|
16
|
+
caption?: string | undefined;
|
|
17
17
|
value: string;
|
|
18
|
-
avg_caption?: string;
|
|
18
|
+
avg_caption?: string | undefined;
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
/**
|
|
@@ -95,7 +95,11 @@ export class OutputScheme {
|
|
|
95
95
|
}
|
|
96
96
|
|
|
97
97
|
public captions(): string {
|
|
98
|
-
return this.items
|
|
98
|
+
return this.items
|
|
99
|
+
.flatMap((item) =>
|
|
100
|
+
item.caption !== undefined && item.caption.length > 0 ? [item.caption] : []
|
|
101
|
+
)
|
|
102
|
+
.join("");
|
|
99
103
|
}
|
|
100
104
|
|
|
101
105
|
public static _head(captions: string): string {
|
|
@@ -114,7 +118,7 @@ export class OutputScheme {
|
|
|
114
118
|
public function_info(functionInfo: FunctionInfo): string {
|
|
115
119
|
let rendered = "";
|
|
116
120
|
for (const item of this.items) {
|
|
117
|
-
if (
|
|
121
|
+
if (item.caption === undefined || item.caption.length === 0) continue;
|
|
118
122
|
rendered += pythonRightJustify(
|
|
119
123
|
pythonString(readFunctionInfoAttribute(functionInfo, item.value)),
|
|
120
124
|
Array.from(item.caption).length
|
|
@@ -128,7 +132,11 @@ export class OutputScheme {
|
|
|
128
132
|
}
|
|
129
133
|
|
|
130
134
|
public average_captions(): string {
|
|
131
|
-
return this.items
|
|
135
|
+
return this.items
|
|
136
|
+
.flatMap((item) =>
|
|
137
|
+
item.avg_caption !== undefined && item.avg_caption.length > 0 ? [item.avg_caption] : []
|
|
138
|
+
)
|
|
139
|
+
.join("");
|
|
132
140
|
}
|
|
133
141
|
|
|
134
142
|
public averageCaptions(): string {
|
|
@@ -138,7 +146,7 @@ export class OutputScheme {
|
|
|
138
146
|
public average_formatter(): string {
|
|
139
147
|
return this.items
|
|
140
148
|
.flatMap((item) => {
|
|
141
|
-
if (
|
|
149
|
+
if (item.avg_caption === undefined || item.avg_caption.length === 0) return [];
|
|
142
150
|
return [`{module.average_${item.value}:${Array.from(item.avg_caption).length}.1f}`];
|
|
143
151
|
})
|
|
144
152
|
.join("");
|
|
@@ -16,9 +16,7 @@ export class LizardExtension implements LizardExtensionProtocol {
|
|
|
16
16
|
const conditions = reader.conditions;
|
|
17
17
|
for (const token of tokens) {
|
|
18
18
|
yield token;
|
|
19
|
-
|
|
20
|
-
context.current_function.complex_tags = [];
|
|
21
|
-
}
|
|
19
|
+
context.current_function.complex_tags ??= [];
|
|
22
20
|
if (conditions.has(token)) {
|
|
23
21
|
context.current_function.complex_tags.push([token, context.current_line]);
|
|
24
22
|
}
|
|
@@ -75,9 +75,9 @@ export interface LizardExtension {
|
|
|
75
75
|
|
|
76
76
|
/** Python resolves extension class attributes and static methods through instances. */
|
|
77
77
|
export interface LizardExtensionClassMetadata {
|
|
78
|
-
readonly ordering_index?: number;
|
|
79
|
-
readonly FUNCTION_INFO?: FunctionInfoDefinitions;
|
|
80
|
-
readonly silent_all_others?: boolean;
|
|
78
|
+
readonly ordering_index?: number | undefined;
|
|
79
|
+
readonly FUNCTION_INFO?: FunctionInfoDefinitions | undefined;
|
|
80
|
+
readonly silent_all_others?: boolean | undefined;
|
|
81
81
|
}
|
|
82
82
|
|
|
83
83
|
/** A directly registered class is an opaque descriptor, not a constructor to invoke at load time. */
|
|
@@ -67,10 +67,12 @@ export function* commentCounter(tokens: TokenStream, reader: AnalyzerReader): Ge
|
|
|
67
67
|
reader.context.forgiveGlobal = true;
|
|
68
68
|
} else if (strippedComment.startsWith("#lizard forgives(")) {
|
|
69
69
|
const metricMatch = /#lizard forgives?\(([^)]*)\)/u.exec(strippedComment);
|
|
70
|
-
if (metricMatch?.[1]) {
|
|
70
|
+
if (metricMatch?.[1] !== undefined) {
|
|
71
71
|
for (const metric of metricMatch[1].split(",")) {
|
|
72
72
|
const trimmedMetric = stripPythonWhitespace(metric);
|
|
73
|
-
if (trimmedMetric)
|
|
73
|
+
if (trimmedMetric.length > 0) {
|
|
74
|
+
reader.context.currentFunction.forgivenMetrics.add(trimmedMetric);
|
|
75
|
+
}
|
|
74
76
|
}
|
|
75
77
|
}
|
|
76
78
|
} else if (strippedComment.startsWith("#lizard forgive")) {
|
|
@@ -150,14 +150,14 @@ function* generatePygmentsCompatibleErlangTokenValues(sourceCode: string): Gener
|
|
|
150
150
|
}
|
|
151
151
|
|
|
152
152
|
const baseInteger = matchAt(ERLANG_BASE_INTEGER, sourceCode, index);
|
|
153
|
-
if (baseInteger) {
|
|
153
|
+
if (baseInteger !== undefined) {
|
|
154
154
|
yield baseInteger;
|
|
155
155
|
index += baseInteger.length;
|
|
156
156
|
continue;
|
|
157
157
|
}
|
|
158
158
|
|
|
159
159
|
const integer = matchAt(ERLANG_INTEGER, sourceCode, index);
|
|
160
|
-
if (integer) {
|
|
160
|
+
if (integer !== undefined) {
|
|
161
161
|
yield integer;
|
|
162
162
|
index += integer.length;
|
|
163
163
|
continue;
|
|
@@ -172,7 +172,7 @@ function* generatePygmentsCompatibleErlangTokenValues(sourceCode: string): Gener
|
|
|
172
172
|
}
|
|
173
173
|
|
|
174
174
|
const variable = matchAt(ERLANG_VARIABLE, sourceCode, index);
|
|
175
|
-
if (variable) {
|
|
175
|
+
if (variable !== undefined) {
|
|
176
176
|
yield variable;
|
|
177
177
|
index += variable.length;
|
|
178
178
|
continue;
|
|
@@ -370,15 +370,15 @@ function consumeErlangDirective(
|
|
|
370
370
|
|
|
371
371
|
function consumeErlangMacro(sourceCode: string, index: number): number {
|
|
372
372
|
const variable = matchAt(ERLANG_VARIABLE, sourceCode, index);
|
|
373
|
-
if (variable) return index + variable.length;
|
|
373
|
+
if (variable !== undefined) return index + variable.length;
|
|
374
374
|
return consumeErlangAtom(sourceCode, index);
|
|
375
375
|
}
|
|
376
376
|
|
|
377
377
|
function consumeErlangAtom(sourceCode: string, index: number): number {
|
|
378
378
|
const quotedAtom = matchAt(ERLANG_QUOTED_ATOM, sourceCode, index);
|
|
379
|
-
if (quotedAtom) return index + quotedAtom.length;
|
|
379
|
+
if (quotedAtom !== undefined) return index + quotedAtom.length;
|
|
380
380
|
const identifier = matchAt(ERLANG_ATOM_IDENTIFIER, sourceCode, index);
|
|
381
|
-
return identifier ? index + identifier.length : index;
|
|
381
|
+
return identifier !== undefined ? index + identifier.length : index;
|
|
382
382
|
}
|
|
383
383
|
|
|
384
384
|
function isPygmentsLineStart(sourceCode: string, index: number): boolean {
|
|
@@ -77,7 +77,7 @@ export class FortranReader extends CodeReader {
|
|
|
77
77
|
newLine = token === "\n";
|
|
78
78
|
|
|
79
79
|
const macro = /^#\s*(\w+)/u.exec(token)?.[1]?.toLowerCase();
|
|
80
|
-
if (macro) {
|
|
80
|
+
if (macro !== undefined) {
|
|
81
81
|
if (["if", "ifdef", "ifndef", "elif"].includes(macro)) this.context.addCondition();
|
|
82
82
|
if (macroDepth > 0) {
|
|
83
83
|
if (["if", "ifdef", "ifndef"].includes(macro)) macroDepth += 1;
|
|
@@ -38,7 +38,9 @@ class ObjCStates extends CLikeStates {
|
|
|
38
38
|
if (token === "typedef") {
|
|
39
39
|
this.next(this._typedef, token);
|
|
40
40
|
} else if (token === "(") {
|
|
41
|
-
this.next((currentToken) =>
|
|
41
|
+
this.next((currentToken) => {
|
|
42
|
+
this._state_dec(currentToken);
|
|
43
|
+
}, token);
|
|
42
44
|
}
|
|
43
45
|
}
|
|
44
46
|
|
|
@@ -59,7 +61,9 @@ class ObjCStates extends CLikeStates {
|
|
|
59
61
|
this.next(this._state_objc_dec);
|
|
60
62
|
this.context.addToFunctionName(token);
|
|
61
63
|
} else if (token === "{") {
|
|
62
|
-
this.next((currentToken) =>
|
|
64
|
+
this.next((currentToken) => {
|
|
65
|
+
this._state_entering_imp(currentToken);
|
|
66
|
+
}, "{");
|
|
63
67
|
} else {
|
|
64
68
|
this.next(this.globalState);
|
|
65
69
|
}
|
|
@@ -73,7 +77,9 @@ class ObjCStates extends CLikeStates {
|
|
|
73
77
|
} else if (token === ",") {
|
|
74
78
|
// Source ignores selector commas.
|
|
75
79
|
} else if (token === "{") {
|
|
76
|
-
this.next((currentToken) =>
|
|
80
|
+
this.next((currentToken) => {
|
|
81
|
+
this._state_entering_imp(currentToken);
|
|
82
|
+
}, "{");
|
|
77
83
|
} else {
|
|
78
84
|
this.next(this._state_objc_dec_begin);
|
|
79
85
|
this.context.addToFunctionName(` ${token}`);
|
|
@@ -95,7 +95,7 @@ export class PHPLanguageStates extends CodeStateMachine {
|
|
|
95
95
|
};
|
|
96
96
|
|
|
97
97
|
private readonly _trait_declaration = (token: string): void => {
|
|
98
|
-
if (token && !isPythonWhitespace(token) && !["{", "("].includes(token)) {
|
|
98
|
+
if (token.length > 0 && !isPythonWhitespace(token) && !["{", "("].includes(token)) {
|
|
99
99
|
this.trait_name = token;
|
|
100
100
|
this.in_trait = true;
|
|
101
101
|
this._state = this._state_global;
|
|
@@ -107,7 +107,7 @@ export class PHPLanguageStates extends CodeStateMachine {
|
|
|
107
107
|
|
|
108
108
|
private readonly _class_declaration = (token: string): void => {
|
|
109
109
|
if (
|
|
110
|
-
token &&
|
|
110
|
+
token.length > 0 &&
|
|
111
111
|
!isPythonWhitespace(token) &&
|
|
112
112
|
!["{", "(", "extends", "implements"].includes(token)
|
|
113
113
|
) {
|
|
@@ -123,10 +123,10 @@ export class PHPLanguageStates extends CodeStateMachine {
|
|
|
123
123
|
private readonly _function_name = (token: string): void => {
|
|
124
124
|
if (token && !isPythonWhitespace(token) && token !== "(") {
|
|
125
125
|
const methodName = token;
|
|
126
|
-
if (this.in_class && this.class_name) {
|
|
126
|
+
if (this.in_class && this.class_name !== undefined && this.class_name.length > 0) {
|
|
127
127
|
this.function_name = `${this.class_name}::${methodName}`;
|
|
128
128
|
this.short_function_name = methodName;
|
|
129
|
-
} else if (this.in_trait && this.trait_name) {
|
|
129
|
+
} else if (this.in_trait && this.trait_name !== undefined && this.trait_name.length > 0) {
|
|
130
130
|
this.function_name = `${this.trait_name}::${methodName}`;
|
|
131
131
|
this.short_function_name = methodName;
|
|
132
132
|
} else {
|
|
@@ -140,8 +140,10 @@ export class PHPLanguageStates extends CodeStateMachine {
|
|
|
140
140
|
} else if (this.in_trait) {
|
|
141
141
|
this.function_name = `${this.trait_name}::(anonymous)`;
|
|
142
142
|
} else {
|
|
143
|
-
|
|
144
|
-
|
|
143
|
+
const assignment = this.assignments.at(-1);
|
|
144
|
+
this.function_name =
|
|
145
|
+
assignment !== undefined && assignment.length > 0 ? assignment : "(anonymous)";
|
|
146
|
+
if (assignment !== undefined && assignment.length > 0) this.assignments.pop();
|
|
145
147
|
}
|
|
146
148
|
this.bracket_level = 1;
|
|
147
149
|
this._state = this._function_args_continue;
|
|
@@ -153,7 +155,12 @@ export class PHPLanguageStates extends CodeStateMachine {
|
|
|
153
155
|
private readonly _function_args = (token: string): void => {
|
|
154
156
|
if (token !== "(") return;
|
|
155
157
|
this.bracket_level = 1;
|
|
156
|
-
if (
|
|
158
|
+
if (
|
|
159
|
+
this.in_class &&
|
|
160
|
+
this.class_name !== undefined &&
|
|
161
|
+
this.class_name.length > 0 &&
|
|
162
|
+
!this.is_function_declaration
|
|
163
|
+
) {
|
|
157
164
|
this.context.pushNewFunction(this.short_function_name);
|
|
158
165
|
} else {
|
|
159
166
|
this.context.pushNewFunction(this.function_name);
|
|
@@ -54,7 +54,9 @@ export class PLSQLReader extends CodeReader {
|
|
|
54
54
|
pendingTokens = [];
|
|
55
55
|
continue;
|
|
56
56
|
}
|
|
57
|
-
if (lastNonWhitespaceToken
|
|
57
|
+
if (lastNonWhitespaceToken !== undefined && lastNonWhitespaceToken.length > 0) {
|
|
58
|
+
yield lastNonWhitespaceToken;
|
|
59
|
+
}
|
|
58
60
|
yield* pendingTokens;
|
|
59
61
|
pendingTokens = [];
|
|
60
62
|
lastNonWhitespaceToken = token;
|
|
@@ -63,7 +65,9 @@ export class PLSQLReader extends CodeReader {
|
|
|
63
65
|
}
|
|
64
66
|
}
|
|
65
67
|
|
|
66
|
-
if (lastNonWhitespaceToken
|
|
68
|
+
if (lastNonWhitespaceToken !== undefined && lastNonWhitespaceToken.length > 0) {
|
|
69
|
+
yield lastNonWhitespaceToken;
|
|
70
|
+
}
|
|
67
71
|
yield* pendingTokens;
|
|
68
72
|
}
|
|
69
73
|
|
|
@@ -246,13 +250,13 @@ class PLSQLStates extends CodeStateMachine {
|
|
|
246
250
|
const lower = token.toLowerCase();
|
|
247
251
|
if (lower === "procedure") {
|
|
248
252
|
this.declaring_nested_function = true;
|
|
249
|
-
|
|
253
|
+
this.nested_br_level ??= 0;
|
|
250
254
|
this.next(this._procedure_name);
|
|
251
255
|
return;
|
|
252
256
|
}
|
|
253
257
|
if (lower === "function") {
|
|
254
258
|
this.declaring_nested_function = true;
|
|
255
|
-
|
|
259
|
+
this.nested_br_level ??= 0;
|
|
256
260
|
this.next(this._function_name);
|
|
257
261
|
return;
|
|
258
262
|
}
|
|
@@ -214,6 +214,7 @@ export class PythonReader extends CodeReader {
|
|
|
214
214
|
tokenFactory?: TokenFactory
|
|
215
215
|
): Generator<string> {
|
|
216
216
|
const quote = token.startsWith('"""') || token.startsWith("'''") ? token.slice(0, 3) : token[0];
|
|
217
|
+
if (quote === undefined) return;
|
|
217
218
|
const body = token.slice(quote.length, -quote.length);
|
|
218
219
|
let literal = "";
|
|
219
220
|
let produced = false;
|
|
@@ -300,7 +301,7 @@ export class PythonReader extends CodeReader {
|
|
|
300
301
|
const iterator = tokens[Symbol.iterator]();
|
|
301
302
|
let next = iterator.next();
|
|
302
303
|
|
|
303
|
-
while (
|
|
304
|
+
while (next.done !== true) {
|
|
304
305
|
const token = next.value;
|
|
305
306
|
if (token === "\n") {
|
|
306
307
|
atLineStart = true;
|
|
@@ -313,7 +314,7 @@ export class PythonReader extends CodeReader {
|
|
|
313
314
|
const lookahead: string[] = [];
|
|
314
315
|
let nextReal: string | undefined;
|
|
315
316
|
next = iterator.next();
|
|
316
|
-
while (
|
|
317
|
+
while (next.done !== true) {
|
|
317
318
|
lookahead.push(next.value);
|
|
318
319
|
if (next.value !== "\n" && !isPythonWhitespace(next.value)) {
|
|
319
320
|
nextReal = next.value;
|
|
@@ -329,7 +330,7 @@ export class PythonReader extends CodeReader {
|
|
|
329
330
|
} else if (nextReal === "(" || nextReal === "[") {
|
|
330
331
|
isKeyword = false;
|
|
331
332
|
let depth = 1;
|
|
332
|
-
while (
|
|
333
|
+
while (next.done !== true) {
|
|
333
334
|
const lookaheadToken = next.value;
|
|
334
335
|
lookahead.push(lookaheadToken);
|
|
335
336
|
if (["(", "[", "{"].includes(lookaheadToken)) depth += 1;
|
|
@@ -51,7 +51,7 @@ export class RReader extends CodeReader {
|
|
|
51
51
|
}
|
|
52
52
|
|
|
53
53
|
class RStates extends CodeStateMachine {
|
|
54
|
-
private recent_tokens: string[] = [];
|
|
54
|
+
private readonly recent_tokens: string[] = [];
|
|
55
55
|
private brace_count = 0;
|
|
56
56
|
private in_braced_function = false;
|
|
57
57
|
private additional_function_names: string[] = [];
|
|
@@ -174,6 +174,7 @@ class RStates extends CodeStateMachine {
|
|
|
174
174
|
let currentNameTokens: string[] = [];
|
|
175
175
|
while (index >= 0) {
|
|
176
176
|
const token = this.recent_tokens[index];
|
|
177
|
+
if (token === undefined) break;
|
|
177
178
|
if (token === "<-" || token === "=") {
|
|
178
179
|
if (currentNameTokens.length > 0) {
|
|
179
180
|
functionNames.push(currentNameTokens.reverse().join(""));
|