Expand description
Wiki INDEX.md 自动生成。
从 ledger projection 生成 <vault_root>/INDEX.md,按 scope (user / project) 分节
列出所有 accepted/canonical 记录。该文件作为 LLM 在 wakeup 时的知识导航入口,
类比 Karpathy LLM Wiki 的 index 层。
§不变量
- 只列 Accepted / Canonical 记录 (candidate 在 review queue,archived 不导航)
- 按 scope 分段:User-Level (always loaded) → Project:
<id>若干段 - 段内按 recorded_at 倒序,最新优先
- 幂等:内容不变不写盘,避免 mtime 抖动
- 失败降级:错误日志 stderr,不阻断 lifecycle 主路径
Structs§
Enums§
Constants§
Functions§
- filter_
index_ sections - 纯函数:按
##大标题切段,保留 User-Level + 当前 project 段。 暴露方便单元测试。 - index_
path - load_
index_ section - 读
<vault_root>/INDEX.md,按当前 scope 过滤出相关 section: - refresh_
index_ from_ config - 从 config_path 加载 AppConfig,resolve vault_root 和 lifecycle_root, 读 latest_state 条目并刷写 INDEX.md。失败降级为 stderr warn 并返回 None, 不阻断调用方的 lifecycle 主路径。
- refresh_
index_ result - CLI-facing variant of
refresh_index_from_configthat propagates errors instead of swallowing them. Used bymemory sync-index --apply. - render_
index - 把 ledger 条目渲染为 markdown 导航索引。
- render_
index_ from_ config - Render the INDEX markdown without writing to disk (dry-run preview).
- write_
index - 把
entries渲染成 INDEX.md 并写入<vault_root>/INDEX.md,幂等。