Skip to content

feat: v4.5.0 - pivot to ESLint config translation#1

Merged
moonrunnerkc merged 6 commits into
mainfrom
feat/lint-config
May 9, 2026
Merged

feat: v4.5.0 - pivot to ESLint config translation#1
moonrunnerkc merged 6 commits into
mainfrom
feat/lint-config

Conversation

@moonrunnerkc
Copy link
Copy Markdown
Owner

Summary

  • Pivot RuleProbe from "verify adherence" to "translate instruction files into ESLint configs." Three new commands: lint-config, drift, extract.
  • Remove compare, tasks, task, and run commands and all runner/agent-invocation code.
  • Audit parser matchers down to 34 ESLint-mappable matchers (from ~103). Remove 67 unmappable matchers and 7 empty categories.
  • Rewrite README around translate/drift/extract. Add CHANGELOG v4.5.0 entry.
  • Bump package.json to 4.5.0.

Breaking changes

  • compare, tasks, task, run commands removed
  • Runner module (buildAgentConfig, invokeAgent, watchForCompletion, countCodeFiles) removed from public API
  • formatComparisonMarkdown removed from reporter
  • RuleCategory narrowed: removed test-requirement, dependency, preference, file-structure, tooling, testing, workflow
  • VerifierType narrowed: removed treesitter, preference, tooling, config-file, git-history
  • verify command deprecated (still works)

Test plan

  • Full test suite green (91 files, 1290 tests)
  • npm run build passes
  • ruleprobe lint-config CLAUDE.md produces valid ESLint config
  • ruleprobe drift CLAUDE.md <eslint-config> detects drift
  • ruleprobe extract <eslint-config> produces markdown rules section
  • npm pack --dry-run tarball contains expected files, no dev artifacts

🤖 Generated with Claude Code

moonrunnerkc and others added 6 commits May 7, 2026 21:38
New CLI command `ruleprobe lint-config <input.md>` that parses an
instruction file and emits a working ESLint config (flat config by
default, --format=legacy for .eslintrc style).

Adds:
- src/mapper/: maps RuleProbe RuleSet to EslintConfig structure
- src/mapper/mappings/: 13 mapping files covering all mappable rule types
- src/emitter/eslint.ts: serializes EslintConfig to runnable config
- src/cli/lint-config.ts: wired into commander setup

Mappable rules (with ESLint equivalents):
- no-any -> @typescript-eslint/no-explicit-any
- named-exports -> import/no-default-export
- kebab-case-files -> unicorn/filename-case
- max-lines -> max-lines
- max-line-length -> max-len
- no-console -> no-console
- jsdoc-required -> jsdoc/require-jsdoc
- pascalcase-types + camelcase-vars -> @typescript-eslint/naming-convention
- no-var, prefer-const, no-empty-catch, no-enum, no-type-assertions,
  no-non-null-assertions, no-nested-ternary, no-magic-numbers,
  max-lines-per-function, max-params, no-throw-literal,
  no-else-after-return, consistent-semicolons, quote-style,
  no-wildcard-exports, no-namespace-imports, no-ts-directives,
  no-implicit-any, no-unused-vars, no-todo-comments

Unmappable rules emit as commented sections with original instruction
text and a one-line reason (e.g. strict-mode -> tsconfig, not ESLint).

Tests: 42 new (34 mapper unit, 8 emitter, 5 e2e, 5 CLI integration).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Add src/action/ module with TypeScript action entry point:
- detect-changes: skip drift when only unrelated files changed
- comment: format drift results as PR comments with dedup marker
- regenerate: open follow-up PRs with regenerated config
- runner: orchestrate drift/verify modes with injectable deps
- main: parse env vars and delegate to runner

Tests: 65 new tests across detect-changes (31), comment (12),
regenerate (9), and runner (13) with mock GitHub payloads.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
- action.yml: default mode is now drift, not verify. New inputs:
  eslint-file, regenerate-on-drift, comment-on-pr, fail-on-drift,
  mode. Verify mode preserved under mode: verify with legacy inputs.
  Drift step runs via node dist/action/main.js; verify step still
  uses action-scripts/run-verify.sh.
