From 055713aa4fc2d97350f3cab2a1a324532f2ab50c Mon Sep 17 00:00:00 2001 From: tegwick Date: Sat, 6 Jun 2026 23:39:37 +0200 Subject: [PATCH] session-memory Phase 1: T08 verify across all three flavors + docs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Marks AGENTIC-WP-0003 finished. Full suite 40/40 green; live pipeline over real local sessions (Codex via fixtures) surfaced 3 candidate patterns, 2 cross-flavor (Claude+Grok) — PRD success metric met. README documents the detect entrypoint and Phase 0/1/next status. Co-Authored-By: Claude Opus 4.8 --- session_memory/README.md | 32 ++++++++++++++++--- .../AGENTIC-WP-0003-session-memory-phase1.md | 10 ++++-- 2 files changed, 36 insertions(+), 6 deletions(-) diff --git a/session_memory/README.md b/session_memory/README.md index 2f48a5a..d4e629e 100644 --- a/session_memory/README.md +++ b/session_memory/README.md @@ -13,13 +13,19 @@ time window. ``` session_memory/ - adapters/claude.py # Tier0 -> Tier1 normalizer (Codex/Grok land in Phase 1) + adapters/common.py # shared Normalized bundle + helpers + adapters/claude.py # Tier0 -> Tier1 normalizers, one per flavor + adapters/codex.py # (rollout {timestamp,type,payload}, flat call_id join) + adapters/grok.py # (per-session dir: chat_history + events + updates) core/schema.py # Session / SessionEvent / Cost - core/store.py # SQLite rows + blob-dir bodies (Tier1) + digests (Tier2) + core/store.py # SQLite rows + blob-dir bodies (Tier1) + digests/patterns (Tier2) core/cursor.py # incremental ingest cursors core/digest.py # Tier1 -> Tier2 promotion + outcome heuristic core/retention.py # budget-based eviction sweep ingest.py # one sweep: discover -> normalize -> store -> digest -> evict + detect/signals.py # signal extractors over digests + detect/cluster.py # cluster signals -> candidate patterns + cross-flavor flag + detect/__main__.py # python -m session_memory.detect (ranked report) config.toml # store paths, retention caps, sources, repo->domain map ``` @@ -51,6 +57,20 @@ the sweep *runs*. Trigger it with the repo scheduler, e.g. daily: or a cron entry / `/loop` on a timer. Push-capture (agent Stop/SessionEnd hooks) can also enqueue a sweep; see design §7. +## Detect candidate patterns + +After ingesting, mine the digests for recurring problem/success patterns: + +```bash +python -m session_memory.detect # ranked report, cross-flavor first +python -m session_memory.detect --json # machine-readable candidates +python -m session_memory.detect --min-frequency 3 +``` + +Candidates are persisted to a Tier 2 `patterns` table and are the input to the +Curate phase (Phase 2). Patterns whose evidence spans more than one agent flavor +are flagged `[CROSS-FLAVOR]` — the highest-value reuse targets. + ## Retention knobs (`[retention]` in config.toml) | Key | Meaning | @@ -71,5 +91,9 @@ python -m pytest # 26 tests: schema, adapter, store, digest, retention, ## Status -Phase 0 (AGENTIC-WP-0002): Claude adapter only, end to end. Codex and Grok -adapters are designed (schemas confirmed in the design doc) and land in Phase 1. +- **Phase 0** (AGENTIC-WP-0002): schema, store, digest, budget retention, Claude + adapter, ingest sweep. +- **Phase 1** (AGENTIC-WP-0003): Codex + Grok adapters, multi-file session merge, + and the Detect pipeline (signals → clustering → cross-flavor candidate patterns). +- **Next — Phase 2 (Curate):** review/approve candidates into a versioned pattern + catalog. **Phase 3 (Distribute) / Phase 4 (Measure)** follow per the PRD. diff --git a/workplans/AGENTIC-WP-0003-session-memory-phase1.md b/workplans/AGENTIC-WP-0003-session-memory-phase1.md index 1ccfbfd..2984c90 100644 --- a/workplans/AGENTIC-WP-0003-session-memory-phase1.md +++ b/workplans/AGENTIC-WP-0003-session-memory-phase1.md @@ -4,7 +4,7 @@ type: workplan title: "Coding Session Memory — Phase 1 (Codex + Grok adapters, Detect)" domain: helix_forge repo: agentic-resources -status: active +status: finished owner: codex topic_slug: helix-forge created: "2026-06-06" @@ -145,7 +145,7 @@ session_memory README. ```task id: AGENTIC-WP-0003-T08 -status: todo +status: done priority: medium state_hub_task_id: "b272c3fa-af81-4a6c-9ed9-7b42173efa81" ``` @@ -161,3 +161,9 @@ questions. After workplan file updates, notify the custodian operator to run fro ```bash make fix-consistency REPO=agentic-resources ``` + +**Verification results (2026-06-06):** full suite 40/40 green. Live pipeline over +real local sessions (Codex not installed → fixtures): ingested 88 → 67 digests +(63 Claude + 4 Grok); detect surfaced 3 candidate patterns, **2 cross-flavor** +(Claude+Grok) — "clean pass" success across 18 sessions and "abandoned" problem +across 13 — plus a Claude-only budget-overrun. PRD cross-flavor success metric met.