diff --git a/AVM-FULL-SWEEP-2026-05-13.md b/AVM-FULL-SWEEP-2026-05-13.md new file mode 100644 index 0000000..0748e08 --- /dev/null +++ b/AVM-FULL-SWEEP-2026-05-13.md @@ -0,0 +1,109 @@ +# AVM 完整功能 sweep — 2026-05-13 + +commit 8307a79;环境 darwin-arm64;视角:clean install + 每个子命令至少 1 happy + 1 error path。 + +## TL;DR + +13 个顶层命令、~30 个子命令实测。**daily path 全部跑通**,但发现 **19 个具体问题**, +其中 **3 个 P0**(含 2 个安全回归延伸 / 已在上次报告 + Codex auth.json 同样泄密), +**8 个 P1**(功能错或显式 "not implemented"),**8 个 P2**(UX / 一致性)。 + +整体测试通过率(命令级):约 70%。 + +## 测了什么 + +| 命令 / 子命令 | happy | error | 备注 | +|---|---|---|---| +| `--version` `--help` `--json` | ✅ | — | 顶层 OK | +| `init`、`init` 二次 | ✅ | — | idempotent ✓ | +| `status` `--json` | ✅ | — | 但会隐式建 `~/.avm` | +| `doctor` | ✅ | — | 同 status 隐式建 home | +| `setup` 默认 / `--runtime X` / `--no-capabilities` / `--on-conflict skip/overwrite` | ✅ | `--on-conflict bogus` ✓ | | +| `runtime list` `--json` | ✅ | — | | +| `capability list` `discover` `show ` `import` `bootstrap` | ✅ | bogus runtime / kind 缺失 ✓ | bootstrap 二次跑藏错误 | +| `agent create / list / show / show --runtime / edit / clone / rename / delete` | ✅ | dup / no-name / bogus-skill ✓ | `--runtime alien` 不校验;`show --runtime` 输出空 | +| `run --preview` 单 / 多 runtime / `--drift` / `--runtime` 覆盖 | ✅ | ghost agent / bogus drift ✓ | `--runtime` 可绕过 agent 声明的 runtime | +| `package export / inspect / install / list / show / uninstall` | ✅ | bogus / corrupt zip ✓ | `list/show` "not implemented" | +| `shell install / uninstall` | 未实装 | 不支持 shell ✓ | 无 `shell status` | +| `uninstall` dry-run / `--yes` / `--json` | dry-run ✓ | — | `--json` 输出仍是文本 | +| `completion zsh/bash/fish` | ✅ | — | 标准 cobra 模板 | + +## 上次未修的 + 这次新发现(19 个) + +### P0(3 个,含上次 2 个 + 新 1 个) + +1. **boundary 泄露 OAuth token**(上次发现的)—— 用户 `~/.claude/settings.local.json` + 里的真实 OAuth token 被原样 copy 进 boundary。**确认这次仍存在。** +2. **bypassPermissions 默认被继承**(上次发现的)—— 用户全局 + `defaultMode=bypassPermissions` 被原样写进每个 boundary。**确认仍存在。** +3. **Codex 也泄密** 🆕 —— `~/.avm/boundaries/codex//auth.json` 是 + `~/.codex/auth.json` 的字节级 copy(`diff` 空),含 ChatGPT id_token JWT。 + 是同一个"wholesale-copy 用户 home"模式的另一处发作,不是孤立 bug。 + (好消息:文件 perm=600,比 claude-code 这边的 perm 同样规范) + +### P1(8 个,功能错误或显式 not implemented) + +4. **`agent show --runtime ` 输出空**——README 明文承诺 "how each field + maps to the runtime",实际 stdout 一字没有,`--json` 也空,exit=1。 +5. **`agent create --runtime alien` 不校验 runtime 名**——成功创建 `runtimes: [alien]` + 的 agent,到 `avm run` 才报错。对比 `--skill bogus` 是即时拒绝,runtime 校验缺失。 +6. **`run --runtime X` 可覆盖 agent 声明的 runtime**——agent 只声明 + `claude-code`,`run --runtime codex` 仍然渲染并尝试启动,应该报 + "agent does not declare runtime codex"。 +7. **`capability bootstrap` 二次跑 exit=0 但藏 27 行错误**——`runtime "claude-code" + has no skill named X`(plugin marketplace skill)。discover 能看到但 import + 不能装,两个命令视角不一致。 +8. **`package list/show` 显式 "not yet implemented"**——但 README §5 把 + `avm package list` 列为 daily path。`show` 还 exit=0,应该 exit=1。 +9. **`package list --json` 返回 `null`**——应该是 `[]`(empty array)。 +10. **`uninstall --json` 输出纯文本**——`--json` 全局标志被忽略。 +11. **`uninstall` 显示要删源码构建路径**——`os.Executable()` 指向我源码 build + 的 `bin/avm`,不是 README 推荐的 `~/.local/bin/avm`。源码运行 uninstall + 会留下真正的安装不动。 + +### P2(8 个,UX / 一致性) + +12. **`status` 和 `doctor` 隐式建 `~/.avm`**——无 mutate 意图的命令也产生副作用。 + 跑 `status` 之后 `init` 就报 "already initialized"。 +13. **`agent show` 把 skills 显示成 `cap_XXX` hash**——`agent list` 用 name, + 一致性差。 +14. **第一次 `avm run` 必报 `drift detected`**——空 boundary 也判 drift, + 第一次 run 应视为 first-create。 +15. **`avm shell status` 静默回退到 `shell --help`**——应报 unknown subcommand。 +16. **没有 `shell status`**——`doctor` 报 "Shell integration: FAIL" 但 shell + 子命令本身没有 status 命令,必须从 doctor 看。 +17. **`shell install` 没有 dry-run**——只能装。 +18. **`run` 没有 `--render-only`**——`--preview` 不写文件,写文件就必须 + `spawn runtime`,QA / snapshot test 无法不启动 runtime 的情况下 inspect 输出。 +19. **`agent show` mapping 表只列 agent 配过的字段**——MCP 字段为空就不显示 + `mcp -- not configured`,用户无法知道 runtime 究竟支持哪些字段。 + +## 这次做对的地方 + +- 全部 CRUD(create/list/show/edit/clone/rename/delete)+ package roundtrip 跑通 +- `agent edit` 的 replace 语义符合 README ✓ +- `--on-conflict` 在 setup / capability / package 三处行为一致 +- `setup` 自动检测 3 个 runtime + 列每个 4 个 caveat +- `run --preview` 五段输出(Env / Will write / Mapping / Drift / Warnings) +- `runtime list --json` shape 干净 +- error 信息绝大部分清晰(regex 约束、unknown drift policy、agent not found 等) +- `go test ./...` 11 个包全绿 + +## 优先级建议(如果只能修 3 个) + +1. **secret 扫描 / boundary 渲染重写**——P0 #1+#2+#3,影响 3 个 adapter, + "isolated boundary" 心智完全靠这个 +2. **`agent show --runtime ` 实装**——README 承诺的核心功能 + 这是 + fidelity reporting UI 的入口 +3. **runtime 名校验 + `run --runtime` 不应覆盖未声明 runtime**——P1 #5+#6, + 数据完整性 + +## 给 Agent Deck 的额外启示 + +1. **`--json` 必须每个命令都走同一渲染层**——uninstall/`package list` 的不一致 + 说明 JSON 输出是按命令各自实现的,不是统一管道。Agent Deck 应该从一开始就 + 把 `Render(out, model)` 强制走双轨。 +2. **read-only 命令不该有副作用**——`status` / `doctor` 隐式建 home 是反模式。 + Agent Deck 的 readonly views(看面板、看 agent 列表)必须 strictly read-only。 +3. **"not yet implemented" 应该 exit ≠ 0**——`package show` exit=0 但返回 + "not implemented" 是脚本 / CI 的隐形地雷。 diff --git a/DOGFOOD-REPORT-2026-05-13.md b/DOGFOOD-REPORT-2026-05-13.md new file mode 100644 index 0000000..46c9dd7 --- /dev/null +++ b/DOGFOOD-REPORT-2026-05-13.md @@ -0,0 +1,85 @@ +# Agent-VM Dogfood 报告 — 2026-05-13 + +视角同上次:darwin-arm64,BENZEMA216,README daily path。 +基线 = DOGFOOD-REPORT-2026-05-08.md,对比 commit db58dc1 → 8307a79(5 commit,主体是 fix: repair package roundtrip + README 重写)。 + +## TL;DR — daily path 终于跑通;但 boundary 在泄密 + +README 5 步 daily path 全部跑通了(上次只有 2/4)。 +但 avm run 把用户的 OAuth token 和 bypassPermissions 默认设置写进了 boundary。 + +## 上次 P0 复盘(8/8 全部修了) + +| # | 上次现象 | 这次状态 | +|---|---|---| +| 1 | install.sh URL 404 | 修了 — curl 200 OK,6.6 KB | +| 6 | avm create backend-coder 位置参数报错 | 修了 — README 已统一为 --name | +| 7 | avm create 提示与 daily path 不一致 | 修了 — 提示 avm run | +| 10 | avm run 接 runtime 名 vs README 的 agent 名 | 修了 — Usage: avm run | +| 11 | AVM_CLAUDE_MCP_CONFIG 指向不存在文件 | 修了 — 该 env 不再导出 | +| 12 | settings.json = {"agent":"X"} 非法 | 形式修了,语义新出回归(见下)| +| 13 | subagent frontmatter effort 非法字段 | 修了(schema 整体撤掉 subagents) | +| 15 | avm skill 只有 list,看不见 ~/.claude/skills | 修了 — avm setup 一行导入 45+21+12=68 个 capability | + +## 上次 P1 复盘(3/4 修了) + +| # | 现象 | 状态 | +|---|---|---| +| 2 | 顶层暴露 activate/deactivate/env/use/sync | 修了 | +| 4 | ~/.avm/envs/default.yaml 仍带 runtime_agents | 修了 — envs/ 整体删除 | +| 9 | profile 在 cmd/ 出现 135 次 vs agent 47 次 | 修了 — 全代码库 profile 0 次 | +| 14 | "Claude Code Supported" 名不副实 | 部分修了 — skills 真渲染了,但 mcp 仍空 | + +## 上次 P2 复盘(2/2 修了) + +| # | 现象 | 状态 | +|---|---|---| +| 3 | --version 输出 (none, unknown) | 修了 — 0.0.0-dev (8307a79, 2026-05-13T...) | +| 5 | avm init 没说创了什么 | 修了 — 列了所有 dir + Next | + +## 新发现 + +### P0 安全/隐私回归 + +**Boundary 泄露 OAuth token + 用户身份** +~/.avm/boundaries/claude-code/backend-coder/ 出现: +- settings.local.json 里有 Bash(TOKEN="sk-ant-oat01-...") — 用户真实 Claude OAuth token +- .claude.json 里完整保留 oauthAccount block(accountUuid / emailAddress / organizationUuid / subscriptionCreatedAt) + +修复方向: +1. boundary settings.* 不应整段 copy 用户 home;应从空白开始 +2. token 字段必须 redact +3. 加 secret scrubber:扫到 sk-ant- / Bearer / OAuth pattern 时拒绝写入 + +**bypassPermissions 默认被继承** +用户 home 的 defaultMode=bypassPermissions + skipDangerousModePermissionPrompt=true 被原样写进每个 boundary settings.json。 +后果:AVM 跑出来的 agent 看似"隔离 boundary",实际默认 bypass 所有权限。 + +修复:boundary permissions 应明确 opt-in 而非继承。安全策略上 boundary 应比 home 更严。 + +### P1 + +- ~/.avm 权限 700 → 755(上次报告夸过的 secrets 处理意识没了;结合 OAuth token 写进 boundary,杀伤力比上次大) +- agent show 把 skills 显示成 cap_XXX hash(agent list 用 name,不一致) +- 全新 install 第一次 avm run 必报 drift detected — 第一次 run 不该判 drift + +### P2 + +- avm run 没有 --no-launch / --render-only — 想检查 boundary 文件就必须真 spawn runtime +- agent show 的 mapping 表里没有 mcp / instructions 字段;建议显示所有 driver 知道的字段并标 "-- not configured" + +## 这次做对的地方 + +- avm setup 自动检测 3 个 runtime + 列出每个 4 条 caveat ✓ 最大产品亮点 +- agent show --runtime 把 fidelity mapping 显式暴露 ✓ 上次点名要求 +- avm run --preview 五段输出(Env / Will write / Mapping / Drift / Warnings)✓ +- go test ./... 11 个包全绿 ✓ +- package export → delete → install → show roundtrip 完美 ✓ +- 术语清洗到位(profile 0 次)✓ + +## 给 Agent Deck 的启示(补充上次) + +1. "isolated boundary" ≠ "copy user home" — AVM 这次的安全回归正踩在这边界上 +2. 第一次运行不该判 drift — 数据没建过就没 baseline +3. fidelity mapping 应全字段展示,把"未配"和"不支持"分开 +4. secret 扫描应该是 write barrier,不是开关