Commit Graph

229 Commits

Author SHA1 Message Date
Skosh a163de9afa fix(core): recover audit files after interrupted scans (#1690)
Co-authored-by: Aiden Bai <aiden@million.dev>
2026-08-27 17:21:09 -07:00
Aiden Bai e183c35190 test: stabilize CI resource-sensitive guards 2026-08-22 05:03:20 +00:00
Skosh 77aec24f42 fix: extract entry points from implicit sub-projects outside workspace patterns (#1666)
* fix: extract entry points from implicit sub-projects outside workspace patterns

When the root package.json declares workspaces, sub-projects outside the
declared workspace globs were discovered but their entry points (main, bin,
exports) were skipped. This caused false positives in unused-file detection.

The fix removes the isDeclaredWorkspace predicate from entry extraction -
any package with a valid package.json should have its entry points extracted
regardless of workspace pattern matching.

Fixes #1665

Co-authored-by: Skosh <skoshx@users.noreply.github.com>

* chore: add changeset for issue #1665 fix

Co-authored-by: Skosh <skoshx@users.noreply.github.com>

* test: consolidate implicit workspace entry regression

* docs(changeset): clarify implicit entry fix

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: Skosh <skoshx@users.noreply.github.com>
Co-authored-by: Aiden Bai <aiden.bai05@gmail.com>
2026-08-21 18:55:41 -07:00
Aiden Bai 2b0f06ec70 perf: profile and optimize rule execution (#1663) 2026-08-20 22:05:20 -07:00
Aiden Bai 6416370836 feat(rules): add UI-library composition and correctness rules behind capability gates (#1654) 2026-08-16 23:29:04 -07:00
Aiden Bai ffc2d14254 chore: upgrade Oxc toolchain (#1651) 2026-08-13 23:31:27 -07:00
Aiden Bai 05ef98926d fix: scan standalone Three.js projects and preserve TUI layout (#1646) 2026-08-13 18:18:45 -07:00
Aiden Bai 8c2f03aea9 feat: make React cleanup first-class (#1624)
* feat: make React cleanup first-class

* refactor: remove editor integrations

* fix: harden React cleanup analysis

* fix: detect default export duplication roots

* fix: unwrap typed duplication roots

* feat: add opt-in project analysis rules

* fix: canonicalize project analysis paths

* fix: harden project analysis precision

* fix: recognize cross-platform project entries

* fix: eliminate project analysis false positives

* fix: harden project analysis reachability

* fix: canonicalize project analysis inputs

* fix: resolve project analysis review findings

* fix: eliminate residual project analysis false positives

* fix: ignore commented registry previews

* fix: eliminate project analysis false positives

* fix: normalize project analysis paths across platforms

* fix: normalize Nextra theme path identity

* test: canonicalize convention fixture paths

* fix: preserve project analysis provenance

* fix: harden project analysis precision

* fix: honor project analysis boundaries

* fix: recognize conditional config plugins

* fix: recognize executable project references

* fix: recognize Stencil tool contracts

* fix: recognize nested tool references

* fix: recognize project setup contracts

* fix: recognize generated and local package consumers

* fix: recognize static template package references

* fix: recognize nested package runtime contracts

* fix: close project analysis parser gaps

* fix: parse project conventions structurally

* refactor: replace structural scanners with parsers

* fix: recognize functional Next CSS config

* fix: close remaining project analysis gaps

* fix: apply tag filters to project analysis

* fix: preserve embedded source positions

* fix: validate static config helper bindings

* fix: bound runtime directory discovery

* fix: close final dependency analysis gaps

* fix: preserve declaration dependency references

* chore: refresh generated rule metadata

* fix: make project analysis portable and bounded

* test: stabilize cleanup scaling guard

* refactor: parse project syntax with oxc

* fix: normalize native filesystem paths

* fix: separate path identity from report paths

* fix: match project files by filesystem identity

* fix: match build glob files by package identity

* fix: use native path keys for file identity

* fix: canonicalize Windows file identities

* fix: canonicalize package ownership paths

* test: inspect Windows path identities

* test: trace Windows package ownership

* fix: keep Windows path identities consistent

* fix: classify test contracts by normalized path

* fix: scope test contracts by canonical package path

* fix: keep test package graphs conservative

* test: keep React complexity advisory
2026-08-13 16:26:08 -07:00
Aiden Bai a2b460d4ae test: stabilize CI timing guards (#1645) 2026-08-13 05:38:07 -07:00
Aiden Bai d908bb1152 fix(rules): close React Bench audit provenance gaps (#1644) 2026-08-13 04:23:03 -07:00
Aiden Bai c50e3bdbe3 fix(core): keep react detection React-specific 2026-08-13 05:02:35 +00:00
Aiden Bai acdcb236b9 fix(core): report supported library projects 2026-08-13 04:36:17 +00:00
Aiden Bai 0f3995b822 fix(cli): recognize supported library projects (#1643)
* fix(cli): recognize supported library projects

* test: fix Docker regression fixture
2026-08-12 20:30:11 -07:00
Aiden Bai 7b7bfe7c1e fix: faithfully port upstream React rules (#1642) 2026-08-12 18:41:05 -07:00
Aiden Bai b49f499840 fix(rules): port no-multi-comp faithfully (#1641)
* fix(rules): port no-multi-comp faithfully

* refactor(rules): preserve component rule ordering
2026-08-12 16:51:20 -07:00
Aiden Bai cd2b22e8c8 fix(core): handle code-less oxlint diagnostics (#1636) 2026-08-12 01:26:43 -07:00
Aiden Bai 51e198db8b perf: reuse source inventories across project scans (#1617)
* perf: reuse source inventories across project scans

* chore: upgrade Oxc toolchain

* fix: fall back for empty shared inventories
2026-08-09 01:42:22 -07:00
Ray Arayilakath c843b01a9e feat(core): add Axiom OTLP transport and an anonymizing tracer (#1608)
* feat(core): add Axiom OTLP transport and an anonymizing tracer

Adds the export path for shipping traces and metrics to Axiom, plus the
anonymization guarantee that has to come with it. Nothing emits yet — the CLI
still routes telemetry to Sentry; this is the engine-side groundwork.

`layerAxiomTraces` and `layerAxiomMetrics` are composed by hand rather than
through `Otlp.layer`, because Axiom routes each signal to a different dataset
via a different header and `Otlp.layer` passes one `headers` object to every
signal. Serialization is protobuf, not JSON: Axiom's `/v1/metrics` accepts
`application/x-protobuf` only. `OtlpSerialization.layerProtobuf` ships with
Effect, so this adds no dependency.

They are separate layers on purpose. Effect tracks delta-temporality state on
the metrics exporter instance, so a second exporter in one process starts with
no previous snapshot and re-reports every counter's full value — doubling every
metric. `telemetry-payload.test.ts` pins that behavior so a future refactor that
merges them fails loudly instead of silently doubling data.

OTLP has no `beforeSend` hook, so Sentry's central scrubber has no equivalent.
`makeScrubbingTracer` wraps the tracer and runs every span name, attribute, and
event payload through `anonymizeText` on the way to the exporter, and is applied
inside `layerAxiomTraces` so an attribute added later cannot bypass it.
`anonymize-text.ts` moves to core (both its scrubbers already lived there) and
`run-inspect.ts` now scrubs `inspect.directory` at the source rather than relying
on the backstop.

`TELEMETRY_SHUTDOWN_TIMEOUT_MS` is 1s, tighter than Sentry's 2s error flush: the
metrics exporter passes `maxBatchSize: "disabled"` internally, which skips
Effect's empty-buffer short-circuit, so it POSTs on every scope close whether or
not anything was recorded. On a firewalled machine that request cannot fail fast,
and unlike the Sentry flush it would run on every scan rather than only on crashes.

Verified against a local collector: correct per-signal datasets and protobuf
content type, and no home directory, username, or secret reaches the wire.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* fix(core): close three review findings in the Axiom transport

Scrub the failure a span ended with. The OTLP tracer runs `Cause.prettyErrors`
over the exit and exports each result as `exception.type` / `exception.message` /
`exception.stacktrace`. None of those go through `span.attribute`, so they
bypassed the scrubbing tracer entirely — and stack traces are full of absolute
paths, meaning any failing scan shipped the user's home directory. This was the
one route into the payload the backstop didn't cover. Interrupt-only causes are
left alone; the exporter emits a fixed label for them and never touches the
error text.

Honor `exportIntervalMs` for traces. It was threaded through to the metrics
exporter but not the tracer, so a long-lived process — the language server —
would hold spans for the full ten-minute default no matter what interval it
asked for.

Trim trailing slashes without a regex. `/\/+$/` backtracks quadratically on a
domain made mostly of slashes, which CodeQL flags as a polynomial-regex denial
of service because the value comes from the caller.

Also corrects a doc comment that still described metrics as being built at exit,
which stopped being true when the CLI moved to a single shared scope.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-08 19:14:46 -05:00
Aiden Bai f27fd5d136 fix(rules): close exhaustive React Bench audit gaps (#1605)
* fix(rules): close exhaustive React Bench audit gaps

* fix(core): fingerprint effect helper imports

* test(fuzz): preserve audit corpus bytes
2026-08-08 04:49:52 -07:00
Aiden Bai 13138a4af5 refactor: simplify internals across the workspace (#1590) 2026-08-08 00:20:14 -07:00
Aiden Bai a4d2c5c8bf fix: recognize browser media lifecycles (#1599) 2026-08-06 23:51:11 -07:00
Aiden Bai ac4e51f685 fix(core): detect React Compiler through Rolldown Babel (#1592) 2026-08-06 03:21:42 -07:00
Aiden Bai 4b03b15cbe fix(core): honor standard Knip config files (#1584) 2026-08-05 03:12:13 -07:00
Aiden Bai 25dbf6d925 Fix parity regressions in effect ownership and parent sync (#1573) 2026-08-04 04:17:07 -07:00
Aiden Bai 212b8b4113 fix: harden CLI against Sentry crash clusters (#1572) 2026-08-04 03:37:33 -07:00
cursor[bot] c825c59550 Narrow AI training environment detection (#948)
* fix: narrow AI training environment detection

* fix: remove ambiguous AI training signals

---------

Co-authored-by: Aiden Bai <aiden@million.dev>
2026-08-03 17:56:46 -07:00
cursor[bot] 45e818a34b fix: clean up config and telemetry drift (#1023)
Co-authored-by: Aiden Bai <aiden@million.dev>
2026-08-03 17:37:34 -07:00
cursor[bot] 3acb41bad6 fix: align ESLint rule metadata (#987)
Co-authored-by: Aiden Bai <aiden@million.dev>
2026-08-03 17:37:09 -07:00
cursor[bot] 45afa01cc2 refactor: remove stale scan plumbing (#1565)
Co-authored-by: Aiden Bai <aiden@million.dev>
2026-08-03 14:21:14 -07:00
Aiden Bai 48ec9a8020 fix(cli): keep large workspace scans responsive (#1549)
* fix: keep large workspace scans responsive

* fix: harden large workspace scans

* test: normalize workspace path on Windows

* fix: resolve workspace exclusions after root redirects

* fix: honor workspace scan boundaries

* fix: keep bounded workspace scans responsive

* fix: preserve dead-code reachability

* refactor: tighten workspace scan controls

* fix(cli): bound staged workspace scans

* fix: eliminate pathological large-file scans

* fix: handle incomplete and conflicted scans

* test: configure conflict merge identity

* perf: cache repeated module resolution probes

* fix(cli): show all incomplete scan warnings

* fix(core): preserve cooperative scan semantics

* perf(cli): streamline workspace scan startup

* perf(cli): harden large workspace scans

* fix(cli): keep scan progress inline

* fix(scan): correct workspace result completeness

* fix(cli): simplify live scan status

* fix(core): make scan deadlines opt-in

* fix(scan): preserve complete workspace results

* perf(scan): accelerate very large workspaces

* fix(scan): yield CPU to foreground work

* perf(scan): avoid unnecessary project indexing

* fix(cli): keep final report inline

* test(cli): stabilize terminal recording setup

* fix(core): honor scan deadline during index probe

* fix(core): skip lint after incomplete index probe

* fix(core): preserve scoped lint ownership

* fix(cli): restore project picker on cancellation
2026-08-03 04:59:45 -07:00
Aiden Bai 44922d6782 FPFNFIX82 Fix form and fragment diagnostics (#1561)
* fix(rules): correct form and fragment diagnostics

* fix(rules): handle fragment review edge cases

* fix: handle document-top fragment links

* fix(a11y): parse ids from html tags only

* fix(a11y): resolve static fragment aliases

* fix(a11y): retain known fragment targets

* fix(a11y): tokenize html id attributes

* fix: preserve known fragment IDs in mixed spreads

* fix: preserve known fragment ID defaults
2026-08-03 03:03:00 -07:00
Aiden Bai 19f2148e00 FPFNFIX82 Fix CSS-reserved image dimensions (#1550)
* fix(rule): recognize CSS-reserved image layout

* fix(rule): scope static CSS image evidence

* fix(no-img-without-dimensions): compose CSS with classes

* fix(no-img-without-dimensions): parse layered CSS

* fix(no-img-without-dimensions): ignore interaction-only CSS

* fix(no-img-without-dimensions): expand selector functions

* fix(no-img-without-dimensions): parse CSS with Lightning CSS

* fix(no-img-without-dimensions): model flex axes

* test(evals): stabilize manifest verification timeout

* test(evals): reset manifest operation deadlines

* fix(no-img-without-dimensions): honor nested CSS cascade

* fix(no-img-without-dimensions): compose Tailwind with CSS

* fix(no-img-without-dimensions): resolve same-layer cascade
2026-08-02 21:48:52 -07:00
Aiden Bai 6b64dfaf9e RDFPFN792026: detect state updater side effects (#1525)
* RDFPFN792026: detect state updater side effects

* fix: accept nullish local collection initialization

* fix: preserve updater-local mutable builders

* fix: detect setter callback prop variants

* fix(rule): preserve updater-local mutable receivers

* fix(rule): tighten updater assignment provenance

* fix(rule): detect external platform append mutations

* fix(rule): close state updater parity gaps

* fix(rule): preserve local updater values

* fix(rule): narrow lazy initializer functions

* fix(rule): prove updater property factories

* fix(rule): prove immutable updater dates

* fix(rule): tighten immutable date provenance

* fix(rule): prove immutable date receiver chains

* fix(rule): replay updater property overwrites

* fix(rule): honor dayjs wrapper depth

* fix(cache): fingerprint dayjs mutation graph

* fix: track deep Day.js configuration dependencies

* fix: preserve module service side effects

* fix(cache): bound dependency graph traversal

* fix(rule): ignore unreachable prior state setters

* fix(rule): keep nested component helpers local

* fix(rule): keep unresolved nested helpers conservative

* fix(rule): ignore dead ternary updater branches

* fix(rule): fail closed at dayjs config frontier
2026-07-31 08:18:35 -07:00
Aiden Bai a81b3d6573 fix(js-hoist-intl): respect dynamic utility inputs (#1507) 2026-07-31 06:45:41 -07:00
Aiden Bai fb5f881e74 fix(rule): treat custom hook calls as opaque (#1511) 2026-07-30 21:12:23 -07:00
Aiden Bai 2db2a97283 perf: reduce scan startup and workspace contention (#1533) 2026-07-30 19:42:52 -07:00
Aiden Bai 83f3ff8ac7 fix: support Astro project scans (#1519) 2026-07-29 23:09:02 -07:00
Aiden Bai 86add14268 fix: honor project scope in Git hook scans (#1516) 2026-07-29 16:54:20 -07:00
Skosh b1352a2be4 fix(core): resolve file URL diagnostic paths (#1473)
* fix(core): handle invisible Unicode characters in disable comments (#1472)

When TERMINAL_EMULATOR=JetBrains-JediTerm is set (or similar IDE/terminal
configurations), invisible Unicode characters like zero-width spaces
(U+200B, U+200C, U+200D) and zero-width no-break spaces (U+FEFF/BOM) can
appear at the end of lines. These characters are not matched by JavaScript's
\s regex class, causing the $ anchor in react-doctor-disable patterns to
fail despite the characters being invisible in editors and terminal output.

This fix adds explicit matching for common invisible Unicode characters
before the $ anchor in both DISABLE_NEXT_LINE_PATTERN and DISABLE_LINE_PATTERN,
making them resilient to these characters while maintaining the $ precision
that near-miss detection relies on.

The foreign disable patterns (eslint-disable, oxlint-disable) never anchored
to $ and were unaffected, which is why oxlint-disable-next-line worked while
react-doctor-disable-next-line failed in the reproduction case.

Fixes #1472

Co-authored-by: Skosh <skoshx@users.noreply.github.com>

* chore: add changeset for invisible Unicode fix

Co-authored-by: Skosh <skoshx@users.noreply.github.com>

* fix(core): resolve file URL diagnostic paths

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: Skosh <skoshx@users.noreply.github.com>
Co-authored-by: Aiden Bai <aiden.bai05@gmail.com>
2026-07-29 00:09:06 -07:00
Aiden Bai f1a1b16eb5 fix: detect React Compiler through bundled config wrappers (#1470) 2026-07-28 03:12:57 -07:00
Skosh 80e89c5ff5 fix: prevent stack overflow in config analysis with cycle detection (#1461) 2026-07-26 04:39:34 -07:00
Aiden Bai 1aa6b12fd6 fix: detect React Compiler through dependency configs (#1458) 2026-07-25 19:48:27 -07:00
Aiden Bai 7ee59d3125 fix: detect React Compiler through require.resolve (#1450) 2026-07-24 17:19:32 -07:00
Aiden Bai b1b62db71d fix: recognize unplugin auto-import JSX globals (#1445) 2026-07-24 15:55:17 -07:00
Aiden Bai 8534d864e4 feat: scan inline scripts in HTML files (#1443) 2026-07-24 03:52:18 -07:00
Aiden Bai 5d2f66d055 Add React Native diagnostics (#1427) 2026-07-23 13:55:48 -07:00
Skosh 30369b6000 fix: detect React Compiler from compatibility runtime (#1437)
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: Aiden Bai <aiden.bai05@gmail.com>
2026-07-23 02:55:52 -07:00
Aiden Bai db9d300343 Make all design rules opt-in by default (#1434) 2026-07-23 01:55:55 -07:00
Aiden Bai 76263ecc08 Add direct Three.js and WebGL diagnostics (#1424)
* add direct Three.js and WebGL rules

* fix parity-discovered config cycle

* fix Three render construction false positives

* fix(rules): preserve JSX-referenced Three components

* fix(rules): address Three.js review findings

* feat(rules): add Three.js resource cleanup diagnostics
2026-07-22 01:48:13 -07:00
Aiden Bai 3d7ea66c3f perf: speed up React Doctor scans (#1423) 2026-07-21 20:35:22 -07:00