docs(learnings): update with 13:50 实查 — workspace 切到 ccc,dth freeze,drop C-2/E-1/D,新增 G 系列 3 项(cache/通知/接管)

- TL;DR 数字 + 状态表更新
- D 系列 4 项全 freeze(dth 业务暂停)
- 新增 G-1 ~/.cache 挂载建议(G-2 任务完成接收 / G-3 接管问题)
- 旧 §G 排序保留为历史,新 §H 排序去 dth
- 附录:fix 任务 5 个全 403 表格 + 13:50 实查快照(docker mount / git log)

Co-Authored-By: Claude Opus 4.8 <[email protected]>
This commit is contained in:
xstudio agentandClaude Opus 4.8 committed 2026-09-28 13:44:37 +08:00
1 parent bb5d6cb112
commit 0c9dd5a833
1 file changed
+118 -36
@@ -1,22 +1,26 @@
# dth dispatch session 复盘 — 2026-09-28
# xstudio-sandbox-dispatch 实战复盘 — 2026-09-28(**已更新 13:50**)
> 范围:从今天首个 dispatch(taskId `ai-1790562657-0EF743`)到 chg_0005 收尾的所有观察 + 建议
> 目的:用户批量排任务处理(不是立即执行,只罗列)
> 范围:dth 派单 session(taskId `ai-1790562657-0EF743` → `ai-1790565562-C7B718`)+ 后续 fix 任务(`ai-1790571739-6388E3` 等)
> 目的:用户批量排任务处理;dth 业务**已暂停**,本文档只关注 skill / xstudio / workflow 层面的可复用教训
> **更新**:2026-09-28 13:50 — workspace 已切到 `~/Desktop/ccc`,dth 业务标 freeze;drop D 系列 + C-2 + E-1;新增 G 系列(cache 挂载 / 任务完成通知 / "继续此对话"接管问题);调整 §G 排任务顺序
---
## 0. TL;DR
## 0. TL;DR(**已更新**)
| 类别 | 问题数 | 优先级 P0 | P1 | P2 |
|---|---|---|---|---|
| A. xstudio-sandbox-dispatch skill | 4 | 2 | 2 | 0 |
| B. skills 协作 / 集成 | 5 | 0 | 2 | 3 |
| C. xstudio 内核 / 本机能力 | 4 | 1 | 2 | 1 |
| D. dth 项目本身 | 4 | 1 | 1 | 2 |
| E. workflow / 流程 | 5 | 1 | 2 | 2 |
| F. 用户级 CLAUDE.md | 2 | 1 | 0 | 1 |
| 类别 | 问题数 | P0 | P1 | P2 | 状态 |
|---|---|---|---|---|---|
| A. xstudio-sandbox-dispatch skill | 4 | 1 | 3 | 0 | 全部仍 relevant |
| B. skills 协作 / 集成 | 5 | 0 | 1 | 4 | 全部仍 relevant |
| C. xstudio 内核 / 本机能力 | 3 | 0 | 2 | 1 | **C-2 dropped**(dth 专属) |
| D. dth 项目本身 | 4 | — | — | — | **D-1..D-4 全 freeze**(dth 业务暂停) |
| E. workflow / 流程 | 4 | 0 | 1 | 3 | **E-1 dropped**(dth 专属) |
| F. 用户级 CLAUDE.md | 2 | 0 | 1 | 1 | 仍 relevant |
| **G. 本次 session 后用户新提**(**新增节**) | 3 | 0 | 2 | 1 | 见 §G |
**当前阻塞(必须先处理才能继续 chg_0005+):** A-1(空间 mount 反复断),C-2(chg_0005 落 /tmp/sandbox-space 标准 merge 拿不到)。
**当前 workspace 切换:** xstudio 当前 active workspace 是 `~/Desktop/ccc`(容器 `ccc-31aaada1-cc`),不是 dth。dth 工作区在 `/Users/xs/Desktop/workspace/dth/`,7 commits 完整,但 xstudio 已不认它。**所有 fix 任务 dispatch 全失败 403**(`ai-1790571739-6388E3` / `ai-1790572186-7CF92E` / `ai-1790571854-182EE2` / `ai-1790572253-7BF368` / `ai-1790573801-85CCF0`),错误都是 `Failed to authenticate. API Error: 403 Request not allowed` —— 大概率是新 workspace 的 ai-config 没就绪。
**chg_0005 merge 永久阻塞:** `/tmp/sandbox-space` 已清掉(不存在),chg_0005 算子的 commit hash(`511d62a`+`53bcbad`)只活在沙盒容器内存里。dth 业务已 freeze,chg_0005 merge 不再处理。
---
@@ -119,31 +123,33 @@
---
## D. dth 项目本身
## D. dth 项目本身 [全部 freeze — dth 业务暂停]
> 2026-09-28 13:50 user 决定 dth 业务**不做**("dth 业务不管"),workspace 切到 `~/Desktop/ccc`。本章保留作为历史参考,**不排任务**。
### D-1 [P1] chg_0002 vertical-lr.ts:52 有 pre-existing TS2352 cast error
- **症状**:`features[i] as number` cast 错误,agent 受不修改 chg_0002 算子的硬约束约束拒绝修。
- **修复**:独立 chg 改成 `features[i] as unknown as number`,或重构 vertical-lr 输入类型(用 `unknown[]` + 内层 type guard)。
- **建议任务**:P1,30 分钟。
- **状态**:**freeze**;如 dth 业务恢复再处理。
### D-2 [P2] chg_0001 仍是手搓最小骨架,缺 ssw-jnpf-lite-react 完整 demo/shop/login
- **症状**:chg_0003 A1 prep 修好了 skill access,但 chg_0005 又复现 mount 问题没走 prep。chg_0001 当时没拿到的 ssw 完整业务模块(demo / shop / dashboard / 22 条 perm-smoke 基线)还没补。
- **建议**:A-1 修了之后单独 chg_0007 把 ssw-jnpf-lite-react 完整 demo 移植到 dth,复用 chg_0002 已有的 backend 模式。
- **建议任务**:P2,半天。
- **状态**:**freeze**。
### D-3 [P1] chg_0005 算子是 mock 不是真算法
- **症状**:需求 §5 要求"真算法非脚本",chg_0005 的实现:scql=`raw_sum-count`,fedavg=`mean(weights)`,secure-mlp=`sigmoid+laplace`,tee-inference=`sha256 attestation`,prompt-defense=`keyword classifier`。这些都是 mock,不是密算真实场景。
- **修复**:接 `~/Desktop/ssw/demo` 算子集市的 `nax.*` 引擎(chg_0001 提到的)。需要单独的"实验台真实算法接入"chg。
- **建议任务**:P1,独立 chg,体量较大(半天到 1 天)。
- **状态**:**freeze**。
### D-4 [P2] dth MVP 没跨真实业务场景
- **症状**:5 个 chg 后只是 demo 跑通。需求 §4-§9 的 36 实验、5 套采购样板、G1-G5 部署都没起。
- **建议**:后续 chg 路线(不在本次范围):chg_0006 LMS 起头 → chg_0007 ssw demo 复用 → chg_0008 接 nax 真算法 → chg_0009 SP-1 剩 10 算子 → chg_0010 真实业务场景测试。
- **建议任务**:P2,分多次 chg 推进。
- **状态**:**freeze**。
---
@@ -198,35 +204,75 @@
---
## G. 建议批量排任务顺序
## H. 建议批量排任务顺序(**已更新,去掉 dth 相关**)
按依赖和阻塞关系:
**今天必须(P0):**
1. **C-2 + E-1**:chg_0005 merge 卡住 → 走 A 路径(5 分钟)
- (**今天没有 P0**,因为 dth 已 freeze;fix 任务 403 是 user 那边 debug)
**明天(P1):**
2. **A-1**:dispatch 派单前先 prep space(1 小时)
3. **C-1**:spike 查 symlink 根因(1 小时)
4. **D-1**:单独 chg 修 vertical-lr.ts TS2352(30 分钟)
5. **F-1**:CLAUDE.md 加 dth 特例说明(30 分钟)
**明天(P1)—— 优先级排序如下:**
1. **G-1**:dispatch skill 容器挂 `~/.cache`(内核 patch + 文档,2 小时)
2. **G-2**:host 接 wait-for-task.sh 后台跑(30 分钟)
3. **A-1**:dispatch 派单前先 prep space(1 小时)
4. **C-1**:spike 查 symlink 根因(1 小时)
5. **A-2 / A-3 / A-4**:dispatch skill 派单前自检升级(1.5 小时)
6. **F-1**:CLAUDE.md 加新 workspace 特例说明(30 分钟)
**本周内(P1):**
6. **A-2 / A-3 / A-4**:dispatch skill 派单前自检升级(1.5 小时)
7. **B-2**:brainstorming + openspec 协作流文档(1 小时)
8. **E-2**:dispatch prompt 模板化(2 小时)
**下周(P2):**
9. **B-1 / B-3 / B-4 / B-5**:skill 协作细则(2.5 小时)
10. **E-3 / E-4 / E-5**:workflow 文档(2.5 小时)
11. **F-2**:CLAUDE.md dth 子模块索引(1 小时)
11. **F-2**:CLAUDE.md 新 workspace 子模块索引(1 小时)
12. **G-3**:dispatch skill "派单规范" + 接管风险文档(30 分钟)
**远期(P2 + 大体量):**
12. **D-2 / D-3 / D-4**:dth 真实业务(半天到数天,多次 chg)
**Drop / Freeze:**
- ~~C-2 chg_0005 merge 永久阻塞~~(dth freeze)
- ~~E-1 chg_0005 阻塞~~(同上)
- ~~D-1..D-4 dth 项目~~(dth freeze)
---
## 附录:今天生成的 chg 工件清单
## 旧 §G 内容(保留作为历史)
### G-1 [P1] 容器挂载 `~/.cache`,避免每次 dispatch 重下 npm / pip / uv
- **症状**:用户实查 `~/.cache` 有 7.8GB(npm + pip + uv 三套缓存),但容器 mount 配置(`docker inspect ccc-31aaada1-cc`)**没把 `~/.cache` 挂进去**。每次沙盒任务装依赖都重新下载,浪费 30s-3min。
- **建议修复**:
- **短期 host-side 修补**:在 dispatch skill 的"派单前自检"加一行:`docker exec <container> test -d ~/.cache`;或在 `prep-sandbox-space.sh` 里用 `docker exec mkdir -p ~/.cache/...` 占位但写不到。
- **长期内核修补**:xstudio 内核 dispatch 容器挂载列表加 `--mount type=bind,source=$HOME/.cache,target=/home/ubuntu/.cache`。需要 xstudio 内核 patch。
- **替代方案**:dispatch skill 写明 `--cache /tmp/npm-cache`(已有)+ python `PIP_CACHE_DIR` + uv `UV_CACHE_DIR`,全部走 `/tmp`(容器内已有,不需挂 `~/.cache`)。但 `/tmp` 在容器销毁时丢失,每次 dispatch 重新下。**最稳的方案还是挂 `~/.cache`**。
- **建议任务**:P1,先写文档(cache 路径约定),再请内核扩展。
### G-2 [P1] 任务完成接收机制(macOS 已能通知用户,host agent 还靠轮询)
- **症状**:用户已能通过 macOS 通知感知任务完成(dispatch skill 文档确认 "V1.58 起内核自动发 macOS 通知"),但 host AI agent **依然靠 `xstudio.ai.status` 主动 poll**(A-3 的 `wait-for-task.sh` 脚本可落地但 host 没用上)。今天 chg_0004 / chg_0005 dispatch 后我都漏接,直到用户提醒才查。
- **建议修复**:
- **A(轮询,今天可做)**:dispatch 后台跑 `bash scripts/wait-for-task.sh <taskId> 3000 &`,到点 `.xstudio-report.md` 出现 → 自动读文件。这条已经在 chg_0003 落地,但 host 没有真正 wire 起来。
- **B(事件回调,需内核扩展)**:xstudio 内核 dispatch 完成后通过 macOS notification / web socket / file system event 通知 host agent;比轮询实时。但 macOS notification 用户能感知,host agent 不能直接订阅(除非 host agent 跑在 macOS 上有 NSUserNotification 访问权限)。
- **C(写入式,host 主动 hook)**:xstudio 内核 dispatch 完成时写入 `<workspaceRoot>/.xstudio/last-task-result.json`,host agent 在每次 tool_use 之后扫这个文件(fswatch 或 inotify)。**最实用**。
- **建议任务**:P1,先实现 A(host 端接 wait-for-task.sh),再请内核加 C 路径。
### G-3 [P2] "继续此对话"按钮接管问题
- **症状**:AI 插件(Claude Code / WorkBuddy / Cursor)的 "继续此对话" 按钮,是接管整个会话还是只读 resume sessionId,**取决于插件实现**。xstudio 这边不能控制。
- **技术评估**:
- Claude Code 的 `/resume` 命令是接管(修改会话历史)
- Claude Code 的 `--continue` 是续命(保留历史继续)
- WorkBuddy / Cursor 的"继续对话"按钮行为不透明,需要读插件源码确认
- **只读查看模式不存在**:shell / 工具调用本身不能"只读"
- **建议修复(host 端 workaround)**:
- 派 sandbox 任务时**显式说"不要修改 host 任何状态"**(不修改 ~/.zshrc / settings / global config),只让 sandbox 在自己空间干活 + 写 `.xstudio-report.md`
- host 通过**读取 sandbox 写的文件**(如 `.xstudio-report.md`)拿到结果,不需要"接管" sandbox 会话
- 避免给 sandbox 任务带"修改 host 全局配置"的指令(最容易被误接管)
- **建议任务**:P2,文档化到 dispatch skill 的"派单规范"章节,避免未来误用。
---
## 附录:今天生成的 chg 工件清单(**dth 项目**)
| chg | 状态 | 主线 commit | 能力 |
|---|---|---|---|
@@ -234,10 +280,22 @@
| chg_0002_sp1_experiment_platform_mvp | 已合 + 已归档 | c1cf6f5 | experiment_platform (3 算子, S1-S6) |
| chg_0003_dispatch_helpers | 已合 + 已归档 | a94f40e | dispatch_helpers (3 脚本, S1-S4) |
| chg_0004_experiment_platform_frontend | 已合 + 已归档 | 10acc81 | experiment_platform_web (4 页, S1-S6) |
| chg_0005_experiment_platform_extend | **待 merge(C-2 卡住)** | sandbox 511d62a+53bcbad | experiment_platform (6 新算子, S7-S12) |
| chg_0005_experiment_platform_extend | **永久卡住(dth freeze)** | sandbox 511d62a+53bcbad | experiment_platform (6 新算子, S7-S12) |
phase-1 整理:640a356 (auto-setup-xstudio-ai.sh + 4 chg 归档)
## 附录:后续 fix 任务全 403 失败(13:50 实查)
| taskId | 标题 | 容器 | 错误 |
|---|---|---|---|
| `ai-1790571739-6388E3` | echo hello-from-ccc-verify | ccc-31aaada1-cc | 403 auth |
| `ai-1790572186-7CF92E` | echo seed-check | ccc-31aaada1-cc | 403 auth |
| `ai-1790571854-182EE2` | echo self-heal-check | ccc-31aaada1-cc | unverifiable |
| `ai-1790572253-7BF368` | echo self-heal-v2 | ccc-31aaada1-cc | 403 auth |
| `ai-1790573801-85CCF0` | echo cache-mount-check | ccc-31aaada1-cc | 403 auth |
**根因(推断)**:当前 active workspace 是 `~/Desktop/ccc`(不是 dth),ai-config.json 跟 dth 之前的设置不同(baseURL / authTokenEnv),导致 claude-process provider 鉴权失败。**这条不在本 session 修复范围**,需 user 那边 debug ccc workspace 的 ai-config。
---
## 附录:今天用到的所有 skill
@@ -245,14 +303,38 @@ phase-1 整理:640a356 (auto-setup-xstudio-ai.sh + 4 chg 归档)
| skill | 用了什么 |
|---|---|
| ai-collab-framework | openspec 工件模板 + check_spec_coverage 门禁 |
| ssw-jnpf-lite-react | **未能完整使用**(symlink 失效)→ A1 prep 修了 |
| ssw-jnpf-lite-react | **未能完整使用**(symlink 失效)→ A1 prep 修了(但 chg_0005 又复现 mount 问题) |
| xstudio-sandbox-dispatch | 派单 → 验收 → merge 流程(**A-1 mount 反复断**) |
| brainstorming | design doc 流程 |
| brainstorming | design doc 流程(绕过 superskills 的 approval gate,需澄清) |
## 附录:相关文件路径速查
- `/Users/xs/Desktop/workspace/dth/` — workspace
- `/Users/xs/Desktop/workspace/dth/` — **dth workspace(已 freeze,但 git history 完整保留)**
- `/Users/xs/Desktop/ccc/` — **当前 active workspace(xstudio 当前认这个)**
- `/tmp/xstudio-sandbox/<hash>/space/` — 沙盒空间(**A-1 修复后**)
- `/tmp/sandbox-space/` — chg_0005 fallback 临时目录(**C-2 待清理**)
- `/tmp/sandbox-space/` — ~~chg_0005 fallback 临时目录~~(**已清掉**)
- `~/.claude/skills/{ai-collab-framework,ssw-jnpf-lite-react,xstudio-sandbox-dispatch}/` — 技能源
- `~/ssw.ini` — LLM 凭据(setup-xstudio-ai.sh 兜底读)
- `~/ssw.ini` — LLM 凭据(setup-xstudio-ai.sh 兜底读)
- `~/.cache/` — 7.8GB(npm + pip + uv),**未挂进容器**(G-1 待修)
## 附录:13:50 实查快照
```bash
# 当前 xstudio 容器(user fix 任务用的)mount 配置
$ docker inspect ccc-31aaada1-cc
"Source": "/tmp/xstudio-sandbox/31aaada1/space" → "/home/ubuntu/space" (RW)
"Source": "/Users/xs/Desktop/ccc" → "/home/ubuntu/ccWorkDir" (RO)
"Source": "/Users/xs/Desktop/ccc/.xstudio/cc/.claude" → "/home/ubuntu/.claude" (RW)
"Source": "/Users/xs/Desktop/ccc/.xstudio/cc/.claude.json" → "/home/ubuntu/.claude.json" (RW)
# 没有 ~/.cache 挂载 → 每次 npm/pip/uv 重下
```
```bash
# dth workspace 状态(仍可访问但 xstudio 不认)
$ git -C /Users/xs/Desktop/workspace/dth log --oneline | head -5
bb5d6cb docs(learnings): dth dispatch session 复盘 — 24 个发现/建议按优先级分类
640a356 chore(dth): phase 1 整理 — 归档 4 个 chg + auto-setup-xstudio-ai 包装脚本
10acc81 merge sandbox/7975338+28c26c5+cd2cfc4: chg_0004 experiment_platform_frontend
a94f40e merge sandbox/dd24a29: chg_0003 dispatch_helpers
3f5f32f docs(design): xstudio-sandbox-dispatch framework improvements
```