@aviaratech/ai-delivery 0.3.35 → 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 (297) hide show
  1. package/CONTRIBUTING.md +12 -206
  2. package/README.md +57 -554
  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 +1651 -1590
  9. package/dist/boardReconcile.test.js.map +7 -1
  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 +402 -515
  15. package/dist/cli.js.map +7 -1
  16. package/dist/cliResult.d.ts +2 -2
  17. package/dist/cliResult.js +42 -45
  18. package/dist/cliResult.js.map +7 -1
  19. package/dist/cliResult.test.js +424 -369
  20. package/dist/cliResult.test.js.map +7 -1
  21. package/dist/config/deliveryConfig.d.ts +288 -14
  22. package/dist/config/deliveryConfig.js +472 -390
  23. package/dist/config/deliveryConfig.js.map +7 -1
  24. package/dist/config/deliveryConfig.test.js +773 -649
  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 -479
  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.js +649 -0
  53. package/dist/deliveryBoard.test.js.map +7 -0
  54. package/dist/deliveryHealth.test.js +179 -155
  55. package/dist/deliveryHealth.test.js.map +7 -1
  56. package/dist/dependencyCompatibility.test.js +154 -140
  57. package/dist/dependencyCompatibility.test.js.map +7 -1
  58. package/dist/directoryIndependent.test.js +417 -383
  59. package/dist/directoryIndependent.test.js.map +7 -1
  60. package/dist/dispatch.d.ts +16 -11
  61. package/dist/dispatch.js +329 -353
  62. package/dist/dispatch.js.map +7 -1
  63. package/dist/errors.d.ts +3 -3
  64. package/dist/errors.js +103 -96
  65. package/dist/errors.js.map +7 -1
  66. package/dist/fixtures/deliveryBoardReplay.d.ts +56 -0
  67. package/dist/fixtures/deliveryBoardReplay.js +617 -0
  68. package/dist/fixtures/deliveryBoardReplay.js.map +7 -0
  69. package/dist/fixtures/discovery.d.ts +59 -19
  70. package/dist/fixtures/discovery.js +96 -90
  71. package/dist/fixtures/discovery.js.map +7 -1
  72. package/dist/fixtures/inertEntrypointChild.js +57 -56
  73. package/dist/fixtures/inertEntrypointChild.js.map +7 -1
  74. package/dist/fixtures/inertEntrypoints.d.ts +1 -1
  75. package/dist/fixtures/inertEntrypoints.js +321 -276
  76. package/dist/fixtures/inertEntrypoints.js.map +7 -1
  77. package/dist/fixtures/inertTarget.d.ts +78 -7
  78. package/dist/fixtures/inertTarget.js +769 -691
  79. package/dist/fixtures/inertTarget.js.map +7 -1
  80. package/dist/fixtures/issue63.d.ts +4 -3
  81. package/dist/fixtures/issue63.js +260 -274
  82. package/dist/fixtures/issue63.js.map +7 -1
  83. package/dist/fixtures/issueProjectItems.d.ts +20 -0
  84. package/dist/fixtures/issueProjectItems.js +15 -0
  85. package/dist/fixtures/issueProjectItems.js.map +7 -0
  86. package/dist/fixtures/readView.d.ts +120 -0
  87. package/dist/fixtures/readView.js +172 -0
  88. package/dist/fixtures/readView.js.map +7 -0
  89. package/dist/fixtures/recordedGitHubFlows.d.ts +120 -0
  90. package/dist/fixtures/recordedGitHubFlows.js +109 -0
  91. package/dist/fixtures/recordedGitHubFlows.js.map +7 -0
  92. package/dist/genericCompatibility.test.js +64 -55
  93. package/dist/genericCompatibility.test.js.map +7 -1
  94. package/dist/git.js +73 -67
  95. package/dist/git.js.map +7 -1
  96. package/dist/gitProcess.d.ts +1 -1
  97. package/dist/gitProcess.js +58 -53
  98. package/dist/gitProcess.js.map +7 -1
  99. package/dist/github/client.d.ts +2 -2
  100. package/dist/github/client.js +484 -379
  101. package/dist/github/client.js.map +7 -1
  102. package/dist/github/commandIdentityPolicy.js +44 -52
  103. package/dist/github/commandIdentityPolicy.js.map +7 -1
  104. package/dist/github/discovery.d.ts +1 -0
  105. package/dist/github/discovery.js +197 -215
  106. package/dist/github/discovery.js.map +7 -1
  107. package/dist/github/discovery.test.js +223 -177
  108. package/dist/github/discovery.test.js.map +7 -1
  109. package/dist/github/issueHistory.d.ts +2 -2
  110. package/dist/github/issueHistory.js +117 -125
  111. package/dist/github/issueHistory.js.map +7 -1
  112. package/dist/github/machineAuth.d.ts +1 -1
  113. package/dist/github/machineAuth.js +126 -117
  114. package/dist/github/machineAuth.js.map +7 -1
  115. package/dist/github/machineAuth.test.js +755 -639
  116. package/dist/github/machineAuth.test.js.map +7 -1
  117. package/dist/github/nativeIssueMetadata.js +286 -273
  118. package/dist/github/nativeIssueMetadata.js.map +7 -1
  119. package/dist/github/projectDelivery.d.ts +18 -2
  120. package/dist/github/projectDelivery.js +615 -557
  121. package/dist/github/projectDelivery.js.map +7 -1
  122. package/dist/github/relationships.js +433 -389
  123. package/dist/github/relationships.js.map +7 -1
  124. package/dist/github/repo.d.ts +1 -0
  125. package/dist/github/repo.js +123 -96
  126. package/dist/github/repo.js.map +7 -1
  127. package/dist/index.js +3 -3
  128. package/dist/index.js.map +7 -1
  129. package/dist/issue.d.ts +40 -9
  130. package/dist/issue.js +2102 -1742
  131. package/dist/issue.js.map +7 -1
  132. package/dist/issue63History.test.js +40 -42
  133. package/dist/issue63History.test.js.map +7 -1
  134. package/dist/issue63Routes.test.js +154 -143
  135. package/dist/issue63Routes.test.js.map +7 -1
  136. package/dist/issueBatchUpdate.test.js +989 -885
  137. package/dist/issueBatchUpdate.test.js.map +7 -1
  138. package/dist/issueBlockerGuard.test.js +262 -226
  139. package/dist/issueBlockerGuard.test.js.map +7 -1
  140. package/dist/issueContract.d.ts +23 -4
  141. package/dist/issueContract.js +416 -395
  142. package/dist/issueContract.js.map +7 -1
  143. package/dist/issueContract.test.d.ts +4 -3
  144. package/dist/issueContract.test.js +358 -321
  145. package/dist/issueContract.test.js.map +7 -1
  146. package/dist/issueDates.test.js +235 -233
  147. package/dist/issueDates.test.js.map +7 -1
  148. package/dist/issueInfoReadback.test.js +304 -190
  149. package/dist/issueInfoReadback.test.js.map +7 -1
  150. package/dist/issueIntake.test.js +1945 -1732
  151. package/dist/issueIntake.test.js.map +7 -1
  152. package/dist/issueJournal.d.ts +40 -19
  153. package/dist/issueJournal.js +229 -138
  154. package/dist/issueJournal.js.map +7 -1
  155. package/dist/issueJournal.test.js +605 -422
  156. package/dist/issueJournal.test.js.map +7 -1
  157. package/dist/issueRollup.test.d.ts +1 -0
  158. package/dist/issueRollup.test.js +476 -0
  159. package/dist/issueRollup.test.js.map +7 -0
  160. package/dist/issueTracking.test.js +1059 -989
  161. package/dist/issueTracking.test.js.map +7 -1
  162. package/dist/issueWriteRecovery.test.d.ts +1 -0
  163. package/dist/issueWriteRecovery.test.js +260 -0
  164. package/dist/issueWriteRecovery.test.js.map +7 -0
  165. package/dist/lifecycle.test.js +112 -441
  166. package/dist/lifecycle.test.js.map +7 -1
  167. package/dist/logger.js +80 -74
  168. package/dist/logger.js.map +7 -1
  169. package/dist/mcp/index.js +116 -94
  170. package/dist/mcp/index.js.map +7 -1
  171. package/dist/mcp/tools.d.ts +264 -286
  172. package/dist/mcp/tools.js +267 -340
  173. package/dist/mcp/tools.js.map +7 -1
  174. package/dist/pluginAuthProbe.js +63 -52
  175. package/dist/pluginAuthProbe.js.map +7 -1
  176. package/dist/pluginAuthProbe.test.js +85 -62
  177. package/dist/pluginAuthProbe.test.js.map +7 -1
  178. package/dist/pluginCredentials.test.js +282 -259
  179. package/dist/pluginCredentials.test.js.map +7 -1
  180. package/dist/pluginDoctor.test.js +653 -588
  181. package/dist/pluginDoctor.test.js.map +7 -1
  182. package/dist/pluginInstaller.d.ts +7 -5
  183. package/dist/pluginInstaller.js +1173 -1229
  184. package/dist/pluginInstaller.js.map +7 -1
  185. package/dist/pluginInstaller.test.js +1842 -1423
  186. package/dist/pluginInstaller.test.js.map +7 -1
  187. package/dist/pluginPackaging.test.js +460 -409
  188. package/dist/pluginPackaging.test.js.map +7 -1
  189. package/dist/pr.d.ts +132 -94
  190. package/dist/pr.js +1521 -1323
  191. package/dist/pr.js.map +7 -1
  192. package/dist/pr.test.js +1678 -632
  193. package/dist/pr.test.js.map +7 -1
  194. package/dist/prAssociation.test.js +2419 -1788
  195. package/dist/prAssociation.test.js.map +7 -1
  196. package/dist/prDispatch.test.js +150 -89
  197. package/dist/prDispatch.test.js.map +7 -1
  198. package/dist/readView.d.ts +183 -0
  199. package/dist/readView.js +217 -0
  200. package/dist/readView.js.map +7 -0
  201. package/dist/readView.test.d.ts +1 -0
  202. package/dist/readView.test.js +119 -0
  203. package/dist/readView.test.js.map +7 -0
  204. package/dist/releaseReconciliation.test.js +267 -288
  205. package/dist/releaseReconciliation.test.js.map +7 -1
  206. package/dist/releaseWorkflow.test.js +2493 -422
  207. package/dist/releaseWorkflow.test.js.map +7 -1
  208. package/dist/review.d.ts +738 -2
  209. package/dist/review.js +601 -348
  210. package/dist/review.js.map +7 -1
  211. package/dist/review.test.js +1218 -812
  212. package/dist/review.test.js.map +7 -1
  213. package/dist/reviewSubmit.test.d.ts +1 -0
  214. package/dist/reviewSubmit.test.js +747 -0
  215. package/dist/reviewSubmit.test.js.map +7 -0
  216. package/dist/services/agentReadinessService.js +42 -37
  217. package/dist/services/agentReadinessService.js.map +7 -1
  218. package/dist/services/blockerGuardService.js +188 -188
  219. package/dist/services/blockerGuardService.js.map +7 -1
  220. package/dist/services/boardReconcileService.d.ts +125 -125
  221. package/dist/services/boardReconcileService.js +1295 -1421
  222. package/dist/services/boardReconcileService.js.map +7 -1
  223. package/dist/services/deliveryAdmission.js +131 -154
  224. package/dist/services/deliveryAdmission.js.map +7 -1
  225. package/dist/services/deliveryHealthService.js +197 -199
  226. package/dist/services/deliveryHealthService.js.map +7 -1
  227. package/dist/services/legacyIssueMigration.js +263 -277
  228. package/dist/services/legacyIssueMigration.js.map +7 -1
  229. package/dist/services/worktreeRegistry.d.ts +27 -119
  230. package/dist/services/worktreeRegistry.js +765 -1182
  231. package/dist/services/worktreeRegistry.js.map +7 -1
  232. package/dist/stagedChecks.test.js +396 -194
  233. package/dist/stagedChecks.test.js.map +7 -1
  234. package/dist/start.test.js +99 -95
  235. package/dist/start.test.js.map +7 -1
  236. package/dist/stdoutRegression.test.js +353 -352
  237. package/dist/stdoutRegression.test.js.map +7 -1
  238. package/dist/targetPolicyDiscovery.test.js +141 -143
  239. package/dist/targetPolicyDiscovery.test.js.map +7 -1
  240. package/dist/targetPolicyEntrypoints.test.js +308 -269
  241. package/dist/targetPolicyEntrypoints.test.js.map +7 -1
  242. package/dist/targetPolicyLocal.test.js +580 -1051
  243. package/dist/targetPolicyLocal.test.js.map +7 -1
  244. package/dist/targetPolicyRoutes.test.js +305 -281
  245. package/dist/targetPolicyRoutes.test.js.map +7 -1
  246. package/dist/targetRepositoryExecution.test.d.ts +1 -0
  247. package/dist/targetRepositoryExecution.test.js +463 -0
  248. package/dist/targetRepositoryExecution.test.js.map +7 -0
  249. package/dist/terminalMessages.js +41 -35
  250. package/dist/terminalMessages.js.map +7 -1
  251. package/dist/toolOutput.d.ts +2 -0
  252. package/dist/toolOutput.js +36 -0
  253. package/dist/toolOutput.js.map +7 -0
  254. package/dist/toolOutput.test.d.ts +1 -0
  255. package/dist/toolOutput.test.js +240 -0
  256. package/dist/toolOutput.test.js.map +7 -0
  257. package/dist/utils/atomicJson.js +84 -76
  258. package/dist/utils/atomicJson.js.map +7 -1
  259. package/dist/utils/filesystem.js +15 -18
  260. package/dist/utils/filesystem.js.map +7 -1
  261. package/dist/utils/lockfile.js +68 -71
  262. package/dist/utils/lockfile.js.map +7 -1
  263. package/dist/verification.d.ts +1 -19
  264. package/dist/verification.js +1020 -1939
  265. package/dist/verification.js.map +7 -1
  266. package/dist/verificationGate.test.js +127 -117
  267. package/dist/verificationGate.test.js.map +7 -1
  268. package/dist/version.js +23 -24
  269. package/dist/version.js.map +7 -1
  270. package/dist/worktree.d.ts +3 -15
  271. package/dist/worktree.js +97 -177
  272. package/dist/worktree.js.map +7 -1
  273. package/package.json +9 -8
  274. package/plugins/ai-delivery/.claude-plugin/plugin.json +2 -2
  275. package/plugins/ai-delivery/README.md +47 -156
  276. package/plugins/ai-delivery/plugin.json +1 -1
  277. package/plugins/ai-delivery/runtime/dist/THIRD-PARTY-NOTICES.md +238 -44
  278. package/plugins/ai-delivery/runtime/dist/cli.js +358 -115
  279. package/plugins/ai-delivery/runtime/package.json +1 -1
  280. package/plugins/ai-delivery/skills/intake-create/SKILL.md +14 -78
  281. package/plugins/ai-delivery/skills/pr-handoff/SKILL.md +35 -36
  282. package/plugins/ai-delivery/skills/worktree-lifecycle/SKILL.md +14 -15
  283. package/dist/investigationCompletion.test.js +0 -728
  284. package/dist/investigationCompletion.test.js.map +0 -1
  285. package/dist/setup.d.ts +0 -60
  286. package/dist/setup.js +0 -585
  287. package/dist/setup.js.map +0 -1
  288. package/dist/setup.test.js +0 -3329
  289. package/dist/setup.test.js.map +0 -1
  290. package/dist/worktreeTransition.d.ts +0 -211
  291. package/dist/worktreeTransition.js +0 -1037
  292. package/dist/worktreeTransition.js.map +0 -1
  293. package/dist/worktreeTransition.test.js +0 -1191
  294. package/dist/worktreeTransition.test.js.map +0 -1
  295. /package/dist/{investigationCompletion.test.d.ts → build.test.d.ts} +0 -0
  296. /package/dist/{setup.test.d.ts → callerErrors.test.d.ts} +0 -0
  297. /package/dist/{worktreeTransition.test.d.ts → deliveryBoard.test.d.ts} +0 -0
