| 5775 | "REMINDER\n"; |
| 5776 | |
| 5777 | static int cbm_build_released_gate_script(const char *binary_path, char *script, |
| 5778 | size_t script_size) { |
| 5779 | if (!binary_path || !script || strchr(binary_path, '"')) { |
| 5780 | return CLI_ERR; |
| 5781 | } |
| 5782 | int written = snprintf(script, script_size, |
| 5783 | "#!/usr/bin/env bash\n" |
| 5784 | "# codebase-memory-mcp search augmenter (Claude Code PreToolUse).\n" |
| 5785 | "# NOTE: the legacy filename is kept for zero-migration upgrades.\n" |
| 5786 | "# Despite the name this NEVER blocks a tool call - it only adds\n" |
| 5787 | "# graph context. Any failure is silent (exit 0, no output).\n" |
| 5788 | "BIN=\"%s\"\n" |
| 5789 | "[ -x \"$BIN\" ] || exit 0\n" |
| 5790 | "\"$BIN\" hook-augment 2>/dev/null\n" |
| 5791 | "exit 0\n", |
| 5792 | binary_path); |
| 5793 | return written > 0 && (size_t)written < script_size ? CLI_OK : CLI_ERR; |
| 5794 | } |
| 5795 | |
| 5796 | static int cbm_remove_owned_hook_script(const char *path, const char *expected_current, |
| 5797 | const char *const *released_scripts, |
no outgoing calls
no test coverage detected