AI Agents SDE Task Viewer
      • Pr description
  1. Home
  2. AgentSDE
  3. agent-core
  4. gh-263
  5. changes
  6. pr_description.md
pr_description.md(1.4 KB)· Apr 3, 2026· 1 min read
  • Title
  • Problem
  • Task / Link
  • Changes
  • Notes
  • Testing

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.ts ArtefactsService mock covers clearPlanArtefacts and buildCentralTaskDir (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
PrdAgent-runner