Skip to main content

Module wiki_lint

Module wiki_lint 

Source
Expand description

Wiki lint — 周期化知识库一致性检查。

Karpathy LLM Wiki 的 Lint 阶段在 spool 的具体化:把已有的 consolidation::detect_prune_candidates (staleness / expired / superseded) 和新的 orphan / broken cross-ref 检测 合成一份 LintReport,供 CLI / MCP / wakeup 统一消费。

§设计原则

  • 纯读,不改 ledger / 不写 vault。消费方决定如何处理。
  • 复用 consolidation::detect_prune_candidates,不重建第二套 staleness 逻辑。
  • orphan / cross-ref 是本模块新增: orphan 发现 vault 中有 canonical note 但 ledger 无对应 record;broken cross-ref 发现 related_records 指向不存在 记录。

Structs§

BrokenCrossRef
LintReport
OrphanNote

Functions§

render_lint_markdown
Render as markdown summary for wakeup / CLI display.
run_lint
核心 lint 逻辑 — 纯函数,方便测试。
run_lint_from_config
从 config_path 加载,跑完整 lint pass。失败降级为 anyhow::Err 供调用方自行处理。