From 16af019e4248502b2912d864eebf9def85dc37e6 Mon Sep 17 00:00:00 2001 From: Garry Tan Date: Wed, 9 Sep 2026 03:19:04 +0000 Subject: [PATCH] fix(uninstall): memorable_recall goes off whether or not state is kept gstack-config resolves its root through GSTACK_STATE_ROOT/GSTACK_HOME, which can differ from the STATE_DIR uninstall removes; a full uninstall could leave memorable_recall=on in a config that survived. Flipped only when currently on. Co-Authored-By: Claude Fable 5.1 --- bin/gstack-uninstall | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/bin/gstack-uninstall b/bin/gstack-uninstall index c532a2ac1..9601e6f17 100755 --- a/bin/gstack-uninstall +++ b/bin/gstack-uninstall @@ -138,6 +138,7 @@ fi # `rm -rf ~/.claude/skills/gstack` silently no-ops and orphans every hook. SETTINGS_HOOK="$(dirname "$0")/gstack-settings-hook" SESSION_UPDATE="$(dirname "$0")/gstack-session-update" +GSTACK_CONFIG="$(dirname "$0")/gstack-config" if [ -x "$SETTINGS_HOOK" ]; then "$SETTINGS_HOOK" remove "$SESSION_UPDATE" && REMOVED+=("SessionStart hook") || true # Cathedral T8 cleanup: also remove plan-tune PreToolUse + PostToolUse hooks. @@ -163,9 +164,12 @@ if [ -x "$SETTINGS_HOOK" ]; then if "$SETTINGS_HOOK" remove-source --source gstack-memorable | grep -q "removed [1-9]"; then REMOVED+=("Memorable UserPromptSubmit hook (Memorable's own consent is unchanged: memorable disable | memorable forget)") fi - # A kept config must never say memorable_recall=on with no hook behind it. - if [ "$KEEP_STATE" -eq 1 ] && [ -x "$(dirname "$0")/gstack-config" ]; then - "$(dirname "$0")/gstack-config" set memorable_recall off >/dev/null 2>&1 || true + # The consent key must never outlive the hook, kept state or not: gstack-config + # resolves its root through GSTACK_STATE_ROOT/GSTACK_HOME, which can be a + # different directory from the STATE_DIR removed below. Only flipped when it + # is actually on, so no config file is created just to say off. + if [ -x "$GSTACK_CONFIG" ] && [ "$("$GSTACK_CONFIG" get memorable_recall 2>/dev/null)" = "on" ]; then + "$GSTACK_CONFIG" set memorable_recall off >/dev/null 2>&1 || true fi # Identity sweep for untagged strays (Claude Code strips _gstack_source # tags; pre-v1.67 setups baked worktree paths). Removes every gstack-owned