refactor: simplify internals across the workspace - #1590
Merged
Conversation
commit: |
Contributor
|
React Doctor found no new issues. 🎉 Reviewed by React Doctor for commit |
Contributor
Interactive terminal E2ETerminal Control verified the built CLI at
|
aidenybai
marked this pull request as ready for review
August 6, 2026 08:19
…-finalization # Conflicts: # packages/oxlint-plugin-react-doctor/src/plugin/rules/state-and-effects/utils/is-controlled-prop-mirror.ts
Contributor
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 5ab6307. Configure here.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Why
The runtime migration left correctness-sensitive work concentrated in oversized coordinators for scan planning, staged snapshots, baseline filtering, cache persistence, project detection, module linking, telemetry, and rendering. The workspace also accumulated duplicate graph walkers, repeated AST helpers, pass-through wrappers, speculative service layers, retired rules, and internal exports with no consumers.
This refactor makes those responsibilities explicit and independently testable while preserving the CLI contract, JSON schema, package APIs, diagnostics, and release behavior. The final audit also found a real overlap race: a synchronously starting dead-code fiber could invoke cache callbacks before their state variables were initialized.
What changed
path.relative, including sibling-prefix regression coverageInspectUiLayersand package-local atomic writersRelative to the current
main, the complete PR changes 228 files with 7,036 insertions and 6,342 deletions. The architecture pass was informed by React Grab state-machine and lifecycle patterns, OpenCode narrow runtime boundaries and lazy loading, and OpenTUI scoped ownership and pure outcome construction.Fallow and deslop were used as evidence rather than mechanical deletion lists. The final changed-file Fallow duplicate pass reports zero groups. Remaining dead-code candidates were manually checked against package entry points, generated worker entry points, Effect layers, fixtures, and public compatibility surfaces before deletion. Truffler was run before and after the new shared utilities and found no competing helpers.
Test plan
nr test- all 15 package tasks; core 1,860 tests, rule plugin 26,215 tests, CLI 2,448 testsnr lint- passes; remaining warnings are intentional fuzz-corpus inputsnr typecheck- 16/16 tasksnr format:check- 6,223 filesnr build --output-logs=errors-only- 9/9 tasksnr check:published-deps- all five published packages validnr smoke:json-report- schema v3 complete reportnr smoke:packed-cli-install- version 0.9.6, 180 diagnostics, zero forbidden packagesnode packages/react-doctor/bin/react-doctor.js --scope changed --base 1840313922918429f6bdde14b2fc878f98ec7362 --blocking warning --no-score --verbose- no issuesnlx fallow@latest dupes --changed-since HEAD --skip-local --format compact --quiet --top 100- zero duplicate groupsnlx deslop-cli@latest .- completed across the full workspace and manually triagedNote
Medium Risk
Touches core scan orchestration (dead-code/lint overlap, editor lifecycle) and networked score I/O, but behavior is largely preserved with added tests and fail-open score handling; Effect beta bump warrants regression on CI and published packages.
Overview
Bumps Effect to
4.0.0-beta.102across the workspace and routes hosted score requests through a newrequestScorehelper on Effect’s HTTP client (gzip body, schema decode, timeouts, fail-open warnings) instead of ad-hocfetchincalculate-score.Scan orchestration moves dead-code cache telemetry variables ahead of the lint/dead-code overlap path so synchronous cache callbacks cannot run before initialization; adds regression coverage for that overlap case. Editor scans resolve config and run
runInspectinside a single traced Effect program rather than mixingloadConfigWithSourcewith imperativerunPromiseExit.Project discovery splits the old
detectorsbarrel into focused modules (framework, Next static export, pre-ES2023 target, React Compiler) and trimsreact-compiler-config-evaluatorwhile keeping export detection behavior. Shared utilities consolidate import module-source lookup, system concurrency facts for lint/dead-code worker caps, and atomic file writes (JSON cache persistence uses the same primitive).Package boundaries:
InspectInput/InspectOutput, oxlint runner options, and Git service shapes move into dedicatedtypes/*modules; several formerly public helpers are narrowed or deduplicated. CI runs Node 20 tests with--concurrency=1and replaces VHS/Go terminal recordings with in-repo Terminal Control E2E (scripts/terminal-e2e.sh) and MP4/PNG artifacts.Reviewed by Cursor Bugbot for commit 7ab01e4. Bugbot is set up for automated code reviews on this repo. Configure here.