Finish live run readiness tooling

This commit is contained in:
Зарубин Филипп
2026-06-24 12:32:27 +03:00
parent 8f2fc2f8ee
commit a2a555cf1d
13 changed files with 241 additions and 44 deletions
+3 -3
View File
@@ -3,7 +3,7 @@
Mnemazine has two operating modes:
- **Conservative (default):** local-only. No network, no LLM, no external services. This is what `node scripts/mnemazine-run.mjs` and `npm run synthesize` do by default.
- **Deep (opt-in):** uses an LLM agent (Claude by default, Codex at parity) to atomize one source into many focused notes (README "one source → ~20 notes") and to verify claims against their sources.
- **Deep (opt-in):** uses an LLM agent (auto-select: Claude, otherwise Codex) to atomize one source into many focused notes (README "one source → ~20 notes") and to verify claims against their sources.
Deep mode is **off unless you ask for it**. Nothing in the default pipeline reaches the network or an LLM.
@@ -30,13 +30,13 @@ If deep mode is requested directly but no LLM engine is available, plain `node s
## The LLM bridge
All LLM calls go through one provider-abstracted module: `scripts/mnemazine-llm.mjs` (`llmJson(prompt, schema, {provider, tools})`). The **code-first engine is Claude** (headless `claude -p`); **Codex is kept at parity** — the same contract, so anything that works via Claude also works via Codex. There is no third LLM client. `mnemazine-codex.mjs` remains as a thin back-compat shim.
All LLM calls go through one provider-abstracted module: `scripts/mnemazine-llm.mjs` (`llmJson(prompt, schema, {provider, tools})`). When `MNEMAZINE_LLM` is unset, Mnemazine uses Claude CLI when available and falls back to Codex CLI otherwise. Pin the engine explicitly with `MNEMAZINE_LLM=claude` or `MNEMAZINE_LLM=codex`. There is no third LLM client. `mnemazine-codex.mjs` remains as a thin back-compat shim.
### Environment variables
| Variable | Default | Purpose |
|----------|---------|---------|
| `MNEMAZINE_LLM` | `claude` | Engine: `claude` (primary) or `codex` (parity). |
| `MNEMAZINE_LLM` | auto | Engine: `claude` or `codex`. When unset: Claude if available, otherwise Codex. |
| `MNEMAZINE_CLAUDE_BIN` | auto-discover | Claude CLI: auto-found via login-shell PATH, common installs (npm/Homebrew/standalone/Desktop), or VSCode. Override to pin. |
| `MNEMAZINE_CODEX_BIN` | `/Applications/Codex.app/Contents/Resources/codex` | Path to the Codex binary. |
| `MNEMAZINE_LLM_TIMEOUT_MS` | `420000` | Per-call timeout. |
+3 -3
View File
@@ -3,7 +3,7 @@
У Mnemazine два режима работы:
- **Консервативный (по умолчанию):** только локально. Без сети, без LLM, без внешних сервисов. Так работают `node scripts/mnemazine-run.mjs` и `npm run synthesize` по умолчанию.
- **Deep (по запросу):** использует LLM-агента (Claude по умолчанию, Codex в паритете), чтобы разбить один источник на много сфокусированных заметок (README «один источник → ~20 заметок») и проверить утверждения по их источникам.
- **Deep (по запросу):** использует LLM-агента (авто-выбор: Claude, иначе Codex), чтобы разбить один источник на много сфокусированных заметок (README «один источник → ~20 заметок») и проверить утверждения по их источникам.
Deep-режим **выключен, пока вы его не попросите**. Ничто в стандартном конвейере не выходит в сеть и не зовёт LLM.
@@ -30,13 +30,13 @@ npm run synthesize -- --deep
## Мост LLM
Все вызовы LLM идут через один провайдер-абстрактный модуль: `scripts/mnemazine-llm.mjs` (`llmJson(prompt, schema, {provider, tools})`). **Движок в первую очередь — Claude** (headless `claude -p`); **Codex держится в паритете** — тот же контракт, поэтому всё, что работает через Claude, работает и через Codex. Третьего LLM-клиента нет. `mnemazine-codex.mjs` остаётся тонким shim'ом обратной совместимости.
Все вызовы LLM идут через один провайдер-абстрактный модуль: `scripts/mnemazine-llm.mjs` (`llmJson(prompt, schema, {provider, tools})`). Если `MNEMAZINE_LLM` не задан, Mnemazine берёт Claude CLI, когда он доступен, иначе Codex CLI. Можно зафиксировать движок явно: `MNEMAZINE_LLM=claude` или `MNEMAZINE_LLM=codex`. Третьего LLM-клиента нет. `mnemazine-codex.mjs` остаётся тонким shim'ом обратной совместимости.
### Переменные окружения
| Переменная | По умолчанию | Назначение |
|----------|---------|---------|
| `MNEMAZINE_LLM` | `claude` | Движок: `claude` (primary) или `codex` (паритет). |
| `MNEMAZINE_LLM` | авто | Движок: `claude` или `codex`. Если не задан — Claude при наличии, иначе Codex. |
| `MNEMAZINE_CLAUDE_BIN` | авто | Claude CLI: авто-поиск через login-shell PATH, типовые установки (npm/Homebrew/standalone/Desktop), VSCode. Переопределите чтобы зафиксировать. |
| `MNEMAZINE_CODEX_BIN` | `/Applications/Codex.app/Contents/Resources/codex` | Путь к бинарю Codex. |
| `MNEMAZINE_LLM_TIMEOUT_MS` | `420000` | Таймаут одного вызова. |
+9 -6
View File
@@ -76,13 +76,16 @@ npm run preflight:live
```
Before a real `npm start`, this checks that tracked code is clean, `HEAD`
matches `origin/main`, the local security audit passes, the Desktop dry-run
passes, and the inbox has active files. Empty inbox or dirty code is a failure.
To test the command itself without files, temporarily set
`MNEMAZINE_PREFLIGHT_ALLOW_EMPTY=1`.
matches `origin/main`, the LLM provider is available, the local security audit
passes, the Desktop dry-run passes, and the inbox has active files. Empty inbox,
dirty code, or a missing LLM provider is a failure. To test the command itself
without files, temporarily set `MNEMAZINE_PREFLIGHT_ALLOW_EMPTY=1`.
After a live run, inspect `.mnemazine/state/last-run.json`,
`.mnemazine/state/last-action-brief.md`, and the newest files in `reports/`.
After a live run, inspect the result with:
```bash
npm run last-run -- --require-ok
```
## Agent Skills
+9 -5
View File
@@ -76,12 +76,16 @@ npm run preflight:live
```
Перед настоящим `npm start` команда проверяет чистоту tracked-кода, совпадение
с `origin/main`, локальный security audit, Desktop dry-run и наличие файлов в
inbox. Пустой inbox или грязный код — fail. Для проверки самой команды без
файлов можно временно поставить `MNEMAZINE_PREFLIGHT_ALLOW_EMPTY=1`.
с `origin/main`, доступность LLM-провайдера, локальный security audit, Desktop
dry-run и наличие файлов в inbox. Пустой inbox, грязный код или недоступный LLM
— fail. Для проверки самой команды без файлов можно временно поставить
`MNEMAZINE_PREFLIGHT_ALLOW_EMPTY=1`.
После live-прогона смотри `.mnemazine/state/last-run.json`,
`.mnemazine/state/last-action-brief.md` и свежие файлы в `reports/`.
После live-прогона смотри итог одной командой:
```bash
npm run last-run -- --require-ok
```
## Agent Skills