Skip to content

feat(gain): reset tracking stats with --reset --confirm#1247

Open
sebastiancichos wants to merge 1 commit intortk-ai:developfrom
sebastiancichos:feat/gain-reset-confirm
Open

feat(gain): reset tracking stats with --reset --confirm#1247
sebastiancichos wants to merge 1 commit intortk-ai:developfrom
sebastiancichos:feat/gain-reset-confirm

Conversation

@sebastiancichos
Copy link
Copy Markdown

Summary

Adds a safe way to clear local rtk gain statistics without deleting the database file manually.

Usage

  • rtk gain --reset --confirm (or -y / --yes) — deletes all rows in commands and parse_failures.
  • rtk gain --project --reset --confirm — deletes only commands rows for the current working directory (same path rules as --project views). Parse failures are global and are not removed in project scope.

--reset without confirmation exits with an error message (no data loss).

Implementation

  • Tracker::reset_all / Tracker::reset_project_commands in tracking.rs
  • CLI flags on Gain: --reset, --confirm with requires = "reset" for -y
  • Docs: docs/guide/analytics/gain.md, AUDIT_GUIDE.md, FEATURES.md
  • Unit tests for SQLite reset and Clap parsing

Verification

cargo fmt --all && cargo clippy --all-targets && cargo test --all

- Add Tracker::reset_all and reset_project_commands (SQLite DELETE)
- rtk gain --reset requires -y/--yes/--confirm; optional --project scope
- Document in gain guide, AUDIT_GUIDE, FEATURES
- Tests for tracker reset and CLI parsing
@pszymkowiak pszymkowiak added effort-medium 1-2 jours, quelques fichiers enhancement New feature or request labels Apr 12, 2026
@pszymkowiak
Copy link
Copy Markdown
Collaborator

[w] wshm · Automated triage by AI

📊 Automated PR Analysis

Type feature
🟢 Risk low

Summary

Adds a built-in rtk gain --reset --confirm command to safely clear local tracking statistics (commands and parse failures) from the SQLite database, with support for project-scoped resets via --project. Includes a safety guard requiring explicit --confirm/-y flag to prevent accidental data loss.

Review Checklist

  • Tests present
  • Breaking change
  • Docs updated

Analyzed automatically by wshm · This is an automated analysis, not a human review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

effort-medium 1-2 jours, quelques fichiers enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants