security: remove the force_merge / --admin CI-override merge path #480

Closed
opened 2026-09-10 22:32:32 +00:00 by hexajon · 0 comments
Owner

madtea must never let an agent merge a PR past a red or pending required status check. The green gate is authoritative.

Today one surface breaks that rule. madt_prs action=merge takes force_merge, and madtea pr merge takes --admin. Both set gitea.MergePROptions.ForceMerge, which sends force_merge: true in the merge payload. The forge then merges even if the required checks have not passed.

Remove this override from every surface. Keep the safe paths: a normal merge still merges, and auto_merge still schedules an auto-merge on green (#438, #464).

Change

  • MCP: drop the force_merge arg from madt_prs action=merge - the input struct field, the action Optional list, the summary, the paramdocs entry, and the drift keywords.
  • CLI: drop the --admin flag from madtea pr merge.
  • Client: drop MergePROptions.ForceMerge and the force_merge payload key.
  • Docs: drop --admin from docs/COMPARISON.md, regenerate the reference docs, and update the agent-onboarding drift row.

Acceptance

  • No madtea surface (MCP arg, CLI flag, client option) can send force_merge.
  • A guard test proves the merge payload never carries a force_merge key, whatever the options.
  • A normal merge and auto_merge (wait-for-green) still work unchanged.
  • ./scripts/gate.sh passes clean: gofmt, vet, staticcheck, parity, drift, and docs-generate.

This is a breaking change. It removes a public CLI flag and a public MCP arg.

madtea must never let an agent merge a PR past a red or pending required status check. The green gate is authoritative. Today one surface breaks that rule. `madt_prs action=merge` takes `force_merge`, and `madtea pr merge` takes `--admin`. Both set `gitea.MergePROptions.ForceMerge`, which sends `force_merge: true` in the merge payload. The forge then merges even if the required checks have not passed. Remove this override from every surface. Keep the safe paths: a normal merge still merges, and `auto_merge` still schedules an auto-merge on green (#438, #464). ## Change - MCP: drop the `force_merge` arg from `madt_prs action=merge` - the input struct field, the action Optional list, the summary, the paramdocs entry, and the drift keywords. - CLI: drop the `--admin` flag from `madtea pr merge`. - Client: drop `MergePROptions.ForceMerge` and the `force_merge` payload key. - Docs: drop `--admin` from `docs/COMPARISON.md`, regenerate the reference docs, and update the agent-onboarding drift row. ## Acceptance - No madtea surface (MCP arg, CLI flag, client option) can send `force_merge`. - A guard test proves the merge payload never carries a `force_merge` key, whatever the options. - A normal merge and `auto_merge` (wait-for-green) still work unchanged. - `./scripts/gate.sh` passes clean: gofmt, vet, staticcheck, parity, drift, and docs-generate. This is a breaking change. It removes a public CLI flag and a public MCP arg.
Sign in to join this conversation.
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#480
No description provided.