From 34fa61e1cceca4ddde0537aeb73b21b558a433d0 Mon Sep 17 00:00:00 2001 From: Manfred Riem <15701806+mnriem@users.noreply.github.com> Date: Mon, 23 Mar 2026 11:00:42 -0500 Subject: [PATCH] docs: clarify that tracking all setup files is intentional (safe due to hash check) --- src/specify_cli/agent_pack.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/specify_cli/agent_pack.py b/src/specify_cli/agent_pack.py index 78f6de88d..5e24c2ee2 100644 --- a/src/specify_cli/agent_pack.py +++ b/src/specify_cli/agent_pack.py @@ -347,13 +347,20 @@ class AgentBootstrap: All files returned by ``setup()`` are tracked — including shared project infrastructure — so that teardown/switch can precisely - remove everything the agent installed. + remove everything the agent installed. This is intentional: + ``remove_tracked_files()`` only deletes files whose SHA-256 + hash still matches the original, so user-modified files are + always preserved (unless ``--force`` is used). Args: agent_files: Files reported by :meth:`setup`. extension_files: Files created by extension registration. """ all_extension = list(extension_files or []) + # Track ALL files returned by setup(), not just those under the + # agent's directory tree. This is safe because teardown only + # removes files that are unmodified (hash check) and prompts + # for confirmation on modified files. all_agent: List[Path] = list(agent_files or []) # Scan the agent's directory tree for files created by later