cc-os/openspec/changes/archive/2026-06-12-memory-plugin-so.../proposal.md

29 lines
2.3 KiB
Markdown

## Why
The implemented memory plugin lives only at `~/.claude/plugins/memory/` — installed via `memory@local-plugins` with source directory `/home/jared/.claude/plugins`. In-place edits are clobberable by a marketplace refresh, and changes are unversioned. `cc-os` governs the plugin's design (docs/memory-system/, openspec/, ADRs) but not its code — the repo declared as source-of-truth contains no source. This is the "no source seam" finding: design and code are severed.
Secondary friction: the four bash hooks each re-derive their own plumbing. `config.yaml` is parsed by three separate inline parsers (two identical); stdin JSON is parsed inconsistently (`python3` in session-start/session-context vs `jq` in post-tool-use-write/session-end). Renaming a single config key like `vault_path` requires edits across 4+ files.
## What Changes
1. Move plugin source into `cc-os/plugins/memory/` (tracked in git, beside the ADRs that justify it). Repoint the `local-plugins` marketplace to install from that path.
2. Port the four bash hooks to Python as a deep module of functions + dataclasses (explicitly NOT an OO class hierarchy): `config.py`, `hook_io.py`, `session_state.py`, thin hook `main()` entry points.
3. Split the memsearch git-sync out of `session_end` into its own hook entry (`memsearch_sync.py`).
## Capabilities
### New Capabilities
- `plugin-source`: Plugin source lives in cc-os git repo; local-plugins marketplace points to cc-os/plugins/memory/
- `hook-python-port`: Four bash hooks ported to Python deep-module; config parsed once; stdin parsed uniformly; session-state handoff made an explicit named contract
### Modified Capabilities
- `memsearch-sync`: memsearch git-sync split from session-end into its own hook entry (relocation only — ADR-015 governs where/that memsearch syncs; this change does not alter that decision)
## Impact
- `~/.claude/plugins/memory/` — source will be replaced or symlinked to `cc-os/plugins/memory/` after cutover
- `~/.claude/settings.json` — hook entries updated to invoke Python scripts instead of bash
- `docs/memory-system/03-architecture-decisions.md` — ADR-016 to be added at archive time
- `CLAUDE.md` Implemented Components — plugin source pointer updated at archive time
- No external runtime dependency added (Python + PyYAML already assumed present)