← Back to Pull requests

Retain raw context when required fold receipt facts exceed their bounds #9673

Open
unknown opened this pull request with 233 lines diff across 2 files
View on GitHub
unknown unknown commented on Nov 30, 2026 18:18 UTC
Author

Outcome

A bounded fold receipt can omit the 65th distinct obligation or clip a long failure fact. In a fresh host session, those details can disappear from the actual next request. The shared TypeScript owner now returns KeepRaw whenever the supplied failure facts or obligations cannot fit. Bounded diagnostic fields remain available and the original work stays available for continuation.

EpochReset and FoldToReceipt use the same collector. Existing limits, exact-duplicate handling, disabled behavior, source binding, and cost checks apply.

Verification

  • The focused regression fails on the parent at an incomplete EpochReset. On this branch, it exercises both fold operators at the receipt limit and covers excess, long, and malformed facts.

  • The real benchmark worker and Core CLI from #9503 at bd95159de8a3 ran two Todo Turns with an installed Codex CLI and an isolated Responses endpoint. The original first receipt committed both lossy cases. The next fresh request omitted the last obligation in one case and the failure detail in the other. Applying the shared patch preserved both details through the original working set and both Turns settled once. The ordinary fixture still delivered the compact receipt with the required facts.

  • The focused TypeScript suite passed 14 tests, the related Python integration passed 42, and the control-plane typecheck passed. The complete native benchmark and production-provider savings remain separate acceptance work.

  • The standard premerge gate records an advisory vocabulary inventory failure on both immutable revisions. The full normalized inventories and diagnostics are identical.

  • The full TypeScript suite ran 6,933 tests with 6,928 passes, four skips, and one failure in the blocked-prerequisite wait test. The same targeted test reproduces the failure on both immutable revisions.
  • Diff: 233 lines (+174 / -59) across 2 files Reviewer: loopx-agent Review duration: 602m
    All Vouch review confidence checks passed
    Residual risk 0.20 = Change Risk (0.37) × (1 − Review Confidence (0.47)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.37 · 233 lines diff across 2 files
    0.37
    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.326
    Real PR Conversation Timeline
    1 comments
    "Review active on #9673"
    general weight: 0.35
    Reviewers
    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: 37.1% (MEDIUM) · Higher = larger blast radius
    37.1%
    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: 19.8% · Safe to merge
    19.8%