@holmes-lab/holmes-kit 0.39.0 → 0.40.1

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 (325) hide show
  1. package/CHANGELOG.md +578 -6
  2. package/README.md +120 -41
  3. package/dist/.build-id +1 -1
  4. package/dist/holmes/admission/core/admission-policy.d.ts +37 -0
  5. package/dist/holmes/admission/core/admission-policy.js +147 -0
  6. package/dist/holmes/admission/core/bounded-reader.d.ts +56 -0
  7. package/dist/holmes/admission/core/bounded-reader.js +135 -0
  8. package/dist/holmes/admission/core/change-classifier.d.ts +34 -0
  9. package/dist/holmes/admission/core/change-classifier.js +278 -0
  10. package/dist/holmes/admission/core/config-loader.d.ts +30 -0
  11. package/dist/holmes/admission/core/config-loader.js +145 -0
  12. package/dist/holmes/admission/core/event-judgement.d.ts +37 -0
  13. package/dist/holmes/admission/core/event-judgement.js +251 -0
  14. package/dist/holmes/admission/core/path-rules.d.ts +35 -0
  15. package/dist/holmes/admission/core/path-rules.js +88 -0
  16. package/dist/holmes/admission/core/pin.d.ts +7 -0
  17. package/dist/holmes/admission/core/pin.js +29 -0
  18. package/dist/holmes/admission/core/ports.d.ts +48 -0
  19. package/dist/holmes/admission/core/ports.js +11 -0
  20. package/dist/holmes/admission/core/range-resolver.d.ts +32 -0
  21. package/dist/holmes/admission/core/range-resolver.js +51 -0
  22. package/dist/holmes/admission/core/self-containment.d.ts +1 -0
  23. package/dist/holmes/admission/core/self-containment.js +125 -0
  24. package/dist/holmes/admission/core/signature-source.d.ts +9 -0
  25. package/dist/holmes/admission/core/signature-source.js +4 -0
  26. package/dist/holmes/admission/core/transition-planner.d.ts +15 -0
  27. package/dist/holmes/admission/core/transition-planner.js +14 -0
  28. package/dist/holmes/admission/core/verdict.d.ts +38 -0
  29. package/dist/holmes/admission/core/verdict.js +17 -0
  30. package/dist/holmes/admission/core/wiring.d.ts +44 -0
  31. package/dist/holmes/admission/core/wiring.js +618 -0
  32. package/dist/holmes/admission/forge/git-object-port.d.ts +4 -0
  33. package/dist/holmes/admission/forge/git-object-port.js +132 -0
  34. package/dist/holmes/assoc/assoc-arm.d.ts +1 -1
  35. package/dist/holmes/assoc/assoc-arm.js +1 -1
  36. package/dist/holmes/cli/agents.d.ts +8 -0
  37. package/dist/holmes/cli/agents.js +9 -5
  38. package/dist/holmes/cli/approve-cli.d.ts +2 -0
  39. package/dist/holmes/cli/approve-cli.js +392 -0
  40. package/dist/holmes/cli/approve-ref.d.ts +13 -7
  41. package/dist/holmes/cli/approve-ref.js +30 -10
  42. package/dist/holmes/cli/approve-status.d.ts +26 -2
  43. package/dist/holmes/cli/approve-status.js +98 -18
  44. package/dist/holmes/cli/approve-watch.d.ts +5 -0
  45. package/dist/holmes/cli/approve-watch.js +10 -5
  46. package/dist/holmes/cli/approve.d.ts +49 -13
  47. package/dist/holmes/cli/approve.js +249 -67
  48. package/dist/holmes/cli/attest.js +2 -1
  49. package/dist/holmes/cli/autonomy.d.ts +4 -1
  50. package/dist/holmes/cli/autonomy.js +17 -10
  51. package/dist/holmes/cli/codex-oracle.d.ts +11 -0
  52. package/dist/holmes/cli/codex-oracle.js +5 -1
  53. package/dist/holmes/cli/codex-toml.d.ts +10 -0
  54. package/dist/holmes/cli/codex-toml.js +36 -2
  55. package/dist/holmes/cli/doctor-boundary.d.ts +76 -0
  56. package/dist/holmes/cli/doctor-boundary.js +308 -0
  57. package/dist/holmes/cli/doctor-locks.d.ts +15 -0
  58. package/dist/holmes/cli/doctor-locks.js +119 -0
  59. package/dist/holmes/cli/doctor.d.ts +2 -0
  60. package/dist/holmes/cli/doctor.js +34 -5
  61. package/dist/holmes/cli/flags.d.ts +23 -0
  62. package/dist/holmes/cli/flags.js +89 -0
  63. package/dist/holmes/cli/index.d.ts +5 -1
  64. package/dist/holmes/cli/index.js +226 -442
  65. package/dist/holmes/cli/init.js +33 -0
  66. package/dist/holmes/cli/interactive-prompt.d.ts +39 -2
  67. package/dist/holmes/cli/interactive-prompt.js +98 -16
  68. package/dist/holmes/cli/lock-recover.d.ts +5 -0
  69. package/dist/holmes/cli/lock-recover.js +126 -0
  70. package/dist/holmes/cli/mcp-processes.js +1 -1
  71. package/dist/holmes/cli/release-docs.js +1 -1
  72. package/dist/holmes/cli/run-exec.d.ts +141 -0
  73. package/dist/holmes/cli/run-exec.js +1435 -0
  74. package/dist/holmes/cli/run-provision.d.ts +3 -1
  75. package/dist/holmes/cli/run-provision.js +255 -44
  76. package/dist/holmes/cli/run-wiring.d.ts +69 -0
  77. package/dist/holmes/cli/run-wiring.js +270 -0
  78. package/dist/holmes/cli/run.d.ts +21 -0
  79. package/dist/holmes/cli/run.js +341 -92
  80. package/dist/holmes/cli/runtime-binding-approval.js +32 -19
  81. package/dist/holmes/cli/screen-safe.d.ts +3 -92
  82. package/dist/holmes/cli/screen-safe.js +18 -756
  83. package/dist/holmes/config/config.d.ts +19 -0
  84. package/dist/holmes/config/config.js +18 -3
  85. package/dist/holmes/cpg/foundation/language-matrix.js +2 -2
  86. package/dist/holmes/cpg/import-resolver.js +1 -1
  87. package/dist/holmes/governance/approval-decisions.d.ts +47 -0
  88. package/dist/holmes/governance/approval-decisions.js +29 -0
  89. package/dist/holmes/governance/approval-grants.d.ts +220 -1
  90. package/dist/holmes/governance/approval-grants.js +612 -33
  91. package/dist/holmes/governance/approval-queue.d.ts +26 -0
  92. package/dist/holmes/governance/approval-queue.js +109 -11
  93. package/dist/holmes/governance/approval-spend.d.ts +95 -0
  94. package/dist/holmes/governance/approval-spend.js +191 -0
  95. package/dist/holmes/governance/autonomous-shell.d.ts +61 -0
  96. package/dist/holmes/governance/autonomous-shell.js +332 -0
  97. package/dist/holmes/governance/autonomy.d.ts +12 -0
  98. package/dist/holmes/governance/autonomy.js +51 -15
  99. package/dist/holmes/governance/constitution.d.ts +5 -0
  100. package/dist/holmes/governance/constitution.js +32 -12
  101. package/dist/holmes/governance/full-autonomy.d.ts +10 -0
  102. package/dist/holmes/governance/full-autonomy.js +103 -7
  103. package/dist/holmes/governance/harness-catalog.d.ts +103 -0
  104. package/dist/holmes/governance/harness-catalog.js +348 -0
  105. package/dist/holmes/governance/human-channel.d.ts +38 -0
  106. package/dist/holmes/governance/human-channel.js +49 -0
  107. package/dist/holmes/governance/install-manifest.d.ts +22 -0
  108. package/dist/holmes/governance/install-manifest.js +160 -0
  109. package/dist/holmes/governance/ledger-rechain.js +2 -0
  110. package/dist/holmes/governance/ledger-store.conformance.d.ts +7 -1
  111. package/dist/holmes/governance/ledger-store.conformance.js +66 -0
  112. package/dist/holmes/governance/ledger-store.d.ts +88 -11
  113. package/dist/holmes/governance/ledger-store.js +186 -8
  114. package/dist/holmes/governance/provenance-chain.d.ts +16 -4
  115. package/dist/holmes/governance/provenance-chain.js +19 -4
  116. package/dist/holmes/governance/provenance-ledger.d.ts +6 -3
  117. package/dist/holmes/governance/provenance-ledger.js +53 -18
  118. package/dist/holmes/governance/push-gate-runner.d.ts +2 -0
  119. package/dist/holmes/governance/push-gate-runner.js +50 -9
  120. package/dist/holmes/governance/push-gate.d.ts +13 -2
  121. package/dist/holmes/governance/push-gate.js +106 -14
  122. package/dist/holmes/governance/recorded-pairs.d.ts +96 -0
  123. package/dist/holmes/governance/recorded-pairs.js +522 -0
  124. package/dist/holmes/governance/replica-id.d.ts +1 -1
  125. package/dist/holmes/governance/replica-id.js +1 -1
  126. package/dist/holmes/governance/spec-seam.d.ts +59 -0
  127. package/dist/holmes/governance/spec-seam.js +587 -0
  128. package/dist/holmes/governance/spend-kinds.d.ts +16 -0
  129. package/dist/holmes/governance/spend-kinds.js +18 -0
  130. package/dist/holmes/guardrail/advisory-line.d.ts +102 -0
  131. package/dist/holmes/guardrail/advisory-line.js +718 -0
  132. package/dist/holmes/guardrail/decision-ledger.d.ts +2 -1
  133. package/dist/holmes/guardrail/decision-ledger.js +2 -1
  134. package/dist/holmes/guardrail/impact-gate.d.ts +7 -0
  135. package/dist/holmes/guardrail/impact-gate.js +33 -6
  136. package/dist/holmes/guardrail/line-continuation.d.ts +8 -0
  137. package/dist/holmes/guardrail/line-continuation.js +39 -0
  138. package/dist/holmes/guardrail/operator-person.d.ts +28 -4
  139. package/dist/holmes/guardrail/operator-person.js +57 -11
  140. package/dist/holmes/guardrail/refusal-codes.d.ts +8 -3
  141. package/dist/holmes/guardrail/refusal-codes.js +64 -10
  142. package/dist/holmes/guardrail/risk-classifier.d.ts +15 -9
  143. package/dist/holmes/guardrail/risk-classifier.js +228 -16
  144. package/dist/holmes/guardrail/risk-gate.d.ts +2 -8
  145. package/dist/holmes/guardrail/risk-gate.js +7 -34
  146. package/dist/holmes/guardrail/risk-types.d.ts +10 -0
  147. package/dist/holmes/guardrail/run-plan-scope.js +3 -1
  148. package/dist/holmes/guardrail/run-refusals.js +24 -8
  149. package/dist/holmes/guardrail/run-stages.d.ts +5 -0
  150. package/dist/holmes/guardrail/run-stages.js +25 -5
  151. package/dist/holmes/guardrail/scope-judgment.js +1 -1
  152. package/dist/holmes/guardrail/shell-words.js +24 -3
  153. package/dist/holmes/guardrail/unresolved-write.d.ts +40 -0
  154. package/dist/holmes/guardrail/unresolved-write.js +556 -0
  155. package/dist/holmes/guardrail/write-target.d.ts +3 -0
  156. package/dist/holmes/guardrail/write-target.js +26 -5
  157. package/dist/holmes/hooks/pre-tool-use.d.ts +116 -1
  158. package/dist/holmes/hooks/pre-tool-use.js +1176 -170
  159. package/dist/holmes/hooks/rtm-refresh-child.d.ts +1 -1
  160. package/dist/holmes/hooks/rtm-refresh-child.js +1 -1
  161. package/dist/holmes/hooks/session-start.js +17 -1
  162. package/dist/holmes/hooks/stop.d.ts +23 -0
  163. package/dist/holmes/hooks/stop.js +86 -33
  164. package/dist/holmes/mcp/approval-adapters.js +3 -1
  165. package/dist/holmes/mcp/approval-commit.js +3 -2
  166. package/dist/holmes/mcp/approval-policy.d.ts +2 -1
  167. package/dist/holmes/mcp/approval-policy.js +3 -1
  168. package/dist/holmes/mcp/handlers/adoption.d.ts +1 -1
  169. package/dist/holmes/mcp/handlers/approval-ask.d.ts +3 -0
  170. package/dist/holmes/mcp/handlers/approval-ask.js +18 -7
  171. package/dist/holmes/mcp/handlers/entity-integration.d.ts +3 -3
  172. package/dist/holmes/mcp/handlers/entity-integration.js +29 -11
  173. package/dist/holmes/mcp/handlers/entity-renumber.d.ts +4 -4
  174. package/dist/holmes/mcp/handlers/entity-renumber.js +29 -11
  175. package/dist/holmes/mcp/handlers/entity-store.d.ts +2 -2
  176. package/dist/holmes/mcp/handlers/entity-store.js +133 -59
  177. package/dist/holmes/mcp/handlers/maintenance-analysis.d.ts +13 -0
  178. package/dist/holmes/mcp/handlers/maintenance-analysis.js +59 -2
  179. package/dist/holmes/mcp/handlers/operator-inspection.d.ts +9 -5
  180. package/dist/holmes/mcp/handlers/operator-inspection.js +79 -16
  181. package/dist/holmes/mcp/handlers/phase-queries.d.ts +1 -1
  182. package/dist/holmes/mcp/handlers/requirement-triage.d.ts +4 -4
  183. package/dist/holmes/mcp/handlers/review-evidence.d.ts +2 -2
  184. package/dist/holmes/mcp/handlers/review-evidence.js +35 -11
  185. package/dist/holmes/mcp/handlers/review-queries.d.ts +5 -0
  186. package/dist/holmes/mcp/handlers/review-queries.js +8 -1
  187. package/dist/holmes/mcp/handlers/review-verdict.d.ts +3 -0
  188. package/dist/holmes/mcp/handlers/review-verdict.js +10 -3
  189. package/dist/holmes/mcp/handlers/risk-assessment.d.ts +7 -2
  190. package/dist/holmes/mcp/handlers/risk-assessment.js +34 -12
  191. package/dist/holmes/mcp/handlers/runtime-binding-tool.d.ts +2 -2
  192. package/dist/holmes/mcp/handlers/slice-orchestration.d.ts +6 -1
  193. package/dist/holmes/mcp/handlers/slice-orchestration.js +14 -1
  194. package/dist/holmes/mcp/handlers/spec-approval.d.ts +15 -3
  195. package/dist/holmes/mcp/handlers/spec-approval.js +32 -5
  196. package/dist/holmes/mcp/handlers/spec-authoring.d.ts +2 -2
  197. package/dist/holmes/mcp/handlers/spec-authoring.js +19 -2
  198. package/dist/holmes/mcp/handlers/spec-lifecycle.d.ts +11 -38
  199. package/dist/holmes/mcp/handlers/spec-lifecycle.js +441 -94
  200. package/dist/holmes/mcp/handlers/spec-queries.d.ts +2 -2
  201. package/dist/holmes/mcp/handlers/taint-screening.d.ts +1 -1
  202. package/dist/holmes/mcp/handlers/taint-screening.js +2 -2
  203. package/dist/holmes/mcp/handlers/test-execution.d.ts +471 -4
  204. package/dist/holmes/mcp/handlers/test-execution.js +199 -21
  205. package/dist/holmes/mcp/handlers/workspace-queries.d.ts +2 -2
  206. package/dist/holmes/mcp/handlers.d.ts +557 -82
  207. package/dist/holmes/mcp/handlers.js +74 -23
  208. package/dist/holmes/mcp/harness-attestation.d.ts +78 -5
  209. package/dist/holmes/mcp/harness-attestation.js +325 -53
  210. package/dist/holmes/mcp/maintenance-analyze.d.ts +6 -1
  211. package/dist/holmes/mcp/maintenance-analyze.js +13 -11
  212. package/dist/holmes/mcp/maintenance-evidence.d.ts +9 -0
  213. package/dist/holmes/mcp/maintenance-evidence.js +35 -3
  214. package/dist/holmes/mcp/requirement-triage-evidence.js +22 -13
  215. package/dist/holmes/mcp/server-staleness.js +1 -1
  216. package/dist/holmes/mcp/server.js +9 -8
  217. package/dist/holmes/mcp/spec-id-guard.js +1 -1
  218. package/dist/holmes/mcp/tool-schemas.d.ts +13 -0
  219. package/dist/holmes/mcp/tool-schemas.js +42 -9
  220. package/dist/holmes/project/act-root.d.ts +19 -0
  221. package/dist/holmes/project/act-root.js +100 -0
  222. package/dist/holmes/project/baseline.d.ts +15 -2
  223. package/dist/holmes/project/baseline.js +14 -8
  224. package/dist/holmes/project/bounded-group.d.ts +47 -0
  225. package/dist/holmes/project/bounded-group.js +140 -0
  226. package/dist/holmes/project/bounded-io.d.ts +51 -2
  227. package/dist/holmes/project/bounded-io.js +140 -6
  228. package/dist/holmes/project/change-source.d.ts +4 -0
  229. package/dist/holmes/project/change-source.js +14 -6
  230. package/dist/holmes/project/instance-id.d.ts +10 -0
  231. package/dist/holmes/project/instance-id.js +233 -0
  232. package/dist/holmes/project/machine-identity.d.ts +25 -0
  233. package/dist/holmes/project/machine-identity.js +133 -0
  234. package/dist/holmes/project/owned-lock.d.ts +84 -0
  235. package/dist/holmes/project/owned-lock.js +263 -0
  236. package/dist/holmes/project/plain-lock-fs.d.ts +2 -0
  237. package/dist/holmes/project/plain-lock-fs.js +126 -0
  238. package/dist/holmes/project/request-lock.d.ts +85 -0
  239. package/dist/holmes/project/request-lock.js +459 -0
  240. package/dist/holmes/project/root.d.ts +12 -4
  241. package/dist/holmes/project/root.js +29 -8
  242. package/dist/holmes/project/run-records.d.ts +19 -0
  243. package/dist/holmes/project/run-records.js +94 -12
  244. package/dist/holmes/project/screen-text.d.ts +94 -0
  245. package/dist/holmes/project/screen-text.js +763 -0
  246. package/dist/holmes/project/spend-lock.d.ts +82 -0
  247. package/dist/holmes/project/spend-lock.js +413 -0
  248. package/dist/holmes/refresh/freshness-coordinator.d.ts +1 -1
  249. package/dist/holmes/refresh/freshness-coordinator.js +1 -1
  250. package/dist/holmes/review/condition-hunk-replay.js +4 -2
  251. package/dist/holmes/review/confidence-calibration.d.ts +1 -1
  252. package/dist/holmes/review/confidence-calibration.js +1 -1
  253. package/dist/holmes/review/content-verify.js +1 -1
  254. package/dist/holmes/review/evidence-mode.d.ts +21 -0
  255. package/dist/holmes/review/evidence-mode.js +33 -0
  256. package/dist/holmes/review/head-worktree.d.ts +55 -0
  257. package/dist/holmes/review/head-worktree.js +329 -0
  258. package/dist/holmes/review/hop-ablation.d.ts +4 -4
  259. package/dist/holmes/review/hop-ablation.js +5 -5
  260. package/dist/holmes/review/mrp.js +13 -3
  261. package/dist/holmes/review/point-in-time-replay.js +12 -3
  262. package/dist/holmes/review/rank-diagnosis.d.ts +2 -2
  263. package/dist/holmes/review/rank-diagnosis.js +1 -1
  264. package/dist/holmes/review/replay-corpus.d.ts +10 -4
  265. package/dist/holmes/review/replay-corpus.js +25 -9
  266. package/dist/holmes/review/requirement-triage.js +2 -2
  267. package/dist/holmes/review/run-provenance.d.ts +45 -0
  268. package/dist/holmes/review/run-provenance.js +314 -0
  269. package/dist/holmes/review/semantic-arm.d.ts +3 -3
  270. package/dist/holmes/review/semantic-arm.js +3 -3
  271. package/dist/holmes/review/test-evidence.d.ts +174 -0
  272. package/dist/holmes/review/test-evidence.js +330 -2
  273. package/dist/holmes/review/test-outcomes.js +3 -1
  274. package/dist/holmes/review/test-reports.d.ts +94 -0
  275. package/dist/holmes/review/test-reports.js +382 -0
  276. package/dist/holmes/review/test-runner.d.ts +180 -58
  277. package/dist/holmes/review/test-runner.js +560 -324
  278. package/dist/holmes/review/test-selection-breadth.js +2 -2
  279. package/dist/holmes/review/test-units.d.ts +159 -0
  280. package/dist/holmes/review/test-units.js +814 -0
  281. package/dist/holmes/review/verdicts.d.ts +105 -8
  282. package/dist/holmes/review/verdicts.js +640 -36
  283. package/dist/holmes/rtm/anchor-census.d.ts +9 -0
  284. package/dist/holmes/rtm/anchor-census.js +151 -0
  285. package/dist/holmes/rtm/anchor-ids.d.ts +25 -1
  286. package/dist/holmes/rtm/anchor-ids.js +45 -2
  287. package/dist/holmes/rtm/comment-ranges.d.ts +2 -0
  288. package/dist/holmes/rtm/comment-ranges.js +104 -0
  289. package/dist/holmes/rtm/counted-tests.d.ts +1 -0
  290. package/dist/holmes/rtm/counted-tests.js +63 -0
  291. package/dist/holmes/rtm/impact-advisory.d.ts +1 -1
  292. package/dist/holmes/rtm/known-defects.js +1 -1
  293. package/dist/holmes/rtm/localize.js +1 -1
  294. package/dist/holmes/rtm/taint-benchmark.d.ts +1 -1
  295. package/dist/holmes/rtm/taint-vocabulary.d.ts +1 -1
  296. package/dist/holmes/rtm/test-scope.d.ts +31 -0
  297. package/dist/holmes/rtm/test-scope.js +166 -5
  298. package/dist/holmes/rtm/trace-gaps.js +1 -1
  299. package/dist/holmes/runtime/dispatch.d.ts +10 -0
  300. package/dist/holmes/runtime/dispatch.js +12 -1
  301. package/dist/holmes/semantic/cloud-usage.d.ts +1 -1
  302. package/dist/holmes/semantic/cloud-usage.js +1 -1
  303. package/dist/holmes/semantic/unreadable-paths.d.ts +1 -1
  304. package/dist/holmes/semantic/unreadable-paths.js +1 -1
  305. package/dist/holmes/spec/approval-blockers.js +1 -1
  306. package/dist/holmes/spec/entity-store.d.ts +6 -1
  307. package/dist/holmes/spec/entity-store.js +16 -2
  308. package/dist/holmes/spec/entity-transaction.d.ts +7 -2
  309. package/dist/holmes/spec/entity-transaction.js +87 -170
  310. package/dist/holmes/spec/spec-store.d.ts +12 -6
  311. package/dist/holmes/spec/spec-store.js +4 -2
  312. package/dist/holmes/spec/spec-types.js +1 -1
  313. package/dist/holmes/spec/succession-guard.d.ts +56 -0
  314. package/dist/holmes/spec/succession-guard.js +187 -0
  315. package/dist/holmes/spec/succession.d.ts +70 -0
  316. package/dist/holmes/spec/succession.js +171 -0
  317. package/dist/holmes/spec/transition-policy.d.ts +2 -2
  318. package/docs/install-guide.md +9 -3
  319. package/docs/language-support.md +78 -0
  320. package/package.json +4 -3
  321. package/playbooks/author-slice/PLAYBOOK.md +1 -1
  322. package/playbooks/promote-slice/PLAYBOOK.md +5 -1
  323. package/playbooks/publish/PLAYBOOK.md +47 -34
  324. package/dist/holmes/review/manual-baseline.d.ts +0 -209
  325. package/dist/holmes/review/manual-baseline.js +0 -2847
