fix(hooks): commit-creating continuation forms dodge the commit steer — deny git merge/revert/cherry-pick/am --continue, WITH a sanctioned madt_* completion path landing first #19

Closed
opened 2026-07-11 21:41:14 +00:00 by hexajon · 0 comments
hexajon commented 2026-07-11 21:41:14 +00:00 (Migrated from codeberg.org)

What happened (2026-07-10)

The commit steer hard-blocks git commit (and git add, steered to madt_add), but the continuation forms that also create commits pass through unmatched. One session created three raw-git commits this way:

  1. GIT_EDITOR=true git merge --continue in a foreign-repo linked worktree — after madt_commit dir= refused (foreign merge-in-progress, #14) and the raw git add && git commit compound was denied.
  2. GIT_EDITOR=true git merge --continue in the session's own repo — completing a hand-rolled base-into-head reconcile after madt_orchestrate reconcile= failed schema validation (#18).
  3. GIT_EDITOR=true git revert --continue — completing a conflicted madt_prs action=revert, whose own error rail says "mark them with git add/rm ... then run git revert --continue" (the TOOL's rail points at the unguarded raw form!).

No deliberate evasion — each use was the only executable exit the rails left — but the guard can't tell surfaced-and-documented use from quiet evasion. Every commit-creating raw-git form should route through the madt_* surface or be denied.

The gap

Unmatched today (all end in git commit machinery): git merge --continue, git revert --continue, git cherry-pick --continue, git am --continue/--resolved, git commit reached via GIT_EDITOR=/env-var prefixes (verify the matcher strips leading env assignments — if not, that is a second, wider hole affecting EVERY guarded form including plain git commit).

Ordering constraint — capability BEFORE deny (ADR 0021's lesson)

Do NOT just add the deny: an agent mid-merge/mid-revert with conflicts resolved would then have NO exit at all (madt_commit currently refuses foreign merge-in-progress, and there is no madt_* revert-continue). A hard block with a capability gap trains hook-evasion (a prior incident; ADR 0021). Land in this order:

  1. Capability: madt_commit completes an in-progress merge/revert/cherry-pick (creating the proper merge/revert commit) in every repo shape it accepts — own repo AND linked worktrees of foreign repos (the #14 refusal narrows to foreign PRIMARY checkouts only, which madtea already refuses everywhere). madt_prs action=revert's conflict rail then names madt_add + madt_commit, not raw git.
  2. Deny: the continuation forms join the commit steer, with self-contained text per ADR 0023 (state the rule; no ADR/issue citations in the shipped string) and the #15 requirements (nothing-executed sentence for compounds; do-not-retry-variants line).
  3. Tests: hook-tests cover each continuation form denied + env-prefix stripping; a rail-consistency check that no madt_* error text recommends a form the hooks deny (#15's cycle test covers this once it lands).

Acceptance

  • All listed continuation forms are denied by the hook; env-assignment prefixes don't dodge any guarded form.
  • madt_commit demonstrably completes a conflicted merge and a conflicted revert in an own-repo checkout and a foreign linked worktree (hermetic tests).
  • madt_prs action=revert conflict rail names only madt_* + still-allowed forms.
  • The three raw-git commits' use cases from this session all have a green sanctioned path.
## What happened (2026-07-10) The commit steer hard-blocks `git commit` (and `git add`, steered to madt_add), but the **continuation forms that also create commits** pass through unmatched. One session created three raw-git commits this way: 1. `GIT_EDITOR=true git merge --continue` in a foreign-repo linked worktree — after `madt_commit dir=` refused (foreign merge-in-progress, #14) and the raw `git add && git commit` compound was denied. 2. `GIT_EDITOR=true git merge --continue` in the session's own repo — completing a hand-rolled base-into-head reconcile after `madt_orchestrate reconcile=` failed schema validation (#18). 3. `GIT_EDITOR=true git revert --continue` — completing a conflicted `madt_prs action=revert`, whose own error rail says "mark them with git add/rm ... then run git revert --continue" (the TOOL's rail points at the unguarded raw form!). No deliberate evasion — each use was the only executable exit the rails left — but the guard can't tell surfaced-and-documented use from quiet evasion. Every commit-creating raw-git form should route through the madt_* surface or be denied. ## The gap Unmatched today (all end in `git commit` machinery): `git merge --continue`, `git revert --continue`, `git cherry-pick --continue`, `git am --continue`/`--resolved`, `git commit` reached via `GIT_EDITOR=`/env-var prefixes (verify the matcher strips leading env assignments — if not, that is a second, wider hole affecting EVERY guarded form including plain `git commit`). ## Ordering constraint — capability BEFORE deny (ADR 0021's lesson) Do NOT just add the deny: an agent mid-merge/mid-revert with conflicts resolved would then have NO exit at all (madt_commit currently refuses foreign merge-in-progress, and there is no madt_* revert-continue). A hard block with a capability gap trains hook-evasion (a prior incident; ADR 0021). Land in this order: 1. **Capability:** `madt_commit` completes an in-progress merge/revert/cherry-pick (creating the proper merge/revert commit) in every repo shape it accepts — own repo AND linked worktrees of foreign repos (the #14 refusal narrows to foreign PRIMARY checkouts only, which madtea already refuses everywhere). `madt_prs action=revert`'s conflict rail then names `madt_add` + `madt_commit`, not raw git. 2. **Deny:** the continuation forms join the commit steer, with self-contained text per ADR 0023 (state the rule; no ADR/issue citations in the shipped string) and the #15 requirements (nothing-executed sentence for compounds; do-not-retry-variants line). 3. **Tests:** hook-tests cover each continuation form denied + env-prefix stripping; a rail-consistency check that no madt_* error text recommends a form the hooks deny (#15's cycle test covers this once it lands). ## Acceptance - All listed continuation forms are denied by the hook; env-assignment prefixes don't dodge any guarded form. - `madt_commit` demonstrably completes a conflicted merge and a conflicted revert in an own-repo checkout and a foreign linked worktree (hermetic tests). - `madt_prs action=revert` conflict rail names only madt_* + still-allowed forms. - The three raw-git commits' use cases from this session all have a green sanctioned path.
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#19
No description provided.