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. */
| 3563 | * filename as an exact-owned document: a foreign collision fails closed, and |
| 3564 | * uninstall accepts only the complete generated lifecycle schema. */ |
| 3565 | static int cbm_upsert_copilot_hooks(const char *binary_path, const char *manifest_path) { |
| 3566 | char *manifest = cbm_build_copilot_hook_manifest(binary_path); |
| 3567 | if (!manifest || !manifest_path) { |
| 3568 | free(manifest); |
| 3569 | return CLI_ERR; |
| 3570 | } |
| 3571 | int rc = cbm_text_ensure_owned_document(manifest_path, manifest); |
| 3572 | free(manifest); |
| 3573 | return rc == 0 ? CLI_OK : CLI_ERR; |
| 3574 | } |
| 3575 | |
| 3576 | static int cbm_remove_copilot_hooks(const char *manifest_path, const char *binary_path) { |
| 3577 | char *manifest = cbm_build_copilot_hook_manifest(binary_path); |
no test coverage detected