Skip to content

feat: implement oxlint sensor spec v2 alignment corrections - #42

Merged
taras merged 3 commits into
mainfrom
feat/oxlint-sensor-v2
Mar 18, 2026
Merged

taras merged 3 commits into
mainfrom
feat/oxlint-sensor-v2

Conversation

@taras

@taras taras commented Mar 17, 2026

Copy link
Copy Markdown
Owner

What does this PR do?

Implements the oxlint-sensor-spec-v2 alignment corrections: sensor config, PR-scoped analysis, density calibration, lint plugin, and process enforcement.

Why?

Post-implementation review of the oxlint sensor found 10 alignment gaps (spec §6.1–§6.10) between the spec and implementation that degraded signal quality — missing config references, whole-project scans inflating density, optional diagnostics hiding signals, and insufficient LLM context.

Summary

Config & Environment (§6.1, §6.3)

  • Create .reviews/.oxlintrc.json sensor config with pedantic: "warn" and style: "warn" (14 bloat-relevant rules vs defaults' 108 correctness-only)
  • Add --config .reviews/.oxlintrc.json to all oxlint invocations across 5 files
  • Add prose narration to Doctor.md for local visibility

PR-Scoped Analysis (§6.6, §8.1)

  • Scope oxlint to changed .ts/.tsx files only in PR entry points via git diff --name-only + xargs
  • Expand tsconfig.oxlint.json include paths to cover full monorepo

Policy Corrections (§6.5, §6.7, §7)

  • Add density calibration thresholds (0.020/0.080/0.100) and Rule of Three to ExtraneousCodePolicy.md LLM prompt
  • Change diagnostics from required: false to required: true in BloatPolicy.md, SlopPolicy.md, PrPolicyReport.md; remove defensive guard clauses
  • Add Rule of Three and YAGNI principles to RepoCleanupPolicy.md

Code Fixes (§6.9)

  • Fix density precision to 3 decimal places in parseDiagnostics for narrow-band signal preservation

New Files (§6.4, §6.8, §3.4)

  • lint-plugins/no-scheme-specifiers.ts — Deno lint plugin flagging jsr:/npm: scheme specifiers with auto-fix to bare specifiers
  • .github/pull_request_template.md — scope confirmation and Rule of Three checklists
  • .reviews/.oxlintrc.json — committed sensor config

Spec Integration

  • Added §13 (Oxlint Sensor v2 extension) to specs/code-review-agent-spec.md

Scope confirmation

  • All changed files relate to the stated purpose
  • No drive-by refactors or "while I'm here" cleanups
  • No formatting changes mixed with functional changes

New abstractions (if any)

  • Each new type/interface/class has 3+ consumers or justification
  • No speculative features ("we might need this later")

Verification

  • Lint: 77 files, 0 warnings/errors
  • Typecheck: clean
  • Tests: 78 passed, 0 failed

- Create .reviews/.oxlintrc.json sensor config with pedantic/style
  categories at warn level (14 bloat-relevant rules)
- Add --config .reviews/.oxlintrc.json to all oxlint invocations
  across ReviewPR, AnalyzeRepo, AnalyzeRepoCI, and Doctor probe
- Scope PR oxlint to changed files only via git diff --name-only
  + xargs for meaningful density metrics
- Expand tsconfig.oxlint.json include paths in PR entry points to
  cover full monorepo (core, cli, durable-streams, durable-effects)
- Add density calibration thresholds and Rule of Three to
  ExtraneousCodePolicy LLM prompt
- Change diagnostics from optional to required in BloatPolicy,
  SlopPolicy, PrPolicyReport; remove defensive guard clauses
- Add Rule of Three and YAGNI principles to RepoCleanupPolicy
- Fix density precision to 3 decimal places in parseDiagnostics
- Add prose narration to Doctor.md for local visibility
- Create lint-plugins/no-scheme-specifiers.ts Deno lint plugin
  for jsr:/npm: bare specifier enforcement
- Create .github/pull_request_template.md for process enforcement
- Integrate oxlint sensor extension into code-review-agent spec
@github-actions

github-actions Bot commented Mar 17, 2026 •

Copy link
Copy Markdown

PR #42: feat: implement oxlint sensor spec v2 alignment corrections

25 files, +473 / -75

Scope

🟡 548 lines changed. PRs under 400 receive more thorough review.

🟡 25 files changed. Are all changes related?

🟡 Large PR with no linked issue.

🟡 PR mixes config and source changes.

Structural

✅ No structural bloat detected.

Slop

Static Analysis

✅ Oxlint found no issues.

Correctness

No extraneous code patterns detected.

Taras Mankovski added 2 commits March 17, 2026 20:05
…l-select

Fix Doctor.md JSON parsing failure in CI: prose narration text was
included in the rendered output, causing parseDoctorResult to fall
back to defaults (oxlintInstalled: false). Doctor.md now wraps its
JSON return in a code fence, and all entry points use
<Capture select="code[lang=json]"> to extract just the JSON.

The select prop parses rendered markdown via remark into an mdast
tree, then queries it with unist-util-select using CSS selector
syntax (e.g. code[lang=json], paragraph, heading[depth=1]). Falls
back to full rendered content when no node matches.

Also fix UnusedInDiff false positive on non-TS files by filtering
pr.added to .ts/.tsx files before scanning for type/interface
declarations.

Updates executable-mdx-spec.md §1, §6.5 (Capture rules, select
prop section, pseudocode, test table C29-C31, decisions 94-96)
and code-review-agent-spec.md §13.2 (Doctor description).
Add <Capture select="code[lang=json]"> to the smoke test document's
Binding Capture section. The test captures a JSON array from a code
fence surrounded by prose text, verifies the selector extracts only
the code block value, and confirms the prose is not in the output.

Uses printf to avoid bash quote stripping on the interpolated JSON.
@taras
taras merged commit 40c5986 into main Mar 18, 2026
3 checks passed
@taras
taras deleted the feat/oxlint-sensor-v2 branch March 18, 2026 00:16
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