Skip to content

Make explain always read the cache and never update it - #315

Merged
dennisdoomen merged 4 commits into
mainfrom
claude/explain-command-cache-9fcc17
Oct 26, 2026
Merged

dennisdoomen merged 4 commits into
mainfrom
claude/explain-command-cache-9fcc17

Conversation

@dennisdoomen

Copy link
Copy Markdown
Owner

explain now uses the package cache (`.packageguard/cache.bin`) whenever it exists and never writes to it.

  • Add `AnalyzerSettings.ReadOnlyCache`: cached packages are reused regardless of age or `RefreshRiskCache`, and neither the package cache nor the GitHub caches are written.
  • `explain` always sets `UseCaching` and `ReadOnlyCache`. The `--use-caching`, `--refresh-risk-cache` and `--risk-cache-max-age-hours` options are removed from `explain`, since they no longer apply. `--cache-file-path` stays.
  • `analyze` is unchanged.

🤖 Generated with Claude Code

dennisdoomen and others added 2 commits October 26, 2026 09:00
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Comment thread Src/PackageGuard.Specs/Package/PackageInfoCollectionSpecs.cs Outdated
@github-actions

github-actions Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

Test Results

    3 files  ±0      3 suites  ±0   6m 24s ⏱️ -5s
  538 tests +2    535 ✅  - 1  3 💤 +3  0 ❌ ±0 
1 075 runs  +4  1 069 ✅  - 2  6 💤 +6  0 ❌ ±0 

Results for commit 326fa2d. ± Comparison against base commit e9df8d2.

This pull request removes 1 and adds 3 tests. Note that renamed tests count towards both.
PackageGuard.Specs.ExplainCommandSettingsSpecs ‑ Never_produces_a_negative_risk_cache_max_age
PackageGuard.Specs.ExplainCommandSettingsSpecs ‑ Always_reads_the_cache_but_never_updates_it
PackageGuard.Specs.PackageInfoSpecs ‑ Read_only_cache_reuses_expired_cached_packages
PackageGuard.Specs.ProjectAnalyzerSpecs ‑ Does_not_create_a_cache_when_the_cache_is_read_only

♻️ This comment has been updated with latest results.

@coveralls

Copy link
Copy Markdown

Coverage Report for CI Build 40289345907

Coverage decreased (-0.2%) to 81.456%

Details

  • Coverage decreased (-0.2%) from the base build.
  • Patch coverage: 2 uncovered changes across 1 file (6 of 8 lines covered, 75.0%).
  • 10 coverage regressions across 2 files.

Uncovered Changes

File Changed Covered %
Src/PackageGuard.Core/Package/PackageCacheStore.cs 3 1 33.33%
Total (4 files) 8 6 75.0%

Coverage Regressions

10 previously-covered lines in 2 files lost coverage.

File Lines Losing Coverage Coverage
Src/PackageGuard.Core/Risk/Enrichment/GitHubRepositoryRiskEnricher.cs 8 84.53%
Src/PackageGuard.Core/GitHub/GitHubApiClient.cs 2 79.22%

Coverage Stats

Coverage Status
Relevant Lines: 9946
Covered Lines: 8346
Line Coverage: 83.91%
Relevant Branches: 3627
Covered Branches: 2710
Branch Coverage: 74.72%
Branches in Coverage %: Yes
Coverage Strength: 2239.46 hits per line

💛 - Coveralls

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@dennisdoomen dennisdoomen added the enhancement New feature or request label Oct 26, 2026
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@dennisdoomen
dennisdoomen merged commit 1abbe7d into main Oct 26, 2026
7 of 8 checks passed
@dennisdoomen
dennisdoomen deleted the claude/explain-command-cache-9fcc17 branch October 26, 2026 15:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants