hooks.pre-bash¶
Refuse shell commands that succeed while silently breaking state.
Guards two patterns: a footman command piped into tail or
head, and a git push of a branch that conflicts with
origin/main.
The pipe guard. A gate's exit code is its verdict, and a pipe
replaces it with the filter's, so fm check | tail -4 reports 0
whatever happened and prints the step summary while the failing step
scrolls past above.
The push guard. Agent sessions share this repository, so main moves
while a branch is being built, and a branch pushed from a stale base
opens a conflicting pull request for which GitHub cannot build its
test-merge and therefore spawns no CI at all. The guard runs
git merge-tree --write-tree locally before letting the push
through. Tag pushes, deletions, and pushes of main itself pass
untouched.
Both are deliberately narrow. Command separators split first, so
fm check && echo done | tail stays legal; quoted spans are data,
so rg "fm check" | head passes.
Hidden: this task is not listed by fm --list, --tree or completion — it runs like any other when named.
| Parameter | Type | Default | Description |
|---|---|---|---|
<event> |
|||
--harness={claude|antigravity} |
claude | antigravity |
"claude" |
the hook protocol to answer in: claude or antigravity |
Returns: text