@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,822 +0,0 @@
1
- /**
2
- * The G-7 proof artifact and its producer (#4864, #4851).
3
- *
4
- * WHAT THESE TESTS ARE FOR. `provenGuards` is the difference between "codex launches
5
- * with no guard enforced" and "codex launches". Before #4864 it was permanently empty
6
- * because nothing wrote it; the risk of writing it is the mirror image — a proof that
7
- * is accepted when it should not be. So the bulk of this file is refusals: every way an
8
- * artifact can be absent, malformed, foreign, out of date or unbacked by trust reads as
9
- * NOTHING PROVEN, which leaves the launch refusal exactly as it was.
10
- *
11
- * MUTATION CHECKS (each one verified to fail the named test when applied):
12
- * - drop the `currentSha !== artifact.hooksSha256` comparison in readGuardProof
13
- * → 'a proof of a DIFFERENT hooks.json is stale, not proof' fails.
14
- * - accept a `permittedExitCode` other than 0 in validateGuardProofShape
15
- * → 'an artifact whose permitted half was refused is not a proof' fails.
16
- * - drop the attribution check in proveCodexGuards
17
- * → 'exit 2 from the WRAPPER, not the guard, is not a proof' fails.
18
- * - drop the trust check in readGuardProof
19
- * → 'trust revoked after the proof reads as not proven' fails.
20
- */
21
- import { describe, it, expect, beforeEach, afterEach } from 'vitest';
22
- import { createHash } from 'crypto';
23
- import { chmodSync, copyFileSync, existsSync, mkdirSync, mkdtempSync, readFileSync, rmSync, symlinkSync, writeFileSync } from 'fs';
24
- import { join } from 'path';
25
- import { tmpdir } from 'os';
26
- import { CODEX_HOOKS_FILENAME, PHASE1_PORTED_GUARDS, VERIFIED_CODEX_VERSION, buildCodexHooksJson, codexHookTrustKeysForDoc, readDeployedHooksDoc, } from '../lib/runtime/codex-config.js';
27
- import { GUARD_PROOF_FILENAME, GUARD_PROOF_VERSION, readGuardProof, runningCliVersion, serializeGuardProof, validateGuardProofShape, writeGuardProof, } from '../lib/runtime/codex-guard-proof.js';
28
- import { CodexAdapter } from '../lib/runtime/codex-adapter.js';
29
- import { proveCodexGuards } from '../commands/codex-prove-guards.js';
30
- const NOW = '2026-08-02T00:00:00Z';
31
- const CLI_ROOT = join(import.meta.dirname, '..', '..');
32
- /**
33
- * Where the real guard scripts come from.
34
- *
35
- * TRACKED first, generated second — and the order is the whole point. These tests read
36
- * `<repo>/.claude/hooks/` only, which exists in every agent worktree because the config
37
- * generator deploys it there. It is also GITIGNORED (`.gitignore:20` — `/.claude/`), so
38
- * a clean CI checkout does not have it: all 58 tests in this file threw
39
- * `ENOENT … copyfile '…/.claude/hooks/git-mutation-guard.sh'` on the #4871 merge commit
40
- * and turned main red, after passing locally, in QA and in security review — every one
41
- * of those ran inside a worktree where the generated directory was present.
42
- *
43
- * `mx-agent-system/agent-config/hooks/` is the tracked SOURCE the generator copies from,
44
- * so it is present in any checkout. `.claude/hooks/` stays as a fallback for the case
45
- * where the source directory moves without this constant moving with it; it is not the
46
- * preferred path and CI must never depend on it.
47
- */
48
- const TRACKED_HOOKS = join(CLI_ROOT, '..', 'agent-config', 'hooks');
49
- const GENERATED_HOOKS = join(CLI_ROOT, '..', '..', '.claude', 'hooks');
50
- /** First readable source for `script`, or a thrown error naming both places tried. */
51
- function guardSourcePath(script) {
52
- for (const dir of [TRACKED_HOOKS, GENERATED_HOOKS]) {
53
- const candidate = join(dir, script);
54
- if (existsSync(candidate))
55
- return candidate;
56
- }
57
- throw new Error(`guard script ${script} not found in the tracked source ${TRACKED_HOOKS} nor in the ` +
58
- `generated ${GENERATED_HOOKS}. The tracked directory is the one CI has; if it moved, ` +
59
- `update TRACKED_HOOKS rather than relying on the generated copy.`);
60
- }
61
- let worktree;
62
- let codexHome;
63
- /** Copy the real guard scripts in — the reader now hashes them (review MF1). */
64
- function deployGuardScripts() {
65
- mkdirSync(join(worktree, '.claude', 'hooks'), { recursive: true });
66
- for (const script of PHASE1_PORTED_GUARDS) {
67
- copyFileSync(guardSourcePath(script), join(worktree, '.claude', 'hooks', script));
68
- }
69
- }
70
- function scriptSha(guard) {
71
- return createHash('sha256')
72
- .update(readFileSync(join(worktree, '.claude', 'hooks', `${guard}.sh`)))
73
- .digest('hex');
74
- }
75
- /** Deploy the hooks file exactly as `mx-agent start --runtime codex` would. */
76
- function deployHooks() {
77
- mkdirSync(join(worktree, '.codex'), { recursive: true });
78
- writeFileSync(join(worktree, CODEX_HOOKS_FILENAME), buildCodexHooksJson({ worktreePath: worktree }));
79
- }
80
- function hooksSha() {
81
- return createHash('sha256').update(readFileSync(join(worktree, CODEX_HOOKS_FILENAME))).digest('hex');
82
- }
83
- /** Grant hook trust for every entry of the deployed file, plus project trust. */
84
- function grantTrust() {
85
- const hooksPath = join(worktree, CODEX_HOOKS_FILENAME);
86
- const keys = codexHookTrustKeysForDoc(hooksPath, readDeployedHooksDoc(worktree));
87
- mkdirSync(codexHome, { recursive: true });
88
- writeFileSync(join(codexHome, 'config.toml'), `[projects."${worktree}"]\ntrust_level = "trusted"\n\n` +
89
- keys.map((k) => `[hooks.state."${k}"]\nenabled = true\ntrusted_hash = "sha256:aa"\n`).join('\n'));
90
- }
91
- /**
92
- * The hashes `hooks/list` would report for this worktree's entries (#4876).
93
- *
94
- * `grantTrust` records `sha256:aa` for every key, so a HEALTHY observation is the same
95
- * value for the same keys — the fixture's stand-in for Codex agreeing with the config.
96
- * Passing this explicitly is the point: `proveCodexGuards` has no default, because a
97
- * proof that skipped the hash comparison would be the false green #4876 removes.
98
- */
99
- function observedHashes(over = {}) {
100
- const hooksPath = join(worktree, CODEX_HOOKS_FILENAME);
101
- const doc = readDeployedHooksDoc(worktree);
102
- // No deployed file → nothing observable. The tests that delete it assert the refusal
103
- // comes from the missing file, not from an exception in the fixture.
104
- const keys = doc ? codexHookTrustKeysForDoc(hooksPath, doc) : [];
105
- const map = new Map(keys.map((k) => [k, 'sha256:aa']));
106
- for (const [k, v] of Object.entries(over))
107
- map.set(k, v);
108
- return map;
109
- }
110
- const OBSERVED = (over) => ({
111
- kind: 'observed',
112
- hashes: observedHashes(over),
113
- source: 'test fixture',
114
- });
115
- function validArtifact(over = {}) {
116
- return {
117
- version: GUARD_PROOF_VERSION,
118
- hooksPath: join(worktree, CODEX_HOOKS_FILENAME),
119
- hooksSha256: hooksSha(),
120
- provenAt: NOW,
121
- codexVersion: VERIFIED_CODEX_VERSION,
122
- cliVersion: runningCliVersion(),
123
- guards: [
124
- {
125
- guard: 'git-mutation-guard',
126
- scriptPath: '.claude/hooks/git-mutation-guard.sh',
127
- scriptSha256: scriptSha('git-mutation-guard'),
128
- refusedStimulus: 'git reset --hard HEAD',
129
- refusedExitCode: 2,
130
- refusalAttribution: 'BLOCKED: destructive git operation',
131
- permittedStimulus: 'git status --short',
132
- permittedExitCode: 0,
133
- },
134
- {
135
- guard: 'named-memory-write-guard',
136
- scriptPath: '.claude/hooks/named-memory-write-guard.sh',
137
- scriptSha256: scriptSha('named-memory-write-guard'),
138
- refusedStimulus: 'mx memories update --name x --content "y"',
139
- refusedExitCode: 2,
140
- refusalAttribution: 'BLOCKED: truncating write to named memory',
141
- permittedStimulus: 'mx memories update --name x --content "…"',
142
- permittedExitCode: 0,
143
- stubbedDependency: 'mx memories get',
144
- },
145
- ],
146
- spawnGate: {
147
- refusedExitCode: 2,
148
- refusalAttribution: 'subagent spawning is unavailable under codex',
149
- unrelatedToolExitCode: 0,
150
- },
151
- ...over,
152
- };
153
- }
154
- /** Write raw bytes to the artifact path, bypassing validation. */
155
- function writeRaw(text) {
156
- mkdirSync(join(worktree, '.codex'), { recursive: true });
157
- writeFileSync(join(worktree, GUARD_PROOF_FILENAME), text);
158
- }
159
- const read = () => readGuardProof({ worktreePath: worktree, codexHome });
160
- beforeEach(() => {
161
- worktree = mkdtempSync(join(tmpdir(), 'mx-proof-wt-'));
162
- codexHome = join(worktree, 'fake-codex-home');
163
- deployHooks();
164
- deployGuardScripts();
165
- grantTrust();
166
- });
167
- afterEach(() => {
168
- rmSync(worktree, { recursive: true, force: true });
169
- });
170
- describe('readGuardProof — every unreadable state is NOTHING PROVEN', () => {
171
- it('a valid, current artifact proves exactly the guards it names', () => {
172
- writeGuardProof({ worktreePath: worktree, artifact: validArtifact() });
173
- const status = read();
174
- expect(status.valid).toBe(true);
175
- expect(status.provenGuards.sort()).toEqual(['git-mutation-guard', 'named-memory-write-guard']);
176
- // ATTRIBUTED, not asserted (review SF1): the line names the file it read and says
177
- // what that file is, instead of claiming this process watched the refusal.
178
- expect(status.detail).toContain('Per .codex/guard-proof.json');
179
- expect(status.detail).toContain('not a security boundary');
180
- expect(status.detail).not.toContain('observed refusing');
181
- // And it surfaces the weaker class of proof (review SF3).
182
- expect(status.detail).toContain('WEAKER PROOF for named-memory-write-guard');
183
- expect(status.detail).toContain('mx memories get');
184
- });
185
- it('NO artifact proves nothing, and names the command that would produce one', () => {
186
- const status = read();
187
- expect(status.provenGuards).toEqual([]);
188
- expect(status.valid).toBe(false);
189
- expect(status.detail).toContain('mx-agent codex prove-guards');
190
- });
191
- it('an artifact that is not JSON proves nothing', () => {
192
- writeRaw('{ not json');
193
- expect(read().provenGuards).toEqual([]);
194
- });
195
- it('an artifact that is not an object proves nothing', () => {
196
- writeRaw('[]');
197
- expect(read().provenGuards).toEqual([]);
198
- });
199
- /**
200
- * THE STALENESS PROPERTY. This is the one that stops a proof of the old
201
- * configuration authorising the new one: prove the guards, then change the hooks
202
- * file, and the proof is void until it is re-run.
203
- */
204
- it('a proof of a DIFFERENT hooks.json is stale, not proof', () => {
205
- writeGuardProof({ worktreePath: worktree, artifact: validArtifact() });
206
- expect(read().valid).toBe(true);
207
- writeFileSync(join(worktree, CODEX_HOOKS_FILENAME), `${readFileSync(join(worktree, CODEX_HOOKS_FILENAME), 'utf-8')} `);
208
- // Re-grant so the ONLY thing that changed for the reader is the hash.
209
- grantTrust();
210
- const status = read();
211
- expect(status.provenGuards).toEqual([]);
212
- expect(status.detail).toContain('STALE PROOF');
213
- });
214
- it('a hooks.json that cannot be read at all proves nothing', () => {
215
- writeGuardProof({ worktreePath: worktree, artifact: validArtifact() });
216
- rmSync(join(worktree, CODEX_HOOKS_FILENAME));
217
- expect(read().provenGuards).toEqual([]);
218
- });
219
- it('an artifact naming ANOTHER worktree\'s hooks file proves nothing here', () => {
220
- writeRaw(serializeGuardProof(validArtifact({ hooksPath: '/somewhere/else/.codex/hooks.json' })));
221
- const status = read();
222
- expect(status.provenGuards).toEqual([]);
223
- expect(status.detail).toContain('/somewhere/else/.codex/hooks.json');
224
- });
225
- it('an artifact from another codex version proves nothing', () => {
226
- writeRaw(serializeGuardProof(validArtifact({ codexVersion: '0.144.5' })));
227
- expect(read().provenGuards).toEqual([]);
228
- expect(read().detail).toContain('0.144.5');
229
- });
230
- it('trust revoked after the proof reads as not proven', () => {
231
- writeGuardProof({ worktreePath: worktree, artifact: validArtifact() });
232
- expect(read().valid).toBe(true);
233
- // Same artifact, same hooks file — only the human grant is gone. The guard would
234
- // not be invoked at all, so a current proof of its behaviour is not enough.
235
- writeFileSync(join(codexHome, 'config.toml'), `[projects."${worktree}"]\ntrust_level = "trusted"\n`);
236
- const status = read();
237
- expect(status.provenGuards).toEqual([]);
238
- expect(status.detail).toContain('hook-trust');
239
- });
240
- it('PARTIAL proof: one guard proven is one guard proven, and the gate stays shut', () => {
241
- const artifact = validArtifact();
242
- artifact.guards = [artifact.guards[0]];
243
- writeRaw(serializeGuardProof(artifact));
244
- const status = read();
245
- expect(status.provenGuards).toEqual(['git-mutation-guard']);
246
- // The adapter needs BOTH containment guards, so a partial proof still refuses.
247
- expect(new CodexAdapter({ projectRoot: '/repo', provenGuards: status.provenGuards }).guardsProven).toBe(false);
248
- });
249
- it('a full proof satisfies the adapter gate — the transition out of the refusal exists', () => {
250
- writeGuardProof({ worktreePath: worktree, artifact: validArtifact() });
251
- expect(new CodexAdapter({ projectRoot: '/repo', provenGuards: read().provenGuards }).guardsProven).toBe(true);
252
- });
253
- });
254
- describe('#4864 review — the gaps the security review found', () => {
255
- /**
256
- * MF1: the artifact bound sha256(hooks.json) and nothing else. hooks.json only NAMES
257
- * the script; the behaviour is in the script, and `.claude/hooks/` is writable from
258
- * inside a session. See also the executed pair at the end of this file.
259
- *
260
- * MUTATION CHECK: removing the scriptSha256 loop in readGuardProof fails these.
261
- */
262
- describe('MF1 — the proof is bound to the guard SCRIPTS, not only to hooks.json', () => {
263
- it('a changed guard script is a STALE PROOF, named by path', () => {
264
- writeGuardProof({ worktreePath: worktree, artifact: validArtifact() });
265
- expect(read().valid).toBe(true);
266
- writeFileSync(join(worktree, '.claude', 'hooks', 'git-mutation-guard.sh'), '#!/bin/bash\nexit 0\n');
267
- const status = read();
268
- expect(status.provenGuards).toEqual([]);
269
- expect(status.detail).toContain('STALE PROOF');
270
- expect(status.detail).toContain('.claude/hooks/git-mutation-guard.sh');
271
- });
272
- it('a MISSING guard script proves nothing', () => {
273
- writeGuardProof({ worktreePath: worktree, artifact: validArtifact() });
274
- rmSync(join(worktree, '.claude', 'hooks', 'named-memory-write-guard.sh'));
275
- expect(read().provenGuards).toEqual([]);
276
- expect(read().detail).toContain('named-memory-write-guard');
277
- });
278
- it('the recorded scriptPath cannot be pointed somewhere harmless', () => {
279
- // An artifact that named a file nobody runs would carry a hash that always
280
- // matches. The path is pinned to the guard's own script, so this is rejected at
281
- // validation rather than checked against the wrong file.
282
- const artifact = validArtifact();
283
- artifact.guards[0].scriptPath = '.claude/hooks/harmless.sh';
284
- expect(validateGuardProofShape(artifact)).not.toBeNull();
285
- writeRaw(serializeGuardProof(artifact));
286
- expect(read().provenGuards).toEqual([]);
287
- });
288
- it.each([
289
- ['an absolute path', '/etc/hostname'],
290
- ['a traversal', '../../.claude/hooks/git-mutation-guard.sh'],
291
- ])('rejects %s as a scriptPath', (_label, path) => {
292
- const artifact = validArtifact();
293
- artifact.guards[0].scriptPath = path;
294
- expect(validateGuardProofShape(artifact)).not.toBeNull();
295
- });
296
- });
297
- /**
298
- * MF3: the pin must void a proof taken against a different LIVE binary, not only one
299
- * that disagrees with the compiled constant.
300
- *
301
- * MUTATION CHECK: dropping the liveCodexVersion comparison fails the first of these.
302
- */
303
- describe('MF3 — the LIVE codex version, not only the compiled pin', () => {
304
- it('a live version different from the proven one voids the proof', () => {
305
- writeGuardProof({ worktreePath: worktree, artifact: validArtifact() });
306
- const status = readGuardProof({
307
- worktreePath: worktree,
308
- codexHome,
309
- liveCodexVersion: '0.146.0',
310
- });
311
- expect(status.provenGuards).toEqual([]);
312
- expect(status.detail).toContain('0.146.0');
313
- expect(status.detail).toContain('binary on PATH');
314
- });
315
- it('a live version equal to the proven one is accepted', () => {
316
- writeGuardProof({ worktreePath: worktree, artifact: validArtifact() });
317
- expect(readGuardProof({ worktreePath: worktree, codexHome, liveCodexVersion: VERIFIED_CODEX_VERSION }).valid).toBe(true);
318
- });
319
- });
320
- /**
321
- * SF4: the spawn gate's decision lives in the PATH-resolved mx-agent binary, not in
322
- * hooks.json, so a CLI change can alter proven behaviour with every hash matching.
323
- */
324
- it('SF4 — an artifact from a different CLI build voids the proof', () => {
325
- writeRaw(serializeGuardProof(validArtifact({ cliVersion: '0.1.262' })));
326
- const status = read();
327
- expect(status.provenGuards).toEqual([]);
328
- expect(status.detail).toContain('0.1.262');
329
- });
330
- /**
331
- * SF2: `lstat`, not `stat`. A symlinked artifact or hooks file would otherwise be
332
- * read through to its target and reported on as though the path held those bytes.
333
- */
334
- describe('SF2 — symlinks and non-regular files are refused, never followed', () => {
335
- it('a symlinked artifact is refused', () => {
336
- const real = join(worktree, 'elsewhere.json');
337
- writeFileSync(real, serializeGuardProof(validArtifact()));
338
- rmSync(join(worktree, GUARD_PROOF_FILENAME), { force: true });
339
- symlinkSync(real, join(worktree, GUARD_PROOF_FILENAME));
340
- const status = read();
341
- expect(status.provenGuards).toEqual([]);
342
- expect(status.detail).toContain('not a regular file');
343
- });
344
- it('a symlinked hooks.json proves nothing', () => {
345
- writeGuardProof({ worktreePath: worktree, artifact: validArtifact() });
346
- const hooksPath = join(worktree, CODEX_HOOKS_FILENAME);
347
- const real = join(worktree, 'elsewhere-hooks.json');
348
- writeFileSync(real, readFileSync(hooksPath));
349
- rmSync(hooksPath);
350
- symlinkSync(real, hooksPath);
351
- expect(read().provenGuards).toEqual([]);
352
- });
353
- it('a symlinked guard script proves nothing', () => {
354
- writeGuardProof({ worktreePath: worktree, artifact: validArtifact() });
355
- const scriptPath = join(worktree, '.claude', 'hooks', 'git-mutation-guard.sh');
356
- const real = join(worktree, 'elsewhere-guard.sh');
357
- writeFileSync(real, readFileSync(scriptPath));
358
- rmSync(scriptPath);
359
- symlinkSync(real, scriptPath);
360
- expect(read().provenGuards).toEqual([]);
361
- });
362
- it('writeGuardProof refuses to write through a symlink', () => {
363
- const real = join(worktree, 'target.json');
364
- writeFileSync(real, '{}');
365
- rmSync(join(worktree, GUARD_PROOF_FILENAME), { force: true });
366
- symlinkSync(real, join(worktree, GUARD_PROOF_FILENAME));
367
- expect(() => writeGuardProof({ worktreePath: worktree, artifact: validArtifact() })).toThrow(/not a regular file/);
368
- expect(readFileSync(real, 'utf-8')).toBe('{}');
369
- });
370
- });
371
- });
372
- /**
373
- * MF2 — the evaluation that CONTROLS the launch must postdate the last write.
374
- *
375
- * `runStart` read the proof to construct the adapter and rewrote `.codex/hooks.json`
376
- * later in the same run, so the gate decided on a snapshot taken before the file it
377
- * was about was last written — and `launch()`'s second `assertLaunchAllowed` call
378
- * replayed that same snapshot rather than checking again.
379
- *
380
- * These use the adapter directly with a real reader, so what is pinned is the property
381
- * (the gate re-reads) rather than a call count.
382
- *
383
- * MUTATION CHECK: deleting `this.refreshGuardProof(ctx.worktreePath)` from
384
- * assertLaunchAllowed makes 'a proof invalidated AFTER construction refuses at the
385
- * gate' fail.
386
- */
387
- describe('MF2 — the launch gate re-reads the proof, it does not remember it', () => {
388
- const reader = (wt) => {
389
- const status = readGuardProof({ worktreePath: wt, codexHome });
390
- return { provenGuards: status.provenGuards, detail: status.detail };
391
- };
392
- /**
393
- * `assertLaunchAllowed` checks project trust through the adapter's default codexHome
394
- * ($HOME/.codex), so the same grant has to be visible there.
395
- */
396
- let oldHome;
397
- beforeEach(() => {
398
- oldHome = process.env.HOME;
399
- const fakeHome = join(worktree, 'home');
400
- mkdirSync(join(fakeHome, '.codex'), { recursive: true });
401
- writeFileSync(join(fakeHome, '.codex', 'config.toml'), readFileSync(join(codexHome, 'config.toml')));
402
- process.env.HOME = fakeHome;
403
- });
404
- afterEach(() => {
405
- if (oldHome === undefined)
406
- delete process.env.HOME;
407
- else
408
- process.env.HOME = oldHome;
409
- });
410
- function adapterWithReader() {
411
- return new CodexAdapter({
412
- projectRoot: '/repo',
413
- // The stale snapshot a caller might construct with. The gate must not trust it.
414
- provenGuards: ['git-mutation-guard', 'named-memory-write-guard'],
415
- readGuardProof: reader,
416
- });
417
- }
418
- it('a proof invalidated AFTER construction refuses at the gate', () => {
419
- writeGuardProof({ worktreePath: worktree, artifact: validArtifact() });
420
- const adapter = adapterWithReader();
421
- expect(adapter.guardsProven).toBe(true); // constructor snapshot
422
- // Exactly what deployConfig does later in runStart: rewrite the hooks file.
423
- writeFileSync(join(worktree, CODEX_HOOKS_FILENAME), `${readFileSync(join(worktree, CODEX_HOOKS_FILENAME), 'utf-8')} `);
424
- expect(() => adapter.assertLaunchAllowed({ worktreePath: worktree })).toThrow(/gate G-7 is unpassed/);
425
- expect(adapter.guardsProven).toBe(false);
426
- });
427
- /**
428
- * SF5 — the refusal has to name the binding that broke. `refreshGuardProof` has just
429
- * computed the precise reason; throwing a generic message discards it, and the
430
- * operator is left with a banner from the earlier read (possibly green) followed by
431
- * a refusal that says only "G-7 is unpassed".
432
- *
433
- * MUTATION CHECK: dropping the `this.guardProofDetail` interpolation from the throw
434
- * makes this fail.
435
- */
436
- it('the refusal NAMES the binding that broke, not just that the gate is shut', () => {
437
- writeGuardProof({ worktreePath: worktree, artifact: validArtifact() });
438
- const adapter = adapterWithReader();
439
- writeFileSync(join(worktree, CODEX_HOOKS_FILENAME), `${readFileSync(join(worktree, CODEX_HOOKS_FILENAME), 'utf-8')} `);
440
- let message = '';
441
- try {
442
- adapter.assertLaunchAllowed({ worktreePath: worktree });
443
- }
444
- catch (err) {
445
- message = err instanceof Error ? err.message : String(err);
446
- }
447
- expect(message).toContain('gate G-7 is unpassed');
448
- // The specific cause, and enough of it to act on.
449
- expect(message).toContain('STALE PROOF');
450
- expect(message).toContain(CODEX_HOOKS_FILENAME);
451
- expect(message).toContain('prove-guards');
452
- });
453
- it('names a CHANGED GUARD SCRIPT in the refusal too, not only a stale hooks hash', () => {
454
- writeGuardProof({ worktreePath: worktree, artifact: validArtifact() });
455
- const adapter = adapterWithReader();
456
- writeFileSync(join(worktree, '.claude', 'hooks', 'git-mutation-guard.sh'), '#!/bin/bash\nexit 0\n');
457
- let message = '';
458
- try {
459
- adapter.assertLaunchAllowed({ worktreePath: worktree });
460
- }
461
- catch (err) {
462
- message = err instanceof Error ? err.message : String(err);
463
- }
464
- expect(message).toContain('.claude/hooks/git-mutation-guard.sh');
465
- });
466
- it('a guard neutered after construction refuses at the gate', () => {
467
- writeGuardProof({ worktreePath: worktree, artifact: validArtifact() });
468
- const adapter = adapterWithReader();
469
- writeFileSync(join(worktree, '.claude', 'hooks', 'git-mutation-guard.sh'), '#!/bin/bash\nexit 0\n');
470
- expect(() => adapter.assertLaunchAllowed({ worktreePath: worktree })).toThrow(/gate G-7 is unpassed/);
471
- });
472
- it('EVERY gate call re-reads — a proof restored between calls is seen', () => {
473
- const adapter = adapterWithReader();
474
- // No artifact yet: the gate refuses despite the constructor's optimistic list.
475
- expect(() => adapter.assertLaunchAllowed({ worktreePath: worktree })).toThrow(/gate G-7 is unpassed/);
476
- writeGuardProof({ worktreePath: worktree, artifact: validArtifact() });
477
- expect(() => adapter.assertLaunchAllowed({ worktreePath: worktree })).not.toThrow();
478
- expect(adapter.guardsProven).toBe(true);
479
- });
480
- it('the banner detail follows the latest read, not the constructor', () => {
481
- const adapter = adapterWithReader();
482
- try {
483
- adapter.assertLaunchAllowed({ worktreePath: worktree });
484
- }
485
- catch {
486
- // Expected: no artifact exists yet.
487
- }
488
- const notices = adapter.bannerNotices().join('\n');
489
- expect(notices).toContain('NO guard hook is proven enforced');
490
- expect(notices).toContain('prove-guards');
491
- });
492
- });
493
- describe('validateGuardProofShape — strict, and any malformed part voids the whole', () => {
494
- const cases = [
495
- ['a version this reader does not implement', { version: 2 }],
496
- ['a sha that is not 64 hex chars', { hooksSha256: 'deadbeef' }],
497
- ['an uppercase sha (not the digest form written)', { hooksSha256: 'A'.repeat(64) }],
498
- ['a provenAt that is not an ISO-8601 UTC stamp', { provenAt: 'yesterday' }],
499
- ['an empty guards list', { guards: [] }],
500
- [
501
- 'a guard name outside the Phase 1 set',
502
- (a) => {
503
- a.guards[0].guard = 'invented-guard';
504
- },
505
- ],
506
- [
507
- 'the same guard listed twice',
508
- (a) => {
509
- a.guards = [a.guards[0], a.guards[0]];
510
- },
511
- ],
512
- [
513
- 'a refused half that did not exit 2',
514
- (a) => {
515
- a.guards[0].refusedExitCode = 0;
516
- },
517
- ],
518
- [
519
- 'a permitted half that was refused',
520
- (a) => {
521
- a.guards[0].permittedExitCode = 2;
522
- },
523
- ],
524
- [
525
- 'an unattributed refusal',
526
- (a) => {
527
- a.guards[0].refusalAttribution = '';
528
- },
529
- ],
530
- [
531
- 'a junk entry alongside a real one',
532
- (a) => {
533
- a.guards.push({ guard: 'git-mutation-guard' });
534
- },
535
- ],
536
- ['no spawn-gate observation', { spawnGate: undefined }],
537
- [
538
- 'a spawn gate that also refused unrelated tools',
539
- (a) => {
540
- a.spawnGate.unrelatedToolExitCode = 2;
541
- },
542
- ],
543
- ];
544
- it.each(cases)('rejects %s', (_label, mutation) => {
545
- const artifact = validArtifact();
546
- if (typeof mutation === 'function')
547
- mutation(artifact);
548
- else
549
- Object.assign(artifact, mutation);
550
- expect(validateGuardProofShape(artifact)).not.toBeNull();
551
- writeRaw(serializeGuardProof(artifact));
552
- expect(read().provenGuards).toEqual([]);
553
- });
554
- it('an artifact whose permitted half was refused is not a proof', () => {
555
- const artifact = validArtifact();
556
- artifact.guards[0].permittedExitCode = 2;
557
- writeRaw(serializeGuardProof(artifact));
558
- expect(read().provenGuards).toEqual([]);
559
- });
560
- it('writeGuardProof refuses to write what its own reader would reject', () => {
561
- expect(() => writeGuardProof({ worktreePath: worktree, artifact: validArtifact({ hooksSha256: 'nope' }) })).toThrow(/refusing to write an invalid/);
562
- expect(existsSync(join(worktree, GUARD_PROOF_FILENAME))).toBe(false);
563
- });
564
- });
565
- describe('proveCodexGuards — the artifact is only written on an OBSERVED refusal', () => {
566
- const GUARD_MARKERS = {
567
- 'git-mutation-guard.sh': 'BLOCKED: destructive git operation',
568
- 'named-memory-write-guard.sh': 'BLOCKED: truncating write to named memory',
569
- };
570
- const GATE_MARKER = 'subagent spawning is unavailable under codex';
571
- /**
572
- * A fake runtime that behaves the way a healthy configuration does. Each test then
573
- * breaks exactly one thing, so the assertion names the cause it is about.
574
- */
575
- function runner(over = {}) {
576
- return (command, payload) => {
577
- const parsed = JSON.parse(payload);
578
- const isGate = command.includes('internal-codex-agent-gate');
579
- if (isGate) {
580
- if (parsed.tool_name === 'spawn_agent') {
581
- return { status: over.gateStatus ?? 2, stderr: over.gateStderr ?? GATE_MARKER };
582
- }
583
- return { status: over.unrelatedStatus ?? 0, stderr: '' };
584
- }
585
- const script = Object.keys(GUARD_MARKERS).find((s) => command.includes(s));
586
- const forbidden = (parsed.tool_input.command ?? '').includes('reset --hard') ||
587
- (parsed.tool_input.command ?? '').includes('--content "x"');
588
- if (!forbidden)
589
- return { status: over.permittedStatus ?? 0, stderr: '' };
590
- return {
591
- status: over.guardStatus ?? 2,
592
- stderr: over.guardStderr ?? GUARD_MARKERS[script],
593
- };
594
- };
595
- }
596
- const prove = (r) => proveCodexGuards({
597
- worktreePath: worktree,
598
- codexHome,
599
- now: NOW,
600
- codexVersion: VERIFIED_CODEX_VERSION,
601
- hashes: OBSERVED(),
602
- runner: r,
603
- env: { PATH: process.env.PATH ?? '', HOME: worktree },
604
- });
605
- it('writes an artifact the reader accepts, bound to the file it proved', () => {
606
- const result = prove(runner());
607
- expect(result.ok).toBe(true);
608
- expect(result.proven.sort()).toEqual(['git-mutation-guard', 'named-memory-write-guard']);
609
- const status = read();
610
- expect(status.valid).toBe(true);
611
- const artifact = JSON.parse(readFileSync(join(worktree, GUARD_PROOF_FILENAME), 'utf-8'));
612
- expect(artifact.hooksSha256).toBe(hooksSha());
613
- expect(artifact.provenAt).toBe(NOW);
614
- });
615
- it('a guard that ALLOWS the forbidden command writes nothing', () => {
616
- const result = prove(runner({ guardStatus: 0 }));
617
- expect(result.ok).toBe(false);
618
- expect(result.lines.join('\n')).toContain('DID NOT REFUSE');
619
- expect(existsSync(join(worktree, GUARD_PROOF_FILENAME))).toBe(false);
620
- });
621
- /**
622
- * The wrapper refuses too — with `BLOCKED: mx-agent containment guard … could not be
623
- * resolved` — and that refusal means the guard was NEVER REACHED. Exit 2 alone
624
- * cannot tell the two apart, which is why attribution is required (#4851).
625
- */
626
- it('exit 2 from the WRAPPER, not the guard, is not a proof', () => {
627
- const result = prove(runner({ guardStderr: 'BLOCKED: mx-agent containment guard could not be resolved.' }));
628
- expect(result.ok).toBe(false);
629
- expect(result.lines.join('\n')).toContain('cannot be attributed to the guard');
630
- expect(existsSync(join(worktree, GUARD_PROOF_FILENAME))).toBe(false);
631
- });
632
- it('a guard that refuses the PERMITTED command writes nothing — both halves are required', () => {
633
- const result = prove(runner({ permittedStatus: 2 }));
634
- expect(result.ok).toBe(false);
635
- expect(result.lines.join('\n')).toContain('blocks everything is not a control');
636
- });
637
- it('a spawn gate that allows a spawn writes nothing', () => {
638
- const result = prove(runner({ gateStatus: 0 }));
639
- expect(result.ok).toBe(false);
640
- expect(result.lines.join('\n')).toContain('spawn gate did not refuse');
641
- });
642
- it('a spawn gate that refuses unrelated tools writes nothing', () => {
643
- const result = prove(runner({ unrelatedStatus: 2 }));
644
- expect(result.ok).toBe(false);
645
- expect(result.lines.join('\n')).toContain('refused an unrelated Bash call');
646
- });
647
- it('refuses when Codex would not RUN the hooks (trust ungranted)', () => {
648
- writeFileSync(join(codexHome, 'config.toml'), `[projects."${worktree}"]\ntrust_level = "trusted"\n`);
649
- const result = prove(runner());
650
- expect(result.ok).toBe(false);
651
- expect(result.lines.join('\n')).toContain('would not RUN these hooks');
652
- expect(existsSync(join(worktree, GUARD_PROOF_FILENAME))).toBe(false);
653
- });
654
- it('refuses when there is no deployed hooks.json to prove', () => {
655
- rmSync(join(worktree, CODEX_HOOKS_FILENAME));
656
- expect(prove(runner()).ok).toBe(false);
657
- });
658
- /**
659
- * #4876. A proof is a statement that Codex would RUN these hooks. A `trusted_hash`
660
- * bound to bytes that changed is one Codex ignores — silently — so proving that the
661
- * entry's command refuses would prove nothing about a live session.
662
- *
663
- * MUTATION CHECK: drop the hash comparison in `codexHookTrustPreconditions` and this
664
- * test fails. Every pre-#4876 check still passes here: the record is present, enabled
665
- * and carries a non-empty hash.
666
- */
667
- it('refuses to record a proof when a granted hash is STALE', () => {
668
- const keys = codexHookTrustKeysForDoc(join(worktree, CODEX_HOOKS_FILENAME), readDeployedHooksDoc(worktree));
669
- const result = proveCodexGuards({
670
- worktreePath: worktree,
671
- codexHome,
672
- now: NOW,
673
- codexVersion: VERIFIED_CODEX_VERSION,
674
- // Codex reports a DIFFERENT hash for one entry than the config records.
675
- hashes: OBSERVED({ [keys[0]]: 'sha256:bb' }),
676
- runner: runner(),
677
- env: { PATH: process.env.PATH ?? '', HOME: worktree },
678
- });
679
- expect(result.ok).toBe(false);
680
- expect(result.lines.join('\n')).toContain('STALE');
681
- expect(result.lines.join('\n')).toContain(keys[0]);
682
- expect(existsSync(join(worktree, GUARD_PROOF_FILENAME))).toBe(false);
683
- });
684
- /**
685
- * The hashes are unreadable — `codex app-server` did not answer, the project is
686
- * untrusted, the method changed shape. That is not permission to fall back to the
687
- * presence check: a gate that cannot run must refuse.
688
- */
689
- it('refuses when Codex\'s own hashes could not be read at all', () => {
690
- const result = proveCodexGuards({
691
- worktreePath: worktree,
692
- codexHome,
693
- now: NOW,
694
- codexVersion: VERIFIED_CODEX_VERSION,
695
- hashes: { kind: 'unavailable', reason: 'app-server produced no response' },
696
- runner: runner(),
697
- env: { PATH: process.env.PATH ?? '', HOME: worktree },
698
- });
699
- expect(result.ok).toBe(false);
700
- expect(result.lines.join('\n')).toContain('unverifiable grant');
701
- expect(result.lines.join('\n')).toContain('app-server produced no response');
702
- expect(existsSync(join(worktree, GUARD_PROOF_FILENAME))).toBe(false);
703
- });
704
- it('refuses a hooks.json this CLI did not generate — no blessing hand edits', () => {
705
- const text = readFileSync(join(worktree, CODEX_HOOKS_FILENAME), 'utf-8');
706
- writeFileSync(join(worktree, CODEX_HOOKS_FILENAME), text.replace('"description"', '"Description"'));
707
- grantTrust();
708
- const result = prove(runner());
709
- expect(result.ok).toBe(false);
710
- expect(result.lines.join('\n')).toContain('does not match what this CLI generates');
711
- });
712
- it('leaves an existing artifact untouched when a later probe fails', () => {
713
- prove(runner());
714
- const before = readFileSync(join(worktree, GUARD_PROOF_FILENAME), 'utf-8');
715
- const result = prove(runner({ gateStatus: 0 }));
716
- expect(result.ok).toBe(false);
717
- expect(readFileSync(join(worktree, GUARD_PROOF_FILENAME), 'utf-8')).toBe(before);
718
- });
719
- });
720
- /**
721
- * ─── EXECUTED, not mocked ──────────────────────────────────────────────────────
722
- *
723
- * The tests above prove the decision logic. This one proves the thing the decision
724
- * logic is about: the REAL guard scripts, invoked through the REAL generated wrapper,
725
- * by the REAL default runner. A mocked positive control is a positive control that has
726
- * never been observed to fire — which is the defect this whole change exists to remove.
727
- *
728
- * The spawn gate is exercised through a `mx-agent` shim pointing at the built CLI, the
729
- * same lift codex-agent-gate.test.ts uses.
730
- */
731
- describe('proveCodexGuards — executed against the shipped guards and gate', () => {
732
- let shimDir;
733
- beforeEach(() => {
734
- // Guard scripts are already on disk from the outer beforeEach (the wrapper looks
735
- // for them there, and the reader hashes them).
736
- shimDir = mkdtempSync(join(tmpdir(), 'mx-proof-bin-'));
737
- const binary = join(CLI_ROOT, 'dist', 'index.js');
738
- expect(existsSync(binary)).toBe(true); // CI builds before testing (binary-smoke.test.ts)
739
- writeFileSync(join(shimDir, 'mx-agent'), `#!/bin/bash\nexec node ${binary} "$@"\n`, { mode: 0o755 });
740
- chmodSync(join(shimDir, 'mx-agent'), 0o755);
741
- });
742
- afterEach(() => {
743
- rmSync(shimDir, { recursive: true, force: true });
744
- });
745
- it('observes both guards and the gate refusing, and records it', () => {
746
- const result = proveCodexGuards({
747
- worktreePath: worktree,
748
- codexHome,
749
- now: NOW,
750
- codexVersion: VERIFIED_CODEX_VERSION,
751
- hashes: OBSERVED(),
752
- env: { PATH: `${shimDir}:${process.env.PATH ?? ''}`, HOME: worktree },
753
- });
754
- expect(result.lines.join('\n')).toContain('✓ git-mutation-guard');
755
- expect(result.ok).toBe(true);
756
- expect(result.proven.sort()).toEqual(['git-mutation-guard', 'named-memory-write-guard']);
757
- expect(read().valid).toBe(true);
758
- });
759
- it('a guard script that is absent is refused before anything is probed', () => {
760
- rmSync(join(worktree, '.claude', 'hooks', 'git-mutation-guard.sh'));
761
- const result = proveCodexGuards({
762
- worktreePath: worktree,
763
- codexHome,
764
- now: NOW,
765
- codexVersion: VERIFIED_CODEX_VERSION,
766
- hashes: OBSERVED(),
767
- env: { PATH: `${shimDir}:${process.env.PATH ?? ''}`, HOME: worktree },
768
- });
769
- // There is no script to hash, so there is nothing to prove. (Before the script
770
- // hash existed this reached the probe, where the WRAPPER's fail-closed exit 2
771
- // would have been mistaken for the guard refusing had attribution not caught it.)
772
- expect(result.ok).toBe(false);
773
- expect(result.lines.join('\n')).toContain('there is no guard');
774
- expect(existsSync(join(worktree, GUARD_PROOF_FILENAME))).toBe(false);
775
- });
776
- /**
777
- * MF1, EXECUTED. `.claude/hooks/` is writable from inside a Codex session — the
778
- * runtime read-only-binds `.git`, `.agents` and `.codex`, and nothing else. So the
779
- * script that carries the behaviour can be replaced while every byte the earlier
780
- * revision hashed stays untouched.
781
- */
782
- it('a NEUTERED guard script is not recorded as proven', () => {
783
- writeFileSync(join(worktree, '.claude', 'hooks', 'git-mutation-guard.sh'), '#!/bin/bash\nexit 0\n');
784
- const result = proveCodexGuards({
785
- worktreePath: worktree,
786
- codexHome,
787
- now: NOW,
788
- codexVersion: VERIFIED_CODEX_VERSION,
789
- hashes: OBSERVED(),
790
- env: { PATH: `${shimDir}:${process.env.PATH ?? ''}`, HOME: worktree },
791
- });
792
- expect(result.ok).toBe(false);
793
- expect(result.lines.join('\n')).toContain('DID NOT REFUSE');
794
- expect(existsSync(join(worktree, GUARD_PROOF_FILENAME))).toBe(false);
795
- });
796
- /**
797
- * MF1's headline case, EXECUTED end to end: prove honestly, THEN neuter the script.
798
- * Before the script hash, this artifact stayed valid and the banner still reported a
799
- * guard that refused nothing.
800
- *
801
- * MUTATION CHECK: dropping the scriptSha256 comparison in readGuardProof makes this
802
- * fail.
803
- */
804
- it('neutering a guard AFTER an honest proof voids that proof', () => {
805
- const proved = proveCodexGuards({
806
- worktreePath: worktree,
807
- codexHome,
808
- now: NOW,
809
- codexVersion: VERIFIED_CODEX_VERSION,
810
- hashes: OBSERVED(),
811
- env: { PATH: `${shimDir}:${process.env.PATH ?? ''}`, HOME: worktree },
812
- });
813
- expect(proved.ok).toBe(true);
814
- expect(read().valid).toBe(true);
815
- writeFileSync(join(worktree, '.claude', 'hooks', 'git-mutation-guard.sh'), '#!/bin/bash\nexit 0\n');
816
- const status = read();
817
- expect(status.provenGuards).toEqual([]);
818
- expect(status.detail).toContain('STALE PROOF');
819
- expect(status.detail).toContain('.claude/hooks/git-mutation-guard.sh');
820
- });
821
- });
822
- //# sourceMappingURL=runtime-codex-guard-proof.test.js.map