Skip to content

gstack-config accepts malformed cross_project_learnings values, silently disabling cross-project learnings with no supported way to undo it #2673

Closed

Description

@tspearconquest

Impact

A user who typos this key gets the opposite of what they asked for, is never
warned, and cannot get back to a working state without hand-editing
~/.gstack/config.yaml.

$ gstack-config set cross_project_learnings ture   # typo for "true"
$ echo $?
0                                                   # accepted

The user believes cross-project learnings are on. They are off, and will stay off
permanently.

Who this affects

The first-run AskUserQuestion prompt writes the value itself (set ... true /
set ... false), so it can never produce a bad one. A malformed value is only
reachable via a hand-run gstack-config set — and since the prompt fires once,
that is the only route left for anyone who later changes their mind.

So the exposed population is specific: people who toggle this between trust
domains
— on for internal work, off before touching a public or client repo.
That is a repeated manual command, so it is the most likely place to fat-finger
the value. The skill's own prompt anticipates this user: "Skip if you work on
multiple client codebases where cross-contamination would be a concern."

On severity: a typo fails toward the private side (anything that isn't true
takes the project-scoped branch), so nothing leaks across repos. The harm is a
feature that silently stops working, with no supported way to change it back.

Expected vs. actual

Expected: the value is rejected, as it is for every other key with a fixed set
of valid values — e.g. gstack-config set pair_agent maybe warns and falls back.

Actual: ture is stored verbatim. No warning, no error, exit code 0.

$ gstack-config set pair_agent maybe
Warning: pair_agent 'maybe' not recognized. Valid values: on, off. Using off.

$ gstack-config set cross_project_learnings ture
$                                                  # nothing

Why the mistake persists

Skills read the key with two separate checks, and a typo fails both:

_CROSS_PROJ=$(gstack-config get cross_project_learnings 2>/dev/null || echo "unset")
if [ "$_CROSS_PROJ" = "true" ]; then     # "ture" != "true"  -> project-scoped
  • It isn't true, so searches quietly stay project-scoped.
  • It isn't empty/unset either, so the first-run AskUserQuestion prompt — the
    one place a user would normally be asked about this — never fires again.

So the one interactive checkpoint that would have caught the mistake is exactly
what the bad value suppresses, and there is no gstack-config unset to undo it.

In fairness, the value is not invisible: gstack-config list shows
cross_project_learnings: ture, and skills echo CROSS_PROJECT: ture while
running. But neither is an error, both are easy to read past, and neither
prompts a correction — so in practice the mistake persists.

Root cause

bin/gstack-config has a block for keys with closed value domains:

# V1: whitelist values for keys with closed value domains. Unknown values warn + default.

It covers ten keys — brain_trust_policy, explain_level, pair_agent,
codex_reviews, skill_prefix and five others.

cross_project_learnings has a closed domain too (true / false / unset) but
is the only such key missing from the block — which looks like an oversight
rather than a deliberate exemption.

Affected

14 skills gate on this key with the same = "true" test (all confirmed at the
SHA below), so one typo changes retrieval behaviour across all of them:

plan-design-review, plan-eng-review, plan-devex-review, plan-ceo-review,
design-review, design-consultation, cso, investigate, qa, qa-only,
review, office-hours, retro, ship.

Suggested fix

Add the key to that block. Suggest following codex_reviews (reject, leave the
existing value alone) rather than the more common warn-and-default: silently
coercing a scope/privacy setting to a default is close to the bug being reported
here.

if [ "$KEY" = "cross_project_learnings" ] && [ "$VALUE" != "true" ] && \
   [ "$VALUE" != "false" ] && [ "$VALUE" != "unset" ]; then
  echo "Error: cross_project_learnings '$VALUE' not recognized. Valid: true, false, unset. Existing value unchanged." >&2
  exit 1
fi

Accepting the literal unset would also give users a supported way back to the
first-run prompt, matching the idiom brain_trust_policy already uses. Today
there is no such path for this key.

Verified against

main @ 85fd9db554ae4aaaa6d356d2daf873121ee85bdd

  • bin/gstack-config:355 — the whitelist block
  • bin/gstack-config:147 — cross_project_learnings) echo "" ;; # intentionally empty → unset triggers first-time prompt
  • plan-design-review/sections/review-sections.md:16 — if [ "$_CROSS_PROJ" = "true" ]; then
  • plan-design-review/sections/review-sections.md:23 — If CROSS_PROJECT is unset (first time): Use AskUserQuestion:

Possibly related

Same class, already open: #1726 (gstack-model-benchmark accepts malformed
--timeout-ms), #1723 (gstack-timeline-read accepts malformed --limit).
#2488 has the same shape.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions