--- id: PLN-0043 ticket: studio-debugger-workspace-integration title: Ordered Plan 3 - First-wave DebugWorkspace registration and temporary execution surface status: review created: 2026-04-06 completed: tags: [studio, debugger, workspace, logs, shell] --- ## Objective Register a native `DebugWorkspace` in Studio and provide a first-wave temporary execution surface that consumes shared session state and merged logs. ## Background `DEC-0022` requires a real native workspace, not an external launcher. `DEC-0021` requires `Play` to navigate toward the debugger destination at the start of execution. This plan intentionally keeps the UI crude and execution-focused. ## Scope ### Included - Register a concrete `DebugWorkspace` in the Studio shell. - Consume the shared session/service boundary from `PLN-0042`. - Render simple session state and a simple merged log sink with visible source labels. - Provide a temporary but native in-Studio execution destination. ### Excluded - Polished final debugger UX. - Rich manual connect/disconnect controls. - Profiler behavior. - Standalone debugger bootstrap embedding. ## Execution Steps ### Step 1 - Register the workspace in the shell **What:** Make `WorkspaceId.DEBUG` point to a real workspace implementation. **How:** Add and register a native `DebugWorkspace` that follows Studio workspace lifecycle and event-bus rules. **File(s):** `prometeu-studio/src/main/java/p/studio/window/MainView.java`, `prometeu-studio/src/main/java/p/studio/workspaces/.../DebugWorkspace.java` (new). ### Step 2 - Add first-wave session state presentation **What:** Surface the shared session states in the workspace. **How:** Render a simple status area or equivalent control showing at least `idle`, `preparing`, `prepare_failed`, `connecting`, `running`, `runtime_failed`, and `stopped`. **File(s):** `DebugWorkspace` controls and supporting view models/bindings. ### Step 3 - Add the temporary merged log sink **What:** Show merged execution logs in a simple native Studio surface. **How:** Use a list/console style control with visible source labels and lightweight severity treatment. Consume the shared session log stream from `PLN-0042`. **File(s):** `DebugWorkspace` controls, log pane/control package. ### Step 4 - Preserve native Studio shape **What:** Keep lifecycle, theming, i18n, and shell-navigation compliance. **How:** Avoid importing the standalone debugger host/bootstrap. Use only Studio-native workspace composition. **File(s):** workspace implementation, i18n keys, theme/style files as needed. ## Test Requirements ### Unit Tests - Verify the workspace can consume session state updates and reflect them. - Verify merged log entries render with visible source identity. ### Integration Tests - Mount the workspace in a shell test and confirm it registers without throwing. - Feed synthetic session/log events and confirm the workspace updates without owning the underlying state. ### Manual Verification - Open the `Debug` workspace from the Studio shell. - Confirm session states and merged logs are visible in a simple but usable surface. ## Acceptance Criteria - [ ] `WorkspaceId.DEBUG` resolves to a real native workspace. - [ ] The workspace shows shared execution state. - [ ] The workspace shows merged logs with visible source identity. - [ ] The implementation stays within native Studio workspace boundaries. ## Dependencies - Accepted `DEC-0022`. - `PLN-0042` shared execution session and log contracts. ## Risks - The first-wave UI may accidentally hardcode temporary choices that later feel permanent. - Workspace ownership may drift into session ownership if bindings are not kept one-way.