A model reads an agent's session once it has been quiet for 30 minutes
and writes down what will hold beyond it: a stated preference, a rule
from a correction, a project fact the code doesn't say. Each one waits
in memory as a candidate (To review), with the session, folder and the
user's words it came from; nothing reaches an agent until kept.
- Off until switched on (distill.json); switched on, it looks back 7 days.
- Main sessions only: no subagents, gateway-only or read-only sessions,
none of its own (agent "memory"), and two user turns at least.
- At most 10 sessions a run, the latest first; a session is read again
only once it goes on. A model that fails stops the run and says why;
the sessions not read are read next time.
- The model is sent user and assistant text alone (no thinking, tool
calls or results), cut to 24k characters (start and end), with the
memories already known so they aren't proposed again. Its
instructions name neither the app nor a vendor.
- A distilled memory the user deleted isn't proposed again (2e0058330).
- An unreadable distill.json is never written over, and nothing runs.
Not wired to the gateway or the GUI yet (next commit).
Run: mote-run go test ./internal/memdistill (ok), go vet (ok).
Broken by hand, each red then green restored: the quiet check
(ReadsQuietSessionsOnce), the read-once mark (three tests), the
text-only filter (WhatIsSent), the on switch (OffReadsNothing), skipping
gateway-only/own sessions (ReadsQuietSessionsOnce).
Not tried: a real model; that comes with the wiring.