# Veect — v1 Technical Specification · rev 1.2.2 _Audience: a coding agent implementing v1. Status: implementation-ready._ _rev 1.2 (2026-07-10, founder direction): **distribution pivot** — v1 is a **standalone application** (desktop, bundled runtime) with an **additional Docker image**; repositories connect **remote-first** (GitHub / GitLab / Bitbucket / any git URL) with **local checkout** as the alternative mode; config becomes **`veect.config.json`** (machine-writable); **publishing branches to origin is now in scope**; worktrees & all Veect state move **outside the user's repo** into app-managed workspaces; the npm-installed-in-repo package (Storybook-style, rev 1.1 §1) is **deferred to a later distribution**._ _rev 1.2.1 (same day, post adversarial review of the new layers): `node` PATH shim + Electron ABI policy (the bundled-runtime promise made real) · workspace-trust model · committer identity · config carry rule · device-flow org-wall handling · SSH BatchMode/known-hosts · exact credential-helper mechanics · LFS/submodule policy · CoW worktree installs · Docker `safe.directory` + headless secret store · env manager pulled into M3 · M0 materialization contradiction resolved._ _rev 1.1 foundations retained: render-path invariant + parity check · split lazy `__veect__` registries, never committed · dedicated-origin adapters + Host validation · checkpoint transaction · docgen-at-scale rules · milestone discipline._ _Companions: `design-brief-veect.md` (UI/UX) · `design-app-prd.md` (product scope) · `company-context.md` (strategy)._ _Locked: **AI compose in v1 (Anthropic; key via app settings or env)** · **any React+TS repo, full Next.js first-class** · **SQLite locally + canonical design JSON committed in the branch** · **name: Veect / npm `veect` / scope `@veectjs/*`**._ --- ## 1. What we are building Veect is a **standalone design application that connects to a repository** — remote or local — and turns it into a design surface: ``` 1. Download Veect (macOS / Windows / Linux) — no system Node required 2. Connect a repository: · GitHub (device-flow sign-in) → pick a repo — the default path · any git URL (HTTPS + token / SSH via agent) — GitLab, Bitbucket, self-hosted · or a local folder — an existing checkout 3. Veect clones (remote) or attaches (local), installs dependencies with its bundled runtime, reads veect.config.json — or walks the user through picking the component folders visually and writes it 4. The designer composes on a canvas of the repo's REAL components; each design project is a git worktree + branch (veect/) 5. Checkpoint → real TSX + design.veect.json committed → Publish pushes veect/ to origin → the team reviews an ordinary PR ``` A **Docker image** ships alongside: the same server, headless, for a team box, self-hosting, or CI (`docker run veect export`). The npm-in-repo package (`npm i -D veect`, Storybook-style) is a **later distribution** on the same core (§17). **Purpose (founder's words):** bring designers closer to developers so they work on prototypes directly on the codebase, with already-defined components and all the context the codebase actually holds. **What v1 must prove:** a designer with _no development environment_ connects a repo, and in one sitting produces an on-brand, real-code prototype on a branch that survives an engineer's review. ### The core invariant (unchanged, stated honestly) > **Same components, same toolchain.** Every component instance on the canvas is the repo's own module compiled by the repo's own framework toolchain. Veect never re-implements or approximates a component. Enforced, not assumed: the doc renderer styles frames with **inline styles only** (never runtime-assembled Tailwind class strings); generated TSX uses Tailwind classes (Veect registers `output.dir` in the host's Tailwind content/`@source` as part of the first published branch); **checkpoint parity check** — the generated file is rendered in the adapter and perceptually diffed against the doc-rendered canvas (threshold ~1%); parity failure blocks the checkpoint with a specific error. ### Non-goals for v1 Multi-user realtime editing · cloud sync (Docker image is self-hosted, single-team-token) · non-React frameworks · Figma import · vector tools · editing arbitrary existing app pages (Onlook's lane) · token write-back · Storybook interop · npm-in-repo distribution (deferred, not dead) · **non-git sources** · **yarn PnP** (doctor fails with message; bun best-effort). ### Prototype inheritance (rev 1.2.2 — the editor exists) The founder's interactive prototype + codebase (`veect-design-spec-current.md`; React 18 · TS strict · Tailwind · **React Flow board substrate** · **zustand** as the in-session store) **seeds `packages/editor`** and _amends this spec_ where it went further: - **Multi-view frames ship in v1** (supersedes "desktop breakpoint only"): frames carry `views/view` (desktop = frame `w` · tablet 768 · mobile 390), rendered as side-by-side **view clusters** of the same tree; the **active view** drives preview, code, and export width. Adapters render each enabled view's width; the doc model's `FrameNode` gains `views: View[]` + `view: ViewId`. - **Code panel edit-mode ships** (supersedes rev 1.1 "read-only"): the codegen grammar is **bidirectional** — the generated TSX parses back with line-referenced errors. The inverse parser is part of `packages/codegen` and must stay in lockstep with the emitter (golden tests run both directions). - **AI UX inherited:** model picker (Haiku default / Sonnet option — a per-request override of `ai.model`), image attachments in context, scoped edits (amber ring + scope chip), dashed-ghost staging, refusal protocol. The prototype's offline heuristics are retained as the **record/replay eval harness + Playground demo mode**. - **Vocabulary:** top-bar "Export" becomes **Checkpoint** (commit) + **Publish** (push + PR link); the export-zip dialog survives only in Playground/Docker-CI contexts. - **Integration seams:** the codebase's declared seams map 1:1 onto this spec's subsystems (`engine/ai.ts#complete` → §14 AI engine; export zip → §10 checkpoint/publish; placeholder projects → §2/§11 workspaces; auth stub → §6 connections; zustand-only persistence → §11 SQLite/JSON write-through). Wiring table: `veect-ui-gap-spec.md` §4; remaining UI surface: same doc §2–§3. --- ## 2. Architecture overview ``` Veect app (desktop shell; bundled Node runtime — ELECTRON_RUN_AS_NODE for all child processes) │ ├── Editor UI (the web editor, in the shell's window) ├── Server core (Hono on 127.0.0.1) ──────────────── identical binary logic in the Docker image │ ├── Connections (GitHub device flow · git URL+PAT · SSH-via-agent · local folder) │ ├── Discovery engine (components + tokens, shared TS program, watch) │ ├── Doc engine (model, validation, revisions) │ ├── Codegen (doc → TSX, prettier, parity check) │ ├── Git engine (clone/fetch/worktrees/checkpoint/publish — system git, execa) │ └── AI engine (Anthropic, constrained to registry) │ ├── App data (per-OS app dir, e.g. ~/Library/Application Support/Veect) │ └── workspaces/github.com/acme/shop/ │ ├── clone/ ← managed clone (remote mode) — partial clone, │ │ │ .git/info/exclude hides nothing: repo stays PRISTINE │ │ └── veect.config.json ← if committed in the repo; else workspace-local (below) │ ├── worktrees/checkout-flow/ ← git worktree, branch veect/checkout-flow │ │ └── /checkout-page/{design.veect.json, CheckoutPage.tsx} │ ├── veect.db ← SQLite (projects, revisions, AI runs, ports) │ ├── config.json ← workspace-local config until committed to the repo │ └── env.enc ← env values, OS-encrypted (never in the clone/repo) │ └── Preview adapters (dedicated port = dedicated origin each; common runtime protocol) ├── vite-react: embedded Vite rooted at the worktree (cwd pinned to worktree) └── nextjs: managed `next dev` of the worktree + materialized /__veect__ route └── Editor canvas