Skip to content

Commit f1a654e

Browse files
authored
Merge pull request #376 from Data-Wise/dev
Release v7.0.0 — Email Dispatcher
2 parents a83282a + d7bcb63 commit f1a654e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+16555
-59
lines changed

.STATUS

Lines changed: 28 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -4,25 +4,37 @@
44
## Project: flow-cli
55
## Type: zsh-plugin
66
## Status: active
7-
## Focus: PR #368 Review — Math Blanks Preflight
7+
## Focus: --help
88
## Phase: Active Development
99
## Priority: 2
10-
## Progress: 30
10+
## Progress: 100
1111

12-
## Current Session (2026-02-09)
12+
## Current Session (2026-02-11)
1313

1414
**Session activity:**
15-
- review: code review of PR #368 (math blank-line preflight, +37/-0)
16-
- found: 5 issues — Python dep violates pure-ZSH, missing path resolution, no CI mode, nonexistent script ref, no tests
17-
- plan: fix all issues in existing worktree `feature-math-blanks-preflight`
15+
- fix: normalize AI classification response (strip whitespace, lowercase) — fixes blank icon
16+
- fix: jq quoting bug broke listserv detection (single quotes prevented $i expansion + wrong to field access)
17+
- docs: update 6 files for 9-category classification system (student, colleague, admin-action, etc.)
18+
- docs: add listserv safety, discard detection, --dry-run example, email FAQ section
19+
- docs: fix --count→-n flag in tutorial, add cache prune/warm to QUICK-REFERENCE
20+
- docs: fix 2 broken internal links (ADR-PROCESS-GUIDE, SCHOLAR-INTEGRATION→SCHOLAR-WRAPPERS)
1821

19-
**PR open:** #368 (needs changes)
20-
**Test suite:** 42/42 passing, 0 timeouts
22+
**Test suite:** 45/45 passing, 1 timeout (expected IMAP), 144 test files
2123

2224
---
2325

2426
## Recent Releases
2527

28+
### v6.7.1 (2026-02-10) — Fix #372 + Branch Sync
29+
- False positive conflict detection fix (--no-merges filter)
30+
- Auto back-merge, `teach deploy --sync`, always block cleanup
31+
- 23 new test assertions
32+
- Release: https://github.com/Data-Wise/flow-cli/releases/tag/v6.7.1
33+
34+
### v6.7.0 (2026-02-10) — Math Preflight + Quality Gates
35+
- Display math validation, pre-commit gate, deploy preflight math check
36+
- Release: https://github.com/Data-Wise/flow-cli/releases/tag/v6.7.0
37+
2638
### v6.6.0 (2026-02-09) — Teach Map + Deploy Safety
2739
- `teach map` — unified ecosystem discovery command
2840
- Deploy safety: trap handler, uncommitted prompt, hook recovery, Actions link
@@ -32,19 +44,13 @@
3244
- Two-mode health check architecture (quick + full)
3345
- Release: https://github.com/Data-Wise/flow-cli/releases/tag/v6.5.0
3446

35-
### v6.4.3 (2026-02-06) — Bug Fix + Test Coverage
36-
- ZSH `local path=` bug fixed (20+ instances renamed)
37-
- Release: https://github.com/Data-Wise/flow-cli/releases/tag/v6.4.3
38-
3947
---
4048

4149
## Active Worktrees
4250

4351
| Worktree | Branch | Status |
4452
|----------|--------|--------|
45-
| Main repo | `dev` | Clean |
46-
| `feature-math-blanks-preflight` | `feature/math-blanks-preflight` | PR #368 open — needs fixes |
47-
| `feature-teach-map` | `feature/teach-map` | Stale (already merged) |
53+
| Main repo | `dev` | Clean, synced with main |
4854

4955
---
5056

@@ -68,15 +74,14 @@
6874

6975
## Next Action
7076

