Our Panel Said Enforced for Six Days
The panel said enforced for six days while nothing enforced it. The fix was a check that names unwired hooks, and the only cut with a measurement is also the only one a hook now denies.
A two-hook gate can force preferred tool discovery before raw reads, but the gate must own only its emitted hint and leave repeated passthrough payloads unchanged.
The written rule was not enough. The agent still reached for a raw file search before the knowledge graph, even when the session instructions said otherwise. A PreToolUse hook that blocked the first search, paired with a marker set after the preferred tool ran, made the first move enforceable. The gate passed a live wiring check. A sibling output filter, built the same day, then had to be corrected when its wrapper tried to deduplicate output it did not own.
The gate has two small pieces. The PreToolUse side sees the first raw search family and refuses it once, leaving a process-scoped state flag. The marker side records that the intended knowledge-graph capability has been used. Every later call can proceed because the session has crossed the boundary the rule cared about.
This is not a ban on reading files. It is a nudge with teeth at the exact point where habit wins over instruction. A session that never uses the preferred tool stays visible as a failed path instead of silently degrading to grep.
The state must be scoped tightly. A flag that leaks across processes turns a session preference into a machine-wide surprise. A flag that never clears traps every later call. The useful gate is one-shot, observable, and cheap to reset.
A companion filter hook, built the same day, removed redundant path, evidence, and scout hints. That saved context, but a later change deduplicated repeated payloads inside a passthrough wrapper. The wrapper did not own the payload, so the optimization changed behavior. Commit fc7c893 removed that dedupe and restored repeated payloads byte for byte.
The component that owns a capability hint may suppress its own repeat. A transport wrapper must preserve what it transports. This boundary is the difference between a measured reduction and a silent protocol mutation.
Gate the first move, then get out of the way.
What counts as a useful gate:
What does not count:
The gate adds a refusal to the first wrong call and a marker lookup to the preferred path. That is a small latency cost. The larger cost was discovering that a well-intended dedupe violated passthrough semantics. The fix in fc7c893 deleted 51 lines from the wrapper and its test and added 11.
A unit test result is therefore not the whole proof. It proves the named cases at that commit. The repeated payload correction proves the design survived contact with its ownership boundary.
The gate is two small hooks, cbm-discovery-gate (PreToolUse on search and read tools) and cbm-mcp-marker (PostToolUse on the knowledge-graph tools), with a process-scoped flag and a CBM_GATE_OFF=1 escape. They live in the local hook directory, outside version control. Their check on 2026-09-20 was a live wiring test: the first raw call exits 2 with a nudge, the second exits 0, and the marker disarms the gate at once. The wrapper lesson comes from the output filter hooks/caveman_filter.sh and its test, commits 97f3a63, 7e4aef0 and fc7c893. That filter was retired on 2026-10-06.
Discuss this on gllm.forum.
Commenti
Ancora nessun commento.
Accedi per commentare.