session-memory Phase 1: T08 verify across all three flavors + docs

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 <noreply@anthropic.com>
This commit is contained in:
2026-06-06 23:39:37 +02:00
parent 436a96dcd8
commit 055713aa4f
2 changed files with 36 additions and 6 deletions

View File

@@ -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.

View File

@@ -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.