@@ -1,10 +1,17 @@
1
+ import { type ExecFileSyncOptionsWithStringEncoding } from 'node:child_process';
1
2
  import { RegressionTier, TestScope } from '../rtm/test-scope';
3
+ import type { NotDetected, NotRun } from './test-evidence';
4
+ import { type CodeRoot, type Ecosystem, type ScanOptions, type TestUnit } from './test-units';
5
+ import { type TestOutcome } from './test-reports';
2
6
  /**
3
7
  * @implements A-SPEC-734 (round 13) — every runner child is bounded, and a tool probe is short. One passing jest
4
8
  * test that left a `setInterval` open never returned, and the synchronous MCP call wedged the server (measured).
5
9
  * A run stopped at the bound is red and says so — never green.
6
10
  */
7
11
  export declare const RUNNER_TIMEOUT_MS: number;
12
+ export declare function runBounded(cmd: string, args: string[], opts: ExecFileSyncOptionsWithStringEncoding, timeoutMs?: number): string;
13
+ /** @implements A-SPEC-734.4 — the last stop note (tests read it). */
14
+ export declare function runnerStopNote(): string | null;
8
15
  /**
9
16
  * Operational wiring for the intelligent test-scope (target-arch §5): turn a TestScope decision into
10
17
  * an actual test run. The PLAN is pure/deterministic (testable); the EXECUTE half shells out to jest.
@@ -36,8 +43,59 @@ export interface TestRunResult {
36
43
  * than it claims, and the caller must be able to see that.
37
44
  */
