feat(studio): integrate project MCP setup and lifecycle
Intrepid/Prometeu/Studio/pipeline/pr-master This commit looks good
Test / Build skipped: 15, passed: 926
Intrepid/Prometeu/Studio/pipeline/head This commit looks good

This commit is contained in:
2026-09-29 19:24:28 +01:00
parent 97cf5e1919
commit d0737df0ac
48 changed files with 2048 additions and 225 deletions
@@ -164,7 +164,7 @@ DEV MUST expose:
- the four control states, project identity, current managed operation and diagnostics;
- a canonical-image canvas with session/build/logical-frame/render-frame identity and stale status;
- a short history of Studio calls, not an independent code history;
- **Copy MCP configuration**, plus short connection/use instructions when the real MCP composition is available.
- **Prepare assistant**, plus short connection/use instructions when the real MCP composition is available.
Actions MUST reflect shared service authority. DEV MUST NOT own a duplicate
lock or release authority when disposing visual subscriptions. Presentation
@@ -177,8 +177,7 @@ in Debug with its existing host/protocol/lifecycle, subject to symmetric guards.
“Agent working” means the task has been acquired; it is not a claim to observe
all external edits, reasoning or conversation.
Without a real composed MCP endpoint, configuration copy MUST be unavailable
rather than produce a fabricated endpoint or token. Test doubles MAY supply
Preparation MUST report missing installation or configuration conflicts explicitly; it does not depend on a live grant or fabricate endpoint credentials. Test doubles MAY supply
operations/captures to isolated tests, never masquerade as product execution.
## 6. Operations and Lost Responses
@@ -274,19 +273,18 @@ that it uses. Capture/build correlation MUST NOT introduce code snapshots.
Concrete tool names, input schemas, response envelopes and HTTP lifecycle are
specified in [MCP Tools and Project Knowledge Contract](11.%20MCP%20Tools%20and%20Project%20Knowledge%20Contract.md).
The app MUST host Streamable HTTP at `127.0.0.1:<OS-assigned-port>/mcp` while
Studio is open. It MUST generate a random token per Studio start, require it
on connections, validate Origin and reject unexpected origins. No remote
binding, accounts, OAuth or stdio MCP bridge is part of this baseline.
Copied configuration MUST contain the actual endpoint/token and MUST NOT be
written to versioned files. Instructions MUST explain that restart requires
refreshing client configuration. Copying configuration and authenticating
MUST NOT grant control.
The desktop MUST host Streamable HTTP at `127.0.0.1:<OS-assigned-port>/mcp`.
DEC-0061 adds Studio-owned stdio discovery and one-time preparation as specified
in spec 11. Each human grant publishes a fresh project-scoped credential through
the required lifecycle participant in spec 8. Authentication, project scope and
task identity remain separate checks. There is no global credential bypass.
Restart invalidates old access and requires a fresh human grant, while the native
client's command/configuration remains unchanged. No remote binding, accounts or
OAuth are introduced. Preparation never grants editing authority.
| Tool group | Required capabilities | Required authority |
| --- | --- | --- |
| Context/references | Project identity, languages, versions, capabilities and paginated references | Authenticated connection; no grant required |
| Context/references | Project identity, languages, versions, capabilities and paginated references | Project credential; no acquired task required |
| Control | Acquire task and release control | Prior human grant for acquisition; valid task identity for release |
| Language | Existing LSP diagnostics/navigation and supported capabilities | Valid project/task identity |
| Build | Compile and pack | Valid project/task identity |
@@ -373,7 +371,7 @@ mature gameplay library is not a prerequisite.
- Pixel-art generation, full-game libraries, audio capture or deep guest introspection.
- Shared editing, isolated worktrees, code snapshots/journals/checkpoints, merge/apply, divergence recovery, undo/rollback or automatic commits/clean-tree gates.
- Replacing compiler, Packer, LSP, VM or human Debug semantics; a new general-purpose Studio source editor.
- Remote MCP, accounts/OAuth, stdio MCP bridge, network runtime discovery or provider-specific connection wizard.
- Remote MCP, accounts/OAuth and network runtime discovery. Studio-owned stdio and local Codex preparation are the explicit DEC-0061 additions.
- Additional language implementation, persistent operation recovery or automatic task resumption.
- Integrated discussion-framework agendas/decisions/plans in the product; those are future work, not this runtime/DEV/MCP contract.
@@ -390,3 +388,14 @@ Implementation is conformant only when all phase gates hold and:
7. Lost operation responses cannot duplicate execution; runtime crash cannot trigger replay or implicit authority release.
8. Language context and indexed local references reflect real installed support and work without source checkouts.
9. Manual Debug, architecture boundaries, packaging and real-client integration pass their regression gates.
## Integrated Connection Revision (DEC-0061)
Connection and authority MUST be displayed separately. Initialization/ping
liveness determines connection, while Core determines waiting/working/manual
control. A missing descriptor means waiting for access, not proof that Studio is
closed. Preparation reports initial client trust/reload requirements without
modifying approval policy. Revocation removes published access even before
asynchronous worker/runtime cleanup finishes. New grants never restore old task
IDs or receipts. Full integrated native-client acceptance belongs to PLN-0140;
the prior HTTP acceptance alone is insufficient.