Issue-lifecycle M4 - MR scope completeness - Implementation Plan¶
For agentic workers: REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development. Steps use
- [ ]checkboxes.
Goal: The Implement run reports what it delivered; the MR body states the delivered scope; a partial delivery opens a follow-up issue for the remainder. (Part B.)
Architecture: Per spec. The agent calls change_summary at the end of an Implement run; the operator uses it for the MR title/body and the follow-up decision. Repos: tatara-cli + tatara-operator.
Task 1: change_summary MCP tool (cli)¶
Files: tatara-cli/internal/mcp/tools.go; Tests.
- Failing test:
change_summaryaccepts{pr_title, pr_body, delivered_scope, remaining_scope?}(task auto-resolved fromTATARA_TASK), POSTs to/tasks/{tk}/change-summary. - Implement. Test PASS. Commit (cli)
feat(cli): change_summary tool.
Task 2: Operator stores change summary¶
Files: api/v1alpha1/task_types.go (status changeSummary sub-struct: PRTitle, PRBody, DeliveredScope, RemainingScope), operator REST handler; Tests.
- Failing test:
POST /tasks/{tk}/change-summarywritesStatus.ChangeSummaryfields. - Implement (
make manifests generatefor the new status struct). Test PASS. Commitfeat(operator): change-summary endpoint + status.
Task 3: MR body uses delivered scope¶
Files: internal/controller/lifecycle.go (Implement open-MR path); Tests.
- Failing test: when
Status.ChangeSummaryis set, the opened MR usesPRTitleas the title and a body that includesPRBody+ a "Delivered:" block fromDeliveredScope+ theCloses #Nline (M1). When unset, fall back to the M1 body (firstLine(Goal)+writeBackBody). - Implement. Test PASS. Commit
feat(controller): MR body describes delivered scope.
Task 4: Follow-up issue on remaining scope¶
Files: internal/controller/lifecycle.go; Tests.
- Failing tests: after opening the MR, if
Status.ChangeSummary.RemainingScope != ""the operatorCreateIssuein the source repo titled "Follow-up:(remaining scope)" with a body describing RemainingScopeand linking the PR URL; the new issue number is recorded (e.g. appended toStatus.DiscoveredIssues). Empty remaining scope -> no issue. Idempotent: re-entry does not open a second follow-up (guard on a recorded marker). - Implement (reuse
writer.CreateIssue; the idempotency guard mirrorscreateProposal's source-set guard - record the follow-up issue URL and skip if present). - Test PASS. Commit
feat(controller): partial delivery opens a follow-up issue.
Self-review¶
- Follow-up issue creation is idempotent across re-implement/re-entry.
- MR body falls back gracefully when the agent did not call change_summary.
- Delivered/remaining scope is agent-self-reported (the operator cannot verify "full scope"; documented).
- Full suite green across touched repos; lint clean.