complete Studio core and JavaFX boundary migration
Intrepid/Prometeu/Studio/pipeline/pr-master Build started...
JaCoCo Coverage #### Project Overview No changes detected, that affect the code coverage. * Line Coverage: 64.01% (20482/31999) * Branch Coverage: 54.22% (8240/15196) * Lines of Code: 31999 * Cyclomatic Complexity: 13164 #### Quality Gates Summary Output truncated.
Test / Build skipped: 15, passed: 715
Intrepid/Prometeu/Studio/pipeline/head This commit looks good

This commit is contained in:
2026-09-25 11:28:18 +01:00
parent 10f1b3f87c
commit a0a5050d5e
461 changed files with 9319 additions and 7205 deletions
@@ -57,11 +57,13 @@ The shell-level workspace host exists to mount independently authored workspaces
Baseline workspace architecture rules are:
- each workspace should have a composition root that mounts the workspace into the shell;
- the shell and workspace composition roots must receive neutral Studio API services through explicit constructor or factory injection;
- a workspace composition root should coordinate workspace services, state orchestration, and structural sync, but it should not own every local render path directly;
- project-session services that must survive workspace focus changes should be owned above individual workspace focus lifecycles and then consumed by workspace composition roots;
- event-observing workspace controls must be lifecycle-managed;
- workspace-local updates should flow through the Studio event system rather than ad hoc imperative redraw chains;
- future workspaces should consume shared Studio workspace framework primitives where those primitives already cover the needed behavior.
- shell and workspace code must not resolve application services through a static container or Spring application-context lookup.
The shell must not encourage a workspace model where every interaction falls back to whole-workspace refresh.
@@ -73,13 +73,14 @@ Propagation rules:
- propagation is workspace to global;
- global-to-workspace rebroadcast is not baseline behavior.
The global Studio bus is backed by a typed event bus reference owned by the Studio application container.
The global Studio bus is a JavaFX-adapter facility created by the application composition root and injected into the UI factory.
Container rules:
Composition rules:
- the Studio `Container` owns the global typed event bus reference used by `StudioEventBus`;
- host-integrated services that need shared Studio operational visibility should receive that container-owned typed event bus reference during bootstrap instead of allocating disconnected local buses;
- the `Container` must be initialized during Studio boot before packer-backed integration services, workspaces, or adapters begin use.
- `prometeu-app` owns construction and lifecycle of the shared UI bus;
- UI composition roots receive the bus explicitly and workspace buses derive from that injected instance;
- host integrations publish neutral application facts through their owning API boundary and may be adapted to UI events at the JavaFX edge;
- `p.studio.Container`, Spring context lookup, or another static service locator must not participate in event access.
This topology exists so callers do not need to duplicate publication decisions manually.
@@ -98,6 +99,8 @@ Illustrative baseline categories include:
- diagnostics update events;
- asset selection events.
Selection, navigation, attach/detach, edit scope, and presentation refresh are UI-local event categories. Application facts such as execution state, build results, runtime state, and asset operation results belong to neutral API contracts owned by their functional module and must not be defined only as JavaFX events.
For project bootstrap and splash/loading integration, the Studio event catalog should reserve typed events for:
- project loading started;
@@ -1,169 +1,66 @@
# Studio Components Module Specification
# Studio JavaFX Components Boundary Specification
Status: Draft
Scope: `prometeu-studio-components` role, admission policy, and JavaFX wrapping boundary
Purpose: Define the authoritative visual control layer for the Studio.
## Status
Active
## Applies To
- `prometeu-studio-ui-javafx`
- shared Studio controls and workspace-framework primitives
- JavaFX controls actively used by the Studio
## Purpose
Define the visual component boundary inside the JavaFX adapter without creating a second application or domain layer.
## Authority and Precedence
This specification consolidates the accepted Studio components module decision into normative form.
## Normative Inputs
- `prometeu-studio-components`
- Studio shell and workspace UI needs
- JavaFX controls actively used by the Studio
This specification is subordinate to [`9. Studio Core and Adapter Architecture Specification.md`](9.%20Studio%20Core%20and%20Adapter%20Architecture%20Specification.md).
## Core Rules
1. `prometeu-studio-components` is the official visual control module for Studio UI.
2. Studio UI should normally consume visual controls from `prometeu-studio-components`, not directly from raw JavaFX.
3. A control enters the module when it is needed by the current Studio UI wave.
4. Controls in the module wrap and shape the JavaFX controls the Studio actively uses, but do not clone the full JavaFX API.
5. Every admitted control must preserve theme and i18n compatibility.
6. Reusable event-driven workspace controls should be admitted when they are part of the active Studio workspace framework.
1. Reusable Studio visual controls belong to `prometeu-studio-ui-javafx`.
2. The JavaFX adapter may organize reusable controls by shell, forms, banks, lifecycle, navigation, feedback, and inspection roles.
3. A control is admitted when it has an immediate Studio consumer; speculative mirroring of JavaFX is forbidden.
4. Shared controls must preserve theme, localization, and explicit visual-state behavior.
5. Controls that observe UI events must expose predictable attach/detach or subscribe/unsubscribe lifecycle behavior.
6. Visual controls must depend on neutral Studio API contracts, not core or provider implementations.
7. Domain rules, application orchestration, filesystem workflows, compiler/Packer/LSP/runtime calls, and Spring composition do not belong in the visual component layer.
## Module Role
## JavaFX Wrapping Boundary
`prometeu-studio-components` is:
The Studio may use raw JavaFX for trivial local composition. A reusable control should expose the Studio-facing API actually needed instead of cloning the complete upstream JavaFX surface.
- the authoritative Studio control layer;
- the home of the Studio visual dialect;
- the place where Studio-facing controls are shaped for Studio use;
- the preferred home for reusable lifecycle-aware workspace controls when those controls are part of the visible Studio UI dialect.
Shared controls may include:
`prometeu-studio-components` is not:
- shell and action controls;
- workspace rails and hosts;
- form sections and action bars;
- list, tree, inspector, and dual-list surfaces;
- activity, progress, badges, headers, and feedback controls;
- lifecycle-managed visual primitives.
- a speculative generic framework;
- a full reimplementation of JavaFX;
- a dumping ground for unrelated non-visual infrastructure.
## Construction and Lifecycle
## Admission Policy
Controls, rows, dialogs, and views MUST NOT be Spring singletons by default. A Spring-managed JavaFX composition factory may create them with explicit constructor dependencies.
A control is admissible when it is needed by the current Studio UI work.
Controls that attach event subscriptions MUST release them when detached. UI-local events may coordinate selection, navigation, editing scope, attach/detach, and presentation refresh. Request/response application behavior MUST use injected Studio API services directly.
Rules:
## State Boundary
- immediate current Studio use is sufficient justification;
- a second use is not required when the control is clearly part of the shell or the current workspace surface;
- no control should be added without an immediate Studio consumer.
- a control needed first by one workspace may still be admitted when it is clearly intended as a reusable Studio workspace primitive.
Presentation-only view models, form drafts, selection state, and formatting helpers may live beside JavaFX controls when they do not determine domain outcomes.
## Studio Usage Rule
The baseline Studio UI should not rely on raw JavaFX controls as its normal visual surface.
Rules:
- a visual control used by Studio should normally come from `prometeu-studio-components`;
- extremely trivial local composition may stay in `prometeu-studio`;
- local exceptions must remain exceptional rather than becoming the default path.
## Wrapping Boundary
Controls in `prometeu-studio-components` must wrap the JavaFX controls the Studio actively uses.
Rules:
- the Studio-layer control should expose the Studio-facing API actually needed;
- exhaustive mirroring of upstream JavaFX APIs is not required;
- the goal is consistency and clarity, not a perfect one-to-one mirror of every JavaFX type.
## Control Lifecycle Hooks
Studio controls may need to observe event buses or other external state.
Rules:
- the control layer must provide explicit subscribe and unsubscribe lifecycle methods that can be overridden when needed;
- the control layer should also provide `onAttached()` and `onDetached()` lifecycle hooks;
- `onAttached()` should call `subscribe()`;
- `onDetached()` should call `unsubscribe()`;
- controls that attach subscriptions must also define how those subscriptions are released;
- event-driven controls must not hide subscription lifecycle completely inside ad hoc local wiring.
These hooks exist so event-driven controls remain predictable and safe to embed in shell and workspace UI.
## Reusable Workspace Primitives
Some reusable controls are not shell-only and are not domain-specific either.
They may still belong in `prometeu-studio-components` when they are part of the visible Studio workspace framework.
Illustrative admissible examples include:
- projection hosts for list/tree/detail surfaces;
- lifecycle-managed row or item controls;
- reusable section or inspector surfaces;
- visible controls that encode local-patch versus structural-sync interaction patterns.
What does not belong here:
- workspace-specific orchestration logic;
- domain-specific service calls;
- hidden coordination code with no visible control responsibility.
## Typical Control Scope
Typical controls that belong in the module include:
- shell controls;
- action controls and buttons;
- tab systems;
- tree and list controls;
- inspector and panel surfaces;
- activity and feedback surfaces;
- badges, headers, and related Studio primitives.
What stays outside the module:
- workspace-specific composition logic;
- non-visual domain behavior;
- speculative controls with no immediate Studio consumer.
## Theme and i18n
Every admitted control must support:
- CSS-based theming;
- safe locale-aware text behavior when text is exposed;
- no hardcoded user-facing text;
- explicit visual states where state matters.
## Organization Guidance
The module should be organized by Studio role rather than vague technical buckets.
Illustrative areas include:
- shell;
- actions;
- navigation;
- feedback;
- inspection;
- trees.
## Anti-Bloat Rule
The module must remain:
- intentional;
- Studio-driven;
- small enough to reason about;
- broad enough to prevent UI entropy in the application.
Non-visual policies and workflows that determine asset validity, capacity, metadata, build, runtime, project, or semantic results MUST live behind `prometeu-studio-api` and be implemented by `prometeu-studio-core` or an explicit infrastructure adapter.
## Non-Goals
- defining the first concrete component set in full detail
- defining final package layout exhaustively
- mirroring the entire JavaFX control hierarchy
- storing domain-specific workspace orchestration code in the components module
- creating a standalone `prometeu-studio-components` Gradle module;
- wrapping the full JavaFX API;
- storing workspace business logic in controls;
- using Spring as a registry for each visual object;
- defining components for a future web UI.
## Exit Criteria
This specification is complete enough when:
- the module role is unambiguous;
- admission rules are stable enough to guide implementation;
- reusable workspace-control admission is clear enough to prevent local reimplementation drift;
- the JavaFX wrapping boundary is clear enough to prevent drift.
This specification is satisfied when reusable JavaFX controls have clear visual ownership, explicit lifecycle behavior, neutral injected dependencies, and no application or provider implementation responsibilities.
@@ -6,7 +6,10 @@ Active
## Applies To
- `prometeu-studio`
- `prometeu-studio-api`
- `prometeu-studio-core`
- `prometeu-studio-ui-javafx`
- `prometeu-app`
- the Studio `Assets` workspace
- packer-facing Studio service integration for asset browsing, inspection, diagnostics, and staged mutations
@@ -29,6 +32,7 @@ This specification extends:
- [`1. Studio Shell and Workspace Layout Specification.md`](1.%20Studio%20Shell%20and%20Workspace%20Layout%20Specification.md)
- [`2. Studio UI Foundations Specification.md`](2.%20Studio%20UI%20Foundations%20Specification.md)
- [`3. Studio Components Module Specification.md`](3.%20Studio%20Components%20Module%20Specification.md)
- [`9. Studio Core and Adapter Architecture Specification.md`](9.%20Studio%20Core%20and%20Adapter%20Architecture%20Specification.md)
For packer-facing semantics, this specification must align with:
@@ -52,7 +56,7 @@ The workspace must assume:
- diagnostics, activity, progress, and staged mutation responses are available from Studio-facing services;
- packer-facing operational freshness may surface states such as `healthy`, `stale`, `diverged`, `reconciling`, or `failed`.
Packer-backed operational events consumed by this workspace are expected to enter Studio through the container-owned typed event bus path rather than through workspace-local ad hoc bus creation.
The JavaFX workspace must consume neutral Studio asset contracts. Stable public Packer APIs are consumed by Studio Core where appropriate; Packer bootstrap and concrete integration remain in `prometeu-app`. Packer-backed application facts may be projected into UI-local events at the JavaFX edge, but the workspace must not call Packer directly or create an ad hoc provider integration.
## Workspace Model
@@ -100,6 +104,7 @@ The `Assets` workspace must be implemented as a composition root plus lifecycle-
Rules:
- the workspace root should coordinate service calls, workspace state, and structural synchronization;
- service calls must target injected `prometeu-studio-api` contracts; domain workflows and filesystem orchestration must not be implemented by the workspace root;
- the workspace root should not own the render and update path of every navigator row, details section, and form control directly;
- the navigator host, asset rows, selected-asset details host, and details-internal sections/forms should subscribe only to the events and state they consume;
- event-consuming controls must subscribe only while mounted in the UI tree;
@@ -6,7 +6,10 @@ Active
## Applies To
- `prometeu-studio`
- `prometeu-studio-api`
- `prometeu-studio-core`
- `prometeu-studio-ui-javafx`
- `prometeu-app`
- Studio project-session persistence under `.studio/`
- project-local Studio session restoration state
- project-local Studio setup configuration
@@ -26,7 +29,7 @@ It extends:
## Core Rules
1. The canonical root for project-local Studio persistence MUST be `.studio/` in the project root.
2. The main project-local Studio session-restoration store MUST be owned by `StudioProjectSession`, or by a service explicitly owned by `StudioProjectSession`.
2. The main project-local Studio session-restoration store MUST be owned by the neutral project-session boundary, implemented in `p.studio.core.session` or by a project service explicitly composed into that session.
3. The main session-restoration store MUST remain a single file at `.studio/state.json`.
4. The main session-restoration store MUST be versioned.
5. The main session-restoration store MUST load when the project session opens.
@@ -0,0 +1,159 @@
# Studio Core and Adapter Architecture Specification
## Status
Active
## Applies To
- `prometeu-studio-api`
- `prometeu-studio-core`
- `prometeu-studio-ui-javafx`
- `prometeu-app`
- integrations with compiler, Packer, LSP, and the runtime
## Purpose
Define the physical and functional boundary that makes the Studio consumable by interchangeable human and automation adapters without coupling application behavior to JavaFX, Spring, or a specific external provider.
## Authority and Precedence
This specification implements `DEC-0059` and is the normative architecture reference for the Studio split. More specific domain specs may refine behavior, but they MUST preserve the dependency direction defined here.
## Architectural Model
The Studio is a set of project and tooling services consumed by adapters:
```text
JavaFX UI ──> Studio API <── future non-visual adapters
│
▼
Studio Core
▲
│
application/infrastructure adapters
```
JavaFX is the current human adapter. A future agent surface is not part of this specification, but MUST be able to consume the same neutral services instead of simulating UI interaction.
## Physical Modules
1. `prometeu-studio-api` MUST contain toolkit-neutral contracts, commands, queries, DTOs, diagnostics, results, events, and operation contracts.
2. `prometeu-studio-core` MUST contain JavaFX-free application services, sessions, policies, orchestration, and Studio-owned use-case implementations.
3. `prometeu-studio-ui-javafx` MUST contain visual workspaces, controls, dialogs, bindings, navigation, presentation projections, theme application, localization binding, and JavaFX-thread dispatch.
4. `prometeu-app` MUST contain the desktop entry point, Spring composition, concrete integration adapters, lifecycle, and packaging.
Gradle is the physical classpath boundary. Spring Modulith verifies the functional modules rooted exclusively at `p.studio.core`; it does not replace the Gradle modules.
The legacy mixed `prometeu-studio` module and the static `p.studio.Container` service locator MUST NOT exist in the final architecture.
## API Neutrality
The public Studio API MUST be plain Java and MUST NOT depend on:
- JavaFX;
- Spring Framework, Spring Boot, or Spring Modulith;
- AI, MCP, or provider SDKs;
- concrete compiler, Packer, LSP, or runtime implementations;
- `p.studio.core` or `p.studio.ui.javafx` internals.
Public contracts MUST NOT expose `Stage`, `Scene`, `Node`, JavaFX properties, controls, `Task`, `ApplicationContext`, Spring events, or provider-specific implementation types.
Expected failures MUST use domain status, diagnostics, and typed results. A universal `Result<T>` abstraction MUST NOT be introduced.
## Core Rules
Core classes MUST be POJOs with constructor injection and MUST remain testable without a Spring context.
The core module MUST NOT:
- depend on JavaFX or UI packages;
- call `Platform.runLater`;
- perform navigation or workspace selection;
- use presentation severity or visual state as domain semantics;
- obtain dependencies from a static holder or `ApplicationContext` lookup.
The functional core modules are:
- `project`: project identity, catalog, creation, paths, setup, and restoration state;
- `session`: open-project lifecycle, ordered cleanup, execution ownership, and the LSP lifecycle port;
- `assets`: Studio-owned asset projections, metadata, policies, non-visual sessions, validation, and workflow orchestration;
- `shipper`: build/pack coordination, manifest generation, artifacts, and neutral logs/results;
- `runtime`: runtime settings, handshake, process/client lifecycle, and technical logs;
- `execution`: play/stop state, cancellation, shutdown, and orchestration of shipper and runtime.
The functional dependency direction MUST remain:
```text
assets --> project
shipper --> project
runtime --> project
execution --> project, shipper, runtime
session --> project, execution, LSP port
```
## JavaFX Adapter Rules
The JavaFX module MUST depend on Studio API contracts rather than core or provider implementations. It owns visual state, UI events, navigation, FX-thread transitions, CSS, fonts, locale bindings, and lifecycle of visual objects.
JavaFX controls and dialogs MUST be constructed by UI factories or composition roots. They MUST NOT become Spring singletons by default.
Presentation-only drafts and projections MAY remain in the JavaFX module. Rules that determine project, asset, build, runtime, or semantic outcomes MUST live behind neutral API contracts and core services.
The JavaFX module MUST NOT directly invoke compiler implementations, `p.packer`, LSP implementations, runtime implementations, or filesystem orchestration.
## Spring Composition
Spring Boot MUST be used only by `prometeu-app` as a non-web composition and lifecycle mechanism. The application MUST start with `WebApplicationType.NONE` or an equivalent guarantee and MUST NOT introduce Spring Web, WebFlux, Data, AI, durable events, or a web server without a later accepted decision.
Spring configuration MAY create core services, infrastructure adapters, and a JavaFX composition factory. It MUST NOT use field injection, context lookup, broad service bags, or a replacement static container.
The desktop entry point MUST retain the JavaFX composition root and close it before closing the Spring context. Closing that root MUST be idempotent and MUST close any active or asynchronously opening project session, execution surface, loading window, project window, and launcher window before provider beans and executors are destroyed.
Spring Modulith verification MUST use `p.studio.core` as its exclusive application root and MUST run as an architecture gate.
## External Integration Rule
An integration MUST use the provider's public API directly when that API is stable, neutral, use-case oriented, and safe to compose and test. A redundant gateway that merely mirrors such an API MUST NOT be created.
A narrow consumer-owned gateway MUST be used when the available integration is concrete, static, infrastructure-oriented, unstable, excessively broad, or leaks lifecycle and implementation details. Its implementation belongs in `prometeu-app` or another explicit infrastructure adapter.
| Studio consumer | Provider | Required boundary |
| --- | --- | --- |
| `assets` | `p.packer` | Stable public Packer API directly; narrow assets-owned gateway only when necessary |
| `shipper` | compiler and `p.packer` | Stable public APIs or a narrow shipper-owned compiler gateway |
| `session` | LSP | Neutral session-owned lifecycle port |
| `runtime` | external runtime/process | Narrow runtime-owned gateway |
| JavaFX UI | Studio | Studio API only |
`p.packer` remains an autonomous domain and MUST NOT depend on any `p.studio` package. Studio MUST NOT copy or assume ownership of Packer semantics.
## Commands, Events, and Operations
Commands and queries requiring an immediate response MUST use direct service calls. In-process events MAY communicate facts that require no response, and each application event MUST be owned by the functional module that owns the fact.
Selection, navigation, attach/detach, and visual lifecycle events remain UI-local.
Long-running build, pack, runtime, and execution work MUST expose a neutral operation contract with stable identity, observable snapshot, standard-Java asynchronous completion, cancellation, updates, and a typed result.
Core services MUST submit such work through the neutral `OperationExecutor` port. `prometeu-app` owns the executor-backed implementation and its thread lifecycle; JavaFX consumes `OperationHandle` completion and snapshots and performs only the required FX-thread projection.
## Conformance Gates
The architecture is conformant only when all of the following hold together:
- API and core compile without JavaFX or Spring dependencies;
- UI has no dependency on core or concrete external providers;
- `ApplicationModules.verify()` succeeds for the exclusive `p.studio.core` root;
- the application boots and shuts down in non-web mode;
- `Container`, `AppContainer`, compatibility allowlists, and the mixed module are absent;
- unit, integration, architecture, packaging, and desktop smoke tests pass;
- no service locator or context lookup replaces the removed static container.
## Non-Goals
- creating an agent or MCP module;
- replacing JavaFX with a web UI;
- migrating the Studio to Rust, Electron, Tauri, or a parallel rewrite;
- redesigning compiler, Packer, LSP, or runtime semantics;
- introducing microservices or durable event infrastructure.
+6 -1
View File
@@ -55,6 +55,7 @@ The current Studio core corpus is:
3. [`3. Studio Components Module Specification.md`](3.%20Studio%20Components%20Module%20Specification.md)
4. [`4. Assets Workspace Specification.md`](4.%20Assets%20Workspace%20Specification.md)
5. [`8. Project-Local Studio State Specification.md`](8.%20Project-Local%20Studio%20State%20Specification.md)
6. [`9. Studio Core and Adapter Architecture Specification.md`](9.%20Studio%20Core%20and%20Adapter%20Architecture%20Specification.md)
## Reading Order
@@ -64,7 +65,8 @@ Recommended order:
2. shared UI foundations;
3. components module policy;
4. assets workspace behavior;
5. project-local Studio state behavior.
5. project-local Studio state behavior;
6. Studio Core, adapter, composition, and external integration boundaries.
## Current Wave Notes
@@ -75,3 +77,6 @@ Normative reminders:
- the active Studio workspace corpus is `Assets`, `Debug`, and `Shipper`;
- project-local Studio session state remains normative and is owned by `StudioProjectSession`;
- any future external-editor backend or replacement language-service architecture requires a new accepted decision before new Studio specs are introduced.
- the Studio backend is exposed through neutral API contracts shared by the JavaFX adapter and future non-visual adapters;
- Spring Boot is a non-web composition root, while Spring Modulith verifies the JavaFX-free `p.studio.core` boundary;
- `p.studio.Container`, `AppContainer`, and the mixed `prometeu-studio` module are not valid final architecture.