feat(memory): /smart-compact forget — safe project memory deletion - #70
Merged
Merged
Conversation
- forgetProjectGraph(projectId): drains queued index writes first (so a scheduled compaction cannot resurrect the memory), then deletes FTS copies, edges, and nodes in one transaction - /smart-compact forget: cwd-resolves the project, shows node/session counts, requires a TUI confirmation dialog; compaction state (restore data) and backups are deliberately kept - tombstone-terminal semantics from #69 guarantee deleted facts cannot be re-derived back into existence by later compactions
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements #63. Review context: #63 (comment)
What
/smart-compact forgetpermanently deletes the current project's graph memory.Graph layer (
forgetProjectGraph): drains the pending index queue first — a scheduled compaction state that flushes after deletion would otherwise resurrect the memory — then deletes in one transaction:context_nodes_ftsrows for the project's nodes (the duplicated-content FTS copy — see the review comment: the FTS table is standalone, not external-content, so both copies must go)context_edgesfor the projectcontext_nodesfor the projectCommand layer: cwd →
deriveProjectIdFromCwd(same resolution as/loops), no-op notice when there is nothing to delete, then a confirmation dialog showing exactly what will be removed (node count, session count) and what is kept. TUI-only, matching thesettingsaction pattern.Deliberately kept: compaction state files (they power
restore, they are not memory) and backups.Why deletion is now safe
Two earlier pieces make this sound:
removeFtsNode+removeNode) already existed for single nodes; this is its project-scoped bulk form.Verification
forgetaction), bench, build, release audit — all green