muonroi-cli 1.8.1 → 1.8.3

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 (971) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +122 -122
  3. package/dist/src/cli/cost-forensics.js +12 -12
  4. package/dist/src/council/prompts.js +20 -20
  5. package/dist/src/generated/version.d.ts +1 -1
  6. package/dist/src/generated/version.js +1 -1
  7. package/dist/src/mcp/oauth-callback.js +2 -2
  8. package/dist/src/mcp/setup-guide-text.d.ts +1 -1
  9. package/dist/src/mcp/setup-guide-text.js +76 -74
  10. package/dist/src/ops/doctor.js +7 -7
  11. package/dist/src/orchestrator/orchestrator.js +22 -13
  12. package/dist/src/orchestrator/prompts.js +159 -159
  13. package/dist/src/pil/layer1-intent.js +37 -37
  14. package/dist/src/pil/layer2_5-ponytail.js +8 -8
  15. package/dist/src/product-loop/done-gate.js +3 -3
  16. package/dist/src/product-loop/loop-driver.js +18 -18
  17. package/dist/src/product-loop/progress-snapshot.js +4 -4
  18. package/dist/src/providers/mcp-vision-bridge.js +48 -48
  19. package/dist/src/reporter/index.js +1 -1
  20. package/dist/src/scaffold/bb-ecosystem-apply.js +47 -47
  21. package/dist/src/scaffold/bb-quality-gate.js +5 -5
  22. package/dist/src/scaffold/continuation-prompt.js +60 -60
  23. package/dist/src/scaffold/init-new.js +453 -453
  24. package/dist/src/self-qa/agentic-loop.js +19 -19
  25. package/dist/src/storage/interaction-log.js +5 -5
  26. package/dist/src/storage/migrations.js +125 -125
  27. package/dist/src/storage/session-experience-store.js +4 -4
  28. package/dist/src/storage/sessions.js +43 -43
  29. package/dist/src/storage/transcript.js +100 -100
  30. package/dist/src/storage/usage.js +14 -14
  31. package/dist/src/storage/workspaces.js +12 -12
  32. package/dist/src/ui/slash/council-inspect.js +4 -4
  33. package/dist/src/utils/clipboard-image.js +23 -23
  34. package/dist/src/utils/install-manager.d.ts +1 -0
  35. package/dist/src/utils/install-manager.js +29 -0
  36. package/dist/src/utils/side-question.js +2 -2
  37. package/dist/src/utils/skills.js +3 -3
  38. package/dist/src/utils/update-checker.js +12 -2
  39. package/package.json +8 -1
  40. package/dist/src/__test-helpers__/catalog-fixtures.d.ts +0 -22
  41. package/dist/src/__test-helpers__/catalog-fixtures.js +0 -55
  42. package/dist/src/__test-stubs__/ee-server.d.ts +0 -27
  43. package/dist/src/__test-stubs__/ee-server.js +0 -138
  44. package/dist/src/__test-stubs__/vitest-setup.d.ts +0 -1
  45. package/dist/src/__test-stubs__/vitest-setup.js +0 -38
  46. package/dist/src/__tests__/council/bubble-layout.test.d.ts +0 -1
  47. package/dist/src/__tests__/council/bubble-layout.test.js +0 -39
  48. package/dist/src/__tests__/council/code-block-truncate.test.d.ts +0 -1
  49. package/dist/src/__tests__/council/code-block-truncate.test.js +0 -45
  50. package/dist/src/__tests__/council/role-palette.test.d.ts +0 -1
  51. package/dist/src/__tests__/council/role-palette.test.js +0 -59
  52. package/dist/src/__tests__/first-run-wizard.test.d.ts +0 -1
  53. package/dist/src/__tests__/first-run-wizard.test.js +0 -9
  54. package/dist/src/agent-harness/__tests__/cli-flags.spec.d.ts +0 -1
  55. package/dist/src/agent-harness/__tests__/cli-flags.spec.js +0 -33
  56. package/dist/src/agent-harness/__tests__/driver.spec.d.ts +0 -1
  57. package/dist/src/agent-harness/__tests__/driver.spec.js +0 -141
  58. package/dist/src/agent-harness/__tests__/idle.spec.d.ts +0 -1
  59. package/dist/src/agent-harness/__tests__/idle.spec.js +0 -84
  60. package/dist/src/agent-harness/__tests__/mock-llm.spec.d.ts +0 -1
  61. package/dist/src/agent-harness/__tests__/mock-llm.spec.js +0 -91
  62. package/dist/src/agent-harness/__tests__/mock-model.spec.d.ts +0 -5
  63. package/dist/src/agent-harness/__tests__/mock-model.spec.js +0 -270
  64. package/dist/src/agent-harness/__tests__/predicate.spec.d.ts +0 -1
  65. package/dist/src/agent-harness/__tests__/predicate.spec.js +0 -27
  66. package/dist/src/agent-harness/__tests__/protocol.spec.d.ts +0 -1
  67. package/dist/src/agent-harness/__tests__/protocol.spec.js +0 -56
  68. package/dist/src/agent-harness/__tests__/schema.spec.d.ts +0 -1
  69. package/dist/src/agent-harness/__tests__/schema.spec.js +0 -76
  70. package/dist/src/agent-harness/__tests__/selector.spec.d.ts +0 -1
  71. package/dist/src/agent-harness/__tests__/selector.spec.js +0 -70
  72. package/dist/src/agent-harness/__tests__/sidechannel.spec.d.ts +0 -1
  73. package/dist/src/agent-harness/__tests__/sidechannel.spec.js +0 -29
  74. package/dist/src/agent-harness/__tests__/spec-helpers.spec.d.ts +0 -1
  75. package/dist/src/agent-harness/__tests__/spec-helpers.spec.js +0 -68
  76. package/dist/src/chat/__tests__/broadcast-bus.test.d.ts +0 -1
  77. package/dist/src/chat/__tests__/broadcast-bus.test.js +0 -81
  78. package/dist/src/chat/__tests__/channel-manager.test.d.ts +0 -1
  79. package/dist/src/chat/__tests__/channel-manager.test.js +0 -133
  80. package/dist/src/chat/__tests__/client.test.d.ts +0 -1
  81. package/dist/src/chat/__tests__/client.test.js +0 -109
  82. package/dist/src/chat/__tests__/discord-integration.test.d.ts +0 -1
  83. package/dist/src/chat/__tests__/discord-integration.test.js +0 -153
  84. package/dist/src/chat/__tests__/intent-prompt.test.d.ts +0 -1
  85. package/dist/src/chat/__tests__/intent-prompt.test.js +0 -80
  86. package/dist/src/chat/__tests__/verdict-resolver.test.d.ts +0 -1
  87. package/dist/src/chat/__tests__/verdict-resolver.test.js +0 -308
  88. package/dist/src/cli/__tests__/bw-vault.test.d.ts +0 -1
  89. package/dist/src/cli/__tests__/bw-vault.test.js +0 -87
  90. package/dist/src/cli/__tests__/keys-bundle.test.d.ts +0 -1
  91. package/dist/src/cli/__tests__/keys-bundle.test.js +0 -40
  92. package/dist/src/cli/__tests__/share-cmd.test.d.ts +0 -1
  93. package/dist/src/cli/__tests__/share-cmd.test.js +0 -175
  94. package/dist/src/cli/config/__tests__/model-picker.test.d.ts +0 -1
  95. package/dist/src/cli/config/__tests__/model-picker.test.js +0 -56
  96. package/dist/src/cli/config/__tests__/provider-fetch.test.d.ts +0 -1
  97. package/dist/src/cli/config/__tests__/provider-fetch.test.js +0 -38
  98. package/dist/src/cli/cost-forensics.test.d.ts +0 -1
  99. package/dist/src/cli/cost-forensics.test.js +0 -223
  100. package/dist/src/cli/experience-report.test.d.ts +0 -5
  101. package/dist/src/cli/experience-report.test.js +0 -63
  102. package/dist/src/cli/keys.test.d.ts +0 -1
  103. package/dist/src/cli/keys.test.js +0 -86
  104. package/dist/src/council/__tests__/abort-threading.test.d.ts +0 -1
  105. package/dist/src/council/__tests__/abort-threading.test.js +0 -193
  106. package/dist/src/council/__tests__/accounting.test.d.ts +0 -1
  107. package/dist/src/council/__tests__/accounting.test.js +0 -66
  108. package/dist/src/council/__tests__/audit-replay.test.d.ts +0 -1
  109. package/dist/src/council/__tests__/audit-replay.test.js +0 -241
  110. package/dist/src/council/__tests__/clarification-prompt.test.d.ts +0 -1
  111. package/dist/src/council/__tests__/clarification-prompt.test.js +0 -71
  112. package/dist/src/council/__tests__/clarifier-max-rounds.test.d.ts +0 -1
  113. package/dist/src/council/__tests__/clarifier-max-rounds.test.js +0 -46
  114. package/dist/src/council/__tests__/clarifier-options.test.d.ts +0 -1
  115. package/dist/src/council/__tests__/clarifier-options.test.js +0 -54
  116. package/dist/src/council/__tests__/clarifier-ready-gate.test.d.ts +0 -1
  117. package/dist/src/council/__tests__/clarifier-ready-gate.test.js +0 -265
  118. package/dist/src/council/__tests__/cost-aware.test.d.ts +0 -1
  119. package/dist/src/council/__tests__/cost-aware.test.js +0 -49
  120. package/dist/src/council/__tests__/council-turn-length-emit.test.d.ts +0 -1
  121. package/dist/src/council/__tests__/council-turn-length-emit.test.js +0 -130
  122. package/dist/src/council/__tests__/debate-planner-structured.test.d.ts +0 -1
  123. package/dist/src/council/__tests__/debate-planner-structured.test.js +0 -209
  124. package/dist/src/council/__tests__/debate-round-budget.test.d.ts +0 -1
  125. package/dist/src/council/__tests__/debate-round-budget.test.js +0 -45
  126. package/dist/src/council/__tests__/decisions-lock.test.d.ts +0 -6
  127. package/dist/src/council/__tests__/decisions-lock.test.js +0 -352
  128. package/dist/src/council/__tests__/evaluator-metrics.test.d.ts +0 -1
  129. package/dist/src/council/__tests__/evaluator-metrics.test.js +0 -463
  130. package/dist/src/council/__tests__/oauth-reachable.test.d.ts +0 -1
  131. package/dist/src/council/__tests__/oauth-reachable.test.js +0 -31
  132. package/dist/src/council/__tests__/parse-outcome-fallback.test.d.ts +0 -1
  133. package/dist/src/council/__tests__/parse-outcome-fallback.test.js +0 -114
  134. package/dist/src/council/__tests__/post-debate-recommendation.test.d.ts +0 -1
  135. package/dist/src/council/__tests__/post-debate-recommendation.test.js +0 -58
  136. package/dist/src/council/__tests__/research-tools.test.d.ts +0 -1
  137. package/dist/src/council/__tests__/research-tools.test.js +0 -214
  138. package/dist/src/council/__tests__/round-tools.test.d.ts +0 -1
  139. package/dist/src/council/__tests__/round-tools.test.js +0 -306
  140. package/dist/src/council/__tests__/tool-trace.test.d.ts +0 -1
  141. package/dist/src/council/__tests__/tool-trace.test.js +0 -131
  142. package/dist/src/council/__tests__/types-contract.test.d.ts +0 -9
  143. package/dist/src/council/__tests__/types-contract.test.js +0 -82
  144. package/dist/src/council/clarifier-question-cap.test.d.ts +0 -12
  145. package/dist/src/council/clarifier-question-cap.test.js +0 -73
  146. package/dist/src/daemon/scheduler.test.d.ts +0 -1
  147. package/dist/src/daemon/scheduler.test.js +0 -103
  148. package/dist/src/ee/__tests__/bb-design.test.d.ts +0 -14
  149. package/dist/src/ee/__tests__/bb-design.test.js +0 -180
  150. package/dist/src/ee/__tests__/ee-onboarding.test.d.ts +0 -1
  151. package/dist/src/ee/__tests__/ee-onboarding.test.js +0 -32
  152. package/dist/src/ee/__tests__/export-transcripts.test.d.ts +0 -11
  153. package/dist/src/ee/__tests__/export-transcripts.test.js +0 -200
  154. package/dist/src/ee/__tests__/pil-context-bridge.test.d.ts +0 -1
  155. package/dist/src/ee/__tests__/pil-context-bridge.test.js +0 -54
  156. package/dist/src/ee/__tests__/pipeline.integration.test.d.ts +0 -14
  157. package/dist/src/ee/__tests__/pipeline.integration.test.js +0 -151
  158. package/dist/src/ee/__tests__/recall-format.test.d.ts +0 -10
  159. package/dist/src/ee/__tests__/recall-format.test.js +0 -57
  160. package/dist/src/ee/__tests__/recall-ledger.test.d.ts +0 -1
  161. package/dist/src/ee/__tests__/recall-ledger.test.js +0 -45
  162. package/dist/src/ee/__tests__/render-sink-wiring.test.d.ts +0 -1
  163. package/dist/src/ee/__tests__/render-sink-wiring.test.js +0 -74
  164. package/dist/src/ee/artifact-cache.test.d.ts +0 -1
  165. package/dist/src/ee/artifact-cache.test.js +0 -69
  166. package/dist/src/ee/auth.test.d.ts +0 -1
  167. package/dist/src/ee/auth.test.js +0 -59
  168. package/dist/src/ee/bridge.test.d.ts +0 -1
  169. package/dist/src/ee/bridge.test.js +0 -230
  170. package/dist/src/ee/client.test.d.ts +0 -1
  171. package/dist/src/ee/client.test.js +0 -181
  172. package/dist/src/ee/extract-session.test.d.ts +0 -1
  173. package/dist/src/ee/extract-session.test.js +0 -192
  174. package/dist/src/ee/intercept.test.d.ts +0 -1
  175. package/dist/src/ee/intercept.test.js +0 -171
  176. package/dist/src/ee/judge.test.d.ts +0 -1
  177. package/dist/src/ee/judge.test.js +0 -190
  178. package/dist/src/ee/mistake-detector.test.d.ts +0 -1
  179. package/dist/src/ee/mistake-detector.test.js +0 -221
  180. package/dist/src/ee/offline-queue.test.d.ts +0 -1
  181. package/dist/src/ee/offline-queue.test.js +0 -246
  182. package/dist/src/ee/phase-outcome.test.d.ts +0 -1
  183. package/dist/src/ee/phase-outcome.test.js +0 -94
  184. package/dist/src/ee/phase-tracker.test.d.ts +0 -1
  185. package/dist/src/ee/phase-tracker.test.js +0 -142
  186. package/dist/src/ee/posttool.test.d.ts +0 -1
  187. package/dist/src/ee/posttool.test.js +0 -70
  188. package/dist/src/ee/prompt-stale.test.d.ts +0 -8
  189. package/dist/src/ee/prompt-stale.test.js +0 -76
  190. package/dist/src/ee/recall-mirror.test.d.ts +0 -1
  191. package/dist/src/ee/recall-mirror.test.js +0 -65
  192. package/dist/src/ee/render.test.d.ts +0 -1
  193. package/dist/src/ee/render.test.js +0 -63
  194. package/dist/src/ee/scope.test.d.ts +0 -1
  195. package/dist/src/ee/scope.test.js +0 -97
  196. package/dist/src/ee/search.test.d.ts +0 -1
  197. package/dist/src/ee/search.test.js +0 -23
  198. package/dist/src/ee/session-trajectory.test.d.ts +0 -1
  199. package/dist/src/ee/session-trajectory.test.js +0 -120
  200. package/dist/src/ee/touch.test.d.ts +0 -1
  201. package/dist/src/ee/touch.test.js +0 -62
  202. package/dist/src/ee/who-am-i.test.d.ts +0 -1
  203. package/dist/src/ee/who-am-i.test.js +0 -101
  204. package/dist/src/flow/__tests__/migration.test.d.ts +0 -1
  205. package/dist/src/flow/__tests__/migration.test.js +0 -105
  206. package/dist/src/flow/__tests__/parser.test.d.ts +0 -1
  207. package/dist/src/flow/__tests__/parser.test.js +0 -68
  208. package/dist/src/flow/__tests__/run-manager-product.test.d.ts +0 -1
  209. package/dist/src/flow/__tests__/run-manager-product.test.js +0 -49
  210. package/dist/src/flow/__tests__/run-manager.test.d.ts +0 -1
  211. package/dist/src/flow/__tests__/run-manager.test.js +0 -83
  212. package/dist/src/flow/__tests__/scaffold-checkpoint.test.d.ts +0 -1
  213. package/dist/src/flow/__tests__/scaffold-checkpoint.test.js +0 -93
  214. package/dist/src/flow/__tests__/scaffold.test.d.ts +0 -1
  215. package/dist/src/flow/__tests__/scaffold.test.js +0 -47
  216. package/dist/src/flow/__tests__/warning-persist.test.d.ts +0 -5
  217. package/dist/src/flow/__tests__/warning-persist.test.js +0 -96
  218. package/dist/src/flow/compaction/__tests__/compress.test.d.ts +0 -1
  219. package/dist/src/flow/compaction/__tests__/compress.test.js +0 -63
  220. package/dist/src/flow/compaction/__tests__/extract.test.d.ts +0 -1
  221. package/dist/src/flow/compaction/__tests__/extract.test.js +0 -66
  222. package/dist/src/flow/compaction/__tests__/preserve.test.d.ts +0 -1
  223. package/dist/src/flow/compaction/__tests__/preserve.test.js +0 -62
  224. package/dist/src/gsd/__tests__/gray-areas.test.d.ts +0 -1
  225. package/dist/src/gsd/__tests__/gray-areas.test.js +0 -29
  226. package/dist/src/gsd/__tests__/types.test.d.ts +0 -1
  227. package/dist/src/gsd/__tests__/types.test.js +0 -78
  228. package/dist/src/headless/__tests__/council-answers.test.d.ts +0 -1
  229. package/dist/src/headless/__tests__/council-answers.test.js +0 -251
  230. package/dist/src/headless/output.test.d.ts +0 -1
  231. package/dist/src/headless/output.test.js +0 -239
  232. package/dist/src/lsp/builtins.test.d.ts +0 -1
  233. package/dist/src/lsp/builtins.test.js +0 -112
  234. package/dist/src/lsp/client-normalize.test.d.ts +0 -12
  235. package/dist/src/lsp/client-normalize.test.js +0 -34
  236. package/dist/src/lsp/manager.test.d.ts +0 -1
  237. package/dist/src/lsp/manager.test.js +0 -194
  238. package/dist/src/lsp/npm-cache.test.d.ts +0 -1
  239. package/dist/src/lsp/npm-cache.test.js +0 -53
  240. package/dist/src/lsp/smoke.test.d.ts +0 -1
  241. package/dist/src/lsp/smoke.test.js +0 -56
  242. package/dist/src/maintain/__tests__/codebase-intel.test.d.ts +0 -5
  243. package/dist/src/maintain/__tests__/codebase-intel.test.js +0 -237
  244. package/dist/src/maintain/__tests__/gh-create-pr.test.d.ts +0 -11
  245. package/dist/src/maintain/__tests__/gh-create-pr.test.js +0 -160
  246. package/dist/src/maintain/__tests__/pr-builder.test.d.ts +0 -10
  247. package/dist/src/maintain/__tests__/pr-builder.test.js +0 -229
  248. package/dist/src/maintain/__tests__/repo-map.test.d.ts +0 -5
  249. package/dist/src/maintain/__tests__/repo-map.test.js +0 -90
  250. package/dist/src/maintain/__tests__/task-runner.test.d.ts +0 -11
  251. package/dist/src/maintain/__tests__/task-runner.test.js +0 -281
  252. package/dist/src/mcp/__tests__/auto-setup.test.d.ts +0 -1
  253. package/dist/src/mcp/__tests__/auto-setup.test.js +0 -155
  254. package/dist/src/mcp/__tests__/cap-tool-result.test.d.ts +0 -1
  255. package/dist/src/mcp/__tests__/cap-tool-result.test.js +0 -58
  256. package/dist/src/mcp/__tests__/client-pool.spec.d.ts +0 -1
  257. package/dist/src/mcp/__tests__/client-pool.spec.js +0 -169
  258. package/dist/src/mcp/__tests__/ee-tools.test.d.ts +0 -1
  259. package/dist/src/mcp/__tests__/ee-tools.test.js +0 -226
  260. package/dist/src/mcp/__tests__/forensics-tools.test.d.ts +0 -1
  261. package/dist/src/mcp/__tests__/forensics-tools.test.js +0 -54
  262. package/dist/src/mcp/__tests__/harness-driver-action-tools.spec.d.ts +0 -1
  263. package/dist/src/mcp/__tests__/harness-driver-action-tools.spec.js +0 -103
  264. package/dist/src/mcp/__tests__/harness-driver-async-tools.spec.d.ts +0 -1
  265. package/dist/src/mcp/__tests__/harness-driver-async-tools.spec.js +0 -112
  266. package/dist/src/mcp/__tests__/harness-driver-read-tools.spec.d.ts +0 -1
  267. package/dist/src/mcp/__tests__/harness-driver-read-tools.spec.js +0 -124
  268. package/dist/src/mcp/__tests__/harness-driver-security.spec.d.ts +0 -1
  269. package/dist/src/mcp/__tests__/harness-driver-security.spec.js +0 -61
  270. package/dist/src/mcp/__tests__/harness-driver.spec.d.ts +0 -1
  271. package/dist/src/mcp/__tests__/harness-driver.spec.js +0 -20
  272. package/dist/src/mcp/__tests__/lazy-schema.spec.d.ts +0 -1
  273. package/dist/src/mcp/__tests__/lazy-schema.spec.js +0 -152
  274. package/dist/src/mcp/__tests__/lsp-tools.test.d.ts +0 -1
  275. package/dist/src/mcp/__tests__/lsp-tools.test.js +0 -56
  276. package/dist/src/mcp/__tests__/mcp-keychain.test.d.ts +0 -1
  277. package/dist/src/mcp/__tests__/mcp-keychain.test.js +0 -40
  278. package/dist/src/mcp/__tests__/parallel-build.spec.d.ts +0 -1
  279. package/dist/src/mcp/__tests__/parallel-build.spec.js +0 -67
  280. package/dist/src/mcp/__tests__/research-onboarding.test.d.ts +0 -1
  281. package/dist/src/mcp/__tests__/research-onboarding.test.js +0 -148
  282. package/dist/src/mcp/__tests__/runtime-hydration.test.d.ts +0 -1
  283. package/dist/src/mcp/__tests__/runtime-hydration.test.js +0 -78
  284. package/dist/src/mcp/__tests__/runtime-output-cap.test.d.ts +0 -1
  285. package/dist/src/mcp/__tests__/runtime-output-cap.test.js +0 -42
  286. package/dist/src/mcp/__tests__/runtime-sanitize.test.d.ts +0 -1
  287. package/dist/src/mcp/__tests__/runtime-sanitize.test.js +0 -40
  288. package/dist/src/mcp/__tests__/self-verify-jobs.test.d.ts +0 -1
  289. package/dist/src/mcp/__tests__/self-verify-jobs.test.js +0 -92
  290. package/dist/src/mcp/__tests__/smart-filter.test.d.ts +0 -1
  291. package/dist/src/mcp/__tests__/smart-filter.test.js +0 -177
  292. package/dist/src/mcp/__tests__/tools-server.smoke.test.d.ts +0 -1
  293. package/dist/src/mcp/__tests__/tools-server.smoke.test.js +0 -42
  294. package/dist/src/mcp/parse-headers.test.d.ts +0 -1
  295. package/dist/src/mcp/parse-headers.test.js +0 -43
  296. package/dist/src/mcp/smoke.test.d.ts +0 -1
  297. package/dist/src/mcp/smoke.test.js +0 -159
  298. package/dist/src/models/__tests__/registry.test.d.ts +0 -1
  299. package/dist/src/models/__tests__/registry.test.js +0 -74
  300. package/dist/src/models/catalog-gemini.test.d.ts +0 -1
  301. package/dist/src/models/catalog-gemini.test.js +0 -48
  302. package/dist/src/models/catalog-url.test.d.ts +0 -1
  303. package/dist/src/models/catalog-url.test.js +0 -26
  304. package/dist/src/models/catalog-validation.test.d.ts +0 -1
  305. package/dist/src/models/catalog-validation.test.js +0 -63
  306. package/dist/src/ops/__tests__/doctor-council-mcp.test.d.ts +0 -1
  307. package/dist/src/ops/__tests__/doctor-council-mcp.test.js +0 -139
  308. package/dist/src/ops/__tests__/doctor-ee-health.test.d.ts +0 -1
  309. package/dist/src/ops/__tests__/doctor-ee-health.test.js +0 -134
  310. package/dist/src/ops/bug-report.test.d.ts +0 -1
  311. package/dist/src/ops/bug-report.test.js +0 -148
  312. package/dist/src/ops/doctor.test.d.ts +0 -1
  313. package/dist/src/ops/doctor.test.js +0 -97
  314. package/dist/src/orchestrator/__tests__/agent-base-url-switch.test.d.ts +0 -1
  315. package/dist/src/orchestrator/__tests__/agent-base-url-switch.test.js +0 -77
  316. package/dist/src/orchestrator/__tests__/auto-commit.test.d.ts +0 -1
  317. package/dist/src/orchestrator/__tests__/auto-commit.test.js +0 -142
  318. package/dist/src/orchestrator/__tests__/batch-turn-runner.test.d.ts +0 -1
  319. package/dist/src/orchestrator/__tests__/batch-turn-runner.test.js +0 -164
  320. package/dist/src/orchestrator/__tests__/council-manager.test.d.ts +0 -1
  321. package/dist/src/orchestrator/__tests__/council-manager.test.js +0 -148
  322. package/dist/src/orchestrator/__tests__/cross-turn-dedup.test.d.ts +0 -1
  323. package/dist/src/orchestrator/__tests__/cross-turn-dedup.test.js +0 -175
  324. package/dist/src/orchestrator/__tests__/current-call-id.test.d.ts +0 -16
  325. package/dist/src/orchestrator/__tests__/current-call-id.test.js +0 -138
  326. package/dist/src/orchestrator/__tests__/delegations.test.d.ts +0 -1
  327. package/dist/src/orchestrator/__tests__/delegations.test.js +0 -96
  328. package/dist/src/orchestrator/__tests__/error-forensics.test.d.ts +0 -1
  329. package/dist/src/orchestrator/__tests__/error-forensics.test.js +0 -93
  330. package/dist/src/orchestrator/__tests__/flow-resume.test.d.ts +0 -5
  331. package/dist/src/orchestrator/__tests__/flow-resume.test.js +0 -61
  332. package/dist/src/orchestrator/__tests__/humanize-api-error.test.d.ts +0 -1
  333. package/dist/src/orchestrator/__tests__/humanize-api-error.test.js +0 -68
  334. package/dist/src/orchestrator/__tests__/mcp-capability-block.test.d.ts +0 -1
  335. package/dist/src/orchestrator/__tests__/mcp-capability-block.test.js +0 -39
  336. package/dist/src/orchestrator/__tests__/message-processor.test.d.ts +0 -1
  337. package/dist/src/orchestrator/__tests__/message-processor.test.js +0 -189
  338. package/dist/src/orchestrator/__tests__/message-write-ahead.test.d.ts +0 -22
  339. package/dist/src/orchestrator/__tests__/message-write-ahead.test.js +0 -149
  340. package/dist/src/orchestrator/__tests__/project-stack.test.d.ts +0 -1
  341. package/dist/src/orchestrator/__tests__/project-stack.test.js +0 -65
  342. package/dist/src/orchestrator/__tests__/prompts.test.d.ts +0 -1
  343. package/dist/src/orchestrator/__tests__/prompts.test.js +0 -88
  344. package/dist/src/orchestrator/__tests__/read-path-budget.test.d.ts +0 -1
  345. package/dist/src/orchestrator/__tests__/read-path-budget.test.js +0 -156
  346. package/dist/src/orchestrator/__tests__/retry-classifier.test.d.ts +0 -1
  347. package/dist/src/orchestrator/__tests__/retry-classifier.test.js +0 -112
  348. package/dist/src/orchestrator/__tests__/retry-stream.test.d.ts +0 -1
  349. package/dist/src/orchestrator/__tests__/retry-stream.test.js +0 -151
  350. package/dist/src/orchestrator/__tests__/route-feedback.test.d.ts +0 -1
  351. package/dist/src/orchestrator/__tests__/route-feedback.test.js +0 -47
  352. package/dist/src/orchestrator/__tests__/stream-runner.test.d.ts +0 -1
  353. package/dist/src/orchestrator/__tests__/stream-runner.test.js +0 -202
  354. package/dist/src/orchestrator/__tests__/sub-agent-model-tier.test.d.ts +0 -1
  355. package/dist/src/orchestrator/__tests__/sub-agent-model-tier.test.js +0 -45
  356. package/dist/src/orchestrator/__tests__/sub-session-delegation.test.d.ts +0 -1
  357. package/dist/src/orchestrator/__tests__/sub-session-delegation.test.js +0 -507
  358. package/dist/src/orchestrator/__tests__/usage-events-shape.test.d.ts +0 -8
  359. package/dist/src/orchestrator/__tests__/usage-events-shape.test.js +0 -58
  360. package/dist/src/orchestrator/__tests__/usage-normalizer-c1.test.d.ts +0 -21
  361. package/dist/src/orchestrator/__tests__/usage-normalizer-c1.test.js +0 -155
  362. package/dist/src/orchestrator/__tests__/usage-shape-threading.test.d.ts +0 -1
  363. package/dist/src/orchestrator/__tests__/usage-shape-threading.test.js +0 -98
  364. package/dist/src/orchestrator/__tests__/write-ahead.test.d.ts +0 -20
  365. package/dist/src/orchestrator/__tests__/write-ahead.test.js +0 -134
  366. package/dist/src/orchestrator/abort.test.d.ts +0 -1
  367. package/dist/src/orchestrator/abort.test.js +0 -34
  368. package/dist/src/orchestrator/agent.test.d.ts +0 -1
  369. package/dist/src/orchestrator/agent.test.js +0 -178
  370. package/dist/src/orchestrator/cleanup.test.d.ts +0 -1
  371. package/dist/src/orchestrator/cleanup.test.js +0 -67
  372. package/dist/src/orchestrator/compaction.test.d.ts +0 -1
  373. package/dist/src/orchestrator/compaction.test.js +0 -187
  374. package/dist/src/orchestrator/delegations.test.d.ts +0 -1
  375. package/dist/src/orchestrator/delegations.test.js +0 -107
  376. package/dist/src/orchestrator/grounding-check.test.d.ts +0 -1
  377. package/dist/src/orchestrator/grounding-check.test.js +0 -94
  378. package/dist/src/orchestrator/interrupted-turn.test.d.ts +0 -1
  379. package/dist/src/orchestrator/interrupted-turn.test.js +0 -34
  380. package/dist/src/orchestrator/message-seq.test.d.ts +0 -1
  381. package/dist/src/orchestrator/message-seq.test.js +0 -24
  382. package/dist/src/orchestrator/pending-calls.test.d.ts +0 -1
  383. package/dist/src/orchestrator/pending-calls.test.js +0 -188
  384. package/dist/src/orchestrator/provider-options-shape.spec.d.ts +0 -1
  385. package/dist/src/orchestrator/provider-options-shape.spec.js +0 -63
  386. package/dist/src/orchestrator/reasoning.test.d.ts +0 -1
  387. package/dist/src/orchestrator/reasoning.test.js +0 -101
  388. package/dist/src/orchestrator/repetition-detector.test.d.ts +0 -1
  389. package/dist/src/orchestrator/repetition-detector.test.js +0 -103
  390. package/dist/src/orchestrator/sandbox.test.d.ts +0 -1
  391. package/dist/src/orchestrator/sandbox.test.js +0 -99
  392. package/dist/src/orchestrator/scope-ceiling.test.d.ts +0 -13
  393. package/dist/src/orchestrator/scope-ceiling.test.js +0 -181
  394. package/dist/src/orchestrator/scope-reminder.test.d.ts +0 -15
  395. package/dist/src/orchestrator/scope-reminder.test.js +0 -225
  396. package/dist/src/orchestrator/session-experience.test.d.ts +0 -6
  397. package/dist/src/orchestrator/session-experience.test.js +0 -72
  398. package/dist/src/orchestrator/stall-rescue.test.d.ts +0 -1
  399. package/dist/src/orchestrator/stall-rescue.test.js +0 -117
  400. package/dist/src/orchestrator/stall-watchdog.test.d.ts +0 -1
  401. package/dist/src/orchestrator/stall-watchdog.test.js +0 -153
  402. package/dist/src/orchestrator/steer-inbox.test.d.ts +0 -1
  403. package/dist/src/orchestrator/steer-inbox.test.js +0 -33
  404. package/dist/src/orchestrator/sub-agent-cap.test.d.ts +0 -1
  405. package/dist/src/orchestrator/sub-agent-cap.test.js +0 -208
  406. package/dist/src/orchestrator/subagent-compactor.spec.d.ts +0 -1
  407. package/dist/src/orchestrator/subagent-compactor.spec.js +0 -636
  408. package/dist/src/orchestrator/text-tool-call-detector.test.d.ts +0 -1
  409. package/dist/src/orchestrator/text-tool-call-detector.test.js +0 -147
  410. package/dist/src/orchestrator/token-counter.test.d.ts +0 -1
  411. package/dist/src/orchestrator/token-counter.test.js +0 -57
  412. package/dist/src/orchestrator/tool-args-hash.test.d.ts +0 -1
  413. package/dist/src/orchestrator/tool-args-hash.test.js +0 -105
  414. package/dist/src/orchestrator/tool-args-repair.test.d.ts +0 -1
  415. package/dist/src/orchestrator/tool-args-repair.test.js +0 -136
  416. package/dist/src/orchestrator/tool-loop-askcard.test.d.ts +0 -1
  417. package/dist/src/orchestrator/tool-loop-askcard.test.js +0 -71
  418. package/dist/src/orchestrator/tool-loop-cap.test.d.ts +0 -1
  419. package/dist/src/orchestrator/tool-loop-cap.test.js +0 -176
  420. package/dist/src/orchestrator/tool-repetition-detector.test.d.ts +0 -1
  421. package/dist/src/orchestrator/tool-repetition-detector.test.js +0 -101
  422. package/dist/src/pil/__tests__/budget.test.d.ts +0 -1
  423. package/dist/src/pil/__tests__/budget.test.js +0 -33
  424. package/dist/src/pil/__tests__/clarity-gate.test.d.ts +0 -1
  425. package/dist/src/pil/__tests__/clarity-gate.test.js +0 -37
  426. package/dist/src/pil/__tests__/config.test.d.ts +0 -1
  427. package/dist/src/pil/__tests__/config.test.js +0 -57
  428. package/dist/src/pil/__tests__/discovery-cache.test.d.ts +0 -1
  429. package/dist/src/pil/__tests__/discovery-cache.test.js +0 -38
  430. package/dist/src/pil/__tests__/discovery-types.test.d.ts +0 -1
  431. package/dist/src/pil/__tests__/discovery-types.test.js +0 -65
  432. package/dist/src/pil/__tests__/discovery.test.d.ts +0 -1
  433. package/dist/src/pil/__tests__/discovery.test.js +0 -178
  434. package/dist/src/pil/__tests__/dual-run.test.d.ts +0 -1
  435. package/dist/src/pil/__tests__/dual-run.test.js +0 -51
  436. package/dist/src/pil/__tests__/layer1-intent-trace.test.d.ts +0 -1
  437. package/dist/src/pil/__tests__/layer1-intent-trace.test.js +0 -138
  438. package/dist/src/pil/__tests__/layer1-intent.test.d.ts +0 -1
  439. package/dist/src/pil/__tests__/layer1-intent.test.js +0 -329
  440. package/dist/src/pil/__tests__/layer15-context-scan.test.d.ts +0 -1
  441. package/dist/src/pil/__tests__/layer15-context-scan.test.js +0 -64
  442. package/dist/src/pil/__tests__/layer16-clarity.test.d.ts +0 -1
  443. package/dist/src/pil/__tests__/layer16-clarity.test.js +0 -72
  444. package/dist/src/pil/__tests__/layer17-feasibility.test.d.ts +0 -1
  445. package/dist/src/pil/__tests__/layer17-feasibility.test.js +0 -36
  446. package/dist/src/pil/__tests__/layer18-acceptance.test.d.ts +0 -1
  447. package/dist/src/pil/__tests__/layer18-acceptance.test.js +0 -18
  448. package/dist/src/pil/__tests__/layer2-personality.test.d.ts +0 -1
  449. package/dist/src/pil/__tests__/layer2-personality.test.js +0 -57
  450. package/dist/src/pil/__tests__/layer2_5-ponytail.test.d.ts +0 -1
  451. package/dist/src/pil/__tests__/layer2_5-ponytail.test.js +0 -53
  452. package/dist/src/pil/__tests__/layer3-ee-injection.test.d.ts +0 -1
  453. package/dist/src/pil/__tests__/layer3-ee-injection.test.js +0 -221
  454. package/dist/src/pil/__tests__/layer3-injected-chunk.test.d.ts +0 -1
  455. package/dist/src/pil/__tests__/layer3-injected-chunk.test.js +0 -134
  456. package/dist/src/pil/__tests__/layer4-gsd.test.d.ts +0 -1
  457. package/dist/src/pil/__tests__/layer4-gsd.test.js +0 -191
  458. package/dist/src/pil/__tests__/layer5-context.test.d.ts +0 -1
  459. package/dist/src/pil/__tests__/layer5-context.test.js +0 -175
  460. package/dist/src/pil/__tests__/layer6-output.test.d.ts +0 -1
  461. package/dist/src/pil/__tests__/layer6-output.test.js +0 -465
  462. package/dist/src/pil/__tests__/llm-classify.test.d.ts +0 -1
  463. package/dist/src/pil/__tests__/llm-classify.test.js +0 -275
  464. package/dist/src/pil/__tests__/native-capabilities-workbook.test.d.ts +0 -1
  465. package/dist/src/pil/__tests__/native-capabilities-workbook.test.js +0 -40
  466. package/dist/src/pil/__tests__/ollama-classify.test.d.ts +0 -1
  467. package/dist/src/pil/__tests__/ollama-classify.test.js +0 -68
  468. package/dist/src/pil/__tests__/orchestrator-integration.test.d.ts +0 -10
  469. package/dist/src/pil/__tests__/orchestrator-integration.test.js +0 -100
  470. package/dist/src/pil/__tests__/pipeline.test.d.ts +0 -1
  471. package/dist/src/pil/__tests__/pipeline.test.js +0 -188
  472. package/dist/src/pil/__tests__/renderer-coverage.test.d.ts +0 -7
  473. package/dist/src/pil/__tests__/renderer-coverage.test.js +0 -42
  474. package/dist/src/pil/__tests__/response-tools.test.d.ts +0 -1
  475. package/dist/src/pil/__tests__/response-tools.test.js +0 -242
  476. package/dist/src/pil/__tests__/schema.test.d.ts +0 -1
  477. package/dist/src/pil/__tests__/schema.test.js +0 -202
  478. package/dist/src/pil/__tests__/scoreComplexity.test.d.ts +0 -1
  479. package/dist/src/pil/__tests__/scoreComplexity.test.js +0 -119
  480. package/dist/src/pil/__tests__/scoreSufficiency.test.d.ts +0 -8
  481. package/dist/src/pil/__tests__/scoreSufficiency.test.js +0 -89
  482. package/dist/src/pil/__tests__/store.test.d.ts +0 -1
  483. package/dist/src/pil/__tests__/store.test.js +0 -44
  484. package/dist/src/pil/__tests__/surface-compaction-artifacts.test.d.ts +0 -1
  485. package/dist/src/pil/__tests__/surface-compaction-artifacts.test.js +0 -112
  486. package/dist/src/pil/__tests__/task-tier-map.test.d.ts +0 -1
  487. package/dist/src/pil/__tests__/task-tier-map.test.js +0 -33
  488. package/dist/src/pil/agent-operating-contract.test.d.ts +0 -1
  489. package/dist/src/pil/agent-operating-contract.test.js +0 -80
  490. package/dist/src/pil/cheap-model-playbook.test.d.ts +0 -1
  491. package/dist/src/pil/cheap-model-playbook.test.js +0 -160
  492. package/dist/src/pil/cheap-model-workbooks.test.d.ts +0 -1
  493. package/dist/src/pil/cheap-model-workbooks.test.js +0 -129
  494. package/dist/src/pil/layer1-intent.test.d.ts +0 -1
  495. package/dist/src/pil/layer1-intent.test.js +0 -764
  496. package/dist/src/pil/layer1_5-complexity-size.test.d.ts +0 -10
  497. package/dist/src/pil/layer1_5-complexity-size.test.js +0 -248
  498. package/dist/src/pil/session-experience-injection.test.d.ts +0 -6
  499. package/dist/src/pil/session-experience-injection.test.js +0 -79
  500. package/dist/src/pil/session-state.test.d.ts +0 -1
  501. package/dist/src/pil/session-state.test.js +0 -73
  502. package/dist/src/playbook/__tests__/directives.test.d.ts +0 -1
  503. package/dist/src/playbook/__tests__/directives.test.js +0 -115
  504. package/dist/src/product-loop/__tests__/artifact-io.test.d.ts +0 -1
  505. package/dist/src/product-loop/__tests__/artifact-io.test.js +0 -83
  506. package/dist/src/product-loop/__tests__/assumption-ledger.test.d.ts +0 -1
  507. package/dist/src/product-loop/__tests__/assumption-ledger.test.js +0 -261
  508. package/dist/src/product-loop/__tests__/backlog-builder.test.d.ts +0 -10
  509. package/dist/src/product-loop/__tests__/backlog-builder.test.js +0 -175
  510. package/dist/src/product-loop/__tests__/backlog-store.test.d.ts +0 -4
  511. package/dist/src/product-loop/__tests__/backlog-store.test.js +0 -96
  512. package/dist/src/product-loop/__tests__/cb2-retry-bonus.test.d.ts +0 -13
  513. package/dist/src/product-loop/__tests__/cb2-retry-bonus.test.js +0 -158
  514. package/dist/src/product-loop/__tests__/circuit-breakers-coverage.test.d.ts +0 -1
  515. package/dist/src/product-loop/__tests__/circuit-breakers-coverage.test.js +0 -67
  516. package/dist/src/product-loop/__tests__/circuit-breakers.test.d.ts +0 -1
  517. package/dist/src/product-loop/__tests__/circuit-breakers.test.js +0 -79
  518. package/dist/src/product-loop/__tests__/complexity-routing.spec.d.ts +0 -11
  519. package/dist/src/product-loop/__tests__/complexity-routing.spec.js +0 -240
  520. package/dist/src/product-loop/__tests__/context-policy.test.d.ts +0 -1
  521. package/dist/src/product-loop/__tests__/context-policy.test.js +0 -266
  522. package/dist/src/product-loop/__tests__/cost-preview.test.d.ts +0 -1
  523. package/dist/src/product-loop/__tests__/cost-preview.test.js +0 -111
  524. package/dist/src/product-loop/__tests__/cost-scoper.test.d.ts +0 -1
  525. package/dist/src/product-loop/__tests__/cost-scoper.test.js +0 -50
  526. package/dist/src/product-loop/__tests__/cross-run-memory.test.d.ts +0 -1
  527. package/dist/src/product-loop/__tests__/cross-run-memory.test.js +0 -168
  528. package/dist/src/product-loop/__tests__/design-output.spec.d.ts +0 -1
  529. package/dist/src/product-loop/__tests__/design-output.spec.js +0 -36
  530. package/dist/src/product-loop/__tests__/discover.test.d.ts +0 -1
  531. package/dist/src/product-loop/__tests__/discover.test.js +0 -83
  532. package/dist/src/product-loop/__tests__/discovery-context-format.test.d.ts +0 -13
  533. package/dist/src/product-loop/__tests__/discovery-context-format.test.js +0 -100
  534. package/dist/src/product-loop/__tests__/discovery-council-runner.test.d.ts +0 -1
  535. package/dist/src/product-loop/__tests__/discovery-council-runner.test.js +0 -13
  536. package/dist/src/product-loop/__tests__/discovery-detection.test.d.ts +0 -1
  537. package/dist/src/product-loop/__tests__/discovery-detection.test.js +0 -151
  538. package/dist/src/product-loop/__tests__/discovery-ecosystem.test.d.ts +0 -8
  539. package/dist/src/product-loop/__tests__/discovery-ecosystem.test.js +0 -209
  540. package/dist/src/product-loop/__tests__/discovery-integration.test.d.ts +0 -1
  541. package/dist/src/product-loop/__tests__/discovery-integration.test.js +0 -126
  542. package/dist/src/product-loop/__tests__/discovery-interview.test.d.ts +0 -1
  543. package/dist/src/product-loop/__tests__/discovery-interview.test.js +0 -394
  544. package/dist/src/product-loop/__tests__/discovery-migrations.test.d.ts +0 -1
  545. package/dist/src/product-loop/__tests__/discovery-migrations.test.js +0 -69
  546. package/dist/src/product-loop/__tests__/discovery-persistence.test.d.ts +0 -1
  547. package/dist/src/product-loop/__tests__/discovery-persistence.test.js +0 -146
  548. package/dist/src/product-loop/__tests__/discovery-prompt-parser.test.d.ts +0 -1
  549. package/dist/src/product-loop/__tests__/discovery-prompt-parser.test.js +0 -65
  550. package/dist/src/product-loop/__tests__/discovery-prompt-specificity.test.d.ts +0 -1
  551. package/dist/src/product-loop/__tests__/discovery-prompt-specificity.test.js +0 -55
  552. package/dist/src/product-loop/__tests__/discovery-recommender-ecosystem.test.d.ts +0 -9
  553. package/dist/src/product-loop/__tests__/discovery-recommender-ecosystem.test.js +0 -178
  554. package/dist/src/product-loop/__tests__/discovery-recommender.test.d.ts +0 -1
  555. package/dist/src/product-loop/__tests__/discovery-recommender.test.js +0 -316
  556. package/dist/src/product-loop/__tests__/discovery-schema.test.d.ts +0 -1
  557. package/dist/src/product-loop/__tests__/discovery-schema.test.js +0 -77
  558. package/dist/src/product-loop/__tests__/done-gate-coverage.test.d.ts +0 -1
  559. package/dist/src/product-loop/__tests__/done-gate-coverage.test.js +0 -135
  560. package/dist/src/product-loop/__tests__/done-gate.test.d.ts +0 -1
  561. package/dist/src/product-loop/__tests__/done-gate.test.js +0 -122
  562. package/dist/src/product-loop/__tests__/ee-extract-wiring.test.d.ts +0 -8
  563. package/dist/src/product-loop/__tests__/ee-extract-wiring.test.js +0 -186
  564. package/dist/src/product-loop/__tests__/extract-to-ee.test.d.ts +0 -1
  565. package/dist/src/product-loop/__tests__/extract-to-ee.test.js +0 -161
  566. package/dist/src/product-loop/__tests__/feedback-routing.test.d.ts +0 -1
  567. package/dist/src/product-loop/__tests__/feedback-routing.test.js +0 -83
  568. package/dist/src/product-loop/__tests__/gather-selectable-alts.test.d.ts +0 -15
  569. package/dist/src/product-loop/__tests__/gather-selectable-alts.test.js +0 -143
  570. package/dist/src/product-loop/__tests__/hot-path.spec.d.ts +0 -11
  571. package/dist/src/product-loop/__tests__/hot-path.spec.js +0 -146
  572. package/dist/src/product-loop/__tests__/integration.test.d.ts +0 -7
  573. package/dist/src/product-loop/__tests__/integration.test.js +0 -301
  574. package/dist/src/product-loop/__tests__/loop-driver-audit.test.d.ts +0 -1
  575. package/dist/src/product-loop/__tests__/loop-driver-audit.test.js +0 -269
  576. package/dist/src/product-loop/__tests__/loop-driver.test.d.ts +0 -1
  577. package/dist/src/product-loop/__tests__/loop-driver.test.js +0 -225
  578. package/dist/src/product-loop/__tests__/maintenance-task-synthesis.test.d.ts +0 -8
  579. package/dist/src/product-loop/__tests__/maintenance-task-synthesis.test.js +0 -67
  580. package/dist/src/product-loop/__tests__/phase-a1-a3-sprint-runner.test.d.ts +0 -13
  581. package/dist/src/product-loop/__tests__/phase-a1-a3-sprint-runner.test.js +0 -268
  582. package/dist/src/product-loop/__tests__/phase-a2-backlog-build.test.d.ts +0 -8
  583. package/dist/src/product-loop/__tests__/phase-a2-backlog-build.test.js +0 -162
  584. package/dist/src/product-loop/__tests__/phase-budget.test.d.ts +0 -1
  585. package/dist/src/product-loop/__tests__/phase-budget.test.js +0 -149
  586. package/dist/src/product-loop/__tests__/phase-orchestrator-integration.test.d.ts +0 -1
  587. package/dist/src/product-loop/__tests__/phase-orchestrator-integration.test.js +0 -138
  588. package/dist/src/product-loop/__tests__/phase-plan.test.d.ts +0 -1
  589. package/dist/src/product-loop/__tests__/phase-plan.test.js +0 -208
  590. package/dist/src/product-loop/__tests__/phase-rituals.test.d.ts +0 -1
  591. package/dist/src/product-loop/__tests__/phase-rituals.test.js +0 -174
  592. package/dist/src/product-loop/__tests__/phase-runner.test.d.ts +0 -1
  593. package/dist/src/product-loop/__tests__/phase-runner.test.js +0 -414
  594. package/dist/src/product-loop/__tests__/phase-tracker-bridge.test.d.ts +0 -1
  595. package/dist/src/product-loop/__tests__/phase-tracker-bridge.test.js +0 -67
  596. package/dist/src/product-loop/__tests__/pick-backend-stack.test.d.ts +0 -11
  597. package/dist/src/product-loop/__tests__/pick-backend-stack.test.js +0 -95
  598. package/dist/src/product-loop/__tests__/product-identity.test.d.ts +0 -1
  599. package/dist/src/product-loop/__tests__/product-identity.test.js +0 -40
  600. package/dist/src/product-loop/__tests__/progress-snapshot.test.d.ts +0 -8
  601. package/dist/src/product-loop/__tests__/progress-snapshot.test.js +0 -152
  602. package/dist/src/product-loop/__tests__/reality-anchor.test.d.ts +0 -1
  603. package/dist/src/product-loop/__tests__/reality-anchor.test.js +0 -49
  604. package/dist/src/product-loop/__tests__/repo-audit.test.d.ts +0 -1
  605. package/dist/src/product-loop/__tests__/repo-audit.test.js +0 -97
  606. package/dist/src/product-loop/__tests__/repo-brief.test.d.ts +0 -9
  607. package/dist/src/product-loop/__tests__/repo-brief.test.js +0 -132
  608. package/dist/src/product-loop/__tests__/role-memory.test.d.ts +0 -1
  609. package/dist/src/product-loop/__tests__/role-memory.test.js +0 -56
  610. package/dist/src/product-loop/__tests__/role-registry.test.d.ts +0 -1
  611. package/dist/src/product-loop/__tests__/role-registry.test.js +0 -222
  612. package/dist/src/product-loop/__tests__/role-routing-ee.test.d.ts +0 -1
  613. package/dist/src/product-loop/__tests__/role-routing-ee.test.js +0 -79
  614. package/dist/src/product-loop/__tests__/route-decision-emit.test.d.ts +0 -10
  615. package/dist/src/product-loop/__tests__/route-decision-emit.test.js +0 -222
  616. package/dist/src/product-loop/__tests__/seed-questions.test.d.ts +0 -1
  617. package/dist/src/product-loop/__tests__/seed-questions.test.js +0 -30
  618. package/dist/src/product-loop/__tests__/ship-polish.test.d.ts +0 -1
  619. package/dist/src/product-loop/__tests__/ship-polish.test.js +0 -96
  620. package/dist/src/product-loop/__tests__/sprint-planner.test.d.ts +0 -6
  621. package/dist/src/product-loop/__tests__/sprint-planner.test.js +0 -140
  622. package/dist/src/product-loop/__tests__/sprint-runner-backlog.test.d.ts +0 -8
  623. package/dist/src/product-loop/__tests__/sprint-runner-backlog.test.js +0 -221
  624. package/dist/src/product-loop/__tests__/sprint-runner-emit.test.d.ts +0 -14
  625. package/dist/src/product-loop/__tests__/sprint-runner-emit.test.js +0 -279
  626. package/dist/src/product-loop/__tests__/sprint-runner-phase-chunks.test.d.ts +0 -14
  627. package/dist/src/product-loop/__tests__/sprint-runner-phase-chunks.test.js +0 -193
  628. package/dist/src/product-loop/__tests__/sprint-runner.test.d.ts +0 -1
  629. package/dist/src/product-loop/__tests__/sprint-runner.test.js +0 -432
  630. package/dist/src/product-loop/__tests__/sprint-self-verify.test.d.ts +0 -8
  631. package/dist/src/product-loop/__tests__/sprint-self-verify.test.js +0 -73
  632. package/dist/src/product-loop/__tests__/sprint-store.test.d.ts +0 -7
  633. package/dist/src/product-loop/__tests__/sprint-store.test.js +0 -84
  634. package/dist/src/product-loop/__tests__/stakeholder-acl.test.d.ts +0 -1
  635. package/dist/src/product-loop/__tests__/stakeholder-acl.test.js +0 -83
  636. package/dist/src/product-loop/__tests__/state-md-ee-injections.test.d.ts +0 -8
  637. package/dist/src/product-loop/__tests__/state-md-ee-injections.test.js +0 -182
  638. package/dist/src/product-loop/__tests__/sufficiency-routing.spec.d.ts +0 -12
  639. package/dist/src/product-loop/__tests__/sufficiency-routing.spec.js +0 -140
  640. package/dist/src/product-loop/__tests__/typed-artifacts.test.d.ts +0 -1
  641. package/dist/src/product-loop/__tests__/typed-artifacts.test.js +0 -222
  642. package/dist/src/product-loop/__tests__/types.test.d.ts +0 -1
  643. package/dist/src/product-loop/__tests__/types.test.js +0 -79
  644. package/dist/src/product-loop/__tests__/verify-failure-threshold.test.d.ts +0 -9
  645. package/dist/src/product-loop/__tests__/verify-failure-threshold.test.js +0 -146
  646. package/dist/src/product-loop/__tests__/verify-failure-tracking.test.d.ts +0 -4
  647. package/dist/src/product-loop/__tests__/verify-failure-tracking.test.js +0 -122
  648. package/dist/src/product-loop/__tests__/verify-result.test.d.ts +0 -1
  649. package/dist/src/product-loop/__tests__/verify-result.test.js +0 -53
  650. package/dist/src/providers/__tests__/adapter-oauth-wiring.test.d.ts +0 -8
  651. package/dist/src/providers/__tests__/adapter-oauth-wiring.test.js +0 -125
  652. package/dist/src/providers/__tests__/capabilities-cosmetic.test.d.ts +0 -1
  653. package/dist/src/providers/__tests__/capabilities-cosmetic.test.js +0 -109
  654. package/dist/src/providers/__tests__/capabilities-flags.test.d.ts +0 -1
  655. package/dist/src/providers/__tests__/capabilities-flags.test.js +0 -145
  656. package/dist/src/providers/__tests__/capabilities-provider-options.test.d.ts +0 -1
  657. package/dist/src/providers/__tests__/capabilities-provider-options.test.js +0 -201
  658. package/dist/src/providers/__tests__/capabilities-sanitize.test.d.ts +0 -1
  659. package/dist/src/providers/__tests__/capabilities-sanitize.test.js +0 -60
  660. package/dist/src/providers/__tests__/capabilities.test.d.ts +0 -1
  661. package/dist/src/providers/__tests__/capabilities.test.js +0 -41
  662. package/dist/src/providers/__tests__/provider-coverage.test.d.ts +0 -1
  663. package/dist/src/providers/__tests__/provider-coverage.test.js +0 -45
  664. package/dist/src/providers/__tests__/reasoning-roundtrip.test.d.ts +0 -1
  665. package/dist/src/providers/__tests__/reasoning-roundtrip.test.js +0 -216
  666. package/dist/src/providers/__tests__/runtime-integration.test.d.ts +0 -1
  667. package/dist/src/providers/__tests__/runtime-integration.test.js +0 -93
  668. package/dist/src/providers/__tests__/runtime.test.d.ts +0 -1
  669. package/dist/src/providers/__tests__/runtime.test.js +0 -80
  670. package/dist/src/providers/__tests__/siliconflow-sse-repair.test.d.ts +0 -1
  671. package/dist/src/providers/__tests__/siliconflow-sse-repair.test.js +0 -267
  672. package/dist/src/providers/__tests__/strategies-registry.test.d.ts +0 -8
  673. package/dist/src/providers/__tests__/strategies-registry.test.js +0 -49
  674. package/dist/src/providers/__tests__/strategies-resolve.test.d.ts +0 -12
  675. package/dist/src/providers/__tests__/strategies-resolve.test.js +0 -128
  676. package/dist/src/providers/__tests__/wire-debug.test.d.ts +0 -1
  677. package/dist/src/providers/__tests__/wire-debug.test.js +0 -39
  678. package/dist/src/providers/adapter.test.d.ts +0 -1
  679. package/dist/src/providers/adapter.test.js +0 -19
  680. package/dist/src/providers/auth/__tests__/browser-flow.test.d.ts +0 -8
  681. package/dist/src/providers/auth/__tests__/browser-flow.test.js +0 -186
  682. package/dist/src/providers/auth/__tests__/device-flow.test.d.ts +0 -6
  683. package/dist/src/providers/auth/__tests__/device-flow.test.js +0 -219
  684. package/dist/src/providers/auth/__tests__/gemini-oauth.test.d.ts +0 -4
  685. package/dist/src/providers/auth/__tests__/gemini-oauth.test.js +0 -306
  686. package/dist/src/providers/auth/__tests__/grok-oauth.test.d.ts +0 -8
  687. package/dist/src/providers/auth/__tests__/grok-oauth.test.js +0 -236
  688. package/dist/src/providers/auth/__tests__/openai-oauth.test.d.ts +0 -7
  689. package/dist/src/providers/auth/__tests__/openai-oauth.test.js +0 -309
  690. package/dist/src/providers/auth/__tests__/token-store.test.d.ts +0 -7
  691. package/dist/src/providers/auth/__tests__/token-store.test.js +0 -125
  692. package/dist/src/providers/errors.test.d.ts +0 -1
  693. package/dist/src/providers/errors.test.js +0 -66
  694. package/dist/src/providers/gemini.test.d.ts +0 -1
  695. package/dist/src/providers/gemini.test.js +0 -37
  696. package/dist/src/providers/keychain.test.d.ts +0 -1
  697. package/dist/src/providers/keychain.test.js +0 -84
  698. package/dist/src/providers/mcp-vision-bridge.test.d.ts +0 -1
  699. package/dist/src/providers/mcp-vision-bridge.test.js +0 -381
  700. package/dist/src/providers/ollama.test.d.ts +0 -1
  701. package/dist/src/providers/ollama.test.js +0 -37
  702. package/dist/src/providers/openai-compatible.test.d.ts +0 -1
  703. package/dist/src/providers/openai-compatible.test.js +0 -53
  704. package/dist/src/providers/openai.test.d.ts +0 -1
  705. package/dist/src/providers/openai.test.js +0 -53
  706. package/dist/src/providers/pricing.test.d.ts +0 -1
  707. package/dist/src/providers/pricing.test.js +0 -81
  708. package/dist/src/providers/prompt-cache-key.spec.d.ts +0 -5
  709. package/dist/src/providers/prompt-cache-key.spec.js +0 -24
  710. package/dist/src/providers/runtime-mock.spec.d.ts +0 -8
  711. package/dist/src/providers/runtime-mock.spec.js +0 -69
  712. package/dist/src/providers/vision-proxy.test.d.ts +0 -1
  713. package/dist/src/providers/vision-proxy.test.js +0 -212
  714. package/dist/src/reporter/__tests__/acl-check.test.d.ts +0 -6
  715. package/dist/src/reporter/__tests__/acl-check.test.js +0 -59
  716. package/dist/src/reporter/__tests__/auto-fire.test.d.ts +0 -10
  717. package/dist/src/reporter/__tests__/auto-fire.test.js +0 -140
  718. package/dist/src/reporter/__tests__/budget.test.d.ts +0 -7
  719. package/dist/src/reporter/__tests__/budget.test.js +0 -60
  720. package/dist/src/reporter/__tests__/handlers.test.d.ts +0 -7
  721. package/dist/src/reporter/__tests__/handlers.test.js +0 -163
  722. package/dist/src/reporter/__tests__/query-router.test.d.ts +0 -6
  723. package/dist/src/reporter/__tests__/query-router.test.js +0 -90
  724. package/dist/src/router/__tests__/step-router.test.d.ts +0 -4
  725. package/dist/src/router/__tests__/step-router.test.js +0 -131
  726. package/dist/src/router/classifier/index.test.d.ts +0 -1
  727. package/dist/src/router/classifier/index.test.js +0 -29
  728. package/dist/src/router/classifier/regex.test.d.ts +0 -1
  729. package/dist/src/router/classifier/regex.test.js +0 -44
  730. package/dist/src/router/classifier/tree-sitter.test.d.ts +0 -1
  731. package/dist/src/router/classifier/tree-sitter.test.js +0 -23
  732. package/dist/src/router/cold.test.d.ts +0 -1
  733. package/dist/src/router/cold.test.js +0 -56
  734. package/dist/src/router/decide.test.d.ts +0 -1
  735. package/dist/src/router/decide.test.js +0 -198
  736. package/dist/src/router/health.test.d.ts +0 -1
  737. package/dist/src/router/health.test.js +0 -52
  738. package/dist/src/router/provider-sentinel.test.d.ts +0 -1
  739. package/dist/src/router/provider-sentinel.test.js +0 -20
  740. package/dist/src/router/role-override.test.d.ts +0 -1
  741. package/dist/src/router/role-override.test.js +0 -26
  742. package/dist/src/router/warm.test.d.ts +0 -1
  743. package/dist/src/router/warm.test.js +0 -202
  744. package/dist/src/scaffold/__tests__/continuation-prompt.test.d.ts +0 -4
  745. package/dist/src/scaffold/__tests__/continuation-prompt.test.js +0 -79
  746. package/dist/src/scaffold/__tests__/continue-as-council.spec.d.ts +0 -10
  747. package/dist/src/scaffold/__tests__/continue-as-council.spec.js +0 -102
  748. package/dist/src/scaffold/__tests__/dotnet-assembly-name.test.d.ts +0 -1
  749. package/dist/src/scaffold/__tests__/dotnet-assembly-name.test.js +0 -27
  750. package/dist/src/scaffold/__tests__/fe-scaffold-contents.test.d.ts +0 -1
  751. package/dist/src/scaffold/__tests__/fe-scaffold-contents.test.js +0 -106
  752. package/dist/src/scaffold/__tests__/init-new.smoke.spec.d.ts +0 -15
  753. package/dist/src/scaffold/__tests__/init-new.smoke.spec.js +0 -81
  754. package/dist/src/scaffold/__tests__/init-new.spec.d.ts +0 -5
  755. package/dist/src/scaffold/__tests__/init-new.spec.js +0 -378
  756. package/dist/src/scaffold/__tests__/install-bb-templates.spec.d.ts +0 -1
  757. package/dist/src/scaffold/__tests__/install-bb-templates.spec.js +0 -77
  758. package/dist/src/scaffold/__tests__/point-to-existing.spec.d.ts +0 -7
  759. package/dist/src/scaffold/__tests__/point-to-existing.spec.js +0 -94
  760. package/dist/src/self-qa/__tests__/agentic-context.test.d.ts +0 -1
  761. package/dist/src/self-qa/__tests__/agentic-context.test.js +0 -98
  762. package/dist/src/self-qa/__tests__/agentic-loop.test.d.ts +0 -1
  763. package/dist/src/self-qa/__tests__/agentic-loop.test.js +0 -62
  764. package/dist/src/self-qa/__tests__/delta-encoder.test.d.ts +0 -1
  765. package/dist/src/self-qa/__tests__/delta-encoder.test.js +0 -97
  766. package/dist/src/self-qa/__tests__/judge.test.d.ts +0 -1
  767. package/dist/src/self-qa/__tests__/judge.test.js +0 -131
  768. package/dist/src/self-qa/__tests__/scenario-planner.test.d.ts +0 -1
  769. package/dist/src/self-qa/__tests__/scenario-planner.test.js +0 -79
  770. package/dist/src/self-qa/__tests__/spec-emitter.test.d.ts +0 -1
  771. package/dist/src/self-qa/__tests__/spec-emitter.test.js +0 -62
  772. package/dist/src/storage/__tests__/hierarchical-session.test.d.ts +0 -1
  773. package/dist/src/storage/__tests__/hierarchical-session.test.js +0 -161
  774. package/dist/src/storage/__tests__/migrations.test.d.ts +0 -12
  775. package/dist/src/storage/__tests__/migrations.test.js +0 -357
  776. package/dist/src/storage/__tests__/sweep-stale-pending.test.d.ts +0 -10
  777. package/dist/src/storage/__tests__/sweep-stale-pending.test.js +0 -97
  778. package/dist/src/storage/__tests__/ui-interaction-log.test.d.ts +0 -7
  779. package/dist/src/storage/__tests__/ui-interaction-log.test.js +0 -127
  780. package/dist/src/storage/atomic-io.test.d.ts +0 -1
  781. package/dist/src/storage/atomic-io.test.js +0 -74
  782. package/dist/src/storage/config.test.d.ts +0 -1
  783. package/dist/src/storage/config.test.js +0 -29
  784. package/dist/src/storage/session-experience-store.test.d.ts +0 -5
  785. package/dist/src/storage/session-experience-store.test.js +0 -86
  786. package/dist/src/storage/tool-results.test.d.ts +0 -1
  787. package/dist/src/storage/tool-results.test.js +0 -48
  788. package/dist/src/storage/transcript-response-entry.test.d.ts +0 -1
  789. package/dist/src/storage/transcript-response-entry.test.js +0 -111
  790. package/dist/src/storage/transcript.test.d.ts +0 -1
  791. package/dist/src/storage/transcript.test.js +0 -22
  792. package/dist/src/storage/usage-cap.test.d.ts +0 -1
  793. package/dist/src/storage/usage-cap.test.js +0 -51
  794. package/dist/src/tools/__tests__/native-tools.test.d.ts +0 -1
  795. package/dist/src/tools/__tests__/native-tools.test.js +0 -59
  796. package/dist/src/tools/__tests__/vision-gate.test.d.ts +0 -1
  797. package/dist/src/tools/__tests__/vision-gate.test.js +0 -56
  798. package/dist/src/tools/bash-output-cache.test.d.ts +0 -1
  799. package/dist/src/tools/bash-output-cache.test.js +0 -89
  800. package/dist/src/tools/bash-output-integration.test.d.ts +0 -10
  801. package/dist/src/tools/bash-output-integration.test.js +0 -30
  802. package/dist/src/tools/bash.test.d.ts +0 -1
  803. package/dist/src/tools/bash.test.js +0 -90
  804. package/dist/src/tools/computer.test.d.ts +0 -1
  805. package/dist/src/tools/computer.test.js +0 -142
  806. package/dist/src/tools/file-tracker.test.d.ts +0 -1
  807. package/dist/src/tools/file-tracker.test.js +0 -77
  808. package/dist/src/tools/file.test.d.ts +0 -1
  809. package/dist/src/tools/file.test.js +0 -106
  810. package/dist/src/tools/git-safety.test.d.ts +0 -1
  811. package/dist/src/tools/git-safety.test.js +0 -155
  812. package/dist/src/tools/registry-bash-empty-command.test.d.ts +0 -13
  813. package/dist/src/tools/registry-bash-empty-command.test.js +0 -57
  814. package/dist/src/tools/registry-bash-footer.test.d.ts +0 -7
  815. package/dist/src/tools/registry-bash-footer.test.js +0 -82
  816. package/dist/src/tools/registry-ee-query.test.d.ts +0 -11
  817. package/dist/src/tools/registry-ee-query.test.js +0 -71
  818. package/dist/src/tools/registry-git-safety.test.d.ts +0 -7
  819. package/dist/src/tools/registry-git-safety.test.js +0 -103
  820. package/dist/src/tools/registry-session-repeat.test.d.ts +0 -12
  821. package/dist/src/tools/registry-session-repeat.test.js +0 -87
  822. package/dist/src/tools/registry.test.d.ts +0 -1
  823. package/dist/src/tools/registry.test.js +0 -34
  824. package/dist/src/tools/schedule.test.d.ts +0 -1
  825. package/dist/src/tools/schedule.test.js +0 -118
  826. package/dist/src/tools/todo-write-snapshot.test.d.ts +0 -1
  827. package/dist/src/tools/todo-write-snapshot.test.js +0 -43
  828. package/dist/src/ui/__tests__/markdown-render.test.d.ts +0 -1
  829. package/dist/src/ui/__tests__/markdown-render.test.js +0 -65
  830. package/dist/src/ui/__tests__/picker-providers.test.d.ts +0 -1
  831. package/dist/src/ui/__tests__/picker-providers.test.js +0 -31
  832. package/dist/src/ui/cards/__tests__/product-status-card.test.d.ts +0 -1
  833. package/dist/src/ui/cards/__tests__/product-status-card.test.js +0 -27
  834. package/dist/src/ui/components/__tests__/council-leader-bubble.test.d.ts +0 -1
  835. package/dist/src/ui/components/__tests__/council-leader-bubble.test.js +0 -14
  836. package/dist/src/ui/components/__tests__/council-message-bubble.test.d.ts +0 -1
  837. package/dist/src/ui/components/__tests__/council-message-bubble.test.js +0 -74
  838. package/dist/src/ui/components/__tests__/council-phase-timeline.test.d.ts +0 -1
  839. package/dist/src/ui/components/__tests__/council-phase-timeline.test.js +0 -51
  840. package/dist/src/ui/components/__tests__/council-placeholder-bubble.test.d.ts +0 -1
  841. package/dist/src/ui/components/__tests__/council-placeholder-bubble.test.js +0 -14
  842. package/dist/src/ui/components/__tests__/council-question-card.test.d.ts +0 -1
  843. package/dist/src/ui/components/__tests__/council-question-card.test.js +0 -121
  844. package/dist/src/ui/components/__tests__/council-synthesis-banner.test.d.ts +0 -1
  845. package/dist/src/ui/components/__tests__/council-synthesis-banner.test.js +0 -11
  846. package/dist/src/ui/components/__tests__/task-list-panel.test.d.ts +0 -1
  847. package/dist/src/ui/components/__tests__/task-list-panel.test.js +0 -31
  848. package/dist/src/ui/components/__tests__/use-pair-quote-buffer.test.d.ts +0 -1
  849. package/dist/src/ui/components/__tests__/use-pair-quote-buffer.test.js +0 -37
  850. package/dist/src/ui/slash/__tests__/clear.test.d.ts +0 -1
  851. package/dist/src/ui/slash/__tests__/clear.test.js +0 -58
  852. package/dist/src/ui/slash/__tests__/compact.test.d.ts +0 -1
  853. package/dist/src/ui/slash/__tests__/compact.test.js +0 -43
  854. package/dist/src/ui/slash/__tests__/cost.test.d.ts +0 -1
  855. package/dist/src/ui/slash/__tests__/cost.test.js +0 -54
  856. package/dist/src/ui/slash/__tests__/discuss.test.d.ts +0 -1
  857. package/dist/src/ui/slash/__tests__/discuss.test.js +0 -83
  858. package/dist/src/ui/slash/__tests__/execute.test.d.ts +0 -1
  859. package/dist/src/ui/slash/__tests__/execute.test.js +0 -71
  860. package/dist/src/ui/slash/__tests__/expand.test.d.ts +0 -1
  861. package/dist/src/ui/slash/__tests__/expand.test.js +0 -67
  862. package/dist/src/ui/slash/__tests__/ideal.test.d.ts +0 -1
  863. package/dist/src/ui/slash/__tests__/ideal.test.js +0 -158
  864. package/dist/src/ui/slash/__tests__/menu-parity.test.d.ts +0 -17
  865. package/dist/src/ui/slash/__tests__/menu-parity.test.js +0 -43
  866. package/dist/src/ui/slash/__tests__/optimize.test.d.ts +0 -1
  867. package/dist/src/ui/slash/__tests__/optimize.test.js +0 -130
  868. package/dist/src/ui/slash/__tests__/pin.test.d.ts +0 -1
  869. package/dist/src/ui/slash/__tests__/pin.test.js +0 -38
  870. package/dist/src/ui/slash/__tests__/plan.test.d.ts +0 -1
  871. package/dist/src/ui/slash/__tests__/plan.test.js +0 -82
  872. package/dist/src/ui/slash/__tests__/ponytail.test.d.ts +0 -1
  873. package/dist/src/ui/slash/__tests__/ponytail.test.js +0 -37
  874. package/dist/src/ui/slash/__tests__/status-render.test.d.ts +0 -7
  875. package/dist/src/ui/slash/__tests__/status-render.test.js +0 -77
  876. package/dist/src/ui/slash/route.test.d.ts +0 -1
  877. package/dist/src/ui/slash/route.test.js +0 -70
  878. package/dist/src/ui/status-bar/index.test.d.ts +0 -1
  879. package/dist/src/ui/status-bar/index.test.js +0 -139
  880. package/dist/src/ui/status-bar/store.test.d.ts +0 -1
  881. package/dist/src/ui/status-bar/store.test.js +0 -116
  882. package/dist/src/ui/status-bar/tier-badge.test.d.ts +0 -1
  883. package/dist/src/ui/status-bar/tier-badge.test.js +0 -34
  884. package/dist/src/ui/status-bar/usd-meter.test.d.ts +0 -1
  885. package/dist/src/ui/status-bar/usd-meter.test.js +0 -32
  886. package/dist/src/ui/utils/__tests__/format.test.d.ts +0 -1
  887. package/dist/src/ui/utils/__tests__/format.test.js +0 -50
  888. package/dist/src/ui/utils/__tests__/tools.test.d.ts +0 -1
  889. package/dist/src/ui/utils/__tests__/tools.test.js +0 -48
  890. package/dist/src/ui/utils/relaunch.test.d.ts +0 -1
  891. package/dist/src/ui/utils/relaunch.test.js +0 -133
  892. package/dist/src/ui/utils/text.test.d.ts +0 -1
  893. package/dist/src/ui/utils/text.test.js +0 -47
  894. package/dist/src/usage/__tests__/product-ledger.test.d.ts +0 -1
  895. package/dist/src/usage/__tests__/product-ledger.test.js +0 -60
  896. package/dist/src/usage/downgrade.test.d.ts +0 -1
  897. package/dist/src/usage/downgrade.test.js +0 -70
  898. package/dist/src/usage/estimator.test.d.ts +0 -1
  899. package/dist/src/usage/estimator.test.js +0 -38
  900. package/dist/src/usage/ledger.test.d.ts +0 -1
  901. package/dist/src/usage/ledger.test.js +0 -171
  902. package/dist/src/usage/midstream.test.d.ts +0 -1
  903. package/dist/src/usage/midstream.test.js +0 -47
  904. package/dist/src/usage/thresholds.test.d.ts +0 -1
  905. package/dist/src/usage/thresholds.test.js +0 -77
  906. package/dist/src/utils/__tests__/auto-council-settings.test.d.ts +0 -1
  907. package/dist/src/utils/__tests__/auto-council-settings.test.js +0 -41
  908. package/dist/src/utils/__tests__/compaction-caps.test.d.ts +0 -21
  909. package/dist/src/utils/__tests__/compaction-caps.test.js +0 -187
  910. package/dist/src/utils/__tests__/ee-logger.test.d.ts +0 -11
  911. package/dist/src/utils/__tests__/ee-logger.test.js +0 -165
  912. package/dist/src/utils/__tests__/file-lock.test.d.ts +0 -1
  913. package/dist/src/utils/__tests__/file-lock.test.js +0 -66
  914. package/dist/src/utils/__tests__/footprint-gitignore.test.d.ts +0 -1
  915. package/dist/src/utils/__tests__/footprint-gitignore.test.js +0 -50
  916. package/dist/src/utils/__tests__/llm-deadline-abort.test.d.ts +0 -1
  917. package/dist/src/utils/__tests__/llm-deadline-abort.test.js +0 -33
  918. package/dist/src/utils/__tests__/llm-deadline.test.d.ts +0 -1
  919. package/dist/src/utils/__tests__/llm-deadline.test.js +0 -68
  920. package/dist/src/utils/__tests__/logger.test.d.ts +0 -1
  921. package/dist/src/utils/__tests__/logger.test.js +0 -115
  922. package/dist/src/utils/__tests__/rate-limit.test.d.ts +0 -1
  923. package/dist/src/utils/__tests__/rate-limit.test.js +0 -38
  924. package/dist/src/utils/__tests__/settings-agent-first.test.d.ts +0 -1
  925. package/dist/src/utils/__tests__/settings-agent-first.test.js +0 -48
  926. package/dist/src/utils/__tests__/settings-disabled-models.test.d.ts +0 -7
  927. package/dist/src/utils/__tests__/settings-disabled-models.test.js +0 -99
  928. package/dist/src/utils/__tests__/settings-web-research.test.d.ts +0 -1
  929. package/dist/src/utils/__tests__/settings-web-research.test.js +0 -46
  930. package/dist/src/utils/__tests__/slugify.test.d.ts +0 -1
  931. package/dist/src/utils/__tests__/slugify.test.js +0 -37
  932. package/dist/src/utils/__tests__/visible-retry.test.d.ts +0 -1
  933. package/dist/src/utils/__tests__/visible-retry.test.js +0 -143
  934. package/dist/src/utils/install-manager.test.d.ts +0 -1
  935. package/dist/src/utils/install-manager.test.js +0 -169
  936. package/dist/src/utils/instructions.test.d.ts +0 -1
  937. package/dist/src/utils/instructions.test.js +0 -93
  938. package/dist/src/utils/open-url.test.d.ts +0 -1
  939. package/dist/src/utils/open-url.test.js +0 -86
  940. package/dist/src/utils/permission-mode.test.d.ts +0 -1
  941. package/dist/src/utils/permission-mode.test.js +0 -188
  942. package/dist/src/utils/redactor.test.d.ts +0 -1
  943. package/dist/src/utils/redactor.test.js +0 -84
  944. package/dist/src/utils/settings.test.d.ts +0 -1
  945. package/dist/src/utils/settings.test.js +0 -212
  946. package/dist/src/utils/shell.test.d.ts +0 -1
  947. package/dist/src/utils/shell.test.js +0 -97
  948. package/dist/src/utils/skills.test.d.ts +0 -1
  949. package/dist/src/utils/skills.test.js +0 -45
  950. package/dist/src/utils/subagent-display.test.d.ts +0 -1
  951. package/dist/src/utils/subagent-display.test.js +0 -21
  952. package/dist/src/utils/subagents-settings.test.d.ts +0 -1
  953. package/dist/src/utils/subagents-settings.test.js +0 -64
  954. package/dist/src/utils/telegram-audio-settings.test.d.ts +0 -1
  955. package/dist/src/utils/telegram-audio-settings.test.js +0 -39
  956. package/dist/src/utils/update-checker.test.d.ts +0 -1
  957. package/dist/src/utils/update-checker.test.js +0 -142
  958. package/dist/src/verify/__tests__/coverage-parsers.test.d.ts +0 -1
  959. package/dist/src/verify/__tests__/coverage-parsers.test.js +0 -69
  960. package/dist/src/verify/__tests__/dotnet-recipe.test.d.ts +0 -10
  961. package/dist/src/verify/__tests__/dotnet-recipe.test.js +0 -70
  962. package/dist/src/verify/checkpoint.test.d.ts +0 -1
  963. package/dist/src/verify/checkpoint.test.js +0 -160
  964. package/dist/src/verify/entrypoint.test.d.ts +0 -1
  965. package/dist/src/verify/entrypoint.test.js +0 -233
  966. package/dist/src/verify/environment.test.d.ts +0 -1
  967. package/dist/src/verify/environment.test.js +0 -94
  968. package/dist/src/verify/orchestrator.test.d.ts +0 -1
  969. package/dist/src/verify/orchestrator.test.js +0 -126
  970. package/dist/src/verify/runtime-prep.test.d.ts +0 -1
  971. package/dist/src/verify/runtime-prep.test.js +0 -38
