mirror of
https://github.com/garrytan/gstack.git
synced 2026-05-20 11:19:56 +08:00
feat(gstack-config): validate explain_level + document in header
Adds explain_level: default|terse to the annotated config header with
a one-line description. Whitelists valid values; on set of an unknown
value, prints a specific warning ("explain_level '\$VALUE' not
recognized. Valid values: default, terse. Using default.") and writes
the default value. Matches V1 preamble's EXPLAIN_LEVEL echo expectation.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -38,6 +38,14 @@ CONFIG_HEADER='# gstack configuration — edit freely, changes take effect on ne
|
|||||||
# skill_prefix: false # true = namespace skills as /gstack-qa, /gstack-ship
|
# skill_prefix: false # true = namespace skills as /gstack-qa, /gstack-ship
|
||||||
# # false = short names /qa, /ship
|
# # false = short names /qa, /ship
|
||||||
#
|
#
|
||||||
|
# ─── Writing style (V1) ──────────────────────────────────────────────
|
||||||
|
# explain_level: default # default = jargon-glossed, outcome-framed prose
|
||||||
|
# # (V1 default — more accessible for everyone)
|
||||||
|
# # terse = V0 prose style, no glosses, no outcome-framing layer
|
||||||
|
# # (for power users who know the terms)
|
||||||
|
# # Unknown values default to "default" with a warning.
|
||||||
|
# # See docs/designs/PLAN_TUNING_V1.md for rationale.
|
||||||
|
#
|
||||||
# ─── Advanced ────────────────────────────────────────────────────────
|
# ─── Advanced ────────────────────────────────────────────────────────
|
||||||
# codex_reviews: enabled # disabled = skip Codex adversarial reviews in /ship
|
# codex_reviews: enabled # disabled = skip Codex adversarial reviews in /ship
|
||||||
# gstack_contributor: false # true = file field reports when gstack misbehaves
|
# gstack_contributor: false # true = file field reports when gstack misbehaves
|
||||||
@@ -63,6 +71,11 @@ case "${1:-}" in
|
|||||||
echo "Error: key must contain only alphanumeric characters and underscores" >&2
|
echo "Error: key must contain only alphanumeric characters and underscores" >&2
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
# V1: whitelist values for keys with closed value domains. Unknown values warn + default.
|
||||||
|
if [ "$KEY" = "explain_level" ] && [ "$VALUE" != "default" ] && [ "$VALUE" != "terse" ]; then
|
||||||
|
echo "Warning: explain_level '$VALUE' not recognized. Valid values: default, terse. Using default." >&2
|
||||||
|
VALUE="default"
|
||||||
|
fi
|
||||||
mkdir -p "$STATE_DIR"
|
mkdir -p "$STATE_DIR"
|
||||||
# Write annotated header on first creation
|
# Write annotated header on first creation
|
||||||
if [ ! -f "$CONFIG_FILE" ]; then
|
if [ ! -f "$CONFIG_FILE" ]; then
|
||||||
|
|||||||
Reference in New Issue
Block a user