test: add milestone execution scenario tests#265
Merged
snipcodeit merged 2 commits intomainfrom Mar 6, 2026
Merged
Conversation
… paths (closes #253) - Extract detectProjectState() into lib/state.cjs with five-signal classification (P/R/S/M/G signals from workflows/detect-state.md) and export it - Write test/project-state-detection.test.js with 19 vitest tests: one describe block per STATE_CLASS (Fresh, GSD-Only, GSD-Mid-Exec, Aligned, Diverged, Extend) plus return-shape contract tests - Add test/fixtures/project-state/{aligned,diverged,extend}.json fixtures for pre-seeded .mgw/project.json scenarios - Include vitest infrastructure from PR chain (#247-#252): vitest.config.js, mock-github.cjs, mock-gsd-agent.cjs, loadFixture.js, setup.js, checkpoint.test.js, pipeline-transitions.test.js, all fixture files - Update package.json scripts (test→vitest run, test:node→node --test) and add vitest ^2.1.9 to devDependencies All 83 tests pass (19 new + 28 pipeline-transitions + 36 checkpoint). Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
Adds test/milestone-execution.test.js with 39 tests covering 6 scenarios: - Dependency-ordered execution via topologicalSort (5 tests) - Failed issue → Retry via resetRetryState/canRetry (6 tests) - Failed issue → Skip (blocked dependents tracking) (4 tests) - Failed issue → Abort (stops loop) (4 tests) - Rate limit guard (REMAINING < ESTIMATED_CALLS caps MAX_ISSUES) (6 tests) - Next-milestone GSD linkage check (linked vs unlinked) (6 tests) - Fixture integrity and mock setup validation (8 tests) Also adds: - test/fixtures/project-state/milestone-execution.json (4-issue dependency graph) - test/fixtures/github/rate-limit-low.json (remaining: 50 for rate limit tests) Co-Authored-By: Stephen Miller <[email protected]> Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
1 task
snipcodeit
pushed a commit
that referenced
this pull request
Mar 6, 2026
…sync Covers four scenarios from issue #255: - No-drift baseline: GH updatedAt <= local mtime → no sync fires - Stale auto-sync: GH updatedAt > local mtime → state refreshed, console.warn logged - Comment delta drift: current count > stored count → flagged in report - PR merged but stage=pr-created → pipeline_stage transitions to done 28 tests across 5 describe blocks (plus integration sync report verification). Uses mock-github.cjs for gh CLI interception and fs.utimesSync for mtime control. Also includes vitest infrastructure (vitest.config.js, test/setup.js, test/loadFixture.js, lib/mock-github.cjs, test/fixtures/github/) carried forward from PR #265 dependency. Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
This was referenced Mar 6, 2026
snipcodeit
pushed a commit
that referenced
this pull request
Mar 6, 2026
…sync Covers four scenarios from issue #255: - No-drift baseline: GH updatedAt <= local mtime → no sync fires - Stale auto-sync: GH updatedAt > local mtime → state refreshed, console.warn logged - Comment delta drift: current count > stored count → flagged in report - PR merged but stage=pr-created → pipeline_stage transitions to done 28 tests across 5 describe blocks (plus integration sync report verification). Uses mock-github.cjs for gh CLI interception and fs.utimesSync for mtime control. Also includes vitest infrastructure (vitest.config.js, test/setup.js, test/loadFixture.js, lib/mock-github.cjs, test/fixtures/github/) carried forward from PR #265 dependency. Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
snipcodeit
added a commit
that referenced
this pull request
Mar 6, 2026
…sync (#266) Covers four scenarios from issue #255: - No-drift baseline: GH updatedAt <= local mtime → no sync fires - Stale auto-sync: GH updatedAt > local mtime → state refreshed, console.warn logged - Comment delta drift: current count > stored count → flagged in report - PR merged but stage=pr-created → pipeline_stage transitions to done 28 tests across 5 describe blocks (plus integration sync report verification). Uses mock-github.cjs for gh CLI interception and fs.utimesSync for mtime control. Also includes vitest infrastructure (vitest.config.js, test/setup.js, test/loadFixture.js, lib/mock-github.cjs, test/fixtures/github/) carried forward from PR #265 dependency. Co-authored-by: Stephen Miller <[email protected]> Co-authored-by: Claude Sonnet 4.6 <[email protected]>
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
test/milestone-execution.test.jswith 39 tests covering 6 milestone orchestration scenarioscommands/milestone.mdusing mock agents and mock GitHub APItest/fixtures/project-state/milestone-execution.jsonwith a 4-issue dependency graph andtest/fixtures/github/rate-limit-low.jsonfor rate limit scenariosCloses #254
Milestone Context
Changes
test/
test/milestone-execution.test.js— 39 vitest tests across 6 describe blockstest/fixtures/project-state/milestone-execution.json— 4-issue project fixture (101←102←103 chain, 104 standalone; v1 linked, v2 unlinked)test/fixtures/github/rate-limit-low.json— Rate limit fixture with remaining: 50Scenario Coverage
Test Plan
npx vitest run test/milestone-execution.test.js— 39/39 tests pass