← Back to Pull requests

fix(sandbox): restore writable files with Docker live checkpoints #1564

Open
unknown opened this pull request with 221 lines diff across 2 files
View on GitHub
unknown unknown commented on Nov 29, 2026 04:33 UTC
Author

Stacked on #1563, which adds the Calc regression fixture.

Docker's process checkpoint could resume a running workbook with an older filesystem. The worker now captures CRIU state and commits the writable layer during one pause. It thaws the parent before exporting the layer. Restore verifies the local parent image ID and supports older process-only artifacts.

Concurrent leases share the reconstructed image and serialize checkpoint starts on the same Docker daemon. Each offline child has its own loopback interface. The worker waits up to 15 seconds to confirm Docker removed each container. In an earlier eight-child run, all workbook checks passed but Docker took 6.66 seconds to remove one child.

Verification

On Ubuntu 24.04.5 with Docker 29.1.3 and CRIU 4.3.1:

  • A continuously edited unsaved Calc workbook resumed in both parent and child. Its cell value, in-memory counter and on-disk journal stayed consistent.

  • Four and eight concurrent children each retained their own edit after every sibling and the parent had written to the same cell.

  • The legacy restore retained its PID 1 marker and had a separate offline network namespace.

  • The run ended with zero containers and zero temporary checkpoint image tags.
  • All 54 Docker provider integration tests, four checkpoint-focused worker unit tests, and both default Bazel test targets passed. Targeted Clippy, formatting and ignored-test inventory checks passed. The file-size ratchet separately reports a pre-existing E2B violation on the base branch.

    Host requirements

    The worker needs temporary disk space for a base-image export, visibility of the daemon's task PIDs and cgroups, and permission to enable loopback using nsenter and ip. External volumes retain their own storage lifecycle.

    Diff: 221 lines (+165 / -56) across 2 files Reviewer: cursor[bot] Review duration: 29m
    All Vouch review confidence checks passed
    Residual risk 0.21 = Change Risk (0.37) × (1 − Review Confidence (0.43)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.37 · 221 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%
    42%
    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.323
    Real PR Conversation Timeline
    1 comments
    "Review active on #1564"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 43.0% 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: 36.8% (MEDIUM) · Higher = larger blast radius
    36.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.0% · Lower = rushed or shallow review
    43.0%
    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: 21.0% · Safe to merge
    21.0%