{
"issueNumber": 234,
"branchName": "fix/234-replan-invalidate-cache",
"generatedAt": "2026-04-02T12:00:00Z",
"stories": [
{
"id": "S1",
"title": "Add replanAttempt column to TaskEntity and resetForReplan() to TaskStateService",
"priority": 1,
"dependsOn": [],
"acceptanceCriteria": [
"TaskEntity has replanAttempt integer column with default 0",
"resetForReplan() resets all phases, nullifies prNumber/prBranch, increments replanAttempt",
"Unit tests cover resetForReplan happy path and idempotent re-entry"
],
"passes": false,
"completedAt": null
},
{
"id": "S2",
"title": "Add clearPlanArtefacts() to ArtefactsService and update DirectiveService replan handler",
"priority": 2,
"dependsOn": [
"S1"
],
"acceptanceCriteria": [
"clearPlanArtefacts removes plan.md, context.json, prd.json from task plan directory",
"Replan handler uses resetForReplan(), calls clearPlanArtefacts(), records replan_attempt event",
"Open PR gets superseded comment before closing",
"Closed/merged PR is left untouched",
"No-op when no prior artefacts exist"
],
"passes": false,
"completedAt": null
},
{
"id": "S3",
"title": "Update restart handler to clear PR state and add comprehensive tests",
"priority": 3,
"dependsOn": [
"S1"
],
"acceptanceCriteria": [
"Restart directive clears prNumber and prBranch",
"Restart closes open PR with superseded comment if exists",
"Unit tests cover: restart clears PR, replan increments counter, no-op with no prior state",
"npm run test and npm run lint pass"
],
"passes": false,
"completedAt": null
}
]
}