session-memory Phase 1: Detect pipeline (T04-T07)

- detect/signals.py: pure extractors over digests (retry storm, repeated
  errors, budget overrun vs corpus p90, abandoned, clean pass, recovery)
- detect/cluster.py: deterministic clustering into candidate Patterns with
  evidence (sessions/repos/flavors/cost impact) + cross-flavor flagging
- detect/__main__.py: python -m session_memory.detect, ranked report
  (cross-flavor first) + --json; persists candidates to Tier 2 patterns table
- core/store.py: list_digests + save_patterns
- tests for signals, cluster, detect entrypoint

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-06-06 22:31:13 +02:00
parent 06767ef924
commit 436a96dcd8
9 changed files with 436 additions and 4 deletions

View File

@@ -84,7 +84,7 @@ identity. Verify event counts are additive and idempotent on re-run.
```task
id: AGENTIC-WP-0003-T04
status: todo
status: done
priority: high
state_hub_task_id: "20920c5d-16f7-43bb-9ed7-9afbfeaf7207"
```
@@ -100,7 +100,7 @@ digests; no new capture. Unit-tested on synthetic sessions.
```task
id: AGENTIC-WP-0003-T05
status: todo
status: done
priority: high
state_hub_task_id: "f42d57f6-34dc-4a92-bf6a-4d8eab572467"
```
@@ -115,7 +115,7 @@ frequency and member session lists.
```task
id: AGENTIC-WP-0003-T06
status: todo
status: done
priority: medium
state_hub_task_id: "8fd502d6-d138-4a42-acd5-6f5921859605"
```
@@ -130,7 +130,7 @@ reuse targets. Persist candidates to a Tier 2 `patterns` store/table.
```task
id: AGENTIC-WP-0003-T07
status: todo
status: done
priority: medium
state_hub_task_id: "34a96d5d-9165-4761-b91e-3643b0401410"
```