@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.
Files changed (670) hide show
  1. package/README.md +36 -5
  2. package/dist/esm/check/check.mjs +4 -0
  3. package/dist/esm/check/check.mjs.map +1 -1
  4. package/dist/esm/check/flag-enablement.mjs +32 -0
  5. package/dist/esm/check/flag-enablement.mjs.map +1 -0
  6. package/dist/esm/check/handoff-provider-identity.mjs +18 -0
  7. package/dist/esm/check/handoff-provider-identity.mjs.map +1 -0
  8. package/dist/esm/check/inherited-collection.mjs +1 -1
  9. package/dist/esm/check/inherited-collection.mjs.map +1 -1
  10. package/dist/esm/check/project-changes.mjs +2 -0
  11. package/dist/esm/check/project-changes.mjs.map +1 -0
  12. package/dist/esm/check/project-context.mjs +2 -0
  13. package/dist/esm/check/project-context.mjs.map +1 -0
  14. package/dist/esm/check-settlement/facts.mjs.map +1 -1
  15. package/dist/esm/check-settlement/record-store.mjs +1 -1
  16. package/dist/esm/check-settlement/record-store.mjs.map +1 -1
  17. package/dist/esm/data-boundary/canonical-data.mjs +36 -7
  18. package/dist/esm/data-boundary/canonical-data.mjs.map +1 -1
  19. package/dist/esm/data-boundary/canonical-json.mjs.map +1 -1
  20. package/dist/esm/data-boundary/closed-values.mjs +28 -4
  21. package/dist/esm/data-boundary/closed-values.mjs.map +1 -1
  22. package/dist/esm/{package-checks/project-files → data-boundary}/config-glob.mjs +3 -3
  23. package/dist/esm/data-boundary/config-glob.mjs.map +1 -0
  24. package/dist/esm/data-boundary/project-path.mjs +19 -0
  25. package/dist/esm/data-boundary/project-path.mjs.map +1 -0
  26. package/dist/esm/index.mjs +12 -5
  27. package/dist/esm/index.mjs.map +1 -1
  28. package/dist/esm/machine-output/v4/atomic-publication.mjs +4 -1
  29. package/dist/esm/machine-output/v4/atomic-publication.mjs.map +1 -1
  30. package/dist/esm/package-checks/check-authoring.mjs +69 -0
  31. package/dist/esm/package-checks/check-authoring.mjs.map +1 -0
  32. package/dist/esm/package-checks/code-quality-findings/finding-waiver-authoring.mjs.map +1 -1
  33. package/dist/esm/package-checks/code-quality-findings/finding-waiver-evidence.mjs.map +1 -1
  34. package/dist/esm/package-checks/command-check/command-check.mjs +55 -0
  35. package/dist/esm/package-checks/command-check/command-check.mjs.map +1 -0
  36. package/dist/esm/package-checks/command-check/contract.mjs +2 -0
  37. package/dist/esm/package-checks/command-check/contract.mjs.map +1 -0
  38. package/dist/esm/package-checks/command-check/execution.mjs +134 -0
  39. package/dist/esm/package-checks/command-check/execution.mjs.map +1 -0
  40. package/dist/esm/package-checks/command-check/options.mjs +284 -0
  41. package/dist/esm/package-checks/command-check/options.mjs.map +1 -0
  42. package/dist/esm/package-checks/command-check/transcript.mjs +26 -0
  43. package/dist/esm/package-checks/command-check/transcript.mjs.map +1 -0
  44. package/dist/esm/package-checks/duplicate-detection/default-check.mjs +9 -11
  45. package/dist/esm/package-checks/duplicate-detection/default-check.mjs.map +1 -1
  46. package/dist/esm/package-checks/duplicate-detection/execution.mjs +2 -4
  47. package/dist/esm/package-checks/duplicate-detection/execution.mjs.map +1 -1
  48. package/dist/esm/package-checks/duplicate-detection/finding-messages.mjs +1 -1
  49. package/dist/esm/package-checks/duplicate-detection/finding-messages.mjs.map +1 -1
  50. package/dist/esm/package-checks/duplicate-detection/jscpd/availability.mjs +1 -1
  51. package/dist/esm/package-checks/duplicate-detection/jscpd/availability.mjs.map +1 -1
  52. package/dist/esm/package-checks/duplicate-detection/options.mjs.map +1 -1
  53. package/dist/esm/package-checks/duplicate-detection/records.mjs.map +1 -1
  54. package/dist/esm/package-checks/file-metrics/constructor.mjs +9 -11
  55. package/dist/esm/package-checks/file-metrics/constructor.mjs.map +1 -1
  56. package/dist/esm/package-checks/file-metrics/execution.mjs +2 -4
  57. package/dist/esm/package-checks/file-metrics/execution.mjs.map +1 -1
  58. package/dist/esm/package-checks/file-metrics/finding-messages.mjs +1 -1
  59. package/dist/esm/package-checks/file-metrics/finding-messages.mjs.map +1 -1
  60. package/dist/esm/package-checks/file-metrics/options.mjs.map +1 -1
  61. package/dist/esm/package-checks/file-metrics/records.mjs.map +1 -1
  62. package/dist/esm/package-checks/file-metrics/scc/availability.mjs +1 -1
  63. package/dist/esm/package-checks/file-metrics/scc/availability.mjs.map +1 -1
  64. package/dist/esm/package-checks/file-metrics/scc/batch-planner.mjs +38 -0
  65. package/dist/esm/package-checks/file-metrics/scc/batch-planner.mjs.map +1 -0
  66. package/dist/esm/package-checks/file-metrics/scc/logical-scan-resources.mjs +35 -0
  67. package/dist/esm/package-checks/file-metrics/scc/logical-scan-resources.mjs.map +1 -0
  68. package/dist/esm/package-checks/file-metrics/scc/scanner.mjs +102 -29
  69. package/dist/esm/package-checks/file-metrics/scc/scanner.mjs.map +1 -1
  70. package/dist/esm/package-checks/function-metrics/analysis.mjs +7 -2
  71. package/dist/esm/package-checks/function-metrics/analysis.mjs.map +1 -1
  72. package/dist/esm/package-checks/function-metrics/analyzer/analysis-model.mjs +1 -1
  73. package/dist/esm/package-checks/function-metrics/analyzer/analysis-model.mjs.map +1 -1
  74. package/dist/esm/package-checks/function-metrics/analyzer/extensions/lizardcomplextags.mjs +1 -3
  75. package/dist/esm/package-checks/function-metrics/analyzer/extensions/lizardcomplextags.mjs.map +1 -1
  76. package/dist/esm/package-checks/function-metrics/analyzer/extensions/protocol.mjs.map +1 -1
  77. package/dist/esm/package-checks/function-metrics/analyzer/pipeline.mjs +3 -2
  78. package/dist/esm/package-checks/function-metrics/analyzer/pipeline.mjs.map +1 -1
  79. package/dist/esm/package-checks/function-metrics/analyzer/readers/erlang.mjs +6 -6
  80. package/dist/esm/package-checks/function-metrics/analyzer/readers/erlang.mjs.map +1 -1
  81. package/dist/esm/package-checks/function-metrics/analyzer/readers/fortran.mjs +1 -1
  82. package/dist/esm/package-checks/function-metrics/analyzer/readers/fortran.mjs.map +1 -1
  83. package/dist/esm/package-checks/function-metrics/analyzer/readers/objc.mjs +9 -3
  84. package/dist/esm/package-checks/function-metrics/analyzer/readers/objc.mjs.map +1 -1
  85. package/dist/esm/package-checks/function-metrics/analyzer/readers/php-states.mjs +12 -7
  86. package/dist/esm/package-checks/function-metrics/analyzer/readers/php-states.mjs.map +1 -1
  87. package/dist/esm/package-checks/function-metrics/analyzer/readers/plsql.mjs +6 -6
  88. package/dist/esm/package-checks/function-metrics/analyzer/readers/plsql.mjs.map +1 -1
  89. package/dist/esm/package-checks/function-metrics/analyzer/readers/python.mjs +5 -3
  90. package/dist/esm/package-checks/function-metrics/analyzer/readers/python.mjs.map +1 -1
  91. package/dist/esm/package-checks/function-metrics/analyzer/readers/r.mjs +2 -0
  92. package/dist/esm/package-checks/function-metrics/analyzer/readers/r.mjs.map +1 -1
  93. package/dist/esm/package-checks/function-metrics/analyzer/readers/ttcn.mjs +9 -3
  94. package/dist/esm/package-checks/function-metrics/analyzer/readers/ttcn.mjs.map +1 -1
  95. package/dist/esm/package-checks/function-metrics/analyzer/readers/typescript.mjs +9 -3
  96. package/dist/esm/package-checks/function-metrics/analyzer/readers/typescript.mjs.map +1 -1
  97. package/dist/esm/package-checks/function-metrics/analyzer/readers/zig.mjs +3 -1
  98. package/dist/esm/package-checks/function-metrics/analyzer/readers/zig.mjs.map +1 -1
  99. package/dist/esm/package-checks/function-metrics/analyzer/shared/code-reader.mjs +3 -1
  100. package/dist/esm/package-checks/function-metrics/analyzer/shared/code-reader.mjs.map +1 -1
  101. package/dist/esm/package-checks/function-metrics/analyzer/shared/js-style-regex.mjs +12 -5
  102. package/dist/esm/package-checks/function-metrics/analyzer/shared/js-style-regex.mjs.map +1 -1
  103. package/dist/esm/package-checks/function-metrics/analyzer-worker-port.mjs +20 -8
  104. package/dist/esm/package-checks/function-metrics/analyzer-worker-port.mjs.map +1 -1
  105. package/dist/esm/package-checks/function-metrics/constructor.mjs +9 -11
  106. package/dist/esm/package-checks/function-metrics/constructor.mjs.map +1 -1
  107. package/dist/esm/package-checks/function-metrics/execution.mjs +2 -4
  108. package/dist/esm/package-checks/function-metrics/execution.mjs.map +1 -1
  109. package/dist/esm/package-checks/function-metrics/finding-messages.mjs +1 -1
  110. package/dist/esm/package-checks/function-metrics/finding-messages.mjs.map +1 -1
  111. package/dist/esm/package-checks/function-metrics/measurement.mjs +3 -1
  112. package/dist/esm/package-checks/function-metrics/measurement.mjs.map +1 -1
  113. package/dist/esm/package-checks/function-metrics/options.mjs.map +1 -1
  114. package/dist/esm/package-checks/function-metrics/records.mjs.map +1 -1
  115. package/dist/esm/package-checks/host-environment/git.mjs +11 -0
  116. package/dist/esm/package-checks/host-environment/git.mjs.map +1 -1
  117. package/dist/esm/package-checks/host-environment/path.mjs +1 -17
  118. package/dist/esm/package-checks/host-environment/path.mjs.map +1 -1
  119. package/dist/esm/package-checks/host-environment/process/contract.mjs.map +1 -1
  120. package/dist/esm/package-checks/host-environment/process/result.mjs +43 -17
  121. package/dist/esm/package-checks/host-environment/process/result.mjs.map +1 -1
  122. package/dist/esm/package-checks/host-environment/process/runner.mjs +7 -5
  123. package/dist/esm/package-checks/host-environment/process/runner.mjs.map +1 -1
  124. package/dist/esm/package-checks/json-schema-validation/default-check.mjs +9 -11
  125. package/dist/esm/package-checks/json-schema-validation/default-check.mjs.map +1 -1
  126. package/dist/esm/package-checks/json-schema-validation/options.mjs.map +1 -1
  127. package/dist/esm/package-checks/json-schema-validation/reference-resolver.mjs +6 -2
  128. package/dist/esm/package-checks/json-schema-validation/reference-resolver.mjs.map +1 -1
  129. package/dist/esm/package-checks/json-schema-validation/schema-policy.mjs +11 -3
  130. package/dist/esm/package-checks/json-schema-validation/schema-policy.mjs.map +1 -1
  131. package/dist/esm/package-checks/json-validation/default-check.mjs +9 -11
  132. package/dist/esm/package-checks/json-validation/default-check.mjs.map +1 -1
  133. package/dist/esm/package-checks/json-validation/options.mjs.map +1 -1
  134. package/dist/esm/package-checks/local-cache-options.mjs +28 -0
  135. package/dist/esm/package-checks/local-cache-options.mjs.map +1 -0
  136. package/dist/esm/package-checks/maintenance-reminders/maintenance-reminders.mjs +37 -45
  137. package/dist/esm/package-checks/maintenance-reminders/maintenance-reminders.mjs.map +1 -1
  138. package/dist/esm/package-checks/maintenance-reminders/maintenance-support.mjs +3 -1
  139. package/dist/esm/package-checks/maintenance-reminders/maintenance-support.mjs.map +1 -1
  140. package/dist/esm/package-checks/markdown-link-validation/default-check.mjs +19 -33
  141. package/dist/esm/package-checks/markdown-link-validation/default-check.mjs.map +1 -1
  142. package/dist/esm/package-checks/markdown-link-validation/execution.mjs +1 -1
  143. package/dist/esm/package-checks/markdown-link-validation/execution.mjs.map +1 -1
  144. package/dist/esm/package-checks/markdown-link-validation/finding-messages.mjs +1 -1
  145. package/dist/esm/package-checks/markdown-link-validation/finding-messages.mjs.map +1 -1
  146. package/dist/esm/package-checks/markdown-link-validation/markdown-parser.mjs +1 -3
  147. package/dist/esm/package-checks/markdown-link-validation/markdown-parser.mjs.map +1 -1
  148. package/dist/esm/package-checks/markdown-link-validation/options-resolution.mjs +3 -18
  149. package/dist/esm/package-checks/markdown-link-validation/options-resolution.mjs.map +1 -1
  150. package/dist/esm/package-checks/markdown-link-validation/options-validation.mjs +2 -14
  151. package/dist/esm/package-checks/markdown-link-validation/options-validation.mjs.map +1 -1
  152. package/dist/esm/package-checks/markdown-link-validation/options.mjs.map +1 -1
  153. package/dist/esm/package-checks/markdown-link-validation/parse-facts-cache-payload.mjs +4 -5
  154. package/dist/esm/package-checks/markdown-link-validation/parse-facts-cache-payload.mjs.map +1 -1
  155. package/dist/esm/package-checks/markdown-lint/adapter.mjs +125 -0
  156. package/dist/esm/package-checks/markdown-lint/adapter.mjs.map +1 -0
  157. package/dist/esm/package-checks/markdown-lint/default-check.mjs +37 -0
  158. package/dist/esm/package-checks/markdown-lint/default-check.mjs.map +1 -0
  159. package/dist/esm/package-checks/markdown-lint/execution.mjs +202 -0
  160. package/dist/esm/package-checks/markdown-lint/execution.mjs.map +1 -0
  161. package/dist/esm/package-checks/markdown-lint/final-data.mjs +16 -0
  162. package/dist/esm/package-checks/markdown-lint/final-data.mjs.map +1 -0
  163. package/dist/esm/package-checks/markdown-lint/finding-messages.mjs +72 -0
  164. package/dist/esm/package-checks/markdown-lint/finding-messages.mjs.map +1 -0
  165. package/dist/esm/package-checks/markdown-lint/finding-waiver-identity.mjs +41 -0
  166. package/dist/esm/package-checks/markdown-lint/finding-waiver-identity.mjs.map +1 -0
  167. package/dist/esm/package-checks/markdown-lint/findings-cache.mjs +110 -0
  168. package/dist/esm/package-checks/markdown-lint/findings-cache.mjs.map +1 -0
  169. package/dist/esm/package-checks/markdown-lint/options-resolution.mjs +74 -0
  170. package/dist/esm/package-checks/markdown-lint/options-resolution.mjs.map +1 -0
  171. package/dist/esm/package-checks/markdown-lint/options-validation.mjs +41 -0
  172. package/dist/esm/package-checks/markdown-lint/options-validation.mjs.map +1 -0
  173. package/dist/esm/package-checks/markdown-lint/options.mjs +13 -0
  174. package/dist/esm/package-checks/markdown-lint/options.mjs.map +1 -0
  175. package/dist/esm/package-checks/markdown-lint/records.mjs +65 -0
  176. package/dist/esm/package-checks/markdown-lint/records.mjs.map +1 -0
  177. package/dist/esm/package-checks/markdown-lint/unavailable-reasons.mjs +14 -0
  178. package/dist/esm/package-checks/markdown-lint/unavailable-reasons.mjs.map +1 -0
  179. package/dist/esm/package-checks/project-files/collection.mjs +23 -19
  180. package/dist/esm/package-checks/project-files/collection.mjs.map +1 -1
  181. package/dist/esm/package-checks/project-files/configuration.mjs +1 -1
  182. package/dist/esm/package-checks/project-files/configuration.mjs.map +1 -1
  183. package/dist/esm/package-checks/project-files/gitlink-revision.mjs +2 -5
  184. package/dist/esm/package-checks/project-files/gitlink-revision.mjs.map +1 -1
  185. package/dist/esm/package-checks/project-files/gitlink-worktree.mjs +22 -6
  186. package/dist/esm/package-checks/project-files/gitlink-worktree.mjs.map +1 -1
  187. package/dist/esm/package-checks/project-files/public-collection.mjs +1 -1
  188. package/dist/esm/package-checks/project-files/public-collection.mjs.map +1 -1
  189. package/dist/esm/package-checks/project-files/revision-paths.mjs +3 -3
  190. package/dist/esm/package-checks/project-files/revision-paths.mjs.map +1 -1
  191. package/dist/esm/package-checks/project-files/revision-worktree-files.mjs +11 -15
  192. package/dist/esm/package-checks/project-files/revision-worktree-files.mjs.map +1 -1
  193. package/dist/esm/package-checks/secret-detection/default-check.mjs +9 -11
  194. package/dist/esm/package-checks/secret-detection/default-check.mjs.map +1 -1
  195. package/dist/esm/package-checks/secret-detection/execution.mjs +2 -2
  196. package/dist/esm/package-checks/secret-detection/execution.mjs.map +1 -1
  197. package/dist/esm/package-checks/secret-detection/input-preparation.mjs +46 -7
  198. package/dist/esm/package-checks/secret-detection/input-preparation.mjs.map +1 -1
  199. package/dist/esm/package-checks/secret-detection/options.mjs.map +1 -1
  200. package/dist/esm/package-checks/secret-detection/records.mjs.map +1 -1
  201. package/dist/esm/package-checks/secret-detection/secretlint/adapter.mjs +3 -4
  202. package/dist/esm/package-checks/secret-detection/secretlint/adapter.mjs.map +1 -1
  203. package/dist/esm/package-tools/admission-policy/define-admission-policy.mjs +10 -0
  204. package/dist/esm/package-tools/admission-policy/define-admission-policy.mjs.map +1 -0
  205. package/dist/esm/{cache → package-tools/cache}/cache-json-by-key.mjs +13 -14
  206. package/dist/esm/package-tools/cache/cache-json-by-key.mjs.map +1 -0
  207. package/dist/esm/package-tools/finding-presentation/finding-presentation.mjs.map +1 -0
  208. package/dist/esm/{finding-waivers → package-tools/finding-waivers}/reconciliation.mjs +14 -5
  209. package/dist/esm/package-tools/finding-waivers/reconciliation.mjs.map +1 -0
  210. package/dist/esm/package-tools/learned-critical-path/critical-path-ranking.mjs.map +1 -0
  211. package/dist/esm/package-tools/learned-critical-path/duration-model/bounded-history.mjs.map +1 -0
  212. package/dist/esm/{learned-critical-path → package-tools/learned-critical-path}/duration-model/prediction.mjs +2 -2
  213. package/dist/esm/package-tools/learned-critical-path/duration-model/prediction.mjs.map +1 -0
  214. package/dist/esm/{learned-critical-path → package-tools/learned-critical-path}/duration-model/preparation.mjs +4 -2
  215. package/dist/esm/package-tools/learned-critical-path/duration-model/preparation.mjs.map +1 -0
  216. package/dist/esm/package-tools/learned-critical-path/duration-model/recording.mjs.map +1 -0
  217. package/dist/esm/{learned-critical-path → package-tools/learned-critical-path}/duration-model/storage.mjs +8 -8
  218. package/dist/esm/package-tools/learned-critical-path/duration-model/storage.mjs.map +1 -0
  219. package/dist/esm/{learned-critical-path → package-tools/learned-critical-path}/selection-layers.mjs +1 -2
  220. package/dist/esm/package-tools/learned-critical-path/selection-layers.mjs.map +1 -0
  221. package/dist/esm/package-tools/learned-critical-path/static-decision.mjs.map +1 -0
  222. package/dist/esm/{learned-critical-path → package-tools/learned-critical-path}/strategy.mjs +3 -3
  223. package/dist/esm/package-tools/learned-critical-path/strategy.mjs.map +1 -0
  224. package/dist/esm/project-definition/check-tree/authoring.mjs +8 -5
  225. package/dist/esm/project-definition/check-tree/authoring.mjs.map +1 -1
  226. package/dist/esm/project-definition/check-tree/check-fields-authoring.mjs +79 -66
  227. package/dist/esm/project-definition/check-tree/check-fields-authoring.mjs.map +1 -1
  228. package/dist/esm/project-definition/check-tree/flag-conditions.mjs +71 -0
  229. package/dist/esm/project-definition/check-tree/flag-conditions.mjs.map +1 -0
  230. package/dist/esm/project-definition/check-tree/materialization.mjs +13 -8
  231. package/dist/esm/project-definition/check-tree/materialization.mjs.map +1 -1
  232. package/dist/esm/project-definition/check-tree/resolution.mjs +7 -6
  233. package/dist/esm/project-definition/check-tree/resolution.mjs.map +1 -1
  234. package/dist/esm/project-definition/declarative-snapshot.mjs +2 -1
  235. package/dist/esm/project-definition/declarative-snapshot.mjs.map +1 -1
  236. package/dist/esm/project-definition/project-changes.mjs +70 -0
  237. package/dist/esm/project-definition/project-changes.mjs.map +1 -0
  238. package/dist/esm/project-definition/project-definition-validation.mjs +40 -8
  239. package/dist/esm/project-definition/project-definition-validation.mjs.map +1 -1
  240. package/dist/esm/project-definition/project-definition.mjs +22 -15
  241. package/dist/esm/project-definition/project-definition.mjs.map +1 -1
  242. package/dist/esm/project-definition/scheduler-policy.mjs.map +1 -1
  243. package/dist/esm/project-run/admission-strategy-provider/custom-strategy-preparation.mjs +9 -6
  244. package/dist/esm/project-run/admission-strategy-provider/custom-strategy-preparation.mjs.map +1 -1
  245. package/dist/esm/project-run/admission-strategy-provider/prepared-admission-strategy.mjs.map +1 -1
  246. package/dist/esm/project-run/aggregation.mjs +42 -59
  247. package/dist/esm/project-run/aggregation.mjs.map +1 -1
  248. package/dist/esm/project-run/changes/git.mjs +161 -0
  249. package/dist/esm/project-run/changes/git.mjs.map +1 -0
  250. package/dist/esm/project-run/check-execution/admitted-check-execution.mjs +41 -0
  251. package/dist/esm/project-run/check-execution/admitted-check-execution.mjs.map +1 -0
  252. package/dist/esm/project-run/check-execution/callback.mjs +3 -2
  253. package/dist/esm/project-run/check-execution/callback.mjs.map +1 -1
  254. package/dist/esm/project-run/check-execution/dependencies.mjs +80 -5
  255. package/dist/esm/project-run/check-execution/dependencies.mjs.map +1 -1
  256. package/dist/esm/project-run/check-execution/execution-finalization.mjs +5 -3
  257. package/dist/esm/project-run/check-execution/execution-finalization.mjs.map +1 -1
  258. package/dist/esm/project-run/check-execution/execution-settlement.mjs +37 -16
  259. package/dist/esm/project-run/check-execution/execution-settlement.mjs.map +1 -1
  260. package/dist/esm/project-run/check-execution/flag-controls.mjs +15 -7
  261. package/dist/esm/project-run/check-execution/flag-controls.mjs.map +1 -1
  262. package/dist/esm/project-run/check-execution/lifecycle.mjs.map +1 -1
  263. package/dist/esm/project-run/check-execution/{preflight-result.mjs → preparation-result.mjs} +24 -24
  264. package/dist/esm/project-run/check-execution/preparation-result.mjs.map +1 -0
  265. package/dist/esm/project-run/check-execution/{preflight.mjs → preparation.mjs} +52 -52
  266. package/dist/esm/project-run/check-execution/preparation.mjs.map +1 -0
  267. package/dist/esm/project-run/check-execution/ready-check-execution.mjs +71 -0
  268. package/dist/esm/project-run/check-execution/ready-check-execution.mjs.map +1 -0
  269. package/dist/esm/project-run/check-execution/resolved-checks.mjs +27 -164
  270. package/dist/esm/project-run/check-execution/resolved-checks.mjs.map +1 -1
  271. package/dist/esm/project-run/check-execution/scheduled-check-run.mjs +79 -0
  272. package/dist/esm/project-run/check-execution/scheduled-check-run.mjs.map +1 -0
  273. package/dist/esm/project-run/check-execution/terminal-result.mjs +70 -25
  274. package/dist/esm/project-run/check-execution/terminal-result.mjs.map +1 -1
  275. package/dist/esm/project-run/completion/completion.mjs +18 -1
  276. package/dist/esm/project-run/completion/completion.mjs.map +1 -1
  277. package/dist/esm/project-run/controls/contract.mjs.map +1 -1
  278. package/dist/esm/project-run/controls/validation.mjs +7 -54
  279. package/dist/esm/project-run/controls/validation.mjs.map +1 -1
  280. package/dist/esm/project-run/diagnostic-logging/diagnostic-detail-rendering.mjs +3 -3
  281. package/dist/esm/project-run/diagnostic-logging/diagnostic-detail-rendering.mjs.map +1 -1
  282. package/dist/esm/project-run/diagnostic-logging/observation-rendering.mjs +1 -1
  283. package/dist/esm/project-run/diagnostic-logging/observation-rendering.mjs.map +1 -1
  284. package/dist/esm/project-run/invocation/candidate.mjs +17 -13
  285. package/dist/esm/project-run/invocation/candidate.mjs.map +1 -1
  286. package/dist/esm/project-run/invocation/candidates.mjs +26 -0
  287. package/dist/esm/project-run/invocation/candidates.mjs.map +1 -0
  288. package/dist/esm/project-run/invocation/creation.mjs +7 -3
  289. package/dist/esm/project-run/invocation/creation.mjs.map +1 -1
  290. package/dist/esm/project-run/invocation/execution.mjs +98 -0
  291. package/dist/esm/project-run/invocation/execution.mjs.map +1 -0
  292. package/dist/esm/project-run/invocation/run.mjs +13 -112
  293. package/dist/esm/project-run/invocation/run.mjs.map +1 -1
  294. package/dist/esm/project-run/invocation/scheduler.mjs +13 -6
  295. package/dist/esm/project-run/invocation/scheduler.mjs.map +1 -1
  296. package/dist/esm/project-run/outputs/status.mjs +12 -12
  297. package/dist/esm/project-run/outputs/status.mjs.map +1 -1
  298. package/dist/esm/project-run/progress-rendering/presentation.mjs +31 -11
  299. package/dist/esm/project-run/progress-rendering/presentation.mjs.map +1 -1
  300. package/dist/esm/project-run/progress-rendering/renderer-formatting.mjs +11 -4
  301. package/dist/esm/project-run/progress-rendering/renderer-formatting.mjs.map +1 -1
  302. package/dist/esm/project-run/progress-rendering/renderer-lifecycle.mjs +20 -6
  303. package/dist/esm/project-run/progress-rendering/renderer-lifecycle.mjs.map +1 -1
  304. package/dist/esm/project-run/progress-rendering/renderer.mjs +6 -2
  305. package/dist/esm/project-run/progress-rendering/renderer.mjs.map +1 -1
  306. package/dist/esm/project-run/project-context.mjs +2 -1
  307. package/dist/esm/project-run/project-context.mjs.map +1 -1
  308. package/dist/esm/project-run/result.mjs +2 -2
  309. package/dist/esm/project-run/result.mjs.map +1 -1
  310. package/dist/esm/project-run/run.mjs.map +1 -1
  311. package/dist/esm/project-run/task-scheduler/admission-core/compiled-graph-lookup.mjs +45 -0
  312. package/dist/esm/project-run/task-scheduler/admission-core/compiled-graph-lookup.mjs.map +1 -0
  313. package/dist/esm/project-run/task-scheduler/admission-core/compiled-graph.mjs +9 -4
  314. package/dist/esm/project-run/task-scheduler/admission-core/compiled-graph.mjs.map +1 -1
  315. package/dist/esm/project-run/task-scheduler/admission-core/selection-query.mjs +3 -5
  316. package/dist/esm/project-run/task-scheduler/admission-core/selection-query.mjs.map +1 -1
  317. package/dist/esm/project-run/task-scheduler/admission-core/selection-seed.mjs +25 -8
  318. package/dist/esm/project-run/task-scheduler/admission-core/selection-seed.mjs.map +1 -1
  319. package/dist/esm/project-run/task-scheduler/admission-core/selection-transition.mjs +8 -8
  320. package/dist/esm/project-run/task-scheduler/admission-core/selection-transition.mjs.map +1 -1
  321. package/dist/esm/project-run/task-scheduler/execution-state.mjs.map +1 -1
  322. package/dist/esm/project-run/task-scheduler/measurement/diagnostics.mjs +8 -4
  323. package/dist/esm/project-run/task-scheduler/measurement/diagnostics.mjs.map +1 -1
  324. package/dist/esm/project-run/task-scheduler/measurement/timing.mjs +12 -6
  325. package/dist/esm/project-run/task-scheduler/measurement/timing.mjs.map +1 -1
  326. package/dist/esm/project-run/task-scheduler/scheduler-observation.mjs +3 -1
  327. package/dist/esm/project-run/task-scheduler/scheduler-observation.mjs.map +1 -1
  328. package/dist/esm/project-run/task-scheduler/scheduler-terminal-measurement.mjs +17 -17
  329. package/dist/esm/project-run/task-scheduler/scheduler-terminal-measurement.mjs.map +1 -1
  330. package/dist/esm/project-run/task-scheduler/scheduler.mjs +18 -6
  331. package/dist/esm/project-run/task-scheduler/scheduler.mjs.map +1 -1
  332. package/docs/api-mechanics.md +147 -28
  333. package/docs/changelog.md +145 -2
  334. package/docs/checks/duplicate-detection.md +22 -3
  335. package/docs/checks/file-metrics.md +25 -6
  336. package/docs/checks/function-metrics.md +21 -2
  337. package/docs/checks/json-schema-validation.md +25 -4
  338. package/docs/checks/json-validation.md +24 -5
  339. package/docs/checks/maintenance-reminders.md +30 -6
  340. package/docs/checks/markdown-link-validation.md +24 -4
  341. package/docs/checks/markdown-lint.md +167 -0
  342. package/docs/checks/secret-detection.md +31 -7
  343. package/docs/examples/artifacts/mixed-outcomes/definition.ts +10 -10
  344. package/docs/guides/building-project-gate.md +706 -0
  345. package/docs/guides/callbacks.md +81 -22
  346. package/docs/guides/check-dependencies.md +41 -10
  347. package/docs/guides/collecting-project-files.md +7 -7
  348. package/docs/guides/command-check.md +155 -0
  349. package/docs/guides/data-boundaries.md +140 -0
  350. package/docs/guides/extending-check-lifecycle.md +77 -25
  351. package/docs/guides/finding-waivers.md +43 -1
  352. package/docs/guides/learned-scheduling.md +1 -1
  353. package/docs/guides/run-outputs.md +35 -9
  354. package/docs/guides/scheduling.md +15 -15
  355. package/docs/output.md +6 -5
  356. package/package.json +2 -1
  357. package/src/check/check.ts +332 -92
  358. package/src/check/flag-enablement.ts +76 -0
  359. package/src/check/handoff-provider-identity.ts +34 -0
  360. package/src/check/inherited-collection.ts +1 -1
  361. package/src/check/project-changes.ts +14 -0
  362. package/src/check/project-context.ts +11 -0
  363. package/src/check-settlement/facts.ts +1 -1
  364. package/src/check-settlement/record-store.ts +1 -1
  365. package/src/data-boundary/canonical-data.ts +36 -9
  366. package/src/data-boundary/canonical-json.ts +18 -1
  367. package/src/data-boundary/closed-values.ts +26 -6
  368. package/src/data-boundary/config-glob.ts +17 -0
  369. package/src/data-boundary/project-path.ts +21 -0
  370. package/src/index.ts +72 -11
  371. package/src/machine-output/v4/atomic-publication.ts +3 -1
  372. package/src/package-checks/check-authoring.ts +136 -0
  373. package/src/package-checks/code-quality-findings/finding-waiver-authoring.ts +1 -1
  374. package/src/package-checks/code-quality-findings/finding-waiver-evidence.ts +1 -1
  375. package/src/package-checks/command-check/command-check.ts +152 -0
  376. package/src/package-checks/command-check/contract.ts +168 -0
  377. package/src/package-checks/command-check/execution.ts +211 -0
  378. package/src/package-checks/command-check/options.ts +331 -0
  379. package/src/package-checks/command-check/transcript.ts +35 -0
  380. package/src/package-checks/duplicate-detection/default-check.ts +37 -6
  381. package/src/package-checks/duplicate-detection/execution.ts +2 -4
  382. package/src/package-checks/duplicate-detection/finding-messages.ts +2 -2
  383. package/src/package-checks/duplicate-detection/jscpd/availability.ts +1 -1
  384. package/src/package-checks/duplicate-detection/options.ts +6 -3
  385. package/src/package-checks/duplicate-detection/records.ts +1 -1
  386. package/src/package-checks/file-metrics/constructor.ts +29 -6
  387. package/src/package-checks/file-metrics/execution.ts +2 -4
  388. package/src/package-checks/file-metrics/finding-messages.ts +1 -1
  389. package/src/package-checks/file-metrics/options.ts +6 -3
  390. package/src/package-checks/file-metrics/records.ts +1 -1
  391. package/src/package-checks/file-metrics/scc/availability.ts +1 -1
  392. package/src/package-checks/file-metrics/scc/batch-planner.ts +56 -0
  393. package/src/package-checks/file-metrics/scc/logical-scan-resources.ts +59 -0
  394. package/src/package-checks/file-metrics/scc/scanner.ts +134 -32
  395. package/src/package-checks/function-metrics/analysis.ts +7 -2
  396. package/src/package-checks/function-metrics/analyzer/analysis-model.ts +1 -1
  397. package/src/package-checks/function-metrics/analyzer/extension-output.ts +14 -6
  398. package/src/package-checks/function-metrics/analyzer/extensions/lizardcomplextags.ts +1 -3
  399. package/src/package-checks/function-metrics/analyzer/extensions/protocol.ts +3 -3
  400. package/src/package-checks/function-metrics/analyzer/pipeline.ts +4 -2
  401. package/src/package-checks/function-metrics/analyzer/readers/erlang.ts +6 -6
  402. package/src/package-checks/function-metrics/analyzer/readers/fortran.ts +1 -1
  403. package/src/package-checks/function-metrics/analyzer/readers/objc.ts +9 -3
  404. package/src/package-checks/function-metrics/analyzer/readers/php-states.ts +14 -7
  405. package/src/package-checks/function-metrics/analyzer/readers/plsql.ts +8 -4
  406. package/src/package-checks/function-metrics/analyzer/readers/python.ts +4 -3
  407. package/src/package-checks/function-metrics/analyzer/readers/r.ts +2 -1
  408. package/src/package-checks/function-metrics/analyzer/readers/ttcn.ts +9 -3
  409. package/src/package-checks/function-metrics/analyzer/readers/typescript.ts +9 -3
  410. package/src/package-checks/function-metrics/analyzer/readers/zig.ts +2 -1
  411. package/src/package-checks/function-metrics/analyzer/shared/code-reader.ts +3 -1
  412. package/src/package-checks/function-metrics/analyzer/shared/js-style-regex.ts +10 -5
  413. package/src/package-checks/function-metrics/analyzer-worker-port.ts +20 -6
  414. package/src/package-checks/function-metrics/constructor.ts +30 -7
  415. package/src/package-checks/function-metrics/execution.ts +2 -4
  416. package/src/package-checks/function-metrics/finding-messages.ts +2 -2
  417. package/src/package-checks/function-metrics/measurement.ts +3 -1
  418. package/src/package-checks/function-metrics/options.ts +6 -3
  419. package/src/package-checks/function-metrics/records.ts +1 -1
  420. package/src/package-checks/host-environment/git.ts +11 -0
  421. package/src/package-checks/host-environment/path.ts +1 -20
  422. package/src/package-checks/host-environment/process/contract.ts +17 -9
  423. package/src/package-checks/host-environment/process/result.ts +48 -20
  424. package/src/package-checks/host-environment/process/runner.ts +8 -4
  425. package/src/package-checks/json-schema-validation/default-check.ts +38 -5
  426. package/src/package-checks/json-schema-validation/options.ts +4 -1
  427. package/src/package-checks/json-schema-validation/reference-resolver.ts +6 -2
  428. package/src/package-checks/json-schema-validation/schema-policy.ts +10 -5
  429. package/src/package-checks/json-validation/default-check.ts +27 -6
  430. package/src/package-checks/json-validation/options.ts +4 -1
  431. package/src/package-checks/local-cache-options.ts +40 -0
  432. package/src/package-checks/maintenance-reminders/maintenance-reminders.ts +89 -9
  433. package/src/package-checks/maintenance-reminders/maintenance-support.ts +3 -3
  434. package/src/package-checks/markdown-link-validation/default-check.ts +48 -5
  435. package/src/package-checks/markdown-link-validation/execution.ts +1 -1
  436. package/src/package-checks/markdown-link-validation/finding-messages.ts +1 -1
  437. package/src/package-checks/markdown-link-validation/markdown-parser.ts +1 -5
  438. package/src/package-checks/markdown-link-validation/options-resolution.ts +2 -19
  439. package/src/package-checks/markdown-link-validation/options-validation.ts +2 -17
  440. package/src/package-checks/markdown-link-validation/options.ts +6 -7
  441. package/src/package-checks/markdown-link-validation/parse-facts-cache-payload.ts +4 -5
  442. package/src/package-checks/markdown-lint/adapter.ts +167 -0
  443. package/src/package-checks/markdown-lint/default-check.ts +92 -0
  444. package/src/package-checks/markdown-lint/execution.ts +266 -0
  445. package/src/package-checks/markdown-lint/final-data.ts +33 -0
  446. package/src/package-checks/markdown-lint/finding-messages.ts +87 -0
  447. package/src/package-checks/markdown-lint/finding-waiver-identity.ts +54 -0
  448. package/src/package-checks/markdown-lint/findings-cache.ts +141 -0
  449. package/src/package-checks/markdown-lint/options-resolution.ts +102 -0
  450. package/src/package-checks/markdown-lint/options-validation.ts +50 -0
  451. package/src/package-checks/markdown-lint/options.ts +82 -0
  452. package/src/package-checks/markdown-lint/records.ts +132 -0
  453. package/src/package-checks/markdown-lint/unavailable-reasons.ts +33 -0
  454. package/src/package-checks/project-files/collection.ts +38 -22
  455. package/src/package-checks/project-files/config-glob.ts +1 -17
  456. package/src/package-checks/project-files/configuration.ts +1 -1
  457. package/src/package-checks/project-files/gitlink-revision.ts +4 -6
  458. package/src/package-checks/project-files/gitlink-worktree.ts +35 -7
  459. package/src/package-checks/project-files/public-collection.ts +1 -1
  460. package/src/package-checks/project-files/revision-paths.ts +3 -3
  461. package/src/package-checks/project-files/revision-worktree-files.ts +16 -16
  462. package/src/package-checks/secret-detection/default-check.ts +29 -6
  463. package/src/package-checks/secret-detection/execution.ts +2 -2
  464. package/src/package-checks/secret-detection/input-preparation.ts +64 -7
  465. package/src/package-checks/secret-detection/options.ts +5 -2
  466. package/src/package-checks/secret-detection/records.ts +1 -1
  467. package/src/package-checks/secret-detection/secretlint/adapter.ts +3 -4
  468. package/src/package-tools/admission-policy/define-admission-policy.ts +54 -0
  469. package/src/{cache → package-tools/cache}/cache-json-by-key.ts +13 -17
  470. package/src/{check → package-tools/finding-presentation}/finding-presentation.ts +3 -1
  471. package/src/{finding-waivers → package-tools/finding-waivers}/reconciliation.ts +16 -8
  472. package/src/{learned-critical-path → package-tools/learned-critical-path}/duration-model/prediction.ts +5 -2
  473. package/src/{learned-critical-path → package-tools/learned-critical-path}/duration-model/preparation.ts +5 -3
  474. package/src/{learned-critical-path → package-tools/learned-critical-path}/duration-model/recording.ts +5 -4
  475. package/src/{learned-critical-path → package-tools/learned-critical-path}/duration-model/storage.ts +9 -10
  476. package/src/{learned-critical-path → package-tools/learned-critical-path}/selection-layers.ts +2 -3
  477. package/src/{learned-critical-path → package-tools/learned-critical-path}/static-decision.ts +1 -1
  478. package/src/{learned-critical-path → package-tools/learned-critical-path}/strategy.ts +7 -4
  479. package/src/project-definition/check-tree/authoring.ts +15 -8
  480. package/src/project-definition/check-tree/check-fields-authoring.ts +106 -91
  481. package/src/project-definition/check-tree/flag-conditions.ts +99 -0
  482. package/src/project-definition/check-tree/materialization.ts +12 -8
  483. package/src/project-definition/check-tree/resolution.ts +13 -15
  484. package/src/project-definition/declarative-snapshot.ts +9 -2
  485. package/src/project-definition/project-changes.ts +112 -0
  486. package/src/project-definition/project-definition-validation.ts +58 -10
  487. package/src/project-definition/project-definition.ts +41 -68
  488. package/src/project-definition/scheduler-policy.ts +6 -3
  489. package/src/project-run/admission-strategy-provider/custom-strategy-preparation.ts +11 -8
  490. package/src/project-run/admission-strategy-provider/prepared-admission-strategy.ts +2 -2
  491. package/src/project-run/aggregation.ts +51 -74
  492. package/src/project-run/changes/git.ts +206 -0
  493. package/src/project-run/check-execution/admitted-check-execution.ts +62 -0
  494. package/src/project-run/check-execution/callback.ts +3 -2
  495. package/src/project-run/check-execution/dependencies.ts +120 -6
  496. package/src/project-run/check-execution/execution-finalization.ts +6 -4
  497. package/src/project-run/check-execution/execution-settlement.ts +88 -29
  498. package/src/project-run/check-execution/flag-controls.ts +22 -8
  499. package/src/project-run/check-execution/lifecycle.ts +14 -6
  500. package/src/project-run/check-execution/{preflight-result.ts → preparation-result.ts} +34 -32
  501. package/src/project-run/check-execution/{preflight.ts → preparation.ts} +92 -84
  502. package/src/project-run/check-execution/ready-check-execution.ts +97 -0
  503. package/src/project-run/check-execution/resolved-checks.ts +40 -219
  504. package/src/project-run/check-execution/scheduled-check-run.ts +119 -0
  505. package/src/project-run/check-execution/terminal-result.ts +108 -29
  506. package/src/project-run/completion/completion.ts +17 -3
  507. package/src/project-run/controls/contract.ts +6 -16
  508. package/src/project-run/controls/validation.ts +7 -60
  509. package/src/project-run/diagnostic-logging/diagnostic-detail-rendering.ts +1 -2
  510. package/src/project-run/diagnostic-logging/observation-rendering.ts +1 -1
  511. package/src/project-run/invocation/candidate.ts +28 -15
  512. package/src/project-run/invocation/candidates.ts +56 -0
  513. package/src/project-run/invocation/creation.ts +7 -3
  514. package/src/project-run/invocation/execution.ts +136 -0
  515. package/src/project-run/invocation/run.ts +15 -179
  516. package/src/project-run/invocation/scheduler.ts +13 -6
  517. package/src/project-run/outputs/status.ts +15 -15
  518. package/src/project-run/progress-rendering/presentation.ts +35 -13
  519. package/src/project-run/progress-rendering/renderer-formatting.ts +20 -7
  520. package/src/project-run/progress-rendering/renderer-lifecycle.ts +23 -6
  521. package/src/project-run/progress-rendering/renderer.ts +10 -4
  522. package/src/project-run/project-context.ts +8 -4
  523. package/src/project-run/result.ts +5 -5
  524. package/src/project-run/run.ts +1 -1
  525. package/src/project-run/task-scheduler/admission-core/compiled-graph-lookup.ts +71 -0
  526. package/src/project-run/task-scheduler/admission-core/compiled-graph.ts +9 -4
  527. package/src/project-run/task-scheduler/admission-core/selection-query.ts +6 -4
  528. package/src/project-run/task-scheduler/admission-core/selection-seed.ts +36 -6
  529. package/src/project-run/task-scheduler/admission-core/selection-transition.ts +17 -8
  530. package/src/project-run/task-scheduler/execution-state.ts +4 -4
  531. package/src/project-run/task-scheduler/measurement/diagnostics.ts +10 -4
  532. package/src/project-run/task-scheduler/measurement/timing.ts +13 -5
  533. package/src/project-run/task-scheduler/scheduler-observation.ts +3 -1
  534. package/src/project-run/task-scheduler/scheduler-terminal-measurement.ts +24 -22
  535. package/src/project-run/task-scheduler/scheduler.ts +23 -6
  536. package/types/check/check.d.ts +178 -67
  537. package/types/check/flag-enablement.d.ts +42 -0
  538. package/types/check/handoff-provider-identity.d.ts +12 -0
  539. package/types/check/project-changes.d.ts +13 -0
  540. package/types/check/project-context.d.ts +10 -0
  541. package/types/check-settlement/facts.d.ts +1 -1
  542. package/types/data-boundary/canonical-data.d.ts +28 -5
  543. package/types/data-boundary/canonical-json.d.ts +18 -1
  544. package/types/data-boundary/closed-values.d.ts +17 -1
  545. package/types/data-boundary/config-glob.d.ts +5 -0
  546. package/types/data-boundary/project-path.d.ts +4 -0
  547. package/types/index.d.ts +27 -11
  548. package/types/package-checks/check-authoring.d.ts +45 -0
  549. package/types/package-checks/code-quality-findings/finding-waiver-authoring.d.ts +1 -1
  550. package/types/package-checks/code-quality-findings/finding-waiver-evidence.d.ts +1 -1
  551. package/types/package-checks/command-check/command-check.d.ts +48 -0
  552. package/types/package-checks/command-check/contract.d.ts +108 -0
  553. package/types/package-checks/command-check/execution.d.ts +7 -0
  554. package/types/package-checks/command-check/options.d.ts +11 -0
  555. package/types/package-checks/command-check/transcript.d.ts +8 -0
  556. package/types/package-checks/duplicate-detection/default-check.d.ts +5 -2
  557. package/types/package-checks/duplicate-detection/finding-messages.d.ts +1 -1
  558. package/types/package-checks/duplicate-detection/options.d.ts +4 -3
  559. package/types/package-checks/duplicate-detection/records.d.ts +1 -1
  560. package/types/package-checks/file-metrics/constructor.d.ts +5 -2
  561. package/types/package-checks/file-metrics/options.d.ts +4 -3
  562. package/types/package-checks/file-metrics/records.d.ts +1 -1
  563. package/types/package-checks/file-metrics/scc/batch-planner.d.ts +18 -0
  564. package/types/package-checks/file-metrics/scc/logical-scan-resources.d.ts +14 -0
  565. package/types/package-checks/function-metrics/analyzer/extensions/protocol.d.ts +3 -3
  566. package/types/package-checks/function-metrics/constructor.d.ts +5 -2
  567. package/types/package-checks/function-metrics/finding-messages.d.ts +1 -1
  568. package/types/package-checks/function-metrics/options.d.ts +4 -3
  569. package/types/package-checks/function-metrics/records.d.ts +1 -1
  570. package/types/package-checks/host-environment/git.d.ts +2 -0
  571. package/types/package-checks/host-environment/path.d.ts +1 -3
  572. package/types/package-checks/host-environment/process/contract.d.ts +17 -9
  573. package/types/package-checks/json-schema-validation/default-check.d.ts +4 -1
  574. package/types/package-checks/json-schema-validation/options.d.ts +2 -1
  575. package/types/package-checks/json-validation/default-check.d.ts +4 -1
  576. package/types/package-checks/json-validation/options.d.ts +2 -1
  577. package/types/package-checks/local-cache-options.d.ts +9 -0
  578. package/types/package-checks/maintenance-reminders/maintenance-reminders.d.ts +11 -2
  579. package/types/package-checks/markdown-link-validation/default-check.d.ts +4 -1
  580. package/types/package-checks/markdown-link-validation/options.d.ts +4 -7
  581. package/types/package-checks/markdown-lint/adapter.d.ts +10 -0
  582. package/types/package-checks/markdown-lint/default-check.d.ts +37 -0
  583. package/types/package-checks/markdown-lint/execution.d.ts +24 -0
  584. package/types/package-checks/markdown-lint/final-data.d.ts +8 -0
  585. package/types/package-checks/markdown-lint/finding-messages.d.ts +6 -0
  586. package/types/package-checks/markdown-lint/finding-waiver-identity.d.ts +3 -0
  587. package/types/package-checks/markdown-lint/findings-cache.d.ts +17 -0
  588. package/types/package-checks/markdown-lint/options-resolution.d.ts +3 -0
  589. package/types/package-checks/markdown-lint/options-validation.d.ts +2 -0
  590. package/types/package-checks/markdown-lint/options.d.ts +65 -0
  591. package/types/package-checks/markdown-lint/records.d.ts +39 -0
  592. package/types/package-checks/markdown-lint/unavailable-reasons.d.ts +3 -0
  593. package/types/package-checks/secret-detection/default-check.d.ts +4 -1
  594. package/types/package-checks/secret-detection/options.d.ts +3 -2
  595. package/types/package-tools/admission-policy/define-admission-policy.d.ts +26 -0
  596. package/types/{check → package-tools/finding-presentation}/finding-presentation.d.ts +3 -1
  597. package/types/{finding-waivers → package-tools/finding-waivers}/reconciliation.d.ts +3 -3
  598. package/types/{learned-critical-path → package-tools/learned-critical-path}/duration-model/prediction.d.ts +2 -2
  599. package/types/{learned-critical-path → package-tools/learned-critical-path}/duration-model/preparation.d.ts +1 -1
  600. package/types/{learned-critical-path → package-tools/learned-critical-path}/duration-model/recording.d.ts +1 -1
  601. package/types/{learned-critical-path → package-tools/learned-critical-path}/selection-layers.d.ts +1 -1
  602. package/types/{learned-critical-path → package-tools/learned-critical-path}/static-decision.d.ts +1 -1
  603. package/types/{learned-critical-path → package-tools/learned-critical-path}/strategy.d.ts +1 -1
  604. package/types/project-definition/check-tree/authoring.d.ts +5 -3
  605. package/types/project-definition/check-tree/check-fields-authoring.d.ts +12 -7
  606. package/types/project-definition/check-tree/flag-conditions.d.ts +5 -0
  607. package/types/project-definition/check-tree/resolution.d.ts +6 -4
  608. package/types/project-definition/declarative-snapshot.d.ts +4 -1
  609. package/types/project-definition/project-changes.d.ts +30 -0
  610. package/types/project-definition/project-definition.d.ts +15 -30
  611. package/types/project-definition/scheduler-policy.d.ts +3 -3
  612. package/types/project-run/admission-strategy-provider/prepared-admission-strategy.d.ts +2 -2
  613. package/types/project-run/aggregation.d.ts +8 -6
  614. package/types/project-run/changes/git.d.ts +14 -0
  615. package/types/project-run/check-execution/admitted-check-execution.d.ts +18 -0
  616. package/types/project-run/check-execution/dependencies.d.ts +3 -0
  617. package/types/project-run/check-execution/execution-finalization.d.ts +1 -1
  618. package/types/project-run/check-execution/execution-settlement.d.ts +15 -7
  619. package/types/project-run/check-execution/flag-controls.d.ts +1 -1
  620. package/types/project-run/check-execution/lifecycle.d.ts +9 -5
  621. package/types/project-run/check-execution/{preflight-result.d.ts → preparation-result.d.ts} +3 -3
  622. package/types/project-run/check-execution/{preflight.d.ts → preparation.d.ts} +10 -9
  623. package/types/project-run/check-execution/ready-check-execution.d.ts +18 -0
  624. package/types/project-run/check-execution/resolved-checks.d.ts +12 -13
  625. package/types/project-run/check-execution/scheduled-check-run.d.ts +10 -0
  626. package/types/project-run/check-execution/terminal-result.d.ts +13 -1
  627. package/types/project-run/completion/completion.d.ts +3 -1
  628. package/types/project-run/controls/contract.d.ts +6 -16
  629. package/types/project-run/invocation/candidates.d.ts +8 -0
  630. package/types/project-run/invocation/execution.d.ts +5 -0
  631. package/types/project-run/invocation/run.d.ts +2 -2
  632. package/types/project-run/outputs/status.d.ts +4 -4
  633. package/types/project-run/progress-rendering/presentation.d.ts +4 -3
  634. package/types/project-run/progress-rendering/renderer-formatting.d.ts +5 -2
  635. package/types/project-run/progress-rendering/renderer-lifecycle.d.ts +2 -0
  636. package/types/project-run/progress-rendering/renderer.d.ts +4 -2
  637. package/types/project-run/project-context.d.ts +3 -3
  638. package/types/project-run/result.d.ts +3 -3
  639. package/types/project-run/run.d.ts +1 -1
  640. package/types/project-run/task-scheduler/admission-core/compiled-graph-lookup.d.ts +10 -0
  641. package/types/project-run/task-scheduler/execution-state.d.ts +4 -4
  642. package/types/project-run/task-scheduler/measurement/diagnostics.d.ts +2 -2
  643. package/types/project-run/task-scheduler/scheduler-terminal-measurement.d.ts +1 -1
  644. package/dist/esm/cache/cache-json-by-key.mjs.map +0 -1
  645. package/dist/esm/check/finding-presentation.mjs.map +0 -1
  646. package/dist/esm/finding-waivers/reconciliation.mjs.map +0 -1
  647. package/dist/esm/learned-critical-path/duration-model/bounded-history.mjs.map +0 -1
  648. package/dist/esm/learned-critical-path/duration-model/prediction.mjs.map +0 -1
  649. package/dist/esm/learned-critical-path/duration-model/preparation.mjs.map +0 -1
  650. package/dist/esm/learned-critical-path/duration-model/recording.mjs.map +0 -1
  651. package/dist/esm/learned-critical-path/duration-model/storage.mjs.map +0 -1
  652. package/dist/esm/learned-critical-path/selection-layers.mjs.map +0 -1
  653. package/dist/esm/learned-critical-path/static-decision.mjs.map +0 -1
  654. package/dist/esm/learned-critical-path/strategy.mjs.map +0 -1
  655. package/dist/esm/package-checks/project-files/config-glob.mjs.map +0 -1
  656. package/dist/esm/project-run/check-execution/preflight-result.mjs.map +0 -1
  657. package/dist/esm/project-run/check-execution/preflight.mjs.map +0 -1
  658. package/dist/esm/project-run/task-scheduler/critical-path-ranking.mjs.map +0 -1
  659. package/types/package-checks/project-files/config-glob.d.ts +0 -5
  660. /package/dist/esm/{check → package-tools/finding-presentation}/finding-presentation.mjs +0 -0
  661. /package/dist/esm/{project-run/task-scheduler → package-tools/learned-critical-path}/critical-path-ranking.mjs +0 -0
  662. /package/dist/esm/{learned-critical-path → package-tools/learned-critical-path}/duration-model/bounded-history.mjs +0 -0
  663. /package/dist/esm/{learned-critical-path → package-tools/learned-critical-path}/duration-model/recording.mjs +0 -0
  664. /package/dist/esm/{learned-critical-path → package-tools/learned-critical-path}/static-decision.mjs +0 -0
  665. /package/src/{project-run/task-scheduler → package-tools/learned-critical-path}/critical-path-ranking.ts +0 -0
  666. /package/src/{learned-critical-path → package-tools/learned-critical-path}/duration-model/bounded-history.ts +0 -0
  667. /package/types/{cache → package-tools/cache}/cache-json-by-key.d.ts +0 -0
  668. /package/types/{project-run/task-scheduler → package-tools/learned-critical-path}/critical-path-ranking.d.ts +0 -0
  669. /package/types/{learned-critical-path → package-tools/learned-critical-path}/duration-model/bounded-history.d.ts +0 -0
  670. /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
