feat: add rtk clean command to reset tracking history#694
Open
cubicj wants to merge 2 commits intortk-ai:developfrom
Open
feat: add rtk clean command to reset tracking history#694cubicj wants to merge 2 commits intortk-ai:developfrom
rtk clean command to reset tracking history#694cubicj wants to merge 2 commits intortk-ai:developfrom
Conversation
Contributor
|
Hey We are cleaning up the codebase and improving the project structure for better onboarding. As part of this effort, PR #826 reorganizes No logic changes — only file moves and import path updates. What you need to doRebase your branch on git fetch origin && git rebase origin/developGit detects renames automatically. If you get import conflicts, update the paths: use crate::git; // now: use crate::cmds::git::git;
use crate::tracking; // now: use crate::core::tracking;
use crate::config; // now: use crate::core::config;
use crate::init; // now: use crate::hooks::init;
use crate::gain; // now: use crate::analytics::gain;Need help rebasing? Tag @aeppling |
c1f9ff2 to
8e15b21
Compare
Clears all token savings records from the SQLite database, allowing users to start fresh with `rtk gain` analytics. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- test_clear_all_deletes_records: verify record count and DB emptied - test_clear_all_empty_db: zero records returns 0 - test_clear_all_clears_parse_failures: both tables cleared All tests use isolated temp DB via RTK_DB_PATH to avoid interference. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
8e15b21 to
b74f6b9
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
rtk cleancommand that clears all token savings records from the SQLite tracking databasecommandsandparse_failurestables, returns count of deleted recordsWhy
There is no way to reset
rtk gainanalytics. When users want to start fresh (e.g. after testing, changing workflow, or benchmarking), they must manually delete the SQLite file.rtk cleanprovides a safe, built-in reset.Usage
Test plan
cargo fmt --all && cargo clippy --all-targets && cargo testrtk cleanoutput inspected,rtk gainshows empty after clean