Metriche repository
- Star
- (48.085 star)
- Metriche merge PR
- (Merge medio 11g 1h) (45 PR mergiate in 30 g)
Descrizione
Summary
tracking.enabled and tracking.history_days are exposed in config/docs, but the v0.39.0 tracking write path appears to ignore both. database_path is honored; the enable flag and retention duration are not.
This is a local privacy/control hardening issue, not an accusation of malware.
Version / tag / commit
- Tag:
v0.39.0 - Commit:
2fbc7514f6964acabcfac65501b8bb6b525e3aa8
Evidence
Config exposes tracking controls:
src/core/config.rs:34-40definesTrackingConfig { enabled, history_days, database_path }.src/core/config.rs:42-49defaultsenabled = trueandhistory_days = DEFAULT_HISTORY_DAYS.docs/guide/getting-started/configuration.md:25-28documents[tracking] enabled = true,history_days = 90, anddatabase_path.
The tracking write/retention path does not appear to use enabled or history_days:
src/core/tracking.rs:402-435always inserts command records intocommands.src/core/tracking.rs:465-483always inserts parse failure records intoparse_failures.src/core/tracking.rs:439-449usesDEFAULT_HISTORY_DAYSdirectly for cleanup rather thanconfig.tracking.history_days.src/core/tracking.rs:1220-1235reads config only fortracking.database_path; noenabledorhistory_dayshandling appears there.src/core/tracking.rs:1356-1397TimedExecution::trackandtrack_passthroughinstantiateTracker::new()and record without checking config.
The data being controlled is privacy-relevant local history:
src/core/tracking.rs:263-318createscommands(original_cmd, rtk_cmd, project_path, ...)andparse_failures(raw_command, error_message, ...).src/core/tracking.rs:417-426records the canonical current project path with each command.
Duplicate search performed:
gh issue list -R rtk-ai/rtk --search "tracking.enabled history_days ignored"gh issue list -R rtk-ai/rtk --search "tracking config disable command history"
Only broad security issue #640 appeared; no focused duplicate was found.
Impact
A user who sets:
[tracking]
enabled = false
history_days = 7
would reasonably expect local command history to stop and retention to shorten. In v0.39.0, static source review indicates command history and parse failures are still written, and cleanup still uses the compile-time 90-day default.
Verification steps
- Inspect
src/core/config.rsforTrackingConfig. - Inspect
src/core/tracking.rsrecord and cleanup paths. - Confirm
database_pathis read butenabledandhistory_daysare not applied before inserting records or deleting old rows.
Suggested mitigation
- Honor
tracking.enabled = falseby making tracking writes no-op before opening/inserting into the DB, or by returning a disabled tracker state. - Use
config.tracking.history_daysin cleanup instead ofDEFAULT_HISTORY_DAYS. - Add regression tests for disabled tracking and custom retention.
- Clarify docs if any fields are intentionally deprecated or unsupported.