Repository navigation
♻️ Organize CLI code by domain - #387
Merged
Merged
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Keep feature commands, routes, contracts, and data operations with their domain. Preserve public package and plugin behavior while making ownership and browser boundaries explicit.
Resolve package build imports to their source owners during architecture checks so lint works in a clean checkout without skipping missing targets.
Robdel12
force-pushed
the
rd/domain-organization
branch
from
November 1, 2026 18:35
11dd2bd to
3a87b54
Compare
Vizzly - Visual Test ResultsCLI Reporter - Waiting for buildNo builds received yet for this pull request.
|
Robdel12
added a commit
that referenced
this pull request
Nov 1, 2026
Builds on #387, which is now merged into main. ## Why Domain folders still competed with separate client, SDK, server, service, and error roots. Following ownership through those folders also exposed repeated workflows and tests that replaced the code they meant to verify. Real boundary tests found failures those fakes concealed. ## Approach - Organize source around `domains/`, `adapters/`, `shared/`, and the separately built `reporter/`. Move product HTTP routes to their domains, keep hosting and cross-domain wiring in adapters, and colocate declarations and focused tests. Preserve public package specifiers, exports, and plugin contracts. - Give Reports ownership of state, lightweight/heavy persistence, and snapshots consumed by capture, dashboard, SSE, health, and static rendering. Share baseline writes, screenshot request serialization, report-image deletion, and the SDK class declaration. Split Context validation, serialization, presentation, and orchestration. - Fix SDK initialization, shutdown/workspace handling, and cloud build finalization after setup failure. Preserve test exit status when visual setup/finalization fails, propagate report-write failures, serve images from the configured workspace, and reexecute CLI updates through the published executable. - Refresh only matching saved credentials, preserve HTTP status for preview/screenshot errors, and return an empty project list when logged out. Roll back only failed optimistic review actions, preserving newer server fields, unrelated decisions, and SSE-added captures. - Replace copied implementations and internal mocks with real HTTP, filesystem, image, SDK, CLI, SSE, and packed-package workflows. Remove redundant cases and unused fixtures, share normal/watch discovery, and enforce pure contract dependencies and shared-code boundaries. ## Evidence The full Node suite passes 1,909 tests with six existing skips on both Node 22 and Node 24: 149 fewer cases than the base. All 98 desktop/mobile browser cases pass with two existing skips at the normal limits. Build, architecture, lint, formatting, and published types pass. Test-first regressions reproduced stale rollback losing a new capture, refresh using an unrelated saved session, unfinished builds after setup failure, success after failed report writes, missing workspace images, and a logged-out cloud route returning 500. The package workflow checks all four public entrypoints, errors/output, bundled guidance, daemon capture/assets, and static HTML without source files. Interactive setup/update workflows verify executable paths through a simulated installation. The final six-area simplifier review found no remaining verified behavior regressions. Manual QA used the packed package without source: interactive/quick setup, captures/matches/diffs, offline review, local Context, daemon lifecycle/assets, child exit codes, controlled cloud-command/device-login workflows, SDK lifecycle and CommonJS/ESM imports, and real configured plugins under Node 22 and 24. The architecture check's clean-checkout failure is fixed in merged #387. This branch is rebased onto main with the Dependabot-only policy from #389; the tested source tree is unchanged.
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
Finding one feature currently means moving between commands, API endpoints, services, and utilities. That spreads ownership across technical folders and makes it easy to put the next change in the wrong place.
Approach
Group CLI behavior and tests by domain, with explicit files for commands, local routes, data operations, validation, rules, normalization, and serialization. Give the reporter the same ownership pattern inside its browser build. Keep shared capabilities narrow and preserve published CLI, SDK, and plugin contracts.
Remove the old internal barrels and paths, centralize packaged resource lookup, and document the ownership rules. Lint now checks imports, module cycles, pure-file I/O boundaries, and browser/server separation without adding a runtime framework.
Evidence
All 2,058 Node tests pass with six existing skips; 96 reporter browser tests pass with two existing skips. Build, lint, formatting, and published type checks pass. Reporter CSS and four rendered HTML fixtures are byte-identical to the previous layout.
A packed-package check imports all four public entrypoints without source files, installs the bundled agent skill, captures through a real local daemon, and generates a static report. Source and compiled HTTP asset delivery also pass. An independent simplification review found no remaining move-related behavior issues.
Final review
Architecture checks now resolve compiled imports to their source owners, so lint works in a clean checkout before a build. Direct clean-checkout architecture and lint validation pass. The complete stack also passed the final Node 22/24, desktop/mobile browser, and installed-package manual QA pass described in #388.