Skip to content

Plugin API follow-ons (thresholds, vocabulary) + per-rule config controls + suppress helper#167

Merged
ColumbusLabs merged 1 commit into
mainfrom
feat/plugin-followons-per-rule-config
Jun 10, 2026
Merged

Plugin API follow-ons (thresholds, vocabulary) + per-rule config controls + suppress helper#167
ColumbusLabs merged 1 commit into
mainfrom
feat/plugin-followons-per-rule-config

Conversation

@ColumbusLabs

Copy link
Copy Markdown
Owner

Summary

Completes the v1 plugin API surface (the two follow-ons called out in docs/plugin-api-rfc.md after #166) and adds per-rule config tuning plus a small DX helper.

Closes #73, closes #74, closes #107, closes #108, closes #146.

Plugin API follow-ons

  • Plugin threshold defaults (Support plugin-exported threshold defaults #73): plugins may export thresholds; they merge after built-in defaults so user config thresholds and --threshold still override. The examples/plugin/ reference plugin now reads context.getThreshold("no-console.maxCalls", 0) with a plugin-provided default, and non-numeric values fail fast at load.
  • Plugin vocabulary merging (Allow plugins to export naming-drift vocabulary groups #74): the vocabulary export (previously accepted-but-ignored with a warning) now merges into naming-drift concept group resolution below user config groups, so config groups with the same id still win. Malformed groups fail fast; when two plugins set the same threshold key or concept id, the later plugin wins with a warning.

Per-rule config controls

  • ruleSeverities (Per-rule severity overrides in config #107): rule id → severity map replacing the severity a rule reports, changing summary counts and --fail-on behavior. Unknown rule ids warn with a did-you-mean suggestion (plugin rule ids are recognized); invalid severity values fail fast at config merge.
  • ruleConfidenceFloors (Per-rule confidence floors in config #108): rule id → minimum confidence (0–1); findings below the floor are hidden and counted under summary.filterStats.filteredByConfidenceFloor. Same unknown-id warning and fail-fast range validation.

DX

  • debtlens suppress (Add debtlens suppress snippet helper for findings #146): prints a copy-paste inline suppression directive — debtlens suppress --rule todo-comment --reason "tracked in PROJ-123", with --file for file-level directives. Rule ids are validated against the registry with did-you-mean; a test feeds the generated snippet through a real scan to prove the scanner honors it.

JSON schema regenerated (guarded by the drift test); README, plugin RFC (status, export shape, open questions), and CHANGELOG updated.

Test plan

  • npm test: 222/222 passing (baseline before this branch: 202).
  • npm run typecheck and npm run typecheck:tests: clean.
  • npm run build: clean; npm run schema:generate output committed.
  • Smoke-tested debtlens suppress (next-line, unknown-rule suggestion) and debtlens scan . --cwd examples/plugin --rules no-console (plugin threshold default of 0 still flags the fixture's single console.log).

🤖 Generated with Claude Code

…s helper

Completes the plugin API v1 surface and adds per-rule tuning:

- Plugins can export a thresholds map merged after built-in defaults and
  before user config / --threshold (#73); the examples/plugin reference
  plugin now demonstrates getThreshold with a plugin-provided default.
- Plugin vocabulary exports merge into naming-drift concept group
  resolution below user config groups, replacing the previous
  ignored-with-warning behavior (#74). Cross-plugin collisions on a
  threshold key or concept id warn, later plugin wins.
- New ruleSeverities config map replaces the severity a rule reports;
  unknown rule ids warn with a did-you-mean suggestion, invalid severity
  values fail fast at config merge (#107).
- New ruleConfidenceFloors config map hides findings below a per-rule
  confidence floor, tracked as filterStats.filteredByConfidenceFloor (#108).
- New debtlens suppress command prints a copy-paste inline suppression
  directive (--rule, --reason, optional --file) validated against the
  rule registry (#146).

Schema regenerated; README, plugin RFC, and CHANGELOG updated.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@ColumbusLabs ColumbusLabs merged commit 85d3c1b into main Jun 10, 2026
2 checks passed
@ColumbusLabs ColumbusLabs deleted the feat/plugin-followons-per-rule-config branch June 10, 2026 18:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant