mirror of
https://github.com/garrytan/gstack.git
synced 2026-09-09 14:38:59 +02:00
A hook script and its sourced helper can be copied at different times. With
an older careful/bin/hook-extract.sh that lacks gstack_hook_state_root:
- check-freeze.sh now emits a deny ("fail closed, re-run ./setup or
/unfreeze") instead of dying under set -e with no decision JSON.
- check-careful.sh falls back to ${GSTACK_HOME:-$HOME/.gstack} so project
rules under the plain chain still load and a decision is always emitted
(a warn hook must never break on a stale helper).
gstack_hook_state_root prints its root without a trailing newline and both
callers capture it with a printf-x sentinel, so a GSTACK_HOME ending in a
newline round-trips byte-for-byte with the writer's %q form.
gstack_hook_log_fire stays on ${GSTACK_HOME:-$HOME/.gstack}/analytics, the
same two-step chain every other analytics writer and reader uses, so the
usage log remains one file under a plugin install.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>