Conversation
FlexBool accepts the full on/off synonym table (true/on/enabled/enable/ active/activated/yes/y/1 vs false/off/disabled/disable/no/not/n/0, case-insensitive, whitespace-tolerant, 1/0 numbers). Every config error now renders 'error in <path> at line L, column C: <detail>' — syntax errors, unknown keys (with Levenshtein 'did you mean' suggestions), wrong-typed values, enum values, and boolean synonyms. Config errors are fatal: late exits 1 before the TUI instead of silently degrading. Missing file still boots a fresh install.
Adversarial review of the strict parser: concatenated top-level JSON values were silently dropped (partially-applied config), a UTF-8 BOM bricked startup with a confusing offset, and truncated input rendered as bare EOF. All now positioned errors; BOM stripped with offsets kept editor-visible. Pins: duplicate keys, CRLF columns, nested keys not flagged, tri-state null handling, SaveConfig omission, upstream-era config compat, flag-explicit-at-default precedence, -replay-shadow/ -check-compaction behavior with broken configs.
Adds docs/config-reference.md and the internal/config/docs_test.go guard, scoped to this branch's Config schema (16 top-level keys): every documented table row must be a real Config json tag, every tag must be documented, and the precedence / boolean-synonyms / strict-parsing sections must stay present. The guard reflects over the same struct the strict parser's unknown-key walk uses, so the doc cannot drift from what the parser accepts.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A typo in config.json used to buy you either silence or a pile of silently-applied defaults. Now every parse problem is named, positioned, and fatal — and booleans speak human.
FlexBool — the full on/off synonym table
Booleans accept
true/on/enabled/enable/active/activated/yes/y/1vsfalse/off/disabled/disable/no/not/n/0— case-insensitive, whitespace-tolerant, with bare1/0numbers allowed. Anything else is an error that lists what's accepted.Every config error is self-explanatory
Each error renders as
error in <full path> at line L, column C: <detail>— for syntax errors, unknown keys (with a Levenshtein did-you-mean suggestion), wrong-typed values, invalid enum values, and invalid boolean synonyms alike.Config errors are fatal
A broken config exits 1 before the TUI starts. No silent degradation to defaults while you believe everything's fine. A missing file still boots a fresh install, unchanged.
Parser hardening
docs/config-reference.md
A full reference for this branch's config keys, enforced by a reflection guard test: every documented row must be a real Config json tag and every tag must be documented, so doc and struct can't drift apart.
Scope note: this PR covers the fields that exist on today's main. Sibling PRs extend both the schema and the doc as they add fields.
Testing
exit 0 — all 18 packages green (15 ok, 3 without test files).