Skip to content

Releases: snipcodeit/mgw

v0.6.0 — Test Infrastructure & CI Hardening

06 Mar 12:05

Choose a tag to compare

What's New

This release ships the complete test infrastructure for MGW and fixes CI to run cleanly on Node 18 and 20.

Testing Framework

MGW now has a full test suite (173 tests across 6 files) backed by purpose-built mock layers:

  • lib/mock-github.cjs — GitHub API interceptor that routes gh CLI calls to local JSON fixtures, enabling offline pipeline tests without hitting the GitHub API
  • lib/mock-gsd-agent.cjs — Fake Task() agent stubs that return fixture-driven outputs for planner, executor, verifier, and comment classifier agents
  • lib/mock-gsd-agent.cjs + lib/mock-github.cjs — Both mocks activate via setup.js and deactivate cleanly after each test, giving tests full control over pipeline behavior

Test Coverage

Test File Tests What It Covers
checkpoint.test.js 36 Checkpoint read/write, merge strategy, resume detection
validate-and-load.test.js 23 State file lifecycle, staleness detection, schema migration
pipeline-transitions.test.js 28 Stage transition rules, hook firing, failed-issue recovery
project-state-detection.test.js 19 All six mgw:project STATE_CLASS routing paths
milestone-execution.test.js 39 Dependency ordering, blocked-issue detection, abort/skip/retry
sync-drift.test.js 28 Drift detection, auto-sync, comment delta, label drift

CI/CD

  • Added test.yml workflow — runs npm test on Node 18 and 20 matrix on every push and PR
  • Added test:coverage step (Node 20 only) with 70% line threshold and artifact upload
  • Fixed ESM config loading failure on Node 18: renamed vitest.config.jsvitest.config.mjs
  • Resolved all 64 ESLint errors across lib/ and test/ files (unused vars, missing error causes, useless assignments, missing Node globals for ESM test files)

Bug Fixes

  • lib/retry-policy.cjs: Fixed abort listener leak in backoff Promise — the resolve reassignment pattern didn't work because setTimeout captured the original reference; restructured to properly remove the listener when the timer fires
  • lib/state.cjs: Added { cause: err } to re-thrown errors for better stack traces in pipeline failures
  • lib/diagnostic-hooks.cjs: Removed unused path/fs requires

173 tests passing. Lint clean. CI green on Node 18 and 20.

What's Changed

  • feat: add lib/mock-github.cjs with GitHub API interceptors for tests by @snipcodeit in #258
  • feat: add lib/mock-gsd-agent.cjs with fake Task() agent stubs by @snipcodeit in #259
  • feat: add vitest test runner with fixture loader and mock activation by @snipcodeit in #260
  • test: integration tests for validate_and_load and state lifecycle by @snipcodeit in #261
  • test: checkpoint read/write and resume detection tests by @snipcodeit in #262
  • test(pipeline): add pipeline stage transition tests for mgw:run by @snipcodeit in #263
  • test(project): add scenario tests for all six mgw:project STATE_CLASS paths by @snipcodeit in #264
  • test: add milestone execution scenario tests by @snipcodeit in #265
  • test(sync): add scenario tests for mgw:sync drift detection and auto-sync by @snipcodeit in #266
  • ci: add test.yml workflow for Node 18 and 20 matrix by @snipcodeit in #267
  • ci(coverage): add vitest v8 coverage with 70% line threshold by @snipcodeit in #268

Full Changelog: v0.5.1...v0.6.0

v0.5.1 — Checkpoint & Resume

06 Mar 08:26

Choose a tag to compare

v0.5.1 — Checkpoint & Resume

Completes Milestone v8 Phase 46: pipeline execution state is now checkpointed at every stage transition, enabling resume after interruption.

What's New

