Conversation
Adds `rtk gain --reset` to clear all token savings stats back to zero. Implements `Tracker::reset_all()` in tracking.rs and wires the flag through the Gain command args and gain::run(). https://claude.ai/code/session_015WXbDdxEU3pXPBtheDkXcd
- reset_all() now clears both `commands` and `parse_failures` atomically via execute_batch (fixes incomplete reset reported by reviewer) - Add [y/N] confirmation prompt before --reset; mirrors init.rs pattern - Add --yes flag to skip prompt in scripts/CI - Add unit test: test_reset_all_clears_both_tables verifies both tables are empty after reset https://claude.ai/code/session_015WXbDdxEU3pXPBtheDkXcd
Avoids raw ANSI codes when stdout is piped, consistent with all other output in gain.rs. https://claude.ai/code/session_015WXbDdxEU3pXPBtheDkXcd
Tracker::new() uses a shared on-disk SQLite DB. Running reset_all() in a parallel test suite wipes records inserted by other concurrent tests, causing intermittent failures. Add Tracker::new_in_memory() (cfg(test) only) backed by an isolated Connection::open_in_memory(), and switch test_reset_all_clears_both_tables to use it. Extracted init_schema() helper to avoid duplicating DDL. https://claude.ai/code/session_015WXbDdxEU3pXPBtheDkXcd
|
|
|
Branch has been corrected |
|
Hey @vzwjustin , we will just merge the user documentation from #1029 so you can then add the new flag for gain command in this doc, then merge. Thanks for recreating with correct target I will tag you here once doc is merged on develop |
Reviewed and approved, merge condition :Will wait for #1029 to get merge in develop so we can update user doc for this, then merge this with doc |
|
@vzwjustin #1029 landed on develop can you update the rtk gain command documentation to provide information about your new flag please ? |
|
Yep give me a little bit |
Adds reset flag documentation to the upstream file path: - Quick Reference: reset usage examples with and without --yes - Command Options: Reset Flag table with --reset and --yes descriptions - Warning note about irreversibility and non-interactive behaviour https://claude.ai/code/session_015WXbDdxEU3pXPBtheDkXcd
Upstream moved this to docs/usage/AUDIT_GUIDE.md in deda44f. Removing the old path so git resolves the rename correctly on merge. https://claude.ai/code/session_015WXbDdxEU3pXPBtheDkXcd
Summary
Test plan
cargo fmt --all && cargo clippy --all-targets && cargo testrtk <command>output inspected