* chore(memory): remove plugin block from opencode.json * chore(memory): remove setup-memory.sh and memory-setup.ts * chore(memory): remove opencode-memory from Dockerfile * docs(memory): update AGENTS.md and SKILL.md for new tools * test(memory): drop tests for removed setup-memory.sh and memory-setup.ts * docs(handoff): add handoff and ADR-045 for plugin/rust removal * docs(handoff): set PR number * docs(project-map): update after plugin/rust removal --------- Co-authored-by: opencode-agent <agent@opencode.local>
4.3 KiB
4.3 KiB
ADR-045: Remove @mathew-cf/opencode-memory plugin + Rust artifacts
Статус
Accepted (2026-07-26)
Контекст
После миграции на единую гибридную систему памяти (5 TS tools, PR #101) + E2E покрытия (PR #102) сохранилась двойная система:
- Plugin
@mathew-cf/opencode-memoryпрописан вopencode.jsonблокеpluginи устанавливается вDockerfileчерезnpm install -g. Но plugin не вызывается из-за бага wrapper-пути (см. ADR-043, handoff pr-101) — фактически мёртвый код, съедающий ~85 MB в image + cache. - Rust
rag-clibinary (внутри плагина) пишет.rag/index.bin(7.5 MB) +.rag/meta.json(12 KB) в Rust-формате (hidden_size,model_id,file_hashes). Pythonsrc/memory/index.pyпишет.rag/index.json(210 MB, 4096-dim embeddings) +.rag/meta.jsonв Python-формате (version,files). Конфликт: оба пишутmeta.jsonпо одному пути, разные форматы → Rust перетирает Python → broken индекс при сосуществовании. setup-memory.sh(4.6 KB) — shell-скрипт инициализации, заменён на auto-setup внутриmemory-save.ts(git init + hook если remote set).memory-setup.ts(716 B) — TS tool-обёртка надsetup-memory.sh, заменён наmemory-doctor.ts(read-only диагностика, не модифицирующий).
Cleanup нужно делать ПОСЛЕ подтверждения что TS tools работают (PR #101) и E2E тесты проходят (PR #102) — иначе остались бы без памяти. Issue #97 (E2E green) был blocker для #98.
Решение
Удалить все артефакты старой системы за один PR (issue #98, фаза 3 эпика #94):
opencode.json— убрать блокpluginцеликом. JSON остался валидным.Dockerfile— убрать@mathew-cf/opencode-memoryизnpm install -g..opencode/scripts/setup-memory.sh— удалить (auto-setup вmemory-save.ts)..opencode/tools/memory-setup.ts— удалить (заменён наmemory-doctor.ts).- Rust артефакты на хосте:
.rag/index.bin,.rag/meta.json(Rust-формат),~/.cache/opencode/packages/@mathew-cf/opencode-memory@latest/+ siblingopencode-memory/(оба 85 MB). НЕ трогать.rag/index.json(Python). AGENTS.md+SKILL.md— обновить Tool Usage Policy: убратьmemory-setup(), добавить 5 kebab-case tools (memory-doctor,memory-save,memory-search,memory-list,memory-access).- Тесты: инвертировать assertions
test_dockerfile.py(плагин должен ОТСУТСТВОВАТЬ), удалить тесты дляsetup-memory.shиmemory-setup.ts.
Имя tool-casing: kebab-case для локальных .opencode/tools/*.ts (runtime
registry = filename), confirmed ADR-009 + memory tool-name-casing-kebab-vs-mcp-snake.
MCP plugin tools были snake_case, но плагин удалён — больше не актуально.
Альтернативы
- Оставить plugin как fallback — отклонено: plugin не вызывается из-за wrapper-бага, Rust meta.json конфилктует с Python, ~170 MB мёртвого веса. Двойная система = каша, двойной maintenance, риск что Rust перетрёт Python индекс.
- Удалить только Rust артефакты, оставить plugin в конфиге — отклонено:
plugin без
npm install= silent skip (opencode логирует warning), но оставляет мёртвый блок в конфиге + вводит в заблуждение. - Поэтапный cleanup (несколько PR) — отклонено: артефакты тесно связаны (plugin → setup-memory.sh → memory-setup.ts → Rust binary), частичный cleanup оставляет поломанное состояние.