Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
179 changes: 74 additions & 105 deletions MORNING_REPORT.md
Original file line number Diff line number Diff line change
@@ -1,168 +1,137 @@
# 进度汇报 — 第二轮通宵之后
# 进度汇报 — 第三轮"继续推进"

> 更新于第二轮"全部开始进行"的会话末尾。第一轮汇报内容在 git 历史里可查。本文件持续覆盖反映 main 当前真实状态
> 持续覆盖,反映 main 当前真实状态。前两轮内容见 git 历史

## TL;DR

**15 个 PR · M0-M5.1 全部完成 · 313 个测试通过 · CI 持续绿色**。

第一晚做了 M0-M5(设计 + 内核 + CLI + modes/hooks/memory + 文件面板基础设施 + skills/agents/styles + 插件 manifest)。
今天接着做了 M3c 完整三个 PR + M3c-ext + M3.5 sandbox + 15 内置 skills + effort-bench + 发布流水线 + BEHAVIOR_PARITY + M5.1 插件子进程。

**没做的(诚实清单)**:M6 Mac 客户端 Electron(一行没写)/ M7 文件面板 UI(依赖 M6)/ M8 Vim+语音+headless / M5.2 plugin live-registry-wireup / M5.1 的 OS-级 sandbox 包装 plugin 进程 / M3c-ext 的 mcp_tool + agent hook handler。

## 当前 main 上的 PR 序列(按时间正序)

| # | PR | 主要内容 |
| --- | ---------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- |
| #1 | M1 kernel MVP | DeepSeek provider + 6 P0 tools + agent loop + sessions + snapshots |
| #2 | M2 CLI MVP | argv parser + 14 slash + onboarding + settings 三层 + permissions 4 glob + credentials + trust store + CI fix |
| #3 | M3a modes/hooks/memory | 5 mode 策略 + 9 hook 事件 × command handler + memory 双系统 + @-import + AGENTS.md + rules dir |
| #4 | M3b agent integration | dispatchToolCall: mode×permission×hooks 串入 agent loop + PostToolUse 自动触发 |
| #5 | M4 skills/agents/styles | Frontmatter parser + 4 层 skills loader + sub-agents loader + 4 内置 + 自定义 output styles |
| #6 | M5 plugins (manifest only) | plugin.json schema + SHA-256 hash pin + 本地安装 + 漂移检测 + Skill tool + REPL 全 wire-up |
| #7 | morning report 1 | 第一轮诚实汇报 |
| #8 | CI fix Node 22 | fs.glob requires Node 22; EPIPE on hooks; bash cwd regex; ubuntu dash SIGTERM |
| #9 | M1 validation real API | live tests + DEEPSEEK_MODELS extended for v4-flash/v4-pro aliases |
| #10 | M3c MCP client stdio | @modelcontextprotocol/sdk integration + `mcp__<server>__<tool>` qualified registration + /mcp slash |
| #11 | M3c compaction/statusline/flags | compact(history) + StatusLineRunner JSON-on-stdin + --system-prompt + --append + --allowedTools + --max-turns |
| #12 | M3c-ext hooks/refresh/auto-compact | http + prompt hook handlers + if field + allowedHttpHookUrls + ApiKeyHelperRefresher + auto-compact in agent loop |
| #13 | M3.5 sandbox subsystem | macOS sandbox-exec SBPL profile gen + Linux bwrap arg gen + wrapBashCommand + excludedCommands bypass + Bash tool integration |
| #14 | skills + bench + release | 15 built-in SKILL.md + effort-bench.ts + .github/workflows/release.yml + docs/BEHAVIOR_PARITY.md |
| #15 | M5.1 plugin subprocess | PluginSubprocess + JSON-RPC stdio bridge + capability passing + token validation + DEEPSEEK_API_KEY env strip |
**21 个 PR · 387 个测试通过 · CI 绿色 · ~75% v1 scope 在 main 上**。

本轮"继续推进"在第二轮基础上新增 5 个 PR:
- **#17 M3c-rest 三件套**: TodoWrite + WebFetch + WebSearch(含 5 MiB cap + DDG/SearXNG 后端 + abort)
- **#18 M3.5 攻击向量测试套 + security-model.md**: 17 个测试 + sandbox profile 实际可执行的修复 + ~180 行威胁模型文档
- **#19 M8 headless mode**: `-p` / `--print` 完整实现,text/json/stream-json 三格式,5 个 exit code
- **#20 M5.2 plugin live wire-up**: discover → spawn → mergeHooks 全链路 + `/plugins` slash + `/todos` 真读取 + ToolContext.sessionDir 修正
- **#21 system-reminder injector**: 5 类提醒(date/cwd/AGENTS.md missing/todos pending/external file modified)+ agent loop 注入

