| 7808 | } |
| 7809 | |
| 7810 | static void uninstall_tiered_profile_prompts(const char *label, const char *verify_path, |
| 7811 | cbm_graph_profile_dialect_t dialect, |
| 7812 | const char *legacy_verify_content, bool dry_run) { |
| 7813 | cbm_graph_access_t access = cbm_tiered_profile_access(dialect); |
| 7814 | for (int value = 0; value < (int)CBM_GRAPH_TIER_COUNT; value++) { |
| 7815 | cbm_graph_tier_t tier = (cbm_graph_tier_t)value; |
| 7816 | char path[CLI_BUF_1K]; |
| 7817 | if (cbm_tiered_profile_path(verify_path, tier, path, sizeof(path)) != CLI_OK) { |
| 7818 | record_agent_config_error(true, label, "prompt_path", verify_path); |
| 7819 | continue; |
| 7820 | } |
| 7821 | if (dry_run) { |
| 7822 | printf(" %s prompt: would remove owned profile %s\n", label, path); |
| 7823 | continue; |
| 7824 | } |
| 7825 | char *current = cbm_render_graph_prompt(tier, access); |
| 7826 | if (!current) { |
| 7827 | record_agent_config_error(true, label, "prompt_render", path); |
| 7828 | continue; |
| 7829 | } |
| 7830 | const char *released[] = {legacy_verify_content}; |
| 7831 | size_t released_count = tier == CBM_GRAPH_TIER_VERIFY && legacy_verify_content ? 1U : 0U; |
| 7832 | int result = cbm_text_remove_owned_document_any(path, current, released, released_count); |
| 7833 | free(current); |
| 7834 | if (result < CLI_OK) { |
| 7835 | record_agent_config_error(true, label, "prompt_uninstall", path); |
| 7836 | } else if (result > CLI_OK) { |
| 7837 | printf(" %s prompt: preserved modified profile %s\n", label, path); |
| 7838 | } else { |
| 7839 | printf(" %s prompt: removed owned profile %s\n", label, path); |
| 7840 | } |
| 7841 | } |
| 7842 | } |
| 7843 | |
| 7844 | static void install_copilot_durable_context(const char *home, const char *binary_path, bool force, |
| 7845 | bool dry_run) { |
no test coverage detected