{
"meta": {
"agent": "planner",
"task_id": "470",
"title": "Show release context in plan comment when task belongs to a release",
"created_at": "2026-04-13T12:00:00Z"
},
"inputs": [
{
"name": "issue-470",
"type": "context",
"ref": "https://github.com/AgentSDE/agent-core/issues/470",
"notes": "Feature request: release context section in plan comment"
},
{
"name": "release.service.ts",
"type": "file",
"ref": "src/release/release.service.ts",
"notes": "findActiveForTask() returns releaseId, rcBranch, baseBranch — needs key, title, status, directive"
},
{
"name": "phase-hooks.service.ts",
"type": "file",
"ref": "src/hooks/phase-hooks.service.ts",
"notes": "onPlanComplete() posts simple text — needs release context logic"
},
{
"name": "github.service.ts",
"type": "file",
"ref": "src/github/github.service.ts",
"notes": "Has editComment() but no findCommentByPrefix() — need to add"
}
],
"outputs": [
{
"name": "plan",
"type": "plan",
"format": "md",
"content": "plan.md"
}
],
"files": [
{
"path": "src/release/release.service.ts",
"action": "modify",
"reason": "Expand findActiveForTask() return type with key, title, status, directive"
},
{
"path": "src/github/github.service.ts",
"action": "modify",
"reason": "Add findCommentByPrefix() to locate comments by heading prefix"
},
{
"path": "src/hooks/phase-hooks.service.ts",
"action": "modify",
"reason": "Inject ReleaseService, build and append release context to plan comment"
},
{
"path": "src/hooks/phase-hooks.module.ts",
"action": "modify",
"reason": "Import ReleaseModule"
},
{
"path": "src/release/release.service.spec.ts",
"action": "modify",
"reason": "Assert expanded findActiveForTask() return fields"
},
{
"path": "src/hooks/phase-hooks.service.spec.ts",
"action": "modify",
"reason": "Test release context appended/skipped in onPlanComplete()"
}
],
"steps": [
{
"id": "S1",
"summary": "Expand findActiveForTask() return type and add findCommentByPrefix() to GitHubService",
"acceptance": [
"findActiveForTask() returns { releaseId, key, title, status, rcBranch, baseBranch, directive } when task has active release",
"findActiveForTask() returns null when task has no active release (unchanged)",
"findCommentByPrefix() returns { id, body } for matching comment or null",
"Unit tests pass for both methods"
],
"depends_on": []
},
{
"id": "S2",
"summary": "Wire release context into onPlanComplete() hook with fallback and tests",
"acceptance": [
"When task has active release, plan comment is edited to include ## Release Context section with human-readable text and collapsed JSON metadata",
"When task has no release, onPlanComplete() posts simple completion message (unchanged behavior)",
"When plan comment not found, release context posted as standalone comment",
"PhaseHooksModule imports ReleaseModule",
"Unit tests cover both release-present and no-release paths"
],
"depends_on": [
"S1"
]
}
],
"risks": [
{
"risk": "Plan comment not yet visible when onPlanComplete fires (GitHub API propagation)",
"mitigation": "Graceful fallback: post release context as separate comment if plan comment not found"
},
{
"risk": "Issues with many comments may require pagination in findCommentByPrefix",
"mitigation": "Use per_page=100 and paginate; plan comments are typically recent"
}
],
"assumptions": [
"The plan-and-propose skill always posts a comment starting with '## Agent Plan' before onPlanComplete fires",
"ReleaseModule is already exported and can be imported by PhaseHooksModule without circular dependencies"
],
"open_questions": []
}