Persist PageTree expand state via control-plane view-state and align chevron/DOM with restored expansion; keep Sidex-style shallow page-tree scan and drop the unused recursive scanner that only added cargo noise. Add password vault workbench routes/runtime/skill/CLI, split page_ai_pi into a module package, and retire Hermes/ACP/OpenHub recycle + root harness evidence from the index while gitignoring recycle and local diag dumps. Archive superseded design/bugs docs under old/, point architecture at ARCHITECTURE.md, and refresh smokes for Pi S1–S7, vault, and editor regressions so the working tree can stay clean.
65 lines
1.9 KiB
Markdown
65 lines
1.9 KiB
Markdown
# [recycle] 7-31 [done][bug] 页面 AI block_edit_workflow 丢弃读取类回答摘要 v1
|
||
|
||
> 发现时间:2026-05-18
|
||
>
|
||
> 状态:`[done]`
|
||
>
|
||
> 关联主线:`07-ai`
|
||
|
||
## 1. 用户可见症状
|
||
|
||
在页面 AI 使用 `ACP · Reasonix` 输入:
|
||
|
||
```text
|
||
检查你是否能读取到本页第一段,同时请修改第二段为:测试123
|
||
```
|
||
|
||
`block_edit_workflow` 即使完成写入,前端也只显示固定文案:
|
||
|
||
```text
|
||
已通过页面 markdown 编辑快路径完成写入。
|
||
```
|
||
|
||
用户要求中的“是否能读取到第一段”没有被回答。
|
||
|
||
## 2. 根因
|
||
|
||
`page_ai_workflow.rs` 的模型提示已经要求模型输出:
|
||
|
||
```json
|
||
{"operations": [...], "summary": "..."}
|
||
```
|
||
|
||
但路由只提取 `operations`,丢弃了 `summary`,并在成功响应中固定返回“已通过页面 markdown 编辑快路径完成写入。”。
|
||
|
||
这会让读写混合请求退化为纯写入反馈。
|
||
|
||
## 3. 修复
|
||
|
||
- 新增 `MarkdownEditPlan`,同时解析模型输出中的 `operations` 与 `summary`。
|
||
- `block_edit_workflow` 成功响应优先返回模型 `summary`,缺失时才使用固定 fallback。
|
||
- 系统提示明确要求:如果用户要求读取某段,`summary` 必须包含从 `page_text` 读取到的原文。
|
||
- 新增回归测试 `block_edit_workflow_surfaces_model_summary_for_read_and_edit_request`,覆盖“读取第一段 + 修改第二段”的真实快路径响应。
|
||
|
||
## 4. 验证
|
||
|
||
RED:
|
||
|
||
```bash
|
||
cargo test --manifest-path rust/Cargo.toml -p mnote-web block_edit_workflow_surfaces_model_summary_for_read_and_edit_request -- --nocapture
|
||
```
|
||
|
||
旧实现失败,`payload.message` 不包含 `已读取第一段:第一段`。
|
||
|
||
GREEN:
|
||
|
||
```bash
|
||
cargo test --manifest-path rust/Cargo.toml -p mnote-web page_ai_workflow -- --nocapture
|
||
```
|
||
|
||
结果:`5 passed`。
|
||
|
||
## 5. 剩余边界
|
||
|
||
本修复只保证 fast workflow 成功响应不丢模型摘要;复杂多步推理、review session、流式 apply 仍属于 Phase C 冻结范围。
|