# App Vision Gaps To realize **Orchard Studio** (the "Deploy First, Talk Later" UI), `rdev` needs to evolve from a CLI/Script-driven engine into a **Reactive Platform API**. ## 1. The Interactivity Gap (State Management) * **Current State:** `tree-runner.sh` manages state in a local JSON file (`.checkpoints/`). The process is synchronous and blocking. * **Vision Requirement:** The UI needs to query "What is the status of the current build?" asynchronously. * **Gap:** We need to move the "Tree Runner" logic **into the `rdev-api`**. * *Missing:* `GET /projects/{id}/operations` (List active builds/deploys). * *Missing:* Database schema for `operations` (replacing local checkpoints). ## 2. The Feedback Loop Gap (Streaming) * **Current State:** We see logs in the terminal where `tree-runner` is running. * **Vision Requirement:** The user sees "Designing Schema..." -> "Running Tests..." in the web UI. * **Gap:** We need a **WebSocket / SSE** pipe from the Agent/CI -> `rdev-api` -> `orchard-studio`. * *Missing:* `rdev-api` endpoint for agents to push progress updates (`POST /operations/{id}/log`). * *Missing:* Frontend subscription endpoint (`GET /operations/{id}/stream`). ## 3. The "Draft Mode" Gap (Blueprint API) * **Current State:** We define features by immediately calling `/sdlc/features` and `POST /builds`. It's "fire and forget". * **Vision Requirement:** The user and Architect iterate on a plan *before* commitment. * **Gap:** We need a staging area for requirements. * *Missing:* `POST /projects/{id}/blueprint/draft`. * *Missing:* `POST /projects/{id}/blueprint/commit` (Triggers the build). ## 4. The Template Gap (Genesis) * **Current State:** We have a few raw templates (`go-api`, `astro-landing`). * **Vision Requirement:** Rich "Seeds" (SaaS, Social, E-comm). * **Gap:** Our templates are too primitive. * *Missing:* A "Meta-Template" system that can combine `go-api` + `auth-pkg` + `postgres` + `react-admin` into a single "SaaS Starter" deployable. ## 5. The "Architect Persona" Gap * **Current State:** We prompt Claude with `/implement-feature`. * **Vision Requirement:** An agent that *asks clarifying questions* instead of just coding. * **Gap:** We lack the "Consultant" system prompt. * *Missing:* `.claude/agents/architect.md`. * *Missing:* A workflow where the API returns a *Question* to the user instead of a *Result*. ## Summary of Work 1. **Port Tree Runner to Go:** Move orchestration logic into `rdev-api`. 2. **Build Event Bus:** Implement SSE/Websockets for real-time logs. 3. **Define Blueprint Resource:** Create DB tables for "Draft Features". 4. **Create Architect Agent:** Define the persona that interviews users.