Repository navigation
fix(config): don't flip explicit false booleans via jq // (#265) - #280
Merged
Merged
Conversation
…ed/keepalive, tune seeds) jq's `//` treats `false` the same as null/missing, so `.enabled // true` and similar defaults silently rewrote an operator's explicit `false` back to `true`. This hit four sites: parse_config's pool keepalive/enabled normalization, and the tune seed helpers _seed_g (1gb-pages) and _seed_wr (wrmsr). A parked failover pool with "enabled": false mined anyway, and a base config with wrmsr/1gb-pages false was benchmarked as if true. Switch each site to a has()-guarded idiom so an explicit value (including a bogus one, which still hits the existing true|false validation) passes through untouched, while an absent key still defaults to true. Closes #265. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
VijitSingh97
enabled auto-merge (squash)
July 17, 2026 02:32
…cov patch gate) The has() edits inside the multi-line jq map can never be attributed by kcov, failing the patch-coverage gate. Revert the map to its original form and restore explicit keepalive/enabled falses in a second single-line pass instead, the same pattern the #115 tls-fingerprint re-attach uses (see the comment there). Semantics are unchanged: only a boolean false matches `== false`, and non-boolean junk still flows through to the existing validation. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
Summary
jq's
//(alternative) operator treatsfalsethe same asnull/missing, so everyX // truedefault silently rewrote an operator's explicitfalseback totrue. Fixed the four affected sites by switching to ahas()-guarded idiom (explicit value — including a bogus one, which still hits existing validation — passes through untouched; an absent key still defaults totrue):rigforge.sh(parse_configpool normalization):keepaliveandenablednow useif has("keepalive"/"enabled") then .field else true end.rigforge.sh_seed_g(tune seed forrandomx."1gb-pages"): samehas()guard.rigforge.sh_seed_wr(tune seed forrandomx.wrmsr): samehas()guard, kept the existing array/type-filter tail unchanged.Sites intentionally left alone:
.tls // false,_seed_hj/_seed_cq(// false),.cpu.yield // false, and all string/number defaults —false // falseisfalse, so a// falsedefault was never affected.Tests added (tests/run.sh)
pools[0]with"enabled": false, "keepalive": falsekeeps bothfalsein the generatedPOOLS_JSON."enabled": "yes"still fails validation withPool enabled must be true or false— proves thehas()change doesn't bypass the existing boolean check._seed_wr/_seed_gkeep an explicit base-configfalse, and still default totruewhen the key is absent.Verified the new tests fail against the unfixed code (reproduced red, then green after the fix). Full suite:
make test(lint + 1339 tests) — 0 failures.Closes #265
🤖 Generated with Claude Code