plugin hook: refuse an agent commit that decides or edits a record without the person's token #662

Open
opened 2026-09-29 16:41:04 +00:00 by hexajon · 0 comments
Owner

What to build

A hook in madtea's Claude Code plugin, before madt_commit and madt_finish. When the change moves a record to a decided status, or edits a decided record, the hook looks in the agent's own session file for the token: a message the person typed, or an answer the person picked that is exactly the token. When the session has none, a token already on a decision issue, from a contributor who is not the session's account, also counts. Otherwise the hook refuses: nothing is committed, and the refusal tells the agent to ask the person, with one option labelled exactly with the token.

The session file format is not a documented contract, so the hook refuses with a clear message when it cannot read the file. The hook reads no setting that the agent can change (ADR 0009).

Depends on

  • #656, for the forge fallback, which accepts only a contributor's token.

Acceptance

Tests with session files taken from real sessions: a typed token allows; an answer that is exactly the token allows; a token in the agent's own text or in a tool output does not; no token refuses; an unreadable session file refuses; an edit to a decided record with no token refuses.

## What to build A hook in madtea's Claude Code plugin, before `madt_commit` and `madt_finish`. When the change moves a record to a decided status, or edits a decided record, the hook looks in the agent's own session file for the token: a message the person typed, or an answer the person picked that is exactly the token. When the session has none, a token already on a decision issue, from a contributor who is not the session's account, also counts. Otherwise the hook refuses: nothing is committed, and the refusal tells the agent to ask the person, with one option labelled exactly with the token. The session file format is not a documented contract, so the hook refuses with a clear message when it cannot read the file. The hook reads no setting that the agent can change (ADR 0009). ## Depends on - #656, for the forge fallback, which accepts only a contributor's token. ## Acceptance Tests with session files taken from real sessions: a typed token allows; an answer that is exactly the token allows; a token in the agent's own text or in a tool output does not; no token refuses; an unreadable session file refuses; an edit to a decided record with no token refuses.
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#662
No description provided.