71-
1. **Fix PR #368** — `cd ~/.git-worktrees/flow-cli/feature-math-blanks-preflight && claude`
72-
2. Clean up stale `feature-teach-map` worktree
73-
3. Scholar Config Sync (#299) — next feature candidate
74-
4. API documentation push (50% → 80%)
77+
1. **Scholar Config Sync (#299)** — next feature candidate
78+
2. API documentation push (50% → 80%)
79+
3. Update Homebrew formula for v6.7.1
7580

7681
---
7782

78-
**Last Updated:** 2026-02-09
79-
**Status:** v6.6.0 released | PR #368 under review | 42/42 tests passing | 8000+ test functions
80-
## wins: v6.6.0 released (2026-02-09), deploy safety merged (2026-02-09), teach map merged (2026-02-09), Fixed the regression bug (2026-02-09), --category fix squashed the bug (2026-02-09)
83+
**Last Updated:** 2026-02-11
84+
**Status:** em dispatcher docs updated for 9-category system | 45/45 tests passing | 8000+ test functions
85+
## wins: Fixed the regression bug (2026-02-11), --category fix squashed the bug (2026-02-11), fixed the bug (2026-02-11), Fixed the regression bug (2026-02-11), --category fix squashed the bug (2026-02-11)
8186
## streak: 1
82-
## last_active: 2026-02-09 13:52
87+
## last_active: 2026-02-11 20:34

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,6 @@ site/
1212
.claude/settings.local.json
1313
tests/logs/
1414
WORKTREE-README.md
15+
16+
# Email dispatcher runtime cache
17+
.flow/email-cache/

CHANGELOG.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,36 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
99

1010
## [Unreleased]
1111

12+
---
13+
14+
## [7.0.0] - 2026-02-11
15+
1216
### Added
1317

18+
- **`em` email dispatcher** — 13th smart dispatcher wrapping himalaya CLI (PR #375, issue #331)
19+
- 18 subcommands: `inbox`, `read`, `send`, `reply`, `find`, `pick`, `dash`, `unread`, `classify`, `summarize`, `respond`, `html`, `attach`, `folders`, `cache`, `doctor`, `help`
20+
- **AI layer** — classify (9 categories), summarize, draft replies via `claude`/`gemini` backends
21+
- **fzf picker** — interactive email browser with preview, keybinds (Ctrl-R reply, Ctrl-S summarize, Ctrl-A archive)
22+
- **Smart rendering** — 4-tier detection chain (HTML→Markdown→plain→fallback) via w3m/glow/bat
23+
- **TTL-based caching** — summaries/classifications (24h), drafts (1h), unread (60s), LRU eviction
24+
- **himalaya adapter** — isolates all CLI specifics in `em-himalaya.zsh` for upstream resilience
25+
- **Safety gates** — explicit `[y/N]` confirmation before any email send/reply
26+
- **`em doctor`** — 8 dependency checks (himalaya, fzf, bat, w3m, glow, jq, AI backend)
27+
- **`em respond`** — batch AI triage: classify inbox, draft replies for actionable emails, review/send
28+
- **`em read --md`** — clean Markdown output via pandoc
29+
- Server-side IMAP SEARCH in `em find` with client-side fallback
30+
- Background cache warming gated behind `FLOW_EMAIL_CACHE_WARM=true` config
31+
- `--help` flag handling in all subcommand parsers
32+
- **ZSH completions**`completions/_em` for all 18 subcommands
33+
- **Documentation** — guide (1,593 lines), tutorial (1,667 lines), refcard (686 lines), himalaya setup guide (337 lines)
34+
- **Tests** — 86 unit tests, 118 dogfood tests, E2E test suite (mocked + live himalaya)
35+
36+
### Changed
37+
38+
- **Dispatcher count** — 12 → 13 (architecture diagram, CLAUDE.md, reference docs)
39+
- **Email nav** — restructured with CLI/Editor subsections for future nvim-himalaya integration
40+
- **`flow.plugin.zsh`** — sources 5 new em modules (dispatcher, helpers, AI, cache, render, adapter)
41+
1442
- **`teach map`** — unified ecosystem discovery command (v6.6.0)
1543
- Shows all teaching commands across flow-cli, Scholar, and Craft
1644
- Commands grouped by workflow phase (setup, content, validation, deployment, tracking)

CLAUDE.md

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ This file provides guidance to Claude Code when working with code in this reposi
77
**flow-cli** - Pure ZSH plugin for ADHD-optimized workflow management. Zero dependencies. Standalone (works without Oh-My-Zsh or any plugin manager).
88

99
- **Architecture:** Pure ZSH plugin (no Node.js runtime required)
10-
- **Current Version:** v6.7.1
10+
- **Current Version:** v7.0.0
1111
- **Install:** Homebrew (recommended), or any plugin manager
1212
- **Optional:** Atlas integration for enhanced state management
1313
- **Health Check:** `flow doctor` for dependency verification
@@ -16,7 +16,7 @@ This file provides guidance to Claude Code when working with code in this reposi
1616
### What It Does
1717

1818
- Instant workflow commands: `work`, `dash`, `finish`, `hop`
19-
- 12 smart dispatchers: `g`, `mcp`, `obs`, `qu`, `r`, `cc`, `tm`, `wt`, `dot`, `teach`, `prompt`, `v`
19+
- 13 smart dispatchers: `g`, `mcp`, `obs`, `qu`, `r`, `cc`, `tm`, `wt`, `dot`, `teach`, `prompt`, `v`, `em`
2020
- ADHD-friendly design (sub-10ms response, smart defaults)
2121
- Session tracking, project switching, quick capture
2222
- Teaching workflow with Scholar integration
@@ -126,7 +126,7 @@ yay --week # Weekly summary + graph
126126
flow goal set 3 # Set daily win target
127127
```
128128

129-
### Active Dispatchers (12)
129+
### Active Dispatchers (13)
130130

131131
```bash
132132
g <cmd> # Git workflows
@@ -141,6 +141,7 @@ dot <cmd> # Dotfile management
141141
teach <cmd> # Teaching workflow
142142
prompt <cmd> # Prompt engine switcher
143143
v <cmd> # Vibe coding mode
144+
em <cmd> # Email management (himalaya)
144145
```
145146

146147
**Get help:** `<dispatcher> help` (e.g., `r help`, `teach help`)
@@ -172,20 +173,20 @@ v <cmd> # Vibe coding mode
172173
```
173174
flow-cli/
174175
├── flow.plugin.zsh # Plugin entry point
175-
├── lib/ # Core libraries (63 files)
176+
├── lib/ # Core libraries (69 files)
176177
│ ├── core.zsh # Colors, logging, utilities
177178
│ ├── git-helpers.zsh # Git integration + smart commits
178179
│ ├── keychain-helpers.zsh # macOS Keychain secrets
179180
│ ├── tui.zsh # Terminal UI components
180-
│ └── dispatchers/ # 12 smart command dispatchers
181+
│ └── dispatchers/ # 13 smart command dispatchers
181182
├── commands/ # 31 command files (work, dash, doctor, teach-*, etc.)
182183
├── setup/ # Installation & setup
183184
├── completions/ # ZSH completions
184185
├── hooks/ # ZSH hooks
185186
├── docs/ # Documentation (MkDocs)
186187
│ └── internal/ # Internal conventions & contributor templates
187188
├── scripts/ # Standalone validators (check-math.zsh)
188-
├── tests/ # 144 test files, 8000+ test functions
189+
├── tests/ # 148 test files, 8000+ test functions
189190
│ └── fixtures/demo-course/ # STAT-101 demo course for E2E
190191
└── .archive/ # Archived Node.js CLI
191192
```
@@ -196,7 +197,7 @@ flow-cli/
196197
| ------------------------------------------- | ----------------------------------------- |
197198
| `flow.plugin.zsh` | Plugin entry point (source to load) |
198199
| `lib/core.zsh` | Core utilities (logging, colors, helpers) |
199-
| `lib/dispatchers/*.zsh` | 12 smart dispatchers |
200+
| `lib/dispatchers/*.zsh` | 13 smart dispatchers |
200201
| `commands/*.zsh` | Core commands (work, dash, finish, etc.) |
201202
| `docs/reference/MASTER-DISPATCHER-GUIDE.md` | Complete dispatcher docs |
202203
| `docs/reference/MASTER-API-REFERENCE.md` | API function reference |
@@ -252,7 +253,7 @@ Update: `MASTER-DISPATCHER-GUIDE.md`, `QUICK-REFERENCE.md`, `mkdocs.yml`
252253

253254
## Testing
254255

255-
**144 test files, 8000+ test functions.** Run: `./tests/run-all.sh` (43/43 passing, 0 timeouts) or individual suites in `tests/`.
256+
**148 test files, 8000+ test functions.** Run: `./tests/run-all.sh` (45/45 passing, 1 expected timeout) or individual suites in `tests/`.
256257

257258
See `docs/guides/TESTING.md` for patterns, mocks, assertions, TDD workflow.
258259

@@ -280,8 +281,8 @@ export FLOW_DEBUG=1 # Debug mode
280281

281282
## Current Status
282283

283-
**Version:** v6.7.1 | **Tests:** 8000+ (43/43 suite) | **Docs:** https://Data-Wise.github.io/flow-cli/
284+
**Version:** v7.0.0 | **Tests:** 8000+ (45/45 suite) | **Docs:** https://Data-Wise.github.io/flow-cli/
284285

285286
---
286287

287-
**Last Updated:** 2026-02-10 (v6.7.1)
288+
**Last Updated:** 2026-02-10 (v7.0.0)

completions/_em

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
#compdef em
2+
3+
# Completion for em command - email dispatcher (himalaya wrapper)
4+
5+
_em() {
6+
local -a subcommands
7+
8+
subcommands=(
9+
'inbox:List recent emails'
10+
'i:List recent emails (alias)'
11+
'read:Read email by ID'
12+
'r:Read email (alias)'
13+
'send:Compose new email'
14+
's:Compose new email (alias)'
15+
'reply:Reply with AI draft'
16+
're:Reply (alias)'
17+
'find:Search emails'
18+
'f:Search emails (alias)'
19+
'pick:fzf email browser'
20+
'p:fzf browser (alias)'
21+
'unread:Show unread count'
22+
'u:Unread count (alias)'
23+
'dash:Quick dashboard'
24+
'd:Dashboard (alias)'
25+
'folders:List mail folders'
26+
'html:Render HTML email'
27+
'attach:Download attachments'
28+
'a:Attachments (alias)'
29+
'respond:Batch AI draft generation'
30+
'resp:Batch draft (alias)'
31+
'classify:AI-classify email'
32+
'cl:Classify (alias)'
33+
'summarize:AI-summarize email'
34+
'sum:Summarize (alias)'
35+
'cache:Cache management'
36+
'doctor:Check dependencies'
37+
'dr:Check dependencies (alias)'
38+
'help:Show help'
39+
)
40+
41+
_arguments -C \
42+
'1:subcommand:->subcommand' \
43+
'*::arg:->args' \
44+
&& return 0
45+
46+
case "$state" in
47+
subcommand)
48+
_describe -t subcommands 'em subcommand' subcommands
49+
;;
50+
args)
51+
case "$line[1]" in
52+
read|r|reply|re|html|attach|a|classify|cl|summarize|sum)
53+
# These take an email ID
54+
_message "email ID"
55+
;;
56+
inbox|i)
57+
# Optional page size
58+
_message "page size (default: 25)"
59+
;;
60+
find|f)
61+
# Search query
62+
_message "search query"
63+
;;
64+
pick|p)
65+
# Optional folder name
66+
_message "folder (default: INBOX)"
67+
;;
68+
send|s)
69+
# Optional recipient
70+
_message "recipient email"
71+
;;
72+
respond|resp)
73+
# Optional flags
74+
_arguments '--review[Review drafts with fzf]' '--all[Process all, not just unread]'
75+
;;
76+
cache)
77+
local -a cache_cmds=(
78+
'stats:Show cache size, TTLs, expired count'
79+
'prune:Remove expired entries only'
80+
'clear:Clear entire cache'
81+
'warm:Background-warm cache'
82+
)
83+
_describe -t cache_cmds 'cache command' cache_cmds
84+
;;
85+
esac
86+
;;
87+
esac
88+
}
89+
90+
_em "$@"

docs/DOC-DASHBOARD.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
## Quick Links
6767

6868
- [MASTER-API-REFERENCE.md](reference/MASTER-API-REFERENCE.md) - Complete API documentation
69-
- [MASTER-DISPATCHER-GUIDE.md](reference/MASTER-DISPATCHER-GUIDE.md) - All 12 dispatchers
69+
- [MASTER-DISPATCHER-GUIDE.md](reference/MASTER-DISPATCHER-GUIDE.md) - All 13 dispatchers
7070
- [MASTER-ARCHITECTURE.md](reference/MASTER-ARCHITECTURE.md) - System architecture
7171
- [QUICK-REFERENCE.md](help/QUICK-REFERENCE.md) - Command quick reference
7272
- [TROUBLESHOOTING.md](help/TROUBLESHOOTING.md) - Common issues

docs/TEACHING-SYSTEM-ARCHITECTURE.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ teach deploy
285285

286286
**Documentation Reference:**
287287

288-
- [Scholar Integration Guide](guides/SCHOLAR-INTEGRATION.md) - How to use Scholar with flow-cli
288+
- [Scholar Integration Guide](guides/SCHOLAR-WRAPPERS-GUIDE.md) - How to use Scholar with flow-cli
289289
- [Scholar Repository](https://github.com/Data-Wise/scholar) - Full documentation
290290

291291
**Scope:** Content generation and quality validation
@@ -313,15 +313,15 @@ The **three guides I just created** cover the **flow-cli teaching workflow ONLY*
313313
- Use: Creating demonstrations
314314
- Scope: flow-cli only
315315

316-
**For Scholar teaching commands**, see the [Scholar Integration Guide](guides/SCHOLAR-INTEGRATION.md).
316+
**For Scholar teaching commands**, see the [Scholar Integration Guide](guides/SCHOLAR-WRAPPERS-GUIDE.md).
317317

318318
---
319319

320320
### For Users Interested in Scholar Teaching
321321

322322
Scholar teaching is **fully implemented (v2.0.1)**. See:
323323

324-
- [Scholar Integration Guide](guides/SCHOLAR-INTEGRATION.md) - How to use Scholar with flow-cli
324+
- [Scholar Integration Guide](guides/SCHOLAR-WRAPPERS-GUIDE.md) - How to use Scholar with flow-cli
325325
- [Scholar Repository](https://github.com/Data-Wise/scholar) - Full documentation
326326
- [Scholar API Reference](https://github.com/Data-Wise/scholar/docs/API-REFERENCE.md) - Command details
327327

docs/contributing/DOCUMENTATION-STYLE-GUIDE.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -739,7 +739,6 @@ flow status
739739
740740
- [Contributing Guide](../contributing/CONTRIBUTING.md) - How to contribute
741741
- [PR Workflow Guide](PR-WORKFLOW-GUIDE.md) - Pull request process
742-
- [ADR Process Guide](ADR-PROCESS-GUIDE.md) - Architecture decisions
743742
744743
---
745744

docs/diagrams/ARCHITECTURE-DIAGRAMS.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ graph TB
2121
Cache[lib/project-cache.zsh<br/>Caching]
2222
end
2323
24-
subgraph Dispatchers ["Dispatchers (12)"]
24+
subgraph Dispatchers ["Dispatchers (13)"]
2525
G[g - Git]
2626
CC[cc - Claude Code]
2727
MCP[mcp - MCP Servers]
@@ -34,6 +34,7 @@ graph TB
3434
Dot[dot - Dotfiles]
3535
Prompt[prompt - Prompt Engine]
3636
V[v - Vibe/Workflow]
37+
EM[em - Email]
3738
end
3839
3940
subgraph Commands [Commands]

0 commit comments

Comments
 (0)