Add Easy Mode step to project wizard

Task 13448 · Queued · Coder · created · updated

Part of epic "Build sponsored Easy Mode app hosting" (PRD task 13412, architecture task 13413). Architecture child **C7 Wizard**. Builds on C5 (`easy_mode.assign_project`, shared node), C6 (`GET /api/hosted-apps/slug`, `POST /api/hosted-apps`) and C8 (one-repo runner tokens). Owns the epic's end-to-end oracles. ## Original requirement (verbatim) > 5. Project wizard: when the org has Easy Mode, the first step asks "Easy Mode" or "Advanced Mode". Easy Mode asks only for a name (and a starter template if more than one): no repository step, no node step. Jaah creates the repo from the template, places the project automatically and provisions its hosted app. Advanced Mode is today's wizard unchanged. Orgs without Easy Mode see today's wizard with no mode question. Epic Done-means (verbatim): "With Easy Mode OFF for an org (the default), the project wizard is unchanged and no hosting or Easy Mode UI shows." / "A member of that org creates a project choosing Easy Mode, entering only a name: no repo or node question is shown, the project is placed on a shared node, a Jaah-owned repo exists from the template, and a push to its main branch publishes the app at `<slug>.apps.jaah.ai`, front-end and `/api` both answering." / "A coder task in that project runs on the shared node using the sponsored AI credit." / "Advanced Mode creates a project exactly as today's wizard does." PRD D10: two templates (Node / Python) — the wizard asks name and template. A4: slug from the name with a numeric suffix for taken/reserved names, shown before create. ## Approach (settled by the Architect) In `apps/web/src/pages/ProjectCreateWizard.tsx` (today steps `repo|name|nodes|review`, `POST /api/git-repos` then `POST /api/projects`): add a Mode step ONLY when the org's `easy_mode` switch is on. Easy path: Name + Template (Node / Python, readable labels) + address preview from `GET /api/hosted-apps/slug?name=` → `POST /api/hosted-apps` → land on the new project (status "Setting up"). Advanced path = today's steps untouched (no code path change). Off = today's wizard with no mode question. Readable errors for the cap refusal and "App hosting isn't set up.". Copy per `docs/standards/ui-copy-standards.md`; layout per `docs/standards/ui-style-guide.md`; phone width. No schema migration. ## Acceptance criteria (verbatim, BA) - **AC-8 Easy Mode wizard.** With Easy Mode ON, New project's first step asks "Easy Mode" or "Advanced Mode". Easy Mode then asks only Name and Template (Node / Python), shows the address the app will get, and creates; no Repository and no Nodes step. → verify: dev, as member, walk the wizard; screenshot each step; observe exactly Mode → Name+Template (→ Review if kept) and no repo/node control. - **AC-22 Advanced unchanged.** Advanced Mode runs today's wizard step-for-step and creates the same project and repo as today. → verify: dev, create with Advanced Mode and compare the project's fields/assignments to one made on an org without Easy Mode; the existing wizard e2e/unit tests pass unchanged. - **AC-1 Off is invisible** (UI). With `easy_mode` OFF (the default on every plan and `(default)`), a tenant member opening New project sees today's wizard (Repository → Name → Nodes → Review) with no mode question, and no Apps/hosting/Easy Mode text on project, org or billing pages … → verify: on dev, as a member of an org without the override, open New project and the project page; observe no Easy Mode UI. - **AC-3b Off again** (UI). Turning Easy Mode off for the org removes the Mode question from the wizard and refuses new Easy Mode projects; existing projects, apps, the shared node, Jaah AI mode and remaining credit are unchanged. → verify: dev, turn off; observe wizard as AC-1; existing app URL still answers; node and wallet unchanged. - **AC-6 Placement** (end to end). Every Easy Mode project of the org is assigned to the org's shared node with no node question; coder tasks in it dispatch there. → verify: dev, create an Easy Mode project, open its Nodes/assignment view, observe the org's shared node; start a task, observe the session on that node. - **AC-7 Re-placement** (end to end, with projects). Disabling the org's shared node (or its host) results within one placement pass in a new shared node for the org on another pool host with room, with the Easy Mode projects re-assigned … → verify: dev, operator disables the node; observe a new node and the reassignment within the pass interval. - **AC-20 Read-only console** (end to end). A client member opening the console/session terminal of a session on the org's shared node gets a view-only terminal (keystrokes not delivered); an operator keeps the full terminal. → verify: dev, as client member open a running session's console, type, observe no input reaches it and a "read-only" indication; as operator, observe two-way. - **AC-14 Sponsored AI runs** (end to end). A coder task in the Easy Mode project runs on the org's shared node on the Jaah account, and the wallet balance drops by its charge, drawing on the sponsored credit; with the balance at the floor, the next task is held with the existing "balance" reason and the client sees how to top up. → verify: dev, start a coder task; observe the session's node = shared node and a `spend` ledger entry; operator debits to the floor, observe the hold. All UI oracles on the dev console in a browser; copy per `docs/standards/ui-copy-standards.md`; phone width passes; fails if text truncated, overlapping, or a raw slug/id/enum shows instead of a readable label. Credentials & reach: - AC-1…AC-9, AC-14…AC-20, AC-22, AC-23, AC-3b (dev UI) — `me/jaah/debug/main/operator-login` (operator; switches into the test tenant, covers member role) on `app.dev.jaah.ai`; member view also via `org/console/dev-tpl-member-login` — verified — both on roster, `credential_get` ok; operator login `POST /api/auth/login` 200 from this node. - AC-5 / AC-6 / AC-7 shared pool — dev operator API `GET /api/vnode-hosts` — verified — `pool-c-host` shared_capacity 4. - AC-4, AC-14 Jaah AI on dev — dev platform Bedrock settings — verified — `platform_bedrock_source = task_role` on dev and prod (values not recorded). - AC-14 runner tokens (C8) — GitHub App "Jaah Easy Mode runners" + its `github_app_key` credential — deferred — created by the operator during C8's run. - Lambda concurrency 1,000 — AWS approval — deferred; the publish half of the end-to-end flow waits for it. - C1 env-root grant — main deferred — promotion to `master` is a human gate, so live-console (`<slug>.apps.jaah.ai`) Easy Mode waits for it; all ACs run on dev (`<slug>.dev.apps.jaah.ai`). Out of scope: a separate GitHub org; a separate app apex domain; custom domains, registrar purchase and paid hosting after sponsorship (draft task 10233 stays as that later work); the always-on shared-box hosting tier. Do NOT change the Advanced Mode wizard's steps, fields or behaviour, nor the wizard for orgs without Easy Mode; do NOT create the repo under the member's GitHub (Jaah's org only, via C6); do NOT add a node or repository control to the Easy path; do NOT build the app panel (C9). Done means: - AC-8 — dev screenshots (desktop + phone) of Mode → Name+Template (+ address preview) → created; no repo/node control anywhere on the Easy path. - AC-22 / AC-1 — existing wizard unit/e2e tests pass unchanged (cite); dev: Advanced create matches a project made on an org without Easy Mode field-for-field; an org with Easy Mode off sees today's four steps and no Easy Mode text on project, org or billing pages. - AC-3b — dev: after the operator turns Easy Mode off, the Mode question is gone, `POST /api/hosted-apps` refused, the existing app URL still answers, node and wallet unchanged. - Epic end-to-end — dev, as member: Easy create with only a name (+ template) → project on the org's shared node (AC-6 Nodes view), Jaah-owned repo from the template, a push to `main` publishes `https://<slug>.dev.apps.jaah.ai/` (200 HTML) and `/api/health` (200). - AC-14 / AC-6 — dev: a coder task in that project runs on the shared node, pushes its branch with the one-repo token, and the wallet shows a `spend` entry drawn from the sponsored credit; after the operator debits to the floor the next task is held with the balance reason and the tenant sees how to top up. - AC-20 — dev: as member the session console is view-only with a read-only indication; as operator two-way. - AC-7 — dev: operator disables the shared node; within one pass a new node exists and the Easy Mode project is re-assigned to it (cite before/after). - `./dc check quick` green.

Activity

  • Draft
  • Ready