Skip to main content

spool/distill/
mod.rs

1//! Distillation pipeline shared between Stop / PreCompact hooks and
2//! the upcoming MCP `memory_distill_pending` tool (R4).
3//!
4//! ## Module layout
5//! - [`redact`] — secrets pattern matching + replacement (runs before
6//!   any payload is shown to the user, written to ledger, or sent to
7//!   `sampling/createMessage`)
8//! - [`transcript`] — Claude Code session transcript JSONL parser
9//!   (`~/.claude/projects/<sanitized-cwd>/<session-id>.jsonl`)
10//! - [`heuristic`] — Tier 1 heuristics (R3b):
11//!   - `self_tag` — explicit self-tags ("记一下", "decide", "from now
12//!     on") → `accepted` records
13//!   - `extraction` — repeated patterns / corrected mistakes →
14//!     `candidate` records
15//!
16//! Tier 2 (R4) lives outside this module: it goes through the MCP
17//! sampling reverse-call, not local code.
18
19pub mod heuristic;
20pub mod pipeline;
21pub mod redact;
22pub mod transcript;