Browse Source

fix: update recovery docs to use existing CLI commands

审查发现修复:

1. [中] data-agent.md 恢复命令不存在
   - 添加注释说明规划中功能
   - 改用现有 CLI 命令作为替代方案:
     * rebuild-index → process-chapter (逐章)
     * rebuild-vectors → index-chapter (逐章)
     * sync-protagonist → get-protagonist + 手动编辑
     * health-check → stats (分别查看)

2. [低] system-data-flow.md 版本标注不一致
   - v5.0 → v5.1 (init/resume 两处)
   - 与正文 v5.1 变化描述保持一致

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
lingfengQAQ 5 months ago
parent
commit
f1626b35a0

+ 37 - 26
.claude/agents/data-agent.md

@@ -323,59 +323,70 @@ python -m data_modules.style_sampler extract --chapter 100 --score 85 --scenes '
 
 
 ## 故障恢复流程 (v5.1)
 ## 故障恢复流程 (v5.1)
 
 
+> **注意**: 以下恢复命令为规划中功能,当前版本请使用替代方案。
+
 ### 索引重建
 ### 索引重建
 
 
-当 index.db 损坏或与实际数据不一致时,执行索引重建
+当 index.db 损坏或与实际数据不一致时:
 
 
+**当前替代方案**(逐章重新处理):
 ```bash
 ```bash
-# 完整重建索引(从正文重新提取所有实体
-python -m data_modules.index_manager rebuild-index --project-root "."
+# 重新处理单章(会更新索引
+python -m data_modules.index_manager process-chapter --chapter 1 --project-root "."
 
 
-# 仅重建特定章节范围
-python -m data_modules.index_manager rebuild-index --start 1 --end 50 --project-root "."
+# 批量重新处理(shell 循环)
+for i in $(seq 1 50); do
+  python -m data_modules.index_manager process-chapter --chapter $i --project-root "."
+done
 
 
-# 验证索引完整性
-python -m data_modules.index_manager verify-index --project-root "."
+# 查看索引统计
+python -m data_modules.index_manager stats --project-root "."
 ```
 ```
 
 
 ### 向量重建
 ### 向量重建
 
 
-当 vectors.db 损坏或嵌入模型更换时,执行向量重建
+当 vectors.db 损坏或嵌入模型更换时:
 
 
+**当前替代方案**(逐章重新索引):
 ```bash
 ```bash
-# 完整重建向量库
-python -m data_modules.rag_adapter rebuild-vectors --project-root "."
+# 重新索引单章
+python -m data_modules.rag_adapter index-chapter --chapter 1 --project-root "."
 
 
-# 仅重建特定章节范围
-python -m data_modules.rag_adapter rebuild-vectors --start 1 --end 50 --project-root "."
+# 批量重新索引(shell 循环)
+for i in $(seq 1 50); do
+  python -m data_modules.rag_adapter index-chapter --chapter $i --project-root "."
+done
 
 
-# 检查向量覆盖率
-python -m data_modules.rag_adapter check-coverage --project-root "."
+# 查看向量统计
+python -m data_modules.rag_adapter stats --project-root "."
 ```
 ```
 
 
 ### 状态同步
 ### 状态同步
 
 
 当 state.json 与 index.db 不一致时:
 当 state.json 与 index.db 不一致时:
 
 
+**当前替代方案**(手动查询和更新):
 ```bash
 ```bash
-# 从 index.db 同步主角状态到 state.json
-python -m data_modules.index_manager sync-protagonist --project-root "."
+# 查看主角实体信息
+python -m data_modules.index_manager get-protagonist --project-root "."
+
+# 查看核心实体列表
+python -m data_modules.index_manager get-core-entities --project-root "."
 
 
-# 导出当前状态快照
-python -m data_modules.index_manager export-state --output snapshot.json --project-root "."
+# 手动更新:根据输出结果编辑 state.json 中的 protagonist_state
 ```
 ```
 
 
 ### 数据一致性检查
 ### 数据一致性检查
 
 
+**当前替代方案**(分别查看统计):
 ```bash
 ```bash
-# 全面检查数据链一致性
-python -m data_modules.index_manager health-check --project-root "."
-
-# 输出示例:
-# ✅ index.db: 256 entities, 512 aliases, 1024 scenes
-# ✅ vectors.db: 1024 vectors (100% coverage)
-# ⚠️ state.json: protagonist_state.entity_id missing in index.db
-# → 建议执行 sync-protagonist
+# 查看索引统计
+python -m data_modules.index_manager stats --project-root "."
+
+# 查看向量统计
+python -m data_modules.rag_adapter stats --project-root "."
+
+# 对比结果判断一致性
 ```
 ```
 
 
 ---
 ---

+ 1 - 1
.claude/skills/webnovel-init/references/system-data-flow.md

@@ -11,7 +11,7 @@ purpose: 重定向到权威版本
 
 
 ## 权威版本位置
 ## 权威版本位置
 
 
-`skills/webnovel-query/references/system-data-flow.md` (v5.0)
+`skills/webnovel-query/references/system-data-flow.md` (v5.1)
 
 
 ## 加载方式
 ## 加载方式
 
 

+ 1 - 1
.claude/skills/webnovel-resume/references/system-data-flow.md

@@ -11,7 +11,7 @@ purpose: 重定向到权威版本
 
 
 ## 权威版本位置
 ## 权威版本位置
 
 
-`skills/webnovel-query/references/system-data-flow.md` (v5.0)
+`skills/webnovel-query/references/system-data-flow.md` (v5.1)
 
 
 ## 加载方式
 ## 加载方式