The gate refuses a force push onto a branch that is not the member's own #230

Closed
opened 2026-11-26 05:14:45 +00:00 by neptunus · 1 comment
Member

Purpose (defect): Martha's gate refuses a force push onto any branch that is not the member's own, so one member cannot rewrite another member's work.

DECIDED 2026-11-26 by Raf, ticking "Force push to a peer's branch" on the gap rows of #45 c5603 (relayed by Mars).

Refs #45 (c5603, rows 5-7, 10-11 and 14-17)

Today

At main a10a6e98, guard_workspace/guard_workspace.ts never reads --force, -f or a + refspec. It refuses a push only when the push targets the default branch or deletes another member's branch. When the gate was run on a crew of neptunus and pluto, with neptunus acting, these all passed:

  • push origin --force pluto/2
  • push origin -f HEAD:pluto/2
  • push origin +pluto/2

Threat model

  • Asset: another member's pushed branch: its commits and its review range.
  • Actor: a crew member acting by mistake: a wrong refspec, a copy-pasted command, or a rebase onto the wrong branch. This is not an attacker. As the guard's header says, the shim is "a speed bump in front of the shell the relay reads, not a boundary", and the forge's branch protection stays the boundary.
  • Harm: a force push replaces a peer's branch, and their commits vanish from the forge. That is the "lost work" the 2026-11-20 DECIDED keeps among what still stops.
  • Out of scope: pushes the gate cannot see. Those are a push through remote.<name>.push config, a ! alias, a script, or a direct API call. The gate fails open when it cannot name the target, as every rule here does.

Rule

A push counts as forced when it carries --force, -f (also inside a bundle such as -uf), --force-with-lease[=…] or a + refspec. A forced push is refused unless every branch it writes is <member>/… and that member is the one acting. The branch a push writes is read from each refspec. With no refspec, or with HEAD/@, it is the branch of the worktree the call runs in, as git worktree list names it.

Done when

  1. Each forced form onto pluto/2 is refused when neptunus acts: --force, -f, a bundled -uf, --force-with-lease, +pluto/2, +HEAD:pluto/2, and a bare push -f run in pluto's worktree.
  2. The same forms onto neptunus/<n> pass, and so does a push with no force onto anything the guard allowed before.
  3. A test goes red when the refusal is mutated out.
Purpose (defect): Martha's gate refuses a force push onto any branch that is not the member's own, so one member cannot rewrite another member's work. DECIDED 2026-11-26 by Raf, ticking "Force push to a peer's branch" on the gap rows of #45 c5603 (relayed by Mars). Refs #45 (c5603, rows 5-7, 10-11 and 14-17) ## Today At main `a10a6e98`, `guard_workspace/guard_workspace.ts` never reads `--force`, `-f` or a `+` refspec. It refuses a push only when the push targets the default branch or deletes another member's branch. When the gate was run on a crew of `neptunus` and `pluto`, with neptunus acting, these all passed: - `push origin --force pluto/2` - `push origin -f HEAD:pluto/2` - `push origin +pluto/2` ## Threat model - **Asset:** another member's pushed branch: its commits and its review range. - **Actor:** a crew member acting by mistake: a wrong refspec, a copy-pasted command, or a rebase onto the wrong branch. This is not an attacker. As the guard's header says, the shim is "a speed bump in front of the shell the relay reads, not a boundary", and the forge's branch protection stays the boundary. - **Harm:** a force push replaces a peer's branch, and their commits vanish from the forge. That is the "lost work" the 2026-11-20 DECIDED keeps among what still stops. - **Out of scope:** pushes the gate cannot see. Those are a push through `remote.<name>.push` config, a `!` alias, a script, or a direct API call. The gate fails open when it cannot name the target, as every rule here does. ## Rule A push counts as forced when it carries `--force`, `-f` (also inside a bundle such as `-uf`), `--force-with-lease[=…]` or a `+` refspec. A forced push is refused unless every branch it writes is `<member>/…` and that member is the one acting. The branch a push writes is read from each refspec. With no refspec, or with `HEAD`/`@`, it is the branch of the worktree the call runs in, as `git worktree list` names it. ## Done when 1. Each forced form onto `pluto/2` is refused when neptunus acts: `--force`, `-f`, a bundled `-uf`, `--force-with-lease`, `+pluto/2`, `+HEAD:pluto/2`, and a bare `push -f` run in pluto's worktree. 2. The same forms onto `neptunus/<n>` pass, and so does a push with no force onto anything the guard allowed before. 3. A test goes red when the refusal is mutated out.
Author
Member

Landed in 74041d92 (Merge PR 233), on main. Closing.

Landed in 74041d92 (Merge PR 233), on main. Closing.
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#230
No description provided.