@memnexus-ai/mx-agent-cli 0.1.296-next.7 → 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/lib/templates.d.ts +1 -1
  6. package/dist/lib/templates.d.ts.map +1 -1
  7. package/dist/lib/templates.js +39 -3
  8. package/dist/lib/templates.js.map +1 -1
  9. package/dist/standards/decision-request.md +6 -57
  10. package/dist/standards/po-communication-standard.md +0 -34
  11. package/dist/standards/report-format.md +0 -90
  12. package/dist/standards/writing-standard.md +0 -312
  13. package/package.json +3 -1
  14. package/dist/__tests__/agent-attribution.test.d.ts +0 -16
  15. package/dist/__tests__/agent-attribution.test.d.ts.map +0 -1
  16. package/dist/__tests__/agent-attribution.test.js +0 -250
  17. package/dist/__tests__/agent-attribution.test.js.map +0 -1
  18. package/dist/__tests__/agents-md-canonicalization.test.d.ts +0 -23
  19. package/dist/__tests__/agents-md-canonicalization.test.d.ts.map +0 -1
  20. package/dist/__tests__/agents-md-canonicalization.test.js +0 -319
  21. package/dist/__tests__/agents-md-canonicalization.test.js.map +0 -1
  22. package/dist/__tests__/behavioral-compliance.test.d.ts +0 -8
  23. package/dist/__tests__/behavioral-compliance.test.d.ts.map +0 -1
  24. package/dist/__tests__/behavioral-compliance.test.js +0 -226
  25. package/dist/__tests__/behavioral-compliance.test.js.map +0 -1
  26. package/dist/__tests__/behavioral-extraction.test.d.ts +0 -12
  27. package/dist/__tests__/behavioral-extraction.test.d.ts.map +0 -1
  28. package/dist/__tests__/behavioral-extraction.test.js +0 -330
  29. package/dist/__tests__/behavioral-extraction.test.js.map +0 -1
  30. package/dist/__tests__/behavioral-git-read.test.d.ts +0 -21
  31. package/dist/__tests__/behavioral-git-read.test.d.ts.map +0 -1
  32. package/dist/__tests__/behavioral-git-read.test.js +0 -955
  33. package/dist/__tests__/behavioral-git-read.test.js.map +0 -1
  34. package/dist/__tests__/behavioral-injection.test.d.ts +0 -13
  35. package/dist/__tests__/behavioral-injection.test.d.ts.map +0 -1
  36. package/dist/__tests__/behavioral-injection.test.js +0 -384
  37. package/dist/__tests__/behavioral-injection.test.js.map +0 -1
  38. package/dist/__tests__/binary-smoke.test.d.ts +0 -12
  39. package/dist/__tests__/binary-smoke.test.d.ts.map +0 -1
  40. package/dist/__tests__/binary-smoke.test.js +0 -88
  41. package/dist/__tests__/binary-smoke.test.js.map +0 -1
  42. package/dist/__tests__/bootstrap-behavioral-contract.test.d.ts +0 -18
  43. package/dist/__tests__/bootstrap-behavioral-contract.test.d.ts.map +0 -1
  44. package/dist/__tests__/bootstrap-behavioral-contract.test.js +0 -104
  45. package/dist/__tests__/bootstrap-behavioral-contract.test.js.map +0 -1
  46. package/dist/__tests__/bundle-config.test.d.ts +0 -18
  47. package/dist/__tests__/bundle-config.test.d.ts.map +0 -1
  48. package/dist/__tests__/bundle-config.test.js +0 -123
  49. package/dist/__tests__/bundle-config.test.js.map +0 -1
  50. package/dist/__tests__/catalog-interaction.test.d.ts +0 -25
  51. package/dist/__tests__/catalog-interaction.test.d.ts.map +0 -1
  52. package/dist/__tests__/catalog-interaction.test.js +0 -269
  53. package/dist/__tests__/catalog-interaction.test.js.map +0 -1
  54. package/dist/__tests__/catalog-named-memories.test.d.ts +0 -2
  55. package/dist/__tests__/catalog-named-memories.test.d.ts.map +0 -1
  56. package/dist/__tests__/catalog-named-memories.test.js +0 -204
  57. package/dist/__tests__/catalog-named-memories.test.js.map +0 -1
  58. package/dist/__tests__/catalog-origin-main.test.d.ts +0 -15
  59. package/dist/__tests__/catalog-origin-main.test.d.ts.map +0 -1
  60. package/dist/__tests__/catalog-origin-main.test.js +0 -305
  61. package/dist/__tests__/catalog-origin-main.test.js.map +0 -1
  62. package/dist/__tests__/catalog.test.d.ts +0 -2
  63. package/dist/__tests__/catalog.test.d.ts.map +0 -1
  64. package/dist/__tests__/catalog.test.js +0 -131
  65. package/dist/__tests__/catalog.test.js.map +0 -1
  66. package/dist/__tests__/claude-local-sanitizer.test.d.ts +0 -24
  67. package/dist/__tests__/claude-local-sanitizer.test.d.ts.map +0 -1
  68. package/dist/__tests__/claude-local-sanitizer.test.js +0 -906
  69. package/dist/__tests__/claude-local-sanitizer.test.js.map +0 -1
  70. package/dist/__tests__/claude-md-compose.test.d.ts +0 -17
  71. package/dist/__tests__/claude-md-compose.test.d.ts.map +0 -1
  72. package/dist/__tests__/claude-md-compose.test.js +0 -119
  73. package/dist/__tests__/claude-md-compose.test.js.map +0 -1
  74. package/dist/__tests__/claude-sync.test.d.ts +0 -2
  75. package/dist/__tests__/claude-sync.test.d.ts.map +0 -1
  76. package/dist/__tests__/claude-sync.test.js +0 -571
  77. package/dist/__tests__/claude-sync.test.js.map +0 -1
  78. package/dist/__tests__/cli-build-integration.test.d.ts +0 -2
  79. package/dist/__tests__/cli-build-integration.test.d.ts.map +0 -1
  80. package/dist/__tests__/cli-build-integration.test.js +0 -64
  81. package/dist/__tests__/cli-build-integration.test.js.map +0 -1
  82. package/dist/__tests__/cli-build.test.d.ts +0 -2
  83. package/dist/__tests__/cli-build.test.d.ts.map +0 -1
  84. package/dist/__tests__/cli-build.test.js +0 -640
  85. package/dist/__tests__/cli-build.test.js.map +0 -1
  86. package/dist/__tests__/codex-agent-gate.test.d.ts +0 -2
  87. package/dist/__tests__/codex-agent-gate.test.d.ts.map +0 -1
  88. package/dist/__tests__/codex-agent-gate.test.js +0 -480
  89. package/dist/__tests__/codex-agent-gate.test.js.map +0 -1
  90. package/dist/__tests__/codex-deploy-config.test.d.ts +0 -2
  91. package/dist/__tests__/codex-deploy-config.test.d.ts.map +0 -1
  92. package/dist/__tests__/codex-deploy-config.test.js +0 -1230
  93. package/dist/__tests__/codex-deploy-config.test.js.map +0 -1
  94. package/dist/__tests__/codex-trust-keys.test.d.ts +0 -2
  95. package/dist/__tests__/codex-trust-keys.test.d.ts.map +0 -1
  96. package/dist/__tests__/codex-trust-keys.test.js +0 -731
  97. package/dist/__tests__/codex-trust-keys.test.js.map +0 -1
  98. package/dist/__tests__/codex-write-race.test.d.ts +0 -2
  99. package/dist/__tests__/codex-write-race.test.d.ts.map +0 -1
  100. package/dist/__tests__/codex-write-race.test.js +0 -2253
  101. package/dist/__tests__/codex-write-race.test.js.map +0 -1
  102. package/dist/__tests__/completion-rows-discriminate.test.d.ts +0 -20
  103. package/dist/__tests__/completion-rows-discriminate.test.d.ts.map +0 -1
  104. package/dist/__tests__/completion-rows-discriminate.test.js +0 -481
  105. package/dist/__tests__/completion-rows-discriminate.test.js.map +0 -1
  106. package/dist/__tests__/config-command.test.d.ts +0 -9
  107. package/dist/__tests__/config-command.test.d.ts.map +0 -1
  108. package/dist/__tests__/config-command.test.js +0 -75
  109. package/dist/__tests__/config-command.test.js.map +0 -1
  110. package/dist/__tests__/config-fidelity-archived-symlinks.test.d.ts +0 -2
  111. package/dist/__tests__/config-fidelity-archived-symlinks.test.d.ts.map +0 -1
  112. package/dist/__tests__/config-fidelity-archived-symlinks.test.js +0 -127
  113. package/dist/__tests__/config-fidelity-archived-symlinks.test.js.map +0 -1
  114. package/dist/__tests__/config-fidelity-display.test.d.ts +0 -2
  115. package/dist/__tests__/config-fidelity-display.test.d.ts.map +0 -1
  116. package/dist/__tests__/config-fidelity-display.test.js +0 -77
  117. package/dist/__tests__/config-fidelity-display.test.js.map +0 -1
  118. package/dist/__tests__/config-fidelity-unreadable-fixture.d.ts +0 -32
  119. package/dist/__tests__/config-fidelity-unreadable-fixture.d.ts.map +0 -1
  120. package/dist/__tests__/config-fidelity-unreadable-fixture.js +0 -37
  121. package/dist/__tests__/config-fidelity-unreadable-fixture.js.map +0 -1
  122. package/dist/__tests__/config-fidelity.test.d.ts +0 -16
  123. package/dist/__tests__/config-fidelity.test.d.ts.map +0 -1
  124. package/dist/__tests__/config-fidelity.test.js +0 -2679
  125. package/dist/__tests__/config-fidelity.test.js.map +0 -1
  126. package/dist/__tests__/config-generation-gate.test.d.ts +0 -46
  127. package/dist/__tests__/config-generation-gate.test.d.ts.map +0 -1
  128. package/dist/__tests__/config-generation-gate.test.js +0 -435
  129. package/dist/__tests__/config-generation-gate.test.js.map +0 -1
  130. package/dist/__tests__/config-generation.test.d.ts +0 -7
  131. package/dist/__tests__/config-generation.test.d.ts.map +0 -1
  132. package/dist/__tests__/config-generation.test.js +0 -141
  133. package/dist/__tests__/config-generation.test.js.map +0 -1
  134. package/dist/__tests__/config-sync.test.d.ts +0 -10
  135. package/dist/__tests__/config-sync.test.d.ts.map +0 -1
  136. package/dist/__tests__/config-sync.test.js +0 -268
  137. package/dist/__tests__/config-sync.test.js.map +0 -1
  138. package/dist/__tests__/coordination-401-production-wiring.test.d.ts +0 -19
  139. package/dist/__tests__/coordination-401-production-wiring.test.d.ts.map +0 -1
  140. package/dist/__tests__/coordination-401-production-wiring.test.js +0 -286
  141. package/dist/__tests__/coordination-401-production-wiring.test.js.map +0 -1
  142. package/dist/__tests__/coordination-401-recovery.test.d.ts +0 -22
  143. package/dist/__tests__/coordination-401-recovery.test.d.ts.map +0 -1
  144. package/dist/__tests__/coordination-401-recovery.test.js +0 -601
  145. package/dist/__tests__/coordination-401-recovery.test.js.map +0 -1
  146. package/dist/__tests__/coordination-brief-pin.test.d.ts +0 -20
  147. package/dist/__tests__/coordination-brief-pin.test.d.ts.map +0 -1
  148. package/dist/__tests__/coordination-brief-pin.test.js +0 -66
  149. package/dist/__tests__/coordination-brief-pin.test.js.map +0 -1
  150. package/dist/__tests__/coordination-brief.test.d.ts +0 -9
  151. package/dist/__tests__/coordination-brief.test.d.ts.map +0 -1
  152. package/dist/__tests__/coordination-brief.test.js +0 -290
  153. package/dist/__tests__/coordination-brief.test.js.map +0 -1
  154. package/dist/__tests__/coordination-client.test.d.ts +0 -9
  155. package/dist/__tests__/coordination-client.test.d.ts.map +0 -1
  156. package/dist/__tests__/coordination-client.test.js +0 -517
  157. package/dist/__tests__/coordination-client.test.js.map +0 -1
  158. package/dist/__tests__/coordination-command.test.d.ts +0 -9
  159. package/dist/__tests__/coordination-command.test.d.ts.map +0 -1
  160. package/dist/__tests__/coordination-command.test.js +0 -1082
  161. package/dist/__tests__/coordination-command.test.js.map +0 -1
  162. package/dist/__tests__/coordination-credential-endpoint.test.d.ts +0 -24
  163. package/dist/__tests__/coordination-credential-endpoint.test.d.ts.map +0 -1
  164. package/dist/__tests__/coordination-credential-endpoint.test.js +0 -1292
  165. package/dist/__tests__/coordination-credential-endpoint.test.js.map +0 -1
  166. package/dist/__tests__/coordination-expected-team.test.d.ts +0 -19
  167. package/dist/__tests__/coordination-expected-team.test.d.ts.map +0 -1
  168. package/dist/__tests__/coordination-expected-team.test.js +0 -423
  169. package/dist/__tests__/coordination-expected-team.test.js.map +0 -1
  170. package/dist/__tests__/coordination-fallback.test.d.ts +0 -9
  171. package/dist/__tests__/coordination-fallback.test.d.ts.map +0 -1
  172. package/dist/__tests__/coordination-fallback.test.js +0 -192
  173. package/dist/__tests__/coordination-fallback.test.js.map +0 -1
  174. package/dist/__tests__/coordination-file-guards.test.d.ts +0 -29
  175. package/dist/__tests__/coordination-file-guards.test.d.ts.map +0 -1
  176. package/dist/__tests__/coordination-file-guards.test.js +0 -380
  177. package/dist/__tests__/coordination-file-guards.test.js.map +0 -1
  178. package/dist/__tests__/coordination-history.test.d.ts +0 -8
  179. package/dist/__tests__/coordination-history.test.d.ts.map +0 -1
  180. package/dist/__tests__/coordination-history.test.js +0 -447
  181. package/dist/__tests__/coordination-history.test.js.map +0 -1
  182. package/dist/__tests__/coordination-memory.test.d.ts +0 -14
  183. package/dist/__tests__/coordination-memory.test.d.ts.map +0 -1
  184. package/dist/__tests__/coordination-memory.test.js +0 -401
  185. package/dist/__tests__/coordination-memory.test.js.map +0 -1
  186. package/dist/__tests__/coordination-mode.test.d.ts +0 -13
  187. package/dist/__tests__/coordination-mode.test.d.ts.map +0 -1
  188. package/dist/__tests__/coordination-mode.test.js +0 -180
  189. package/dist/__tests__/coordination-mode.test.js.map +0 -1
  190. package/dist/__tests__/coordination-plain-shell-commands.test.d.ts +0 -22
  191. package/dist/__tests__/coordination-plain-shell-commands.test.d.ts.map +0 -1
  192. package/dist/__tests__/coordination-plain-shell-commands.test.js +0 -1875
  193. package/dist/__tests__/coordination-plain-shell-commands.test.js.map +0 -1
  194. package/dist/__tests__/coordination-provision.test.d.ts +0 -12
  195. package/dist/__tests__/coordination-provision.test.d.ts.map +0 -1
  196. package/dist/__tests__/coordination-provision.test.js +0 -103
  197. package/dist/__tests__/coordination-provision.test.js.map +0 -1
  198. package/dist/__tests__/coordination-render.test.d.ts +0 -9
  199. package/dist/__tests__/coordination-render.test.d.ts.map +0 -1
  200. package/dist/__tests__/coordination-render.test.js +0 -335
  201. package/dist/__tests__/coordination-render.test.js.map +0 -1
  202. package/dist/__tests__/coordination-setup.test.d.ts +0 -6
  203. package/dist/__tests__/coordination-setup.test.d.ts.map +0 -1
  204. package/dist/__tests__/coordination-setup.test.js +0 -448
  205. package/dist/__tests__/coordination-setup.test.js.map +0 -1
  206. package/dist/__tests__/coordination-status-plain-shell.test.d.ts +0 -19
  207. package/dist/__tests__/coordination-status-plain-shell.test.d.ts.map +0 -1
  208. package/dist/__tests__/coordination-status-plain-shell.test.js +0 -332
  209. package/dist/__tests__/coordination-status-plain-shell.test.js.map +0 -1
  210. package/dist/__tests__/coordination-status-registration.test.d.ts +0 -16
  211. package/dist/__tests__/coordination-status-registration.test.d.ts.map +0 -1
  212. package/dist/__tests__/coordination-status-registration.test.js +0 -480
  213. package/dist/__tests__/coordination-status-registration.test.js.map +0 -1
  214. package/dist/__tests__/coordination-token-multitenant.test.d.ts +0 -11
  215. package/dist/__tests__/coordination-token-multitenant.test.d.ts.map +0 -1
  216. package/dist/__tests__/coordination-token-multitenant.test.js +0 -106
  217. package/dist/__tests__/coordination-token-multitenant.test.js.map +0 -1
  218. package/dist/__tests__/coordination-token.test.d.ts +0 -11
  219. package/dist/__tests__/coordination-token.test.d.ts.map +0 -1
  220. package/dist/__tests__/coordination-token.test.js +0 -201
  221. package/dist/__tests__/coordination-token.test.js.map +0 -1
  222. package/dist/__tests__/coordination-wiring.test.d.ts +0 -11
  223. package/dist/__tests__/coordination-wiring.test.d.ts.map +0 -1
  224. package/dist/__tests__/coordination-wiring.test.js +0 -43
  225. package/dist/__tests__/coordination-wiring.test.js.map +0 -1
  226. package/dist/__tests__/creation-pr-class-check.test.d.ts +0 -17
  227. package/dist/__tests__/creation-pr-class-check.test.d.ts.map +0 -1
  228. package/dist/__tests__/creation-pr-class-check.test.js +0 -346
  229. package/dist/__tests__/creation-pr-class-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,731 +0,0 @@
