Skip to content

fix(config): reject malformed cross_project_learnings at set - #2676

Open
szsunyuan wants to merge 1 commit into
garrytan:mainfrom
szsunyuan:fix/gstack-config-reject-bad-cross-project-learnings
Open

fix(config): reject malformed cross_project_learnings at set#2676
szsunyuan wants to merge 1 commit into
garrytan:mainfrom
szsunyuan:fix/gstack-config-reject-bad-cross-project-learnings

Conversation

@szsunyuan

Copy link
Copy Markdown
Contributor

Why (in your own words)

gstack-config set cross_project_learnings ture exited 0 and stored the typo. Skills only enable on the literal true, and a non-empty value suppresses the first-run prompt, so the feature stayed off and the question never came back. The official AskUserQuestion path only writes true / false. A hand-typed typo was the hole.

Reject the bad write, same as codex_reviews. Do not coerce to false — a stored default still kills the empty-get sentinel.

Fixes #2673. Same class as #2488 (durable bad write). Not #1726 / #1723 (those are parseInt on one-shot flags; #1726 is already on main, #1723 has #1724). Did not add an unset token or a new subcommand.

Why this shape

Issue author named bin/gstack-config set and the closed-domain block. CONTRIBUTING's wave rule: if two PRs fix the same thing, keep the smaller one. This is 2 files, on current main. Fine to absorb into a wave.

Did not follow the issue's "Expected" pair_agent warn-and-default. That would persist a value and still suppress the prompt.

What it does

  • set cross_project_learnings accepts only true and false.
  • Anything else exits 1, prints not recognized, leaves the file unchanged.
  • Empty get (first-run sentinel) is unchanged.

What it deliberately does not do

  • Accept literal unset (author snippet; optional undo, not the typo bug)
  • Add gstack-config unset
  • Heal an already-stored ture on get
  • Whitelist skill_prefix / telemetry / other unvalidated keys
  • Extract validate_key() (TODOS P3 leftover)
  • VERSION / CHANGELOG / README / ETHOS
  • /ship (wave stamps version)

AI was used for assistance.

Live evidence

Temp GSTACK_HOME only — not ~/.gstack/config.yaml. Same isolated dir, real bin/gstack-config.

Before (upstream/main @ 85fd9db):

$ bin/gstack-config set cross_project_learnings ture
$ echo $?
0

$ bin/gstack-config get cross_project_learnings
ture

After (this branch):

$ bin/gstack-config set cross_project_learnings ture
Error: cross_project_learnings 'ture' not recognized. Valid values: true, false. Existing value left unchanged.
$ echo $?
1

$ bin/gstack-config get cross_project_learnings

$ echo $?
0

$ bin/gstack-config set cross_project_learnings true
$ bin/gstack-config get cross_project_learnings
true

$ bin/gstack-config set cross_project_learnings ture
Error: cross_project_learnings 'ture' not recognized. Valid values: true, false. Existing value left unchanged.
$ bin/gstack-config get cross_project_learnings
true

Scope

  • Changed: bin/gstack-config (set only), test/gstack-config-cross-project.test.ts
  • Verified live by: the transcripts above, plus bun test test/gstack-config-cross-project.test.ts test/gstack-config-defaults.test.ts test/gstack-config-redact-keys.test.ts test/gstack-config-key-locale.test.ts (18 pass). The two reject cases were red on tip (Expected: 1, Received: 0) before the arm existed. Full bun run test green (7 shards). bun run slop:diff: no new findings in 2 files.
  • Did NOT test: Tier 2/3 evals. A real ~/.gstack/config.yaml. Healing a ture already on disk (out of scope).

Liveness proof (required)

  • Liveness screenshot attached: GSTACK PR typed live into a real surface (not edited onto the image)
image

Checklist

Test plan

  • bun test test/gstack-config-cross-project.test.ts → 4 pass (2 were red on tip)
  • Live: set ture → exit 1, get empty
  • Live: set true then set ture → still true
  • Empty get sentinel still exit 0
  • Existing defaults / redact / locale config tests still pass

Fork PRs do not get eval secrets; the free file above is the gate.

A typo was stored with exit 0, so the feature stayed off and the first-run prompt never returned. Reject like codex_reviews; do not coerce.

Co-authored-by: Cursor <cursoragent@cursor.com>
@trunk-io

trunk-io Bot commented Aug 23, 2026

Copy link
Copy Markdown

Merging to main in this repository is managed by Trunk.

  • To merge this pull request, check the box to the left or comment /trunk merge below.

After your PR is submitted to the merge queue, this comment will be automatically updated with its status. If the PR fails, failure details will also be posted here

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

1 participant