feat(knowledge): implement rollback command and TUI palette#5053
Merged
Conversation
bug-ops
enabled auto-merge (squash)
June 7, 2026 22:57
…5020) Closes #5019, Closes #5020. Rollback: - IngestLedger: add batch_exists() and delete_batch() to query and remove ledger rows by import_batch_id - GraphStore: add delete_batch() to remove imported edges and orphaned entities stamped with the given import_batch_id; conversation-origin rows are never touched - CLI: add --yes/-y flag to `zeph knowledge rollback` to skip the interactive confirmation prompt - handle_rollback: real async implementation replacing the Phase-1 stub; verifies batch exists, prompts for confirmation, deletes graph rows and ledger entries, warns when 0 graph rows removed (Phase-1 notes sink writes to Qdrant, not the graph) Slash command / agent integration: - AgentAccess: add knowledge_status() and knowledge_rollback() trait methods with implementations in agent_access_impl.rs - KnowledgeSlashCommand: /knowledge [status | rollback <batch_id>] registered in the command registry - knowledge_status: safe UTF-8 source_uri truncation via floor_char_boundary TUI palette (spec-067 §8): - TuiCommand: KnowledgeStatus, KnowledgeRollbackPrompt, KnowledgeIngestPrompt variants - build_knowledge_commands(): 3 palette entries under the knowledge category - handle_knowledge_command(): dispatches status via /knowledge status slash command (with spinner), prefills rollback input
bug-ops
force-pushed
the
feat/m29/5019-knowledge-rollback-status-tui
branch
from
June 7, 2026 22:57
2866fb8 to
9162fce
Compare
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.
Summary
zeph knowledge rollback --batch-id <id>CLI command deletes graph edges and entities for the given import batch, removes the ledger row, and prompts for confirmation unless--yes/-yis passed/knowledge rollback <id>slash command dispatched viaAgentAccess::knowledge_rollback(same logic, agent path)/knowledge statusslash command (AgentAccess::knowledge_status) returns ledger summary as formatted textKnowledgeStatus(dispatches/knowledge statuswith spinner),KnowledgeRollbackPrompt(prefills/knowledge rollback),KnowledgeIngestPrompt(shows CLI instructions)IngestLedger::batch_existsandIngestLedger::delete_batchmethods added tozeph-memory(4 unit tests)GraphStore::delete_batchremoves edges and orphaned imported entities; conversation-origin knowledge is never touched (2 unit tests)edges == 0 && entities == 0— note is printed before the summary line (CLI) or appended viapush_str(agent path); Qdrant vectors remain until Phase 2source_uritruncation viafloor_char_boundary(40)inagent_access_impl.rsTest plan
cargo nextest run -p zeph-memory -E 'test(batch_exists)' --lib— PASScargo nextest run -p zeph-memory -E 'test(delete_batch)' --lib— PASScargo nextest run --workspace --features desktop,ide,server,chat,pdf,scheduler --lib --bins— 11077 PASScargo +nightly fmt --check— cleancargo clippy --all-targets --features desktop,ide,server,chat,pdf,scheduler --workspace -- -D warnings— no warningsRUSTFLAGS="-D warnings" cargo check --workspace --all-targets --features desktop,ide,server,chat,pdf,scheduler --locked— cleanzeph knowledge rollback --helpshows--batch-idand--yesflagszeph knowledge rollback --batch-id nonexistentexits with "batch not found" error/palette showsknowledge:status,knowledge:rollback,knowledge:ingestentries (live TUI — Qdrant DOWN in CI)Closes #5019
Closes #5020