← Back to Pull requests

fix: cache mise binary for caches saved without a version record #648

Closed
unknown closed this pull request without merging on Oct 03, 2026 23:53 UTC
View on GitHub
unknown unknown commented on Oct 03, 2026 22:44 UTC
Author

<!-- entire-trail-link-start -->
https://entire.io/gh/jdx/mise-action/trails/23
<!-- entire-trail-link-end -->

Problem


A main cache saved before the mise-version record existed is verified against the latest release. When a newer mise ships, verification fails and mise is reinstalled (latest-version lookup, checksum fetch, binary download). An exact main-cache hit is never re-saved and auto_update: false never writes the binary cache, so this repeats on every run, and a cache hit every run never expires. Found by Greptile on #646.

Fix


On that legacy no-record path, restore the version-keyed binary cache (mise-bin-v1-…-<version>, the same one auto_update uses) before verifying. On a miss the reinstalled binary and its mise-version record are saved there, so later runs restore and verify without downloading.

Notes


  • Typecheck, lint, tests and build pass; dist/ rebuilt.

  • Not exercised end-to-end: the behaviour depends on real GitHub cache state, so it needs a manual run against a pre-existing cache.
  • 🤖 Generated with Claude Code

    <!-- CURSOR_SUMMARY -->
    ---

    [!NOTE]

    Medium Risk

    Changes mise install/cache restore behavior for legacy caches without mise-version, which can affect CI download paths but does not touch auth or secrets.

    > Overview

    Fixes a repeat download on every workflow run when the main mise cache was saved before the mise-version file existed and auto_update is off.

    > setupMise now centralizes version-keyed binary cache restore in a useBinCache helper (same mise-bin-v1-…-<version> key as auto_update). That restore runs on the legacy path after resolving the version used for checksum verification when no version record is present, not only when auto_update is enabled. Reinstalled binaries and the new version record can then be saved to the binary cache on install, so later runs avoid re-fetching once a newer mise release makes “verify against latest” fail.

    > Comments are updated to explain why the binary cache is required when an exact main-cache hit cannot be re-saved. dist/ is rebuilt (including a trivial fs import reorder).

    > <sup>Reviewed by Cursor Bugbot for commit 007f8bb0cb6716a5aa0a0f60f4cfb93bfa79b1ab. Bugbot is set up for automated code reviews on this repo. Configure here.</sup>

    <!-- /CURSOR_SUMMARY -->

    <!-- This is an auto-generated comment: release notes by coderabbit.ai -->

    Summary by CodeRabbit

    Bug Fixes
    Mise setup can now reuse a cached binary when the latest version is selected, including when an existing cache does not record its version. This can reduce the need to fetch the binary again during setup. The change applies both when an automatic update selects the latest version and when setup uses an existing cache with no version information.

    <!-- end of auto-generated comment: release notes by coderabbit.ai -->

    Diff: 376 lines (+282 / -94) across 4 files Reviewer: jdx Review duration: 68m
    All Vouch review confidence checks passed
    Residual risk 0.17 = Change Risk (0.43) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.43 · 376 lines diff across 4 files
    0.43
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.355
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #648"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 42.9% (MEDIUM) · Higher = larger blast radius
    42.9%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 60.5% · Lower = rushed or shallow review
    60.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 16.9% · Safe to merge
    16.9%