From 51713f6c70a19cbf685ab350f4399196391179ed Mon Sep 17 00:00:00 2001 From: Garry Tan Date: Wed, 9 Sep 2026 03:57:16 +0000 Subject: [PATCH] fix(uninstall): revoke memorable_recall independently of the hook manager and name a failed revocation Co-Authored-By: Claude Fable 5.1 --- bin/gstack-uninstall | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/bin/gstack-uninstall b/bin/gstack-uninstall index 9601e6f17..eaa30a013 100755 --- a/bin/gstack-uninstall +++ b/bin/gstack-uninstall @@ -164,13 +164,6 @@ 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 - # 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 # hook item, live or dead — the binaries they point at are being deleted. @@ -178,6 +171,18 @@ if [ -x "$SETTINGS_HOOK" ]; then REMOVED+=("stray gstack hook entries") fi fi +# The Memorable consent key must never outlive the hook, kept state or not, and +# not only when the hook manager is present: 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; a failed flip is named, not hidden. +if [ -x "$GSTACK_CONFIG" ] && [ "$("$GSTACK_CONFIG" get memorable_recall 2>/dev/null)" = "on" ]; then + if "$GSTACK_CONFIG" set memorable_recall off >/dev/null 2>&1; then + REMOVED+=("memorable_recall consent (set off)") + else + echo "WARNING: could not set memorable_recall off; run: $GSTACK_CONFIG set memorable_recall off" >&2 + fi +fi # ─── Remove global Claude skills ──────────────────────────── CLAUDE_SKILLS="$HOME/.claude/skills"