Files
codebase-memory-mcp/tests
Martin Vogel e1be4c4eaf fix(cli): remove the owned Augment scripts under the install-hook opt-out
install --no-hooks and the persisted install_hooks=false preference
removed the Augment SessionStart and PostToolUse view registrations from
~/.augment/settings.json but left the two scripts they pointed at,
~/.augment/hooks/codebase-memory-session.sh and
codebase-memory-coverage.sh (.ps1 on Windows), on disk.

The opt-out now deletes them the way uninstall does. Both paths share
remove_augment_owned_hook_scripts(): each script is rebuilt from the
binary path the install embedded and removed with
cbm_text_remove_owned_document() only on a byte-for-byte match, so a
script the user edited, or a foreign file with the same name, is kept.
Uninstall keeps its error operation names; the opt-out records
session_script_disable and coverage_script_disable. install --hooks
writes both scripts again.

Test: cli_no_hooks_removes_augment_owned_scripts drives the install
command with fake activation ops in a temporary HOME: default install,
--no-hooks (both scripts gone, MCP entry kept), a bare install with the
stored preference (still gone), --hooks (restored), and a user-edited
session script that --no-hooks keeps while it deletes the untouched
coverage script. The test ends on --hooks because the opt-out is process
state that later tests rely on.

Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-11-02 18:52:14 +01:00
..