close_task
Close a task that should not be built — a duplicate, or work already shipped.
Use this when a task on the board is obsolete: the change already landed in
another PR, a sibling task covers it, or the user changed direction. The
task is marked `cancelled` and keeps ALL of its history (acceptance
criteria, QA steps, iterations) — nothing is deleted.
`reason` is REQUIRED and is recorded on the audit trail; say why in one
line. Pass `superseded_by_pr_number` (or `superseded_by_task_id`) when the
work was genuinely delivered somewhere else — that records verified
provenance instead of a bare abandon. Closing does NOT claim the content is
on the default branch, so any task that declared a dependency on this one
keeps waiting; deliver or re-plan those separately.
Refuses with 409 while the task is being worked on by a running iteration
(stop the machine first, or wait for it to finish). A task in another
workspace 404s. Idempotent: closing an already-closed task changes nothing.
The response echoes `open_tasks`: how many tasks are still open on the
project, counted after the close commits. Check it — if it did not drop,
the ticket was already closed and this call changed nothing. It is the same
count `project_status` returns, and neither counts a closed task as open.
Prefer this over leaving a dead task on the board: unfinished tasks count
against the project's planning capacity, so stale duplicates quietly stop
new roadmap items from being expanded.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| reason | Yes | ||
| task_id | Yes | ||
| project_id | Yes | ||
| superseded_by_task_id | No | ||
| superseded_by_pr_number | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |