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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (797) hide show
  1. package/dist/agent-config/hooks/gh-pr-edit-guard.sh +21 -9
  2. package/dist/agent-config/settings.json +7 -1
  3. package/dist/commands/check.d.ts +20 -0
  4. package/dist/commands/check.d.ts.map +1 -0
  5. package/dist/commands/check.js +30 -0
  6. package/dist/commands/check.js.map +1 -0
  7. package/dist/commands/create.d.ts +36 -0
  8. package/dist/commands/create.d.ts.map +1 -1
  9. package/dist/commands/create.js +85 -8
  10. package/dist/commands/create.js.map +1 -1
  11. package/dist/commands/gh.d.ts +38 -0
  12. package/dist/commands/gh.d.ts.map +1 -0
  13. package/dist/commands/gh.js +162 -0
  14. package/dist/commands/gh.js.map +1 -0
  15. package/dist/commands/git-credential.d.ts +22 -0
  16. package/dist/commands/git-credential.d.ts.map +1 -0
  17. package/dist/commands/git-credential.js +53 -0
  18. package/dist/commands/git-credential.js.map +1 -0
  19. package/dist/commands/new.d.ts +24 -0
  20. package/dist/commands/new.d.ts.map +1 -1
  21. package/dist/commands/new.js +56 -5
  22. package/dist/commands/new.js.map +1 -1
  23. package/dist/commands/pr-set-body.d.ts +120 -35
  24. package/dist/commands/pr-set-body.d.ts.map +1 -1
  25. package/dist/commands/pr-set-body.js +343 -108
  26. package/dist/commands/pr-set-body.js.map +1 -1
  27. package/dist/commands/pr-sync.d.ts +2 -1
  28. package/dist/commands/pr-sync.d.ts.map +1 -1
  29. package/dist/commands/pr-sync.js +129 -32
  30. package/dist/commands/pr-sync.js.map +1 -1
  31. package/dist/index.d.ts +3 -0
  32. package/dist/index.d.ts.map +1 -1
  33. package/dist/index.js +82 -2
  34. package/dist/index.js.map +1 -1
  35. package/dist/lib/check-run.d.ts +131 -0
  36. package/dist/lib/check-run.d.ts.map +1 -0
  37. package/dist/lib/check-run.js +291 -0
  38. package/dist/lib/check-run.js.map +1 -0
  39. package/dist/lib/coordination-token.d.ts +33 -1
  40. package/dist/lib/coordination-token.d.ts.map +1 -1
  41. package/dist/lib/coordination-token.js +138 -9
  42. package/dist/lib/coordination-token.js.map +1 -1
  43. package/dist/lib/gh-remote.d.ts +20 -0
  44. package/dist/lib/gh-remote.d.ts.map +1 -1
  45. package/dist/lib/gh-remote.js +26 -0
  46. package/dist/lib/gh-remote.js.map +1 -1
  47. package/dist/lib/gh-token-run.d.ts +551 -0
  48. package/dist/lib/gh-token-run.d.ts.map +1 -0
  49. package/dist/lib/gh-token-run.js +1246 -0
  50. package/dist/lib/gh-token-run.js.map +1 -0
  51. package/dist/lib/git-credential.d.ts +120 -0
  52. package/dist/lib/git-credential.d.ts.map +1 -0
  53. package/dist/lib/git-credential.js +204 -0
  54. package/dist/lib/git-credential.js.map +1 -0
  55. package/dist/lib/github-app-token.d.ts +288 -0
  56. package/dist/lib/github-app-token.d.ts.map +1 -0
  57. package/dist/lib/github-app-token.js +519 -0
  58. package/dist/lib/github-app-token.js.map +1 -0
  59. package/dist/lib/memory.d.ts.map +1 -1
  60. package/dist/lib/memory.js +35 -2
  61. package/dist/lib/memory.js.map +1 -1
  62. package/dist/lib/repo-guard-state-dirs.d.ts +39 -0
  63. package/dist/lib/repo-guard-state-dirs.d.ts.map +1 -0
  64. package/dist/lib/repo-guard-state-dirs.js +170 -0
  65. package/dist/lib/repo-guard-state-dirs.js.map +1 -0
  66. package/dist/standards/decision-request.md +6 -57
  67. package/dist/standards/po-communication-standard.md +0 -34
  68. package/dist/standards/report-format.md +0 -90
  69. package/dist/standards/writing-standard.md +0 -312
  70. package/package.json +3 -1
  71. package/dist/__tests__/agent-attribution.test.d.ts +0 -16
  72. package/dist/__tests__/agent-attribution.test.d.ts.map +0 -1
  73. package/dist/__tests__/agent-attribution.test.js +0 -250
  74. package/dist/__tests__/agent-attribution.test.js.map +0 -1
  75. package/dist/__tests__/agents-md-canonicalization.test.d.ts +0 -23
  76. package/dist/__tests__/agents-md-canonicalization.test.d.ts.map +0 -1
  77. package/dist/__tests__/agents-md-canonicalization.test.js +0 -319
  78. package/dist/__tests__/agents-md-canonicalization.test.js.map +0 -1
  79. package/dist/__tests__/behavioral-compliance.test.d.ts +0 -8
  80. package/dist/__tests__/behavioral-compliance.test.d.ts.map +0 -1
  81. package/dist/__tests__/behavioral-compliance.test.js +0 -226
  82. package/dist/__tests__/behavioral-compliance.test.js.map +0 -1
  83. package/dist/__tests__/behavioral-extraction.test.d.ts +0 -12
  84. package/dist/__tests__/behavioral-extraction.test.d.ts.map +0 -1
  85. package/dist/__tests__/behavioral-extraction.test.js +0 -330
  86. package/dist/__tests__/behavioral-extraction.test.js.map +0 -1
  87. package/dist/__tests__/behavioral-git-read.test.d.ts +0 -21
  88. package/dist/__tests__/behavioral-git-read.test.d.ts.map +0 -1
  89. package/dist/__tests__/behavioral-git-read.test.js +0 -955
  90. package/dist/__tests__/behavioral-git-read.test.js.map +0 -1
  91. package/dist/__tests__/behavioral-injection.test.d.ts +0 -13
  92. package/dist/__tests__/behavioral-injection.test.d.ts.map +0 -1
  93. package/dist/__tests__/behavioral-injection.test.js +0 -384
  94. package/dist/__tests__/behavioral-injection.test.js.map +0 -1
  95. package/dist/__tests__/binary-smoke.test.d.ts +0 -12
  96. package/dist/__tests__/binary-smoke.test.d.ts.map +0 -1
  97. package/dist/__tests__/binary-smoke.test.js +0 -88
  98. package/dist/__tests__/binary-smoke.test.js.map +0 -1
  99. package/dist/__tests__/bootstrap-behavioral-contract.test.d.ts +0 -18
  100. package/dist/__tests__/bootstrap-behavioral-contract.test.d.ts.map +0 -1
  101. package/dist/__tests__/bootstrap-behavioral-contract.test.js +0 -104
  102. package/dist/__tests__/bootstrap-behavioral-contract.test.js.map +0 -1
  103. package/dist/__tests__/bundle-config.test.d.ts +0 -18
  104. package/dist/__tests__/bundle-config.test.d.ts.map +0 -1
  105. package/dist/__tests__/bundle-config.test.js +0 -123
  106. package/dist/__tests__/bundle-config.test.js.map +0 -1
  107. package/dist/__tests__/catalog-interaction.test.d.ts +0 -25
  108. package/dist/__tests__/catalog-interaction.test.d.ts.map +0 -1
  109. package/dist/__tests__/catalog-interaction.test.js +0 -269
  110. package/dist/__tests__/catalog-interaction.test.js.map +0 -1
  111. package/dist/__tests__/catalog-named-memories.test.d.ts +0 -2
  112. package/dist/__tests__/catalog-named-memories.test.d.ts.map +0 -1
  113. package/dist/__tests__/catalog-named-memories.test.js +0 -204
  114. package/dist/__tests__/catalog-named-memories.test.js.map +0 -1
  115. package/dist/__tests__/catalog-origin-main.test.d.ts +0 -15
  116. package/dist/__tests__/catalog-origin-main.test.d.ts.map +0 -1
  117. package/dist/__tests__/catalog-origin-main.test.js +0 -305
  118. package/dist/__tests__/catalog-origin-main.test.js.map +0 -1
  119. package/dist/__tests__/catalog.test.d.ts +0 -2
  120. package/dist/__tests__/catalog.test.d.ts.map +0 -1
  121. package/dist/__tests__/catalog.test.js +0 -131
  122. package/dist/__tests__/catalog.test.js.map +0 -1
  123. package/dist/__tests__/claude-local-sanitizer.test.d.ts +0 -24
  124. package/dist/__tests__/claude-local-sanitizer.test.d.ts.map +0 -1
  125. package/dist/__tests__/claude-local-sanitizer.test.js +0 -906
  126. package/dist/__tests__/claude-local-sanitizer.test.js.map +0 -1
  127. package/dist/__tests__/claude-md-compose.test.d.ts +0 -17
  128. package/dist/__tests__/claude-md-compose.test.d.ts.map +0 -1
  129. package/dist/__tests__/claude-md-compose.test.js +0 -119
  130. package/dist/__tests__/claude-md-compose.test.js.map +0 -1
  131. package/dist/__tests__/claude-sync.test.d.ts +0 -2
  132. package/dist/__tests__/claude-sync.test.d.ts.map +0 -1
  133. package/dist/__tests__/claude-sync.test.js +0 -571
  134. package/dist/__tests__/claude-sync.test.js.map +0 -1
  135. package/dist/__tests__/cli-build-integration.test.d.ts +0 -2
  136. package/dist/__tests__/cli-build-integration.test.d.ts.map +0 -1
  137. package/dist/__tests__/cli-build-integration.test.js +0 -64
  138. package/dist/__tests__/cli-build-integration.test.js.map +0 -1
  139. package/dist/__tests__/cli-build.test.d.ts +0 -2
  140. package/dist/__tests__/cli-build.test.d.ts.map +0 -1
  141. package/dist/__tests__/cli-build.test.js +0 -640
  142. package/dist/__tests__/cli-build.test.js.map +0 -1
  143. package/dist/__tests__/codex-agent-gate.test.d.ts +0 -2
  144. package/dist/__tests__/codex-agent-gate.test.d.ts.map +0 -1
  145. package/dist/__tests__/codex-agent-gate.test.js +0 -480
  146. package/dist/__tests__/codex-agent-gate.test.js.map +0 -1
  147. package/dist/__tests__/codex-deploy-config.test.d.ts +0 -2
  148. package/dist/__tests__/codex-deploy-config.test.d.ts.map +0 -1
  149. package/dist/__tests__/codex-deploy-config.test.js +0 -1230
  150. package/dist/__tests__/codex-deploy-config.test.js.map +0 -1
  151. package/dist/__tests__/codex-trust-keys.test.d.ts +0 -2
  152. package/dist/__tests__/codex-trust-keys.test.d.ts.map +0 -1
  153. package/dist/__tests__/codex-trust-keys.test.js +0 -731
  154. package/dist/__tests__/codex-trust-keys.test.js.map +0 -1
  155. package/dist/__tests__/codex-write-race.test.d.ts +0 -2
  156. package/dist/__tests__/codex-write-race.test.d.ts.map +0 -1
  157. package/dist/__tests__/codex-write-race.test.js +0 -2253
  158. package/dist/__tests__/codex-write-race.test.js.map +0 -1
  159. package/dist/__tests__/completion-rows-discriminate.test.d.ts +0 -20
  160. package/dist/__tests__/completion-rows-discriminate.test.d.ts.map +0 -1
  161. package/dist/__tests__/completion-rows-discriminate.test.js +0 -481
  162. package/dist/__tests__/completion-rows-discriminate.test.js.map +0 -1
  163. package/dist/__tests__/config-command.test.d.ts +0 -9
  164. package/dist/__tests__/config-command.test.d.ts.map +0 -1
  165. package/dist/__tests__/config-command.test.js +0 -75
  166. package/dist/__tests__/config-command.test.js.map +0 -1
  167. package/dist/__tests__/config-fidelity-archived-symlinks.test.d.ts +0 -2
  168. package/dist/__tests__/config-fidelity-archived-symlinks.test.d.ts.map +0 -1
  169. package/dist/__tests__/config-fidelity-archived-symlinks.test.js +0 -127
  170. package/dist/__tests__/config-fidelity-archived-symlinks.test.js.map +0 -1
  171. package/dist/__tests__/config-fidelity-display.test.d.ts +0 -2
  172. package/dist/__tests__/config-fidelity-display.test.d.ts.map +0 -1
  173. package/dist/__tests__/config-fidelity-display.test.js +0 -77
  174. package/dist/__tests__/config-fidelity-display.test.js.map +0 -1
  175. package/dist/__tests__/config-fidelity-unreadable-fixture.d.ts +0 -32
  176. package/dist/__tests__/config-fidelity-unreadable-fixture.d.ts.map +0 -1
  177. package/dist/__tests__/config-fidelity-unreadable-fixture.js +0 -37
  178. package/dist/__tests__/config-fidelity-unreadable-fixture.js.map +0 -1
  179. package/dist/__tests__/config-fidelity.test.d.ts +0 -16
  180. package/dist/__tests__/config-fidelity.test.d.ts.map +0 -1
  181. package/dist/__tests__/config-fidelity.test.js +0 -2679
  182. package/dist/__tests__/config-fidelity.test.js.map +0 -1
  183. package/dist/__tests__/config-generation-gate.test.d.ts +0 -46
  184. package/dist/__tests__/config-generation-gate.test.d.ts.map +0 -1
  185. package/dist/__tests__/config-generation-gate.test.js +0 -435
  186. package/dist/__tests__/config-generation-gate.test.js.map +0 -1
  187. package/dist/__tests__/config-generation.test.d.ts +0 -7
  188. package/dist/__tests__/config-generation.test.d.ts.map +0 -1
  189. package/dist/__tests__/config-generation.test.js +0 -141
  190. package/dist/__tests__/config-generation.test.js.map +0 -1
  191. package/dist/__tests__/config-sync.test.d.ts +0 -10
  192. package/dist/__tests__/config-sync.test.d.ts.map +0 -1
  193. package/dist/__tests__/config-sync.test.js +0 -268
  194. package/dist/__tests__/config-sync.test.js.map +0 -1
  195. package/dist/__tests__/coordination-401-production-wiring.test.d.ts +0 -19
  196. package/dist/__tests__/coordination-401-production-wiring.test.d.ts.map +0 -1
  197. package/dist/__tests__/coordination-401-production-wiring.test.js +0 -286
  198. package/dist/__tests__/coordination-401-production-wiring.test.js.map +0 -1
  199. package/dist/__tests__/coordination-401-recovery.test.d.ts +0 -22
  200. package/dist/__tests__/coordination-401-recovery.test.d.ts.map +0 -1
  201. package/dist/__tests__/coordination-401-recovery.test.js +0 -601
  202. package/dist/__tests__/coordination-401-recovery.test.js.map +0 -1
  203. package/dist/__tests__/coordination-brief-pin.test.d.ts +0 -20
  204. package/dist/__tests__/coordination-brief-pin.test.d.ts.map +0 -1
  205. package/dist/__tests__/coordination-brief-pin.test.js +0 -66
  206. package/dist/__tests__/coordination-brief-pin.test.js.map +0 -1
  207. package/dist/__tests__/coordination-brief.test.d.ts +0 -9
  208. package/dist/__tests__/coordination-brief.test.d.ts.map +0 -1
  209. package/dist/__tests__/coordination-brief.test.js +0 -290
  210. package/dist/__tests__/coordination-brief.test.js.map +0 -1
  211. package/dist/__tests__/coordination-client.test.d.ts +0 -9
  212. package/dist/__tests__/coordination-client.test.d.ts.map +0 -1
  213. package/dist/__tests__/coordination-client.test.js +0 -517
  214. package/dist/__tests__/coordination-client.test.js.map +0 -1
  215. package/dist/__tests__/coordination-command.test.d.ts +0 -9
  216. package/dist/__tests__/coordination-command.test.d.ts.map +0 -1
  217. package/dist/__tests__/coordination-command.test.js +0 -1082
  218. package/dist/__tests__/coordination-command.test.js.map +0 -1
  219. package/dist/__tests__/coordination-credential-endpoint.test.d.ts +0 -24
  220. package/dist/__tests__/coordination-credential-endpoint.test.d.ts.map +0 -1
  221. package/dist/__tests__/coordination-credential-endpoint.test.js +0 -1292
  222. package/dist/__tests__/coordination-credential-endpoint.test.js.map +0 -1
  223. package/dist/__tests__/coordination-expected-team.test.d.ts +0 -19
  224. package/dist/__tests__/coordination-expected-team.test.d.ts.map +0 -1
  225. package/dist/__tests__/coordination-expected-team.test.js +0 -423
  226. package/dist/__tests__/coordination-expected-team.test.js.map +0 -1
  227. package/dist/__tests__/coordination-fallback.test.d.ts +0 -9
  228. package/dist/__tests__/coordination-fallback.test.d.ts.map +0 -1
  229. package/dist/__tests__/coordination-fallback.test.js +0 -192
  230. package/dist/__tests__/coordination-fallback.test.js.map +0 -1
  231. package/dist/__tests__/coordination-file-guards.test.d.ts +0 -29
  232. package/dist/__tests__/coordination-file-guards.test.d.ts.map +0 -1
  233. package/dist/__tests__/coordination-file-guards.test.js +0 -380
  234. package/dist/__tests__/coordination-file-guards.test.js.map +0 -1
  235. package/dist/__tests__/coordination-history.test.d.ts +0 -8
  236. package/dist/__tests__/coordination-history.test.d.ts.map +0 -1
  237. package/dist/__tests__/coordination-history.test.js +0 -447
  238. package/dist/__tests__/coordination-history.test.js.map +0 -1
  239. package/dist/__tests__/coordination-memory.test.d.ts +0 -14
  240. package/dist/__tests__/coordination-memory.test.d.ts.map +0 -1
  241. package/dist/__tests__/coordination-memory.test.js +0 -401
  242. package/dist/__tests__/coordination-memory.test.js.map +0 -1
  243. package/dist/__tests__/coordination-mode.test.d.ts +0 -13
  244. package/dist/__tests__/coordination-mode.test.d.ts.map +0 -1
  245. package/dist/__tests__/coordination-mode.test.js +0 -180
  246. package/dist/__tests__/coordination-mode.test.js.map +0 -1
  247. package/dist/__tests__/coordination-plain-shell-commands.test.d.ts +0 -22
  248. package/dist/__tests__/coordination-plain-shell-commands.test.d.ts.map +0 -1
  249. package/dist/__tests__/coordination-plain-shell-commands.test.js +0 -1875
  250. package/dist/__tests__/coordination-plain-shell-commands.test.js.map +0 -1
  251. package/dist/__tests__/coordination-provision.test.d.ts +0 -12
  252. package/dist/__tests__/coordination-provision.test.d.ts.map +0 -1
  253. package/dist/__tests__/coordination-provision.test.js +0 -103
  254. package/dist/__tests__/coordination-provision.test.js.map +0 -1
  255. package/dist/__tests__/coordination-render.test.d.ts +0 -9
  256. package/dist/__tests__/coordination-render.test.d.ts.map +0 -1
  257. package/dist/__tests__/coordination-render.test.js +0 -335
  258. package/dist/__tests__/coordination-render.test.js.map +0 -1
  259. package/dist/__tests__/coordination-setup.test.d.ts +0 -6
  260. package/dist/__tests__/coordination-setup.test.d.ts.map +0 -1
  261. package/dist/__tests__/coordination-setup.test.js +0 -448
  262. package/dist/__tests__/coordination-setup.test.js.map +0 -1
  263. package/dist/__tests__/coordination-status-plain-shell.test.d.ts +0 -19
  264. package/dist/__tests__/coordination-status-plain-shell.test.d.ts.map +0 -1
  265. package/dist/__tests__/coordination-status-plain-shell.test.js +0 -332
  266. package/dist/__tests__/coordination-status-plain-shell.test.js.map +0 -1
  267. package/dist/__tests__/coordination-status-registration.test.d.ts +0 -16
  268. package/dist/__tests__/coordination-status-registration.test.d.ts.map +0 -1
  269. package/dist/__tests__/coordination-status-registration.test.js +0 -480
  270. package/dist/__tests__/coordination-status-registration.test.js.map +0 -1
  271. package/dist/__tests__/coordination-token-multitenant.test.d.ts +0 -11
  272. package/dist/__tests__/coordination-token-multitenant.test.d.ts.map +0 -1
  273. package/dist/__tests__/coordination-token-multitenant.test.js +0 -106
  274. package/dist/__tests__/coordination-token-multitenant.test.js.map +0 -1
  275. package/dist/__tests__/coordination-token.test.d.ts +0 -11
  276. package/dist/__tests__/coordination-token.test.d.ts.map +0 -1
  277. package/dist/__tests__/coordination-token.test.js +0 -201
  278. package/dist/__tests__/coordination-token.test.js.map +0 -1
  279. package/dist/__tests__/coordination-wiring.test.d.ts +0 -11
  280. package/dist/__tests__/coordination-wiring.test.d.ts.map +0 -1
  281. package/dist/__tests__/coordination-wiring.test.js +0 -43
  282. package/dist/__tests__/coordination-wiring.test.js.map +0 -1
  283. package/dist/__tests__/creation-pr-class-check.test.d.ts +0 -17
  284. package/dist/__tests__/creation-pr-class-check.test.d.ts.map +0 -1
  285. package/dist/__tests__/creation-pr-class-check.test.js +0 -346
  286. package/dist/__tests__/creation-pr-class-check.test.js.map +0 -1
  287. package/dist/__tests__/creation-step6a-push-check.test.d.ts +0 -15
  288. package/dist/__tests__/creation-step6a-push-check.test.d.ts.map +0 -1
  289. package/dist/__tests__/creation-step6a-push-check.test.js +0 -150
  290. package/dist/__tests__/creation-step6a-push-check.test.js.map +0 -1
  291. package/dist/__tests__/decision-check.test.d.ts +0 -2
  292. package/dist/__tests__/decision-check.test.d.ts.map +0 -1
  293. package/dist/__tests__/decision-check.test.js +0 -105
  294. package/dist/__tests__/decision-check.test.js.map +0 -1
  295. package/dist/__tests__/digest-fail-closed.test.d.ts +0 -16
  296. package/dist/__tests__/digest-fail-closed.test.d.ts.map +0 -1
  297. package/dist/__tests__/digest-fail-closed.test.js +0 -248
  298. package/dist/__tests__/digest-fail-closed.test.js.map +0 -1
  299. package/dist/__tests__/digest-team-omission.test.d.ts +0 -15
  300. package/dist/__tests__/digest-team-omission.test.d.ts.map +0 -1
  301. package/dist/__tests__/digest-team-omission.test.js +0 -247
  302. package/dist/__tests__/digest-team-omission.test.js.map +0 -1
  303. package/dist/__tests__/doctor-config-fidelity.test.d.ts +0 -19
  304. package/dist/__tests__/doctor-config-fidelity.test.d.ts.map +0 -1
  305. package/dist/__tests__/doctor-config-fidelity.test.js +0 -324
  306. package/dist/__tests__/doctor-config-fidelity.test.js.map +0 -1
  307. package/dist/__tests__/doctor-framework-version.test.d.ts +0 -2
  308. package/dist/__tests__/doctor-framework-version.test.d.ts.map +0 -1
  309. package/dist/__tests__/doctor-framework-version.test.js +0 -146
  310. package/dist/__tests__/doctor-framework-version.test.js.map +0 -1
  311. package/dist/__tests__/doctor-worktree-path.test.d.ts +0 -17
  312. package/dist/__tests__/doctor-worktree-path.test.d.ts.map +0 -1
  313. package/dist/__tests__/doctor-worktree-path.test.js +0 -158
  314. package/dist/__tests__/doctor-worktree-path.test.js.map +0 -1
  315. package/dist/__tests__/doctor.test.d.ts +0 -20
  316. package/dist/__tests__/doctor.test.d.ts.map +0 -1
  317. package/dist/__tests__/doctor.test.js +0 -849
  318. package/dist/__tests__/doctor.test.js.map +0 -1
  319. package/dist/__tests__/event-shipper.test.d.ts +0 -16
  320. package/dist/__tests__/event-shipper.test.d.ts.map +0 -1
  321. package/dist/__tests__/event-shipper.test.js +0 -287
  322. package/dist/__tests__/event-shipper.test.js.map +0 -1
  323. package/dist/__tests__/fleet-data.test.d.ts +0 -2
  324. package/dist/__tests__/fleet-data.test.d.ts.map +0 -1
  325. package/dist/__tests__/fleet-data.test.js +0 -501
  326. package/dist/__tests__/fleet-data.test.js.map +0 -1
  327. package/dist/__tests__/fleet-devpod.test.d.ts +0 -12
  328. package/dist/__tests__/fleet-devpod.test.d.ts.map +0 -1
  329. package/dist/__tests__/fleet-devpod.test.js +0 -260
  330. package/dist/__tests__/fleet-devpod.test.js.map +0 -1
  331. package/dist/__tests__/fleet-tmux.test.d.ts +0 -2
  332. package/dist/__tests__/fleet-tmux.test.d.ts.map +0 -1
  333. package/dist/__tests__/fleet-tmux.test.js +0 -289
  334. package/dist/__tests__/fleet-tmux.test.js.map +0 -1
  335. package/dist/__tests__/fleet.test.d.ts +0 -16
  336. package/dist/__tests__/fleet.test.d.ts.map +0 -1
  337. package/dist/__tests__/fleet.test.js +0 -75
  338. package/dist/__tests__/fleet.test.js.map +0 -1
  339. package/dist/__tests__/generate-claude.test.d.ts +0 -18
  340. package/dist/__tests__/generate-claude.test.d.ts.map +0 -1
  341. package/dist/__tests__/generate-claude.test.js +0 -1015
  342. package/dist/__tests__/generate-claude.test.js.map +0 -1
  343. package/dist/__tests__/gh-remote.test.d.ts +0 -2
  344. package/dist/__tests__/gh-remote.test.d.ts.map +0 -1
  345. package/dist/__tests__/gh-remote.test.js +0 -136
  346. package/dist/__tests__/gh-remote.test.js.map +0 -1
  347. package/dist/__tests__/git-env.test.d.ts +0 -14
  348. package/dist/__tests__/git-env.test.d.ts.map +0 -1
  349. package/dist/__tests__/git-env.test.js +0 -131
  350. package/dist/__tests__/git-env.test.js.map +0 -1
  351. package/dist/__tests__/git-identity-isolation.test.d.ts +0 -33
  352. package/dist/__tests__/git-identity-isolation.test.d.ts.map +0 -1
  353. package/dist/__tests__/git-identity-isolation.test.js +0 -626
  354. package/dist/__tests__/git-identity-isolation.test.js.map +0 -1
  355. package/dist/__tests__/harness-extract.test.d.ts +0 -19
  356. package/dist/__tests__/harness-extract.test.d.ts.map +0 -1
  357. package/dist/__tests__/harness-extract.test.js +0 -566
  358. package/dist/__tests__/harness-extract.test.js.map +0 -1
  359. package/dist/__tests__/harness-wiring.test.d.ts +0 -16
  360. package/dist/__tests__/harness-wiring.test.d.ts.map +0 -1
  361. package/dist/__tests__/harness-wiring.test.js +0 -469
  362. package/dist/__tests__/harness-wiring.test.js.map +0 -1
  363. package/dist/__tests__/hook-completeness.test.d.ts +0 -13
  364. package/dist/__tests__/hook-completeness.test.d.ts.map +0 -1
  365. package/dist/__tests__/hook-completeness.test.js +0 -238
  366. package/dist/__tests__/hook-completeness.test.js.map +0 -1
  367. package/dist/__tests__/hook-heal.test.d.ts +0 -8
  368. package/dist/__tests__/hook-heal.test.d.ts.map +0 -1
  369. package/dist/__tests__/hook-heal.test.js +0 -156
  370. package/dist/__tests__/hook-heal.test.js.map +0 -1
  371. package/dist/__tests__/human-turn-classifier.test.d.ts +0 -17
  372. package/dist/__tests__/human-turn-classifier.test.d.ts.map +0 -1
  373. package/dist/__tests__/human-turn-classifier.test.js +0 -311
  374. package/dist/__tests__/human-turn-classifier.test.js.map +0 -1
  375. package/dist/__tests__/init-coordination-url.test.d.ts +0 -11
  376. package/dist/__tests__/init-coordination-url.test.d.ts.map +0 -1
  377. package/dist/__tests__/init-coordination-url.test.js +0 -217
  378. package/dist/__tests__/init-coordination-url.test.js.map +0 -1
  379. package/dist/__tests__/isolation-probe.test.d.ts +0 -15
  380. package/dist/__tests__/isolation-probe.test.d.ts.map +0 -1
  381. package/dist/__tests__/isolation-probe.test.js +0 -611
  382. package/dist/__tests__/isolation-probe.test.js.map +0 -1
  383. package/dist/__tests__/leader-lock.test.d.ts +0 -12
  384. package/dist/__tests__/leader-lock.test.d.ts.map +0 -1
  385. package/dist/__tests__/leader-lock.test.js +0 -293
  386. package/dist/__tests__/leader-lock.test.js.map +0 -1
  387. package/dist/__tests__/memory-archive-checks.test.d.ts +0 -22
  388. package/dist/__tests__/memory-archive-checks.test.d.ts.map +0 -1
  389. package/dist/__tests__/memory-archive-checks.test.js +0 -748
  390. package/dist/__tests__/memory-archive-checks.test.js.map +0 -1
  391. package/dist/__tests__/memory-archive-prep.test.d.ts +0 -8
  392. package/dist/__tests__/memory-archive-prep.test.d.ts.map +0 -1
  393. package/dist/__tests__/memory-archive-prep.test.js +0 -524
  394. package/dist/__tests__/memory-archive-prep.test.js.map +0 -1
  395. package/dist/__tests__/memory-autocreate.test.d.ts +0 -10
  396. package/dist/__tests__/memory-autocreate.test.d.ts.map +0 -1
  397. package/dist/__tests__/memory-autocreate.test.js +0 -709
  398. package/dist/__tests__/memory-autocreate.test.js.map +0 -1
  399. package/dist/__tests__/memory-log-result.test.d.ts +0 -13
  400. package/dist/__tests__/memory-log-result.test.d.ts.map +0 -1
  401. package/dist/__tests__/memory-log-result.test.js +0 -149
  402. package/dist/__tests__/memory-log-result.test.js.map +0 -1
  403. package/dist/__tests__/memory-named-exists.test.d.ts +0 -16
  404. package/dist/__tests__/memory-named-exists.test.d.ts.map +0 -1
  405. package/dist/__tests__/memory-named-exists.test.js +0 -288
  406. package/dist/__tests__/memory-named-exists.test.js.map +0 -1
  407. package/dist/__tests__/message-bus.test.d.ts +0 -10
  408. package/dist/__tests__/message-bus.test.d.ts.map +0 -1
  409. package/dist/__tests__/message-bus.test.js +0 -526
  410. package/dist/__tests__/message-bus.test.js.map +0 -1
  411. package/dist/__tests__/monitor.test.d.ts +0 -6
  412. package/dist/__tests__/monitor.test.d.ts.map +0 -1
  413. package/dist/__tests__/monitor.test.js +0 -458
  414. package/dist/__tests__/monitor.test.js.map +0 -1
  415. package/dist/__tests__/mx-agent-cli-pin-validation.test.d.ts +0 -2
  416. package/dist/__tests__/mx-agent-cli-pin-validation.test.d.ts.map +0 -1
  417. package/dist/__tests__/mx-agent-cli-pin-validation.test.js +0 -232
  418. package/dist/__tests__/mx-agent-cli-pin-validation.test.js.map +0 -1
  419. package/dist/__tests__/mx-agent-cli-version-pin.test.d.ts +0 -2
  420. package/dist/__tests__/mx-agent-cli-version-pin.test.d.ts.map +0 -1
  421. package/dist/__tests__/mx-agent-cli-version-pin.test.js +0 -236
  422. package/dist/__tests__/mx-agent-cli-version-pin.test.js.map +0 -1
  423. package/dist/__tests__/new-project-first-team.test.d.ts +0 -15
  424. package/dist/__tests__/new-project-first-team.test.d.ts.map +0 -1
  425. package/dist/__tests__/new-project-first-team.test.js +0 -444
  426. package/dist/__tests__/new-project-first-team.test.js.map +0 -1
  427. package/dist/__tests__/otel-env.test.d.ts +0 -2
  428. package/dist/__tests__/otel-env.test.d.ts.map +0 -1
  429. package/dist/__tests__/otel-env.test.js +0 -127
  430. package/dist/__tests__/otel-env.test.js.map +0 -1
  431. package/dist/__tests__/pager-fail-closed.test.d.ts +0 -19
  432. package/dist/__tests__/pager-fail-closed.test.d.ts.map +0 -1
  433. package/dist/__tests__/pager-fail-closed.test.js +0 -229
  434. package/dist/__tests__/pager-fail-closed.test.js.map +0 -1
  435. package/dist/__tests__/pr-set-body.test.d.ts +0 -29
  436. package/dist/__tests__/pr-set-body.test.d.ts.map +0 -1
  437. package/dist/__tests__/pr-set-body.test.js +0 -314
  438. package/dist/__tests__/pr-set-body.test.js.map +0 -1
  439. package/dist/__tests__/prior-sync-failure.test.d.ts +0 -2
  440. package/dist/__tests__/prior-sync-failure.test.d.ts.map +0 -1
  441. package/dist/__tests__/prior-sync-failure.test.js +0 -81
  442. package/dist/__tests__/prior-sync-failure.test.js.map +0 -1
  443. package/dist/__tests__/project-config.test.d.ts +0 -2
  444. package/dist/__tests__/project-config.test.d.ts.map +0 -1
  445. package/dist/__tests__/project-config.test.js +0 -458
  446. package/dist/__tests__/project-config.test.js.map +0 -1
  447. package/dist/__tests__/provision-behavioral-contract.test.d.ts +0 -13
  448. package/dist/__tests__/provision-behavioral-contract.test.d.ts.map +0 -1
  449. package/dist/__tests__/provision-behavioral-contract.test.js +0 -548
  450. package/dist/__tests__/provision-behavioral-contract.test.js.map +0 -1
  451. package/dist/__tests__/provision-catalog-precondition.test.d.ts +0 -26
  452. package/dist/__tests__/provision-catalog-precondition.test.d.ts.map +0 -1
  453. package/dist/__tests__/provision-catalog-precondition.test.js +0 -622
  454. package/dist/__tests__/provision-catalog-precondition.test.js.map +0 -1
  455. package/dist/__tests__/provision-completion-rows.test.d.ts +0 -17
  456. package/dist/__tests__/provision-completion-rows.test.d.ts.map +0 -1
  457. package/dist/__tests__/provision-completion-rows.test.js +0 -3473
  458. package/dist/__tests__/provision-completion-rows.test.js.map +0 -1
  459. package/dist/__tests__/provision-copy-containment.test.d.ts +0 -19
  460. package/dist/__tests__/provision-copy-containment.test.d.ts.map +0 -1
  461. package/dist/__tests__/provision-copy-containment.test.js +0 -187
  462. package/dist/__tests__/provision-copy-containment.test.js.map +0 -1
  463. package/dist/__tests__/provision-identity-gate.test.d.ts +0 -20
  464. package/dist/__tests__/provision-identity-gate.test.d.ts.map +0 -1
  465. package/dist/__tests__/provision-identity-gate.test.js +0 -602
  466. package/dist/__tests__/provision-identity-gate.test.js.map +0 -1
  467. package/dist/__tests__/provision-resume.test.d.ts +0 -26
  468. package/dist/__tests__/provision-resume.test.d.ts.map +0 -1
  469. package/dist/__tests__/provision-resume.test.js +0 -1344
  470. package/dist/__tests__/provision-resume.test.js.map +0 -1
  471. package/dist/__tests__/provision-roleguide-anchors.test.d.ts +0 -27
  472. package/dist/__tests__/provision-roleguide-anchors.test.d.ts.map +0 -1
  473. package/dist/__tests__/provision-roleguide-anchors.test.js +0 -747
  474. package/dist/__tests__/provision-roleguide-anchors.test.js.map +0 -1
  475. package/dist/__tests__/provision-row12-stub-server.test.d.ts +0 -21
  476. package/dist/__tests__/provision-row12-stub-server.test.d.ts.map +0 -1
  477. package/dist/__tests__/provision-row12-stub-server.test.js +0 -264
  478. package/dist/__tests__/provision-row12-stub-server.test.js.map +0 -1
  479. package/dist/__tests__/provision-skeleton-fill.test.d.ts +0 -16
  480. package/dist/__tests__/provision-skeleton-fill.test.d.ts.map +0 -1
  481. package/dist/__tests__/provision-skeleton-fill.test.js +0 -490
  482. package/dist/__tests__/provision-skeleton-fill.test.js.map +0 -1
  483. package/dist/__tests__/provision-step8-commit.test.d.ts +0 -40
  484. package/dist/__tests__/provision-step8-commit.test.d.ts.map +0 -1
  485. package/dist/__tests__/provision-step8-commit.test.js +0 -529
  486. package/dist/__tests__/provision-step8-commit.test.js.map +0 -1
  487. package/dist/__tests__/provision-teambuilder-flow.test.d.ts +0 -22
  488. package/dist/__tests__/provision-teambuilder-flow.test.d.ts.map +0 -1
  489. package/dist/__tests__/provision-teambuilder-flow.test.js +0 -253
  490. package/dist/__tests__/provision-teambuilder-flow.test.js.map +0 -1
  491. package/dist/__tests__/provision-write-integrity.test.d.ts +0 -18
  492. package/dist/__tests__/provision-write-integrity.test.d.ts.map +0 -1
  493. package/dist/__tests__/provision-write-integrity.test.js +0 -141
  494. package/dist/__tests__/provision-write-integrity.test.js.map +0 -1
  495. package/dist/__tests__/repo-guard-wiring.test.d.ts +0 -21
  496. package/dist/__tests__/repo-guard-wiring.test.d.ts.map +0 -1
  497. package/dist/__tests__/repo-guard-wiring.test.js +0 -638
  498. package/dist/__tests__/repo-guard-wiring.test.js.map +0 -1
  499. package/dist/__tests__/report-format.test.d.ts +0 -2
  500. package/dist/__tests__/report-format.test.d.ts.map +0 -1
  501. package/dist/__tests__/report-format.test.js +0 -219
  502. package/dist/__tests__/report-format.test.js.map +0 -1
  503. package/dist/__tests__/row15-detail-sanitizer.test.d.ts +0 -20
  504. package/dist/__tests__/row15-detail-sanitizer.test.d.ts.map +0 -1
  505. package/dist/__tests__/row15-detail-sanitizer.test.js +0 -61
  506. package/dist/__tests__/row15-detail-sanitizer.test.js.map +0 -1
  507. package/dist/__tests__/rows-9-10-zero-remotes.test.d.ts +0 -32
  508. package/dist/__tests__/rows-9-10-zero-remotes.test.d.ts.map +0 -1
  509. package/dist/__tests__/rows-9-10-zero-remotes.test.js +0 -203
  510. package/dist/__tests__/rows-9-10-zero-remotes.test.js.map +0 -1
  511. package/dist/__tests__/runtime-claude-adapter.test.d.ts +0 -2
  512. package/dist/__tests__/runtime-claude-adapter.test.d.ts.map +0 -1
  513. package/dist/__tests__/runtime-claude-adapter.test.js +0 -70
  514. package/dist/__tests__/runtime-claude-adapter.test.js.map +0 -1
  515. package/dist/__tests__/runtime-codex-adapter.test.d.ts +0 -2
  516. package/dist/__tests__/runtime-codex-adapter.test.d.ts.map +0 -1
  517. package/dist/__tests__/runtime-codex-adapter.test.js +0 -558
  518. package/dist/__tests__/runtime-codex-adapter.test.js.map +0 -1
  519. package/dist/__tests__/runtime-codex-config.test.d.ts +0 -2
  520. package/dist/__tests__/runtime-codex-config.test.d.ts.map +0 -1
  521. package/dist/__tests__/runtime-codex-config.test.js +0 -1421
  522. package/dist/__tests__/runtime-codex-config.test.js.map +0 -1
  523. package/dist/__tests__/runtime-codex-gateway-pilot.test.d.ts +0 -2
  524. package/dist/__tests__/runtime-codex-gateway-pilot.test.d.ts.map +0 -1
  525. package/dist/__tests__/runtime-codex-gateway-pilot.test.js +0 -309
  526. package/dist/__tests__/runtime-codex-gateway-pilot.test.js.map +0 -1
  527. package/dist/__tests__/runtime-codex-gateway-provider.test.d.ts +0 -2
  528. package/dist/__tests__/runtime-codex-gateway-provider.test.d.ts.map +0 -1
  529. package/dist/__tests__/runtime-codex-gateway-provider.test.js +0 -163
  530. package/dist/__tests__/runtime-codex-gateway-provider.test.js.map +0 -1
  531. package/dist/__tests__/runtime-codex-guard-proof.test.d.ts +0 -2
  532. package/dist/__tests__/runtime-codex-guard-proof.test.d.ts.map +0 -1
  533. package/dist/__tests__/runtime-codex-guard-proof.test.js +0 -822
  534. package/dist/__tests__/runtime-codex-guard-proof.test.js.map +0 -1
  535. package/dist/__tests__/runtime-codex-version-pin.test.d.ts +0 -2
  536. package/dist/__tests__/runtime-codex-version-pin.test.d.ts.map +0 -1
  537. package/dist/__tests__/runtime-codex-version-pin.test.js +0 -86
  538. package/dist/__tests__/runtime-codex-version-pin.test.js.map +0 -1
  539. package/dist/__tests__/runtime-identity.test.d.ts +0 -2
  540. package/dist/__tests__/runtime-identity.test.d.ts.map +0 -1
  541. package/dist/__tests__/runtime-identity.test.js +0 -117
  542. package/dist/__tests__/runtime-identity.test.js.map +0 -1
  543. package/dist/__tests__/runtime-resolve.test.d.ts +0 -2
  544. package/dist/__tests__/runtime-resolve.test.d.ts.map +0 -1
  545. package/dist/__tests__/runtime-resolve.test.js +0 -172
  546. package/dist/__tests__/runtime-resolve.test.js.map +0 -1
  547. package/dist/__tests__/security-posture.test.d.ts +0 -8
  548. package/dist/__tests__/security-posture.test.d.ts.map +0 -1
  549. package/dist/__tests__/security-posture.test.js +0 -82
  550. package/dist/__tests__/security-posture.test.js.map +0 -1
  551. package/dist/__tests__/session-model.test.d.ts +0 -2
  552. package/dist/__tests__/session-model.test.d.ts.map +0 -1
  553. package/dist/__tests__/session-model.test.js +0 -74
  554. package/dist/__tests__/session-model.test.js.map +0 -1
  555. package/dist/__tests__/session-pause-provisioning.test.d.ts +0 -19
  556. package/dist/__tests__/session-pause-provisioning.test.d.ts.map +0 -1
  557. package/dist/__tests__/session-pause-provisioning.test.js +0 -115
  558. package/dist/__tests__/session-pause-provisioning.test.js.map +0 -1
  559. package/dist/__tests__/session-reclamation.test.d.ts +0 -15
  560. package/dist/__tests__/session-reclamation.test.d.ts.map +0 -1
  561. package/dist/__tests__/session-reclamation.test.js +0 -73
  562. package/dist/__tests__/session-reclamation.test.js.map +0 -1
  563. package/dist/__tests__/session-record-disclosure.test.d.ts +0 -24
  564. package/dist/__tests__/session-record-disclosure.test.d.ts.map +0 -1
  565. package/dist/__tests__/session-record-disclosure.test.js +0 -494
  566. package/dist/__tests__/session-record-disclosure.test.js.map +0 -1
  567. package/dist/__tests__/session-status.test.d.ts +0 -11
  568. package/dist/__tests__/session-status.test.d.ts.map +0 -1
  569. package/dist/__tests__/session-status.test.js +0 -76
  570. package/dist/__tests__/session-status.test.js.map +0 -1
  571. package/dist/__tests__/session.test.d.ts +0 -15
  572. package/dist/__tests__/session.test.d.ts.map +0 -1
  573. package/dist/__tests__/session.test.js +0 -366
  574. package/dist/__tests__/session.test.js.map +0 -1
  575. package/dist/__tests__/shim-deploy-safety.test.d.ts +0 -24
  576. package/dist/__tests__/shim-deploy-safety.test.d.ts.map +0 -1
  577. package/dist/__tests__/shim-deploy-safety.test.js +0 -174
  578. package/dist/__tests__/shim-deploy-safety.test.js.map +0 -1
  579. package/dist/__tests__/slug-validation.test.d.ts +0 -13
  580. package/dist/__tests__/slug-validation.test.d.ts.map +0 -1
  581. package/dist/__tests__/slug-validation.test.js +0 -202
  582. package/dist/__tests__/slug-validation.test.js.map +0 -1
  583. package/dist/__tests__/standards-injection.test.d.ts +0 -2
  584. package/dist/__tests__/standards-injection.test.d.ts.map +0 -1
  585. package/dist/__tests__/standards-injection.test.js +0 -179
  586. package/dist/__tests__/standards-injection.test.js.map +0 -1
  587. package/dist/__tests__/start-config-conflict.test.d.ts +0 -17
  588. package/dist/__tests__/start-config-conflict.test.d.ts.map +0 -1
  589. package/dist/__tests__/start-config-conflict.test.js +0 -101
  590. package/dist/__tests__/start-config-conflict.test.js.map +0 -1
  591. package/dist/__tests__/start-interactive-role.test.d.ts +0 -22
  592. package/dist/__tests__/start-interactive-role.test.d.ts.map +0 -1
  593. package/dist/__tests__/start-interactive-role.test.js +0 -204
  594. package/dist/__tests__/start-interactive-role.test.js.map +0 -1
  595. package/dist/__tests__/start-rebase-never-ran.test.d.ts +0 -25
  596. package/dist/__tests__/start-rebase-never-ran.test.d.ts.map +0 -1
  597. package/dist/__tests__/start-rebase-never-ran.test.js +0 -227
  598. package/dist/__tests__/start-rebase-never-ran.test.js.map +0 -1
  599. package/dist/__tests__/start-report-generation-capture.test.d.ts +0 -17
  600. package/dist/__tests__/start-report-generation-capture.test.d.ts.map +0 -1
  601. package/dist/__tests__/start-report-generation-capture.test.js +0 -127
  602. package/dist/__tests__/start-report-generation-capture.test.js.map +0 -1
  603. package/dist/__tests__/start-report-integration.test.d.ts +0 -12
  604. package/dist/__tests__/start-report-integration.test.d.ts.map +0 -1
  605. package/dist/__tests__/start-report-integration.test.js +0 -138
  606. package/dist/__tests__/start-report-integration.test.js.map +0 -1
  607. package/dist/__tests__/start-runtime-wiring.test.d.ts +0 -31
  608. package/dist/__tests__/start-runtime-wiring.test.d.ts.map +0 -1
  609. package/dist/__tests__/start-runtime-wiring.test.js +0 -735
  610. package/dist/__tests__/start-runtime-wiring.test.js.map +0 -1
  611. package/dist/__tests__/start-stash.test.d.ts +0 -2
  612. package/dist/__tests__/start-stash.test.d.ts.map +0 -1
  613. package/dist/__tests__/start-stash.test.js +0 -131
  614. package/dist/__tests__/start-stash.test.js.map +0 -1
  615. package/dist/__tests__/start-sync-hardstop.test.d.ts +0 -15
  616. package/dist/__tests__/start-sync-hardstop.test.d.ts.map +0 -1
  617. package/dist/__tests__/start-sync-hardstop.test.js +0 -280
  618. package/dist/__tests__/start-sync-hardstop.test.js.map +0 -1
  619. package/dist/__tests__/start-team-identity.test.d.ts +0 -25
  620. package/dist/__tests__/start-team-identity.test.d.ts.map +0 -1
  621. package/dist/__tests__/start-team-identity.test.js +0 -307
  622. package/dist/__tests__/start-team-identity.test.js.map +0 -1
  623. package/dist/__tests__/startup-health-render.test.d.ts +0 -11
  624. package/dist/__tests__/startup-health-render.test.d.ts.map +0 -1
  625. package/dist/__tests__/startup-health-render.test.js +0 -60
  626. package/dist/__tests__/startup-health-render.test.js.map +0 -1
  627. package/dist/__tests__/startup-policy.test.d.ts +0 -2
  628. package/dist/__tests__/startup-policy.test.d.ts.map +0 -1
  629. package/dist/__tests__/startup-policy.test.js +0 -27
  630. package/dist/__tests__/startup-policy.test.js.map +0 -1
  631. package/dist/__tests__/startup-report.test.d.ts +0 -13
  632. package/dist/__tests__/startup-report.test.d.ts.map +0 -1
  633. package/dist/__tests__/startup-report.test.js +0 -278
  634. package/dist/__tests__/startup-report.test.js.map +0 -1
  635. package/dist/__tests__/startup-shipper.test.d.ts +0 -13
  636. package/dist/__tests__/startup-shipper.test.d.ts.map +0 -1
  637. package/dist/__tests__/startup-shipper.test.js +0 -149
  638. package/dist/__tests__/startup-shipper.test.js.map +0 -1
  639. package/dist/__tests__/stream-input-controller.test.d.ts +0 -10
  640. package/dist/__tests__/stream-input-controller.test.d.ts.map +0 -1
  641. package/dist/__tests__/stream-input-controller.test.js +0 -167
  642. package/dist/__tests__/stream-input-controller.test.js.map +0 -1
  643. package/dist/__tests__/team-memory-commands.test.d.ts +0 -11
  644. package/dist/__tests__/team-memory-commands.test.d.ts.map +0 -1
  645. package/dist/__tests__/team-memory-commands.test.js +0 -240
  646. package/dist/__tests__/team-memory-commands.test.js.map +0 -1
  647. package/dist/__tests__/team-name-propagation.test.d.ts +0 -13
  648. package/dist/__tests__/team-name-propagation.test.d.ts.map +0 -1
  649. package/dist/__tests__/team-name-propagation.test.js +0 -198
  650. package/dist/__tests__/team-name-propagation.test.js.map +0 -1
  651. package/dist/__tests__/team-token-probe.test.d.ts +0 -16
  652. package/dist/__tests__/team-token-probe.test.d.ts.map +0 -1
  653. package/dist/__tests__/team-token-probe.test.js +0 -295
  654. package/dist/__tests__/team-token-probe.test.js.map +0 -1
  655. package/dist/__tests__/template-budget.test.d.ts +0 -2
  656. package/dist/__tests__/template-budget.test.d.ts.map +0 -1
  657. package/dist/__tests__/template-budget.test.js +0 -119
  658. package/dist/__tests__/template-budget.test.js.map +0 -1
  659. package/dist/__tests__/template-sync.test.d.ts +0 -19
  660. package/dist/__tests__/template-sync.test.d.ts.map +0 -1
  661. package/dist/__tests__/template-sync.test.js +0 -480
  662. package/dist/__tests__/template-sync.test.js.map +0 -1
  663. package/dist/__tests__/test-project.test.d.ts +0 -18
  664. package/dist/__tests__/test-project.test.d.ts.map +0 -1
  665. package/dist/__tests__/test-project.test.js +0 -465
  666. package/dist/__tests__/test-project.test.js.map +0 -1
  667. package/dist/__tests__/tracked-instruction-files.test.d.ts +0 -21
  668. package/dist/__tests__/tracked-instruction-files.test.d.ts.map +0 -1
  669. package/dist/__tests__/tracked-instruction-files.test.js +0 -489
  670. package/dist/__tests__/tracked-instruction-files.test.js.map +0 -1
  671. package/dist/__tests__/unlock.test.d.ts +0 -11
  672. package/dist/__tests__/unlock.test.d.ts.map +0 -1
  673. package/dist/__tests__/unlock.test.js +0 -100
  674. package/dist/__tests__/unlock.test.js.map +0 -1
  675. package/dist/__tests__/usage-per-call-grouping.test.d.ts +0 -25
  676. package/dist/__tests__/usage-per-call-grouping.test.d.ts.map +0 -1
  677. package/dist/__tests__/usage-per-call-grouping.test.js +0 -952
  678. package/dist/__tests__/usage-per-call-grouping.test.js.map +0 -1
  679. package/dist/__tests__/usage-pricing.test.d.ts +0 -20
  680. package/dist/__tests__/usage-pricing.test.d.ts.map +0 -1
  681. package/dist/__tests__/usage-pricing.test.js +0 -176
  682. package/dist/__tests__/usage-pricing.test.js.map +0 -1
  683. package/dist/__tests__/usage-subagent-discovery.test.d.ts +0 -17
  684. package/dist/__tests__/usage-subagent-discovery.test.d.ts.map +0 -1
  685. package/dist/__tests__/usage-subagent-discovery.test.js +0 -213
  686. package/dist/__tests__/usage-subagent-discovery.test.js.map +0 -1
  687. package/dist/__tests__/verify-hooks-check-all.test.d.ts +0 -32
  688. package/dist/__tests__/verify-hooks-check-all.test.d.ts.map +0 -1
  689. package/dist/__tests__/verify-hooks-check-all.test.js +0 -563
  690. package/dist/__tests__/verify-hooks-check-all.test.js.map +0 -1
  691. package/dist/__tests__/verify-hooks-heal-log.test.d.ts +0 -11
  692. package/dist/__tests__/verify-hooks-heal-log.test.d.ts.map +0 -1
  693. package/dist/__tests__/verify-hooks-heal-log.test.js +0 -172
  694. package/dist/__tests__/verify-hooks-heal-log.test.js.map +0 -1
  695. package/dist/__tests__/worker-cap.test.d.ts +0 -14
  696. package/dist/__tests__/worker-cap.test.d.ts.map +0 -1
  697. package/dist/__tests__/worker-cap.test.js +0 -97
  698. package/dist/__tests__/worker-cap.test.js.map +0 -1
  699. package/dist/__tests__/worktree-link-repair.test.d.ts +0 -2
  700. package/dist/__tests__/worktree-link-repair.test.d.ts.map +0 -1
  701. package/dist/__tests__/worktree-link-repair.test.js +0 -471
  702. package/dist/__tests__/worktree-link-repair.test.js.map +0 -1
  703. package/dist/__tests__/worktree-sync-fixture.test.d.ts +0 -17
  704. package/dist/__tests__/worktree-sync-fixture.test.d.ts.map +0 -1
  705. package/dist/__tests__/worktree-sync-fixture.test.js +0 -519
  706. package/dist/__tests__/worktree-sync-fixture.test.js.map +0 -1
  707. package/dist/__tests__/worktree-sync-hardening.test.d.ts +0 -13
  708. package/dist/__tests__/worktree-sync-hardening.test.d.ts.map +0 -1
  709. package/dist/__tests__/worktree-sync-hardening.test.js +0 -919
  710. package/dist/__tests__/worktree-sync-hardening.test.js.map +0 -1
  711. package/dist/__tests__/worktree-sync-shell-free.test.d.ts +0 -25
  712. package/dist/__tests__/worktree-sync-shell-free.test.d.ts.map +0 -1
  713. package/dist/__tests__/worktree-sync-shell-free.test.js +0 -185
  714. package/dist/__tests__/worktree-sync-shell-free.test.js.map +0 -1
  715. package/dist/__tests__/worktree.test.d.ts +0 -2
  716. package/dist/__tests__/worktree.test.d.ts.map +0 -1
  717. package/dist/__tests__/worktree.test.js +0 -168
  718. package/dist/__tests__/worktree.test.js.map +0 -1
  719. package/dist/lib/code-context-file.test.d.ts +0 -19
  720. package/dist/lib/code-context-file.test.d.ts.map +0 -1
  721. package/dist/lib/code-context-file.test.js +0 -202
  722. package/dist/lib/code-context-file.test.js.map +0 -1
  723. package/dist/lib/harness/console/announce.test.d.ts +0 -2
  724. package/dist/lib/harness/console/announce.test.d.ts.map +0 -1
  725. package/dist/lib/harness/console/announce.test.js +0 -104
  726. package/dist/lib/harness/console/announce.test.js.map +0 -1
  727. package/dist/lib/harness/console/by-session.test.d.ts +0 -2
  728. package/dist/lib/harness/console/by-session.test.d.ts.map +0 -1
  729. package/dist/lib/harness/console/by-session.test.js +0 -86
  730. package/dist/lib/harness/console/by-session.test.js.map +0 -1
  731. package/dist/lib/harness/console/console.test.d.ts +0 -2
  732. package/dist/lib/harness/console/console.test.d.ts.map +0 -1
  733. package/dist/lib/harness/console/console.test.js +0 -269
  734. package/dist/lib/harness/console/console.test.js.map +0 -1
  735. package/dist/lib/harness/console/decision-request.test.d.ts +0 -2
  736. package/dist/lib/harness/console/decision-request.test.d.ts.map +0 -1
  737. package/dist/lib/harness/console/decision-request.test.js +0 -75
  738. package/dist/lib/harness/console/decision-request.test.js.map +0 -1
  739. package/dist/lib/harness/console/rank.test.d.ts +0 -2
  740. package/dist/lib/harness/console/rank.test.d.ts.map +0 -1
  741. package/dist/lib/harness/console/rank.test.js +0 -124
  742. package/dist/lib/harness/console/rank.test.js.map +0 -1
  743. package/dist/lib/harness/console/render.test.d.ts +0 -2
  744. package/dist/lib/harness/console/render.test.d.ts.map +0 -1
  745. package/dist/lib/harness/console/render.test.js +0 -96
  746. package/dist/lib/harness/console/render.test.js.map +0 -1
  747. package/dist/lib/harness/console/replay-cli.test.d.ts +0 -2
  748. package/dist/lib/harness/console/replay-cli.test.d.ts.map +0 -1
  749. package/dist/lib/harness/console/replay-cli.test.js +0 -96
  750. package/dist/lib/harness/console/replay-cli.test.js.map +0 -1
  751. package/dist/lib/harness/console/replay.test.d.ts +0 -2
  752. package/dist/lib/harness/console/replay.test.d.ts.map +0 -1
  753. package/dist/lib/harness/console/replay.test.js +0 -81
  754. package/dist/lib/harness/console/replay.test.js.map +0 -1
  755. package/dist/lib/harness/console/turn-reader.test.d.ts +0 -2
  756. package/dist/lib/harness/console/turn-reader.test.d.ts.map +0 -1
  757. package/dist/lib/harness/console/turn-reader.test.js +0 -108
  758. package/dist/lib/harness/console/turn-reader.test.js.map +0 -1
  759. package/dist/lib/harness/credential.test.d.ts +0 -2
  760. package/dist/lib/harness/credential.test.d.ts.map +0 -1
  761. package/dist/lib/harness/credential.test.js +0 -74
  762. package/dist/lib/harness/credential.test.js.map +0 -1
  763. package/dist/lib/harness/evaluate.test.d.ts +0 -2
  764. package/dist/lib/harness/evaluate.test.d.ts.map +0 -1
  765. package/dist/lib/harness/evaluate.test.js +0 -621
  766. package/dist/lib/harness/evaluate.test.js.map +0 -1
  767. package/dist/lib/harness/gate.test.d.ts +0 -2
  768. package/dist/lib/harness/gate.test.d.ts.map +0 -1
  769. package/dist/lib/harness/gate.test.js +0 -111
  770. package/dist/lib/harness/gate.test.js.map +0 -1
  771. package/dist/lib/harness/self-check.test.d.ts +0 -2
  772. package/dist/lib/harness/self-check.test.d.ts.map +0 -1
  773. package/dist/lib/harness/self-check.test.js +0 -43
  774. package/dist/lib/harness/self-check.test.js.map +0 -1
  775. package/dist/lib/harness/transcript.test.d.ts +0 -2
  776. package/dist/lib/harness/transcript.test.d.ts.map +0 -1
  777. package/dist/lib/harness/transcript.test.js +0 -118
  778. package/dist/lib/harness/transcript.test.js.map +0 -1
  779. package/dist/lib/projects-registry.test.d.ts +0 -2
  780. package/dist/lib/projects-registry.test.d.ts.map +0 -1
  781. package/dist/lib/projects-registry.test.js +0 -176
  782. package/dist/lib/projects-registry.test.js.map +0 -1
  783. package/dist/lib/roster.test.d.ts +0 -15
  784. package/dist/lib/roster.test.d.ts.map +0 -1
  785. package/dist/lib/roster.test.js +0 -299
  786. package/dist/lib/roster.test.js.map +0 -1
  787. package/dist/lib/vault.test.d.ts +0 -17
  788. package/dist/lib/vault.test.d.ts.map +0 -1
  789. package/dist/lib/vault.test.js +0 -169
  790. package/dist/lib/vault.test.js.map +0 -1
  791. package/dist/lib/window-view.test.d.ts +0 -2
  792. package/dist/lib/window-view.test.d.ts.map +0 -1
  793. package/dist/lib/window-view.test.js +0 -168
  794. package/dist/lib/window-view.test.js.map +0 -1
  795. package/dist/standards/fail-loud-standard.md +0 -495
  796. package/dist/standards/known-issues-standard.md +0 -380
  797. package/dist/standards/rulings.md +0 -104
