From 93ecbcb879fef2a778ea1f3bd046fb49c91b8e09 Mon Sep 17 00:00:00 2001 From: damocles Date: Mon, 1 Jun 2026 22:01:24 +0200 Subject: [PATCH] =?UTF-8?q?fix(#1013):=20make=20write=20private=20?= =?UTF-8?q?=E2=80=94=20only=20set=5Fgroups=20and=20remove=5Fagent=20are=20?= =?UTF-8?q?the=20write=20paths?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hive-c0re/src/tool_groups.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/hive-c0re/src/tool_groups.rs b/hive-c0re/src/tool_groups.rs index 77fdcd56..1d894e59 100644 --- a/hive-c0re/src/tool_groups.rs +++ b/hive-c0re/src/tool_groups.rs @@ -56,10 +56,9 @@ pub fn groups_for(name: &str) -> Vec { } /// Persist the full tool-groups map. Sorted JSON output keeps diffs -/// minimal. Best-effort — returns `io::Error` so callers decide -/// whether to abort or log. Prefer `set_groups` over calling this -/// directly — `set_groups` validates group names before writing. -pub fn write(map: &BTreeMap>) -> std::io::Result<()> { +/// minimal. Use `set_groups` (or `remove_agent`) from outside this +/// module — they go through the validated write path. +fn write(map: &BTreeMap>) -> std::io::Result<()> { let path = tool_groups_path(); if let Some(parent) = path.parent() { std::fs::create_dir_all(parent)?;