@aviaratech/ai-delivery 0.3.34 → 0.3.36

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 (301) hide show
  1. package/CONTRIBUTING.md +12 -206
  2. package/README.md +57 -506
  3. package/dist/agent.d.ts +0 -2
  4. package/dist/agent.js +76 -16
  5. package/dist/agent.js.map +7 -1
  6. package/dist/agentReadiness.test.js +73 -67
  7. package/dist/agentReadiness.test.js.map +7 -1
  8. package/dist/boardReconcile.test.js +1746 -0
  9. package/dist/boardReconcile.test.js.map +7 -0
  10. package/dist/build.test.js +130 -0
  11. package/dist/build.test.js.map +7 -0
  12. package/dist/callerErrors.test.js +105 -0
  13. package/dist/callerErrors.test.js.map +7 -0
  14. package/dist/cli.js +406 -485
  15. package/dist/cli.js.map +7 -1
  16. package/dist/cliResult.d.ts +2 -2
  17. package/dist/cliResult.js +42 -25
  18. package/dist/cliResult.js.map +7 -1
  19. package/dist/cliResult.test.js +434 -297
  20. package/dist/cliResult.test.js.map +7 -1
  21. package/dist/config/deliveryConfig.d.ts +320 -14
  22. package/dist/config/deliveryConfig.js +472 -385
  23. package/dist/config/deliveryConfig.js.map +7 -1
  24. package/dist/config/deliveryConfig.test.js +775 -584
  25. package/dist/config/deliveryConfig.test.js.map +7 -1
  26. package/dist/contributorChecks.test.js +1694 -916
  27. package/dist/contributorChecks.test.js.map +7 -1
  28. package/dist/currentConsumer.test.js +819 -737
  29. package/dist/currentConsumer.test.js.map +7 -1
  30. package/dist/currentTrackingScenario.test.js +499 -477
  31. package/dist/currentTrackingScenario.test.js.map +7 -1
  32. package/dist/delivery/common.js +160 -172
  33. package/dist/delivery/common.js.map +7 -1
  34. package/dist/delivery/delivery.test.js +509 -431
  35. package/dist/delivery/delivery.test.js.map +7 -1
  36. package/dist/delivery/evidence.d.ts +2 -2
  37. package/dist/delivery/evidence.js +133 -120
  38. package/dist/delivery/evidence.js.map +7 -1
  39. package/dist/delivery/index.js +7 -2
  40. package/dist/delivery/index.js.map +7 -1
  41. package/dist/delivery/legacy.js +65 -5
  42. package/dist/delivery/legacy.js.map +7 -1
  43. package/dist/delivery/policy.d.ts +10 -10
  44. package/dist/delivery/policy.js +211 -238
  45. package/dist/delivery/policy.js.map +7 -1
  46. package/dist/delivery/stage.d.ts +18 -18
  47. package/dist/delivery/stage.js +220 -235
  48. package/dist/delivery/stage.js.map +7 -1
  49. package/dist/deliveryBoard.d.ts +74 -0
  50. package/dist/deliveryBoard.js +644 -0
  51. package/dist/deliveryBoard.js.map +7 -0
  52. package/dist/deliveryBoard.test.d.ts +1 -0
  53. package/dist/deliveryBoard.test.js +649 -0
  54. package/dist/deliveryBoard.test.js.map +7 -0
  55. package/dist/deliveryHealth.test.js +179 -155
  56. package/dist/deliveryHealth.test.js.map +7 -1
  57. package/dist/dependencyCompatibility.test.js +154 -140
  58. package/dist/dependencyCompatibility.test.js.map +7 -1
  59. package/dist/directoryIndependent.test.js +417 -383
  60. package/dist/directoryIndependent.test.js.map +7 -1
  61. package/dist/dispatch.d.ts +17 -12
  62. package/dist/dispatch.js +330 -322
  63. package/dist/dispatch.js.map +7 -1
  64. package/dist/errors.d.ts +16 -3
  65. package/dist/errors.js +104 -82
  66. package/dist/errors.js.map +7 -1
  67. package/dist/fixtures/deliveryBoardReplay.d.ts +56 -0
  68. package/dist/fixtures/deliveryBoardReplay.js +617 -0
  69. package/dist/fixtures/deliveryBoardReplay.js.map +7 -0
  70. package/dist/fixtures/discovery.d.ts +59 -19
  71. package/dist/fixtures/discovery.js +96 -90
  72. package/dist/fixtures/discovery.js.map +7 -1
  73. package/dist/fixtures/inertEntrypointChild.js +57 -56
  74. package/dist/fixtures/inertEntrypointChild.js.map +7 -1
  75. package/dist/fixtures/inertEntrypoints.d.ts +1 -1
  76. package/dist/fixtures/inertEntrypoints.js +321 -276
  77. package/dist/fixtures/inertEntrypoints.js.map +7 -1
  78. package/dist/fixtures/inertTarget.d.ts +78 -7
  79. package/dist/fixtures/inertTarget.js +769 -691
  80. package/dist/fixtures/inertTarget.js.map +7 -1
  81. package/dist/fixtures/issue63.d.ts +4 -3
  82. package/dist/fixtures/issue63.js +260 -274
  83. package/dist/fixtures/issue63.js.map +7 -1
  84. package/dist/fixtures/issueProjectItems.d.ts +20 -0
  85. package/dist/fixtures/issueProjectItems.js +15 -0
  86. package/dist/fixtures/issueProjectItems.js.map +7 -0
  87. package/dist/fixtures/readView.d.ts +120 -0
  88. package/dist/fixtures/readView.js +172 -0
  89. package/dist/fixtures/readView.js.map +7 -0
  90. package/dist/fixtures/recordedGitHubFlows.d.ts +120 -0
  91. package/dist/fixtures/recordedGitHubFlows.js +109 -0
  92. package/dist/fixtures/recordedGitHubFlows.js.map +7 -0
  93. package/dist/genericCompatibility.test.js +64 -55
  94. package/dist/genericCompatibility.test.js.map +7 -1
  95. package/dist/git.js +73 -67
  96. package/dist/git.js.map +7 -1
  97. package/dist/gitProcess.d.ts +1 -1
  98. package/dist/gitProcess.js +58 -53
  99. package/dist/gitProcess.js.map +7 -1
  100. package/dist/github/client.d.ts +2 -2
  101. package/dist/github/client.js +484 -379
  102. package/dist/github/client.js.map +7 -1
  103. package/dist/github/commandIdentityPolicy.js +44 -51
  104. package/dist/github/commandIdentityPolicy.js.map +7 -1
  105. package/dist/github/discovery.d.ts +3 -0
  106. package/dist/github/discovery.js +197 -201
  107. package/dist/github/discovery.js.map +7 -1
  108. package/dist/github/discovery.test.js +223 -177
  109. package/dist/github/discovery.test.js.map +7 -1
  110. package/dist/github/issueHistory.d.ts +2 -2
  111. package/dist/github/issueHistory.js +117 -125
  112. package/dist/github/issueHistory.js.map +7 -1
  113. package/dist/github/machineAuth.d.ts +1 -1
  114. package/dist/github/machineAuth.js +126 -117
  115. package/dist/github/machineAuth.js.map +7 -1
  116. package/dist/github/machineAuth.test.js +755 -639
  117. package/dist/github/machineAuth.test.js.map +7 -1
  118. package/dist/github/nativeIssueMetadata.js +286 -273
  119. package/dist/github/nativeIssueMetadata.js.map +7 -1
  120. package/dist/github/projectDelivery.d.ts +53 -1
  121. package/dist/github/projectDelivery.js +623 -460
  122. package/dist/github/projectDelivery.js.map +7 -1
  123. package/dist/github/relationships.d.ts +5 -2
  124. package/dist/github/relationships.js +434 -333
  125. package/dist/github/relationships.js.map +7 -1
  126. package/dist/github/repo.d.ts +1 -0
  127. package/dist/github/repo.js +123 -96
  128. package/dist/github/repo.js.map +7 -1
  129. package/dist/index.js +3 -3
  130. package/dist/index.js.map +7 -1
  131. package/dist/issue.d.ts +103 -7
  132. package/dist/issue.js +2104 -1547
  133. package/dist/issue.js.map +7 -1
  134. package/dist/issue63History.test.js +40 -42
  135. package/dist/issue63History.test.js.map +7 -1
  136. package/dist/issue63Routes.test.js +154 -143
  137. package/dist/issue63Routes.test.js.map +7 -1
  138. package/dist/issueBatchUpdate.test.js +1004 -683
  139. package/dist/issueBatchUpdate.test.js.map +7 -1
  140. package/dist/issueBlockerGuard.test.js +262 -226
  141. package/dist/issueBlockerGuard.test.js.map +7 -1
  142. package/dist/issueContract.d.ts +23 -4
  143. package/dist/issueContract.js +416 -395
  144. package/dist/issueContract.js.map +7 -1
  145. package/dist/issueContract.test.d.ts +4 -3
  146. package/dist/issueContract.test.js +358 -321
  147. package/dist/issueContract.test.js.map +7 -1
  148. package/dist/issueDates.test.js +235 -233
  149. package/dist/issueDates.test.js.map +7 -1
  150. package/dist/issueInfoReadback.test.js +304 -190
  151. package/dist/issueInfoReadback.test.js.map +7 -1
  152. package/dist/issueIntake.test.js +1945 -1732
  153. package/dist/issueIntake.test.js.map +7 -1
  154. package/dist/issueJournal.d.ts +40 -19
  155. package/dist/issueJournal.js +229 -138
  156. package/dist/issueJournal.js.map +7 -1
  157. package/dist/issueJournal.test.js +605 -422
  158. package/dist/issueJournal.test.js.map +7 -1
  159. package/dist/issueRollup.test.d.ts +1 -0
  160. package/dist/issueRollup.test.js +476 -0
  161. package/dist/issueRollup.test.js.map +7 -0
  162. package/dist/issueTracking.test.js +1088 -593
  163. package/dist/issueTracking.test.js.map +7 -1
  164. package/dist/issueWriteRecovery.test.d.ts +1 -0
  165. package/dist/issueWriteRecovery.test.js +260 -0
  166. package/dist/issueWriteRecovery.test.js.map +7 -0
  167. package/dist/lifecycle.test.js +112 -441
  168. package/dist/lifecycle.test.js.map +7 -1
  169. package/dist/logger.js +80 -74
  170. package/dist/logger.js.map +7 -1
  171. package/dist/mcp/index.js +116 -90
  172. package/dist/mcp/index.js.map +7 -1
  173. package/dist/mcp/tools.d.ts +790 -220
  174. package/dist/mcp/tools.js +267 -333
  175. package/dist/mcp/tools.js.map +7 -1
  176. package/dist/pluginAuthProbe.js +63 -52
  177. package/dist/pluginAuthProbe.js.map +7 -1
  178. package/dist/pluginAuthProbe.test.js +85 -62
  179. package/dist/pluginAuthProbe.test.js.map +7 -1
  180. package/dist/pluginCredentials.test.js +282 -259
  181. package/dist/pluginCredentials.test.js.map +7 -1
  182. package/dist/pluginDoctor.test.js +653 -588
  183. package/dist/pluginDoctor.test.js.map +7 -1
  184. package/dist/pluginInstaller.d.ts +7 -5
  185. package/dist/pluginInstaller.js +1173 -1231
  186. package/dist/pluginInstaller.js.map +7 -1
  187. package/dist/pluginInstaller.test.js +1822 -1283
  188. package/dist/pluginInstaller.test.js.map +7 -1
  189. package/dist/pluginPackaging.test.js +485 -305
  190. package/dist/pluginPackaging.test.js.map +7 -1
  191. package/dist/pr.d.ts +132 -94
  192. package/dist/pr.js +1521 -1323
  193. package/dist/pr.js.map +7 -1
  194. package/dist/pr.test.js +1678 -632
  195. package/dist/pr.test.js.map +7 -1
  196. package/dist/prAssociation.test.js +2419 -1788
  197. package/dist/prAssociation.test.js.map +7 -1
  198. package/dist/prDispatch.test.js +150 -89
  199. package/dist/prDispatch.test.js.map +7 -1
  200. package/dist/readView.d.ts +183 -0
  201. package/dist/readView.js +217 -0
  202. package/dist/readView.js.map +7 -0
  203. package/dist/readView.test.d.ts +1 -0
  204. package/dist/readView.test.js +119 -0
  205. package/dist/readView.test.js.map +7 -0
  206. package/dist/releaseReconciliation.test.js +267 -288
  207. package/dist/releaseReconciliation.test.js.map +7 -1
  208. package/dist/releaseWorkflow.test.js +2493 -422
  209. package/dist/releaseWorkflow.test.js.map +7 -1
  210. package/dist/review.d.ts +738 -2
  211. package/dist/review.js +601 -348
  212. package/dist/review.js.map +7 -1
  213. package/dist/review.test.js +1218 -812
  214. package/dist/review.test.js.map +7 -1
  215. package/dist/reviewSubmit.test.d.ts +1 -0
  216. package/dist/reviewSubmit.test.js +747 -0
  217. package/dist/reviewSubmit.test.js.map +7 -0
  218. package/dist/services/agentReadinessService.js +42 -37
  219. package/dist/services/agentReadinessService.js.map +7 -1
  220. package/dist/services/blockerGuardService.js +188 -188
  221. package/dist/services/blockerGuardService.js.map +7 -1
  222. package/dist/services/boardReconcileService.d.ts +1204 -0
  223. package/dist/services/boardReconcileService.js +1445 -0
  224. package/dist/services/boardReconcileService.js.map +7 -0
  225. package/dist/services/deliveryAdmission.d.ts +2 -0
  226. package/dist/services/deliveryAdmission.js +129 -152
  227. package/dist/services/deliveryAdmission.js.map +7 -1
  228. package/dist/services/deliveryHealthService.js +197 -199
  229. package/dist/services/deliveryHealthService.js.map +7 -1
  230. package/dist/services/legacyIssueMigration.js +263 -277
  231. package/dist/services/legacyIssueMigration.js.map +7 -1
  232. package/dist/services/worktreeRegistry.d.ts +27 -119
  233. package/dist/services/worktreeRegistry.js +765 -1182
  234. package/dist/services/worktreeRegistry.js.map +7 -1
  235. package/dist/stagedChecks.test.js +396 -194
  236. package/dist/stagedChecks.test.js.map +7 -1
  237. package/dist/start.test.js +99 -95
  238. package/dist/start.test.js.map +7 -1
  239. package/dist/stdoutRegression.test.js +354 -350
  240. package/dist/stdoutRegression.test.js.map +7 -1
  241. package/dist/targetPolicyDiscovery.test.js +141 -143
  242. package/dist/targetPolicyDiscovery.test.js.map +7 -1
  243. package/dist/targetPolicyEntrypoints.test.js +308 -269
  244. package/dist/targetPolicyEntrypoints.test.js.map +7 -1
  245. package/dist/targetPolicyLocal.test.js +580 -1051
  246. package/dist/targetPolicyLocal.test.js.map +7 -1
  247. package/dist/targetPolicyRoutes.test.js +305 -281
  248. package/dist/targetPolicyRoutes.test.js.map +7 -1
  249. package/dist/targetRepositoryExecution.test.d.ts +1 -0
  250. package/dist/targetRepositoryExecution.test.js +463 -0
  251. package/dist/targetRepositoryExecution.test.js.map +7 -0
  252. package/dist/terminalMessages.js +41 -35
  253. package/dist/terminalMessages.js.map +7 -1
  254. package/dist/toolOutput.d.ts +2 -0
  255. package/dist/toolOutput.js +36 -0
  256. package/dist/toolOutput.js.map +7 -0
  257. package/dist/toolOutput.test.d.ts +1 -0
  258. package/dist/toolOutput.test.js +240 -0
  259. package/dist/toolOutput.test.js.map +7 -0
  260. package/dist/utils/atomicJson.js +84 -76
  261. package/dist/utils/atomicJson.js.map +7 -1
  262. package/dist/utils/filesystem.js +15 -18
  263. package/dist/utils/filesystem.js.map +7 -1
  264. package/dist/utils/lockfile.js +68 -71
  265. package/dist/utils/lockfile.js.map +7 -1
  266. package/dist/verification.d.ts +1 -19
  267. package/dist/verification.js +1020 -1929
  268. package/dist/verification.js.map +7 -1
  269. package/dist/verificationGate.test.js +127 -117
  270. package/dist/verificationGate.test.js.map +7 -1
  271. package/dist/version.d.ts +6 -0
  272. package/dist/version.js +24 -10
  273. package/dist/version.js.map +7 -1
  274. package/dist/worktree.d.ts +3 -15
  275. package/dist/worktree.js +97 -177
  276. package/dist/worktree.js.map +7 -1
  277. package/package.json +10 -8
  278. package/plugins/ai-delivery/.claude-plugin/plugin.json +2 -2
  279. package/plugins/ai-delivery/README.md +47 -156
  280. package/plugins/ai-delivery/plugin.json +1 -1
  281. package/plugins/ai-delivery/runtime/dist/THIRD-PARTY-NOTICES.md +261 -43
  282. package/plugins/ai-delivery/runtime/dist/cli.js +369 -125
  283. package/plugins/ai-delivery/runtime/package.json +1 -1
  284. package/plugins/ai-delivery/skills/intake-create/SKILL.md +14 -78
  285. package/plugins/ai-delivery/skills/pr-handoff/SKILL.md +35 -36
  286. package/plugins/ai-delivery/skills/worktree-lifecycle/SKILL.md +14 -15
  287. package/dist/investigationCompletion.test.js +0 -728
  288. package/dist/investigationCompletion.test.js.map +0 -1
  289. package/dist/setup.d.ts +0 -60
  290. package/dist/setup.js +0 -585
  291. package/dist/setup.js.map +0 -1
  292. package/dist/setup.test.js +0 -3058
  293. package/dist/setup.test.js.map +0 -1
  294. package/dist/worktreeTransition.d.ts +0 -211
  295. package/dist/worktreeTransition.js +0 -1037
  296. package/dist/worktreeTransition.js.map +0 -1
  297. package/dist/worktreeTransition.test.js +0 -1191
  298. package/dist/worktreeTransition.test.js.map +0 -1
  299. /package/dist/{investigationCompletion.test.d.ts → boardReconcile.test.d.ts} +0 -0
  300. /package/dist/{setup.test.d.ts → build.test.d.ts} +0 -0
  301. /package/dist/{worktreeTransition.test.d.ts → callerErrors.test.d.ts} +0 -0