38
45
  unsupported?: string[];
46
+ /**
47
+ * @implements A-SPEC-466.2 — the worker count placed on the jest argv; null when no worker flag reached jest (no
48
+ * count given, or no jest group ran). Absent only on results built before 466.2.
49
+ */
50
+ workers?: number | null;
51
+ /** @implements A-SPEC-466.3 — the runners that ran and took no worker count, when one was given (jest only takes it). */
52
+ workersIgnoredBy?: string[];
39
53
  /** Which adapters actually ran, for evidence provenance. */
40
54
  ranWith?: string[];
55
+ /**
56
+ * @implements A-SPEC-128.5 — the tests the runners executed, summed over ecosystems, whatever their attribution to files
57
+ * or A-SPECs (a full go or cargo run credits no file; an unanchored test credits no A-SPEC). The push gate reads this.
58
+ */
59
+ testsRun?: number;
60
+ /** @implements A-SPEC-128.5 — a runner child was stopped at the budget: the run is not judged. */
61
+ stopped?: boolean;
62
+ /** @implements A-SPEC-128.6 — the tests executed per ecosystem. */
63
+ testsRunBy?: Record<string, number>;
64
+ /** @implements A-SPEC-128.5 — the ecosystems a full plan found in the project; a full run must run every one. */
65
+ detected?: string[];
66
+ /** @implements A-SPEC-128.7 — per detected ecosystem, the root-relative path of the shallowest file that named it. */
67
+ detectedBy?: Record<string, string>;
68
+ /** @implements A-SPEC-128.7 — the ecosystems whose runner was red or stopped. */
69
+ failedBy?: string[];
70
+ /** @implements A-SPEC-128.7 — I1: impacted test files of an ecosystem a full run does not run, named instead. */
71
+ notRun?: NotRun[];
72
+ /** @implements A-SPEC-128.7 — build files outside the detection range, named and not run. */
73
+ notDetected?: NotDetected[];
74
+ /** @implements A-SPEC-128.9 — what each execution unit ran; every unit must run at least one test. */
75
+ units?: UnitResult[];
76
+ /** @implements A-SPEC-128.9 — units that failed because their runner is missing (E4 environment). */
77
+ environment?: Array<{
78
+ ecosystem: string;
79
+ dir: string;
80
+ reason: string;
81
+ }>;
82
+ /** @implements A-SPEC-128.9 — implementation sources outside tests and exclusions (E2). */
83
+ implementationCount?: number;
84
+ implementationSample?: string[];
85
+ /** @implements A-SPEC-128.9 — test-named python files holding no test function (A L3). */
86
+ notTests?: string[];
87
+ /** @implements A-SPEC-128.13 — the test files the scan found (E2: "nothing to test" needs none). */
88
+ testFileCount?: number;
89
+ /** @implements A-SPEC-128.13 — T4: _test.go files go does not build on this platform with no tags (named, not refused). */
90
+ notBuilt?: string[];
91
+ /** @implements A-SPEC-128.10 — I3: detected test files the runners did not report. */
92
+ notExecuted?: string[];
93
+ /** @implements A-SPEC-128.10 — R2: build roots whose code saw no executed test. */
94
+ untestedCode?: Array<{
95
+ root: string;
96
+ sample: string[];
97
+ missingBuildFile?: string;
98
+ }>;
41
99
  /**
42
100
  * @implements A-SPEC-534.5
43
101
  * Per-file RED-first outcome (jest only). red-assertion | red-error | green, for the outcome ledger
@@ -45,51 +103,12 @@ export interface TestRunResult {
45
103
  */
