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

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 (797) hide show
  1. package/dist/agent-config/hooks/gh-pr-edit-guard.sh +21 -9
  2. package/dist/agent-config/settings.json +7 -1
  3. package/dist/commands/check.d.ts +20 -0
  4. package/dist/commands/check.d.ts.map +1 -0
  5. package/dist/commands/check.js +30 -0
  6. package/dist/commands/check.js.map +1 -0
  7. package/dist/commands/create.d.ts +36 -0
  8. package/dist/commands/create.d.ts.map +1 -1
  9. package/dist/commands/create.js +85 -8
  10. package/dist/commands/create.js.map +1 -1
  11. package/dist/commands/gh.d.ts +38 -0
  12. package/dist/commands/gh.d.ts.map +1 -0
  13. package/dist/commands/gh.js +162 -0
  14. package/dist/commands/gh.js.map +1 -0
  15. package/dist/commands/git-credential.d.ts +22 -0
  16. package/dist/commands/git-credential.d.ts.map +1 -0
  17. package/dist/commands/git-credential.js +53 -0
  18. package/dist/commands/git-credential.js.map +1 -0
  19. package/dist/commands/new.d.ts +24 -0
  20. package/dist/commands/new.d.ts.map +1 -1
  21. package/dist/commands/new.js +56 -5
  22. package/dist/commands/new.js.map +1 -1
  23. package/dist/commands/pr-set-body.d.ts +120 -35
  24. package/dist/commands/pr-set-body.d.ts.map +1 -1
  25. package/dist/commands/pr-set-body.js +343 -108
  26. package/dist/commands/pr-set-body.js.map +1 -1
  27. package/dist/commands/pr-sync.d.ts +2 -1
  28. package/dist/commands/pr-sync.d.ts.map +1 -1
  29. package/dist/commands/pr-sync.js +129 -32
  30. package/dist/commands/pr-sync.js.map +1 -1
  31. package/dist/index.d.ts +3 -0
  32. package/dist/index.d.ts.map +1 -1
  33. package/dist/index.js +82 -2
  34. package/dist/index.js.map +1 -1
  35. package/dist/lib/check-run.d.ts +131 -0
  36. package/dist/lib/check-run.d.ts.map +1 -0
  37. package/dist/lib/check-run.js +291 -0
  38. package/dist/lib/check-run.js.map +1 -0
  39. package/dist/lib/coordination-token.d.ts +33 -1
  40. package/dist/lib/coordination-token.d.ts.map +1 -1
  41. package/dist/lib/coordination-token.js +138 -9
  42. package/dist/lib/coordination-token.js.map +1 -1
  43. package/dist/lib/gh-remote.d.ts +20 -0
  44. package/dist/lib/gh-remote.d.ts.map +1 -1
  45. package/dist/lib/gh-remote.js +26 -0
  46. package/dist/lib/gh-remote.js.map +1 -1
  47. package/dist/lib/gh-token-run.d.ts +551 -0
  48. package/dist/lib/gh-token-run.d.ts.map +1 -0
  49. package/dist/lib/gh-token-run.js +1246 -0
  50. package/dist/lib/gh-token-run.js.map +1 -0
  51. package/dist/lib/git-credential.d.ts +120 -0
  52. package/dist/lib/git-credential.d.ts.map +1 -0
  53. package/dist/lib/git-credential.js +204 -0
  54. package/dist/lib/git-credential.js.map +1 -0
  55. package/dist/lib/github-app-token.d.ts +288 -0
  56. package/dist/lib/github-app-token.d.ts.map +1 -0
  57. package/dist/lib/github-app-token.js +519 -0
  58. package/dist/lib/github-app-token.js.map +1 -0
  59. package/dist/lib/memory.d.ts.map +1 -1
  60. package/dist/lib/memory.js +35 -2
  61. package/dist/lib/memory.js.map +1 -1
  62. package/dist/lib/repo-guard-state-dirs.d.ts +39 -0
  63. package/dist/lib/repo-guard-state-dirs.d.ts.map +1 -0
  64. package/dist/lib/repo-guard-state-dirs.js +170 -0
  65. package/dist/lib/repo-guard-state-dirs.js.map +1 -0
  66. package/dist/standards/decision-request.md +6 -57
  67. package/dist/standards/po-communication-standard.md +0 -34
  68. package/dist/standards/report-format.md +0 -90
  69. package/dist/standards/writing-standard.md +0 -312
  70. package/package.json +3 -1
  71. package/dist/__tests__/agent-attribution.test.d.ts +0 -16
  72. package/dist/__tests__/agent-attribution.test.d.ts.map +0 -1
  73. package/dist/__tests__/agent-attribution.test.js +0 -250
  74. package/dist/__tests__/agent-attribution.test.js.map +0 -1
  75. package/dist/__tests__/agents-md-canonicalization.test.d.ts +0 -23
  76. package/dist/__tests__/agents-md-canonicalization.test.d.ts.map +0 -1
  77. package/dist/__tests__/agents-md-canonicalization.test.js +0 -319
  78. package/dist/__tests__/agents-md-canonicalization.test.js.map +0 -1
  79. package/dist/__tests__/behavioral-compliance.test.d.ts +0 -8
  80. package/dist/__tests__/behavioral-compliance.test.d.ts.map +0 -1
  81. package/dist/__tests__/behavioral-compliance.test.js +0 -226
  82. package/dist/__tests__/behavioral-compliance.test.js.map +0 -1
  83. package/dist/__tests__/behavioral-extraction.test.d.ts +0 -12
  84. package/dist/__tests__/behavioral-extraction.test.d.ts.map +0 -1
  85. package/dist/__tests__/behavioral-extraction.test.js +0 -330
  86. package/dist/__tests__/behavioral-extraction.test.js.map +0 -1
  87. package/dist/__tests__/behavioral-git-read.test.d.ts +0 -21
  88. package/dist/__tests__/behavioral-git-read.test.d.ts.map +0 -1
  89. package/dist/__tests__/behavioral-git-read.test.js +0 -955
  90. package/dist/__tests__/behavioral-git-read.test.js.map +0 -1
  91. package/dist/__tests__/behavioral-injection.test.d.ts +0 -13
  92. package/dist/__tests__/behavioral-injection.test.d.ts.map +0 -1
  93. package/dist/__tests__/behavioral-injection.test.js +0 -384
  94. package/dist/__tests__/behavioral-injection.test.js.map +0 -1
  95. package/dist/__tests__/binary-smoke.test.d.ts +0 -12
  96. package/dist/__tests__/binary-smoke.test.d.ts.map +0 -1
  97. package/dist/__tests__/binary-smoke.test.js +0 -88
  98. package/dist/__tests__/binary-smoke.test.js.map +0 -1
  99. package/dist/__tests__/bootstrap-behavioral-contract.test.d.ts +0 -18
  100. package/dist/__tests__/bootstrap-behavioral-contract.test.d.ts.map +0 -1
  101. package/dist/__tests__/bootstrap-behavioral-contract.test.js +0 -104
  102. package/dist/__tests__/bootstrap-behavioral-contract.test.js.map +0 -1
  103. package/dist/__tests__/bundle-config.test.d.ts +0 -18
  104. package/dist/__tests__/bundle-config.test.d.ts.map +0 -1
  105. package/dist/__tests__/bundle-config.test.js +0 -123
  106. package/dist/__tests__/bundle-config.test.js.map +0 -1
  107. package/dist/__tests__/catalog-interaction.test.d.ts +0 -25
  108. package/dist/__tests__/catalog-interaction.test.d.ts.map +0 -1
  109. package/dist/__tests__/catalog-interaction.test.js +0 -269
  110. package/dist/__tests__/catalog-interaction.test.js.map +0 -1
  111. package/dist/__tests__/catalog-named-memories.test.d.ts +0 -2
  112. package/dist/__tests__/catalog-named-memories.test.d.ts.map +0 -1
  113. package/dist/__tests__/catalog-named-memories.test.js +0 -204
  114. package/dist/__tests__/catalog-named-memories.test.js.map +0 -1
  115. package/dist/__tests__/catalog-origin-main.test.d.ts +0 -15
  116. package/dist/__tests__/catalog-origin-main.test.d.ts.map +0 -1
  117. package/dist/__tests__/catalog-origin-main.test.js +0 -305
  118. package/dist/__tests__/catalog-origin-main.test.js.map +0 -1
  119. package/dist/__tests__/catalog.test.d.ts +0 -2
  120. package/dist/__tests__/catalog.test.d.ts.map +0 -1
  121. package/dist/__tests__/catalog.test.js +0 -131
  122. package/dist/__tests__/catalog.test.js.map +0 -1
  123. package/dist/__tests__/claude-local-sanitizer.test.d.ts +0 -24
  124. package/dist/__tests__/claude-local-sanitizer.test.d.ts.map +0 -1
  125. package/dist/__tests__/claude-local-sanitizer.test.js +0 -906
  126. package/dist/__tests__/claude-local-sanitizer.test.js.map +0 -1
  127. package/dist/__tests__/claude-md-compose.test.d.ts +0 -17
  128. package/dist/__tests__/claude-md-compose.test.d.ts.map +0 -1
  129. package/dist/__tests__/claude-md-compose.test.js +0 -119
  130. package/dist/__tests__/claude-md-compose.test.js.map +0 -1
  131. package/dist/__tests__/claude-sync.test.d.ts +0 -2
  132. package/dist/__tests__/claude-sync.test.d.ts.map +0 -1
  133. package/dist/__tests__/claude-sync.test.js +0 -571
  134. package/dist/__tests__/claude-sync.test.js.map +0 -1
  135. package/dist/__tests__/cli-build-integration.test.d.ts +0 -2
  136. package/dist/__tests__/cli-build-integration.test.d.ts.map +0 -1
  137. package/dist/__tests__/cli-build-integration.test.js +0 -64
  138. package/dist/__tests__/cli-build-integration.test.js.map +0 -1
  139. package/dist/__tests__/cli-build.test.d.ts +0 -2
  140. package/dist/__tests__/cli-build.test.d.ts.map +0 -1
  141. package/dist/__tests__/cli-build.test.js +0 -640
  142. package/dist/__tests__/cli-build.test.js.map +0 -1
  143. package/dist/__tests__/codex-agent-gate.test.d.ts +0 -2
  144. package/dist/__tests__/codex-agent-gate.test.d.ts.map +0 -1
  145. package/dist/__tests__/codex-agent-gate.test.js +0 -480
  146. package/dist/__tests__/codex-agent-gate.test.js.map +0 -1
  147. package/dist/__tests__/codex-deploy-config.test.d.ts +0 -2
  148. package/dist/__tests__/codex-deploy-config.test.d.ts.map +0 -1
  149. package/dist/__tests__/codex-deploy-config.test.js +0 -1230
  150. package/dist/__tests__/codex-deploy-config.test.js.map +0 -1
  151. package/dist/__tests__/codex-trust-keys.test.d.ts +0 -2
  152. package/dist/__tests__/codex-trust-keys.test.d.ts.map +0 -1
  153. package/dist/__tests__/codex-trust-keys.test.js +0 -731
  154. package/dist/__tests__/codex-trust-keys.test.js.map +0 -1
  155. package/dist/__tests__/codex-write-race.test.d.ts +0 -2
  156. package/dist/__tests__/codex-write-race.test.d.ts.map +0 -1
  157. package/dist/__tests__/codex-write-race.test.js +0 -2253
  158. package/dist/__tests__/codex-write-race.test.js.map +0 -1
  159. package/dist/__tests__/completion-rows-discriminate.test.d.ts +0 -20
  160. package/dist/__tests__/completion-rows-discriminate.test.d.ts.map +0 -1
  161. package/dist/__tests__/completion-rows-discriminate.test.js +0 -481
  162. package/dist/__tests__/completion-rows-discriminate.test.js.map +0 -1
  163. package/dist/__tests__/config-command.test.d.ts +0 -9
  164. package/dist/__tests__/config-command.test.d.ts.map +0 -1
  165. package/dist/__tests__/config-command.test.js +0 -75
  166. package/dist/__tests__/config-command.test.js.map +0 -1
  167. package/dist/__tests__/config-fidelity-archived-symlinks.test.d.ts +0 -2
  168. package/dist/__tests__/config-fidelity-archived-symlinks.test.d.ts.map +0 -1
  169. package/dist/__tests__/config-fidelity-archived-symlinks.test.js +0 -127
  170. package/dist/__tests__/config-fidelity-archived-symlinks.test.js.map +0 -1
  171. package/dist/__tests__/config-fidelity-display.test.d.ts +0 -2
  172. package/dist/__tests__/config-fidelity-display.test.d.ts.map +0 -1
  173. package/dist/__tests__/config-fidelity-display.test.js +0 -77
  174. package/dist/__tests__/config-fidelity-display.test.js.map +0 -1
  175. package/dist/__tests__/config-fidelity-unreadable-fixture.d.ts +0 -32
  176. package/dist/__tests__/config-fidelity-unreadable-fixture.d.ts.map +0 -1
  177. package/dist/__tests__/config-fidelity-unreadable-fixture.js +0 -37
  178. package/dist/__tests__/config-fidelity-unreadable-fixture.js.map +0 -1
  179. package/dist/__tests__/config-fidelity.test.d.ts +0 -16
  180. package/dist/__tests__/config-fidelity.test.d.ts.map +0 -1
  181. package/dist/__tests__/config-fidelity.test.js +0 -2679
  182. package/dist/__tests__/config-fidelity.test.js.map +0 -1
  183. package/dist/__tests__/config-generation-gate.test.d.ts +0 -46
  184. package/dist/__tests__/config-generation-gate.test.d.ts.map +0 -1
  185. package/dist/__tests__/config-generation-gate.test.js +0 -435
  186. package/dist/__tests__/config-generation-gate.test.js.map +0 -1
  187. package/dist/__tests__/config-generation.test.d.ts +0 -7
  188. package/dist/__tests__/config-generation.test.d.ts.map +0 -1
  189. package/dist/__tests__/config-generation.test.js +0 -141
  190. package/dist/__tests__/config-generation.test.js.map +0 -1
  191. package/dist/__tests__/config-sync.test.d.ts +0 -10
  192. package/dist/__tests__/config-sync.test.d.ts.map +0 -1
  193. package/dist/__tests__/config-sync.test.js +0 -268
  194. package/dist/__tests__/config-sync.test.js.map +0 -1
  195. package/dist/__tests__/coordination-401-production-wiring.test.d.ts +0 -19
  196. package/dist/__tests__/coordination-401-production-wiring.test.d.ts.map +0 -1
  197. package/dist/__tests__/coordination-401-production-wiring.test.js +0 -286
  198. package/dist/__tests__/coordination-401-production-wiring.test.js.map +0 -1
  199. package/dist/__tests__/coordination-401-recovery.test.d.ts +0 -22
  200. package/dist/__tests__/coordination-401-recovery.test.d.ts.map +0 -1
  201. package/dist/__tests__/coordination-401-recovery.test.js +0 -601
  202. package/dist/__tests__/coordination-401-recovery.test.js.map +0 -1
  203. package/dist/__tests__/coordination-brief-pin.test.d.ts +0 -20
  204. package/dist/__tests__/coordination-brief-pin.test.d.ts.map +0 -1
  205. package/dist/__tests__/coordination-brief-pin.test.js +0 -66
  206. package/dist/__tests__/coordination-brief-pin.test.js.map +0 -1
  207. package/dist/__tests__/coordination-brief.test.d.ts +0 -9
  208. package/dist/__tests__/coordination-brief.test.d.ts.map +0 -1
  209. package/dist/__tests__/coordination-brief.test.js +0 -290
  210. package/dist/__tests__/coordination-brief.test.js.map +0 -1
  211. package/dist/__tests__/coordination-client.test.d.ts +0 -9
  212. package/dist/__tests__/coordination-client.test.d.ts.map +0 -1
  213. package/dist/__tests__/coordination-client.test.js +0 -517
  214. package/dist/__tests__/coordination-client.test.js.map +0 -1
  215. package/dist/__tests__/coordination-command.test.d.ts +0 -9
  216. package/dist/__tests__/coordination-command.test.d.ts.map +0 -1
  217. package/dist/__tests__/coordination-command.test.js +0 -1082
  218. package/dist/__tests__/coordination-command.test.js.map +0 -1
  219. package/dist/__tests__/coordination-credential-endpoint.test.d.ts +0 -24
  220. package/dist/__tests__/coordination-credential-endpoint.test.d.ts.map +0 -1
  221. package/dist/__tests__/coordination-credential-endpoint.test.js +0 -1292
  222. package/dist/__tests__/coordination-credential-endpoint.test.js.map +0 -1
  223. package/dist/__tests__/coordination-expected-team.test.d.ts +0 -19
  224. package/dist/__tests__/coordination-expected-team.test.d.ts.map +0 -1
  225. package/dist/__tests__/coordination-expected-team.test.js +0 -423
  226. package/dist/__tests__/coordination-expected-team.test.js.map +0 -1
  227. package/dist/__tests__/coordination-fallback.test.d.ts +0 -9
  228. package/dist/__tests__/coordination-fallback.test.d.ts.map +0 -1
  229. package/dist/__tests__/coordination-fallback.test.js +0 -192
  230. package/dist/__tests__/coordination-fallback.test.js.map +0 -1
  231. package/dist/__tests__/coordination-file-guards.test.d.ts +0 -29
  232. package/dist/__tests__/coordination-file-guards.test.d.ts.map +0 -1
  233. package/dist/__tests__/coordination-file-guards.test.js +0 -380
  234. package/dist/__tests__/coordination-file-guards.test.js.map +0 -1
  235. package/dist/__tests__/coordination-history.test.d.ts +0 -8
  236. package/dist/__tests__/coordination-history.test.d.ts.map +0 -1
  237. package/dist/__tests__/coordination-history.test.js +0 -447
  238. package/dist/__tests__/coordination-history.test.js.map +0 -1
  239. package/dist/__tests__/coordination-memory.test.d.ts +0 -14
  240. package/dist/__tests__/coordination-memory.test.d.ts.map +0 -1
  241. package/dist/__tests__/coordination-memory.test.js +0 -401
  242. package/dist/__tests__/coordination-memory.test.js.map +0 -1
  243. package/dist/__tests__/coordination-mode.test.d.ts +0 -13
  244. package/dist/__tests__/coordination-mode.test.d.ts.map +0 -1
  245. package/dist/__tests__/coordination-mode.test.js +0 -180
  246. package/dist/__tests__/coordination-mode.test.js.map +0 -1
  247. package/dist/__tests__/coordination-plain-shell-commands.test.d.ts +0 -22
  248. package/dist/__tests__/coordination-plain-shell-commands.test.d.ts.map +0 -1
  249. package/dist/__tests__/coordination-plain-shell-commands.test.js +0 -1875
  250. package/dist/__tests__/coordination-plain-shell-commands.test.js.map +0 -1
  251. package/dist/__tests__/coordination-provision.test.d.ts +0 -12
  252. package/dist/__tests__/coordination-provision.test.d.ts.map +0 -1
  253. package/dist/__tests__/coordination-provision.test.js +0 -103
  254. package/dist/__tests__/coordination-provision.test.js.map +0 -1
  255. package/dist/__tests__/coordination-render.test.d.ts +0 -9
  256. package/dist/__tests__/coordination-render.test.d.ts.map +0 -1
  257. package/dist/__tests__/coordination-render.test.js +0 -335
  258. package/dist/__tests__/coordination-render.test.js.map +0 -1
  259. package/dist/__tests__/coordination-setup.test.d.ts +0 -6
  260. package/dist/__tests__/coordination-setup.test.d.ts.map +0 -1
  261. package/dist/__tests__/coordination-setup.test.js +0 -448
  262. package/dist/__tests__/coordination-setup.test.js.map +0 -1
  263. package/dist/__tests__/coordination-status-plain-shell.test.d.ts +0 -19
  264. package/dist/__tests__/coordination-status-plain-shell.test.d.ts.map +0 -1
  265. package/dist/__tests__/coordination-status-plain-shell.test.js +0 -332
  266. package/dist/__tests__/coordination-status-plain-shell.test.js.map +0 -1
  267. package/dist/__tests__/coordination-status-registration.test.d.ts +0 -16
  268. package/dist/__tests__/coordination-status-registration.test.d.ts.map +0 -1
  269. package/dist/__tests__/coordination-status-registration.test.js +0 -480
  270. package/dist/__tests__/coordination-status-registration.test.js.map +0 -1
  271. package/dist/__tests__/coordination-token-multitenant.test.d.ts +0 -11
  272. package/dist/__tests__/coordination-token-multitenant.test.d.ts.map +0 -1
  273. package/dist/__tests__/coordination-token-multitenant.test.js +0 -106
  274. package/dist/__tests__/coordination-token-multitenant.test.js.map +0 -1
  275. package/dist/__tests__/coordination-token.test.d.ts +0 -11
  276. package/dist/__tests__/coordination-token.test.d.ts.map +0 -1
  277. package/dist/__tests__/coordination-token.test.js +0 -201
  278. package/dist/__tests__/coordination-token.test.js.map +0 -1
  279. package/dist/__tests__/coordination-wiring.test.d.ts +0 -11
  280. package/dist/__tests__/coordination-wiring.test.d.ts.map +0 -1
  281. package/dist/__tests__/coordination-wiring.test.js +0 -43
  282. package/dist/__tests__/coordination-wiring.test.js.map +0 -1
  283. package/dist/__tests__/creation-pr-class-check.test.d.ts +0 -17
  284. package/dist/__tests__/creation-pr-class-check.test.d.ts.map +0 -1
  285. package/dist/__tests__/creation-pr-class-check.test.js +0 -346
  286. package/dist/__tests__/creation-pr-class-check.test.js.map +0 -1
  287. package/dist/__tests__/creation-step6a-push-check.test.d.ts +0 -15
  288. package/dist/__tests__/creation-step6a-push-check.test.d.ts.map +0 -1
  289. package/dist/__tests__/creation-step6a-push-check.test.js +0 -150
  290. package/dist/__tests__/creation-step6a-push-check.test.js.map +0 -1
  291. package/dist/__tests__/decision-check.test.d.ts +0 -2
  292. package/dist/__tests__/decision-check.test.d.ts.map +0 -1
  293. package/dist/__tests__/decision-check.test.js +0 -105
  294. package/dist/__tests__/decision-check.test.js.map +0 -1
  295. package/dist/__tests__/digest-fail-closed.test.d.ts +0 -16
  296. package/dist/__tests__/digest-fail-closed.test.d.ts.map +0 -1
  297. package/dist/__tests__/digest-fail-closed.test.js +0 -248
  298. package/dist/__tests__/digest-fail-closed.test.js.map +0 -1
  299. package/dist/__tests__/digest-team-omission.test.d.ts +0 -15
  300. package/dist/__tests__/digest-team-omission.test.d.ts.map +0 -1
  301. package/dist/__tests__/digest-team-omission.test.js +0 -247
  302. package/dist/__tests__/digest-team-omission.test.js.map +0 -1
  303. package/dist/__tests__/doctor-config-fidelity.test.d.ts +0 -19
  304. package/dist/__tests__/doctor-config-fidelity.test.d.ts.map +0 -1
  305. package/dist/__tests__/doctor-config-fidelity.test.js +0 -324
  306. package/dist/__tests__/doctor-config-fidelity.test.js.map +0 -1
  307. package/dist/__tests__/doctor-framework-version.test.d.ts +0 -2
  308. package/dist/__tests__/doctor-framework-version.test.d.ts.map +0 -1
  309. package/dist/__tests__/doctor-framework-version.test.js +0 -146
  310. package/dist/__tests__/doctor-framework-version.test.js.map +0 -1
  311. package/dist/__tests__/doctor-worktree-path.test.d.ts +0 -17
  312. package/dist/__tests__/doctor-worktree-path.test.d.ts.map +0 -1
  313. package/dist/__tests__/doctor-worktree-path.test.js +0 -158
  314. package/dist/__tests__/doctor-worktree-path.test.js.map +0 -1
  315. package/dist/__tests__/doctor.test.d.ts +0 -20
  316. package/dist/__tests__/doctor.test.d.ts.map +0 -1
  317. package/dist/__tests__/doctor.test.js +0 -849
  318. package/dist/__tests__/doctor.test.js.map +0 -1
  319. package/dist/__tests__/event-shipper.test.d.ts +0 -16
  320. package/dist/__tests__/event-shipper.test.d.ts.map +0 -1
  321. package/dist/__tests__/event-shipper.test.js +0 -287
  322. package/dist/__tests__/event-shipper.test.js.map +0 -1
  323. package/dist/__tests__/fleet-data.test.d.ts +0 -2
  324. package/dist/__tests__/fleet-data.test.d.ts.map +0 -1
  325. package/dist/__tests__/fleet-data.test.js +0 -501
  326. package/dist/__tests__/fleet-data.test.js.map +0 -1
  327. package/dist/__tests__/fleet-devpod.test.d.ts +0 -12
  328. package/dist/__tests__/fleet-devpod.test.d.ts.map +0 -1
  329. package/dist/__tests__/fleet-devpod.test.js +0 -260
  330. package/dist/__tests__/fleet-devpod.test.js.map +0 -1
  331. package/dist/__tests__/fleet-tmux.test.d.ts +0 -2
  332. package/dist/__tests__/fleet-tmux.test.d.ts.map +0 -1
  333. package/dist/__tests__/fleet-tmux.test.js +0 -289
  334. package/dist/__tests__/fleet-tmux.test.js.map +0 -1
  335. package/dist/__tests__/fleet.test.d.ts +0 -16
  336. package/dist/__tests__/fleet.test.d.ts.map +0 -1
  337. package/dist/__tests__/fleet.test.js +0 -75
  338. package/dist/__tests__/fleet.test.js.map +0 -1
  339. package/dist/__tests__/generate-claude.test.d.ts +0 -18
  340. package/dist/__tests__/generate-claude.test.d.ts.map +0 -1
  341. package/dist/__tests__/generate-claude.test.js +0 -1015
  342. package/dist/__tests__/generate-claude.test.js.map +0 -1
  343. package/dist/__tests__/gh-remote.test.d.ts +0 -2
  344. package/dist/__tests__/gh-remote.test.d.ts.map +0 -1
  345. package/dist/__tests__/gh-remote.test.js +0 -136
  346. package/dist/__tests__/gh-remote.test.js.map +0 -1
  347. package/dist/__tests__/git-env.test.d.ts +0 -14
  348. package/dist/__tests__/git-env.test.d.ts.map +0 -1
  349. package/dist/__tests__/git-env.test.js +0 -131
  350. package/dist/__tests__/git-env.test.js.map +0 -1
  351. package/dist/__tests__/git-identity-isolation.test.d.ts +0 -33
  352. package/dist/__tests__/git-identity-isolation.test.d.ts.map +0 -1
  353. package/dist/__tests__/git-identity-isolation.test.js +0 -626
  354. package/dist/__tests__/git-identity-isolation.test.js.map +0 -1
  355. package/dist/__tests__/harness-extract.test.d.ts +0 -19
  356. package/dist/__tests__/harness-extract.test.d.ts.map +0 -1
  357. package/dist/__tests__/harness-extract.test.js +0 -566
  358. package/dist/__tests__/harness-extract.test.js.map +0 -1
  359. package/dist/__tests__/harness-wiring.test.d.ts +0 -16
  360. package/dist/__tests__/harness-wiring.test.d.ts.map +0 -1
  361. package/dist/__tests__/harness-wiring.test.js +0 -469
  362. package/dist/__tests__/harness-wiring.test.js.map +0 -1
  363. package/dist/__tests__/hook-completeness.test.d.ts +0 -13
  364. package/dist/__tests__/hook-completeness.test.d.ts.map +0 -1
  365. package/dist/__tests__/hook-completeness.test.js +0 -238
  366. package/dist/__tests__/hook-completeness.test.js.map +0 -1
  367. package/dist/__tests__/hook-heal.test.d.ts +0 -8
  368. package/dist/__tests__/hook-heal.test.d.ts.map +0 -1
  369. package/dist/__tests__/hook-heal.test.js +0 -156
  370. package/dist/__tests__/hook-heal.test.js.map +0 -1
  371. package/dist/__tests__/human-turn-classifier.test.d.ts +0 -17
  372. package/dist/__tests__/human-turn-classifier.test.d.ts.map +0 -1
  373. package/dist/__tests__/human-turn-classifier.test.js +0 -311
  374. package/dist/__tests__/human-turn-classifier.test.js.map +0 -1
  375. package/dist/__tests__/init-coordination-url.test.d.ts +0 -11
  376. package/dist/__tests__/init-coordination-url.test.d.ts.map +0 -1
  377. package/dist/__tests__/init-coordination-url.test.js +0 -217
  378. package/dist/__tests__/init-coordination-url.test.js.map +0 -1
  379. package/dist/__tests__/isolation-probe.test.d.ts +0 -15
  380. package/dist/__tests__/isolation-probe.test.d.ts.map +0 -1
  381. package/dist/__tests__/isolation-probe.test.js +0 -611
  382. package/dist/__tests__/isolation-probe.test.js.map +0 -1
  383. package/dist/__tests__/leader-lock.test.d.ts +0 -12
  384. package/dist/__tests__/leader-lock.test.d.ts.map +0 -1
  385. package/dist/__tests__/leader-lock.test.js +0 -293
  386. package/dist/__tests__/leader-lock.test.js.map +0 -1
  387. package/dist/__tests__/memory-archive-checks.test.d.ts +0 -22
  388. package/dist/__tests__/memory-archive-checks.test.d.ts.map +0 -1
  389. package/dist/__tests__/memory-archive-checks.test.js +0 -748
  390. package/dist/__tests__/memory-archive-checks.test.js.map +0 -1
  391. package/dist/__tests__/memory-archive-prep.test.d.ts +0 -8
  392. package/dist/__tests__/memory-archive-prep.test.d.ts.map +0 -1
  393. package/dist/__tests__/memory-archive-prep.test.js +0 -524
  394. package/dist/__tests__/memory-archive-prep.test.js.map +0 -1
  395. package/dist/__tests__/memory-autocreate.test.d.ts +0 -10
  396. package/dist/__tests__/memory-autocreate.test.d.ts.map +0 -1
  397. package/dist/__tests__/memory-autocreate.test.js +0 -709
  398. package/dist/__tests__/memory-autocreate.test.js.map +0 -1
  399. package/dist/__tests__/memory-log-result.test.d.ts +0 -13
  400. package/dist/__tests__/memory-log-result.test.d.ts.map +0 -1
  401. package/dist/__tests__/memory-log-result.test.js +0 -149
  402. package/dist/__tests__/memory-log-result.test.js.map +0 -1
  403. package/dist/__tests__/memory-named-exists.test.d.ts +0 -16
  404. package/dist/__tests__/memory-named-exists.test.d.ts.map +0 -1
  405. package/dist/__tests__/memory-named-exists.test.js +0 -288
  406. package/dist/__tests__/memory-named-exists.test.js.map +0 -1
  407. package/dist/__tests__/message-bus.test.d.ts +0 -10
  408. package/dist/__tests__/message-bus.test.d.ts.map +0 -1
  409. package/dist/__tests__/message-bus.test.js +0 -526
  410. package/dist/__tests__/message-bus.test.js.map +0 -1
  411. package/dist/__tests__/monitor.test.d.ts +0 -6
  412. package/dist/__tests__/monitor.test.d.ts.map +0 -1
  413. package/dist/__tests__/monitor.test.js +0 -458
  414. package/dist/__tests__/monitor.test.js.map +0 -1
  415. package/dist/__tests__/mx-agent-cli-pin-validation.test.d.ts +0 -2
  416. package/dist/__tests__/mx-agent-cli-pin-validation.test.d.ts.map +0 -1
  417. package/dist/__tests__/mx-agent-cli-pin-validation.test.js +0 -232
  418. package/dist/__tests__/mx-agent-cli-pin-validation.test.js.map +0 -1
  419. package/dist/__tests__/mx-agent-cli-version-pin.test.d.ts +0 -2
  420. package/dist/__tests__/mx-agent-cli-version-pin.test.d.ts.map +0 -1
  421. package/dist/__tests__/mx-agent-cli-version-pin.test.js +0 -236
  422. package/dist/__tests__/mx-agent-cli-version-pin.test.js.map +0 -1
  423. package/dist/__tests__/new-project-first-team.test.d.ts +0 -15
  424. package/dist/__tests__/new-project-first-team.test.d.ts.map +0 -1
  425. package/dist/__tests__/new-project-first-team.test.js +0 -444
  426. package/dist/__tests__/new-project-first-team.test.js.map +0 -1
  427. package/dist/__tests__/otel-env.test.d.ts +0 -2
  428. package/dist/__tests__/otel-env.test.d.ts.map +0 -1
  429. package/dist/__tests__/otel-env.test.js +0 -127
  430. package/dist/__tests__/otel-env.test.js.map +0 -1
  431. package/dist/__tests__/pager-fail-closed.test.d.ts +0 -19
  432. package/dist/__tests__/pager-fail-closed.test.d.ts.map +0 -1
  433. package/dist/__tests__/pager-fail-closed.test.js +0 -229
  434. package/dist/__tests__/pager-fail-closed.test.js.map +0 -1
  435. package/dist/__tests__/pr-set-body.test.d.ts +0 -29
  436. package/dist/__tests__/pr-set-body.test.d.ts.map +0 -1
  437. package/dist/__tests__/pr-set-body.test.js +0 -314
  438. package/dist/__tests__/pr-set-body.test.js.map +0 -1
  439. package/dist/__tests__/prior-sync-failure.test.d.ts +0 -2
  440. package/dist/__tests__/prior-sync-failure.test.d.ts.map +0 -1
  441. package/dist/__tests__/prior-sync-failure.test.js +0 -81
  442. package/dist/__tests__/prior-sync-failure.test.js.map +0 -1
  443. package/dist/__tests__/project-config.test.d.ts +0 -2
  444. package/dist/__tests__/project-config.test.d.ts.map +0 -1
  445. package/dist/__tests__/project-config.test.js +0 -458
  446. package/dist/__tests__/project-config.test.js.map +0 -1
  447. package/dist/__tests__/provision-behavioral-contract.test.d.ts +0 -13
  448. package/dist/__tests__/provision-behavioral-contract.test.d.ts.map +0 -1
  449. package/dist/__tests__/provision-behavioral-contract.test.js +0 -548
  450. package/dist/__tests__/provision-behavioral-contract.test.js.map +0 -1
  451. package/dist/__tests__/provision-catalog-precondition.test.d.ts +0 -26
  452. package/dist/__tests__/provision-catalog-precondition.test.d.ts.map +0 -1
  453. package/dist/__tests__/provision-catalog-precondition.test.js +0 -622
  454. package/dist/__tests__/provision-catalog-precondition.test.js.map +0 -1
  455. package/dist/__tests__/provision-completion-rows.test.d.ts +0 -17
  456. package/dist/__tests__/provision-completion-rows.test.d.ts.map +0 -1
  457. package/dist/__tests__/provision-completion-rows.test.js +0 -3473
  458. package/dist/__tests__/provision-completion-rows.test.js.map +0 -1
  459. package/dist/__tests__/provision-copy-containment.test.d.ts +0 -19
  460. package/dist/__tests__/provision-copy-containment.test.d.ts.map +0 -1
  461. package/dist/__tests__/provision-copy-containment.test.js +0 -187
  462. package/dist/__tests__/provision-copy-containment.test.js.map +0 -1
  463. package/dist/__tests__/provision-identity-gate.test.d.ts +0 -20
  464. package/dist/__tests__/provision-identity-gate.test.d.ts.map +0 -1
  465. package/dist/__tests__/provision-identity-gate.test.js +0 -602
  466. package/dist/__tests__/provision-identity-gate.test.js.map +0 -1
  467. package/dist/__tests__/provision-resume.test.d.ts +0 -26
  468. package/dist/__tests__/provision-resume.test.d.ts.map +0 -1
  469. package/dist/__tests__/provision-resume.test.js +0 -1344
  470. package/dist/__tests__/provision-resume.test.js.map +0 -1
  471. package/dist/__tests__/provision-roleguide-anchors.test.d.ts +0 -27
  472. package/dist/__tests__/provision-roleguide-anchors.test.d.ts.map +0 -1
  473. package/dist/__tests__/provision-roleguide-anchors.test.js +0 -747
  474. package/dist/__tests__/provision-roleguide-anchors.test.js.map +0 -1
  475. package/dist/__tests__/provision-row12-stub-server.test.d.ts +0 -21
  476. package/dist/__tests__/provision-row12-stub-server.test.d.ts.map +0 -1
  477. package/dist/__tests__/provision-row12-stub-server.test.js +0 -264
  478. package/dist/__tests__/provision-row12-stub-server.test.js.map +0 -1
  479. package/dist/__tests__/provision-skeleton-fill.test.d.ts +0 -16
  480. package/dist/__tests__/provision-skeleton-fill.test.d.ts.map +0 -1
  481. package/dist/__tests__/provision-skeleton-fill.test.js +0 -490
  482. package/dist/__tests__/provision-skeleton-fill.test.js.map +0 -1
  483. package/dist/__tests__/provision-step8-commit.test.d.ts +0 -40
  484. package/dist/__tests__/provision-step8-commit.test.d.ts.map +0 -1
  485. package/dist/__tests__/provision-step8-commit.test.js +0 -529
  486. package/dist/__tests__/provision-step8-commit.test.js.map +0 -1
  487. package/dist/__tests__/provision-teambuilder-flow.test.d.ts +0 -22
  488. package/dist/__tests__/provision-teambuilder-flow.test.d.ts.map +0 -1
  489. package/dist/__tests__/provision-teambuilder-flow.test.js +0 -253
  490. package/dist/__tests__/provision-teambuilder-flow.test.js.map +0 -1
  491. package/dist/__tests__/provision-write-integrity.test.d.ts +0 -18
  492. package/dist/__tests__/provision-write-integrity.test.d.ts.map +0 -1
  493. package/dist/__tests__/provision-write-integrity.test.js +0 -141
  494. package/dist/__tests__/provision-write-integrity.test.js.map +0 -1
  495. package/dist/__tests__/repo-guard-wiring.test.d.ts +0 -21
  496. package/dist/__tests__/repo-guard-wiring.test.d.ts.map +0 -1
  497. package/dist/__tests__/repo-guard-wiring.test.js +0 -638
  498. package/dist/__tests__/repo-guard-wiring.test.js.map +0 -1
  499. package/dist/__tests__/report-format.test.d.ts +0 -2
  500. package/dist/__tests__/report-format.test.d.ts.map +0 -1
  501. package/dist/__tests__/report-format.test.js +0 -219
  502. package/dist/__tests__/report-format.test.js.map +0 -1
  503. package/dist/__tests__/row15-detail-sanitizer.test.d.ts +0 -20
  504. package/dist/__tests__/row15-detail-sanitizer.test.d.ts.map +0 -1
  505. package/dist/__tests__/row15-detail-sanitizer.test.js +0 -61
  506. package/dist/__tests__/row15-detail-sanitizer.test.js.map +0 -1
  507. package/dist/__tests__/rows-9-10-zero-remotes.test.d.ts +0 -32
  508. package/dist/__tests__/rows-9-10-zero-remotes.test.d.ts.map +0 -1
  509. package/dist/__tests__/rows-9-10-zero-remotes.test.js +0 -203
  510. package/dist/__tests__/rows-9-10-zero-remotes.test.js.map +0 -1
  511. package/dist/__tests__/runtime-claude-adapter.test.d.ts +0 -2
  512. package/dist/__tests__/runtime-claude-adapter.test.d.ts.map +0 -1
  513. package/dist/__tests__/runtime-claude-adapter.test.js +0 -70
  514. package/dist/__tests__/runtime-claude-adapter.test.js.map +0 -1
  515. package/dist/__tests__/runtime-codex-adapter.test.d.ts +0 -2
  516. package/dist/__tests__/runtime-codex-adapter.test.d.ts.map +0 -1
  517. package/dist/__tests__/runtime-codex-adapter.test.js +0 -558
  518. package/dist/__tests__/runtime-codex-adapter.test.js.map +0 -1
  519. package/dist/__tests__/runtime-codex-config.test.d.ts +0 -2
  520. package/dist/__tests__/runtime-codex-config.test.d.ts.map +0 -1
  521. package/dist/__tests__/runtime-codex-config.test.js +0 -1421
  522. package/dist/__tests__/runtime-codex-config.test.js.map +0 -1
  523. package/dist/__tests__/runtime-codex-gateway-pilot.test.d.ts +0 -2
  524. package/dist/__tests__/runtime-codex-gateway-pilot.test.d.ts.map +0 -1
  525. package/dist/__tests__/runtime-codex-gateway-pilot.test.js +0 -309
  526. package/dist/__tests__/runtime-codex-gateway-pilot.test.js.map +0 -1
  527. package/dist/__tests__/runtime-codex-gateway-provider.test.d.ts +0 -2
  528. package/dist/__tests__/runtime-codex-gateway-provider.test.d.ts.map +0 -1
  529. package/dist/__tests__/runtime-codex-gateway-provider.test.js +0 -163
  530. package/dist/__tests__/runtime-codex-gateway-provider.test.js.map +0 -1
  531. package/dist/__tests__/runtime-codex-guard-proof.test.d.ts +0 -2
  532. package/dist/__tests__/runtime-codex-guard-proof.test.d.ts.map +0 -1
  533. package/dist/__tests__/runtime-codex-guard-proof.test.js +0 -822
  534. package/dist/__tests__/runtime-codex-guard-proof.test.js.map +0 -1
  535. package/dist/__tests__/runtime-codex-version-pin.test.d.ts +0 -2
  536. package/dist/__tests__/runtime-codex-version-pin.test.d.ts.map +0 -1
  537. package/dist/__tests__/runtime-codex-version-pin.test.js +0 -86
  538. package/dist/__tests__/runtime-codex-version-pin.test.js.map +0 -1
  539. package/dist/__tests__/runtime-identity.test.d.ts +0 -2
  540. package/dist/__tests__/runtime-identity.test.d.ts.map +0 -1
  541. package/dist/__tests__/runtime-identity.test.js +0 -117
  542. package/dist/__tests__/runtime-identity.test.js.map +0 -1
  543. package/dist/__tests__/runtime-resolve.test.d.ts +0 -2
  544. package/dist/__tests__/runtime-resolve.test.d.ts.map +0 -1
  545. package/dist/__tests__/runtime-resolve.test.js +0 -172
  546. package/dist/__tests__/runtime-resolve.test.js.map +0 -1
  547. package/dist/__tests__/security-posture.test.d.ts +0 -8
  548. package/dist/__tests__/security-posture.test.d.ts.map +0 -1
  549. package/dist/__tests__/security-posture.test.js +0 -82
  550. package/dist/__tests__/security-posture.test.js.map +0 -1
  551. package/dist/__tests__/session-model.test.d.ts +0 -2
  552. package/dist/__tests__/session-model.test.d.ts.map +0 -1
  553. package/dist/__tests__/session-model.test.js +0 -74
  554. package/dist/__tests__/session-model.test.js.map +0 -1
  555. package/dist/__tests__/session-pause-provisioning.test.d.ts +0 -19
  556. package/dist/__tests__/session-pause-provisioning.test.d.ts.map +0 -1
  557. package/dist/__tests__/session-pause-provisioning.test.js +0 -115
  558. package/dist/__tests__/session-pause-provisioning.test.js.map +0 -1
  559. package/dist/__tests__/session-reclamation.test.d.ts +0 -15
  560. package/dist/__tests__/session-reclamation.test.d.ts.map +0 -1
  561. package/dist/__tests__/session-reclamation.test.js +0 -73
  562. package/dist/__tests__/session-reclamation.test.js.map +0 -1
  563. package/dist/__tests__/session-record-disclosure.test.d.ts +0 -24
  564. package/dist/__tests__/session-record-disclosure.test.d.ts.map +0 -1
  565. package/dist/__tests__/session-record-disclosure.test.js +0 -494
  566. package/dist/__tests__/session-record-disclosure.test.js.map +0 -1
  567. package/dist/__tests__/session-status.test.d.ts +0 -11
  568. package/dist/__tests__/session-status.test.d.ts.map +0 -1
  569. package/dist/__tests__/session-status.test.js +0 -76
  570. package/dist/__tests__/session-status.test.js.map +0 -1
  571. package/dist/__tests__/session.test.d.ts +0 -15
  572. package/dist/__tests__/session.test.d.ts.map +0 -1
  573. package/dist/__tests__/session.test.js +0 -366
  574. package/dist/__tests__/session.test.js.map +0 -1
  575. package/dist/__tests__/shim-deploy-safety.test.d.ts +0 -24
  576. package/dist/__tests__/shim-deploy-safety.test.d.ts.map +0 -1
  577. package/dist/__tests__/shim-deploy-safety.test.js +0 -174
  578. package/dist/__tests__/shim-deploy-safety.test.js.map +0 -1
  579. package/dist/__tests__/slug-validation.test.d.ts +0 -13
  580. package/dist/__tests__/slug-validation.test.d.ts.map +0 -1
  581. package/dist/__tests__/slug-validation.test.js +0 -202
  582. package/dist/__tests__/slug-validation.test.js.map +0 -1
  583. package/dist/__tests__/standards-injection.test.d.ts +0 -2
  584. package/dist/__tests__/standards-injection.test.d.ts.map +0 -1
  585. package/dist/__tests__/standards-injection.test.js +0 -179
  586. package/dist/__tests__/standards-injection.test.js.map +0 -1
  587. package/dist/__tests__/start-config-conflict.test.d.ts +0 -17
  588. package/dist/__tests__/start-config-conflict.test.d.ts.map +0 -1
  589. package/dist/__tests__/start-config-conflict.test.js +0 -101
  590. package/dist/__tests__/start-config-conflict.test.js.map +0 -1
  591. package/dist/__tests__/start-interactive-role.test.d.ts +0 -22
  592. package/dist/__tests__/start-interactive-role.test.d.ts.map +0 -1
  593. package/dist/__tests__/start-interactive-role.test.js +0 -204
  594. package/dist/__tests__/start-interactive-role.test.js.map +0 -1
  595. package/dist/__tests__/start-rebase-never-ran.test.d.ts +0 -25
  596. package/dist/__tests__/start-rebase-never-ran.test.d.ts.map +0 -1
  597. package/dist/__tests__/start-rebase-never-ran.test.js +0 -227
  598. package/dist/__tests__/start-rebase-never-ran.test.js.map +0 -1
  599. package/dist/__tests__/start-report-generation-capture.test.d.ts +0 -17
  600. package/dist/__tests__/start-report-generation-capture.test.d.ts.map +0 -1
  601. package/dist/__tests__/start-report-generation-capture.test.js +0 -127
  602. package/dist/__tests__/start-report-generation-capture.test.js.map +0 -1
  603. package/dist/__tests__/start-report-integration.test.d.ts +0 -12
  604. package/dist/__tests__/start-report-integration.test.d.ts.map +0 -1
  605. package/dist/__tests__/start-report-integration.test.js +0 -138
  606. package/dist/__tests__/start-report-integration.test.js.map +0 -1
  607. package/dist/__tests__/start-runtime-wiring.test.d.ts +0 -31
  608. package/dist/__tests__/start-runtime-wiring.test.d.ts.map +0 -1
  609. package/dist/__tests__/start-runtime-wiring.test.js +0 -735
  610. package/dist/__tests__/start-runtime-wiring.test.js.map +0 -1
  611. package/dist/__tests__/start-stash.test.d.ts +0 -2
  612. package/dist/__tests__/start-stash.test.d.ts.map +0 -1
  613. package/dist/__tests__/start-stash.test.js +0 -131
  614. package/dist/__tests__/start-stash.test.js.map +0 -1
  615. package/dist/__tests__/start-sync-hardstop.test.d.ts +0 -15
  616. package/dist/__tests__/start-sync-hardstop.test.d.ts.map +0 -1
  617. package/dist/__tests__/start-sync-hardstop.test.js +0 -280
  618. package/dist/__tests__/start-sync-hardstop.test.js.map +0 -1
  619. package/dist/__tests__/start-team-identity.test.d.ts +0 -25
  620. package/dist/__tests__/start-team-identity.test.d.ts.map +0 -1
  621. package/dist/__tests__/start-team-identity.test.js +0 -307
  622. package/dist/__tests__/start-team-identity.test.js.map +0 -1
  623. package/dist/__tests__/startup-health-render.test.d.ts +0 -11
  624. package/dist/__tests__/startup-health-render.test.d.ts.map +0 -1
  625. package/dist/__tests__/startup-health-render.test.js +0 -60
  626. package/dist/__tests__/startup-health-render.test.js.map +0 -1
  627. package/dist/__tests__/startup-policy.test.d.ts +0 -2
  628. package/dist/__tests__/startup-policy.test.d.ts.map +0 -1
  629. package/dist/__tests__/startup-policy.test.js +0 -27
  630. package/dist/__tests__/startup-policy.test.js.map +0 -1
  631. package/dist/__tests__/startup-report.test.d.ts +0 -13
  632. package/dist/__tests__/startup-report.test.d.ts.map +0 -1
  633. package/dist/__tests__/startup-report.test.js +0 -278
  634. package/dist/__tests__/startup-report.test.js.map +0 -1
  635. package/dist/__tests__/startup-shipper.test.d.ts +0 -13
  636. package/dist/__tests__/startup-shipper.test.d.ts.map +0 -1
  637. package/dist/__tests__/startup-shipper.test.js +0 -149
  638. package/dist/__tests__/startup-shipper.test.js.map +0 -1
  639. package/dist/__tests__/stream-input-controller.test.d.ts +0 -10
  640. package/dist/__tests__/stream-input-controller.test.d.ts.map +0 -1
  641. package/dist/__tests__/stream-input-controller.test.js +0 -167
  642. package/dist/__tests__/stream-input-controller.test.js.map +0 -1
  643. package/dist/__tests__/team-memory-commands.test.d.ts +0 -11
  644. package/dist/__tests__/team-memory-commands.test.d.ts.map +0 -1
  645. package/dist/__tests__/team-memory-commands.test.js +0 -240
  646. package/dist/__tests__/team-memory-commands.test.js.map +0 -1
  647. package/dist/__tests__/team-name-propagation.test.d.ts +0 -13
  648. package/dist/__tests__/team-name-propagation.test.d.ts.map +0 -1
  649. package/dist/__tests__/team-name-propagation.test.js +0 -198
  650. package/dist/__tests__/team-name-propagation.test.js.map +0 -1
  651. package/dist/__tests__/team-token-probe.test.d.ts +0 -16
  652. package/dist/__tests__/team-token-probe.test.d.ts.map +0 -1
  653. package/dist/__tests__/team-token-probe.test.js +0 -295
  654. package/dist/__tests__/team-token-probe.test.js.map +0 -1
  655. package/dist/__tests__/template-budget.test.d.ts +0 -2
  656. package/dist/__tests__/template-budget.test.d.ts.map +0 -1
  657. package/dist/__tests__/template-budget.test.js +0 -119
  658. package/dist/__tests__/template-budget.test.js.map +0 -1
  659. package/dist/__tests__/template-sync.test.d.ts +0 -19
  660. package/dist/__tests__/template-sync.test.d.ts.map +0 -1
  661. package/dist/__tests__/template-sync.test.js +0 -480
  662. package/dist/__tests__/template-sync.test.js.map +0 -1
  663. package/dist/__tests__/test-project.test.d.ts +0 -18
  664. package/dist/__tests__/test-project.test.d.ts.map +0 -1
  665. package/dist/__tests__/test-project.test.js +0 -465
  666. package/dist/__tests__/test-project.test.js.map +0 -1
  667. package/dist/__tests__/tracked-instruction-files.test.d.ts +0 -21
  668. package/dist/__tests__/tracked-instruction-files.test.d.ts.map +0 -1
  669. package/dist/__tests__/tracked-instruction-files.test.js +0 -489
  670. package/dist/__tests__/tracked-instruction-files.test.js.map +0 -1
  671. package/dist/__tests__/unlock.test.d.ts +0 -11
  672. package/dist/__tests__/unlock.test.d.ts.map +0 -1
  673. package/dist/__tests__/unlock.test.js +0 -100
  674. package/dist/__tests__/unlock.test.js.map +0 -1
  675. package/dist/__tests__/usage-per-call-grouping.test.d.ts +0 -25
  676. package/dist/__tests__/usage-per-call-grouping.test.d.ts.map +0 -1
  677. package/dist/__tests__/usage-per-call-grouping.test.js +0 -952
  678. package/dist/__tests__/usage-per-call-grouping.test.js.map +0 -1
  679. package/dist/__tests__/usage-pricing.test.d.ts +0 -20
  680. package/dist/__tests__/usage-pricing.test.d.ts.map +0 -1
  681. package/dist/__tests__/usage-pricing.test.js +0 -176
  682. package/dist/__tests__/usage-pricing.test.js.map +0 -1
  683. package/dist/__tests__/usage-subagent-discovery.test.d.ts +0 -17
  684. package/dist/__tests__/usage-subagent-discovery.test.d.ts.map +0 -1
  685. package/dist/__tests__/usage-subagent-discovery.test.js +0 -213
  686. package/dist/__tests__/usage-subagent-discovery.test.js.map +0 -1
  687. package/dist/__tests__/verify-hooks-check-all.test.d.ts +0 -32
  688. package/dist/__tests__/verify-hooks-check-all.test.d.ts.map +0 -1
  689. package/dist/__tests__/verify-hooks-check-all.test.js +0 -563
  690. package/dist/__tests__/verify-hooks-check-all.test.js.map +0 -1
  691. package/dist/__tests__/verify-hooks-heal-log.test.d.ts +0 -11
  692. package/dist/__tests__/verify-hooks-heal-log.test.d.ts.map +0 -1
  693. package/dist/__tests__/verify-hooks-heal-log.test.js +0 -172
  694. package/dist/__tests__/verify-hooks-heal-log.test.js.map +0 -1
  695. package/dist/__tests__/worker-cap.test.d.ts +0 -14
  696. package/dist/__tests__/worker-cap.test.d.ts.map +0 -1
  697. package/dist/__tests__/worker-cap.test.js +0 -97
  698. package/dist/__tests__/worker-cap.test.js.map +0 -1
  699. package/dist/__tests__/worktree-link-repair.test.d.ts +0 -2
  700. package/dist/__tests__/worktree-link-repair.test.d.ts.map +0 -1
  701. package/dist/__tests__/worktree-link-repair.test.js +0 -471
  702. package/dist/__tests__/worktree-link-repair.test.js.map +0 -1
  703. package/dist/__tests__/worktree-sync-fixture.test.d.ts +0 -17
  704. package/dist/__tests__/worktree-sync-fixture.test.d.ts.map +0 -1
  705. package/dist/__tests__/worktree-sync-fixture.test.js +0 -519
  706. package/dist/__tests__/worktree-sync-fixture.test.js.map +0 -1
  707. package/dist/__tests__/worktree-sync-hardening.test.d.ts +0 -13
  708. package/dist/__tests__/worktree-sync-hardening.test.d.ts.map +0 -1
  709. package/dist/__tests__/worktree-sync-hardening.test.js +0 -919
  710. package/dist/__tests__/worktree-sync-hardening.test.js.map +0 -1
  711. package/dist/__tests__/worktree-sync-shell-free.test.d.ts +0 -25
  712. package/dist/__tests__/worktree-sync-shell-free.test.d.ts.map +0 -1
  713. package/dist/__tests__/worktree-sync-shell-free.test.js +0 -185
  714. package/dist/__tests__/worktree-sync-shell-free.test.js.map +0 -1
  715. package/dist/__tests__/worktree.test.d.ts +0 -2
  716. package/dist/__tests__/worktree.test.d.ts.map +0 -1
  717. package/dist/__tests__/worktree.test.js +0 -168
  718. package/dist/__tests__/worktree.test.js.map +0 -1
  719. package/dist/lib/code-context-file.test.d.ts +0 -19
  720. package/dist/lib/code-context-file.test.d.ts.map +0 -1
  721. package/dist/lib/code-context-file.test.js +0 -202
  722. package/dist/lib/code-context-file.test.js.map +0 -1
  723. package/dist/lib/harness/console/announce.test.d.ts +0 -2
  724. package/dist/lib/harness/console/announce.test.d.ts.map +0 -1
  725. package/dist/lib/harness/console/announce.test.js +0 -104
  726. package/dist/lib/harness/console/announce.test.js.map +0 -1
  727. package/dist/lib/harness/console/by-session.test.d.ts +0 -2
  728. package/dist/lib/harness/console/by-session.test.d.ts.map +0 -1
  729. package/dist/lib/harness/console/by-session.test.js +0 -86
  730. package/dist/lib/harness/console/by-session.test.js.map +0 -1
  731. package/dist/lib/harness/console/console.test.d.ts +0 -2
  732. package/dist/lib/harness/console/console.test.d.ts.map +0 -1
  733. package/dist/lib/harness/console/console.test.js +0 -269
  734. package/dist/lib/harness/console/console.test.js.map +0 -1
  735. package/dist/lib/harness/console/decision-request.test.d.ts +0 -2
  736. package/dist/lib/harness/console/decision-request.test.d.ts.map +0 -1
  737. package/dist/lib/harness/console/decision-request.test.js +0 -75
  738. package/dist/lib/harness/console/decision-request.test.js.map +0 -1
  739. package/dist/lib/harness/console/rank.test.d.ts +0 -2
  740. package/dist/lib/harness/console/rank.test.d.ts.map +0 -1
  741. package/dist/lib/harness/console/rank.test.js +0 -124
  742. package/dist/lib/harness/console/rank.test.js.map +0 -1
  743. package/dist/lib/harness/console/render.test.d.ts +0 -2
  744. package/dist/lib/harness/console/render.test.d.ts.map +0 -1
  745. package/dist/lib/harness/console/render.test.js +0 -96
  746. package/dist/lib/harness/console/render.test.js.map +0 -1
  747. package/dist/lib/harness/console/replay-cli.test.d.ts +0 -2
  748. package/dist/lib/harness/console/replay-cli.test.d.ts.map +0 -1
  749. package/dist/lib/harness/console/replay-cli.test.js +0 -96
  750. package/dist/lib/harness/console/replay-cli.test.js.map +0 -1
  751. package/dist/lib/harness/console/replay.test.d.ts +0 -2
  752. package/dist/lib/harness/console/replay.test.d.ts.map +0 -1
  753. package/dist/lib/harness/console/replay.test.js +0 -81
  754. package/dist/lib/harness/console/replay.test.js.map +0 -1
  755. package/dist/lib/harness/console/turn-reader.test.d.ts +0 -2
  756. package/dist/lib/harness/console/turn-reader.test.d.ts.map +0 -1
  757. package/dist/lib/harness/console/turn-reader.test.js +0 -108
  758. package/dist/lib/harness/console/turn-reader.test.js.map +0 -1
  759. package/dist/lib/harness/credential.test.d.ts +0 -2
  760. package/dist/lib/harness/credential.test.d.ts.map +0 -1
  761. package/dist/lib/harness/credential.test.js +0 -74
  762. package/dist/lib/harness/credential.test.js.map +0 -1
  763. package/dist/lib/harness/evaluate.test.d.ts +0 -2
  764. package/dist/lib/harness/evaluate.test.d.ts.map +0 -1
  765. package/dist/lib/harness/evaluate.test.js +0 -621
  766. package/dist/lib/harness/evaluate.test.js.map +0 -1
  767. package/dist/lib/harness/gate.test.d.ts +0 -2
  768. package/dist/lib/harness/gate.test.d.ts.map +0 -1
  769. package/dist/lib/harness/gate.test.js +0 -111
  770. package/dist/lib/harness/gate.test.js.map +0 -1
  771. package/dist/lib/harness/self-check.test.d.ts +0 -2
  772. package/dist/lib/harness/self-check.test.d.ts.map +0 -1
  773. package/dist/lib/harness/self-check.test.js +0 -43
  774. package/dist/lib/harness/self-check.test.js.map +0 -1
  775. package/dist/lib/harness/transcript.test.d.ts +0 -2
  776. package/dist/lib/harness/transcript.test.d.ts.map +0 -1
  777. package/dist/lib/harness/transcript.test.js +0 -118
  778. package/dist/lib/harness/transcript.test.js.map +0 -1
  779. package/dist/lib/projects-registry.test.d.ts +0 -2
  780. package/dist/lib/projects-registry.test.d.ts.map +0 -1
  781. package/dist/lib/projects-registry.test.js +0 -176
  782. package/dist/lib/projects-registry.test.js.map +0 -1
  783. package/dist/lib/roster.test.d.ts +0 -15
  784. package/dist/lib/roster.test.d.ts.map +0 -1
  785. package/dist/lib/roster.test.js +0 -299
  786. package/dist/lib/roster.test.js.map +0 -1
  787. package/dist/lib/vault.test.d.ts +0 -17
  788. package/dist/lib/vault.test.d.ts.map +0 -1
  789. package/dist/lib/vault.test.js +0 -169
  790. package/dist/lib/vault.test.js.map +0 -1
  791. package/dist/lib/window-view.test.d.ts +0 -2
  792. package/dist/lib/window-view.test.d.ts.map +0 -1
  793. package/dist/lib/window-view.test.js +0 -168
  794. package/dist/lib/window-view.test.js.map +0 -1
  795. package/dist/standards/fail-loud-standard.md +0 -495
  796. package/dist/standards/known-issues-standard.md +0 -380
  797. package/dist/standards/rulings.md +0 -104
