Copilot loads every manifest in $COPILOT_HOME/hooks. Treat our dedicated * filename as an exact-owned document: a foreign collision fails closed, and * uninstall accepts only the complete generated lifecycle schema. */
| 4081 | * filename as an exact-owned document: a foreign collision fails closed, and |
| 4082 | * uninstall accepts only the complete generated lifecycle schema. */ |
| 4083 | static int cbm_upsert_copilot_hooks(const char *binary_path, const char *manifest_path) { |
| 4084 | char *manifest = cbm_build_copilot_hook_manifest(binary_path); |
| 4085 | if (!manifest || !manifest_path) { |
| 4086 | free(manifest); |
| 4087 | return CLI_ERR; |
| 4088 | } |
| 4089 | int rc = cbm_text_ensure_owned_document(manifest_path, manifest); |
| 4090 | free(manifest); |
| 4091 | return rc == 0 ? CLI_OK : CLI_ERR; |
| 4092 | } |
| 4093 | |
| 4094 | static int cbm_remove_copilot_hooks(const char *manifest_path, const char *binary_path) { |
| 4095 | char *manifest = cbm_build_copilot_hook_manifest(binary_path); |
no test coverage detected