Skip to content

fix(config): let enabled reach the check that declares it (CD-324) + docs fix (CD-325) - #215

Merged
TAJD merged 2 commits into
mainfrom
fix/cd-324
Aug 11, 2026
Merged

fix(config): let enabled reach the check that declares it (CD-324) + docs fix (CD-325)#215
TAJD merged 2 commits into
mainfrom
fix/cd-324

Conversation

@TAJD

@TAJD TAJD commented Aug 11, 2026

Copy link
Copy Markdown
Owner

Two commits, both small.

CD-324 — Refactor.PurityHeuristic was unreachable

Its only option is called enabled, and the config loader listed enabled in META_KEYS — stripped out of every check's option bag before validation, as a forward-compatible placeholder. The check's own catalogue page tells the user to write enabled = true, and the check never saw it. A registered check no user could turn on.

enabled now flows through to the option bag like any other option; options_for_raw drops it again only for the checks that do not declare it, so configs carrying a stray enabled keep loading rather than hard-failing on upgrade (validate_options rejects unknown keys with an error, not a warning).

The fix is deliberately silent for the inert case. Making it loud means routing a diagnostic through CD-311's unknown-key warning channel, which options_for_raw has no sink for; that is not worth the plumbing, and rejecting outright would be a breaking change for a key we told people was accepted.

CD-325 — a docs recommendation that breaks another check

Design.LayerViolation's page offered .cofferdamignore as the simple way to keep tests out of layer analysis. That prunes the files before discovery, so they contribute no import edges either, and Design.OrphanExport then reports every symbol only the tests import as never imported in the project. The page now points at [[overrides]] with disabled = true. The underlying behaviour is unchanged and tracked on CD-325.

Verification

cargo build --workspace, cargo test --workspace (1426 passed), cargo clippy --workspace --all-targets -D warnings, cargo fmt --check, gen-docs --check via the pre-commit hook, plus cofferdam check examples/purity_heuristic.ts with enabled = true — which now emits the two expected Refactor.PurityHeuristic findings and emitted nothing before.

🤖 Generated with Claude Code

https://claude.ai/code/session_019afugU2bTYCtXn6Vy9dn1v

TAJD and others added 2 commits August 11, 2026 08:00
`Refactor.PurityHeuristic`'s only option is called `enabled`, and the
config loader stripped that key out of every check's option bag before
validation as a forward-compatible placeholder. The check's catalogue
page told the user to write `enabled = true`; the check never saw it, so
a registered check was unreachable by any user.

`enabled` now flows through to the option bag like any other option, and
`options_for_raw` drops it again only for the checks that do not declare
it — so configs carrying a stray `enabled` keep loading rather than
failing on upgrade.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019afugU2bTYCtXn6Vy9dn1v
`Design.LayerViolation`'s page offered `.cofferdamignore` as the simple
way to keep tests out of layer analysis. That prunes the files before
discovery, so they contribute no import edges either, and
`Design.OrphanExport` then reports every symbol only the tests import as
never imported in the project. Point at `[[overrides]] disabled = true`
instead, which turns off the one check without removing the files from
the graph.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019afugU2bTYCtXn6Vy9dn1v
@TAJD TAJD changed the title fix(config): let enabled reach the check that declares it (CD-324) fix(config): let enabled reach the check that declares it (CD-324) + docs fix (CD-325) Aug 11, 2026
@github-actions

Copy link
Copy Markdown

Criterion benchmark comparison (PR head vs base branch)

�[1m�[92m   Compiling�[0m cofferdam-engine v0.4.2 (/home/runner/work/cofferdam/cofferdam/crates/cofferdam-engine)
�[1m�[92m    Finished�[0m `bench` profile [optimized] target(s) in 40.29s
�[1m�[92m     Running�[0m benches/engine_bench.rs (target/release/deps/engine_bench-e0ce420cbfc0fb1d)
Gnuplot not found, using plotters backend
Benchmarking full_run_no_cache
Benchmarking full_run_no_cache: Warming up for 3.0000 s
Benchmarking full_run_no_cache: Collecting 20 samples in estimated 7.5752 s (420 iterations)
Benchmarking full_run_no_cache: Analyzing
full_run_no_cache       time:   [17.132 ms 17.239 ms 17.423 ms]
                        change: [+2.6023% +3.3993% +4.2355%] (p = 0.00 < 0.05)
                        Performance has regressed.
Found 6 outliers among 20 measurements (30.00%)
  3 (15.00%) low mild
  1 (5.00%) high mild
  2 (10.00%) high severe

Benchmarking single_file_edit_incremental
Benchmarking single_file_edit_incremental: Warming up for 3.0000 s

Warning: Unable to complete 20 samples in 5.0s. You may wish to increase target time to 9.8s, enable flat sampling, or reduce sample count to 10.
Benchmarking single_file_edit_incremental: Collecting 20 samples in estimated 9.7584 s (210 iterations)
Benchmarking single_file_edit_incremental: Analyzing
single_file_edit_incremental
                        time:   [7.7400 ms 7.8559 ms 7.9579 ms]
                        change: [-1.4141% +0.3745% +2.2171%] (p = 0.70 > 0.05)
                        No change in performance detected.


@github-actions

Copy link
Copy Markdown

Criterion benchmark comparison (PR head vs base branch)

�[1m�[92m   Compiling�[0m cofferdam-engine v0.4.2 (/home/runner/work/cofferdam/cofferdam/crates/cofferdam-engine)
�[1m�[92m   Compiling�[0m cofferdam-checks v0.4.2 (/home/runner/work/cofferdam/cofferdam/crates/cofferdam-checks)
�[1m�[92m    Finished�[0m `bench` profile [optimized] target(s) in 51.37s
�[1m�[92m     Running�[0m benches/engine_bench.rs (target/release/deps/engine_bench-e0ce420cbfc0fb1d)
Gnuplot not found, using plotters backend
Benchmarking full_run_no_cache
Benchmarking full_run_no_cache: Warming up for 3.0000 s
Benchmarking full_run_no_cache: Collecting 20 samples in estimated 7.5852 s (420 iterations)
Benchmarking full_run_no_cache: Analyzing
full_run_no_cache       time:   [17.009 ms 17.079 ms 17.159 ms]
                        change: [+4.5231% +5.2954% +5.9567%] (p = 0.00 < 0.05)
                        Performance has regressed.

Benchmarking single_file_edit_incremental
Benchmarking single_file_edit_incremental: Warming up for 3.0000 s

Warning: Unable to complete 20 samples in 5.0s. You may wish to increase target time to 9.8s, enable flat sampling, or reduce sample count to 10.
Benchmarking single_file_edit_incremental: Collecting 20 samples in estimated 9.7890 s (210 iterations)
Benchmarking single_file_edit_incremental: Analyzing
single_file_edit_incremental
                        time:   [7.6273 ms 7.6674 ms 7.7124 ms]
                        change: [+5.7619% +6.5591% +7.3983%] (p = 0.00 < 0.05)
                        Performance has regressed.


@TAJD
TAJD merged commit 01949ab into main Aug 11, 2026
18 checks passed
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.

1 participant