Skip to content

feat(config): per-check thresholds in .checkup.yml (complexity CCN, duplication %)#124

Merged
maudlin merged 1 commit into
mainfrom
72-per-check-thresholds
Jun 27, 2026
Merged

feat(config): per-check thresholds in .checkup.yml (complexity CCN, duplication %)#124
maudlin merged 1 commit into
mainfrom
72-per-check-thresholds

Conversation

@maudlin

@maudlin maudlin commented Jun 26, 2026

Copy link
Copy Markdown
Owner

What

The .checkup.yml override layer shipped stack / checks / commands but 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:

thresholds:
  complexity_ccn_warn: 10   # report functions at/above this CCN (ESLint + lizard engines)
  complexity_ccn_fail: 30   # any function at/above this → the complexity record fails
  duplication_warn_pct: 3   # duplication % at/above this → warn
  duplication_fail_pct: 5   # …→ fail
  • Parsed by lib/config.sh into CHECKUP_CPLX_CCN_WARN/_FAIL + CHECKUP_DUP_WARN_PCT/_FAIL_PCTintegers, validated (garbage warns and is ignored, keeping the default; parser ethos: never abort, never a false pass).
  • bin/checkup.sh resolves each with the historical literal as default (_cfg_int guards a hand-set non-integer from reaching jq / [ -lt ]), 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). 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

  • Full CI suite green (12 suites); 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).
  • End-to-end: complexity + duplication records byte-identical on no-config runs; knobs move the band as configured — complexity fail: 11 flips a CCN-13 repo warn → fail; duplication on a 75%-clone repo is fail by default and pass with warn: 95.

Documented in .checkup.yml.example (live block) and the README overrides section.

Closes #72

🤖 Generated with Claude Code

…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
@maudlin maudlin merged commit db873b6 into main Jun 27, 2026
6 checks passed
@maudlin maudlin deleted the 72-per-check-thresholds branch June 27, 2026 00:00
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.

Per-check thresholds in .checkup.yml (complexity CCN, duplication %)

1 participant