@@ -1,378 +1,382 @@
1
- import assert from 'node:assert/strict';
2
- import { execFileSync } from 'node:child_process';
3
- import { Console } from 'node:console';
4
- import { mkdtempSync, realpathSync, rmSync, writeFileSync } from 'node:fs';
5
- import { tmpdir } from 'node:os';
6
- import { join } from 'node:path';
7
- import { Octokit } from '@octokit/rest';
8
- import { afterEach, test, vi } from 'vitest';
9
- import { parseDeliveryConfig } from './config/deliveryConfig.js';
10
- import { syntheticDiscoveryConfig } from './fixtures/discovery.js';
11
- import { replaceParentIssue } from './github/relationships.js';
12
- import { IssueFields, renderIssueBody } from './issueContract.js';
13
- import { CLIError, handleCommandError, logDebug, logError, logInfo, logProgress, logSuccess, logWarn, setLogsSuppressed, } from './logger.js';
14
- import { addWorktreeEntry, removeWorktreeEntry } from './services/worktreeRegistry.js';
15
- // Project/field metadata is unrelated to stream routing. Keep these provider
16
- // adapters local while exercising real parent linking, issue start and dispatch.
17
- vi.mock('./github/nativeIssueMetadata.js', async (importOriginal) => ({
18
- ...(await importOriginal()),
19
- getConfiguredNativeIssueMetadata: async () => ({ points: 2 }),
20
- setConfiguredNativeIssueMetadata: async () => ({ points: 2 }),
21
- clearConfiguredNativeIssuePoints: async () => { },
1
+ import assert from "node:assert/strict";
2
+ import { execFileSync } from "node:child_process";
3
+ import { Console } from "node:console";
4
+ import { mkdtempSync, realpathSync, rmSync, writeFileSync } from "node:fs";
5
+ import { tmpdir } from "node:os";
6
+ import { join } from "node:path";
7
+ import { Octokit } from "@octokit/rest";
8
+ import { afterEach, test, vi } from "vitest";
9
+ import { parseDeliveryConfig } from "./config/deliveryConfig.js";
10
+ import { syntheticDiscoveryConfig } from "./fixtures/discovery.js";
11
+ import { replaceParentIssue } from "./github/relationships.js";
12
+ import { IssueFields, renderIssueBody } from "./issueContract.js";
13
+ import {
14
+ CLIError,
15
+ handleCommandError,
16
+ logDebug,
17
+ logError,
18
+ logInfo,
19
+ logProgress,
20
+ logSuccess,
21
+ logWarn,
22
+ setLogsSuppressed
23
+ } from "./logger.js";
24
+ import { addWorktreeEntry, removeWorktreeEntry } from "./services/worktreeRegistry.js";
25
+ const projectReadback = vi.hoisted(() => ({ value: null }));
26
+ vi.mock("./github/nativeIssueMetadata.js", async (importOriginal) => ({
27
+ ...await importOriginal(),
28
+ getConfiguredNativeIssueMetadata: async () => ({ points: 2 }),
29
+ setConfiguredNativeIssueMetadata: async () => ({ points: 2 }),
30
+ clearConfiguredNativeIssuePoints: async () => {
31
+ }
22
32
  }));
23
- vi.mock('./github/projectDelivery.js', async (importOriginal) => ({
24
- ...(await importOriginal()),
25
- getIssueProjectStatus: async () => null,
26
- syncIssueProjectStatus: async () => null,
33
+ vi.mock("./github/projectDelivery.js", async (importOriginal) => ({
34
+ ...await importOriginal(),
35
+ assertIssueProjectWritable: async () => {
36
+ },
37
+ getIssueProjectStatus: async () => projectReadback.value,
38
+ syncIssueProjectStatus: async ({ status }) => projectReadback.value = { itemId: "SYNTHETIC-PROJECT-ITEM", status }
27
39
  }));
28
40
  afterEach(() => {
29
- vi.restoreAllMocks();
30
- vi.unstubAllEnvs();
31
- setLogsSuppressed(false);
41
+ projectReadback.value = null;
42
+ vi.restoreAllMocks();
43
+ vi.unstubAllEnvs();
44
+ setLogsSuppressed(false);
32
45
  });
33
- const readyBody = renderIssueBody(IssueFields.parse({
34
- title: 'Synthetic change',
35
- issueType: 'Task',
46
+ const readyBody = renderIssueBody(
47
+ IssueFields.parse({
48
+ title: "Synthetic change",
49
+ issueType: "Task",
36
50
  points: 2,
37
- problem: 'Parent-link diagnostics can corrupt the CLI JSON result.',
38
- outcome: 'Return one parseable JSON result after parent linking or branch failure.',
51
+ problem: "Parent-link diagnostics can corrupt the CLI JSON result.",
52
+ outcome: "Return one parseable JSON result after parent linking or branch failure.",
39
53
  acceptanceCriteria: [
40
- {
41
- behavior: 'Parent linking leaves stdout as one JSON result and diagnostics on stderr.',
42
- verifiedBy: 'Byte-level CLI stream assertions.',
43
- },
54
+ {
55
+ behavior: "Parent linking leaves stdout as one JSON result and diagnostics on stderr.",
56
+ verifiedBy: "Byte-level CLI stream assertions."
57
+ }
44
58
  ],
45
- outOfScope: ['Live GitHub access and host configuration.'],
46
- context: { files: ['artifact.txt'] },
47
- }));
59
+ outOfScope: ["Live GitHub access and host configuration."],
60
+ context: { files: ["artifact.txt"] }
61
+ })
62
+ );
48
63
  function fixture(developmentFails = false) {
49
- const root = realpathSync(mkdtempSync(join(tmpdir(), 'ai-delivery-stdout-')));
50
- const git = (...args) => execFileSync('git', args, { cwd: root, encoding: 'utf8' }).trim();
51
- git('init', '-q', '-b', 'main');
52
- git('config', 'user.name', 'Synthetic Delivery');
53
- git('config', 'user.email', 'delivery@example.test');
54
- writeFileSync(join(root, 'artifact.txt'), 'synthetic\n');
55
- git('add', 'artifact.txt');
56
- git('commit', '-qm', 'synthetic base');
57
- git('remote', 'add', 'origin', 'https://github.com/example/widget.git');
58
- git('update-ref', 'refs/remotes/origin/main', git('rev-parse', 'HEAD'));
59
- git('symbolic-ref', 'refs/remotes/origin/HEAD', 'refs/remotes/origin/main');
60
- let parent = null;
61
- const issue = {
62
- id: 170,
63
- number: 17,
64
- node_id: 'ISSUE-17',
65
- title: 'Synthetic change',
66
- body: readyBody,
67
- state: 'open',
68
- html_url: 'https://github.com/example/widget/issues/17',
69
- labels: [],
70
- type: { name: 'Task' },
71
- };
72
- const rest = new Octokit();
73
- rest.request = (async (route) => {
74
- if (route === 'GET /orgs/{org}/issue-fields')
75
- return {
76
- data: [
77
- { id: 101, name: 'Estimate', data_type: 'single_select' },
78
- { id: 102, name: 'Urgency', data_type: 'single_select' },
79
- ],
80
- };
81
- if (route === 'GET /repos/{owner}/{repo}/issues/{issue_number}/issue-field-values')
82
- return {
83
- data: [
84
- {
85
- issue_field_id: 101,
86
- issue_field_name: 'Estimate',
87
- data_type: 'single_select',
88
- value: '2',
89
- single_select_option: { name: '2' },
90
- },
91
- ],
92
- };
93
- throw new Error(`Unexpected synthetic stdout REST operation: ${route}`);
94
- });
95
- Object.assign(rest.issues, {
96
- get: async ({ issue_number }) => ({
97
- data: issue_number === 17
98
- ? { ...issue, state: developmentFails ? 'closed' : 'open' }
99
- : { ...issue, number: issue_number, id: issue_number * 10, node_id: `ISSUE-${String(issue_number)}` },
100
- }),
101
- create: async (input) => {
102
- issue.title = input.title;
103
- issue.body = input.body;
104
- return { data: issue };
105
- },
106
- listForRepo: async () => ({ data: [] }),
107
- update: async (input) => {
108
- if (input.title !== undefined)
109
- issue.title = input.title;
110
- if (input.body !== undefined)
111
- issue.body = input.body;
112
- return { data: issue };
113
- },
114
- listSubIssues: async ({ issue_number }) => ({
115
- data: parent === issue_number ? [issue] : [],
116
- }),
117
- addSubIssue: async ({ issue_number }) => {
118
- parent = issue_number;
119
- return { data: issue };
120
- },
121
- });
122
- Object.assign(rest, {
123
- paginate: async (_route, { issue_number }) => parent === issue_number ? [issue] : [],
124
- });
125
- const clients = {
126
- authSource: 'personal',
127
- role: 'author',
128
- rest,
129
- graphql: (async (query) => {
130
- const page = { nodes: [], pageInfo: { endCursor: null, hasNextPage: false } };
131
- if (query.includes('blockedBy(')) {
132
- return {
133
- repository: {
134
- issue: {
135
- blockedBy: page,
136
- parent: parent === null
137
- ? null
138
- : { id: 'ISSUE-5', number: parent, repository: { nameWithOwner: 'example/widget' } },
139
- },
140
- },
141
- };
64
+ const root = realpathSync(mkdtempSync(join(tmpdir(), "ai-delivery-stdout-")));
65
+ const git = (...args) => execFileSync("git", args, { cwd: root, encoding: "utf8" }).trim();
66
+ git("init", "-q", "-b", "main");
67
+ git("config", "user.name", "Synthetic Delivery");
68
+ git("config", "user.email", "delivery@example.test");
69
+ writeFileSync(join(root, "artifact.txt"), "synthetic\n");
70
+ git("add", "artifact.txt");
71
+ git("commit", "-qm", "synthetic base");
72
+ git("remote", "add", "origin", "https://github.com/example/widget.git");
73
+ git("update-ref", "refs/remotes/origin/main", git("rev-parse", "HEAD"));
74
+ git("symbolic-ref", "refs/remotes/origin/HEAD", "refs/remotes/origin/main");
75
+ let parent = null;
76
+ const issue = {
77
+ id: 170,
78
+ number: 17,
79
+ node_id: "ISSUE-17",
80
+ title: "Synthetic change",
81
+ body: readyBody,
82
+ state: "open",
83
+ html_url: "https://github.com/example/widget/issues/17",
84
+ labels: [],
85
+ type: { name: "Task" }
86
+ };
87
+ const rest = new Octokit();
88
+ rest.request = (async (route) => {
89
+ if (route === "GET /orgs/{org}/issue-fields")
90
+ return {
91
+ data: [
92
+ { id: 101, name: "Estimate", data_type: "single_select" },
93
+ { id: 102, name: "Urgency", data_type: "single_select" }
94
+ ]
95
+ };
96
+ if (route === "GET /repos/{owner}/{repo}/issues/{issue_number}/issue-field-values")
97
+ return {
98
+ data: [
99
+ {
100
+ issue_field_id: 101,
101
+ issue_field_name: "Estimate",
102
+ data_type: "single_select",
103
+ value: "2",
104
+ single_select_option: { name: "2" }
105
+ }
106
+ ]
107
+ };
108
+ throw new Error(`Unexpected synthetic stdout REST operation: ${route}`);
109
+ });
110
+ Object.assign(rest.issues, {
111
+ get: async ({ issue_number }) => ({
112
+ data: issue_number === 17 ? { ...issue, state: developmentFails ? "closed" : "open" } : { ...issue, number: issue_number, id: issue_number * 10, node_id: `ISSUE-${String(issue_number)}` }
113
+ }),
114
+ create: async (input) => {
115
+ issue.title = input.title;
116
+ issue.body = input.body;
117
+ return { data: issue };
118
+ },
119
+ listForRepo: async () => ({ data: [] }),
120
+ update: async (input) => {
121
+ if (input.title !== void 0) issue.title = input.title;
122
+ if (input.body !== void 0) issue.body = input.body;
123
+ return { data: issue };
124
+ },
125
+ listSubIssues: async ({ issue_number }) => ({
126
+ data: parent === issue_number ? [issue] : []
127
+ }),
128
+ addSubIssue: async ({ issue_number }) => {
129
+ parent = issue_number;
130
+ return { data: issue };
131
+ }
132
+ });
133
+ Object.assign(rest, {
134
+ paginate: async (_route, { issue_number }) => parent === issue_number ? [issue] : []
135
+ });
136
+ const clients = {
137
+ authSource: "personal",
138
+ role: "author",
139
+ rest,
140
+ graphql: (async (query) => {
141
+ const page = { nodes: [], pageInfo: { endCursor: null, hasNextPage: false } };
142
+ if (query.includes("blockedBy(")) {
143
+ return {
144
+ repository: {
145
+ issue: {
146
+ blockedBy: page,
147
+ parent: parent === null ? null : { id: "ISSUE-5", number: parent, repository: { nameWithOwner: "example/widget" } }
142
148
  }
143
- if (query.includes('blocking('))
144
- return { repository: { issue: { blocking: page } } };
145
- if (query.includes('subIssues('))
146
- return { repository: { issue: { subIssues: page } } };
147
- throw new Error('Unexpected synthetic stdout query.');
148
- }),
149
- };
150
- const config = parseDeliveryConfig({
151
- ...syntheticDiscoveryConfig,
152
- schemaVersion: 'ai-delivery.config@2',
153
- policy: { contract: 'RepositoryDeliveryPolicy@1', module: './policy.mjs' },
154
- roles: {
155
- author: { identity: 'host-author', authSource: 'personal', credentialEnv: { token: 'AUTHOR_TOKEN' } },
156
- reviewer: {
157
- identity: 'synthetic-reviewer',
158
- credentialEnv: {
159
- appId: 'REVIEWER_APP_ID',
160
- installationId: 'REVIEWER_INSTALLATION_ID',
161
- privateKeyPath: 'REVIEWER_KEY_PATH',
162
- },
163
- },
164
- },
165
- commandPolicy: {
166
- checks: { format: 'REQUIRED', gitClean: 'REQUIRED', lint: 'REQUIRED', test: 'REQUIRED', typecheck: 'REQUIRED' },
167
- timeoutsMs: { lint: 60000, test: 60000, typecheck: 60000 },
168
- },
169
- });
170
- return {
171
- context: { root, repo: { owner: 'example', repo: 'widget' }, clients, config },
172
- cleanup: () => rmSync(root, { recursive: true, force: true }),
173
- };
149
+ }
150
+ };
151
+ }
152
+ if (query.includes("blocking(")) return { repository: { issue: { blocking: page } } };
153
+ if (query.includes("subIssues(")) return { repository: { issue: { subIssues: page } } };
154
+ throw new Error("Unexpected synthetic stdout query.");
155
+ })
156
+ };
157
+ const config = parseDeliveryConfig({
158
+ ...syntheticDiscoveryConfig,
159
+ schemaVersion: "ai-delivery.config@2",
160
+ policy: { contract: "RepositoryDeliveryPolicy@1", module: "./policy.mjs" },
161
+ roles: {
162
+ author: { identity: "host-author", authSource: "personal", credentialEnv: { token: "AUTHOR_TOKEN" } },
163
+ reviewer: {
164
+ identity: "synthetic-reviewer",
165
+ credentialEnv: {
166
+ appId: "REVIEWER_APP_ID",
167
+ installationId: "REVIEWER_INSTALLATION_ID",
168
+ privateKeyPath: "REVIEWER_KEY_PATH"
169
+ }
170
+ }
171
+ },
172
+ commandPolicy: {
173
+ checks: { format: "REQUIRED", gitClean: "REQUIRED", lint: "REQUIRED", test: "REQUIRED", typecheck: "REQUIRED" },
174
+ timeoutsMs: { lint: 6e4, test: 6e4, typecheck: 6e4 }
175
+ }
176
+ });
177
+ return {
178
+ context: { root, repo: { owner: "example", repo: "widget" }, clients, config },
179
+ cleanup: () => rmSync(root, { recursive: true, force: true })
180
+ };
174
181
  }
175
182
  function captureStreams() {
176
- const output = { stdout: '', stderr: '' };
177
- const previousConsole = globalThis.console;
178
- // Vitest intercepts console calls before they reach process streams. Use a
179
- // native console so the byte-level capture matches an actual CLI process.
180
- globalThis.console = new Console(process.stdout, process.stderr);
181
- const out = vi.spyOn(process.stdout, 'write').mockImplementation((value) => {
182
- output.stdout += String(value);
183
- return true;
184
- });
185
- const err = vi.spyOn(process.stderr, 'write').mockImplementation((value) => {
186
- output.stderr += String(value);
187
- return true;
188
- });
189
- return {
190
- output,
191
- restore: () => {
192
- out.mockRestore();
193
- err.mockRestore();
194
- globalThis.console = previousConsole;
195
- },
196
- };
197
- }
198
- test('parent replacement emits its diagnostic on stderr without writing any stdout bytes', async () => {
199
- const f = fixture();
200
- const capture = captureStreams();
201
- try {
202
- await replaceParentIssue({ ...f.context.clients, repo: f.context.repo, issueNumber: 17, parentIssueNumber: 5 });
203
- assert.equal(capture.output.stdout, '');
204
- assert.match(capture.output.stderr, /Linked issue #17 as sub-issue of issue #5\./u);
205
- }
206
- finally {
207
- capture.restore();
208
- f.cleanup();
183
+ const output = { stdout: "", stderr: "" };
184
+ const previousConsole = globalThis.console;
185
+ globalThis.console = new Console(process.stdout, process.stderr);
186
+ const out = vi.spyOn(process.stdout, "write").mockImplementation((value) => {
187
+ output.stdout += String(value);
188
+ return true;
189
+ });
190
+ const err = vi.spyOn(process.stderr, "write").mockImplementation((value) => {
191
+ output.stderr += String(value);
192
+ return true;
193
+ });
194
+ return {
195
+ output,
196
+ restore: () => {
197
+ out.mockRestore();
198
+ err.mockRestore();
199
+ globalThis.console = previousConsole;
209
200
  }
201
+ };
202
+ }
203
+ test("parent replacement emits its diagnostic on stderr without writing any stdout bytes", async () => {
204
+ const f = fixture();
205
+ const capture = captureStreams();
206
+ try {
207
+ await replaceParentIssue({ ...f.context.clients, repo: f.context.repo, issueNumber: 17, parentIssueNumber: 5 });
208
+ assert.equal(capture.output.stdout, "");
209
+ assert.match(capture.output.stderr, /Linked issue #17 as sub-issue of issue #5\./u);
210
+ } finally {
211
+ capture.restore();
212
+ f.cleanup();
213
+ }
210
214
  });
211
- test.each(['add', 'remove'])('registry %s emits its diagnostic without writing any stdout bytes', async (operation) => {
215
+ test.each(["add", "remove"])(
216
+ "registry %s emits its diagnostic without writing any stdout bytes",
217
+ async (operation) => {
212
218
  const f = fixture();
213
219
  const row = {
214
- path: join(f.context.root, '.worktrees', 'synthetic'),
215
- branch: 'issue/17',
216
- type: 'issue',
217
- issueNumber: 17,
218
- identity: 'host-author',
219
- status: 'active',
220
- createdAt: '2026-10-08T00:00:00Z',
221
- updatedAt: '2026-10-08T00:00:00Z',
220
+ path: join(f.context.root, ".worktrees", "synthetic"),
221
+ branch: "issue/17",
222
+ type: "issue",
223
+ issueNumber: 17,
224
+ identity: "host-author",
225
+ status: "active",
226
+ createdAt: "2026-10-08T00:00:00Z",
227
+ updatedAt: "2026-10-08T00:00:00Z"
222
228
  };
223
229
  const capture = captureStreams();
224
230
  try {
225
- await addWorktreeEntry(row, f.context.root);
226
- if (operation === 'remove') {
227
- capture.output.stdout = '';
228
- capture.output.stderr = '';
229
- assert.equal(await removeWorktreeEntry(row.path, f.context.root), true);
230
- }
231
- assert.equal(capture.output.stdout, '');
232
- assert.match(capture.output.stderr, operation === 'add' ? /Added to worktree registry:/u : /Removed from worktree registry:/u);
233
- }
234
- finally {
235
- capture.restore();
236
- f.cleanup();
231
+ await addWorktreeEntry(row, f.context.root);
232
+ if (operation === "remove") {
233
+ capture.output.stdout = "";
234
+ capture.output.stderr = "";
235
+ assert.equal(await removeWorktreeEntry(row.path, f.context.root), true);
236
+ }
237
+ assert.equal(capture.output.stdout, "");
238
+ assert.match(
239
+ capture.output.stderr,
240
+ operation === "add" ? /Added to worktree registry:/u : /Removed from worktree registry:/u
241
+ );
242
+ } finally {
243
+ capture.restore();
244
+ f.cleanup();
237
245
  }
238
- });
246
+ }
247
+ );
239
248
  async function runCli(context, args) {
240
- vi.resetModules();
241
- const configuration = await import('./config/deliveryConfig.js');
242
- const issues = await import('./issue.js');
243
- const admission = await import('./services/deliveryAdmission.js');
244
- const prs = await import('./pr.js');
245
- const dispatch = await import('./dispatch.js');
246
- vi.spyOn(configuration, 'loadDeliverySettings').mockResolvedValue({
247
- ...context.config,
248
- configPath: 'synthetic-user.json',
249
- checkoutRoots: [],
250
- overrides: { schemaVersion: 'ai-delivery.config@2' },
251
- sourceDigest: 'synthetic',
252
- });
253
- vi.spyOn(issues, 'loadDeliveryContext').mockResolvedValue(context);
254
- // Synthetic authorization seams: these tests exercise streams, not live access.
255
- vi.spyOn(admission, 'assertDeliveryRuntimeAdmitted').mockResolvedValue({});
256
- vi.spyOn(prs, 'preflightReviewRoute').mockResolvedValue({});
257
- const argv = process.argv;
258
- const exitCode = process.exitCode;
259
- const capture = captureStreams();
260
- let completed = () => { };
261
- let failed = () => { };
262
- const resultWritten = new Promise((resolve, reject) => {
263
- completed = resolve;
264
- failed = reject;
265
- });
266
- const execute = dispatch.executeTool;
267
- vi.spyOn(dispatch, 'executeTool').mockImplementation(async (...input) => {
268
- try {
269
- return await execute(...input);
270
- }
271
- catch (error) {
272
- failed(error);
273
- throw error;
274
- }
275
- });
276
- vi.spyOn(process.stdout, 'write').mockImplementation((value) => {
277
- capture.output.stdout += String(value);
278
- // Wait for the result, not the earlier diagnostic chunk that reproduces #74.
279
- if (String(value).startsWith('{'))
280
- completed();
281
- return true;
282
- });
249
+ vi.resetModules();
250
+ const configuration = await import("./config/deliveryConfig.js");
251
+ const issues = await import("./issue.js");
252
+ const admission = await import("./services/deliveryAdmission.js");
253
+ const prs = await import("./pr.js");
254
+ const dispatch = await import("./dispatch.js");
255
+ vi.spyOn(configuration, "loadDeliverySettings").mockResolvedValue({
256
+ ...context.config,
257
+ configPath: "synthetic-user.json",
258
+ checkoutRoots: [],
259
+ overrides: { schemaVersion: "ai-delivery.config@2" },
260
+ sourceDigest: "synthetic"
261
+ });
262
+ vi.spyOn(issues, "loadDeliveryContext").mockResolvedValue(context);
263
+ vi.spyOn(admission, "assertDeliveryRuntimeAdmitted").mockResolvedValue(
264
+ {}
265
+ );
266
+ vi.spyOn(prs, "preflightReviewRoute").mockResolvedValue({});
267
+ const argv = process.argv;
268
+ const exitCode = process.exitCode;
269
+ const capture = captureStreams();
270
+ let completed = () => {
271
+ };
272
+ let failed = () => {
273
+ };
274
+ const resultWritten = new Promise((resolve, reject) => {
275
+ completed = resolve;
276
+ failed = reject;
277
+ });
278
+ const execute = dispatch.executeTool;
279
+ vi.spyOn(dispatch, "executeTool").mockImplementation(async (...input) => {
283
280
  try {
284
- process.exitCode = undefined;
285
- process.argv = [process.execPath, 'ai-delivery', '--repo-root', context.root, '--identity', 'host-author', ...args];
286
- await import('./cli.js');
287
- await resultWritten;
288
- return { ...capture.output, exitCode: process.exitCode };
289
- }
290
- finally {
291
- capture.restore();
292
- vi.restoreAllMocks();
293
- process.argv = argv;
294
- process.exitCode = exitCode;
281
+ return await execute(...input);
282
+ } catch (error) {
283
+ failed(error);
284
+ throw error;
295
285
  }
286
+ });
287
+ vi.spyOn(process.stdout, "write").mockImplementation((value) => {
288
+ capture.output.stdout += String(value);
289
+ if (String(value).startsWith("{")) completed();
290
+ return true;
291
+ });
292
+ try {
293
+ process.exitCode = void 0;
294
+ process.argv = [process.execPath, "ai-delivery", "--repo-root", context.root, "--identity", "host-author", ...args];
295
+ await import("./cli.js");
296
+ await resultWritten;
297
+ return { ...capture.output, exitCode: process.exitCode };
298
+ } finally {
299
+ capture.restore();
300
+ vi.restoreAllMocks();
301
+ process.argv = argv;
302
+ process.exitCode = exitCode;
303
+ }
296
304
  }
297
- test('parent update through the CLI entry produces one parseable JSON result', async () => {
298
- const f = fixture();
299
- try {
300
- const output = await runCli(f.context, ['update', '--issue', '17', '--parent', '5']);
301
- const result = JSON.parse(output.stdout);
302
- assert.equal(result.issueNumber, 17);
303
- assert.equal(result.parentIssueNumber, 5);
304
- assert.equal(output.exitCode, undefined);
305
- assert.match(output.stderr, /Linked issue #17 as sub-issue of issue #5\./u);
306
- }
307
- finally {
308
- f.cleanup();
309
- }
305
+ test("parent update through the CLI entry produces one parseable JSON result", async () => {
306
+ const f = fixture();
307
+ try {
308
+ const output = await runCli(f.context, ["update", "--issue", "17", "--parent", "5"]);
309
+ const result = JSON.parse(output.stdout);
310
+ assert.equal(result.issueNumber, 17);
311
+ assert.equal(result.parentIssueNumber, 5);
312
+ assert.equal(output.exitCode, void 0);
313
+ assert.match(output.stderr, /Linked issue #17 as sub-issue of issue #5\./u);
314
+ } finally {
315
+ f.cleanup();
316
+ }
310
317
  });
311
- test('failed remote branch start after parent linking preserves parseable CLI recovery JSON and nonzero exit', async () => {
312
- const f = fixture(true);
313
- try {
314
- const output = await runCli(f.context, [
315
- 'start',
316
- '--title',
317
- 'Synthetic change',
318
- '--body',
319
- readyBody,
320
- '--parent',
321
- '5',
322
- ]);
323
- const result = JSON.parse(output.stdout);
324
- assert.equal(result.status, 'created-not-started');
325
- assert.equal(result.createdIssue.number, 17);
326
- assert.equal(result.failure.phase, 'branch-or-journal');
327
- assert.match(result.failure.message, /open GitHub issue/u);
328
- assert.equal(result.safeResume.arguments.issueNumber, 17);
329
- assert.equal('parentIssueNumber' in result.safeResume.arguments, false);
330
- assert.equal('resumeCreated' in result.safeResume.arguments, false);
331
- assert.equal(output.exitCode, 1);
332
- assert.match(output.stderr, /Linked issue #17 as sub-issue of issue #5\./u);
333
- }
334
- finally {
335
- f.cleanup();
336
- }
318
+ test("failed remote branch start after parent linking preserves parseable CLI recovery JSON and nonzero exit", async () => {
319
+ const f = fixture(true);
320
+ try {
321
+ const output = await runCli(f.context, [
322
+ "start",
323
+ "--title",
324
+ "Synthetic change",
325
+ "--body",
326
+ readyBody,
327
+ "--parent",
328
+ "5"
329
+ ]);
330
+ const result = JSON.parse(output.stdout);
331
+ assert.equal(result.status, "created-not-started");
332
+ assert.equal(result.createdIssue.number, 17);
333
+ assert.equal(result.failure.phase, "branch-or-journal");
334
+ assert.match(result.failure.message, /open GitHub issue/u);
335
+ assert.equal(result.safeResume.arguments.issueNumber, 17);
336
+ assert.equal("parentIssueNumber" in result.safeResume.arguments, false);
337
+ assert.equal("resumeCreated" in result.safeResume.arguments, false);
338
+ assert.equal(output.exitCode, 1);
339
+ assert.match(output.stderr, /Linked issue #17 as sub-issue of issue #5\./u);
340
+ } finally {
341
+ f.cleanup();
342
+ }
337
343
  });
338
- test('all enabled diagnostics preserve their content on stderr', () => {
339
- vi.stubEnv('DEBUG', '1');
340
- const capture = captureStreams();
341
- try {
342
- logDebug('debug proof');
343
- logInfo('info proof');
344
- logSuccess('success proof');
345
- logWarn('warning proof');
346
- logError('error proof');
347
- logProgress('progress proof');
348
- handleCommandError(new CLIError('failure proof', { hint: 'retry proof' }));
349
- assert.equal(capture.output.stdout, '');
350
- for (const message of ['debug', 'info', 'success', 'warning', 'error', 'progress', 'failure', 'retry']) {
351
- assert.match(capture.output.stderr, new RegExp(`${message} proof`, 'u'));
352
- }
353
- }
354
- finally {
355
- capture.restore();
344
+ test("all enabled diagnostics preserve their content on stderr", () => {
345
+ vi.stubEnv("DEBUG", "1");
346
+ const capture = captureStreams();
347
+ try {
348
+ logDebug("debug proof");
349
+ logInfo("info proof");
350
+ logSuccess("success proof");
351
+ logWarn("warning proof");
352
+ logError("error proof");
353
+ logProgress("progress proof");
354
+ handleCommandError(new CLIError("failure proof", { hint: "retry proof" }));
355
+ assert.equal(capture.output.stdout, "");
356
+ for (const message of ["debug", "info", "success", "warning", "error", "progress", "failure", "retry"]) {
357
+ assert.match(capture.output.stderr, new RegExp(`${message} proof`, "u"));
356
358
  }
359
+ } finally {
360
+ capture.restore();
361
+ }
357
362
  });
358
- test('MCP suppression still silences diagnostics while retaining errors and recovery hints on stderr', () => {
359
- vi.stubEnv('DEBUG', 'true');
360
- setLogsSuppressed(true);
361
- const capture = captureStreams();
362
- try {
363
- logDebug('hidden');
364
- logInfo('hidden');
365
- logSuccess('hidden');
366
- logWarn('hidden');
367
- logProgress('hidden');
368
- handleCommandError(new CLIError('visible error', { hint: 'visible recovery' }));
369
- assert.equal(capture.output.stdout, '');
370
- assert.doesNotMatch(capture.output.stderr, /hidden/u);
371
- assert.match(capture.output.stderr, /visible error/u);
372
- assert.match(capture.output.stderr, /visible recovery/u);
373
- }
374
- finally {
375
- capture.restore();
376
- }
363
+ test("MCP suppression still silences diagnostics while retaining errors and recovery hints on stderr", () => {
364
+ vi.stubEnv("DEBUG", "true");
365
+ setLogsSuppressed(true);
366
+ const capture = captureStreams();
367
+ try {
368
+ logDebug("hidden");
369
+ logInfo("hidden");
370
+ logSuccess("hidden");
371
+ logWarn("hidden");
372
+ logProgress("hidden");
373
+ handleCommandError(new CLIError("visible error", { hint: "visible recovery" }));
374
+ assert.equal(capture.output.stdout, "");
375
+ assert.doesNotMatch(capture.output.stderr, /hidden/u);
376
+ assert.match(capture.output.stderr, /visible error/u);
377
+ assert.match(capture.output.stderr, /visible recovery/u);
378
+ } finally {
379
+ capture.restore();
380
+ }
377
381
  });
378
- //# sourceMappingURL=stdoutRegression.test.js.map
382
+ //# sourceMappingURL=stdoutRegression.test.js.map