Files
mnote/bugs/old/07-ai/done/7-19-hermes-tool-guidance-markdown-edit-contract-drift-v1.md
T
Agent Board b798f628ee chore: land tree view-state, vault, Pi module split, and repo hygiene
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.
2026-07-21 05:13:05 +08:00

2.5 KiB
Raw Blame History

[recycle] 7-19 [done][bug] Hermes 工具指导仍优先 apply_block_ops 而非 markdown_edit v1

发现时间:2026-05-17

状态:[done]

关联主线:07-ai

1. 问题定义

mnote.doc.markdown_edit 已被设计为普通页面正文编辑的主路径,但 Hermes run 的工具指导仍要求简单正文编辑优先调用 mnote_doc_apply_block_ops

这导致模型策略与工具主线冲突。

2. 证据

3. 影响

  • Hermes 与 page AI fast-path 会走不同编辑工具。
  • markdown 级 search/replace 的收敛设计无法成为唯一验收口径。
  • apply_block_ops 的 revision / conflictDetectionKey 合同缺陷会被继续放大。

4. 建议修复

  • 将普通正文 search/replace、局部段落替换、全文 markdown 替换统一引导到 mnote_doc_markdown_edit
  • 仅在需要结构性块移动、资源块、复杂定位时才引导模型使用 apply_block_opsmnote.block.*
  • 同步更新 smoke:模型生成工具调用时应优先产出 mnote_doc_markdown_edit

5. 修复

  • hermes_client.rs 将 Hermes run instructions 改为:普通正文 search/replace、局部段落替换、全文 markdown 替换优先调用 mnote_doc_markdown_edit
  • hermes_client.rsblockEditingToolOrder 首位调整为 mnote_doc_markdown_editmnote_doc_apply_block_ops 仅保留给 markdown_edit 不能表达的结构性块操作。
  • hermes_client.rs 增加 run guidance 合同测试,防止普通正文编辑重新退回 apply_block_ops 优先口径。

6. 验证

  • cargo test --manifest-path rust/Cargo.toml -p mnote-web hermes_client_run_guidance_prefers_markdown_edit_for_plain_body_edits -- --nocapture
    • 结果:1 passed
  • cargo test --manifest-path rust/Cargo.toml -p mnote-web hermes_client_run_body -- --nocapture
    • 结果:2 passed