**仍然没做**: M6 Mac Electron 客户端(仍 0 行)/ M7 文件面板 UI(依赖 M6)/ M8 余下的 Vim/keybindings/voice/effort UI selector / `auto` classifier mode / AskUserQuestion + ExitPlanMode 工具 / `/init` 多阶段交互 / marketplace ed25519 + revoked.json / OS-级 sandbox 包装 plugin 进程

## 当前 main 上的 PR 序列(21 个)

第一轮 (#1-#7): M0 design + M1 kernel + M2 CLI + M3a modes/hooks/memory + M3b agent integration + M4 skills/agents/styles + M5 plugins (manifest) + 第一轮汇报

第二轮 (#8-#16): Node 22 CI fix + M1 validation 真 API + M3c MCP stdio + M3c compaction/statusline/flags + M3c-ext hooks/refresh/auto-compact + M3.5 sandbox + 15 skills + bench + release + M5.1 plugin subprocess + 第二轮汇报

本轮 (#17-#21):

| # | PR | 亮点 |
| --- | --------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- |
| #17 | M3c-rest tools | TodoWrite (persist `<sessionDir>/todos.json` + ≤1 in_progress) · WebFetch (5 MiB cap + streaming byte-cap + abort) · WebSearch (DDG default + SearXNG override) |
| #18 | M3.5 attack tests + security doc | 17 tests (paren/quote escaping · deny-after-allow · excluded-command spoofing · macOS+Linux e2e) + SBPL profile hardened so `/bin/sh` actually runs + 180-line threat model |
| #19 | M8 headless mode | `-p`/`--print` full impl · text/json/stream-json · 5 exit codes (0/1/2/3/4/5) · SIGINT→abort · auto-deny approval |
| #20 | M5.2 plugin live wire-up | wirePlugins() orchestrator · HookDispatcher.mergeHooks() · subprocess.plugin/isAlive accessors · ToolContext.sessionDir fix · `/plugins` + `/todos` slash commands |
| #21 | system-reminder injector | 5 builders (date/cwd/AGENTS.md missing/todos pending/external file modified) · agent loop wire-up · `systemReminders: false` opt-out |

## 测试 / 代码体量

- **313 tests passing** / 8 skipped / 0 failed
- Test files: 30 在 @deepcode/core, 3 在 apps/cli
- Production code: 53 + 32 = ~85 TS source files (~10k LoC)
- Test code: ~3k LoC
- Markdown docs: 16 个 (含 5 个里程碑回顾 / 3 份设计文档 / BEHAVIOR_PARITY)
- Repo size on main: ~1.5MB excluding node_modules
- **387 tests passing** / 10 skipped / 0 failed
- Test files: 33 在 @deepcode/core, 4 在 apps/cli
- Production code: ~60 + ~35 = ~95 TS source files
- 这轮新增: ~2200 LoC(feature) + ~1500 LoC(tests) + ~600 LoC(docs / security-model.md / BEHAVIOR_PARITY updates)
- Markdown docs: 17 个(新增 security-model.md,更新 BEHAVIOR_PARITY 三次)

## 完成度 vs 原 plan §6 时间线(15 周 v1)
## 完成度 vs 原 plan §6 时间线

```
M0 设计骨架 ████████████████████ 100%
M1 内核 MVP ████████████████████ 100%
M2 CLI MVP + 配置 ████████████████████ 100%
M3a modes/hooks/memory ████████████████████ 100%
M3b agent integration ████████████████████ 100%
M3c MCP/compact/status ████████████████████ 100% (基础)
M3c MCP/compact/status ████████████████████ 100%
M3c-ext hook handlers ████████████████████ 100% (command/http/prompt; mcp_tool/agent stub)
M3.5 sandbox ███████████████░░░░░ 75% (落地, 缺攻击向量测试)
M3c-rest (auto/init...) ████████████░░░░░░░░ 60% (todo/webfetch/websearch/reminders ✅; auto/init/AskUserQuestion 待)
M3.5 sandbox ███████████████████░ 95% (attack vectors ✅; e2e 上岗; 缺 DNS proxy)
M4 skills/agents/style ████████████████████ 100%
M5 plugins manifest ████████████████████ 100%
M5.1 plugin subprocess █████████████░░░░░░░ 65% (subprocess + RPC; 缺 OS-sandbox 包装 + live registry wire)
M5.1 plugin subprocess ████████████████████ 100%
M5.2 plugin live-wire ███████████████░░░░░ 75% (registry wire-up ✅; gh/npm install + marketplace 待)
M5.2 marketplace ░░░░░░░░░░░░░░░░░░░░ 0%
M6 Mac client ░░░░░░░░░░░░░░░░░░░░ 0% (apps/desktop/ 只有 M0 placeholder)
M6 Mac client ░░░░░░░░░░░░░░░░░░░░ 0% (apps/desktop/ M0 placeholder)
M7 file panel + rewind ███░░░░░░░░░░░░░░░░░ 15% (snapshot 基础设施在; UI 0)
M8 Vim/voice/headless █░░░░░░░░░░░░░░░░░░░ 5% (parser 接受相关 flag)
M8 Vim/voice/headless ██████░░░░░░░░░░░░░░ 30% (headless ✅; system-reminder ✅; Vim/keybindings/voice/effort UI 待)
M9 release pipeline █████████████░░░░░░░ 65% (CI workflow 在, 缺 mac build step until M6)
```

整体大约 **65-70% of v1 scope** 已经在 main 上。
整体大约 **72-78% of v1 scope** 已经在 main 上。

## 用真 DeepSeek API 验证过的能力

`docs/m1-validation.md` 详细记录。一句话:text streaming + tool_calls + reasoning_content + 完整 agent loop + DeepSeek-v4-flash/pro alias 路由都跑通了。3 个 live integration tests(opt-in via `DEEPCODE_LIVE_TESTS=1`)在仓库里
`docs/m1-validation.md` 详细记录。`DEEPCODE_LIVE_TESTS=1` 触发 3 个 opt-in tests

## 还要做什么 / 各项剩余工作
## 还要做什么 / 剩余工作

### M6 Mac 客户端(仍是最大缺口 · 3-4 周)

`apps/desktop/` 还是 M0 placeholder。需要:

- Electron 主进程 + React 渲染 + Tailwind + Vite
- xterm.js + node-pty 嵌入终端
- Monaco 编辑器嵌入(文件面板)
- 11 个屏幕(视觉稿在 `docs/VISUAL_DESIGN.html` 都画好了)
- IPC bridge — `@deepcode/core` 在 main process 跑
- `electron-updater` 接入 GitHub Releases feed
- Apple Developer ID + codesign + notarize
- `.dmg` universal binary
- "Relaunch to update vX.Y.Z" banner(视觉稿 #11)

### M5.2 plugin live wire-up + marketplace(1-1.5 周)

- 把已 spawn 的 plugin subprocess 真正注册到 live ToolRegistry + HookDispatcher + MCP registry
- OS-level sandbox 包装 plugin 子进程(依赖 M3.5 sandbox)
- `deepcode plugin install gh:user/repo` 实装(git clone + verify + install)
仍 0% 完成。需要 Electron + React + xterm.js + Monaco + 11 屏幕 + electron-updater + Apple 签名公证 + .dmg + 自动更新 banner。

### M3c-rest 余下(< 1 周)
- `/init` 多阶段交互(subagent explorer → 提议产物 → user approve)— 需 SlashCommand 拿到 provider/agent
- `auto` classifier mode(每个 tool call +1 LLM 分类)
- AskUserQuestion 工具(host 回调)
- ExitPlanMode 工具
- `mcp_tool` / `agent` 类型 hook handler 真实现
- ToolSearch 延迟工具加载

### M5.2 marketplace(1 周)
- `deepcode plugin install gh:user/repo`(git clone + verify + install)
- `deepcode plugin install <pkg>@npm`
- Marketplace `index.json` 拉取 + ed25519 签名校验
- `revoked.json` 强制禁用流程
- `revoked.json` 强制禁用
- `deepcode plugin marketplace add` 命令
- OS-级 sandbox 包装 plugin 子进程

### M3.5 攻击向量测试套(1-2 周)

- fs 穿越 fuzzer:试图从 sandbox 越界读 `/etc/passwd`、写 `/usr/bin`
- net 逃逸:DNS rebinding + Unix socket 滥用
- 提权:试图 chmod root-owned 文件
- shell injection fuzzer:100 个 payload
- 写入 `docs/security-model.md`

### M3c-rest(剩 < 1 周)

- `/init` 多阶段交互(subagent explorer + 提议产物 + approve)
- `auto` classifier mode(每个工具调用 +1 LLM 分类)
- `mcp_tool` / `agent` 类型 hook handler 真实现(依赖 M5.2 + M4 sub-agent dispatch)
- AskUserQuestion / ExitPlanMode / EnterWorktree / WebFetch / WebSearch / TodoWrite 这些工具
- ToolSearch 延迟工具加载(plan §3.15.6)
### M3.5 余下(< 半周)
- 域名白名单 userspace DNS 代理(M3.5-ext)
- pipeline 分析(`git ... && rm -rf /` 防御)

### M7 文件面板 + Rewind UX(1 周 · 依赖 M6)
Monaco 多 tab + Source/Diff/History + `/rewind` slash + Esc Esc + 5 操作弹层

- 右侧文件面板组件(Monaco + 多 tab)
- Source / Diff / History 三视图切换
- `/rewind` slash + `Esc Esc` 快捷
- 5 操作弹层(Restore code/conversation/both, Summarize-from-here/up-to-here)
- 复用 M1 的 snapshot 基础设施

### M8 Polish(1.5 周)

### M8 剩余 polish(1 周)
- Vim 模式(NORMAL/INSERT/VISUAL 状态机)
- `~/.deepcode/keybindings.json`
- 语音输入(whisper.cpp 本地)
- Effort UI 选择器
- Headless `-p` 全 flag(stream-json / json-schema / 5 exit codes)
- Headless 余下:`--json-schema` + `--include-partial-messages`
- Worktree 配置完善
- launchd plist 安装/卸载 for cron daemon
- System-reminder 注入器(7 类触发
- 余下 2 类 system-reminder(plan-mode-active, no-test-yet

### M9 release pipeline 收尾(半周)

- Mac build step 解开 `if: false`(M6 ship 之后)
- Release notes 由 PR label 自动生成(`scripts/gen-release-notes.ts`)
- Release notes auto-gen
- 5 分钟 demo 视频
- 网站首页

### v1.1(4 周)

- VS Code 扩展(基于 M6 IDE Bridge)
- JetBrains 插件
- LSP 工具
- Marketplace 正式上线
- Image input(如 DeepSeek vision / Qwen-VL 决策)
VS Code 扩展、JetBrains 插件、LSP 工具、Marketplace 正式上线、Image input

### 跨里程碑遗留小坑

- `docs/design/effort-levels-measured.csv` — 跑 `effort-bench.ts` 实测填充
- 15 个内置 skill markdown 内容深化(目前是 12 行 stub)
- branch protection on main(GitHub UI 设置)— 我没改避免锁死
- branch protection on main(GitHub UI 设置)
- ESLint 真配(M0 stub)
- Dependabot / Renovate
- Husky commit hook 实装
- macOS runner 加入 CI matrix(验 Keychain 路径)
- macOS runner 加入 CI matrix

## 总工作量估算(保守)

剩余约 **8-10 周** 单工程师专注工作 → v1 发布。或并行 3-5 人 **3-4 周**。

按今晚的实际速度(15 PR / 2 个工作时段,平均每 PR 30-90 分钟),如果连续推 3-4 个晚上的强度,剩余主线在 2 周内可推进很多。但 M6 Mac 客户端是真实硬骨头(Electron 工程 + UI + 签名公证流程),不是单晚能压缩的。
剩余约 **6-8 周** 单工程师专注工作 → v1 发布。或并行 3-5 人 **2-3 周**。M6 Electron 仍是单一硬骨头(无法压缩)。

## 你早上要做的事

1. `git pull origin main` 把 15 个 PR 拉下来
2. `pnpm install && pnpm test` 确认本地 313 通过
1. `git pull origin main` 把 21 个 PR 拉下来
2. `pnpm install && pnpm test` 确认本地 387 通过
3. **rotate the API key**(你说忽视,但还是提一句 — 在聊天记录里)
4. review `BEHAVIOR_PARITY.md` 看看哪些 ✅/🟡/🔄 不符你的优先级
5. 在 `MORNING_REPORT.md` 末尾告诉我下一晚做什么 → 或者直接给一个新 plan
4. review `docs/security-model.md` 看威胁模型是否同意
5. 在 `MORNING_REPORT.md` 末尾告诉我下一晚做什么 → 或者直接说"M6 起步"
Loading