docs(path-b): mark weeks 1-3 shipped; preview routing scoped
- AI_PATH_B_EXECUTION_PLAN.md: Status changed from "proposed" to
"week 1 shipped", weeks 1-3 checkboxes flipped to ✅ for the parts
that landed in vibn-frontend@4ba9407 and @41d4d37. Lists what's
still manual (DNS wildcard, Coolify host image build, Traefik cert).
- vibn-dev/PREVIEWS.md: Architecture for *.preview.vibnai.com
routing, the deferred Coolify-compose-hot-update piece, and an
HMR/websocket troubleshooting checklist.
- vibn-dev/setup-on-coolify.sh: One-shot script to build
vibn-dev:latest on the Coolify host (referenced by the compose
template's pull_policy: never).
Made-with: Cursor
This commit is contained in:
@@ -9,7 +9,7 @@
|
||||
> state) and [`AI_CAPABILITIES_ROADMAP.md`](./AI_CAPABILITIES_ROADMAP.md)
|
||||
> (everything else).
|
||||
>
|
||||
> **Status:** proposed. Not started. Decision document.
|
||||
> **Status:** week 1 shipped (2026-04-28). Tool surface is live in code; image build on Coolify host + DNS wildcard + Traefik wiring still pending.
|
||||
>
|
||||
> **Why this exists:** today's AI loop is *3–7 min to first preview, 2–4
|
||||
> min per iteration*, because every change goes through a Coolify nixpacks
|
||||
@@ -156,42 +156,45 @@ becomes:
|
||||
|
||||
## 5. Week-by-week execution
|
||||
|
||||
### Week 1 — Foundations (dev container + shell)
|
||||
### Week 1 — Foundations (dev container + shell) — **SHIPPED 2026-04-28**
|
||||
|
||||
**Goal:** AI can clone a repo, install deps, run a script.
|
||||
|
||||
- [ ] Build `ghcr.io/vibnai/vibn-dev:latest` Docker image (Ubuntu 24.04 + toolchains). Push to a registry the Coolify host can pull from.
|
||||
- [ ] Add `lib/dev-container.ts`: helpers to mint, locate, ensure-running, suspend, resume the per-project `vibn-dev` Coolify service.
|
||||
- [ ] Add MCP tool `dev_container.ensure { projectId }` — internal/auto, spins up the container if not present. Returns its UUID + status.
|
||||
- [ ] Add MCP tools: `shell.exec`, `fs.read`, `fs.write`, `fs.list`, `fs.delete`, `fs.glob`, `fs.grep`. All proxy through Coolify's exec API to the dev container.
|
||||
- [ ] Smoke test (`scripts/smoke-path-b.ts`): boots a dev container, clones a Gitea repo, runs `npm init -y && npm install lodash`, reads `package.json`, succeeds.
|
||||
- [ ] Update `vibn-tools.ts` and ship a chat UI that streams `shell.exec` stdout to the user as it happens (existing terminal-style component if we have one, or a new one).
|
||||
- [x] `vibn-dev/Dockerfile` (Ubuntu 24.04 + git + ripgrep + python3 + mise lazy toolchains). `setup-on-coolify.sh` builds it on the host; compose uses `pull_policy: never` to avoid registry round-trips.
|
||||
- [x] `lib/dev-container.ts`: ensure / exec / suspend / resume helpers. Backed by `fs_project_dev_containers` (auto-created).
|
||||
- [x] `devcontainer.{ensure,status,suspend}` MCP tools.
|
||||
- [x] `shell.exec` + `fs.{read,write,edit,list,delete,glob,grep}` MCP tools — all enforce per-workspace tenancy via `fs_projects` ownership lookup, all locked to `/workspace`.
|
||||
- [x] Network isolation: per-project `vibn-dev-net-${slug}` bridge — no route to `vibn-postgres` / `vibn-frontend`.
|
||||
- [x] Kill switch: `/api/admin/path-b/{disable,enable}` flips a feature flag in <10s.
|
||||
- [x] `vibn-tools.ts`: 11 new Gemini tool defs, smoke test passes (63 tools accepted).
|
||||
- [x] System prompt rewritten — shell-first guidance, `gitea_file_*` flagged for hard removal in week 3.
|
||||
|
||||
**Exit criteria:** an internal user can chat *"clone the express hello-world repo and run it"* and see the output stream live.
|
||||
**Still pending for week 1 exit:** build the image on the live Coolify host (`ssh + setup-on-coolify.sh`), end-to-end verify `devcontainer.ensure → shell.exec ls` against a real project once the frontend deploy lands.
|
||||
|
||||
### Week 2 — Preview URLs + iteration
|
||||
### Week 2 — Preview URLs + iteration — **PARTIALLY SHIPPED 2026-04-28**
|
||||
|
||||
**Goal:** AI starts a dev server, user clicks a preview URL, sees their app.
|
||||
|
||||
- [ ] Traefik wildcard rule on the Coolify host: `*.preview.vibnai.com` → terminates TLS, forwards to dev container based on subdomain (`preview-{ws}-{project}.vibnai.com` → `vibn-dev` of that project's Coolify project).
|
||||
- [ ] Add MCP tools: `dev_server.start`, `dev_server.stop`, `dev_server.list`. Implementation: starts the process inside the dev container under a small supervisor (e.g. `tini` / `supervisord`), tracks PID/port, registers a Traefik label on the dev container.
|
||||
- [ ] Add `fs.edit` (Aider-format search/replace, with explicit error when `oldString` not found / ambiguous).
|
||||
- [ ] Per-workspace plan-tier resource caps on the dev container (free tier: 1 GB / 0.5 CPU; paid: 4 GB / 2 CPU).
|
||||
- [ ] System prompt rewrite (see §4). Update the AI's deploy recipes to start with `shell.exec` and `dev_server.start` rather than `apps_create`.
|
||||
- [ ] DNS: `*.preview.vibnai.com → coolify-host-ip` in OpenSRS. **Manual step, not yet done.**
|
||||
- [ ] Traefik wildcard cert via DNS-01 against OpenSRS. **Config staged in `vibn-dev/PREVIEWS.md`, not yet applied to live Traefik.**
|
||||
- [x] `dev_server.{start,stop,list,logs}` MCP tools. Process is `nohup`'d inside the container, PID/port/preview-url tracked in `fs_dev_servers`. Server is reachable from inside the container today; Traefik label injection is **deferred** (see PREVIEWS.md for the recommended pre-allocated-port-range approach).
|
||||
- [x] `fs.edit` Aider-style (HTTP 404 if missing, 409 if ambiguous, success returns replacement count).
|
||||
- [x] Per-container CPU/RAM caps: 1 vCPU / 1 GiB by default. Tier scaling via env var.
|
||||
- [x] System prompt rewritten with shell-first recipe.
|
||||
|
||||
**Exit criteria:** the marketplace scenario from §1 works end-to-end up through "user makes 5 styling changes in 3 minutes."
|
||||
**Exit criteria progress:** end-to-end works inside the container; preview URL routing is the last mile.
|
||||
|
||||
### Week 3 — Ship-it path + cleanup
|
||||
### Week 3 — Ship-it path + cleanup — **PARTIALLY SHIPPED 2026-04-28**
|
||||
|
||||
**Goal:** the dev container's working tree graduates to production.
|
||||
|
||||
- [ ] Add `ship` tool: runs `git add . && git commit -m {msg} && git push` inside the container, then either calls `apps_deploy { uuid }` (if a prod app exists) or `apps_create { projectId, repo }` (first ship).
|
||||
- [ ] Auto-link the prod app to `fs_project_resources` so the existing project-isolation accounting stays consistent.
|
||||
- [ ] Idle-suspend logic: cron job every 5 min checks last `shell.exec` timestamp per dev container; suspends after 30 min idle. Auto-resume on next call.
|
||||
- [ ] Deprecation pass: mark `gitea_file_*` tools as deprecated in `vibn-tools.ts` (keep working, add a banner in their description).
|
||||
- [ ] Update `AI_CAPABILITIES.md` to reflect the new architecture and tool surface.
|
||||
- [x] `ship` MCP tool: `git init` (if needed) → `git add -A && git commit && git push` to Gitea using the workspace bot PAT, then triggers `deployApplication` if the project has a linked Coolify app.
|
||||
- [x] Auto-push autosave to `vibn-autosave/main` branch (force-push, throttled to once per 5 min). Endpoint: `POST /api/admin/path-b/autosave { projectId | sweep:true }`.
|
||||
- [x] Idle-suspend sweep: `POST /api/admin/path-b/idle-sweep[?minutes=30]`. Wire to a 5-min cron once we trust the suspend path.
|
||||
- [ ] Hard-remove `gitea_file_*` from the AI tool list (keep REST endpoints alive 30 days). **Deferred to next week so we can A/B the new tools first.**
|
||||
- [ ] Update `AI_CAPABILITIES.md`. **Deferred — will rewrite once eval data is in.**
|
||||
|
||||
**Exit criteria:** end-to-end clean run: user prompt → AI scaffolds in dev container → user iterates → user says "ship" → app live on real domain. Total time logged.
|
||||
**Exit criteria progress:** ship loop is functionally complete. Outstanding: full prod test against a real project, gitea_file_* hard-remove, docs refresh.
|
||||
|
||||
### Week 4 — Eval, polish, IDE drop-in
|
||||
|
||||
|
||||
Reference in New Issue
Block a user