Procházet zdrojové kódy

docs: 对齐 state/index schema 文档与脚本实现

lingfengQAQ před 3 měsíci
rodič
revize
1473295f64

+ 17 - 2
.claude/templates/output/index-schema.md

@@ -2,10 +2,12 @@
 
 > 以 SQLite 存储大规模数据(实体/别名/场景/关系)。
 >
-> **v5.4**:结构沿用 v5.1/v5.2,并在脚本侧扩展新表。
+> **v5.4**:结构沿用 v5.1/v5.2,并新增追读力/可观测性相关表。
 
 ## 表一览
 
+### 核心索引表
+
 ### chapters
 - chapter (INTEGER, PK)
 - title (TEXT)
@@ -66,4 +68,17 @@
 - description (TEXT)
 - chapter (INTEGER)
 
-> 实际字段以 `data_modules/index_manager.py` 为准。
+### v5.3 追读力债务相关表
+- override_contracts
+- chase_debt
+- debt_events
+- chapter_reading_power
+
+### v5.4 可观测性与审查相关表
+- invalid_facts
+- review_metrics
+- rag_query_log
+- tool_call_stats
+- writing_checklist_scores
+
+> 实际字段与约束以 `.claude/scripts/data_modules/index_manager.py` 为准。

+ 15 - 3
.claude/templates/output/state-schema.md

@@ -2,19 +2,23 @@
 
 > 该文件为运行态精简状态,避免体量膨胀。实体等大数据存于 index.db。
 >
-> **v5.4**:结构沿用 v5.2
+> **v5.4**:以下示例与 `update_state.py` 当前校验字段保持一致
 
 ```json
 {
   "project_info": {
     "title": "",
     "genre": "",
-    "target_words": 0
+    "target_words": 0,
+    "target_chapters": 0
   },
   "progress": {
     "current_chapter": 0,
     "total_words": 0,
-    "last_updated": ""
+    "last_updated": "",
+    "volumes_completed": [],
+    "current_volume": 1,
+    "volumes_planned": []
   },
   "protagonist_state": {
     "name": "",
@@ -22,6 +26,13 @@
     "location": {"current": "", "last_chapter": 0},
     "golden_finger": {"name": "", "level": 0, "cooldown": 0}
   },
+  "relationships": {},
+  "world_settings": {
+    "power_system": [],
+    "factions": [],
+    "locations": []
+  },
+  "review_checkpoints": [],
   "strand_tracker": {
     "last_quest_chapter": 0,
     "last_fire_chapter": 0,
@@ -31,6 +42,7 @@
     "history": []
   },
   "plot_threads": {
+    "active_threads": [],
     "foreshadowing": []
   },
   "disambiguation_warnings": [],