mirror of
https://github.com/garrytan/gstack.git
synced 2026-06-23 18:20:00 +02:00
fix(setup,config): harden plan-tune decision against bad input
Review follow-ups to the non-interactive plan-tune work:
- setup now lowercases + whitespace-strips the resolved decision before the
case match, so an explicit opt-in via flag/env ("YES", "Yes", " yes") is
honored instead of silently falling through to "prompt"/skip. Also accepts
on/off and 1/0.
- gstack-config rejects out-of-domain plan_tune_hooks values (anything but
prompt|yes|no) with a warning + fallback to prompt, matching the existing
value-whitelist pattern for explain_level / artifacts_sync_mode.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -298,6 +298,10 @@ case "${1:-}" in
|
||||
echo "Warning: redact_prepush_hook '$VALUE' not recognized. Valid values: true, false. Using false." >&2
|
||||
VALUE="false"
|
||||
fi
|
||||
if [ "$KEY" = "plan_tune_hooks" ] && [ "$VALUE" != "prompt" ] && [ "$VALUE" != "yes" ] && [ "$VALUE" != "no" ]; then
|
||||
echo "Warning: plan_tune_hooks '$VALUE' not recognized. Valid values: prompt, yes, no. Using prompt." >&2
|
||||
VALUE="prompt"
|
||||
fi
|
||||
mkdir -p "$STATE_DIR"
|
||||
# Write annotated header on first creation
|
||||
if [ ! -f "$CONFIG_FILE" ]; then
|
||||
|
||||
Reference in New Issue
Block a user