@@ -1,50 +1,49 @@
1
- import assert from 'node:assert/strict';
2
- import { spawnSync } from 'node:child_process';
3
- import { gzipSync } from 'node:zlib';
4
- import { appendFileSync, chmodSync, mkdirSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from 'node:fs';
5
- import { tmpdir } from 'node:os';
6
- import { dirname, join } from 'node:path';
7
- import { fileURLToPath, pathToFileURL } from 'node:url';
8
- import { setTimeout as delay } from 'node:timers/promises';
9
- import { test } from 'vitest';
10
- const source = process.env['AI_DELIVERY_CURRENT_CONSUMER_SCRIPT'] ??
11
- fileURLToPath(new URL('../scripts/current-consumer.mjs', import.meta.url));
12
- const api = (await import(pathToFileURL(source).href));
13
- // Optional caller-owned local evidence. Child environments still use the helper's
14
- // explicit allowlist and never inherit this path or ambient credentials.
15
- const evidencePath = process.env['AI_DELIVERY_CURRENT_CONSUMER_EVIDENCE_FILE'];
1
+ import assert from "node:assert/strict";
2
+ import { spawnSync } from "node:child_process";
3
+ import { gzipSync } from "node:zlib";
4
+ import { appendFileSync, chmodSync, mkdirSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from "node:fs";
5
+ import { tmpdir } from "node:os";
6
+ import { dirname, join } from "node:path";
7
+ import { fileURLToPath, pathToFileURL } from "node:url";
8
+ import { setTimeout as delay } from "node:timers/promises";
9
+ import { test } from "vitest";
10
+ const source = process.env["AI_DELIVERY_CURRENT_CONSUMER_SCRIPT"] ?? fileURLToPath(new URL("../scripts/current-consumer.mjs", import.meta.url));
11
+ const api = await import(pathToFileURL(source).href);
12
+ const evidencePath = process.env["AI_DELIVERY_CURRENT_CONSUMER_EVIDENCE_FILE"];
16
13
  function recordSynthetic(evidence) {
17
- if (evidencePath)
18
- appendFileSync(evidencePath, JSON.stringify({ boundary: 'fictional synthetic fixture', evidence }) + '\n');
14
+ if (evidencePath)
15
+ appendFileSync(evidencePath, JSON.stringify({ boundary: "fictional synthetic fixture", evidence }) + "\n");
19
16
  }
20
17
  const helper = {
21
- ...api,
22
- runOwnedProcess: async (command, args, options) => {
23
- try {
24
- const result = await api.runOwnedProcess(command, args, options);
25
- recordSynthetic({ kind: 'process-result', stdoutSha256: api.sha256(result.stdout), ...result.evidence });
26
- return result;
27
- }
28
- catch (error) {
29
- if (error instanceof Error) {
30
- const e = error;
31
- recordSynthetic({ kind: 'process-failure', code: e.code, evidence: e.evidence });
32
- }
33
- throw error;
34
- }
35
- },
18
+ ...api,
19
+ runOwnedProcess: async (command, args, options) => {
20
+ try {
21
+ const result = await api.runOwnedProcess(command, args, options);
22
+ recordSynthetic({ kind: "process-result", stdoutSha256: api.sha256(result.stdout), ...result.evidence });
23
+ return result;
24
+ } catch (error) {
25
+ if (error instanceof Error) {
26
+ const e = error;
27
+ recordSynthetic({ kind: "process-failure", code: e.code, evidence: e.evidence });
28
+ }
29
+ throw error;
30
+ }
31
+ }
36
32
  };
37
33
  const failure = (code) => (error) => error instanceof Error && error.code === code;
38
- test.each([false, true])('synthetic actual Node24 coverage parent preserves reused explicit env; frozen=%s', (frozen) => {
34
+ test.each([false, true])(
35
+ "synthetic actual Node24 coverage parent preserves reused explicit env; frozen=%s",
36
+ { tags: ["release"] },
37
+ (frozen) => {
39
38
  const f = fixture();
40
39
  let confirmedQuiescence = false;
41
40
  try {
42
- const coverage = join(f.directory, 'coverage');
43
- mkdirSync(coverage);
44
- const program = `import {runOwnedProcess,consumerEnvironment,sha256} from ${JSON.stringify(pathToFileURL(source).href)};
41
+ const coverage = join(f.directory, "coverage");
42
+ mkdirSync(coverage);
43
+ const program = `import {runOwnedProcess,consumerEnvironment,sha256} from ${JSON.stringify(pathToFileURL(source).href)};
45
44
  import process from 'node:process';
46
45
  const input=consumerEnvironment(${JSON.stringify(f.directory)},process.execPath);
47
- const env=${frozen ? 'Object.freeze(input)' : 'input'};
46
+ const env=${frozen ? "Object.freeze(input)" : "input"};
48
47
  const before={...env};const keys=Object.keys(env).sort();
49
48
  const report={boundary:'fictional synthetic process, actual Node24 coverage parent',actualRuntime:process.version,
50
49
  coverageParentEnabled:typeof process.env.NODE_V8_COVERAGE==='string',frozenCaller:Object.isFrozen(env),
@@ -71,762 +70,845 @@ try{
71
70
  report.callerKeysUnchanged=JSON.stringify(Object.keys(env).sort())===JSON.stringify(keys);
72
71
  report.callerValuesUnchanged=keys.every(key=>env[key]===before[key]);
73
72
  console.log(JSON.stringify(report));`;
74
- const parent = spawnSync(process.execPath, ['--input-type=module', '-e', program], {
75
- cwd: f.directory,
76
- env: {
77
- PATH: dirname(process.execPath) + ':/usr/bin:/bin',
78
- HOME: f.directory,
79
- TMPDIR: f.directory,
80
- NO_COLOR: '1',
81
- NODE_V8_COVERAGE: coverage,
82
- },
83
- encoding: 'utf8',
84
- maxBuffer: 512 * 1024,
85
- });
86
- assert.ok(parent.status === 0, 'Synthetic coverage parent failed before its bounded receipt');
87
- const report = JSON.parse(parent.stdout);
88
- recordSynthetic({ kind: 'coverage-caller-env-regression', report, stderrSha256: helper.sha256(parent.stderr) });
89
- confirmedQuiescence = !report.unresolvedOwnedChild && report.phases.every((phase) => phase.quiescent);
90
- assert.equal(report.actualRuntime, 'v24.21.0');
91
- assert.equal(report.coverageParentEnabled, true);
92
- assert.equal(report.status, 'passed');
93
- assert.equal(report.frozenCaller, frozen);
94
- assert.equal(report.callerKeysUnchanged, true);
95
- assert.equal(report.callerValuesUnchanged, true);
96
- assert.equal(report.environmentValuesSerialized, false);
97
- assert.equal(report.unresolvedOwnedChild, false);
98
- assert.equal(report.phases.length, 2);
99
- assert.ok(report.phases.every((phase) => phase.quiescent));
100
- assert.deepEqual(report.rejectedKeys, [
101
- 'NODE_V8_COVERAGE',
102
- 'GH_TOKEN',
103
- 'GH_APP_ID_GPT_REVIEWER',
104
- 'AI_DELIVERY_CONFIG',
105
- 'NODE_PATH',
106
- ]);
107
- }
108
- finally {
109
- if (confirmedQuiescence)
110
- f.cleanup();
111
- else
112
- recordSynthetic({ kind: 'fixture-retained', directory: f.directory, quiescent: false });
113
- }
114
- });
73
+ const parent = spawnSync(process.execPath, ["--input-type=module", "-e", program], {
74
+ cwd: f.directory,
75
+ env: {
76
+ PATH: dirname(process.execPath) + ":/usr/bin:/bin",
77
+ HOME: f.directory,
78
+ TMPDIR: f.directory,
79
+ NO_COLOR: "1",
80
+ NODE_V8_COVERAGE: coverage
81
+ },
82
+ encoding: "utf8",
83
+ maxBuffer: 512 * 1024
84
+ });
85
+ assert.ok(parent.status === 0, "Synthetic coverage parent failed before its bounded receipt");
86
+ const report = JSON.parse(parent.stdout);
87
+ recordSynthetic({ kind: "coverage-caller-env-regression", report, stderrSha256: helper.sha256(parent.stderr) });
88
+ confirmedQuiescence = !report.unresolvedOwnedChild && report.phases.every((phase) => phase.quiescent);
89
+ assert.equal(report.actualRuntime, "v24.21.0");
90
+ assert.equal(report.coverageParentEnabled, true);
91
+ assert.equal(report.status, "passed");
92
+ assert.equal(report.frozenCaller, frozen);
93
+ assert.equal(report.callerKeysUnchanged, true);
94
+ assert.equal(report.callerValuesUnchanged, true);
95
+ assert.equal(report.environmentValuesSerialized, false);
96
+ assert.equal(report.unresolvedOwnedChild, false);
97
+ assert.equal(report.phases.length, 2);
98
+ assert.ok(report.phases.every((phase) => phase.quiescent));
99
+ assert.deepEqual(report.rejectedKeys, [
100
+ "NODE_V8_COVERAGE",
101
+ "GH_TOKEN",
102
+ "GH_APP_ID_GPT_REVIEWER",
103
+ "AI_DELIVERY_CONFIG",
104
+ "NODE_PATH"
105
+ ]);
106
+ } finally {
107
+ if (confirmedQuiescence) f.cleanup();
108
+ else recordSynthetic({ kind: "fixture-retained", directory: f.directory, quiescent: false });
109
+ }
110
+ }
111
+ );
115
112
  function archive(members) {
116
- const chunks = [];
117
- for (const member of members) {
118
- const header = Buffer.alloc(512);
119
- header.write(`package/${member.path}`, 0, 100);
120
- const number = (value, offset, length) => header.write(value.toString(8).padStart(length - 1, '0') + '\0', offset, length);
121
- number(member.mode, 100, 8);
122
- number(0, 108, 8);
123
- number(0, 116, 8);
124
- number(member.bytes.length, 124, 12);
125
- number(0, 136, 12);
126
- header.fill(32, 148, 156);
127
- header.write(member.type ?? '0', 156);
128
- header.write('ustar\0', 257);
129
- header.write('00', 263);
130
- const sum = header.reduce((a, b) => a + b, 0);
131
- header.write(sum.toString(8).padStart(6, '0') + '\0 ', 148, 8);
132
- chunks.push(header, member.bytes, Buffer.alloc((512 - (member.bytes.length % 512)) % 512));
133
- }
134
- chunks.push(Buffer.alloc(1024));
135
- return gzipSync(Buffer.concat(chunks));
113
+ const chunks = [];
114
+ for (const member of members) {
115
+ const header = Buffer.alloc(512);
116
+ header.write(`package/${member.path}`, 0, 100);
117
+ const number = (value, offset, length) => header.write(value.toString(8).padStart(length - 1, "0") + "\0", offset, length);
118
+ number(member.mode, 100, 8);
119
+ number(0, 108, 8);
120
+ number(0, 116, 8);
121
+ number(member.bytes.length, 124, 12);
122
+ number(0, 136, 12);
123
+ header.fill(32, 148, 156);
124
+ header.write(member.type ?? "0", 156);
125
+ header.write("ustar\0", 257);
126
+ header.write("00", 263);
127
+ const sum = header.reduce((a, b) => a + b, 0);
128
+ header.write(sum.toString(8).padStart(6, "0") + "\0 ", 148, 8);
129
+ chunks.push(header, member.bytes, Buffer.alloc((512 - member.bytes.length % 512) % 512));
130
+ }
131
+ chunks.push(Buffer.alloc(1024));
132
+ return gzipSync(Buffer.concat(chunks));
136
133
  }
137
134
  function fixture() {
138
- const directory = mkdtempSync(join(tmpdir(), 'synthetic-current-consumer-'));
139
- const root = join(directory, 'built');
140
- mkdirSync(root);
141
- const manifest = {
142
- name: '@aviaratech/ai-delivery',
143
- version: '0.0.0',
144
- type: 'module',
145
- main: './dist/index.js',
146
- bin: { 'ai-delivery': './dist/cli.js' },
147
- engines: { node: '>=24.21.0 <25 || 26.2.0', npm: '11.19.0' },
148
- exports: {
149
- '.': { default: './dist/index.js', types: './dist/index.d.ts' },
150
- './agent': { default: './dist/agent.js', types: './dist/agent.d.ts' },
151
- './delivery': { default: './dist/delivery/index.js', types: './dist/delivery/index.d.ts' },
152
- './mcp': { default: './dist/mcp/index.js', types: './dist/mcp/index.d.ts' },
153
- },
154
- };
155
- const files = new Map();
156
- files.set('package.json', JSON.stringify(manifest));
157
- for (const path of [
158
- 'LICENSE',
159
- 'README.md',
160
- 'CONTRIBUTING.md',
161
- 'dist/cli.js',
162
- 'plugins/ai-delivery/dist/mcp-launcher.js',
163
- 'plugins/ai-delivery/runtime/dist/cli.js',
164
- 'plugins/ai-delivery/runtime/dist/THIRD-PARTY-NOTICES.md',
165
- ])
166
- files.set(path, 'synthetic inert file\n');
167
- for (const path of ['index', 'agent', 'delivery/index', 'mcp/index'])
168
- for (const ext of ['js', 'd.ts'])
169
- files.set(`dist/${path}.${ext}`, 'synthetic inert export\n');
170
- for (const path of ['plugins/ai-delivery/plugin.json', 'plugins/ai-delivery/.claude-plugin/plugin.json'])
171
- files.set(path, JSON.stringify({ name: 'ai-delivery', version: '0.0.0' }));
172
- files.set('plugins/ai-delivery/runtime/package.json', JSON.stringify({ version: '0.0.0' }));
173
- files.set('plugins/ai-delivery/mcp.json', JSON.stringify({
174
- mcpServers: { 'ai-delivery': { type: 'stdio', command: 'node', args: ['${PLUGIN_ROOT}/dist/mcp-launcher.js'] } },
175
- }));
176
- for (const skill of ['intake-create', 'worktree-lifecycle', 'pr-handoff'])
177
- files.set(`plugins/ai-delivery/skills/${skill}/SKILL.md`, `---\nname: "ai-delivery:${skill}"\ndescription: Synthetic fixture only\n---\n`);
178
- const members = [...files].map(([path, text]) => ({
179
- path,
180
- bytes: Buffer.from(text),
181
- mode: path.endsWith('/cli.js') || path.endsWith('/mcp-launcher.js') ? 0o755 : 0o644,
182
- }));
183
- for (const member of members) {
184
- const path = join(root, member.path);
185
- mkdirSync(dirname(path), { recursive: true });
186
- writeFileSync(path, member.bytes);
187
- chmodSync(path, member.mode);
188
- }
189
- writeFileSync(join(root, 'package-lock.json'), JSON.stringify({ name: manifest.name, version: manifest.version, lockfileVersion: 3, synthetic: true }));
190
- const make = (items = members) => {
191
- const bytes = archive(items);
192
- const archivePath = join(directory, 'synthetic.tgz');
193
- writeFileSync(archivePath, bytes);
194
- const contract = {
195
- sourceRoot: root,
196
- archivePath,
197
- archiveSha256: helper.sha256(bytes),
198
- sourceManifestSha256: helper.sha256(readFileSync(join(root, 'package.json'))),
199
- sourceLockSha256: helper.sha256(readFileSync(join(root, 'package-lock.json'))),
200
- packageVersion: '0.0.0',
201
- dryInventory: items.map(({ path, bytes: data, mode }) => ({ path, size: data.length, mode })),
202
- };
203
- recordSynthetic({ kind: 'archive-contract', ...contract });
204
- return contract;
135
+ const directory = mkdtempSync(join(tmpdir(), "synthetic-current-consumer-"));
136
+ const root = join(directory, "built");
137
+ mkdirSync(root);
138
+ const manifest = {
139
+ name: "@aviaratech/ai-delivery",
140
+ version: "0.0.0",
141
+ type: "module",
142
+ main: "./dist/index.js",
143
+ bin: { "ai-delivery": "./dist/cli.js" },
144
+ engines: { node: ">=24.21.0 <25 || 26.2.0", npm: "11.19.0" },
145
+ exports: {
146
+ ".": { default: "./dist/index.js", types: "./dist/index.d.ts" },
147
+ "./agent": { default: "./dist/agent.js", types: "./dist/agent.d.ts" },
148
+ "./delivery": { default: "./dist/delivery/index.js", types: "./dist/delivery/index.d.ts" },
149
+ "./mcp": { default: "./dist/mcp/index.js", types: "./dist/mcp/index.d.ts" }
150
+ }
151
+ };
152
+ const files = /* @__PURE__ */ new Map();
153
+ files.set("package.json", JSON.stringify(manifest));
154
+ for (const path of [
155
+ "LICENSE",
156
+ "README.md",
157
+ "CONTRIBUTING.md",
158
+ "dist/cli.js",
159
+ "plugins/ai-delivery/dist/mcp-launcher.js",
160
+ "plugins/ai-delivery/runtime/dist/cli.js",
161
+ "plugins/ai-delivery/runtime/dist/THIRD-PARTY-NOTICES.md"
162
+ ])
163
+ files.set(path, "synthetic inert file\n");
164
+ for (const path of ["index", "agent", "delivery/index", "mcp/index"])
165
+ for (const ext of ["js", "d.ts"]) files.set(`dist/${path}.${ext}`, "synthetic inert export\n");
166
+ for (const path of ["plugins/ai-delivery/plugin.json", "plugins/ai-delivery/.claude-plugin/plugin.json"])
167
+ files.set(path, JSON.stringify({ name: "ai-delivery", version: "0.0.0" }));
168
+ files.set("plugins/ai-delivery/runtime/package.json", JSON.stringify({ version: "0.0.0" }));
169
+ files.set(
170
+ "plugins/ai-delivery/mcp.json",
171
+ JSON.stringify({
172
+ mcpServers: { "ai-delivery": { type: "stdio", command: "node", args: ["${PLUGIN_ROOT}/dist/mcp-launcher.js"] } }
173
+ })
174
+ );
175
+ for (const skill of ["intake-create", "worktree-lifecycle", "pr-handoff"])
176
+ files.set(
177
+ `plugins/ai-delivery/skills/${skill}/SKILL.md`,
178
+ `---
179
+ name: "ai-delivery:${skill}"
180
+ description: Synthetic fixture only
181
+ ---
182
+ `
183
+ );
184
+ const members = [...files].map(([path, text]) => ({
185
+ path,
186
+ bytes: Buffer.from(text),
187
+ mode: path.endsWith("/cli.js") || path.endsWith("/mcp-launcher.js") ? 493 : 420
188
+ }));
189
+ for (const member of members) {
190
+ const path = join(root, member.path);
191
+ mkdirSync(dirname(path), { recursive: true });
192
+ writeFileSync(path, member.bytes);
193
+ chmodSync(path, member.mode);
194
+ }
195
+ writeFileSync(
196
+ join(root, "package-lock.json"),
197
+ JSON.stringify({ name: manifest.name, version: manifest.version, lockfileVersion: 3, synthetic: true })
198
+ );
199
+ const make = (items = members) => {
200
+ const bytes = archive(items);
201
+ const archivePath = join(directory, "synthetic.tgz");
202
+ writeFileSync(archivePath, bytes);
203
+ const contract = {
204
+ sourceRoot: root,
205
+ archivePath,
206
+ archiveSha256: helper.sha256(bytes),
207
+ sourceManifestSha256: helper.sha256(readFileSync(join(root, "package.json"))),
208
+ sourceLockSha256: helper.sha256(readFileSync(join(root, "package-lock.json"))),
209
+ packageVersion: "0.0.0",
210
+ dryInventory: items.map(({ path, bytes: data, mode }) => ({ path, size: data.length, mode }))
205
211
  };
206
- return { directory, root, members, make, cleanup: () => rmSync(directory, { recursive: true, force: true }) };
212
+ recordSynthetic({ kind: "archive-contract", ...contract });
213
+ return contract;
214
+ };
215
+ return { directory, root, members, make, cleanup: () => rmSync(directory, { recursive: true, force: true }) };
207
216
  }
208
- test('synthetic current-layout archive binds all inventory bytes/modes; no actual candidate is qualified', async () => {
209
- const f = fixture();
210
- try {
211
- const contract = f.make();
212
- const result = helper.inspectCandidate(contract);
213
- assert.equal(result.inventory.length, f.members.length);
214
- assert.match(result.inventorySha256, /^[a-f0-9]{64}$/u);
215
- const deferred = await helper.runCurrentConsumer(contract);
216
- assert.equal(deferred.status, 'incomplete');
217
- assert.equal(deferred.qualified, false);
218
- assert.match(deferred.reason, /not been admitted/u);
219
- recordSynthetic({ kind: 'noninstalling-helper-result', receipt: deferred });
220
- }
221
- finally {
222
- f.cleanup();
223
- }
217
+ test("synthetic current-layout archive binds all inventory bytes/modes; no actual candidate is qualified", async () => {
218
+ const f = fixture();
219
+ try {
220
+ const contract = f.make();
221
+ const result = helper.inspectCandidate(contract);
222
+ assert.equal(result.inventory.length, f.members.length);
223
+ assert.match(result.inventorySha256, /^[a-f0-9]{64}$/u);
224
+ const deferred = await helper.runCurrentConsumer(contract);
225
+ assert.equal(deferred.status, "incomplete");
226
+ assert.equal(deferred.qualified, false);
227
+ assert.match(deferred.reason, /not been admitted/u);
228
+ recordSynthetic({ kind: "noninstalling-helper-result", receipt: deferred });
229
+ } finally {
230
+ f.cleanup();
231
+ }
224
232
  });
225
- test.each(['../escape', '/absolute', 'dist/../../escape', 'dist\\escape', 'dist/.env', 'other/file'])('synthetic unsafe inventory rejects %s', (path) => {
233
+ test.each(["../escape", "/absolute", "dist/../../escape", "dist\\escape", "dist/.env", "other/file"])(
234
+ "synthetic unsafe inventory rejects %s",
235
+ (path) => {
226
236
  const f = fixture();
227
237
  try {
228
- const contract = f.make([{ path, bytes: Buffer.from('unsafe'), mode: 0o644 }]);
229
- assert.throws(() => helper.readArchive(readFileSync(contract.archivePath), contract.archiveSha256), failure('unsafe-inventory'));
230
- }
231
- finally {
232
- f.cleanup();
233
- }
234
- });
238
+ const contract = f.make([{ path, bytes: Buffer.from("unsafe"), mode: 420 }]);
239
+ assert.throws(
240
+ () => helper.readArchive(readFileSync(contract.archivePath), contract.archiveSha256),
241
+ failure("unsafe-inventory")
242
+ );
243
+ } finally {
244
+ f.cleanup();
245
+ }
246
+ }
247
+ );
235
248
  function producerFixture() {
236
- const f = fixture();
237
- const contract = f.make();
238
- const init = spawnSync('git', ['init', '--quiet'], {
239
- cwd: f.root,
240
- env: { PATH: '/usr/bin:/bin', GIT_CONFIG_GLOBAL: '/dev/null', GIT_CONFIG_SYSTEM: '/dev/null' },
241
- encoding: 'utf8',
242
- });
243
- assert.equal(init.status, 0, init.stderr);
244
- contract.sourceCommit = 'a'.repeat(40);
245
- contract.sourceTree = 'b'.repeat(40);
246
- contract.node24 = process.execPath;
247
- contract.node26 = '/fictional/node26';
248
- contract.npmCli = '/fictional/npm-cli.js';
249
- const files = spawnSync('git', ['ls-files', '-co', '--exclude-standard', '-z'], {
250
- cwd: f.root,
251
- env: { PATH: '/usr/bin:/bin', GIT_CONFIG_GLOBAL: '/dev/null', GIT_CONFIG_SYSTEM: '/dev/null' },
252
- encoding: 'utf8',
253
- });
254
- assert.equal(files.status, 0);
255
- const fingerprint = {
256
- kind: 'working-copy',
257
- sha256: helper.sha256(JSON.stringify([...new Set(files.stdout.split('\0').filter(Boolean))].sort().map((path) => ({
258
- path,
259
- executable: f.members.some((member) => member.path === path && (member.mode & 0o111) !== 0),
260
- sha256: helper.sha256(readFileSync(join(f.root, path))),
261
- })))),
262
- fileCount: new Set(files.stdout.split('\0').filter(Boolean)).size,
263
- };
264
- const gates = ['format', 'lint', 'types', 'build', 'tests', 'inventory'];
265
- const checks = {
266
- schemaVersion: 'contributor-checks@1',
267
- runId: 'fictional-producer-run',
268
- scope: 'full',
269
- status: 'passed',
270
- fullSuccess: true,
271
- exitCode: 0,
272
- selectedTestFiles: ['dist/fictional.test.js'],
273
- tests: { files: 1, total: 1, passed: 1, skips: [] },
274
- gates,
275
- omitted: [],
276
- tree: fingerprint,
277
- commands: gates.map((stage) => ({ stage, status: 'passed', exitCode: 0, signal: null, cleanupConfirmed: true })),
278
- toolchain: {
279
- controller: { version: 'v24.21.0', executable: contract.node24 },
280
- npm: { version: '11.19.0', executable: contract.npmCli },
281
- libraryConsumer: { version: 'v26.2.0', executable: contract.node26 },
282
- },
283
- inventory: {
284
- kind: 'dry-inventory-only',
285
- name: '@aviaratech/ai-delivery',
286
- version: '0.0.0',
287
- fileCount: contract.dryInventory.length,
288
- files: contract.dryInventory,
289
- },
290
- };
291
- const artifact = {
292
- schemaVersion: 'ai-delivery.current-artifact-producer@1',
293
- status: 'passed',
294
- sourceCommit: contract.sourceCommit,
295
- sourceTree: contract.sourceTree,
296
- sourceManifestSha256: contract.sourceManifestSha256,
297
- sourceLockSha256: contract.sourceLockSha256,
298
- packageVersion: contract.packageVersion,
299
- archiveSha256: contract.archiveSha256,
300
- inventorySha256: helper.inspectCandidate(contract).inventorySha256,
301
- sourceFingerprint: fingerprint,
302
- pack: { status: 'passed', exitCode: 0, quiescent: true, archiveSha256: contract.archiveSha256 },
303
- };
304
- const persist = () => {
305
- const checksPath = join(f.directory, 'checks.json');
306
- writeFileSync(checksPath, JSON.stringify(checks));
307
- const digest = helper.sha256(readFileSync(checksPath));
308
- artifact['checksResultSha256'] = digest;
309
- const artifactPath = join(f.directory, 'producer.json');
310
- writeFileSync(artifactPath, JSON.stringify(artifact));
311
- contract.producer = {
312
- checksResultPath: checksPath,
313
- checksResultSha256: digest,
314
- artifactReceiptPath: artifactPath,
315
- artifactReceiptSha256: helper.sha256(readFileSync(artifactPath)),
316
- };
249
+ const f = fixture();
250
+ const contract = f.make();
251
+ const init = spawnSync("git", ["init", "--quiet"], {
252
+ cwd: f.root,
253
+ env: { PATH: "/usr/bin:/bin", GIT_CONFIG_GLOBAL: "/dev/null", GIT_CONFIG_SYSTEM: "/dev/null" },
254
+ encoding: "utf8"
255
+ });
256
+ assert.equal(init.status, 0, init.stderr);
257
+ contract.sourceCommit = "a".repeat(40);
258
+ contract.sourceTree = "b".repeat(40);
259
+ contract.node24 = process.execPath;
260
+ contract.node26 = "/fictional/node26";
261
+ contract.npmCli = "/fictional/npm-cli.js";
262
+ const files = spawnSync("git", ["ls-files", "-co", "--exclude-standard", "-z"], {
263
+ cwd: f.root,
264
+ env: { PATH: "/usr/bin:/bin", GIT_CONFIG_GLOBAL: "/dev/null", GIT_CONFIG_SYSTEM: "/dev/null" },
265
+ encoding: "utf8"
266
+ });
267
+ assert.equal(files.status, 0);
268
+ const fingerprint = {
269
+ kind: "working-copy",
270
+ sha256: helper.sha256(
271
+ JSON.stringify(
272
+ [...new Set(files.stdout.split("\0").filter(Boolean))].sort().map((path) => ({
273
+ path,
274
+ executable: f.members.some((member) => member.path === path && (member.mode & 73) !== 0),
275
+ sha256: helper.sha256(readFileSync(join(f.root, path)))
276
+ }))
277
+ )
278
+ ),
279
+ fileCount: new Set(files.stdout.split("\0").filter(Boolean)).size
280
+ };
281
+ const gates = ["format", "lint", "types", "build", "tests", "inventory"];
282
+ const checks = {
283
+ schemaVersion: "contributor-checks@1",
284
+ runId: "fictional-producer-run",
285
+ scope: "full",
286
+ status: "passed",
287
+ fullSuccess: true,
288
+ exitCode: 0,
289
+ selectedTestFiles: ["src/fictional.test.ts"],
290
+ tests: { files: 1, total: 1, passed: 1, skips: [] },
291
+ gates,
292
+ omitted: [],
293
+ tree: fingerprint,
294
+ commands: gates.map((stage) => ({ stage, status: "passed", exitCode: 0, signal: null, cleanupConfirmed: true })),
295
+ toolchain: {
296
+ controller: { version: "v24.21.0", executable: contract.node24 },
297
+ npm: { version: "11.19.0", executable: contract.npmCli },
298
+ libraryConsumer: { version: "v26.2.0", executable: contract.node26 }
299
+ },
300
+ inventory: {
301
+ kind: "dry-inventory-only",
302
+ name: "@aviaratech/ai-delivery",
303
+ version: "0.0.0",
304
+ fileCount: contract.dryInventory.length,
305
+ files: contract.dryInventory
306
+ }
307
+ };
308
+ const artifact = {
309
+ schemaVersion: "ai-delivery.current-artifact-producer@1",
310
+ status: "passed",
311
+ sourceCommit: contract.sourceCommit,
312
+ sourceTree: contract.sourceTree,
313
+ sourceManifestSha256: contract.sourceManifestSha256,
314
+ sourceLockSha256: contract.sourceLockSha256,
315
+ packageVersion: contract.packageVersion,
316
+ archiveSha256: contract.archiveSha256,
317
+ inventorySha256: helper.inspectCandidate(contract).inventorySha256,
318
+ sourceFingerprint: fingerprint,
319
+ pack: { status: "passed", exitCode: 0, quiescent: true, archiveSha256: contract.archiveSha256 }
320
+ };
321
+ const persist = () => {
322
+ const checksPath = join(f.directory, "checks.json");
323
+ writeFileSync(checksPath, JSON.stringify(checks));
324
+ const digest = helper.sha256(readFileSync(checksPath));
325
+ artifact["checksResultSha256"] = digest;
326
+ const artifactPath = join(f.directory, "producer.json");
327
+ writeFileSync(artifactPath, JSON.stringify(artifact));
328
+ contract.producer = {
329
+ checksResultPath: checksPath,
330
+ checksResultSha256: digest,
331
+ artifactReceiptPath: artifactPath,
332
+ artifactReceiptSha256: helper.sha256(readFileSync(artifactPath))
317
333
  };
318
- persist();
319
- return { f, contract, checks, artifact, persist };
334
+ };
335
+ persist();
336
+ return { f, contract, checks, artifact, persist };
320
337
  }
321
- test('synthetic canonical producer join accepts matching source and archive, but never qualifies without install admission', async () => {
322
- const { f, contract } = producerFixture();
323
- try {
324
- const joined = helper.verifyProducerJoin(contract, helper.inspectCandidate(contract));
325
- assert.equal(joined['actualArchiveSha256'], contract.archiveSha256);
326
- const result = await helper.runCurrentConsumer(contract);
327
- assert.equal(result.status, 'incomplete');
328
- assert.equal(result.qualified, false);
329
- recordSynthetic({ kind: 'fictional-canonical-producer-join', joined, result, actualApplicationBoundary: false });
330
- }
331
- finally {
332
- f.cleanup();
333
- }
338
+ test("synthetic canonical producer join accepts matching source and archive, but never qualifies without install admission", async () => {
339
+ const { f, contract } = producerFixture();
340
+ try {
341
+ const joined = helper.verifyProducerJoin(contract, helper.inspectCandidate(contract));
342
+ assert.equal(joined["actualArchiveSha256"], contract.archiveSha256);
343
+ const result = await helper.runCurrentConsumer(contract);
344
+ assert.equal(result.status, "incomplete");
345
+ assert.equal(result.qualified, false);
346
+ recordSynthetic({ kind: "fictional-canonical-producer-join", joined, result, actualApplicationBoundary: false });
347
+ } finally {
348
+ f.cleanup();
349
+ }
334
350
  });
335
351
  test.each([
336
- 'scope',
337
- 'status',
338
- 'fullSuccess',
339
- 'exitCode',
340
- 'gates',
341
- 'omitted',
342
- 'tree',
343
- 'commands',
344
- 'toolchain',
345
- 'inventory',
346
- 'tests',
347
- 'selectedTestFiles',
348
- ])('synthetic canonical %s incompleteness cannot qualify rebuilt artifact', (field) => {
349
- const { f, contract, checks, persist } = producerFixture();
350
- try {
351
- checks[field] = field === 'gates' || field === 'omitted' ? ['build'] : null;
352
- persist();
353
- assert.throws(() => helper.verifyProducerJoin(contract, helper.inspectCandidate(contract)), failure('producer'));
354
- }
355
- finally {
356
- f.cleanup();
357
- }
352
+ "scope",
353
+ "status",
354
+ "fullSuccess",
355
+ "exitCode",
356
+ "gates",
357
+ "omitted",
358
+ "tree",
359
+ "commands",
360
+ "toolchain",
361
+ "inventory",
362
+ "tests",
363
+ "selectedTestFiles"
364
+ ])("synthetic canonical %s incompleteness cannot qualify rebuilt artifact", (field) => {
365
+ const { f, contract, checks, persist } = producerFixture();
366
+ try {
367
+ checks[field] = field === "gates" || field === "omitted" ? ["build"] : null;
368
+ persist();
369
+ assert.throws(() => helper.verifyProducerJoin(contract, helper.inspectCandidate(contract)), failure("producer"));
370
+ } finally {
371
+ f.cleanup();
372
+ }
358
373
  });
359
374
  test.each([
360
- 'sourceCommit',
361
- 'sourceTree',
362
- 'sourceManifestSha256',
363
- 'sourceLockSha256',
364
- 'packageVersion',
365
- 'archiveSha256',
366
- 'inventorySha256',
367
- 'pack',
368
- 'sourceFingerprint',
369
- ])('synthetic artifact producer %s drift cannot reuse old producer proof', (field) => {
370
- const { f, contract, artifact, persist } = producerFixture();
371
- try {
372
- artifact[field] = null;
373
- persist();
374
- assert.throws(() => helper.verifyProducerJoin(contract, helper.inspectCandidate(contract)), failure('producer'));
375
- }
376
- finally {
377
- f.cleanup();
378
- }
375
+ "sourceCommit",
376
+ "sourceTree",
377
+ "sourceManifestSha256",
378
+ "sourceLockSha256",
379
+ "packageVersion",
380
+ "archiveSha256",
381
+ "inventorySha256",
382
+ "pack",
383
+ "sourceFingerprint"
384
+ ])("synthetic artifact producer %s drift cannot reuse old producer proof", (field) => {
385
+ const { f, contract, artifact, persist } = producerFixture();
386
+ try {
387
+ artifact[field] = null;
388
+ persist();
389
+ assert.throws(() => helper.verifyProducerJoin(contract, helper.inspectCandidate(contract)), failure("producer"));
390
+ } finally {
391
+ f.cleanup();
392
+ }
379
393
  });
380
- test('synthetic producer hash and source-file drift are refused before any install', () => {
381
- const { f, contract, persist } = producerFixture();
382
- try {
383
- assert.ok(contract.producer);
384
- appendFileSync(contract.producer.checksResultPath, ' ');
385
- assert.throws(() => helper.verifyProducerJoin(contract, helper.inspectCandidate(contract)), failure('producer'));
386
- persist();
387
- writeFileSync(join(f.root, 'changed-untracked-source.ts'), 'synthetic new source');
388
- assert.throws(() => helper.verifyProducerJoin(contract, helper.inspectCandidate(contract)), failure('producer'));
389
- delete contract.producer;
390
- assert.throws(() => helper.verifyProducerJoin(contract, helper.inspectCandidate(contract)), failure('producer'));
391
- }
392
- finally {
393
- f.cleanup();
394
- }
394
+ test("synthetic producer hash and source-file drift are refused before any install", () => {
395
+ const { f, contract, persist } = producerFixture();
396
+ try {
397
+ assert.ok(contract.producer);
398
+ appendFileSync(contract.producer.checksResultPath, " ");
399
+ assert.throws(() => helper.verifyProducerJoin(contract, helper.inspectCandidate(contract)), failure("producer"));
400
+ persist();
401
+ writeFileSync(join(f.root, "changed-untracked-source.ts"), "synthetic new source");
402
+ assert.throws(() => helper.verifyProducerJoin(contract, helper.inspectCandidate(contract)), failure("producer"));
403
+ delete contract.producer;
404
+ assert.throws(() => helper.verifyProducerJoin(contract, helper.inspectCandidate(contract)), failure("producer"));
405
+ } finally {
406
+ f.cleanup();
407
+ }
395
408
  });
396
409
  test.each([
397
- 'missing-gate',
398
- 'duplicate-gate',
399
- 'nonquiescent',
400
- 'zero-tests',
401
- 'zero-selection',
402
- 'unexpected-skip',
403
- 'dry-inventory-byte-drift',
404
- ])('synthetic canonical producer refuses %s despite a claimed full success', (kind) => {
405
- const { f, contract, checks, persist } = producerFixture();
406
- try {
407
- const steps = checks['commands'];
408
- if (kind === 'missing-gate')
409
- steps.pop();
410
- else if (kind === 'duplicate-gate')
411
- steps[5] = steps[4];
412
- else if (kind === 'nonquiescent')
413
- steps[3]['cleanupConfirmed'] = false;
414
- else if (kind === 'zero-tests')
415
- checks['tests'] = { files: 1, total: 0, passed: 0, skips: [] };
416
- else if (kind === 'zero-selection') {
417
- checks['selectedTestFiles'] = [];
418
- checks['tests'] = { files: 0, total: 1, passed: 1, skips: [] };
419
- }
420
- else if (kind === 'unexpected-skip')
421
- checks['tests'] = {
422
- files: 1,
423
- total: 2,
424
- passed: 1,
425
- skips: [{ file: 'dist/fictional.test.js', title: 'unreviewed skip', kind: 'unreviewed' }],
426
- };
427
- else
428
- checks['inventory'] = {
429
- kind: 'dry-inventory-only',
430
- name: '@aviaratech/ai-delivery',
431
- version: '0.0.0',
432
- fileCount: 1,
433
- files: [{ path: 'package.json', size: 1, mode: 0o644 }],
434
- };
435
- persist();
436
- assert.throws(() => helper.verifyProducerJoin(contract, helper.inspectCandidate(contract)), failure('producer'));
437
- }
438
- finally {
439
- f.cleanup();
440
- }
410
+ "missing-gate",
411
+ "duplicate-gate",
412
+ "nonquiescent",
413
+ "zero-tests",
414
+ "zero-selection",
415
+ "unexpected-skip",
416
+ "dry-inventory-byte-drift"
417
+ ])("synthetic canonical producer refuses %s despite a claimed full success", (kind) => {
418
+ const { f, contract, checks, persist } = producerFixture();
419
+ try {
420
+ const steps = checks["commands"];
421
+ if (kind === "missing-gate") steps.pop();
422
+ else if (kind === "duplicate-gate") steps[5] = steps[4];
423
+ else if (kind === "nonquiescent") steps[3]["cleanupConfirmed"] = false;
424
+ else if (kind === "zero-tests") checks["tests"] = { files: 1, total: 0, passed: 0, skips: [] };
425
+ else if (kind === "zero-selection") {
426
+ checks["selectedTestFiles"] = [];
427
+ checks["tests"] = { files: 0, total: 1, passed: 1, skips: [] };
428
+ } else if (kind === "unexpected-skip")
429
+ checks["tests"] = {
430
+ files: 1,
431
+ total: 2,
432
+ passed: 1,
433
+ skips: [{ file: "dist/fictional.test.js", title: "unreviewed skip", kind: "unreviewed" }]
434
+ };
435
+ else
436
+ checks["inventory"] = {
437
+ kind: "dry-inventory-only",
438
+ name: "@aviaratech/ai-delivery",
439
+ version: "0.0.0",
440
+ fileCount: 1,
441
+ files: [{ path: "package.json", size: 1, mode: 420 }]
442
+ };
443
+ persist();
444
+ assert.throws(() => helper.verifyProducerJoin(contract, helper.inspectCandidate(contract)), failure("producer"));
445
+ } finally {
446
+ f.cleanup();
447
+ }
441
448
  });
442
- test.each(['1', '2', '3', '6'])('synthetic tar link/special type %s cannot reach npm extraction', (type) => {
443
- const f = fixture();
444
- try {
445
- const contract = f.make([{ path: 'dist/link', bytes: Buffer.alloc(0), mode: 0o644, type }]);
446
- assert.throws(() => helper.readArchive(readFileSync(contract.archivePath), contract.archiveSha256), failure('unsafe-inventory'));
447
- }
448
- finally {
449
- f.cleanup();
450
- }
449
+ test.each(["1", "2", "3", "6"])("synthetic tar link/special type %s cannot reach npm extraction", (type) => {
450
+ const f = fixture();
451
+ try {
452
+ const contract = f.make([{ path: "dist/link", bytes: Buffer.alloc(0), mode: 420, type }]);
453
+ assert.throws(
454
+ () => helper.readArchive(readFileSync(contract.archivePath), contract.archiveSha256),
455
+ failure("unsafe-inventory")
456
+ );
457
+ } finally {
458
+ f.cleanup();
459
+ }
451
460
  });
452
- test('synthetic corruption, duplicates, inventory omissions and built-byte drift fail closed', () => {
453
- const f = fixture();
454
- try {
455
- let contract = f.make();
456
- assert.throws(() => helper.readArchive(readFileSync(contract.archivePath), 'a'.repeat(64)), failure('archive-digest'));
457
- contract = f.make([...f.members, f.members[0]]);
458
- assert.throws(() => helper.inspectCandidate(contract), failure('unsafe-inventory'));
459
- contract = f.make();
460
- contract.dryInventory.pop();
461
- assert.throws(() => helper.inspectCandidate(contract), failure('inventory-mismatch'));
462
- contract = f.make();
463
- writeFileSync(join(f.root, 'README.md'), 'changed');
464
- assert.throws(() => helper.inspectCandidate(contract), failure('built-bytes'));
465
- }
466
- finally {
467
- f.cleanup();
468
- }
461
+ test("synthetic corruption, duplicates, inventory omissions and built-byte drift fail closed", () => {
462
+ const f = fixture();
463
+ try {
464
+ let contract = f.make();
465
+ assert.throws(
466
+ () => helper.readArchive(readFileSync(contract.archivePath), "a".repeat(64)),
467
+ failure("archive-digest")
468
+ );
469
+ contract = f.make([...f.members, f.members[0]]);
470
+ assert.throws(() => helper.inspectCandidate(contract), failure("unsafe-inventory"));
471
+ contract = f.make();
472
+ contract.dryInventory.pop();
473
+ assert.throws(() => helper.inspectCandidate(contract), failure("inventory-mismatch"));
474
+ contract = f.make();
475
+ writeFileSync(join(f.root, "README.md"), "changed");
476
+ assert.throws(() => helper.inspectCandidate(contract), failure("built-bytes"));
477
+ } finally {
478
+ f.cleanup();
479
+ }
469
480
  });
470
- test('synthetic installed package rejects unexpected files beyond the accepted inventory', () => {
471
- const f = fixture();
472
- try {
473
- const candidate = helper.inspectCandidate(f.make());
474
- rmSync(join(f.root, 'package-lock.json'));
475
- helper.verifyInstalledPackage(f.root, candidate.inventory);
476
- writeFileSync(join(f.root, 'dist', 'unexpected.js'), 'unexpected');
477
- assert.throws(() => helper.verifyInstalledPackage(f.root, candidate.inventory), failure('installed-bytes'));
478
- }
479
- finally {
480
- f.cleanup();
481
- }
481
+ test("synthetic installed package rejects unexpected files beyond the accepted inventory", () => {
482
+ const f = fixture();
483
+ try {
484
+ const candidate = helper.inspectCandidate(f.make());
485
+ rmSync(join(f.root, "package-lock.json"));
486
+ helper.verifyInstalledPackage(f.root, candidate.inventory);
487
+ writeFileSync(join(f.root, "dist", "unexpected.js"), "unexpected");
488
+ assert.throws(() => helper.verifyInstalledPackage(f.root, candidate.inventory), failure("installed-bytes"));
489
+ } finally {
490
+ f.cleanup();
491
+ }
482
492
  });
483
493
  test.each([
484
- 'dist/index.js',
485
- 'plugins/ai-delivery/runtime/dist/cli.js',
486
- 'plugins/ai-delivery/skills/intake-create/SKILL.md',
487
- ])('synthetic missing packaged entry %s fails inspection', (path) => {
488
- const f = fixture();
489
- try {
490
- assert.throws(() => helper.inspectCandidate(f.make(f.members.filter((member) => member.path !== path))), failure('missing-file'));
491
- }
492
- finally {
493
- f.cleanup();
494
- }
494
+ "dist/index.js",
495
+ "plugins/ai-delivery/runtime/dist/cli.js",
496
+ "plugins/ai-delivery/skills/intake-create/SKILL.md"
497
+ ])("synthetic missing packaged entry %s fails inspection", (path) => {
498
+ const f = fixture();
499
+ try {
500
+ assert.throws(
501
+ () => helper.inspectCandidate(f.make(f.members.filter((member) => member.path !== path))),
502
+ failure("missing-file")
503
+ );
504
+ } finally {
505
+ f.cleanup();
506
+ }
495
507
  });
496
- test.each(['name', 'version', 'runtime'])('synthetic wrong package %s cannot pass', (kind) => {
497
- const f = fixture();
498
- try {
499
- const member = f.members.find((item) => item.path === 'package.json');
500
- const pkg = JSON.parse(member.bytes.toString());
501
- if (kind === 'name')
502
- pkg.name = 'other';
503
- else if (kind === 'version')
504
- pkg.version = '0.0.1';
505
- else
506
- pkg.engines.node = '>=20';
507
- member.bytes = Buffer.from(JSON.stringify(pkg));
508
- assert.throws(() => helper.inspectCandidate(f.make()), failure(kind === 'runtime' ? 'runtime' : 'package-identity'));
509
- }
510
- finally {
511
- f.cleanup();
512
- }
508
+ test.each(["name", "version", "runtime"])("synthetic wrong package %s cannot pass", (kind) => {
509
+ const f = fixture();
510
+ try {
511
+ const member = f.members.find((item) => item.path === "package.json");
512
+ const pkg = JSON.parse(member.bytes.toString());
513
+ if (kind === "name") pkg.name = "other";
514
+ else if (kind === "version") pkg.version = "0.0.1";
515
+ else pkg.engines.node = ">=20";
516
+ member.bytes = Buffer.from(JSON.stringify(pkg));
517
+ assert.throws(
518
+ () => helper.inspectCandidate(f.make()),
519
+ failure(kind === "runtime" ? "runtime" : "package-identity")
520
+ );
521
+ } finally {
522
+ f.cleanup();
523
+ }
513
524
  });
514
- test('synthetic environment never borrows ambient author/reviewer/preload or npm configuration', () => {
515
- const f = fixture();
516
- try {
517
- const env = helper.consumerEnvironment(f.directory, process.execPath);
518
- for (const name of [
519
- 'GH_TOKEN',
520
- 'GH_APP_ID_GPT_REVIEWER',
521
- 'GH_INSTALLATION_ID_GPT_REVIEWER',
522
- 'GH_PRIVATE_KEY_GPT_REVIEWER',
523
- 'NODE_PATH',
524
- 'NODE_OPTIONS',
525
- 'AI_DELIVERY_CONFIG',
526
- ])
527
- assert.equal(env[name], undefined);
528
- assert.equal(readFileSync(env['npm_config_userconfig'], 'utf8'), '');
529
- assert.notEqual(env['npm_config_userconfig'], env['npm_config_globalconfig']);
530
- }
531
- finally {
532
- f.cleanup();
533
- }
525
+ test("synthetic environment never borrows ambient author/reviewer/preload or npm configuration", () => {
526
+ const f = fixture();
527
+ try {
528
+ const env = helper.consumerEnvironment(f.directory, process.execPath);
529
+ for (const name of [
530
+ "GH_TOKEN",
531
+ "GH_APP_ID_GPT_REVIEWER",
532
+ "GH_INSTALLATION_ID_GPT_REVIEWER",
533
+ "GH_PRIVATE_KEY_GPT_REVIEWER",
534
+ "NODE_PATH",
535
+ "NODE_OPTIONS",
536
+ "AI_DELIVERY_CONFIG"
537
+ ])
538
+ assert.equal(env[name], void 0);
539
+ assert.equal(readFileSync(env["npm_config_userconfig"], "utf8"), "");
540
+ assert.notEqual(env["npm_config_userconfig"], env["npm_config_globalconfig"]);
541
+ } finally {
542
+ f.cleanup();
543
+ }
534
544
  });
535
- test('synthetic resolver demonstrates a borrowing false positive, then rejects external and undeclared hoisted dependencies', async () => {
545
+ test(
546
+ "synthetic resolver demonstrates a borrowing false positive, then rejects external and undeclared hoisted dependencies",
547
+ { tags: ["release"] },
548
+ async () => {
536
549
  const f = fixture();
537
550
  try {
538
- const consumer = join(f.directory, 'consumer');
539
- mkdirSync(consumer);
540
- writeFileSync(join(consumer, 'package.json'), JSON.stringify({ type: 'module', dependencies: {} }));
541
- const borrowed = join(f.directory, 'node_modules', 'borrowed-only');
542
- mkdirSync(borrowed, { recursive: true });
543
- writeFileSync(join(borrowed, 'package.json'), JSON.stringify({ name: 'borrowed-only', type: 'module', exports: './index.js' }));
544
- writeFileSync(join(borrowed, 'index.js'), 'export const borrowed=true;');
545
- const env = helper.consumerEnvironment(f.directory, process.execPath);
546
- const probe = join(consumer, 'owned-probe.mjs');
547
- writeFileSync(probe, "console.log((await import('borrowed-only')).borrowed)");
548
- const args = [probe];
549
- assert.equal((await helper.runOwnedProcess(process.execPath, args, { cwd: consumer, env })).stdout.trim(), 'true');
550
- const guard = join(consumer, 'owned-guard.mjs');
551
- writeFileSync(guard, helper.resolutionGuard(consumer));
552
- await assert.rejects(helper.runOwnedProcess(process.execPath, ['--import', guard, ...args], { cwd: consumer, env }), failure('isolation'));
553
- const hoisted = join(consumer, 'node_modules', 'borrowed-only');
554
- mkdirSync(hoisted, { recursive: true });
555
- writeFileSync(join(hoisted, 'package.json'), readFileSync(join(borrowed, 'package.json')));
556
- writeFileSync(join(hoisted, 'index.js'), 'export const borrowed=true;');
557
- await assert.rejects(helper.runOwnedProcess(process.execPath, ['--import', guard, ...args], { cwd: consumer, env }), failure('dependency'));
558
- }
559
- finally {
560
- f.cleanup();
561
- }
562
- });
563
- test.each(['network', 'permission', 'process'])('synthetic external %s failure retains bounded quiescent evidence', async (kind) => {
551
+ const consumer = join(f.directory, "consumer");
552
+ mkdirSync(consumer);
553
+ writeFileSync(join(consumer, "package.json"), JSON.stringify({ type: "module", dependencies: {} }));
554
+ const borrowed = join(f.directory, "node_modules", "borrowed-only");
555
+ mkdirSync(borrowed, { recursive: true });
556
+ writeFileSync(
557
+ join(borrowed, "package.json"),
558
+ JSON.stringify({ name: "borrowed-only", type: "module", exports: "./index.js" })
559
+ );
560
+ writeFileSync(join(borrowed, "index.js"), "export const borrowed=true;");
561
+ const env = helper.consumerEnvironment(f.directory, process.execPath);
562
+ const probe = join(consumer, "owned-probe.mjs");
563
+ writeFileSync(probe, "console.log((await import('borrowed-only')).borrowed)");
564
+ const args = [probe];
565
+ assert.equal(
566
+ (await helper.runOwnedProcess(process.execPath, args, { cwd: consumer, env })).stdout.trim(),
567
+ "true"
568
+ );
569
+ const guard = join(consumer, "owned-guard.mjs");
570
+ writeFileSync(guard, helper.resolutionGuard(consumer));
571
+ await assert.rejects(
572
+ helper.runOwnedProcess(process.execPath, ["--import", guard, ...args], { cwd: consumer, env }),
573
+ failure("isolation")
574
+ );
575
+ const hoisted = join(consumer, "node_modules", "borrowed-only");
576
+ mkdirSync(hoisted, { recursive: true });
577
+ writeFileSync(join(hoisted, "package.json"), readFileSync(join(borrowed, "package.json")));
578
+ writeFileSync(join(hoisted, "index.js"), "export const borrowed=true;");
579
+ await assert.rejects(
580
+ helper.runOwnedProcess(process.execPath, ["--import", guard, ...args], { cwd: consumer, env }),
581
+ failure("dependency")
582
+ );
583
+ } finally {
584
+ f.cleanup();
585
+ }
586
+ }
587
+ );
588
+ test.each(["network", "permission", "process"])(
589
+ "synthetic external %s failure retains bounded quiescent evidence",
590
+ { tags: ["release"] },
591
+ async (kind) => {
564
592
  const f = fixture();
565
593
  try {
566
- const env = helper.consumerEnvironment(f.directory, process.execPath);
567
- const text = kind === 'network' ? 'ENOTFOUND' : kind === 'permission' ? 'EACCES' : 'synthetic npm failure';
568
- await assert.rejects(helper.runOwnedProcess(process.execPath, ['-e', `process.stderr.write(${JSON.stringify(text)});process.exit(1)`], { cwd: f.directory, env }), (error) => failure(kind)(error) && error.evidence.quiescent === true);
569
- assert.throws(() => helper.parseJsonOutput('startup banner\n{}'), failure('schema'));
570
- }
571
- finally {
572
- f.cleanup();
573
- }
574
- });
575
- test('synthetic interrupted owned child is quiescent before disposable fixture cleanup', async () => {
594
+ const env = helper.consumerEnvironment(f.directory, process.execPath);
595
+ const text = kind === "network" ? "ENOTFOUND" : kind === "permission" ? "EACCES" : "synthetic npm failure";
596
+ await assert.rejects(
597
+ helper.runOwnedProcess(
598
+ process.execPath,
599
+ ["-e", `process.stderr.write(${JSON.stringify(text)});process.exit(1)`],
600
+ { cwd: f.directory, env }
601
+ ),
602
+ (error) => failure(kind)(error) && error.evidence.quiescent === true
603
+ );
604
+ assert.throws(() => helper.parseJsonOutput("startup banner\n{}"), failure("schema"));
605
+ } finally {
606
+ f.cleanup();
607
+ }
608
+ }
609
+ );
610
+ test(
611
+ "synthetic interrupted owned child is quiescent before disposable fixture cleanup",
612
+ { tags: ["release"] },
613
+ async () => {
576
614
  const f = fixture();
577
615
  const cancellation = new AbortController();
578
616
  try {
579
- const env = helper.consumerEnvironment(f.directory, process.execPath);
580
- await assert.rejects(helper.runOwnedProcess(process.execPath, ['-e', 'setInterval(()=>{},1000)'], {
581
- cwd: f.directory,
582
- env,
583
- signal: cancellation.signal,
584
- onSpawn: () => setTimeout(() => cancellation.abort(), 50),
585
- }), (error) => {
586
- assert.equal(error.code, 'cancelled');
587
- assert.equal(error.evidence.quiescent, true);
588
- assert.ok(error.evidence.birth);
589
- return true;
590
- });
591
- }
592
- finally {
593
- f.cleanup();
594
- }
595
- });
596
- test('synthetic bounded-output failure never becomes successful stdout/schema proof', async () => {
617
+ const env = helper.consumerEnvironment(f.directory, process.execPath);
618
+ await assert.rejects(
619
+ helper.runOwnedProcess(process.execPath, ["-e", "setInterval(()=>{},1000)"], {
620
+ cwd: f.directory,
621
+ env,
622
+ signal: cancellation.signal,
623
+ onSpawn: () => setTimeout(() => cancellation.abort(), 50)
624
+ }),
625
+ (error) => {
626
+ assert.equal(error.code, "cancelled");
627
+ assert.equal(error.evidence.quiescent, true);
628
+ assert.ok(error.evidence.birth);
629
+ return true;
630
+ }
631
+ );
632
+ } finally {
633
+ f.cleanup();
634
+ }
635
+ }
636
+ );
637
+ test(
638
+ "synthetic bounded-output failure never becomes successful stdout/schema proof",
639
+ { tags: ["release"] },
640
+ async () => {
597
641
  const f = fixture();
598
642
  try {
599
- await assert.rejects(helper.runOwnedProcess(process.execPath, ['-e', "process.stdout.write('x'.repeat(10000))"], {
600
- cwd: f.directory,
601
- env: helper.consumerEnvironment(f.directory, process.execPath),
602
- maxOutputBytes: 128,
603
- }), failure('output-bound'));
604
- }
605
- finally {
606
- f.cleanup();
607
- }
608
- });
643
+ await assert.rejects(
644
+ helper.runOwnedProcess(process.execPath, ["-e", "process.stdout.write('x'.repeat(10000))"], {
645
+ cwd: f.directory,
646
+ env: helper.consumerEnvironment(f.directory, process.execPath),
647
+ maxOutputBytes: 128
648
+ }),
649
+ failure("output-bound")
650
+ );
651
+ } finally {
652
+ f.cleanup();
653
+ }
654
+ }
655
+ );
609
656
  test.each([
610
- '---\nname: "ai-delivery:intake-create"\ndescription: Synthetic fixture only\n',
611
- '---\nother: Header\n---\nname: "ai-delivery:intake-create"\ndescription: Body only\n',
612
- ])('synthetic malformed skill frontmatter fails within the delimited header', (text) => {
613
- const f = fixture();
614
- try {
615
- const member = f.members.find((item) => item.path === 'plugins/ai-delivery/skills/intake-create/SKILL.md');
616
- member.bytes = Buffer.from(text);
617
- assert.throws(() => helper.inspectCandidate(f.make()), failure('schema'));
618
- }
619
- finally {
620
- f.cleanup();
621
- }
657
+ '---\nname: "ai-delivery:intake-create"\ndescription: Synthetic fixture only\n',
658
+ '---\nother: Header\n---\nname: "ai-delivery:intake-create"\ndescription: Body only\n'
659
+ ])("synthetic malformed skill frontmatter fails within the delimited header", (text) => {
660
+ const f = fixture();
661
+ try {
662
+ const member = f.members.find((item) => item.path === "plugins/ai-delivery/skills/intake-create/SKILL.md");
663
+ member.bytes = Buffer.from(text);
664
+ assert.throws(() => helper.inspectCandidate(f.make()), failure("schema"));
665
+ } finally {
666
+ f.cleanup();
667
+ }
622
668
  });
623
- test('synthetic nested type-only manifest uses the installed package declaration owner', async () => {
669
+ test(
670
+ "synthetic nested type-only manifest uses the installed package declaration owner",
671
+ { tags: ["release"] },
672
+ async () => {
624
673
  const f = fixture();
625
674
  try {
626
- const consumer = join(f.directory, 'consumer');
627
- mkdirSync(consumer);
628
- writeFileSync(join(consumer, 'package.json'), JSON.stringify({ name: 'fictional-consumer', type: 'module', dependencies: { '@fictional/sdk': '0' } }));
629
- const sdk = join(consumer, 'node_modules', '@fictional', 'sdk');
630
- const esm = join(sdk, 'dist', 'esm');
631
- mkdirSync(esm, { recursive: true });
632
- writeFileSync(join(sdk, 'package.json'), JSON.stringify({
633
- name: '@fictional/sdk',
634
- type: 'module',
635
- exports: './dist/esm/index.js',
636
- dependencies: { 'declared-only': '0' },
637
- }));
638
- writeFileSync(join(esm, 'package.json'), '{"type":"module"}');
639
- const dep = join(sdk, 'node_modules', 'declared-only');
640
- mkdirSync(dep, { recursive: true });
641
- writeFileSync(join(dep, 'package.json'), JSON.stringify({ name: 'declared-only', type: 'module', exports: './index.js' }));
642
- writeFileSync(join(dep, 'index.js'), 'export const value=true;');
643
- writeFileSync(join(esm, 'index.js'), "import {value} from 'declared-only';console.log(value);");
644
- const guard = join(consumer, 'owned-guard.mjs');
645
- writeFileSync(guard, helper.resolutionGuard(consumer));
646
- const env = helper.consumerEnvironment(f.directory, process.execPath);
647
- const probe = join(consumer, 'owned-probe.mjs');
648
- writeFileSync(probe, "await import('@fictional/sdk')");
649
- const args = ['--import', guard, probe];
650
- assert.equal((await helper.runOwnedProcess(process.execPath, args, { cwd: consumer, env })).stdout.trim(), 'true');
651
- writeFileSync(join(esm, 'index.js'), "await import('missing-only');");
652
- await assert.rejects(helper.runOwnedProcess(process.execPath, args, { cwd: consumer, env }), failure('dependency'));
653
- const hoisted = join(consumer, 'node_modules', 'undeclared-only');
654
- mkdirSync(hoisted, { recursive: true });
655
- writeFileSync(join(hoisted, 'package.json'), JSON.stringify({ name: 'undeclared-only', type: 'module', exports: './index.js' }));
656
- writeFileSync(join(hoisted, 'index.js'), 'export const value=true;');
657
- writeFileSync(join(esm, 'index.js'), "await import('undeclared-only');");
658
- await assert.rejects(helper.runOwnedProcess(process.execPath, args, { cwd: consumer, env }), failure('dependency'));
659
- }
660
- finally {
661
- f.cleanup();
662
- }
663
- });
664
- test('synthetic cancellation kills an observed resistant descendant after its parent exits', async () => {
675
+ const consumer = join(f.directory, "consumer");
676
+ mkdirSync(consumer);
677
+ writeFileSync(
678
+ join(consumer, "package.json"),
679
+ JSON.stringify({ name: "fictional-consumer", type: "module", dependencies: { "@fictional/sdk": "0" } })
680
+ );
681
+ const sdk = join(consumer, "node_modules", "@fictional", "sdk");
682
+ const esm = join(sdk, "dist", "esm");
683
+ mkdirSync(esm, { recursive: true });
684
+ writeFileSync(
685
+ join(sdk, "package.json"),
686
+ JSON.stringify({
687
+ name: "@fictional/sdk",
688
+ type: "module",
689
+ exports: "./dist/esm/index.js",
690
+ dependencies: { "declared-only": "0" }
691
+ })
692
+ );
693
+ writeFileSync(join(esm, "package.json"), '{"type":"module"}');
694
+ const dep = join(sdk, "node_modules", "declared-only");
695
+ mkdirSync(dep, { recursive: true });
696
+ writeFileSync(
697
+ join(dep, "package.json"),
698
+ JSON.stringify({ name: "declared-only", type: "module", exports: "./index.js" })
699
+ );
700
+ writeFileSync(join(dep, "index.js"), "export const value=true;");
701
+ writeFileSync(join(esm, "index.js"), "import {value} from 'declared-only';console.log(value);");
702
+ const guard = join(consumer, "owned-guard.mjs");
703
+ writeFileSync(guard, helper.resolutionGuard(consumer));
704
+ const env = helper.consumerEnvironment(f.directory, process.execPath);
705
+ const probe = join(consumer, "owned-probe.mjs");
706
+ writeFileSync(probe, "await import('@fictional/sdk')");
707
+ const args = ["--import", guard, probe];
708
+ assert.equal(
709
+ (await helper.runOwnedProcess(process.execPath, args, { cwd: consumer, env })).stdout.trim(),
710
+ "true"
711
+ );
712
+ writeFileSync(join(esm, "index.js"), "await import('missing-only');");
713
+ await assert.rejects(
714
+ helper.runOwnedProcess(process.execPath, args, { cwd: consumer, env }),
715
+ failure("dependency")
716
+ );
717
+ const hoisted = join(consumer, "node_modules", "undeclared-only");
718
+ mkdirSync(hoisted, { recursive: true });
719
+ writeFileSync(
720
+ join(hoisted, "package.json"),
721
+ JSON.stringify({ name: "undeclared-only", type: "module", exports: "./index.js" })
722
+ );
723
+ writeFileSync(join(hoisted, "index.js"), "export const value=true;");
724
+ writeFileSync(join(esm, "index.js"), "await import('undeclared-only');");
725
+ await assert.rejects(
726
+ helper.runOwnedProcess(process.execPath, args, { cwd: consumer, env }),
727
+ failure("dependency")
728
+ );
729
+ } finally {
730
+ f.cleanup();
731
+ }
732
+ }
733
+ );
734
+ test(
735
+ "synthetic cancellation kills an observed resistant descendant after its parent exits",
736
+ { tags: ["release"], timeout: 5e3 },
737
+ async () => {
665
738
  const f = fixture();
666
739
  const cancellation = new AbortController();
667
740
  let quiescent = false;
668
741
  try {
669
- const env = helper.consumerEnvironment(f.directory, process.execPath);
670
- const descendant = join(f.directory, 'descendant.cjs');
671
- writeFileSync(descendant, "process.on('SIGTERM',()=>{});require('node:fs').writeFileSync('ready',String(process.pid));setInterval(()=>{},1000);");
672
- const parent = join(f.directory, 'parent.cjs');
673
- writeFileSync(parent, "require('node:child_process').spawn(process.execPath,[process.argv[2]],{stdio:['ignore',process.stdout,process.stderr]});setInterval(()=>{},1000);");
674
- const running = helper.runOwnedProcess(process.execPath, [parent, descendant], {
675
- cwd: f.directory,
676
- env,
677
- signal: cancellation.signal,
678
- });
679
- // Synchronize to the child's ready marker; allow one 50ms identity sample.
680
- for (let i = 0; i < 100; i++) {
681
- try {
682
- readFileSync(join(f.directory, 'ready'));
683
- break;
684
- }
685
- catch {
686
- await delay(10);
687
- }
742
+ const env = helper.consumerEnvironment(f.directory, process.execPath);
743
+ const descendant = join(f.directory, "descendant.cjs");
744
+ writeFileSync(
745
+ descendant,
746
+ "process.on('SIGTERM',()=>{});require('node:fs').writeFileSync('ready',String(process.pid));setInterval(()=>{},1000);"
747
+ );
748
+ const parent = join(f.directory, "parent.cjs");
749
+ writeFileSync(
750
+ parent,
751
+ "require('node:child_process').spawn(process.execPath,[process.argv[2]],{stdio:['ignore',process.stdout,process.stderr]});setInterval(()=>{},1000);"
752
+ );
753
+ const running = helper.runOwnedProcess(process.execPath, [parent, descendant], {
754
+ cwd: f.directory,
755
+ env,
756
+ signal: cancellation.signal
757
+ });
758
+ for (let i = 0; i < 100; i++) {
759
+ try {
760
+ readFileSync(join(f.directory, "ready"));
761
+ break;
762
+ } catch {
763
+ await delay(10);
688
764
  }
689
- await delay(150);
690
- cancellation.abort();
691
- await assert.rejects(running, (error) => {
692
- const e = error;
693
- quiescent = e.evidence.quiescent === true;
694
- assert.equal(e.code, 'cancelled');
695
- assert.equal(quiescent, true);
696
- assert.ok((e.evidence.observed?.length ?? 0) >= 2);
697
- return true;
698
- });
699
- }
700
- finally {
701
- if (quiescent)
702
- f.cleanup();
703
- }
704
- }, 5000);
705
- test('synthetic unknown or reused process identity is refused rather than signaled', () => {
706
- const known = [{ pid: 1, birth: 'first', rssBytes: 0 }];
707
- assert.deepEqual(helper.ownedSignalTargets(known, null), { targets: [], unknown: true });
708
- assert.deepEqual(helper.ownedSignalTargets(known, [{ pid: 1, birth: 'reused', rssBytes: 0 }]), {
709
- targets: [],
710
- unknown: true,
711
- });
765
+ }
766
+ await delay(150);
767
+ cancellation.abort();
768
+ await assert.rejects(running, (error) => {
769
+ const e = error;
770
+ quiescent = e.evidence.quiescent === true;
771
+ assert.equal(e.code, "cancelled");
772
+ assert.equal(quiescent, true);
773
+ assert.ok((e.evidence.observed?.length ?? 0) >= 2);
774
+ return true;
775
+ });
776
+ } finally {
777
+ if (quiescent) f.cleanup();
778
+ }
779
+ }
780
+ );
781
+ test("synthetic unknown or reused process identity is refused rather than signaled", () => {
782
+ const known = [{ pid: 1, birth: "first", rssBytes: 0 }];
783
+ assert.deepEqual(helper.ownedSignalTargets(known, null), { targets: [], unknown: true });
784
+ assert.deepEqual(helper.ownedSignalTargets(known, [{ pid: 1, birth: "reused", rssBytes: 0 }]), {
785
+ targets: [],
786
+ unknown: true
787
+ });
712
788
  });
713
- test.each(['created', 'prepared', 'cleanup', 'unknown-quiescence'])('synthetic disposable %s failure preserves receipt and owned cleanup evidence', async (kind) => {
789
+ test.each(["created", "prepared", "cleanup", "unknown-quiescence"])(
790
+ "synthetic disposable %s failure preserves receipt and owned cleanup evidence",
791
+ async (kind) => {
714
792
  const f = fixture();
715
793
  let retained;
716
794
  try {
717
- const receipt = {
718
- status: 'incomplete',
719
- qualified: false,
720
- phases: [{ phase: 'prior', synthetic: true }],
721
- cleanup: null,
722
- };
723
- const result = await helper.withDisposableConsumer(f.root, process.execPath, 'a'.repeat(64), receipt, async (context) => {
724
- if (kind === 'unknown-quiescence')
725
- context.setQuiescent(false);
726
- return receipt;
727
- }, {
728
- fault: (phase, directory) => {
729
- retained = directory;
730
- if (kind === 'cleanup' && phase === 'cleanup')
731
- writeFileSync(join(directory, 'owned.json'), 'corrupt marker');
732
- if (kind === phase && (kind === 'created' || kind === 'prepared'))
733
- throw Object.assign(new Error('fictional permission failure'), { code: 'EACCES' });
734
- },
735
- });
736
- assert.equal(result.status, 'incomplete');
737
- assert.equal(result.qualified, false);
738
- assert.deepEqual(result.phases, [{ phase: 'prior', synthetic: true }]);
739
- assert.equal(result.cleanup?.removed, kind === 'created' || kind === 'prepared');
740
- if (kind === 'cleanup')
741
- assert.ok(result.cleanup?.failure);
742
- if (kind === 'unknown-quiescence')
743
- assert.equal(result.cleanup?.quiescent, false);
744
- }
745
- finally {
746
- // These are explicit injected filesystem/quiescence faults with no processes.
747
- if (retained)
748
- rmSync(retained, { recursive: true, force: true });
749
- f.cleanup();
750
- }
751
- });
795
+ const receipt = {
796
+ status: "incomplete",
797
+ qualified: false,
798
+ phases: [{ phase: "prior", synthetic: true }],
799
+ cleanup: null
800
+ };
801
+ const result = await helper.withDisposableConsumer(
802
+ f.root,
803
+ process.execPath,
804
+ "a".repeat(64),
805
+ receipt,
806
+ async (context) => {
807
+ if (kind === "unknown-quiescence") context.setQuiescent(false);
808
+ return receipt;
809
+ },
810
+ {
811
+ fault: (phase, directory) => {
812
+ retained = directory;
813
+ if (kind === "cleanup" && phase === "cleanup")
814
+ writeFileSync(join(directory, "owned.json"), "corrupt marker");
815
+ if (kind === phase && (kind === "created" || kind === "prepared"))
816
+ throw Object.assign(new Error("fictional permission failure"), { code: "EACCES" });
817
+ }
818
+ }
819
+ );
820
+ assert.equal(result.status, "incomplete");
821
+ assert.equal(result.qualified, false);
822
+ assert.deepEqual(result.phases, [{ phase: "prior", synthetic: true }]);
823
+ assert.equal(result.cleanup?.removed, kind === "created" || kind === "prepared");
824
+ if (kind === "cleanup") assert.ok(result.cleanup?.failure);
825
+ if (kind === "unknown-quiescence") assert.equal(result.cleanup?.quiescent, false);
826
+ } finally {
827
+ if (retained) rmSync(retained, { recursive: true, force: true });
828
+ f.cleanup();
829
+ }
830
+ }
831
+ );
752
832
  test.each([
753
- 'startup',
754
- 'schema',
755
- 'matching-schema',
756
- 'resistant-startup',
757
- 'resistant-schema',
758
- 'resistant-matching-schema',
759
- ])('synthetic packaged stdio MCP %s exercises its explicit mocked schema and shutdown boundary', async (kind) => {
833
+ "startup",
834
+ "schema",
835
+ "matching-schema",
836
+ "resistant-startup",
837
+ "resistant-schema",
838
+ "resistant-matching-schema"
839
+ ])(
840
+ "synthetic packaged stdio MCP %s exercises its explicit mocked schema and shutdown boundary",
841
+ { tags: ["release"] },
842
+ async (kind) => {
760
843
  const f = fixture();
761
844
  let quiescent = true;
762
845
  try {
763
- const consumer = join(f.directory, 'consumer');
764
- mkdirSync(consumer);
765
- writeFileSync(join(consumer, 'package.json'), JSON.stringify({ type: 'module' }));
766
- const pkg = join(consumer, 'node_modules', '@aviaratech', 'ai-delivery');
767
- mkdirSync(pkg, { recursive: true });
768
- writeFileSync(join(pkg, 'package.json'), JSON.stringify({ name: '@aviaratech/ai-delivery', type: 'module', exports: { './mcp': './mcp.js' } }));
769
- writeFileSync(join(pkg, 'mcp.js'), 'export const AI_DELIVERY_MCP_TOOLS=[];');
770
- const zod = join(pkg, 'node_modules', 'zod');
771
- mkdirSync(zod, { recursive: true });
772
- writeFileSync(join(zod, 'package.json'), JSON.stringify({ name: 'zod', main: 'index.cjs' }));
773
- writeFileSync(join(zod, 'index.cjs'), 'exports.toJSONSchema=()=>({});');
774
- const launcher = join(consumer, 'fictional-packaged-launcher.cjs');
775
- const startup = kind === 'startup';
776
- const resistant = kind.startsWith('resistant-');
777
- const tools = ['matching-schema', 'resistant-matching-schema'].includes(kind)
778
- ? []
779
- : [{ name: 'unexpected', inputSchema: {} }];
780
- const server = `process.on('SIGTERM',${resistant ? '()=>{}' : '()=>process.exit(0)'});
846
+ const consumer = join(f.directory, "consumer");
847
+ mkdirSync(consumer);
848
+ writeFileSync(join(consumer, "package.json"), JSON.stringify({ type: "module" }));
849
+ const pkg = join(consumer, "node_modules", "@aviaratech", "ai-delivery");
850
+ mkdirSync(pkg, { recursive: true });
851
+ writeFileSync(
852
+ join(pkg, "package.json"),
853
+ JSON.stringify({ name: "@aviaratech/ai-delivery", type: "module", exports: { "./mcp": "./mcp.js" } })
854
+ );
855
+ writeFileSync(join(pkg, "mcp.js"), "export const AI_DELIVERY_MCP_TOOLS=[];");
856
+ const zod = join(pkg, "node_modules", "zod");
857
+ mkdirSync(zod, { recursive: true });
858
+ writeFileSync(join(zod, "package.json"), JSON.stringify({ name: "zod", main: "index.cjs" }));
859
+ writeFileSync(join(zod, "index.cjs"), "exports.toJSONSchema=()=>({});");
860
+ const launcher = join(consumer, "fictional-packaged-launcher.cjs");
861
+ const startup = kind === "startup";
862
+ const resistant = kind.startsWith("resistant-");
863
+ const tools = ["matching-schema", "resistant-matching-schema"].includes(kind) ? [] : [{ name: "unexpected", inputSchema: {} }];
864
+ const server = `process.on('SIGTERM',${resistant ? "()=>{}" : "()=>process.exit(0)"});
781
865
  require('node:readline').createInterface({input:process.stdin}).on('line',line=>{
782
866
  const m=JSON.parse(line);if(m.id===1)console.log(JSON.stringify({jsonrpc:'2.0',id:1,result:{serverInfo:{version:'0.0.0'}}}));
783
867
  if(m.id===2)console.log(JSON.stringify({jsonrpc:'2.0',id:2,result:{tools:${JSON.stringify(tools)}}}));
784
868
  });`;
785
- writeFileSync(launcher, startup
786
- ? 'process.exit(1);'
787
- : kind === 'resistant-startup'
788
- ? "process.on('SIGTERM',()=>{});console.log('fictional startup banner');setInterval(()=>{},1000);"
789
- : server);
790
- const probe = join(consumer, 'owned-mcp.mjs');
791
- writeFileSync(probe, helper.MCP_PROBE);
792
- quiescent = false;
793
- const running = helper.runOwnedProcess(process.execPath, [probe, launcher, '0.0.0'], {
794
- cwd: consumer,
795
- env: helper.consumerEnvironment(f.directory, process.execPath),
869
+ writeFileSync(
870
+ launcher,
871
+ startup ? "process.exit(1);" : kind === "resistant-startup" ? "process.on('SIGTERM',()=>{});console.log('fictional startup banner');setInterval(()=>{},1000);" : server
872
+ );
873
+ const probe = join(consumer, "owned-mcp.mjs");
874
+ writeFileSync(probe, helper.MCP_PROBE);
875
+ quiescent = false;
876
+ const running = helper.runOwnedProcess(process.execPath, [probe, launcher, "0.0.0"], {
877
+ cwd: consumer,
878
+ env: helper.consumerEnvironment(f.directory, process.execPath)
879
+ });
880
+ if (kind === "matching-schema") {
881
+ const result = await running;
882
+ quiescent = result.evidence.quiescent;
883
+ assert.deepEqual(helper.parseJsonOutput(result.stdout), {
884
+ toolCount: 0,
885
+ schemas: [],
886
+ protocol: "stdio initialize/tools/list",
887
+ version: "0.0.0"
796
888
  });
797
- if (kind === 'matching-schema') {
798
- const result = await running;
799
- quiescent = result.evidence.quiescent;
800
- assert.deepEqual(helper.parseJsonOutput(result.stdout), {
801
- toolCount: 0,
802
- schemas: [],
803
- protocol: 'stdio initialize/tools/list',
804
- version: '0.0.0',
805
- });
806
- assert.equal(result.evidence.quiescent, true);
807
- }
808
- else
809
- await assert.rejects(running, (error) => {
810
- quiescent = error.evidence.quiescent === true;
811
- return failure(kind === 'resistant-matching-schema' ? 'cleanup' : 'schema')(error) && quiescent;
812
- });
813
- }
814
- finally {
815
- if (quiescent)
816
- f.cleanup();
817
- else
818
- recordSynthetic({ kind: 'fixture-retained', directory: f.directory, quiescent: false });
819
- }
820
- });
821
- test.each(['sourceManifestSha256', 'sourceLockSha256'])('synthetic integrated %s digest drift cannot reuse an older archive as candidate proof', (field) => {
889
+ assert.equal(result.evidence.quiescent, true);
890
+ } else
891
+ await assert.rejects(running, (error) => {
892
+ quiescent = error.evidence.quiescent === true;
893
+ return failure(kind === "resistant-matching-schema" ? "cleanup" : "schema")(error) && quiescent;
894
+ });
895
+ } finally {
896
+ if (quiescent) f.cleanup();
897
+ else recordSynthetic({ kind: "fixture-retained", directory: f.directory, quiescent: false });
898
+ }
899
+ }
900
+ );
901
+ test.each(["sourceManifestSha256", "sourceLockSha256"])(
902
+ "synthetic integrated %s digest drift cannot reuse an older archive as candidate proof",
903
+ (field) => {
822
904
  const f = fixture();
823
905
  try {
824
- const contract = f.make();
825
- contract[field] = 'a'.repeat(64);
826
- assert.throws(() => helper.inspectCandidate(contract), failure('source-identity'));
827
- }
828
- finally {
829
- f.cleanup();
830
- }
831
- });
832
- //# sourceMappingURL=currentConsumer.test.js.map
906
+ const contract = f.make();
907
+ contract[field] = "a".repeat(64);
908
+ assert.throws(() => helper.inspectCandidate(contract), failure("source-identity"));
909
+ } finally {
910
+ f.cleanup();
911
+ }
912
+ }
913
+ );
914
+ //# sourceMappingURL=currentConsumer.test.js.map