You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refactor(studio): reorganize source tree by domain layer
harness-studio's src/ had accumulated a flat, inconsistent layout: a
2723-line server.ts route dispatcher, artifact-format files mixed
with plugin registry files, a session-debugger-model.ts that mixed
shared types with server-only logic and a server -> app reverse
dependency, and artifact views split across app/ and app/artifacts/.
- Extract src/contracts/ for types shared by app and server, dropping
the redundant "-model" suffix and merging the duplicate 2-line
artifact re-export.
- Split session-debugger-model.ts into contracts/debugger-session.ts
(types), server/debugger-session-transform.ts (retained-run
conversion), and app/run/{debugger-cursor,sample-debugger-session}.ts
(UI navigation and the recorded-sample fixture), removing the
server -> app dependency.
- Consolidate ArtifactView/ArtifactPreviewHost/MarkdownArtifactView
into app/artifacts/ alongside the other Artifact Surface views.
- Group server/ into artifacts/{registry,adapters}/,
providers/{qoder,walnut}/, experiment/, and workspace/; extract
StudioIntentAnalyzer out of server.ts so the Qoder provider no
longer depends on the route-dispatcher file for one interface.
- Split server.ts's route handlers into per-domain modules
(studio-types, http-utils, acp-runs, workspace/routes, git/routes,
artifacts/routes, experiment/routes, content-routes), leaving
server.ts as a thin dispatcher plus the server factory.
- Group app/ into run/, experiment/, and code/ for each multi-file
feature area; single-view areas stay flat.
- Split src/index.ts into a browser-safe src/client.ts (also
published as the "./client" export) and the Node-only server/CLI
surface.
Verified after every step with tsc --noEmit (diffed against a
captured baseline of pre-existing, unrelated errors from a stale
sibling package build) and vitest run (265/266 passing throughout,
matching the pre-existing baseline exactly).
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
0 commit comments