- README: drift-first action example, document new inputs, move
  verify mode under "legacy" subsection, add monorepo limitation.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Pivot RuleProbe from "verify adherence" to "translate instruction
files into ESLint configs." Three new commands: lint-config, drift,
extract. Remove compare, tasks, task, and run commands. Audit parser
matchers down to 34 ESLint-mappable matchers (from ~103). Remove
67 unmappable matchers and 7 empty categories.

BREAKING: compare, tasks, task, and run commands removed.
BREAKING: runner module removed from public API.
BREAKING: formatComparisonMarkdown removed from reporter.
BREAKING: RuleCategory narrowed to 7 categories + agent-behavior.
BREAKING: VerifierType narrowed to ast, regex, filesystem.
BREAKING: verify command deprecated (still works, primary focus shifted).

- Remove src/commands/compare.ts, tasks.ts, run.ts
- Remove src/runner/agent-configs.ts, agent-invoker.ts, watch-mode.ts,
  task-templates.ts, task-templates/*.md
- Remove 6 matcher files: preference, file-structure, tooling, testing,
  config-file, git-history
- Remove individual unmappable matchers from remaining files
- Add src/commands/drift.ts, extract.ts (from prior commits)
- Add src/drift/, src/extractor/, src/mappings/ (from prior commits)
- Rewrite README around translate/drift/extract pitch
- Add CHANGELOG v4.5.0 entry
- Bump package.json to 4.5.0
- Update .npmignore and .gitignore for dev artifacts
- Update all test files for removed matchers and commands
- Clean stale dist files

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
P0: Generated ESLint configs are invalid
- Flat config: rule entries use object property syntax with quoted
  severity strings; plugin keys with special chars are quoted;
  plugins registered in plugins object
- Legacy config: output is valid JSON via JSON.stringify(); unmappable
  rules appear as comment block after JSON
- Added tests that parse generated configs and validate syntax

P0: Unsupported parser rules become false passes
- All CATEGORY_MAP entries set to null; unmatched categories go to
  unparseable instead of creating generic rules
- Verifiers return {passed: false, skipped: true} for unsupported
  pattern types instead of silently passing
- Added skipped field to RuleResult type

P0: Drift and extract async config parsing
- parseEslintConfigAsync() supports .js, .mjs, .cjs, .ts files
- drift.ts and extract.ts now use async parser
- Synchronous parser throws for JS/TS files with actionable message
- Added resolveSafePath() to lint-config, drift, and extract commands

P0: GitHub Action drift mode broken
- Added RULEPROBE_BIN env var for resolved CLI path
- Made findEslintFileInWorkspace() async with proper await
- Both drift and verify steps in action.yml set RULEPROBE_BIN

P1: ESLint rule mapping accuracy
- no-wildcard-exports: import/no-namespace -> import/no-anonymous-default-export
- no-namespace-imports: @typescript-eslint/consistent-type-imports -> import/no-namespace
- no-unused-exports: no-unused-vars -> import/no-unused-modules
- no-implicit-any: @typescript-eslint/no-implicit-any -> @typescript-eslint/no-explicit-any
- no-deep-relative-imports: now includes maxDepth in options

P1: Package output contains stale build artifacts
- Added prebuild script (rm -rf dist) to clean before every build
- Added files allowlist to package.json

P1: README and reference docs stale
- Updated README format descriptions and verify format list
- Removed removed commands (compare, tasks, task, run) from cli-reference.md
- Added lint-config, drift, extract command docs
- Updated matchers.md to reflect 34 mappable matchers across 7 categories

P2: Path boundary and config validation
- resolveSafePath() applied to lint-config, drift, and extract
- Config validation now rejects unknown categories and verifiers
- verify command accepts all valid report formats (summary, detailed, ci added)

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
The self-check workflow defaulted to drift mode, which requires an
ESLint config file that doesn't exist in this repo. Switch to verify
mode which only needs the instruction file and source directory.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@moonrunnerkc moonrunnerkc merged commit 0206b2d into main May 9, 2026
1 check failed
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