feat(cli): add zeph project purge command for full project state cleanup#3598
Merged
feat(cli): add zeph project purge command for full project state cleanup#3598
zeph project purge command for full project state cleanup#3598Conversation
…eanup Adds `zeph project purge [--config <path>] [--dry-run] [-y]` that removes all project-local state in a single operation: - Pre-flight exclusive lock check on SQLite DB (aborts if agent is running) - SQLite database file + WAL/SHM siblings (OsString-safe path composition) - Log files: main log + rotated siblings, scheduler daemon log + PID file - Debug artifacts directory and trace files directory - Audit log file (when configured as a file path) - All 10 known Qdrant collections, deleted concurrently via buffer_unordered(10) - VectorBackend guard: skips Qdrant step when vector_backend = sqlite - PostgreSQL guard: skips SQLite file deletion when database_url is postgres:// --dry-run lists byte counts per category without deleting. -y skips the confirmation prompt but never bypasses the DB lock safety check. Closes #3573
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 project purge [--config <path>] [--dry-run] [-y]CLI command that removes all project-local state in a single operation--yesdoes not bypass safety)--dry-runreports byte counts per category without deletingvector_backend = sqlite; PostgreSQL guard: skips SQLite file deletion whendatabase_urlispostgres://Changes
src/cli.rs—Command::Project { command: ProjectCommand }+ProjectCommand::Purgesrc/commands/project.rs— new:PurgeEngine,PurgeReport,PurgeCategory,PurgeItem, all purge steps, 14 unit testssrc/commands/mod.rs— exposemod projectsrc/runner.rs— dispatch arm forCommand::ProjectCHANGELOG.md—[Unreleased]entryTest Plan
cargo nextest run --workspace --lib --bins -E 'test(purge)'→ 14/14 passcargo +nightly fmt --check→ cleancargo clippy --workspace --all-targets --features "desktop,ide,server,chat,pdf,scheduler" -- -D warnings→ cleanzeph project purge --dry-run→ verify byte-count report, no deletionszeph project purge -y→ verify SQLite + artifacts removed.local/testing/playbooks/project-purge.mdfor full scenario matrixCloses #3573