What problem does it solve?
Tool-failure observations accumulate in an append-only lessons inbox (.moai/lessons-inbox.jsonl) with no mechanical process to consume them, so recurring failure patterns drown in Bash timeout and sandbox noise and never become actionable improvements.
Core Features & Use Cases
- Companion-offset drain: Reads new stubs from a persistent offset without mutating the append-only inbox, filtering out Bash timeout/sandbox noise before clustering.
- Event-key clustering with importance scoring: Groups survivors by event_key, discards singletons, and assigns a 1-10 Generative-Agents-style importance score, staging candidates in clusters.json.
- Session-start wrapper and reflection: session_drain.sh adds locking, archive-before-overwrite, and fail-open behavior; reflect.sh consolidates accumulated feedback topics into archived principles.
- Use Case: On each session start, drain the accumulated failure inbox, archive prior candidates, and surface clustered recurring failures (e.g., repeated Agent:UnknownFailure) as shadow proposals for later approval.
Quick Start
Run the session drain wrapper against the lessons inbox to cluster new failure stubs into staged candidates in the LSEL state directory.