46
104
  outcomeByFile?: Record<string, TestOutcome>;
47
105
  }
48
- export type Ecosystem = 'jest' | 'pytest' | 'go' | 'rust' | 'java' | 'dotnet';
106
+ export type { Ecosystem, TestUnit, EcosystemScan, ScanOptions, CodeRoot } from './test-units';
107
+ export { scanEcosystems, excludedDir, normaliseExcludeDirs, BUILD_ROOTS, pytestRules, projectFiles } from './test-units';
49
108
  /** Ecosystem of a test file, by extension/convention. `null` when no runner adapter exists for it. */
50
109
  export declare function ecosystemOf(file: string): Ecosystem | null;
51
- /**
52
- * @implements A-SPEC-137.1
53
- * Executed-test counts per Go package from `go test -json` output. A test is EXECUTED when a NAMED
54
- * test (`Test` present) reaches `Action: 'pass'` or `'fail'` — a skip does not count (matching the
55
- * jest/pytest rule), and a package-level result (no `Test`) is not a test case. Non-JSON lines (go
56
- * interleaves build output) are ignored. Pure; empty/garbage input yields `{}` rather than throwing.
57
- */
58
- export declare function parseGoTestJson(out: string): Record<string, number>;
59
- /**
60
- * Parse jest --json output into per-file EXECUTED case counts. This is the execution-proof upgrade
61
- * over the syntactic countTestCases lower bound: a case only appears here if jest actually ran it
62
- * (pending/skipped assertions are excluded), so `if(false){it(…)}`, aliasing, and other syntactic
63
- * fabrications cannot produce evidence. Returns {} for unparseable output (caller falls back).
64
- */
65
- export declare function parseExecutedCounts(stdout: string, cwd: string): Record<string, number>;
66
- /**
67
- * Per-file test outcome for RED-first evidence (REQ-534). `red-assertion` is a REAL red — a case ran
68
- * and its assertion failed; `red-error` is a file that could not run its cases (load/collection/import
69
- * error), which ART-8 (534.2) must NOT accept as a valid RED; `green` ran and all assertions passed.
70
- */
71
- export type TestOutcome = 'red-assertion' | 'red-error' | 'green';
72
- /**
73
- * @implements A-SPEC-534.1
74
- * Classify each jest-executed file into red-assertion | red-error | green from `jest --json` stdout.
75
- * Pure; unparseable/empty input → {} (same fail-soft convention as parseExecutedCounts).
76
- *
77
- * A failed assertion anywhere in a file wins (`red-assertion`) — that is a real red. A file that ran
78
- * NO assertions but errored (testExecError, or status 'failed' with an empty assertion list — a
79
- * load/collection/import failure) is `red-error`, which ART-8 must not accept as a valid RED. A file
80
- * that executed ≥1 assertion with none failing is `green`. A file that only pended/skipped carries no
81
- * evidence and is omitted entirely.
82
- */
83
- export declare function classifyJestOutcomes(stdout: string, cwd: string): Record<string, TestOutcome>;
84
- /**
85
- * Parse pytest's built-in JUnit XML into per-file EXECUTED case counts — the pytest analogue of
86
- * parseExecutedCounts. `--junit-xml` ships with pytest core, so this needs no plugin, and it is the
87
- * only pytest output that is both machine-readable and per-file.
88
- *
89
- * A `<testcase>` counts as executed unless it carries `<skipped>`, matching the jest rule where
90
- * pending/skipped assertions are excluded. Errors and failures DO count: they executed.
91
- */
92
- export declare function parseJUnitXmlCounts(xml: string, ext?: string): Record<string, number>;
110
+ export { parseGoTestJson, goPackagesWithTestEvents, parseExecutedCounts, classifyJestOutcomes, parseJUnitXmlCounts, parseJUnitXmlOutcomes, parseJUnitXmlFiles, wellShapedJson, readJestReport } from './test-reports';
111
+ export type { TestOutcome } from './test-reports';
93
112
  /**
94
113
  * @implements A-SPEC-466 — W-4. The TARGET repo's own jest entry, as its package declares it.
95
114
  *
@@ -105,35 +124,68 @@ export declare function parseJUnitXmlCounts(xml: string, ext?: string): Record<s
105
124
  * there), and a repo with no local jest could never yield meaningful suite evidence anyway.
106
125
  */
