feat(memory) + chore(workplan): complete T02 for CYA-WP-0003 — port extensions for activation, kinds, and retrospection records (backward compatible)

This commit is contained in:
2026-05-26 15:15:20 +02:00
parent 03aaaf99e5
commit abc54989e5
2 changed files with 96 additions and 31 deletions

View File

@@ -73,20 +73,26 @@ completed: "2026-05-27"
```task
id: CYA-WP-0003-T02
status: todo
status: done
priority: high
state_hub_task_id: "6f50bdf4-6252-4b93-9697-407ef432cd90"
started: "2026-05-27 ralph continuation (after T01 review)"
completed: "2026-05-27"
```
- Evolve the four ports (or add minimal new ones) to better support:
- Richer scoping and activation hints (e.g., directory + project identity + optional profile).
- Storing and retrieving "retrospection outcomes" and "interaction goals" as first-class memory.
- Define lightweight structures for retrospection records and activated context packages.
- Maintain full backward compatibility and user inspectability.
**Done** — implemented in `src/cya/memory/__init__.py`.
**Acceptance criteria**:
- Ports and data model support the concepts from T01 without breaking existing usage.
- All new memory remains fully user-visible and editable.
- Added `kind` parameter to `remember_preference` (defaults to "preference" for full backward compat).
- Added `KIND_*` constants and `remember_retrospection_outcome()` convenience helper.
- Enhanced `recall_preferences` with better `kinds` filtering + new `activation_context` parameter for smarter directory/project-aware activation.
- Improved `export_memory` with optional `kinds` filter and `by_kind` summary.
- All changes maintain 100% backward compatibility with existing call sites.
- Verified manually (roundtrips for preferences, retrospection records, kind filtering, and activation hints all work).
**Acceptance criteria met**:
- Ports and data model now support the T01 concepts.
- Everything remains fully user-visible/editable (still plain JSON under `~/.config/cya/memory/`).
- No breaking changes.
### T03 — Implement directory- and project-bound memory activation