← Back to Pull requests

perf(images): cache system CA roots, registry clients, manifests, and configs #3261

Open
unknown opened this pull request with 140 lines diff across 1 files
View on GitHub
unknown unknown commented on Dec 03, 2026 03:34 UTC
Author

TL;DR

Cache system CA roots, bounded per-host registry clients, verified manifests, and parsed image configs in memory.

Design doc: https://github.com/boxlite-ai/boxlite/issues/3153

Documentation: [docs/concepts/images.md](docs/concepts/images.md#in-memory-caches), [docs/guides/image-registry-configuration.md](docs/guides/image-registry-configuration.md#tls-trust)

How it works

ImageStore snapshots system roots on first successful HTTPS load (propagating failures for retry and skipping the store for plain HTTP or skip_verify), caps per-host clients with a 32-entry LRU, and caches digest-verified manifests with write-lock deduplicated Arc<ImageConfiguration> while keeping ImageObject::load_config() owned. Cold disk checks run outside the write lock with monotonic generations, digest validation, and cold-rebind rechecks.

Verification

  • make fmt:check:rust && make clippy && make test:unit:rust FILTER=images:: → passed (253/253); defect proofs fail reverted and pass restored.

  • macOS pre-push smart matrix (rust unit + 310 passed, 37 skipped integration) → passed. Linux KVM pending.
  • Diff: 140 lines (+105 / -35) across 1 files Reviewer: DefeatMan Review duration: 3646m
    All Vouch review confidence checks passed
    Residual risk 0.32 = Change Risk (0.56) × (1 − Review Confidence (0.43)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.56 · 140 lines diff across 1 files
    0.56
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.02 · 1 substantive comment(s)
    0.02
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    42%
    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
    Shallow Review Depth shallow_review_depth
    0.344
    Diff Size diff_size
    0.296
    Sensitive Paths sensitive_paths
    0.056
    Real PR Conversation Timeline
    1 comments
    "Review active on #3261"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 43.0% reviewed sensitive_module
    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: 55.8% (MEDIUM) · Higher = larger blast radius
    55.8%
    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: 43.0% · Lower = rushed or shallow review
    43.0%
    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: 31.8% · Safe to merge
    31.8%