Expand description
Lifecycle → Vault canonical note 回写。
负责把 MemoryRecord 按 docs/OBSIDIAN_SCHEMA.md 的 frontmatter 契约渲染成单个 Markdown
note,落入 50-Memory-Ledger/Extracted/<record_id>.md。
幂等 + body 保护:frontmatter 里保存上次写入时的 body hash (spool_body_hash),
再次回写时若磁盘上 body 的实际 hash 与 stored 不一致,视为用户手改,保留用户 body
只重写 frontmatter;一致则按 record 重新渲染 body。archive 不删文件,仅打 archived 标记。
Structs§
Enums§
Constants§
Functions§
- apply_
writeback_ for_ entry - 根据
LedgerEntry的最新 state 做 vault 回写,错误降级为 stderr warn。 - archive_
memory_ note - memory_
note_ path - memory_
note_ path_ for - 根据 memory_type 分发目标子目录:
knowledge(Karpathy wiki compiled 页) 走Compiled/,其他碎片记忆走Extracted/。保持 Extracted 为默认以兼容现有 测试与 MCP 路径引用。 - write_
memory_ note - writeback_
from_ config - 从 config_path 加载 AppConfig 并 resolve vault root,再做 writeback。 任何 config/vault 解析错误都 swallow 为 None (不阻断业务)。
- writeback_
from_ config_ no_ compile - Same as
writeback_from_configbut skips auto-compile. Used by MCP handlers that will run LLM-assisted compile separately.