← Back to Pull requests

perf(resolver): skip revalidating primer packages on the second install #2023

Closed
unknown closed this pull request without merging on Dec 02, 2026 01:45 UTC
View on GitHub
unknown unknown commented on Dec 02, 2026 01:07 UTC
Author

The second install after a fresh one no longer re-asks the registry about packages that aube's bundled primer already answered.

Before: the first aube install on a clean machine serves most popular packages from the bundled primer and writes them to the packument cache marked stale. The next install then revalidated every one of those entries over the network. On vlt's next fixture that was 299 of 387 packuments, so the first cached install took about 3.5s instead of about 1s.

After: when a stale cache entry is one the primer wrote and has not been revalidated since, and the primer covers the minimumReleaseAge cutoff for that package, aube answers from the primer again instead of going to the registry. That is the same condition under which a fresh install serves the package from the primer, so a repeat install now gives the answer a fresh install would give at the same moment.

Behavior is unchanged when there is no cutoff (minimumReleaseAge: 0), when any minimumReleaseAgeExclude rule names the package (version-specific rules included), or once an entry has been revalidated from the registry: those still revalidate as before.

The primer's coverage stamp is compiled in, so this applies only within minimumReleaseAge of the primer snapshot in the build (a day with the default 1440 minutes), the same window in which a fresh install uses the primer at all. Within that window a dist-tags change made after the snapshot is not seen, as on a fresh install today.

Results

vlt's next fixture, advisory checks off, fresh home, then a repeat install with the lockfile and node_modules removed:

| | first cached install |
|---|---|
| before | 3498 ms |
| after | 538 ms |

Steady-state installs after that are unchanged at about 1.0 to 1.1s. Single runs on a shared cloud host, so treat the numbers as indicative.

Validation

  • New test stale_primer_seed_reuses_the_primer_only_under_a_covered_cutoff fails without the fix; names_package_counts_version_specific_rules covers the exclude check.

  • cargo test -p aube-resolver -p aube-registry and clippy pass.
  • AI-assisted — Tool: Claude Code; model: anthropic/claude-opus-5-5; version: unavailable.

    ---
    _Generated by Claude Code_

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

    <!-- coderabbit-ai-generated:v1 -->

    Summary by CodeRabbit

    Bug Fixes
    Cached registry data can now be reused when it is stale but still covers the configured minimum-release-age cutoff, provided the package is not excluded by a trust rule.
    Stale cached data that does not cover the cutoff continues to be checked against the registry, keeping release-age results current.
    Forced refreshes continue to bypass cached data.

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

    Diff: 355 lines (+266 / -89) across 4 files Reviewer: jdx Review duration: 37m
    All Vouch review confidence checks passed
    Residual risk 0.18 = Change Risk (0.43) × (1 − Review Confidence (0.57)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.43 · 355 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%
    56%
    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.351
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #2023"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 56.8% 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.5% (MEDIUM) · Higher = larger blast radius
    42.5%
    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: 56.8% · Lower = rushed or shallow review
    56.8%
    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: 18.4% · Safe to merge
    18.4%
    Repository