1
- /**
2
- * Hook-trust key enumeration and REAL hash verification (#4876, closes
3
- * KI-CODEX-TRUST-HASH-NOT-VERIFIED).
4
- *
5
- * ─── THE TWO DEFECTS UNDER TEST ───────────────────────────────────────────────
6
- * 1. A STALE GRANT READ AS TRUST. `codexHookTrustPreconditions` accepted any non-empty
7
- * `trusted_hash`. Codex does not run an entry whose hash stopped matching, and it
8
- * says nothing when it declines — so the guards went inert while every check we own
9
- * reported green. The test named "a stale hash is NOT trust" is the mutation canary:
10
- * remove the comparison and it fails.
11
- * 2. THE DOUBLE PREFIX. `hooks/list` returns `currentHash` ALREADY carrying `sha256:`.
12
- * A record written as `sha256:sha256:<hex>` is never matched, and the failure is
13
- * silent in the same direction. The pasteable block is asserted to reproduce the
14
- * observed value verbatim and to contain no doubled prefix.
15
- *
16
- * The `hooks/list` payload in these tests is the SHAPE OBSERVED LIVE on codex-cli
17
- * 0.145.0 (2026-08-02): `result.data[].hooks[]` with key, currentHash, trustStatus,
18
- * sourcePath, enabled — and, per OpenAI bug #27133, every `sourcePath` is the MAIN
19
- * repo's file even when the query names a worktree cwd.
20
- */
21
- import { describe, it, expect, beforeEach, afterEach } from 'vitest';
22
- import { mkdirSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from 'fs';
23
- import { createHash } from 'crypto';
24
- import { join } from 'path';
25
- import { tmpdir } from 'os';
26
- import { fileURLToPath } from 'url';
27
- import { CODEX_HOOKS_FILENAME, buildCodexHooksJson, codexHookTrustKeysForDoc, codexHookTrustPreconditions, readCodexTrustState, readDeployedHooksDoc, } from '../lib/runtime/codex-config.js';
28
- import { carryOverHashes, observedHashesByKey, parseHooksListResponse, queryCodexHooksList, splitTrustKey, } from '../lib/runtime/codex-hooks-list.js';
29
- import { CODEX_HASH_SHAPE, buildTrustKeyReport, shaCodexHooksFiles, trustGrantToml, } from '../lib/runtime/codex-trust-keys.js';
30
- import { renderTrustKeyReport } from '../commands/codex-trust-keys.js';
31
- let mainRepo;
32
- let worktree;
33
- let codexHome;
34
- /** A real 71-character Codex hash shape: `sha256:` + 64 hex. */
35
- const HASH = (seed) => `sha256:${createHash('sha256').update(seed).digest('hex')}`;
36
- function deployHooks(dir) {
37
- mkdirSync(join(dir, '.codex'), { recursive: true });
38
- writeFileSync(join(dir, CODEX_HOOKS_FILENAME), buildCodexHooksJson({ worktreePath: dir }));
39
- }
40
- function keysFor(dir) {
41
- return codexHookTrustKeysForDoc(join(dir, CODEX_HOOKS_FILENAME), readDeployedHooksDoc(dir));
42
- }
43
- /** `hooks/list` entries as Codex reports them: main-repo sourcePath only (#27133). */
44
- function liveEntries(over = {}) {
45
- return keysFor(mainRepo).map((key) => ({
46
- key,
47
- currentHash: over[key] ?? HASH(key.split(':').slice(-3).join(':')),
48
- trustStatus: 'trusted',
49
- sourcePath: join(mainRepo, CODEX_HOOKS_FILENAME),
50
- enabled: true,
51
- }));
52
- }
53
- function writeConfig(sections) {
54
- mkdirSync(codexHome, { recursive: true });
55
- writeFileSync(join(codexHome, 'config.toml'), sections);
56
- }
57
- /** Grant every key of both files, with the hashes `hooks/list` would report. */
58
- function grantAll(over = {}) {
59
- const observed = new Map(liveEntries().map((e) => [e.key, e.currentHash]));
60
- const carried = carryOverHashes(observed, join(mainRepo, CODEX_HOOKS_FILENAME), join(worktree, CODEX_HOOKS_FILENAME));
61
- const all = new Map([...observed, ...carried]);
62
- writeConfig(`[projects."${mainRepo}"]\ntrust_level = "trusted"\n\n` +
63
- `[projects."${worktree}"]\ntrust_level = "trusted"\n\n` +
64
- [...all]
65
- .map(([k, h]) => `[hooks.state."${k}"]\nenabled = true\ntrusted_hash = "${over[k] ?? h}"\n`)
66
- .join('\n'));
67
- }
68
- const report = (entries) => buildTrustKeyReport({
69
- worktreePath: worktree,
70
- mainRepoPath: mainRepo,
71
- codexHome,
72
- hooksList: { ok: true, entries: entries ?? liveEntries() },
73
- });
74
- beforeEach(() => {
75
- mainRepo = mkdtempSync(join(tmpdir(), 'mx-tk-main-'));
76
- worktree = mkdtempSync(join(tmpdir(), 'mx-tk-wt-'));
77
- codexHome = mkdtempSync(join(tmpdir(), 'mx-tk-home-'));
78
- deployHooks(mainRepo);
79
- deployHooks(worktree);
80
- });
81
- afterEach(() => {
82
- for (const d of [mainRepo, worktree, codexHome])
83
- rmSync(d, { recursive: true, force: true });
84
- });
85
- describe('hooks/list parsing — fail closed on every shape it cannot read', () => {
86
- const envelope = (hooks) => [
87
- '{"jsonrpc":"2.0","id":1,"result":{}}',
88
- 'not json at all',
89
- JSON.stringify({ jsonrpc: '2.0', id: 2, result: { data: [{ cwd: '/x', hooks }] } }),
90
- ].join('\n');
91
- it('reads key, currentHash, trustStatus and sourcePath from the live shape', () => {
92
- const result = parseHooksListResponse(envelope([
93
- {
94
- key: '/workspace/.codex/hooks.json:pre_tool_use:0:0',
95
- currentHash: HASH('a'),
96
- trustStatus: 'trusted',
97
- sourcePath: '/workspace/.codex/hooks.json',
98
- enabled: true,
99
- },
100
- ]));
101
- expect(result.ok).toBe(true);
102
- if (!result.ok)
103
- return;
104
- expect(result.entries[0]?.key).toBe('/workspace/.codex/hooks.json:pre_tool_use:0:0');
105
- expect(result.entries[0]?.currentHash).toMatch(CODEX_HASH_SHAPE);
106
- expect(result.entries[0]?.sourcePath).toBe('/workspace/.codex/hooks.json');
107
- });
108
- /**
109
- * An empty `data` array is what Codex returns for an UNTRUSTED project. Reading it as
110
- * "no hooks, nothing to check" would turn the single most important negative result
111
- * into a green one.
112
- */
113
- it('an empty result set is an ERROR naming project trust, not an empty success', () => {
114
- const result = parseHooksListResponse('{"jsonrpc":"2.0","id":2,"result":{"data":[]}}');
115
- expect(result.ok).toBe(false);
116
- expect(result.ok === false && result.error).toMatch(/UNTRUSTED project/);
117
- });
118
- it('no response, a JSON-RPC error, and a missing currentHash are all refusals', () => {
119
- expect(parseHooksListResponse('').ok).toBe(false);
120
- const rpcError = parseHooksListResponse('{"jsonrpc":"2.0","id":2,"error":{"code":-1,"message":"nope"}}');
121
- expect(rpcError.ok === false && rpcError.error).toMatch(/JSON-RPC error/);
122
- const noHash = parseHooksListResponse(envelope([{ key: 'k:pre_tool_use:0:0' }]));
123
- expect(noHash.ok).toBe(false);
124
- expect(noHash.ok === false && noHash.error).toMatch(/do not hand-write a hash/);
125
- });
126
- it('splitTrustKey separates the file path from the event/group/hook suffix', () => {
127
- expect(splitTrustKey('/a/b/.codex/hooks.json:pre_tool_use:2:0')).toEqual({
128
- hooksPath: '/a/b/.codex/hooks.json',
129
- suffix: 'pre_tool_use:2:0',
130
- });
131
- expect(splitTrustKey('nonsense')).toBeNull();
132
- });
133
- /**
134
- * SF-1. `data:[null]` and `data:[42]` reached `.hooks` on a non-object and threw a
135
- * TypeError, uncaught, through `queryCodexHooksList`, `buildTrustKeyReport` and both
136
- * commands — so the operator got a stack trace where `prove-guards` should have
137
- * printed its refusal. Nothing from another process throws out of this parser.
138
- */
139
- it('a malformed data array is a refusal, never a thrown TypeError', () => {
140
- for (const payload of ['{"id":2,"result":{"data":[null]}}', '{"id":2,"result":{"data":[42]}}']) {
141
- let result;
142
- expect(() => {
143
- result = parseHooksListResponse(payload);
144
- }).not.toThrow();
145
- expect(result.ok).toBe(false);
146
- }
147
- });
148
- /**
149
- * The try/catch is around the WHOLE parse, not one field, so a shape nobody
150
- * anticipated still returns a refusal. These are the shapes a fuzzed or
151
- * version-shifted response can take; none may escape as an exception.
152
- */
153
- it('every odd top-level shape returns a refusal rather than throwing', () => {
154
- for (const payload of [
155
- '{"id":2,"result":{"data":[[]]}}',
156
- '{"id":2,"result":{"data":[{"hooks":[null]}]}}',
157
- '{"id":2,"result":{"data":[{"hooks":"not an array"}]}}',
158
- '{"id":2,"result":{"data":{"not":"an array"}}}',
159
- '{"id":2,"result":null}',
160
- '{"id":2}',
161
- ]) {
162
- let result;
163
- expect(() => {
164
- result = parseHooksListResponse(payload);
165
- }, payload).not.toThrow();
166
- expect(result?.ok, payload).toBe(false);
167
- }
168
- });
169
- /**
170
- * SF-2. `observedHashesByKey` builds a Map, so a later duplicate silently replaced an
171
- * earlier one — a second entry for a key could shadow the real hash and turn a
172
- * `stale-hash` verdict into `granted`. Two answers to one JSON-RPC id had the same
173
- * last-wins shape at the response level.
174
- */
175
- it('refuses a duplicate key whose hash DIFFERS, and tolerates an identical repeat', () => {
176
- const dup = (hashB) => JSON.stringify({
177
- id: 2,
178
- result: {
179
- data: [
180
- {
181
- hooks: [
182
- { key: '/w/.codex/hooks.json:pre_tool_use:0:0', currentHash: HASH('a'), sourcePath: '/w/.codex/hooks.json' },
183
- { key: '/w/.codex/hooks.json:pre_tool_use:0:0', currentHash: hashB, sourcePath: '/w/.codex/hooks.json' },
184
- ],
185
- },
186
- ],
187
- },
188
- });
189
- const conflicting = parseHooksListResponse(dup(HASH('b')));
190
- expect(conflicting.ok).toBe(false);
191
- expect(conflicting.ok === false && conflicting.error).toMatch(/two DIFFERENT hashes for the same key/);
192
- const identical = parseHooksListResponse(dup(HASH('a')));
193
- expect(identical.ok).toBe(true);
194
- expect(identical.ok === true && identical.entries).toHaveLength(1);
195
- });
196
- it('refuses a stream carrying two responses to the same request id', () => {
197
- const one = (hash) => JSON.stringify({
198
- id: 2,
199
- result: { data: [{ hooks: [{ key: '/w/.codex/hooks.json:pre_tool_use:0:0', currentHash: hash, sourcePath: '/w/.codex/hooks.json' }] }] },
200
- });
201
- const result = parseHooksListResponse(`${one(HASH('a'))}\n${one(HASH('b'))}`);
202
- expect(result.ok).toBe(false);
203
- expect(result.ok === false && result.error).toMatch(/more than one response to hooks\/list/);
204
- });
205
- /**
206
- * SF-3. `sourcePath` was captured and never compared to the key it arrived with, so an
207
- * entry claiming a foreign source file was recorded as a direct observation of the key
208
- * it names. It is also this module's evidence for #27133 — the claim about WHICH file
209
- * Codex resolved — which the check restores.
210
- */
211
- it('refuses an entry whose sourcePath is not the key\'s own file', () => {
212
- const result = parseHooksListResponse(JSON.stringify({
213
- id: 2,
214
- result: {
215
- data: [
216
- {
217
- hooks: [
218
- {
219
- key: '/w/.codex/hooks.json:pre_tool_use:0:0',
220
- currentHash: HASH('a'),
221
- sourcePath: '/somewhere/else/.codex/hooks.json',
222
- },
223
- ],
224
- },
225
- ],
226
- },
227
- }));
228
- expect(result.ok).toBe(false);
229
- expect(result.ok === false && result.error).toMatch(/keyed on .* but sourced from/);
230
- });
231
- /**
232
- * MUST FIX 3 (security review, executed). An ABSENT or non-string `sourcePath` skipped
233
- * the provenance check entirely and the entry was recorded as a DIRECT observation.
234
- * That is fail-open in the one direction that matters: `buildTrustKeyReport` treats any
235
- * direct observation of a file as proof Codex saw that file, which switches off the
236
- * byte-identity precondition on the carry-over — so an entry with no provenance at all
237
- * could grade `granted`. Codex reports `sourcePath` on every entry (verified live on
238
- * 0.145.0), so its absence is a shape we have never seen from Codex.
239
- */
240
- it('refuses an entry with NO sourcePath — absent provenance is not provenance', () => {
241
- for (const sourcePath of [undefined, null, 99]) {
242
- const result = parseHooksListResponse(JSON.stringify({
243
- id: 2,
244
- result: {
245
- data: [
246
- {
247
- hooks: [
248
- {
249
- key: '/w/.codex/hooks.json:pre_tool_use:0:0',
250
- currentHash: HASH('a'),
251
- ...(sourcePath === undefined ? {} : { sourcePath }),
252
- },
253
- ],
254
- },
255
- ],
256
- },
257
- }));
258
- expect(result.ok, `sourcePath ${String(sourcePath)}`).toBe(false);
259
- expect(result.ok === false && result.error).toMatch(/with NO sourcePath/);
260
- }
261
- });
262
- /**
263
- * The same fail-open reached the report: an unprovenanced entry keyed on the WORKTREE
264
- * file made `hasDirect` true there, so the byte-identity check that gates the
265
- * carry-over never ran, and the row graded `granted` off a hash nothing corroborated.
266
- * The refusal above is what stops it — and this asserts the outcome, not the mechanism.
267
- */
268
- it('an unprovenanced entry keyed on the worktree file cannot grade granted', () => {
269
- const wtHooks = join(worktree, CODEX_HOOKS_FILENAME);
270
- const key = `${wtHooks}:pre_tool_use:0:0`;
271
- const hooksList = parseHooksListResponse(JSON.stringify({ id: 2, result: { data: [{ hooks: [{ key, currentHash: HASH('a') }] }] } }));
272
- expect(hooksList.ok).toBe(false);
273
- writeConfig(`[hooks.state."${key}"]\nenabled = true\ntrusted_hash = "${HASH('a')}"\n`);
274
- const built = buildTrustKeyReport({
275
- worktreePath: worktree,
276
- mainRepoPath: mainRepo,
277
- codexHome,
278
- hooksList,
279
- });
280
- expect(built.ok).toBe(false);
281
- expect(built.sets.flatMap((s) => s.rows).some((r) => r.status === 'granted')).toBe(false);
282
- });
283
- /**
284
- * MUST FIX 2, layer one (security review, CVSS 8.2, executed). Trust keys are written
285
- * into TOML table headers in the block an operator is told to paste into
286
- * `~/.codex/config.toml`. A key carrying `"` and a newline closes that header and opens
287
- * one of its own; the reviewer's payload produced `[projects."/workspace"]
288
- * trust_level = "trusted"`. A key of that shape is not something to render carefully —
289
- * it is not a fact about our configuration, and it never enters `entries`.
290
- */
291
- it('refuses a key that is not <path>:<event>:<group>:<index>, quote or newline included', () => {
292
- const evil = '/w/.codex/hooks.json:p:0:0"\nenabled = true\n\n[projects."/workspace"]\ntrust_level = "trusted"\n\n[hooks.state."x';
293
- for (const key of [
294
- evil,
295
- '/w/.codex/hooks.json:PreToolUse:0:0',
296
- '/w/.codex/hooks.json:pre_tool_use:0',
297
- '/w/.codex/hooks.json:pre_tool_use:0:x',
298
- 'abc',
299
- ]) {
300
- const result = parseHooksListResponse(JSON.stringify({
301
- id: 2,
302
- result: {
303
- data: [
304
- { hooks: [{ key, currentHash: HASH('a'), sourcePath: '/w/.codex/hooks.json' }] },
305
- ],
306
- },
307
- }));
308
- expect(result.ok, key).toBe(false);
309
- expect(result.ok === false && result.error).toMatch(/not of the form|quote, backslash/);
310
- }
311
- });
312
- /**
313
- * SF-5. `r.status` was never inspected and stderr was captured and dropped, so a
314
- * non-zero exit with parseable stdout was accepted as an answer, and the commonest
315
- * failure of all — no `codex` on PATH — surfaced as "produced no response to
316
- * hooks/list", which sends an operator to check project trust instead of their install.
317
- */
318
- it('refuses a non-zero exit even when stdout parses, and carries stderr', () => {
319
- const good = JSON.stringify({
320
- id: 2,
321
- result: { data: [{ hooks: [{ key: '/w/.codex/hooks.json:pre_tool_use:0:0', currentHash: HASH('a') }] }] },
322
- });
323
- const result = queryCodexHooksList({
324
- cwd: '/w',
325
- exec: () => ({ stdout: good, status: 1, stderr: 'panicked at codex\nbacktrace' }),
326
- });
327
- expect(result.ok).toBe(false);
328
- expect(result.ok === false && result.error).toMatch(/exited 1/);
329
- expect(result.ok === false && result.error).toContain('backtrace');
330
- });
331
- it('names a missing codex binary as a missing install, not as an empty answer', () => {
332
- const result = queryCodexHooksList({
333
- cwd: '/w',
334
- exec: () => ({ stdout: '', status: 127, stderr: 'bash: line 1: codex: command not found' }),
335
- });
336
- expect(result.ok).toBe(false);
337
- expect(result.ok === false && result.error).toMatch(/not found on PATH/);
338
- expect(result.ok === false && result.error).not.toMatch(/UNTRUSTED project/);
339
- });
340
- it('reports a timeout kill and a signal kill distinctly', () => {
341
- const timedOut = queryCodexHooksList({ cwd: '/w', exec: () => ({ stdout: '', status: 124, stderr: '' }) });
342
- expect(timedOut.ok === false && timedOut.error).toMatch(/timed out/);
343
- const signalled = queryCodexHooksList({ cwd: '/w', exec: () => ({ stdout: '', status: null, stderr: '' }) });
344
- expect(signalled.ok === false && signalled.error).toMatch(/killed by a signal/);
345
- });
346
- /**
347
- * SF-4. `spawnSync`'s own timeout signals only the direct child — `bash` — leaving the
348
- * `cat`, the 8-second `sleep` and a live `codex app-server` behind, once per run, on a
349
- * machine several agent sessions share. GNU `timeout` runs the command in its own
350
- * process group and signals the GROUP.
351
- */
352
- it('the default invocation is wrapped in `timeout -k` so the whole pipeline is killed', () => {
353
- const src = readFileSync(fileURLToPath(new URL('../lib/runtime/codex-hooks-list.ts', import.meta.url)), 'utf-8');
354
- expect(src).toMatch(/spawnSync\(\s*'timeout',\s*\['-k',\s*'5',/);
355
- expect(src).not.toMatch(/spawnSync\('bash',/);
356
- });
357
- it('carryOverHashes re-keys onto the other file and drops foreign keys', () => {
358
- const observed = new Map([['/m/.codex/hooks.json:pre_tool_use:0:0', HASH('x')]]);
359
- const carried = carryOverHashes(observed, '/m/.codex/hooks.json', '/w/.codex/hooks.json');
360
- expect([...carried.keys()]).toEqual(['/w/.codex/hooks.json:pre_tool_use:0:0']);
361
- expect(carryOverHashes(observed, '/other/hooks.json', '/w/hooks.json').size).toBe(0);
362
- });
363
- });
364
- describe('the trust precondition now VERIFIES the hash (KI-CODEX-TRUST-HASH-NOT-VERIFIED)', () => {
365
- const wtKeys = () => keysFor(worktree);
366
- it('a matching hash is trust', () => {
367
- grantAll();
368
- const observed = new Map(wtKeys().map((k) => [k, readGranted(k)]));
369
- const trust = codexHookTrustPreconditions({
370
- worktreePath: worktree,
371
- codexHome,
372
- observedHashes: observed,
373
- });
374
- expect(trust.find((t) => t.id === 'hook-trust')?.satisfied).toBe(true);
375
- });
376
- /**
377
- * MUTATION CANARY. Delete the `observed !== recorded` comparison in
378
- * codexHookTrustPreconditions and this test passes when it must fail: the record is
379
- * present, enabled and non-empty — every check that existed before #4876.
380
- */
381
- it('a stale hash is NOT trust, and the entry is named', () => {
382
- grantAll();
383
- const keys = wtKeys();
384
- const observed = new Map(keys.map((k) => [k, readGranted(k)]));
385
- const staleKey = keys[0];
386
- observed.set(staleKey, HASH('the file changed'));
387
- const trust = codexHookTrustPreconditions({
388
- worktreePath: worktree,
389
- codexHome,
390
- observedHashes: observed,
391
- });
392
- const hookTrust = trust.find((t) => t.id === 'hook-trust');
393
- expect(hookTrust?.satisfied).toBe(false);
394
- expect(hookTrust?.detail).toContain('STALE');
395
- expect(hookTrust?.detail).toContain(staleKey);
396
- });
397
- it('a key with NO observed hash is reported unverified, not assumed fine', () => {
398
- grantAll();
399
- const keys = wtKeys();
400
- const observed = new Map(keys.slice(1).map((k) => [k, readGranted(k)]));
401
- const hookTrust = codexHookTrustPreconditions({
402
- worktreePath: worktree,
403
- codexHome,
404
- observedHashes: observed,
405
- }).find((t) => t.id === 'hook-trust');
406
- expect(hookTrust?.satisfied).toBe(false);
407
- expect(hookTrust?.detail).toContain('could not be checked');
408
- expect(hookTrust?.detail).toContain(keys[0]);
409
- });
410
- it('without observed hashes the old presence check stands — and SAYS it is unverified', () => {
411
- grantAll();
412
- const hookTrust = codexHookTrustPreconditions({ worktreePath: worktree, codexHome })
413
- .find((t) => t.id === 'hook-trust');
414
- expect(hookTrust?.satisfied).toBe(true);
415
- expect(hookTrust?.detail).toContain('no observed hashes were supplied');
416
- expect(hookTrust?.detail).toContain('trust-keys');
417
- });
418
- it('an ungranted entry still reports ungranted, separately from stale', () => {
419
- writeConfig(`[projects."${worktree}"]\ntrust_level = "trusted"\n`);
420
- const hookTrust = codexHookTrustPreconditions({
421
- worktreePath: worktree,
422
- codexHome,
423
- observedHashes: new Map(wtKeys().map((k) => [k, HASH(k)])),
424
- }).find((t) => t.id === 'hook-trust');
425
- expect(hookTrust?.satisfied).toBe(false);
426
- expect(hookTrust?.detail).toContain('NO usable trust record');
427
- expect(hookTrust?.detail).not.toContain('STALE');
428
- });
429
- function readGranted(key) {
430
- return readCodexTrustState(codexHome).records.get(key)?.hash ?? '';
431
- }
432
- });
433
- describe('trust-keys report — both key sets, and the #27133 carry-over', () => {
434
- it('reports BOTH key sets, and carries hashes to the worktree set when files match', () => {
435
- grantAll();
436
- const r = report();
437
- expect(r.sets.map((s) => s.label).sort()).toEqual(['main-repo', 'worktree']);
438
- const wt = r.sets.find((s) => s.label === 'worktree');
439
- expect(wt?.rows).toHaveLength(4);
440
- expect(wt?.rows.every((row) => row.observedFrom === 'carried-over')).toBe(true);
441
- const main = r.sets.find((s) => s.label === 'main-repo');
442
- expect(main?.rows.every((row) => row.observedFrom === 'hooks/list')).toBe(true);
443
- expect(r.ok).toBe(true);
444
- });
445
- /**
446
- * The carry-over is exact ONLY for byte-identical files. When the two diverge, Codex is
447
- * running hooks this worktree never deployed — the runbook's §2b silent failure — and
448
- * the worktree entries become unverifiable rather than being borrowed anyway.
449
- */
450
- it('refuses to carry hashes between files that differ, and says why', () => {
451
- grantAll();
452
- writeFileSync(join(worktree, CODEX_HOOKS_FILENAME), `${readFileSync(join(worktree, CODEX_HOOKS_FILENAME), 'utf-8').replace('GENERATED', 'EDITED')}`);
453
- const r = report();
454
- expect(r.ok).toBe(false);
455
- expect(r.warnings.join(' ')).toContain('#27133');
456
- expect(r.warnings.join(' ')).toContain('DIFFER');
457
- const wt = r.sets.find((s) => s.label === 'worktree');
458
- expect(wt?.rows.every((row) => row.status === 'unverifiable')).toBe(true);
459
- });
460
- it('marks a stale-hash entry and an ungranted entry distinctly', () => {
461
- grantAll();
462
- const mainKeys = keysFor(mainRepo);
463
- // One entry re-granted with a wrong hash, one dropped entirely.
464
- const state = readCodexTrustState(codexHome).records;
465
- const lines = [...state]
466
- .filter(([k]) => k !== mainKeys[1])
467
- .map(([k, v]) => `[hooks.state."${k}"]\nenabled = true\ntrusted_hash = "${k === mainKeys[0] ? HASH('drifted') : v.hash}"\n`);
468
- writeConfig(`[projects."${mainRepo}"]\ntrust_level = "trusted"\n\n` +
469
- `[projects."${worktree}"]\ntrust_level = "trusted"\n\n${lines.join('\n')}`);
470
- const rows = report().sets.find((s) => s.label === 'main-repo')?.rows ?? [];
471
- expect(rows.find((r) => r.key === mainKeys[0])?.status).toBe('stale-hash');
472
- expect(rows.find((r) => r.key === mainKeys[1])?.status).toBe('ungranted');
473
- expect(rows.find((r) => r.key === mainKeys[2])?.status).toBe('granted');
474
- });
475
- /**
476
- * SF-8. The byte-identity sha that licenses the carry-over was read AFTER `hooks/list`
477
- * returned — seconds later, on a machine where another session may be running
478
- * `mx-agent codex deploy-config`. A deploy landing inside that window makes a carried
479
- * hash describe bytes that are no longer on disk, and the row reads `granted`. The
480
- * files are now hashed before AND after the call, and any change refuses the carry-over.
481
- */
482
- it('refuses the carry-over when a hooks file changed during the hooks/list call', () => {
483
- grantAll();
484
- const shaBefore = shaCodexHooksFiles([worktree, mainRepo]);
485
- // The concurrent deploy: same keys, different bytes, landing mid-call.
486
- writeFileSync(join(worktree, CODEX_HOOKS_FILENAME), `${readFileSync(join(worktree, CODEX_HOOKS_FILENAME), 'utf-8')}\n`);
487
- const r = buildTrustKeyReport({
488
- worktreePath: worktree,
489
- mainRepoPath: mainRepo,
490
- codexHome,
491
- hooksList: { ok: true, entries: liveEntries() },
492
- shaBefore,
493
- });
494
- expect(r.ok).toBe(false);
495
- expect(r.warnings.join(' ')).toContain('CHANGED while Codex was being asked for its hashes');
496
- const wt = r.sets.find((s) => s.label === 'worktree');
497
- expect(wt?.rows.every((row) => row.status === 'unverifiable')).toBe(true);
498
- expect(wt?.rows.every((row) => row.observedFrom === null)).toBe(true);
499
- });
500
- it('an unchanged pair carries over exactly as before — the check costs nothing when quiet', () => {
501
- grantAll();
502
- const r = buildTrustKeyReport({
503
- worktreePath: worktree,
504
- mainRepoPath: mainRepo,
505
- codexHome,
506
- hooksList: { ok: true, entries: liveEntries() },
507
- shaBefore: shaCodexHooksFiles([worktree, mainRepo]),
508
- });
509
- expect(r.ok).toBe(true);
510
- expect(r.sets.find((s) => s.label === 'worktree')?.rows.every((row) => row.observedFrom === 'carried-over')).toBe(true);
511
- });
512
- it('shaCodexHooksFiles keys by hooks-file path and reports an absent file as null', () => {
513
- const map = shaCodexHooksFiles([worktree, join(worktree, 'nope')]);
514
- expect(map.get(join(worktree, CODEX_HOOKS_FILENAME))).toMatch(/^[0-9a-f]{64}$/);
515
- expect(map.get(join(worktree, 'nope', CODEX_HOOKS_FILENAME))).toBeNull();
516
- });
517
- it('a failed hooks/list produces an error report, never an empty green one', () => {
518
- const r = buildTrustKeyReport({
519
- worktreePath: worktree,
520
- mainRepoPath: mainRepo,
521
- codexHome,
522
- hooksList: { ok: false, error: 'app-server did not answer' },
523
- });
524
- expect(r.ok).toBe(false);
525
- expect(r.error).toContain('app-server did not answer');
526
- expect(r.sets).toEqual([]);
527
- });
528
- it('warns when a project directory is not trusted — hook trust is moot there', () => {
529
- writeConfig('');
530
- expect(report().warnings.join(' ')).toContain('is not trusted in the Codex config');
531
- });
532
- it('a missing hooks file is reported as an error for that set, not as zero keys granted', () => {
533
- grantAll();
534
- rmSync(join(worktree, CODEX_HOOKS_FILENAME));
535
- const r = report();
536
- expect(r.ok).toBe(false);
537
- expect(r.sets.find((s) => s.label === 'worktree')?.error).toContain('No readable hooks document');
538
- });
539
- });
540
- describe('the pasteable grant block — the double-prefix defect', () => {
541
- /**
542
- * THE DEFECT: `currentHash` already begins with `sha256:`. A record written as
543
- * `sha256:sha256:<hex>` is never matched by Codex, so the hook does not run, while a
544
- * presence-only precondition reports trust satisfied. Guards inert, tooling green.
545
- */
546
- it('reproduces the observed hash VERBATIM and never doubles the prefix', () => {
547
- writeConfig(`[projects."${mainRepo}"]\ntrust_level = "trusted"\n`);
548
- const r = report();
549
- const rows = r.sets.flatMap((s) => s.rows);
550
- const { block } = trustGrantToml(rows);
551
- expect(block).not.toContain('sha256:sha256:');
552
- for (const row of rows) {
553
- if (row.observedHash === null)
554
- continue;
555
- expect(block).toContain(`trusted_hash = "${row.observedHash}"`);
556
- expect(row.observedHash).toMatch(CODEX_HASH_SHAPE);
557
- expect(row.observedHash).toHaveLength(71);
558
- }
559
- });
560
- it('emits a block only for entries that need one, and enables each record', () => {
561
- grantAll();
562
- const rows = report().sets.flatMap((s) => s.rows);
563
- expect(trustGrantToml(rows).block).toBe('');
564
- const stale = [{ ...rows[0], status: 'stale-hash' }];
565
- const { block } = trustGrantToml(stale);
566
- expect(block).toContain('enabled = true');
567
- expect(block.match(/\[hooks\.state\./g)).toHaveLength(1);
568
- });
569
- /**
570
- * SF-6. A hash that FAILED the shape check was still emitted into the pasteable block,
571
- * under a heading that tells the operator to paste it — the one string this command
572
- * exists to prevent them from writing. The renderer's shape warning came afterwards and
573
- * removed nothing. Verbatim reproduction governs what is DISPLAYED; it is not a reason
574
- * to offer a malformed value for pasting.
575
- */
576
- it('a shape-failing hash never reaches the pasteable block, and says why', () => {
577
- grantAll();
578
- const rows = report().sets.flatMap((s) => s.rows);
579
- const malformed = {
580
- ...rows[0],
581
- status: 'ungranted',
582
- observedHash: 'sha256:sha256:deadbeef',
583
- };
584
- const { block, unresolvable } = trustGrantToml([malformed]);
585
- expect(block).toBe('');
586
- expect(block).not.toContain('sha256:sha256:');
587
- expect(unresolvable).toHaveLength(1);
588
- expect(unresolvable[0]?.reason).toMatch(/not the sha256:<64 hex> shape/);
589
- expect(unresolvable[0]?.reason).toMatch(/NOT offered for pasting/);
590
- });
591
- it('a well-shaped hash alongside a malformed one is still offered', () => {
592
- grantAll();
593
- const rows = report().sets.flatMap((s) => s.rows);
594
- const good = { ...rows[0], status: 'stale-hash' };
595
- const bad = {
596
- ...rows[1],
597
- status: 'stale-hash',
598
- observedHash: 'not-a-hash',
599
- };
600
- const { block, unresolvable } = trustGrantToml([good, bad]);
601
- expect(block).toContain(`trusted_hash = "${good.observedHash}"`);
602
- expect(block).not.toContain('not-a-hash');
603
- expect(unresolvable.map((r) => r.key)).toEqual([bad.key]);
604
- });
605
- it('the rendered output shows the malformed row under unresolvable, with its reason', () => {
606
- grantAll();
607
- const rows = report().sets.flatMap((s) => s.rows);
608
- const malformed = {
609
- ...rows[0],
610
- status: 'ungranted',
611
- observedHash: 'sha256:tooshort',
612
- };
613
- const text = renderTrustKeyReport({
614
- ok: false,
615
- sets: [{ label: 'worktree', hooksPath: join(worktree, CODEX_HOOKS_FILENAME), hooksSha256: null, rows: [malformed] }],
616
- warnings: [],
617
- observedHashes: new Map(),
618
- }).join('\n');
619
- expect(text).toContain('NO hash is offered for them');
620
- expect(text).toContain('not the sha256:<64 hex> shape');
621
- expect(text).not.toContain('Paste into ~/.codex/config.toml');
622
- });
623
- it('lists entries with no hash as unresolvable rather than inventing one', () => {
624
- grantAll();
625
- const rows = report().sets.flatMap((s) => s.rows);
626
- const orphan = { ...rows[0], status: 'ungranted', observedHash: null, observedFrom: null };
627
- const { block, unresolvable } = trustGrantToml([orphan]);
628
- expect(block).toBe('');
629
- expect(unresolvable).toHaveLength(1);
630
- });
631
- it('the rendered output tells the operator not to add another prefix, and covers both files', () => {
632
- writeConfig(`[projects."${mainRepo}"]\ntrust_level = "trusted"\n`);
633
- const text = renderTrustKeyReport(report()).join('\n');
634
- expect(text).toContain('Do NOT add another one');
635
- expect(text).not.toContain('sha256:sha256:');
636
- expect(text).toContain(join(mainRepo, CODEX_HOOKS_FILENAME));
637
- expect(text).toContain(join(worktree, CODEX_HOOKS_FILENAME));
638
- expect(text).toContain('UNGRANTED');
639
- expect(text).toContain('one sitting');
640
- });
641
- it('renders the failure reason when hooks/list could not be read', () => {
642
- const text = renderTrustKeyReport({
643
- ok: false,
644
- sets: [],
645
- warnings: [],
646
- error: 'boom',
647
- observedHashes: new Map(),
648
- }).join('\n');
649
- expect(text).toContain("Could not read Codex's own hook hashes: boom");
650
- });
651
- it('observedHashesByKey keys by the entry key, verbatim', () => {
652
- const map = observedHashesByKey(liveEntries());
653
- expect(map.size).toBe(keysFor(mainRepo).length);
654
- for (const [, hash] of map)
655
- expect(hash).toMatch(CODEX_HASH_SHAPE);
656
- });
657
- /**
658
- * MUST FIX 2, layer two (security review, CVSS 8.2, executed). The parser now refuses a
659
- * hostile key from `hooks/list` — but the OTHER vector never passes the parser: a
660
- * `.codex/hooks.json` planted in the repository, whose EVENT NAME carries TOML.
661
- * `codexHookTrustKeysForDoc` derives those keys locally and hands them straight to this
662
- * renderer. The reviewer's payload put `[projects."/workspace"] trust_level = "trusted"`
663
- * and `sandbox_mode = "danger-full-access"` into the block an operator is told to paste:
664
- * a fleet-wide trust grant and a sandbox escape, written by the operator's own hand.
665
- */
666
- it('renders a hostile key as ONE escaped table header — no [projects.] line appears', () => {
667
- const evilEvent = 'pre_tool_use"]\n[projects."/workspace"]\ntrust_level = "trusted"\nsandbox_mode = "danger-full-access"\n#';
668
- const hooksPath = join(worktree, CODEX_HOOKS_FILENAME);
669
- writeFileSync(hooksPath, JSON.stringify({ description: 'x', hooks: { [evilEvent]: [{ hooks: [{ type: 'command', command: '/bin/true' }] }] } }, null, 2));
670
- const keys = codexHookTrustKeysForDoc(hooksPath, readDeployedHooksDoc(worktree));
671
- expect(keys).toHaveLength(1);
672
- const { block } = trustGrantToml([
673
- {
674
- key: keys[0],
675
- status: 'ungranted',
676
- observedHash: HASH('a'),
677
- observedFrom: 'hooks/list',
678
- recordedHash: null,
679
- recordEnabled: false,
680
- codexTrustStatus: null,
681
- detail: '',
682
- },
683
- ]);
684
- // The payload's own text may not appear as TOML structure: no second table header,
685
- // and above all no project-trust or sandbox grant.
686
- expect(block).not.toMatch(/^\[projects\./m);
687
- expect(block).not.toMatch(/^trust_level/m);
688
- expect(block).not.toMatch(/^sandbox_mode/m);
689
- expect(block.match(/^\[hooks\.state\./gm)).toHaveLength(1);
690
- // And it is escaped, not silently dropped — the operator sees the key they have.
691
- expect(block).toContain('\\"');
692
- expect(block).toContain('\\n');
693
- // One header line, one enabled, one hash: the shape a grant block is allowed to have.
694
- expect(block.split('\n').filter((l) => l.startsWith('enabled = '))).toHaveLength(1);
695
- });
696
- });
697
- /**
698
- * SF-E. `result.status !== undefined && result.status !== 0` made a result with NO status
699
- * field the SUCCESS path: the invocation's outcome is unknown and its stdout was read as
700
- * Codex's answer. `null` (killed by a signal) keeps its own branch.
701
- */
702
- describe('hooks/list exec — an absent exit status is not a zero one', () => {
703
- it('refuses when the exec result carries no status field', () => {
704
- const good = JSON.stringify({
705
- id: 2,
706
- result: {
707
- data: [
708
- {
709
- hooks: [
710
- {
711
- key: '/w/.codex/hooks.json:pre_tool_use:0:0',
712
- currentHash: HASH('a'),
713
- sourcePath: '/w/.codex/hooks.json',
714
- },
715
- ],
716
- },
717
- ],
718
- },
719
- });
720
- const result = queryCodexHooksList({ cwd: '/w', exec: () => ({ stdout: good, stderr: '' }) });
721
- expect(result.ok).toBe(false);
722
- expect(result.ok === false && result.error).toMatch(/reported no exit status/);
723
- // And a status of 0 still succeeds, so this is not simply refusing everything.
724
- const okResult = queryCodexHooksList({
725
- cwd: '/w',
726
- exec: () => ({ stdout: good, status: 0, stderr: '' }),
727
- });
728
- expect(okResult.ok).toBe(true);
729
- });
730
- });
731
- //# sourceMappingURL=codex-trust-keys.test.js.map