Skip to content

fix(config): make key validation locale-independent - #2506

Open
Math1987 wants to merge 1 commit into
garrytan:mainfrom
Math1987:codex/fix-config-key-locale
Open

fix(config): make key validation locale-independent#2506
Math1987 wants to merge 1 commit into
garrytan:mainfrom
Math1987:codex/fix-config-key-locale

Conversation

@Math1987

Copy link
Copy Markdown

Summary

  • pin both gstack-config key validators to the C locale
  • preserve the strict ASCII key contract instead of widening it with a locale-aware character class
  • add a cross-platform regression tripwire plus get/set behavior coverage

Fixes #2494

Why

POSIX bracket ranges follow locale collation. With GNU grep under tr_TR.UTF-8, the ASCII letter i can fall outside [a-z], so valid config keys are rejected and skill preambles silently fall back to their defaults.

Tests

  • fail-first: the new regression test failed on main because neither validator pinned LC_ALL
  • bun test test/gstack-config-key-locale.test.ts test/user-slug-fallback.test.ts test/docs-config-keys.test.ts test/explain-level-config.test.ts test/gstack-config-redact-keys.test.ts — 35 pass, 0 fail
  • bash -n bin/gstack-config
  • git diff --check

Full-suite note

I also attempted bun test, but it did not complete cleanly in my multi-repository macOS workspace: unrelated existing suites timed out or depended on unavailable local services and fixture assumptions (including global discovery, gbrain fixtures, and local server binding). The focused config suite above is green.

@trunk-io

trunk-io Bot commented Aug 10, 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 rejects every key containing the letter "i" under Turkish locale (a-z range is collation-dependent)

1 participant