micro-models-agent 0.61.0 → 0.62.0

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 (233) hide show
  1. package/CHANGELOG.md +619 -595
  2. package/README.md +358 -358
  3. package/dist/certification/certifications.json +493 -493
  4. package/dist/cli/commands.js +447 -0
  5. package/dist/cli/completer.js +167 -0
  6. package/dist/cli/index.js +2 -0
  7. package/dist/cli/main.js +153 -0
  8. package/dist/cli/plugin-commands.js +36 -0
  9. package/dist/cli/repl-commands.js +761 -0
  10. package/dist/cli/repl.js +702 -0
  11. package/dist/cli/run-result.js +33 -0
  12. package/dist/cli/security-commands.js +164 -0
  13. package/dist/cli/setup.js +237 -0
  14. package/dist/config/config.js +276 -0
  15. package/dist/config/defaults.js +141 -0
  16. package/dist/config/domains.js +179 -0
  17. package/dist/config/experts.js +15 -0
  18. package/dist/config/index.js +4 -0
  19. package/dist/config/security.js +213 -0
  20. package/dist/config/types.js +1 -0
  21. package/dist/core/agent-moe.js +102 -0
  22. package/dist/core/agent.js +1018 -0
  23. package/dist/core/bootstrap.js +481 -0
  24. package/dist/core/crash-handler.js +51 -0
  25. package/dist/core/environment.js +199 -0
  26. package/dist/core/index.js +2 -0
  27. package/dist/core/prompt-builder.js +76 -0
  28. package/dist/core/session-logger.js +251 -0
  29. package/dist/core/types.js +1 -0
  30. package/dist/core/version.js +26 -0
  31. package/dist/core/workspace.js +76 -0
  32. package/dist/i18n/en.json +776 -757
  33. package/dist/i18n/index.js +46 -0
  34. package/dist/i18n/ru.json +776 -757
  35. package/dist/index.js +22 -0
  36. package/dist/llm/image-utils.js +143 -0
  37. package/dist/llm/index.js +4 -0
  38. package/dist/llm/model-loader.js +78 -0
  39. package/dist/llm/openai-compat.js +497 -0
  40. package/dist/llm/orchestrator.js +200 -0
  41. package/dist/llm/provider.js +10 -0
  42. package/dist/llm/response.js +39 -0
  43. package/dist/llm/token-counter.js +39 -0
  44. package/dist/llm/types.js +1 -0
  45. package/dist/logger/app-logger.js +189 -0
  46. package/dist/logger/file-log.js +151 -0
  47. package/dist/logger/index.js +1 -0
  48. package/dist/main.js +1026 -417
  49. package/dist/migration/backup.js +45 -0
  50. package/dist/migration/detect.js +50 -0
  51. package/dist/migration/index.js +2 -0
  52. package/dist/modules/artifacts/store.js +61 -0
  53. package/dist/modules/browser/actions.js +76 -0
  54. package/dist/modules/browser/bridge-client.js +199 -0
  55. package/dist/modules/browser/bridge-path.js +10 -0
  56. package/dist/modules/browser/bridge-server.mjs +219 -219
  57. package/dist/modules/browser/cookie-store.js +24 -0
  58. package/dist/modules/browser/driver.js +136 -0
  59. package/dist/modules/browser/index.js +7 -0
  60. package/dist/modules/browser/module.js +29 -0
  61. package/dist/modules/browser/session.js +342 -0
  62. package/dist/modules/browser/snapshot.js +148 -0
  63. package/dist/modules/browser/types.js +12 -0
  64. package/dist/modules/certification/cli.js +213 -0
  65. package/dist/modules/certification/fact-checker.js +82 -0
  66. package/dist/modules/certification/loader.js +106 -0
  67. package/dist/modules/certification/manifest.js +58 -0
  68. package/dist/modules/certification/runner.js +245 -0
  69. package/dist/modules/certification/scenarios.js +407 -0
  70. package/dist/modules/certification/types.js +1 -0
  71. package/dist/modules/context/chunk-query.js +100 -0
  72. package/dist/modules/context/fact-extractor.js +168 -0
  73. package/dist/modules/context/history.js +15 -0
  74. package/dist/modules/context/index.js +1 -0
  75. package/dist/modules/context/manager.js +440 -0
  76. package/dist/modules/execution/audit-runners.js +206 -0
  77. package/dist/modules/execution/auditor.js +218 -0
  78. package/dist/modules/execution/execution-plugin.js +431 -0
  79. package/dist/modules/execution/index.js +8 -0
  80. package/dist/modules/execution/module.js +625 -0
  81. package/dist/modules/execution/moe-executor.js +304 -0
  82. package/dist/modules/execution/plan-coverage.js +68 -0
  83. package/dist/modules/execution/plan-persister.js +46 -0
  84. package/dist/modules/execution/plan-store.js +196 -0
  85. package/dist/modules/execution/plan-tool.js +677 -0
  86. package/dist/modules/execution/plan-validator.js +153 -0
  87. package/dist/modules/execution/planner.js +94 -0
  88. package/dist/modules/execution/stuck-detector.js +746 -0
  89. package/dist/modules/execution/tracker.js +69 -0
  90. package/dist/modules/execution/types.js +1 -0
  91. package/dist/modules/execution/verifier.js +235 -0
  92. package/dist/modules/execution/windows-commands.js +41 -0
  93. package/dist/modules/hallucination/confidence.js +66 -0
  94. package/dist/modules/hallucination/consistency.js +26 -0
  95. package/dist/modules/hallucination/detector.js +47 -0
  96. package/dist/modules/hallucination/factual.js +169 -0
  97. package/dist/modules/hallucination/index.js +5 -0
  98. package/dist/modules/hallucination/js-identifiers.js +262 -0
  99. package/dist/modules/hallucination/llm-judge.js +101 -0
  100. package/dist/modules/index.js +5 -0
  101. package/dist/modules/indexer/cache.js +40 -0
  102. package/dist/modules/indexer/index.js +3 -0
  103. package/dist/modules/indexer/module.js +246 -0
  104. package/dist/modules/indexer/project-profile.js +183 -0
  105. package/dist/modules/indexer/walker.js +101 -0
  106. package/dist/modules/lsp/check-tool.js +58 -0
  107. package/dist/modules/lsp/client.js +389 -0
  108. package/dist/modules/lsp/command.js +60 -0
  109. package/dist/modules/lsp/config.js +135 -0
  110. package/dist/modules/lsp/index.js +3 -0
  111. package/dist/modules/lsp/module.js +260 -0
  112. package/dist/modules/lsp/probe.js +86 -0
  113. package/dist/modules/lsp/project-root.js +32 -0
  114. package/dist/modules/lsp/startup-check.js +144 -0
  115. package/dist/modules/lsp/types.js +1 -0
  116. package/dist/modules/mcp/client.js +399 -0
  117. package/dist/modules/mcp/index.js +3 -0
  118. package/dist/modules/mcp/module.js +142 -0
  119. package/dist/modules/mcp/registry.js +15 -0
  120. package/dist/modules/memory/index.js +1 -0
  121. package/dist/modules/memory/module.js +96 -0
  122. package/dist/modules/memory/search.js +42 -0
  123. package/dist/modules/memory/store.js +69 -0
  124. package/dist/modules/pipelines/engine.js +60 -0
  125. package/dist/modules/pipelines/index.js +3 -0
  126. package/dist/modules/pipelines/parser.js +56 -0
  127. package/dist/modules/pipelines/template.js +14 -0
  128. package/dist/modules/plugins/builtin/lint-on-write.js +334 -0
  129. package/dist/modules/plugins/builtin/notify.js +9 -0
  130. package/dist/modules/plugins/index.js +1 -0
  131. package/dist/modules/plugins/loader.js +70 -0
  132. package/dist/modules/plugins/manager.js +261 -0
  133. package/dist/modules/plugins/types.js +1 -0
  134. package/dist/modules/pricing/index.js +61 -0
  135. package/dist/modules/pricing/prices.js +129 -0
  136. package/dist/modules/processes/detect.js +34 -0
  137. package/dist/modules/processes/index.js +2 -0
  138. package/dist/modules/processes/registry.js +327 -0
  139. package/dist/modules/processes/runner.js +23 -0
  140. package/dist/modules/providers/create.js +22 -0
  141. package/dist/modules/providers/fallback.js +79 -0
  142. package/dist/modules/providers/health.js +46 -0
  143. package/dist/modules/providers/index.js +5 -0
  144. package/dist/modules/providers/manager.js +161 -0
  145. package/dist/modules/providers/presets.js +128 -0
  146. package/dist/modules/providers/registry.js +22 -0
  147. package/dist/modules/providers/types.js +1 -0
  148. package/dist/modules/registry.js +48 -0
  149. package/dist/modules/security/audit-log.js +136 -0
  150. package/dist/modules/security/audit-notifier.js +292 -0
  151. package/dist/modules/security/command-validator.js +219 -0
  152. package/dist/modules/security/content-scanner.js +53 -0
  153. package/dist/modules/security/data-sanitizer.js +89 -0
  154. package/dist/modules/security/encryption.js +242 -0
  155. package/dist/modules/security/index.js +14 -0
  156. package/dist/modules/security/network-validator.js +88 -0
  157. package/dist/modules/security/path-validator.js +203 -0
  158. package/dist/modules/security/rate-limiter.js +119 -0
  159. package/dist/modules/security/security-policies.js +531 -0
  160. package/dist/modules/security/session-encryption.js +210 -0
  161. package/dist/modules/security/session-isolation.js +95 -0
  162. package/dist/modules/session/index.js +3 -0
  163. package/dist/modules/session/manager.js +172 -0
  164. package/dist/modules/session/module.js +24 -0
  165. package/dist/modules/session/store.js +222 -0
  166. package/dist/modules/session/types.js +1 -0
  167. package/dist/modules/skills/index.js +2 -0
  168. package/dist/modules/skills/loader.js +72 -0
  169. package/dist/modules/skills/matcher.js +27 -0
  170. package/dist/modules/skills/module.js +129 -0
  171. package/dist/modules/types.js +1 -0
  172. package/dist/modules/updater/checker.js +96 -0
  173. package/dist/modules/updater/index.js +2 -0
  174. package/dist/modules/updater/module.js +116 -0
  175. package/dist/modules/user-profile/compressor.js +16 -0
  176. package/dist/modules/user-profile/index.js +1 -0
  177. package/dist/modules/user-profile/profile.js +68 -0
  178. package/dist/skills/builtin/git.md +36 -36
  179. package/dist/skills/builtin/typescript.md +35 -35
  180. package/dist/tools/approve.js +33 -0
  181. package/dist/tools/attach-image.js +101 -0
  182. package/dist/tools/bash.js +519 -0
  183. package/dist/tools/browser.js +115 -0
  184. package/dist/tools/chunk-query.js +100 -0
  185. package/dist/tools/create-dir.js +56 -0
  186. package/dist/tools/delete-file.js +63 -0
  187. package/dist/tools/download-file.js +117 -0
  188. package/dist/tools/edit-file.js +80 -0
  189. package/dist/tools/enable-tools.js +59 -0
  190. package/dist/tools/executor.js +154 -0
  191. package/dist/tools/file-info.js +47 -0
  192. package/dist/tools/filter-tools.js +17 -0
  193. package/dist/tools/glob-tool.js +27 -0
  194. package/dist/tools/grep-tool.js +125 -0
  195. package/dist/tools/hidden-tools-block.js +37 -0
  196. package/dist/tools/index.js +78 -0
  197. package/dist/tools/list-dir.js +49 -0
  198. package/dist/tools/load-skill.js +43 -0
  199. package/dist/tools/mcp-call.js +69 -0
  200. package/dist/tools/move-file.js +86 -0
  201. package/dist/tools/path-utils.js +101 -0
  202. package/dist/tools/pipeline-run.js +145 -0
  203. package/dist/tools/preview.js +2 -0
  204. package/dist/tools/process-kill.js +40 -0
  205. package/dist/tools/process-list.js +37 -0
  206. package/dist/tools/process-log.js +54 -0
  207. package/dist/tools/question.js +141 -0
  208. package/dist/tools/read-file.js +179 -0
  209. package/dist/tools/recall.js +118 -0
  210. package/dist/tools/registry.js +47 -0
  211. package/dist/tools/remember.js +68 -0
  212. package/dist/tools/scope-check.js +32 -0
  213. package/dist/tools/search-history.js +85 -0
  214. package/dist/tools/subagent.js +196 -0
  215. package/dist/tools/types.js +1 -0
  216. package/dist/tools/user-input.js +123 -0
  217. package/dist/tools/web-browse.js +87 -0
  218. package/dist/tools/web-fetch.js +119 -0
  219. package/dist/tools/web-search.js +105 -0
  220. package/dist/tools/write-file.js +82 -0
  221. package/dist/ui/box.js +77 -0
  222. package/dist/ui/colors.js +4 -0
  223. package/dist/ui/diff.js +178 -0
  224. package/dist/ui/index.js +6 -0
  225. package/dist/ui/line-editor.js +822 -0
  226. package/dist/ui/line-math.js +73 -0
  227. package/dist/ui/md-formatter.js +212 -0
  228. package/dist/ui/output.js +13 -0
  229. package/dist/ui/plan-view.js +103 -0
  230. package/dist/ui/renderer.js +259 -0
  231. package/dist/ui/spinner.js +70 -0
  232. package/dist/ui/table.js +144 -0
  233. package/package.json +51 -51
