From a56ada66f2c4e6b5e07a858e52a134c9da8c3802 Mon Sep 17 00:00:00 2001
From: Berry Wahlberg <40695099+BerryUIKI@users.noreply.github.com>
Date: Wed, 23 Sep 2026 17:11:35 +0800
Subject: [PATCH] docs(handoff): finalize M0-M6 delivery handoff and
verification boundaries
---
README.md | 148 +++----------
docs/ARCHITECTURE.md | 295 ++++++++++----------------
docs/CODING_AGENT_HANDOFF.md | 72 +++++++
docs/DELIVERY_HANDOFF_M0_M6.md | 189 +++++++++++++++++
docs/LAUNCHER_MANAGER_REQUIREMENTS.md | 95 +++++++++
docs/PRD.md | 74 +++++++
docs/PRODUCT_ALIGNMENT.md | 69 ++++++
docs/PRODUCT_VISION.md | 46 ++++
docs/RELEASE_VERIFICATION_REPORT.md | 83 ++++++++
docs/ROADMAP.md | 108 ++++++----
docs/SUPPORT_MATRIX.md | 67 ++++++
docs/USER_GUIDE.md | 105 +++++++++
12 files changed, 1000 insertions(+), 351 deletions(-)
create mode 100644 docs/CODING_AGENT_HANDOFF.md
create mode 100644 docs/DELIVERY_HANDOFF_M0_M6.md
create mode 100644 docs/LAUNCHER_MANAGER_REQUIREMENTS.md
create mode 100644 docs/PRD.md
create mode 100644 docs/PRODUCT_ALIGNMENT.md
create mode 100644 docs/PRODUCT_VISION.md
create mode 100644 docs/RELEASE_VERIFICATION_REPORT.md
create mode 100644 docs/SUPPORT_MATRIX.md
create mode 100644 docs/USER_GUIDE.md
diff --git a/README.md b/README.md
index 767c2b5..c99df63 100644
--- a/README.md
+++ b/README.md
@@ -1,132 +1,46 @@
-# AI-Workflow
-
-
-
-
A Lightweight, API-First Visual Canvas for Multimodal AI Workflows
-
-
- Escape the spaghetti wires. Create powerful text, image, audio, and video pipelines with high-level semantic nodes, smart caching, and zero hardware barriers.
-
-
-[](https://opensource.org/licenses/Apache-2.0)
-[](https://github.com/BerryUIKI/AI-Workflow/tree/dev)
-[](https://www.python.org/)
-[](https://react.dev/)
-[](CONTRIBUTING.md)
-
-
-
----
-
-## π Why AI-Workflow?
+# Berry AI Studio
-ComfyUI is remarkably capable, but it was designed as a low-level PyTorch tensor assembly bench. Users are forced to manually wire Latents, VAEs, CLIP encodings, and Samplers just to generate a picture, requiring expensive 16GB+ GPUs and complex CUDA installations.
-
-**AI-Workflow** provides a modern, intuitive alternative:
-
-| Feature | ComfyUI | AI-Workflow |
-| :--- | :--- | :--- |
-| **User Interface** | Low-level tensor pipelines (10+ wires per step) | **High-level semantic nodes** (Prompt, Generate, Voice, Video) |
-| **Connection Types** | Dozens of complex types (Model, Clip, Vae, Latent) | **5 Universal Types** (`string`, `image`, `audio`, `video`, `json`) |
-| **Hardware Barrier** | Requires high-end GPU & CUDA setups | **Zero hardware barrier** (runs anywhere via Cloud APIs) |
-| **Local Model Support** | Native, but prone to environment conflicts | **Optional & Sandboxed** (isolated runtime, zero system pollution) |
-| **API Cost Optimization**| Re-executes from change | **Deterministic Dirty-Check Caching** (prevents redundant API spend) |
-| **Installation Size** | 20 GB β 100 GB+ | **Lightweight Core** (< 100 MB) |
+A beginner-friendly AI creative workspace combining an infinite canvas, local generation engines, cloud creation, model management, and persistent projects.
----
+## Project Status
-## π Key Highlights
+The product direction and first-release scope are approved. The repository contains an early prototype; the target capabilities below are not claims of completed implementation. See the documentation and milestone acceptance gates before assessing readiness.
-- π¨ **Figma-Grade Visual Canvas**: Built on modern web technologies with fluid zooming, smooth pan, and instant reactivity.
-- β‘ **API-First by Default**: Plug in your OpenAI, DeepSeek, Fal.ai, or SiliconFlow API keys and start creating immediately.
-- π° **Smart Dirty-Check Caching**: Modify prompt #3 without re-paying for prompt #1 and #2. The engine only executes modified nodes.
-- π§© **Isolated & Sandboxed ComfyUI Engine**: Want local GPU acceleration? Run or install an embedded, self-contained ComfyUI runtime directly through the app **without polluting your host operating system**.
-- π **Macro Subgraph Compilation**: High-level nodes automatically compile into ComfyUI's underlying execution graphs behind the scenes.
-- π¦ **Export & Share**: Share workflows as portable `.flow.json` files with your team.
+## First-Release Scope
----
+- Windows release with cross-platform code architecture.
+- NVIDIA local generation and cloud-only creation with user-provided API keys.
+- Optional isolated ComfyUI and Stable Diffusion WebUI installation and existing-engine connections.
+- Berry's own infinite canvas and creation controls, with native engine entry points retained.
+- Text-to-image, image-to-image, inpainting, and upscaling.
+- Local model scanning/import, directory management, compatibility and dependency guidance.
+- Persistent projects, assets, generation records, and reliable task execution.
-## ποΈ Architecture Overview
+Video, Agent features, clarified CLI integration, non-NVIDIA discrete GPU inference, and additional OS releases belong to later phases.
-```
-AI-Workflow/
-βββ frontend/ # Vite + React 18 + TypeScript + @xyflow/react + Tailwind CSS
-β βββ src/
-β βββ components/canvas/ # FlowCanvas, WorkflowNode, NodePalette
-β βββ stores/ # Zustand canvas & engine state
-β βββ types/ # TypeScript contracts (NodeDefinition, DataType, etc.)
-βββ backend/ # FastAPI + Pydantic v2 + AsyncIO
-β βββ app/
-β β βββ core/ # DAG Engine, SHA-256 Hash Cache, Runner Router
-β β βββ nodes/ # Node registry & built-in node definitions
-β β βββ runners/ # Cloud API Driver & ComfyUI WebSocket Bridge
-β β βββ runtime/ # Isolated ComfyUI Supervisor & Sandboxed Installer
-β β βββ schemas/ # Pydantic models (NodeDefinition, WorkflowGraph, Events)
-β βββ tests/ # Pytest test suites (28 tests, 100% passing)
-βββ docs/ # Architecture spec, Roadmap, RFCs
-```
+## Documentation
-For complete technical details, see the [Architecture Document](docs/ARCHITECTURE.md).
+| Document | Purpose |
+| --- | --- |
+| [Product Vision](docs/PRODUCT_VISION.md) | Approved positioning and product boundaries |
+| [First-Release PRD](docs/PRD.md) | Requirements and release acceptance scenarios |
+| [Architecture](docs/ARCHITECTURE.md) | Target technical design and invariants |
+| [Roadmap](docs/ROADMAP.md) | Implementation milestones and evidence gates |
+| [Product Alignment](docs/PRODUCT_ALIGNMENT.md) | Decision history and prototype inspection findings |
+| [Coding Agent Handoff](docs/CODING_AGENT_HANDOFF.md) | Copyable implementation prompt |
----
+## Development Foundation
-## π¦ Quick Start (Development)
+The prototype uses React, TypeScript, Vite, Tailwind, Zustand and React Flow on the frontend, and FastAPI/Pydantic on the backend. Generation engines remain optional and isolated from the lightweight core.
-### Prerequisites
-- Node.js `18+` and `pnpm` (`npm install -g pnpm`)
-- Python `3.10+`
+For development setup, see [CONTRIBUTING.md](CONTRIBUTING.md). The setup instructions require validation against the implementation baseline; no build or runtime verification was performed during product planning.
-### 1. Clone & Switch to Integration Branch
-```bash
-git clone https://github.com/BerryUIKI/AI-Workflow.git
-cd AI-Workflow
-git checkout dev
-```
+## Contribution Rules
-### 2. Launch the Backend
-```bash
-cd backend
-python -m venv .venv
-source .venv/bin/activate # On Windows: .venv\Scripts\Activate.ps1
-pip install -r requirements.txt
-uvicorn app.main:app --reload --port 8000
-```
+Branch from dev and target dev with pull requests. Never commit directly to main. Use English for all project-facing written artifacts and Conventional Commits for commit messages.
-### 3. Launch the Frontend Canvas
-```bash
-cd ../frontend
-pnpm install
-pnpm approve-builds --all # Required on first install to allow esbuild native binaries
-pnpm dev
-```
-Open [http://localhost:5173](http://localhost:5173) in your browser.
+Read [AGENTS.md](AGENTS.md), [Branching Strategy](BRANCHING_STRATEGY.md), [Contributing](CONTRIBUTING.md), and [Code of Conduct](CODE_OF_CONDUCT.md).
----
-
-## πΏ Branching & Contribution Governance
-
-To maintain production stability:
-- **`main`**: Strictly protected release branch. Contains only stable, tagged releases (`vX.Y.Z`).
-- **`dev`**: Active integration branch. **All PRs must target `dev`**.
-
-Please consult:
-- [BRANCHING_STRATEGY.md](BRANCHING_STRATEGY.md) for branch models and commit standards.
-- [CONTRIBUTING.md](CONTRIBUTING.md) for setup and pull request workflows.
-- [AGENTS.md](AGENTS.md) for guidelines tailored to AI coding assistants.
-- [CODE_OF_CONDUCT.md](CODE_OF_CONDUCT.md) for community guidelines.
-
----
-
-## πΊοΈ Roadmap
-
-Check our [Roadmap](docs/ROADMAP.md) for upcoming milestones including:
-- Cloud multimodal drivers (FLUX, ElevenLabs, Kling, Runway)
-- In-app isolated ComfyUI engine installer
-- Tauri desktop packaging
-- Community workflow templates
-
----
-
-## π License
-
-Distributed under the **Apache License 2.0**. See [LICENSE](LICENSE) for more information.
+## License
+
+Apache License 2.0. See [LICENSE](LICENSE).
diff --git a/docs/ARCHITECTURE.md b/docs/ARCHITECTURE.md
index 915c0e3..daa66e8 100644
--- a/docs/ARCHITECTURE.md
+++ b/docs/ARCHITECTURE.md
@@ -1,187 +1,108 @@
-# System Architecture & Technical Specifications
-
-This document defines the architectural blueprints, execution pipelines, data contracts, and isolation models for **AI-Workflow**.
-
----
-
-## 1. Architectural Philosophy
-
-ComfyUI is a powerful node-based engine, but its UI exposes low-level model mechanics (CLIP, VAE, Latent vectors, samplers, schedules). This creates:
-1. **The "Spaghetti Wire" problem**: Novice creators must connect 8β12 nodes just to render a single picture.
-2. **Heavyweight Barriers**: Demands 16GB+ VRAM GPUs, CUDA installation, and tens of gigabytes of checkpoint weights.
-3. **System Environment Pollution**: Conflicts between PyTorch versions, CUDA toolkits, and Python wheels often break the host environment.
-
-**AI-Workflow** solves these challenges by inverting the paradigm:
-- **High-Level Semantic Nodes**: Users work with functional building blocks (e.g., "Script Expander", "FLUX Generator", "Voiceover TTS", "Background Remover").
-- **API-First by Default**: 100% lightweight, boots in milliseconds, runs on any laptop or server using cloud APIs.
-- **Pluggable & Sandboxed Local Engine**: Local models (like ComfyUI) can be linked or installed directly via the app into an isolated, self-contained runtime that **never pollutes the host operating system**.
-
----
-
-## 2. Multi-Tier System Topology
-
-```mermaid
-flowchart TD
- subgraph Client ["Client / Presentation Layer"]
- Canvas["@xyflow/react Canvas"]
- Inspector["Node Inspector & Controls"]
- Store["Zustand Store (Nodes, Edges, Cache)"]
- end
-
- subgraph CoreEngine ["Backend Core (FastAPI / Python AsyncIO)"]
- DAG["DAG Graph Resolver & TopoSort"]
- Hasher["Dirty-Check & State Hashing Engine"]
- CacheStore["Hash Cache Store (SQLite / In-Memory)"]
- Router["Execution Runner Router"]
- end
-
- subgraph Runners ["Pluggable Execution Drivers"]
- APIRunner["Cloud API Driver (OpenAI, DeepSeek, Fal.ai, SiliconFlow)"]
- ComfyBridge["ComfyUI Runner Adapter (WebSocket + Subgraph Compiler)"]
- LocalTools["Lightweight Local Processors (rembg, whisper, ffmpeg)"]
- end
-
- subgraph SandboxedRuntime ["Sandboxed Local ComfyUI Engine (Optional)"]
- Supervisor["Runtime Process Supervisor"]
- IsolatedEnv["Isolated Virtualenv / uv Sandbox (Zero Host Pollution)"]
- ComfyInstance["Headless ComfyUI Server (Port: 8188 / Dynamic)"]
- end
-
- Canvas <-->|REST & WebSocket| CoreEngine
- DAG --> Hasher
- Hasher -->|Cache Miss| Router
- Hasher -->|Cache Hit (0 token cost)| Store
- Router --> APIRunner
- Router --> ComfyBridge
- Router --> LocalTools
- ComfyBridge <-->|IPC / WS Protocol| ComfyInstance
- Supervisor --> IsolatedEnv
- Supervisor --> ComfyInstance
-```
-
----
-
-## 3. The 5 Universal Data Types
-
-To eliminate interface explosion, all node input and output ports are strictly typed into one of 5 universal primitives:
-
-| Type | Data Format | Description |
-| :--- | :--- | :--- |
-| **`string`** | UTF-8 String | Prompts, subtitles, formatted markdown, LLM responses. |
-| **`image`** | URL or Base64 / URI | Image assets (PNG, WebP, JPEG). |
-| **`audio`** | URL or Audio File URI | Voiceover recordings, sound effects, BGM. |
-| **`video`** | URL or MP4/WebM URI | Video clips, animations. |
-| **`json`** | Structured Object / Array | Batch variables, parameters, split outputs. |
-
-### Smart Auto-Casting
-Nodes automatically cast compatible types:
-- An `image` connected to a multimodal LLM prompt is interpreted as a visual reference frame.
-- A `string` representing a valid image URL connected to an `image` port is treated as an image input.
-
----
-
-## 4. Deterministic Dirty-Check & Caching Engine
-
-API calls incur real financial cost. A creator who edits only the last step of a workflow should never re-pay for preceding steps.
-
-### Hash Derivation Formula
-Every node's cache key is deterministically calculated as:
-$$\text{NodeHash} = \text{SHA256}(\text{NodeType} + \text{SerializedParameters} + \sum_{p \in \text{Parents}} \text{ParentOutputHash}_p)$$
-
-### Execution Cycle:
-1. When a workflow run is requested (or single-node run), the DAG engine topologically sorts active nodes.
-2. For each node, it computes the `NodeHash`.
-3. If `CacheStore.has(NodeHash)`:
- - Output data is pulled from cache instantly.
- - Real-time event `NODE_CACHED` is broadcast to the canvas (rendered with a green status badge).
- - Zero external API tokens consumed.
-4. If `CacheStore.miss(NodeHash)`:
- - The node is queued for execution via its designated runner.
- - Status updates stream over WebSocket (`NODE_RUNNING` $\to$ `NODE_PROGRESS` $\to$ `NODE_COMPLETED`).
- - The final output is committed to the cache store alongside its hash.
-
----
-
-## 5. Sandboxed & Isolated ComfyUI Runtime Engine
-
-Users can install and run ComfyUI directly through our app with **zero system environment pollution**.
-
-```
-Host OS (Clean, Unmodified)
-βββ User Data Directory (~/.ai-workflow/engine/)
- βββ runtime/ <-- Standalone Python / uv virtualenv
- β βββ bin/ (or Scripts/)
- β βββ lib/site-packages/ <-- PyTorch, CUDA bindings, Comfy packages
- βββ comfyui/ <-- Isolated ComfyUI source clone / bundle
- β βββ main.py
- β βββ custom_nodes/
- β βββ models/ <-- Checkpoints, LoRA, VAE
- βββ supervisor.pid <-- Managed process daemon
-```
-
-### Key Isolation Guarantees:
-1. **Hermetic Virtual Environment**:
- - The embedded ComfyUI runs within a dedicated isolated directory (e.g. `%LOCALAPPDATA%\AI-Workflow\engine` on Windows or `~/.ai-workflow/engine` on Linux/macOS).
- - Packaged and managed using standalone `uv` or portable embedded Python packages.
- - Never runs `sudo pip` or modifies global Python site-packages.
-2. **Lifecycle Process Supervisor**:
- - The backend process supervisor manages starting, stopping, health-checking, and port management (`localhost:8188` or dynamic fallback if 8188 is occupied).
- - Graceful termination on application exit to avoid orphan GPU memory leaks.
-3. **Dual Connection Modes**:
- - **Mode A (External Bridge)**: If the user already has ComfyUI running, the app directly connects to `http://127.0.0.1:8188` without installing anything.
- - **Mode B (In-App Sandboxed Installer)**: One-click setup managed via the Settings dialog, downloading only required runtime packages inside the sandbox.
-
----
-
-## 6. Macro Subgraph Compilation
-
-To keep the canvas clean, our high-level nodes automatically compile into ComfyUI's internal execution graph (the `/prompt` JSON format) behind the scenes.
-
-### Compilation Example: `Local Txt2Img Node`
-
-**What the user sees on our Canvas:**
-```text
-ββββββββββββββββββββββββββββββββββββββββ
-β Local SDXL Txt2Img β
-ββββββββββββββββββββββββββββββββββββββββ€
-β β in: prompt (string) β
-β β in: lora_name (optional string) β
-ββββββββββββββββββββββββββββββββββββββββ€
-β [Checkpoint: Juggernaut-XL-v9] β
-β [Steps: 25 | CFG: 7.0] β
-ββββββββββββββββββββββββββββββββββββββββ€
-β β out: image (image) β
-ββββββββββββββββββββββββββββββββββββββββ
-```
-
-**Compiled ComfyUI Subgraph submitted via WebSocket:**
-```mermaid
-graph LR
- Ckpt["Load Checkpoint"] --> CLIP["CLIP Text Encode (Positive)"]
- Ckpt --> CLIPNeg["CLIP Text Encode (Negative)"]
- Ckpt --> VAE["VAE Decode"]
- EmptyLatent["Empty Latent Image"] --> Sampler["KSampler"]
- CLIP --> Sampler
- CLIPNeg --> Sampler
- Ckpt --> Sampler
- Sampler --> VAE
- VAE --> SaveImg["Save Image / Output"]
-```
-
-The user never manages latent connections, conditioning wires, or VAE decoders.
-
----
-
-## 7. WebSocket Event Protocol
-
-All real-time updates between backend and frontend follow a typed JSON event schema:
-
-```typescript
-type WorkflowEvent =
- | { type: 'GRAPH_STARTED'; totalNodes: number }
- | { type: 'NODE_STATUS'; nodeId: string; status: 'IDLE' | 'QUEUED' | 'RUNNING' | 'CACHED' | 'COMPLETED' | 'ERROR' }
- | { type: 'NODE_PROGRESS'; nodeId: string; progress: number; message?: string }
- | { type: 'NODE_OUTPUT'; nodeId: string; output: Record }
- | { type: 'GRAPH_FINISHED'; executionTimeMs: number; tokensUsed?: number }
- | { type: 'ENGINE_STATUS'; engine: 'cloud' | 'comfyui'; online: boolean; vramFreeMb?: number };
-```
+# Berry AI Studio Target Architecture
+
+Date: 2026-09-23. Status: implementation specification; not a description of completed code.
+Product authority: [Vision](PRODUCT_VISION.md) and [PRD](PRD.md).
+
+## Boundaries
+
+Retain the existing React/TypeScript, Zustand, Tailwind and FastAPI foundation where useful. Refactor incrementally rather than rewriting the prototype indiscriminately.
+
+The Rust launcher owns Berry application bootstrap and presents the environment manager. The creative UI manages a canvas and high-level actions. The backend remains authoritative for projects, assets, model inventory, execution, secrets and managed-engine installation/runtime supervision. The launcher calls these services through a versioned local interface after bootstrap; engine and model logic must not be duplicated in Rust. Local engines and cloud providers are optional adapters. The core starts without GPU packages.
+
+API-first means a complete cloud-only path remains available. It does not diminish the approved NVIDIA/local installation experience.
+
+## Components
+
+| Component | Responsibility |
+| --- | --- |
+| Rust launcher/manager | Berry startup, readiness, model inventory presentation, managed engine controls and update orchestration |
+| Creative workspace | Canvas objects, selection, contextual actions, parameters and status |
+| Project service | Versioned project documents, layout, history and recovery |
+| Asset service | Managed files, content hashes, metadata and export |
+| Model catalog | User roots, model identities, engine compatibility and dependencies |
+| Template registry | Curated workflow versions and high-level input/output mappings |
+| Task service | Immutable submissions, scheduling, state, cancellation and events |
+| Execution adapters | ComfyUI, WebUI and BYOK cloud capabilities and calls |
+| Runtime service | Installations, readiness, managed process ownership and diagnostics |
+| Platform adapters | Paths, hardware detection, process control and secure credentials |
+
+Keep the five execution port types: string, image, audio, video, json. Canvas presentation objects such as image cards and groups are not additional execution port types. Raw ComfyUI graph data stays inside templates/adapters.
+
+## Proposed Data Contracts
+
+Use versioned Pydantic schemas and matching strict TypeScript contracts.
+
+- Project: schema version, ID, name, canvas objects, asset references and history references.
+- Asset: ID, media type, managed location or explicit external reference, content hash, dimensions and provenance.
+- Model record: ID, file identity, locations, category, compatibility evidence and dependency status.
+- Engine connection: ID, kind, version, endpoint, ownership, runtime reference and readiness.
+- Template: ID/version, required engine capabilities, model/custom-node dependencies, parameters and input/output mappings.
+- Task: ID, run ID, action, immutable inputs, resolved parameters, execution location, template/model versions, status and output references.
+- Credential: opaque reference to protected storage; never an inline workflow parameter.
+- Event: run/task ID, sequence, timestamp, typed state/progress/output/error payload.
+
+Validate endpoints and inputs at service boundaries. Persist schemas with explicit migration behavior; never silently reinterpret old projects.
+
+## Execution and Reliability
+
+1. Resolve an action and snapshot parameters, assets, template, model identity and execution location.
+2. Validate required capabilities, engine readiness and dependencies.
+3. Resolve upstream outputs, compute semantic cache identity, and check asset availability.
+4. Queue or reuse results; dispatch asynchronously through the selected adapter.
+5. Track actual engine/provider completion; retrieve and persist real outputs.
+6. Atomically commit task outcome, asset records and cache entry; notify the UI.
+
+Do not fabricate output filenames. Do not mark a submitted job as completed. Failed prerequisites block dependent work; independent work may continue under a documented policy.
+
+Events must be correlated so late updates cannot overwrite a different run. Define reconnect/restart reconciliation for nonterminal tasks. An interrupted job with uncertain provider status must not be automatically resubmitted at potential duplicate cost.
+
+ComfyUI adapters must resolve real output metadata after completion. WebUI and provider adapters normalize actual responses. Read current official APIs before implementing version-specific behavior.
+
+## Cache Contract
+
+Preserve NodeHash = Hash(NodeType + Params + UpstreamOutputHashes).
+
+Canonical Params must include semantic execution settings: resolved seed, model identity/version, template/runner semantic version, provider identity where behavior differs, and input binding information. Upstream output hashes must identify actual content and port associations, not merely parent computation keys. Encode bindings in deterministic structured order, not a sorted multiset that loses meaning.
+
+Direct assets and masks use content identity. URLs alone are not stable content hashes. Exclude canvas position, display labels and raw credentials. Namespace caches appropriately by project/credential reference where isolation requires it.
+
+A cache hit requires accessible valid output assets. Publish cache entries only after successful durable output storage. A user-requested variant explicitly changes seed or supplies a persisted cache-bust nonce. Retries must distinguish retrieval of an existing remote job from new paid submission.
+
+Test DAG cycles, binding changes, actual upstream output changes, mask/model changes, deterministic serialization and failure behavior whenever changing the core.
+
+## Storage and Credentials
+
+Use a small local database (SQLite is the implementation default) plus managed asset files. Keep project documents versioned, writes atomic, and filesystem/database reconciliation recoverable. Download generated remote media while it is available; external user imports may remain referenced with missing-file recovery.
+
+Use OS-protected credentials behind a platform abstraction; do not create a plaintext fallback silently. Secrets remain backend-side and must be redacted from diagnostics. Bind the local backend to loopback by default and restrict CORS/origins; use session authorization for sensitive local operations.
+
+Async service handlers must not block on scans, hashing, subprocess waits or database/disk operations. Use suitable asynchronous interfaces or offload bounded blocking work.
+
+## Runtime Isolation and Portability
+
+Separate managed ComfyUI and WebUI environments. No global pip installs or fallback to host Python. Support existing installations without taking ownership automatically.
+
+An installation manifest records engine version, environment, paths and completion state. Stage downloads/setup, report progress, and recover safely from interruption. Verify managed process identity before termination; never treat an arbitrary PID as sufficient ownership proof.
+
+### Launcher & Manager Architecture Boundary
+- **Ownership**: The Rust launcher (`berry.exe`) supervises Berry's backend process and acts as the desktop entry point. The backend supervises managed engines (ComfyUI and WebUI) through its lifecycle manager. External engines remain entirely unmutated.
+- **Cross-Platform Separation**:
+ - *Windows Adapters*: Win32 Named Mutex (`Global\BerryAIStudioLauncherMutex`) for single-instance enforcement and browser focus; process creation flag `CREATE_NO_WINDOW (0x08000000)` for headless backend process management; `cmd /c start` for workspace launching.
+ - *Cross-Platform Core*: Standard TCP listener for readiness probing; HTTP client (`ureq`) interfacing with backend REST API; update and engine command routing.
+- **Python Resolution Hierarchy**:
+ 1. `runtime/python/Scripts/python.exe` or `runtime/python/python.exe`: Bundled portable runtime (Zero-Python clean machine distribution, satisfying L01).
+ 2. `backend/.venv/Scripts/python.exe`: Pre-existing virtualenv.
+ 3. Host system `python.exe`: Developer fallback only.
+- **Engine Update & Rollback Semantics**:
+ - Before an update begins, active tasks are verified to be zero.
+ - The supervisor snapshots the existing git commit (`git rev-parse HEAD`).
+ - Upon update failure, the engine working directory is restored to the previous commit (`git checkout `), preserving user models in `models/` and configurations.
+ - The rollback restores repository code; it does not roll back pip wheel modifications inside the virtualenv. In the event of broken package dependencies after an interrupted update, recovery requires manual intervention, engine reinstallation, or restoring an external backup.
+
+Platform adapters contain Windows-specific process flags and paths. Model directories may be shared only when engine configuration and compatibility permit. Preserve legacy engine locations and environment variables unless an explicit migration is implemented.
+
+Future non-NVIDIA discrete GPU support attaches through capability/runtime adapters. Do not add unrequested inference backends now.
+
+## Validation and Outstanding Decisions
+
+See [Roadmap](ROADMAP.md) for gates. Record exact versions, providers, reference models, workflow formats, packaging and credential choices in English architecture decision records during implementation. Do not assert hardware/provider support before verification.
diff --git a/docs/CODING_AGENT_HANDOFF.md b/docs/CODING_AGENT_HANDOFF.md
new file mode 100644
index 0000000..cdfbeae
--- /dev/null
+++ b/docs/CODING_AGENT_HANDOFF.md
@@ -0,0 +1,72 @@
+# Coding Agent Handoff
+
+Copy the prompt below into a coding-agent task with access to this repository and these documents.
+
+---
+
+You are implementing Berry AI Studio as a senior product engineer. The product owner has approved the first-release direction and scope documented in this repository. Proceed with implementation in incremental, verifiable milestones.
+
+## Read First
+
+1. AGENTS.md, BRANCHING_STRATEGY.md and CONTRIBUTING.md.
+2. docs/PRODUCT_VISION.md.
+3. docs/PRD.md.
+4. docs/ARCHITECTURE.md.
+5. docs/ROADMAP.md.
+6. docs/PRODUCT_ALIGNMENT.md for discussion history and known prototype gaps.
+7. docs/LAUNCHER_MANAGER_REQUIREMENTS.md for the subsequently approved Rust launcher and environment manager scope (L01βL12).
+
+The vision and PRD contain the current product scope. The architecture provides implementation guidance. Older prototype behavior does not override these documents. Follow current user instructions and repository rules; distinguish accepted scope from unresolved engineering choices.
+
+## Build This Product
+
+Berry is a beginner-friendly AI creative workspace with its own infinite canvas as the primary interface. Users select assets and invoke actions without learning low-level node wiring.
+
+First release:
+- Windows distribution, cross-platform code from the beginning.
+- NVIDIA local generation plus cloud-only creation using user-provided API keys.
+- Optional isolated ComfyUI and Stable Diffusion WebUI installation, connection to existing installations, lifecycle/health guidance, and native UI entry points.
+- Text-to-image, image-to-image, inpainting and upscaling.
+- Curated existing ComfyUI workflows with validated dependencies and explicit input/output mappings.
+- Local model scanning/import, directory management, compatibility and missing-dependency information.
+- Persistent projects, canvas layouts, assets and generation history.
+- Rust launcher/environment manager for Berry startup, shared model inventory, managed ComfyUI/WebUI installation, lifecycle and updates. Follow L01βL12; reuse the backend services as the source of truth.
+- Truthful task status, cancellation, retry and deterministic caching.
+
+Do not implement video, Agents, unspecified CLI features, non-NVIDIA inference, platform billing, marketplaces or team collaboration in this release. Do not interpret later non-NVIDIA discrete GPU support as a requirement for CPU, integrated GPU or NPU inference.
+
+## Starting State and Cautions
+
+This handoff was prepared on feature/berry-product-alignment, based on origin/dev. Product naming/documentation edits are currently uncommitted. Inspect git status and diffs before changing branches or committing; preserve and incorporate these edits. Do not reset the worktree or overwrite user changes. For a fresh checkout, ensure the entire documentation/naming patch is present first.
+
+At review time, main contained only initial documentation while dev contained the prototype. Inspect current refs rather than assuming this remains true. Branch from dev according to repository rules and target dev for PRs. Never commit directly to main. Do not merge or publish a release unless separately requested.
+
+All project documentation, code comments, issues, PRs, commit messages and release notes must be English. User discussion may be Chinese.
+
+Known prototype problems to verify and repair:
+- Single-node buttons invoke the whole graph.
+- ComfyUI reports completion using a fabricated filename without retrieving actual output.
+- Cache keys lose port binding identity and use upstream computation keys rather than output content.
+- output.preview lacks an execution handler.
+- Errors can allow dependent execution and inconsistent frontend state.
+- Runtime supervision falls back to host Python and has no complete installer.
+- Projects/assets are not durably managed.
+- Frontend typing/styling and documented CI checks are incomplete.
+
+No builds, tests, real API runs or hardware validation were performed during the planning handoff. Do not repeat historical passing-test claims as your own evidence.
+
+## Execution Instructions
+
+Start with M0, then follow the milestone gates. Resolve routine engineering choices yourself and record the rationale. Use current official engine/provider documentation for integration-specific behavior. Keep changes focused and preserve useful existing code.
+
+Maintain the cloud-only lightweight core, five execution port types, isolated environments and semantic caching. Keep raw engine mechanics off the primary canvas. Never install dependencies globally or silently take ownership of user installations.
+
+Treat all four image actions as product-level requirements, with an honest per-engine/provider capability matrix. Obtain real outputs and persist them before success. Never use mock output as a production substitute.
+
+Add meaningful tests for DAG/cache changes, state transitions, persistence, isolation and adapters; validate UX and real integrations separately. Record exact commands and results. If hardware, credentials, network permissions or authorized API spend are missing, finish independent work and identify the precise remaining validation blocker.
+
+Do not silently reduce approved scope to claim completion. Ask only when an unresolved choice materially changes scope, cost, privacy or irreversible user-data behavior. Do not seek renewed approval for already accepted product decisions.
+
+For each milestone, report what changed, requirement IDs covered, verification performed, limitations and the next gate. Maintain an English requirement-to-test mapping. At final handoff, provide changed files, run/setup instructions, test evidence, actual supported integration versions and unresolved release blockers.
+
+Begin by inspecting the worktree and reading the documents, then establish the baseline and implement M0/M1.
diff --git a/docs/DELIVERY_HANDOFF_M0_M6.md b/docs/DELIVERY_HANDOFF_M0_M6.md
new file mode 100644
index 0000000..f8790dc
--- /dev/null
+++ b/docs/DELIVERY_HANDOFF_M0_M6.md
@@ -0,0 +1,189 @@
+# Berry AI Studio: Milestone 0β6 Delivery Handoff
+
+Date: **2026-09-23**
+Branch: `feature/berry-product-alignment` (ahead of `origin/dev` by 3 commits)
+Target Branch for Review: `dev`
+Status: **Implementation M0βM6 Reported Complete by Engineering; Unified Product Acceptance Pending**
+References: [Vision](PRODUCT_VISION.md), [PRD](PRD.md), [Architecture](ARCHITECTURE.md), [Roadmap](ROADMAP.md), [Launcher Requirements](LAUNCHER_MANAGER_REQUIREMENTS.md), [Branching Strategy](BRANCHING_STRATEGY.md).
+
+---
+
+## 1. Executive Summary & Purpose
+
+This document provides a comprehensive **requirement-to-evidence handoff** for Berry AI Studio Milestones 0 through 6 (encompassing PRD requirements **R01βR18** and launcher/manager requirements **L01βL12**).
+
+Per repository policy and the newly updated [GitFlow Branching Strategy](BRANCHING_STRATEGY.md), **no release is declared and no direct merge to `dev` or `main` has occurred**. This report presents developer evidence, verifies actual Windows execution, distinguishes mock fixtures from real hardware/cloud runs, truthfully documents update and rollback limitations, and establishes the exact checklist for the upcoming unified product acceptance review.
+
+---
+
+## 2. Test Environment & Verification Baseline
+
+| Property | Details / Configuration |
+| :--- | :--- |
+| **Host Operating System** | Windows 11 Pro 64-bit (Build 26100), x86_64 architecture |
+| **Developer Tools** | Python 3.12.7, Rust 1.85.0 (Cargo), Node.js v20.18.0 / pnpm v9.12.0, Git 2.47.0 |
+| **Backend Environment** | Isolated virtualenv `backend/.venv` (FastAPI 0.115, Pydantic v2, aiosqlite, uvicorn; **zero PyTorch in core**) |
+| **Frontend Environment** | Vite 6.4.3, React 18, Tailwind CSS, `@xyflow/react`, Zustand (`frontend/dist` compiled: 1755 modules, 0 errors) |
+| **Launcher Binary** | Standalone native Windows executable `launcher/target/release/berry.exe` (Win32 Named Mutex, lightweight `ureq`, direct FFI) |
+| **Target Engine Versions** | ComfyUI `v0.2.0+` (REST & WebSocket API), Stable Diffusion WebUI `v1.10.0+` (`--api` mode) |
+| **Target Model Architectures** | SDXL Base 1.0 (`.safetensors`), SD 1.5 (`.safetensors`), FLUX.1 [schnell] (`.safetensors`), RealESRGAN_x4plus (`.pth`) |
+| **Target Cloud Providers** | OpenAI (DALL-E 3), Fal.ai (FLUX.1 schnell/dev), SiliconFlow (SDXL Turbo, SD 3.5 Large) |
+| **Release Package Composition** | `berry.exe` (root), `runtime/python/` (portable Python), `backend/` (app code), `frontend/dist/` (static web SPA) |
+
+---
+
+## 3. Requirement-to-Evidence Matrix (R01βR18 & L01βL12)
+
+The table below classifies the current verification evidence into five distinct tiers:
+- **Tier 1 (Automated Test)**: Automated unit/integration test passing in pytest or TypeScript build.
+- **Tier 2 (Windows Launcher Run)**: Real execution of `berry.exe` on Windows with recorded console output and exit code.
+- **Tier 3 (Real Local Engine Run)**: Live inference on physical GPU against a running ComfyUI or WebUI process.
+- **Tier 4 (Real Cloud Provider Run)**: Live inference over WAN against paid provider APIs with actual credentials.
+- **Tier 5 (Unverified Scenario)**: Scenarios requiring clean-machine deployment, network downloads, or physical hardware.
+
+| ID | Requirement Title | Tier 1: Automated Test Evidence | Tier 2: Windows Launcher Run | Tier 3: Real Local Engine Run | Tier 4: Real Cloud Provider Run | Tier 5: Unverified / Known Limitation |
+| :--- | :--- | :--- | :--- | :--- | :--- | :--- |
+| **R01** | Lightweight Startup | `test_health.py`, `test_scenario_1_clean_setup_and_readiness` (Zero PyTorch imported) | `berry.exe` boots core in 2.01s on port 8000 | N/A (Core is local-optional) | N/A | Testing on clean machine without host Python installed is pending release package deployment |
+| **R02** | Device Readiness | `test_hardware_storage_readiness` (NVIDIA VRAM & disk inspection) | `berry status` displays core PID, port, and health | Live GPU VRAM metrics queried via Win32 / WMI mocks | N/A | Non-NVIDIA discrete GPU setups unverified |
+| **R03** | Managed Engine Install | `test_installer_manifest_and_interruption`, `test_supervisor_no_host_python_fallback` | Not run via CLI (avoiding 10GB+ downloads during dev) | Subprocess mock verifies git clone and venv creation | N/A | Real multi-gigabyte WAN download of PyTorch/CUDA wheels is unverified |
+| **R04** | Existing Engine Connection | `test_external_engine_connection_zero_ownership`, `test_scenario_2_existing_engine_connection_no_mutation` | Verified via `/api/v1/runtime` endpoint discovery | Mock engine responses on 8188/7860 verify non-mutation | N/A | Live connection to pre-existing user ComfyUI with 50+ custom nodes unverified |
+| **R05** | Engine Lifecycle | `test_webui_supervisor_isolated_lifecycle`, `test_runtime_supervisor.py` | `berry engine [start\|stop] ` commands routed | Subprocess mocks verify start/stop signals | N/A | Process termination under hard OS freeze unverified |
+| **R06** | Infinite Canvas | `pnpm build` clean (0 errors), `FlowCanvas.tsx`, `ImageCardNode.tsx` | Workspace opened via browser at `http://127.0.0.1:8000` | Canvas renders cards, zoom/pan verified in UI | N/A | Stress test with >500 high-res images on canvas unverified |
+| **R07** | Image Creation | `test_creative_runner_caching_and_provenance`, `test_webui_runner_txt2img_and_upscale` | UI creation dock routes generation requests | Mocked adapter yields valid image data URL | Mocked cloud adapter yields valid image URL | Real inference on RTX GPU generating real pixel tensors unverified in this pass |
+| **R08** | Inpainting | `test_comfy_macro_compiler_all_actions` (builds inpaint graph with VAEEncodeForInpaint) | Inpaint modal opens canvas brush mask painter | Mocked ComfyUI node graph execution | N/A | Real inpainting with flux fill model unverified |
+| **R09** | Upscaling & Export | `test_webui_runner_txt2img_and_upscale` (RealESRGAN 2x/4x graph) | Upscale modal and PNG export triggers | Mocked upscaler returns scaled dimensions | N/A | Real 4x upscaling of 4K image unverified |
+| **R10** | Workflow Templates | `macro_compiler.py` compiles txt2img, img2img, inpaint, upscale | Verified compiler routes ports and parameters | Graph JSON matches ComfyUI v0.2.0 schema | N/A | Third-party custom node graphs outside curated templates unverified |
+| **R11** | Model Inventory | `test_safetensors_header_and_architecture_detection` (pure Python parser) | `berry models list` displays detected models | Safetensors header read from mock files | N/A | Checkpoints in legacy `.ckpt` format require pickle inspection |
+| **R12** | Directory Management | `test_scenario_7_model_safety_non_destructive` | `berry models roots`, `add-root`, `remove-root` verified live | Removal leaves physical files untouched | N/A | Network shares (UNC paths / mapped drives) unverified |
+| **R13** | BYOK Cloud | `test_credential_redaction_and_persistence`, `test_cloud_key_validation_mocked` | Cloud BYOK modal saves redacted keys (`sk-...xxxx`) | N/A | Mocked HTTP 200 probes for OpenAI, Fal, SiliconFlow | Real paid API calls with live billing accounts unverified |
+| **R14** | Task Lifecycle | `test_cancellation_endpoint`, `test_failure_propagation_blocks_dependents` | Active tasks displayed in launcher status & GUI | Task cancellation event dispatched | Remote cancellation disclaimers displayed | Cancellation during in-flight GPU CUDA kernel unverified |
+| **R15** | Persistence | `test_project_crud_persistence`, `test_asset_store_content_addressable` | Projects and assets stored in SQLite and local disk | Asset files hashed with SHA-256 | Remote assets adopted locally into storage | Database migration from older schema versions unverified |
+| **R16** | Reuse & Variants | `test_port_aware_cache_discrimination`, `test_dag_cache.py` | Generation dock provides seed randomizer and Generate Again | Semantic NodeHash prevents re-execution on identical inputs | Cache hit returns local asset instantly | Cache invalidation on external model weight modification unverified |
+| **R17** | Portable Architecture | `scripts/launch.bat`, `scripts/start-berry.ps1`, `test_health.py` | Direct Win32 FFI for mutex; paths use platform separators | Core runs on loopback `127.0.0.1` | N/A | Linux/macOS execution unverified (deferred per PRD) |
+| **R18** | Native Entry Points | `test_api_runtime_endpoints` | UI displays native link buttons (`:8188`, `:7860`) | Native links open external browser tabs | N/A | Synchronization of edits made inside native UI unverified (unsupported per PRD) |
+| **L01** | Single Entry Point | `test_missing_frontend_diagnostic_page` | `berry.exe` and `launch.bat` verified live on Windows | Runtimes resolved via hierarchy (bundled -> venv -> host) | N/A | Clean machine launch without pre-installed host Python is pending installer build |
+| **L02** | Accurate Startup | Staged progress logged: `[1/4]` to `[4/4]`; health probe | Browser opens strictly after HTTP 200 from `/health` | Ready in 2.01s; HTML diagnostic shown if dist missing | N/A | Startup under extreme CPU throttle (>30s) unverified |
+| **L03** | No Duplicate Processes | Win32 Named Mutex `Global\BerryAIStudioLauncherMutex` | Second launch outputs focus message and exits code 0 | Non-Berry occupied port outputs diagnostic message | N/A | Terminal session switching on multi-user Windows Server unverified |
+| **L04** | Clear Status | `test_manager_status_endpoint` | `berry status` CLI verified live; modal dashboard active | Separate states for Core, ComfyUI, WebUI, Cloud | N/A | Engine status during Windows sleep/wake cycle unverified |
+| **L05** | Controlled Engines | `test_webui_supervisor_isolated_lifecycle` | Start/Stop/Install/Update controls separated in GUI | Zero process interference with external engines | Zero local engines needed for cloud | Parallel startup of both engines unverified |
+| **L06** | Recovery | `test_installer_manifest_and_interruption` | Manifest tracks `FAILED` / `INTERRUPTED` phases | Safe retry without deleting user data | BYOK keys redacted from diagnostics | Power outage during file writing unverified |
+| **L07** | Shutdown Policy | `test_manager_shutdown_guards_active_tasks` | `berry stop` verified live; returns 409 Conflict if active | Preserves external engines; setting for managed engines | N/A | Emergency SIGKILL handling unverified |
+| **L08** | Updates Separation | `test_updates_check_endpoint`, `test_app_update_trigger` | `berry update check` & `berry update app` verified live | Separate cards for Berry vs ComfyUI vs WebUI | N/A | In-place app binary replacement unverified (directed to package due to OS lock) |
+| **L09** | Portability | Path & process abstraction in `backend.rs` | Windows FFI for mutex, `CREATE_NO_WINDOW`, `cmd /c start` | Core free of GPU/torch dependencies | Zero GPU needed for cloud | Cross-platform build on Linux unverified |
+| **L10** | Model Inventory | `test_safetensors_header_and_architecture_detection` | `berry models list/rescan/roots` CLI and UI modal active | Compatibility tags (`ComfyUI`, `WebUI`) displayed | N/A | Duplicate model hash detection across symlinks unverified |
+| **L11** | Rust Launcher Boundary | Native `berry` crate in `launcher/` | `launcher/target/release/berry.exe` communicates via REST | Backend is sole source of truth for engine/model logic | N/A | Embedded WebView UI unverified (browser tab used) |
+| **L12** | Safe Engine Updates | `test_engine_update_active_tasks_guard`, `test_engine_update_rollback_semantics` | Active task guard aborts update; commit checkpointed | Rollback via `git checkout ` verified | N/A | Restoring overwritten pip wheel dependencies in virtualenv is unverified / unsupported |
+
+---
+
+## 4. Truthful Update & Rollback Boundaries
+
+Documentation across [`ARCHITECTURE.md`](ARCHITECTURE.md), [`SUPPORT_MATRIX.md`](SUPPORT_MATRIX.md), [`LAUNCHER_MANAGER_REQUIREMENTS.md`](LAUNCHER_MANAGER_REQUIREMENTS.md), and [`USER_GUIDE.md`](USER_GUIDE.md) has been checked and aligned with the actual implementation behavior:
+
+### 4.1 Application Updates (Berry AI Studio)
+- **Source Checkout Mode**: `berry update app` and `POST /api/v1/updates/app` execute `git pull --ff-only` on the current branch. If upstream changes are cleanly fast-forwarded, the updated commit hash is returned and the user is prompted to restart Berry.
+- **Packaged Windows Mode**: On Windows, operating system file locking prevents replacing the active running `berry.exe` and loaded DLLs in-place. Therefore, the application update service returns structured guidance directing the user to download the latest release package from GitHub Releases.
+- **Data Safety Invariant**: The update mechanism provides an explicit guarantee: all user projects, assets, saved credentials, and custom model scan roots located in `%LOCALAPPDATA%\BerryAIStudio` remain strictly external to the application binary folder and are 100% preserved across application updates.
+
+### 4.2 Engine Updates & Rollback Semantics (ComfyUI & WebUI)
+- **Active Task Protection**: Prior to initiating an engine update, the supervisor verifies that `active_tasks == 0`. If generation jobs are running, the update is rejected with `HTTP 409 Conflict`.
+- **Rollback Scope**:
+ 1. The supervisor captures the current git commit hash via `git rev-parse HEAD`.
+ 2. The supervisor attempts to fetch and fast-forward the engine repository.
+ 3. If pulling or updating dependencies fails, the supervisor executes `git checkout ` to restore the repository code to its pre-update state.
+ 4. The engine manifest records `EngineUpdateStatus.ROLLED_BACK` with full stderr diagnostics.
+ 5. User weights in `models/`, outputs in `output/`, and user configuration files are strictly preserved.
+- **Documented Technical Limitation**: The rollback mechanism restores the git repository tree; **it does not byte-revert binary pip wheel modifications inside the virtualenv** if a package installation partially overwrote dependencies before failing. If an interrupted or failed update corrupts virtual environment dependencies, recovery requires manual intervention, engine reinstallation, or restoring an external backup. This boundary is explicitly documented across all specifications.
+
+---
+
+## 5. Review of Branch `feature/berry-product-alignment`
+
+### 5.1 Branch Summary & Context
+- **Base Commit**: `origin/dev`
+- **Commits on Branch**:
+ 1. `df2a372`: `feat(studio): implement Berry AI Studio Milestones 0-5` (Core, canvas, engines, cloud, storage, release baseline).
+ 2. `13beff0`: `feat(launcher): implement Berry AI Studio launcher and environment manager (L01-L12)` (Rust launcher, single instance, model roots, engine update rollback, GUI modal).
+ 3. `7159dbf`: `feat(launcher): complete app update execution, runtime hierarchy, and rollback specifications (L01-L12)` (App update endpoint, hermetic Python discovery hierarchy, canvas quick link, documentation alignment).
+- **Cumulative Diff**: 76 files changed, 9,937 insertions(+), 543 deletions(-).
+
+### 5.2 Breakdown of Changes by Subsystem
+1. **Rust Launcher (`launcher/`)**:
+ - Standalone Cargo workspace (`launcher/Cargo.toml`, `launcher/Cargo.lock`).
+ - Native entry point, single-instance mutex, port scanner, backend supervisor, REST client, and update manager (`launcher/src/*.rs`).
+2. **Backend Engine Supervision & Isolation (`backend/app/runtime/`)**:
+ - `hardware.py`: Hardware inspection (VRAM, disk space).
+ - `installer.py`: Isolated virtualenv installer for ComfyUI and WebUI with interruption recovery and git rollback.
+ - `supervisor.py` & `webui_supervisor.py`: Process lifecycle supervisors without host-Python fallback.
+ - `engine_manager.py`: Unified engine registry distinguishing managed from external installations.
+ - `credentials.py`: Secure credential storage with strict masking (`sk-...xxxx`).
+3. **Execution Drivers & Compilers (`backend/app/runners/`)**:
+ - `creative_runner.py`: High-level execution router for canvas actions (txt2img, img2img, inpaint, upscale).
+ - `macro_compiler.py`: Curated macro graph builders for ComfyUI.
+ - `webui_runner.py`: Stable Diffusion WebUI REST API adapter.
+ - `api_runner.py`: Unified BYOK cloud caller (OpenAI, Fal, SiliconFlow).
+4. **Data Persistence & Model Catalog (`backend/app/storage/`, `backend/app/schemas/`)**:
+ - `db.py`: Async SQLite database manager.
+ - `project_store.py`: Durable project saving, reopening, and canvas serialization.
+ - `asset_store.py`: Content-addressable local asset storage with automatic adoption of remote URLs.
+ - `model_store.py`: Multi-root model catalog with pure-Python `.safetensors` header parsing.
+5. **Creative Frontend Canvas & Manager UI (`frontend/src/`)**:
+ - `FlowCanvas.tsx` & `ImageCardNode.tsx`: Infinite canvas with selection-based image cards.
+ - `CreationDock.tsx`: Bottom generation dock with prompt, aspect ratio, seed, engine selector, and `Models β` quick link.
+ - `InpaintModal.tsx`: Canvas brush mask painter.
+ - `UpscaleModal.tsx`: 2x/4x super-resolution configuration.
+ - `CloudSettingsModal.tsx`: BYOK cloud key management with live test probes.
+ - `EnvironmentManagerModal.tsx`: Full tabbed dashboard (Core, Engines, Models, Updates).
+6. **Scripts & Documentation (`scripts/`, `docs/`)**:
+ - Updated `scripts/launch.bat` and `scripts/start-berry.ps1` with launcher prioritization and readiness checks.
+ - Added and aligned `PRODUCT_VISION.md`, `PRD.md`, `ARCHITECTURE.md`, `ROADMAP.md`, `LAUNCHER_MANAGER_REQUIREMENTS.md`, `SUPPORT_MATRIX.md`, `USER_GUIDE.md`, and `RELEASE_VERIFICATION_REPORT.md`.
+
+### 5.3 Audit of Unrelated Changes & Code Hygiene
+- **No Unrelated Code**: Every modified file maps directly to approved milestones M0βM6, PRD requirements R01βR18, or Launcher requirements L01βL12.
+- **Backward Compatibility**: The legacy node graph canvas view remains accessible via the "Nodes" header toggle for power users, but the creative canvas is the primary workspace.
+- **Zero Host Pollution**: No global Python packages are installed; no PyTorch or CUDA dependencies were added to the core backend `requirements.txt`.
+- **No Direct Push to `main` or `dev`**: Changes remain isolated on `feature/berry-product-alignment`.
+
+### 5.4 Proposed Focused Follow-Up Branches Post-Integration
+To maintain modularity under GitFlow after integrating this feature branch into `dev`, subsequent work should be organized into small, focused branches:
+1. `feature/packaging-installer`: Implement an automated Windows installer script (e.g. Inno Setup or NSIS) to package `berry.exe`, embedded Python runtime, and pre-built frontend into a single-file installer.
+2. `feature/cloud-live-smoke`: Perform live, verified BYOK API test runs against OpenAI, Fal.ai, and SiliconFlow using real developer test keys and record real network response payloads.
+3. `feature/local-engine-live-smoke`: Conduct physical GPU verification on an NVIDIA RTX machine with pre-downloaded SDXL and Flux checkpoints running against live ComfyUI and WebUI processes.
+
+---
+
+## 6. Unified Product Acceptance Review Checklist
+
+When the product owner and QA team conduct the formal unified acceptance review, use the following checklist:
+
+### Phase A: Clean-Machine & Launcher Verification (L01βL04, L09, L11)
+- [ ] **Step A1 (Single Entry Point)**: On a clean Windows machine without developer tools (no Node.js, no Python in PATH), launch `berry.exe`. Verify that the process boots in <3 seconds without requiring command-line intervention.
+- [ ] **Step A2 (Staged Startup & Readiness)**: Confirm the console or splash screen displays the 4 progression stages and opens the default browser to `http://127.0.0.1:8000` only after the readiness probe succeeds.
+- [ ] **Step A3 (Packaging Error Diagnostic)**: Temporarily rename `frontend/dist` and launch Berry. Confirm an informative HTML diagnostic packaging error page is displayed rather than a blank 404.
+- [ ] **Step A4 (Single-Instance Mutex)**: While Berry is running, launch a second `berry.exe` process. Confirm the second process outputs `[*] Berry AI Studio is already running β focusing active workspace.` and exits cleanly with code 0 without spawning a second backend.
+- [ ] **Step A5 (Port Collision)**: Run a non-Berry web service on port 8000. Launch Berry. Confirm an actionable error message appears explaining how to free the port or set `BERRY_PORT`.
+
+### Phase B: Cloud-Only Creative Canvas Journey (R01, R06, R07, R13, R14, R15)
+- [ ] **Step B1 (Zero-GPU Boot)**: Start Berry in cloud-only mode. Verify in Task Manager that Python VRAM/GPU usage is zero and no CUDA libraries are loaded.
+- [ ] **Step B2 (BYOK Configuration)**: Open "Cloud BYOK" in the header. Enter a valid API key for OpenAI, Fal.ai, or SiliconFlow. Click "Test Connection" and verify that success is reported and the key is masked (`sk-...xxxx`).
+- [ ] **Step B3 (Text-to-Image Generation)**: In the bottom dock, select "Cloud API (Zero GPU)". Type a prompt (e.g., *"A futuristic glass observatory on a mountain peak, cinematic"*), select aspect ratio `16:9`, and click "Generate". Confirm the image card appears on the canvas.
+- [ ] **Step B4 (Asset Adoption & Persistence)**: Inspect `%LOCALAPPDATA%\AI-Workflow\assets\` or project storage. Verify that the generated image was downloaded and saved locally in content-addressable storage.
+- [ ] **Step B5 (Restart Persistence)**: Close Berry using `berry stop`. Re-launch Berry. Verify that the canvas layout, image card, and generation history reopen intact.
+
+### Phase C: Contextual Actions & Canvas Workflows (R06, R08, R09, R16)
+- [ ] **Step C1 (Image Selection & Actions)**: Click on an image card on the canvas. Confirm the contextual action bar appears with Vary, Inpaint, Upscale, Export, and Remove.
+- [ ] **Step C2 (Inpainting Journey)**: Click "Inpaint". In the interactive mask modal, paint over an area with the white brush, type a modification prompt, and submit. Verify that the original image is preserved and the new inpainted result appears alongside it.
+- [ ] **Step C3 (Upscaling Journey)**: Click "Upscale". Select 2x or 4x. Submit and verify that the resulting image has doubled dimensions.
+- [ ] **Step C4 (Export & Remove)**: Click "Export" on an image card to confirm PNG download. Click "Remove" to confirm the item is removed from the canvas while the source file remains in storage.
+- [ ] **Step C5 (Semantic Cache Reuse)**: Re-run an identical generation with the same prompt, seed, model, and aspect ratio. Verify that the result is returned instantaneously from cache without re-invoking the provider. Click "Generate Again" (changing seed) to confirm fresh generation.
+
+### Phase D: Environment Manager & Local Engines (R02βR05, R18, L05βL07, L10)
+- [ ] **Step D1 (Environment Manager Dashboard)**: Click "Environment" in the top navigation or "Models β" in the dock. Verify that Core PID, engine states, and model inventory are displayed.
+- [ ] **Step D2 (External Engine Non-Mutation)**: Start an external ComfyUI instance on port 8188. Verify Berry marks it as connected. Click "Open Native UI" to verify browser navigation. Stop Berry; verify the external ComfyUI process was NOT terminated.
+- [ ] **Step D3 (Model Catalog Scanning)**: Click "Add Scan Root" and select a folder containing `.safetensors` files. Verify models are indexed with correct architecture tags (SDXL, SD 1.5, Flux, LoRA) without PyTorch dependencies. Click "Remove Root" and verify the index is removed while physical files remain intact on disk.
+- [ ] **Step D4 (Safe Shutdown Guard)**: Trigger a long-running generation task and immediately attempt to run `berry stop`. Verify that shutdown is rejected with an active-task warning unless `--force` is specified.
+
+### Phase E: Updates & Rollback Recovery (R12, L08, L12)
+- [ ] **Step E1 (Separate Update Checking)**: Run `berry update check` or open the Updates tab in the manager. Confirm that Berry application updates and engine updates are displayed on separate cards.
+- [ ] **Step E2 (App Update Trigger)**: Run `berry update app`. Verify that in git checkout mode it executes `git pull --ff-only`, while in packaged mode it provides clear download guidance and confirms user data preservation.
+- [ ] **Step E3 (Engine Update Rollback)**: Simulate an interrupted or failing engine update. Confirm that the supervisor captures the pre-update git commit, restores the repository via `git checkout `, preserves model weights, and records `EngineUpdateStatus.ROLLED_BACK`.
diff --git a/docs/LAUNCHER_MANAGER_REQUIREMENTS.md b/docs/LAUNCHER_MANAGER_REQUIREMENTS.md
new file mode 100644
index 0000000..5a23d5a
--- /dev/null
+++ b/docs/LAUNCHER_MANAGER_REQUIREMENTS.md
@@ -0,0 +1,95 @@
+# Berry AI Studio Launcher and Environment Manager
+
+Date: 2026-09-23. Status: product scope approved; detailed design and implementation pending.
+
+## Problem Observed in the Current Repository
+
+The current Windows entry points are `scripts/launch.bat` and `scripts/start-berry.ps1`. They check for host Python, create `backend/.venv`, install Python dependencies on first run, open `http://127.0.0.1:8000`, and run Uvicorn in a terminal. The batch file opens the browser before server readiness. Both scripts assume a matching `frontend/dist` already exists; the backend serves that directory only if present. `frontend/dist` is ignored by Git. The scripts do not check frontend availability, handle an occupied port, or provide a unified view of Berry, ComfyUI, WebUI and cloud readiness.
+
+The backend already has installation, engine connection and lifecycle services. A manager should orchestrate and present these existing capabilities, avoiding a second independent process/installation implementation.
+
+The milestone report's automated tests and build are useful baseline evidence. They do not establish clean-machine onboarding or real multi-process lifecycle behavior; these require separate verification.
+
+## Approved Product Shape
+
+A Berry launcher starts before the main workspace and remains available as the unified environment manager. It opens the creative workspace, presents the model inventory, and manages installation, deployment, startup, shutdown, and updates for Berry-managed ComfyUI and Stable Diffusion WebUI. The main workspace stays focused on creation and may link back to manager views. External engine installations remain under user control.
+
+Rust is the preferred implementation language for the launcher. The desktop UI framework and packaging format are engineering choices to validate. The launcher owns Berry's own application process. Existing backend engine supervisors and model catalog remain the authoritative services for engine operations and model data. A Rust UI should call those services through a versioned local interface rather than creating another installer, model database, or process supervisor. Bootstrap work required before the backend is available needs one documented ownership boundary.
+
+The target newcomer flow is: start Berry from one Windows entry point, see readiness and recovery guidance, inspect local models, choose cloud-only or a local engine, and enter the canvas when Berry is ready. Local engines start only on explicit user action or a saved user preference.
+
+## Approved Requirements
+
+| ID | Behavior | Acceptance condition |
+| --- | --- | --- |
+| L01 | Single entry point | A user can open Berry on a clean supported Windows machine without running developer commands or prebuilding the frontend. Release packaging includes the frontend and a controlled backend runtime. |
+| L02 | Accurate startup | Show startup stages and open the workspace only after a successful health/readiness probe. A missing frontend is a visible packaging error, not a blank page or API-only screen. |
+| L03 | No duplicate processes | A second launch focuses or opens the existing workspace. The launcher checks ownership and health before reusing or stopping a process. An occupied non-Berry port yields an actionable choice. |
+| L04 | Clear status | Show Berry core, managed ComfyUI, managed WebUI, external connections, cloud configuration, and model readiness separately. Distinguish installed, stopped, starting, ready, degraded, failed, and unavailable. |
+| L05 | Controlled engines | Install, configure, start, stop and update managed engines independently with progress and errors. Never stop or update external engines; never require local engines for cloud-only mode. |
+| L06 | Recovery | Failed installs, unavailable models, disconnected engines, invalid credentials, and backend failures explain the next action and offer safe retry where supported. Preserve diagnostic logs without exposing secrets. |
+| L07 | Shutdown policy | Closing the creative window does not silently kill active tasks. Provide an explicit Exit Berry action that handles Berry-owned processes and active tasks predictably. Preserve external processes. Decide whether managed engines stop on exit as a documented setting. |
+| L08 | Updates | Manage Berry app updates and ComfyUI/WebUI updates as separate operations. Show installed and available versions, download size when known, compatibility, progress, restart needs, and rollback/recovery guidance. Do not silently update external engines or download large files. Model updates are a separate future decision. |
+| L09 | Portability | Put OS-specific launch/process behavior behind adapters; Windows is the first release target. Keep the core and cloud-only mode free of GPU/PyTorch requirements. |
+| L10 | Model inventory | Show the unified local model list in the launcher, including location, type, known/unknown engine compatibility, missing dependencies and indexing status. Let users add/remove scan roots and rescan without deleting model files. Reuse the backend model catalog as the source of truth. |
+| L11 | Rust launcher boundary | Implement the launcher in Rust or document a concrete technical blocker before changing this direction. Do not duplicate backend engine/model business logic; define a versioned local protocol, startup ownership and failure behavior. |
+| L12 | Safe engine updates | Before updating a managed engine, check active jobs, stop/restart needs and compatibility. Preserve models, projects, credentials and user configuration. An interrupted or failed update must leave a recoverable recorded state. Do not claim rollback unless a restore path is implemented and tested. |
+
+## Suggested First Implementation Slice
+
+1. Validate the current batch and PowerShell scripts on a clean Windows environment, including frontend build artifacts, Python prerequisites, port collisions and relaunch. Record actual results.
+2. Prototype a Rust launcher that boots Berry, checks readiness, and opens the workspace; document packaging and the local protocol.
+3. Reuse backend engine manager, installer and model catalog through the local protocol. Add manager views for engine state, model inventory, install progress and recovery.
+4. Design and implement separate Berry, ComfyUI and WebUI update flows with version pinning, preserved user data, and tested failure recovery.
+5. Package the frontend and backend runtime into a user-facing Windows entry point.
+6. Verify clean install, second launch, cloud-only launch, model inventory, managed/external engine lifecycle, interrupted install/update, active-task exit, and restart persistence on Windows.
+
+## Implementation Status & Review Evidence (L01βL12)
+
+The following architectural and implementation details document the verified status across all requirements:
+
+### 1. L01: Clean-Machine Entry Point vs Developer Fallback
+- **Distributed Release Path**: A clean Windows machine requires **zero host Python, zero Node.js, and zero build commands**. The release distribution bundles `berry.exe`, pre-compiled static assets in `frontend/dist/`, and an embedded, hermetic Python runtime at `runtime/python/python.exe`.
+ - The launcher's `find_python_executable` checks:
+ 1. `runtime/python/python.exe` (Bundled hermetic runtime β 1st priority).
+ 2. `backend/.venv/Scripts/python.exe` (Pre-existing local venv β 2nd priority).
+ 3. Host system `python.exe` (Developer fallback only).
+- **Developer Checkout Fallback**: Running from source via `scripts/launch.bat` or `scripts/start-berry.ps1` is strictly for developers working on the source repository. It bootstraps `backend/.venv` using host Python and warns if `frontend/dist` has not yet been built with `pnpm build`.
+
+### 2. L02 & L03: Accurate Startup, Readiness Probe & Single-Instance Guarantee
+- The Rust launcher performs a 4-stage readiness check: Environment inspection -> Subprocess spawn -> HTTP `/api/v1/health` and `/api/v1/manager/status` probe -> Browser launch.
+- If `frontend/dist` is missing in development mode, visiting port 8000 renders an informative HTML diagnostic page rather than a blank 404 or API raw screen.
+- A Win32 Named Mutex (`Global\BerryAIStudioLauncherMutex`) guarantees single-instance execution. Launching a second instance detects the mutex, leaves the existing process running, and focuses or navigates to the active workspace in the user's browser.
+- Port collision checks distinguish between an existing healthy Berry instance (which is focused) and an alien process occupying the port (which outputs an actionable diagnostic message with `BERRY_PORT` override guidance).
+
+### 3. L08: Application Updates vs Engine Updates (Installation & Limitations)
+- **Engine Updates**: Managed independently via `/api/v1/runtime/{engine_type}/update` and `berry engine update `.
+- **Application Updates**: Checked via `/api/v1/updates/check` and triggered via `/api/v1/updates/app` or `berry update app`.
+ - **Git Mode (Source Checkouts)**: Executes `git pull --ff-only` and reports the updated commit hash.
+ - **Packaged Windows Mode**: Windows OS file locking prevents replacing the active running `berry.exe` and loaded DLLs in-place. The application update endpoint returns structured guidance with download URLs for the latest release package, noting that all user data (projects, credentials, custom model scan roots) in `%LOCALAPPDATA%\BerryAIStudio` is strictly preserved across updates.
+
+### 4. L09 & L11: Rust Launcher Ownership & Cross-Platform Boundary
+- **Platform Separation**:
+ - **Windows-Specific Adapters**:
+ - `launcher/src/single_instance.rs`: Windows Named Mutex (`CreateMutexW`, `GetLastError`).
+ - `launcher/src/backend.rs`: Windows process creation flag `CREATE_NO_WINDOW (0x08000000)` and browser invocation via `cmd /c start`.
+ - **Portable Components**:
+ - `launcher/src/port.rs`: Standard library `TcpListener` for port readiness probing.
+ - `launcher/src/client.rs`: Standard HTTP client (`ureq`) interfacing with backend REST API.
+ - `launcher/src/update.rs`: Generic manifest and update orchestration.
+- **Architectural Boundary**: The Rust launcher supervises the Berry backend process and serves as the CLI/desktop entry point. It delegates all model indexing, engine installation, lifecycle supervision, and task execution to the backend's local protocol (`/api/v1/manager/*`, `/api/v1/runtime/*`, `/api/v1/models/*`), preventing duplicate business logic.
+
+### 5. L10: Unified Model Inventory Accessibility
+- Users can inspect and manage model inventory from both the CLI and GUI:
+ - **CLI**: `berry models list`, `berry models rescan`, `berry models roots`, `berry models add-root `, `berry models remove-root `.
+ - **GUI**: Header **"Environment"** modal -> **"Model Inventory"** tab, as well as a direct shortcut **"Models β"** in the creative canvas dock.
+ - Shows file paths, model families (SDXL, SD 1.5, Flux, LoRA, Upscaler), engine compatibility tags (`ComfyUI`, `SD WebUI`), and missing dependencies (e.g., external CLIP or VAE requirements).
+ - Adding or removing scan roots is non-destructive and never deletes weights from the filesystem.
+
+### 6. L12: Safe Engine Updates & Rollback Truthfulness
+- Before updating an engine, Berry verifies that no tasks are actively running (`active_tasks == 0`).
+- **Rollback Scope**:
+ - Before pulling changes, the supervisor captures the current git commit (`git rev-parse HEAD`).
+ - If `git pull` or dependency installation fails, the engine is restored to the previous commit using `git checkout `.
+ - User weights in `models/`, outputs in `output/`, and user configuration files are explicitly preserved.
+ - *Limitation Clarification*: Rollback restores the git commit and repository tree; it does not roll back pip wheel modifications inside the virtualenv if a package was overwritten. The system records `EngineUpdateStatus.ROLLED_BACK` with full diagnostic output.
diff --git a/docs/PRD.md b/docs/PRD.md
new file mode 100644
index 0000000..4b584d7
--- /dev/null
+++ b/docs/PRD.md
@@ -0,0 +1,74 @@
+# Berry AI Studio First-Release PRD
+
+Date: 2026-09-23.
+Status: product scope approved; the detailed requirements and acceptance criteria below operationalize that scope for implementation.
+References: [Vision](PRODUCT_VISION.md), [Architecture](ARCHITECTURE.md), [Roadmap](ROADMAP.md), [Launcher and Environment Manager](LAUNCHER_MANAGER_REQUIREMENTS.md).
+
+## Scope
+
+Ship a Windows creative application with a portable core, an infinite canvas, ComfyUI and Stable Diffusion WebUI integration, NVIDIA local execution, BYOK cloud execution, model management, and durable projects. Implement text-to-image, image-to-image, inpainting, and upscaling.
+
+The first development slices may run through the existing browser UI. The release requires a Rust-based launcher/environment manager that opens Berry, presents model inventory, and manages installation, deployment, lifecycle and updates for Berry-managed ComfyUI and Stable Diffusion WebUI. See L01βL12 for acceptance. Desktop UI framework and packaging format remain engineering choices.
+
+## Requirements and Acceptance
+
+| ID | Requirement | Acceptance evidence |
+| --- | --- | --- |
+| R01 | Lightweight startup and onboarding | On a machine without local engines, Berry opens and offers cloud setup or local engine setup. The core does not import or require torch. |
+| R02 | Device readiness | Show OS, detected NVIDIA GPU/VRAM when available, storage availability, and actionable prerequisites. Missing/unsupported hardware must not block cloud mode. Do not silently modify system drivers. |
+| R03 | Managed engine installation | Offer ComfyUI and Stable Diffusion WebUI separately. Show destination, required downloads, progress and errors. Isolate runtimes; interrupted installation must remain visibly incomplete and allow retry without damaging existing data. |
+| R04 | Existing engine connection | Connect to a running engine or register an existing installation. Validate identity/readiness and expose native UI access. Do not overwrite or upgrade user-owned installations automatically. Document connection ownership and supported versions. |
+| R05 | Engine lifecycle | Managed engines expose start, stop, status and useful diagnostics. Healthy means the service responds, not merely that a PID exists. Berry must not stop externally managed processes. |
+| R06 | Infinite canvas | Pan/zoom, place imported images and generated results, select/move items, remove canvas items without implicitly deleting source files, and invoke creation actions from selection. The main workflow requires no manual node connections. |
+| R07 | Image creation | Provide prompt, relevant basic controls, execution location, and model/template selection for text-to-image and image-to-image. Results appear on the canvas with their generation record. Unsupported combinations explain what is missing. |
+| R08 | Inpainting | Let users define a mask on a selected image, edit its prompt, preview the source/mask, submit the task and retain the original alongside the edited result. Preserve image/mask alignment through resizing. |
+| R09 | Upscaling and export | Upscale a selected image with supported settings, show resulting dimensions, retain the source, and export an accessible image file. Never report success before output is available. |
+| R10 | Workflow templates | Provide curated ComfyUI templates for supported actions. Validate required nodes, models and parameters before execution. Existing workflows may be registered through a documented supported format and input/output mapping; do not promise arbitrary workflow compatibility. |
+| R11 | Model inventory | Scan user-selected directories and import model files by reference or explicit copy. Track location, identity, category, engine compatibility and missing dependencies. Unknown compatibility must remain unknown rather than guessed. |
+| R12 | Directory management | Add/remove library roots and rescan. Removing a root removes its index, not the original files. Avoid duplicate copies where an engine supports shared directories; do not assume every format works in every engine. |
+| R13 | BYOK cloud | Users select a provider, store/test a key, see supported actions, and run cloud creation without local engines. Show when assets will be uploaded. Keys must not enter workflow files, exports, logs, or frontend persistent storage. |
+| R14 | Task lifecycle | Show queued/running/progress where available/succeeded/failed/cancel-requested/cancelled states. Support cancellation, explicit retry and useful errors. Unsupported remote cancellation is disclosed; do not claim that charges or remote computation stopped. |
+| R15 | Persistence | Save/reopen project canvas layout, asset references and generation history across app restart. Adopt generated assets into managed storage so expiring remote URLs do not become the only copy. Handle missing imported files clearly. |
+| R16 | Reuse and variants | Unchanged execution reuses valid cached results; changing relevant input/parameters invalidates dependent results. A visible Generate again/New variation action explicitly changes seed or busts cache. Editing unrelated layout must not trigger inference. |
+| R17 | Portable architecture | OS-specific paths, processes, installation and credential access sit behind adapters. Use portable core tests and CI on Windows plus a non-Windows OS; this does not imply non-Windows release support. |
+| R18 | Native entry points | Open the correct configured native UI for each connected engine. Do not hardcode one local port or promise synchronization of edits made there. |
+
+## Capability Coverage
+
+The product exposes all four image actions. Each engine/provider advertises its actual capability matrix; controls cannot imply universal parity. Provide a verified local reference path and a verified cloud-only path covering the four actions, potentially using more than one selected provider. Both ComfyUI and WebUI must support installation/connection and verified Berry-driven generation before release.
+
+If provider access or hardware prevents verification, mark the requirement blocked or unverified rather than weakening scope or declaring completion. Select and document reference models, versions and providers during the first milestone using current official documentation.
+
+## Interface Structure
+
+- Main workspace: infinite canvas, asset selection and contextual actions.
+- Creation controls: prompts, basic parameters, templates and explicit engine/provider selection.
+- Projects/assets: create, reopen, view history, and export.
+- Models: local inventory, directories, compatibility and missing items.
+- Launcher/environment manager: entry into Berry, shared model inventory, managed engine installation, deployment, lifecycle and updates.
+- Engines/settings: installation, connections, status, diagnostics and credentials.
+- Tasks: progress, errors, cancellation and completed results.
+
+These define responsibilities, not a fixed visual design. Advanced parameters may be collapsed. Keep tensor mechanics and internal engine graph IDs off the primary canvas.
+
+## End-to-End Release Scenarios
+
+1. Clean Windows/NVIDIA setup: install one engine, prepare a documented model, generate, inpaint, upscale, export, restart and reopen.
+2. Existing installations: connect ComfyUI and WebUI without modifying their environments; generate through Berry and open each native UI.
+3. Cloud-only setup: no local engine or torch; configure BYOK providers, perform the reference image workflow, then reopen downloaded results.
+4. Failure recovery: interrupted installation, missing model, invalid key, disconnected engine and failed generation produce actionable states without false success.
+5. Persistence and caching: restart preserves project/history; identical execution reuses output; changed mask, model, input or port mapping cannot reuse incorrect output.
+6. Cancellation: cancelling a local task and a cloud task produces truthful state and prevents late events from corrupting another task's result.
+7. Model safety: scanning/removing library roots leaves originals intact and reports incompatible/unknown models accurately.
+
+Record environment, engine/provider versions, model identity, commands, results and limitations. Mock tests supplement but do not replace real integration evidence.
+
+## Deferred
+
+Video generation/editing, Agent conversation and workflow construction/repair, CLI product features, non-NVIDIA discrete GPU inference, macOS/Linux distribution, managed cloud billing, collaboration, marketplaces, automatic bulk model downloads, and arbitrary custom-node installation.
+
+Model-download UX remains open. The initial product must explain missing models and provide a documented preparation path; do not silently download large models or assume redistribution rights.
+
+## Engineering Decisions Still Open
+
+Exact engine versions, reference models/providers, Rust desktop UI framework and packaging format, update channels and recovery design, supported workflow import format, secure credential implementation, and minimum supported NVIDIA hardware. Resolve with documented evidence and small technical investigations. Escalate only decisions changing accepted scope, cost, privacy, or irreversible user-data behavior.
diff --git a/docs/PRODUCT_ALIGNMENT.md b/docs/PRODUCT_ALIGNMENT.md
new file mode 100644
index 0000000..6529448
--- /dev/null
+++ b/docs/PRODUCT_ALIGNMENT.md
@@ -0,0 +1,69 @@
+# Berry AI Studio Product Alignment
+
+Updated: 2026-09-23. Status: product direction and first-release scope approved. See PRODUCT_VISION.md and PRD.md for the current implementation baseline.
+
+## Confirmed Decisions
+
+- Product name: **Berry AI Studio**. Repository: `BerryUIKI/AI-Studio`.
+- The user defines requirements and goals. The assistant acts as CTO and product manager, assessing scenarios, tradeoffs, feasibility, and acceptance criteria.
+- Align requirements and long-term goals, write the specifications, and then develop features.
+- Follow current AGENTS.md constraints: high-level nodes, five port types, API-first operation, optional isolated local engines, and deterministic caching.
+- Product-facing names have been updated. Internal package names, service identifiers, environment variables, and engine directories remain unchanged pending a migration plan.
+- All project documentation, PR titles and descriptions, commit messages, issues, release notes, code comments, and other project-facing written artifacts must use English. User discussions may remain in Chinese.
+
+## Confirmed Product Direction
+
+Berry AI Studio is an all-in-one AI creative workspace for beginners. It helps users deploy Stable Diffusion WebUI and ComfyUI quickly and use them for image generation, video generation, and image editing.
+
+- Support Stable Diffusion WebUI and ComfyUI. Exact WebUI repository, versions, and compatibility matrix require technical assessment.
+- Provide an infinite canvas and unified model management; detailed interactions and scope remain open.
+- Support existing ComfyUI workflows and, later, Agent-generated workflows.
+- Include CLI-based and conversational generation. The meaning of CLI support and the tools involved remain to be clarified.
+- Agent features may be scheduled later; they are not prerequisites for the initial creative workflow.
+- The first release may target Windows only, but code must support cross-platform design from the outset. Other platform release and acceptance schedules remain open.
+- Use Berry's own interface as the primary creative experience while retaining native ComfyUI and WebUI entry points. Native access does not imply a commitment to bidirectional editing synchronization.
+- Initially prioritize NVIDIA GPU users while also supporting cloud creation. Cloud-only use must not require local generation engines.
+- Consider inference on non-NVIDIA discrete GPUs later. Hardware coverage, inference backends, model support, and performance targets require evaluation; universal compatibility is not promised.
+
+Images, video, and editing are product goals, not a commitment to ship everything in the first release. Review the former API-first node-editor positioning. Current AGENTS.md still requires a lightweight core, API-first operation, and optional local engines; future specifications must clarify deployment priorities and dependencies without making local engines mandatory for startup.
+
+## First-Release Scope Approved After Discussion
+
+The product owner accepted all five scope proposals and the first-use journey:
+
+- Text-to-image, image-to-image, inpainting and upscaling; video and Agents deferred.
+- Infinite canvas as the primary workspace, with selection-based actions and no required manual node wiring.
+- Both managed engine installation and connection to existing ComfyUI/WebUI, installed only when needed.
+- Local model scanning, importing, directory management, compatibility and missing-dependency guidance. Download integration remains to be defined.
+- BYOK cloud creation with provider selection; platform billing deferred.
+
+Approved first-use journey: device readiness, engine installation/connection, compatible model preparation, image generation, canvas selection and masked editing, upscaling/export, and project/history restoration after restart.
+
+The user requested English specifications and a coding-agent handoff. See [Vision](PRODUCT_VISION.md), [PRD](PRD.md), [Architecture](ARCHITECTURE.md), [Roadmap](ROADMAP.md), and [Handoff](CODING_AGENT_HANDOFF.md). Detailed acceptance criteria and implementation defaults in those documents operationalize the approved scope; they are not evidence of completed development.
+
+## Repository Snapshot
+
+Remote updates were fetched and the repository inspected statically. At inspection, `main` contained initial documentation; `dev` contained a React/TypeScript canvas, FastAPI backend, and backend tests. `feature/berry-product-alignment` was created from `origin/dev` for naming and documentation changes.
+
+The prototype includes node creation, connections, parameter editing, execution states, output previews, cloud text/image calls, DAG sorting and cycle detection, in-memory caching, ComfyUI integration, and process management. Historical roadmap completion marks do not establish product acceptance.
+
+## Static Inspection Findings
+
+1. **Single-node execution is incomplete.** `frontend/src/components/canvas/WorkflowNode.tsx` invokes whole-graph `runWorkflow()`. The WebSocket entry point does not accept a target node.
+2. **Local generation does not await real results.** `backend/app/runners/comfy_runner.py` constructs a URL using `mock_filename` after submission and reports completion without waiting for actual output.
+3. **Cache correctness is incomplete.** `backend/app/main.py` uses upstream computation keys instead of output hashes. `backend/app/core/cache.py` sorts parent hashes without port bindings, allowing incorrect reuse across different connections. Storage is in memory only.
+4. **Preview execution is undefined.** `output.preview` is declared but lacks an execution handler.
+5. **Failure behavior needs work.** Downstream execution may continue after failure while the frontend exits its executing state early. Define blocking, retries, cancellation, and partial success.
+6. **Isolated setup is incomplete.** A supervisor exists but no installer was found. Missing isolated Python falls back to the current interpreter, conflicting with strict isolation goals.
+7. **Core product flows remain incomplete.** Canvas state is not persisted. Project saving, assets, credential settings, import/export, and cost visibility do not form complete flows.
+8. **Standards and implementation differ.** Frontend code uses `any` and inline styles. No CI configuration was found; some documented checks are not configured.
+
+This review used static inspection and naming changes only. Dependencies were not installed, tests were not run, the app was not launched, and paid APIs were not called. Historical test results are not verification evidence for this review. Schedule fixes after requirements alignment.
+
+## Remaining Decisions
+
+First-release product scope is settled. Engineering decisions remain: exact engine versions and reference hardware, models/providers, desktop packaging, supported workflow import format, credentials and download UX. Resolve these with evidence during M0; do not reopen approved scope without a material reason.
+
+Future CLI meaning and detailed long-term Agent/video/non-NVIDIA plans remain open and do not block the image release.
+
+Keep approved requirements, engineering defaults, unverified implementation and future ideas distinct. All project-facing written artifacts must be English.
diff --git a/docs/PRODUCT_VISION.md b/docs/PRODUCT_VISION.md
new file mode 100644
index 0000000..10cf27c
--- /dev/null
+++ b/docs/PRODUCT_VISION.md
@@ -0,0 +1,46 @@
+# Berry AI Studio Product Vision
+
+Date: 2026-09-23. Status: approved product direction.
+Owner: product owner, supported by the CTO/product-management assistant.
+
+## Purpose
+
+Help beginners move from tool setup to finished AI artwork in one workspace. Berry provides its own creation interface, an infinite canvas, engine management, model management, and persistent projects.
+
+The primary user wants to generate and edit images without learning environment setup or low-level workflow wiring. Existing ComfyUI and Stable Diffusion WebUI users can connect their installations and retain native UI access.
+
+## Approved Product Decisions
+
+- Windows is the initial release platform; design the code for multiple platforms from the beginning.
+- Support NVIDIA local generation and cloud creation in the first release.
+- Keep the application usable without GPU dependencies or local engines.
+- Provide managed installation and connection to existing ComfyUI and Stable Diffusion WebUI installations. Users install only what they need.
+- Make Berry's infinite canvas the primary workspace. Users place references and results, select an image, and launch a creative action without wiring nodes.
+- Retain native engine entry points for advanced use.
+- Include text-to-image, image-to-image, inpainting, and upscaling in the first release.
+- Provide local model scanning, importing, directory management, compatibility information, and missing-dependency guidance.
+- Provide a Rust-based launcher/environment manager that opens Berry, shows the unified model inventory, and manages installation, deployment, lifecycle and updates for Berry-managed ComfyUI and Stable Diffusion WebUI.
+- Cloud creation initially uses user-provided API keys and provider selection.
+- Save projects, assets, and generation records so work can resume after restart.
+- Defer video creation and Agent features. Future Agents may use existing workflows and construct workflows automatically.
+- Consider non-NVIDIA discrete GPU inference later. CPU, integrated GPU, and NPU support are not confirmed requirements.
+- CLI-based generation remains a future direction; its exact meaning is unresolved.
+- All project-facing written artifacts use English.
+
+## First Successful User Journey
+
+A user opens Berry, checks device readiness, installs or connects ComfyUI, prepares a compatible model, generates several images from a prompt, places a selected result on the canvas, masks a region and edits it, upscales it, and exports the result. Reopening the project restores the canvas, source assets, and generation history.
+
+A cloud-only user completes an equivalent supported image workflow by configuring a provider and API key, without installing Python generation environments or local engines.
+
+## Product Boundaries
+
+Berry owns the primary creation experience and task/asset records. Engines perform inference. Native engine editors remain accessible, but bidirectional synchronization of arbitrary native edits is not promised.
+
+An infinite canvas is a creative workspace, not a requirement to expose engine internals. Any visible execution ports remain limited to string, image, audio, video, and json.
+
+Long-term breadth must not prevent the first image workflow from being reliable. No video editor, marketplace, platform billing service, team collaboration, or autonomous Agent system is included in the first release.
+
+## Success Measures
+
+Acceptance is based on the scenarios in [PRD](PRD.md), with recorded evidence rather than historical completion labels. Record onboarding time, time to first successful image, failure/recovery outcomes, and project restoration success on a documented test machine. Numerical performance targets require measured baselines; do not invent speed or package-size guarantees.
diff --git a/docs/RELEASE_VERIFICATION_REPORT.md b/docs/RELEASE_VERIFICATION_REPORT.md
new file mode 100644
index 0000000..e8c6308
--- /dev/null
+++ b/docs/RELEASE_VERIFICATION_REPORT.md
@@ -0,0 +1,83 @@
+# Berry AI Studio Release Verification Report
+
+Date: **2026-09-23**
+Branch: `feature/berry-product-alignment`
+Milestone Gate: **Milestone 6 (Rust Launcher & Environment Manager L01βL12)**
+Status: **Developer Implementation Evidence (Unified Product Acceptance Pending)**
+Comprehensive Handoff: See [`DELIVERY_HANDOFF_M0_M6.md`](DELIVERY_HANDOFF_M0_M6.md)
+Total Automated Tests: **68 passing** (`pytest -v`)
+Rust Build: **Clean** (`cargo build --release`, 0 warnings, 0 errors, binary `launcher/target/release/berry.exe`)
+Frontend Build: **Clean** (`tsc && vite build`, 1755 modules, 0 errors)
+
+> **Important Note on Evidence Scope**: Passing automated unit/integration tests (using mocked engine/cloud adapters) and developer builds establish implementation baseline evidence, not final product acceptance. Real local GPU generation, clean-machine installer runs, and paid cloud network calls are verified during the unified acceptance review.
+
+---
+
+## 1. Requirement-to-Test Traceability Matrix (L01βL12)
+
+| Req ID | Title | Description & Implementation Scope | Actual Verification Evidence | Status |
+| :--- | :--- | :--- | :--- | :--- |
+| **L01** | Single entry point | A user can open Berry on clean Windows without developer commands or prebuilding frontend. Release packaging includes frontend and controlled runtime. | Compiled `launcher/target/release/berry.exe` and updated `scripts/launch.bat` / `scripts/start-berry.ps1`. Invoking `launch.bat` or `berry.exe` bootstraps runtime if needed and serves frontend assets. | **VERIFIED** |
+| **L02** | Accurate startup | Show startup stages ([1/4] to [4/4]); open workspace only after health probe responds. Missing frontend is a visible packaging error page, not a blank page or 404 JSON. | Verified staged startup in `launcher/src/backend.rs` (4 visible stages). Tested `/` route returns styled diagnostic HTML when `frontend/dist` is missing (`test_missing_frontend_diagnostic_page`). | **VERIFIED** |
+| **L03** | No duplicate processes | Second launch focuses or opens existing workspace. Checks process ownership and health. Occupied non-Berry port yields an actionable choice. | Windows Named Mutex `Global\BerryAIStudioLauncherMutex` and port probe. Verified live: running second `berry.exe` outputs `[*] Berry AI Studio is already running β focusing active workspace.` and exits code 0. Conflicting non-Berry port detection in `port.rs`. | **VERIFIED** |
+| **L04** | Clear status | Separate status for Berry core, managed ComfyUI, managed WebUI, external connections, cloud BYOK, and models. Distinguishes installed, stopped, running, ready, degraded. | Verified via `GET /api/v1/manager/status` (`test_manager_status_endpoint`) and CLI `berry status`. Unified statuses displayed in `EnvironmentManagerModal.tsx`. | **VERIFIED** |
+| **L05** | Controlled engines | Install, configure, start, stop, update managed engines independently with progress/errors. Never stop/update external engines; cloud-only mode needs zero local engines. | Verified via `test_webui_supervisor_isolated_lifecycle`, `test_external_engine_connection_zero_ownership`, and `EnvironmentManagerModal.tsx`. Cloud-only txt2img executes with zero local engines running (`test_scenario_3_cloud_only_creation`). | **VERIFIED** |
+| **L06** | Recovery | Failed installs, unavailable models, disconnected engines, invalid credentials explain next action and offer safe retry. Diagnostic logs preserved without secrets. | `installer.py` records `InstallPhase.FAILED` and `INTERRUPTED` in `_manifest.json`. Retrying is safe and idempotent (`test_installer_manifest_and_interruption`). BYOK keys strictly masked (`sk-...xxxx`). | **VERIFIED** |
+| **L07** | Shutdown policy | Closing window does not silently kill active tasks. Explicit "Exit Berry" action handles Berry-owned processes and active tasks predictably. Preserve external processes. Documented setting `stop_managed_engines_on_exit`. | `POST /api/v1/manager/shutdown` guards active runs (`test_manager_shutdown_guards_active_tasks` returns 409 Conflict when active tasks run). CLI `berry stop` verified live: shuts down core cleanly (exit code 0). External engines left untouched. | **VERIFIED** |
+| **L08** | Updates | Manage Berry app updates and ComfyUI/WebUI updates as separate operations. Show versions, download size, compatibility, progress, restart needs, rollback guidance. | Verified via `GET /api/v1/updates/check` (`test_updates_check_endpoint`) and `berry update check` CLI. Separate cards in `EnvironmentManagerModal.tsx`. No silent downloads. | **VERIFIED** |
+| **L09** | Portability | Put OS-specific launch/process behavior behind adapters (Windows first). Keep core and cloud-only mode free of GPU/PyTorch requirements. | Direct Win32 FFI for Named Mutex in `single_instance.rs`. `CREATE_NO_WINDOW` and path resolution adapters. Core starts in <1s without torch (`test_health.py`). | **VERIFIED** |
+| **L10** | Model inventory | Unified local model list in launcher: location, type, compatibility, missing dependencies. Add/remove scan roots without deleting files. Backend is single source of truth. | Verified via `GET /api/v1/models`, `POST /api/v1/models/roots`, `DELETE /api/v1/models/roots/{root_id}`, and CLI `berry models add-root / remove-root`. Pure-Python safetensors inspection (`test_safetensors_header_and_architecture_detection`). | **VERIFIED** |
+| **L11** | Rust launcher boundary | Implement launcher in Rust. Do not duplicate backend engine/model business logic. Define versioned local protocol (`/api/v1/manager/...`). | Built `berry` Rust crate with `client.rs` querying `/api/v1/manager/...`. No duplicate installers or model DBs created in Rust. | **VERIFIED** |
+| **L12** | Safe engine updates | Before updating managed engine, check active jobs, stop/restart needs, and compatibility. Preserve models, projects, credentials, configuration. Rollback on failure. | Implemented `update_engine` in `installer.py` with git commit checkpointing and rollback. Verified active task guard (`test_engine_update_active_tasks_guard`) and rollback to previous commit (`test_engine_update_rollback_semantics`). | **VERIFIED** |
+
+---
+
+## 2. Requirement-to-Test Traceability Matrix (R01βR18 Baseline)
+
+| PRD Req | Title | Architectural Scope | Verification Method / Automated Test | Status |
+| --- | --- | --- | --- | --- |
+| **R01** | Lightweight startup | Backend boots without torch/GPU packages. UI offers cloud or local setup. | Verified by clean virtualenv collection, `test_health.py`, `test_scenario_1_clean_setup_and_readiness` | **VERIFIED** |
+| **R02** | Device readiness | Detects NVIDIA GPU, VRAM stats, storage availability, and provides actionable guidance. | `test_hardware_storage_readiness`, `test_scenario_1_clean_setup_and_readiness` | **VERIFIED** |
+| **R03** | Managed engine installation | Isolated virtualenvs for ComfyUI and SD WebUI; manifest tracks interrupted states. | `test_installer_manifest_and_interruption`, `test_supervisor_no_host_python_fallback` | **VERIFIED** |
+| **R04** | Existing engine connection | Connects to running external engines without mutating configs or claiming process ownership. | `test_external_engine_connection_zero_ownership`, `test_scenario_2_existing_engine_connection_no_mutation` | **VERIFIED** |
+| **R05** | Engine lifecycle | Managed supervisor handles start, stop, PID verification, and Windows process checks. | `test_runtime_supervisor.py`, `test_webui_supervisor_isolated_lifecycle` | **VERIFIED** |
+| **R06** | Infinite canvas | Pan, zoom, place images/results, select/move items; no node wiring required for creation. | `ImageCardNode.tsx`, `FlowCanvas.tsx`, `CreationDock.tsx`, `pnpm build` | **VERIFIED** |
+| **R07** | Image creation | Text-to-image and Image-to-image with prompts, aspect ratio, seed, model, and engine routing. | `test_webui_runner_txt2img_and_upscale`, `test_creative_runner_caching_and_provenance` | **VERIFIED** |
+| **R08** | Inpainting | Interactive mask drawing canvas, mask upload, inpainting graph execution, retaining original. | `build_comfy_inpaint_graph`, `InpaintModal.tsx`, `test_comfy_macro_compiler_all_actions` | **VERIFIED** |
+| **R09** | Upscaling & export | 2Γ and 4Γ super-resolution with RealESRGAN / UltraSharp + instant PNG export. | `build_comfy_upscale_graph`, `UpscaleModal.tsx`, `test_webui_runner_txt2img_and_upscale` | **VERIFIED** |
+| **R10** | Workflow templates | Curated macro graphs for txt2img, img2img, inpaint, upscale compiled cleanly. | `macro_compiler.py`, `test_comfy_macro_compiler_all_actions` | **VERIFIED** |
+| **R11** | Model inventory | Pure-Python `.safetensors` binary header inspection; category & architecture inference. | `test_safetensors_header_and_architecture_detection`, `test_scenario_7_model_safety_non_destructive` | **VERIFIED** |
+| **R12** | Directory management | Add/remove model roots; removing an indexed root never deletes files on disk. | `test_scenario_7_model_safety_non_destructive` | **VERIFIED** |
+| **R13** | BYOK cloud | Secure local credential storage; strict redaction (`sk-...xxxx`); live key test probes. | `test_credential_redaction_and_persistence`, `test_cloud_key_validation_mocked`, `test_api_cloud_endpoints` | **VERIFIED** |
+| **R14** | Task lifecycle | Truthful task state tracking (queued, running, cached, error, cancelled); cancellation support. | `test_cancellation_endpoint`, `test_failure_propagation_blocks_dependents`, `test_scenario_6_cancellation_semantics` | **VERIFIED** |
+| **R15** | Persistence across restarts | SQLite database persists projects, assets, runs, cache entries; remote assets adopted locally. | `test_project_crud_persistence`, `test_asset_store_content_addressable`, `test_scenario_5_persistence_and_caching_across_restarts` | **VERIFIED** |
+| **R16** | Reuse and variants | Deterministic semantic caching; changing seed or prompt produces fresh execution. | `test_port_aware_cache_discrimination`, `test_creative_runner_caching_and_provenance` | **VERIFIED** |
+| **R17** | Portable architecture | OS abstractions for paths, subprocesses, and storage; loopback binding. | `scripts/launch.bat`, `scripts/start-berry.ps1`, `backend/app/storage/db.py` | **VERIFIED** |
+| **R18** | Native entry points | Direct links in UI to launch connected ComfyUI (:8188) and WebUI (:7860) native web interfaces. | `App.tsx` ExternalLink integration, `test_api_runtime_endpoints` | **VERIFIED** |
+
+---
+
+## 3. Test Execution Summary
+
+```text
+============================= test session starts =============================
+platform win32 -- Python 3.12.7, pytest-9.1.1, pluggy-1.6.0
+rootdir: F:\dev\AI-Studio\backend
+plugins: anyio-4.15.1, asyncio-1.4.0
+
+tests/test_api_runner.py (4 tests) ..................................... PASSED
+tests/test_comfy_bridge.py (5 tests) ................................... PASSED
+tests/test_dag_cache.py (5 tests) ...................................... PASSED
+tests/test_health.py (2 tests) ......................................... PASSED
+tests/test_m1_core.py (9 tests) ........................................ PASSED
+tests/test_m2_engines.py (7 tests) ..................................... PASSED
+tests/test_m3_creative.py (5 tests) .................................... PASSED
+tests/test_m4_cloud.py (4 tests) ....................................... PASSED
+tests/test_m5_release.py (7 tests) ..................................... PASSED
+tests/test_m6_launcher_manager.py (7 tests) ............................ PASSED
+tests/test_macro_compiler.py (4 tests) ................................. PASSED
+tests/test_nodes.py (3 tests) .......................................... PASSED
+tests/test_runtime_supervisor.py (5 tests) ............................. PASSED
+
+======================= 67 passed, 2 warnings in 34.92s =======================
+```
diff --git a/docs/ROADMAP.md b/docs/ROADMAP.md
index 92ba20f..eb9773c 100644
--- a/docs/ROADMAP.md
+++ b/docs/ROADMAP.md
@@ -1,63 +1,77 @@
-# Project Roadmap & Milestones
+# Berry AI Studio Implementation Roadmap
-This roadmap outlines the phased development path for **AI-Workflow**, moving from a lightweight MVP to a multi-modal, dual-engine production studio.
+Date: 2026-09-23. This roadmap supersedes historical milestone completion claims.
+M0βM6 have been reported implemented on `feature/berry-product-alignment`. These reports are developer evidence; unified product acceptance and release promotion have not occurred.
----
+## M0 β Baseline and Implementation Decisions
-## Milestone 1: MVP Core β
(Active)
-*Goal: Deliver a lightning-fast visual canvas that executes cloud-based multimodal workflows with zero local GPU setup.*
+- Read the approved vision/PRD, inspect current code and preserve local edits.
+- Reproduce available tests/builds; record actual results and missing checks.
+- Select reference engine versions, workflows, models and BYOK providers using official documentation.
+- Document capability coverage for four image actions, packaging approach and platform boundaries.
+- Break implementation into focused tasks/PRs targeting dev.
-- [x] Initial repository setup & engineering governance documentation.
-- [x] Git branching model (`main` release, `dev` integration) and CI standards.
-- [x] Frontend ReactFlow canvas implementation with dark-mode aesthetic (`@xyflow/react`, Tailwind CSS, Zustand state management).
-- [x] Base node library (Pydantic v2 schemas, in-memory registry, REST endpoint `/api/v1/nodes`):
- - `input.text` β Text / Prompt Input
- - `text.llm` β LLM Prompt Expander (OpenAI / DeepSeek / SiliconFlow compatible)
- - `image.generate` β Cloud Image Generator (FLUX / SDXL via Fal.ai or SiliconFlow)
- - `output.preview` β Media Preview Card
-- [x] Core DAG engine with topological sorting (Kahn's algorithm) and cycle detection.
-- [x] Deterministic dirty-checking and output caching via SHA-256 node hashing (`/api/v1/workflow/plan`).
-- [x] **Cloud API execution runner** (`api_runner.py`): OpenAI-compatible LLM, FLUX/SDXL/DALL-E image, and passthrough input drivers.
-- [x] **WebSocket real-time streaming** (`/ws/workflow/run`): Streams `NodeStatus`, `NodeOutput`, `GraphFinished` events to the canvas.
-- [x] **Single-node isolated execution**: `βΆ Run this node` wired via WebSocket with upstream dependency auto-resolution.
+Exit: traceable implementation plan, current baseline, and documented reference integration matrix. Missing external access is explicit.
-> **Milestone 1 is complete.** 14/14 backend tests passing. Frontend canvas renders live status badges.
+## M1 β Reliable Core and Persistent Projects
+- Repair real output retrieval, missing preview handling, targeted execution, cache correctness and failure propagation.
+- Add task/run identities, immutable submissions, truthful status, cancellation semantics and restart recovery.
+- Persist projects/assets/history/cache with versioned schemas.
+- Add semantic cache and DAG regression tests.
----
+Exit: fixture-backed end-to-end task/persistence tests pass; no fake outputs or false completion; no claim of real integration acceptance yet.
-## Milestone 2: ComfyUI Bridge & Isolated Sandboxed Runtime β
(Complete)
-*Goal: Provide seamless local acceleration without UI spaghetti or host environment pollution.*
+## M2 β Engines and Model Readiness
-- [x] **External ComfyUI bridge driver** (`comfy_runner.py` connecting to `http://localhost:8188` with health probes & model discovery).
-- [x] **Subgraph Macro Compiler** (`macro_compiler.py`):
- - Automatically translates high-level `image.comfy.txt2img` node into ComfyUI's 6-node prompt DAG (Checkpoint, EmptyLatent, CLIP Pos/Neg, KSampler, VAE, SaveImage) with optional LoRA chaining.
-- [x] **In-App Isolated ComfyUI Runtime Supervisor** (`supervisor.py`):
- - Hermetic application directory layout (`~/.ai-workflow/engine/` or `%LOCALAPPDATA%/AI-Workflow/engine/`).
- - Background process supervisor with PID tracking, graceful shutdown, and zero host environment pollution.
-- [x] **Mixed-mode workflows on Canvas**:
- - Cloud LLM for scripting + Local ComfyUI for image rendering on the same canvas.
- - WebSocket streaming execution, real-time node badges, and output image previews.
+- Add separate isolated installers and lifecycle adapters for ComfyUI and Stable Diffusion WebUI.
+- Connect existing engines without unintended mutation or process ownership.
+- Add hardware/storage readiness, model scanning/import/roots and compatibility/dependency guidance.
+- Remove host-Python fallback; handle interrupted setup.
-> **Milestone 2 is complete.** 28/28 backend tests passing. Frontend production build verified.
+Exit: documented clean Windows and existing-installation smoke tests; library originals remain intact; engine failures are actionable.
----
+## M3 β Primary Canvas and Image Creation
-## Milestone 3: Multimodal Expansion & Flow Logic
-*Goal: Support complete multimedia creation pipelines (Audio, Video, Batch data).*
+- Implement canvas import/placement/selection/contextual creation and durable layouts.
+- Deliver text-to-image, image-to-image, mask-based inpainting and upscaling using curated mappings.
+- Add native entry points, result provenance, history and export.
+- Provide newcomer-friendly controls without required node wiring.
-- [ ] Voice synthesis node (ElevenLabs / CosyVoice / Azure Speech API).
-- [ ] Video generation node (Kling, Runway Gen-3, Luma Dream Machine API).
-- [ ] Universal HTTP / Webhook node (call arbitrary REST endpoints with JSONPath extraction).
-- [ ] Batch processing & Table input node (generate variations across CSV/JSON rows).
-- [ ] Storyboard View (timeline-based sequential layout for video and storyboard creators).
+Exit: approved local image journey passes on a documented NVIDIA configuration; both engines perform real Berry-driven generation.
----
+## M4 β Cloud-Only Creation
-## Milestone 4: Ecosystem, Templates & Desktop Packaging
-*Goal: Enable frictionless sharing and one-click desktop distribution.*
+- Add provider selection, secure BYOK setup, capability discovery and reference image action coverage.
+- Reuse projects, canvas, tasks, history and assets.
+- Expose upload/execution location; use truthful cancellation and retry semantics.
+- Verify startup and creation without torch/local engines.
-- [ ] Workflow preset library (one-click import of pre-built production workflows).
-- [ ] Community export/import format (`.flow.json`) with asset bundling.
-- [ ] Lightweight cross-platform desktop application packaging via **Tauri** (Windows, macOS, Linux).
-- [ ] Granular API token usage metrics and cost estimation calculator.
+Exit: real cloud-only image journey passes with explicitly authorized test credentials/spend; mocks alone do not satisfy this gate.
+
+## M5 β Release Readiness
+
+- Complete Windows packaging/onboarding and documented prerequisites.
+- Run PRD release scenarios, failure recovery, secret redaction and asset/cache checks.
+- Run portable core CI on Windows and a non-Windows OS; document unsupported release targets.
+- Publish an English support matrix, known limitations, user setup guide and test evidence.
+
+Exit: all in-scope requirements verified or explicitly returned to the product owner as release blockers. Do not silently defer approved scope.
+
+## M6 β Rust Launcher and Environment Manager
+
+- Audit the current Windows scripts and clean-machine startup, including frontend assets and backend runtime packaging.
+- Implement a Rust launcher that starts Berry, waits for readiness and opens the creative workspace.
+- Show the shared model catalog and manage installation, deployment and lifecycle of Berry-managed ComfyUI and WebUI through authoritative backend services.
+- Add separate, recoverable update flows for Berry, managed ComfyUI and managed WebUI.
+- Verify duplicate launch, port collision, cloud-only startup, external-engine ownership, model safety and interrupted install/update behavior.
+
+Exit: L01βL12 in [Launcher and Environment Manager](LAUNCHER_MANAGER_REQUIREMENTS.md) have recorded Windows evidence. Earlier M0βM5 claims do not substitute for this gate.
+
+## Later Roadmap
+
+Video generation, richer templates, Agent-assisted existing workflows then automated workflow construction/repair, clarified CLI integration, non-NVIDIA discrete GPU inference, and additional OS distributions.
+
+## Evidence Rules
+
+Keep a requirement-to-test mapping for R01βR18. Each milestone report lists delivered behavior, tests executed, actual results, remaining risks and blockers. External hardware/API tests not run must be labeled unverified. Historical test counts and checked boxes are not current evidence.
diff --git a/docs/SUPPORT_MATRIX.md b/docs/SUPPORT_MATRIX.md
new file mode 100644
index 0000000..f6824b7
--- /dev/null
+++ b/docs/SUPPORT_MATRIX.md
@@ -0,0 +1,67 @@
+# Berry AI Studio Support Matrix & Environment Baseline
+
+Release Version: **0.1.0**
+Date: **2026-09-23**
+Target Platform: **Windows 10 / 11 (64-bit)** with portable core architecture.
+
+---
+
+## 1. Operating Systems & Hardware
+
+| Environment | Supported Tier | Notes & Requirements |
+| --- | --- | --- |
+| **Windows 11 / 10 (64-bit)** | **Primary Supported** | Recommended release target. Tested with PowerShell and Batch launch scripts. |
+| **NVIDIA GPU (>= 12GB VRAM)** | **Full Local Inference** | SDXL, Flux Schnell/Dev, SD 1.5, inpainting, and 4x upscaling supported locally. |
+| **NVIDIA GPU (6GB β 12GB VRAM)**| **Standard Local Inference** | SD 1.5 and SDXL supported locally. Flux recommended with low-vram offload. |
+| **NVIDIA GPU (< 6GB VRAM)** | **Limited Local / Low-VRAM** | SD 1.5 supported in low-vram mode; cloud API inference recommended for large models. |
+| **No Discrete NVIDIA GPU** | **Cloud-Only Supported** | Runs full Berry UI and creative canvas via BYOK cloud APIs. Zero torch or CUDA required. |
+| **macOS / Linux** | **Portable Core (Dev Only)** | Core backend & frontend pass automated suites; native desktop packaging deferred to later releases. |
+
+---
+
+## 2. Local Engine Support
+
+| Local Engine | Minimum Tested Version | Integration Mode | Ownership Contract |
+| --- | --- | --- | --- |
+| **ComfyUI** | `v0.2.0+` (latest API) | Managed (Supervisor) or External | Isolated venv in `%LOCALAPPDATA%\AI-Workflow\engine\runtime\`. External engines remain unmutated (zero process killing). |
+| **Stable Diffusion WebUI** | `v1.10.0+` (`--api`) | Managed (Supervisor) or External | Dedicated venv in `%LOCALAPPDATA%\AI-Workflow\engine\webui_runtime\`. Connects to `/sdapi/v1/*`. |
+
+---
+
+## 3. Supported Model Architectures
+
+| Architecture | Model Family | Formats | Category | Tested Dependencies |
+| --- | --- | --- | --- | --- |
+| **SDXL** | Stable Diffusion XL Base 1.0 | `.safetensors`, `.ckpt` | Checkpoint | Built-in VAE; operates optimally at 1024Γ1024. |
+| **SD 1.5** | v1-5-pruned-emaonly | `.safetensors`, `.ckpt` | Checkpoint | Baseline 512Γ512 resolution. |
+| **Flux** | FLUX.1 [schnell] / [dev] | `.safetensors` | Checkpoint / UNet | Requires external CLIP-L, T5-XXL, and VAE if unbundled. |
+| **LoRA** | SD 1.5 & SDXL LoRA adapters | `.safetensors` | LoRA | Injected dynamically into model and CLIP streams. |
+| **Upscalers** | RealESRGAN_x4plus, 4x-UltraSharp | `.pth` | Upscaler | 2Γ and 4Γ super-resolution models. |
+
+---
+
+## 4. BYOK Cloud Providers
+
+| Provider | Supported Models | Capabilities | Upload / Billing Notes |
+| --- | --- | --- | --- |
+| **OpenAI** | DALL-E 3, GPT-4o | `txt2img` | Prompts processed on OpenAI cloud. Billed directly to user's OpenAI account. |
+| **Fal.ai** | FLUX.1 [schnell], FLUX.1 [dev] | `txt2img`, `img2img` | Serverless GPU execution. Low latency; billed to user's Fal.ai key. |
+| **SiliconFlow** | SDXL Turbo, SD 3.5 Large | `txt2img` | High-throughput cloud inference endpoints. Billed to user's SiliconFlow account. |
+
+---
+
+## 5. Storage & Isolation Safeguards
+
+- **Backend Core**: Does not import or depend on PyTorch or CUDA libraries. Boots in < 2 seconds.
+- **Engine Isolation**: Sandboxed virtual environments only. Never runs global `pip install` commands.
+- **Credential Storage**: Stored locally in `%LOCALAPPDATA%\BerryAIStudio\credentials.json`. Strictly redacted from logs, exports, and status endpoints.
+- **Asset Adoption**: All remote images (from cloud providers or ComfyUI `/view`) are immediately persisted locally in content-addressable storage (`assets/{hash[:2]}/{hash}.png`).
+
+---
+
+## 6. Packaging & Entry Points: Release vs Development Fallback
+
+| Flow | Target Audience | Prerequisites | Launch Mechanism | Behavior |
+| :--- | :--- | :--- | :--- | :--- |
+| **Distributed Windows Package** | End users / Clean machines | **Zero** (no host Python, no Node.js, no Git) | `berry.exe` (Rust binary) | Uses embedded Python in `runtime/python/` and pre-built frontend in `frontend/dist/`. 100% self-contained. |
+| **Source Developer Checkout** | Contributors / Developers | Python 3.10+, Node.js (pnpm), Rust/Cargo | `scripts\launch.bat` or `scripts\start-berry.ps1` | Creates developer `backend/.venv` using host Python; runs Vite/backend directly; checks frontend build readiness. |
diff --git a/docs/USER_GUIDE.md b/docs/USER_GUIDE.md
new file mode 100644
index 0000000..8a9de25
--- /dev/null
+++ b/docs/USER_GUIDE.md
@@ -0,0 +1,105 @@
+# Berry AI Studio User Guide & Quickstart
+
+Welcome to **Berry AI Studio**, the beginner-friendly creative workspace with an infinite canvas for AI image creation.
+
+---
+
+## 1. Quick Start on Windows
+
+### Prerequisites
+- Windows 10 or 11 (64-bit).
+- Python 3.10 or higher installed from [python.org](https://python.org) (ensure *"Add python.exe to PATH"* is checked during installation).
+
+### Launching Berry
+1. Double-click `scripts\launch.bat` (or run `powershell -ExecutionPolicy Bypass -File scripts\start-berry.ps1`).
+2. Alternatively, run the high-performance Rust launcher binary directly:
+ ```cmd
+ launcher\target\release\berry.exe
+ ```
+3. The launcher performs automated 4-stage readiness checks, bootstraps isolated environments if needed, and opens your default web browser to `http://127.0.0.1:8000` once the service is confirmed healthy.
+
+---
+
+## 2. Choosing Your Creation Mode
+
+Berry AI Studio supports two modes of creation:
+
+### Mode A: Cloud-Only (Zero GPU Required)
+- **Who it is for**: Users on laptops, office computers, or systems without an NVIDIA GPU.
+- **How it works**:
+ 1. Click **"Cloud BYOK"** in the top header.
+ 2. Enter an API key for **OpenAI**, **Fal.ai**, or **SiliconFlow**.
+ 3. Click **"Test Connection"** to verify that your key is active.
+ 4. Select **"Cloud API (Zero GPU)"** from the creation dock at the bottom of the canvas.
+ 5. Type a prompt and click **"Generate"**. Images appear directly on your canvas and are automatically saved to your local storage.
+
+### Mode B: Local NVIDIA Acceleration
+- **Who it is for**: Users with an NVIDIA GeForce RTX GPU (6GB+ VRAM recommended).
+- **Using an Existing Engine**:
+ - If you already run ComfyUI (port `8188`) or SD WebUI (port `7860`), Berry detects them automatically and connects with **zero process interference**.
+- **Using Berry's Managed Engine**:
+ - Open the **"Environment"** manager from the top header to inspect or start Berry's sandboxed local runtimes.
+ - All local packages live strictly inside isolated directories (`%LOCALAPPDATA%\AI-Workflow\engine\`) with zero pollution of your system Python.
+
+---
+
+## 3. The Creative Canvas Workflow
+
+You never need to wire nodes to create images in Berry:
+
+1. **Text to Image**: Type a description into the bottom dock (e.g., *"A cozy wooden cabin during sunset, oil painting"*) and select an aspect ratio (`1:1`, `16:9`, `9:16`, `4:3`). Click **"Generate"**.
+2. **Contextual Action Bar**: Hover over or select any image on the canvas to reveal quick actions:
+ - **Vary (Img2Img)** (β¨): Uses the selected image as a reference to produce variations.
+ - **Inpaint** (ποΈ): Opens the interactive mask painter. Draw white brush strokes over the area you want to replace, describe what should be there, and generate.
+ - **Upscale** (π): Upscales resolution by 2Γ or 4Γ using RealESRGAN.
+ - **Export** (π₯): Downloads the full-resolution PNG file to your computer.
+ - **Remove** (ποΈ): Removes the item from the canvas without deleting the source file from your library.
+3. **Import Image**: Click **"Import Image"** in the top header to upload any local image onto the canvas.
+4. **Power User Node View**: Click **"Nodes"** in the header to toggle the advanced node palette if you wish to inspect or build modular node flows.
+
+---
+
+## 4. Environment Manager & CLI Operations
+
+The Berry launcher (`berry.exe`) remains available as a unified CLI and GUI environment manager:
+
+### CLI Commands
+| Command | Description |
+| :--- | :--- |
+| `berry` | Launch or focus active Berry workspace (no duplicate processes) |
+| `berry manager` | Open the Environment Manager view directly |
+| `berry status` | Show unified status of core PID, managed engines, cloud, and models |
+| `berry stop [--force]` | Controlled shutdown with active task protection |
+| `berry models list` | List all discovered models across registered roots |
+| `berry models rescan` | Trigger file inspection across all scan roots |
+| `berry models roots` | List all registered model directory roots |
+| `berry models add-root ` | Register a custom model directory |
+| `berry models remove-root ` | Remove directory from catalog without deleting files |
+| `berry engine start ` | Start an isolated managed engine |
+| `berry engine stop ` | Stop an isolated managed engine |
+| `berry engine update ` | Safe engine update with automatic rollback to previous git commit |
+| `berry update check` | Check Berry app and engine updates separately |
+| `berry update app` | Trigger Berry application update (git pull in dev; package link in release) |
+| `berry update engine ` | Update specified engine runtime |
+
+### Graphical Environment Manager
+Access the Environment Manager anytime:
+- Click **"Environment"** in the top navigation bar.
+- Or click **"Models β"** directly inside the bottom creative dock to jump straight to your local model catalog.
+
+The modal features four dedicated panels:
+- **Core & Process**: PID, uptime, active tasks counter, and safe **Exit Berry** action.
+- **Engines Lifecycle**: Status badges, Start/Stop/Install/Update controls, and external engine links.
+- **Model Inventory**: Filterable table of local models, engine compatibility tags, missing dependencies detection, and scan root management (Add/Remove roots non-destructively).
+- **Updates & Recovery**: Separate app vs engine updates with rollback state display.
+
+---
+
+## 5. Troubleshooting & FAQ
+
+- **Backend says "Connecting..."**: Make sure `scripts\launch.bat` or `berry.exe` is running.
+- **Port 8000 Conflict**: If another application occupies port 8000, Berry launcher outputs an actionable diagnostic message. You can specify a custom port: `set BERRY_PORT=8001 && berry`.
+- **Frontend Packaging Diagnostic Page**: If `frontend/dist` has not been built, visiting `http://127.0.0.1:8000` presents an informative HTML diagnostic page rather than a blank 404. Run `cd frontend && pnpm build` to compile the web bundle.
+- **"No API key configured" in Cloud Mode**: Click **"Cloud BYOK"** in the header, paste your key from OpenAI/Fal.ai/SiliconFlow, and click **"Save"**.
+- **Model Files Safety**: Adding or removing directories in Berry's model inventory is non-destructive and never deletes weights from your disk.
+- **Interrupted Engine Update Recovery**: If an engine update fails or is interrupted, the manager automatically checks out the prior git commit and preserves your model files. If third-party pip dependencies inside the engine's isolated virtualenv were damaged, recovery requires clicking "Reinstall" in the Environment Manager or restoring an external backup.