Skip to content

feat(state): checkpoint schema for pipeline execution state#244

Merged
snipcodeit merged 5 commits intomainfrom
issue/235-design-checkpoint-schema-for-pipeline-ex
Mar 6, 2026
Merged

feat(state): checkpoint schema for pipeline execution state#244
snipcodeit merged 5 commits intomainfrom
issue/235-design-checkpoint-schema-for-pipeline-ex

Conversation

@snipcodeit
Copy link
Owner

Summary

  • Designed and implemented a forward-compatible checkpoint schema for tracking fine-grained pipeline execution progress in .mgw/active/<issue>.json state files
  • Added initCheckpoint() and updateCheckpoint() functions to lib/state.cjs with append-only artifact tracking and shallow-merge step progress
  • Extended migrateProjectState() to add checkpoint: null default to existing active issue files
  • Documented checkpoint update integration points in pipeline command files (triage, execute)

Closes #235

Milestone Context

  • Milestone: v8 — Agent Reliability & Failure Recovery
  • Phase: 46 — Checkpoint & Resume for Long-Running Pipelines
  • Issue: 7 of 9 in milestone

Changes

Schema & Documentation (commands/workflows/state.md)

  • Added checkpoint field to Issue State Schema (default: null)
  • Defined 10-field checkpoint object structure with step-specific progress shapes
  • Documented forward-compatibility contract (5 rules: unknown-field preservation, new step extensibility, schema_version bump criteria, append-only arrays, opaque resume.context)
  • Added checkpoint lifecycle diagram and consumer reference table

Implementation (lib/state.cjs)

  • CHECKPOINT_SCHEMA_VERSION = 1 — exported constant for version checking
  • initCheckpoint(pipelineStep) — creates fresh checkpoint with defaults
  • updateCheckpoint(issueNumber, data) — partial merge updater:
    • Shallow-merges scalar fields and step_progress
    • Append-only for artifacts and step_history arrays
    • Replaces resume object entirely (opaque context contract)
    • Auto-initializes checkpoint if absent
  • Extended migrateProjectState() to add checkpoint field to active issue files

Pipeline Integration (commands/run/triage.md, commands/run/execute.md)

  • Checkpoint initialization at triage (validate_and_load step)
  • Checkpoint updates after planner, executor, and verifier agents complete
  • Each update records: step progress, agent output path, artifact entry, resume instructions

Test Plan

  • initCheckpoint() creates valid structure with schema_version=1
  • updateCheckpoint() correctly merges partial data (scalar merge, step_progress merge)
  • Append-only arrays verified (artifacts count 1 → 2 after second update)
  • migrateProjectState() adds checkpoint field to all 7 existing active issue files
  • No breaking changes to existing state files or exports
  • Forward-compatibility rules verified (unknown field preservation, no fixed step validation)

Stephen Miller and others added 4 commits March 6, 2026 01:37
Add comprehensive Checkpoint Schema section to workflows/state.md that
documents the new checkpoint field on issue state objects. Includes
field definitions, step-specific progress shapes, forward-compatibility
contract, lifecycle diagram, update patterns, and consumer reference.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Extend migrateProjectState() to add a checkpoint field (default: null)
to active issue state files. Add initCheckpoint() for creating fresh
checkpoint objects and updateCheckpoint() for partial merge updates
with append-only artifacts and step_history arrays.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add checkpoint initialization in triage.md (validate_and_load step) and
checkpoint update calls at key pipeline stages in execute.md: after
planner (plan step), after executor (execute step), and after verifier
(verify step). Each checkpoint records step progress, agent output
paths, accumulated artifacts, and resume instructions.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add plan, summary, and verification artifacts for the checkpoint
schema design task.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ine-ex

Resolve conflicts in command files: combine checkpoint writes (from #244)
with diagnostic hooks and criticality annotations (from #240, #243).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@snipcodeit snipcodeit merged commit fd0398b into main Mar 6, 2026
4 of 5 checks passed
@github-actions github-actions bot added slash-commands Changes to slash command files core Changes to core library labels Mar 6, 2026
@snipcodeit snipcodeit deleted the issue/235-design-checkpoint-schema-for-pipeline-ex branch March 6, 2026 08:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core Changes to core library slash-commands Changes to slash command files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Design checkpoint schema for pipeline execution state

1 participant