107
126
  export declare function jestEntry(cwd: string): string | null;
127
+ /** @implements A-SPEC-466.1 — what a run may be told beyond its scope. Only the jest adapter reads it. */
128
+ export interface TestRunOptions {
129
+ workers?: number;
130
+ timeoutMinutes?: number;
131
+ /** @implements A-SPEC-128.6 — the trees detection never walks, injected by the caller from ax.config.json. */
132
+ excludeDirs?: string[];
133
+ /** @implements A-SPEC-128.9 — the project's ignore matcher (root-relative), injected by the caller. */
134
+ isIgnored?: (relPath: string) => boolean;
135
+ /** @implements A-SPEC-128.13 — the work tree a HEAD worktree run came from: pytest's interpreter (a .venv) is found there. */
136
+ sourceRoot?: string;
137
+ }
138
+ /** @implements A-SPEC-128.9 — one unit's outcome in a full run. */
139
+ export interface UnitResult {
140
+ ecosystem: string;
141
+ dir: string;
142
+ testsRun: number;
143
+ passed: boolean;
144
+ environment?: string;
145
+ }
146
+ /**
147
+ * @implements A-SPEC-466.6 — test_run's `timeoutMinutes`, the run's time budget: absent or null is 30; an integer
148
+ * 1..180 is kept; anything else throws (never clamped). It is not a judgement input.
149
+ */
150
+ export declare function testRunTimeoutMinutes(value: unknown): number;
151
+ /**
152
+ * @implements A-SPEC-466.1 — test_run's `workers`: absent stays absent; an integer 1..64 is kept; anything else
153
+ * throws, so a bad count is refused before any change set is derived or any runner starts.
154
+ */
155
+ export declare function testRunWorkers(value: unknown): number | undefined;
156
+ /**
157
+ * @implements A-SPEC-128.12 — the one message for a configuration outside the 0.40.x supported surface (jest with one
158
+ * project and one unit, pytest under default naming, go). It leads every such environment reason.
159
+ */
160
+ export declare const UNSUPPORTED = "\uC774 \uAD6C\uC131\uC740 0.40.x\uAC00 \uC99D\uBE59\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4 \u2014 0.41 / \uC624\uB108 \uACB0\uC815";
108
161
  /**
109
162
  * @implements A-SPEC-534.8
110
163
  * Run specific jest files and return only their RED-first outcomes — the runner `test_run --mutate`
111
164
  * injects into runKillsOnFile. Scoped, jest only (the classifier is jest-only), fail-soft to {}.
112
165
  */
