fix(cli): apply [[overrides]] to plugin findings (CD-321) - #209
Open
TAJD wants to merge 1 commit into
Open
Conversation
Plugin checks run through the Node host in `plugins.rs`, outside the engine loop where `effective_options` / `effective_severity` resolve `[[overrides]]`. A `disabled = true` block that silenced a built-in check left an identically-scoped plugin check firing, with no error and no diagnostic — escalating the glob to `paths = ["**"]` changed nothing. Resolution now runs over plugin issues in `run_plugins_filtered`, the single point both `cofferdam check` and `cofferdam verify --dist` funnel through. Severity overrides fall out of the same helper and previously did not reach plugin issues either. Per-check `options` overrides still do not reach plugins: the host receives the global `cfg.checks` bag once per run, so per-path resolution would need a second invocation or a wire-protocol change. Left for a follow-up rather than smuggled in here. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019afugU2bTYCtXn6Vy9dn1v
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.
Fixes CD-321.
[[overrides]]withdisabled = truehad no effect on plugin-produced findings, while the identical syntax in the same file silenced a built-in check. No error, no warning. Escalating the glob fromplugins/*/fixtures/**to**/fixtures/**to**changed nothing at any step — the documented escape hatch was simply unavailable for plugin checks.Root cause
Override resolution lives in
Engine::effective_options/effective_severity, called from inside the engine'sself.checksloop. Plugin checks never enter that loop: they run through the Node host incrates/cofferdam-cli/src/plugins.rs, entirely outside the engine.Fix
A new
plugin_override_verdictincofferdam-cli/src/main.rsmirrors those two methods' last-match-wins semantics over the samecfg::OverrideBlocklist, applied to plugin issues inrun_plugins_filtered— the single point bothcofferdam checkandcofferdam verify --distfunnel through. Disabled matches are dropped; severity matches are stamped on.Post-filtering on the Rust side rather than pre-invocation: pushing override state into the host would be a wire-protocol change, and a plugin check can be enabled on some paths and disabled on others, so the host has to run for the file set regardless. No change to the wire protocol, the
Checktrait, or the Node host.Also fixed, and not fixed
severityoverrides now reach plugin issues. They did not before — a plugin's owndefaultSeveritywas the only source of truth, and neither a global nor a per-path severity override touched it.optionsoverrides still do not. The host receives the globalcfg.checksbag once per run in theheaderrecord, so per-path resolution needs either one invocation per distinct option set or a protocol change. Filed as CD-326, deliberately not smuggled in here.[[context_suppress]]is unaffected — it filtersContext.*digest items fromcofferdam context, not check findings.Tests
crates/cofferdam-cli/tests/plugin_overrides.rs, four end-to-end cases against a fixture plugin that flags unconditionally:paths = ["**"]silences it entirely; a narrow glob disables it for the matching path and leaves the other reporting; a severity override replaces the plugin's owndefaultSeverity; no override at all still reports. Modelled on the existingplugin_suppression_relative_path.rsharness, and skipping whennodeis absent, per the existing convention.Verification
cargo build --workspace,cargo test --workspace(1379 passed, 8 ignored),cargo clippy --workspace --all-targets -- -D warnings,cargo fmt --all -- --check— all green.🤖 Generated with Claude Code
https://claude.ai/code/session_019afugU2bTYCtXn6Vy9dn1v