feat(studio): coordinate integrated AI activity and internal language services
Test / Tests and coverage
Intrepid/Prometeu/Studio/pipeline/head This commit looks good

Start project-owned language and authenticated MCP services when opening a
project, reusing the embedded LSP backend without a desktop TCP listener.
Keep editor overlays separate from saved-file MCP queries.

Reserve conflicting editing before ACP prompt delivery and retain protection
through native/tool termination, runtime cleanup and document refresh. Preserve
drafts on rejected admission, provide cleanup/preparation recovery, distinguish
terminal outcomes and redact permission previews.

Add lifecycle, language parity, activity, composition and UI regressions and
update the canonical Studio contracts. Keep distribution update alignment as
the separate WRK-002A follow-up.

Validation: complete make -C tooling verify PASSED in
20261127T035822Z-ec5d9266 (1172 unit, 131 compiler fixture, 31 headless tests).
Opt-in real-model and native AI-view qualification are outside that gate.

Work: WRK-0029; decision: DEC-0001.
This commit is contained in:
2026-11-27 09:58:57 +00:00
parent 802a13a6aa
commit e6542df56e
46 changed files with 1485 additions and 180 deletions
@@ -124,7 +124,7 @@ The JavaFX module MUST NOT directly invoke compiler implementations, `p.packer`,
Spring Boot MUST be used only by `prometeu-app` for desktop composition and lifecycle. `WebApplicationType.NONE` remains a valid composition mode with an explicitly managed local HTTP adapter. Conformance MUST NOT impose an unconditional absence of a web server that would forbid the DEC-0060 MCP exception.
The sole accepted HTTP-server use is an in-process MCP Streamable HTTP endpoint at `127.0.0.1:<OS-assigned-port>/mcp`. The application/infrastructure adapter MUST own its transport dependencies and lifecycle. It MUST require a fresh grant-published project credential, validate project/session scope and Origin, and stop with Studio. Connection authentication MUST NOT grant project/task authority. Credentials MUST NOT be stored in versioned files. Restart requires a fresh human grant, while the stable client configuration remains unchanged.
The sole accepted HTTP-server use is an in-process MCP Streamable HTTP endpoint at `127.0.0.1:<OS-assigned-port>/mcp`. The application/infrastructure adapter MUST own its transport dependencies and lifecycle. It MUST require a fresh open-project credential, validate project/session scope and Origin, and stop with Studio. Connection authentication MUST NOT grant project/task authority. Credentials MUST NOT be stored in versioned files. Restart requires fresh project access and a newly admitted activity, while the stable client configuration remains unchanged.
This exception does not authorize a web UI, remote binding, general-purpose web application, accounts or OAuth. DEC-0061 explicitly adds the Studio-owned stdio mode and local client preparation. HTTP/MCP dependencies MUST NOT enter API/Core or the JavaFX adapter. Spring Data, Spring AI and durable event infrastructure remain outside the accepted architecture.
@@ -149,7 +149,7 @@ A narrow consumer-owned gateway MUST be used when the available integration is c
| JavaFX UI | Studio | Studio API only |
| MCP adapter | Studio | Studio API only; transport DTO translation belongs to infrastructure |
The headless gateway MUST start `prometeu headless --stdio` from the configured runtime installation and map the runtime-owned JSONL contract to neutral results. It MUST NOT reuse the human DevTools connection, introduce a native Rust/Java binding, search/download another runtime, or redefine firmware/VM semantics. Runtime process supervision and the existing project LSP client belong to application/infrastructure adapters, not UI controls.
The headless gateway MUST start `prometeu headless --stdio` from the configured runtime installation and map the runtime-owned JSONL contract to neutral results. It MUST NOT reuse the human DevTools connection, introduce a native Rust/Java binding, search/download another runtime, or redefine firmware/VM semantics. Runtime process supervision and the project-owned internal language workspace belong to application/infrastructure adapters, not UI controls.
`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.
@@ -367,3 +367,21 @@ Encoded guest messages MUST fit 256 UTF-8 bytes and stay within the unchanged
runner drains every pending native page before another bounded advance. Native
continuity alone cannot detect events dropped before ring insertion. No new guest
ABI, formatting facility or increased execution/logging budget is introduced.
## Internal project language and integrated activity
The application MUST compose one language workspace per open project, using the
existing compiler bridge and embedded LSP services without a TCP listener. API
exposes versioned document requests and JSON-compatible results; Core owns its
lifecycle and editor document handoff through neutral ports. Editor overlays and
MCP saved-file requests share the engine while keeping separate document views.
Backend execution and bounded admission MUST remain outside FX. Project generation
and document revisions fence results; shutdown waits for actual workers.
Core MUST reserve conflicting project editing before ACP prompt submission. A
project-owned agent decorator coordinates admission, model completion, cancellation,
managed worker/runtime finalization and refresh. MCP authentication is available
at project open and never implies task authority. UI bindings project this guard;
they MUST NOT be its authority. An integrated model release alone MUST NOT unlock
editing. Failed cleanup retains the reservation and exposes an explicit retry.