@@ -1,747 +0,0 @@
1
- /**
2
- * Tests for the roleguide's Named Memory Anchors table as the source of the
3
- * seeded memory list (#138, plan #190, security pre-ruling comment 5428914046).
4
- *
5
- * Provisioning seeded three memories from a constant while two of the three live
6
- * roleguides named a fourth. Nothing read the table, so the fourth was never
7
- * created, `provision` reported success, and the team found the gap at its first
8
- * session — `mx-agent-surface-watch-log` and `mx-agent-bootstrap-completion-contract`
9
- * were both created by hand afterwards.
10
- *
11
- * Every test below names the pre-ruling condition it holds:
12
- *
13
- * M1 a refused table seeds NOTHING, so no name is taken
14
- * M2 `<slug>` is this run's slug; another team's namespace is refused;
15
- * an empty or misshapen suffix is refused
16
- * M3 every anchor goes through the probe-then-create path with the ownership check
17
- * M4 `specByKey` returns a typed failure and never throws
18
- * M5 anchors four and beyond join the one conversation, and the verdict covers N
19
- * M6 parsing runs after the `isPlaceholderRoleguide` exemption
20
- * S1 `create.ts`'s identity regex stays static, byte for byte
21
- * S2 row 13's refusal set does not widen
22
- * S3 the tolerances and the refusals, each against a real file where one exists
23
- * S4 every accepted anchor is printed by name
24
- * S5 seed bodies are generated from the suffix, never from the Content cell
25
- */
26
- import { describe, it, expect } from 'vitest';
27
- import { readFileSync } from 'fs';
28
- import { join, dirname } from 'path';
29
- import { fileURLToPath } from 'url';
30
- import { __testing } from '../commands/create.js';
31
- import { teamMemorySpecs, specByKey, EXTRA_ANCHOR_SUFFIX_RE, } from '../lib/memory.js';
32
- const { parseAnchorTable, validateAnchorRows, anchorStage, anchorRowLetter, safeRowText, MEMORY_KEY_RE, TEAM_MEMORY_SUFFIXES, MAX_ANCHOR_ROWS, } = __testing;
33
- const HERE = dirname(fileURLToPath(import.meta.url));
34
- /** mx-agent-system/, from cli/src/__tests__/. */
35
- const SYSTEM = join(HERE, '..', '..', '..');
36
- function readSystem(rel) {
37
- return readFileSync(join(SYSTEM, rel), 'utf-8');
38
- }
39
- /** A well-formed table for `prefix`, with the three mandatory rows plus `extra`. */
40
- function table(prefix, extra = []) {
41
- return [
42
- '# A Roleguide',
43
- '',
44
- '## Named Memory Anchors',
45
- '',
46
- '| Name | Content | Updated when |',
47
- '|---|---|---|',
48
- `| \`${prefix}-leader-state\` | State | Every change |`,
49
- `| \`${prefix}-iteration-log\` | Log | At close |`,
50
- `| \`${prefix}-known-issues\` | Issues | When found |`,
51
- ...extra.map((sfx) => `| \`${prefix}-${sfx}\` | Whatever | Daily |`),
52
- '',
53
- ].join('\n');
54
- }
55
- // ── S3 tolerances, against the files that ship ───────────────────────────────
56
- /**
57
- * The three live roleguides parse, with the counts asserted.
58
- *
59
- * Not a synthetic fixture, because the point of S3 is that the three files
60
- * DISAGREE with each other on heading level, column casing and separator width,
61
- * and a parser keyed to any one of them refuses a file that ships today.
62
- */
63
- describe('the parser accepts the three live roleguides (S3)', () => {
64
- const cases = [
65
- { file: 'roleguides/bootstrap-leader.md', count: 4, note: '`##` heading, `Updated when`, `|---|`' },
66
- { file: 'roleguides/product-leader.md', count: 3, note: '`##` heading, and a fenced example table below it' },
67
- { file: 'roleguides/surface-leader.md', count: 4, note: '`###` heading, `Updated When`, `|------|`' },
68
- ];
69
- for (const c of cases) {
70
- it(`${c.file} parses to ${c.count} anchors (${c.note})`, () => {
71
- const parsed = parseAnchorTable(readSystem(c.file));
72
- expect(parsed.ok, parsed.ok ? '' : parsed.detail).toBe(true);
73
- if (!parsed.ok)
74
- return;
75
- expect(parsed.rows).toHaveLength(c.count);
76
- });
77
- }
78
- it('bootstrap-leader.md names completion-contract, the anchor that was never seeded', () => {
79
- const parsed = parseAnchorTable(readSystem('roleguides/bootstrap-leader.md'));
80
- expect(parsed.ok).toBe(true);
81
- if (!parsed.ok)
82
- return;
83
- expect(parsed.rows.map((r) => r.name)).toContain('mx-agent-bootstrap-completion-contract');
84
- });
85
- it('surface-leader.md names watch-log, the anchor a human created by hand', () => {
86
- const parsed = parseAnchorTable(readSystem('roleguides/surface-leader.md'));
87
- expect(parsed.ok).toBe(true);
88
- if (!parsed.ok)
89
- return;
90
- expect(parsed.rows.map((r) => r.name)).toContain('mx-agent-surface-watch-log');
91
- });
92
- /**
93
- * Gap 5 of the security re-check. The I3 comment this PR adds sits directly
94
- * ABOVE the table the parser finds by heading, which is exactly the position
95
- * that can break heading matching or table-start detection. So the skeleton is
96
- * in the accept set, read from the file at this head with the comment present.
97
- *
98
- * It parses to three ROWS. Those rows are then REFUSED by the validator,
99
- * because their names still hold `<PROJECT_SLUG>` and `<TEAM>`. That is
100
- * correct and not a contradiction: the skeleton is never provisioned directly.
101
- * `provision` generates a roleguide FROM it and substitutes the tokens first
102
- * (`create.ts` generateRoleguide, `<PROJECT_SLUG>-<TEAM>-` to the real prefix),
103
- * and a roleguide that still held them would be refused at row 13 anyway.
104
- */
105
- it('the skeleton parses to three rows with the new machine-parsed comment present (gap 5)', () => {
106
- const skeleton = readSystem('templates/roleguide-skeleton.md');
107
- expect(skeleton).toContain('MACHINE-PARSED');
108
- const parsed = parseAnchorTable(skeleton);
109
- expect(parsed.ok, parsed.ok ? '' : parsed.detail).toBe(true);
110
- if (!parsed.ok)
111
- return;
112
- expect(parsed.rows).toHaveLength(3);
113
- // The comment line did not become a row, and did not hide the table.
114
- expect(parsed.rows.map((r) => r.name)).toEqual([
115
- '<PROJECT_SLUG>-<TEAM>-leader-state',
116
- '<PROJECT_SLUG>-<TEAM>-iteration-log',
117
- '<PROJECT_SLUG>-<TEAM>-known-issues',
118
- ]);
119
- // And the validator refuses those three rows, which is correct ONLY because
120
- // the skeleton is never provisioned directly. `provision` generates a
121
- // roleguide from it and substitutes `<PROJECT_SLUG>-<TEAM>-` for the real
122
- // prefix first, so the copy the parser reads holds real names.
123
- const v = validateAnchorRows(parsed.rows, {
124
- projectSlug: 'mx-agent', teamSlug: 'newteam', otherSlugs: [],
125
- });
126
- expect(v.ok).toBe(false);
127
- if (v.ok)
128
- return;
129
- expect(v.detail).toContain('still holds a template token');
130
- });
131
- it('tolerates heading level, column casing, separator width and column order', () => {
132
- const body = [
133
- '###### named memory anchors',
134
- '',
135
- '| Updated When | NAME | Content |',
136
- '|:--------:|------|:---|',
137
- '| Daily | `p-t-leader-state` | State |',
138
- '| Daily | `p-t-iteration-log` | Log |',
139
- '| Daily | `p-t-known-issues` | Issues |',
140
- ].join('\n');
141
- const parsed = parseAnchorTable(body);
142
- expect(parsed.ok, parsed.ok ? '' : parsed.detail).toBe(true);
143
- if (!parsed.ok)
144
- return;
145
- expect(parsed.rows.map((r) => r.name)).toEqual([
146
- 'p-t-leader-state', 'p-t-iteration-log', 'p-t-known-issues',
147
- ]);
148
- });
149
- /**
150
- * CRLF. `.gitattributes` records what a repository-wide CRLF rewrite did on
151
- * 2026-08-20: 1,180 working-tree files rewritten, three shipped hooks stopped
152
- * being bash, and two test suites stopped parsing, each failing with a message
153
- * that pointed somewhere other than the line endings.
154
- *
155
- * The same shape applied here: `.` does not match `\r` in JavaScript, so a
156
- * heading line ending `\r` failed `ANCHOR_HEADING_RE` and the parser reported
157
- * "no `Named Memory Anchors` heading" for a roleguide that plainly has one.
158
- * A refusal that names the wrong cause is worse than no refusal, because the
159
- * author edits the heading and nothing changes (red-team Step 6 Minor on #199).
160
- */
161
- it('parses a CRLF roleguide, and does not report it as a missing heading', () => {
162
- const crlf = table('p-t', ['watch-log']).replace(/\n/g, '\r\n');
163
- const parsed = parseAnchorTable(crlf);
164
- expect(parsed.ok, parsed.ok ? '' : parsed.detail).toBe(true);
165
- if (!parsed.ok)
166
- return;
167
- expect(parsed.rows.map((r) => r.name)).toEqual([
168
- 'p-t-leader-state', 'p-t-iteration-log', 'p-t-known-issues', 'p-t-watch-log',
169
- ]);
170
- });
171
- it('a CRLF roleguide validates to the same anchors as its LF twin', () => {
172
- const lf = parseAnchorTable(table('mx-agent-surface', ['watch-log']));
173
- const crlf = parseAnchorTable(table('mx-agent-surface', ['watch-log']).replace(/\n/g, '\r\n'));
174
- expect(lf.ok && crlf.ok).toBe(true);
175
- if (!lf.ok || !crlf.ok)
176
- return;
177
- expect(crlf.rows.map((r) => r.name)).toEqual(lf.rows.map((r) => r.name));
178
- // The raw row kept for a refusal message holds no stray carriage return.
179
- expect(crlf.rows.every((r) => !r.raw.includes('\r'))).toBe(true);
180
- });
181
- it('a CRLF file with a genuinely absent table still reports the absent table', () => {
182
- const parsed = parseAnchorTable('## Named Memory Anchors\r\n\r\nNo table here.\r\n');
183
- expect(parsed.ok).toBe(false);
184
- if (parsed.ok)
185
- return;
186
- expect(parsed.detail).toContain('has no table under it');
187
- });
188
- it('tolerates a comment and prose between the heading and the table', () => {
189
- const body = [
190
- '## Named Memory Anchors',
191
- '',
192
- '<!-- MACHINE-PARSED: provisioning reads the Name column below. -->',
193
- '',
194
- 'Some prose a reader needs.',
195
- '',
196
- '| Name | Content |',
197
- '|---|---|',
198
- '| `p-t-leader-state` | State |',
199
- '| `p-t-iteration-log` | Log |',
200
- '| `p-t-known-issues` | Issues |',
201
- ].join('\n');
202
- const parsed = parseAnchorTable(body);
203
- expect(parsed.ok, parsed.ok ? '' : parsed.detail).toBe(true);
204
- });
205
- });
206
- // ── S3 refusals ──────────────────────────────────────────────────────────────
207
- describe('the parser refuses what it cannot read confidently (S3)', () => {
208
- function refusal(body) {
209
- const parsed = parseAnchorTable(body);
210
- expect(parsed.ok).toBe(false);
211
- return parsed.ok ? '' : parsed.detail;
212
- }
213
- it('refuses two tables under the heading, naming the heading and both lines', () => {
214
- const body = [
215
- '## Named Memory Anchors',
216
- '',
217
- '| Name | Content |',
218
- '|---|---|',
219
- '| `p-t-leader-state` | State |',
220
- '',
221
- '| Name | Content |',
222
- '|---|---|',
223
- '| `p-t-known-issues` | Issues |',
224
- ].join('\n');
225
- const detail = refusal(body);
226
- expect(detail).toContain('2 tables under the `Named Memory Anchors` heading');
227
- expect(detail).toContain('provisioning will not take the first and ignore the rest');
228
- });
229
- it('refuses an absent table under the heading', () => {
230
- expect(refusal('## Named Memory Anchors\n\nNo table here.\n'))
231
- .toContain('has no table under it');
232
- });
233
- it('refuses a roleguide with no anchors heading at all', () => {
234
- expect(refusal('# A Roleguide\n\nNothing about memories.\n'))
235
- .toContain('no `Named Memory Anchors` heading');
236
- });
237
- it('refuses two headings of the same name', () => {
238
- const body = '## Named Memory Anchors\n\n## Named Memory Anchors\n\n| Name |\n|---|\n| `a-b-leader-state` |\n';
239
- expect(refusal(body)).toContain('2 `Named Memory Anchors` headings');
240
- });
241
- it('refuses a prose Name cell, naming the cell and the raw row', () => {
242
- const body = table('p-t').replace('| `p-t-known-issues` | Issues | When found |', '| the usual known issues memory | Issues | When found |');
243
- const detail = refusal(body);
244
- expect(detail).toContain('is not a memory name');
245
- expect(detail).toContain('the usual known issues memory');
246
- });
247
- it('parses an unsubstituted template token as a ROW, and the validator refuses it', () => {
248
- // Two stages on purpose. The parser must still FIND the row, or a test
249
- // cannot prove that a comment above the table did not hide the table
250
- // (gap 5). The validator is what refuses it, naming the raw row.
251
- const body = table('p-t').replace('| `p-t-leader-state` | State | Every change |', '| `<PROJECT_SLUG>-<TEAM>-leader-state` | State | Every change |');
252
- const parsed = parseAnchorTable(body);
253
- expect(parsed.ok, parsed.ok ? '' : parsed.detail).toBe(true);
254
- if (!parsed.ok)
255
- return;
256
- expect(parsed.rows).toHaveLength(3);
257
- const v = validateAnchorRows(parsed.rows, {
258
- projectSlug: 'p', teamSlug: 't', otherSlugs: [],
259
- });
260
- expect(v.ok).toBe(false);
261
- if (v.ok)
262
- return;
263
- expect(v.detail).toContain('still holds a template token');
264
- expect(v.detail).toContain('<PROJECT_SLUG>-<TEAM>-leader-state');
265
- expect(v.detail).toContain('team-builder step 5b');
266
- });
267
- it('refuses an escaped pipe rather than guessing the cell boundary', () => {
268
- const body = table('p-t').replace('| `p-t-known-issues` | Issues | When found |', '| `p-t-known-issues` | Issues \\| defects | When found |');
269
- expect(refusal(body)).toContain('escaped `\\|` this parser will not resolve');
270
- });
271
- it('refuses a pipe inside a code span rather than splitting through it', () => {
272
- const body = table('p-t').replace('| `p-t-known-issues` | Issues | When found |', '| `p-t-known-issues` | see `a | b` | When found |');
273
- expect(refusal(body)).toContain('inside a code span this parser will not resolve');
274
- });
275
- it('refuses a row missing its trailing pipe', () => {
276
- const body = table('p-t').replace('| `p-t-known-issues` | Issues | When found |', '| `p-t-known-issues` | Issues | When found');
277
- // The unterminated line ends the table group, so what follows is either a
278
- // cell-count refusal or a group refusal. Either way it is refused and named.
279
- const detail = refusal(body);
280
- expect(detail).toMatch(/does not open and close with|cells, the header has/);
281
- });
282
- it('refuses a row whose cell count differs from the header', () => {
283
- const body = table('p-t').replace('| `p-t-known-issues` | Issues | When found |', '| `p-t-known-issues` | Issues |');
284
- expect(refusal(body)).toContain('has 2 cells, the header has 3');
285
- });
286
- it('refuses a table with no Name column', () => {
287
- const body = [
288
- '## Named Memory Anchors',
289
- '',
290
- '| Memory | Content |',
291
- '|---|---|',
292
- '| `p-t-leader-state` | State |',
293
- ].join('\n');
294
- expect(refusal(body)).toContain('no `Name` column');
295
- });
296
- it(`refuses more than ${MAX_ANCHOR_ROWS} rows`, () => {
297
- const many = Array.from({ length: MAX_ANCHOR_ROWS + 1 }, (_, k) => `extra-${k}`);
298
- expect(refusal(table('p-t', many))).toContain(`more than ${MAX_ANCHOR_ROWS} anchors`);
299
- });
300
- it('an empty Name cell is refused, not read as a blank anchor', () => {
301
- const body = table('p-t').replace('| `p-t-known-issues` | Issues | When found |', '| | Issues | When found |');
302
- expect(refusal(body)).toContain('has an empty Name cell');
303
- });
304
- });
305
- // ── M2 ───────────────────────────────────────────────────────────────────────
306
- describe('validation binds <slug> to this run and refuses another namespace (M2)', () => {
307
- function validate(body, i = {}) {
308
- const parsed = parseAnchorTable(body);
309
- expect(parsed.ok, parsed.ok ? '' : parsed.detail).toBe(true);
310
- if (!parsed.ok)
311
- throw new Error('unreachable');
312
- return validateAnchorRows(parsed.rows, {
313
- projectSlug: i.projectSlug ?? 'mx-agent',
314
- teamSlug: i.teamSlug ?? 'rehearsal',
315
- otherSlugs: i.otherSlugs ?? [],
316
- });
317
- }
318
- it('accepts the three plus an extra for this run\'s slug', () => {
319
- const v = validate(table('mx-agent-rehearsal', ['watch-log']));
320
- expect(v.ok).toBe(true);
321
- if (!v.ok)
322
- return;
323
- expect(v.anchors.map((a) => a.suffix)).toEqual([
324
- 'leader-state', 'iteration-log', 'known-issues', 'watch-log',
325
- ]);
326
- });
327
- /**
328
- * CHECK 2. `^<projectSlug>-<slug>-[a-z0-9-]+$` matches
329
- * `mx-agent-rehearsal-qa34-leader-state` when provisioning `rehearsal`, with
330
- * suffix `qa34-leader-state`, and that string is the `rehearsal-qa34` team's
331
- * leader-state anchor.
332
- *
333
- * The colliding slug is built in this fixture's catalog list rather than read
334
- * from the repository: `rehearsal-qa34-leader.md` in the lead's worktree is an
335
- * untracked, gitignored rehearsal leftover, not a catalog team (plan revision
336
- * 3). The SHAPE is what is real, and it is what this asserts.
337
- */
338
- it('refuses the pre-ruling\'s worked example, catalog or no catalog', () => {
339
- const body = table('mx-agent-rehearsal', ['qa34-leader-state']);
340
- // Refused for all three catalog states now, because check 4 reaches it
341
- // first. Strictly stronger than the catalog rule it used to depend on.
342
- for (const otherSlugs of [['rehearsal-qa34', 'product'], ['product'], []]) {
343
- const only = validate(body, { otherSlugs });
344
- expect(only.ok, `otherSlugs=${JSON.stringify(otherSlugs)}`).toBe(false);
345
- }
346
- const v = validate(body, { otherSlugs: ['rehearsal-qa34', 'product'] });
347
- expect(v.ok).toBe(false);
348
- if (v.ok)
349
- return;
350
- expect(v.detail).toContain('mx-agent-rehearsal-qa34-leader-state');
351
- });
352
- /**
353
- * CHECK 2 ON ITS OWN, with a suffix check 4 does not reach.
354
- *
355
- * Check 4 now catches every universal-suffix tail before check 2 sees it, so
356
- * the pre-ruling's worked example above no longer exercises the catalog rule.
357
- * This does: `qa34-watch-log` ends in nothing universal, so only the catalog
358
- * can tell that `mx-agent-rehearsal-qa34-watch-log` belongs to another team.
359
- */
360
- it('refuses a non-universal name inside another catalog slug\'s namespace (check 2)', () => {
361
- const v = validate(table('mx-agent-rehearsal', ['qa34-watch-log']), {
362
- otherSlugs: ['rehearsal-qa34', 'product'],
363
- });
364
- expect(v.ok).toBe(false);
365
- if (v.ok)
366
- return;
367
- expect(v.detail).toContain('mx-agent-rehearsal-qa34-watch-log');
368
- expect(v.detail).toContain("is in the `rehearsal-qa34` team's namespace");
369
- expect(v.detail).toContain('mx-agent-rehearsal-qa34-');
370
- });
371
- /**
372
- * THE REVERSE DIRECTION, and it is the one that breaks a real creation.
373
- *
374
- * The forward case above protects the SHORTER slug's run: provisioning
375
- * `rehearsal` must not take a name belonging to `rehearsal-qa34`. Applying the
376
- * same rule to the LONGER slug's run inverts it. Team `rehearsal-qa34`'s own
377
- * mandatory anchor `mx-agent-rehearsal-qa34-leader-state` does start with
378
- * `mx-agent-rehearsal-`, so a rule keyed on `startsWith` alone refuses it, and
379
- * because validation is all-or-nothing (M1) that refuses every row including
380
- * the three. `provision rehearsal-qa34` could then never succeed while
381
- * `rehearsal` stays in the catalog, with no workaround short of renaming the
382
- * team (red-team Step 6 Major on PR #199).
383
- */
384
- it('accepts a team whose slug EXTENDS an existing catalog slug (red-team Major)', () => {
385
- const v = validate(table('mx-agent-rehearsal-qa34'), {
386
- teamSlug: 'rehearsal-qa34',
387
- otherSlugs: ['rehearsal', 'rehearsal-qa34', 'product'],
388
- });
389
- expect(v.ok, v.ok ? '' : v.detail).toBe(true);
390
- if (!v.ok)
391
- return;
392
- expect(v.anchors.map((a) => a.name)).toEqual([
393
- 'mx-agent-rehearsal-qa34-leader-state',
394
- 'mx-agent-rehearsal-qa34-iteration-log',
395
- 'mx-agent-rehearsal-qa34-known-issues',
396
- ]);
397
- });
398
- it('still refuses a THIRD team\'s namespace when this slug extends another', () => {
399
- // `rehearsal-qa34` provisioning a name that belongs to `rehearsal-qa34-sub`
400
- // is still the forward case, and still refused.
401
- const v = validate(table('mx-agent-rehearsal-qa34', ['sub-watch-log']), {
402
- teamSlug: 'rehearsal-qa34',
403
- otherSlugs: ['rehearsal', 'rehearsal-qa34-sub'],
404
- });
405
- expect(v.ok).toBe(false);
406
- if (v.ok)
407
- return;
408
- expect(v.detail).toContain("is in the `rehearsal-qa34-sub` team's namespace");
409
- });
410
- /**
411
- * REPLACED EXPECTATION, and the replacement is the finding.
412
- *
413
- * This asserted that `mx-agent-rehearsal-qa34-leader-state` was ACCEPTED when
414
- * no other slug claimed it. That was the fail-open the security review
415
- * measured: the same row was accepted or refused depending on whether an
416
- * unrelated team had been created yet. Check 4 refuses it either way, so the
417
- * name `rehearsal-qa34` will need can no longer be squatted by `rehearsal`
418
- * just because `rehearsal-qa34` does not exist yet.
419
- */
420
- it('refuses a universal-suffix name even when no other slug claims it', () => {
421
- const v = validate(table('mx-agent-rehearsal', ['qa34-leader-state']), { otherSlugs: ['product'] });
422
- expect(v.ok).toBe(false);
423
- if (v.ok)
424
- return;
425
- expect(v.detail).toContain('whose suffix ends in `leader-state`');
426
- });
427
- it('accepts a non-universal name when no other slug claims it (check 2 is catalog-scoped)', () => {
428
- const v = validate(table('mx-agent-rehearsal', ['qa34-watch-log']), { otherSlugs: ['product'] });
429
- expect(v.ok, v.ok ? '' : v.detail).toBe(true);
430
- });
431
- it('refuses a name under another team entirely', () => {
432
- const body = table('mx-agent-rehearsal').replace('| `mx-agent-rehearsal-known-issues` | Issues | When found |', '| `mx-agent-surface-known-issues` | Issues | When found |');
433
- const v = validate(body);
434
- expect(v.ok).toBe(false);
435
- if (v.ok)
436
- return;
437
- expect(v.detail).toContain('is not one of this team\'s anchors');
438
- expect(v.detail).toContain('must start with `mx-agent-rehearsal-`');
439
- });
440
- /**
441
- * CHECK 3, dropped between plan revisions and restored by the security
442
- * re-check (gap 4). `[a-z0-9-]+` excludes only the empty string, so
443
- * `mx-agent-rehearsal--` and `mx-agent-rehearsal--foo` both pass it.
444
- */
445
- it.each([
446
- ['a doubled hyphen', 'mx-agent-rehearsal--foo'],
447
- ['a trailing hyphen', 'mx-agent-rehearsal-foo-'],
448
- ['an all-hyphen suffix', 'mx-agent-rehearsal--'],
449
- ])('refuses %s (M2 check 3)', (_label, name) => {
450
- const body = table('mx-agent-rehearsal').replace('| `mx-agent-rehearsal-known-issues` | Issues | When found |', `| \`${name}\` | Issues | When found |\n| \`mx-agent-rehearsal-known-issues\` | Issues | When found |`);
451
- const parsed = parseAnchorTable(body);
452
- if (!parsed.ok) {
453
- // A trailing hyphen fails the name shape at the parser, which is the same
454
- // refusal one step earlier. Either place is a refusal that names the row.
455
- expect(parsed.detail).toContain(name);
456
- return;
457
- }
458
- const v = validateAnchorRows(parsed.rows, {
459
- projectSlug: 'mx-agent', teamSlug: 'rehearsal', otherSlugs: [],
460
- });
461
- expect(v.ok).toBe(false);
462
- if (v.ok)
463
- return;
464
- expect(v.detail).toContain('is empty or misshapen');
465
- });
466
- /**
467
- * CHECK 4, and the three cases in one test.
468
- *
469
- * Check 2 can only refuse a team the catalog already holds. So the SAME row
470
- * was accepted or refused depending on whether an unrelated team had been
471
- * created yet, and on a project with no catalog directory `listTeams` returns
472
- * `[]` and check 2 compares against nothing. Check 4 does not consult the
473
- * catalog: no extra anchor legitimately ends in a universal suffix, so a name
474
- * that does is another team's mandatory anchor wearing this slug as a prefix
475
- * (security review Should Fix 1 at 5429572939).
476
- */
477
- describe('a universal suffix in an extra anchor is refused without consulting the catalog (check 4)', () => {
478
- const rowName = 'mx-agent-rehearsal-newteam-leader-state';
479
- it.each([
480
- ['the colliding slug is ABSENT from the catalog', ['product']],
481
- ['the colliding slug is PRESENT in the catalog', ['product', 'rehearsal-newteam']],
482
- ['the catalog is empty', []],
483
- ])('refuses it when %s', (_label, otherSlugs) => {
484
- const v = validate(table('mx-agent-rehearsal', ['newteam-leader-state']), { otherSlugs });
485
- expect(v.ok).toBe(false);
486
- if (v.ok)
487
- return;
488
- expect(v.detail).toContain(rowName);
489
- expect(v.detail).toContain('whose suffix ends in `leader-state`');
490
- });
491
- it('refuses a suffix ending in each of the three universal anchors', () => {
492
- for (const tail of ['leader-state', 'iteration-log', 'known-issues']) {
493
- const v = validate(table('mx-agent-rehearsal', [`newteam-${tail}`]));
494
- expect(v.ok, `${tail} should refuse`).toBe(false);
495
- if (!v.ok)
496
- expect(v.detail).toContain(`whose suffix ends in \`${tail}\``);
497
- }
498
- });
499
- /**
500
- * The three mandatory anchors have suffix exactly `leader-state` and so on,
501
- * with no leading hyphen, so `endsWith('-' + s)` does not match them. If it
502
- * did, check 4 would refuse every roleguide in the repository.
503
- */
504
- it('does not refuse the three mandatory anchors themselves', () => {
505
- const v = validate(table('mx-agent-rehearsal'));
506
- expect(v.ok, v.ok ? '' : v.detail).toBe(true);
507
- });
508
- it('does not refuse the extra anchors that ship today', () => {
509
- // Measured in the security review: every extra anchor in this repository
510
- // and in the example roleguide.
511
- const shipped = [
512
- 'completion-contract', 'watch-log', 'consumer-baseline', 'iteration-report',
513
- 'consumer-feedback', 'dogfood-findings', 'token-metrics',
514
- 'async-experiment-log', 'provisioning-checklist',
515
- ];
516
- const v = validate(table('mx-agent-rehearsal', shipped));
517
- expect(v.ok, v.ok ? '' : v.detail).toBe(true);
518
- if (!v.ok)
519
- return;
520
- expect(v.anchors).toHaveLength(3 + shipped.length);
521
- });
522
- });
523
- it('refuses a table that drops one of the three, naming it', () => {
524
- const body = table('mx-agent-rehearsal').replace('| `mx-agent-rehearsal-iteration-log` | Log | At close |\n', '');
525
- const v = validate(body);
526
- expect(v.ok).toBe(false);
527
- if (v.ok)
528
- return;
529
- expect(v.detail).toContain('mx-agent-rehearsal-iteration-log');
530
- expect(v.detail).toContain('does not name');
531
- });
532
- it('refuses the same name twice', () => {
533
- const body = table('mx-agent-rehearsal', ['watch-log', 'watch-log']);
534
- const v = validate(body);
535
- expect(v.ok).toBe(false);
536
- if (v.ok)
537
- return;
538
- expect(v.detail).toContain('a second time');
539
- });
540
- it('binds the prefix to the unprefixed form when no project slug is configured', () => {
541
- const v = validate(table('rehearsal', ['watch-log']), { projectSlug: '' });
542
- expect(v.ok).toBe(true);
543
- if (!v.ok)
544
- return;
545
- expect(v.anchors.map((a) => a.name)).toContain('rehearsal-watch-log');
546
- });
547
- });
548
- // ── M6 ───────────────────────────────────────────────────────────────────────
549
- describe('parsing runs after the placeholder exemption (M6)', () => {
550
- it('reports exempt for the bundled team-builder roleguide, without reading it', () => {
551
- const stage = anchorStage({
552
- // A path that does not exist. Reaching the filesystem at all would fail
553
- // here, which is what makes "never parsed" checkable rather than asserted.
554
- roleguideInWorktree: '/nonexistent/team-builder.md',
555
- unfilledPlaceholdersAllowed: true,
556
- willRefuseAtRow13: false,
557
- projectSlug: 'mx-agent',
558
- teamSlug: 'team-builder',
559
- otherSlugs: [],
560
- });
561
- expect(stage.kind).toBe('exempt');
562
- });
563
- it('the bundled team-builder roleguide would otherwise be refused, which is why order matters', () => {
564
- // It has no anchors table: it says in prose that it has no anchors of its
565
- // own, and names one only inside a checklist item.
566
- const parsed = parseAnchorTable(readSystem('roleguides/team-builder.md'));
567
- expect(parsed.ok).toBe(false);
568
- if (parsed.ok)
569
- return;
570
- expect(parsed.detail).toContain('no `Named Memory Anchors` heading');
571
- });
572
- it('does not parse when row 13 already refuses the run', () => {
573
- const stage = anchorStage({
574
- roleguideInWorktree: '/nonexistent/x.md',
575
- unfilledPlaceholdersAllowed: false,
576
- willRefuseAtRow13: true,
577
- projectSlug: 'mx-agent',
578
- teamSlug: 'newteam',
579
- otherSlugs: [],
580
- });
581
- expect(stage.kind).toBe('not-reached');
582
- });
583
- /**
584
- * `listTeams` calls `readdirSync` after an `existsSync`, so a directory that
585
- * exists but cannot be read throws. Null and `[]` are different answers: an
586
- * empty catalog is a positive reading, an unreadable one establishes nothing,
587
- * and check 2 cannot be evaluated against nothing.
588
- */
589
- it('reports could-not-run when the catalog could not be read (null, not [])', () => {
590
- const stage = anchorStage({
591
- roleguideInWorktree: null,
592
- unfilledPlaceholdersAllowed: false,
593
- willRefuseAtRow13: false,
594
- projectSlug: 'mx-agent',
595
- teamSlug: 'newteam',
596
- otherSlugs: null,
597
- });
598
- expect(stage.kind).toBe('could-not-run');
599
- });
600
- it('reports could-not-run, not "no anchors", when the file cannot be read', () => {
601
- const stage = anchorStage({
602
- roleguideInWorktree: '/nonexistent/x.md',
603
- unfilledPlaceholdersAllowed: false,
604
- willRefuseAtRow13: false,
605
- projectSlug: 'mx-agent',
606
- teamSlug: 'newteam',
607
- otherSlugs: [],
608
- });
609
- expect(stage.kind).toBe('could-not-run');
610
- });
611
- });
612
- // ── S1 and S2 ────────────────────────────────────────────────────────────────
613
- describe('the identity regex and the suffix set stay static (S1, S2)', () => {
614
- /**
615
- * PINNED BYTE FOR BYTE. `checkRoleguideIdentity` builds its scan from a regex
616
- * literal carrying measured backtracking bounds (10 KB 37 ms through 200 KB
617
- * 14.9 s before it was bounded, against a 1 MiB `MAX_ROLEGUIDE_BYTES`).
618
- * Deriving its alternation from a table read out of a file would mean
619
- * constructing that regex at runtime from file content. The pre-ruling's S1
620
- * says leave it static; this test is what makes "left static" checkable.
621
- */
622
- it('MEMORY_KEY_RE is unchanged', () => {
623
- expect(MEMORY_KEY_RE.source).toBe('(?<![A-Za-z0-9_<>-])[A-Za-z0-9_<>-]{0,128}-(?:leader-state|iteration-log|known-issues)(?![A-Za-z0-9_<>-])');
624
- expect(MEMORY_KEY_RE.flags).toBe('g');
625
- });
626
- it('TEAM_MEMORY_SUFFIXES still holds exactly the three universal anchors', () => {
627
- expect([...TEAM_MEMORY_SUFFIXES]).toEqual(['leader-state', 'iteration-log', 'known-issues']);
628
- });
629
- /**
630
- * S2, the false-refusal direction. Widening the suffix set would make a
631
- * roleguide that legitimately mentions a peer team's anchor in prose a row-13
632
- * mismatch, which `AGENTS.md` positively encourages teams to write. The set
633
- * did not widen, so this stays as it was.
634
- */
635
- it('a roleguide naming a peer team\'s extra anchor in prose is not a mismatch', () => {
636
- const text = [
637
- 'Check the surface team through `mx-agent-surface-watch-log`.',
638
- 'Our own state is `mx-agent-bootstrap-leader-state`.',
639
- ].join('\n');
640
- const mismatches = __testing.checkRoleguideIdentity(text, 'bootstrap', 'mx-agent');
641
- expect(mismatches).toEqual([]);
642
- });
643
- it('extra anchors are not counted as unfilled placeholders', () => {
644
- const text = table('mx-agent-surface', ['watch-log']);
645
- expect(__testing.remainingPlaceholders(text)).toEqual([]);
646
- expect(__testing.checkRoleguideIdentity(text, 'surface', 'mx-agent')).toEqual([]);
647
- });
648
- });
649
- // ── M4 ───────────────────────────────────────────────────────────────────────
650
- describe('specByKey is a typed failure, not an unchecked cast (M4)', () => {
651
- const specs = teamMemorySpecs('newteam', 'Newteam', 'rg.md', 'mx-agent', {
652
- extraAnchorSuffixes: ['watch-log'],
653
- });
654
- it('resolves each of the three universal keys', () => {
655
- for (const key of ['leaderState', 'iterationLog', 'knownIssues']) {
656
- expect(specByKey(specs, key)?.key).toBe(key);
657
- }
658
- });
659
- it('resolves an extra key', () => {
660
- expect(specByKey(specs, 'extra:watch-log')?.name).toBe('mx-agent-newteam-watch-log');
661
- });
662
- it('returns null for an unknown key and never throws', () => {
663
- expect(() => specByKey(specs, 'extra:nope')).not.toThrow();
664
- expect(specByKey(specs, 'extra:nope')).toBeNull();
665
- // The shape the old `as TeamMemorySpec` cast produced: `undefined` returned
666
- // as a spec, then `spec.name` read off it, a TypeError mid-provision.
667
- expect(() => specByKey(specs, 'extra:nope')?.name).not.toThrow();
668
- });
669
- });
670
- // ── S5 ───────────────────────────────────────────────────────────────────────
671
- describe('seed bodies are generated from the suffix (S5)', () => {
672
- const LONG_CELL = 'word '.repeat(3000);
673
- it('builds an extra spec whose content never holds the Content cell', () => {
674
- const specs = teamMemorySpecs('surface', 'Surface', 'rg.md', 'mx-agent', {
675
- extraAnchorSuffixes: ['watch-log'],
676
- });
677
- const spec = specByKey(specs, 'extra:watch-log');
678
- expect(spec.name).toBe('mx-agent-surface-watch-log');
679
- expect(spec.content).toContain('mx-agent-surface-watch-log');
680
- expect(spec.content).toContain('Watch Log');
681
- expect(spec.content).not.toContain(LONG_CELL.slice(0, 40));
682
- // Well under the ~2000-word cap named at `lib/memory.ts` teamMemorySpecs.
683
- expect(spec.content.split(/\s+/).length).toBeLessThan(200);
684
- });
685
- it('a 3000-word Content cell reaches no memory: the table supplies the name only', () => {
686
- const body = [
687
- '## Named Memory Anchors',
688
- '',
689
- '| Name | Content | Updated when |',
690
- '|---|---|---|',
691
- '| `mx-agent-surface-leader-state` | State | Every change |',
692
- '| `mx-agent-surface-iteration-log` | Log | At close |',
693
- '| `mx-agent-surface-known-issues` | Issues | When found |',
694
- `| \`mx-agent-surface-watch-log\` | ${LONG_CELL.trim()} | Daily |`,
695
- ].join('\n');
696
- const parsed = parseAnchorTable(body);
697
- expect(parsed.ok, parsed.ok ? '' : parsed.detail).toBe(true);
698
- if (!parsed.ok)
699
- return;
700
- const v = validateAnchorRows(parsed.rows, {
701
- projectSlug: 'mx-agent', teamSlug: 'surface', otherSlugs: [],
702
- });
703
- expect(v.ok).toBe(true);
704
- if (!v.ok)
705
- return;
706
- const specs = teamMemorySpecs('surface', 'Surface', 'rg.md', 'mx-agent', {
707
- extraAnchorSuffixes: v.anchors.filter((a) => a.suffix === 'watch-log').map((a) => a.suffix),
708
- });
709
- const spec = specByKey(specs, 'extra:watch-log');
710
- expect(spec.content).not.toContain(LONG_CELL.slice(0, 40));
711
- });
712
- it('drops a suffix that never passed the validator, rather than naming a memory from it', () => {
713
- const specs = teamMemorySpecs('surface', 'Surface', 'rg.md', 'mx-agent', {
714
- extraAnchorSuffixes: ['watch-log', 'BAD Suffix', 'leader-state'],
715
- });
716
- expect(specs.map((s) => s.key)).toEqual([
717
- 'leaderState', 'iterationLog', 'knownIssues', 'extra:watch-log',
718
- ]);
719
- });
720
- it('EXTRA_ANCHOR_SUFFIX_RE is the shape both files apply', () => {
721
- expect(EXTRA_ANCHOR_SUFFIX_RE.test('watch-log')).toBe(true);
722
- expect(EXTRA_ANCHOR_SUFFIX_RE.test('completion-contract')).toBe(true);
723
- for (const bad of ['', '-foo', 'foo-', 'foo--bar', 'Foo', 'foo bar', 'foo;rm']) {
724
- expect(EXTRA_ANCHOR_SUFFIX_RE.test(bad), bad).toBe(false);
725
- }
726
- });
727
- });
728
- // ── I2 / S4 formatting ───────────────────────────────────────────────────────
729
- describe('row numbering and printed output (I2, S4)', () => {
730
- it('numbers extras a, b, c, ... and keeps going past z', () => {
731
- expect(anchorRowLetter(0)).toBe('a');
732
- expect(anchorRowLetter(1)).toBe('b');
733
- expect(anchorRowLetter(25)).toBe('z');
734
- expect(anchorRowLetter(26)).toBe('aa');
735
- });
736
- it('strips control characters from a raw row before printing it', () => {
737
- const raw = '| `p-t-x` | red |  |';
738
- const safe = safeRowText(raw);
739
- expect(safe).not.toContain('');
740
- expect(safe).not.toContain('');
741
- expect(safe).toContain('p-t-x');
742
- });
743
- it('truncates a very long row rather than printing a screenful', () => {
744
- expect(safeRowText('| x '.repeat(500) + '|').length).toBeLessThanOrEqual(170);
745
- });
746
- });
747
- //# sourceMappingURL=provision-roleguide-anchors.test.js.map