@@ -1,175 +0,0 @@
1
- import { describe, expect, it, vi } from "vitest";
2
- vi.mock("../../ee/bridge.js", () => ({
3
- getEmbeddingRaw: vi.fn().mockResolvedValue(null),
4
- searchCollection: vi.fn().mockResolvedValue([]),
5
- searchByText: vi.fn().mockResolvedValue([]),
6
- // WhoAmI v4.0: L5 reads session_length to tune the resume-digest stale window.
7
- // Default null = fail-open → 30m default, so the pre-v4.0 assertions below hold.
8
- getWhoAmIProfile: vi.fn(() => null),
9
- }));
10
- vi.mock("node:fs", async (importOriginal) => {
11
- const actual = await importOriginal();
12
- return {
13
- ...actual,
14
- promises: {
15
- ...actual.promises,
16
- readFile: vi.fn().mockRejectedValue(new Error("not found")),
17
- readdir: vi.fn().mockRejectedValue(new Error("not found")),
18
- stat: vi.fn().mockRejectedValue(new Error("not found")),
19
- },
20
- };
21
- });
22
- import { getWhoAmIProfile } from "../../ee/bridge.js";
23
- import { layer5Context, staleThresholdMsForSessionLength } from "../layer5-context.js";
24
- function makeCtx(overrides = {}) {
25
- return {
26
- raw: "continue working on the auth module",
27
- enriched: "continue working on the auth module",
28
- taskType: "refactor",
29
- domain: null,
30
- confidence: 0.9,
31
- outputStyle: "concise",
32
- tokenBudget: 500,
33
- metrics: null,
34
- layers: [],
35
- ...overrides,
36
- };
37
- }
38
- describe("layer5Context", () => {
39
- it("skips workspace context when intentKind === 'chitchat'", async () => {
40
- const before = "hi";
41
- const result = await layer5Context(makeCtx({
42
- raw: before,
43
- enriched: before,
44
- intentKind: "chitchat",
45
- resumeDigest: "should be ignored on chitchat",
46
- }));
47
- expect(result.enriched).toBe(before);
48
- const layer = result.layers.find((l) => l.name === "context-enrichment");
49
- expect(layer.applied).toBe(false);
50
- expect(layer.delta).toBe("skip:chitchat");
51
- });
52
- it("injects resume digest when available", async () => {
53
- const digest = "Last session: refactored auth middleware, JWT validation working, need to add refresh token logic.";
54
- const result = await layer5Context(makeCtx({ resumeDigest: digest }));
55
- expect(result.enriched).toContain("[flow-context:");
56
- expect(result.enriched).toContain("refactored auth middleware");
57
- const layer = result.layers.find((l) => l.name === "context-enrichment");
58
- expect(layer).toBeDefined();
59
- expect(layer.applied).toBe(true);
60
- expect(layer.delta).toContain("digest=");
61
- });
62
- it("no digest, no EE, no flow → applied=false", async () => {
63
- const result = await layer5Context(makeCtx({ resumeDigest: null }));
64
- const layer = result.layers.find((l) => l.name === "context-enrichment");
65
- expect(layer).toBeDefined();
66
- expect(layer.applied).toBe(false);
67
- });
68
- it("no digest undefined → applied=false (with mocked EE)", async () => {
69
- const result = await layer5Context(makeCtx());
70
- const layer = result.layers.find((l) => l.name === "context-enrichment");
71
- expect(layer.applied).toBe(false);
72
- });
73
- it("empty digest → applied=false (with mocked EE)", async () => {
74
- const result = await layer5Context(makeCtx({ resumeDigest: "" }));
75
- const layer = result.layers.find((l) => l.name === "context-enrichment");
76
- expect(layer.applied).toBe(false);
77
- });
78
- it("includes digest in delta when present", async () => {
79
- const result = await layer5Context(makeCtx({ resumeDigest: "Some digest", activeRunId: "abc123" }));
80
- const layer = result.layers.find((l) => l.name === "context-enrichment");
81
- expect(layer.applied).toBe(true);
82
- expect(layer.delta).toContain("digest=");
83
- });
84
- it("respects tokenBudget — truncates long digest", async () => {
85
- const longDigest = "Context: ".repeat(500);
86
- const result = await layer5Context(makeCtx({ resumeDigest: longDigest, tokenBudget: 50 }));
87
- const layer = result.layers.find((l) => l.name === "context-enrichment");
88
- if (layer?.delta) {
89
- const charsMatch = layer.delta.match(/chars=(\d+)/);
90
- if (charsMatch) {
91
- expect(parseInt(charsMatch[1], 10)).toBeLessThanOrEqual(50 * 4);
92
- }
93
- }
94
- });
95
- it("adds stale warning when digest is older than 30 minutes", async () => {
96
- const result = await layer5Context(makeCtx({ resumeDigest: "Previous work on auth", digestAgeMs: 60 * 60 * 1000 }));
97
- expect(result.enriched).toContain("stale");
98
- const layer = result.layers.find((l) => l.name === "context-enrichment");
99
- expect(layer.delta).toContain("stale");
100
- });
101
- it("no stale warning when digest is fresh", async () => {
102
- const result = await layer5Context(makeCtx({ resumeDigest: "Recent work", digestAgeMs: 5 * 60 * 1000 }));
103
- expect(result.enriched).not.toContain("stale");
104
- });
105
- it("no stale warning when digestAgeMs is undefined", async () => {
106
- const result = await layer5Context(makeCtx({ resumeDigest: "Some work" }));
107
- expect(result.enriched).not.toContain("stale");
108
- });
109
- it("skips fetchPrinciples when ctx._brainData already supplied them", async () => {
110
- const { searchByText } = await import("../../ee/bridge.js");
111
- vi.mocked(searchByText).mockClear();
112
- const { layer5Context } = await import("../layer5-context.js");
113
- await layer5Context({
114
- raw: "x",
115
- enriched: "x",
116
- taskType: "debug",
117
- domain: null,
118
- confidence: 0.85,
119
- outputStyle: "balanced",
120
- tokenBudget: 2000,
121
- metrics: null,
122
- layers: [],
123
- _brainData: {
124
- t0_principles: [{ text: "p", score: 0.9 }],
125
- t1_rules: [],
126
- t2_patterns: [],
127
- retrieval_skipped_reason: null,
128
- },
129
- });
130
- expect(searchByText).not.toHaveBeenCalled();
131
- });
132
- it("preserves existing enriched content", async () => {
133
- const result = await layer5Context(makeCtx({
134
- enriched: "already enriched prompt\n[personality: concise]",
135
- resumeDigest: "Previous session work",
136
- }));
137
- expect(result.enriched).toContain("already enriched prompt");
138
- expect(result.enriched).toContain("[flow-context:");
139
- });
140
- // WhoAmI v4.0: session_length tunes the resume-digest stale window. A 45-minute-old
141
- // digest is stale at the 30m default but FRESH for a long-session user (window→60m).
142
- // This proves the profile actually flows through layer5Context, not just the helper.
143
- it("long session_length relaxes the stale window — 45m digest is not stale", async () => {
144
- vi.mocked(getWhoAmIProfile).mockReturnValueOnce({
145
- level: "minimal",
146
- dims: { "work_patterns.session_length": { value: "long", confidence: 0.5, samples: 16 } },
147
- });
148
- const result = await layer5Context(makeCtx({ resumeDigest: "Deep-work session context", digestAgeMs: 45 * 60 * 1000 }));
149
- expect(result.enriched).not.toContain("stale");
150
- const layer = result.layers.find((l) => l.name === "context-enrichment");
151
- expect(layer.delta).toContain("window=60m");
152
- expect(layer.delta).not.toContain(",stale");
153
- });
154
- it("short session_length tightens the stale window — 20m digest is stale", async () => {
155
- vi.mocked(getWhoAmIProfile).mockReturnValueOnce({
156
- level: "minimal",
157
- dims: { "work_patterns.session_length": { value: "short", confidence: 0.5, samples: 16 } },
158
- });
159
- const result = await layer5Context(makeCtx({ resumeDigest: "Quick-burst session context", digestAgeMs: 20 * 60 * 1000 }));
160
- expect(result.enriched).toContain("stale");
161
- const layer = result.layers.find((l) => l.name === "context-enrichment");
162
- expect(layer.delta).toContain("window=15m");
163
- });
164
- });
165
- describe("staleThresholdMsForSessionLength — pure session_length → stale window mapping", () => {
166
- it("long → 60m, short → 15m, medium/absent/unknown → 30m default (fail-open)", () => {
167
- expect(staleThresholdMsForSessionLength("long")).toBe(60 * 60 * 1000);
168
- expect(staleThresholdMsForSessionLength("short")).toBe(15 * 60 * 1000);
169
- expect(staleThresholdMsForSessionLength("medium")).toBe(30 * 60 * 1000);
170
- expect(staleThresholdMsForSessionLength(undefined)).toBe(30 * 60 * 1000);
171
- expect(staleThresholdMsForSessionLength(null)).toBe(30 * 60 * 1000);
172
- expect(staleThresholdMsForSessionLength("telegraphic")).toBe(30 * 60 * 1000);
173
- });
174
- });
175
- //# sourceMappingURL=layer5-context.test.js.map
@@ -1 +0,0 @@
1
- export {};
@@ -1,465 +0,0 @@
1
- import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
2
- import { getWhoAmIProfile } from "../../ee/bridge.js";
3
- import { applyPilSuffix, getResponseToolSet, isImplementationIntent, isQuestionLike, layer6Output, } from "../layer6-output.js";
4
- // Mock bridge for PIL-03 classifyViaBrain tests. getWhoAmIProfile defaults to null
5
- // (fail-open) so applyPilSuffix never reads the real on-device profile during tests.
6
- vi.mock("../../ee/bridge.js", () => ({
7
- classifyViaBrain: vi.fn().mockResolvedValue(null),
8
- getWhoAmIProfile: vi.fn(() => null),
9
- }));
10
- async function getMockBrain() {
11
- const { classifyViaBrain } = await import("../../ee/bridge.js");
12
- return vi.mocked(classifyViaBrain);
13
- }
14
- const makeCtx = (taskType = null, outputStyle = null) => ({
15
- raw: "test prompt for output style detection",
16
- enriched: "test prompt for output style detection",
17
- taskType,
18
- domain: null,
19
- confidence: 0,
20
- outputStyle,
21
- tokenBudget: 500,
22
- metrics: null,
23
- layers: [],
24
- });
25
- describe("applyPilSuffix — per-task-type suffixes", () => {
26
- const taskTypes = ["refactor", "debug", "plan", "analyze", "documentation", "generate"];
27
- it.each(taskTypes)("appends correct OUTPUT RULES for taskType=%s", (tt) => {
28
- const ctx = makeCtx(tt);
29
- const result = applyPilSuffix("SYSTEM", ctx);
30
- expect(result).toContain("SYSTEM");
31
- expect(result).toContain(`OUTPUT RULES (${tt})`);
32
- expect(result.length).toBeGreaterThan("SYSTEM".length);
33
- });
34
- it("each task type has a distinct suffix", () => {
35
- const suffixes = taskTypes.map((tt) => applyPilSuffix("", makeCtx(tt)));
36
- const unique = new Set(suffixes);
37
- expect(unique.size).toBe(taskTypes.length);
38
- });
39
- it("returns system prompt unchanged when taskType is null", () => {
40
- const system = "You are a helpful assistant.";
41
- expect(applyPilSuffix(system, makeCtx(null))).toBe(system);
42
- });
43
- it("defaults to concise when outputStyle is null", () => {
44
- const ctxNullStyle = makeCtx("debug", null);
45
- const ctxConcise = makeCtx("debug", "concise");
46
- expect(applyPilSuffix("S", ctxNullStyle)).toBe(applyPilSuffix("S", ctxConcise));
47
- });
48
- it("PIL-04 Tier 1.2: appends OUTPUT BUDGET hint per task type", () => {
49
- const result = applyPilSuffix("S", makeCtx("debug", "concise"));
50
- expect(result).toMatch(/OUTPUT BUDGET: aim for ≤500 tokens/);
51
- const genResult = applyPilSuffix("S", makeCtx("generate", "concise"));
52
- expect(genResult).toMatch(/OUTPUT BUDGET: aim for ≤1200 tokens/);
53
- });
54
- it("PIL-04 Tier 1.3: appends FORBIDDEN OPENERS rule for all styles", () => {
55
- for (const style of ["concise", "balanced", "detailed"]) {
56
- const result = applyPilSuffix("S", makeCtx("plan", style));
57
- expect(result).toMatch(/FORBIDDEN OPENERS/);
58
- expect(result).toMatch(/Tôi sẽ/); // bilingual
59
- }
60
- });
61
- it("de-robotized: NO_PREAMBLE bans only openers, not end-of-turn summary or inter-tool narration", () => {
62
- // The summary + inter-tool bans were removed because they stripped natural
63
- // connective tissue (the "máy móc" feel). Inter-tool spam is still removed
64
- // structurally by stripInterToolNarration() in reasoning.ts. This guards
65
- // against the bans silently creeping back into the system prompt.
66
- const result = applyPilSuffix("S", makeCtx("debug", "concise"));
67
- expect(result).toMatch(/FORBIDDEN OPENERS/);
68
- expect(result).not.toMatch(/FORBIDDEN END-OF-TURN SUMMARY/);
69
- expect(result).not.toMatch(/FORBIDDEN INTER-TOOL NARRATION/);
70
- });
71
- it("de-robotized: debug suffix is guidance, not a rigid arrow skeleton", () => {
72
- // "Format = Hypothesis → Root cause → Fix → Verify" produced stilted,
73
- // label-prefixed answers. It must read as guidance now.
74
- const result = applyPilSuffix("S", makeCtx("debug", "concise"));
75
- expect(result).toContain("OUTPUT RULES (debug)");
76
- expect(result).not.toMatch(/Format = Hypothesis/);
77
- });
78
- it("E: appends the anti-bookkeeping note on the natural path for non-question turns", () => {
79
- // The contract's REPORTING rule leaks as a provenance footer ("evidence only
80
- // from this turn") on imperative answer turns; the natural path now guards it.
81
- const result = applyPilSuffix("S", makeCtx("analyze", "concise"));
82
- expect(result).toMatch(/WRITE FOR THE READER/);
83
- expect(result).toMatch(/provenance/i);
84
- });
85
- it("E: skips the anti-bookkeeping note for question turns (L4 QUESTION directive covers them)", () => {
86
- const ctx = { ...makeCtx("analyze", "concise"), raw: "why does the enrichment layer fail?" };
87
- expect(applyPilSuffix("S", ctx)).not.toMatch(/WRITE FOR THE READER/);
88
- });
89
- it("E: response-tools path does not add the natural-path bookkeeping note", () => {
90
- const result = applyPilSuffix("S", makeCtx("analyze", "balanced"), true);
91
- expect(result).not.toMatch(/WRITE FOR THE READER/);
92
- });
93
- it("PIL-04: response-tools path skips budget+preamble (tool already enforces structure)", () => {
94
- const result = applyPilSuffix("S", makeCtx("analyze", "balanced"), true);
95
- expect(result).toContain("respond_analyze");
96
- expect(result).not.toMatch(/OUTPUT BUDGET/);
97
- expect(result).not.toMatch(/FORBIDDEN OPENERS/);
98
- });
99
- it("general response-tool turn appends the human-UX note + no-footer clause (session 9e3fb3e2e0c9)", () => {
100
- // A general/question response-tool turn must steer the answer toward a
101
- // human reader: lead with the answer, no implementation plan, no process
102
- // narration, and crucially NO evidence-provenance footer ("all facts from
103
- // this turn / did not infer unopened files") — that compliance bookkeeping
104
- // leaked into the user-facing reply.
105
- const result = applyPilSuffix("S", makeCtx("general", "concise"), true);
106
- expect(result).toContain("respond_general");
107
- expect(result).toMatch(/for the HUMAN who asked/);
108
- expect(result).toMatch(/do NOT narrate your own process/);
109
- expect(result).toMatch(/Do NOT append an evidence-provenance footer/);
110
- });
111
- });
112
- describe("getResponseToolSet — narrow gating (de-robotizing)", () => {
113
- // Override raw on a typed ctx so the report/question discriminator is exercised.
114
- const ctxRaw = (raw, t) => ({ ...makeCtx(t, null), raw });
115
- it("returns response tool for analyze on an explicit report/list request", () => {
116
- const tools = getResponseToolSet(ctxRaw("audit the orchestrator and list all cost-leak findings", "analyze"));
117
- expect(Object.keys(tools)).toContain("respond_analyze");
118
- });
119
- it("returns response tool for plan on an explicit plan request", () => {
120
- const tools = getResponseToolSet(ctxRaw("plan the migration to the new auth flow step by step", "plan"));
121
- expect(Object.keys(tools)).toContain("respond_plan");
122
- });
123
- it("returns response tool for debug only on an explicit report request", () => {
124
- const tools = getResponseToolSet(ctxRaw("audit the failing suite and list each root cause", "debug"));
125
- expect(Object.keys(tools)).toContain("respond_debug");
126
- });
127
- it("returns empty toolset for generate (code-heavy, markdown wins)", () => {
128
- expect(getResponseToolSet(makeCtx("generate", null))).toEqual({});
129
- });
130
- it("returns empty toolset for refactor (diff-heavy, markdown wins)", () => {
131
- expect(getResponseToolSet(makeCtx("refactor", null))).toEqual({});
132
- });
133
- it("returns empty toolset for documentation (prose-heavy)", () => {
134
- expect(getResponseToolSet(makeCtx("documentation", null))).toEqual({});
135
- });
136
- it("returns response tool for general regardless of report signal (renders as plain markdown)", () => {
137
- // general is exempt from the report/question gate: GeneralSchema is pure text
138
- // and its renderer shows plain markdown, so respond_general is never robotic.
139
- const tools = getResponseToolSet(makeCtx("general", null));
140
- expect(Object.keys(tools)).toContain("respond_general");
141
- });
142
- it("drops respond_general when providerId is deepseek (token leak quirk)", () => {
143
- expect(getResponseToolSet(makeCtx("general", null), "deepseek")).toEqual({});
144
- expect(getResponseToolSet(makeCtx("general", null), "siliconflow")).toEqual({});
145
- });
146
- it("keeps respond_general for openai/anthropic/google", () => {
147
- for (const id of ["openai", "anthropic", "google", "xai"]) {
148
- const tools = getResponseToolSet(makeCtx("general", null), id);
149
- expect(Object.keys(tools)).toContain("respond_general");
150
- }
151
- });
152
- it("returns empty toolset when taskType is null", () => {
153
- expect(getResponseToolSet(makeCtx(null, null))).toEqual({});
154
- });
155
- it("gates the response tool for chitchat turns", () => {
156
- const ctx = { ...makeCtx("general", null), intentKind: "chitchat" };
157
- expect(getResponseToolSet(ctx)).toEqual({});
158
- });
159
- it("DROPS respond_<task> for question-style debug/analyze/plan (natural markdown path)", () => {
160
- // The de-robotizing change: a plain QUESTION must not be forced into the
161
- // rigid respond_* schema + labeled renderer. It falls through to the softened
162
- // markdown OUTPUT RULES so the answer reads as natural prose.
163
- expect(getResponseToolSet(ctxRaw("why does the build fail intermittently?", "debug"))).toEqual({});
164
- expect(getResponseToolSet(ctxRaw("analyze how the enrichment function works", "analyze"))).toEqual({});
165
- expect(getResponseToolSet(ctxRaw("what is the cleanest way to structure this module?", "plan"))).toEqual({});
166
- });
167
- it("KEEPS respond_<task> for explicit report / list / plan requests (EN + VI)", () => {
168
- const keep = (raw, t) => Object.keys(getResponseToolSet(ctxRaw(raw, t)));
169
- expect(keep("list all cost leaks in the orchestrator", "analyze")).toContain("respond_analyze");
170
- expect(keep("review the module and report each finding by severity", "analyze")).toContain("respond_analyze");
171
- expect(keep("lập kế hoạch migration sang auth flow mới", "plan")).toContain("respond_plan");
172
- });
173
- it("DROPS respond_<task> for a QUESTION that merely mentions plan/list (narrow-gate fix)", () => {
174
- // Live bug (grok interview): a question that QUOTED the phrase "state a 2-3
175
- // line plan" matched the bare word 'plan' in STRUCTURED_REPORT_RE and forced
176
- // respond_plan, cramming an introspective answer into a rigid plan schema. A
177
- // question-shaped prompt must stay on the natural markdown path even when it
178
- // contains plan/list words.
179
- expect(getResponseToolSet(ctxRaw("what rules constrain you, e.g. the 'state a 2-3 line plan' directive?", "plan"))).toEqual({});
180
- expect(getResponseToolSet(ctxRaw("can you list the main points?", "analyze"))).toEqual({});
181
- expect(getResponseToolSet(ctxRaw("how would you plan the rollout?", "plan"))).toEqual({});
182
- // Imperative delivery requests are NOT question-shaped → still structured.
183
- expect(Object.keys(getResponseToolSet(ctxRaw("plan the rollout step by step", "plan")))).toContain("respond_plan");
184
- });
185
- it("drops respond_<task> on an IMPLEMENTATION-intent prompt (no premature terminal answer)", () => {
186
- // Live (grok session 19fa8895c41c): an "Improve … implement these fixes"
187
- // prompt classified `debug` got respond_debug; the model called it mid-task
188
- // as a plan and the turn ended before the edits completed. Implementation
189
- // turns must fall through to markdown OUTPUT RULES, not a terminal tool.
190
- // Implementation intent takes precedence over a report signal.
191
- const impl = (raw, t) => ({ ...makeCtx(t, null), raw });
192
- expect(getResponseToolSet(impl("Improve the story-list screen. Implement these prioritized fixes: …", "debug"))).toEqual({});
193
- expect(getResponseToolSet(impl("Edit ONLY these two files and fix the empty span", "debug"))).toEqual({});
194
- expect(getResponseToolSet(impl("refactor the genre dropdown and wire up keyboard handlers", "analyze"))).toEqual({});
195
- expect(getResponseToolSet(impl("triển khai các cải tiến đã đề xuất", "plan"))).toEqual({});
196
- });
197
- });
198
- describe("getResponseToolSet — Phase 2b deliverableKind consume (model overrides regex)", () => {
199
- const ctxD = (raw, t, deliverableKind) => ({
200
- ...makeCtx(t, null),
201
- raw,
202
- deliverableKind,
203
- });
204
- it("deliverableKind='code' DROPS respond_* even when the prompt reads as a report/list", () => {
205
- // Legacy regex (prefersStructuredReport) would KEEP the tool on "list all …".
206
- // The model said the deliverable is code → drop it (edits, not a report).
207
- expect(getResponseToolSet(ctxD("list all cost leaks in the orchestrator", "analyze", "code"))).toEqual({});
208
- });
209
- it("deliverableKind='report' KEEPS respond_* even when the prompt is question-shaped", () => {
210
- // Legacy regex (isQuestionLike) would DROP the tool on "why does …?". The
211
- // model said the deliverable is a structured report → keep it.
212
- const tools = getResponseToolSet(ctxD("why does the suite fail — break it down by cause", "analyze", "report"));
213
- expect(Object.keys(tools)).toContain("respond_analyze");
214
- });
215
- it("deliverableKind='answer' DROPS respond_* for non-general even on a report-shaped request", () => {
216
- expect(getResponseToolSet(ctxD("plan the migration step by step", "plan", "answer"))).toEqual({});
217
- });
218
- it("deliverableKind='answer' KEEPS respond_general (general is exempt — renders as plain markdown)", () => {
219
- const tools = getResponseToolSet(ctxD("what does the enrichment layer do?", "general", "answer"));
220
- expect(Object.keys(tools)).toContain("respond_general");
221
- });
222
- it("falls back to the legacy regex when deliverableKind is absent (null)", () => {
223
- // No model signal → legacy path: question-shaped analyze drops the tool.
224
- expect(getResponseToolSet({ ...makeCtx("analyze", null), raw: "why does the build fail?" })).toEqual({});
225
- // …and an explicit report request keeps it.
226
- expect(Object.keys(getResponseToolSet({ ...makeCtx("analyze", null), raw: "list all cost leaks" }))).toContain("respond_analyze");
227
- });
228
- it("DROPS respond_* on an implement turn even when mis-classified as report (session 2b7a10219499)", () => {
229
- // "lên plan rồi improvement … cải thiện X" is an implement turn the model
230
- // tagged deliverable=report; the report-exception used to KEEP respond_plan,
231
- // so the model stated a plan and ended the turn with edits done but
232
- // uncommitted/unreported. Implementation intent must suppress the terminal
233
- // tool BEFORE the deliverable branch is consulted.
234
- expect(getResponseToolSet(ctxD("lên plan rồi improvement nhé, focus cải thiện Compaction", "plan", "report"))).toEqual({});
235
- expect(getResponseToolSet(ctxD("improve the compactor and implement the fix", "plan", "report"))).toEqual({});
236
- });
237
- });
238
- describe("applyPilSuffix — outputStyle variants", () => {
239
- const styles = ["concise", "detailed", "balanced"];
240
- it("each style produces a different suffix for the same taskType (using non-action task)", () => {
241
- // Action tasks (debug/refactor/generate) coerce style=detailed → concise
242
- // unless the prompt literally asks for detail, so they only have 2 distinct
243
- // suffix shapes from the 3 inputs. Use a non-action task (plan) to verify
244
- // style variants are still routed through.
245
- const suffixes = styles.map((s) => applyPilSuffix("", makeCtx("plan", s)));
246
- const unique = new Set(suffixes);
247
- expect(unique.size).toBe(styles.length);
248
- });
249
- it.each(styles)("debug suffix always present for style=%s", (style) => {
250
- const result = applyPilSuffix("", makeCtx("debug", style));
251
- expect(result).toContain("OUTPUT RULES (debug)");
252
- });
253
- it("detailed suffix allows explanation on non-action task (plan)", () => {
254
- // Action-task coercion: refactor+detailed → concise (no "full rationale").
255
- // The behavior we care about — that "detailed" really carries through to a
256
- // longer suffix — is still observable on plan.
257
- const result = applyPilSuffix("", makeCtx("plan", "detailed"));
258
- expect(result).toContain("full rationale");
259
- });
260
- it("concise suffix restricts prose", () => {
261
- const result = applyPilSuffix("", makeCtx("refactor", "concise"));
262
- expect(result).toContain("No prose");
263
- });
264
- it("coerces refactor+detailed → concise when prompt has no detail-request keywords (session 127140a47b56)", () => {
265
- const ctx = makeCtx("refactor", "detailed");
266
- ctx.raw = "rename foo to bar across the repo";
267
- const result = applyPilSuffix("", ctx);
268
- expect(result).toContain("No prose");
269
- expect(result).not.toContain("full rationale");
270
- });
271
- it("honors refactor+detailed when the prompt explicitly asks for detail", () => {
272
- const ctx = makeCtx("refactor", "detailed");
273
- ctx.raw = "refactor this module and explain in detail what you changed";
274
- const result = applyPilSuffix("", ctx);
275
- expect(result).toContain("full rationale");
276
- });
277
- it("honors refactor+detailed when the Vietnamese prompt asks for chi tiết", () => {
278
- const ctx = makeCtx("refactor", "detailed");
279
- ctx.raw = "refactor module này và giải thích chi tiết cho tôi";
280
- const result = applyPilSuffix("", ctx);
281
- expect(result).toContain("full rationale");
282
- });
283
- });
284
- describe("layer6Output — style resolution", () => {
285
- beforeEach(() => {
286
- vi.clearAllMocks();
287
- });
288
- it("uses ctx.outputStyle from L1 directly when already set — no brain call", async () => {
289
- const brain = await getMockBrain();
290
- const result = await layer6Output(makeCtx("debug", "concise"));
291
- expect(result.layers[0].delta).toContain("style=concise");
292
- expect(result.layers[0].delta).toContain("src=inherited");
293
- expect(brain).not.toHaveBeenCalled();
294
- });
295
- it("uses detailed style when passed from L1", async () => {
296
- const result = await layer6Output(makeCtx("plan", "detailed"));
297
- expect(result.layers[0].delta).toContain("style=detailed");
298
- expect(result.layers[0].delta).toContain("src=inherited");
299
- });
300
- it("when ctx.taskType is null, layer is not applied", async () => {
301
- const result = await layer6Output(makeCtx(null, null));
302
- expect(result.layers[0].applied).toBe(false);
303
- });
304
- it("PIL-03a: rescues outputStyle via brain when L1 returns null", async () => {
305
- const brain = await getMockBrain();
306
- brain.mockResolvedValueOnce("detailed");
307
- const result = await layer6Output(makeCtx("plan", null));
308
- expect(result.outputStyle).toBe("detailed");
309
- expect(result.layers[0].delta).toContain("style=detailed");
310
- expect(result.layers[0].delta).toContain("src=brain-rescue");
311
- });
312
- // PIL-L6 verbosity fix — debug default flipped to "concise" to stop the
313
- // model from padding root-cause analysis with rationale prose.
314
- it("PIL-03b: uses task-type heuristic when brain returns null (debug→concise)", async () => {
315
- const result = await layer6Output(makeCtx("debug", null));
316
- expect(result.outputStyle).toBe("concise");
317
- expect(result.layers[0].delta).toContain("style=concise");
318
- expect(result.layers[0].delta).toContain("src=task-heuristic");
319
- });
320
- it("PIL-03b: task-heuristic for plan→balanced (not detailed — avoids generating extra sections)", async () => {
321
- const result = await layer6Output(makeCtx("plan", null));
322
- expect(result.outputStyle).toBe("balanced");
323
- expect(result.layers[0].delta).toContain("style=balanced");
324
- });
325
- it("PIL-03b: task-heuristic for generate→concise", async () => {
326
- const result = await layer6Output(makeCtx("generate", null));
327
- expect(result.outputStyle).toBe("concise");
328
- expect(result.layers[0].delta).toContain("style=concise");
329
- });
330
- it("PIL-03b: task-heuristic for refactor→concise", async () => {
331
- const result = await layer6Output(makeCtx("refactor", null));
332
- expect(result.outputStyle).toBe("concise");
333
- });
334
- it("skips classifyViaBrain rescue when ctx._brainData is populated (style guaranteed by L1)", async () => {
335
- const brain = await getMockBrain();
336
- brain.mockClear();
337
- const ctx = {
338
- ...makeCtx("plan", "balanced"),
339
- _brainData: { t0_principles: [], t1_rules: [], t2_patterns: [], retrieval_skipped_reason: null },
340
- };
341
- await layer6Output(ctx);
342
- expect(brain).not.toHaveBeenCalled();
343
- });
344
- it("PIL-03: resolved outputStyle propagated back onto ctx", async () => {
345
- // PIL-L6 verbosity fix — analyze default also flipped to "concise".
346
- const result = await layer6Output(makeCtx("analyze", null));
347
- expect(result.outputStyle).not.toBeNull();
348
- expect(result.outputStyle).toBe("concise");
349
- });
350
- });
351
- describe("layer6Output", () => {
352
- beforeEach(() => {
353
- vi.clearAllMocks();
354
- });
355
- it("with taskType=debug — applied=true, delta contains suffix=debug and style", async () => {
356
- const { classifyViaBrain } = await import("../../ee/bridge.js");
357
- vi.mocked(classifyViaBrain).mockResolvedValue(null);
358
- const result = await layer6Output(makeCtx("debug", "concise"));
359
- expect(result.layers).toHaveLength(1);
360
- expect(result.layers[0].applied).toBe(true);
361
- expect(result.layers[0].delta).toMatch(/suffix=debug/);
362
- expect(result.layers[0].delta).toMatch(/style=concise/);
363
- expect(result.layers[0].delta).toMatch(/chars=\d+/);
364
- });
365
- it("with taskType=refactor — applied=true, delta contains suffix=refactor", async () => {
366
- const { classifyViaBrain } = await import("../../ee/bridge.js");
367
- vi.mocked(classifyViaBrain).mockResolvedValue(null);
368
- const result = await layer6Output(makeCtx("refactor", "detailed"));
369
- expect(result.layers[0].applied).toBe(true);
370
- expect(result.layers[0].delta).toMatch(/suffix=refactor/);
371
- expect(result.layers[0].delta).toMatch(/style=detailed/);
372
- });
373
- it("with taskType=null — applied=false, delta=null", async () => {
374
- const result = await layer6Output(makeCtx(null));
375
- expect(result.layers[0].applied).toBe(false);
376
- expect(result.layers[0].delta).toBeNull();
377
- });
378
- it("chitchat short-circuit: skips suffix work, marks delta=skip:chitchat", async () => {
379
- const brain = await getMockBrain();
380
- const ctx = { ...makeCtx("general", "concise"), intentKind: "chitchat" };
381
- const result = await layer6Output(ctx);
382
- expect(result.layers[0].applied).toBe(false);
383
- expect(result.layers[0].delta).toBe("skip:chitchat");
384
- expect(brain).not.toHaveBeenCalled();
385
- });
386
- it("applyPilSuffix: returns prompt unchanged when intentKind=chitchat", () => {
387
- const ctx = { ...makeCtx("general", "concise"), intentKind: "chitchat" };
388
- const system = "SYSTEM";
389
- expect(applyPilSuffix(system, ctx)).toBe(system);
390
- });
391
- it("enriched unchanged (Layer 6 modifies system prompt only)", async () => {
392
- const { classifyViaBrain } = await import("../../ee/bridge.js");
393
- vi.mocked(classifyViaBrain).mockResolvedValue(null);
394
- const ctx = makeCtx("generate");
395
- const result = await layer6Output(ctx);
396
- expect(result.enriched).toBe(ctx.enriched);
397
- });
398
- });
399
- describe("isQuestionLike — Vietnamese yes/no question frames (regression: session f6f7881a5fae)", () => {
400
- it("detects the live miss: 'check ... dùng được mcp ... không nhé'", () => {
401
- // The exact prompt that was mis-routed to the implement/verify scaffold.
402
- expect(isQuestionLike("bạn check xem dùng được mcp muonroi-docs không nhé")).toBe(true);
403
- // It is NOT an implementation intent, so layer4-gsd's informational gate fires.
404
- expect(isImplementationIntent("bạn check xem dùng được mcp muonroi-docs không nhé")).toBe(false);
405
- });
406
- it("detects common VI yes/no tails", () => {
407
- expect(isQuestionLike("dùng được không")).toBe(true);
408
- expect(isQuestionLike("cái này chạy được không vậy")).toBe(true);
409
- expect(isQuestionLike("đúng không")).toBe(true);
410
- expect(isQuestionLike("phải không nhỉ")).toBe(true);
411
- expect(isQuestionLike("test đã pass chưa")).toBe(true);
412
- expect(isQuestionLike("xong chưa ạ")).toBe(true);
413
- expect(isQuestionLike("có chạy được không?")).toBe(true);
414
- });
415
- it("does NOT treat a mid-sentence negation as a question", () => {
416
- // "không là hỏng" = "or it breaks" — 'không' is not the clause-final particle.
417
- expect(isQuestionLike("đừng commit file .env không là lộ key")).toBe(false);
418
- // Plain imperative with a 'nhé' softener (no 'không'/'chưa' tail) stays a task.
419
- expect(isQuestionLike("sửa giúp tôi cái này nhé")).toBe(false);
420
- expect(isQuestionLike("triển khai tính năng login")).toBe(false);
421
- });
422
- it("still detects the pre-existing EN/VI question shapes", () => {
423
- expect(isQuestionLike("why does the build fail?")).toBe(true);
424
- expect(isQuestionLike("tại sao build lỗi")).toBe(true);
425
- expect(isQuestionLike("explain the pipeline")).toBe(true);
426
- });
427
- });
428
- describe("isImplementationIntent — improve / cải thiện (regression: session 2b7a10219499)", () => {
429
- it("recognises improve/improvement + VI cải thiện as implement turns", () => {
430
- expect(isImplementationIntent("improve the compactor")).toBe(true);
431
- expect(isImplementationIntent("lên plan rồi improvement nhé")).toBe(true);
432
- expect(isImplementationIntent("focus cải thiện Compaction")).toBe(true);
433
- expect(isImplementationIntent("cai thien phan compaction")).toBe(true);
434
- });
435
- it("does not over-match analysis questions that merely describe behaviour", () => {
436
- expect(isImplementationIntent("what does the enrichment layer do?")).toBe(false);
437
- expect(isImplementationIntent("why does the suite fail — break it down")).toBe(false);
438
- });
439
- });
440
- describe("applyPilSuffix — WhoAmI feedback_style correction-affordance", () => {
441
- const withFeedback = (value) => ({
442
- level: "standard",
443
- dims: { "communication.feedback_style": { value, confidence: 0.7, samples: 20 } },
444
- });
445
- // Reset around each test so a mockReturnValue never leaks into (or out of) this
446
- // block — clearAllMocks elsewhere only clears history, not the return override.
447
- beforeEach(() => vi.mocked(getWhoAmIProfile).mockReturnValue(null));
448
- afterEach(() => vi.mocked(getWhoAmIProfile).mockReturnValue(null));
449
- it("precise-correction + action task (refactor) → AUDITABLE CHANGES rule", () => {
450
- vi.mocked(getWhoAmIProfile).mockReturnValue(withFeedback("precise-correction"));
451
- expect(applyPilSuffix("SYS", makeCtx("refactor"))).toContain("AUDITABLE CHANGES");
452
- });
453
- it("precise-correction + non-action task (analyze) → no rule (diffs don't apply)", () => {
454
- vi.mocked(getWhoAmIProfile).mockReturnValue(withFeedback("precise-correction"));
455
- expect(applyPilSuffix("SYS", makeCtx("analyze"))).not.toContain("AUDITABLE CHANGES");
456
- });
457
- it("implicit feedback → no rule (intentionally unwired — covered by brevity/delegation)", () => {
458
- vi.mocked(getWhoAmIProfile).mockReturnValue(withFeedback("implicit"));
459
- expect(applyPilSuffix("SYS", makeCtx("debug"))).not.toContain("AUDITABLE CHANGES");
460
- });
461
- it("absent profile → no rule (fail-open)", () => {
462
- expect(applyPilSuffix("SYS", makeCtx("generate"))).not.toContain("AUDITABLE CHANGES");
463
- });
464
- });
465
- //# sourceMappingURL=layer6-output.test.js.map
@@ -1 +0,0 @@
1
- export {};