本文件用于快速确认:每个组件负责什么、读写哪些数据、以及推荐的调用顺序(避免“文档说法/历史数据/脚本实现”互相打架)。
正文/:章节文件(支持 正文/第0001章.md 或 正文/第1卷/第001章-标题.md)大纲/:卷纲/章纲/场景纲设定集/:世界观/力量体系/角色卡/物品卡等设定库.webnovel/state.json:唯一权威状态(角色/伏笔/进度/主角状态/关系/审查记录).webnovel/workflow_state.json:工作流断点(用于 /webnovel-resume).webnovel/index.db:结构化索引(章节/角色/伏笔的 SQLite 索引).webnovel/archive/*.json:归档数据(角色/伏笔/审查报告)init_project.py:初始化项目结构与模板(生成 .webnovel/state.json 等)extract_entities.py:扫描章节中的 <entity/> / <skill/> / <foreshadow/> 标签 → 写入 设定集/ + 更新 state.json(兼容旧方括号格式)update_state.py:原子性更新 state.json(进度/位置/战力/关系/伏笔/审查记录/Strand)structured_index.py:把章节元数据写入 .webnovel/index.db;并从 state.json 同步角色/伏笔到索引(用于快速查询/上下文筛选)status_reporter.py:生成健康报告、伏笔紧急度分析、Strand 分布等archive_manager.py:归档不活跃角色、已回收伏笔、过旧审查报告(写入 .webnovel/archive/*.json 并从 state.json 移除)context_manager.py:生成“滑动窗口”上下文(优先读索引;失败则降级读 state.json + 文件遍历)正文/…metadata-extractor(agent)抽取:title/location/characters/word_count/hashstructured_index.py --update-chapter ...(更新 .webnovel/index.db)extract_entities.py --chapter N --auto(同步 设定集/ + 更新 state.json)update_state.py --progress N WORDS(必要时记录位置/战力/Strand/关系/伏笔)archive_manager.py --auto-check(可选:自动触发归档,控制 state.json 体积)未回收 / 已回收待回收 / 进行中 / active / pending / resolvedcontent, statusplanted_chapter, target_chapter, tier(核心/支线/装饰)location, characters, resolved_chapterstatus_reporter.py --focus urgency(基于 tier + target_chapter)structured_index.py --query-urgent-foreshadowing(基于“超过 50 章未回收”的阈值)--add-foreshadowing 没有埋设/目标章节:update_state.py 已自动补 planted_chapter/target_chapter/tier.webnovel/archive/*.json