package/CHANGELOG.md CHANGED
@@ -1,595 +1,619 @@
1
- # Changelog
2
-
3
- All notable changes to Micro Models Agent (MMA) will be documented in this file.
4
-
5
- The format is based on [Keep a Changelog](https://keepachangelog.com/), and this project adheres to [Semantic Versioning](https://semver.org/).
6
-
7
- ## [0.61.0] - 2026-09-15
8
-
9
- ### Added
10
- - **Budget share controls**: `mma context --system <f>` / `--reserve <f>` and REPL `/context system <f>` / `reserve <f>` set `contextBudget.systemPrompt` / `responseReserve` (validated 0.05–0.9, system + reserve < 0.95). `mma context` and `/context` with no argument now print the budget breakdown (system / reserve / history in tokens and %). `mma config set contextBudget.systemPrompt <f>` keeps working.
11
-
12
- ### Changed
13
- - **Overflow fix advice**: the "system prompt exceeds budget" warning no longer only snaps to a coarse standard context size — a 32K project was jumping straight to `131072`, which looked arbitrary and was often unusable on a local model. The hint (`prompt.overflow.hint_*`, en+ru) now states the raw requirement (`needs ~N system tokens; current budget: W × f = B`) and both levers: raise `contextWindow` to the exact minimum (with the standard size) **or** keep the window and raise `contextBudget.systemPrompt` to the required share (`mma context --system <f>`).
14
-
15
- ### Fixed
16
- - **`mma context` ignored `MMA_CONFIG_DIR`**: it saved to a hardcoded `~/.mma/config.json`; it now writes to the config dir resolved by bootstrap.
17
-
18
- ## [0.60.1] - 2026-09-15
19
-
20
- ### Fixed
21
- - **Silent prompt-overflow summarization**: the startup dry-run warns that AGENTS.md / the project map "will be summarized before the first run", but the actual summarization ran with no notice — the first prompt appeared to hang while a local model rewrote a large AGENTS.md. `resolvePromptOverflow` now emits (en+ru, `prompt.overflow.*`): a "compressing N block(s)…" line before it starts, a per-block "summarizing \"label\" (N M tok)…" line before the model call, a "truncating …" line on the fallback, and a failure line before falling back to truncation.
22
- - **Hardcoded English startup logs**: model auto-load success/failure, reasoning probe result, project indexing start/finish/failure, unreadable index entries and background-processes-killed-on-shutdown were untranslated; they now use `env.*` keys (en+ru). Project indexing now announces start and completion (`Indexed N file(s)`), so a slow first walk no longer pauses startup silently.
23
-
24
- ## [0.60.0] - 2026-09-15
25
-
26
- ### Added
27
- - **`session_info` tool** (`src/tools/session-info.ts`, `alwaysOn`): the model can now answer questions about the session it is running in — id, name, model, provider, context window, message count, timestamps and **live context usage** (`tokens / history budget (percent)` from `ContextManager.getSnapshot()`). Reads live metadata through a new `sessionManager` getter on `ToolContext` (like `sessionId`/`sessionContext`), so a REPL `/new` or `/resume` is reflected immediately. Previously the model reported having "no access to session metadata".
28
- - **Session prompt block** (`session.info_full`, en+ru): the system prompt carries a compact `[Session: "name" (id) | model: | context: tokens]` line so session identity is available passively as well.
29
- - **Project-map command**: `mma map [summary|refresh|find <query>]` (CLI) and `/map [summary|refresh|find <query>]` (REPL) let the user inspect the index directly `summary` prints the exact text injected into the system prompt, `refresh` re-indexes, `find` searches by path or exported symbol. Shared implementation in `src/modules/indexer/map-command.ts` (also used by the `project_map` tool for `find`).
30
- - **Multi-language index**: symbol extraction was TS/JS-only and the extension whitelist stopped at 10 types. New `src/modules/indexer/symbols.ts` is a data-driven registry — adding a language is one rule plus extensions. It now indexes and extracts symbols for TypeScript/JavaScript, Python, Rust, Go, Java, Kotlin, C#, Ruby, PHP, Swift, Scala, C/C++, Shell and Lua (plus data formats: JSON, Markdown, YAML, TOML, XML, HTML/CSS); symbols are deduped and capped at 40 per file. `map-select.ts` now reuses `isCodeLanguage()` instead of its own list.
31
-
32
- ### Fixed
33
- - **Session metadata never reached the model**: `SessionModule.getSystemPromptBlock()` was collected once during bootstrap, but the session is created during that same bootstrap with `messageCount === 0`, so the block was always `null`. It is now collected through `getDynamicPromptBlocks`; content is deliberately limited to stable per-session fields (no message count) so the system prompt does not mutate every turn and the prefix KV-cache survives.
34
- - **Prompt-overflow messages not localized**: the overflow warnings emitted by `agent.ts` and the startup check in `bootstrap.ts` were hardcoded English; they now use `t("prompt.overflow.*")` and respect the configured locale (en+ru). The model-facing hint block stays English by design.
35
- - **Project map showed no source files**: the map listed the first 100 files in `readdir` walk order, which on a real workspace can be entirely docs/config/tests — on this repo the first 100 walked files contained **zero** `src/` entries, so the model had no idea about the project's code structure. New `selectMapFiles` (`src/modules/indexer/map-select.ts`) ranks source above tests above docs/config, puts the densest source directory first (no directory names hardcoded), drops lockfile noise, and sorts deterministically (KV-cache); the listing is capped at 80 files. The index still contains every file, so `project_map find` is unaffected.
36
- - **Indexer swallowed virtualenvs and other vendor trees**: `IGNORE_DIRS` was Node-centric (`node_modules`, `dist`, `build`, `.mma`, `coverage`), so a Python `venv/` (thousands of dependency files) was indexed and could crowd the map out. The list now covers Python (`venv`, `.venv`, `env`, `virtualenv`, `__pycache__`, `.pytest_cache`, `.mypy_cache`, `.ruff_cache`, `.tox`, `site-packages`), Rust (`target`), Go/PHP/Ruby (`vendor`, `.bundle`), JVM (`.gradle`, `out`), .NET (`obj`), Apple (`pods`, `deriveddata`), VCS/IDE (`.hg`, `.svn`, `.idea`, `.vscode`) plus the original Node entries. Matching is case-insensitive and the watcher now matches whole path **segments** instead of substrings, so short names (`env`, `out`, `obj`) cannot black out `environment.ts` or `about/`.
37
-
38
- ## [0.59.0] - 2026-09-05
39
-
40
- ### Added
41
- - **Instructions overflow handling**: AGENTS.md and the project map that exceed the system-prompt budget are no longer silently dropped — they are summarized by the LLM into the remaining budget (disk-cached in `<project>/.mma/cache/prompt-summaries`, invalidated by file edits/budget changes) or truncated with a marker; a small essential hint block tells the model what was compressed and to `read_file` the full source
42
- - **Startup overflow warning**: bootstrap dry-runs the system budget with the real block set and warns the user when instructions/project map will not fit, with a concrete fix — `mma context <N>` for a global `contextWindow`, or an edit of `provider.entries[].contextWindow` in `config/provider.json` when the active entry overrides it
43
- - **Context probe**: at startup MMA asks LM Studio's native API for the context length the model is actually loaded with and compares it with the configured `contextWindow` — warning on overflow risk (no auto-clamp, user decides), info suggestion when the model supports more; result logged as a `context_probe` session entry
44
- - **Config**: `instructions.summarize` (default `true`) to disable LLM summarization (truncation fallback only)
45
-
46
- ## [0.58.2] - 2026-09-01
47
-
48
- ### Fixed
49
- - **Stale i18n in published package**: `build:copy-assets` did not refresh `dist/i18n/en.json`/`ru.json`, so the 0.58.1 release shipped the old startup-check wording in the standalone JSON files (only `dist/main.js` had the fix). The copy step now ships the current dictionaries.
50
-
51
- ## [0.58.1] - 2026-09-01
52
-
53
- ### Fixed
54
- - **Startup check overreach**: the `lsp.startup_header` prompt block instructed the model to "fix these before continuing", overriding `SCOPE DISCIPLINE` the 9B model started fixing pre-existing project errors the user never asked about (and skipped clarifying questions). The block is now informational (baseline only): errors are listed but the model is told to ignore them unless the current request is about them (en+ru).
55
-
56
- ## [0.58.0] - 2026-08-31
57
-
58
- ### Added
59
- - **MoE experts**: dynamic expert registry `config.experts` (with optional `ExpertConfig.description`) is rendered into the MoE planner prompt instead of a hardcoded code/research/browser/vision list (fallback: `tool_tags`)
60
- - **MoE orchestrator provider**: `OrchestratorClient` builds its provider through `ProviderManager` per-entry `contextWindow`/`retry`/`rateLimits` and failover entries are honored; `orchestrator.contextWindow` is the global fallback (legacy `{type,baseUrl,apiKey}` configs keep working)
61
- - **MoE success criteria**: machine-readable `success_criteria` (`file-exists:<path>`, `substring-in-file:<path>:<text>`, `command-exit-0:<cmd>`) verified by `StepVerifier.verifySubtaskCriteria` before merge; LLM-only criteria surface as warnings in the Router context
62
- - **MoE selective re-plan**: `executePlan(plan, {skipIds, carriedResults})` — already-succeeded subtasks are carried over across re-plan cycles, only failed/new subtasks re-execute
63
- - **MoE observability**: `moe_plan` / `moe_subtask` / `moe_replan` / `moe_verify` events written to `session.jsonl` (visible in `mma session show`); token usage aggregated per `expert_tag` (`MoEExecutor.getUsageByTag`); sub-agents receive the real session id instead of the hardcoded `"moe"`
64
- - **MoE cert scenarios**: `5.2-moe-parallel-waves` and `5.3-moe-read-after-write` (tag `moe`, timeoutMs 600_000)
65
- - **ToolResult.usage**: sub-agent token usage propagated to the MoE executor for cost attribution
66
-
67
- ### Changed
68
- - **Reasoning policy baseline**: configurable via `reasoning.baseline` (default `medium`) the auto policy's quiet-iteration level is no longer hardcoded, so trivial Q&A turns can start at `low`
69
-
70
- ### Fixed
71
- - **MoE hang**: sub-agents spawned by the `subagent` tool re-entered `runWithMoE` when the parent config had `moe.enabled=true` — each MoE sub-agent planned its own subtasks and spawned nested sub-agents recursively (bounded only by `maxRecursionDepth`), hanging execution for many minutes with zero progress events. Sub-agents now always run the plain single-agent loop (`moe` is a top-level orchestration mode only).
72
- - **MoE fallback visibility**: missing `orchestrator.model` with `moe.enabled=true` now logs a WARN with a fix hint instead of a debug-only message that made silent fallback to single-agent invisible.
73
- - **CLI one-shot commands hang**: `config`, `session`, `model`, `provider`, `context`, `security`, `plugins`, `changelog` printed their result but never exited bootstrap leaves open handles (reasoning-probe fetch, indexer) and only the prompt/REPL paths called `process.exit`. Subcommand roots now exit via a `postAction` hook (verified: `session list` 2.7s / exit 0, chained `config set` persists correctly).
74
- - **Repeated tool calls**: identical `(tool, args)` repeat now injects a nudge into context in ALL modes — previously the nudge was gated behind `--exit-on-complete`, so interactive runs silently burned iterations re-running the same command (observed: duplicate `node sum.js` verification back-to-back).
75
- - **Perfectionism cycle**: repeated mutations of the SAME target (same file via `edit_file`/`write_file`, same bash command, same `plan`/`todo` action) with varying arguments now inject a finalize-nudge after 5 occurrences — the consecutive-duplicate guard cannot see this pattern (args differ each time; observed: 20+ polish iterations after the task was already complete, then 10+ bookkeeping churn iterations after an audit rejection). The nudge lands AFTER tool results, so `assistant(tool_calls) → tool(results) → user(nudge)` pairing stays valid.
76
- - **Audit gate friction (evidence-based auto-close)**: pending plan steps whose every file-like token resolves to an existing file are auto-closed by the final audit with a note — small models routinely finish the work but forget `plan update` bookkeeping, and the gate then rejected correct answers burning all retry budget. Steps without file tokens or with missing files stay pending (honest).
77
- - **Audit rejection guidance**: the audit gate's `<system-summary>` now names the resolution paths (mark done / skipped / re-plan) in en+ru instead of a bare "continue working" — model plan-drift after a rejection (wrong file names, changed approach) is common for 9B and the old message did not point at the fix.
78
- - **LSP false positives without type env**: `lsp_check` suppresses module-resolution diagnostics when the project root has no `tsconfig.json`/`jsconfig.json`/`node_modules` and reports an inconclusive note instead phantom `Cannot find module 'fs'` / `Cannot find name '__dirname'` errors made the model abandon a working `.ts` approach for `.js` and spiral into plan drift.
79
- - **Windows Unix-command hints**: `bash` hint list and the module-side forbidden set now cover `sed`/`awk`/`uniq`/`xargs`/`cut`/`tr`/`basename`/`dirname`/`export`/`source`/`sleep`/`env` (both lists kept consistent) — the 9B model keeps reaching for Unix tools in cmd.exe.
80
- - **Tool visibility narrowing**: `chunk_query`, `download_file`, `mcp_call`, `pipeline_run` no longer visible by default — they moved behind `enable_tools` (`research`/`shell` tags); the default visible set drops from 23 to 19 schemas, cutting tool tokens on every turn.
81
- - **Tests**: replaced process-global `vi.mock` with DI seams (`AgentDeps.runWithMoEOverride`, `ToolContext.agentFactory`) — Bun module mocks leak across test files in the same worker; full suite is now green by default (1803 pass / 0 fail).
82
- - **Docs**: AGENTS.md / testing.md — warn that `mma` resolves the globally installed package (stale `dist/`) when run outside the repo root, silently ignoring `src/` changes; always run from the repo root with `-d <sandbox>` and verify the version in the `Environment:` line.
83
-
84
- ## [0.57.2] - 2026-08-30
85
-
86
- ### Changed
87
- - **KV-cache**: plan block removed from system prompt; plan status now injected into `<system-summary>` envelope after every tool batch. System prompt is immutable per session local backends retain prefix cache.
88
- - **Provenance**: provider entry resolution uses active entry label, not bare `provider.type`
89
- - **Reasoning signals**: `consecutiveToolSuccesses` and `isRepetitive` now feed real values to the reasoning policy (were hardcoded)
90
- - **Token estimation**: tool-def token estimate in agent loop uses `estimateTokens()` instead of flat `/4`
91
- - **Agent split**: `agent.ts` 1550→950 lines; 10 extracted modules (`loop-state`, `compaction`, `tool-batch`, `hallucination-gate`, `audit-gate`, `reasoning-resolver`, `token-tracker`, `context-renderer`, `tool-output`, `constants`)
92
- - **Plan-tool**: `plan-tool.ts` 741→232 lines; per-action handlers in `plan-actions.ts`
93
- - **CLI**: `createProgram` 513→thin orchestrator; `registerMmaCommands` 470→8 lines (5 per-domain registers)
94
- - **Bash handler**: `bash.ts` 236→~100 lines (`resolveBashSecurityConfig`, `decorateCommandOutput`)
95
- - **Orchestrator**: reuse `parseChunks` instead of hand-rolled `any[]` aggregation; `createPlan` uses own `parseJSON`; constructor deduplicated via `createProviderInstance`
96
- - **Shared utils**: `src/utils/` with `errMsg()`, `sleep()`, `truncate()`, `backoffDelay()`
97
- - **errMsg**: replaces 23 occurrences of `e instanceof Error ? e.message : String(e)` across 12 files
98
-
99
- ### Fixed
100
- - **chunk_query**: one failing chunk no longer kills the entire query; per-chunk `catch` `[FAILED]`
101
- - **chunk_query**: synthesis prompt capped at 20K chars with `[TRUNCATED]` marker
102
- - **chunk_query**: `AbortSignal` propagated to `chatText` for cancellation support
103
- - **Executor**: `failFast` cleanup guard prevents nested scope clobbering
104
- - **probe.ts**: transient errors (network/auth) no longer cached as "reasoning not supported" for 24h; returns `null` caller skips cache
105
- - **LSP**: startup timeout unified on `DEFAULT_TIMEOUT` (15000) instead of conflicting hardcoded 10000
106
- - **Browser**: `BridgeResponse.data` typed (was `any`)
107
- - **Agent**: `Agent.runTool()` public API replaces `(ctx.agent as any).deps` reach-in; `/reload` no longer mutates readonly context
108
- - **LSP /lsp check**: fixed latent bug where `.execute()` was called with `.executeByName` signature
109
-
110
- ### Added
111
- - **Plan Reminder**: static `[Plan Reminder]` block in system prompt (never mutates)
112
- - **Documentation**: reentrancy warning on `executeByName()`, `PlanResult` JSDoc
113
- - **Tests**: `probe.test.ts` (6 cases), `command-suggest.test.ts`, `providers-factory.test.ts`, `subagent-tool.test.ts`, `agent-moe-write.test.ts`, `chunk-query.test.ts`
114
- - **probe.ts**: `null` return for transient errors; bootstrap skips cache on `null`
115
- - **Execution-plugin**: `resetStepFlags`/`resetPlanState` helpers (dedup 3 inline reset blocks)
116
- - **Security-policies**: `comparePolicies` typed (`keyof SecurityConfig` replaces `as any`)
117
-
118
- ### Removed
119
- - **Browser**: dead `buildWaitScript` export (never imported)
120
-
121
- ## [0.57.1] - 2026-08-28
122
-
123
- ### Fixed
124
- - **Publish**: republish after version bump
125
-
126
- ## [0.57.0] - 2026-08-28
127
-
128
- ### Changed
129
- - **MCP**: lazy connect server connections deferred to first tool call. Startup no longer blocks on unreachable MCP servers (e.g. context7 offline). Discovery runs in background with 5s timeout.
130
- - **Updater**: `checkOnStart` and `autoInstall` disabled by default. Reduced `waitForIdle` timeout from 130s to 10s.
131
- - **Config**: `updater.checkOnStart` default changed from `true` to `false`
132
-
133
- ### Added
134
- - **MCP**: HTTP request timeouts (10s) on `connectSSE`, `listToolsHTTP`, `callToolHTTP`
135
- - **MCP**: `failedServers` tracking servers that fail discovery are not retried
136
- - **MCP**: placeholder `connect` tool for not-yet-discovered servers (LLM can trigger lazy discovery)
137
- - **Reasoning**: persistent disk cache (`~/.mma/reasoning-cache.json`) with 24h TTL — avoids re-probing LLM on every restart
138
-
139
- ## [0.56.5] - 2026-08-27
140
-
141
- ### Fixed
142
- - **Hallucination**: `FactualCheck` now receives deleted files from `ConsistencyCheck` — no longer false-positives on files that were intentionally deleted in the same session
143
-
144
- ## [0.56.4] - 2026-08-27
145
-
146
- ### Fixed
147
- - **Tools**: `list_dir` now filters `.mma/`, `node_modules/`, `.git/`, `dist/`, `build/`, `coverage/` from directory listings (consistent with indexer)
148
- - **Hallucination**: `dotfileVariants` now tries dot-prefixing each directory component, not just basename (fixes false positive on `.mma/index-cache.json` → `mma/index-cache.json`)
149
-
150
- ## [0.56.1] - 2026-08-27
151
-
152
- ### Added
153
- - **CLI**: `mma changelog` command show latest changelog entry or diff between versions (`--from <version>`)
154
- - **Updater**: show changelog after auto-update install (`updater.installed` message includes new version's changelog)
155
- - **Docs**: `CHANGELOG.md` included in npm package (visible via `npm info micro-models-agent`)
156
- - **Docs**: rule to maintain changelog in `AGENTS.md`
157
-
158
- ## [0.56.0] - 2026-08-27
159
-
160
- ### Added
161
- - **MoE**: live re-plan loop in `runWithMoE`orchestrator re-plans on structural failures
162
- - **MoE**: scope expansion protocol (`scope_request`) for cross-expert file access
163
- - **MoE**: Esc/interrupt support in the MoE execution path
164
- - **MoE**: `input_from` cross-expert data flow for subtask dependencies
165
- - **LSP**: Angular language server support (`@angular/language-server` for `.html` in Angular workspaces)
166
- - **Tools**: syntax pre-validation and auto-fix for `write_file`/`edit_file`
167
-
168
- ### Fixed
169
- - **Security**: SSRF via IPv6-mapped IPv4 and raw numeric hostnames
170
- - **Security**: command-validator blacklist bypasses (shell expansions, encoded chars)
171
- - **Security**: audit webhook retry queue drained forever (infinite loop + duplicate notifications)
172
- - **Core**: dangling `tool_calls` on interrupt synthesized tool messages keep assistant/tool pairing
173
- - **Core**: live reasoning policy + `set_thinking` override integration
174
- - **Core**: deep-clone config defaults to prevent cross-session mutation
175
- - **Config**: preserve `provider.fallback` on hot-swap
176
- - **Tools**: path/scope escape holes in filesystem and read tools closed
177
- - **Tools**: clear timeout timer & abort listener after race settles; log discarded losers
178
- - **MCP**: stdio timer leaks + null deref after disconnect; added initialize handshake
179
- - **LSP**: spawn servers detached on POSIX so `killTree` reaches the whole chain
180
- - **Browser**: bridge leaked Chromium on SIGTERM and parent death
181
- - **UI**: diff LCS memory cap; one bad encrypted line no longer kills session history
182
- - **CLI**: `/config migrate` was unreachable
183
- - **MoE**: locale-independent artifact path + no retry on user abort
184
-
185
- ## [0.55.1] - 2026-08-25
186
-
187
- ### Fixed
188
- - **LLM**: NDJSON-tolerant stream parser for Ollama backends
189
- - **LLM**: mid-stream provider errors surfaced (Ollama generation failures)
190
- - **LLM**: `delta.reasoning` alias for thinking models
191
- - **LLM**: wire-level debug logging for diagnostics
192
-
193
- ## [0.55.0] - 2026-08-25
194
-
195
- ### Added
196
- - **Certification**: targeted re-run (`--scenarios <ids>`) with result merging
197
- - **Certification**: per-rep timeout (`--timeout <ms>` + per-scenario `timeoutMs`)
198
- - **Certification**: audit-gate bypass fix for `--exit-on-complete`
199
-
200
- ### Fixed
201
- - **Certification**: stale-label wording (removed impossible user instruction)
202
- - **Dependencies**: typescript pinned to ^5.9 (TS7 preview breaks `@types/node`)
203
-
204
- ## [0.54.0] - 2026-08-24
205
-
206
- ### Added
207
- - **Certification**: global manifest shipped with package updates (`~/.mma/certifications.json`)
208
- - **Certification**: bundled manifest + startup sync from package
209
-
210
- ### Fixed
211
- - **Certification**: marks only showed when running from repo root
212
-
213
- ## [0.53.0] - 2026-08-24
214
-
215
- ### Added
216
- - **Certification**: qwen3.5-9b certified 20/20
217
- - **Config**: `provider.maxCompletionTokens` option
218
- - **Certification**: label text in `mma model list` and REPL `/model`
219
-
220
- ### Fixed
221
- - **Certification**: reasoning-heavy models truncated tool_call arguments at default 4096 cap
222
- - **Certification**: scenario 3.5 prompt disambiguation
223
-
224
- ## [0.52.0] - 2026-08-23
225
-
226
- ### Added
227
- - **Execution**: `FS_MUTATING_TOOLS` — plan auto-advance after bash/download/subagent/mcp/pipeline/browser tools
228
- - **Config**: `provider.maxCompletionTokens` plumbing through ProviderManager → agent
229
-
230
- ### Fixed
231
- - **Execution**: small models create files via bash instead of `write_file`, stalling plans
232
- - **Execution**: `maxCompletionTokens` was never read from config
233
-
234
- ## [0.51.0] - 2026-08-23
235
-
236
- ### Added
237
- - **Plugin**: `HostBridge` interface for bidirectional agent communication
238
- - **Plugin**: `onTurnEnd(ctx, TurnSummary)` hook — dispatched once per completed run
239
- - **Plugin**: `web-ui` example plugin — browser-based chat with SSE streaming
240
- - **CLI**: REPL bridge wiring for web-ui submit/interrupt
241
-
242
- ### Fixed
243
- - **REPL**: `/config migrate` unreachable
244
-
245
- ## [0.50.3] - 2026-08-22
246
-
247
- ### Fixed
248
- - **UI**: REPL line editor scroll-proof rendering (absolute anchoring via DSR query)
249
-
250
- ## [0.50.2] - 2026-08-22
251
-
252
- ### Fixed
253
- - **LLM**: idle stream timeout increased 60s → 180s (LM Studio buffering)
254
- - **LLM**: stall diagnosis with dedicated message for SSE buffering
255
- - **LLM**: truncation no longer masquerades as empty response
256
- - **LLM**: recoverable LLM errors fed back into context instead of dying
257
- - **Execution**: bash flailing detector (≥4 failed bash attempts in last 6)
258
-
259
- ## [0.50.1] - 2026-08-21
260
-
261
- ### Fixed
262
- - **Security**: no longer silently overrides explicit user opt-out
263
- - **Lint**: skips missing lint binary (was appending error to every write)
264
- - **Stuck**: anti-spam for stuck-warnings (dedup via key, decay per-tool counters)
265
- - **Plan**: unified progress counting (done+skipped as settled)
266
- - **Plan**: bulk `steps[]` rewrite guarded on progressed plans
267
- - **Plan**: archived plans answer read-only
268
- - **Process**: usage hints for `process_kill`/`process_log` without id
269
-
270
- ## [0.50.0] - 2026-08-21
271
-
272
- ### Added
273
- - **Provider**: health probe (`probeProviders()` + `mma provider check`)
274
- - **Provider**: code-only capability routing (`ProviderManager.pickFor()`)
275
- - **Provider**: per-entry isolation + priority fallback order
276
- - **Pricing**: per-provider cost attribution + breakdown
277
-
278
- ### Fixed
279
- - **Provider**: transparent failover on 429/5xx/network errors
280
-
281
- ## [0.49.0] - 2026-08-20
282
-
283
- ### Fixed
284
- - **REPL**: stale-plan leaks — plan state no longer persists across sessions
285
- - **REPL**: plan checklist prints only on plan/todo tool-end events
286
- - **Plan**: `PlanStore` is single source of truth for UI consumers
287
-
288
- ## [0.48.3] - 2026-08-20
289
-
290
- ### Fixed
291
- - **Hallucination**: dotfile false-positive (`.prettierrc.json` extracted as `prettierrc.json`)
292
-
293
- ## [0.48.2] - 2026-08-20
294
-
295
- ### Fixed
296
- - **REPL**: stale plan printed on first agent run of a session
297
-
298
- ## [0.47.0] - 2026-08-19
299
-
300
- ### Added
301
- - **Session**: startup diagnostics logging (environment, LSP probe, baseline typecheck)
302
- - **Session**: `logBaselineTypecheck()` for post-mortem visibility
303
-
304
- ## [0.46.1] - 2026-08-19
305
-
306
- ### Fixed
307
- - **LLM**: connection-break hardening (stream-level retry, no-data timeout, `[DONE]` tracking)
308
- - **LLM**: non-streaming timeout (was missing, could hang forever)
309
- - **Config**: `retry.maxStreamRetries`, `retry.noDataTimeoutMs` options
310
-
311
- ## [0.46.0] - 2026-08-19
312
-
313
- ### Added
314
- - **Provider**: multi-provider + hot-swap + per-message provenance
315
- - **Provider**: `ProviderManager` with entry-based config
316
- - **CLI**: `mma provider add/list/use`
317
- - **REPL**: `/provider list/use`
318
-
319
- ### Fixed
320
- - **Path**: `safeResolvePath` POSIX bug (absolute paths re-resolved against baseDir)
321
-
322
- ## [0.45.0] - 2026-08-18
323
-
324
- ### Added
325
- - **Provider**: provider module Phase 1 (registry, presets, `createProvider()`)
326
- - **Provider**: `openrouter` preset
327
- - **Setup**: wizard menu built from `BUILTIN_PROVIDERS`
328
-
329
- ## [0.44.0] - 2026-08-18
330
-
331
- ### Added
332
- - **Plugins**: folder plugins (subdirectory with entry file)
333
- - **Plugin**: `trace-server` split into folder plugin
334
-
335
- ### Fixed
336
- - **Plugin**: template-literal page inlining broke `\n` in JS strings
337
-
338
- ## [0.43.2] - 2026-08-17
339
-
340
- ### Fixed
341
- - **Execution**: plan done-gate on known compile failures (typecheck gate)
342
- - **Bootstrap**: live getters for `sessionId`/`sessionContext` after session switch
343
- - **Edit**: `edit_file` "String not found" hint to `read_file` first
344
-
345
- ## [0.43.1] - 2026-08-17
346
-
347
- ### Fixed
348
- - **Agent**: session-interrupt no longer renders tool results after "Session ended"
349
- - **Executor**: `onAfterTool` plugins skipped when signal is aborted
350
- - **Lint**: abortable syntax checks on Esc
351
-
352
- ## [0.43.0] - 2026-08-17
353
-
354
- ### Added
355
- - **Plan**: `plan delete <id>` + `plan purge` actions
356
- - **Plan**: `abort` honors `id` parameter
357
- - **Plan**: `replan` renumbers ids for kept steps
358
- - **Audit**: `resolveTestCommand` picks the project's real test runner
359
-
360
- ### Fixed
361
- - **Plan**: `switch` to already-active plan is a no-op
362
- - **Plan**: final audit runs for a completed plan
363
- - **Plan**: evidence-based plan nudge (replaces iteration counter)
364
- - **Plan**: `checkPlanAlignment` scans path arguments only
365
- - **Plan**: `isDepsStep` requires a package-manager verb
366
- - **Plan**: auto-advance resolves nested files
367
-
368
- ## [0.42.0] - 2026-08-16
369
-
370
- ### Added
371
- - **Execution**: automatic error web search (≥5 same-error repeats → web search → inject results)
372
- - **Config**: `errorWebSearch` section
373
-
374
- ### Fixed
375
- - **Execution**: `onAfterTool` double-counted typecheck + failure errors
376
-
377
- ## [0.41.1] - 2026-08-16
378
-
379
- ### Fixed
380
- - **LSP**: `typescript@5` pin + `--yes` for npx
381
- - **LSP**: sequential probing (waves) to avoid npx cache lock contention
382
- - **LSP**: stale config normalization
383
- - **LSP**: Windows process leak in `shutdown()`
384
- - **REPL**: non-blocking LSP banner
385
- - **Bootstrap**: lazy startup health check
386
-
387
- ## [0.41.0] - 2026-08-15
388
-
389
- ### Added
390
- - **REPL**: live plan checklist with progress bar
391
- - **UI**: tool-to-step binding (`← step N` suffix in tool headers)
392
- - **UI**: background command output preview
393
-
394
- ## [0.40.1] - 2026-08-15
395
-
396
- ### Fixed
397
- - **LSP**: broken package names (`vscode-html-languageserver` → `vscode-langservers-extracted`)
398
-
399
- ## [0.40.0] - 2026-08-15
400
-
401
- ### Added
402
- - **Tools**: tool-set narrowing (on-demand enable via `enable_tools`)
403
- - **Config**: `tools.defaultTags` + `tools.enableOnDemand`
404
- - **Tools**: `alwaysOn` flag for structural tools
405
-
406
- ## [0.39.1] - 2026-08-14
407
-
408
- ### Fixed
409
- - **Plugins**: dedup by version, compatibility gate, source tracking
410
- - **CLI**: `mma plugins list` command
411
-
412
- ## [0.38.0] - 2026-08-14
413
-
414
- ### Added
415
- - **LSP**: `lsp_check` tool for on-demand diagnostics
416
- - **Plan**: `plan create` guard (blocks when active plan has progress)
417
-
418
- ### Fixed
419
- - **Context**: compaction summary carries plan + read state
420
- - **Browser**: bridge path resolution in bundled dist
421
-
422
- ## [0.37.0] - 2026-08-13
423
-
424
- ### Added
425
- - **Plugins**: folder plugin support in `PluginLoader`
426
-
427
- ### Fixed
428
- - **Plugin**: template-literal page inlining broke `\n` in JS
429
-
430
- ## [0.36.3] - 2026-08-13
431
-
432
- ### Fixed
433
- - **UI**: REPL paste fix (batch single-render, CRLF collapse)
434
-
435
- ## [0.36.2] - 2026-08-13
436
-
437
- ### Fixed
438
- - **Updater**: silent logger, one-shot `process.exit()` killed background install, semver-aware check
439
-
440
- ## [0.36.1] - 2026-08-13
441
-
442
- ### Fixed
443
- - **Audit**: nested-file resolution, non-zero test run blocks
444
- - **Browser**: bridge diagnostics + one-shot restart
445
- - **LSP**: per-server disable + initialize retry + CSS timeout
446
- - **Bash**: npm exec hint
447
-
448
- ## [0.36.0] - 2026-08-12
449
-
450
- ### Added
451
- - **Plan**: model-declared `kind: "create"|"delete"` for steps
452
- - **Execution**: `FS_MUTATING_TOOLS` for plan auto-advance
453
- - **Config**: `provider.maxCompletionTokens` option
454
-
455
- ### Fixed
456
- - **Context**: compaction preserves session `mission`
457
- - **Context**: deleted files leave compaction `[Files:]` list
458
- - **Audit**: final audit runs real `tsc --noEmit --skipLibCheck`
459
- - **Bash**: repeated forbidden Windows commands hard-stopped after 2 failures
460
-
461
- ## [0.35.5] - 2026-08-12
462
-
463
- ### Fixed
464
- - **Execution**: plan-alignment phantom paths (domains/extensions treated as files)
465
- - **Execution**: hint/recovery dedup in `StuckDetector`
466
-
467
- ## [0.35.3] - 2026-08-11
468
-
469
- ### Fixed
470
- - **LSP**: workspace root resolved from edited file's project
471
- - **Audit**: skipped steps treated as terminal
472
- - **Bash**: Windows hint keys on original command word
473
- - **Tools**: boundedOutput tools never budget-truncated
474
-
475
- ## [0.35.0] - 2026-08-11
476
-
477
- ### Added
478
- - **Tools**: `download_file` tool for binary file downloads
479
-
480
- ## [0.34.0] - 2026-08-10
481
-
482
- ### Added
483
- - **Indexer**: project profile (`[Stack: ...]` summary from manifest)
484
- - **Indexer**: dynamic map refresh inside sessions
485
-
486
- ## [0.33.3] - 2026-08-10
487
-
488
- ### Fixed
489
- - **Audit**: nested-file resolution (basename + path-suffix match)
490
- - **Plan**: `plan show` honors `id` parameter
491
- - **Context**: compaction interval reset per user turn
492
- - **Context**: `extractFacts` captures `edit_file` paths + Windows drive-letter paths
493
- - **Execution**: stuck detector read-only loop detection
494
- - **Read**: default limit 15 300 lines
495
- - **LSP**: `spawn` on Windows (`.cmd` shim resolution)
496
- - **Todo**: `todo add` tracks subtasks, `todo done` marks individual sub-task
497
- - **Memory**: learns repeated per-tool failures (≥3×)
498
- - **Context**: compaction preserves user's task
499
-
500
- ## [0.33.2] - 2026-08-09
501
-
502
- ### Fixed
503
- - **UI**: REPL conversation layout (user/agent message dividers)
504
- - **Tools**: `isFilePathLike` uses allow-list of file extensions
505
-
506
- ## [0.33.1] - 2026-08-09
507
-
508
- ### Fixed
509
- - **UI**: REPL line editor redraw fix (no duplicated multi-line input)
510
- - **Tools**: `web_fetch`/`web_browse` description clarifications
511
-
512
- ## [0.33.0] - 2026-08-09
513
-
514
- ### Added
515
- - **RLM**: pass-by-reference sub-agent results (`ArtifactStore`)
516
- - **RLM**: chunked parallel queries (`chunk_query` tool)
517
- - **Config**: `subagent.resultMode`, `maxSummaryChars`, `artifactsDir`, `stableSystemPrompt`
518
-
519
- ## [0.32.0] - 2026-08-08
520
-
521
- ### Added
522
- - **Browser**: driver abstraction (`PlaywrightDriver` + `BridgeDriver`)
523
- - **Browser**: Node bridge for Bun compatibility
524
- - **Config**: `browser.maxConsoleLineChars`
525
-
526
- ## [0.31.0] - 2026-08-08
527
-
528
- ### Added
529
- - **Security**: session file encryption (AES-256-GCM)
530
- - **Security**: audit notifications (file + webhook)
531
- - **Security**: security policies (strict/balanced/permissive)
532
- - **CLI**: `mma security` commands
533
-
534
- ## [0.30.0] - 2026-08-07
535
-
536
- ### Added
537
- - **Execution**: final audit gate (runs `bun test` for verification steps)
538
- - **Execution**: `detectTestResults()` auto-verification in bash
539
-
540
- ### Fixed
541
- - **Execution**: empty-CLI entry-point hint
542
- - **Bash**: Windows anti-patterns documentation
543
-
544
- ## [0.29.0] - 2026-08-07
545
-
546
- ### Added
547
- - **Bash**: smart UTF-8/OEM line decoding (fixes Cyrillic on Windows)
548
- - **Bash**: behavior-based background detection
549
- - **Bash**: stuck-detector bash awareness
550
-
551
- ## [0.28.0] - 2026-08-06
552
-
553
- ### Fixed
554
- - **Agent**: double-Esc interrupt fix (Bun readline keypress collapsing)
555
- - **Agent**: abortable in-flight LLM requests on interrupt
556
- - **UI**: clipboard paste hint
557
-
558
- ## [0.27.0] - 2026-08-06
559
-
560
- ### Fixed
561
- - **Security**: Windows hardening
562
- - **Hallucination**: fixes
563
-
564
- ## [0.26.0] - 2026-08-05
565
-
566
- ### Added
567
- - **UI**: opencode-style inline tool headers (`ui.toolStyle`)
568
- - **UI**: model commentary next to tool calls (`ui.toolComments`)
569
- - **UI**: diffs without background color
570
-
571
- ## [0.25.0] - 2026-08-05
572
-
573
- ### Added
574
- - **LSP**: LSP module (typescript, CSS, HTML, JSON, Python, Rust, Go)
575
- - **Execution**: audit gate language-agnostic
576
- - **Bash**: Windows command hints
577
-
578
- ## [0.24.0] - 2026-08-04
579
-
580
- ### Added
581
- - **Context**: quality formula upgrade (token load + compaction loss + error density + freshness)
582
- - **Read**: display mode (show only header in REPL, full content to LLM)
583
-
584
- ## [0.23.0] - 2026-08-04
585
-
586
- ### Added
587
- - **Certification**: model certification module (`mma model certify`)
588
- - **CLI**: cert checkmarks in model lists
589
-
590
- ## [0.22.0] - 2026-08-03
591
-
592
- ### Added
593
- - **Security**: `enabled` flag (disabled by default)
594
- - **CLI**: init/first-run apply wizard security answers
595
- - **Prompt**: system prompt & recovery messages cleanup
1
+ # Changelog
2
+
3
+ All notable changes to Micro Models Agent (MMA) will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/), and this project adheres to [Semantic Versioning](https://semver.org/).
6
+
7
+ ## [0.62.0] - 2026-09-17
8
+
9
+ ### Added
10
+ - **Prompt-cache awareness (cloud + local)**: every provider declares its cache behavior via a new `CacheCapability` (`ProviderCapabilities.cache`, overridable per entry with `provider.entries[].cache`). The OpenAI-compatible provider now sends the right request hints per backend — `cache_prompt` (llama.cpp), `prompt_cache_key` (OpenAI), `session_id` (OpenRouter sticky routing) while `x-opencode-session` is gated by `sessionHeader` (legacy behavior preserved when no capability is set). `parseCacheUsage` (`src/llm/cache-usage.ts`) normalizes response formats (OpenAI/LM Studio/llama.cpp/vLLM/OpenRouter/Zen/Go, DeepSeek, Anthropic, Ollama) into `Chunk.usage.cache`.
11
+ - **Cache metrics & savings**: `ModelPrice.cachedInput`/`cacheWrite`, `calculateCostDetailed` and `CostTracker.saved` bill cached reads at the cached rate and report the savings; builtin cached-read prices for MiniMax/GLM. A client-side prefix monitor (`src/core/agent/prefix-monitor.ts`) classifies why a cacheable prefix broke (`system`/`tools`/`history`/`volatile`) even when the provider reports nothing.
12
+ - **Cache display**: a single footer line (`Cache: 87% hit · saved $0.42`, or `Prefix stable: 93% · broke: tool set`) in the REPL, single-run result and `--json` (`cache`); `mma session show <id>` aggregates `llm_usage` into token totals and cache hit rate.
13
+ - **Streaming usage**: OpenAI-compatible streaming requests now send `stream_options: { include_usage: true }` (new `CacheCapability.requestStreamUsage`, on by default for OpenAI-shaped providers), so backends that only report usage in the final chunk LM Studio, vLLM, OpenAI, OpenRouter return real token counts (and `cached_tokens` where available) instead of the local chars/4 estimate.
14
+ - **`mma usage`**: shows the active provider's balance/usage. OpenRouter is supported (`GET /key` for per-key usage/limit, plus `GET /credits` for account balance when a management key is configured); other providers report that they do not expose an API balance (OpenCode Zen/Go show it in the web dashboard).
15
+
16
+ ### Changed
17
+ - **Code comments are Russian** (new architecture rule #15).
18
+ - **Cross-platform rule** (new architecture rule #16): processes/paths/shell/FS code must work on Windows, macOS and Linux (no `mklink`, no `npx` for local tools, quote paths, skip-not-fail tests when an OS lacks a primitive).
19
+
20
+ ### Fixed
21
+ - **One-shot subcommands hung when piped**: `mma session show <id> | cat` never exited because `bootstrap()` fired the background startup health check, which spawns an LSP/npx child that `process.exit` does not reap — the orphan kept the stdout pipe open. Subcommands never run an agent, so `setOneShotMode` now skips that check (detected in `main.ts` before `program.parse`). The recursive `postAction process.exit(0)` hook (nested subcommands previously never fired it) is kept, and the startup check's `npx tsc` fallback now uses the local tsc.
22
+ - **Prefix-cache line false alarm**: the footer treated the first iteration (`cause: unknown`, ratio 0) and normal history appends (`cause: none`) as a broken prefix. It now shows `Prefix stable …` only for a real break (`system`/`tools`/`history`/`volatile`) and surfaces the most recent such break even if later iterations are stable again.
23
+ - **TypeScript checks were slow and unreliable**: syntax/type checks shelled out to `npx tsc`, which on Windows takes 5–13s (and tries the network without a local `typescript`), tripping test timeouts and stalling writes. New `resolveTscCommand` (`src/modules/lsp/project-root.ts`) runs the nearest local `tsc` via the current runtime (`process.execPath`), used by `verifier.ts`, `lint-on-write.ts` and `audit-runners.ts`; when no local tsc exists the check is skipped fast instead of hanging. The nested-project verifier test now links TypeScript with a cross-platform `symlinkSync(..., "junction")` instead of Windows-only `mklink`, and `bash.test.ts` resets the leaked grace window between tests.
24
+
25
+ ## [0.61.1] - 2026-09-16
26
+
27
+ ### Fixed
28
+ - **OpenCode Go rejected every request**: `/chat/completions` returned `400 MissingSessionID` because the OpenAI-compatible provider sent no `x-opencode-session` header. The provider now sends the live session id (threaded through `ProviderOptions` `ProviderManager` `Agent`/`bootstrap`, plus the MoE orchestrator) and a `micro-models-agent/<version>` User-Agent on every chat and `listModels` request.
29
+ - **Dev runs self-updated the global install**: running from TypeScript sources (`bun run mma`, `bun --watch src/cli/main.ts`) read the checkout's `package.json` version and `npm install -g`'d the published one over the user's install. The background updater is now skipped when the entry is a TS source; real installs (`dist/main.js` via `bin/mma.mjs`) still update.
30
+
31
+ ## [0.61.0] - 2026-09-15
32
+
33
+ ### Added
34
+ - **Budget share controls**: `mma context --system <f>` / `--reserve <f>` and REPL `/context system <f>` / `reserve <f>` set `contextBudget.systemPrompt` / `responseReserve` (validated 0.05–0.9, system + reserve < 0.95). `mma context` and `/context` with no argument now print the budget breakdown (system / reserve / history in tokens and %). `mma config set contextBudget.systemPrompt <f>` keeps working.
35
+
36
+ ### Changed
37
+ - **Overflow fix advice**: the "system prompt exceeds budget" warning no longer only snaps to a coarse standard context size — a 32K project was jumping straight to `131072`, which looked arbitrary and was often unusable on a local model. The hint (`prompt.overflow.hint_*`, en+ru) now states the raw requirement (`needs ~N system tokens; current budget: W × f = B`) and both levers: raise `contextWindow` to the exact minimum (with the standard size) **or** keep the window and raise `contextBudget.systemPrompt` to the required share (`mma context --system <f>`).
38
+
39
+ ### Fixed
40
+ - **`mma context` ignored `MMA_CONFIG_DIR`**: it saved to a hardcoded `~/.mma/config.json`; it now writes to the config dir resolved by bootstrap.
41
+
42
+ ## [0.60.1] - 2026-09-15
43
+
44
+ ### Fixed
45
+ - **Silent prompt-overflow summarization**: the startup dry-run warns that AGENTS.md / the project map "will be summarized before the first run", but the actual summarization ran with no notice — the first prompt appeared to hang while a local model rewrote a large AGENTS.md. `resolvePromptOverflow` now emits (en+ru, `prompt.overflow.*`): a "compressing N block(s)…" line before it starts, a per-block "summarizing \"label\" (N → M tok)…" line before the model call, a "truncating …" line on the fallback, and a failure line before falling back to truncation.
46
+ - **Hardcoded English startup logs**: model auto-load success/failure, reasoning probe result, project indexing start/finish/failure, unreadable index entries and background-processes-killed-on-shutdown were untranslated; they now use `env.*` keys (en+ru). Project indexing now announces start and completion (`Indexed N file(s)`), so a slow first walk no longer pauses startup silently.
47
+
48
+ ## [0.60.0] - 2026-09-15
49
+
50
+ ### Added
51
+ - **`session_info` tool** (`src/tools/session-info.ts`, `alwaysOn`): the model can now answer questions about the session it is running in — id, name, model, provider, context window, message count, timestamps and **live context usage** (`tokens / history budget (percent)` from `ContextManager.getSnapshot()`). Reads live metadata through a new `sessionManager` getter on `ToolContext` (like `sessionId`/`sessionContext`), so a REPL `/new` or `/resume` is reflected immediately. Previously the model reported having "no access to session metadata".
52
+ - **Session prompt block** (`session.info_full`, en+ru): the system prompt carries a compact `[Session: "name" (id) | model: … | context: … tokens]` line so session identity is available passively as well.
53
+ - **Project-map command**: `mma map [summary|refresh|find <query>]` (CLI) and `/map [summary|refresh|find <query>]` (REPL) let the user inspect the index directly — `summary` prints the exact text injected into the system prompt, `refresh` re-indexes, `find` searches by path or exported symbol. Shared implementation in `src/modules/indexer/map-command.ts` (also used by the `project_map` tool for `find`).
54
+ - **Multi-language index**: symbol extraction was TS/JS-only and the extension whitelist stopped at 10 types. New `src/modules/indexer/symbols.ts` is a data-driven registry adding a language is one rule plus extensions. It now indexes and extracts symbols for TypeScript/JavaScript, Python, Rust, Go, Java, Kotlin, C#, Ruby, PHP, Swift, Scala, C/C++, Shell and Lua (plus data formats: JSON, Markdown, YAML, TOML, XML, HTML/CSS); symbols are deduped and capped at 40 per file. `map-select.ts` now reuses `isCodeLanguage()` instead of its own list.
55
+
56
+ ### Fixed
57
+ - **Session metadata never reached the model**: `SessionModule.getSystemPromptBlock()` was collected once during bootstrap, but the session is created during that same bootstrap with `messageCount === 0`, so the block was always `null`. It is now collected through `getDynamicPromptBlocks`; content is deliberately limited to stable per-session fields (no message count) so the system prompt does not mutate every turn and the prefix KV-cache survives.
58
+ - **Prompt-overflow messages not localized**: the overflow warnings emitted by `agent.ts` and the startup check in `bootstrap.ts` were hardcoded English; they now use `t("prompt.overflow.*")` and respect the configured locale (en+ru). The model-facing hint block stays English by design.
59
+ - **Project map showed no source files**: the map listed the first 100 files in `readdir` walk order, which on a real workspace can be entirely docs/config/tests — on this repo the first 100 walked files contained **zero** `src/` entries, so the model had no idea about the project's code structure. New `selectMapFiles` (`src/modules/indexer/map-select.ts`) ranks source above tests above docs/config, puts the densest source directory first (no directory names hardcoded), drops lockfile noise, and sorts deterministically (KV-cache); the listing is capped at 80 files. The index still contains every file, so `project_map find` is unaffected.
60
+ - **Indexer swallowed virtualenvs and other vendor trees**: `IGNORE_DIRS` was Node-centric (`node_modules`, `dist`, `build`, `.mma`, `coverage`), so a Python `venv/` (thousands of dependency files) was indexed and could crowd the map out. The list now covers Python (`venv`, `.venv`, `env`, `virtualenv`, `__pycache__`, `.pytest_cache`, `.mypy_cache`, `.ruff_cache`, `.tox`, `site-packages`), Rust (`target`), Go/PHP/Ruby (`vendor`, `.bundle`), JVM (`.gradle`, `out`), .NET (`obj`), Apple (`pods`, `deriveddata`), VCS/IDE (`.hg`, `.svn`, `.idea`, `.vscode`) plus the original Node entries. Matching is case-insensitive and the watcher now matches whole path **segments** instead of substrings, so short names (`env`, `out`, `obj`) cannot black out `environment.ts` or `about/`.
61
+
62
+ ## [0.59.0] - 2026-09-05
63
+
64
+ ### Added
65
+ - **Instructions overflow handling**: AGENTS.md and the project map that exceed the system-prompt budget are no longer silently dropped — they are summarized by the LLM into the remaining budget (disk-cached in `<project>/.mma/cache/prompt-summaries`, invalidated by file edits/budget changes) or truncated with a marker; a small essential hint block tells the model what was compressed and to `read_file` the full source
66
+ - **Startup overflow warning**: bootstrap dry-runs the system budget with the real block set and warns the user when instructions/project map will not fit, with a concrete fix — `mma context <N>` for a global `contextWindow`, or an edit of `provider.entries[].contextWindow` in `config/provider.json` when the active entry overrides it
67
+ - **Context probe**: at startup MMA asks LM Studio's native API for the context length the model is actually loaded with and compares it with the configured `contextWindow` — warning on overflow risk (no auto-clamp, user decides), info suggestion when the model supports more; result logged as a `context_probe` session entry
68
+ - **Config**: `instructions.summarize` (default `true`) to disable LLM summarization (truncation fallback only)
69
+
70
+ ## [0.58.2] - 2026-09-01
71
+
72
+ ### Fixed
73
+ - **Stale i18n in published package**: `build:copy-assets` did not refresh `dist/i18n/en.json`/`ru.json`, so the 0.58.1 release shipped the old startup-check wording in the standalone JSON files (only `dist/main.js` had the fix). The copy step now ships the current dictionaries.
74
+
75
+ ## [0.58.1] - 2026-09-01
76
+
77
+ ### Fixed
78
+ - **Startup check overreach**: the `lsp.startup_header` prompt block instructed the model to "fix these before continuing", overriding `SCOPE DISCIPLINE` the 9B model started fixing pre-existing project errors the user never asked about (and skipped clarifying questions). The block is now informational (baseline only): errors are listed but the model is told to ignore them unless the current request is about them (en+ru).
79
+
80
+ ## [0.58.0] - 2026-08-31
81
+
82
+ ### Added
83
+ - **MoE experts**: dynamic expert registry — `config.experts` (with optional `ExpertConfig.description`) is rendered into the MoE planner prompt instead of a hardcoded code/research/browser/vision list (fallback: `tool_tags`)
84
+ - **MoE orchestrator provider**: `OrchestratorClient` builds its provider through `ProviderManager` — per-entry `contextWindow`/`retry`/`rateLimits` and failover entries are honored; `orchestrator.contextWindow` is the global fallback (legacy `{type,baseUrl,apiKey}` configs keep working)
85
+ - **MoE success criteria**: machine-readable `success_criteria` (`file-exists:<path>`, `substring-in-file:<path>:<text>`, `command-exit-0:<cmd>`) verified by `StepVerifier.verifySubtaskCriteria` before merge; LLM-only criteria surface as warnings in the Router context
86
+ - **MoE selective re-plan**: `executePlan(plan, {skipIds, carriedResults})` — already-succeeded subtasks are carried over across re-plan cycles, only failed/new subtasks re-execute
87
+ - **MoE observability**: `moe_plan` / `moe_subtask` / `moe_replan` / `moe_verify` events written to `session.jsonl` (visible in `mma session show`); token usage aggregated per `expert_tag` (`MoEExecutor.getUsageByTag`); sub-agents receive the real session id instead of the hardcoded `"moe"`
88
+ - **MoE cert scenarios**: `5.2-moe-parallel-waves` and `5.3-moe-read-after-write` (tag `moe`, timeoutMs 600_000)
89
+ - **ToolResult.usage**: sub-agent token usage propagated to the MoE executor for cost attribution
90
+
91
+ ### Changed
92
+ - **Reasoning policy baseline**: configurable via `reasoning.baseline` (default `medium`) — the auto policy's quiet-iteration level is no longer hardcoded, so trivial Q&A turns can start at `low`
93
+
94
+ ### Fixed
95
+ - **MoE hang**: sub-agents spawned by the `subagent` tool re-entered `runWithMoE` when the parent config had `moe.enabled=true` each MoE sub-agent planned its own subtasks and spawned nested sub-agents recursively (bounded only by `maxRecursionDepth`), hanging execution for many minutes with zero progress events. Sub-agents now always run the plain single-agent loop (`moe` is a top-level orchestration mode only).
96
+ - **MoE fallback visibility**: missing `orchestrator.model` with `moe.enabled=true` now logs a WARN with a fix hint instead of a debug-only message that made silent fallback to single-agent invisible.
97
+ - **CLI one-shot commands hang**: `config`, `session`, `model`, `provider`, `context`, `security`, `plugins`, `changelog` printed their result but never exited — bootstrap leaves open handles (reasoning-probe fetch, indexer) and only the prompt/REPL paths called `process.exit`. Subcommand roots now exit via a `postAction` hook (verified: `session list` 2.7s / exit 0, chained `config set` persists correctly).
98
+ - **Repeated tool calls**: identical `(tool, args)` repeat now injects a nudge into context in ALL modes — previously the nudge was gated behind `--exit-on-complete`, so interactive runs silently burned iterations re-running the same command (observed: duplicate `node sum.js` verification back-to-back).
99
+ - **Perfectionism cycle**: repeated mutations of the SAME target (same file via `edit_file`/`write_file`, same bash command, same `plan`/`todo` action) with varying arguments now inject a finalize-nudge after 5 occurrences — the consecutive-duplicate guard cannot see this pattern (args differ each time; observed: 20+ polish iterations after the task was already complete, then 10+ bookkeeping churn iterations after an audit rejection). The nudge lands AFTER tool results, so `assistant(tool_calls) → tool(results) → user(nudge)` pairing stays valid.
100
+ - **Audit gate friction (evidence-based auto-close)**: pending plan steps whose every file-like token resolves to an existing file are auto-closed by the final audit with a note — small models routinely finish the work but forget `plan update` bookkeeping, and the gate then rejected correct answers burning all retry budget. Steps without file tokens or with missing files stay pending (honest).
101
+ - **Audit rejection guidance**: the audit gate's `<system-summary>` now names the resolution paths (mark done / skipped / re-plan) in en+ru instead of a bare "continue working" — model plan-drift after a rejection (wrong file names, changed approach) is common for 9B and the old message did not point at the fix.
102
+ - **LSP false positives without type env**: `lsp_check` suppresses module-resolution diagnostics when the project root has no `tsconfig.json`/`jsconfig.json`/`node_modules` and reports an inconclusive note instead — phantom `Cannot find module 'fs'` / `Cannot find name '__dirname'` errors made the model abandon a working `.ts` approach for `.js` and spiral into plan drift.
103
+ - **Windows Unix-command hints**: `bash` hint list and the module-side forbidden set now cover `sed`/`awk`/`uniq`/`xargs`/`cut`/`tr`/`basename`/`dirname`/`export`/`source`/`sleep`/`env` (both lists kept consistent) — the 9B model keeps reaching for Unix tools in cmd.exe.
104
+ - **Tool visibility narrowing**: `chunk_query`, `download_file`, `mcp_call`, `pipeline_run` no longer visible by default they moved behind `enable_tools` (`research`/`shell` tags); the default visible set drops from 23 to 19 schemas, cutting tool tokens on every turn.
105
+ - **Tests**: replaced process-global `vi.mock` with DI seams (`AgentDeps.runWithMoEOverride`, `ToolContext.agentFactory`) — Bun module mocks leak across test files in the same worker; full suite is now green by default (1803 pass / 0 fail).
106
+ - **Docs**: AGENTS.md / testing.md — warn that `mma` resolves the globally installed package (stale `dist/`) when run outside the repo root, silently ignoring `src/` changes; always run from the repo root with `-d <sandbox>` and verify the version in the `Environment:` line.
107
+
108
+ ## [0.57.2] - 2026-08-30
109
+
110
+ ### Changed
111
+ - **KV-cache**: plan block removed from system prompt; plan status now injected into `<system-summary>` envelope after every tool batch. System prompt is immutable per session — local backends retain prefix cache.
112
+ - **Provenance**: provider entry resolution uses active entry label, not bare `provider.type`
113
+ - **Reasoning signals**: `consecutiveToolSuccesses` and `isRepetitive` now feed real values to the reasoning policy (were hardcoded)
114
+ - **Token estimation**: tool-def token estimate in agent loop uses `estimateTokens()` instead of flat `/4`
115
+ - **Agent split**: `agent.ts` 1550→950 lines; 10 extracted modules (`loop-state`, `compaction`, `tool-batch`, `hallucination-gate`, `audit-gate`, `reasoning-resolver`, `token-tracker`, `context-renderer`, `tool-output`, `constants`)
116
+ - **Plan-tool**: `plan-tool.ts` 741→232 lines; per-action handlers in `plan-actions.ts`
117
+ - **CLI**: `createProgram` 513→thin orchestrator; `registerMmaCommands` 470→8 lines (5 per-domain registers)
118
+ - **Bash handler**: `bash.ts` 236→~100 lines (`resolveBashSecurityConfig`, `decorateCommandOutput`)
119
+ - **Orchestrator**: reuse `parseChunks` instead of hand-rolled `any[]` aggregation; `createPlan` uses own `parseJSON`; constructor deduplicated via `createProviderInstance`
120
+ - **Shared utils**: `src/utils/` with `errMsg()`, `sleep()`, `truncate()`, `backoffDelay()`
121
+ - **errMsg**: replaces 23 occurrences of `e instanceof Error ? e.message : String(e)` across 12 files
122
+
123
+ ### Fixed
124
+ - **chunk_query**: one failing chunk no longer kills the entire query; per-chunk `catch` → `[FAILED]`
125
+ - **chunk_query**: synthesis prompt capped at 20K chars with `[TRUNCATED]` marker
126
+ - **chunk_query**: `AbortSignal` propagated to `chatText` for cancellation support
127
+ - **Executor**: `failFast` cleanup guard prevents nested scope clobbering
128
+ - **probe.ts**: transient errors (network/auth) no longer cached as "reasoning not supported" for 24h; returns `null` → caller skips cache
129
+ - **LSP**: startup timeout unified on `DEFAULT_TIMEOUT` (15000) instead of conflicting hardcoded 10000
130
+ - **Browser**: `BridgeResponse.data` typed (was `any`)
131
+ - **Agent**: `Agent.runTool()` public API replaces `(ctx.agent as any).deps` reach-in; `/reload` no longer mutates readonly context
132
+ - **LSP /lsp check**: fixed latent bug where `.execute()` was called with `.executeByName` signature
133
+
134
+ ### Added
135
+ - **Plan Reminder**: static `[Plan Reminder]` block in system prompt (never mutates)
136
+ - **Documentation**: reentrancy warning on `executeByName()`, `PlanResult` JSDoc
137
+ - **Tests**: `probe.test.ts` (6 cases), `command-suggest.test.ts`, `providers-factory.test.ts`, `subagent-tool.test.ts`, `agent-moe-write.test.ts`, `chunk-query.test.ts`
138
+ - **probe.ts**: `null` return for transient errors; bootstrap skips cache on `null`
139
+ - **Execution-plugin**: `resetStepFlags`/`resetPlanState` helpers (dedup 3 inline reset blocks)
140
+ - **Security-policies**: `comparePolicies` typed (`keyof SecurityConfig` replaces `as any`)
141
+
142
+ ### Removed
143
+ - **Browser**: dead `buildWaitScript` export (never imported)
144
+
145
+ ## [0.57.1] - 2026-08-28
146
+
147
+ ### Fixed
148
+ - **Publish**: republish after version bump
149
+
150
+ ## [0.57.0] - 2026-08-28
151
+
152
+ ### Changed
153
+ - **MCP**: lazy connectserver connections deferred to first tool call. Startup no longer blocks on unreachable MCP servers (e.g. context7 offline). Discovery runs in background with 5s timeout.
154
+ - **Updater**: `checkOnStart` and `autoInstall` disabled by default. Reduced `waitForIdle` timeout from 130s to 10s.
155
+ - **Config**: `updater.checkOnStart` default changed from `true` to `false`
156
+
157
+ ### Added
158
+ - **MCP**: HTTP request timeouts (10s) on `connectSSE`, `listToolsHTTP`, `callToolHTTP`
159
+ - **MCP**: `failedServers` tracking — servers that fail discovery are not retried
160
+ - **MCP**: placeholder `connect` tool for not-yet-discovered servers (LLM can trigger lazy discovery)
161
+ - **Reasoning**: persistent disk cache (`~/.mma/reasoning-cache.json`) with 24h TTLavoids re-probing LLM on every restart
162
+
163
+ ## [0.56.5] - 2026-08-27
164
+
165
+ ### Fixed
166
+ - **Hallucination**: `FactualCheck` now receives deleted files from `ConsistencyCheck` — no longer false-positives on files that were intentionally deleted in the same session
167
+
168
+ ## [0.56.4] - 2026-08-27
169
+
170
+ ### Fixed
171
+ - **Tools**: `list_dir` now filters `.mma/`, `node_modules/`, `.git/`, `dist/`, `build/`, `coverage/` from directory listings (consistent with indexer)
172
+ - **Hallucination**: `dotfileVariants` now tries dot-prefixing each directory component, not just basename (fixes false positive on `.mma/index-cache.json` → `mma/index-cache.json`)
173
+
174
+ ## [0.56.1] - 2026-08-27
175
+
176
+ ### Added
177
+ - **CLI**: `mma changelog` command show latest changelog entry or diff between versions (`--from <version>`)
178
+ - **Updater**: show changelog after auto-update install (`updater.installed` message includes new version's changelog)
179
+ - **Docs**: `CHANGELOG.md` included in npm package (visible via `npm info micro-models-agent`)
180
+ - **Docs**: rule to maintain changelog in `AGENTS.md`
181
+
182
+ ## [0.56.0] - 2026-08-27
183
+
184
+ ### Added
185
+ - **MoE**: live re-plan loop in `runWithMoE` — orchestrator re-plans on structural failures
186
+ - **MoE**: scope expansion protocol (`scope_request`) for cross-expert file access
187
+ - **MoE**: Esc/interrupt support in the MoE execution path
188
+ - **MoE**: `input_from` cross-expert data flow for subtask dependencies
189
+ - **LSP**: Angular language server support (`@angular/language-server` for `.html` in Angular workspaces)
190
+ - **Tools**: syntax pre-validation and auto-fix for `write_file`/`edit_file`
191
+
192
+ ### Fixed
193
+ - **Security**: SSRF via IPv6-mapped IPv4 and raw numeric hostnames
194
+ - **Security**: command-validator blacklist bypasses (shell expansions, encoded chars)
195
+ - **Security**: audit webhook retry queue drained forever (infinite loop + duplicate notifications)
196
+ - **Core**: dangling `tool_calls` on interrupt synthesized tool messages keep assistant/tool pairing
197
+ - **Core**: live reasoning policy + `set_thinking` override integration
198
+ - **Core**: deep-clone config defaults to prevent cross-session mutation
199
+ - **Config**: preserve `provider.fallback` on hot-swap
200
+ - **Tools**: path/scope escape holes in filesystem and read tools closed
201
+ - **Tools**: clear timeout timer & abort listener after race settles; log discarded losers
202
+ - **MCP**: stdio timer leaks + null deref after disconnect; added initialize handshake
203
+ - **LSP**: spawn servers detached on POSIX so `killTree` reaches the whole chain
204
+ - **Browser**: bridge leaked Chromium on SIGTERM and parent death
205
+ - **UI**: diff LCS memory cap; one bad encrypted line no longer kills session history
206
+ - **CLI**: `/config migrate` was unreachable
207
+ - **MoE**: locale-independent artifact path + no retry on user abort
208
+
209
+ ## [0.55.1] - 2026-08-25
210
+
211
+ ### Fixed
212
+ - **LLM**: NDJSON-tolerant stream parser for Ollama backends
213
+ - **LLM**: mid-stream provider errors surfaced (Ollama generation failures)
214
+ - **LLM**: `delta.reasoning` alias for thinking models
215
+ - **LLM**: wire-level debug logging for diagnostics
216
+
217
+ ## [0.55.0] - 2026-08-25
218
+
219
+ ### Added
220
+ - **Certification**: targeted re-run (`--scenarios <ids>`) with result merging
221
+ - **Certification**: per-rep timeout (`--timeout <ms>` + per-scenario `timeoutMs`)
222
+ - **Certification**: audit-gate bypass fix for `--exit-on-complete`
223
+
224
+ ### Fixed
225
+ - **Certification**: stale-label wording (removed impossible user instruction)
226
+ - **Dependencies**: typescript pinned to ^5.9 (TS7 preview breaks `@types/node`)
227
+
228
+ ## [0.54.0] - 2026-08-24
229
+
230
+ ### Added
231
+ - **Certification**: global manifest shipped with package updates (`~/.mma/certifications.json`)
232
+ - **Certification**: bundled manifest + startup sync from package
233
+
234
+ ### Fixed
235
+ - **Certification**: marks only showed when running from repo root
236
+
237
+ ## [0.53.0] - 2026-08-24
238
+
239
+ ### Added
240
+ - **Certification**: qwen3.5-9b certified 20/20
241
+ - **Config**: `provider.maxCompletionTokens` option
242
+ - **Certification**: label text in `mma model list` and REPL `/model`
243
+
244
+ ### Fixed
245
+ - **Certification**: reasoning-heavy models truncated tool_call arguments at default 4096 cap
246
+ - **Certification**: scenario 3.5 prompt disambiguation
247
+
248
+ ## [0.52.0] - 2026-08-23
249
+
250
+ ### Added
251
+ - **Execution**: `FS_MUTATING_TOOLS` — plan auto-advance after bash/download/subagent/mcp/pipeline/browser tools
252
+ - **Config**: `provider.maxCompletionTokens` plumbing through ProviderManager → agent
253
+
254
+ ### Fixed
255
+ - **Execution**: small models create files via bash instead of `write_file`, stalling plans
256
+ - **Execution**: `maxCompletionTokens` was never read from config
257
+
258
+ ## [0.51.0] - 2026-08-23
259
+
260
+ ### Added
261
+ - **Plugin**: `HostBridge` interface for bidirectional agent communication
262
+ - **Plugin**: `onTurnEnd(ctx, TurnSummary)` hook dispatched once per completed run
263
+ - **Plugin**: `web-ui` example plugin browser-based chat with SSE streaming
264
+ - **CLI**: REPL bridge wiring for web-ui submit/interrupt
265
+
266
+ ### Fixed
267
+ - **REPL**: `/config migrate` unreachable
268
+
269
+ ## [0.50.3] - 2026-08-22
270
+
271
+ ### Fixed
272
+ - **UI**: REPL line editor scroll-proof rendering (absolute anchoring via DSR query)
273
+
274
+ ## [0.50.2] - 2026-08-22
275
+
276
+ ### Fixed
277
+ - **LLM**: idle stream timeout increased 60s → 180s (LM Studio buffering)
278
+ - **LLM**: stall diagnosis with dedicated message for SSE buffering
279
+ - **LLM**: truncation no longer masquerades as empty response
280
+ - **LLM**: recoverable LLM errors fed back into context instead of dying
281
+ - **Execution**: bash flailing detector (≥4 failed bash attempts in last 6)
282
+
283
+ ## [0.50.1] - 2026-08-21
284
+
285
+ ### Fixed
286
+ - **Security**: no longer silently overrides explicit user opt-out
287
+ - **Lint**: skips missing lint binary (was appending error to every write)
288
+ - **Stuck**: anti-spam for stuck-warnings (dedup via key, decay per-tool counters)
289
+ - **Plan**: unified progress counting (done+skipped as settled)
290
+ - **Plan**: bulk `steps[]` rewrite guarded on progressed plans
291
+ - **Plan**: archived plans answer read-only
292
+ - **Process**: usage hints for `process_kill`/`process_log` without id
293
+
294
+ ## [0.50.0] - 2026-08-21
295
+
296
+ ### Added
297
+ - **Provider**: health probe (`probeProviders()` + `mma provider check`)
298
+ - **Provider**: code-only capability routing (`ProviderManager.pickFor()`)
299
+ - **Provider**: per-entry isolation + priority fallback order
300
+ - **Pricing**: per-provider cost attribution + breakdown
301
+
302
+ ### Fixed
303
+ - **Provider**: transparent failover on 429/5xx/network errors
304
+
305
+ ## [0.49.0] - 2026-08-20
306
+
307
+ ### Fixed
308
+ - **REPL**: stale-plan leaks plan state no longer persists across sessions
309
+ - **REPL**: plan checklist prints only on plan/todo tool-end events
310
+ - **Plan**: `PlanStore` is single source of truth for UI consumers
311
+
312
+ ## [0.48.3] - 2026-08-20
313
+
314
+ ### Fixed
315
+ - **Hallucination**: dotfile false-positive (`.prettierrc.json` extracted as `prettierrc.json`)
316
+
317
+ ## [0.48.2] - 2026-08-20
318
+
319
+ ### Fixed
320
+ - **REPL**: stale plan printed on first agent run of a session
321
+
322
+ ## [0.47.0] - 2026-08-19
323
+
324
+ ### Added
325
+ - **Session**: startup diagnostics logging (environment, LSP probe, baseline typecheck)
326
+ - **Session**: `logBaselineTypecheck()` for post-mortem visibility
327
+
328
+ ## [0.46.1] - 2026-08-19
329
+
330
+ ### Fixed
331
+ - **LLM**: connection-break hardening (stream-level retry, no-data timeout, `[DONE]` tracking)
332
+ - **LLM**: non-streaming timeout (was missing, could hang forever)
333
+ - **Config**: `retry.maxStreamRetries`, `retry.noDataTimeoutMs` options
334
+
335
+ ## [0.46.0] - 2026-08-19
336
+
337
+ ### Added
338
+ - **Provider**: multi-provider + hot-swap + per-message provenance
339
+ - **Provider**: `ProviderManager` with entry-based config
340
+ - **CLI**: `mma provider add/list/use`
341
+ - **REPL**: `/provider list/use`
342
+
343
+ ### Fixed
344
+ - **Path**: `safeResolvePath` POSIX bug (absolute paths re-resolved against baseDir)
345
+
346
+ ## [0.45.0] - 2026-08-18
347
+
348
+ ### Added
349
+ - **Provider**: provider module Phase 1 (registry, presets, `createProvider()`)
350
+ - **Provider**: `openrouter` preset
351
+ - **Setup**: wizard menu built from `BUILTIN_PROVIDERS`
352
+
353
+ ## [0.44.0] - 2026-08-18
354
+
355
+ ### Added
356
+ - **Plugins**: folder plugins (subdirectory with entry file)
357
+ - **Plugin**: `trace-server` split into folder plugin
358
+
359
+ ### Fixed
360
+ - **Plugin**: template-literal page inlining broke `\n` in JS strings
361
+
362
+ ## [0.43.2] - 2026-08-17
363
+
364
+ ### Fixed
365
+ - **Execution**: plan done-gate on known compile failures (typecheck gate)
366
+ - **Bootstrap**: live getters for `sessionId`/`sessionContext` after session switch
367
+ - **Edit**: `edit_file` "String not found" hint to `read_file` first
368
+
369
+ ## [0.43.1] - 2026-08-17
370
+
371
+ ### Fixed
372
+ - **Agent**: session-interrupt no longer renders tool results after "Session ended"
373
+ - **Executor**: `onAfterTool` plugins skipped when signal is aborted
374
+ - **Lint**: abortable syntax checks on Esc
375
+
376
+ ## [0.43.0] - 2026-08-17
377
+
378
+ ### Added
379
+ - **Plan**: `plan delete <id>` + `plan purge` actions
380
+ - **Plan**: `abort` honors `id` parameter
381
+ - **Plan**: `replan` renumbers ids for kept steps
382
+ - **Audit**: `resolveTestCommand` picks the project's real test runner
383
+
384
+ ### Fixed
385
+ - **Plan**: `switch` to already-active plan is a no-op
386
+ - **Plan**: final audit runs for a completed plan
387
+ - **Plan**: evidence-based plan nudge (replaces iteration counter)
388
+ - **Plan**: `checkPlanAlignment` scans path arguments only
389
+ - **Plan**: `isDepsStep` requires a package-manager verb
390
+ - **Plan**: auto-advance resolves nested files
391
+
392
+ ## [0.42.0] - 2026-08-16
393
+
394
+ ### Added
395
+ - **Execution**: automatic error web search (≥5 same-error repeats → web search → inject results)
396
+ - **Config**: `errorWebSearch` section
397
+
398
+ ### Fixed
399
+ - **Execution**: `onAfterTool` double-counted typecheck + failure errors
400
+
401
+ ## [0.41.1] - 2026-08-16
402
+
403
+ ### Fixed
404
+ - **LSP**: `typescript@5` pin + `--yes` for npx
405
+ - **LSP**: sequential probing (waves) to avoid npx cache lock contention
406
+ - **LSP**: stale config normalization
407
+ - **LSP**: Windows process leak in `shutdown()`
408
+ - **REPL**: non-blocking LSP banner
409
+ - **Bootstrap**: lazy startup health check
410
+
411
+ ## [0.41.0] - 2026-08-15
412
+
413
+ ### Added
414
+ - **REPL**: live plan checklist with progress bar
415
+ - **UI**: tool-to-step binding (`← step N` suffix in tool headers)
416
+ - **UI**: background command output preview
417
+
418
+ ## [0.40.1] - 2026-08-15
419
+
420
+ ### Fixed
421
+ - **LSP**: broken package names (`vscode-html-languageserver` → `vscode-langservers-extracted`)
422
+
423
+ ## [0.40.0] - 2026-08-15
424
+
425
+ ### Added
426
+ - **Tools**: tool-set narrowing (on-demand enable via `enable_tools`)
427
+ - **Config**: `tools.defaultTags` + `tools.enableOnDemand`
428
+ - **Tools**: `alwaysOn` flag for structural tools
429
+
430
+ ## [0.39.1] - 2026-08-14
431
+
432
+ ### Fixed
433
+ - **Plugins**: dedup by version, compatibility gate, source tracking
434
+ - **CLI**: `mma plugins list` command
435
+
436
+ ## [0.38.0] - 2026-08-14
437
+
438
+ ### Added
439
+ - **LSP**: `lsp_check` tool for on-demand diagnostics
440
+ - **Plan**: `plan create` guard (blocks when active plan has progress)
441
+
442
+ ### Fixed
443
+ - **Context**: compaction summary carries plan + read state
444
+ - **Browser**: bridge path resolution in bundled dist
445
+
446
+ ## [0.37.0] - 2026-08-13
447
+
448
+ ### Added
449
+ - **Plugins**: folder plugin support in `PluginLoader`
450
+
451
+ ### Fixed
452
+ - **Plugin**: template-literal page inlining broke `\n` in JS
453
+
454
+ ## [0.36.3] - 2026-08-13
455
+
456
+ ### Fixed
457
+ - **UI**: REPL paste fix (batch single-render, CRLF collapse)
458
+
459
+ ## [0.36.2] - 2026-08-13
460
+
461
+ ### Fixed
462
+ - **Updater**: silent logger, one-shot `process.exit()` killed background install, semver-aware check
463
+
464
+ ## [0.36.1] - 2026-08-13
465
+
466
+ ### Fixed
467
+ - **Audit**: nested-file resolution, non-zero test run blocks
468
+ - **Browser**: bridge diagnostics + one-shot restart
469
+ - **LSP**: per-server disable + initialize retry + CSS timeout
470
+ - **Bash**: npm exec hint
471
+
472
+ ## [0.36.0] - 2026-08-12
473
+
474
+ ### Added
475
+ - **Plan**: model-declared `kind: "create"|"delete"` for steps
476
+ - **Execution**: `FS_MUTATING_TOOLS` for plan auto-advance
477
+ - **Config**: `provider.maxCompletionTokens` option
478
+
479
+ ### Fixed
480
+ - **Context**: compaction preserves session `mission`
481
+ - **Context**: deleted files leave compaction `[Files:]` list
482
+ - **Audit**: final audit runs real `tsc --noEmit --skipLibCheck`
483
+ - **Bash**: repeated forbidden Windows commands hard-stopped after 2 failures
484
+
485
+ ## [0.35.5] - 2026-08-12
486
+
487
+ ### Fixed
488
+ - **Execution**: plan-alignment phantom paths (domains/extensions treated as files)
489
+ - **Execution**: hint/recovery dedup in `StuckDetector`
490
+
491
+ ## [0.35.3] - 2026-08-11
492
+
493
+ ### Fixed
494
+ - **LSP**: workspace root resolved from edited file's project
495
+ - **Audit**: skipped steps treated as terminal
496
+ - **Bash**: Windows hint keys on original command word
497
+ - **Tools**: boundedOutput tools never budget-truncated
498
+
499
+ ## [0.35.0] - 2026-08-11
500
+
501
+ ### Added
502
+ - **Tools**: `download_file` tool for binary file downloads
503
+
504
+ ## [0.34.0] - 2026-08-10
505
+
506
+ ### Added
507
+ - **Indexer**: project profile (`[Stack: ...]` summary from manifest)
508
+ - **Indexer**: dynamic map refresh inside sessions
509
+
510
+ ## [0.33.3] - 2026-08-10
511
+
512
+ ### Fixed
513
+ - **Audit**: nested-file resolution (basename + path-suffix match)
514
+ - **Plan**: `plan show` honors `id` parameter
515
+ - **Context**: compaction interval reset per user turn
516
+ - **Context**: `extractFacts` captures `edit_file` paths + Windows drive-letter paths
517
+ - **Execution**: stuck detector read-only loop detection
518
+ - **Read**: default limit 15 → 300 lines
519
+ - **LSP**: `spawn` on Windows (`.cmd` shim resolution)
520
+ - **Todo**: `todo add` tracks subtasks, `todo done` marks individual sub-task
521
+ - **Memory**: learns repeated per-tool failures (≥3×)
522
+ - **Context**: compaction preserves user's task
523
+
524
+ ## [0.33.2] - 2026-08-09
525
+
526
+ ### Fixed
527
+ - **UI**: REPL conversation layout (user/agent message dividers)
528
+ - **Tools**: `isFilePathLike` uses allow-list of file extensions
529
+
530
+ ## [0.33.1] - 2026-08-09
531
+
532
+ ### Fixed
533
+ - **UI**: REPL line editor redraw fix (no duplicated multi-line input)
534
+ - **Tools**: `web_fetch`/`web_browse` description clarifications
535
+
536
+ ## [0.33.0] - 2026-08-09
537
+
538
+ ### Added
539
+ - **RLM**: pass-by-reference sub-agent results (`ArtifactStore`)
540
+ - **RLM**: chunked parallel queries (`chunk_query` tool)
541
+ - **Config**: `subagent.resultMode`, `maxSummaryChars`, `artifactsDir`, `stableSystemPrompt`
542
+
543
+ ## [0.32.0] - 2026-08-08
544
+
545
+ ### Added
546
+ - **Browser**: driver abstraction (`PlaywrightDriver` + `BridgeDriver`)
547
+ - **Browser**: Node bridge for Bun compatibility
548
+ - **Config**: `browser.maxConsoleLineChars`
549
+
550
+ ## [0.31.0] - 2026-08-08
551
+
552
+ ### Added
553
+ - **Security**: session file encryption (AES-256-GCM)
554
+ - **Security**: audit notifications (file + webhook)
555
+ - **Security**: security policies (strict/balanced/permissive)
556
+ - **CLI**: `mma security` commands
557
+
558
+ ## [0.30.0] - 2026-08-07
559
+
560
+ ### Added
561
+ - **Execution**: final audit gate (runs `bun test` for verification steps)
562
+ - **Execution**: `detectTestResults()` auto-verification in bash
563
+
564
+ ### Fixed
565
+ - **Execution**: empty-CLI entry-point hint
566
+ - **Bash**: Windows anti-patterns documentation
567
+
568
+ ## [0.29.0] - 2026-08-07
569
+
570
+ ### Added
571
+ - **Bash**: smart UTF-8/OEM line decoding (fixes Cyrillic on Windows)
572
+ - **Bash**: behavior-based background detection
573
+ - **Bash**: stuck-detector bash awareness
574
+
575
+ ## [0.28.0] - 2026-08-06
576
+
577
+ ### Fixed
578
+ - **Agent**: double-Esc interrupt fix (Bun readline keypress collapsing)
579
+ - **Agent**: abortable in-flight LLM requests on interrupt
580
+ - **UI**: clipboard paste hint
581
+
582
+ ## [0.27.0] - 2026-08-06
583
+
584
+ ### Fixed
585
+ - **Security**: Windows hardening
586
+ - **Hallucination**: fixes
587
+
588
+ ## [0.26.0] - 2026-08-05
589
+
590
+ ### Added
591
+ - **UI**: opencode-style inline tool headers (`ui.toolStyle`)
592
+ - **UI**: model commentary next to tool calls (`ui.toolComments`)
593
+ - **UI**: diffs without background color
594
+
595
+ ## [0.25.0] - 2026-08-05
596
+
597
+ ### Added
598
+ - **LSP**: LSP module (typescript, CSS, HTML, JSON, Python, Rust, Go)
599
+ - **Execution**: audit gate language-agnostic
600
+ - **Bash**: Windows command hints
601
+
602
+ ## [0.24.0] - 2026-08-04
603
+
604
+ ### Added
605
+ - **Context**: quality formula upgrade (token load + compaction loss + error density + freshness)
606
+ - **Read**: display mode (show only header in REPL, full content to LLM)
607
+
608
+ ## [0.23.0] - 2026-08-04
609
+
610
+ ### Added
611
+ - **Certification**: model certification module (`mma model certify`)
612
+ - **CLI**: cert checkmarks in model lists
613
+
614
+ ## [0.22.0] - 2026-08-03
615
+
616
+ ### Added
617
+ - **Security**: `enabled` flag (disabled by default)
618
+ - **CLI**: init/first-run apply wizard security answers
619
+ - **Prompt**: system prompt & recovery messages cleanup