{
"issueNumber": 267,
"branchName": "fix/267-reset-main-repo-to-master",
"generatedAt": "2026-04-03T12:00:00Z",
"stories": [
{
"id": "S1",
"title": "Add resetToMaster() method to WorktreeService",
"priority": 1,
"dependsOn": [],
"acceptanceCriteria": [
"WorktreeService has a public resetToMaster(repo: string) method",
"Method runs git checkout master in the main repo path (REPOS_DIR/repoName)",
"Method catches errors and logs a warning — never throws"
],
"passes": false,
"completedAt": null
},
{
"id": "S2",
"title": "Call resetToMaster in PhaseRouterService finally block when no worktree",
"priority": 2,
"dependsOn": [
"S1"
],
"acceptanceCriteria": [
"executePhase finally block calls worktree.resetToMaster(task.repo) when !worktreePath",
"Call is wrapped in try/catch — failure logs warning, does not mask phase result",
"Existing worktree cleanup for isolated worktrees is unchanged"
],
"passes": false,
"completedAt": null
},
{
"id": "S3",
"title": "Add unit tests for reset-to-master behavior",
"priority": 3,
"dependsOn": [
"S1",
"S2"
],
"acceptanceCriteria": [
"phase-router spec: resetToMaster called after non-worktree phase completes",
"phase-router spec: resetToMaster error is caught and logged, not thrown",
"worktree spec: resetToMaster calls git checkout master with correct cwd",
"worktree spec: resetToMaster failure logs warning and does not throw",
"npm run test passes",
"npm run lint passes"
],
"passes": false,
"completedAt": null
}
]
}