guard: the forge client send functions call the guard #660

Closed
opened 2026-09-29 16:40:31 +00:00 by hexajon · 2 comments
Owner

What to build

The forge client in internal/gitea receives the guard as an interface when it is built. Each function that sends a request calls the guard before a write (any method other than GET), with the effects of the endpoint. A client with no guard refuses every write. The per-handler out-of-scope checks in the MCP layer go, because the client now runs that rule on every surface.

Depends on

  • #653, for the guard package.
  • #654, because the client needs the declared effect of each endpoint.

Acceptance

  • madt_files create, update, delete, and batch, madt_git_objects apply patch, madt_repos sync_fork and merge_upstream, and madt_branches rename refuse a write to the default branch on the CLI and MCP.
  • A content write to a populated repo outside the session's scope is refused on the CLI too.
  • A delete that ADR 0029 omits is refused at the client.
  • Breaking for anyone who writes files to the default branch through madtea. The release notes say so.
## What to build The forge client in `internal/gitea` receives the guard as an interface when it is built. Each function that sends a request calls the guard before a write (any method other than GET), with the effects of the endpoint. A client with no guard refuses every write. The per-handler out-of-scope checks in the MCP layer go, because the client now runs that rule on every surface. ## Depends on - #653, for the guard package. - #654, because the client needs the declared effect of each endpoint. ## Acceptance - `madt_files` create, update, delete, and batch, `madt_git_objects` apply patch, `madt_repos` sync_fork and merge_upstream, and `madt_branches` rename refuse a write to the default branch on the CLI and MCP. - A content write to a populated repo outside the session's scope is refused on the CLI too. - A delete that ADR 0029 omits is refused at the client. - Breaking for anyone who writes files to the default branch through madtea. The release notes say so.
Author
Owner

The code for this landed on main, and the host tests pass: the forge client takes the write guard as an interface, the default-branch and out-of-scope writes are refused on both surfaces, and an omitted-class delete is refused at the client. This issue depends on #654, which stays open, so it is not closed yet. #654 has the effect-declaration mechanism in place, but its own dependency #538 (the vendored specs are stale against the live forge) is still open.

The code for this landed on main, and the host tests pass: the forge client takes the write guard as an interface, the default-branch and out-of-scope writes are refused on both surfaces, and an omitted-class delete is refused at the client. This issue depends on #654, which stays open, so it is not closed yet. #654 has the effect-declaration mechanism in place, but its own dependency #538 (the vendored specs are stale against the live forge) is still open.
Author
Owner

The v0.20.0 breaking set is complete and green on main. The code landed across the v0.20.0 branches, the full local gate passes, and the forge suite is green on both forges at both pinned versions on current main (31693766). Closing as done.

The v0.20.0 breaking set is complete and green on main. The code landed across the v0.20.0 branches, the full local gate passes, and the forge suite is green on both forges at both pinned versions on current main (31693766). Closing as done.
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.

Reference
sixfold-space/madtea#660
No description provided.