ShtukbaseStandard

Human approves

human-gate · version 0.1.0
Agents and automations2 norms

A gate on Claude Code hooks: an agent runs a command from the list (publishing, messages to people, history rewriting) only after a person's "yes" in an approval record; only a person writes the answer.

About the package

Outside only after a person's "yes". The rule is held at the moment of the agent's action, so its enforcer is a hook.

How it goes:

  1. The agent runs a command from the gate list. The hook ask does not let it through and says which record to create.
  2. The agent creates a record in Approvals: what and why, exactly which command, what will happen and whether it can be rolled back. And tells the person it is waiting.
  3. The person answers in the record: answer: yes or no.
  4. The agent runs the command again. If there is a "yes" for exactly this command, the hook writes usedOn into the record and lets it through. One "yes" is one run.

The agent cannot answer itself: the hook answer-guard does not let it edit the fields answer, answeredOn, usedOn, and the hook ask does not let through Bash commands that write into the approvals folder.

Norms:

  • HG-R01: a command from the gate list goes only after a person's "yes". The enforcer is the hook ask.
  • HG-R02: the answer in an approval record is written only by a person. The enforcers are the hooks answer-guard and ask.

The approvals collection is a new kind of record, Approval. On install, the place action adds its line to the placement map.

Boundary: the hook sees only Claude Code tools in this project. An action through another tool (MCP, a browser) or around Bash is not seen by the gate. A write by someone else's script into the approvals folder is caught by the hook ask by the look of the command, not for certain. The package hooks is required.

Norms 2

IDNormLevelModeEnforcer
HG-R01
A command that matches the list /base/human-gate.md is run by an agent only when a record in /work/approvals names exactly it and a person answered answer: yes; one "yes" is one run
MUST blocks
hook
HG-R02
An agent does not write the fields answer, answeredOn and usedOn in records of /work/approvals and does not write into this folder with Bash commands
MUST blocks
hook

"Blocks": the enforcer stops a violation. "Observes": it only notes it. Level MUST means required; SHOULD means yes by default.

Actions 1

NameWhat it doesFileWhen
placeThe Approval kind goes into the placement map /base/ontology/placement.mdbin/place.ts
after install after update

shtuk check runs the checks; shtuk run human-gate <name> runs any action. "After install" actions run by themselves only if the package comes from a trusted source.

Agent hooks 2

NameEventToolsFileNorm
askPreToolUseBashhooks/ask.tsHG-R01
answer-guardPreToolUseWrite, Edit, MultiEdithooks/answer-guard.tsHG-R02

Pages 4

They go into the project at these paths.

Package files 5

They go into .shtukbase/packages/human-gate/; actions run from there.