The gate refuses a repository delete through a git host (gh repo delete, the forge API) #232

Open
opened 2026-11-26 05:14:45 +00:00 by neptunus · 0 comments
Member

Purpose (defect): Martha's gate refuses a repository delete through a git host, so a member cannot delete a repository.

DECIDED 2026-11-26 by Raf, ticking "Repo delete" on the gap rows of #45 c5603 (relayed by Mars).

Refs #45 (c5603, row 3)

Today

At main a10a6e98, the gate reads only git calls in a shell line. gh repo delete owner/repo --yes passes, and so does a curl -X DELETE on a forge's /api/v1/repos/<owner>/<repo>. Martha has no git-host adapter of its own that deletes a repository: none of its code calls one, and the A1 host seam has not landed. So today the only way a member reaches a repo delete is the shell.

Threat model

  • Asset: a repository on a git host, with its issues, PRs, releases and CI history. A delete cannot be undone on GitHub after its grace period, and on Forgejo it cannot be undone at all.
  • Actor: a crew member acting by mistake: a wrong repo name, or cleanup run too wide. This is not an attacker. The member's token scope stays the boundary.
  • Harm: the repository and everything only the host keeps are lost.
  • Out of scope: a delete the shell line does not show. That covers a script file, a variable holding the URL, and a language runtime making the call. The gate is a speed bump in front of the shell the relay reads, as the guard's header says.

Rule

A member's shell line is refused when one of its commands is either of:

  • gh repo delete … (with gh's global flags in between)
  • an HTTP client (curl, wget, http/https) sending a DELETE to a URL whose path ends in /repos/<owner>/<repo>, with or without /api/v1 or /api/v3, and with or without a trailing /

A DELETE on anything below a repository (/repos/o/r/branches/x, /repos/o/r/actions/runs/1) passes, and so does a GET on the repository.

Done when

  1. gh repo delete o/r --yes is refused, and so are gh -R o/r repo delete --yes and a cd x && gh repo delete.
  2. Each of these is refused:
    • curl -X DELETE https://git.example/api/v1/repos/o/r
    • curl --request DELETE …/repos/o/r/
    • curl -XDELETE https://api.github.com/repos/o/r
  3. gh repo view o/r, curl https://…/repos/o/r and curl -X DELETE …/repos/o/r/branches/x pass.
  4. A test goes red when the refusal is mutated out.
Purpose (defect): Martha's gate refuses a repository delete through a git host, so a member cannot delete a repository. DECIDED 2026-11-26 by Raf, ticking "Repo delete" on the gap rows of #45 c5603 (relayed by Mars). Refs #45 (c5603, row 3) ## Today At main `a10a6e98`, the gate reads only git calls in a shell line. `gh repo delete owner/repo --yes` passes, and so does a `curl -X DELETE` on a forge's `/api/v1/repos/<owner>/<repo>`. Martha has no git-host adapter of its own that deletes a repository: none of its code calls one, and the A1 host seam has not landed. So today the only way a member reaches a repo delete is the shell. ## Threat model - **Asset:** a repository on a git host, with its issues, PRs, releases and CI history. A delete cannot be undone on GitHub after its grace period, and on Forgejo it cannot be undone at all. - **Actor:** a crew member acting by mistake: a wrong repo name, or cleanup run too wide. This is not an attacker. The member's token scope stays the boundary. - **Harm:** the repository and everything only the host keeps are lost. - **Out of scope:** a delete the shell line does not show. That covers a script file, a variable holding the URL, and a language runtime making the call. The gate is a speed bump in front of the shell the relay reads, as the guard's header says. ## Rule A member's shell line is refused when one of its commands is either of: - `gh repo delete …` (with `gh`'s global flags in between) - an HTTP client (`curl`, `wget`, `http`/`https`) sending a `DELETE` to a URL whose path ends in `/repos/<owner>/<repo>`, with or without `/api/v1` or `/api/v3`, and with or without a trailing `/` A DELETE on anything below a repository (`/repos/o/r/branches/x`, `/repos/o/r/actions/runs/1`) passes, and so does a GET on the repository. ## Done when 1. `gh repo delete o/r --yes` is refused, and so are `gh -R o/r repo delete --yes` and a `cd x && gh repo delete`. 2. Each of these is refused: - `curl -X DELETE https://git.example/api/v1/repos/o/r` - `curl --request DELETE …/repos/o/r/` - `curl -XDELETE https://api.github.com/repos/o/r` 3. `gh repo view o/r`, `curl https://…/repos/o/r` and `curl -X DELETE …/repos/o/r/branches/x` pass. 4. A test goes red when the refusal is mutated out.
Sign in to join this conversation.
No labels
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
martha-ai/martha#232
No description provided.