| 5015 | "REMINDER\n"; |
| 5016 | |
| 5017 | static int cbm_build_released_gate_script(const char *binary_path, char *script, |
| 5018 | size_t script_size) { |
| 5019 | if (!binary_path || !script || strchr(binary_path, '"')) { |
| 5020 | return CLI_ERR; |
| 5021 | } |
| 5022 | int written = snprintf(script, script_size, |
| 5023 | "#!/usr/bin/env bash\n" |
| 5024 | "# codebase-memory-mcp search augmenter (Claude Code PreToolUse).\n" |
| 5025 | "# NOTE: the legacy filename is kept for zero-migration upgrades.\n" |
| 5026 | "# Despite the name this NEVER blocks a tool call - it only adds\n" |
| 5027 | "# graph context. Any failure is silent (exit 0, no output).\n" |
| 5028 | "BIN=\"%s\"\n" |
| 5029 | "[ -x \"$BIN\" ] || exit 0\n" |
| 5030 | "\"$BIN\" hook-augment 2>/dev/null\n" |
| 5031 | "exit 0\n", |
| 5032 | binary_path); |
| 5033 | return written > 0 && (size_t)written < script_size ? CLI_OK : CLI_ERR; |
| 5034 | } |
| 5035 | |
| 5036 | static int cbm_remove_owned_hook_script(const char *path, const char *expected_current, |
| 5037 | const char *const *released_scripts, |
no outgoing calls
no test coverage detected