@memnexus-ai/mx-agent-cli 0.1.296 → 0.1.297

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 (736) hide show
  1. package/dist/commands/create.d.ts +36 -0
  2. package/dist/commands/create.d.ts.map +1 -1
  3. package/dist/commands/create.js +85 -8
  4. package/dist/commands/create.js.map +1 -1
  5. package/dist/standards/decision-request.md +6 -57
  6. package/dist/standards/po-communication-standard.md +0 -34
  7. package/dist/standards/report-format.md +0 -90
  8. package/dist/standards/writing-standard.md +0 -312
  9. package/package.json +3 -1
  10. package/dist/__tests__/agent-attribution.test.d.ts +0 -16
  11. package/dist/__tests__/agent-attribution.test.d.ts.map +0 -1
  12. package/dist/__tests__/agent-attribution.test.js +0 -250
  13. package/dist/__tests__/agent-attribution.test.js.map +0 -1
  14. package/dist/__tests__/agents-md-canonicalization.test.d.ts +0 -23
  15. package/dist/__tests__/agents-md-canonicalization.test.d.ts.map +0 -1
  16. package/dist/__tests__/agents-md-canonicalization.test.js +0 -319
  17. package/dist/__tests__/agents-md-canonicalization.test.js.map +0 -1
  18. package/dist/__tests__/behavioral-compliance.test.d.ts +0 -8
  19. package/dist/__tests__/behavioral-compliance.test.d.ts.map +0 -1
  20. package/dist/__tests__/behavioral-compliance.test.js +0 -226
  21. package/dist/__tests__/behavioral-compliance.test.js.map +0 -1
  22. package/dist/__tests__/behavioral-extraction.test.d.ts +0 -12
  23. package/dist/__tests__/behavioral-extraction.test.d.ts.map +0 -1
  24. package/dist/__tests__/behavioral-extraction.test.js +0 -330
  25. package/dist/__tests__/behavioral-extraction.test.js.map +0 -1
  26. package/dist/__tests__/behavioral-git-read.test.d.ts +0 -21
  27. package/dist/__tests__/behavioral-git-read.test.d.ts.map +0 -1
  28. package/dist/__tests__/behavioral-git-read.test.js +0 -955
  29. package/dist/__tests__/behavioral-git-read.test.js.map +0 -1
  30. package/dist/__tests__/behavioral-injection.test.d.ts +0 -13
  31. package/dist/__tests__/behavioral-injection.test.d.ts.map +0 -1
  32. package/dist/__tests__/behavioral-injection.test.js +0 -384
  33. package/dist/__tests__/behavioral-injection.test.js.map +0 -1
  34. package/dist/__tests__/binary-smoke.test.d.ts +0 -12
  35. package/dist/__tests__/binary-smoke.test.d.ts.map +0 -1
  36. package/dist/__tests__/binary-smoke.test.js +0 -88
  37. package/dist/__tests__/binary-smoke.test.js.map +0 -1
  38. package/dist/__tests__/bootstrap-behavioral-contract.test.d.ts +0 -18
  39. package/dist/__tests__/bootstrap-behavioral-contract.test.d.ts.map +0 -1
  40. package/dist/__tests__/bootstrap-behavioral-contract.test.js +0 -104
  41. package/dist/__tests__/bootstrap-behavioral-contract.test.js.map +0 -1
  42. package/dist/__tests__/bundle-config.test.d.ts +0 -18
  43. package/dist/__tests__/bundle-config.test.d.ts.map +0 -1
  44. package/dist/__tests__/bundle-config.test.js +0 -123
  45. package/dist/__tests__/bundle-config.test.js.map +0 -1
  46. package/dist/__tests__/catalog-interaction.test.d.ts +0 -25
  47. package/dist/__tests__/catalog-interaction.test.d.ts.map +0 -1
  48. package/dist/__tests__/catalog-interaction.test.js +0 -269
  49. package/dist/__tests__/catalog-interaction.test.js.map +0 -1
  50. package/dist/__tests__/catalog-named-memories.test.d.ts +0 -2
  51. package/dist/__tests__/catalog-named-memories.test.d.ts.map +0 -1
  52. package/dist/__tests__/catalog-named-memories.test.js +0 -204
  53. package/dist/__tests__/catalog-named-memories.test.js.map +0 -1
  54. package/dist/__tests__/catalog-origin-main.test.d.ts +0 -15
  55. package/dist/__tests__/catalog-origin-main.test.d.ts.map +0 -1
  56. package/dist/__tests__/catalog-origin-main.test.js +0 -305
  57. package/dist/__tests__/catalog-origin-main.test.js.map +0 -1
  58. package/dist/__tests__/catalog.test.d.ts +0 -2
  59. package/dist/__tests__/catalog.test.d.ts.map +0 -1
  60. package/dist/__tests__/catalog.test.js +0 -131
  61. package/dist/__tests__/catalog.test.js.map +0 -1
  62. package/dist/__tests__/claude-local-sanitizer.test.d.ts +0 -24
  63. package/dist/__tests__/claude-local-sanitizer.test.d.ts.map +0 -1
  64. package/dist/__tests__/claude-local-sanitizer.test.js +0 -906
  65. package/dist/__tests__/claude-local-sanitizer.test.js.map +0 -1
  66. package/dist/__tests__/claude-md-compose.test.d.ts +0 -17
  67. package/dist/__tests__/claude-md-compose.test.d.ts.map +0 -1
  68. package/dist/__tests__/claude-md-compose.test.js +0 -119
  69. package/dist/__tests__/claude-md-compose.test.js.map +0 -1
  70. package/dist/__tests__/claude-sync.test.d.ts +0 -2
  71. package/dist/__tests__/claude-sync.test.d.ts.map +0 -1
  72. package/dist/__tests__/claude-sync.test.js +0 -571
  73. package/dist/__tests__/claude-sync.test.js.map +0 -1
  74. package/dist/__tests__/cli-build-integration.test.d.ts +0 -2
  75. package/dist/__tests__/cli-build-integration.test.d.ts.map +0 -1
  76. package/dist/__tests__/cli-build-integration.test.js +0 -64
  77. package/dist/__tests__/cli-build-integration.test.js.map +0 -1
  78. package/dist/__tests__/cli-build.test.d.ts +0 -2
  79. package/dist/__tests__/cli-build.test.d.ts.map +0 -1
  80. package/dist/__tests__/cli-build.test.js +0 -640
  81. package/dist/__tests__/cli-build.test.js.map +0 -1
  82. package/dist/__tests__/codex-agent-gate.test.d.ts +0 -2
  83. package/dist/__tests__/codex-agent-gate.test.d.ts.map +0 -1
  84. package/dist/__tests__/codex-agent-gate.test.js +0 -480
  85. package/dist/__tests__/codex-agent-gate.test.js.map +0 -1
  86. package/dist/__tests__/codex-deploy-config.test.d.ts +0 -2
  87. package/dist/__tests__/codex-deploy-config.test.d.ts.map +0 -1
  88. package/dist/__tests__/codex-deploy-config.test.js +0 -1230
  89. package/dist/__tests__/codex-deploy-config.test.js.map +0 -1
  90. package/dist/__tests__/codex-trust-keys.test.d.ts +0 -2
  91. package/dist/__tests__/codex-trust-keys.test.d.ts.map +0 -1
  92. package/dist/__tests__/codex-trust-keys.test.js +0 -731
  93. package/dist/__tests__/codex-trust-keys.test.js.map +0 -1
  94. package/dist/__tests__/codex-write-race.test.d.ts +0 -2
  95. package/dist/__tests__/codex-write-race.test.d.ts.map +0 -1
  96. package/dist/__tests__/codex-write-race.test.js +0 -2253
  97. package/dist/__tests__/codex-write-race.test.js.map +0 -1
  98. package/dist/__tests__/completion-rows-discriminate.test.d.ts +0 -20
  99. package/dist/__tests__/completion-rows-discriminate.test.d.ts.map +0 -1
  100. package/dist/__tests__/completion-rows-discriminate.test.js +0 -481
  101. package/dist/__tests__/completion-rows-discriminate.test.js.map +0 -1
  102. package/dist/__tests__/config-command.test.d.ts +0 -9
  103. package/dist/__tests__/config-command.test.d.ts.map +0 -1
  104. package/dist/__tests__/config-command.test.js +0 -75
  105. package/dist/__tests__/config-command.test.js.map +0 -1
  106. package/dist/__tests__/config-fidelity-archived-symlinks.test.d.ts +0 -2
  107. package/dist/__tests__/config-fidelity-archived-symlinks.test.d.ts.map +0 -1
  108. package/dist/__tests__/config-fidelity-archived-symlinks.test.js +0 -127
  109. package/dist/__tests__/config-fidelity-archived-symlinks.test.js.map +0 -1
  110. package/dist/__tests__/config-fidelity-display.test.d.ts +0 -2
  111. package/dist/__tests__/config-fidelity-display.test.d.ts.map +0 -1
  112. package/dist/__tests__/config-fidelity-display.test.js +0 -77
  113. package/dist/__tests__/config-fidelity-display.test.js.map +0 -1
  114. package/dist/__tests__/config-fidelity-unreadable-fixture.d.ts +0 -32
  115. package/dist/__tests__/config-fidelity-unreadable-fixture.d.ts.map +0 -1
  116. package/dist/__tests__/config-fidelity-unreadable-fixture.js +0 -37
  117. package/dist/__tests__/config-fidelity-unreadable-fixture.js.map +0 -1
  118. package/dist/__tests__/config-fidelity.test.d.ts +0 -16
  119. package/dist/__tests__/config-fidelity.test.d.ts.map +0 -1
  120. package/dist/__tests__/config-fidelity.test.js +0 -2679
  121. package/dist/__tests__/config-fidelity.test.js.map +0 -1
  122. package/dist/__tests__/config-generation-gate.test.d.ts +0 -46
  123. package/dist/__tests__/config-generation-gate.test.d.ts.map +0 -1
  124. package/dist/__tests__/config-generation-gate.test.js +0 -435
  125. package/dist/__tests__/config-generation-gate.test.js.map +0 -1
  126. package/dist/__tests__/config-generation.test.d.ts +0 -7
  127. package/dist/__tests__/config-generation.test.d.ts.map +0 -1
  128. package/dist/__tests__/config-generation.test.js +0 -141
  129. package/dist/__tests__/config-generation.test.js.map +0 -1
  130. package/dist/__tests__/config-sync.test.d.ts +0 -10
  131. package/dist/__tests__/config-sync.test.d.ts.map +0 -1
  132. package/dist/__tests__/config-sync.test.js +0 -268
  133. package/dist/__tests__/config-sync.test.js.map +0 -1
  134. package/dist/__tests__/coordination-401-production-wiring.test.d.ts +0 -19
  135. package/dist/__tests__/coordination-401-production-wiring.test.d.ts.map +0 -1
  136. package/dist/__tests__/coordination-401-production-wiring.test.js +0 -286
  137. package/dist/__tests__/coordination-401-production-wiring.test.js.map +0 -1
  138. package/dist/__tests__/coordination-401-recovery.test.d.ts +0 -22
  139. package/dist/__tests__/coordination-401-recovery.test.d.ts.map +0 -1
  140. package/dist/__tests__/coordination-401-recovery.test.js +0 -601
  141. package/dist/__tests__/coordination-401-recovery.test.js.map +0 -1
  142. package/dist/__tests__/coordination-brief-pin.test.d.ts +0 -20
  143. package/dist/__tests__/coordination-brief-pin.test.d.ts.map +0 -1
  144. package/dist/__tests__/coordination-brief-pin.test.js +0 -66
  145. package/dist/__tests__/coordination-brief-pin.test.js.map +0 -1
  146. package/dist/__tests__/coordination-brief.test.d.ts +0 -9
  147. package/dist/__tests__/coordination-brief.test.d.ts.map +0 -1
  148. package/dist/__tests__/coordination-brief.test.js +0 -290
  149. package/dist/__tests__/coordination-brief.test.js.map +0 -1
  150. package/dist/__tests__/coordination-client.test.d.ts +0 -9
  151. package/dist/__tests__/coordination-client.test.d.ts.map +0 -1
  152. package/dist/__tests__/coordination-client.test.js +0 -517
  153. package/dist/__tests__/coordination-client.test.js.map +0 -1
  154. package/dist/__tests__/coordination-command.test.d.ts +0 -9
  155. package/dist/__tests__/coordination-command.test.d.ts.map +0 -1
  156. package/dist/__tests__/coordination-command.test.js +0 -1082
  157. package/dist/__tests__/coordination-command.test.js.map +0 -1
  158. package/dist/__tests__/coordination-credential-endpoint.test.d.ts +0 -24
  159. package/dist/__tests__/coordination-credential-endpoint.test.d.ts.map +0 -1
  160. package/dist/__tests__/coordination-credential-endpoint.test.js +0 -1292
  161. package/dist/__tests__/coordination-credential-endpoint.test.js.map +0 -1
  162. package/dist/__tests__/coordination-expected-team.test.d.ts +0 -19
  163. package/dist/__tests__/coordination-expected-team.test.d.ts.map +0 -1
  164. package/dist/__tests__/coordination-expected-team.test.js +0 -423
  165. package/dist/__tests__/coordination-expected-team.test.js.map +0 -1
  166. package/dist/__tests__/coordination-fallback.test.d.ts +0 -9
  167. package/dist/__tests__/coordination-fallback.test.d.ts.map +0 -1
  168. package/dist/__tests__/coordination-fallback.test.js +0 -192
  169. package/dist/__tests__/coordination-fallback.test.js.map +0 -1
  170. package/dist/__tests__/coordination-file-guards.test.d.ts +0 -29
  171. package/dist/__tests__/coordination-file-guards.test.d.ts.map +0 -1
  172. package/dist/__tests__/coordination-file-guards.test.js +0 -380
  173. package/dist/__tests__/coordination-file-guards.test.js.map +0 -1
  174. package/dist/__tests__/coordination-history.test.d.ts +0 -8
  175. package/dist/__tests__/coordination-history.test.d.ts.map +0 -1
  176. package/dist/__tests__/coordination-history.test.js +0 -447
  177. package/dist/__tests__/coordination-history.test.js.map +0 -1
  178. package/dist/__tests__/coordination-memory.test.d.ts +0 -14
  179. package/dist/__tests__/coordination-memory.test.d.ts.map +0 -1
  180. package/dist/__tests__/coordination-memory.test.js +0 -401
  181. package/dist/__tests__/coordination-memory.test.js.map +0 -1
  182. package/dist/__tests__/coordination-mode.test.d.ts +0 -13
  183. package/dist/__tests__/coordination-mode.test.d.ts.map +0 -1
  184. package/dist/__tests__/coordination-mode.test.js +0 -180
  185. package/dist/__tests__/coordination-mode.test.js.map +0 -1
  186. package/dist/__tests__/coordination-plain-shell-commands.test.d.ts +0 -22
  187. package/dist/__tests__/coordination-plain-shell-commands.test.d.ts.map +0 -1
  188. package/dist/__tests__/coordination-plain-shell-commands.test.js +0 -1875
  189. package/dist/__tests__/coordination-plain-shell-commands.test.js.map +0 -1
  190. package/dist/__tests__/coordination-provision.test.d.ts +0 -12
  191. package/dist/__tests__/coordination-provision.test.d.ts.map +0 -1
  192. package/dist/__tests__/coordination-provision.test.js +0 -103
  193. package/dist/__tests__/coordination-provision.test.js.map +0 -1
  194. package/dist/__tests__/coordination-render.test.d.ts +0 -9
  195. package/dist/__tests__/coordination-render.test.d.ts.map +0 -1
  196. package/dist/__tests__/coordination-render.test.js +0 -335
  197. package/dist/__tests__/coordination-render.test.js.map +0 -1
  198. package/dist/__tests__/coordination-setup.test.d.ts +0 -6
  199. package/dist/__tests__/coordination-setup.test.d.ts.map +0 -1
  200. package/dist/__tests__/coordination-setup.test.js +0 -448
  201. package/dist/__tests__/coordination-setup.test.js.map +0 -1
  202. package/dist/__tests__/coordination-status-plain-shell.test.d.ts +0 -19
  203. package/dist/__tests__/coordination-status-plain-shell.test.d.ts.map +0 -1
  204. package/dist/__tests__/coordination-status-plain-shell.test.js +0 -332
  205. package/dist/__tests__/coordination-status-plain-shell.test.js.map +0 -1
  206. package/dist/__tests__/coordination-status-registration.test.d.ts +0 -16
  207. package/dist/__tests__/coordination-status-registration.test.d.ts.map +0 -1
  208. package/dist/__tests__/coordination-status-registration.test.js +0 -480
  209. package/dist/__tests__/coordination-status-registration.test.js.map +0 -1
  210. package/dist/__tests__/coordination-token-multitenant.test.d.ts +0 -11
  211. package/dist/__tests__/coordination-token-multitenant.test.d.ts.map +0 -1
  212. package/dist/__tests__/coordination-token-multitenant.test.js +0 -106
  213. package/dist/__tests__/coordination-token-multitenant.test.js.map +0 -1
  214. package/dist/__tests__/coordination-token.test.d.ts +0 -11
  215. package/dist/__tests__/coordination-token.test.d.ts.map +0 -1
  216. package/dist/__tests__/coordination-token.test.js +0 -201
  217. package/dist/__tests__/coordination-token.test.js.map +0 -1
  218. package/dist/__tests__/coordination-wiring.test.d.ts +0 -11
  219. package/dist/__tests__/coordination-wiring.test.d.ts.map +0 -1
  220. package/dist/__tests__/coordination-wiring.test.js +0 -43
  221. package/dist/__tests__/coordination-wiring.test.js.map +0 -1
  222. package/dist/__tests__/creation-pr-class-check.test.d.ts +0 -17
  223. package/dist/__tests__/creation-pr-class-check.test.d.ts.map +0 -1
  224. package/dist/__tests__/creation-pr-class-check.test.js +0 -346
  225. package/dist/__tests__/creation-pr-class-check.test.js.map +0 -1
  226. package/dist/__tests__/creation-step6a-push-check.test.d.ts +0 -15
  227. package/dist/__tests__/creation-step6a-push-check.test.d.ts.map +0 -1
  228. package/dist/__tests__/creation-step6a-push-check.test.js +0 -150
  229. package/dist/__tests__/creation-step6a-push-check.test.js.map +0 -1
  230. package/dist/__tests__/decision-check.test.d.ts +0 -2
  231. package/dist/__tests__/decision-check.test.d.ts.map +0 -1
  232. package/dist/__tests__/decision-check.test.js +0 -105
  233. package/dist/__tests__/decision-check.test.js.map +0 -1
  234. package/dist/__tests__/digest-fail-closed.test.d.ts +0 -16
  235. package/dist/__tests__/digest-fail-closed.test.d.ts.map +0 -1
  236. package/dist/__tests__/digest-fail-closed.test.js +0 -248
  237. package/dist/__tests__/digest-fail-closed.test.js.map +0 -1
  238. package/dist/__tests__/digest-team-omission.test.d.ts +0 -15
  239. package/dist/__tests__/digest-team-omission.test.d.ts.map +0 -1
  240. package/dist/__tests__/digest-team-omission.test.js +0 -247
  241. package/dist/__tests__/digest-team-omission.test.js.map +0 -1
  242. package/dist/__tests__/doctor-config-fidelity.test.d.ts +0 -19
  243. package/dist/__tests__/doctor-config-fidelity.test.d.ts.map +0 -1
  244. package/dist/__tests__/doctor-config-fidelity.test.js +0 -324
  245. package/dist/__tests__/doctor-config-fidelity.test.js.map +0 -1
  246. package/dist/__tests__/doctor-framework-version.test.d.ts +0 -2
  247. package/dist/__tests__/doctor-framework-version.test.d.ts.map +0 -1
  248. package/dist/__tests__/doctor-framework-version.test.js +0 -146
  249. package/dist/__tests__/doctor-framework-version.test.js.map +0 -1
  250. package/dist/__tests__/doctor-worktree-path.test.d.ts +0 -17
  251. package/dist/__tests__/doctor-worktree-path.test.d.ts.map +0 -1
  252. package/dist/__tests__/doctor-worktree-path.test.js +0 -158
  253. package/dist/__tests__/doctor-worktree-path.test.js.map +0 -1
  254. package/dist/__tests__/doctor.test.d.ts +0 -20
  255. package/dist/__tests__/doctor.test.d.ts.map +0 -1
  256. package/dist/__tests__/doctor.test.js +0 -849
  257. package/dist/__tests__/doctor.test.js.map +0 -1
  258. package/dist/__tests__/event-shipper.test.d.ts +0 -16
  259. package/dist/__tests__/event-shipper.test.d.ts.map +0 -1
  260. package/dist/__tests__/event-shipper.test.js +0 -287
  261. package/dist/__tests__/event-shipper.test.js.map +0 -1
  262. package/dist/__tests__/fleet-data.test.d.ts +0 -2
  263. package/dist/__tests__/fleet-data.test.d.ts.map +0 -1
  264. package/dist/__tests__/fleet-data.test.js +0 -501
  265. package/dist/__tests__/fleet-data.test.js.map +0 -1
  266. package/dist/__tests__/fleet-devpod.test.d.ts +0 -12
  267. package/dist/__tests__/fleet-devpod.test.d.ts.map +0 -1
  268. package/dist/__tests__/fleet-devpod.test.js +0 -260
  269. package/dist/__tests__/fleet-devpod.test.js.map +0 -1
  270. package/dist/__tests__/fleet-tmux.test.d.ts +0 -2
  271. package/dist/__tests__/fleet-tmux.test.d.ts.map +0 -1
  272. package/dist/__tests__/fleet-tmux.test.js +0 -289
  273. package/dist/__tests__/fleet-tmux.test.js.map +0 -1
  274. package/dist/__tests__/fleet.test.d.ts +0 -16
  275. package/dist/__tests__/fleet.test.d.ts.map +0 -1
  276. package/dist/__tests__/fleet.test.js +0 -75
  277. package/dist/__tests__/fleet.test.js.map +0 -1
  278. package/dist/__tests__/generate-claude.test.d.ts +0 -18
  279. package/dist/__tests__/generate-claude.test.d.ts.map +0 -1
  280. package/dist/__tests__/generate-claude.test.js +0 -1015
  281. package/dist/__tests__/generate-claude.test.js.map +0 -1
  282. package/dist/__tests__/gh-remote.test.d.ts +0 -2
  283. package/dist/__tests__/gh-remote.test.d.ts.map +0 -1
  284. package/dist/__tests__/gh-remote.test.js +0 -136
  285. package/dist/__tests__/gh-remote.test.js.map +0 -1
  286. package/dist/__tests__/git-env.test.d.ts +0 -14
  287. package/dist/__tests__/git-env.test.d.ts.map +0 -1
  288. package/dist/__tests__/git-env.test.js +0 -131
  289. package/dist/__tests__/git-env.test.js.map +0 -1
  290. package/dist/__tests__/git-identity-isolation.test.d.ts +0 -33
  291. package/dist/__tests__/git-identity-isolation.test.d.ts.map +0 -1
  292. package/dist/__tests__/git-identity-isolation.test.js +0 -626
  293. package/dist/__tests__/git-identity-isolation.test.js.map +0 -1
  294. package/dist/__tests__/harness-extract.test.d.ts +0 -19
  295. package/dist/__tests__/harness-extract.test.d.ts.map +0 -1
  296. package/dist/__tests__/harness-extract.test.js +0 -566
  297. package/dist/__tests__/harness-extract.test.js.map +0 -1
  298. package/dist/__tests__/harness-wiring.test.d.ts +0 -16
  299. package/dist/__tests__/harness-wiring.test.d.ts.map +0 -1
  300. package/dist/__tests__/harness-wiring.test.js +0 -469
  301. package/dist/__tests__/harness-wiring.test.js.map +0 -1
  302. package/dist/__tests__/hook-completeness.test.d.ts +0 -13
  303. package/dist/__tests__/hook-completeness.test.d.ts.map +0 -1
  304. package/dist/__tests__/hook-completeness.test.js +0 -238
  305. package/dist/__tests__/hook-completeness.test.js.map +0 -1
  306. package/dist/__tests__/hook-heal.test.d.ts +0 -8
  307. package/dist/__tests__/hook-heal.test.d.ts.map +0 -1
  308. package/dist/__tests__/hook-heal.test.js +0 -156
  309. package/dist/__tests__/hook-heal.test.js.map +0 -1
  310. package/dist/__tests__/human-turn-classifier.test.d.ts +0 -17
  311. package/dist/__tests__/human-turn-classifier.test.d.ts.map +0 -1
  312. package/dist/__tests__/human-turn-classifier.test.js +0 -311
  313. package/dist/__tests__/human-turn-classifier.test.js.map +0 -1
  314. package/dist/__tests__/init-coordination-url.test.d.ts +0 -11
  315. package/dist/__tests__/init-coordination-url.test.d.ts.map +0 -1
  316. package/dist/__tests__/init-coordination-url.test.js +0 -217
  317. package/dist/__tests__/init-coordination-url.test.js.map +0 -1
  318. package/dist/__tests__/isolation-probe.test.d.ts +0 -15
  319. package/dist/__tests__/isolation-probe.test.d.ts.map +0 -1
  320. package/dist/__tests__/isolation-probe.test.js +0 -611
  321. package/dist/__tests__/isolation-probe.test.js.map +0 -1
  322. package/dist/__tests__/leader-lock.test.d.ts +0 -12
  323. package/dist/__tests__/leader-lock.test.d.ts.map +0 -1
  324. package/dist/__tests__/leader-lock.test.js +0 -293
  325. package/dist/__tests__/leader-lock.test.js.map +0 -1
  326. package/dist/__tests__/memory-archive-checks.test.d.ts +0 -22
  327. package/dist/__tests__/memory-archive-checks.test.d.ts.map +0 -1
  328. package/dist/__tests__/memory-archive-checks.test.js +0 -748
  329. package/dist/__tests__/memory-archive-checks.test.js.map +0 -1
  330. package/dist/__tests__/memory-archive-prep.test.d.ts +0 -8
  331. package/dist/__tests__/memory-archive-prep.test.d.ts.map +0 -1
  332. package/dist/__tests__/memory-archive-prep.test.js +0 -524
  333. package/dist/__tests__/memory-archive-prep.test.js.map +0 -1
  334. package/dist/__tests__/memory-autocreate.test.d.ts +0 -10
  335. package/dist/__tests__/memory-autocreate.test.d.ts.map +0 -1
  336. package/dist/__tests__/memory-autocreate.test.js +0 -709
  337. package/dist/__tests__/memory-autocreate.test.js.map +0 -1
  338. package/dist/__tests__/memory-log-result.test.d.ts +0 -13
  339. package/dist/__tests__/memory-log-result.test.d.ts.map +0 -1
  340. package/dist/__tests__/memory-log-result.test.js +0 -149
  341. package/dist/__tests__/memory-log-result.test.js.map +0 -1
  342. package/dist/__tests__/memory-named-exists.test.d.ts +0 -16
  343. package/dist/__tests__/memory-named-exists.test.d.ts.map +0 -1
  344. package/dist/__tests__/memory-named-exists.test.js +0 -288
  345. package/dist/__tests__/memory-named-exists.test.js.map +0 -1
  346. package/dist/__tests__/message-bus.test.d.ts +0 -10
  347. package/dist/__tests__/message-bus.test.d.ts.map +0 -1
  348. package/dist/__tests__/message-bus.test.js +0 -526
  349. package/dist/__tests__/message-bus.test.js.map +0 -1
  350. package/dist/__tests__/monitor.test.d.ts +0 -6
  351. package/dist/__tests__/monitor.test.d.ts.map +0 -1
  352. package/dist/__tests__/monitor.test.js +0 -458
  353. package/dist/__tests__/monitor.test.js.map +0 -1
  354. package/dist/__tests__/mx-agent-cli-pin-validation.test.d.ts +0 -2
  355. package/dist/__tests__/mx-agent-cli-pin-validation.test.d.ts.map +0 -1
  356. package/dist/__tests__/mx-agent-cli-pin-validation.test.js +0 -232
  357. package/dist/__tests__/mx-agent-cli-pin-validation.test.js.map +0 -1
  358. package/dist/__tests__/mx-agent-cli-version-pin.test.d.ts +0 -2
  359. package/dist/__tests__/mx-agent-cli-version-pin.test.d.ts.map +0 -1
  360. package/dist/__tests__/mx-agent-cli-version-pin.test.js +0 -236
  361. package/dist/__tests__/mx-agent-cli-version-pin.test.js.map +0 -1
  362. package/dist/__tests__/new-project-first-team.test.d.ts +0 -15
  363. package/dist/__tests__/new-project-first-team.test.d.ts.map +0 -1
  364. package/dist/__tests__/new-project-first-team.test.js +0 -444
  365. package/dist/__tests__/new-project-first-team.test.js.map +0 -1
  366. package/dist/__tests__/otel-env.test.d.ts +0 -2
  367. package/dist/__tests__/otel-env.test.d.ts.map +0 -1
  368. package/dist/__tests__/otel-env.test.js +0 -127
  369. package/dist/__tests__/otel-env.test.js.map +0 -1
  370. package/dist/__tests__/pager-fail-closed.test.d.ts +0 -19
  371. package/dist/__tests__/pager-fail-closed.test.d.ts.map +0 -1
  372. package/dist/__tests__/pager-fail-closed.test.js +0 -229
  373. package/dist/__tests__/pager-fail-closed.test.js.map +0 -1
  374. package/dist/__tests__/pr-set-body.test.d.ts +0 -29
  375. package/dist/__tests__/pr-set-body.test.d.ts.map +0 -1
  376. package/dist/__tests__/pr-set-body.test.js +0 -314
  377. package/dist/__tests__/pr-set-body.test.js.map +0 -1
  378. package/dist/__tests__/prior-sync-failure.test.d.ts +0 -2
  379. package/dist/__tests__/prior-sync-failure.test.d.ts.map +0 -1
  380. package/dist/__tests__/prior-sync-failure.test.js +0 -81
  381. package/dist/__tests__/prior-sync-failure.test.js.map +0 -1
  382. package/dist/__tests__/project-config.test.d.ts +0 -2
  383. package/dist/__tests__/project-config.test.d.ts.map +0 -1
  384. package/dist/__tests__/project-config.test.js +0 -458
  385. package/dist/__tests__/project-config.test.js.map +0 -1
  386. package/dist/__tests__/provision-behavioral-contract.test.d.ts +0 -13
  387. package/dist/__tests__/provision-behavioral-contract.test.d.ts.map +0 -1
  388. package/dist/__tests__/provision-behavioral-contract.test.js +0 -548
  389. package/dist/__tests__/provision-behavioral-contract.test.js.map +0 -1
  390. package/dist/__tests__/provision-catalog-precondition.test.d.ts +0 -26
  391. package/dist/__tests__/provision-catalog-precondition.test.d.ts.map +0 -1
  392. package/dist/__tests__/provision-catalog-precondition.test.js +0 -622
  393. package/dist/__tests__/provision-catalog-precondition.test.js.map +0 -1
  394. package/dist/__tests__/provision-completion-rows.test.d.ts +0 -17
  395. package/dist/__tests__/provision-completion-rows.test.d.ts.map +0 -1
  396. package/dist/__tests__/provision-completion-rows.test.js +0 -3473
  397. package/dist/__tests__/provision-completion-rows.test.js.map +0 -1
  398. package/dist/__tests__/provision-copy-containment.test.d.ts +0 -19
  399. package/dist/__tests__/provision-copy-containment.test.d.ts.map +0 -1
  400. package/dist/__tests__/provision-copy-containment.test.js +0 -187
  401. package/dist/__tests__/provision-copy-containment.test.js.map +0 -1
  402. package/dist/__tests__/provision-identity-gate.test.d.ts +0 -20
  403. package/dist/__tests__/provision-identity-gate.test.d.ts.map +0 -1
  404. package/dist/__tests__/provision-identity-gate.test.js +0 -602
  405. package/dist/__tests__/provision-identity-gate.test.js.map +0 -1
  406. package/dist/__tests__/provision-resume.test.d.ts +0 -26
  407. package/dist/__tests__/provision-resume.test.d.ts.map +0 -1
  408. package/dist/__tests__/provision-resume.test.js +0 -1344
  409. package/dist/__tests__/provision-resume.test.js.map +0 -1
  410. package/dist/__tests__/provision-roleguide-anchors.test.d.ts +0 -27
  411. package/dist/__tests__/provision-roleguide-anchors.test.d.ts.map +0 -1
  412. package/dist/__tests__/provision-roleguide-anchors.test.js +0 -747
  413. package/dist/__tests__/provision-roleguide-anchors.test.js.map +0 -1
  414. package/dist/__tests__/provision-row12-stub-server.test.d.ts +0 -21
  415. package/dist/__tests__/provision-row12-stub-server.test.d.ts.map +0 -1
  416. package/dist/__tests__/provision-row12-stub-server.test.js +0 -264
  417. package/dist/__tests__/provision-row12-stub-server.test.js.map +0 -1
  418. package/dist/__tests__/provision-skeleton-fill.test.d.ts +0 -16
  419. package/dist/__tests__/provision-skeleton-fill.test.d.ts.map +0 -1
  420. package/dist/__tests__/provision-skeleton-fill.test.js +0 -490
  421. package/dist/__tests__/provision-skeleton-fill.test.js.map +0 -1
  422. package/dist/__tests__/provision-step8-commit.test.d.ts +0 -40
  423. package/dist/__tests__/provision-step8-commit.test.d.ts.map +0 -1
  424. package/dist/__tests__/provision-step8-commit.test.js +0 -529
  425. package/dist/__tests__/provision-step8-commit.test.js.map +0 -1
  426. package/dist/__tests__/provision-teambuilder-flow.test.d.ts +0 -22
  427. package/dist/__tests__/provision-teambuilder-flow.test.d.ts.map +0 -1
  428. package/dist/__tests__/provision-teambuilder-flow.test.js +0 -253
  429. package/dist/__tests__/provision-teambuilder-flow.test.js.map +0 -1
  430. package/dist/__tests__/provision-write-integrity.test.d.ts +0 -18
  431. package/dist/__tests__/provision-write-integrity.test.d.ts.map +0 -1
  432. package/dist/__tests__/provision-write-integrity.test.js +0 -141
  433. package/dist/__tests__/provision-write-integrity.test.js.map +0 -1
  434. package/dist/__tests__/repo-guard-wiring.test.d.ts +0 -21
  435. package/dist/__tests__/repo-guard-wiring.test.d.ts.map +0 -1
  436. package/dist/__tests__/repo-guard-wiring.test.js +0 -638
  437. package/dist/__tests__/repo-guard-wiring.test.js.map +0 -1
  438. package/dist/__tests__/report-format.test.d.ts +0 -2
  439. package/dist/__tests__/report-format.test.d.ts.map +0 -1
  440. package/dist/__tests__/report-format.test.js +0 -219
  441. package/dist/__tests__/report-format.test.js.map +0 -1
  442. package/dist/__tests__/row15-detail-sanitizer.test.d.ts +0 -20
  443. package/dist/__tests__/row15-detail-sanitizer.test.d.ts.map +0 -1
  444. package/dist/__tests__/row15-detail-sanitizer.test.js +0 -61
  445. package/dist/__tests__/row15-detail-sanitizer.test.js.map +0 -1
  446. package/dist/__tests__/rows-9-10-zero-remotes.test.d.ts +0 -32
  447. package/dist/__tests__/rows-9-10-zero-remotes.test.d.ts.map +0 -1
  448. package/dist/__tests__/rows-9-10-zero-remotes.test.js +0 -203
  449. package/dist/__tests__/rows-9-10-zero-remotes.test.js.map +0 -1
  450. package/dist/__tests__/runtime-claude-adapter.test.d.ts +0 -2
  451. package/dist/__tests__/runtime-claude-adapter.test.d.ts.map +0 -1
  452. package/dist/__tests__/runtime-claude-adapter.test.js +0 -70
  453. package/dist/__tests__/runtime-claude-adapter.test.js.map +0 -1
  454. package/dist/__tests__/runtime-codex-adapter.test.d.ts +0 -2
  455. package/dist/__tests__/runtime-codex-adapter.test.d.ts.map +0 -1
  456. package/dist/__tests__/runtime-codex-adapter.test.js +0 -558
  457. package/dist/__tests__/runtime-codex-adapter.test.js.map +0 -1
  458. package/dist/__tests__/runtime-codex-config.test.d.ts +0 -2
  459. package/dist/__tests__/runtime-codex-config.test.d.ts.map +0 -1
  460. package/dist/__tests__/runtime-codex-config.test.js +0 -1421
  461. package/dist/__tests__/runtime-codex-config.test.js.map +0 -1
  462. package/dist/__tests__/runtime-codex-gateway-pilot.test.d.ts +0 -2
  463. package/dist/__tests__/runtime-codex-gateway-pilot.test.d.ts.map +0 -1
  464. package/dist/__tests__/runtime-codex-gateway-pilot.test.js +0 -309
  465. package/dist/__tests__/runtime-codex-gateway-pilot.test.js.map +0 -1
  466. package/dist/__tests__/runtime-codex-gateway-provider.test.d.ts +0 -2
  467. package/dist/__tests__/runtime-codex-gateway-provider.test.d.ts.map +0 -1
  468. package/dist/__tests__/runtime-codex-gateway-provider.test.js +0 -163
  469. package/dist/__tests__/runtime-codex-gateway-provider.test.js.map +0 -1
  470. package/dist/__tests__/runtime-codex-guard-proof.test.d.ts +0 -2
  471. package/dist/__tests__/runtime-codex-guard-proof.test.d.ts.map +0 -1
  472. package/dist/__tests__/runtime-codex-guard-proof.test.js +0 -822
  473. package/dist/__tests__/runtime-codex-guard-proof.test.js.map +0 -1
  474. package/dist/__tests__/runtime-codex-version-pin.test.d.ts +0 -2
  475. package/dist/__tests__/runtime-codex-version-pin.test.d.ts.map +0 -1
  476. package/dist/__tests__/runtime-codex-version-pin.test.js +0 -86
  477. package/dist/__tests__/runtime-codex-version-pin.test.js.map +0 -1
  478. package/dist/__tests__/runtime-identity.test.d.ts +0 -2
  479. package/dist/__tests__/runtime-identity.test.d.ts.map +0 -1
  480. package/dist/__tests__/runtime-identity.test.js +0 -117
  481. package/dist/__tests__/runtime-identity.test.js.map +0 -1
  482. package/dist/__tests__/runtime-resolve.test.d.ts +0 -2
  483. package/dist/__tests__/runtime-resolve.test.d.ts.map +0 -1
  484. package/dist/__tests__/runtime-resolve.test.js +0 -172
  485. package/dist/__tests__/runtime-resolve.test.js.map +0 -1
  486. package/dist/__tests__/security-posture.test.d.ts +0 -8
  487. package/dist/__tests__/security-posture.test.d.ts.map +0 -1
  488. package/dist/__tests__/security-posture.test.js +0 -82
  489. package/dist/__tests__/security-posture.test.js.map +0 -1
  490. package/dist/__tests__/session-model.test.d.ts +0 -2
  491. package/dist/__tests__/session-model.test.d.ts.map +0 -1
  492. package/dist/__tests__/session-model.test.js +0 -74
  493. package/dist/__tests__/session-model.test.js.map +0 -1
  494. package/dist/__tests__/session-pause-provisioning.test.d.ts +0 -19
  495. package/dist/__tests__/session-pause-provisioning.test.d.ts.map +0 -1
  496. package/dist/__tests__/session-pause-provisioning.test.js +0 -115
  497. package/dist/__tests__/session-pause-provisioning.test.js.map +0 -1
  498. package/dist/__tests__/session-reclamation.test.d.ts +0 -15
  499. package/dist/__tests__/session-reclamation.test.d.ts.map +0 -1
  500. package/dist/__tests__/session-reclamation.test.js +0 -73
  501. package/dist/__tests__/session-reclamation.test.js.map +0 -1
  502. package/dist/__tests__/session-record-disclosure.test.d.ts +0 -24
  503. package/dist/__tests__/session-record-disclosure.test.d.ts.map +0 -1
  504. package/dist/__tests__/session-record-disclosure.test.js +0 -494
  505. package/dist/__tests__/session-record-disclosure.test.js.map +0 -1
  506. package/dist/__tests__/session-status.test.d.ts +0 -11
  507. package/dist/__tests__/session-status.test.d.ts.map +0 -1
  508. package/dist/__tests__/session-status.test.js +0 -76
  509. package/dist/__tests__/session-status.test.js.map +0 -1
  510. package/dist/__tests__/session.test.d.ts +0 -15
  511. package/dist/__tests__/session.test.d.ts.map +0 -1
  512. package/dist/__tests__/session.test.js +0 -366
  513. package/dist/__tests__/session.test.js.map +0 -1
  514. package/dist/__tests__/shim-deploy-safety.test.d.ts +0 -24
  515. package/dist/__tests__/shim-deploy-safety.test.d.ts.map +0 -1
  516. package/dist/__tests__/shim-deploy-safety.test.js +0 -174
  517. package/dist/__tests__/shim-deploy-safety.test.js.map +0 -1
  518. package/dist/__tests__/slug-validation.test.d.ts +0 -13
  519. package/dist/__tests__/slug-validation.test.d.ts.map +0 -1
  520. package/dist/__tests__/slug-validation.test.js +0 -202
  521. package/dist/__tests__/slug-validation.test.js.map +0 -1
  522. package/dist/__tests__/standards-injection.test.d.ts +0 -2
  523. package/dist/__tests__/standards-injection.test.d.ts.map +0 -1
  524. package/dist/__tests__/standards-injection.test.js +0 -179
  525. package/dist/__tests__/standards-injection.test.js.map +0 -1
  526. package/dist/__tests__/start-config-conflict.test.d.ts +0 -17
  527. package/dist/__tests__/start-config-conflict.test.d.ts.map +0 -1
  528. package/dist/__tests__/start-config-conflict.test.js +0 -101
  529. package/dist/__tests__/start-config-conflict.test.js.map +0 -1
  530. package/dist/__tests__/start-interactive-role.test.d.ts +0 -22
  531. package/dist/__tests__/start-interactive-role.test.d.ts.map +0 -1
  532. package/dist/__tests__/start-interactive-role.test.js +0 -204
  533. package/dist/__tests__/start-interactive-role.test.js.map +0 -1
  534. package/dist/__tests__/start-rebase-never-ran.test.d.ts +0 -25
  535. package/dist/__tests__/start-rebase-never-ran.test.d.ts.map +0 -1
  536. package/dist/__tests__/start-rebase-never-ran.test.js +0 -227
  537. package/dist/__tests__/start-rebase-never-ran.test.js.map +0 -1
  538. package/dist/__tests__/start-report-generation-capture.test.d.ts +0 -17
  539. package/dist/__tests__/start-report-generation-capture.test.d.ts.map +0 -1
  540. package/dist/__tests__/start-report-generation-capture.test.js +0 -127
  541. package/dist/__tests__/start-report-generation-capture.test.js.map +0 -1
  542. package/dist/__tests__/start-report-integration.test.d.ts +0 -12
  543. package/dist/__tests__/start-report-integration.test.d.ts.map +0 -1
  544. package/dist/__tests__/start-report-integration.test.js +0 -138
  545. package/dist/__tests__/start-report-integration.test.js.map +0 -1
  546. package/dist/__tests__/start-runtime-wiring.test.d.ts +0 -31
  547. package/dist/__tests__/start-runtime-wiring.test.d.ts.map +0 -1
  548. package/dist/__tests__/start-runtime-wiring.test.js +0 -735
  549. package/dist/__tests__/start-runtime-wiring.test.js.map +0 -1
  550. package/dist/__tests__/start-stash.test.d.ts +0 -2
  551. package/dist/__tests__/start-stash.test.d.ts.map +0 -1
  552. package/dist/__tests__/start-stash.test.js +0 -131
  553. package/dist/__tests__/start-stash.test.js.map +0 -1
  554. package/dist/__tests__/start-sync-hardstop.test.d.ts +0 -15
  555. package/dist/__tests__/start-sync-hardstop.test.d.ts.map +0 -1
  556. package/dist/__tests__/start-sync-hardstop.test.js +0 -280
  557. package/dist/__tests__/start-sync-hardstop.test.js.map +0 -1
  558. package/dist/__tests__/start-team-identity.test.d.ts +0 -25
  559. package/dist/__tests__/start-team-identity.test.d.ts.map +0 -1
  560. package/dist/__tests__/start-team-identity.test.js +0 -307
  561. package/dist/__tests__/start-team-identity.test.js.map +0 -1
  562. package/dist/__tests__/startup-health-render.test.d.ts +0 -11
  563. package/dist/__tests__/startup-health-render.test.d.ts.map +0 -1
  564. package/dist/__tests__/startup-health-render.test.js +0 -60
  565. package/dist/__tests__/startup-health-render.test.js.map +0 -1
  566. package/dist/__tests__/startup-policy.test.d.ts +0 -2
  567. package/dist/__tests__/startup-policy.test.d.ts.map +0 -1
  568. package/dist/__tests__/startup-policy.test.js +0 -27
  569. package/dist/__tests__/startup-policy.test.js.map +0 -1
  570. package/dist/__tests__/startup-report.test.d.ts +0 -13
  571. package/dist/__tests__/startup-report.test.d.ts.map +0 -1
  572. package/dist/__tests__/startup-report.test.js +0 -278
  573. package/dist/__tests__/startup-report.test.js.map +0 -1
  574. package/dist/__tests__/startup-shipper.test.d.ts +0 -13
  575. package/dist/__tests__/startup-shipper.test.d.ts.map +0 -1
  576. package/dist/__tests__/startup-shipper.test.js +0 -149
  577. package/dist/__tests__/startup-shipper.test.js.map +0 -1
  578. package/dist/__tests__/stream-input-controller.test.d.ts +0 -10
  579. package/dist/__tests__/stream-input-controller.test.d.ts.map +0 -1
  580. package/dist/__tests__/stream-input-controller.test.js +0 -167
  581. package/dist/__tests__/stream-input-controller.test.js.map +0 -1
  582. package/dist/__tests__/team-memory-commands.test.d.ts +0 -11
  583. package/dist/__tests__/team-memory-commands.test.d.ts.map +0 -1
  584. package/dist/__tests__/team-memory-commands.test.js +0 -240
  585. package/dist/__tests__/team-memory-commands.test.js.map +0 -1
  586. package/dist/__tests__/team-name-propagation.test.d.ts +0 -13
  587. package/dist/__tests__/team-name-propagation.test.d.ts.map +0 -1
  588. package/dist/__tests__/team-name-propagation.test.js +0 -198
  589. package/dist/__tests__/team-name-propagation.test.js.map +0 -1
  590. package/dist/__tests__/team-token-probe.test.d.ts +0 -16
  591. package/dist/__tests__/team-token-probe.test.d.ts.map +0 -1
  592. package/dist/__tests__/team-token-probe.test.js +0 -295
  593. package/dist/__tests__/team-token-probe.test.js.map +0 -1
  594. package/dist/__tests__/template-budget.test.d.ts +0 -2
  595. package/dist/__tests__/template-budget.test.d.ts.map +0 -1
  596. package/dist/__tests__/template-budget.test.js +0 -119
  597. package/dist/__tests__/template-budget.test.js.map +0 -1
  598. package/dist/__tests__/template-sync.test.d.ts +0 -19
  599. package/dist/__tests__/template-sync.test.d.ts.map +0 -1
  600. package/dist/__tests__/template-sync.test.js +0 -480
  601. package/dist/__tests__/template-sync.test.js.map +0 -1
  602. package/dist/__tests__/test-project.test.d.ts +0 -18
  603. package/dist/__tests__/test-project.test.d.ts.map +0 -1
  604. package/dist/__tests__/test-project.test.js +0 -465
  605. package/dist/__tests__/test-project.test.js.map +0 -1
  606. package/dist/__tests__/tracked-instruction-files.test.d.ts +0 -21
  607. package/dist/__tests__/tracked-instruction-files.test.d.ts.map +0 -1
  608. package/dist/__tests__/tracked-instruction-files.test.js +0 -489
  609. package/dist/__tests__/tracked-instruction-files.test.js.map +0 -1
  610. package/dist/__tests__/unlock.test.d.ts +0 -11
  611. package/dist/__tests__/unlock.test.d.ts.map +0 -1
  612. package/dist/__tests__/unlock.test.js +0 -100
  613. package/dist/__tests__/unlock.test.js.map +0 -1
  614. package/dist/__tests__/usage-per-call-grouping.test.d.ts +0 -25
  615. package/dist/__tests__/usage-per-call-grouping.test.d.ts.map +0 -1
  616. package/dist/__tests__/usage-per-call-grouping.test.js +0 -952
  617. package/dist/__tests__/usage-per-call-grouping.test.js.map +0 -1
  618. package/dist/__tests__/usage-pricing.test.d.ts +0 -20
  619. package/dist/__tests__/usage-pricing.test.d.ts.map +0 -1
  620. package/dist/__tests__/usage-pricing.test.js +0 -176
  621. package/dist/__tests__/usage-pricing.test.js.map +0 -1
  622. package/dist/__tests__/usage-subagent-discovery.test.d.ts +0 -17
  623. package/dist/__tests__/usage-subagent-discovery.test.d.ts.map +0 -1
  624. package/dist/__tests__/usage-subagent-discovery.test.js +0 -213
  625. package/dist/__tests__/usage-subagent-discovery.test.js.map +0 -1
  626. package/dist/__tests__/verify-hooks-check-all.test.d.ts +0 -32
  627. package/dist/__tests__/verify-hooks-check-all.test.d.ts.map +0 -1
  628. package/dist/__tests__/verify-hooks-check-all.test.js +0 -563
  629. package/dist/__tests__/verify-hooks-check-all.test.js.map +0 -1
  630. package/dist/__tests__/verify-hooks-heal-log.test.d.ts +0 -11
  631. package/dist/__tests__/verify-hooks-heal-log.test.d.ts.map +0 -1
  632. package/dist/__tests__/verify-hooks-heal-log.test.js +0 -172
  633. package/dist/__tests__/verify-hooks-heal-log.test.js.map +0 -1
  634. package/dist/__tests__/worker-cap.test.d.ts +0 -14
  635. package/dist/__tests__/worker-cap.test.d.ts.map +0 -1
  636. package/dist/__tests__/worker-cap.test.js +0 -97
  637. package/dist/__tests__/worker-cap.test.js.map +0 -1
  638. package/dist/__tests__/worktree-link-repair.test.d.ts +0 -2
  639. package/dist/__tests__/worktree-link-repair.test.d.ts.map +0 -1
  640. package/dist/__tests__/worktree-link-repair.test.js +0 -471
  641. package/dist/__tests__/worktree-link-repair.test.js.map +0 -1
  642. package/dist/__tests__/worktree-sync-fixture.test.d.ts +0 -17
  643. package/dist/__tests__/worktree-sync-fixture.test.d.ts.map +0 -1
  644. package/dist/__tests__/worktree-sync-fixture.test.js +0 -519
  645. package/dist/__tests__/worktree-sync-fixture.test.js.map +0 -1
  646. package/dist/__tests__/worktree-sync-hardening.test.d.ts +0 -13
  647. package/dist/__tests__/worktree-sync-hardening.test.d.ts.map +0 -1
  648. package/dist/__tests__/worktree-sync-hardening.test.js +0 -919
  649. package/dist/__tests__/worktree-sync-hardening.test.js.map +0 -1
  650. package/dist/__tests__/worktree-sync-shell-free.test.d.ts +0 -25
  651. package/dist/__tests__/worktree-sync-shell-free.test.d.ts.map +0 -1
  652. package/dist/__tests__/worktree-sync-shell-free.test.js +0 -185
  653. package/dist/__tests__/worktree-sync-shell-free.test.js.map +0 -1
  654. package/dist/__tests__/worktree.test.d.ts +0 -2
  655. package/dist/__tests__/worktree.test.d.ts.map +0 -1
  656. package/dist/__tests__/worktree.test.js +0 -168
  657. package/dist/__tests__/worktree.test.js.map +0 -1
  658. package/dist/lib/code-context-file.test.d.ts +0 -19
  659. package/dist/lib/code-context-file.test.d.ts.map +0 -1
  660. package/dist/lib/code-context-file.test.js +0 -202
  661. package/dist/lib/code-context-file.test.js.map +0 -1
  662. package/dist/lib/harness/console/announce.test.d.ts +0 -2
  663. package/dist/lib/harness/console/announce.test.d.ts.map +0 -1
  664. package/dist/lib/harness/console/announce.test.js +0 -104
  665. package/dist/lib/harness/console/announce.test.js.map +0 -1
  666. package/dist/lib/harness/console/by-session.test.d.ts +0 -2
  667. package/dist/lib/harness/console/by-session.test.d.ts.map +0 -1
  668. package/dist/lib/harness/console/by-session.test.js +0 -86
  669. package/dist/lib/harness/console/by-session.test.js.map +0 -1
  670. package/dist/lib/harness/console/console.test.d.ts +0 -2
  671. package/dist/lib/harness/console/console.test.d.ts.map +0 -1
  672. package/dist/lib/harness/console/console.test.js +0 -269
  673. package/dist/lib/harness/console/console.test.js.map +0 -1
  674. package/dist/lib/harness/console/decision-request.test.d.ts +0 -2
  675. package/dist/lib/harness/console/decision-request.test.d.ts.map +0 -1
  676. package/dist/lib/harness/console/decision-request.test.js +0 -75
  677. package/dist/lib/harness/console/decision-request.test.js.map +0 -1
  678. package/dist/lib/harness/console/rank.test.d.ts +0 -2
  679. package/dist/lib/harness/console/rank.test.d.ts.map +0 -1
  680. package/dist/lib/harness/console/rank.test.js +0 -124
  681. package/dist/lib/harness/console/rank.test.js.map +0 -1
  682. package/dist/lib/harness/console/render.test.d.ts +0 -2
  683. package/dist/lib/harness/console/render.test.d.ts.map +0 -1
  684. package/dist/lib/harness/console/render.test.js +0 -96
  685. package/dist/lib/harness/console/render.test.js.map +0 -1
  686. package/dist/lib/harness/console/replay-cli.test.d.ts +0 -2
  687. package/dist/lib/harness/console/replay-cli.test.d.ts.map +0 -1
  688. package/dist/lib/harness/console/replay-cli.test.js +0 -96
  689. package/dist/lib/harness/console/replay-cli.test.js.map +0 -1
  690. package/dist/lib/harness/console/replay.test.d.ts +0 -2
  691. package/dist/lib/harness/console/replay.test.d.ts.map +0 -1
  692. package/dist/lib/harness/console/replay.test.js +0 -81
  693. package/dist/lib/harness/console/replay.test.js.map +0 -1
  694. package/dist/lib/harness/console/turn-reader.test.d.ts +0 -2
  695. package/dist/lib/harness/console/turn-reader.test.d.ts.map +0 -1
  696. package/dist/lib/harness/console/turn-reader.test.js +0 -108
  697. package/dist/lib/harness/console/turn-reader.test.js.map +0 -1
  698. package/dist/lib/harness/credential.test.d.ts +0 -2
  699. package/dist/lib/harness/credential.test.d.ts.map +0 -1
  700. package/dist/lib/harness/credential.test.js +0 -74
  701. package/dist/lib/harness/credential.test.js.map +0 -1
  702. package/dist/lib/harness/evaluate.test.d.ts +0 -2
  703. package/dist/lib/harness/evaluate.test.d.ts.map +0 -1
  704. package/dist/lib/harness/evaluate.test.js +0 -621
  705. package/dist/lib/harness/evaluate.test.js.map +0 -1
  706. package/dist/lib/harness/gate.test.d.ts +0 -2
  707. package/dist/lib/harness/gate.test.d.ts.map +0 -1
  708. package/dist/lib/harness/gate.test.js +0 -111
  709. package/dist/lib/harness/gate.test.js.map +0 -1
  710. package/dist/lib/harness/self-check.test.d.ts +0 -2
  711. package/dist/lib/harness/self-check.test.d.ts.map +0 -1
  712. package/dist/lib/harness/self-check.test.js +0 -43
  713. package/dist/lib/harness/self-check.test.js.map +0 -1
  714. package/dist/lib/harness/transcript.test.d.ts +0 -2
  715. package/dist/lib/harness/transcript.test.d.ts.map +0 -1
  716. package/dist/lib/harness/transcript.test.js +0 -118
  717. package/dist/lib/harness/transcript.test.js.map +0 -1
  718. package/dist/lib/projects-registry.test.d.ts +0 -2
  719. package/dist/lib/projects-registry.test.d.ts.map +0 -1
  720. package/dist/lib/projects-registry.test.js +0 -176
  721. package/dist/lib/projects-registry.test.js.map +0 -1
  722. package/dist/lib/roster.test.d.ts +0 -15
  723. package/dist/lib/roster.test.d.ts.map +0 -1
  724. package/dist/lib/roster.test.js +0 -299
  725. package/dist/lib/roster.test.js.map +0 -1
  726. package/dist/lib/vault.test.d.ts +0 -17
  727. package/dist/lib/vault.test.d.ts.map +0 -1
  728. package/dist/lib/vault.test.js +0 -169
  729. package/dist/lib/vault.test.js.map +0 -1
  730. package/dist/lib/window-view.test.d.ts +0 -2
  731. package/dist/lib/window-view.test.d.ts.map +0 -1
  732. package/dist/lib/window-view.test.js +0 -168
  733. package/dist/lib/window-view.test.js.map +0 -1
  734. package/dist/standards/fail-loud-standard.md +0 -495
  735. package/dist/standards/known-issues-standard.md +0 -380
  736. package/dist/standards/rulings.md +0 -104
@@ -1,640 +0,0 @@
1
- /**
2
- * `lib/cli-build.ts` — the module that builds the CLI inside a new worktree (#123).
3
- *
4
- * One test per item of the security design pre-ruling on issue #207 (comment
5
- * 5430622857), named by item number so a reviewer can walk the ruling and this
6
- * file side by side. `child_process` is mocked, so nothing here spawns npm and
7
- * nothing reaches the network.
8
- *
9
- * I1: `$HOME/.npmrc` exists on this machine and npm reads it on every provision,
10
- * because M7 keeps `HOME` in the allowlist. No test in this file reads, prints,
11
- * copies or measures that file, and none dumps npm's resolved configuration: the
12
- * allowlist is proven from the `env` argument captured at the mock, never from
13
- * npm's own output.
14
- */
15
- import { describe, it, expect, beforeEach, afterEach, vi } from 'vitest';
16
- import { mkdirSync, mkdtempSync, rmSync, symlinkSync, writeFileSync } from 'fs';
17
- import { join } from 'path';
18
- import { tmpdir } from 'os';
19
- vi.mock('child_process', () => ({
20
- spawnSync: vi.fn(),
21
- }));
22
- import { spawnSync } from 'child_process';
23
- import { buildCliInWorktree, buildEnv, excerpt, resolveNpm, ORPHAN_WARNING, REBUILD_REMEDY, ORPHAN_REMEDY, } from '../lib/cli-build.js';
24
- let root;
25
- /** The worktree fixture: `<root>/wt` holding `mx-agent-system/cli`. */
26
- let worktree;
27
- let cliDir;
28
- /** Queued answers, consumed one per spawn in order: ci, build, probe. */
29
- let answers = [];
30
- const OK = { status: 0, stdout: '', stderr: '' };
31
- const PROBE_OK = { status: 0, stdout: '0.1.72\n', stderr: '' };
32
- /** Every spawn's arguments, in call order. */
33
- function calls() {
34
- return vi.mocked(spawnSync).mock.calls.map((c) => ({
35
- command: String(c[0]),
36
- args: c[1] ?? [],
37
- options: c[2] ?? {},
38
- }));
39
- }
40
- /** A worktree that passes every pre-spawn check. */
41
- function makeWorktree() {
42
- cliDir = join(worktree, 'mx-agent-system', 'cli');
43
- mkdirSync(cliDir, { recursive: true });
44
- writeFileSync(join(cliDir, 'package.json'), '{"name":"x","version":"0.1.72"}\n');
45
- writeFileSync(join(cliDir, 'package-lock.json'), '{"lockfileVersion":3}\n');
46
- }
47
- /** A directory holding an executable file named `npm`, for the M2 seam. */
48
- function fakeNodeDir(withNpm) {
49
- const dir = mkdtempSync(join(root, 'exec-'));
50
- if (withNpm)
51
- writeFileSync(join(dir, 'npm'), '#!/bin/sh\n', { mode: 0o755 });
52
- return join(dir, 'node');
53
- }
54
- beforeEach(() => {
55
- root = mkdtempSync(join(tmpdir(), 'mx-cli-build-'));
56
- worktree = join(root, 'wt');
57
- mkdirSync(worktree, { recursive: true });
58
- makeWorktree();
59
- answers = [OK, OK, PROBE_OK];
60
- vi.mocked(spawnSync).mockReset();
61
- vi.mocked(spawnSync).mockImplementation((() => {
62
- const next = answers.shift();
63
- return next ?? OK;
64
- }));
65
- });
66
- afterEach(() => {
67
- rmSync(root, { recursive: true, force: true });
68
- });
69
- // ── M1. Lifecycle scripts are off, on the argv, on both commands ────────────
70
- describe('M1 — --ignore-scripts on the argv of both commands', () => {
71
- it('passes the flag on both, and never through the environment', () => {
72
- const result = buildCliInWorktree(worktree);
73
- expect(result.kind).toBe('built');
74
- const [ci, build] = calls();
75
- expect(ci.args).toContain('--ignore-scripts');
76
- expect(build.args).toContain('--ignore-scripts');
77
- // An argv flag beats a project `.npmrc`; an environment variable does not.
78
- for (const c of calls()) {
79
- const env = c.options.env;
80
- expect(env.npm_config_ignore_scripts).toBeUndefined();
81
- }
82
- });
83
- it('never spawns install, rebuild, link or publish', () => {
84
- buildCliInWorktree(worktree);
85
- for (const c of calls()) {
86
- expect(['install', 'rebuild', 'link', 'publish']).not.toContain(c.args[0]);
87
- }
88
- });
89
- });
90
- // ── M2. npm resolved beside node first, PATH second ─────────────────────────
91
- describe('M2 — npm is resolved from dirname(process.execPath) first', () => {
92
- it('spawns the absolute path when npm sits beside node', () => {
93
- const execPath = fakeNodeDir(true);
94
- const result = buildCliInWorktree(worktree, { execPath });
95
- expect(result.kind).toBe('built');
96
- expect(calls()[0].command).toBe(join(execPath, '..', 'npm'));
97
- });
98
- it('falls back to PATH when nothing sits beside node, and says which was used', () => {
99
- const execPath = fakeNodeDir(false);
100
- answers = [{ status: 1, stdout: '', stderr: 'boom' }];
101
- const result = buildCliInWorktree(worktree, { execPath });
102
- expect(calls()[0].command).toBe('npm');
103
- expect(result.kind).toBe('could-not-run');
104
- if (result.kind !== 'could-not-run')
105
- throw new Error('unreachable');
106
- expect(result.detail).toContain('npm from PATH');
107
- });
108
- it('reports the node-adjacent npm in the failure detail when that one was used', () => {
109
- const execPath = fakeNodeDir(true);
110
- answers = [{ status: 1, stdout: '', stderr: 'boom' }];
111
- const result = buildCliInWorktree(worktree, { execPath });
112
- if (result.kind !== 'could-not-run')
113
- throw new Error('unreachable');
114
- expect(result.detail).toContain('beside node');
115
- });
116
- it('never spawns npm.cmd and never sets shell', () => {
117
- buildCliInWorktree(worktree);
118
- for (const c of calls()) {
119
- expect(c.command).not.toContain('npm.cmd');
120
- expect(c.options.shell).toBeUndefined();
121
- }
122
- });
123
- it('falls back when the node-adjacent npm is a directory', () => {
124
- const dir = mkdtempSync(join(root, 'exec-'));
125
- mkdirSync(join(dir, 'npm'));
126
- expect(resolveNpm(join(dir, 'node'))).toEqual({ command: 'npm', source: 'PATH' });
127
- });
128
- });
129
- // ── M3. Every symlinked component refuses, before any spawn ─────────────────
130
- describe('M3 — the containment gate', () => {
131
- it('refuses when the PARENT mx-agent-system is a symlink, naming it, with zero spawns', () => {
132
- // The case the last-component check misses: the lexical join still starts
133
- // with the worktree prefix and `lstatSync(cliDir)` follows the parent and
134
- // reports a real directory.
135
- const outside = join(root, 'elsewhere');
136
- mkdirSync(join(outside, 'cli'), { recursive: true });
137
- writeFileSync(join(outside, 'cli', 'package.json'), '{}\n');
138
- writeFileSync(join(outside, 'cli', 'package-lock.json'), '{}\n');
139
- const wt = join(root, 'wt2');
140
- mkdirSync(wt, { recursive: true });
141
- symlinkSync(outside, join(wt, 'mx-agent-system'));
142
- const result = buildCliInWorktree(wt);
143
- expect(result.kind).toBe('could-not-run');
144
- if (result.kind !== 'could-not-run')
145
- throw new Error('unreachable');
146
- expect(result.detail).toContain('symlink');
147
- expect(result.detail).toContain('mx-agent-system');
148
- expect(spawnSync).not.toHaveBeenCalled();
149
- });
150
- it('refuses when the LAST component mx-agent-system/cli is a symlink', () => {
151
- const outside = join(root, 'elsewhere2');
152
- mkdirSync(outside, { recursive: true });
153
- writeFileSync(join(outside, 'package.json'), '{}\n');
154
- const wt = join(root, 'wt3');
155
- mkdirSync(join(wt, 'mx-agent-system'), { recursive: true });
156
- symlinkSync(outside, join(wt, 'mx-agent-system', 'cli'));
157
- const result = buildCliInWorktree(wt);
158
- expect(result.kind).toBe('could-not-run');
159
- if (result.kind !== 'could-not-run')
160
- throw new Error('unreachable');
161
- expect(result.detail).toContain('symlink');
162
- expect(result.detail).toContain('cli');
163
- expect(spawnSync).not.toHaveBeenCalled();
164
- });
165
- it('refuses a component that resolves outside the worktree through ..', () => {
166
- // `realpathSync(worktreePath)` normalises a literal `..` inside the
167
- // worktree path itself, so the reachable form of that case is a component
168
- // whose target climbs out with `..`. The equality check catches it.
169
- const outside = join(root, 'sibling');
170
- mkdirSync(join(outside, 'cli'), { recursive: true });
171
- writeFileSync(join(outside, 'cli', 'package.json'), '{}\n');
172
- const wt = join(root, 'wt4');
173
- mkdirSync(wt, { recursive: true });
174
- symlinkSync('../sibling', join(wt, 'mx-agent-system'));
175
- const result = buildCliInWorktree(wt);
176
- expect(result.kind).toBe('could-not-run');
177
- if (result.kind !== 'could-not-run')
178
- throw new Error('unreachable');
179
- expect(result.detail).toContain('symlink');
180
- expect(spawnSync).not.toHaveBeenCalled();
181
- });
182
- it('passes cwd and --prefix= as one byte-identical absolute path', () => {
183
- buildCliInWorktree(worktree);
184
- for (const c of calls().slice(0, 2)) {
185
- const prefix = c.args.find((a) => a.startsWith('--prefix='));
186
- expect(prefix).toBeDefined();
187
- const value = prefix.slice('--prefix='.length);
188
- expect(value).toBe(c.options.cwd);
189
- expect(value.startsWith('/')).toBe(true);
190
- }
191
- });
192
- });
193
- // ── M4. .npmrc, shrinkwrap, and the required lockfile ───────────────────────
194
- describe('M4 — refusals that precede the first spawn', () => {
195
- const forbidden = [
196
- ['the worktree .npmrc', ['.npmrc']],
197
- ['the mx-agent-system .npmrc', ['mx-agent-system', '.npmrc']],
198
- ['the cli .npmrc', ['mx-agent-system', 'cli', '.npmrc']],
199
- ['a shrinkwrap', ['mx-agent-system', 'cli', 'npm-shrinkwrap.json']],
200
- ];
201
- for (const [name, parts] of forbidden) {
202
- it(`refuses on ${name}, naming the path, with zero spawns`, () => {
203
- const path = join(worktree, ...parts);
204
- writeFileSync(path, 'registry=https://example.invalid/\n');
205
- const result = buildCliInWorktree(worktree);
206
- expect(result.kind).toBe('could-not-run');
207
- if (result.kind !== 'could-not-run')
208
- throw new Error('unreachable');
209
- expect(result.detail).toContain(path);
210
- expect(spawnSync).not.toHaveBeenCalled();
211
- });
212
- }
213
- it('refuses a SYMLINKED .npmrc, which an existence check would follow', () => {
214
- // `lstatSync`, not `existsSync`: the point of the item is that a `.npmrc`
215
- // symlinked to a file outside the tree passes an existence check aimed at
216
- // catching it.
217
- const path = join(worktree, 'mx-agent-system', 'cli', '.npmrc');
218
- symlinkSync('/dev/null', path);
219
- const result = buildCliInWorktree(worktree);
220
- expect(result.kind).toBe('could-not-run');
221
- if (result.kind !== 'could-not-run')
222
- throw new Error('unreachable');
223
- expect(result.detail).toContain(path);
224
- expect(spawnSync).not.toHaveBeenCalled();
225
- });
226
- it('refuses when package-lock.json is absent, naming the lock file', () => {
227
- rmSync(join(cliDir, 'package-lock.json'));
228
- const result = buildCliInWorktree(worktree);
229
- expect(result.kind).toBe('could-not-run');
230
- if (result.kind !== 'could-not-run')
231
- throw new Error('unreachable');
232
- expect(result.detail).toContain('package-lock.json');
233
- expect(spawnSync).not.toHaveBeenCalled();
234
- });
235
- });
236
- // ── M5. The stages are gated on each other ──────────────────────────────────
237
- describe('M5 — a failed npm ci stops the module', () => {
238
- it('stops after one spawn on a non-zero ci exit', () => {
239
- answers = [{ status: 1, stdout: '', stderr: 'E404 not found' }];
240
- const result = buildCliInWorktree(worktree);
241
- expect(vi.mocked(spawnSync)).toHaveBeenCalledTimes(1);
242
- expect(result).toMatchObject({ kind: 'could-not-run', stage: 'ci' });
243
- });
244
- it('stops after one spawn on a killed ci', () => {
245
- answers = [{ status: null, signal: 'SIGKILL', stdout: '', stderr: '', error: Object.assign(new Error('timed out'), { code: 'ETIMEDOUT' }) }];
246
- const result = buildCliInWorktree(worktree);
247
- expect(vi.mocked(spawnSync)).toHaveBeenCalledTimes(1);
248
- expect(result).toMatchObject({ kind: 'could-not-run', stage: 'ci' });
249
- });
250
- it('never runs the probe after a failed build', () => {
251
- answers = [OK, { status: 2, stdout: '', stderr: 'tsc failed' }];
252
- const result = buildCliInWorktree(worktree);
253
- expect(vi.mocked(spawnSync)).toHaveBeenCalledTimes(2);
254
- expect(result).toMatchObject({ kind: 'could-not-run', stage: 'build' });
255
- });
256
- });
257
- // ── M6. The excerpt pipeline ────────────────────────────────────────────────
258
- describe('M6 — the stderr excerpt is bounded, stripped and redacted', () => {
259
- it('caps one enormous line at 8192 bytes', () => {
260
- const huge = 'x'.repeat(200_000);
261
- answers = [{ status: 1, stdout: '', stderr: huge }];
262
- const result = buildCliInWorktree(worktree);
263
- if (result.kind !== 'could-not-run')
264
- throw new Error('unreachable');
265
- expect(Buffer.from(result.detail, 'utf8').byteLength).toBeLessThanOrEqual(8192 + 300);
266
- expect(result.detail).not.toContain(huge);
267
- });
268
- it('caps 100 lines at 20', () => {
269
- const lines = Array.from({ length: 100 }, (_, i) => `line-${i}`);
270
- answers = [{ status: 1, stdout: '', stderr: lines.join('\n') }];
271
- const result = buildCliInWorktree(worktree);
272
- if (result.kind !== 'could-not-run')
273
- throw new Error('unreachable');
274
- expect(result.detail).toContain('line-99');
275
- expect(result.detail).not.toContain('line-79');
276
- });
277
- it('strips escape sequences that could rewrite the lines above them', () => {
278
- const esc = String.fromCharCode(27);
279
- answers = [{ status: 1, stdout: '', stderr: `${esc}[2J${esc}[Hnpm ERR! failed` }];
280
- const result = buildCliInWorktree(worktree);
281
- if (result.kind !== 'could-not-run')
282
- throw new Error('unreachable');
283
- expect(result.detail).not.toContain(esc);
284
- expect(result.detail).toContain('npm ERR! failed');
285
- });
286
- const secrets = [
287
- ['URL credentials', 'https://user:tok@registry.example/', 'tok'],
288
- ['an _authToken', '//registry.example/:_authToken=abcdef123', 'abcdef123'],
289
- ['an _auth', '_auth=abcdef123', 'abcdef123'],
290
- ['a _password', '_password=hunter2hunter2', 'hunter2hunter2'],
291
- ['an Authorization header', 'Authorization: Bearer abcdef123', 'abcdef123'],
292
- ['a bare Bearer token', 'Bearer abcdef123456', 'abcdef123456'],
293
- ['a ghp_ token', 'ghp_AAAABBBBCCCCDDDD', 'ghp_AAAABBBBCCCCDDDD'],
294
- ['a github_pat_ token', 'github_pat_AAAABBBB', 'github_pat_AAAABBBB'],
295
- ['an sk-ant- key', 'sk-ant-AAAABBBBCCCC', 'sk-ant-AAAABBBBCCCC'],
296
- ];
297
- for (const [name, line, leaked] of secrets) {
298
- it(`redacts ${name}`, () => {
299
- answers = [{ status: 1, stdout: '', stderr: `npm ERR! ${line}` }];
300
- const result = buildCliInWorktree(worktree);
301
- if (result.kind !== 'could-not-run')
302
- throw new Error('unreachable');
303
- expect(result.detail).not.toContain(leaked);
304
- expect(result.detail).toContain('<redacted>');
305
- });
306
- }
307
- it('runs the pipeline on the DETAIL, not only on a logged line', () => {
308
- // `detail` is what a status report or a PR body copies, so it reaches
309
- // further than the log does. This whole file asserts against `detail`.
310
- answers = [{ status: 1, stdout: '', stderr: 'npm ERR! https://u:leaked@r.example/' }];
311
- const result = buildCliInWorktree(worktree);
312
- if (result.kind !== 'could-not-run')
313
- throw new Error('unreachable');
314
- expect(result.detail).not.toContain('leaked');
315
- });
316
- it('redacts BEFORE the cut, so removing a prefix cannot orphan a secret body', () => {
317
- // The residual that redact-last leaves on its own. The truncation keeps the
318
- // tail, so it removes the fixed literal prefix first: once `https://` is
319
- // gone the remainder no longer matches and the secret body would print.
320
- // Swept across every offset where the 8,192-byte cut lands inside or beside
321
- // the prefix, so this cannot pass by landing on a lucky alignment.
322
- const secret = 'SUPERSECRETTOKEN';
323
- for (let suffixLen = 8180; suffixLen <= 8215; suffixLen++) {
324
- const credential = `https://user:${secret}@registry.example/x`;
325
- const payload = credential + 'T'.repeat(Math.max(0, suffixLen - credential.length));
326
- answers = [{ status: 1, stdout: '', stderr: 'H'.repeat(12_000) + payload }];
327
- vi.mocked(spawnSync).mockClear();
328
- const result = buildCliInWorktree(worktree);
329
- if (result.kind !== 'could-not-run')
330
- throw new Error('unreachable');
331
- expect(result.detail, `leaked at suffix length ${suffixLen}`).not.toContain(secret);
332
- }
333
- });
334
- it('redacts a ghp_ token whose prefix the cut removes', () => {
335
- const body = 'AAAABBBBCCCCDDDDEEEEFFFF';
336
- for (let suffixLen = 8185; suffixLen <= 8200; suffixLen++) {
337
- const token = `ghp_${body}`;
338
- const payload = token + 'T'.repeat(Math.max(0, suffixLen - token.length));
339
- answers = [{ status: 1, stdout: '', stderr: 'H'.repeat(12_000) + payload }];
340
- vi.mocked(spawnSync).mockClear();
341
- const result = buildCliInWorktree(worktree);
342
- if (result.kind !== 'could-not-run')
343
- throw new Error('unreachable');
344
- expect(result.detail, `leaked at suffix length ${suffixLen}`).not.toContain(body);
345
- }
346
- });
347
- it('leaves no secret when the cut splits a redaction marker instead', () => {
348
- // The residual that redact-first leaves on its own, and the reason the
349
- // ruling put redaction last. With a pass at each end, a cut can divide only
350
- // marker text, so what survives is at worst a fragment of `<redacted>`.
351
- const secret = 'SUPERSECRETTOKEN';
352
- for (let suffixLen = 8180; suffixLen <= 8200; suffixLen++) {
353
- const credential = `https://user:${secret}@registry.example/x`;
354
- const payload = 'T'.repeat(Math.max(0, suffixLen - credential.length)) + credential;
355
- answers = [{ status: 1, stdout: '', stderr: 'H'.repeat(12_000) + payload }];
356
- vi.mocked(spawnSync).mockClear();
357
- const result = buildCliInWorktree(worktree);
358
- if (result.kind !== 'could-not-run')
359
- throw new Error('unreachable');
360
- expect(result.detail, `leaked at suffix length ${suffixLen}`).not.toContain(secret);
361
- }
362
- });
363
- it('redacts a pattern the control strip reassembles, which needs the final pass', () => {
364
- // A NUL inside the prefix stops the first pass matching. The strip removes
365
- // it, and the pass after the strip is what catches the result.
366
- const body = 'AAAABBBBCCCCDDDD';
367
- answers = [{ status: 1, stdout: '', stderr: `npm ERR! ghp${String.fromCharCode(0)}_${body}` }];
368
- const result = buildCliInWorktree(worktree);
369
- if (result.kind !== 'could-not-run')
370
- throw new Error('unreachable');
371
- expect(result.detail).not.toContain(body);
372
- });
373
- it('exposes the pipeline directly for the two budgets', () => {
374
- expect(Buffer.from(excerpt('y'.repeat(100_000)), 'utf8').byteLength).toBeLessThanOrEqual(8192);
375
- expect(excerpt(Array.from({ length: 50 }, (_, i) => `l${i}`).join('\n')).split('\n')).toHaveLength(20);
376
- });
377
- });
378
- // ── M7. The environment allowlist ───────────────────────────────────────────
379
- describe('M7 — the child environment', () => {
380
- const DECOYS = [
381
- 'NODE_ENV',
382
- 'NODE_PATH',
383
- 'NODE_OPTIONS',
384
- 'GIT_DIR',
385
- 'npm_config_cache',
386
- 'npm_config_ignore_scripts',
387
- 'npm_config_registry',
388
- 'GH_TOKEN',
389
- 'GITHUB_TOKEN',
390
- 'ANTHROPIC_API_KEY',
391
- 'MX_AGENT_OBSERVABILITY_TOKEN',
392
- ];
393
- it('drops every decoy and keeps only the allowlist plus the two colour keys', () => {
394
- const source = { PATH: '/usr/bin', HOME: '/home/node', LANG: 'C' };
395
- for (const key of DECOYS)
396
- source[key] = 'decoy-value';
397
- const env = buildEnv(source);
398
- for (const key of DECOYS)
399
- expect(env[key]).toBeUndefined();
400
- expect(Object.keys(env).sort()).toEqual(['HOME', 'LANG', 'NO_COLOR', 'PATH', 'npm_config_color'].sort());
401
- expect(env.NO_COLOR).toBe('1');
402
- expect(env.npm_config_color).toBe('false');
403
- });
404
- it('gives every spawn that environment, proven from the captured argument', () => {
405
- // Proven from what the mock received, never from npm's own output: a test
406
- // that dumped npm's resolved configuration would put the contents of the
407
- // user config file into a fleet-readable transcript (I1).
408
- buildCliInWorktree(worktree, { env: { PATH: '/usr/bin', GH_TOKEN: 'decoy-value' } });
409
- for (const c of calls()) {
410
- const env = c.options.env;
411
- expect(env.GH_TOKEN).toBeUndefined();
412
- expect(env.NO_COLOR).toBe('1');
413
- }
414
- });
415
- it('passes --include=dev and a fixed --loglevel=error, and never a verbose level', () => {
416
- buildCliInWorktree(worktree);
417
- const [ci, build] = calls();
418
- expect(ci.args).toContain('--include=dev');
419
- expect(ci.args).toContain('--loglevel=error');
420
- expect(build.args).toContain('--loglevel=error');
421
- for (const c of calls()) {
422
- for (const bad of ['--loglevel=verbose', '--loglevel=silly', '--foreground-scripts', '--verbose']) {
423
- expect(c.args).not.toContain(bad);
424
- }
425
- }
426
- });
427
- });
428
- // ── S1. maxBuffer, and no cache pin ─────────────────────────────────────────
429
- describe('S1 — the buffer bound and the refused cache pin', () => {
430
- it('bounds every spawn at 8 MiB', () => {
431
- buildCliInWorktree(worktree);
432
- for (const c of calls())
433
- expect(c.options.maxBuffer).toBe(8 * 1024 * 1024);
434
- });
435
- it('pins no npm cache, in the environment or on the argv', () => {
436
- // Refused: npm's cache is content-addressed and verified on read, and a pin
437
- // would force a 315 MB download per creation. What matters is that
438
- // `npm_config_cache` cannot be injected, which the allowlist closes.
439
- buildCliInWorktree(worktree);
440
- for (const c of calls()) {
441
- expect(c.options.env.npm_config_cache).toBeUndefined();
442
- expect(c.args.some((a) => a.includes('cache'))).toBe(false);
443
- }
444
- });
445
- });
446
- // ── S2. A build-stage kill leaves a grandchild ──────────────────────────────
447
- describe('S2 — the build-stage timeout names the orphan and changes the remedy', () => {
448
- it('warns about a surviving tsc and gives the clearing remedy', () => {
449
- answers = [OK, { status: null, signal: 'SIGKILL', stdout: '', stderr: '', error: Object.assign(new Error('timed out'), { code: 'ETIMEDOUT' }) }];
450
- const result = buildCliInWorktree(worktree);
451
- if (result.kind !== 'could-not-run')
452
- throw new Error('unreachable');
453
- expect(result.stage).toBe('build');
454
- expect(result.detail).toContain(ORPHAN_WARNING);
455
- expect(result.detail).toContain(ORPHAN_REMEDY);
456
- expect(ORPHAN_REMEDY).not.toBe(REBUILD_REMEDY);
457
- });
458
- it('gives the ordinary remedy on a plain non-zero build exit', () => {
459
- answers = [OK, { status: 2, stdout: '', stderr: 'tsc error' }];
460
- const result = buildCliInWorktree(worktree);
461
- if (result.kind !== 'could-not-run')
462
- throw new Error('unreachable');
463
- expect(result.detail).not.toContain(ORPHAN_WARNING);
464
- expect(result.detail).toContain(REBUILD_REMEDY);
465
- });
466
- it('does not let npm stderr choose the remedy', () => {
467
- // The remedy used to be picked by matching `/timed out|was killed/` against
468
- // a detail string that already carries npm's stderr, so npm's own words
469
- // selected the destructive `rm -rf` hint. The verdict comes from the spawn
470
- // result now, which no output can reach.
471
- answers = [OK, { status: 1, stdout: '', stderr: 'npm ERR! upstream process was killed by the registry' }];
472
- const result = buildCliInWorktree(worktree);
473
- if (result.kind !== 'could-not-run')
474
- throw new Error('unreachable');
475
- expect(result.detail).not.toContain(ORPHAN_WARNING);
476
- expect(result.detail).not.toContain(ORPHAN_REMEDY);
477
- expect(result.detail).toContain(REBUILD_REMEDY);
478
- });
479
- });
480
- // ── The maxBuffer overflow is not a timeout ─────────────────────────────────
481
- describe('S1/S2 — a maxBuffer overflow is reported as itself', () => {
482
- it('names the output bound instead of claiming a timeout', () => {
483
- // Measured on Node v22.16.0: an overflow gives status null, signal SIGKILL
484
- // and error.code ENOBUFS, so the signal alone cannot tell it from a timeout.
485
- answers = [{ status: null, signal: 'SIGKILL', stdout: '', stderr: '', error: Object.assign(new Error('spawnSync ENOBUFS'), { code: 'ENOBUFS' }) }];
486
- const result = buildCliInWorktree(worktree);
487
- expect(result).toMatchObject({ kind: 'could-not-run', stage: 'ci' });
488
- if (result.kind !== 'could-not-run')
489
- throw new Error('unreachable');
490
- expect(result.detail).toContain('more than 8 MiB of output');
491
- expect(result.detail).not.toContain('timed out');
492
- });
493
- it('still warns about the orphan when the build stage overflows', () => {
494
- // The child was signalled, so a grandchild can outlive it exactly as on a
495
- // timeout. The warning is right here; only the timeout sentence was wrong.
496
- answers = [OK, { status: null, signal: 'SIGKILL', stdout: '', stderr: '', error: Object.assign(new Error('spawnSync ENOBUFS'), { code: 'ENOBUFS' }) }];
497
- const result = buildCliInWorktree(worktree);
498
- if (result.kind !== 'could-not-run')
499
- throw new Error('unreachable');
500
- expect(result.stage).toBe('build');
501
- expect(result.detail).toContain('more than 8 MiB of output');
502
- expect(result.detail).not.toContain('timed out');
503
- expect(result.detail).toContain(ORPHAN_WARNING);
504
- });
505
- });
506
- // ── S3. The version probe is parsed, not trusted ────────────────────────────
507
- describe('S3 — the version probe', () => {
508
- it('accepts a semver first line and ignores what follows it', () => {
509
- answers = [OK, OK, { status: 0, stdout: '1.2.3\nnoise\n', stderr: '' }];
510
- const result = buildCliInWorktree(worktree);
511
- expect(result).toMatchObject({ kind: 'built', version: '1.2.3' });
512
- });
513
- it('accepts a prerelease alone', () => {
514
- answers = [OK, OK, { status: 0, stdout: '1.2.3-rc.1\n', stderr: '' }];
515
- expect(buildCliInWorktree(worktree)).toMatchObject({ kind: 'built', version: '1.2.3-rc.1' });
516
- });
517
- it('accepts build metadata alone', () => {
518
- answers = [OK, OK, { status: 0, stdout: '1.2.3+build.5\n', stderr: '' }];
519
- expect(buildCliInWorktree(worktree)).toMatchObject({ kind: 'built', version: '1.2.3+build.5' });
520
- });
521
- it('accepts a prerelease AND build metadata together', () => {
522
- // The ruling's character class omitted `+` from the suffix, so this legal
523
- // semver was refused and a good provision read could-not-run.
524
- answers = [OK, OK, { status: 0, stdout: '1.2.3-rc.1+build.5\n', stderr: '' }];
525
- expect(buildCliInWorktree(worktree)).toMatchObject({ kind: 'built', version: '1.2.3-rc.1+build.5' });
526
- });
527
- it('still refuses the shapes that are not versions', () => {
528
- for (const bad of ['v1.2.3', '1.2', '1.2.3-', '1.2.3 rubbish', '1.2.3-rc.1+build.5+extra']) {
529
- answers = [OK, OK, { status: 0, stdout: `${bad}\n`, stderr: '' }];
530
- vi.mocked(spawnSync).mockClear();
531
- expect(buildCliInWorktree(worktree), bad).toMatchObject({ kind: 'could-not-run', stage: 'probe' });
532
- }
533
- });
534
- it('refuses output that is not a version, and never prints it', () => {
535
- const attack = 'not-a-version-but-a-sentence-someone-wrote';
536
- answers = [OK, OK, { status: 0, stdout: `${attack}\n`, stderr: '' }];
537
- const result = buildCliInWorktree(worktree);
538
- expect(result).toMatchObject({ kind: 'could-not-run', stage: 'probe' });
539
- if (result.kind !== 'could-not-run')
540
- throw new Error('unreachable');
541
- expect(result.detail).not.toContain(attack);
542
- expect(result.detail).toContain(String(attack.length));
543
- });
544
- it('refuses a version line longer than 64 characters', () => {
545
- answers = [OK, OK, { status: 0, stdout: `1.2.3-${'a'.repeat(100)}\n`, stderr: '' }];
546
- expect(buildCliInWorktree(worktree)).toMatchObject({ kind: 'could-not-run', stage: 'probe' });
547
- });
548
- it('runs the probe with the same env, containment and no shell as the other two', () => {
549
- buildCliInWorktree(worktree);
550
- const probe = calls()[2];
551
- expect(probe.args[0]).toBe('--');
552
- expect(probe.args[2]).toBe('--version');
553
- expect(probe.options.cwd).toBe(cliDir);
554
- expect(probe.options.shell).toBeUndefined();
555
- expect(probe.options.env.NO_COLOR).toBe('1');
556
- });
557
- });
558
- // ── S4. Both versions ───────────────────────────────────────────────────────
559
- describe('S4 — the built version and the running binary version', () => {
560
- it('returns the runner version alongside the built one', () => {
561
- answers = [OK, OK, { status: 0, stdout: '9.9.9\n', stderr: '' }];
562
- const result = buildCliInWorktree(worktree);
563
- if (result.kind !== 'built')
564
- throw new Error('unreachable');
565
- expect(result.version).toBe('9.9.9');
566
- // Resolved from the package.json shipping beside this module, the same way
567
- // `src/index.ts` resolves it. Two different codebases, two fields.
568
- expect(result.runnerVersion).toMatch(/^\d+\.\d+\.\d+/);
569
- expect(Object.keys(result)).toContain('runnerVersion');
570
- });
571
- });
572
- // ── S5. The -- separator stays ──────────────────────────────────────────────
573
- describe('S5 — the run build separator', () => {
574
- it('keeps -- on the run build argv', () => {
575
- // Pinned so a later reader who finds the corrected reason does not remove
576
- // the flag along with the wrong explanation. It separates npm's arguments
577
- // from the script's; it does not end npm's option parsing.
578
- buildCliInWorktree(worktree);
579
- expect(calls()[1].args).toContain('--');
580
- expect(calls()[1].args[0]).toBe('run');
581
- expect(calls()[1].args[1]).toBe('build');
582
- });
583
- });
584
- // ── S6. Four kinds and no others ────────────────────────────────────────────
585
- describe('S6 — the result kinds', () => {
586
- it('reports not-applicable when the worktree holds no CLI source', () => {
587
- const wt = join(root, 'consumer');
588
- mkdirSync(wt, { recursive: true });
589
- const result = buildCliInWorktree(wt);
590
- expect(result.kind).toBe('not-applicable');
591
- expect(spawnSync).not.toHaveBeenCalled();
592
- });
593
- it('reports not-applicable when package.json is absent from an existing cli dir', () => {
594
- rmSync(join(cliDir, 'package.json'));
595
- expect(buildCliInWorktree(worktree).kind).toBe('not-applicable');
596
- expect(spawnSync).not.toHaveBeenCalled();
597
- });
598
- it('refuses on win32 rather than guessing an extension', () => {
599
- const result = buildCliInWorktree(worktree, { platform: 'win32' });
600
- expect(result).toMatchObject({ kind: 'could-not-run', stage: 'ci' });
601
- expect(spawnSync).not.toHaveBeenCalled();
602
- });
603
- it('reports could-not-run on ENOENT from the spawn itself', () => {
604
- answers = [{ status: null, stdout: '', stderr: '', error: Object.assign(new Error('spawn npm ENOENT'), { code: 'ENOENT' }) }];
605
- expect(buildCliInWorktree(worktree)).toMatchObject({ kind: 'could-not-run', stage: 'ci' });
606
- });
607
- it('never returns a kind outside the four', () => {
608
- const kinds = new Set();
609
- kinds.add(buildCliInWorktree(worktree).kind);
610
- answers = [{ status: 1, stdout: '', stderr: 'x' }];
611
- kinds.add(buildCliInWorktree(worktree).kind);
612
- const wt = join(root, 'consumer2');
613
- mkdirSync(wt, { recursive: true });
614
- kinds.add(buildCliInWorktree(wt).kind);
615
- for (const kind of kinds) {
616
- expect(['built', 'not-applicable', 'not-reached', 'could-not-run']).toContain(kind);
617
- }
618
- });
619
- it('does not let a thrown spawn escape as an exception', () => {
620
- vi.mocked(spawnSync).mockImplementation((() => {
621
- throw new Error('spawn exploded');
622
- }));
623
- // The module does not catch this itself; `create.ts` step 6e does, and this
624
- // pins that the throw is what it has to catch rather than a silent success.
625
- expect(() => buildCliInWorktree(worktree)).toThrow('spawn exploded');
626
- });
627
- });
628
- // ── I1. The constraint that belongs in the test file ────────────────────────
629
- describe('I1 — no test reads the user npm config', () => {
630
- it('proves the allowlist from the captured env argument alone', () => {
631
- // `$HOME/.npmrc` exists on this machine and npm reads it on every provision,
632
- // because M7 keeps `HOME`. Nothing here reads, prints, copies or measures
633
- // that file, and nothing dumps npm's resolved configuration.
634
- buildCliInWorktree(worktree, { env: { PATH: '/usr/bin', HOME: '/home/node' } });
635
- const env = calls()[0].options.env;
636
- expect(env.HOME).toBe('/home/node');
637
- expect(Object.keys(env)).not.toContain('npm_config_userconfig');
638
- });
639
- });
640
- //# sourceMappingURL=cli-build.test.js.map