Skip to content

Epic: Unified Authoring Architecture #9

Description

@mikewolfd

Motivation

Today, studio and chat are separate worlds: studio calls Project methods directly, chat creates its own McpBridge with its own Project instance, and the user imports results between them. This architecture unifies them into a single workspace where one Project instance is shared between the user (canvas) and the AI (MCP tools), with a proposal layer (ProposalManager) for reviewing AI changes before committing them.

Three motivations drive this:

  1. Shared undo/redo — one history stack, both actors contributing
  2. Convergence — chat and canvas are the same workspace, AI sees user edits in real-time
  3. Stack simplification — collapse the separate Project instances, make MCP the universal AI surface with full spec coverage

Architecture Overview

The critical inversion: studio creates the MCP infrastructure (wrapping its own Project), and chat connects to it — reversing the current flow where chat creates McpBridge with its own Project.

Studio
+-- Project (single instance, source of truth)
|     +-- CommandPipeline (with recording middleware, actor-tagged)
+-- ProposalManager (controls middleware, dependency analysis via WASM, merge/reject)
+-- MCP Server (full tool coverage, brackets tool calls with beginEntry/endEntry)
|     +-- InMemoryTransport -> MCP Client A (ChatSession)
|     +-- InMemoryTransport -> MCP Client B (inline actions)
+-- ChatSession (conversation state, AI adapter, extended ToolContext)
+-- Canvas (renders project.state, calls project.* for user actions — never blocked)
+-- Chat Panel (renders conversation + changeset merge review UI)

What Gets Deleted

  • McpBridge class — deleted entirely
  • Chat's separate Project instance — gone
  • Import/export dance between chat and studio — gone
  • Separate chat entry point (main-chat.tsx, chat/, chat-v2/) — consolidated into integrated panel

Delivery Phases

Phase 1: Foundation — Engine + Core (E1-E3, C1-C11)

Push spec-level logic and structural queries down the stack. Prerequisites for everything else.

Phase 2: Studio-Core + MCP Tools (S1-S18) + Theme/Component Coverage

Each studio-core addition ships with its MCP tool. Theme and component full coverage in parallel.

Phase 3: New Document Types + Remaining Tools

Locale, ontology, references, migration, mapping, bind fine-grained, shape composition, publish, composition, changelog, response, audit.

Phase 4A: ProposalManager (Changeset Semantics)

Middleware-based recording, restoreState(), ProposalManager class, Rust dependency analysis, changeset MCP tools. Can start as soon as Phase 1 core middleware is in place.

Phase 4B: Chat Integration in Studio

ChatSession refactor, adapter update, studio chat panel, inline canvas AI actions, interview-to-scaffold flow. Can start after Phase 2 MCP coverage.

Phase 4C: Convergence — Changeset Review UI

Where Track A (ProposalManager) meets Track B (chat panel). Dependency-grouped accept/reject, user overlay awareness, conflict diagnostics.

Spec Reference

thoughts/specs/2026-03-24-unified-authoring-architecture.md

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions