feat(retrospection) + chore(workplan): complete T04 for CYA-WP-0003 — added 'cya retrospect' guided reflection flow with goal capture

This commit is contained in:
2026-05-26 15:26:54 +02:00
parent f2c555284f
commit 6cbd055b1a
3 changed files with 147 additions and 12 deletions

View File

@@ -121,21 +121,27 @@ completed: "2026-05-27"
```task
id: CYA-WP-0003-T04
status: todo
status: done
priority: high
state_hub_task_id: "fb63edc4-1e3f-4964-a2b6-19b29d00ffd8"
started: "2026-05-27 ralph continuation (after T03)"
completed: "2026-05-27"
```
- Design and implement a retrospection mode or dedicated subcommand / prompt pattern.
- During retrospection, the agent helps the user:
- Review recent interactions and memory usage.
- Reflect on what helped or didn't.
- Explicitly set or refine goals, preferences, and "rules for future interactions."
- Store retrospection outputs as durable memory (stabilized phase where appropriate).
**Done** — implemented.
**Acceptance criteria**:
- A user can run a retrospection session and have its outcomes affect future assistance.
- The flow feels natural in a terminal and respects user control.
- Added `cya retrospect` subcommand in `src/cya/cli/main.py`.
- Implemented `run_retrospection()` in `src/cya/orchestrator.py`:
- Reviews recent memory in the given scope.
- Guides the user through reflection questions.
- Records outcomes using the T02 `remember_retrospection_outcome` helper (stored as retrospection / interaction_goal kinds).
- Uses rich panels for a pleasant terminal experience.
- The command is discoverable (`cya --help` shows the `retrospect` subcommand).
- Outcomes are stored in the same user-controlled memory store and will be activated in future normal sessions (per T03 activation logic).
**Acceptance criteria met** (MVP):
- A user can run `cya retrospect` and capture goals/preferences that affect future assistance.
- The flow is natural, guided, and fully respects user control (they decide what to record).
### T05 — Close the continuous optimization loop