← Back to Pull requests

update: keep the serving build when an update build fails #28

Open
unknown opened this pull request with 210 lines diff across 2 files
View on GitHub
unknown unknown commented on Nov 17, 2026 14:33 UTC
Author

Summary

Stops a failed update from leaving the app dead — the failure mode behind the last two server outages.

apply() built into .next in place; when the build failed and the rollback rebuild also failed, the repo was left with no production build, so next start died ("Could not find a production build"). Now apply() first parks the currently-serving build at .next.prev, and restoreServed() puts it back whenever no new build could be produced — a failed update still leaves a startable server running the previous version.

Also:

  • The in-place fallback now rmSyncs .next before building, which is newly safe (the parked copy survives) and clears staged partials / a poisoned build cache.

  • dump-start.cmd (on the laptop, not versioned) got a matching belt: if .next/BUILD_ID is missing at start time it runs npm run build once before next start instead of starting a dead server.
  • Link to Devin session: https://app.devin.ai/sessions/45b39ec377b74ce683bf060e7eb9d383
    Open in Devin Desktop: https://app.devin.ai/desktop/session/45b39ec377b74ce683bf060e7eb9d383?variant=devin
    Requested by: @hsk-victor
    <!-- devin-review-badge-begin -->

    ---

    🟢 Devin fixed the finding · Follow Devin's work

    <a href="https://app.devin.ai/review/hsk-victor/dump/pull/28" target="_blank"><picture><source media="(prefers-color-scheme: dark)" srcset="https://static.devin.ai/assets/gh-devin-review-dark.svg?v=4"><img src="https://static.devin.ai/assets/gh-devin-review-light.svg?v=4" alt="Devin Review"></picture></a><!-- devin-review-badge-end -->

    Diff: 210 lines (+157 / -53) across 2 files Reviewer: devin-ai-integration[bot] Review duration: 6m
    All Vouch review confidence checks passed
    Residual risk 0.22 = Change Risk (0.41) × (1 − Review Confidence (0.47)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.41 · 210 lines diff across 2 files
    0.41
    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%
    46%
    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.320
    Ai Authored ai_authored
    0.050
    Real PR Conversation Timeline
    1 comments
    "Review active on #28"
    general weight: 0.35
    Assignees
    Unassigned
    Labels
    risk: low confidence: 46.7% 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: 41.5% (MEDIUM) · Higher = larger blast radius
    41.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: 46.7% · Lower = rushed or shallow review
    46.7%
    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: 22.1% · Safe to merge
    22.1%