Person/codekiln/GitHub/logseq-gardener/Analysis/Codex/26/09/12/0733 ET Keep editor buffers and worktrees separate in the shared cache
Keep editor buffers and worktrees separate in the shared cache
- The Person/codekiln/GitHub/logseq-gardener/Project/Brief wants editors, scripts, and agents to reuse a cache. The missing boundary is which version of the garden each client means. Saved files, an unsaved Neovim buffer, and an agent's worktree can all contain different text for the same relative path.
An editor owns its unsaved text
- The LSP document-open contract makes the client's supplied text authoritative for an open document. Document changes carry versions, so a completion request can be answered against the synchronized buffer.
- If someone changes a page's
alias:: in Neovim, editor completion should reflect the unsaved alias while a separate CLI invocation still sees the saved graph. Writing the editor's transient interpretation into a shared current-state index would mix those views. - Give each editor session a buffer layer over the saved graph. Track document versions, and discard an older parse result if a newer version has arrived. The core can expose parsing from supplied text while the LSP manages the document lifecycle.
A worktree is a different saved graph
- My/Pref/Dev/Tool/git/Worktree makes multiple checkouts part of the expected workflow. A repository identity or Git commit alone cannot identify the current graph: worktrees at the same commit can have different uncommitted edits.
- Identify each checkout separately. If parse artifacts are shared, key them by content and every relevant parser input; retain checkout-specific file membership, configuration, and reference indexes.
- Configuration belongs in invalidation too. Changing filename or journal-title interpretation can change identities even when no Markdown file changed.
The editor acceptance test