113
- export declare function runJestOutcomes(files: string[], cwd: string): Record<string, TestOutcome>;
166
+ export declare function runJestOutcomes(files: string[], cwd: string, timeoutMinutes?: number): Record<string, TestOutcome>;
114
167
  /** Run the pytest half of a plan, taking execution evidence from pytest's built-in JUnit XML. */
115
- /**
116
- * @implements A-SPEC-647
117
- * Per-file RED-first outcome from the same JUnit XML `parseJUnitXmlCounts` reads. Measured 2026-09-14
118
- * in an external pytest project: a ranged test_run executed the anchored case and recorded NOTHING,
119
- * because classification was jest-only — a Python project could never produce the red-assertion→green
120
- * sequence ART-8 reads. `<error>` (collection/import/setup) is a red-error, `<failure>` (an assertion)
121
- * a red-assertion, executed cases without either are green; a file with only skipped cases says nothing.
122
- */
123
- export declare function parseJUnitXmlOutcomes(xml: string, ext?: string): Record<string, TestOutcome>;
124
168
  /**
125
169
  * @implements A-SPEC-647
126
170
  * The ecosystems a project's OWN test files belong to, by file-name convention, under a bounded walk
127
171
  * that skips vendored trees and virtualenvs. Measured: a full-tier run with no impacted list assumed
128
- * the jest suite on a pytest-only project, ran nothing and reported passed:false. This repository's
129
- * Python tests live under `reference/`, so it detects jest only and its runs are unchanged.
172
+ * the jest suite on a pytest-only project, ran nothing and reported passed:false.
173
+ * @implements A-SPEC-128.5 — configuration files name an ecosystem too (a pytest.ini, a go.mod), the root's are read
174
+ * even where the walk stops early, and the skipped trees a project vendors are its own declaration
175
+ * (`ax.config.json` testRun.excludeDirs), not a name built in here. This repository lists `reference`.
130
176
  */
