Title#
Add integration tests for replan and restart directive lifecycles
Problem#
PR #261 added resetForReplan(), clearPlanArtefacts(), and restart PR cleanup, but the E2E CI job was cancelled (infra timeout) before validating the new state contracts. Integration test coverage was missing for these two directives.
Task / Link#
Closes #263
Changes#
- Add
test/integration/replan-directive.integration.spec.ts— validates replan lifecycle: artefacts cleared, prNumber/prBranch nullified, replanAttempt incremented, phases reset, refine enqueued; terminal and active-refine rejection cases - Add
test/integration/restart-directive.integration.spec.ts— validates restart lifecycle: PR closed, prNumber/prBranch cleared, phases reset, refine enqueued, plan artefacts NOT cleared; active-task rejection case - Verify
blocked-persistent-to-refine.integration.spec.tsArtefactsService mock coversclearPlanArtefactsandbuildCentralTaskDir(already in place from PR #261)
Notes#
- The E2E timeout was infra-related (reviewer confirmed "likely-infra") — if it recurs on re-trigger it should be escalated as a CI runner capacity issue, not a code regression
Testing#
- 6 new integration tests pass (real SQLite + real TaskStateService, mocked GitHub/ArtefactsService)
- Full unit test suite: 681/681 pass (1 pre-existing ws-gateway failure unrelated to this change)
npm run lint— no new warnings or errors introduced