← Back to Pull requests

Carry time already slept across session dumps #1292

Open
unknown opened this pull request with 254 lines diff across 3 files
View on GitHub
unknown unknown commented on Nov 09, 2026 16:19 UTC
Author

Restoring a dump reset max_total_sleep usage to zero: the pool's SessionBudget::forget cleared sleep_used on load and the wire had no field to carry it, contradicting the snapshot docs.

The interpreter's ResourceTracker now records each capped system sleep as the sandbox requests it (serialized with #[serde(default)], so older dumps load with nothing slept) and refunds it when the host aborts the call. Workers report the total as ChildEvent.total_sleep_micros (tag 31) and the WASM component as total-sleep-micros; the pool and the JS wasm transport adopt it from a Load reply. The sleep a restored suspension re-announces is already in that total, so it is checked against the limit without being charged again.

<!-- This is an auto-generated description by cubic. -->
---

Summary by cubic


Restoring a dump no longer resets max_total_sleep usage — the time a session already slept now travels in the dump and is adopted from the Load reply.

The interpreter records each capped system sleep as the sandbox requests it, refunds it when the host aborts the call or abandons the pending REPL call, and serializes it into dumps (older dumps load with zero slept). On restore, the parent removes the sleep the dump is suspended on from the adopted total and charges it again, so it is counted once; a dump that records no sleep charges that pending sleep in full.

<sup>Written for commit bb84182bd1d64ca6d5a4337b0c9bb9c55ae5062e. Summary will update on new commits.</sup>

<a href="https://cubic.dev/pr/pydantic/monty/pull/1292?utm_source=github" target="_blank" rel="noopener noreferrer" data-no-image-dialog="true"><picture><source media="(prefers-color-scheme: dark)" srcset="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://www.cubic.dev/buttons/review-in-cubic-light.svg"><img alt="View guided diff" src="https://www.cubic.dev/buttons/review-in-cubic-light.svg"></picture></a>

<!-- End of auto-generated description by cubic. -->

Diff: 254 lines (+190 / -64) across 3 files Reviewer: rewitt94 Review duration: 30549m
All Vouch review confidence checks passed
Residual risk 0.23 = Change Risk (0.44) × (1 − Review Confidence (0.47)). Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.44 · 254 lines diff across 3 files
0.44
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.332
Ai Authored ai_authored
0.050
Real PR Conversation Timeline
1 comments
"Review active on #1292"
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: 44.1% (MEDIUM) · Higher = larger blast radius
44.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: 23.5% · Safe to merge
23.5%
Repository