← Back to Pull requests

Return finished briefs instead of "being written" on frozen instances #13

Closed
unknown closed this pull request without merging on Nov 22, 2026 19:46 UTC
View on GitHub
unknown unknown commented on Nov 22, 2026 19:45 UTC
Author

Found while verifying the production deploy of main.

Bug


After a brief was written, get_build_brief kept answering "The brief … is being written right now", even though /j/<id> showed the finished brief. In production this persisted well past the intended 60 s.

Cause


After a successful write, the in-memory entry was removed by a 60 s setTimeout. Vercel freezes an instance between requests, so the timer may not fire. Meanwhile, lookups saw the entry and reported the job as pending before checking whether it had finished.

Fix


  • Freshness is judged by the clock at lookup time, with no timer.

  • A finished successful write is returned as the saved brief.

  • A failed write is forgotten immediately so it can be retried.

  • The map is capped at 1,000 entries.

  • Server version is bumped to 0.6.0, so production visibly identifies the build.
  • Verification


  • 249 tests pass, including 2 new regression tests. One reproduces the bug: lookup immediately after a write returns saved. The other uses mocked time to confirm the minute-long window expires with no timer involved.
  • 🤖 Generated with Claude Code

    Diff: 145 lines (+108 / -37) across 1 files Reviewer: cursor[bot] Review duration: 1m
    All Vouch review confidence checks passed
    Residual risk 0.19 = Change Risk (0.33) × (1 − Review Confidence (0.43)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.33 · 145 lines diff across 1 files
    0.33
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 49% · Reviewer familiarity: 35%
    43%
    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.298
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #13"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 43.3% 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: 32.8% (LOW) · Higher = larger blast radius
    32.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.3% · Lower = rushed or shallow review
    43.3%
    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.6% · Safe to merge
    18.6%