| 8023 | } |
| 8024 | |
| 8025 | static void uninstall_tiered_profile_prompts(const char *label, const char *verify_path, |
| 8026 | cbm_graph_profile_dialect_t dialect, |
| 8027 | const char *legacy_verify_content, bool dry_run) { |
| 8028 | cbm_graph_access_t access = cbm_tiered_profile_access(dialect); |
| 8029 | for (int value = 0; value < (int)CBM_GRAPH_TIER_COUNT; value++) { |
| 8030 | cbm_graph_tier_t tier = (cbm_graph_tier_t)value; |
| 8031 | char path[CLI_BUF_1K]; |
| 8032 | if (cbm_tiered_profile_path(verify_path, tier, path, sizeof(path)) != CLI_OK) { |
| 8033 | record_agent_config_error(true, label, "prompt_path", verify_path); |
| 8034 | continue; |
| 8035 | } |
| 8036 | if (dry_run) { |
| 8037 | printf(" %s prompt: would remove owned profile %s\n", label, path); |
| 8038 | continue; |
| 8039 | } |
| 8040 | char *current = cbm_render_graph_prompt(tier, access); |
| 8041 | if (!current) { |
| 8042 | record_agent_config_error(true, label, "prompt_render", path); |
| 8043 | continue; |
| 8044 | } |
| 8045 | const char *released[] = {legacy_verify_content}; |
| 8046 | size_t released_count = tier == CBM_GRAPH_TIER_VERIFY && legacy_verify_content ? 1U : 0U; |
| 8047 | int result = cbm_text_remove_owned_document_any(path, current, released, released_count); |
| 8048 | free(current); |
| 8049 | if (result < CLI_OK) { |
| 8050 | record_agent_config_error(true, label, "prompt_uninstall", path); |
| 8051 | } else if (result > CLI_OK) { |
| 8052 | printf(" %s prompt: preserved modified profile %s\n", label, path); |
| 8053 | } else { |
| 8054 | printf(" %s prompt: removed owned profile %s\n", label, path); |
| 8055 | } |
| 8056 | } |
| 8057 | } |
| 8058 | |
| 8059 | static void install_copilot_durable_context(const char *home, const char *binary_path, bool force, |
| 8060 | bool dry_run) { |
no test coverage detected