gateguard: fact-force frequency knobs are undocumented; routine-Bash gate fires on read-only commands
Summary
The fact-forcing gate fires often enough in normal sessions to read as noise rather than signal, and the knobs that would tune it are effectively undiscoverable. Three of the four GATEGUARD_* env vars implemented in scripts/hooks/gateguard-fact-force.js appear in no markdown file in the repo, and the deny message points users only at the two nuclear options (ECC_GATEGUARD=off, ECC_DISABLED_HOOKS).
This is not a request to weaken the destructive-command gate — that one earns its keep. It's about the two gates that fire on operations with no destructive potential.
What I actually hit
First Bash call of a fresh session was a plain directory listing (ls, find, no writes). It was denied by the routine-Bash gate:
[Fact-Forcing Gate]
Before the first Bash command this session, present these facts:
1. The current user request in one sentence
2. What this specific command verifies or produces
Recovery: if GateGuard is blocking setup or repair work, run this session
with `ECC_GATEGUARD=off` or add `pre:bash:gateguard-fact-force` to
`ECC_DISABLED_HOOKS`.The recovery hint offers only "turn the whole thing off." GATEGUARD_BASH_ROUTINE_DISABLED=1 — which disables exactly this gate while leaving destructive gating fully intact — is implemented at gateguard-fact-force.js:137-139 and :1261-1263, but a user has no way to learn it exists short of reading the hook source.
Documentation gaps (verified against ECC 2.0.0, commit b6fe5a7)
grep -rl "<VAR>" --include="*.md" . across the repo:
| Env var | Documented? |
|---|---|
GATEGUARD_FACT_FORCE_FULL_DENIALS |
skills/gateguard/SKILL.md:102 only |
GATEGUARD_BASH_ROUTINE_DISABLED |
nowhere |
GATEGUARD_EXEMPT_GLOBS |
nowhere |
GATEGUARD_BASH_EXTRA_DESTRUCTIVE |
nowhere |
Worse than absent — actively misdirecting. skills/gateguard/SKILL.md:128 says:
Use
.gateguard.ymlto ignore paths like.venv/,node_modules/,.git/.
That advice belongs to Option B (pip install gateguard-ai). The Option A JS hook — the one ECC actually ships and enables — never reads .gateguard.yml. Its path-exemption mechanism is GATEGUARD_EXEMPT_GLOBS (gateguard-fact-force.js:97-135), which the doc never mentions. So a user following the documented advice to exempt node_modules/ gets no effect and no error.
Note #2078 ("surface gateguard config knobs in the JS port") was closed, and the knobs do exist in code — but the doc half of that request didn't land.
Why the routine-Bash gate specifically
The read-only escape hatch isReadOnlyGitIntrospection() (:985-1052) is git-only, and narrowly so — git status --porcelain, git diff --name-only, git log --oneline, git branch --show-current, and a few more. Every other read-only command in existence — ls, find, cat, rg, wc, node -e, jq — trips the gate.
Since the gate fires once per session, the practical effect is: the first command of nearly every session is denied and must be retried, and it's usually orientation/discovery work where "what does this command produce" is answerable only as a tautology. The facts extracted are near-zero-information, which trains exactly the reflexive compliance the gate's design rationale (self-evaluation always answers "yes") is trying to avoid.
Proposed changes
- Document all four knobs in
skills/gateguard/SKILL.md, with a short table of what each one costs you. - Fix
SKILL.md:128— split path-ignore guidance by option:.gateguard.ymlfor the pip package,GATEGUARD_EXEMPT_GLOBSfor the JS hook. - Name the graduated knobs in the deny message.
withRecoveryHint()(:1129-1132) currently offers only off/disabled-hooks. For the routine-Bash deny specifically, mentionGATEGUARD_BASH_ROUTINE_DISABLED=1; for Edit/Write denials, mentionGATEGUARD_EXEMPT_GLOBS. Users learn the graduated option at the moment they want it. - Consider defaulting
GATEGUARD_BASH_ROUTINE_DISABLEDto on. The destructive-Bash gate is the load-bearing one; the routine gate taxes a read-only command per session for facts that are usually tautological. If the default stays off, at minimum broaden the read-only allowlist beyond git to coverls,pwd,cat,head,wc,find(no-exec/-delete), andrg/grep— all already non-destructive by construction.
Workaround, for anyone who lands here
{
"env": {
"GATEGUARD_BASH_ROUTINE_DISABLED": "1",
"GATEGUARD_FACT_FORCE_FULL_DENIALS": "1",
"GATEGUARD_EXEMPT_GLOBS": "**/test/**,**/tests/**,**/*.test.*,**/*.spec.*,**/docs/**,**/*.md,**/dist/**,**/build/**,**/node_modules/**"
}
}Verified against the shipped hook (17/17 assertions): routine ls passes; rm -rf, git reset --hard, and drop table still deny; the first source-file edit still emits the full four-fact block, later ones condense; exempt trees never gate; retries of an already-gated target pass.
Environment
ECC 2.0.0 (marketplace affaan-m/ECC @ b6fe5a7), Claude Code, macOS 25.5.0, Opus 5.
Source: affaan-m/ECC