131
- export declare function detectProjectEcosystems(cwd: string): Ecosystem[];
132
- export declare function runPytest(files: string[], mode: TestRunPlan['mode'], cwd: string): {
177
+ export declare function detectProjectEcosystems(cwd: string, opts?: ScanOptions): Ecosystem[];
178
+ export declare function runPytest(files: string[], mode: TestRunPlan['mode'], cwd: string, ignore?: string[], pythonFrom?: string, run?: {
179
+ root: string;
180
+ sourceRoot: string;
181
+ }): {
133
182
  passed: boolean;
134
183
  tail: string;
135
184
  executed: Record<string, number>;
136
185
  outcomes: Record<string, TestOutcome>;
186
+ testsRun?: number;
187
+ reported?: string[];
188
+ environment?: boolean;
137
189
  };
138
190
  /**
139
191
  * @implements A-SPEC-137.2
@@ -159,6 +211,7 @@ export declare function runCargo(files: string[], _mode: TestRunPlan['mode'], cw
159
211
  tail: string;
160
212
  executed: Record<string, number>;
161
213
  unsupported?: string[];
214
+ testsRun?: number;
162
215
  };
163
216
  /**
164
217
  * @implements A-SPEC-137.3
@@ -174,6 +227,7 @@ export declare function runGradle(files: string[], _mode: TestRunPlan['mode'], c
174
227
  tail: string;
175
228
  executed: Record<string, number>;
176
229
  unsupported?: string[];
230
+ testsRun?: number;
177
231
  };
178
232
  /**
179
233
  * @implements A-SPEC-137.3
@@ -188,6 +242,7 @@ export declare function runDotnet(files: string[], _mode: TestRunPlan['mode'], c
188
242
  tail: string;
189
243
  executed: Record<string, number>;
190
244
  unsupported?: string[];
245
+ testsRun?: number;
191
246
  };
192
247
  /**
193
248
  * @implements A-SPEC-137.1
@@ -198,11 +253,14 @@ export declare function runDotnet(files: string[], _mode: TestRunPlan['mode'], c
198
253
  */
199
254
  export declare function runGo(files: string[], mode: TestRunPlan['mode'], cwd: string, opts?: {
200
255
  goPresent?: boolean;
256
+ ignore?: string[];
257
+ env?: Record<string, string>;
201
258
  }): {
202
259
  passed: boolean;
203
260
  tail: string;
204
261
  executed: Record<string, number>;
205
262
  unsupported?: string[];
263
+ testsRun?: number;
206
264
  };
207
265
  /**
208
266
  * Execute a plan (I/O). Deterministic inputs → deterministic command; the pass/fail is the suite's.
@@ -213,7 +271,63 @@ export declare function runGo(files: string[], mode: TestRunPlan['mode'], cwd: s
213
271
  * ecosystem has no adapter are returned in `unsupported` — never dropped quietly, because a scoped
214
272
  * gate that ran part of its scope has verified less than it reports.
215
273
  */
216
- export declare function runTestScope(scope: TestScope, cwd: string): TestRunResult;
274
+ export declare function runTestScope(scope: TestScope, cwd: string, opts?: TestRunOptions): TestRunResult;
275
+ /**
276
+ * @implements A-SPEC-128.4 — which ecosystem groups a plan runs. A scoped plan groups its own files. A full plan runs
277
+ * every ecosystem the PROJECT has, together with those of the impacted test files: detecting from the impacted files
278
+ * alone let a full run of a jest+pytest project skip pytest and still record `mode: full` (review 2026-11-05, A H1).
279
+ * Jest is assumed only when the project shows no ecosystem at all, and the run says so.
280
+ */
281
+ export declare function runEcosystems(scope: TestScope, plan: TestRunPlan, cwd: string, opts?: ScanOptions): {
282
+ groups: Map<Ecosystem, string[]>;
283
+ units: Array<TestUnit & {
284
+ files: string[];
285
+ }>;
286
+ unsupported: string[];
287
+ assumedJest: boolean;
288
+ detected: Ecosystem[];
289
+ detectedBy: Record<string, string>;
290
+ notRun: NotRun[];
291
+ notDetected: NotDetected[];
292
+ implementationCount: number;
293
+ implementationSample: string[];
294
+ notTests: string[];
295
+ expected: Record<string, string[]>;
296
+ codeRoots: CodeRoot[];
297
+ buildRoots: string[];
298
+ sparseTests: string[];
299
+ outsideSurface: Array<{
300
+ ecosystem: string;
301
+ dir: string;
302
+ reason: string;
303
+ }>;
304
+ testFiles: string[];
305
+ notBuilt: string[];
306
+ };
307
+ /**
308
+ * @implements A-SPEC-128.10 — I3 and R2, judged AFTER the run from what the runners reported: the expected test files
309
+ * a unit did not report (a runner configuration, a root narrower than the tree, a package that ran nothing), and the
310
+ * build roots whose code saw no executed test. Units that could not run (environment, stop) are judged elsewhere.
311
+ */
312
+ export declare function coverageAfterRun(expected: Record<string, string[]>, codeRoots: CodeRoot[], reported: Set<string>, executedByFile: Record<string, number>, skipUnits: Set<string>, buildRoots?: readonly string[], testFiles?: readonly string[]): {
313
+ notExecuted: string[];
314
+ untestedCode: Array<{
315
+ root: string;
316
+ sample: string[];
317
+ missingBuildFile?: string;
318
+ testFiles?: number;
319
+ }>;
320
+ };
321
+ /**
322
+ * @implements A-SPEC-128.9 — E4: why a unit that ran nothing failed, when the cause is its environment, not its tests: a
323
+ * missing runner. Null when the unit executed a test or failed for any other reason (then it is the tests).
324
+ */
325
+ export declare function environmentReason(r: {
326
+ passed: boolean;
327
+ tail: string;
328
+ unsupported?: string[];
329
+ environment?: boolean;
330
+ }, counted: number): string | null;
217
331
  /**
218
332
  * The last few lines of a runner's output, bounded by SIZE as well as by line count.
219
333
  *
@@ -255,4 +369,12 @@ export declare function tailOf(s: string, opts?: number | {
255
369
  * Only the FIRST line of a failure message: one failure, one look. The rest is in the file.
256
370
  */
257
371
  export declare function failedTestSummary(stdout: string, limit?: number): string | null;
372
+ /**
373
+ * @implements A-SPEC-466.3, A-SPEC-466.4 \u2014 the tail of a red jest run. The failing names come first; jest's stderr
374
+ * follows with a bound of its own. One `tailOf` over both kept the last lines and cut the front, so a long stderr pushed
375
+ * every name out (2026-11-04, `27bc0c40`: five failures, none named). The name block is bounded by its parts: five names
376
+ * of at most WHERE_MAX and FIRST_MAX characters and one count line, so the whole tail stays under 7,000 characters.
377
+ * Without readable jest JSON the tail is what it always was.
378
+ */
379
+ export declare function redJestTail(stdout: string, stderr: string): string;
258
380
  export declare function summarizeJestJson(stdout: string): string | null;