feat(config): per-check thresholds in .checkup.yml (complexity CCN, duplication %)#124
Merged
Conversation
…uplication %) (#72) The .checkup.yml override layer shipped stack/checks/commands but deferred per-check thresholds, leaving the complexity and duplication banding as hardcoded literals an owner couldn't tune without editing the orchestrator. Add a `thresholds:` block parsed by lib/config.sh into CHECKUP_CPLX_CCN_WARN / _FAIL and CHECKUP_DUP_WARN_PCT / _FAIL_PCT (integers, validated — garbage warns and is ignored, keeping the default). bin/checkup.sh resolves each with the historical literal as its default (_cfg_int guards a hand-set non-integer), then threads them through the complexity CCN arms (ESLint --rule level built so the default renders the exact historical JSON; lizard/eslint select + severity bands; the merged-record fail cutoff via complexity-merge.jq's $ARGS.named.fail // 30) and the duplication jscpd/lizard percentage bands. Tunes a check's STATUS only — never the health score (ADR-0009). An absent `thresholds:` block is byte-identical to before (verified end-to-end: complexity and duplication records unchanged on no-config runs; knobs flip warn↔fail↔pass as configured). scc's heuristic complexity band is a different scale and keeps its own cutoffs. Documented in .checkup.yml.example (live block) and README; covered by test/config.test.sh (parse, integer validation, unknown-key warn, _cfg_int). Closes #72 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012oHR4g8pH7Ui242SRycFzw
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.
What
The
.checkup.ymloverride layer shippedstack/checks/commandsbut deferred per-check thresholds — so the complexity and duplication banding were hardcoded literals an owner couldn't tune without editing the orchestrator.Adds a
thresholds:block:lib/config.shintoCHECKUP_CPLX_CCN_WARN/_FAIL+CHECKUP_DUP_WARN_PCT/_FAIL_PCT— integers, validated (garbage warns and is ignored, keeping the default; parser ethos: never abort, never a false pass).bin/checkup.shresolves each with the historical literal as default (_cfg_intguards a hand-set non-integer from reaching jq /[ -lt ]), then threads them through the complexity CCN arms (ESLint--rulelevel — built so the default renders the exact historical JSON; lizard/eslintselect+ severity bands; the merged-record fail cutoff viacomplexity-merge.jq's$ARGS.named.fail // 30) and the duplication jscpd/lizard percentage bands.Tunes a check's status only — never the health score (ADR-0009). scc's heuristic complexity band is a different scale and keeps its own cutoffs.
Why this is safe
An absent
thresholds:block defaults every knob to today's literal → byte-identical to before.Verification
config.test.sh+13 cases → 33 passing (parse, integer validation, unknown-key warn,_cfg_int, and the existing example-sync test now exercises the live block).fail: 11flips a CCN-13 repowarn → fail; duplication on a 75%-clone repo isfailby default andpasswithwarn: 95.Documented in
.checkup.yml.example(live block) and the README overrides section.Closes #72
🤖 Generated with Claude Code