- const SCC_SCAN_TIMEOUT_MS = 300_000;
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 scanArguments = buildSccArgs(includePaths);
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 commandResult = runProcessSync({
28
- args: scanArguments,
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
- if (commandResult.error) {
35
- return {
36
- ok: false,
37
- error: `scc process error: ${commandResult.error.message}`,
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 parseSccCSV(commandResult.stdout || "", cwd);
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 buildSccArgs(includePaths: readonly string[]): string[] {
67
- return [...SCC_BY_FILE_ARGUMENTS, ...includePaths];
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 lineDifference = left[index].line - right[index].line;
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(left[index].token, right[index].token);
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.flatMap((item) => (item.caption ? [item.caption] : [])).join("");
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 (!item.caption) continue;
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.flatMap((item) => (item.avg_caption ? [item.avg_caption] : [])).join("");
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 (!item.avg_caption) return [];
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
- if (context.current_function.complex_tags === undefined) {
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) reader.context.currentFunction.forgivenMetrics.add(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) => this._state_dec(currentToken), token);
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) => this._state_entering_imp(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) => this._state_entering_imp(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
- this.function_name = this.assignments.at(-1) || "(anonymous)";
144
- if (this.assignments.at(-1)) this.assignments.pop();
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 (this.in_class && this.class_name && !this.is_function_declaration) {
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) yield 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) yield 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
- if (this.nested_br_level === undefined) this.nested_br_level = 0;
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
- if (this.nested_br_level === undefined) this.nested_br_level = 0;
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 (!next.done) {
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 (!next.done) {
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 (!next.done) {
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(""));