| 5179 | "REMINDER\n"; |
| 5180 | |
| 5181 | static int cbm_build_released_gate_script(const char *binary_path, char *script, |
| 5182 | size_t script_size) { |
| 5183 | if (!binary_path || !script || strchr(binary_path, '"')) { |
| 5184 | return CLI_ERR; |
| 5185 | } |
| 5186 | int written = snprintf(script, script_size, |
| 5187 | "#!/usr/bin/env bash\n" |
| 5188 | "# codebase-memory-mcp search augmenter (Claude Code PreToolUse).\n" |
| 5189 | "# NOTE: the legacy filename is kept for zero-migration upgrades.\n" |
| 5190 | "# Despite the name this NEVER blocks a tool call - it only adds\n" |
| 5191 | "# graph context. Any failure is silent (exit 0, no output).\n" |
| 5192 | "BIN=\"%s\"\n" |
| 5193 | "[ -x \"$BIN\" ] || exit 0\n" |
| 5194 | "\"$BIN\" hook-augment 2>/dev/null\n" |
| 5195 | "exit 0\n", |
| 5196 | binary_path); |
| 5197 | return written > 0 && (size_t)written < script_size ? CLI_OK : CLI_ERR; |
| 5198 | } |
| 5199 | |
| 5200 | static int cbm_remove_owned_hook_script(const char *path, const char *expected_current, |
| 5201 | const char *const *released_scripts, |
no outgoing calls
no test coverage detected