Explainable Recommendations Enhancement#1
Merged
CSZHK merged 18 commits intoMay 6, 2026
Conversation
…storageCategory Add AtlasStorageCategory enum with fine-grained categories (systemCache, appCache, developerArtifact, browserData, logFile, downloadArtifact, mailAttachment, oldBackup). Add FileAgeInfo struct for file age metadata. Add FindingAggregate struct for risk-level summary aggregation. Extend Finding struct with optional explanation, fileAge, and storageCategory fields. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…h explanation generation logic Add AtlasFindingExplanations enum with three public API functions: - explanation(for:category:risk:fileAge:) generates human-readable cleanup explanations - ageDescriptor(from:) converts FileAgeInfo to descriptors like "not used in 6 months" - localizedExplanation(for:language:) returns explanations in the correct language Define 24 explanation templates (8 StorageCategory × 3 RiskLevel) with full zh-Hans and en localization strings including storage category names, file age descriptors, and combined explanation format strings. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…type, StorageCategory type, and classification functions Add RiskLevel (safe/review/advanced) and StorageCategory (systemCache, appCache, developerArtifact, browserData, logFile, downloadArtifact, mailAttachment, oldBackup) types with riskLevelForPath(), categoryForPath(), and explanationKeyFor() functions. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…amp fields Add RiskLevel, StorageCategory, LastAccessed, CreatedDate, and ExplanationKey fields to jsonEntry in cmd/analyze/json.go. Update performScanForJSON() to populate these using existing risk/category helpers and file system timestamps. Add CreatedDate field to dirEntry in main.go alongside LastAccess. Add getCreationTimeFromInfo() helper in scanner.go following the pattern of getLastAccessTimeFromInfo(). Populate CreatedDate for symlinks and regular files in scanPathConcurrent(). New JSON fields use omitempty for backward compatibility. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…ched TSV Extend MoleSmartCleanAdapter to handle enriched TSV output with optional risk level, storage category, and file age columns (columns 4-7). Add storageCategory() classification function for fallback path-based category assignment. Add enrichFindingsWithFileAge() for file age extraction via FileManager attributes. Populate explanation, fileAge, and storageCategory fields on all Finding objects using AtlasFindingExplanations. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Add Array<Finding> extension with aggregatesByRisk() that computes FindingAggregate summaries grouped by RiskLevel (safe/review/advanced) with total bytes and count, and groupedByStorageCategory() that returns [String: [Finding]] grouped by AtlasStorageCategory. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…l space breakdown Add AggregateSummaryCard.swift that displays total reclaimable space grouped by risk level (safe/review/advanced) with a visual proportion bar, per-level byte counts, finding counts, and summary text. Follows AtlasHeroCard pattern for card styling with AtlasTone system. Includes EN and zh-Hans localization keys for all new strings. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…g row component Introduces FindingRowView.swift in AtlasFeaturesSmartClean, an enhanced row component for displaying individual scan findings. Shows title, detail, size, risk badge (AtlasStatusChip with tone), file age indicator (relative date), storage category tag, and collapsible human-readable explanation text. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…all new components - Add AggregateSummaryCard above risk sections to show total reclaimable space breakdown - Replace inline AtlasDetailRow finding rows with FindingRowView components - Add category sub-grouping within each risk section using AtlasSectionDisclosure - Wire up FindingAggregate calculation via AggregateSummaryCard from findings array - Preserve existing scan/preview/execute flow unchanged Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…ble.strings Add smartclean-prefixed localization keys for: - Risk level descriptions (safe/review/advanced) - Explanation templates per storage category (8 categories) - File age labels (lastAccessed, created, notUsedIn) - Aggregate summary labels (title, safelyCleanable, needsReview, requiresAdvanced) - Category display names (8 storage categories) Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…lproj/Localizable.strings Add Chinese (Simplified) translations for all new explainable recommendations keys: risk level descriptions, explanation templates per category×risk, file age labels, aggregate summaries, and category display names. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…est Finding initialization with new fields (explanation, fileAge, storageCategory), AtlasStorageCategory raw values and caseIterable, FileAgeInfo struct, FindingAggregate calculation, explanation generation via AtlasFindingExplanations, and ageDescriptor() with various date offsets. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…nriched JSON output Add comprehensive table-driven tests for: - riskLevelForPath(): safe/review/advanced risk classification - categoryForPath(): all 9 storage categories - explanationKeyFor(): every category+risk combination - JSON entry serialization with new fields and backward compatibility - isDeveloperArtifactName() helper Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…changes Add 17 new tests covering enriched TSV parsing, file age extraction, fallback parsing, storage category classification, and FindingAggregate computation. All 19 tests pass (2 existing + 17 new). Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…egration Fix missing localization keys for FindingRowView in both en and zh-Hans. Fix incorrect localization key references in FindingRowView. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
The Go explanationKeyFor function was generating keys with the format "smartclean.explanation.<category>.<risk>", but the actual localization keys in both en.lproj and zh-Hans.lproj use "explanation.<category>.<risk>" format (matching the Swift-side AtlasFindingExplanations convention). This fixes the Go JSON API output to produce correct localization keys that actually exist in the localization files. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
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.
Strengthen the explainable recommendation system by enriching every finding with risk-level grouping (safe/caution/danger), file age context, storage category tags, and human-readable explanations of why each finding is recommended for cleanup. Add aggregate summaries that explain the overall scan results before users commit.