← Back to Pull requests

feat(runner): plumb full checkpoint kind and memorySizeBytes through export, upload, and restore #3106

Closed
unknown closed this pull request without merging on Nov 30, 2026 09:08 UTC
View on GitHub
unknown unknown commented on Nov 26, 2026 08:35 UTC
Author

TL;DR

Plumbs checkpoint kind (disk | full) and memorySizeBytes through apps/runner export, upload, acknowledge, and restore flows while keeping memory_checkpoint capability unadvertised.

Design doc: https://github.com/boxlite-ai/boxlite/issues/3109

Documentation: [apps/runner/README.md](apps/runner/README.md)

How it works

ExportCheckpointPayload, Reference, and RestoreRequest accept optional kind (defaulting to disk). Under the source operation lease, ExportCheckpoint requires StateRunning for full (vs StateStopped for disk), calls ExportWithOptions(IncludeMemory: true), verifies the exported path is a regular file directly inside the staging directory before reading memory_checkpoint.memory_size_bytes from v8 manifests (leaving cleanup to the staging directory defer), and compares *int64 values via artifactsEqual instead of pointer addresses.

On restore, r.Kind is checked against r.Archive.NormalizedKind(), same-operationId journal replays normalize omitted "" and explicit "disk" kinds before comparing requests, and candidates must be stopped with PID == 0 (recovery predecessors must be stopped or failed with PID == 0). Before rewriting manifest.json and streaming the tar tail unchanged, checkpointImportArchive rejects v8 archives declared as disk and validates that memory_checkpoint presence and memory_size_bytes match the declared Artifact kind and memorySizeBytes.

Verification

  • (umask 022 && go test -count=1 ./pkg/checkpoint/...) (in apps/runner) → passed on 6fbc7a9aa, including kind-mismatch, configured candidate/predecessor rejection, full export replay, and ""/"disk" restore retry normalization regressions.

  • go test -count=1 -v -run 'TestCheckpoint' ./pkg/boxlite/checkpoint_archive.go ./pkg/boxlite/checkpoint_import_test.go (in apps/runner) → passed on 6fbc7a9aa (v8-as-disk rejection, manifest kind/size validation, and exported archive path containment/symlink tests).

  • Pre-commit Quality autofix (fmt + lint checks) → passed on 6fbc7a9aa.

  • Gaps: ./pkg/boxlite and ./pkg/runner/v2/executor link tests were not re-run locally (submodules not initialized in this worktree); live full export end-to-end requires a VMM backend.
  • Diff: 285 lines (+213 / -72) across 3 files Reviewer: DefeatMan Review duration: 5792m
    All Vouch review confidence checks passed
    Residual risk 0.16 = Change Risk (0.40) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.40 · 285 lines diff across 3 files
    0.40
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    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.338
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #3106"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% 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: 39.8% (MEDIUM) · Higher = larger blast radius
    39.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: 60.5% · Lower = rushed or shallow review
    60.5%
    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: 15.7% · Safe to merge
    15.7%