Skip to content

♻️ Clarify domain ownership and simplify workflows - #388

Merged
Robdel12 merged 4 commits into
mainfrom
rd/domain-simplification
Nov 1, 2026
Merged

Robdel12 merged 4 commits into
mainfrom
rd/domain-simplification

Conversation

@Robdel12

@Robdel12 Robdel12 commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

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.

@Robdel12 Robdel12 changed the title ♻️ Simplify domain workflows and colocate tests ♻️ Clarify domain ownership and simplify workflows Oct 31, 2026
@Robdel12
Robdel12 force-pushed the rd/domain-organization branch from 11dd2bd to 3a87b54 Compare November 1, 2026 18:35
Robdel12 added a commit that referenced this pull request Nov 1, 2026
## 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.
Base automatically changed from rd/domain-organization to main November 1, 2026 18:39
Share baseline installation and review mutation handling, fix lifecycle and HTTP error paths exposed by real boundaries, and replace duplicate internal mocks with focused colocated tests and CLI/browser/package workflows.
Move report persistence, baseline writes, and context contracts to their owners. Preserve credential identity during refresh, finalize setup failures, and keep new server data when optimistic review actions fail.
Keep product routes with their domains and collect CLI, client, SDK, HTTP,
and plugin wiring under adapters. Colocate public declarations, preserve
package entrypoints, and share screenshot serialization and SDK types.

Replace route mocks with real HTTP workflows, fix workspace asset serving
and logged-out project responses, and reexecute updates through the public
CLI executable. Enforce the new shared-code boundary in architecture checks.
Preserve per-action logging and reset counts while using one safe deletion path. Exercise built import resolution without output files, including missing targets and shared dependency violations.
@Robdel12
Robdel12 force-pushed the rd/domain-simplification branch from 6bea8fa to 9beca4f Compare November 1, 2026 18:39
@vizzly-testing

vizzly-testing Bot commented Nov 1, 2026

Copy link
Copy Markdown

Vizzly - Visual Test Results

CLI Reporter - Waiting for build

No builds received yet for this pull request.

CLI TUI - Approved

5 comparisons, no changes detected.

View build


rd/domain-simplification · 9beca4fb

@Robdel12
Robdel12 merged commit 004054b into main Nov 1, 2026
38 of 39 checks passed
@Robdel12
Robdel12 deleted the rd/domain-simplification branch November 1, 2026 18:44
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