← Back to Pull requests

[PPF] Instant validation for `ensureStatic = "shell" | "prefetch"` #98249

Closed
unknown closed this pull request without merging on Sep 24, 2026 14:40 UTC
View on GitHub
unknown unknown commented on Sep 03, 2026 23:13 UTC
Author

Adjusts Instant Validation internals to validate the ShellStatic stage instead of ShellRuntime when ensureStatic >= "shell". If that's the case, the client will do a static request (and extract the shell from it), so the app shell cannot access session data (unlike the PPF default, where we use a runtime shell).

Note that in some cases, this might seem more restrictive than needed. For ensureStatic >= "shell", the client will do a static prefetch that goes up to the Static stage which resolves more things, like static params, prefetch() ( in the PrefetchStatic stage) and navigation() (in the NavigationStatic stage). However:
1. The client expects to be able to rewind the static prefetch into a shell and reuse it across the whole route, so we should be validating that the shell is actually useful.
2. For ensureStatic = "shell", we might still do a runtime prefetch (with <Link prefetch={true}>), which will not have navigation(), and validating ShellStatic catches that.

Implementation notes

  • I've renamed RequestStore.needsAppShell to RequestStore.needsRuntimeShell (undoing a previous rename), because the ShellStatic stage can _also_ be an App Shell, just not a _runtime_ one. The flag controls whether or not we're delaying link data until the runtime stages, which we don't need to do if the shell is static.

  • If we have ensureStatic >= "shell" set, we _won't_ set RequestStore.needsRuntimeShell anymore, which means that the main render can once again be re-used for both IV and SSV. prepareValidationInputsInPartialPrefetching is changed accordingly. We'll also set revealAfterStage to StaticShell to match what the client would have prefetched.

  • We add a new mode in instant validation, ValidationPrefetchKind.StaticAppShell, which checks the prefetch at the ShellStatic stage. This is enabled if we have ensureStatic >= "shell". the PPF default modeValidationPrefetchKind.RuntimeAppShell uses ShellRuntime instead.
  • Tests

  • IV should show an insight for unguarded cookies() if ensureStatic >= "shell" (unlike the default behavior of app shells)

  • IV should still show an insight for unguarded static params, prefetch(), and navigation() regardless of ensureStatic (same as default)
  • Diff: 288 lines (+216 / -72) across 3 files Reviewer: lubieowoce Review duration: 29727m
    All Vouch review confidence checks passed
    Residual risk 0.17 = Change Risk (0.40) × (1 − Review Confidence (0.57)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.40 · 288 lines diff across 3 files
    0.40
    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.339
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #98249"
    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: 39.8% (MEDIUM) · Higher = larger blast radius
    39.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: 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: 17.2% · Safe to merge
    17.2%
    Repository