feat!: finish takes no close inputs, and every merge closes its branch issue #889

Merged
hexajon merged 27 commits from issue-879-finish-no-close-inputs into main 2026-10-23 21:22:03 +00:00
Owner

Summary

finish no longer takes no_close, close_linked, closes=, or --close. A merge through madtea now always closes the issue that its branch names, as ADR 0061 rules.

  • finish refuses before any push, PR, or merge when the branch names no issue, names two, names a missing, closed, or PR number, or the issue has an open dependency, and when the forge cannot be read.
  • Every PR merge (finish, madt_prs merge, orchestrate, and the raw API merge call) goes through one guard limit that runs the same checks and adds a missing Closes #N line before the merge.
  • A revert opens its own issue, and its merge closes it.
  • Every first push into an empty repo asks a person, through MCP elicitation or a terminal prompt, and refuses when no person can be asked.
  • The dependency list is read across every page, and a repo with dependencies turned off counts as having none.
  • ADR 0061 is accepted, and ADR 0006, 0007, 0046, and 0058 point at its rules.

The rulings added to ADR 0061 in its last edit (origin host check, seeded repo creates, the unreadable-forge push rule, revert retry reuse, and suggestions as text only) are not built in this change. They are tracked in their own issue.

Closes #879

## Summary finish no longer takes `no_close`, `close_linked`, `closes=`, or `--close`. A merge through madtea now always closes the issue that its branch names, as ADR 0061 rules. - `finish` refuses before any push, PR, or merge when the branch names no issue, names two, names a missing, closed, or PR number, or the issue has an open dependency, and when the forge cannot be read. - Every PR merge (`finish`, `madt_prs` merge, `orchestrate`, and the raw API merge call) goes through one guard limit that runs the same checks and adds a missing `Closes #N` line before the merge. - A revert opens its own issue, and its merge closes it. - Every first push into an empty repo asks a person, through MCP elicitation or a terminal prompt, and refuses when no person can be asked. - The dependency list is read across every page, and a repo with dependencies turned off counts as having none. - ADR 0061 is accepted, and ADR 0006, 0007, 0046, and 0058 point at its rules. The rulings added to ADR 0061 in its last edit (origin host check, seeded repo creates, the unreadable-forge push rule, revert retry reuse, and suggestions as text only) are not built in this change. They are tracked in their own issue. Closes #879
Red step only: precheckFinishIssues and FinishIssueReader do not exist yet.
Refs #879
The merge-close rule is one effect of the write guard. It runs before
POST /repos/{owner}/{repo}/pulls/{index}/merge, so finish, prs merge, the
orchestrate batch merge, and the raw API passthrough all pass it. It reads the
PR head branch, runs the issue pre-checks, and adds a missing close line with
the body append operation before the merge. finish keeps its early pre-check
and now calls the same rule.
The orchestrate auto-revert and prs revert first open an issue titled
"Revert PR #N: <reason>", name the branch issue-M-revert-pr-N, and write
Closes #M in the revert PR body. A revert branch has no exemption from the
merge-close rule.
In a repo with no commits, finish asks a person whether this is a new repo:
through an MCP input request (elicitation), or a prompt on a CLI terminal. A
no refuses. With no way to ask a person it refuses and names madtea init. A
forge repo with commits, or a forge repo that cannot be read, refuses before
the question. Both first-push shortcuts ask.
The forge-tagged binary now installs the production write guard, as the
madtea binary does at startup. The close-rule test covers the branch, issue,
and PR-number refusals, a resumed PR, prs merge and raw API merge, and the
empty-repo question on both forges at both pins.
test: apply go fix to the new close-line and first-push tests
Some checks failed
ci / gate (pull_request) Has been cancelled
drift / govulncheck (pull_request) Has been cancelled
drift / surface-diff (pull_request) Has been cancelled
drift / forgejo-smoke (pull_request) Has been cancelled
ci / gate (push) Has been cancelled
drift / govulncheck (push) Has been cancelled
drift / surface-diff (push) Has been cancelled
drift / forgejo-smoke (push) Has been cancelled
c3fa16ac5e
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
sixfold-space/madtea!889
No description provided.