Skip to content

#24: make runner/sensor/registry smell-agnostic (config-driven) - #39

Merged
devill merged 2 commits into
mainfrom
issue-24-smell-agnostic
Jun 17, 2026
Merged

#24: make runner/sensor/registry smell-agnostic (config-driven)#39
devill merged 2 commits into
mainfrom
issue-24-smell-agnostic

Conversation

@devill

@devill devill commented Jun 17, 2026

Copy link
Copy Markdown
Collaborator

Closes #24.

Concrete smell knowledge was hardcoded across the runner, sensors, checks, and rules registry. Per the locked decision it should live only in config (+ language initializers). This moves it all to a single config home.

Design

New src/config/tool-smells.ts is the single source:

  • Derived from the catalogue (defaultRules): the eslint raw→smell map, and eslint/jscpd/comment produces. So adding a catalogue smell auto-wires its translation and produces.
  • Config literals: knip's raw issue-type keys (tool-API keys, not canonical smell ids) and the supplemental parse-error (an eslint fatal with no catalogue rule).
  • The ruff + deptry AdapterSpecs moved here too.

The runner, sensors (preset/python-preset/deptry-sensor), checks (eslint/knip/jscpd/comment), and rules registry now import these instead of hardcoding.

Acceptance

  • grep -rn "non-essential-comment\|duplicated-code\|unused-dependency\|parse-error" src/runner.ts src/sensors/ src/checks/ src/rules/ is clean for non-test source (test files retain concrete smells as behaviour assertions).
  • Adding an eslint smell touches only src/config/ + src/cli/init/ — a derivation test pins this, and Add deep-nesting smell (TypeScript via ESLint max-depth) — also #24's live demonstrator #26 (deep-nesting) is the live demonstrator (stacked on this branch).
  • Build + full suite green (388).

Note

Realizes the locked "spec from config" via config-derived constants imported by the sensor layer (rather than per-call DI) — smell knowledge lives solely in config, consumed downward; lower-risk and behaviour-preserving. Documented in DECISIONS.md.

Atomic commits

  1. #24: add config/tool-smells as the single home for smell knowledge
  2. #24: make the runner/sensor/check/registry layer smell-agnostic

🤖 Generated with Claude Code


Generated by Claude Code

claude added 2 commits June 17, 2026 17:20
Derive the eslint raw->smell map, eslint/jscpd/comment produces from the
catalogue, hold knip's raw issue types and the supplemental parse-error
as config literals, and move the ruff + deptry AdapterSpecs here. A test
pins the catalogue derivation. Unused until the sensor layer imports it.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Nq6xHU6JtSNpYWhMYjXB15
hardcoding it. The acceptance grep for non-essential-comment /
duplicated-code / unused-dependency / parse-error is now clean for
non-test source; adding an eslint smell touches only config + init.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Nq6xHU6JtSNpYWhMYjXB15
@devill
devill force-pushed the issue-24-smell-agnostic branch from 067a3ed to bff09dc Compare June 17, 2026 15:26
@devill
devill marked this pull request as ready for review June 17, 2026 15:27
@devill
devill merged commit 3729f1e into main Jun 17, 2026
2 checks passed
@devill
devill deleted the issue-24-smell-agnostic branch June 19, 2026 12:21
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.

Mapper, runner, and sensor layer should be smell/sensor-agnostic — concrete smell knowledge belongs only in config + language initializers

2 participants