@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,22 +0,0 @@
1
- /**
2
- * #4970 — a REJECTED coordination token must never read as an empty inbox.
3
- *
4
- * Before this, resolveCoordinationToken returned the per-worktree cache
5
- * unconditionally, nothing deleted that cache on an HTTP error, and runBrief
6
- * called drain() with no handling at all. Post-rotation every team's session
7
- * start would present the dead cached token forever with no self-heal, and the
8
- * session-start hook discarded the failure entirely.
9
- *
10
- * THE DIRECTION THAT MATTERS (KI-METHOD-MUTATE-FAIL-OPEN). These tests are
11
- * written to fail when the code goes back to being QUIET. The mutations they
12
- * must catch are:
13
- * - the client wrapper swallowing a 401 and returning an empty DrainResponse;
14
- * - the second 401 being reported as anything other than a loud, non-zero,
15
- * TOKEN_REJECTED failure;
16
- * - refreshCoordinationToken keeping the stale cache file;
17
- * - the recovery being wired into runBrief only, leaving drain/history silent.
18
- * A test that only asserts the happy retry path would pass against every one of
19
- * those, so each case below also asserts the ABSENCE of the reassuring output.
20
- */
21
- export {};
22
- //# sourceMappingURL=coordination-401-recovery.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"coordination-401-recovery.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/coordination-401-recovery.test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG"}
@@ -1,601 +0,0 @@
1
- /**
2
- * #4970 — a REJECTED coordination token must never read as an empty inbox.
3
- *
4
- * Before this, resolveCoordinationToken returned the per-worktree cache
5
- * unconditionally, nothing deleted that cache on an HTTP error, and runBrief
6
- * called drain() with no handling at all. Post-rotation every team's session
7
- * start would present the dead cached token forever with no self-heal, and the
8
- * session-start hook discarded the failure entirely.
9
- *
10
- * THE DIRECTION THAT MATTERS (KI-METHOD-MUTATE-FAIL-OPEN). These tests are
11
- * written to fail when the code goes back to being QUIET. The mutations they
12
- * must catch are:
13
- * - the client wrapper swallowing a 401 and returning an empty DrainResponse;
14
- * - the second 401 being reported as anything other than a loud, non-zero,
15
- * TOKEN_REJECTED failure;
16
- * - refreshCoordinationToken keeping the stale cache file;
17
- * - the recovery being wired into runBrief only, leaving drain/history silent.
18
- * A test that only asserts the happy retry path would pass against every one of
19
- * those, so each case below also asserts the ABSENCE of the reassuring output.
20
- */
21
- import { describe, it, expect, beforeEach, afterEach, vi } from 'vitest';
22
- import { mkdtempSync, mkdirSync, rmSync, writeFileSync, existsSync, readFileSync, statSync } from 'node:fs';
23
- import { join } from 'node:path';
24
- import { tmpdir } from 'node:os';
25
- import { runBrief, runDrain, runWatch, prepareClient, withTokenRefresh, WatchAuthError, CoordinationAuthError, TOKEN_REJECTED_MARKER, } from '../commands/coordination.js';
26
- import { refreshCoordinationToken, KEYVAULT_NAME } from '../lib/coordination-token.js';
27
- import { ServiceHttpError, ServiceUnreachableError } from '../lib/coordination-client.js';
28
- let logs;
29
- let errs;
30
- let flushRoot;
31
- const savedEnv = { ...process.env };
32
- beforeEach(() => {
33
- logs = [];
34
- errs = [];
35
- // brief, drain and watch flush the outage fallback file under the worktree
36
- // root before they drain. Since the #525 fix round that root is the git
37
- // worktree of the cwd when CLAUDE_WORKTREE_PATH is unset, which is the
38
- // developer's real team worktree. Name an empty temp dir instead; afterEach
39
- // restores the whole environment.
40
- flushRoot = mkdtempSync(join(tmpdir(), 'coord-401-root-'));
41
- process.env.CLAUDE_WORKTREE_PATH = flushRoot;
42
- // Stated rather than inherited. `resolveProductSlug()` reads
43
- // `mx-agent.config.json` from whatever repository hosts this checkout when the
44
- // env is unset, and this one carries `projectSlug: "mx-agent"` since it was
45
- // onboarded on 2026-08-20. These assertions name memnexus, so the tenant is
46
- // set here instead of borrowed from the tree the tests happen to run in.
47
- process.env.MX_PRODUCT_SLUG = 'memnexus';
48
- process.env.MX_COORDINATION_MODE = 'queue';
49
- vi.spyOn(console, 'log').mockImplementation((m) => { logs.push(String(m)); });
50
- vi.spyOn(console, 'error').mockImplementation((m) => { errs.push(String(m)); });
51
- vi.spyOn(process.stderr, 'write').mockImplementation(((c) => { errs.push(String(c)); return true; }));
52
- });
53
- afterEach(() => {
54
- delete process.env.MX_PRODUCT_SLUG;
55
- vi.restoreAllMocks();
56
- process.env = { ...savedEnv };
57
- rmSync(flushRoot, { recursive: true, force: true });
58
- });
59
- function stubClient(over = {}) {
60
- return {
61
- async enqueue() { return { messageId: 'm1', duplicate: false }; },
62
- async drain() { return { messages: [], remaining: 0, batchId: '' }; },
63
- async confirmDrain() { },
64
- async ack() { },
65
- async history() { return { messages: [], nextBefore: '' }; },
66
- async respondToMessage() { return { messageId: '', obligationState: 'resolved', stateNote: null, stateChangedAt: '' }; },
67
- async getObligations() { return { owe: [], owed: [] }; },
68
- ...over,
69
- };
70
- }
71
- const ONE_MESSAGE = {
72
- messages: [{ id: 'm1', from: 'retrieval', to: 'platform', priority: 'p1', body: 'rotation blocker', timestamp: 't' }],
73
- remaining: 0,
74
- batchId: 'b1',
75
- };
76
- /** A drain that 401s the first `n` calls, then succeeds. Counts every call. */
77
- function drainRejecting(n, calls) {
78
- return async () => {
79
- calls.count++;
80
- if (calls.count <= n)
81
- throw new ServiceHttpError(401, 'invalid token');
82
- return ONE_MESSAGE;
83
- };
84
- }
85
- /** A refresh stub that yields a new token, recording the rejected one it saw. */
86
- function refreshStub(newToken, seen) {
87
- return (rejected) => {
88
- seen.push(rejected);
89
- return { status: 'refreshed', token: newToken, project: 'memnexus', slug: 'platform', source: 'keyvault', cacheInvalidated: true };
90
- };
91
- }
92
- describe('#4970 runBrief — 401 invalidates, refetches, and retries once', () => {
93
- it('recovers: one 401 → refresh → retry succeeds → the brief renders and confirms', async () => {
94
- const calls = { count: 0 };
95
- const seen = [];
96
- const confirmed = [];
97
- process.env.MX_COORD_SERVICE_TOKEN = 'stale-token';
98
- const client = stubClient({
99
- drain: drainRejecting(1, calls),
100
- async confirmDrain(id) { confirmed.push(id); },
101
- });
102
- await runBrief({}, { client, refreshToken: refreshStub('fresh-token', seen) });
103
- expect(calls.count).toBe(2); // retried exactly once
104
- expect(seen).toEqual(['stale-token']); // refresh saw the rejected token
105
- // SF-2 (#5188 security review): the swap is IN-PROCESS — the fresh bearer goes
106
- // to the rebuilt client and to the wrapper's own field, never to process.env,
107
- // which every subprocess inherits. The env value the test set is left alone.
108
- expect(process.env.MX_COORD_SERVICE_TOKEN).toBe('stale-token');
109
- expect(logs.join('\n')).toContain('MX_COORD_UNTRUSTED'); // the brief rendered
110
- expect(confirmed).toEqual(['b1']);
111
- // FAIL-OPEN PIN: recovery must not be reported as an empty queue.
112
- expect(logs.join('\n')).not.toContain('no cross-team coordination pending');
113
- });
114
- it('does NOT retry more than once: a second 401 is a LOUD terminal failure', async () => {
115
- const calls = { count: 0 };
116
- const client = stubClient({ drain: drainRejecting(99, calls) });
117
- const err = await runBrief({}, { client, refreshToken: refreshStub('fresh-token', []) })
118
- .then(() => null, (e) => e);
119
- // Loud: a typed auth error carrying the operator block.
120
- expect(err).toBeInstanceOf(CoordinationAuthError);
121
- expect(err.message).toContain(TOKEN_REJECTED_MARKER);
122
- expect(err.message).toContain('NOT an empty inbox');
123
- expect(err.message).toContain('needs re-issuing');
124
- // Bounded: exactly the original call plus ONE retry, never a loop.
125
- expect(calls.count).toBe(2);
126
- // FAIL-OPEN PIN: nothing that reads as a clear inbox may be printed.
127
- expect(logs.join('\n')).not.toContain('no cross-team coordination pending');
128
- expect(logs.join('\n')).not.toContain('MX_COORD_UNTRUSTED');
129
- });
130
- it('fails LOUD (and never silently) when no replacement token can be fetched', async () => {
131
- const calls = { count: 0 };
132
- const client = stubClient({ drain: drainRejecting(99, calls) });
133
- const refresh = () => ({
134
- status: 'unprovisioned',
135
- project: 'memnexus',
136
- slug: 'platform',
137
- detail: 'Key Vault returned no token (az not logged in, KV unreachable, or secret missing)',
138
- cacheInvalidated: true,
139
- });
140
- const err = await runBrief({}, { client, refreshToken: refresh }).then(() => null, (e) => e);
141
- expect(err).toBeInstanceOf(CoordinationAuthError);
142
- expect(err.message).toContain(TOKEN_REJECTED_MARKER);
143
- expect(err.message).toContain('Cannot refetch a replacement token');
144
- expect(calls.count).toBe(1); // no pointless retry without a token
145
- expect(logs.join('\n')).not.toContain('no cross-team coordination pending');
146
- });
147
- it('names the vault when the refetched token is byte-identical to the rejected one', async () => {
148
- const calls = { count: 0 };
149
- const client = stubClient({ drain: drainRejecting(99, calls) });
150
- const refresh = () => ({
151
- status: 'refreshed', token: 'same', unchanged: true, slug: 'platform', source: 'keyvault', cacheInvalidated: true,
152
- });
153
- const err = await runBrief({}, { client, refreshToken: refresh }).then(() => null, (e) => e);
154
- expect(err.message).toContain('byte-identical to the rejected one');
155
- });
156
- it('fails LOUD with no refresh hook at all (never a swallowed 401)', async () => {
157
- const client = stubClient({ drain: drainRejecting(99, { count: 0 }) });
158
- const err = await runBrief({}, { client }).then(() => null, (e) => e);
159
- expect(err).toBeInstanceOf(CoordinationAuthError);
160
- expect(err.message).toContain(TOKEN_REJECTED_MARKER);
161
- expect(logs.join('\n')).not.toContain('no cross-team coordination pending');
162
- });
163
- it('a 401 from the obligations ledger is not swallowed by the best-effort catch', async () => {
164
- const client = stubClient({
165
- async drain() { return ONE_MESSAGE; },
166
- async getObligations() { throw new ServiceHttpError(401, 'invalid token'); },
167
- });
168
- const err = await runBrief({}, { client }).then(() => null, (e) => e);
169
- expect(err).toBeInstanceOf(CoordinationAuthError);
170
- });
171
- it('leaves non-401 failures exactly as they were (no new swallow, no new fatal)', async () => {
172
- const client = stubClient({ async drain() { throw new ServiceUnreachableError(new Error('down')); } });
173
- await expect(runBrief({}, { client })).rejects.toBeInstanceOf(ServiceUnreachableError);
174
- const c403 = stubClient({ async drain() { throw new ServiceHttpError(403, 'team mismatch'); } });
175
- const seen = [];
176
- // 403 is an authorization decision, not a stale credential: no refetch.
177
- await expect(runBrief({}, { client: c403, refreshToken: refreshStub('x', seen) })).rejects.toThrow('team mismatch');
178
- expect(seen).toEqual([]);
179
- });
180
- });
181
- describe('#4970 recovery lives in the client, so every command gets it', () => {
182
- it('runDrain recovers from a 401 the same way the brief does', async () => {
183
- const calls = { count: 0 };
184
- const confirmed = [];
185
- const client = stubClient({
186
- drain: drainRejecting(1, calls),
187
- async confirmDrain(id) { confirmed.push(id); },
188
- });
189
- await runDrain({}, { client, refreshToken: refreshStub('fresh', []) });
190
- expect(calls.count).toBe(2);
191
- expect(logs.join('\n')).toContain('MX_COORD_UNTRUSTED');
192
- expect(confirmed).toEqual(['b1']);
193
- expect(logs.join('\n')).not.toContain('no cross-team coordination pending');
194
- });
195
- it('runDrain fails LOUD on a surviving 401 instead of printing an empty queue', async () => {
196
- const client = stubClient({ drain: drainRejecting(99, { count: 0 }) });
197
- const err = await runDrain({}, { client, refreshToken: refreshStub('fresh', []) }).then(() => null, (e) => e);
198
- expect(err).toBeInstanceOf(CoordinationAuthError);
199
- expect(logs.join('\n')).not.toContain('no cross-team coordination pending');
200
- });
201
- it('history is wrapped too (the wrapper covers the whole client surface)', async () => {
202
- const client = stubClient({ async history() { throw new ServiceHttpError(401, 'invalid token'); } });
203
- const wrapped = (await prepareClient({ client }));
204
- await expect(wrapped.history({})).rejects.toBeInstanceOf(CoordinationAuthError);
205
- });
206
- it('refetches at most once per client even across many calls (no Key Vault storm)', async () => {
207
- let refreshes = 0;
208
- const client = stubClient({ async drain() { throw new ServiceHttpError(401, 'invalid token'); } });
209
- const wrapped = (await prepareClient({
210
- client,
211
- refreshToken: () => { refreshes++; return { status: 'unprovisioned', detail: 'no token' }; },
212
- }));
213
- for (let i = 0; i < 5; i++) {
214
- await expect(wrapped.drain({})).rejects.toBeInstanceOf(CoordinationAuthError);
215
- }
216
- expect(refreshes).toBe(1);
217
- });
218
- it('BOUNDS refetches even when every refresh SUCCEEDS (no Key Vault storm on a flapping service)', async () => {
219
- // The `exhausted` flag is set only when a refresh FAILS, so a service that
220
- // alternates 401/200 re-arms the path on every call. Measured by the security
221
- // review: 50 drains → 50 refetches, each up to two `az keyvault secret show`
222
- // spawns plus a cache delete+rewrite. runWatch polls every ~15s for hours, so
223
- // that is a service-triggered indefinite loop of subprocess spawns and secret
224
- // reads driven from one command. The budget applies REGARDLESS of outcome.
225
- let refreshes = 0;
226
- let n = 0;
227
- const client = stubClient({
228
- async drain() {
229
- n++;
230
- if (n % 2 === 1)
231
- throw new ServiceHttpError(401, 'invalid token');
232
- return ONE_MESSAGE;
233
- },
234
- });
235
- const wrapped = (await prepareClient({
236
- client,
237
- refreshToken: () => {
238
- refreshes++;
239
- return { status: 'refreshed', token: `fresh-${refreshes}`, slug: 'platform', source: 'keyvault', cacheInvalidated: true };
240
- },
241
- }));
242
- // Three calls each burn one refresh and then succeed.
243
- for (let i = 0; i < 3; i++)
244
- await wrapped.drain({});
245
- expect(refreshes).toBe(3);
246
- // The fourth 401 must NOT buy a fourth refetch — it fails loud instead.
247
- const err = await wrapped.drain({}).then(() => null, (e) => e);
248
- expect(err).toBeInstanceOf(CoordinationAuthError);
249
- expect(err.message).toContain(TOKEN_REJECTED_MARKER);
250
- expect(err.message).toContain('already refetched the token 3 times');
251
- expect(refreshes).toBe(3);
252
- // And it stays bounded for the rest of the client's life, however the service
253
- // keeps flapping (these calls alternate 401 / 200 — outcome is not the point,
254
- // the refetch count is).
255
- for (let i = 0; i < 20; i++) {
256
- await wrapped.drain({}).catch(() => undefined);
257
- }
258
- expect(refreshes).toBe(3);
259
- });
260
- it('a wrapped client wrapped AGAIN refreshes once in total (anti-recursion guard)', async () => {
261
- // Defence in depth for `err instanceof CoordinationAuthError → rethrow`.
262
- // Without it, an outer wrapper treats the inner wrapper's terminal auth
263
- // failure as a fresh 401 (CoordinationAuthError extends ServiceHttpError 401)
264
- // and refetches again — one Key Vault round per nesting level.
265
- let inner = 0;
266
- let outer = 0;
267
- const client = stubClient({ async drain() { throw new ServiceHttpError(401, 'invalid token'); } });
268
- const w1 = withTokenRefresh(client, () => client, () => {
269
- inner++;
270
- return { status: 'unprovisioned', detail: 'no token' };
271
- });
272
- const w2 = withTokenRefresh(w1, () => w1, () => {
273
- outer++;
274
- return { status: 'refreshed', token: 'fresh', slug: 'platform', source: 'keyvault' };
275
- });
276
- await expect(w2.drain({})).rejects.toBeInstanceOf(CoordinationAuthError);
277
- expect(inner).toBe(1);
278
- expect(outer).toBe(0);
279
- });
280
- it('runWatch keeps its clean-fatal convention after recovery fails (WatchAuthError)', async () => {
281
- const client = stubClient({ async drain() { throw new ServiceHttpError(401, 'invalid token'); } });
282
- const err = await runWatch({ once: true }, { client, sleep: async () => { } }).then(() => null, (e) => e);
283
- expect(err).toBeInstanceOf(WatchAuthError);
284
- // The loud recovery block survives the conversion — without this, watch
285
- // reports a generic one-liner and the operator loses the three recovery steps.
286
- expect(err.message).toContain(TOKEN_REJECTED_MARKER);
287
- expect(err.message).toContain('needs re-issuing');
288
- });
289
- it('runWatch self-heals when the refetch works (no restart needed)', async () => {
290
- const calls = { count: 0 };
291
- const client = stubClient({ drain: drainRejecting(1, calls) });
292
- await runWatch({ once: true }, { client, refreshToken: refreshStub('fresh', []), sleep: async () => { } });
293
- expect(calls.count).toBe(2);
294
- expect(logs.join('\n')).toContain('MX_COORD_UNTRUSTED');
295
- });
296
- });
297
- describe('#4970 refreshCoordinationToken — the cache is actually invalidated', () => {
298
- let dir;
299
- beforeEach(() => { dir = mkdtempSync(join(tmpdir(), 'coord-401-')); });
300
- afterEach(() => { rmSync(dir, { recursive: true, force: true }); });
301
- const CACHE = '.mx-coordination-token--memnexus--platform';
302
- function seed(token) {
303
- writeFileSync(join(dir, '.mx-coordination-team'), 'platform\n');
304
- const cache = join(dir, CACHE);
305
- writeFileSync(cache, token, { mode: 0o600 });
306
- return cache;
307
- }
308
- it('DELETES the stale cache file and refetches from Key Vault', async () => {
309
- const cache = seed('stale-token');
310
- const names = [];
311
- const res = await refreshCoordinationToken('stale-token', {
312
- env: { CLAUDE_WORKTREE_PATH: dir },
313
- fetchSecret: (vault, name) => { names.push(`${vault}:${name}`); return 'fresh-token'; },
314
- });
315
- expect(res.status).toBe('refreshed');
316
- expect(res.token).toBe('fresh-token');
317
- expect(res.cacheInvalidated).toBe(true);
318
- expect(res.source).toBe('keyvault');
319
- expect(names).toEqual([`${KEYVAULT_NAME}:coordination-token--memnexus--platform`]);
320
- // The file was rewritten with the NEW token — never left holding the dead one.
321
- expect(readFileSync(cache, 'utf-8')).toBe('fresh-token');
322
- expect(statSync(cache).mode & 0o777).toBe(0o600); // SF-3 preserved on rewrite
323
- });
324
- it('KEEPS the rejected token cached when Key Vault has nothing to give', async () => {
325
- const cache = seed('stale-token');
326
- const res = await refreshCoordinationToken('stale-token', {
327
- env: { CLAUDE_WORKTREE_PATH: dir },
328
- fetchSecret: () => undefined,
329
- });
330
- expect(res.status).toBe('unprovisioned');
331
- expect(res.cacheInvalidated).toBe(false);
332
- // SILENCE PIN (inverted from the original #4970 assertion by the security
333
- // review). Deleting here is the regression, not the fix:
334
- // az is fail-open and "not logged in" is an EXPECTED worktree state. Delete
335
- // first + fetch fails => no token anywhere. The session-start hook then
336
- // finds no cache, its own az fetch fails too, and it exits 0 with NO
337
- // OUTPUT — the pre-existing fail-open branch. The brief is never invoked
338
- // again, so neither the CLI's loud block nor the hook's 401 block can fire.
339
- // Session N loud, every session after it silent, on the P0 escalation
340
- // channel, until a human happens to run `az login`.
341
- // A token the service already refuses grants nothing; keeping it keeps the
342
- // 401 — and the alarm — firing every session. Do not "tidy" this back.
343
- expect(existsSync(cache)).toBe(true);
344
- expect(readFileSync(cache, 'utf-8')).toBe('stale-token');
345
- expect(res.detail).toContain('LEFT in the per-worktree cache');
346
- });
347
- it('reports unchanged=true when the vault still holds the rejected value', async () => {
348
- seed('stale-token');
349
- const res = await refreshCoordinationToken('stale-token', {
350
- env: { CLAUDE_WORKTREE_PATH: dir },
351
- fetchSecret: () => 'stale-token',
352
- });
353
- expect(res.status).toBe('refreshed');
354
- expect(res.unchanged).toBe(true);
355
- });
356
- it('uses a cache another process already rotated, without deleting it or calling az', async () => {
357
- const cache = seed('someone-elses-fresher-token');
358
- const fetchSecret = vi.fn();
359
- const res = await refreshCoordinationToken('stale-token', {
360
- env: { CLAUDE_WORKTREE_PATH: dir },
361
- fetchSecret,
362
- });
363
- expect(res.status).toBe('refreshed');
364
- expect(res.source).toBe('cache');
365
- expect(res.token).toBe('someone-elses-fresher-token');
366
- expect(res.cacheInvalidated).toBe(false);
367
- expect(fetchSecret).not.toHaveBeenCalled();
368
- expect(existsSync(cache)).toBe(true);
369
- });
370
- it('SF-2 holds on the refresh path: a non-roster slug never reaches az and keeps its cache', async () => {
371
- writeFileSync(join(dir, '.mx-coordination-team'), 'not-a-real-team\n');
372
- const cache = join(dir, '.mx-coordination-token--memnexus--not-a-real-team');
373
- writeFileSync(cache, 'stale-token', { mode: 0o600 });
374
- const fetchSecret = vi.fn();
375
- const res = await refreshCoordinationToken('stale-token', {
376
- env: { CLAUDE_WORKTREE_PATH: dir },
377
- fetchSecret,
378
- });
379
- expect(res.status).toBe('not-on-roster');
380
- expect(fetchSecret).not.toHaveBeenCalled();
381
- expect(existsSync(cache)).toBe(true); // no fetch, no deletion — nothing was proven
382
- });
383
- it('fails CLOSED on an invalid project slug — no marker read, no fetch', async () => {
384
- seed('stale-token');
385
- const fetchSecret = vi.fn();
386
- const res = await refreshCoordinationToken('stale-token', {
387
- env: { CLAUDE_WORKTREE_PATH: dir },
388
- project: 'Bad_Project',
389
- fetchSecret,
390
- });
391
- expect(res.status).toBe('misconfigured');
392
- expect(fetchSecret).not.toHaveBeenCalled();
393
- });
394
- it('never throws when there is no worktree to look in', async () => {
395
- // No CLAUDE_WORKTREE_PATH and no git worktree around the cwd: the #507
396
- // follow-up's git fallback must not reach the developer's real checkout.
397
- // No project root either, so the next step in the detail cannot list this
398
- // machine's real team worktrees (#525 fix round).
399
- const noProject = () => { throw new Error('no project in this test'); };
400
- const res = await refreshCoordinationToken('stale-token', { env: {}, fetchSecret: () => 'x', locate: { gitTopology: () => undefined, projectRoot: noProject } });
401
- expect(res.status).toBe('unprovisioned');
402
- expect(res.detail).toContain('CLAUDE_WORKTREE_PATH');
403
- });
404
- });
405
- /**
406
- * #4970 DELTA SECURITY REVIEW — every operator-facing claim must be derived from
407
- * measured state, and pinned to it.
408
- *
409
- * The review's central finding was not any single wrong sentence: it was that
410
- * three consecutive rounds put the new defect in freshly-written operator text,
411
- * and that NOTHING IN THE SUITE tied a message string to the side effect it
412
- * claims. Two mutations survived in exactly that gap:
413
- * MN-7 make the "(replacing the cached copy)" parenthetical unconditional
414
- * MN-2 `if (!fetched)` → `if (fetched === undefined)`
415
- * Both left 55/55 green. The cases below fail against each.
416
- *
417
- * The message assertions deliberately run through runBrief with the REAL
418
- * refreshCoordinationToken against a REAL temp worktree, so the string under test
419
- * is produced by the same filesystem state the operator would have.
420
- */
421
- describe('#4970 SF-1/SF-2/SF-4 — the message must match the state on disk', () => {
422
- let dir;
423
- beforeEach(() => { dir = mkdtempSync(join(tmpdir(), 'coord-claims-')); });
424
- afterEach(() => { rmSync(dir, { recursive: true, force: true }); });
425
- const CACHE = '.mx-coordination-token--memnexus--platform';
426
- const cachePath = () => join(dir, CACHE);
427
- function marker() {
428
- writeFileSync(join(dir, '.mx-coordination-team'), 'platform\n');
429
- }
430
- function seedCache(token) {
431
- writeFileSync(cachePath(), token, { mode: 0o600 });
432
- }
433
- /** Drive the loud block through the real refresh + a client that always 401s. */
434
- async function loudMessage(deps) {
435
- process.env.MX_COORD_SERVICE_TOKEN = 'stale-token';
436
- const client = stubClient({ async drain() { throw new ServiceHttpError(401, 'invalid token'); } });
437
- const err = await runBrief({}, {
438
- client,
439
- refreshToken: async (rejected) => refreshCoordinationToken(rejected, deps),
440
- }).then(() => null, (e) => e);
441
- expect(err).toBeInstanceOf(CoordinationAuthError);
442
- return err.message;
443
- }
444
- // ── SF-1: "left in the cache on purpose" is only true when it IS in the cache ──
445
- it('SF-1: with NO cache file, the failure is reported as the one that goes SILENT', async () => {
446
- marker();
447
- expect(existsSync(cachePath())).toBe(false); // measured precondition
448
- const res = await refreshCoordinationToken('stale-token', {
449
- env: { CLAUDE_WORKTREE_PATH: dir },
450
- fetchSecret: () => undefined,
451
- });
452
- expect(res.status).toBe('unprovisioned');
453
- expect(res.cacheInvalidated).toBe(false);
454
- // The old text claimed a cache entry that does not exist AND promised a
455
- // loudness guarantee that does not hold on this path: next session finds no
456
- // cache, its az fetch fails, and coordination-brief.sh takes its fail-open
457
- // exit 0 with no output. Reachable in production whenever the token came from
458
- // MX_COORD_SERVICE_TOKEN or the global config (no cache is ever written), or
459
- // when the hook's `|| true` cache write failed.
460
- expect(res.detail).not.toContain('LEFT in the per-worktree cache');
461
- expect(res.detail).toContain('NO cached token');
462
- expect(res.detail).toContain('NEEDS MANUAL ATTENTION');
463
- expect(existsSync(cachePath())).toBe(false); // and still nothing deleted
464
- });
465
- it('SF-1: a whitespace-only cache file is the no-cache case, not the left-in-place one', async () => {
466
- marker();
467
- seedCache(' \n');
468
- const res = await refreshCoordinationToken('stale-token', {
469
- env: { CLAUDE_WORKTREE_PATH: dir },
470
- fetchSecret: () => undefined,
471
- });
472
- expect(res.status).toBe('unprovisioned');
473
- expect(res.detail).not.toContain('LEFT in the per-worktree cache');
474
- expect(res.detail).toContain('NO cached token');
475
- });
476
- it('SF-1: with the rejected token CACHED, the left-in-place claim is made and is true', async () => {
477
- marker();
478
- seedCache('stale-token');
479
- const res = await refreshCoordinationToken('stale-token', {
480
- env: { CLAUDE_WORKTREE_PATH: dir },
481
- fetchSecret: () => undefined,
482
- });
483
- expect(res.detail).toContain('LEFT in the per-worktree cache');
484
- expect(res.detail).not.toContain('NO cached token');
485
- // The claim is checked against the disk, not just against itself.
486
- expect(readFileSync(cachePath(), 'utf-8')).toBe('stale-token');
487
- });
488
- it('SF-1: the operator block carries the no-cache wording end-to-end', async () => {
489
- marker();
490
- const msg = await loudMessage({ env: { CLAUDE_WORKTREE_PATH: dir }, fetchSecret: () => undefined });
491
- expect(msg).toContain(TOKEN_REJECTED_MARKER);
492
- expect(msg).toContain('NEEDS MANUAL ATTENTION');
493
- expect(msg).not.toContain('LEFT in the per-worktree cache');
494
- });
495
- // ── SF-2: "(replacing the cached copy)" requires a replacement that LANDED ──
496
- it('SF-2 / MN-7: a swallowed cache-write failure must NOT report a replacement', async () => {
497
- marker();
498
- seedCache('stale-token');
499
- const msg = await loudMessage({
500
- env: { CLAUDE_WORKTREE_PATH: dir },
501
- fetchSecret: () => 'fresh-token',
502
- writeCache: () => false, // the failure defaultWriteCache swallows
503
- });
504
- // MN-7 (make the parenthetical unconditional) dies here. The delete succeeded,
505
- // so the ONLY local copy is gone and nothing replaced it — the Must Fix of the
506
- // previous round, in the read-only / full-filesystem window.
507
- expect(msg).not.toContain('replacing the cached copy');
508
- expect(msg).toContain('token cache, which is now EMPTY');
509
- expect(existsSync(cachePath())).toBe(false); // measured: no copy on disk
510
- });
511
- it('SF-2: the result flags match the disk after a failed write', async () => {
512
- marker();
513
- seedCache('stale-token');
514
- const res = await refreshCoordinationToken('stale-token', {
515
- env: { CLAUDE_WORKTREE_PATH: dir },
516
- fetchSecret: () => 'fresh-token',
517
- writeCache: () => false,
518
- });
519
- expect(res.status).toBe('refreshed'); // the token IS usable in memory
520
- expect(res.token).toBe('fresh-token');
521
- expect(res.cacheInvalidated).toBe(false); // derived from the WRITE, not the delete
522
- expect(res.cacheWriteFailed).toBe(true);
523
- expect(res.cacheRemoved).toBe(true);
524
- expect(existsSync(cachePath())).toBe(false);
525
- });
526
- it('SF-2: when the write LANDS, the replacement claim is made and matches the disk', async () => {
527
- marker();
528
- seedCache('stale-token');
529
- const msg = await loudMessage({ env: { CLAUDE_WORKTREE_PATH: dir }, fetchSecret: () => 'fresh-token' });
530
- expect(msg).toContain('replacing the cached copy');
531
- expect(msg).not.toContain('now EMPTY');
532
- // The claim is true: the file exists and holds the new value at 0600.
533
- expect(readFileSync(cachePath(), 'utf-8')).toBe('fresh-token');
534
- expect(statSync(cachePath()).mode & 0o777).toBe(0o600);
535
- });
536
- it('SF-2: a write failure with NOTHING deleted does not claim an empty cache either', async () => {
537
- marker(); // no cache file to delete
538
- const msg = await loudMessage({
539
- env: { CLAUDE_WORKTREE_PATH: dir },
540
- fetchSecret: () => 'fresh-token',
541
- writeCache: () => false,
542
- });
543
- expect(msg).not.toContain('replacing the cached copy');
544
- expect(msg).toContain('unchanged on disk');
545
- expect(msg).not.toContain('now EMPTY');
546
- });
547
- it('SF-2: the default cache writer reports success and failure truthfully', async () => {
548
- // The flags above are only worth anything if the DEFAULT writer — the one
549
- // production uses — reports what actually happened.
550
- marker();
551
- const ok = await refreshCoordinationToken('stale-token', {
552
- env: { CLAUDE_WORKTREE_PATH: dir },
553
- fetchSecret: () => 'fresh-token',
554
- });
555
- expect(ok.cacheWriteFailed).toBe(false);
556
- expect(readFileSync(cachePath(), 'utf-8')).toBe('fresh-token');
557
- // Same call with the cache path occupied by a DIRECTORY: the real writeFileSync
558
- // throws EISDIR and the default writer must report false, not swallow it.
559
- rmSync(cachePath());
560
- mkdirSync(cachePath());
561
- const bad = await refreshCoordinationToken('stale-token', {
562
- env: { CLAUDE_WORKTREE_PATH: dir },
563
- fetchSecret: () => 'fresh-token',
564
- });
565
- expect(bad.status).toBe('refreshed');
566
- expect(bad.cacheWriteFailed).toBe(true);
567
- expect(bad.cacheInvalidated).toBe(false);
568
- });
569
- // ── SF-4: nothing is deleted unless we hold a replacement — for ANY falsy ──
570
- it('SF-4 / MN-2: an EMPTY-STRING vault answer must not delete the cache', async () => {
571
- marker();
572
- seedCache('stale-token');
573
- const res = await refreshCoordinationToken('stale-token', {
574
- env: { CLAUDE_WORKTREE_PATH: dir },
575
- fetchSecret: () => '',
576
- });
577
- // MN-2 (`if (!fetched)` → `if (fetched === undefined)`) dies here: under it the
578
- // cache is deleted and an empty file written, which is the Must Fix restored.
579
- expect(res.status).toBe('unprovisioned');
580
- expect(res.cacheInvalidated).toBe(false);
581
- expect(existsSync(cachePath())).toBe(true);
582
- expect(readFileSync(cachePath(), 'utf-8')).toBe('stale-token');
583
- });
584
- it('SF-4: a WHITESPACE-ONLY vault answer is rejected at the guard, not cached', async () => {
585
- marker();
586
- seedCache('stale-token');
587
- const res = await refreshCoordinationToken('stale-token', {
588
- env: { CLAUDE_WORKTREE_PATH: dir },
589
- fetchSecret: () => ' \n',
590
- });
591
- // The default fetcher trims this to undefined, but that is one line of a
592
- // DIFFERENT function; the guard must not depend on it.
593
- expect(res.status).toBe('unprovisioned');
594
- expect(res.token).toBeUndefined();
595
- expect(readFileSync(cachePath(), 'utf-8')).toBe('stale-token');
596
- });
597
- // The matching first-resolve guard is pinned in coordination-token.test.ts,
598
- // which mocks the global config store (this file does not, and resolve consults
599
- // it before the marker).
600
- });
601
- //# sourceMappingURL=coordination-401-recovery.test.js.map