AI Agents SDE Task Viewer
      • Context
      • Plan
      • Prd
  1. Home
  2. AgentSDE
  3. agent-core
  4. gh-263
  5. plan
  6. context.json
context.json(3.6 KB)· Apr 3, 2026
{
  "meta": {
    "agent": "planner",
    "task_id": "263",
    "title": "Fix E2E failure on replan/restart plan invalidation (PR #261)",
    "created_at": "2026-04-03T15:00:00Z"
  },
  "inputs": [
    {
      "name": "issue-263",
      "type": "context",
      "ref": "https://github.com/AgentSDE/agent-core/issues/263",
      "notes": "E2E failure on PR #261 — timeout/cancelled, not assertion failure"
    },
    {
      "name": "pr-261",
      "type": "link",
      "ref": "https://github.com/AgentSDE/agent-core/pulls/261",
      "notes": "feat/issue-234 branch — adds resetForReplan, clearPlanArtefacts, restart PR cleanup"
    },
    {
      "name": "ci-run",
      "type": "log",
      "ref": "https://github.com/AgentSDE/agent-core/actions/runs/23927729134",
      "notes": "E2E job cancelled at step 5 — likely infra timeout per reviewer"
    }
  ],
  "outputs": [
    {
      "name": "plan",
      "type": "plan",
      "format": "md",
      "content": "plan.md"
    }
  ],
  "files": [
    {
      "path": "test/integration/replan-directive.integration.spec.ts",
      "action": "create",
      "reason": "Integration test for replan directive lifecycle — validates new state contract"
    },
    {
      "path": "test/integration/restart-directive.integration.spec.ts",
      "action": "create",
      "reason": "Integration test for restart directive lifecycle — validates PR cleanup and state reset"
    },
    {
      "path": "test/integration/blocked-persistent-to-refine.integration.spec.ts",
      "action": "inspect",
      "reason": "Verify ArtefactsService mock completeness after PR #261 changes"
    }
  ],
  "steps": [
    {
      "id": "S1",
      "summary": "Create replan directive integration test with real TaskStateService + in-memory SQLite",
      "acceptance": [
        "Test verifies: task with plan+PR → replan → artefacts cleared, prNumber/prBranch null, replanAttempt incremented, phases reset to pending, currentPhase=refine, refine enqueued",
        "Test verifies: superseded comment posted on PR before close",
        "Test verifies: replan on terminal task is rejected"
      ],
      "depends_on": []
    },
    {
      "id": "S2",
      "summary": "Create restart directive integration test validating PR cleanup and state reset",
      "acceptance": [
        "Test verifies: task with open PR → restart → PR closed, prNumber/prBranch cleared, phases reset, refine enqueued",
        "Test verifies: plan artefacts NOT cleared during restart (contrast with replan)",
        "Test verifies: restart on active task is rejected"
      ],
      "depends_on": [
        "S1"
      ]
    },
    {
      "id": "S3",
      "summary": "Verify existing blocked-persistent-to-refine integration test and run full test suite",
      "acceptance": [
        "blocked-persistent-to-refine.integration.spec.ts ArtefactsService mock covers clearPlanArtefacts and buildCentralTaskDir",
        "npm run test passes with zero failures (excluding pre-existing ws-gateway issue)",
        "npm run lint passes with zero warnings"
      ],
      "depends_on": [
        "S1",
        "S2"
      ]
    }
  ],
  "risks": [
    {
      "risk": "E2E timeout was infra-related, not a code regression",
      "mitigation": "Re-trigger E2E CI after merging — if timeout recurs, escalate as infra issue"
    },
    {
      "risk": "New integration tests may need ArtefactsModule wiring that doesn't exist yet",
      "mitigation": "Follow blocked-persistent-to-refine pattern — mock ArtefactsService, use real TaskStateService + SQLite"
    }
  ],
  "assumptions": [
    "E2E failure was a timeout/cancellation (confirmed by CI logs: step 5 cancelled, not failed)",
    "No replan/restart-specific E2E tests exist in agent-core-e2e — the gap is integration test coverage in agent-core",
    "TypeORM synchronize:true handles the new replan_attempt column without explicit migration"
  ],
  "open_questions": []
}
Plan