@@ -1,611 +0,0 @@
1
- /**
2
- * Isolation-banner probes (#4646) — FL-2 false-green remediation.
3
- *
4
- * The banner used to print three unconditional `✓` literals. Each line is now
5
- * computed from a probe, so each probe needs all three of its states driven by
6
- * INJECTED faults, not by observing that a healthy worktree looks healthy
7
- * (FL-16: running the tool and seeing no complaint is not verification).
8
- *
9
- * Every test builds a real worktree fixture on disk — settings.json, deployed
10
- * hooks, an agent-config source to hash against — and then breaks exactly one
11
- * thing. The one-thing-at-a-time structure is what makes the mutation checks at
12
- * the bottom meaningful: deleting a probe's check has to fail a named test.
13
- */
14
- import { describe, it, expect, beforeEach, afterEach, vi } from 'vitest';
15
- import { mkdtempSync, mkdirSync, writeFileSync, rmSync, existsSync, unlinkSync, symlinkSync } from 'fs';
16
- import { join } from 'path';
17
- import { tmpdir } from 'os';
18
- import chalk from 'chalk';
19
- import { probeContainment, probeBranchPin, probePushBlock, probeIsolation, renderProbeLine, bannerHeading, renderIsolationBanner, safeConfigSource, ISOLATION_CLAIMS, } from '../lib/isolation-probe.js';
20
- const CONFIG_SOURCE = 'mx-agent-system/agent-config';
21
- const GUARD_BODY = '#!/bin/bash\n# worktree-guard fixture\nexit 0\n';
22
- const DENY_ALL = [
23
- 'Bash(git checkout main)',
24
- 'Bash(git checkout main *)',
25
- 'Bash(git switch main)',
26
- 'Bash(git switch main *)',
27
- 'Bash(git push origin main)',
28
- 'Bash(git push origin main *)',
29
- 'Bash(git push -u origin main)',
30
- 'Bash(git push -u origin main *)',
31
- ];
32
- let root;
33
- let worktree;
34
- /**
35
- * An INDEPENDENT freshness anchor, outside both the worktree and the project
36
- * root — the npm-installed CLI bundle's role in production. A healthy fixture
37
- * needs one: without it the probes correctly report `unknown` rather than `pass`,
38
- * because there is nothing to compare the deployed guard against that an attacker
39
- * with write access to the worktree could not also have written.
40
- */
41
- let bundleDir;
42
- let prevBundleEnv;
43
- /** Build a fully healthy fixture: contained worktree, registered+fresh guard, full deny list. */
44
- function makeFixture(opts = {}) {
45
- root = mkdtempSync(join(tmpdir(), 'iso-probe-'));
46
- worktree = join(root, '.worktrees', 'team-x');
47
- mkdirSync(join(worktree, '.claude', 'hooks'), { recursive: true });
48
- mkdirSync(join(worktree, CONFIG_SOURCE, 'hooks'), { recursive: true });
49
- // agent-config SOURCE: settings.json (drives the expected-guard set) + guard.
50
- const sourceSettings = {
51
- hooks: {
52
- PreToolUse: [
53
- { matcher: 'Bash', hooks: [{ type: 'command', command: 'bash .claude/hooks/worktree-guard.sh' }] },
54
- ],
55
- },
56
- };
57
- writeFileSync(join(worktree, CONFIG_SOURCE, 'settings.json'), JSON.stringify(sourceSettings, null, 2));
58
- writeFileSync(join(worktree, CONFIG_SOURCE, 'hooks', 'worktree-guard.sh'), opts.sourceGuardBody ?? GUARD_BODY);
59
- // Deployed worktree config.
60
- const liveSettings = {
61
- permissions: { deny: opts.deny ?? DENY_ALL },
62
- hooks: sourceSettings.hooks,
63
- };
64
- writeFileSync(join(worktree, '.claude', 'settings.json'), JSON.stringify(liveSettings, null, 2));
65
- writeFileSync(join(worktree, '.claude', 'hooks', 'worktree-guard.sh'), opts.guardBody ?? GUARD_BODY);
66
- // Independent anchor: same bytes as a healthy deployed guard.
67
- bundleDir = mkdtempSync(join(tmpdir(), 'iso-bundle-'));
68
- mkdirSync(join(bundleDir, 'hooks'), { recursive: true });
69
- writeFileSync(join(bundleDir, 'settings.json'), '{}');
70
- writeFileSync(join(bundleDir, 'hooks', 'worktree-guard.sh'), opts.bundledGuardBody ?? GUARD_BODY);
71
- }
72
- function input(over = {}) {
73
- return {
74
- projectRoot: root,
75
- worktreePath: worktree,
76
- baseBranch: 'main',
77
- configSource: CONFIG_SOURCE,
78
- cwd: worktree,
79
- currentBranch: 'worktree/team-x-20260730',
80
- // Test seam, not the env var: production ignores MX_BUNDLED_CONFIG_DIR.
81
- resolveBundledDir: () => bundleDir,
82
- ...over,
83
- };
84
- }
85
- beforeEach(() => {
86
- // The env override is cleared, not used: the probe ignores it by design, and a
87
- // stray value in the ambient environment must not change these results.
88
- prevBundleEnv = process.env.MX_BUNDLED_CONFIG_DIR;
89
- delete process.env.MX_BUNDLED_CONFIG_DIR;
90
- makeFixture();
91
- });
92
- afterEach(() => {
93
- vi.restoreAllMocks();
94
- if (prevBundleEnv === undefined)
95
- delete process.env.MX_BUNDLED_CONFIG_DIR;
96
- else
97
- process.env.MX_BUNDLED_CONFIG_DIR = prevBundleEnv;
98
- if (root && existsSync(root))
99
- rmSync(root, { recursive: true, force: true });
100
- if (bundleDir && existsSync(bundleDir))
101
- rmSync(bundleDir, { recursive: true, force: true });
102
- });
103
- // ── Probe 1: containment ─────────────────────────────────────────────────────
104
- describe('probeContainment', () => {
105
- it('PASSES on a contained worktree with a registered, fresh guard', () => {
106
- expect(probeContainment(input())).toEqual({ state: 'pass' });
107
- });
108
- it('FAILS when the worktree directory does not exist', () => {
109
- const r = probeContainment(input({ worktreePath: join(root, '.worktrees', 'gone') }));
110
- expect(r.state).toBe('fail');
111
- expect(r.reason).toMatch(/not a directory/);
112
- });
113
- it('FAILS when the worktree is outside the project root', () => {
114
- const outside = mkdtempSync(join(tmpdir(), 'iso-outside-'));
115
- try {
116
- mkdirSync(join(outside, '.claude', 'hooks'), { recursive: true });
117
- const r = probeContainment(input({ worktreePath: outside, cwd: outside }));
118
- expect(r.state).toBe('fail');
119
- expect(r.reason).toMatch(/not under project root/);
120
- }
121
- finally {
122
- rmSync(outside, { recursive: true, force: true });
123
- }
124
- });
125
- it('FAILS when cwd is outside the worktree', () => {
126
- const r = probeContainment(input({ cwd: root }));
127
- expect(r.state).toBe('fail');
128
- expect(r.reason).toMatch(/outside the worktree/);
129
- });
130
- it('FAILS when the guard is registered but absent on disk (hook fails open)', () => {
131
- unlinkSync(join(worktree, '.claude', 'hooks', 'worktree-guard.sh'));
132
- const r = probeContainment(input());
133
- expect(r.state).toBe('fail');
134
- expect(r.reason).toMatch(/MISSING on disk|absent from/);
135
- });
136
- it('FAILS when the deployed guard is STALE relative to its source', () => {
137
- // Present and registered, so an existence check passes — but the deployed
138
- // bytes are an older build (FL-9: presence is not verification).
139
- writeFileSync(join(worktree, '.claude', 'hooks', 'worktree-guard.sh'), GUARD_BODY + '# drifted\n');
140
- const r = probeContainment(input());
141
- expect(r.state).toBe('fail');
142
- expect(r.reason).toMatch(/STALE/);
143
- });
144
- it('FAILS when the guard is not registered at all', () => {
145
- writeFileSync(join(worktree, '.claude', 'settings.json'), JSON.stringify({ permissions: { deny: DENY_ALL }, hooks: {} }));
146
- const r = probeContainment(input());
147
- expect(r.state).toBe('fail');
148
- expect(r.reason).toMatch(/not registered/);
149
- });
150
- it('CANNOT PROBE (unknown) when settings.json is absent', () => {
151
- unlinkSync(join(worktree, '.claude', 'settings.json'));
152
- const r = probeContainment(input());
153
- expect(r.state).toBe('unknown');
154
- expect(r.reason).toMatch(/settings\.json/);
155
- });
156
- it('CANNOT PROBE (unknown) when settings.json is malformed', () => {
157
- writeFileSync(join(worktree, '.claude', 'settings.json'), '{ not json');
158
- const r = probeContainment(input());
159
- expect(r.state).toBe('unknown');
160
- });
161
- it('PASSES with no in-repo source when the independent bundled anchor matches', () => {
162
- // The anchor redesign makes the in-repo source optional: an independent
163
- // anchor is a better answer, not a supplementary one.
164
- rmSync(join(worktree, CONFIG_SOURCE), { recursive: true, force: true });
165
- expect(probeContainment(input()).state).toBe('pass');
166
- });
167
- it('CANNOT PROBE (unknown) with neither an in-repo source nor a bundled anchor', () => {
168
- rmSync(join(worktree, CONFIG_SOURCE), { recursive: true, force: true });
169
- rmSync(bundleDir, { recursive: true, force: true });
170
- const r = probeContainment(input({ resolveBundledDir: () => null }));
171
- expect(r.state).toBe('unknown');
172
- expect(r.reason).toMatch(/cannot compare|not found|no CLI bundle/);
173
- });
174
- it('CANNOT PROBE (unknown) when cwd cannot be resolved', () => {
175
- const r = probeContainment(input({ cwd: join(root, 'no', 'such', 'dir') }));
176
- expect(r.state).toBe('unknown');
177
- expect(r.reason).toMatch(/could not be resolved/);
178
- });
179
- });
180
- // ── Probe 2: branch pin ──────────────────────────────────────────────────────
181
- describe('probeBranchPin', () => {
182
- it('PASSES on a team branch with the switch-to-main deny rules present', () => {
183
- expect(probeBranchPin(input())).toEqual({ state: 'pass' });
184
- });
185
- it('FAILS when the worktree is sitting ON the base branch', () => {
186
- const r = probeBranchPin(input({ currentBranch: 'main' }));
187
- expect(r.state).toBe('fail');
188
- expect(r.reason).toMatch(/ON the base branch/);
189
- });
190
- it('FAILS on a detached HEAD (no branch is pinned)', () => {
191
- const r = probeBranchPin(input({ currentBranch: 'HEAD' }));
192
- expect(r.state).toBe('fail');
193
- expect(r.reason).toMatch(/detached HEAD/);
194
- });
195
- it('FAILS when a switch-to-main deny rule has been removed', () => {
196
- makeFixture({ deny: DENY_ALL.filter((d) => d !== 'Bash(git switch main)') });
197
- const r = probeBranchPin(input());
198
- expect(r.state).toBe('fail');
199
- expect(r.reason).toMatch(/switch-to-main rules/);
200
- });
201
- it('FAILS when the deny list is emptied entirely', () => {
202
- makeFixture({ deny: [] });
203
- const r = probeBranchPin(input());
204
- expect(r.state).toBe('fail');
205
- expect(r.reason).toMatch(/missing 4 of 4/);
206
- });
207
- it('FAILS when the guard is stale even with every deny rule present', () => {
208
- writeFileSync(join(worktree, '.claude', 'hooks', 'worktree-guard.sh'), GUARD_BODY + '# drifted\n');
209
- const r = probeBranchPin(input());
210
- expect(r.state).toBe('fail');
211
- expect(r.reason).toMatch(/STALE/);
212
- });
213
- it('CANNOT PROBE (unknown) when the branch cannot be read', () => {
214
- const r = probeBranchPin(input({ currentBranch: null }));
215
- expect(r.state).toBe('unknown');
216
- expect(r.reason).toMatch(/could not be read/);
217
- });
218
- it('CANNOT PROBE (unknown) when no base branch is configured', () => {
219
- const r = probeBranchPin(input({ baseBranch: '' }));
220
- expect(r.state).toBe('unknown');
221
- expect(r.reason).toMatch(/no base branch/);
222
- });
223
- it('CANNOT PROBE (unknown) when permissions.deny is not an array', () => {
224
- writeFileSync(join(worktree, '.claude', 'settings.json'), JSON.stringify({ permissions: { deny: 'nope' }, hooks: {} }));
225
- const r = probeBranchPin(input());
226
- expect(r.state).toBe('unknown');
227
- expect(r.reason).toMatch(/permissions\.deny/);
228
- });
229
- it('falls back to the injected reader when currentBranch is omitted', () => {
230
- const inp = input();
231
- delete inp.currentBranch;
232
- const r = probeBranchPin({ ...inp, readBranch: () => 'worktree/from-reader' });
233
- expect(r.state).toBe('pass');
234
- });
235
- it('reports unknown when the injected reader fails', () => {
236
- const inp = input();
237
- delete inp.currentBranch;
238
- const r = probeBranchPin({ ...inp, readBranch: () => null });
239
- expect(r.state).toBe('unknown');
240
- });
241
- });
242
- // ── Probe 3: push-to-main block ──────────────────────────────────────────────
243
- describe('probePushBlock', () => {
244
- it('PASSES with every push-to-main deny rule present and a fresh guard', () => {
245
- expect(probePushBlock(input())).toEqual({ state: 'pass' });
246
- });
247
- it('FAILS when a push-to-main deny rule has been removed', () => {
248
- makeFixture({ deny: DENY_ALL.filter((d) => d !== 'Bash(git push origin main)') });
249
- const r = probePushBlock(input());
250
- expect(r.state).toBe('fail');
251
- expect(r.reason).toMatch(/push-to-main rules/);
252
- });
253
- it('FAILS when only the -u forms were removed (partial gap still a gap)', () => {
254
- makeFixture({ deny: DENY_ALL.filter((d) => !d.includes('-u')) });
255
- const r = probePushBlock(input());
256
- expect(r.state).toBe('fail');
257
- expect(r.reason).toMatch(/missing 2 of 4/);
258
- });
259
- it('FAILS when the guard is missing on disk', () => {
260
- unlinkSync(join(worktree, '.claude', 'hooks', 'worktree-guard.sh'));
261
- const r = probePushBlock(input());
262
- expect(r.state).toBe('fail');
263
- });
264
- it('CANNOT PROBE (unknown) when settings.json is absent', () => {
265
- unlinkSync(join(worktree, '.claude', 'settings.json'));
266
- const r = probePushBlock(input());
267
- expect(r.state).toBe('unknown');
268
- });
269
- });
270
- // ── probeIsolation: aggregation never throws ──────────────────────────────────
271
- describe('probeIsolation', () => {
272
- it('returns all three probes on a healthy fixture', () => {
273
- const rep = probeIsolation(input());
274
- expect(rep.containment.state).toBe('pass');
275
- expect(rep.branchPin.state).toBe('pass');
276
- expect(rep.pushBlock.state).toBe('pass');
277
- });
278
- it('converts an unexpected throw into unknown, never a pass', () => {
279
- const inp = input();
280
- delete inp.currentBranch;
281
- const rep = probeIsolation({
282
- ...inp,
283
- readBranch: () => { throw new Error('boom'); },
284
- });
285
- expect(rep.branchPin.state).toBe('unknown');
286
- expect(rep.branchPin.reason).toMatch(/probe threw/);
287
- });
288
- it('reports each line independently — one failure does not mask the others', () => {
289
- makeFixture({ deny: DENY_ALL.filter((d) => !d.includes('push')) });
290
- const rep = probeIsolation(input());
291
- expect(rep.containment.state).toBe('pass');
292
- expect(rep.branchPin.state).toBe('pass');
293
- expect(rep.pushBlock.state).toBe('fail');
294
- });
295
- it('completes well inside the 100ms budget', () => {
296
- const start = Date.now();
297
- probeIsolation(input());
298
- expect(Date.now() - start).toBeLessThan(100);
299
- });
300
- });
301
- // ── Render: three distinct glyphs, no ✓ without a pass ───────────────────────
302
- describe('render', () => {
303
- const origLevel = chalk.level;
304
- beforeEach(() => { chalk.level = 0; });
305
- afterEach(() => { chalk.level = origLevel; });
306
- it('renders ✓ only for a pass, and with no reason appended', () => {
307
- const line = renderProbeLine('claim', { state: 'pass' });
308
- expect(line).toContain('✓');
309
- expect(line).not.toContain('—');
310
- });
311
- it('renders ✗ plus the reason for a fail', () => {
312
- const line = renderProbeLine('claim', { state: 'fail', reason: 'guard is STALE' });
313
- expect(line).toContain('✗');
314
- expect(line).not.toContain('✓');
315
- expect(line).toContain('guard is STALE');
316
- });
317
- it('renders ? plus the reason for could-not-probe — never ✓', () => {
318
- const line = renderProbeLine('claim', { state: 'unknown', reason: 'settings.json absent' });
319
- expect(line).toContain('?');
320
- expect(line).not.toContain('✓');
321
- expect(line).toContain('settings.json absent');
322
- });
323
- it('never renders ✓ for any non-pass state', () => {
324
- for (const state of ['fail', 'unknown']) {
325
- expect(renderProbeLine('c', { state, reason: 'r' })).not.toContain('✓');
326
- }
327
- });
328
- it('says "no reason given" rather than nothing when a reason is missing', () => {
329
- expect(renderProbeLine('c', { state: 'fail' })).toContain('no reason given');
330
- });
331
- const rep = (c, b, p) => ({ containment: c, branchPin: b, pushBlock: p });
332
- const P = { state: 'pass' };
333
- it('heading claims verified only when all three pass', () => {
334
- expect(bannerHeading(rep(P, P, P))).toContain('verified');
335
- expect(bannerHeading(rep(P, P, P))).not.toContain('NOT');
336
- });
337
- it('heading goes red when any line fails', () => {
338
- expect(bannerHeading(rep(P, { state: 'fail', reason: 'x' }, P))).toContain('NOT fully enabled');
339
- });
340
- it('heading warns when any line could not be probed', () => {
341
- expect(bannerHeading(rep(P, { state: 'unknown', reason: 'x' }, P))).toContain('partially verified');
342
- });
343
- it('a fail is echoed to stderr as well as stdout, and does not throw', () => {
344
- const out = [];
345
- const err = [];
346
- vi.spyOn(console, 'log').mockImplementation((m) => { out.push(String(m ?? '')); });
347
- vi.spyOn(console, 'error').mockImplementation((m) => { err.push(String(m ?? '')); });
348
- expect(() => renderIsolationBanner(rep(P, { state: 'fail', reason: 'guard is STALE' }, P))).not.toThrow();
349
- expect(out.join('\n')).toContain(ISOLATION_CLAIMS.branchPin);
350
- expect(err.join('\n')).toContain('NOT VERIFIED');
351
- expect(err.join('\n')).toContain('guard is STALE');
352
- expect(out.join('\n')).toContain('1 of 3 isolation claims are not verified');
353
- });
354
- it('an all-pass banner writes nothing to stderr', () => {
355
- const err = [];
356
- vi.spyOn(console, 'log').mockImplementation(() => { });
357
- vi.spyOn(console, 'error').mockImplementation((m) => { err.push(String(m ?? '')); });
358
- renderIsolationBanner(rep(P, P, P));
359
- expect(err).toEqual([]);
360
- });
361
- it('an unknown line is NOT echoed to stderr but IS counted as unverified', () => {
362
- const out = [];
363
- const err = [];
364
- vi.spyOn(console, 'log').mockImplementation((m) => { out.push(String(m ?? '')); });
365
- vi.spyOn(console, 'error').mockImplementation((m) => { err.push(String(m ?? '')); });
366
- renderIsolationBanner(rep(P, P, { state: 'unknown', reason: 'x' }));
367
- expect(err).toEqual([]);
368
- expect(out.join('\n')).toContain('1 of 3 isolation claims are not verified');
369
- });
370
- });
371
- // ── Hostile input (security review round 1) ──────────────────────────────────
372
- describe('hostile input', () => {
373
- const ESC = String.fromCharCode(27);
374
- const origLevel = chalk.level;
375
- beforeEach(() => { chalk.level = 0; });
376
- afterEach(() => { chalk.level = origLevel; });
377
- it('MF1 (CWE-150): ANSI/control content in a hook command cannot forge the banner', () => {
378
- // An unresolvable hook command becomes part of a reason string. This one
379
- // carries erase-line + cursor-up + green-fg, the shape that overwrites an
380
- // already-printed ✗ with a fake ✓.
381
- const payload = `bash $HOOKDIR/.claude/hooks/${ESC}[2K${ESC}[A${ESC}[32m✓ git push origin main blocked${ESC}[0m`;
382
- writeFileSync(join(worktree, '.claude', 'settings.json'), JSON.stringify({
383
- permissions: { deny: DENY_ALL },
384
- hooks: {
385
- PreToolUse: [
386
- { matcher: 'Bash', hooks: [{ type: 'command', command: 'bash .claude/hooks/worktree-guard.sh' }] },
387
- { matcher: 'Bash', hooks: [{ type: 'command', command: payload }] },
388
- ],
389
- },
390
- }));
391
- const r = probeContainment(input());
392
- expect(r.state).toBe('unknown'); // unresolvable registration → cannot verify
393
- const line = renderProbeLine(ISOLATION_CLAIMS.containment, r);
394
- expect(line.includes(ESC)).toBe(false);
395
- expect(line).not.toContain('[2K');
396
- expect(line).not.toContain('[A');
397
- expect(line).not.toContain('[32m');
398
- // The glyph for this line is still '?', not a forged pass.
399
- expect(line).toContain('?');
400
- expect(line).not.toContain('✓');
401
- });
402
- it('MF1: the stderr echo is sanitized too', () => {
403
- const err = [];
404
- vi.spyOn(console, 'log').mockImplementation(() => { });
405
- vi.spyOn(console, 'error').mockImplementation((m) => { err.push(String(m ?? '')); });
406
- renderIsolationBanner({
407
- containment: { state: 'fail', reason: `evil${ESC}[2K${ESC}[A${ESC}[32m✓ forged` },
408
- branchPin: { state: 'pass' },
409
- pushBlock: { state: 'pass' },
410
- });
411
- const joined = err.join('\n');
412
- expect(joined.includes(ESC)).toBe(false);
413
- expect(joined).toContain('NOT VERIFIED');
414
- });
415
- it('MF1: an over-long reason is truncated rather than scrolling the banner away', () => {
416
- const line = renderProbeLine('c', { state: 'fail', reason: 'x'.repeat(5000) });
417
- expect(line.length).toBeLessThan(400);
418
- });
419
- it('MF2 (CWE-22): a traversing configSource cannot relocate the freshness anchor', () => {
420
- // Plant an attacker-controlled "source" outside the repo holding a neutered
421
- // guard, and point configSource at it via traversal. The probe must not read
422
- // it, and must not report pass.
423
- const outside = mkdtempSync(join(tmpdir(), 'iso-evil-'));
424
- try {
425
- mkdirSync(join(outside, 'hooks'), { recursive: true });
426
- const neutered = '#!/bin/bash\nexit 0\n';
427
- writeFileSync(join(outside, 'hooks', 'worktree-guard.sh'), neutered);
428
- // Deployed guard is neutered to match the attacker's anchor.
429
- writeFileSync(join(worktree, '.claude', 'hooks', 'worktree-guard.sh'), neutered);
430
- const rel = `${'../'.repeat(12)}${outside.replace(/^\//, '')}`;
431
- const r = probeContainment(input({ configSource: rel }));
432
- expect(r.state).not.toBe('pass');
433
- }
434
- finally {
435
- rmSync(outside, { recursive: true, force: true });
436
- }
437
- });
438
- it('MF2: safeConfigSource rejects traversal and absolute paths', () => {
439
- for (const bad of [
440
- '../../../etc',
441
- '..',
442
- 'a/../../b',
443
- 'mx-agent-system/../../..',
444
- '/etc/passwd',
445
- ]) {
446
- expect(safeConfigSource(bad)).toBe('mx-agent-system/agent-config');
447
- }
448
- // A clean relative path is preserved.
449
- expect(safeConfigSource('some/config')).toBe('some/config');
450
- expect(safeConfigSource(undefined)).toBe('mx-agent-system/agent-config');
451
- expect(safeConfigSource(' ')).toBe('mx-agent-system/agent-config');
452
- });
453
- it('SF3: a SYMLINKED deployed guard is unknown, not pass (kills hash(x)==hash(x))', () => {
454
- const deployed = join(worktree, '.claude', 'hooks', 'worktree-guard.sh');
455
- unlinkSync(deployed);
456
- symlinkSync(join(worktree, CONFIG_SOURCE, 'hooks', 'worktree-guard.sh'), deployed);
457
- const r = probeContainment(input());
458
- expect(r.state).toBe('unknown');
459
- expect(r.reason).toMatch(/SYMLINK/);
460
- });
461
- it('SF3: coordinated neuter of deployed AND in-repo source is NOT a pass when an independent anchor exists', () => {
462
- // The attack the anchor redesign exists to stop: write a neutered guard to
463
- // both the deployed path and the in-repo source so they agree with each
464
- // other. With an honest bundled anchor present and disagreeing, the only
465
- // correct answer is "not verified".
466
- const neutered = '#!/bin/bash\nexit 0\n';
467
- writeFileSync(join(worktree, '.claude', 'hooks', 'worktree-guard.sh'), neutered);
468
- writeFileSync(join(worktree, CONFIG_SOURCE, 'hooks', 'worktree-guard.sh'), neutered);
469
- // bundleDir already holds the real guard body — an honest anchor that
470
- // disagrees with the coordinated pair.
471
- const r = probeContainment(input());
472
- expect(r.state).not.toBe('pass');
473
- expect(r.reason).toMatch(/shipped CLI bundle|STALE/);
474
- });
475
- it('SF3: deployed matching the independent bundled anchor is a pass', () => {
476
- // Both directions (FL-10): the hardened anchor must still green-light a
477
- // genuinely healthy worktree, or it gets switched off.
478
- expect(probeContainment(input())).toEqual({ state: 'pass' });
479
- });
480
- it('SF3: worktree and project-root sources disagreeing yields unknown', () => {
481
- // No bundled anchor, two in-repo copies that differ → no single answer.
482
- mkdirSync(join(root, CONFIG_SOURCE, 'hooks'), { recursive: true });
483
- writeFileSync(join(root, CONFIG_SOURCE, 'hooks', 'worktree-guard.sh'), GUARD_BODY + '# other\n');
484
- const r = probeContainment(input({ resolveBundledDir: () => null }));
485
- expect(r.state).toBe('unknown');
486
- expect(r.reason).toMatch(/disagree|cannot be established|shipped CLI bundle|independent/);
487
- });
488
- it('SF3: a bundle resolving INSIDE the worktree is not an anchor (self-reference)', () => {
489
- // A source-tree run resolves getBundledConfigDir() back into the repo. An
490
- // anchor inside the set it measures compares two files the same writer
491
- // controls, so agreement proves nothing — this must not be a pass even though
492
- // the hashes match.
493
- const neutered = '#!/bin/bash\nexit 0\n';
494
- const inRepoBundle = join(worktree, 'mx-agent-system', 'cli', 'dist', 'agent-config');
495
- mkdirSync(join(inRepoBundle, 'hooks'), { recursive: true });
496
- writeFileSync(join(inRepoBundle, 'hooks', 'worktree-guard.sh'), neutered);
497
- writeFileSync(join(worktree, '.claude', 'hooks', 'worktree-guard.sh'), neutered);
498
- writeFileSync(join(worktree, CONFIG_SOURCE, 'hooks', 'worktree-guard.sh'), neutered);
499
- const r = probeContainment(input({ resolveBundledDir: () => inRepoBundle }));
500
- expect(r.state).not.toBe('pass');
501
- });
502
- it('SF3: a bundle resolving inside the PROJECT ROOT is not an anchor either', () => {
503
- const neutered = '#!/bin/bash\nexit 0\n';
504
- const rootBundle = join(root, 'some', 'dist', 'agent-config');
505
- mkdirSync(join(rootBundle, 'hooks'), { recursive: true });
506
- writeFileSync(join(rootBundle, 'hooks', 'worktree-guard.sh'), neutered);
507
- writeFileSync(join(worktree, '.claude', 'hooks', 'worktree-guard.sh'), neutered);
508
- writeFileSync(join(worktree, CONFIG_SOURCE, 'hooks', 'worktree-guard.sh'), neutered);
509
- const r = probeContainment(input({ resolveBundledDir: () => rootBundle }));
510
- expect(r.state).not.toBe('pass');
511
- });
512
- it('SF5: an ENV-DESIGNATED bundle is NOT an anchor — matching neutered copy is not a pass', () => {
513
- // Re-review finding: getBundledConfigDir() honoured MX_BUNDLED_CONFIG_DIR
514
- // unconditionally, and an env path trivially passes the outside-worktree-and-
515
- // root test. Point it at /tmp with a neutered copy and the deployed guard
516
- // "matches its anchor" — the same whoever-chooses-the-anchor defect as the
517
- // traversing configSource. The env var is a test seam; production ignores it.
518
- const neutered = '#!/bin/bash\nexit 0\n';
519
- writeFileSync(join(worktree, '.claude', 'hooks', 'worktree-guard.sh'), neutered);
520
- writeFileSync(join(worktree, CONFIG_SOURCE, 'hooks', 'worktree-guard.sh'), neutered);
521
- const evil = mkdtempSync(join(tmpdir(), 'iso-evil-bundle-'));
522
- const prev = process.env.MX_BUNDLED_CONFIG_DIR;
523
- try {
524
- mkdirSync(join(evil, 'hooks'), { recursive: true });
525
- writeFileSync(join(evil, 'settings.json'), '{}');
526
- writeFileSync(join(evil, 'hooks', 'worktree-guard.sh'), neutered);
527
- process.env.MX_BUNDLED_CONFIG_DIR = evil;
528
- // No injected seam here: this exercises the production resolution path.
529
- const inp = input();
530
- delete inp.resolveBundledDir;
531
- const r = probeContainment(inp);
532
- expect(r.state).not.toBe('pass');
533
- }
534
- finally {
535
- if (prev === undefined)
536
- delete process.env.MX_BUNDLED_CONFIG_DIR;
537
- else
538
- process.env.MX_BUNDLED_CONFIG_DIR = prev;
539
- rmSync(evil, { recursive: true, force: true });
540
- }
541
- });
542
- it('SF4: an oversize settings.json is unknown, not read', () => {
543
- writeFileSync(join(worktree, '.claude', 'settings.json'), 'x'.repeat(1024 * 1024 + 10));
544
- const r = probePushBlock(input());
545
- expect(r.state).toBe('unknown');
546
- expect(r.reason).toMatch(/probe cap|not valid JSON/);
547
- });
548
- it('SF4: an exhausted budget yields unknown without further filesystem work', () => {
549
- const r = probeContainment(input({ budgetStartedAt: Date.now() - 5000 }));
550
- expect(r.state).toBe('unknown');
551
- expect(r.reason).toMatch(/100ms budget/);
552
- });
553
- it('INFORMATIONAL: worktreePath === projectRoot is a fail, not a pass', () => {
554
- const r = probeContainment(input({ worktreePath: root, cwd: root }));
555
- expect(r.state).toBe('fail');
556
- expect(r.reason).toMatch(/project root — no worktree isolation/);
557
- });
558
- });
559
- // ── Mutation sensitivity: a deleted probe must fail a test ───────────────────
560
- //
561
- // The FL-2 defect was a banner line with no probe behind it. These assert that
562
- // each probe's checks are load-bearing: if a future edit drops one, the fixture
563
- // that breaks that specific property stops being detected. Expressed as
564
- // "breaking property X must not leave state 'pass'", which is exactly what fails
565
- // if the corresponding check is deleted from the probe.
566
- describe('mutation sensitivity', () => {
567
- it('containment: every injected fault is detected (no fault reads as pass)', () => {
568
- const faults = [
569
- ['cwd outside worktree', () => input({ cwd: root })],
570
- ['worktree absent', () => input({ worktreePath: join(root, '.worktrees', 'nope') })],
571
- ['guard deleted', () => { unlinkSync(join(worktree, '.claude', 'hooks', 'worktree-guard.sh')); return input(); }],
572
- ['guard stale', () => { writeFileSync(join(worktree, '.claude', 'hooks', 'worktree-guard.sh'), 'drift'); return input(); }],
573
- ['settings absent', () => { unlinkSync(join(worktree, '.claude', 'settings.json')); return input(); }],
574
- ];
575
- for (const [label, build] of faults) {
576
- makeFixture();
577
- const r = probeContainment(build());
578
- expect(r.state, `fault not detected: ${label}`).not.toBe('pass');
579
- expect(r.reason, `no reason for: ${label}`).toBeTruthy();
580
- }
581
- });
582
- it('branchPin: every injected fault is detected', () => {
583
- const faults = [
584
- ['on base branch', () => input({ currentBranch: 'main' })],
585
- ['detached HEAD', () => input({ currentBranch: 'HEAD' })],
586
- ['branch unreadable', () => input({ currentBranch: null })],
587
- ['deny rule removed', () => { makeFixture({ deny: DENY_ALL.filter((d) => d !== 'Bash(git switch main)') }); return input(); }],
588
- ['guard stale', () => { writeFileSync(join(worktree, '.claude', 'hooks', 'worktree-guard.sh'), 'drift'); return input(); }],
589
- ];
590
- for (const [label, build] of faults) {
591
- makeFixture();
592
- const r = probeBranchPin(build());
593
- expect(r.state, `fault not detected: ${label}`).not.toBe('pass');
594
- }
595
- });
596
- it('pushBlock: every injected fault is detected', () => {
597
- const faults = [
598
- ['deny rule removed', () => { makeFixture({ deny: DENY_ALL.filter((d) => d !== 'Bash(git push origin main)') }); return input(); }],
599
- ['deny list emptied', () => { makeFixture({ deny: [] }); return input(); }],
600
- ['guard deleted', () => { unlinkSync(join(worktree, '.claude', 'hooks', 'worktree-guard.sh')); return input(); }],
601
- ['guard stale', () => { writeFileSync(join(worktree, '.claude', 'hooks', 'worktree-guard.sh'), 'drift'); return input(); }],
602
- ['settings absent', () => { unlinkSync(join(worktree, '.claude', 'settings.json')); return input(); }],
603
- ];
604
- for (const [label, build] of faults) {
605
- makeFixture();
606
- const r = probePushBlock(build());
607
- expect(r.state, `fault not detected: ${label}`).not.toBe('pass');
608
- }
609
- });
610
- });
611
- //# sourceMappingURL=isolation-probe.test.js.map