SLOPSHOPPER

fnhook-fixture-valid

Valid function-hook gate fixture

new
A shopper browsing a rack in a slop shop
Source 1 files
hooks/register.ts 17 lines
1import type { Register } from "claude-code";
2
3// Every module registering classic.PreToolUse must permit these, consulted —
4// asserted by `assert_escape_hatch_permitted`. This fixture denies nothing, and
5// carries the set anyway: the invariant is deliberately exception-free.
6const ESCAPE_HATCH_TOOLS = new Set(["AskUserQuestion", "SendUserMessage"]);
7
8export const register: Register = (on) => {
9  on("classic.PreToolUse", { tool: "Read" }, async (_$, e, next) => {
10    const result = await next(e);
11    if (ESCAPE_HATCH_TOOLS.has(e.tool)) {
12      return result;
13    }
14    return { ...result, additionalContext: ["fixture-valid"] };
15  });
16};
17