Repository navigation
Closed
Labels
cc:taskCodeCrew: a task issue, attached to its milestone as a sub-issue (SPEC §4)
Description
Goal
status names each remote task/-… branch whose task is closed with the same delete-or-keep verdict milestone close would give it, computed by the same code; the implementer contract forbids a closing keyword before any ref but the task's own, and task finish notes every issue the PR's closing references would close besides the task, before the merge. Adopts #295 and #303.
Requirements
M15-R5
Adopts
- Backlog capture: status reports stale task branches, so a skipped sweep is visible before the next close #295 — Backlog capture: status reports stale task branches, so a skipped sweep is visible before the next close
- Backlog capture: PR body prose can create unintended closing references from example refs #303 — Backlog capture: PR body prose can create unintended closing references from example refs
Plan
First half — status reports stale task branches (#295).
internal/cli/branches.go:sweepItemgains aTaskOpen bool, set bystaleBranchActionon the arm where the task issue is still open. The sweep's own output is unchanged (it still printsstale branch <name>: kept (<ref> is open)); the field only lets a second caller tell that arm apart from a real keep without matching on reason prose.internal/cli/branches.go: newplanStaleReport(t, repo, defaultBranch) ([]sweepItem, bool, error)— one prefix-filteredTaskBrancheslisting for the one repo,taskNumberoff each name, andstaleBranchActionfor the verdict. It is the same functionplanStaleSweepcalls for the close's second pass, so the report and the sweep cannot disagree. It carrieshasNextPageback to the caller rather than wording it, because the sweep's wording ("a later close reaches the rest") is not true of a report.internal/cli/status.go:statusReportreadsRepoInfo(c.current)once — it already reads it for the delete-on-merge note — and, when that read succeeded, prints the stale-branch lines under it, before the contract-drift block. Per branch:stale branch: <name> — <ref> is closed; <reason> — the next milestone close would delete itor… — kept by the next milestone close. A branch whose task is open is skipped (TaskOpen). A branch whose task could not be read printsstaleBranchAction's ownnote:line verbatim, exactly as the sweep does. A truncated listing addsnote: <repo> carries more task branches than one listing holds; this report saw <n> of them. An unreadable listing is onenote:and status carries on — every check under the board is advisory and none of them may fail the verb.- Nothing to report prints nothing. Recorded as a Decision: the two notes beside it print only when they have something to say, and a line saying a repo is clean would appear on every run of the verb an operator runs most.
- The repo is
c.currentalone. Recorded as a Decision with its reasons.
Second half — the closing-reference guard (#303).
internal/tracker/tracker.go+github.go: newClosingReferences(repo string, number int) ([]TitledIssue, error)— GraphQLpullRequest.closingIssuesReferenceswithnumber,titleandrepository { nameWithOwner }, so the note can name the issue.TitledIssuealready carries exactly ref + title.internal/cli/dryrun.go:plangainsnotes []stringand aremark(...)method, printed between the gates and the actions. The existingnoteattaches to a gate; this line is not a gate's.internal/cli/task.go:planFinish, after every gate has passed and beside the adoptions read, callsClosingReferencesand recordsnote: this PR would also close <ref> (<title>) — not the taskfor every reference that is not the task.p.remarkputs it in the dry run's listing;runprints the same strings before the merge. A note, never a refusal: GitHub has already parsed the body, and no new code joins SPEC §10..codecrew/roles/implementer.md"Open the PR": the task's own number is the only closing keyword, and no closing word (close/closes/closed/fix/fixes/fixed/resolve/resolves/resolved) may precede any other#refanywhere in the body, because GitHub's PR-body parser reads prose — cite Backlog capture: PR body prose can create unintended closing references from example refs #303 and PR feat(task): task new --adopts and task finish closing the adopted captures (#270) #294, and name thegh pr view <n> --json closingIssuesReferencescheck after opening..codecrew/roles/reviewer.md: a "Review against" bullet — the PR'sclosingIssuesReferencesnames the task alone. The contracts are embedded straight out of.codecrew/roles/byassets.go, so both edits ship in the binary androles diffstays clean; verified with the built binary.
Docs.
- SPEC §6: the
statusrow gains the stale-branches sentence beside the drift and delete-on-merge one; thetask finishrow gains the closing-references note. docs/introduction.md's verb summary says only "notes" forstatusand does not enumerate them, so it needs no change. Recorded rather than left silent.- CHANGELOG entry under
## [Unreleased],(#310).
Tests.
status_test.go(statusFake grows the branch-side methods): a stale branch listed with the verdictbranchActiongives it; an open task's branch omitted; an unreadable task'snote:; the partial-listing note when the flag is set; nothing printed when there is nothing to report.dryrun_test.go(finishFake growsClosingReferences): the dry run's listing and the live run both print the note for an extra closing reference, and neither prints anything when the PR closes only the task.go test ./...,go vet ./...,gofmt -l .clean;roles diffrun from the built binary for both edited contracts.
Ask-the-human points
None. The one judgment the brief left open — what status says when it has nothing to report — is an ordinary engineering call and is recorded as a Decision.
Metadata
Metadata
Assignees
Labels
cc:taskCodeCrew: a task issue, attached to its milestone as a sub-issue (SPEC §4)
Activity
radiusred-cody commentedon Sep 7, 2026
Started by @radiusred-cody[bot].
radiusred-cody commentedon Sep 7, 2026
Decision:
statusreports the stale task branches ofc.current— the repo the verb runs in — and walks no other.Trade-off: A hub operator running
statusin the hub sees the hub's own stale branches and not a spoke's, so a spoke that accumulates them is still invisible until someone runsstatusthere or a milestone closes. That is the price of a report that costs one listing.Why here:
statushas no repo set to walk that is both complete and cheap. The hub's routing table names roles, not repos, so there is no register of spokes to read; the open milestones' tasks name repos, but the report has to work between milestones too — that quiet period is exactly when #295 says a skipped sweep goes unseen, and it is when the board is empty. Walking every repo the open milestones happen to name would multiply the cost of the verb an operator runs most often (one prefix-filtered listing plus one issue read per task branch, each), and would still miss a spoke with no open task.milestone close's second pass already covers the hub-plus-task-repos set at the moment it matters; the report covers the repo you are standing in, which is also the only one whose branches you were about to act on.Rejected: walking
m.Tasks's repos the wayplanStaleSweepdoes — the same set, at a much higher rate, with the wrong coverage between milestones.radiusred-cody commentedon Sep 7, 2026
Decision: when there is no stale branch to report,
statusprints nothing at all — no "no stale task branches" line.Trade-off: an operator cannot tell, from the output alone, a repo with nothing stale from a listing the verb could not read. The unreadable case is covered instead: it prints its own
note:line, so silence means clean and a failure is never silent.Why: the two checks this report sits beside — contract drift and delete-on-merge — both print only when they have something to say, and
statusis the verb run most often in a project. A permanent clean line on every run is the kind of output an operator stops reading, which is precisely how the line that does matter gets missed.feat(status): report the stale task branches of the repo it runs in (#…
feat(task): note every issue task finish would close beside the task (#…
docs(roles): no closing keyword before any ref but the task's own (#310)
docs: the stale-branch report and the closing-reference note in SPEC …
radiusred-cody commentedon Sep 7, 2026
Deviation: the closing-reference note names the issue as a fully qualified ref —
note: this PR would also close radiusred/gh-codecrew#42 (An example ref in the prose) — not the task— where the task's brief wrote the shape as a bare#<n>.Why: GitHub's closing keywords accept
owner/repo#n, so a pull request can genuinely carry a closing reference to another repository's issue, andClosingReferencesreads each node's ownnameWithOwnerrather than assuming the PR's. A bare number would name the wrong issue in exactly the case the note exists to catch. Every other issue this codebase prints is a qualifiedIssueReftoo, so the line reads like the rest of the verb's output — and it still contains#42for anyone scanning for the number.feat(status): report the stale task branches of the repo it runs in (#…
feat(task): note every issue task finish would close beside the task (#…
docs(roles): no closing keyword before any ref but the task's own (#310)
docs: the stale-branch report and the closing-reference note in SPEC …
8 remaining items
fix(status): an unreadable repo is a note, not a silent empty report (#…
fix(task): an unreadable closing-reference lookup is a note, not a de…
feat(status): report the stale task branches of the repo it runs in (#…
feat(task): note every issue task finish would close beside the task (#…
docs(roles): no closing keyword before any ref but the task's own (#310)
docs: the stale-branch report and the closing-reference note in SPEC …
fix(status): an unreadable repo is a note, not a silent empty report (#…
fix(task): an unreadable closing-reference lookup is a note, not a de…
feat(status): report the stale task branches of the repo it runs in (#…
feat(task): note every issue task finish would close beside the task (#…
docs(roles): no closing keyword before any ref but the task's own (#310)
docs: the stale-branch report and the closing-reference note in SPEC …
fix(status): an unreadable repo is a note, not a silent empty report (#…
fix(task): an unreadable closing-reference lookup is a note, not a de…