Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
318 changes: 2 additions & 316 deletions Cargo.lock

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions crates/chystik-cli/src/tui.rs
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,7 @@ impl ScanView {
note: "fixture".into(),
advice: None,
provenance: None,
version_group: None,
};
Self {
root: Some("/home/demo".into()),
Expand Down
12 changes: 9 additions & 3 deletions crates/chystik-cli/tests/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,13 @@ fn scan_json_writes_a_versioned_document_and_no_diagnostics_on_success() {
"generated_at must be an RFC 3339 UTC timestamp: {document}"
);
assert_eq!(document["findings"], serde_json::json!([]));
assert!(document["roots"][0].as_str().unwrap().starts_with('/'));
// Roots are absolute; a leading `/` is Unix-only, so assert absoluteness
// portably rather than by prefix (Windows roots look like `C:\…`).
let root0 = document["roots"][0].as_str().unwrap();
assert!(
std::path::Path::new(root0).is_absolute(),
"scan roots must be absolute: {root0}"
);
}

#[test]
Expand Down Expand Up @@ -234,7 +240,7 @@ fn catalog_finding_exposes_policy_and_evidence_in_json_and_verbose_output() {
.unwrap()
.contains("pip.pypa.io"));
assert!(pip["provenance"]["recovery_cost"].as_str().is_some());
assert_eq!(pip["provenance"]["reviewed_at"], "2026-08-26");
assert_eq!(pip["provenance"]["reviewed_at"], "2026-08-30");
assert!(pip["provenance"]["preconditions"]
.as_array()
.is_some_and(|preconditions| !preconditions.is_empty()));
Expand All @@ -258,7 +264,7 @@ fn catalog_finding_exposes_policy_and_evidence_in_json_and_verbose_output() {
assert!(stdout.contains("rule: python.pip.cache"));
assert!(stdout.contains("recovery:"));
assert!(stdout.contains("source: https://pip.pypa.io/"));
assert!(stdout.contains("reviewed: 2026-08-26"));
assert!(stdout.contains("reviewed: 2026-08-30"));
assert!(stdout.contains("requires:"));

let mut preview = chystik();
Expand Down
4 changes: 2 additions & 2 deletions crates/chystik-core/rules/catalog/amd.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ recovery_note = "re-download the AMD installer if it is needed for repair"
cleanup_policy = "review-required"
note = "AMD extracted installer — confirm no install or repair is in progress"
source_url = "https://rocm.docs.amd.com/projects/install-on-windows/en/latest/how-to/install.html"
reviewed_at = "2026-08-26"
reviewed_at = "2026-08-30"
preconditions = [
"the path is under the exact vendor staging root",
"the documented installer layout markers are present",
Expand All @@ -28,7 +28,7 @@ recovery_note = "games rebuild shaders on their next start"
cleanup_policy = "tool-managed"
note = "AMD shader cache — reset it through AMD Software: Adrenalin"
source_url = "https://www.amd.com/en/resources/support-articles/faqs/dh-012.html"
reviewed_at = "2026-08-26"
reviewed_at = "2026-08-30"
preconditions = [
"Chystik must not move this path to Trash",
"use the owning operating-system or vendor command instead",
Expand Down
30 changes: 30 additions & 0 deletions crates/chystik-core/rules/catalog/android-studio.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Android Studio is a JetBrains-platform IDE vendored by Google. Its
# regenerable "system" directory (caches, indexes, logs) sits under
# %LOCALAPPDATA%\Google\AndroidStudio<version>, while settings live in the
# separate roaming config directory. See:
# https://developer.android.com/studio/intro/studio-config

[[rule]]
id = "google.android-studio-system-dir"
category = "ide-toolchains"
recovery = "rebuild-redownload"
recovery_note = "Android Studio rebuilds its caches and reindexes projects on the next launch; local history and per-project workspace state in this directory are lost"
cleanup_policy = "review-required"
note = "Android Studio system directory for one version — caches and indexes rebuild on the next launch, but local history and per-project workspace state here are lost"
source_url = "https://developer.android.com/studio/intro/studio-config"
reviewed_at = "2026-08-30"
preconditions = [
"the directory is an Android Studio version system directory in the local Google vendor folder",
"settings and plugins live in the separate roaming config directory and are never touched",
]

# Match each AndroidStudio<version> directory by its regenerable caches folder.
# Chrome, the other common tenant of the local Google folder, keeps its cache
# under a nested profile path and has no top-level caches folder, so this
# marker leaves it alone.
[[rule.locator]]
platform = "windows"
root = "local-app-data"
path = "Google"
matcher = "direct-child-with-markers"
required_dirs = ["caches"]
8 changes: 4 additions & 4 deletions crates/chystik-core/rules/catalog/apple.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ recovery_note = "pods are downloaded again on the next install"
cleanup_policy = "auto-cleanable"
note = "CocoaPods download cache — restored by the next pod install"
source_url = "https://guides.cocoapods.org/using/faq.html"
reviewed_at = "2026-08-26"
reviewed_at = "2026-08-30"
preconditions = [
"the path is the exact documented cache root",
"the path remains inside a Chystik-owned user root",
Expand All @@ -25,7 +25,7 @@ recovery_note = "the selected Xcode projects rebuild indexes and products"
cleanup_policy = "review-required"
note = "Xcode DerivedData — close Xcode; the selected project's build data is rebuilt"
source_url = "https://developer.apple.com/documentation/Xcode-Release-Notes/xcode-26-release-notes"
reviewed_at = "2026-08-26"
reviewed_at = "2026-08-30"
preconditions = [
"the path is the exact Xcode developer-data child",
"Xcode should be closed before manual cleanup",
Expand All @@ -44,7 +44,7 @@ recovery_note = "connect a device again to download its support files"
cleanup_policy = "review-required"
note = "Xcode iOS DeviceSupport — device symbols download again when needed"
source_url = "https://developer.apple.com/forums/thread/683496"
reviewed_at = "2026-08-26"
reviewed_at = "2026-08-30"
preconditions = [
"the path is the exact Xcode developer-data child",
"Xcode should be closed before manual cleanup",
Expand All @@ -63,7 +63,7 @@ recovery_note = "unavailable simulator devices are removed; available runtimes s
cleanup_policy = "tool-managed"
note = "Unavailable iOS simulators — let simctl remove only devices without a runtime"
source_url = "https://developer.apple.com/forums/thread/835883"
reviewed_at = "2026-08-26"
reviewed_at = "2026-08-30"
preconditions = [
"Chystik must not move this path to Trash",
"use the owning operating-system or vendor command instead",
Expand Down
57 changes: 57 additions & 0 deletions crates/chystik-core/rules/catalog/chromium.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# Chromium-based browsers store regenerable disk caches (Cache, Code Cache,
# GPUCache) inside the profile directory under the user-data dir. History,
# cookies and site data are separate files and are never targeted. See:
# https://chromium.googlesource.com/chromium/src/+/HEAD/docs/user_data_dir.md

[[rule]]
id = "google.chrome-cache"
category = "browser-system"
recovery = "automatic"
recovery_note = "Chrome refetches cached web resources and recompiles shaders as you browse"
cleanup_policy = "auto-cleanable"
note = "Google Chrome HTTP, code and GPU caches (Default profile) — refilled as you browse"
source_url = "https://chromium.googlesource.com/chromium/src/+/HEAD/docs/user_data_dir.md"
reviewed_at = "2026-08-30"
preconditions = [
"the path is a Chromium cache subdirectory of the Default profile",
"browsing history, cookies and site data live in separate files and are not touched",
]

[[rule.locator]]
platform = "windows"
root = "local-app-data"
path = "Google/Chrome/User Data/Default/Cache"

[[rule.locator]]
platform = "windows"
root = "local-app-data"
path = "Google/Chrome/User Data/Default/Code Cache"

[[rule.locator]]
platform = "windows"
root = "local-app-data"
path = "Google/Chrome/User Data/Default/GPUCache"

[[rule]]
id = "perplexity.comet-cache"
category = "browser-system"
recovery = "automatic"
recovery_note = "Comet refetches cached web resources and recompiles shaders as you browse"
cleanup_policy = "auto-cleanable"
note = "Perplexity Comet browser HTTP and code caches (Default profile) — refilled as you browse"
source_url = "https://chromium.googlesource.com/chromium/src/+/HEAD/docs/user_data_dir.md"
reviewed_at = "2026-08-30"
preconditions = [
"the path is a Chromium cache subdirectory of the Comet Default profile",
"browsing history, cookies and site data live in separate files and are not touched",
]

[[rule.locator]]
platform = "windows"
root = "local-app-data"
path = "Perplexity/Comet/User Data/Default/Cache"

[[rule.locator]]
platform = "windows"
root = "local-app-data"
path = "Perplexity/Comet/User Data/Default/Code Cache"
8 changes: 4 additions & 4 deletions crates/chystik-core/rules/catalog/cpp.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ recovery_note = "the next C/C++ build recompiles cache misses"
cleanup_policy = "auto-cleanable"
note = "ccache compiler outputs — rebuilt while C/C++ projects compile"
source_url = "https://ccache.dev/manual/latest.html"
reviewed_at = "2026-08-26"
reviewed_at = "2026-08-30"
preconditions = [
"the path is the exact documented cache root",
"the path remains inside a Chystik-owned user root",
Expand Down Expand Up @@ -45,7 +45,7 @@ recovery_note = "the next compiler run repopulates local cache entries"
cleanup_policy = "auto-cleanable"
note = "sccache compiler outputs — rebuilt while projects compile"
source_url = "https://android.googlesource.com/toolchain/sccache/+/HEAD/docs/Local.md"
reviewed_at = "2026-08-26"
reviewed_at = "2026-08-30"
preconditions = [
"the path is the exact documented cache root",
"the path remains inside a Chystik-owned user root",
Expand Down Expand Up @@ -79,7 +79,7 @@ recovery_note = "the next vcpkg install rebuilds or downloads archives"
cleanup_policy = "auto-cleanable"
note = "vcpkg binary archives — rebuilt or downloaded by the next install"
source_url = "https://learn.microsoft.com/en-us/vcpkg/users/binarycaching"
reviewed_at = "2026-08-26"
reviewed_at = "2026-08-30"
preconditions = [
"the path is the exact documented cache root",
"the path remains inside a Chystik-owned user root",
Expand Down Expand Up @@ -113,7 +113,7 @@ recovery_note = "Conan downloads or rebuilds selected packages"
cleanup_policy = "tool-managed"
note = "Conan package storage — clean it through Conan so package references stay valid"
source_url = "https://docs.conan.io/2/reference/commands/cache.html"
reviewed_at = "2026-08-26"
reviewed_at = "2026-08-30"
preconditions = [
"Chystik must not move this path to Trash",
"use the owning operating-system or vendor command instead",
Expand Down
79 changes: 79 additions & 0 deletions crates/chystik-core/rules/catalog/dart.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
# Dart/Flutter pub package cache. Hosted packages are re-downloaded on the
# next resolve, and globally activated packages are re-activated on demand.
# Location and the PUB_CACHE override are documented at:
# https://dart.dev/tools/pub/environment-variables

[[rule]]
id = "dart.pub-cache"
category = "package-caches"
recovery = "rebuild-redownload"
recovery_note = "pub re-downloads hosted packages and re-activates global packages on the next pub get or run"
cleanup_policy = "review-required"
note = "Dart/Flutter pub package cache — re-downloaded by the next pub get"
source_url = "https://dart.dev/tools/pub/environment-variables"
reviewed_at = "2026-08-30"
preconditions = [
"the path is the documented pub system cache root",
"the path stays inside a Chystik-owned user root",
]

# Dart 3+ default on Windows.
[[rule.locator]]
platform = "windows"
root = "local-app-data"
path = "Pub/Cache"

# Pre-Dart-3 fallback on Windows.
[[rule.locator]]
platform = "windows"
root = "roaming-app-data"
path = "Pub/Cache"

[[rule.locator]]
platform = "linux"
root = "home"
path = ".pub-cache"

[[rule.locator]]
platform = "macos"
root = "home"
path = ".pub-cache"

[[rule.locator]]
platform = "all"
root = "environment"
environment = "PUB_CACHE"

# Dart Analysis Server cache/instrumentation state. The analysis server
# recreates it on the next launch; clearing it is the documented remedy for a
# stale analyzer. dart.dev names the Windows location as the server's cache dir:
# https://dart.dev/tools/analyzer-performance
[[rule]]
id = "dart.analysis-server-cache"
category = "ide-toolchains"
recovery = "automatic"
recovery_note = "the Dart Analysis Server rebuilds its driver cache and instrumentation state on the next launch"
cleanup_policy = "auto-cleanable"
note = "Dart Analysis Server cache (.dartServer) — rebuilt on the next analyzer launch"
source_url = "https://dart.dev/tools/analyzer-performance"
reviewed_at = "2026-08-30"
preconditions = [
"the path is the documented .dartServer analysis-server cache directory",
"the path stays inside a Chystik-owned user root",
]

# Dart 3+ on Windows keeps .dartServer under %LOCALAPPDATA%.
[[rule.locator]]
platform = "windows"
root = "local-app-data"
path = ".dartServer"

[[rule.locator]]
platform = "linux"
root = "home"
path = ".dartServer"

[[rule.locator]]
platform = "macos"
root = "home"
path = ".dartServer"
77 changes: 77 additions & 0 deletions crates/chystik-core/rules/catalog/electron-apps.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
# Electron apps embed Chromium and write its regenerable disk caches (Cache,
# Code Cache, GPUCache) under the app's user-data directory. Account, message
# and document data live in separate stores and are never targeted. Chromium's
# cache subdirectories under userData are documented at:
# https://www.electronjs.org/docs/latest/api/app

[[rule]]
id = "discord.cache"
category = "messengers"
recovery = "automatic"
recovery_note = "Discord refetches cached assets and recompiles code caches as you use it"
cleanup_policy = "auto-cleanable"
note = "Discord (Electron) HTTP, code and GPU caches — refilled as you use the app"
source_url = "https://www.electronjs.org/docs/latest/api/app"
reviewed_at = "2026-08-30"
preconditions = [
"the path is a Chromium cache subdirectory of the Discord user-data folder",
"account, message and settings data live in separate stores and are not touched",
]

[[rule.locator]]
platform = "windows"
root = "roaming-app-data"
path = "discord/Cache"

[[rule.locator]]
platform = "windows"
root = "roaming-app-data"
path = "discord/Code Cache"

[[rule.locator]]
platform = "windows"
root = "roaming-app-data"
path = "discord/GPUCache"

[[rule]]
id = "notion.cache"
category = "office-docs"
recovery = "automatic"
recovery_note = "Notion refetches cached assets and recompiles code caches as you use it"
cleanup_policy = "auto-cleanable"
note = "Notion (Electron) HTTP and code caches — refilled as you use the app"
source_url = "https://www.electronjs.org/docs/latest/api/app"
reviewed_at = "2026-08-30"
preconditions = [
"the path is a Chromium cache subdirectory of the Notion user-data folder",
"documents and offline data live in separate stores and are not touched",
]

[[rule.locator]]
platform = "windows"
root = "roaming-app-data"
path = "Notion/Partitions/notion/Cache"

[[rule.locator]]
platform = "windows"
root = "roaming-app-data"
path = "Notion/Partitions/notion/Code Cache"

[[rule]]
id = "antigravity.cache"
category = "ide-toolchains"
recovery = "automatic"
recovery_note = "Antigravity recompiles cached bytecode on the next launch"
cleanup_policy = "auto-cleanable"
note = "Antigravity (Electron IDE) compiled-bytecode cache — rebuilt on the next launch"
source_url = "https://www.electronjs.org/docs/latest/api/app"
reviewed_at = "2026-08-30"
preconditions = [
"the path is a Chromium cache subdirectory of the Antigravity user-data folder",
"settings, extensions and workspace state live elsewhere and are not touched",
]

[[rule.locator]]
platform = "windows"
root = "roaming-app-data"
path = "Antigravity/CachedData"
Loading
Loading