feat(run): add resume detection and auto-resume to mgw:run startup#246
Merged
snipcodeit merged 4 commits intomainfrom Mar 6, 2026
Merged
Conversation
Add detectCheckpoint(), resumeFromCheckpoint(), and clearCheckpoint() to lib/state.cjs for pipeline resume detection at mgw:run startup. - detectCheckpoint(issueNumber): checks if active state file has a checkpoint with pipeline_step beyond "triage", returns checkpoint data if resumable - resumeFromCheckpoint(issueNumber): returns checkpoint data plus computed resumeStage based on resume.action mapping - clearCheckpoint(issueNumber): resets checkpoint to null for fresh-start scenarios Closes #237 (partial) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add checkpoint detection logic to the validate_and_load step in commands/run/triage.md. When a prior pipeline run left a checkpoint with progress beyond triage, the pipeline now: 1. Detects the checkpoint via detectCheckpoint() 2. Displays checkpoint state (step, completed work, artifacts) 3. Offers Resume/Fresh/Skip options via AskUserQuestion 4. Resume: loads checkpoint context and jumps to appropriate stage 5. Fresh: clears checkpoint via clearCheckpoint() and starts over 6. Skip: exits pipeline for this issue This enables recovery from interrupted sessions, context switches, and multi-session pipeline execution without losing prior work. Closes #237 (partial) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add comprehensive documentation for the checkpoint resume system: - Resume detection functions (detectCheckpoint, resumeFromCheckpoint, clearCheckpoint) with signatures and return types - Resume action to pipeline stage mapping table - Resume detection flow diagram - Pipeline step order constant documentation - Resume context shapes per action type - Updated consumers table with checkpoint resume entry Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This was referenced Mar 6, 2026
…me-to Combine checkpoint writes (initCheckpoint, atomicWriteJson, updateCheckpoint) with checkpoint detection/resume (detectCheckpoint, resumeFromCheckpoint, clearCheckpoint). Both sides are complementary Phase 46 features. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
detectCheckpoint,resumeFromCheckpoint,clearCheckpoint) tolib/state.cjsfor pipeline resume at startupcommands/run/triage.mdvalidate_and_load step with Resume/Fresh/Skip user promptscommands/workflows/state.mdCloses #237
Milestone Context
Changes
lib/state.cjsCHECKPOINT_STEP_ORDERconstant — ordered pipeline step progressiondetectCheckpoint(issueNumber)— checks if checkpoint has progressed beyond triageresumeFromCheckpoint(issueNumber)— returns checkpoint data with computed resume stage/action mappingclearCheckpoint(issueNumber)— resets checkpoint to null for fresh-startcommands/run/triage.mdmigrateProjectState()callcommands/workflows/state.mdTest Plan
detectCheckpoint()returns null for no checkpointdetectCheckpoint()returns null for triage-only checkpointdetectCheckpoint()returns data for checkpoint at plan/execute/verify/prresumeFromCheckpoint()correctly maps resume.action to pipeline stageresumeFromCheckpoint()extracts completed steps from step_historyclearCheckpoint()sets checkpoint to null and returns{ cleared: true }Dependencies
#235— checkpoint schema design) must merge first#236— checkpoint writes) must merge first