test: pin the env parsers; reframe mutation guidance as an occasional audit#53
Merged
Merged
Conversation
… audit A scoped mutation audit of src/config/env.ts left its parsers under-asserted — there was no env spec, so the fallback / NaN-reject / sign-and-range-reject branches of readPort, readIntFromEnv, and readNonNegativeIntFromEnv all survived. Added a focused loadEnv spec covering each parser's four cases, including the deliberate difference between readIntFromEnv (rejects <= 0) and readNonNegativeIntFromEnv (0 is valid — 'due immediately'). Verified by hand-applying the <= 0 -> < 0 mutant (the readIntFromEnv test fails on it). Per the app's pragmatic-coverage constitution this stays targeted — the env parsers are genuine config-correctness logic; the rest of src/ is not chased. Also reframes the mutation guidance (guidelines + CLAUDE.md) as an occasional, scoped audit rather than a per-PR gate, and documents hand-verification.
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 scoped mutation audit of
src/config/env.tsfound its parsers under-asserted — there was no env spec at all, so the fallback / NaN-reject / sign-and-range-reject branches ofreadPort,readIntFromEnv, andreadNonNegativeIntFromEnvsurvived.Added a focused
loadEnvspec covering each parser's cases — including the deliberate contrast betweenreadIntFromEnv(rejects<= 0) andreadNonNegativeIntFromEnv(0is valid: "due immediately", which the reminder tests rely on) andreadPort's range check. Verified by hand-applying the<= 0→< 0mutant — thereadIntFromEnvtest fails on it.Kept targeted, per this app's pragmatic-coverage constitution (Rule 3: full-source mutation is a non-goal): the env parsers are genuine config-correctness logic worth pinning; the rest of
src/is deliberately not chased.Also reframes the mutation-testing guidance (guidelines + CLAUDE.md) as an occasional, targeted audit — not a per-PR gate, and documents the fast hand-verification method (apply the mutant, run the suite, revert). Base suite green (84 tests, the live-Kafka e2e self-skips). No behavior change.