refactor: simplify internals across the workspace - #1590
Open
aidenybai wants to merge 8 commits into
Open
Conversation
commit: |
Contributor
|
React Doctor found no new issues. 🎉 Reviewed by React Doctor for commit |
Contributor
Interactive terminal E2ERecorded from the built CLI at |
aidenybai
marked this pull request as ready for review
August 6, 2026 08:19
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 e20ce0a. 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, cast-heavy boundaries, pass-through wrappers, 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.
What changed
path.relative, including the sibling-prefix regression caseInspectUiLayersand package-local atomic writers where combining them would break public or package boundariesThe complete PR now changes 179 files with 5,275 insertions and 4,738 deletions. The final architecture pass was informed by React Grab's explicit state machines and snapshot-before-callback lifecycle handling, OpenCode's narrow runtime boundaries and lazy command loading, and OpenTUI's scoped ownership and pure outcome construction.
Fallow and deslop were used as evidence rather than mechanical deletion lists. The final Fallow pass reduced newly attributed duplicate groups from 9 to 3 and the maximum attributed cyclomatic complexity from 135 to 111. Its remaining new-only failures are known analysis limitations: an 89% file rename is counted as newly introduced complexity, the published CLI deliberately bundles
effect,vite-plusis centrally managed workspace tooling,InspectUiLayersis a public compatibility export, and the two atomic writers sit across a private package boundary. The latest whole-repo deslop run exited successfully after analyzing 6,997 files and 9,268 exports; its large unused-file list is dominated by deliberate fuzz corpora and dead-code fixtures.Test plan
nr test— 15/15 tasks; React Doctor 2,453 passed / 27 skippednr test:deslop— deslop-js 521 passed; deslop-cli 17 passednr lint— passes; remaining warnings are intentional fuzz-corpus inputsnr typecheck— 16/16 tasks across the workspacenr format:check— 6,211 filesnr build— all workspace build tasks passnr smoke:json-report— schema v3 complete reportnr smoke:packed-cli-install— version 0.9.5, 180 diagnostics, zero forbidden packagesnpx --yes fallow@latest audit --base origin/main— completed and manually triaged as described abovenpx --yes deslop-cli@latest analyze .— completed successfully across the full workspace