Add digest command to email processor

Read-only summary of recent decisions, grouped by action with
[auto]/[user] markers. Supports --recent N for multi-day lookback.
This commit is contained in:
Yanxin Lu
2026-03-13 11:17:43 -07:00
parent 3c54098b1d
commit 36143fcd93
5 changed files with 97 additions and 3 deletions

View File

@@ -60,6 +60,7 @@ The system separates **classification** (what the LLM does) from **confidence**
- **Repeat senders** with consistent tag signatures reach 85%+ confidence and get auto-acted during `scan`. They never touch the pending queue.
- **New or ambiguous senders** start at 50% and get queued.
- **You occasionally run `review list`** to handle stragglers — each decision further builds history.
- **`digest` gives a quick glance** at what was processed recently — subject lines grouped by action, with `[auto]`/`[user]` markers.
- **`stats` shows your automation rate** climbing over time.
### Confidence Computation
@@ -96,6 +97,10 @@ chmod +x email-processor.sh
./email-processor.sh review all delete # delete all pending
./email-processor.sh review accept # accept all suggestions
# --- Digest ---
./email-processor.sh digest # today's processed emails
./email-processor.sh digest --recent 3 # last 3 days
# --- Other ---
./email-processor.sh stats # show decision history
```
@@ -244,13 +249,16 @@ ollama list # should show kamekichi128/qwen3-4b-instruct-2507:latest
# 7. Check that the decision was recorded
./email-processor.sh stats
# 8. Quick glance at what was processed today
./email-processor.sh digest
```
## File Structure
```
email_processor/
main.py # Entry point — scan/review/stats subcommands
main.py # Entry point — scan/review/stats/digest subcommands
classifier.py # LLM prompt builder + response parser, tag taxonomy
decision_store.py # Decision history, confidence computation, few-shot retrieval
config.json # Ollama + automation settings