@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,621 +0,0 @@
1
- import { readFileSync } from 'fs';
2
- import { join } from 'path';
3
- import { describe, it, expect } from 'vitest';
4
- // The extraction stream owns this file. The end-to-end block at the bottom runs
5
- // real tool calls through it, so this test needs that stream's commit as well
6
- // as this one.
7
- import { extract } from './extract.js';
8
- import { attributes, checkRuleset, compileRuleset, NO_DESTRUCTIVE_GIT, RULES_ARE_NOT_SELF_EDITABLE, RulesetRefused, SECTION_5_RULES, STARTER_RULES, SURFACES, TEAMS_STAY_IN_OWN_WORKTREE, TESTER_WORKS_FROM_THE_REQUIREMENT, TESTS_FIRST_UNDER_SCOPED_PATHS, } from './evaluate.js';
9
- const CTX = {
10
- worktreeRoot: '/repo/worktrees/product',
11
- repoRoot: '/repo',
12
- governingRulePaths: ['/repo/.claude/settings.json', '/repo/.claude/hooks/**', '/repo/.claude/rules/**'],
13
- testGuardedPaths: ['/repo/worktrees/product/core-api/src'],
14
- };
15
- const LEAD = {
16
- team: 'product',
17
- role: 'implementation-engineer',
18
- subagentId: null,
19
- sessionId: 's1',
20
- };
21
- const SUBAGENT = { ...LEAD, subagentId: 'sub-7' };
22
- /** A rule that passes every structural check, so a test can break one field at a time. */
23
- function fixture(overrides = {}) {
24
- return {
25
- id: 'fixture',
26
- statement: 'A fixture decides nothing interesting.',
27
- rationale: 'It exists so a test can remove one field and see the refusal.',
28
- surfaces: ['permission-callback'],
29
- mode: 'block',
30
- effect: 'deny',
31
- match: { operations: ['git.reset-hard'] },
32
- records: ['operation', 'decision'],
33
- changeControl: { owner: 'platform', subjectMayPropose: true, subjectMayApply: false },
34
- examples: [{ attrs: attributes({ operation: 'git.reset-hard' }), expect: 'deny' }],
35
- ...overrides,
36
- };
37
- }
38
- function codesFrom(sources, ctx = CTX) {
39
- return checkRuleset(sources, ctx).refusals.map((r) => r.code);
40
- }
41
- // ── The three refusals the task names ────────────────────────────────────────
42
- describe('the compiler refuses a rule bound to a surface that cannot enforce it', () => {
43
- it('refuses the tester rule on the permission callback, which never receives a read', () => {
44
- const outcome = checkRuleset([TESTER_WORKS_FROM_THE_REQUIREMENT], CTX);
45
- const refusal = outcome.refusals.find((r) => r.code === 'unenforceable-surface');
46
- expect(outcome.evaluator).toBeNull();
47
- expect(refusal).toBeDefined();
48
- expect(refusal.ruleId).toBe('tester-works-from-the-requirement');
49
- expect(refusal.detail).toContain('permission-callback observes');
50
- expect(refusal.detail).toContain('report healthy and refuse nothing');
51
- expect(refusal.detail).toContain('POC-1c');
52
- });
53
- it('refuses that rule on every surface the contract defines, not only the callback', () => {
54
- for (const surface of Object.keys(SURFACES)) {
55
- const codes = codesFrom([{ ...TESTER_WORKS_FROM_THE_REQUIREMENT, surfaces: [surface] }]);
56
- expect(codes, `surface ${surface}`).toContain('unenforceable-surface');
57
- }
58
- });
59
- it('refuses rather than warns: no evaluator comes back', () => {
60
- expect(() => compileRuleset([TESTER_WORKS_FROM_THE_REQUIREMENT], CTX)).toThrow(RulesetRefused);
61
- });
62
- it('allows a surface that observes some of the rule\'s operations', () => {
63
- // The pre-tool hook observes a shell write and not a Write tool call, and
64
- // both fold to `write`. Partial coverage enforces something, so it compiles.
65
- expect(codesFrom([TEAMS_STAY_IN_OWN_WORKTREE])).not.toContain('unenforceable-surface');
66
- });
67
- it('refuses a blocking rule whose only observing surfaces are not built', () => {
68
- const codes = codesFrom([fixture({ surfaces: ['integration-lane', 'remote'], match: { operations: ['change'] } })]);
69
- expect(codes).toContain('blocking-on-unavailable-surface');
70
- });
71
- it('refuses a rule that names no surface at all', () => {
72
- expect(codesFrom([fixture({ surfaces: [] })])).toContain('no-surface');
73
- });
74
- });
75
- describe('the compiler refuses two rules on one team claiming the same write scope', () => {
76
- const claimant = (id, team) => fixture({
77
- id,
78
- ...(team ? { principals: { team } } : {}),
79
- match: {
80
- operations: ['write'],
81
- writes: { outside: ['${worktree}'] },
82
- onUncertain: 'escalate',
83
- },
84
- claims: { writeScope: ['${worktree}'] },
85
- examples: [
86
- {
87
- attrs: attributes({ operation: 'write', writes: ['${worktree}/../elsewhere/x.ts'] }),
88
- expect: 'deny',
89
- },
90
- ],
91
- });
92
- it('refuses when both rules bind the same team', () => {
93
- const refusal = checkRuleset([claimant('first', 'product'), claimant('second', 'product')], CTX).refusals.find((r) => r.code === 'duplicate-write-scope');
94
- expect(refusal).toBeDefined();
95
- expect(refusal.detail).toContain('/repo/worktrees/product');
96
- expect(refusal.detail).toContain('declaration order');
97
- });
98
- it('refuses when one rule binds no team, because it applies to every team', () => {
99
- expect(codesFrom([claimant('first'), claimant('second', 'product')])).toContain('duplicate-write-scope');
100
- });
101
- it('allows two rules on different teams to claim the same scope', () => {
102
- expect(codesFrom([claimant('first', 'product'), claimant('second', 'platform')])).not.toContain('duplicate-write-scope');
103
- });
104
- it('allows a narrower scope nested inside a broader one, which is how a rule tightens', () => {
105
- const broad = claimant('broad', 'product');
106
- const narrow = {
107
- ...claimant('narrow', 'product'),
108
- claims: { writeScope: ['${worktree}/src'] },
109
- };
110
- expect(codesFrom([broad, narrow])).not.toContain('duplicate-write-scope');
111
- });
112
- it('refuses a write rule that claims no scope, so the check cannot be evaded by silence', () => {
113
- const silent = { ...claimant('silent', 'product') };
114
- delete silent.claims;
115
- expect(codesFrom([silent])).toContain('missing-write-scope');
116
- });
117
- });
118
- describe('the compiler refuses a rule with no rationale', () => {
119
- it('refuses an absent rationale', () => {
120
- const missing = fixture();
121
- missing.rationale = undefined;
122
- const refusal = checkRuleset([missing], CTX).refusals.find((r) => r.code === 'missing-rationale');
123
- expect(refusal).toBeDefined();
124
- expect(refusal.detail).toContain('challenge');
125
- });
126
- it('refuses whitespace as a rationale', () => {
127
- expect(codesFrom([fixture({ rationale: ' \n ' })])).toContain('missing-rationale');
128
- });
129
- it('refuses rather than warns', () => {
130
- expect(() => compileRuleset([fixture({ rationale: '' })], CTX)).toThrow(RulesetRefused);
131
- });
132
- });
133
- // ── The rest of the refusals ─────────────────────────────────────────────────
134
- describe('the other compiler refusals', () => {
135
- it('reports every refusal at once rather than the first', () => {
136
- const broken = fixture({ id: 'broken', rationale: '', statement: '', surfaces: [] });
137
- const codes = codesFrom([broken]);
138
- expect(codes).toContain('missing-rationale');
139
- expect(codes).toContain('missing-statement');
140
- expect(codes).toContain('no-surface');
141
- });
142
- it('refuses a rule with a path condition and no uncertainty handling', () => {
143
- const unsure = fixture({
144
- match: { operations: ['write'], writes: { outside: ['${worktree}'] } },
145
- claims: { writeScope: ['${worktree}'] },
146
- });
147
- expect(codesFrom([unsure])).toContain('missing-uncertainty-handling');
148
- });
149
- it('refuses a path condition that expands to nothing in this context', () => {
150
- const empty = { ...CTX, testGuardedPaths: [] };
151
- expect(codesFrom([TESTS_FIRST_UNDER_SCOPED_PATHS], empty)).toContain('empty-path-condition');
152
- });
153
- it('refuses an unknown path token', () => {
154
- const bad = fixture({
155
- match: { operations: ['write'], writes: { outside: ['${nowhere}'] }, onUncertain: 'match' },
156
- claims: { writeScope: ['${nowhere}'] },
157
- });
158
- expect(codesFrom([bad])).toContain('bad-path-token');
159
- });
160
- it('refuses two rules that share an id', () => {
161
- expect(codesFrom([fixture(), fixture()])).toContain('duplicate-id');
162
- });
163
- it('refuses a rule with no operations, because the surface check reads them', () => {
164
- expect(codesFrom([fixture({ match: { operations: [] } })])).toContain('no-operations');
165
- });
166
- it('refuses a rule with no owner', () => {
167
- const unowned = fixture();
168
- unowned.changeControl = undefined;
169
- expect(codesFrom([unowned])).toContain('missing-change-control');
170
- });
171
- it('refuses a rule with no examples', () => {
172
- expect(codesFrom([fixture({ examples: [] })])).toContain('no-examples');
173
- });
174
- it('refuses an example that disagrees with the ruleset', () => {
175
- const wrong = fixture({
176
- examples: [{ attrs: attributes({ operation: 'git.reset-hard' }), expect: 'allow' }],
177
- });
178
- const refusal = checkRuleset([wrong], CTX).refusals.find((r) => r.code === 'example-disagrees');
179
- expect(refusal).toBeDefined();
180
- expect(refusal.detail).toContain('returned deny');
181
- });
182
- it('refuses when a new rule breaks an existing rule\'s allow example', () => {
183
- const catchAll = fixture({
184
- id: 'catch-all',
185
- match: { operations: ['write'], writes: { inside: ['${repoRoot}'] }, onUncertain: 'match' },
186
- claims: { writeScope: ['${repoRoot}'] },
187
- examples: [
188
- { attrs: attributes({ operation: 'write', writes: ['${repoRoot}/x.ts'] }), expect: 'deny' },
189
- ],
190
- });
191
- const codes = codesFrom([...STARTER_RULES, catchAll]);
192
- expect(codes).toContain('example-disagrees');
193
- });
194
- it('warns rather than refuses on a role-only binding, with the measurement', () => {
195
- const roleOnly = fixture({ principals: { role: 'qa-tester' } });
196
- const outcome = checkRuleset([roleOnly], CTX);
197
- expect(outcome.refusals).toEqual([]);
198
- expect(outcome.warnings[0].detail).toContain('92%');
199
- });
200
- });
201
- // ── The starter set ──────────────────────────────────────────────────────────
202
- describe('the starter set', () => {
203
- it('compiles, which runs every example in every rule', () => {
204
- const evaluator = compileRuleset(STARTER_RULES, CTX);
205
- expect(evaluator.ruleIds).toEqual([
206
- 'teams-stay-in-own-worktree',
207
- 'no-destructive-git',
208
- 'tests-first-under-scoped-paths',
209
- 'rules-are-not-self-editable',
210
- ]);
211
- });
212
- it('refuses when the fifth rule of section 5 joins it, and refuses only that rule', () => {
213
- const outcome = checkRuleset(SECTION_5_RULES, CTX);
214
- expect(outcome.evaluator).toBeNull();
215
- expect(new Set(outcome.refusals.map((r) => r.ruleId))).toEqual(new Set(['tester-works-from-the-requirement']));
216
- // Two refusals, both true: the callback observes no read, and blocking on a
217
- // surface that cannot observe the rule leaves nothing to run it.
218
- expect(outcome.refusals.map((r) => r.code)).toEqual([
219
- 'blocking-on-unavailable-surface',
220
- 'unenforceable-surface',
221
- ]);
222
- });
223
- it('warns that the tests-first rule has no surface that exists', () => {
224
- const outcome = checkRuleset(STARTER_RULES, CTX);
225
- const warning = outcome.warnings.find((w) => w.ruleId === 'tests-first-under-scoped-paths');
226
- expect(warning.detail).toContain('not built');
227
- });
228
- });
229
- describe('(a) a team writes only inside its own worktree', () => {
230
- const evaluator = compileRuleset(STARTER_RULES, CTX);
231
- it('refuses a write to another team\'s tree and names the rule', () => {
232
- const d = evaluator.evaluate(attributes({ operation: 'write', writes: ['/repo/worktrees/other-team/src/index.ts'] }), LEAD, 'permission-callback');
233
- expect(d.effect).toBe('deny');
234
- expect(d.matchedRules).toEqual(['teams-stay-in-own-worktree']);
235
- expect(d.reason).toContain('teams-stay-in-own-worktree');
236
- expect(d.reason).toContain('/repo/worktrees/other-team/src/index.ts');
237
- });
238
- it('allows a write inside the worktree, with no rule matching', () => {
239
- const d = evaluator.evaluate(attributes({ operation: 'write', writes: ['/repo/worktrees/product/src/index.ts'] }), LEAD, 'permission-callback');
240
- expect(d.effect).toBe('allow');
241
- expect(d.matchedRules).toEqual([]);
242
- });
243
- it('binds the subagent as well as the lead, which is 92% of the measured writes', () => {
244
- const d = evaluator.evaluate(attributes({ operation: 'write', writes: ['/repo/worktrees/other-team/x.ts'] }), SUBAGENT, 'permission-callback');
245
- expect(d.effect).toBe('deny');
246
- });
247
- it('does not treat a sibling with a shared prefix as inside', () => {
248
- const d = evaluator.evaluate(attributes({ operation: 'write', writes: ['/repo/worktrees/product-archive/x.ts'] }), LEAD, 'permission-callback');
249
- expect(d.effect).toBe('deny');
250
- });
251
- it('resolves .. before comparing, so a traversal does not read as inside', () => {
252
- const d = evaluator.evaluate(attributes({ operation: 'write', writes: ['/repo/worktrees/product/../other-team/x.ts'] }), LEAD, 'permission-callback');
253
- expect(d.effect).toBe('deny');
254
- });
255
- it('covers a git command pointed at another tree, which writes that directory', () => {
256
- const d = evaluator.evaluate(attributes({ operation: 'git.commit', writes: ['/repo/worktrees/other-team'] }), LEAD, 'pre-tool-hook');
257
- expect(d.effect).toBe('deny');
258
- });
259
- it('escalates a write whose target the extractor could not resolve', () => {
260
- const d = evaluator.evaluate(attributes({ operation: 'write', uncertain: true, uncertainReason: 'nested substitution' }), LEAD, 'permission-callback');
261
- expect(d.effect).toBe('ask');
262
- expect(d.reason).toContain('nested substitution');
263
- });
264
- it('does not escalate a command the extractor does not model', () => {
265
- // `npm test` folds here. Escalating would prompt on every test run, and the
266
- // rule's rationale states that gap rather than hiding it.
267
- const d = evaluator.evaluate(attributes({ operation: 'unknown', uncertain: true, uncertainReason: 'npm is not modelled' }), LEAD, 'permission-callback');
268
- expect(d.effect).toBe('allow');
269
- expect(d.matchedRules).toEqual([]);
270
- });
271
- });
272
- describe('(b) destructive git operations are refused', () => {
273
- const evaluator = compileRuleset(STARTER_RULES, CTX);
274
- const decide = (operation, surface = 'permission-callback') => evaluator.evaluate(attributes({ operation }), LEAD, surface).effect;
275
- it('refuses the destructive verbs, named as extract.ts emits them', () => {
276
- expect(decide('git.reset-hard')).toBe('deny');
277
- expect(decide('git.reset')).toBe('deny');
278
- expect(decide('git.clean')).toBe('deny');
279
- expect(decide('git.checkout-path')).toBe('deny');
280
- expect(decide('git.restore')).toBe('deny');
281
- expect(decide('git.stash-drop')).toBe('deny');
282
- expect(decide('git.branch-delete')).toBe('deny');
283
- expect(decide('git.filter-branch')).toBe('deny');
284
- expect(decide('git.push-force')).toBe('deny');
285
- });
286
- it('refuses a push that names main, which the extractor resolves', () => {
287
- expect(decide('git.push-main')).toBe('deny');
288
- expect(decide('git.push-force-main')).toBe('deny');
289
- expect(decide('git.push-main', 'remote')).toBe('deny');
290
- });
291
- it('allows the non-destructive variants of the same verbs', () => {
292
- expect(decide('git.reset-soft')).toBe('allow');
293
- expect(decide('git.clean-dry-run')).toBe('allow');
294
- expect(decide('git.checkout-new-branch')).toBe('allow');
295
- expect(decide('git.stash-push')).toBe('allow');
296
- });
297
- it('refuses a bare merge, which passes both string layers today', () => {
298
- expect(decide('git.merge')).toBe('deny');
299
- expect(decide('git.merge', 'pre-tool-hook')).toBe('deny');
300
- });
301
- it('allows the git operations that discard nothing', () => {
302
- expect(decide('git.status')).toBe('allow');
303
- expect(decide('git.rebase')).toBe('allow');
304
- expect(decide('git.push')).toBe('allow');
305
- expect(decide('git.commit')).toBe('allow');
306
- });
307
- });
308
- describe('(d) tests first, in observe mode', () => {
309
- const evaluator = compileRuleset(STARTER_RULES, CTX);
310
- it('reports what it would have caught and enforces nothing', () => {
311
- const d = evaluator.evaluate(attributes({ operation: 'change', writes: ['/repo/worktrees/product/core-api/src/billing.ts'] }), LEAD, 'integration-lane');
312
- expect(d.effect).toBe('allow');
313
- expect(d.observedOnly).toBe(true);
314
- expect(d.matchedRules).toEqual(['tests-first-under-scoped-paths']);
315
- expect(d.reason).toContain('would have escalated');
316
- expect(d.reason).toContain('enforced nothing');
317
- });
318
- it('does not match a change outside the assigned paths', () => {
319
- const d = evaluator.evaluate(attributes({ operation: 'change', writes: ['/repo/docs/notes.md'] }), LEAD, 'integration-lane');
320
- expect(d.effect).toBe('allow');
321
- expect(d.matchedRules).toEqual([]);
322
- expect(d.observedOnly).toBeUndefined();
323
- });
324
- });
325
- describe('(e) an agent does not edit the rules that bind it', () => {
326
- const evaluator = compileRuleset(STARTER_RULES, CTX);
327
- it('refuses every operation that resolves a write to a governing path', () => {
328
- // Write, Edit, MultiEdit, NotebookEdit and `sed -i` all fold to `write`,
329
- // which is how one decision closes the Write hole in today's deny list.
330
- for (const operation of ['write', 'chmod', 'git.commit']) {
331
- const d = evaluator.evaluate(attributes({ operation, writes: ['/repo/.claude/settings.json'] }), LEAD, 'permission-callback');
332
- expect(d.effect, operation).toBe('deny');
333
- expect(d.matchedRules, operation).toContain('rules-are-not-self-editable');
334
- }
335
- });
336
- it('refuses a shell write to a hook, matched by glob', () => {
337
- const d = evaluator.evaluate(attributes({ operation: 'write', writes: ['/repo/.claude/hooks/worktree-guard.sh'] }), LEAD, 'pre-tool-hook');
338
- expect(d.effect).toBe('deny');
339
- expect(d.matchedRules).toContain('rules-are-not-self-editable');
340
- });
341
- it('allows a proposal written inside the team\'s own tree', () => {
342
- const d = evaluator.evaluate(attributes({ operation: 'write', writes: ['/repo/worktrees/product/docs/proposed-rule-change.md'] }), LEAD, 'permission-callback');
343
- expect(d.effect).toBe('allow');
344
- });
345
- it('records that the subject may propose a change and may not apply one', () => {
346
- expect(evaluator.changeControlFor('rules-are-not-self-editable')).toEqual({
347
- owner: 'platform',
348
- subjectMayPropose: true,
349
- subjectMayApply: false,
350
- });
351
- });
352
- });
353
- // ── Observe mode and the meaning of observedOnly ─────────────────────────────
354
- describe('observedOnly means a rule matched in observe mode and did not enforce', () => {
355
- const observed = fixture({
356
- id: 'observed',
357
- mode: 'observe',
358
- match: { operations: ['git.reset-hard'] },
359
- examples: [{ attrs: attributes({ operation: 'git.reset-hard' }), expect: 'allow', expectObservedOnly: true }],
360
- });
361
- const blocking = fixture({
362
- id: 'blocking',
363
- mode: 'block',
364
- match: { operations: ['git.reset-hard'] },
365
- });
366
- it('is true when every matching rule observes', () => {
367
- const d = compileRuleset([observed], CTX).evaluate(attributes({ operation: 'git.reset-hard' }), LEAD, 'permission-callback');
368
- expect(d.effect).toBe('allow');
369
- expect(d.observedOnly).toBe(true);
370
- expect(d.matchedRules).toEqual(['observed']);
371
- });
372
- it('is unset when a blocking rule enforced, even if an observe rule also matched', () => {
373
- // The observe rule states deny here because examples test the ruleset the
374
- // rule ships in, and in this ruleset the blocking rule decides the call.
375
- const observedAlongside = fixture({
376
- id: 'observed',
377
- mode: 'observe',
378
- match: { operations: ['git.reset-hard'] },
379
- examples: [{ attrs: attributes({ operation: 'git.reset-hard' }), expect: 'deny' }],
380
- });
381
- const d = compileRuleset([observedAlongside, blocking], CTX).evaluate(attributes({ operation: 'git.reset-hard' }), LEAD, 'permission-callback');
382
- expect(d.effect).toBe('deny');
383
- expect(d.observedOnly).toBeUndefined();
384
- expect(d.matchedRules).toEqual(['blocking']);
385
- expect(d.reason).toContain('observed also matched in observe mode and enforced nothing');
386
- });
387
- it('is unset when no rule matched, which is not the same as a rule allowing', () => {
388
- const d = compileRuleset([observed], CTX).evaluate(attributes({ operation: 'git.status' }), LEAD, 'permission-callback');
389
- expect(d.observedOnly).toBeUndefined();
390
- expect(d.matchedRules).toEqual([]);
391
- });
392
- it('reports the effect the rule would have produced', () => {
393
- const wouldDeny = compileRuleset([observed], CTX).evaluate(attributes({ operation: 'git.reset-hard' }), LEAD, 'permission-callback');
394
- expect(wouldDeny.reason).toContain('would have refused');
395
- });
396
- });
397
- // ── Precedence, scoping and uncertainty ──────────────────────────────────────
398
- describe('precedence and scoping', () => {
399
- it('lets the most restrictive blocking effect win, so a narrow allow opens no hole', () => {
400
- const deny = fixture({ id: 'wide-deny', effect: 'deny' });
401
- const allow = fixture({
402
- id: 'narrow-allow',
403
- effect: 'allow',
404
- principals: { team: 'product', role: 'implementation-engineer' },
405
- examples: [{ attrs: attributes({ operation: 'git.reset-hard' }), expect: 'deny' }],
406
- });
407
- const d = compileRuleset([deny, allow], CTX).evaluate(attributes({ operation: 'git.reset-hard' }), LEAD, 'permission-callback');
408
- expect(d.effect).toBe('deny');
409
- });
410
- it('reports the most specific matching rule first', () => {
411
- const wide = fixture({ id: 'wide' });
412
- const narrow = fixture({ id: 'narrow', principals: { team: 'product', role: 'implementation-engineer' } });
413
- const d = compileRuleset([wide, narrow], CTX).evaluate(attributes({ operation: 'git.reset-hard' }), LEAD, 'permission-callback');
414
- expect(d.matchedRules).toEqual(['narrow', 'wide']);
415
- });
416
- it('skips a rule the principal does not match', () => {
417
- const other = fixture({ id: 'platform-only', principals: { team: 'platform' } });
418
- const d = compileRuleset([other], CTX).evaluate(attributes({ operation: 'git.reset-hard' }), LEAD, 'permission-callback');
419
- expect(d.effect).toBe('allow');
420
- expect(d.matchedRules).toEqual([]);
421
- });
422
- it('skips a rule not bound to the surface asking', () => {
423
- const d = compileRuleset(STARTER_RULES, CTX).evaluate(attributes({ operation: 'git.reset-hard' }), LEAD, 'integration-lane');
424
- expect(d.effect).toBe('allow');
425
- });
426
- });
427
- describe('uncertainty never reads as safety', () => {
428
- const build = (onUncertain) => compileRuleset([
429
- fixture({
430
- id: `on-${onUncertain}`,
431
- match: { operations: ['unknown'], writes: { outside: ['${worktree}'] }, onUncertain },
432
- claims: { writeScope: ['${worktree}'] },
433
- examples: [
434
- {
435
- attrs: attributes({ operation: 'unknown', writes: ['${worktree}/../x'] }),
436
- expect: 'deny',
437
- },
438
- ],
439
- }),
440
- ], CTX);
441
- const unsure = attributes({ operation: 'unknown', uncertain: true, uncertainReason: 'eval in the argument' });
442
- it('escalate turns an unresolved target into ask', () => {
443
- expect(build('escalate').evaluate(unsure, LEAD, 'permission-callback').effect).toBe('ask');
444
- });
445
- it('match applies the rule\'s own effect to an unresolved target', () => {
446
- expect(build('match').evaluate(unsure, LEAD, 'permission-callback').effect).toBe('deny');
447
- });
448
- it('skip is available and states the choice, rather than leaving it implied', () => {
449
- const d = build('skip').evaluate(unsure, LEAD, 'permission-callback');
450
- expect(d.effect).toBe('allow');
451
- expect(d.matchedRules).toEqual([]);
452
- });
453
- it('does not read an empty writes array as touching nothing when uncertain', () => {
454
- // A Write tool call with no file path. #5434 is what an empty array reading
455
- // as "touches nothing" costs.
456
- const d = compileRuleset(STARTER_RULES, CTX).evaluate(attributes({ operation: 'write', writes: [], uncertain: true }), LEAD, 'permission-callback');
457
- expect(d.effect).toBe('ask');
458
- });
459
- });
460
- // ── Coverage reporting ───────────────────────────────────────────────────────
461
- describe('unenforceableOn reports what a surface is not enforcing', () => {
462
- const evaluator = compileRuleset(STARTER_RULES, CTX);
463
- it('names the rules the permission callback does not run', () => {
464
- const ids = evaluator.unenforceableOn('permission-callback').map((r) => r.id);
465
- expect(ids).toEqual(['tests-first-under-scoped-paths']);
466
- });
467
- it('names the rules the integration lane does not run', () => {
468
- const ids = evaluator.unenforceableOn('integration-lane').map((r) => r.id);
469
- expect(ids).toEqual([
470
- 'teams-stay-in-own-worktree',
471
- 'no-destructive-git',
472
- 'rules-are-not-self-editable',
473
- ]);
474
- });
475
- it('is empty of nothing: every compiled rule has at least one surface that runs it', () => {
476
- const everywhere = Object.keys(SURFACES).flatMap((s) => evaluator.ruleIds.filter((id) => !evaluator.unenforceableOn(s).some((r) => r.id === id)));
477
- expect(new Set(everywhere).size).toBe(evaluator.ruleIds.length);
478
- });
479
- it('reports the write scopes each rule claims', () => {
480
- expect(evaluator.claimedWriteScopes()).toEqual([
481
- // The scratch roots are part of the scope this rule claims: an agent
482
- // writing to its own scratchpad has not left its scope, and refusing that
483
- // was 10 of the 600 ordinary commands the first version of the rule
484
- // refused (docs/gate-coverage.md section 4).
485
- { ruleId: 'teams-stay-in-own-worktree', scope: ['/repo/worktrees/product', '/tmp', '/var/tmp'] },
486
- { ruleId: 'tests-first-under-scoped-paths', scope: ['/repo/worktrees/product/core-api/src'] },
487
- {
488
- ruleId: 'rules-are-not-self-editable',
489
- scope: ['/repo/.claude/settings.json', '/repo/.claude/hooks/**', '/repo/.claude/rules/**'],
490
- },
491
- ]);
492
- });
493
- });
494
- // ── The evaluator owns policy and nothing else ───────────────────────────────
495
- describe('the evaluator never parses a command string', () => {
496
- const SOURCE = readFileSync(join(__dirname, 'evaluate.ts'), 'utf-8');
497
- const CODE = SOURCE.split('\n')
498
- .filter((line) => !/^\s*(\/\/|\/\*|\*)/.test(line))
499
- .join('\n');
500
- it('reads no command field anywhere in its executable lines', () => {
501
- expect(CODE).not.toMatch(/\.command\b/);
502
- });
503
- it('decides on the operation even when the command text looks destructive', () => {
504
- const evaluator = compileRuleset(STARTER_RULES, CTX);
505
- const d = evaluator.evaluate({ operation: 'read', writes: [], reads: ['/repo/README.md'], uncertain: false, command: 'git reset --hard' }, LEAD, 'permission-callback');
506
- expect(d.effect).toBe('allow');
507
- expect(d.matchedRules).toEqual([]);
508
- });
509
- it('refuses on the operation even when the command text looks harmless', () => {
510
- const evaluator = compileRuleset(STARTER_RULES, CTX);
511
- const d = evaluator.evaluate({ operation: 'git.reset-hard', writes: [], reads: [], uncertain: false, command: 'git status' }, LEAD, 'permission-callback');
512
- expect(d.effect).toBe('deny');
513
- });
514
- });
515
- describe('the surface table states its basis', () => {
516
- it('gives every surface a measured or configured basis', () => {
517
- for (const [name, capability] of Object.entries(SURFACES)) {
518
- expect(capability.basis.length, name).toBeGreaterThan(20);
519
- expect(capability.observes.length, name).toBeGreaterThan(0);
520
- }
521
- });
522
- it('records that the permission callback does not observe a read', () => {
523
- expect(SURFACES['permission-callback'].observes).not.toContain('read');
524
- expect(SURFACES['permission-callback'].basis).toContain('Grep was not measured');
525
- expect(SURFACES['permission-callback'].basis).toContain('partial observation');
526
- });
527
- it('records that a hook observes the shell half of a write and not the tool half', () => {
528
- expect(SURFACES['pre-tool-hook'].observes).toContain('write');
529
- expect(SURFACES['pre-tool-hook'].basis).toContain('reaches no hook');
530
- expect(SURFACES['pre-tool-hook'].observes).not.toContain('read');
531
- });
532
- });
533
- // ── The two halves together ──────────────────────────────────────────────────
534
- /**
535
- * The starter rules name operations `extract.ts` produces. Asserting that by
536
- * reading the extractor's source would prove nothing, so these run real tool
537
- * calls through the real extractor and decide the attributes it returns. A rule
538
- * naming an operation nothing emits fails here.
539
- */
540
- describe('the starter rules decide real tool calls, through the real extractor', () => {
541
- const evaluator = compileRuleset(STARTER_RULES, CTX);
542
- const world = { cwd: '/repo/worktrees/product', worktreeRoot: '/repo/worktrees/product' };
543
- const decide = (call, surface = 'permission-callback') => evaluator.evaluate(extract(call, world), LEAD, surface);
544
- const bash = (command) => ({ name: 'Bash', input: { command } });
545
- it('refuses the destructive git commands', () => {
546
- expect(decide(bash('git reset --hard HEAD~1')).effect).toBe('deny');
547
- expect(decide(bash('git clean -fdx .')).effect).toBe('deny');
548
- expect(decide(bash('git push --force origin main')).effect).toBe('deny');
549
- expect(decide(bash('git checkout -- src/index.ts')).effect).toBe('deny');
550
- });
551
- it('refuses a bare git merge, which passes both string layers today', () => {
552
- const d = decide(bash('git merge'));
553
- expect(d.effect).toBe('deny');
554
- expect(d.matchedRules).toContain('no-destructive-git');
555
- });
556
- it('allows the git commands that discard nothing', () => {
557
- expect(decide(bash('git status')).effect).toBe('allow');
558
- expect(decide(bash('git rebase origin/main')).effect).toBe('allow');
559
- expect(decide(bash('git push origin product/feature')).effect).toBe('allow');
560
- expect(decide(bash('git commit -m "work"')).effect).toBe('allow');
561
- });
562
- it('refuses a write outside the worktree, whichever tool performs it', () => {
563
- expect(decide(bash('echo x > ../other-team/notes.md')).effect).toBe('deny');
564
- expect(decide(bash('git -C ../other-team commit -m x')).effect).toBe('deny');
565
- expect(decide({ name: 'Write', input: { file_path: '/repo/worktrees/other-team/src/index.ts' } }).effect).toBe('deny');
566
- });
567
- it('refuses a write to the rules, through Write and through sed', () => {
568
- const viaTool = decide({ name: 'Write', input: { file_path: '/repo/.claude/settings.json' } });
569
- expect(viaTool.effect).toBe('deny');
570
- expect(viaTool.matchedRules).toContain('rules-are-not-self-editable');
571
- const viaSed = decide(bash("sed -i 's/deny/allow/' /repo/.claude/settings.json"));
572
- expect(viaSed.effect).toBe('deny');
573
- expect(viaSed.matchedRules).toContain('rules-are-not-self-editable');
574
- });
575
- it('allows ordinary work inside the worktree', () => {
576
- expect(decide({ name: 'Write', input: { file_path: 'src/index.ts' } }).effect).toBe('allow');
577
- expect(decide(bash('cd ./src && npm test')).effect).toBe('allow');
578
- expect(decide(bash('git status && echo done > notes.txt')).effect).toBe('allow');
579
- });
580
- it('escalates a write whose target the extractor could not resolve', () => {
581
- expect(decide(bash('echo hi > $(pick)')).effect).toBe('ask');
582
- expect(decide(bash('sed -i s/a/b/ $TARGET')).effect).toBe('ask');
583
- // The dangerous form of the unmodelled case: the working directory is lost
584
- // and the command writes, so it folds to write and escalates.
585
- expect(decide(bash('cd $X && rm -rf build')).effect).toBe('ask');
586
- expect(decide({ name: 'Write', input: {} }).effect).toBe('ask');
587
- });
588
- it('leaves an unmodelled command alone, which is the stated gap', () => {
589
- // `npm test` and `eval` fold to unknown, and no starter rule lists it. The
590
- // alternative is a prompt on every test run.
591
- expect(decide(bash('npm test')).effect).toBe('allow');
592
- expect(decide(bash('pytest -q')).effect).toBe('allow');
593
- expect(decide(bash('eval "$CMD"')).effect).toBe('allow');
594
- });
595
- it('allows a read, because no read rule ships and no surface could run one', () => {
596
- expect(decide({ name: 'Read', input: { file_path: 'src/billing.ts' } }).effect).toBe('allow');
597
- });
598
- it('does not escalate a delegation, which the extractor marks uncertain', () => {
599
- // `tool.Task` is uncertain and has no write target. Listing it in a
600
- // write rule would escalate every delegation the fleet makes.
601
- const d = decide({ name: 'Task', input: { prompt: 'go' } });
602
- expect(d.effect).toBe('allow');
603
- expect(d.matchedRules).toEqual([]);
604
- });
605
- });
606
- describe('the rules state the fields the format argued for', () => {
607
- it('every starter rule names its surfaces, its owner and its rationale', () => {
608
- for (const rule of [...STARTER_RULES, ...SECTION_5_RULES]) {
609
- expect(rule.surfaces.length, rule.id).toBeGreaterThan(0);
610
- expect(rule.changeControl.owner, rule.id).not.toBe('');
611
- expect(rule.rationale.length, rule.id).toBeGreaterThan(40);
612
- expect(rule.records.length, rule.id).toBeGreaterThan(0);
613
- }
614
- });
615
- it('the mutating rules bind every principal rather than one role', () => {
616
- for (const rule of [TEAMS_STAY_IN_OWN_WORKTREE, NO_DESTRUCTIVE_GIT, RULES_ARE_NOT_SELF_EDITABLE]) {
617
- expect(rule.principals, rule.id).toBeUndefined();
618
- }
619
- });
620
- });
621
- //# sourceMappingURL=evaluate.test.js.map