Checkpoint Schema & Atomic Writes (PR #244, #245)

  • Defined CHECKPOINT_SCHEMA_VERSION with fields: pipeline_step, step_progress, last_agent_output, artifacts, resume, started_at, updated_at, step_history
  • atomicWriteJson() — write-to-tmp-then-rename prevents state corruption from SIGINT, crashes, or context timeouts
  • updateCheckpoint() — shallow-merge semantics: scalar fields overwrite, artifacts and step_history are append-only
  • initCheckpoint() — creates fresh checkpoint with schema version stamp
  • Checkpoint writes added at every pipeline stage: triage → plan → execute → verify → PR

Resume Detection & Auto-Resume (PR #246)

  • detectCheckpoint() — finds checkpoints with progress beyond triage
  • resumeFromCheckpoint() — maps resume actions to pipeline stages (spawn-executorexecuting, create-prpr-pending, etc.)
  • clearCheckpoint() — resets checkpoint for fresh pipeline runs
  • Triage step now prompts Resume/Fresh/Skip when a checkpoint exists
  • Resume context carries step-specific data (quick_dir, plan_num, phase_number) so the target stage can pick up exactly where it left off

Workflow Documentation

  • commands/workflows/state.md updated with checkpoint resume, writes, and atomic writes integration points
  • Checkpoint lifecycle fully documented: init → write → detect → resume/clear

Full Phase 46 PRs

  • #244 — Design checkpoint schema for pipeline execution state
  • #245 — Implement checkpoint writes at each pipeline stage transition
  • #246 — Add resume detection and auto-resume to mgw:run startup

Previous Release (v0.5.0)

See v0.5.0 release notes for the agent reliability infrastructure (failure taxonomy, diagnostics, retry policies, model fallback, criticality classification).

v0.5.0 — Agent Reliability & Failure Recovery

06 Mar 07:45

Choose a tag to compare

MGW now has a formal agent failure handling infrastructure. When GSD agents fail during pipeline execution, MGW can classify the failure, retry intelligently, fall back to cheaper models, and degrade gracefully for non-critical agents — instead of hard-crashing the pipeline.

This release also validates the structured comment system shipped in v0.4.0: issue #230's planner agent successfully read #229's summary from structured issue comments and produced a correctly integrated module, proving multi-machine context sharing works as designed.

Core Changes

Agent Failure Taxonomy (lib/agent-errors.cjs) — #238

5 canonical failure types with structured error codes, severity levels, and recovery actions. classifyAgentFailure() handles both pattern-matching and context-based classification.

Structured Diagnostic Logger (lib/agent-diagnostics.cjs) — #239

Non-blocking telemetry capture for every agent invocation. Per-entry JSON files to .mgw/diagnostics/ with 30-day auto-pruning and 3-tier graceful fallback for classification.

Diagnostic Capture Hooks (lib/diagnostic-hooks.cjs) — #240

beforeAgentSpawn()/afterAgentSpawn() wrappers instrumented across all 9 Task() spawn points in the mgw:run pipeline.

Configurable Retry Policy Engine (lib/retry-policy.cjs) — #241

Per-failure-type retry limits with exponential backoff + jitter. Per-agent-type overrides from .mgw/config.json. executeWithPolicy() wraps Task() calls with automatic retry.

Model Fallback Strategy (lib/model-fallback.cjs) — #242

ModelFallbackEngine provides per-agent-type model tier fallback (opus → sonnet → haiku) when retry policy exhausts. Configurable, disabled by default.

Graceful Degradation (lib/agent-criticality.cjs) — #243

All 9 agent spawn points classified as critical or advisory. Advisory agents (comment classifier, plan-checker, verifier) degrade gracefully on failure. Critical agents trigger retry/fallback/dead-letter.

New Files

File Lines Purpose
lib/agent-errors.cjs 384 Agent failure taxonomy
lib/agent-diagnostics.cjs 451 Diagnostic logger
lib/diagnostic-hooks.cjs 326 Diagnostic capture hooks
lib/retry-policy.cjs 557 Retry policy engine
lib/model-fallback.cjs 421 Model fallback engine
lib/agent-criticality.cjs 227 Agent criticality classification

Total: ~2,366 new lines of reliability infrastructure

What's Next

Milestone v8 Phase 46 (Checkpoint & Resume) remains:

  • #235 — Design checkpoint schema
  • #236 — Implement checkpoint writes
  • #237 — Add resume detection and auto-resume

Full Changelog: v0.4.0...v0.5.0

v0.4.0

06 Mar 02:10

Choose a tag to compare

What's Changed

  • feat(providers): multi-provider AI architecture by @snipcodeit in #171
  • feat(context): multi-machine context sharing via structured issue comments by @snipcodeit in #178

Full Changelog: v0.3.0...v0.4.0

v0.3.0

05 Mar 21:19

Choose a tag to compare

What's Changed

Full Changelog: v0.2.0...v0.3.0