Skip to content

Control plane & studio ​

Path: apps/control-plane
Role: Platform API (Hono) + React studio SPA. Owns identity and the app catalog.

Placement follows the database (#668, merged)

apps/control-plane/wrangler.jsonc pins the Worker's placement next to the database, because permission reads go uncached through Hyperdrive and one request makes many of them in sequence. As of #668 (merged 2026-10-08 19:10 IDT, merge 079b27d6) it is aws:us-east-2 for Neon; it was aws:us-east-1 next to Aurora, and even that hop timed out the dev-preview e2e step. Prod's placement moves with prod's database flip. Rule: if the database moves region, move this pin with it. Details in the Neon plan.

Responsibilities ​

  • Tenants, users, memberships, workspaces, apps
  • Session login (Auth0 OIDC — plain /authorize + token exchange; see ADR auth.md)
  • Capability token minting (POST /tokens) with tenant-checked scopes
  • Access policy CRUD and sync toward edge caches where applicable
  • Usage / billing ingest from conductor
  • Studio UI (landing, /apps home prompt, chat, preview iframe, Code tab, composer)

Usage & deployment receipts (#441, merged) ​

Part of turn recovery (closes #404). Conductor may retry /ingest/turn and /ingest/deployment after a lost response; the control plane must record each logical event once.

PieceBehaviour
SchemasShared wire/decode shapes in @brilliant/service-contracts/ingest (usage_event_id / deployment_event_id, max 256 chars). usage_event_id and deployment_event_id require workspace_id.
Migrations0030_turn_usage_receipts · 0031_deployment_receipts — unique on (workspace_id, event_id). Appended after current main; side-env ledger aliases reconciled without changing application data.
CommitReceipt + usage/credit or deployment/app/audit rows in one transaction. Same payload → replayed success; different payload → 409 conflict. Deleted app → no revive.
Policy activationAn id-bearing deployment ingest returns 201 only after APP_POLICIES is written; otherwise 503 activation_pending (receipt survives so the frozen body can retry).
StudioStable prompt IDs and connected-stream / snapshot handoff with stale-read and overlap guards (prompt-sender.ts, session-connection.ts, session/handoff.ts).

Conductor-side outboxes, replay policy, and question recovery: Conductor — Turn recovery.

Auth (current) ​

Auth0 tenants for prod vs nonprod (staging + side-envs + local). Multi-tenancy is ours in Postgres (email-domain join / Organizations wiring for enterprise SSO later). Older docs mentioning WorkOS or Better Auth are historical revisions — do not implement against them.

Part of phase 4 cleanup after the prod cutover (#304); narrows #305.

Why: After #318 the control plane wrote __Host-brilliant_session on https but still accepted unprefixed brilliant_session whenever the prefixed cookie was absent. Any host under the studio’s registrable domain can set that name with Domain=<apex>, and published apps (model-authored code) live on sibling subdomains — a login-CSRF / session-fixation vector onto app.<domain>.

Contract session-cookie-host-prefix-wins (rewritten in #400):

RuleBehaviour
Prefixed wins__Host-brilliant_session always wins when present, even if empty or invalid.
Unprefixed only on plain httpbrilliant_session is read only when studioOrigin(c) is plain http — the same origin gate writeSessionCookie uses to pick the name.
Dev-origin headerstudioOrigin honours x-brilliant-dev-origin only for http://localhost / 127.0.0.1 (contract studio-auth-origin-localhost-only), so local Vite against a deployed Worker keeps working.
ResidualA request that itself sends that localhost header still reads the old name. A planted cookie cannot exploit this: browsers never add the header on navigation, and the SPA never sends it outside local dev.

Scripts / helpers: STUDIO_SESSION_COOKIE and studioSessionCookieHeader() in @brilliant/capabilities — every script that mints a session for a deployed env (e2e, smoke, journeys, replay capture, model QA, evals runner) uses them. scripts/e2e/admin-live-check.ts still sends brilliant_session= on purpose to assert a studio cookie never authenticates admin.

Checks called out in the PR: https + old name → 401; spoofed non-local dev origin → 401; http + old name → 200; dev proxy + old name → 200. Live-verified briefly on side env p4cookie (since torn down).

Related: Marketing site — Attribution & cookies · Template demos — Origins and cookies.

Login-flow cookies host-prefix (#463, merged) ​

Merged 2026-10-05 into main. Fixes the login-CSRF part of #458. Same idea as #400, applied to the short-lived OAuth flow cookies instead of the session cookie.

Why: Template demos run untrusted script on demo.<studio domain>, a sibling of the studio. Dispatch strips Set-Cookie headers, but page script can still write document.cookie with Domain=<apex>. The studio's OAuth state cookie brilliant_auth_state was unprefixed, and /auth/callback accepted any state verifyAuthState validated. So a demo page could plant the attacker's state, send the visitor through /auth/callback?code=<attacker code>&state=…, and sign them into the attacker's account.

PieceBehaviour
auth/flow-cookie.tsNew readFlowCookie / writeFlowCookie / clearFlowCookie, built like auth/session-cookie.ts. On https, written and read only as __Host-<name> (Path=/, Secure, HttpOnly, SameSite=Lax, no Domain). The unprefixed name is written on any non-https origin but read only on localhost dev, so a plain-http deployed host with an unprefixed state still gets 400 invalid_state (tightened in review). Contract login-flow-cookies-host-prefix.
Cookies movedbrilliant_auth_state, brilliant_auth_return (routes/auth/studio.ts), brilliant_login_attr (login-attribution.ts), brilliant_app_auth_state (routes/auth/app.ts, published-app end-user login).
GuardA source scan fails if anything other than the two cookie helpers calls getCookie.
DispatchhandleDemoRequest contract now says header stripping is not the whole defence.

Rollout: no fallback to the old name on https. A login started before the deploy and finished after it fails once with 400 invalid_state; a retry works (these cookies live 10 minutes). Not live-verified in the PR (the agent couldn't run env:up). Staging check still owed: one studio login, one MCP authorize login, and one published-app end-user login.

Follow-ups (not in #463): PKCE or binding state to a browser nonce for studio /auth/callback (#467); serving demos from a registrable domain the studio doesn't share and extending the apps-domain-never-shares-studio-registrable-domain check (infra/pulumi/src/apps-zone.ts) to the demo host (infra, needs a human; #468).

Related: Session cookie host-prefix · Template demos — Origins and cookies.

Session routes recheck membership (#371, merged) ​

sessionOrNext only verifies the JWT. A removed member (or a user whose tenant is suspended) could keep a valid cookie for up to ~7 days and still hit routes that start containers, read screenshots, or read usage. #371 (merged 2026-10-03, closes #368) added sessionStillActive after sessionOrNext. Contract session-routes-recheck-membership: any session route that reads or starts tenant resources must run it before touching the conductor.

PieceBehaviour
sessionStillActiveLoads current tenant + membership for the session user; 404 { error: "not_found" } (no conductor call) when the user has no membership, the tenant is missing, or tenant.status === "suspended".
Wired on (#371, merged)POST /workspaces/:id/warm and GET /workspaces/:id/thumb (same gate as warm).
Wired on (#461, merged 2026-10-05; fixes #375)GET /tenants/:id/usage and GET /apps/:id/activity (routes/session-usage.ts). Before this, a removed member or a suspended tenant's user could keep reading usage, the credit ledger and app activity until the JWT expired.
Cookie clearing (#461, merged)When the membership is missing, the 404 also clears __Host-brilliant_session (as sessionMiddleware does), so a removed member's SPA stops resending a dead cookie. This applies to every route using sessionStillActive, including the 7 session-workspaces routes, not just usage/activity. A suspended tenant with a live membership gets 404 without clearing (pinned in the contract and test). Contract text updated to require this. /tenants/:id/usage reuses the tenant sessionStillActive loaded instead of reading it twice.
Still not coveredOther session proxies (e.g. history) unless they are wired explicitly; check new session routes against the contract.

Unit coverage: non-member and suspended-tenant warm → 404 with zero conductor calls; thumb 404 for a non-member (#371). #461 adds test/activity.test.ts: owner 200 on usage and activity, non-member 404 + clearing Set-Cookie, owner 404 after suspension. Neither was live-verified on a side env. Staging check still owed for #461: take a session cookie for a member, remove the member, then GET /tenants/<id>/usage should return 404 with a clearing Set-Cookie, and the next /me should return 401.

Signed-in user avatar (#331, merged) ​

Auth0's picture claim is stored in users.avatar_url and returned by /me. Studio chat shows it via shared UserAvatar in @brilliant/studio-ui (#331, merged):

  • Picture when present; first initial underneath if missing, slow, or failed to load.
  • Images use referrerPolicy="no-referrer" — Google/GitHub picture URLs can fail without it.
  • CurrentUserContext carries id and avatarUrl (not only name/email).
  • Own messages (and older messages with no author) use the signed-in person's picture; a teammate's message still shows their initial — teammate pictures need the actor headers path (routes/oc.ts → do/identity.ts → takeActor), tracked in #333.
  • Sidebar bottom-left initials are still UserInitials; folding them into UserAvatar is #332.

Studio SPA notes ​

  • Same origin as API (run_worker_first); document navigations vs API distinguished carefully (see ARCHITECTURE-EXPLAINED).
  • The studio agent client talks directly to conductor with a short-lived ws: token — not proxied chat through the control plane. Since #546 it speaks /w/:ws/agent/* (Pi events + Brilliant frames, packages/rpc); before that it was OpenCode's /oc API. A compacted chat shows a divider, and task list and error rows survive a reconnect.
  • Frontend conventions: apps/control-plane/web/AGENTS.md; icons @tabler/icons-react only on studio surfaces.

Static asset cache headers (#362, merged) ​

Before this, staging's studio served every ASSETS file public, max-age=0, must-revalidate — including content-hashed JS — so every visit paid a round trip per chunk and image. Landed in #362 (merged 2026-10-03, yoni-monday; stacked on #347; refs #348).

PieceBehaviour
HelperShared staticCacheControl in packages/capabilities/src/static-cache.ts — same rules as the marketing site Worker.
Wired inControl-plane catch-all ASSETS / SPA fallback in apps/control-plane/src/app.ts (clone response, set cache-control when the helper returns a value).
/assets/* (real JS/CSS)public, max-age=31536000, immutable
Images / fontspublic, max-age=86400, stale-while-revalidate=604800
HTML / SPA shellNever given a long max-age — contract static-cache-never-pins-a-page. A missing chunk falls back to index.html with 200; pinning that URL for a year would break the visitor until cache clear.
304sSame header as the matching 200 (browser copies 304 headers onto the stored entry).

Studio also needs the HTML guard the site never hit as hard: SPA fallback can answer /assets/gone-123.js with the shell. See Marketing site — Cache-Control for the shared table and ops rename rule for non-hashed images.

Tests: apps/control-plane/test/spa.test.ts (chunk, image, revalidated image, shell, shell-as-gone-asset) and packages/capabilities/test/static-cache.test.ts. Not yet curl-verified live on studio staging at merge time.

Local frontend against staging ​

Designers and UI engineers usually run Vite only against staging (no local Worker). One-time .env.local with staging service URLs, bun --env-file=.env.local run dev, Auth0 localhost allowlists, and Path 1 troubleshooting live on Local setup & Day 1 (#188).

Landing & studio home prompt ​

Marketing landing is site-only (apps/site). The signed-in studio home still uses the shared @brilliant/composer prompt (chips, suggestions, model/thinking pickers). Merged #401 (merged 2026-10-04) deleted the studio’s signed-out landing / marketing routes and the local lib/signed-in-hint.ts flash path; a site→app hand-off still fills the home composer via /start + stash.

Shared prompt behaviour that still matters on studio home (and on the site landing via packages/composer):

  • Rotating starter prompt with source chips; sources-ranked suggestion row (skeleton while refreshing).
  • Ranking uses picked sources + prompt chips, not free-typed words. Filling the box from a suggestion must not reshuffle the row the visitor just picked from.
  • Click tracking: suggestion_clicked with placement landing | apps (site vs studio home).
  • A prompt handed off from the site landing into /apps (or /start) opens as chips (takeLandingHandoff → replacePrompt / parseSuggestionPrompt).
  • The old text-ranked useSuggestions hook is gone; live suggestions go through useLiveSuggestions.
  • The shared prompt paints a static shell first (PromptStaticView — a plain div with #app-goal-input) until PromptEditor lazy-loads. The editable control is then contenteditable or a textarea with the same id. Smoke/e2e that fills the box must wait for #app-goal-input[contenteditable="true"] or textarea#app-goal-input, not the bare id (#163).

Home always makes a new project, named by the model (#556, merged) ​

#556 is merged (yoni-monday, opened 2026-10-07 09:47 IDT, merged 2026-10-07 10:27 IDT, merge a96adc89, branch studio/home-llm-project-name). It reaches staging with the next deploy after cac22f1. Operator request: take the Project dropdown off Home, and name the new project with the same model that names the app.

Why names were never the model's before. The studio sent name = appNameFromGoal(goal), a text heuristic, in the create body, so the server's model naming never ran. The new project then took that heuristic name too (project.name ?? app.name). In the PR's live check, the heuristic would have named a garden-tools tracker "I need something".

PieceBehaviour since #556
HomeProjectPicker is deleted. Home always sends {kind: "new"} with no project name, so the server names the project after the app. Adding an app to an existing project happens on that project's page.
POST /tenants/:id/app-nameNew control-plane route (session + same-tenant check). Body { goal }. Returns { name }: the model's sanitized title from the existing suggestAppName (conductor, about 4 s budget), else nameFromGoal(goal), else null. A down, slow or junk-answering conductor never becomes an error status; only no session (401), another tenant (404) or a missing or over-4096-character goal (400) is refused. Contract app-name-suggestion-never-fails-on-naming.
Add-app flow (use-add-app.ts, lib/add-app-request.ts)New naming phase: the studio asks for the name once, before minting the request, and shows "Setting up your app…" meanwhile. Retry and Send again resend the stored request (same name and requestId) and never re-ask. If naming fails it falls back to appNameFromGoal, so create is never blocked (contract add-app-naming-never-blocks-create). A second submit while naming is dropped, and leaving the page while naming cancels.

Verification in the PR: new control-plane endpoint test, add-app unit tests and projects-apps browser tests, each shown failing on the old code. Live on side env permp02: the goal "keep track of which neighbours borrowed my garden tools" gave an app and a project named "Neighbour Tool Tracker"; with the naming route forced to 503, the app still got created under the fallback name.

Desktop polish and explicit Plan/Build mode (#558, merged) ​

#558 (danfishbein) was merged to main 2026-10-08 11:07 IDT by yoni-monday (merge 9e767fea, head 4be86d93; opened 2026-10-07 10:09 IDT, branch desktop-polish; 17 commits, 86 files, +4599/−482). It closes #601. Between opening and merge its scope changed: the Plan/Build toast and canvas now follow an explicit, durable session mode set by the agent, and the Home Browse modal was dropped from this PR (Home still uses its existing project search). The branch map docs/desktop-polish-parity.md was deleted. Not yet confirmed live on shared staging at the time of writing; it was verified on the side env pr558-mode.

AreaWhat landed
Plan/Build modeThe session has a real mode, plan or build (default build), stored by the conductor and sent in the agent session frame as mode. The agent moves it with two new zero-argument tools, enter_plan_mode (start of the plan interview, or a replan after a build) and exit_plan_mode (only when the user asks to skip or stop planning). Approving a plan switches to Build by itself, before the agent resumes. Ordinary questions and tab browsing never change the mode. The mode only reports the phase; it never gates tools (the old gate stays gone, see #520). Conductor details: Conductor — Explicit Plan/Build mode.
Plan approvalpropose_plan now asks and waits on its own approval form, linked to the proposal by metadata.planId (the propose call's id). The model no longer has to ask a separate approval question. The studio binds the card by planId, never by a "Plan" header, so a plain question headed "Plan" renders as an ordinary question. Only the exact approve option (markers stripped, whitespace trimmed) starts the build; free text like "Approve but change X" is change feedback. Failed proposal retries no longer leave extra Review plan cards.
Plan chatWhile propose_plan is still running the card shows a disabled Planning… button, then Start building, then Review plan, so there is no "Review plan" flash. History splits into Plan and Build phases at the recorded mode transitions without relabelling earlier work; the enter/exit calls never render a row.
CanvasThe canvas turns to the plan doc only while the session is in plan mode and a turn is live, and leaving plan mode any way returns it to the preview. It no longer guesses from file writes, plan.md, or pending questions (use-canvas-tab.ts).
Mode toastA "Plan mode: on" / "Build mode: on" pill over the canvas for 2.5 s when the mode is first known and whenever the agent changes it (ModeToast.tsx, use-mode-toast.ts). Browsing Plan, Code or Settings never toasts. The glyphs are served from /mode-toast/plan.svg and /mode-toast/build.svg as CSS masks.
Look questionStyle previews sit inside the question card, plus an All styles picker over the full catalog (QuestionLookChoices, StylePickerModal, StyleTile; the design from #394). A pick outside the offered three is passed to propose_plan and apply_style by id.
ShellNo page jump before an app or Home opens: the shell keys layout on useShellPath() (lib/shell-route-key.ts) on main. This brings the Studio shell path gotcha fix onto main.
Left railThe Agents section (AgentStack) is removed. The rail is home tile, primary pages, More, theme switcher, account menu.
Menus.menu-panel has one 1px border (--color-border) and only the drop half of the shadow, instead of a doubled 2px edge.
EditorThe reload bar moved to ReloadingBar.tsx to keep PreviewPane.tsx under the file-size cap.

Deploying it (mixed versions): release the control plane and SPA first, wait for its SHA, then the conductor; roll back in the order the release dependencies need. An older conductor sends no mode, which the studio reads as unknown (no toast, canvas stays on the preview). Old approvals with no planId keep their card through a narrow legacy adapter (legacy-plan-binding.ts) that never invents a mode or phase. A conductor deploy still evicts running turns. Written up in the repo's gotchas/deploying.md; see also Troubleshooting.

Verification at merge (from the PR): root bun run verify passed; 1,976 web, 1,980 conductor and 1,525 control-plane tests passed with clean typechecks; CI verify green on the head. On pr558-mode, bun scripts/e2e-smoke.ts passed all eight checks, and a real planning flow (default model claude-opus-5-5) picked a style from All styles, switched to Build on Start building while busy, and showed zero false toasts while browsing tabs; a replan entered Plan and a skip exited to Build. An older conductor (49e8d4b5) paired with the new SPA also passed. Auth0 login itself was not exercised. Follow-ups: Sonnet catalog grounding in #612, starting plan mode from explicit studio planning intent in #613.

Phone Home and composer (Dan's design) (#680, merged) ​

#680 (yoni-monday) was merged to main 2026-10-08 22:11 IDT (merge 524b8286, head d06507df; opened 20:17 IDT, branch studio-home-composer-596-597; 3 commits, 44 files, +2551/−148) combines and supersedes #596 (phone Home) and #597 (composer), ported onto current main. Dan's design is unchanged; one keyboard-lift fix sits on top. No backend changes (nothing under apps/control-plane/src, services/, packages/api-types, packages/service-contracts, or migrations). Desktop Home stays as it is.

SurfaceBehaviour (≤767px unless noted)
Phone HomeHero card with a centred prompt that starts empty and grows. The top bar lives inside the screen so the bar and hero lift over the keyboard as one column (MobileHome + use-keyboard-lift). A failed create shows inline; Send again reuses the stored request so it cannot create a second app, but only while the prompt is unchanged: any edit resets the failed state and the next Send mints a new request id. The phone alert uses the same FAILED_COPY map as the desktop status strip (exported from AddAppControls.tsx), so the two cannot drift.
Composer (Home, project page, editor chat)Thinking-level trigger shows Balanced (and the other stops). Model and Connect pickers open as the studio's phone sheet (sheet kit handed to @brilliant/composer at boot). Return inserts a new line on a phone; only the send button builds. The @ and chip menus are touch panels that keep the keyboard up.
Keyboard-lift loopPreviously read layout every frame while the prompt was focused with no keyboard (~30 frames / 500ms idle). Now runs only while there is a keyboard to follow. Covered by home-keyboard-lift.test.tsx.

Blast radius: studio Home and every composer. Phone Home layout is ≤767px only; the model trigger and sheets change on phones in all composers. Side env studio633 at 7753ded2 passed official smoke 8/8 and phone check 12/12 (the final commit only shared the failed-create copy and reworded comments). Gotchas for this live in gotchas/studio-frontend.md under “Phone Home” on main: the prompt box is Tiptap, so enterSends (false on a phone) must flow through RichPromptInput to PromptEditor; ProseMirror adds a br.ProseMirror-trailingBreak after a hard break, so tests counting line breaks must skip it; and the shell Header returns null on / because MobileHome draws its own top bar.

Signed-out studio shell (#401, merged) ​

After cutover the marketing landing lives on the site apex — not on the studio host. Merged #401 (merged 2026-10-04; part of #304) made that true in the SPA itself: no landing view, no siteFrontsStudio flag, no build-time VITE_SITE_ORIGIN gate. SignedOut always sends a signed-out visitor to /auth/login once per tab (signed-out-redirects-once drops its “when the site fronts the studio” condition), then shows a Sign-in button. /start still renders pre-auth outside the shell. A session error that isn’t a 403 always gets Retry (root.tsx).

SituationBehaviour
No sessionRedirect to /auth/login once per tab; a second time shows a Sign-in button (not another redirect).
/me 403 (refused / suspended workspace)Explanation + Sign out — never redirect to login (Auth0 would loop).
Non-403 failure (offline, 429, 5xx)Retry UI, not sign-out.
LogoutAuth0 returnTo is SITE_ORIGIN/ when SITE_COOKIE_DOMAIN is set (logout-returns-to-site-only-when-it-fronts); otherwise the studio origin. #398 (merged): that apex must be in Pulumi auth0.logoutOnlyHosts (or hosts) — never a sign-in callback host.
fetchMe401 → null (signed out); 403 throws so the shell can name refusal.

History: #361 turned on the redirect only when the SPA was built with VITE_SITE_ORIGIN (and SITE_COOKIE_DOMAIN was set). Side envs left that empty, so signed-out visitors there still saw the old in-studio landing — a different product from staging/prod. #401 deletes that path. Contracts: signed-in-hint-fallback deleted; session-authorizes-studio drops its hint clause. Domain / cookie rules: Marketing site — Cutover step 2.

Quick use-cases & templates ​

On the site landing (#176 era, now apps/site / composer): quick use-case chips and template cards. Merged #401 (merged 2026-10-04) removed the studio copies (TemplateGrid, marketing-only landing chrome). Picking a card scrolls to the top before filling the prompt; delayed fills cancel on a newer pick, prompt edit, or unmount.

Marketing Use cases pages ​

Hub / department / use-case pages under /use-cases (optional ?lp=1 ad mode) are served by apps/site after cutover. Full write-up of the content model: Marketing Use cases pages (#259 / #275, merged).

On main via #318 + staging cutover #361 (merged): prerendered apps/site + /start hand-off; staging apex is the site and the studio moves to app.brilliant.rocks — see Marketing site (apps/site). Prod mirrors that after #388 (itsbrilliant.ai → site / app.itsbrilliant.ai → studio) — code on main; live flip still needs lead infra. Merged #401 (merged 2026-10-04) deleted the leftover studio SPA marketing routes (routes/marketing/*, routes/landing.tsx, marketing-only components/landing/) — they are no longer “remain until phase 4”; that cleanup was #401.

Model picker & thinking levels ​

Updated by #820 (merged 2026-10-12): the slider is no longer a fixed three stops. Each model offers its own effort scale and the highest stop is always named Brilliant. The table below describes the pre-#820 picker; see Per-model effort scales and Muse Spark 1.3 (#820).

Landing and chat composers share one model picker. Thinking level is a snapping slider with three stops: Quick · Balanced · Brilliant (ThinkingSlider, chip on the prompt box). Pole labels are Quick and Brilliant. Default stop is Balanced.

UI stopInternal / shared aliases
Quicklow / quick
Balancedmedium / balanced
Brillianthigh / deep

Naming: the picker UI’s top stop is only “Brilliant”. Shared thinking-level formatting in @brilliant/studio-ui (formatThinkingLevelLabel) still says “Deep” — do not rename that helper casually; map in the picker via levelLabel / stopOf.

All picker chrome copy lives in apps/control-plane/web/src/components/landing/model-picker-copy.ts (PICKER_COPY, LEVEL_LABELS, LEVEL_HINTS). Header: “How brilliant do you want it?”; help tip explains longer think / more credits. Model list names come from the provider catalogue (not from that file). Panel size follows Figma anatomy (304 × 183px). At the Brilliant stop the track becomes an ambient orange pixel field (still under reduced motion). Help tooltip is portaled so overflow/blur does not clip it.

For models with no variants, the slider still shows three stops but the UI level is a no-op (getEffectiveVariant sends none) — known quirk. Catalogue Sol id is gpt-6.1-sol; a saved gpt-6-sol rewrites to it (#173; Responses path in conductor).

Phone composers (#680, merged): the compact toolbar shows the thinking-level label (default Balanced) and opens the model / Connect pickers as phone sheets via the studio sheet registry, rather than the desktop popover panel above.

Feedback ​

FeedbackButton (#401 merged 2026-10-04: under components/home/) takes a placement — historically bottom-left on the studio landing and top-right on studio home; after #401 the studio surface is home-only (site landing has its own chrome). Stays visible but inert until FEEDBACK_FORM_URL is set. When the URL is set, opens the form in a new tab (no rest background fill; theme tokens + global 1px focus, not hard-coded hex / Tailwind rings).

Workspace warm on open (#308, merged) ​

Opening an existing workspace fires a fire-and-forget warm so the container / Vite preview is already starting before the iframe asks for /dev/.

PieceBehaviour
POST /workspaces/:id/warmSession + current membership in an active tenant (via sessionStillActive, #371 merged) + workspace in that tenant, same gate as thumb; 404 and no conductor call otherwise; returns 202 before waiting on conductor; forwards with the guard; conductor errors only logged (workspace-warm-fire-and-forget).
Studio/w/$workspaceId fires warm from onEnter + onStay (only from commitMatches, never preload), once per workspace per minute, without awaiting.
No hover preloadHovering project cards must not warm — that would start a billable VM per card on a grid sweep.
Fresh createNo separate client warm mark — POST /apps init already starts the container; warm and /init share the same in-flight promise.

Conductor side (POST /w/:id/warm, ensureDevServer only, no OpenCode; dev.warm outcomes started/ready/probed/failed): Conductor — Pre-start on intent / warm.

Studio header & editor chrome ​

Landed in #143 (merged): Figma layout reorg of the studio header, chat column, and preview chrome. No handler or data-flow change — layout/placement plus behaviour fixes found while doing it. Follow-ups in #148 (merged): chat resize without page re-renders, Esc scoping in in-column version history.

  • One app bubble above the chat: app name, app actions (rename / duplicate / delete / settings), and the versions dropdown. Chat show/hide sits beside versions (not in the left rail).
  • Draft/Live is a status label only. The Publish button label is always "Publish" in every live state (publish-header-idle-label contract); status is not duplicated on the button.
  • Invite opens the access/publish modal. Publish opens a status menu: live URL, last published (who/when → version history), unpublished change count (→ Code). First publish (nothing to show in the menu yet) goes straight to the access modal. Share & Invite / Projects redesign (app Invite dialog, Members, projects folders) is open #445 — see Share & Invite / Projects.
  • Publish blocked by type errors (#490, merged 2026-10-05): the header shows "Publish stopped: the draft has type errors…" and Studio sends the compiler errors once to the chat session Publish started in, so the agent fixes them. It never publishes again by itself. See Conductor — Publish typecheck failures go back to the agent.
  • Direction (2026-10-19, design): the app header drops full screen and hide chat and keeps only Open in external tab, with no floating bar. See Chat and app header direction.
  • Project switcher, app switcher, and preview refresh stay wired but are gated behind feature flag studio_header_navigation (default off) in @brilliant/capabilities flags (see Admin Feature Flags).

Chat column ​

  • Version history opens inside the chat column; the sheet over the preview remains for phone (no column to host it). Esc closes the panel only when the key event was not already handled (defaultPrevented) — so Esc that dismisses the Publish/Versions popover (Radix) does not also close history behind it (#148).
  • Column is resizable by drag (360–640px, capped at half the viewport; double-click resets; arrow keys step). Width persists in localStorage (brilliant_chat_width); read() clamps on load so a stale huge value never paints unclamped. The store sets --chat-w on <html>; the page and header read it in CSS only (lg:w-[var(--chat-w)]) — do not subscribe WorkspaceView with useChatWidth, or every pointermove re-renders the whole studio (lib/chat-width.ts, ChatResizeHandle; #148).
  • Collapse/expand animates without mid-animation text reflow.
  • Composer model picker is the same component as the landing’s (Quick · Balanced · Brilliant slider; see Model picker & thinking levels). Effort/level chip never truncates (model name may).

Chat & plan mode (design) ​

Decided product behaviour for studio chat / plan mode. Source brief: docs/design/chat-plan-mode/CHAT_PLAN_MODE_BRIEF.md (on main). Framing: Brilliant builds apps, not agents — take interaction patterns from references, not agent copy.

Decisions (stable) ​

TopicDecision
ModeFirst prompt of a new app → always plan mode. Returning users → agent picks from the query (default light; plan when adding data source/integration, page/flow, or data-model change). Agent states the switch in one line; does not ask permission.
Plan doc after buildBecomes the app’s living brief, updated on scope changes, used as agent context.
QuestionsCard docked above the composer (both stay active). Composer text = free-text answer to the current question card — not a docked connect card (#394; see Plan mode fine-tuning).
Skipping / auto-answerPer-question Skip only (no Skip all). Defaults tagged “Default” in the recap and editable. Server-side auto-answer after a configurable wait (#317, merged) replaces the old studio 30s tab timer — see Server-side question / plan auto-answer. Connect and write-approval never auto-answer.
Plan approval and writesNo write gate (#520, merged 2026-10-06). The plan flow stays (Look, propose_plan, the Plan card with Approve - start building, plan.md), but the conductor no longer refuses writes or shell commands before approval. See No plan-build gate.
Canvas buildDriven by real build events, not scripted progress.
ConnectionsNever block (#380, merged; contract declined-connection-never-blocks): silent if already connected; else Connect / Later (legacy Cancel still accepted). Later, cancel, no answer, or a connection that never completes → continue on sample data without asking whether to proceed, note “isn’t connected yet” on the plan.md section, tell the user they can connect later. Timing (#386 merged / #394 open, stacked on #380): connect during planning only as a fixed skill step after Look (before propose_plan); never during build; after the build, Connect chips (Invite always fits). See Chat rhythm 2 · Plan mode fine-tuning · Integrations — Studio UX.
Build errorsQuiet retry (×2), then per-block retry card; rest of app keeps working.
Turn recap / failureNo “What changed” card (#491, merged 2026-10-05). Success settles to “Worked for {duration}” only. A failed turn uses the plain system pill with Send again (ChatMessage.tsx) — same path as other system messages. Studio-only UI; there was never a backend endpoint. See No What changed card.
Canvas steeringNot from the canvas — edits go through chat.
Status copyHybrid: fixed verb list (statusVerbs.ts) + model-written object ({Verb} {object}).
Returning historyFull history, collapsed into timeline rows.

Phase 1 = structure, typography, rhythm, timeline, interrupts. Typewriter/streaming polish is phase 2. Phase-2 canvas floating widget / full abstract build stages wait on conductor events (see Conductor — studio chat signal gaps).

First slice landed (#247, merged) ​

Frontend-only slice (conductor change = prompt text only). On main:

  • Typography & speaker. Chat-scale tokens (ChatTypography: H2 20/28, H3 16/24, body 14/22, 68ch cap) via Markdown variant="chat"; plan docs keep the default scale. A “Brilliant” speaker label once per turn. Copy and Retry under the last answer of the latest settled turn only (thumbs left out until there is somewhere to send the vote). Entity links [Name](entity://provider/kind/id) render as chips when known, plain text otherwise — nothing supplies an entity catalog yet, and the prompt does not ask for them yet.
  • Status line & timeline. While a turn runs, the header reads {Verb} {object} (verbs in statusVerbs.ts; starts as “Thinking”, shimmers while active). Live sub-steps: newest 4 plus “+N more”; done rows muted with a check; same-kind runs compact (“Read 3 files”). When the turn ends, it folds into one timeline row. Sessions that start by asking or planning get Plan / Build / Polish stage labels. The newest turn reserves the viewport (user message at top, reply grows beneath).
  • Questions docked above the composer. Pending questions float above the composer (outside the scroll area) and disappear once answered; connect and approval cards stay in the stream. Per-question Skip only (no Skip all). Skip (and, after #317, server auto-answer) send the recommended option tagged (default) in the answer text so the recap shows a Default tag after reload. Number keys pick an option; Esc skips; the composer answers the docked card. A “bigger change, plan first?” question renders as a compact mode row. The studio’s own 30s auto-advance timer (use-auto-advance.ts) is removed by #317.
  • Prompt text. ask-questions.ts and the plan-with-user skill no longer mention “Skip all”, and say an answer ending (default) was a skip or timeout, not the user’s pick. Closing-summary rules in conversation-tone.ts are unchanged.
  • Polish. Chat, composer, and canvas corners use --radius-panel (16px); disabled primary buttons dim the whole face; chat scroll fades under its top edge once scrolled.

Local-dev chat playground lives on branch chat-playground (stacked; not part of #247). Backend signal gaps that forced simplifications: Conductor — studio chat signal gaps.

Server-side question / plan auto-answer (#317, merged) ​

Landed in #317 (merged 2026-10-02). A turn blocked on a question or plan card used to stall forever if the user walked away — the only timer was a 30s countdown in the studio tab that paused when the tab lost focus, and the plan card had none. #317 moves the deadline to the conductor and deletes the client timer.

PieceBehaviour
Who answersConductor’s existing 30s heartbeat alarm lists each running session’s pending forms, stamps a deadline the first time it sees one, and answers past-due forms. No second alarm.
WaitAdmin Config key QUESTION_AUTO_ANSWER_SECONDS: default 300, 0 turns it off, otherwise 30–3600. Missing key or KV outage falls back to 300, never to off.
QuestionRecommended option, tagged (default); fixed-choice field gets that exact option; with no recommended option the form is dismissed so the agent decides. One deadline per request (multi-field round answered in one reply).
Plan approvalApprove label Approve - start building (default) (no design-style bracket). Look is its own docked question before propose_plan, so auto-approve must not invent a style (#316). Chat widget shows “Approved automatically, no reply”.
Never auto-answeredConnect prompts and write-approval prompts.
Studiouse-auto-advance.ts deleted; no timer is shown to the user. Recap still shows Default / “You approved this plan”.
Side envsConductors bind their own CONFIG_KV (patchConductorConfig, render.ts, up-phases.ts, deploy.ts) so the timeout is editable per env.

Plan-build gate (removed): the gate that matched the approve label (em dash or " - ", (recommended), older bracket styles, and the trailing style bracket #317 stripped) was deleted in #520. Auto-approve still answers the plan card with Approve - start building (default), but nothing downstream checks that label any more. See No plan-build gate.

Detection gotcha (pre-#546, OpenCode): the plugin event bus carries no form.* events and form.request.list reads the wrong location — unit tests with fake events passed while the server answered nothing. Detection polls session.active() + form.list({ sessionID }). Both traps are in gotchas/opencode-and-turns.md.

Known limits: at the default 300s the answer lands between ~300s and ~360s after the question opens (clock starts when a tick first sees the form). A WorkspaceDO eviction restarted the clock under OpenCode (it dropped its forms and the model re-asked under a new form id); since #546 Pi re-runs the replay-safe question tool, which finds the same form with its stored deadline. A value written to KV by hand needs the store’s config/ prefix.

Verified on side env qtimer (timeout 30s): question card settled after ~48s, plan card after ~32s; recap “Answered 3 questions” / “You approved this plan”; agent continued to build; wrangler tail showed question_deadline.armed then question_deadline.expired … outcome:settled.

See also Conductor — Question / plan auto-answer · Admin Config.

Plan mode canvas (#316, merged) ​

Landed in #316 (merged 2026-10-02). Planning is a Plan mode canvas document, not a modal or chat card. Related #336 (Cool slate defaults / Playground scenarios / theme-chrome prefs) closed without merging — do not treat those extras as live.

Plan doc (canvas tab)

  • Read-only plan document on a Plan mode canvas tab; it fills while the agent asks questions (sections arrive in ask order). Overview is written last and fades in at the top.
  • One prose section per question topic. No em dashes and no internal build notes (build order, “(done)” markers, collection names). Data & connections lists only services, what each provides, and status. #380 (merged) refines this to answered questions only (no unanswered placeholders) — see Plan mode polish.
  • Before the first section arrives, the sheet shows a skeleton outline (not an empty landing). Both papers use the theme border token.
  • Toolbar above the sheet (replaces the in-sheet header): doc icon + app name, Copy (“Copied” for 2s), To-dos pill (moved out of chat), Start building. As shipped in #316, Start building appeared only when the plan was ready; #380 (merged) keeps it always visible (primary only while approval is pending) — see Plan mode polish.

Chat widget (replaces plan cards / modal)

  • The plan widget replaces PlanCard, PlanModal, PlanResolvedCard, and the plan-look picker.
  • It renders at the approval question’s position, so it sits below every question once the doc is ready, and stays in history.
  • Tiny live render of the real doc as its thumbnail.
  • Before approval: primary Start building. Afterwards: secondary Review plan (opens Plan mode scrolled to the top).
  • Look is a normal docked question (before propose_plan). Thinking collapses when it finishes.
  • Timed-out auto-approve shows “Approved automatically, no reply” (see Server-side question / plan auto-answer).

Build handoff

  • Approving switches the canvas to Preview with a “Building your app from the plan…” placeholder. As shipped in #316, the placeholder lasted until the turn settled; #380 (merged) keeps it until the preview has drawn once (avoids a premature broken-preview from the fail clock) — see Plan mode polish.

Agent (plan-with-user skill + conductor prompts)

  • Section titles follow question headers; Overview written last.
  • Connections never block: build on realistic sample data and connect later (strengthened in #380 — see Plan mode polish).
  • Progress via update_tasks, not markers in plan.md.
  • Since #489 (merged 2026-10-05), marking the last task done clears the stored list; the studio keeps the finished list ("N of N done") on screen via the new tasks.completed event until the next turn starts, so nothing changes for the user. See Conductor — Task list clears when done.
  • Build gate accepts the approve label with either an em dash or " - " (and related tags — see auto-answer / gate notes above).
  • Template no longer shows “Drawing your first screen”.

Delete app (same PR)

  • After one delete, the workspace app list was not refreshed, so the next delete omitted force, the server answered 409 “last app”, and handleDeleteApp returned silently on 409.
  • Fix: menu offers Delete app only or Delete project, and the list refreshes after a delete.
  • Still open: app-detail can snap back to an app named in the URL (from 5c3c4690).

Also included: Warm stone / Cool slate theme switcher in the sidebar (Studio theme switcher; removed later in #956).

Not in #316: Playground tab / prototype wiring; uncommitted theme-chrome preference work; an AgentRail change that broke its contract test.

Verified on side env planmode: bun scripts/e2e-smoke.ts --env planmode (4/4); bun scripts/e2e/plan-live.ts --env planmode (interview → Look → Start building → preview placeholder → apply_style); --auto-approve path records Approve - start building (default) and the widget “Approved automatically, no reply”.

Plan mode polish (#380, merged) ​

Landed in #380 (merged 2026-10-04 by yoni-monday; branch chat-rythem, merge commit d167e415). Durable product rules below. Verified on side env rythem (with #386 merged): e2e-smoke + plan-live ALL CHECKS PASSED (Later on connect → continued; doc “isn’t connected yet” note; To-dos 0/N; Start building → small build window → clears).

Connections never block (contract declined-connection-never-blocks)

  • Connect prompts offer Connect and Later; legacy Cancel is still accepted.
  • Later, cancel, no answer, or a connection that never completes → the agent must: continue on sample data without asking whether to proceed, add an “isn’t connected yet” note to the relevant plan.md section, and tell the user they can connect later.
  • Same carry-on-with-sample-data instruction for blocked_by_admin (review fix; no longer asks whether to build without it). Contract also covers admin block; these payloads are returned, never thrown.

Declines are not failures (contract declined-step-not-failed)

  • Declines arrive as successful results so integration errors stay red (card_declined is no longer green).
  • Exception: a question the builder dismissed (OpenCode CancelledError) is not a failure (tool-failure.ts).

Retry check

  • Keyed by tool + file/provider (not per assistant run); spans the whole turn so question cards don’t leave tools red wrongly.

Plan doc content

  • One section per answered question, in ask order (latest at the bottom). Overview goes on top once everything is answered.
  • Removed: “Question N” placeholders, headings for unanswered questions, leftover plan.md sections.
  • Stand-in text before agent prose no longer echoes the question or says “You chose”.
  • plan-with-user skill: asks for statements (bad/good example); writes build to-dos (all open) right before propose_plan; narrates one plain sentence after each build step.

Toolbar always visible (refines #316)

  • To-dos pill shows “To-dos” with no count until the agent writes steps; never “0/0”.
  • Copy disabled until the plan is proposed, then check + “Copied” for 2s.
  • Start building visible from the start; primary only while approval is pending; otherwise muted. Tooltip: “Available when the plan is ready” while revising; “Plan approved” only after approval.

Plan / build boundary

  • A planned session stays in Plan until Start building (planning shell no longer splits the plan block).

Build handoff (contract build-placeholder-yields-to-preview)

  • After Start building, the placeholder stays until the preview has drawn once (not merely until the build turn settles). Previously the preview fail clock (running since app open) could flip to broken-preview when the build turn ended.
  • Build end restarts the preview fail clock; placeholder yields when preview is ready or failed; never covers Retry; never arms for a build that didn’t resume a turn; never covers another app.

Chat timeline (phase-blocks.ts, tool-failure.ts)

  • One work block per phase (plan / build / each polish); running block last while the phase runs; collapses when the phase ends; mid-process message goes below the running block.
  • Running text first: agent messages never inside a block; running block collapses to one live header line.
  • Adjacent answered question recaps merge into “Answered N questions”.
  • Footer cards after the work block are suggestions (next-step) only — no what_changed turn-recap (#491, merged).
  • Red only on real failures.

UI reading aids (brief): edge fades + scroll button on canvas layer PlanDocCanvasEdge; auto-scroll via use-doc-scroll.ts.

Known follow-ups (still open): #390 don’t re-raise connect in tools; #391 tooltip + disabled Button focus; #396 update_tasks rejects Connect to-dos.

Continued in the chat-rhythm stack: merged #386 (chat-rythem-2, stacked on #380) covers connect-while-planning / never-in-build, BUILD-from-start, build-window sizing, and plan-doc rewrite/scroll polish — see Chat rhythm 2. Connect recaps join the “Answered N questions” bundle from this PR.

Chat rhythm 2 (#386, merged) ​

Landed in #386 (merged 2026-10-04 by yoni-monday; branch chat-rythem-2). Stacked on merged #380 (chat-rythem). Durable product rules below. Live check / screenshots on a side env were not done in the PR (staging workspace container answered 503 during local smoke); later verified together with #380 on side env rythem — see Plan mode polish.

Connector timing (agent prompts / skills; takes effect on conductor deploy). Cross-link: Integrations — Studio UX.

PhaseBehaviour
PlanningAfter other questions and before the plan is ready: one connect card per shared service that isn’t connected. Skipping is fine — planning continues; Data & connections says “Sample data for now, connect later”.
BuildNo connect prompts. Agent never calls an inactive provider after Start building, writes no “Connect …” to-do, builds that part on sample data. Studio also hides any Connect to-do the agent writes anyway.
After buildChips: Connect <Service> for each skipped service (sends a request → same connect card), then Invite others to your app, then at most one feature suggestion. Three chips max.

Known limit: prompt-level “no connect in build” is not tool-enforced — integration_run can still raise a card if the agent calls it. Worth a follow-up if prompt compliance is weak. Never-block from #380 still holds (declined-connection-never-blocks).

Chat

  • Connect card recaps from planning join the “Answered N questions” bundle from #380 (never loose “Asked you a question” rows). Opened, each service shows Connected or Skipped. See Plan mode polish — Chat timeline.
  • After Start building, the work section is labeled BUILD from its first step (used to stay PLAN until the first app file write).
  • Agent test screenshots render inside the BUILD block.
  • Connect copy uses short dashes only (no em dashes).

Build window

  • Stays small for the whole build; expands only when the build turn ends. Previously expanded early because it ended the first time session status wasn’t “streaming” (dropped event stream → “reconnecting”; first boot paint → “ready”). Now reads messages + session busyKnown.
  • Reload mid-build restores the small window, not the full app.
  • Caption under the window equals the chat’s BUILD header from the same function (buildHeaderLabel in live-header.ts). To-dos pill unchanged.

Plan doc

  • A plan.md rewrite no longer re-shimmers/re-types sections the user already read; only brand-new sections animate.
  • While the plan is written, the doc glides to keep the newest section in view. Scrolling up (wheel/keys/touch) pauses following; returning to the bottom resumes.
  • Round button is only ever an up arrow (“Scroll to top”), shown once scrolled down. No down arrow.
  • Connect cards are no longer plan sections; their result belongs in Data & connections.

Local Vite docs: Path 1 must proxy to https://app.brilliant.rocks — bare brilliant.rocks 308s and breaks local sign-in (Chrome caches it). See Getting started — Path 1.

Continued: open #394 (chat-fine-tunnings, stacked on #386) hardens the connect step as a fixed recipe, docks connect cards with questions, guards the composer, groups after-build Connect chips so Invite always fits, and adds Look style preview tiles / All-styles modal — see Plan mode fine-tuning.

Plan mode fine-tuning (#394, open) ​

Open follow-on on branch chat-fine-tunnings (#394, open — not merged), stacked on #386 (chat-rythem-2). #386 and #380 have both merged. Durable product / control-plane rules below; treat as intended once it merges. Live check of the connect step needs this branch’s conductor skill on a side env (staging runs main, whose skill still forbids connecting before approval). Look card / modal screenshots in the PR are from a local render.

Connect is a fixed plan-mode step (skill step 1c; refines #386 “while planning”)

PieceBehaviour
WhenRight after the Look answer, before the fixed plan sections and propose_plan.
Recipeintegration_connections → one integration_run per service from the first prompt (or the plan, shared account) that isn’t active → integration_connections again to read the outcome. No skill loading or action lookup in between.
not_connectedControl plane answers not_connected (with the connect card) before it reads the action — authorizeIntegrationCaller runs first in POST /v1/integrations/:provider/run.
DockingWhile no plan is approved, connect cards dock with the plan questions (pickDockedQuestion), one card per service. After approval they stay inline. Recaps still join the “Answered N questions” bundle (#386).
Composer guardComposer text no longer answers a docked connect card. Previously any answer but “Later” made the tool wait up to 10 minutes for a connection.

Never-block from #380 and no-connect-in-build from #386 still hold. Cross-link: Integrations — Studio UX.

Follow-up chips after the build (refines #386)

  • Every tool named on the first prompt’s “Connect and use these integrations” line counts as unconnected until a card connects it or the app reports it active — not only services whose cards were skipped.
  • Invite always fits: up to two tools get a chip each; three or more share one “Connect A, B and C” chip (then Invite, then at most one feature suggestion).

Look question — style previews

  • Options that name catalog styles render as preview tiles (two per row; recommended first with a badge), plus an All styles tile that opens a searchable modal of all 76 styles.
  • A pick from the modal answers with the style name; the skill and the propose_plan follow-up map any style name to its id (lowercased with dashes — true for every catalog entry; pinned by a test).
  • #558 (merged 2026-10-08) brought the in-card previews and All styles picker onto main — see Desktop polish and explicit Plan/Build mode.

No plan-build gate (#520, merged) ​

#520 (yoni-monday; merged 2026-10-06 09:58 IDT, merge 7ab297b4) removed the conductor's plan-build gate instead of switching it on. It fixes #293 and is the alternative to #509, which fixed the gate's loader bug so it would actually start blocking.

Why. Because of the loader bug in #293 (stored messages carry no type), the gate never blocked anything in production. Switching it on (#509) was reviewed as risky, since it would refuse app edits in every existing session that had built past a plan without an exact Approve. The product decision (Yoni, in Slack) was to drop the gate altogether and not worry about existing apps or sessions.

Stays (plan flow)Gone (gate)
propose_plan, the Plan question with Approve - start building, plan cards, plan.md, the Look / apply_style stepThe conductor refusing write / edit / scaffold_model and shell commands before approval
plan-with-user skill guidance to build nothing before approval (agent behaviour, not enforced)plan_build_gate errors and their studio mapping in errors.ts
Package-manager guard at shell spawn (host/workspace-driver.ts)PLAN_BUILD_GATE (host/host.ts), the wrapper in host/brilliant-plugin.ts, and the planBuildGateDisabled test flags

Deleted code and contracts: coding-agent/tools/plan-build-gate.ts, plan-build-gate-hook.ts, plan-build-gate-shell.ts, their tests, and the contracts plan-approve-unlocks-app-tree and gate-loader-matches-full-scan. In-repo docs updated to match: feature-registry.md STUDIO-PLAN-001 (no write gate, no flag), the STUDIO-PLAN-001 row in e2e-regression-adr.md, ARCHITECTURE*.md, and the plan_build_gate entry removed from gotchas/opencode-and-turns.md.

Verification at merge: conductor tsc clean and bun test 2008 pass; studio web 1993 pass with one known flaky timeout (avatar-hover.client.test.tsx, also flaky on main); bun run verify green apart from that test. Not live-verified on a side env.

This is now intended behaviour on main: plan approval is a product step in chat, not a write lock. If an app edit is refused, look elsewhere (package-manager guard, flags, destroy tombstones), not at plan approval.

No What changed card (#491, merged) ​

#491 (yoni-monday; merged 2026-10-05, merge 3552aaca) removed the studio “What changed” turn-recap card entirely. It was studio-only UI — WhatChangedCard derived bullets client-side from assistant prose (snapshotFiles + parse-outcome-bullets.ts); there was never a backend endpoint (checked conductor, control-plane server, dispatch).

BeforeAfter (#491)
Follow-up turns that wrote files could show a What changed success card (2–4 bullets parsed from the reply).No success recap card. A finished turn settles to Worked for {duration} on the activity row.
Failed turns with retryText rendered as a failed What changed card (“Couldn't finish” + Retry).Failed turns fall through to the plain system item; ChatMessage.tsx shows a pill with Send again (unchanged path used elsewhere).
phase-blocks.ts treated what_changed as a footer card (with suggestions).Footer check is suggestions only.

Also deleted: WhatChangedCard.tsx, lib/parse-outcome-bullets.ts, and the what_changed / buildTurnFollowUp / isFollowUpTurn paths in turn-grouping.ts. Staging smoke turn_finishes_minimal now fails on a visible Send again retry pill instead of [data-testid=what-changed-card]. In-repo QA copy (docs/qa/feature-registry.md, e2e-regression-adr.md, gotchas/studio-frontend.md) updated to match.

Removed again (#746, merged 2026-10-10, merge 9f1dc9ef). The card had come back (synthesized from assistant prose plus changed-file metadata, with failed turns routed into it). #746 deleted WhatChangedCard.tsx, turn-follow-up.ts, parse-outcome-bullets.ts and the render-item variant again. Now the assistant reply renders once with no recap markup, and failures stay as normal system messages with Send again (reason, retry text and diagnostics kept). Changed-file metadata still powers undo, version thumbnails and the Code tab; next-step suggestions are unchanged. Applies to historic transcripts too.

This is now intended product behaviour on main: there is no turn-recap card, and a failed turn always shows the system pill with Send again.

Studio UI consolidation and explicit lifecycle (#633, merged) ​

#633 (yoni-monday; merged 2026-10-08 19:26 IDT, merge 61b98128) brings Dan's phone and desktop studio design onto main and supersedes #598, #599 and #595. Dan's layout, copy and animation are kept, and so are main's explicit Plan/Build mode, approval stamps and preview iframe identity.

  • No lifecycle guessing. New apps open on Draft. The Plan canvas and the phone Preview lock follow the explicit runtime mode, which owns the approval stamps and the confirmed busy state. The studio never infers lifecycle from files, assistant prose, headers or creation markers, and the unused plan-entry marker was deleted. While planning, the toast reads “Preview will be ready after your build”.
  • Counts, not names. Projects carry a server-authoritative appCount, and a project with one app is shown as that app. See Share & Invite / Projects: app counts and deletion for the new DELETE /apps/:id flag.
  • Sharing. Leaving project inheritance is now a single write (fixes a race), and the app Invite dialog makes far fewer requests (19 down to 5 with 12 apps).

Verification at merge: local bun run verify green; side env studio633 at head de92746e passed the official smoke 8/8 (create, preview, turn settle, Code tab, publish live, teardown) and a live delete-contract check 9/9. No migration and no new binding. Follow-ups: #670 sharing policy decisions, #671 plan doc still uses first-build.ts for “is built”, #672 tell the user when a flagged delete kept the project, #673 unused port files suppressed in knip.json.

Studio theme switcher (#316, merged) ​

#316 ships a Warm stone / Cool slate theme switcher in the studio sidebar (chrome of the studio, not the app preview iframe). Source: apps/control-plane/web/src/lib/theme.ts / ThemeSwitcher.

#336 proposed Cool slate as DEFAULT_THEME_ID, white chrome panels, Image logo / Image ring toggles (studio-theme-chrome), and Invite chrome tweaks — that PR closed unmerged. Until a follow-up lands, treat only the dual-palette switcher as documented product behaviour from #316; do not assume Cool slate is the factory default or that logo/ring prefs exist.

Removed in #956: #956 (merged 2026-10-15) deleted this switcher. Cool slate is now the only studio theme — see Cool slate is the only studio theme (#956, merged). The rest of this section is history.

Preview & settings ​

  • Fullscreen is real browser fullscreen of the running app, with “Open in new tab” and “Back to editor”. Esc or leaving fullscreen returns to the editor.
  • Code file tree and Settings nav share one side-nav style so switching tabs does not shift layout.
  • Settings sections (Access, People, Activity, Database, Files, Integrations) use shared SettingsHeader / org-settings layout.

Not in #143 (file as follow-ups) ​

  • Manual vs auto publish in the Publish menu; Invite modal redesign; remaining reorg-doc prompt-box / preview acceptance checklist.

Studio chunk recovery & Sentry (#182) ​

Merged #182: intermittent lazy-import failures (including PromptEditor) no longer leave the studio on TanStack’s raw error screen, and production/staging start reporting errors to Sentry.

Chunk recovery ​

  • Listens for Vite vite:preloadError and router-caught exceptions (apps/control-plane/web/src/observability/chunk-recovery.ts).
  • On a chunk-load error: report, then one automatic reload per entry-bundle build id and tab (sessionStorage key brilliant:chunk-reload:<buildId>).
  • No auto-reload when offline, session storage is unavailable, or the user has typed/changed an editable control in this document (including after an error boundary unmounts that control).
  • Do not clear the reload guard after a successful boot — a persistently failing chunk would otherwise loop forever.
  • If auto-reload does not run (or fails), StudioErrorFallback shows a usable reload screen instead of the raw router error UI.

Carry previous studio chunks on deploy (#296, merged) ​

Merged #296 (fixes Sentry BRILLIANT-1): each studio deploy used to drop the previous build’s hashed chunks. A tab opened before the deploy still imports e.g. assets/apps-<hash>.js; the SPA fallback answers with index.html, and the dynamic import fails with Failed to fetch dynamically imported module. Client recovery (#182) reloads once, but a second failure or unsaved input leaves the user on the error screen.

What landed: after source-map cleanup and before wrangler uploads dist/, scripts/env/lib/carry-assets.ts (carryForwardStudioAssets, called from deploy.ts) downloads the live build’s own chunks (listed in asset-manifest.json) into the new dist/. Only the live build’s files are carried again — not anything it itself carried — so the set stays bounded to two builds. Carriable paths match assets/<hashed>.(js|css) only. Manifest shape: { files: string[], carried: string[] }. After #387 (merged), canonical envs fetch that manifest from the control plane’s workers.dev host (the custom domain/apex is the marketing site and has no studio manifest).

Failure mode: any fetch/manifest failure ships the deploy without carrying (same as before this existed). First prod deploy after merge carries nothing (no manifest yet); protection starts from the second.

Verified on side env chunkfix: after a rename deploy, the previous chunk URL still returned 200 text/javascript; a never-served name still got the SPA HTML shell.

Studio browser telemetry ​

  • Init runs before the rest of the studio evaluates (import "./observability/telemetry.ts" first in main.tsx).
  • Captures global / React / router / React Query / mutation / chunk failures. Production builds enable Sentry only when VITE_SENTRY_DSN is set (copied from the target Worker’s SENTRY_DSN at studio build time — see scripts/env/lib/telemetry.ts).
  • Sampled browser tracing (tracesSampleRate 0.1) and session replay (0.1 sessions; 1.0 on error). Replay uses masked DOM, blocks generated-app iframes, and scrubbed URLs; SDK 11 dataCollection restrictions apply (no PII / cookies / bodies / query params by default).
  • Worker Sentry lives in @brilliant/capabilities/telemetry so the Cloudflare SDK cannot enter the SPA bundle.

Worker telemetry ​

Control plane, conductor, and dispatch wrap with withSentry / workerSentryOptions. Public SENTRY_DSN plus BRILLIANT_ENV / GIT_SHA tags. Workers report unexpected platform failures and 5xx responses; excluded from reporting: conductor waking 503 with x-brilliant-waking: 1, and responses marked x-brilliant-upstream: app (generated-app /dev-server 5xx; renamed from x-brilliant-app-origin: 1 in #243). Conductor also sets a static route tag (#217). Events are heavily minimized (no request bodies, cookies, user identity, or arbitrary exception text — only fixed diagnostic messages, source locations, and allowed tags).

Driver cause on control-plane 500s (#355, merged) ​

Diagnostic for #322 (does not fix the underlying failure by itself). drizzle 0.45 wraps every postgres.js failure in DrizzleQueryError; the driver error (with its code) sits on err.cause. Before this change, Workers logs for Control plane request error: kept only the wrapper stack — so CONNECT_TIMEOUT, ECONNRESET, and a PG SQLSTATE were indistinguishable. Sentry also drops the cause (defaultIntegrations: false → no linkedErrors; messages omitted under Worker telemetry minimization).

What landed: apps/control-plane/src/app.ts onError appends { cause_name, cause_code } from err.cause onto the existing console.error line when a cause object is present. Fixed class/code only — never a message — so no new data leaves the Worker. Sentry path is unchanged.

How to triage: for control-plane 500s (e.g. getMembership, POST /api/bi), read Worker / wrangler logs for cause_code, not Sentry. Client response bodies stay sanitized (no err.message).

Underlying wake timeout (#395, merged): intermittent ~15s hangs with Hyperdrive SQLSTATE 58000 on staging session reads / OAuth were Aurora auto-pause at 0 ACU racing Hyperdrive’s 15s origin connect timeout. Fix path is staging minAcu: 0.5 (match prod), not auth retries — see Hosting — Aurora min capacity.

Unique/FK violations return 409 again (#510, merged) ​

Merged 2026-10-06, fixes #356. Same root as #355 above: because drizzle 0.45 moves the postgres.js error (and its code) onto err.cause, every check that read the top-level err.code missed real Postgres violations. Creating an app with a duplicate name, renames, agent grants, tenants and workspaces answered 500 internal_error instead of their 409/400. Unit tests stayed green because the in-memory store sets .code directly.

What landed:

PieceBehaviour
apps/control-plane/src/lib/pg-error.tssqlState(err) walks the .cause chain and returns only a real 5-character SQLSTATE, so driver codes like ECONNRESET are never mistaken for one. constraintName(err) reads the constraint the same way. Contract sqlstate-read-through-cause.
app.ts onError23505 (unique) returns 409 conflict. 23503 (foreign key) returns 400 foreign_key_violation, kept at 400 because contract control-plane-handled-errors-reported fixes that status. Any other wrapped error stays 500.
Call sitesroutes/apps.ts, apps-rename.ts, agent-grants.ts, session-apps.ts, session-workspaces.ts, tenants.ts, internal.ts, integrations/tenant-crud.ts all use sqlState(). It replaces the ad-hoc unwraps in operations/apps.ts and templates/repo-drizzle.ts. Synthetic errors that set .code = "23505" directly still work.
Testpg-error-unwrap.test.ts throws a real DrizzleQueryError through the app (onError mapping, plus app, tenant-app and tenant create returning 409).

Rule for new code: never read err.code for a Postgres error in the control plane. Use sqlState(err) / constraintName(err) from lib/pg-error.ts, and test with a real DrizzleQueryError rather than an object with .code set. Also recorded in gotchas/data.md.

Studio source maps to Sentry (#191) ​

Merged #191 (closes #180): production/staging deploys upload hidden studio source maps to Sentry, then wipe them from dist/ before public assets ship.

Build: production Vite builds use sourcemap: "hidden" — .map files land in dist/, but the shipped JS has no sourceMappingURL, so browsers (and anyone probing the public host) never discover them.

Upload + clean: after the SPA build, scripts/env/lib/sourcemaps.ts (uploadAndCleanStudioSourceMaps) runs sentry-cli sourcemaps inject + upload against org mondaycom-3j / project brilliant, tagged with the deployed commit sha (must match the release the bundle reports). Then it deletes every .map under dist/ whether the token was missing, the upload succeeded, or sentry-cli failed — leftover maps must never reach wrangler deploy public assets. A failed upload logs a warning and does not fail the deploy.

Where it runs: scripts/env/deploy.ts (canonical / side-env control-plane deploys) and scripts/env/lib/up-deploy.ts (env:up). CD (.github/workflows/deploy.yml) extracts optional SENTRY_AUTH_TOKEN from the brilliant/<env> ASM blob (same tolerant pattern as DATABASE_URL_UNPOOLED).

Secret: catalog entry SENTRY_AUTH_TOKEN — optional: true, consumers: [] (CI-only; never written to a Worker). Missing token → skip upload, still wipe maps. See Secrets & environments.

Sanitizer: studio sanitizeTelemetryEvent previously stripped debug_meta entirely, which would defeat debug-ID source resolution even with maps uploaded. It now keeps a sanitized sourcemap-type passthrough (code_file URL-stripped, bare debug_id), matching the Worker sanitizer shape.

Still needed before calling it “live”: materialize SENTRY_AUTH_TOKEN in ASM and confirm a real staging/side-env error resolves to TypeScript in the Sentry UI.

Follow-ups still open in-repo: Durable Objects / remaining services (#179).

MCP (Connected agents) ​

External agents connect via MCP OAuth in this worker. Consent UI lives at /oauth/authorize and uses studio design tokens (see MCP server). Do not add form-action to that page’s CSP — it breaks the loopback redirect after Allow.

Flag-gated features (hide on UI, error on API) ​

Settings features behind a platform flag use requireFlag on the API (403 feature_disabled, fail closed) and FlagGatedPage on the SPA route. Internal routes with no session use requireFlagForTenant, keyed on the tenant. Pattern and flag list: Admin Feature Flags, catalog flags. Agents and Workflows joined mcp_server in #505 (merged 2026-10-06).

Data tab access (studio) ​

Owner decision (#139, merged — closes #95): an app’s live end-user data is readable and editable only by a builder-seat member who created the app, or an organization owner/admin. An app with no recorded creator is owner/admin only.

Before this, any tenant member — including user-seat app users — could read, edit, and clear any app’s data from the studio Data tab.

WhoOwn appSomeone else’s app
Builder-seat creatorallowed—
Builder-seat (not creator)—403
Owner / adminallowedallowed
User-seat403 (seat check)403
  • Enforcement: creatorOrAdmin on operations/define.ts, checked by appOp (app createdBy) and workspaceOp (earliest app creator in the workspace) after load; owners/admins always pass; tenantOp refuses the option at declaration. Registry pins it per operation.
  • Routes: all ten Data tab routes in routes/data.ts go through operations/data-rows.ts with seat: "builder", creatorOrAdmin: true (reads data:read, writes write). Refusal body: { error: "forbidden", message: "Only the app's creator or an organization admin can do this" } (user-seat refusals may omit the message; studio keys on the code).
  • Studio UI: a 403 forbidden shows a locked “Data is limited to the app’s creator” panel (no refresh / retry / row actions), not the red error card.
  • MCP: data_schema / query_data use the same rule — see MCP server.

What the Data tab lists ​

buildDataOverview (apps/control-plane/src/data/overview.ts) builds the table list from sqlite_master and excludes platform/internal names so builders only see user collections:

  • FTS side tables (%_fts, %_fts_%)
  • ORM bookkeeping (_prisma_%, _drizzle_%)
  • The app-events outbox table _brilliant_events (#307, merged)

_brilliant_events is still written and read as usual (see Workflows — Triggers). Agent-facing describeWorkspace (codemode) is unchanged and may still surface it.

What the Code tab lists (#523, merged) ​

The studio Code tab file tree comes from GET /apps/:id/source. The control plane filters that list with visibleSourcePaths (apps/control-plane/src/lib/workspace-source-path.ts) before Studio sees it, so the filtering is server-side; there is no extra frontend filter.

  • Paths that isAllowedSourceReadPath rejects are dropped, so the tab never auto-opens a file that would fail with "Path is not allowed for Code view".
  • Root directories in SOURCE_TREE_BLOCKED_ROOTS are dropped along with everything under them. Since #523 (yoni-monday; merged 2026-10-06, merge 6c3e40ed) that set holds only .brilliant, so the app's platform folder (config, skills) no longer shows in the explorer.
  • The blocklist only matches the top-level segment: a nested src/.brilliant/... still lists.
  • The blocklist affects listings only. File-read permissions are unchanged, so .brilliant/config.json is still readable by path.

To hide another platform folder from the tree, add its root name to SOURCE_TREE_BLOCKED_ROOTS. Live smoke and screenshots for this change are tracked in #524.

App policy KV keys (disable / delete) ​

Admin kill switch and app/workspace delete write into the shared APP_POLICIES KV. Key format and helpers are documented on Dispatch — App enablement & tombstones. Always use disabledAppKey / deletedAppKey from @brilliant/capabilities — never hand-build app:…:disabled / :deleted strings (#250, merged).

BI ingest (POST /api/bi) ​

Studio and site browsers post behavioural events here. Catalog and emitter classes: BI events.

  • Merged #363 (bi-browser-events-only, closes #309): only BROWSER_BI_EVENTS; a platform name in the batch → 400 and nothing emitted. placement cannot be MCP_PLACEMENT (mcp). Platform rows (signed_up, app_created, …) come from server paths only. Classification: BI_EVENT_POSTED_BY in bi-events.ts.
  • Merged #364 (bi-visitor-ingest-bounded, closes #321): no session → only VISITOR_BI_EVENTS, identity fields stripped, BI_VISITOR_RATELIMIT 30/min/IP; a presented session (even invalid) never takes that path.

Integrations (Settings + agent proposals) ​

Studio Settings → Integrations covers managed (Composio) connections and custom API-key definitions. Agent-proposed customs (#369, merged): the coding agent calls integration_propose_custom; the user types the key on a control-plane page (never in chat); definition + connection exist only after a successful GET probe. Policy flag custom_integration_settings.admin_only (default off). Full contracts: Integrations.

Studio UI: Dan's design on main (#688, merged) ​

PR #688 (merged 2026-10-09) replaces #614, #604, #615 and #626. Rule: Dan's design wins on visuals, Yoni's logic and data win on behaviour. No DB migrations; app-summary gains additive caller access and published script name.

  • Folder rule (left panel, Home grid, Browse, launcher, phone Projects): from server appCount, a project with exactly 1 app shows as a plain app row under Apps; 0 or 2+ apps is a folder under Projects. Helper api/app-count-grouping.ts. Invite's "Same as <project>" shows only for 2+.
  • Stable turn state: Publish stays disabled until the first build finishes and the preview is full size, derived from build + turn state, never session connection status (which dips on reconnect). The same signal drives plan doc Start building / Edit app, Delete, Version history, To-dos pill, phone pill, canvas tab and chat FAB. "Delete app…" is blocked during a turn with "Can't delete while the app is building".
  • Settings: new Apps tab (app → its settings); General keeps Name, Organization ID, Email domain, Sign-in. Phone "App settings" picker removed. Members page with real Seats section.
  • Menus: all Radix menus share one 1px panel style; tests fail if a menu adds its own border/shadow.
  • Home: desktop Home uses the shared hero/prompt/chips/cards from packages/composer. "Add to project" is visible but disabled ("Coming soon"). Organization switcher hidden.
  • Hidden from UI, code kept: full list in docs/mobile-v2-parity.md → "Hidden from UI (infra kept)" (project page, main's Publish modal, Share as template, Customers tab, install pages, etc.).
  • Decision: apps/site keeps main's landing for now; moving it to the shared hero is a follow-up.

Studio follow-ups after #688 (#726, merged) ​

PR #726 by danfishbein, merged 2026-10-10 09:32 IDT.

  • Send on Home opens /apps/new with the editor loading frame right away while the ~10s create runs, then replaces to /apps/:id. On failure it returns to Home with the prompt and an inline alert; retry resends the same request.
  • New apps land on Plan with the doc skeleton from the first frame (no preview wake, no "Build mode: on" before the agent decides).
  • Plan doc: desktop callers must pass appId so sections type in after every answer (a source scan enforces it); rewrites of seen text crossfade in place; Copy plan works from the first section ("Nothing to copy yet" when empty); Start building with open questions says "Answer the open questions to start building".
  • First-build window: neutral surface with the Brilliant mark until the template posts its hmr-status message, replacing the old load-plus-probe cover. Caption uses components/text/text-enter.tsx.
  • Disabled controls explain why via tooltip (desktop) or toast (phone) and stay focusable with aria-disabled, e.g. "Publish will be available when your app is ready", "Not published yet".
  • Settings → Apps search reuses launcher search pieces, now shared in components/search. Left panel "New project" is hidden until a move-to-project route exists.
  • Design behaviour suite (scripts/design-suite): 28 Dan-approved behaviours, each with browser tests, guarded source and a breaking mutation. bun run design-suite runs them; --prove (clean tree) checks each mutation fails its tests; --changed, --staged, --list-affected <range> select by changed files. Opt-in commit gate: git config brilliant.designSuite true. Behaviours 2, 8, 13 still lack browser tests. See Verify & ship.
  • Known open: a preview still blocked after build shows Chrome's error page full size; Add to project stays Coming soon; create latency ~1.4s naming + ~8.6s create.
  • @brilliant/studio-ui, @brilliant/design-tokens, @brilliant/api-types
  • @brilliant/capabilities for shared JWT helpers and Worker Sentry (@brilliant/capabilities/telemetry)

Async app launch from Home (PR #735) ​

Merged to main 2026-10-10 14:50 IDT (PR #735, merge 7a9c2213).

  • Before: Home Send waited for the AI title, then container/init, then navigated, and the first prompt only showed after the stream snapshot.
  • Now: the chat and submitted prompt paint immediately (title shows a shimmer). The control plane commits the canonical app plus a durable launch intent, then environment preparation and naming run independently in a Cloudflare Workflow (APP_LAUNCH_WORKFLOW, Pulumi resource brilliant-app-launch). The editor preloads on composer focus, and the original prompt id is reconciled after readiness.
  • Naming is async, never overwrites a manual title edit, and releases the shimmer on failure.
  • An outbox survives a lost scheduling response; retry and reload keep the same creation and prompt ids; tenant changes can't redirect an old receipt to another org.
  • Each Workflow step reloads current principal and authority (no stale authority cache). Existing synchronous callers stay synchronous unless they opt into async launch.
  • Rollout: migration 0040 (app_launches) is append-only and must be applied before code that reads it; the Workflow binding and Pulumi resource need a reviewed infra/code rollout order.

New-app launch flow (#805, merged) ​

#805 (merged to main 2026-10-12 00:04 IDT, merge f609fc4b) makes the leadership-demo path real: Home, then questions, plan, build, live app, share.

StageWhat landed
Home inputBecomes the first agent message. It is no longer stored as apps.goal; it is held durably in app_launches.first_prompt (migration 0045) until the creator's client admits it.
Early agent startChat starts before the container is ready. Container tools and checkpoints wait on one readiness gate; the checkpoint baseline is the seeded tree.
PlanOne question batch. Sample rows only go in the app's own collections, never in place of a connected service's data; an unconnected service shows an empty state that names it.
BuildLive progress window with real tool activity and To-dos (pending, running, done). The builder prompt asks for the first visible write within three build steps, with no filesystem exploration.
DoneAutomatic publish only while the app is restricted; the server refuses {automatic:true} otherwise. Manual publish is unchanged. The first share waits for, or joins, its publish (one deploy). Published apps open in a new tab; automatic and share publishes open none.
ProjectsOne persistent default project per tenant and user (migration 0043). Project moves are gated closed (0044 adds intents only). See Share & Invite / Projects.
UICode moved into Settings (App settings nav), What's next chips, in-chat Connect row, Figma icons. Studio smoke code_tab_loads opens Code from Settings. (Canvas on create: see #817 merged — Preview loader until actual Plan mode, not an empty Plan doc.)

Rollback caveat: an app created on this release keeps its first prompt in app_launches.first_prompt until admitted. Rolling back before then leaves the prompt unsent (the old release reads apps.goal), so the user retypes it. Code is a two-way door; migrations only add tables or columns, and 0043 widens a check constraint to a superset.

Blast radius: wide (launch, chat connection, publishing, sharing, editor shell). Verify a fresh app end to end on staging before promoting to prod.

Known follow-ups: the build window sometimes needs a reload after approval; one side-env app stuck on "Connecting to Brilliant…" after a conductor redeploy mid-launch (bare 503, under investigation).

Preview loader until Plan mode (#817, merged) ​

#817 (merged 2026-10-12 10:20 IDT by yoni-monday, merge 671cebb2, branch fix/preview-until-explicit-plan-mode) sets how the editor canvas chooses Preview vs Plan on create and reload. Landed on main.

Session stateCanvas
App creation / first prompt / mode unknownPreview + shared loading orbs (PreviewStarting; after the build window opens, only the window's own cover — see #924)
Session reports PlanPlan document
Session reports BuildPreview
  • Removes the hard-coded empty Plan canvas from PendingEditor and the firstModePending / settled-proposal guesses in useCanvasTab.
  • Canvas tab selection is mode-driven only: old proposal history cannot open Plan while mode is Build or unknown.
  • One accessible house loader covers preparing the app and the start of the first prompt; Preview stays mounted under it.
  • Actual Plan mode, explicit Review plan, approval/build handling, and automatic-publish readiness stay unchanged.
  • Blast radius: preview (two-way door). No backend, mode-producer, or auth changes.
  • Verification at merge (from the PR): 56 focused checks passed (canvas lifecycle, desktop/phone pending editor, creation retries, automatic-publish boundaries); web typecheck, Biome, size/diff, and design detector passed. Local Chromium harness only; full CI gates deployment.

Related: New-app launch flow (#805).

Per-model effort scales and Muse Spark 1.3 (#820, merged) ​

#820 (merged to main 2026-10-12 14:22 IDT by yoni-monday, merge 77de74fa) replaces the fixed Quick · Balanced · Brilliant slider with a per-model effort scale and adds Muse Spark 1.3 to the picker.

ModelNative effort stops (variants in packages/composer/src/model-catalog.ts)Top stop sends
GPT-6 Luna, GPT-6.1 Sol, Muse Spark 1.3low · medium · high · xhigh · maxmax
Claude Opus 5.5 (default model)low · medium · high · xhigh (max withheld, #827)xhigh
Gemini 3.8 Flashlow · medium · highhigh
  • Labels: the highest stop a model offers is always shown as Brilliant; the native value sent upstream stays max, xhigh or high. Other stops use LEVEL_LABELS in packages/composer/src/model-picker-copy.ts: Quick (low), Balanced (medium), Extra High (xhigh), Max (max). The slider's pole labels now come from the model's first and last stop instead of fixed Quick / Brilliant copy.
  • Help tip now reads that higher levels give the model more time and can use more credits, and that available levels depend on the model.
  • Saved or restored choices: resolveThinkingLevel keeps a stored level only if the selected model offers it; otherwise it falls back to medium (or the model's first stop). An unsupported choice is never sent upstream. Picker, stored preferences, prompt admission and the conductor runtime all use the same per-model list.
  • Luna and Sol previously had no variants (the slider was a no-op for them, the old "known quirk" above); Gemini now has three real stops.
  • Defaults unchanged: default model is still Claude Opus 5.5 and Kimi is untouched. Superseded by #905: new Studio builds now start in Auto mode (see Studio Auto mode).
  • Cost: Extra High and Max can use noticeably more credits and time.
  • Deploy order caveat (from the PR): the canonical pipeline deploys control-plane before conductor, so during a mixed-version window a new picker level can be rejected by an older conductor. Not enforced by this PR.

Runtime side (Muse route, per-model validation, Opus max cap): Conductor: Muse Spark 1.3 and per-model thinking levels. If a turn is refused with thinking_level_not_offered, see Troubleshooting.

Studio Auto mode (#905, merged) ​

#905 (merged to main 2026-10-14 11:39 IDT by yoni-monday, merge 978dedc2) makes Auto the Studio default. When no model is picked, the picker shows only a tier, and the conductor picks the model for that tier from admin config, so changing what a tier runs needs no deploy.

Picker (LandingModelPicker, used on Home, in the editor, and in the phone sheet):

BeforeAfter
TriggerThinking level plus model name (e.g. "Balanced Claude Opus 5.5")Tier only (e.g. "Balanced"); Auto hides the model
SliderThe model's own effort stops (low … xhigh)Auto tiers: Quick · Balanced · Deep · Brilliant (packages/models/src/auto-mode.ts)
More models"Default" (Home only), Opus, Haiku, …Auto, Opus, Haiku, … (Auto in the editor too)
  • Wire format: the SPA sends { model: "auto", thinkingLevel: <tier> } on POST /agent/prompt and on /agent/model, on every prompt. The conductor resolves it (see Conductor: Auto tiers).
  • Picking a concrete model (e.g. Gemini) sends that model as before (gemini-3.8-flash), and the per-model effort scale from #820 applies. Switching back to Auto hides the name again.
  • Selection logic: DEFAULT_STUDIO_SELECTION and STUDIO_MODEL_CHOICES (Auto first, then the catalogue) in @brilliant/models; Home and editor read them through useStudioModelSelection.
  • Saved choices: apps with a saved concrete model keep it and keep showing its name; they are not switched to Auto. A stored brilliant_model_<app> = "auto" falls back to the default if the PR is reverted.
  • Deploy skew guard: the conductor advertises AgentSession.autoTiers. If the session has no autoTiers (an older conductor), the editor hides Auto and sends a concrete model (Claude Opus 5.5 at medium), so the SPA never sends auto to a conductor that would reject it. Ship the conductor before or with the SPA.
  • Default shift: with the code-default tiers, a new Studio build runs Muse Spark 1.3 at medium (Balanced) instead of Opus at medium, which changes cost and quality. Operators change it in admin Config (see Admin Config: Studio model keys).
  • Removed: the studio_haiku_5_5_default flag (and the optional Haiku default it controlled). Its value may still be set in Flagship; delete it there. The design-suite behaviour haiku-default is now auto-mode.

Evidence at merge (from the PR): auto-mode.client.test.tsx in a real browser at 1280 and 390 px (Home's first prompt sends {auto, balanced} and the trigger reads Balanced; moving to Deep sends {auto, deep}; a session without autoTiers hides Auto and sends Opus medium); bun run design-suite --prove --only auto-mode proven.

Clarify card holds the first Studio turn (#900 product, #913 smoke) ​

Since #900, a first Studio prompt can open the clarify setup card before any build starts. The card’s primary actions are Pick for me (QuestionCard.tsx) and Skip, just build it (QuestionCardSkipAllFooter / QuestionCardRoundNav.tsx). Until one is chosen, the prompt is held and the turn does not start.

#913 (merged 2026-10-14 11:55 IDT, 67c87b62, fixes #912) updates Studio smoke and the permissions journey to dismiss that card via TURN_GATE_BUTTONS / clearTurnGates. Product thresholds in packages/clarify are unchanged.

Related: Verify & ship: studio smoke clarify gate, Troubleshooting.

First-build window: show app when it draws, hold through a question (#924, merged) ​

#924 (opened 2026-10-14 14:00 IDT by Brilliant Fixer / monday-sphera-ai[bot], branch fix-build-window-states; merged 2026-10-14 14:12 IDT by yoni-monday, merge d96818ed, head 988e02df unchanged from the open review) fixed two first-build window bugs reported by Yoni. This is the behavior on main now.

What was wrong

  1. Logo over a drawn preview. PreviewStarting (full-pane logo while firstBuildPending) stayed on top of the build window until the agent's first file write. The window underneath could already have drawn the app (one live case: app at 19.6s, logo until first write at 102.6s).
  2. Full preview then shrink back. A mid-build question card stops streaming (derive-messages drops the final segment while a card is pending), so turnRunning reads false. useCanvasTab then ended the build, the window grew to full preview, and it shrank again when the answer resumed the turn.

Fix (SPA only)

FileChange
PreviewPane.tsxPreviewStarting only before the build window opens (showBuildPlaceholder). After that, the window's own logo cover is the only loader, and it lifts when the app draws.
use-canvas-tab.tsA pending question counts as the first build still running for the window only (`running = isStreaming

Intended sequence: logo → window with logo → window with app → one grow into the full preview.

Not changed (follow-ups from the PR): failed first older-history page fetch leaves historyComplete false with no retry (no window at all); ~13-minute preview-token remint reloads the draft iframe.

Verification (from the PR): two new tests in preview-build-window-browser.test.tsx (before first write: no preview-starting over the window; pending question keeps window state); design-suite behaviours hold; live side-env bw-probe before/after timings.

Related: Builder preview XState machine (#934, merged), Preview loader until Plan mode (#817), Clarify card holds the first turn, Troubleshooting.

Builder preview: one XState machine owns the first-build canvas (#934, merged) ​

#934 (opened 2026-10-14 15:40 IDT by yoni-monday, branch builder-state-machine; merged 2026-10-14 20:22 IDT by yoni-monday, merge 0e96a0ec, final head acf809d1) consolidates the first-build canvas into one XState machine and makes the window caption read the same words as the chat row. It builds on #924 (both #924 rules and their tests carry over). This is the behavior on main now.

Why it still flickered after #924

About eight hooks each held part of the canvas state (use-canvas-tab, use-build-placeholder, use-build-window, PreviewPane flags, firstBuildPending) and they changed at different moments:

  1. Too-small canvas. When the canvas was too small for the window, the window switched off. The preview grew into the live app while the agent was still building; the "app has drawn" flag reset, so the logo returned when the window came back. Sequence on main before the fix: window → growing → full mid-build.
  2. Three logos. PreviewStarting, the window cover, and the DraftPreviewStatus overlay each showed depending on which flag flipped first.

Design (SPA only; on main)

PieceRole
components/builder/builder-machine.tsOwns canvas states: starting (full-canvas logo before the first prompt), window, settling (hold after build ends), growing, full. Also holds the canvas tab. 450ms grow and 5s grace are delayed transitions. "App has drawn" lasts for the whole build (logo never returns once drawn). Switching app resets in one transition.
BuildWindowStateless: draws what the machine says. Too-small canvas shows the build full size and still view-only, then becomes the window again when it fits. Window cover is the editor's only logo loader.
deriveBuildFacts (first-build.ts)One definition of "first build"; replaces firstBuildHolds and requires a launch prompt. A template install's first edit no longer gets the build window (matches Publish). Phone Preview lock reads the same facts.
toolRowLabelCaption, chat row, and run_script row all read the same label (progress, error/stopped, folded groups, script summaries).

Deleted: use-canvas-tab.ts, use-build-placeholder.ts, the state half of use-build-window.ts (renamed to use-element-size.ts), and their tests.

Dependencies: adds xstate and @xstate/react to the web app.

Not in this PR (planned next, from the description): server-side built_at on the app (replace message scanning and three browser memories); build-completion announcement, and chat first-build consumers into the machine. Publish state moved into its own machine in #935 (merged 2026-10-15). Preview readiness (token, waking, HMR, fail clock) moved into its own machine in #937 (merged into the publish-machine branch, not yet on main). The chat's workspace connection moved into its own machine in #936 (merged 2026-10-15).

Verification (from the PR): 11 machine tests with a simulated clock; resize test that fails on main; caption tests vs chat row; full web suite green; design-suite --prove for build-window-small-canvas (#47), build-window-neutral, first-build-window. Side env builder-sm.

Related: Admin client state: XState conventions for the admin app (#922), First-build window states (#924), Publish XState machine (#935, merged), Draft preview readiness (#937, not on main yet), Preview loader until Plan mode (#817), Troubleshooting.

Publish: one XState machine owns the beat, error and in-flight run (#935, merged) ​

#935 (opened 2026-10-14 21:14 IDT by yoni-monday, branch publish-machine; merged 2026-10-15 09:56 IDT by yoni-monday, merge c056aae6, final head 58ccec0a) is the second XState follow-up planned in #934: the editor's publish state moves from refs and effects in usePreviewDeploy into one machine. Nothing changes for the person publishing, except two edge cases the old code got wrong (below). This is the behavior on main now.

Why

usePreviewDeploy held publish as an implicit state machine spread across:

  • two timers (success beat, and "Publish failed" → Retry);
  • a ref for the publish in flight (a first share joins it);
  • a ref (liveSeenFor) that bridged "published, but the app hasn't read live yet";
  • an error string set from three places, including PreviewPane on an app switch.

These had to agree with each other and with the React Query mutation's isPending / isSuccess.

Design (SPA; on main)

PieceRole
preview/publish-machine.tsStates: idle, publishing, success ("Up to date" beat), failed (message, then Retry). Owns error, in-flight run, and live bridge (awaitingLive). Beat timers are delayed transitions. A second publish while one runs joins it (share or automatic), not a second run. Switching apps resets and drops the left-behind publish.
usePreviewDeployKeeps side effects: deploy request, reserved tab for a pressed Publish, type-error repair, automatic-publish gate. Return shape unchanged minus setDeployError (only caller was PreviewPane app-switch reset; the machine does that now).
isLiveUses awaitingLive from the machine instead of the mutation's lasting isSuccess, so an unpublish in the same tab no longer leaves Live stuck.

Outcomes: published, refused (quiet automatic policy/409), busy (workspace held — message, no failed beat), failed.

Review follow-ups before merge (4 commits after e7c06c6b): a deploy that throws still ends the publish (the machine never sticks in publishing); the busy check moved into the machine; switching back to an app whose publish is still running picks that run up again instead of showing idle; formatting. Design-suite entry 48 one-publish-at-a-time is marked as having no browser test yet.

Fixes that fall out

  1. App switch mid-publish. The publish of the app you left no longer paints its error or success beat on the app you switched to (before, only a type-check failure was dropped).
  2. Live tab after an unpublish. Live tab state no longer uses the mutation's lasting isSuccess; it uses the same live bridge as the live link.

Verification (from the PR): 9 machine tests with a simulated clock (publish-machine.test.ts); existing hook-level tests unchanged (175); design-suite --prove for 29–32, 35 and new 48 one-publish-at-a-time (no browser test yet); tsc / biome / knip / check-file-size clean. Not run: e2e-smoke / screenshots (need a signed-in session).

Related: Builder preview XState machine (#934), Draft preview readiness (#937, not on main yet), Publish typecheck failures (#490), Troubleshooting: publish beat bleeds across apps / Live after unpublish.

Chat: one XState machine owns the workspace connection (#936, merged) ​

#936 (opened 2026-10-14 21:17 IDT by yoni-monday, branch session-connection-machine; merged 2026-10-15 09:17 IDT by yoni-monday, merge 3bda6c86, final head 634b9e21) is the third XState follow-up from #934: the chat's connection to the workspace (mint the client, open the event stream, retry) moves from mutable variables in createSessionConnector into one machine. There is no visible change; the goal is that the reconnect rules are readable states instead of a loop that re-checks "am I still current?" after every await. This is the behavior on main now.

Why

createSessionConnector (chat/hooks/session-connection.ts) kept the connection's state in loose variables that had to agree:

  • a generation counter and an abort controller, re-checked after every await by a stale() closure;
  • a gaveUp flag, so its own give-up abort didn't count as a superseded connection;
  • booted and everBooted;
  • two retry counters;
  • two separate setTimeout schedulers, one for backoff and one for "environment preparing".

Design (SPA; on main)

PieceRole
chat/hooks/connection-machine.tsStates: idle (before first connect, or disposed), establishing (mint or reuse the client; a promise actor), streaming.booting (stream open, snapshot not yet in), streaming.live (booted; frames feed the reducer), preparing (short fixed retry while the workspace is prepared), waiting (backoff), failed (stopped, shows Reconnect). The stream is a callback actor. A new connect, Reconnect or dispose leaves the state, which stops the child actor and aborts its stream, so a superseded connection can never report again — the generation counter and stale() checks are gone.
Retry rules (guards)Retry fast while preparing (250 ms for the first 20, then 1 s; up to about 5 minutes / 315 retries). A refused identity (non-retryable auth) stops at once. A connection that never booted stops after 6 backed-off attempts (about 45 s), or 20 for a waking workspace (about 4.5 minutes). Once a stream has booted, later drops keep reconnecting behind the transcript with no error.
20-second give-upOwned by the stream actor, not the machine: XState defers sendTo until after the transition, by which point the child has stopped, so a machine-side timer would trace a give-up as "cancelled" instead of "error". Response-trace spans (client_auth, stream_snapshot, session_received) are unchanged.
session-connection.tsNow a small handle over the actor with the same API (connect, reconnect, dispose, getClient, getSessionID), so use-agent-session and prompt-sender don't change. dispose returns the machine to idle, because the hook connects again when the workspace or token changes.
reconnect-policy.tsscheduleReconnect removed (no other caller). establishAgentClient, getReconnectDelay and the error classifiers stay.

Review follow-ups before merge (2 commits after de78aabf): explicit types for the client and its input, a typed done output, the error kept in machine context, a pure assign, and a fresh connect now starts the retry counts over (so a new connect after a stop gets the full retry budget again).

The first prompt is still seeded on boot: an empty conversation gets the launch prompt sent under its id (a resend reuses the id, so the conductor admits it once); a conversation that already started settles it instead.

Verification (from the PR): all 10 existing session-connection.test.ts tests pass unchanged (real connector, fake client, patched timers: give-up and reopen, preparing retries, refused identity, give-up with Reconnect, first-prompt seed and settle); 3 new connection-machine.test.ts tests (a superseded stream never feeds the session; dispose stops retrying and a later connect works; a stream the server ends after booting reconnects with no error); 30 chat/connector/reconnect test files (323 tests) pass; design-suite --changed passes; tsc / biome / knip / check-file-size clean. Not run: e2e-smoke (needs a signed-in session). Worth watching live: a conductor deploy (waking workspace), a laptop sleep, and a brand-new app while its environment is prepared.

Related: Builder preview XState machine (#934), Publish XState machine (#935, merged), Draft preview readiness (#937, not on main yet), Conductor, Troubleshooting: chat stuck on Connecting.

Draft preview: one XState machine owns readiness (token, waking, HMR, fail clock) (#937, merged into branch, not on main) ​

#937 (opened 2026-10-14 21:36 IDT by yoni-monday, branch preview-readiness-machine, final head 4a77099e; merged 2026-10-15 09:56 IDT as 9643c33d) is the third XState follow-up planned in #934: whether the draft preview counts as loaded moves from three hooks and four pieces of PreviewPane state into one statechart, preview/draft-preview-machine.ts. Nothing changes for the person building, except two leaks the old code had (below).

Not on main yet

#937's base was publish-machine, the branch of #935. #935 was squash-merged into main at 09:56 IDT (c056aae6), and #937 merged into publish-machine about 30 seconds later, so its changes landed only on that branch. As of 2026-10-15 ~10:00 IDT, main has no draft-preview-machine.ts and still has usePreviewWaking.ts and the other old hooks. The design below describes the PR, not what main runs. Re-landing it on main needs a new PR from preview-readiness-machine (or publish-machine) into main; flip this note when that merges.

Why

Whether the draft counted as loaded came out of several pieces that had to agree:

  • useDraftPreviewLifecycle: a mark-loaded effect that reads the token, HMR and the document probe.
  • usePreviewWaking: its own probe timers, a fast and slow cadence, and a pause flag.
  • usePreviewElapsed: a clock in milliseconds that ticks every second for the slow and failed thresholds.
  • PreviewPane state: isDraftLoaded, hasDraftEverLoaded, isReloading and retryGeneration, plus an uncleared 1.2 s setTimeout for the reload spinner.

Design (SPA; merged into publish-machine, not yet on main)

PieceRole
preview/draft-preview-machine.tsThree parallel regions. frame: deciding → preparing → loading (delayed slow / timeout) → ready / failed. HMR readiness counts only while the workspace is awake; a document read that errors while ready returns to loading. waking: document reads every 2 s for 30 reads, then every 5 s; pauses while preparing, when the token has failed, or when the frame has timed out; a successful read emits wakeResolved and the pane reloads once. spinner: reload control spins at most 1.2 s and stops when the frame loads or settles.
use-draft-preview.tsFeeds the machine URL, token, HMR and preparing; exposes frameLoaded, frameError, wake, reload and spin plus the derived view for PreviewPane.
use-draft-frame-events.tsReports loads and errors to the machine, not to setters.
draft-preview-ready.tsGains probePreviewDocument (one read, aborted after 5 s) for the machine to invoke.
DraftPreviewInput.clockrunning, slow or timedOut replaces elapsedMs, so nothing ticks every second.

Deleted: useDraftPreviewLifecycle.ts, usePreviewWaking.ts and usePreviewElapsed.ts.

Fixes that fall out

  1. Stale probe URL. A probe result for a URL the pane has moved past is dropped, so a stale load can't mark the new URL loaded.
  2. Reload spinner after switch/unmount. The spinner's timer is a delayed transition, so it no longer fires after an app switch or unmount.

Verification (from the PR): 9 machine tests in draft-preview-machine.test.ts (simulated clock, faked document read: slow→failed→late load, HMR while waking, 2 s / 5 s cadence, reload vs Retry and clock, pausing, spinner, probe error while ready, preparing, app switch); existing preview-lifecycle, draft-preview-status and draft-preview-ready updated to clock / ProbeResult; design-suite --validate and --changed pass; --prove PROVEN for 3, 5, 22, 23, 29–32, 34, 35 and new 49 draft-ready-not-while-waking (needsBrowserTest); tsc / biome / knip / check-file-size clean. Not run: e2e-smoke / screenshots (need a signed-in session). A real workspace waking from sleep has no browser test yet.

Related: Builder preview XState machine (#934), Publish XState machine (#935, merged), Workspace connection (#936, merged), Troubleshooting: stale preview load / spinner after switch.

Studio sidebar: order by latest edit (#933, merged) ​

#933 (by yoni-monday, branch sidebar-order-by-recent-edit; merged 2026-10-15 09:56 IDT, merge 925ae6c7, head 4b67be9f) orders the studio sidebar by the latest change: projects, and the apps inside each project, sort newest first, then by name. Before, the order came from recent opens, creation time, or name.

What the user sees

  • The project or app you last opened from the sidebar, or last edited in the builder, moves to the top.
  • An edit inside a project lifts that project too: a project's updatedAt folds in its apps' times.
  • With no recorded time for anything, the sidebar stays in name order.
  • The row moves without a refetch: the tree subscribes to the opened-at revision with useSyncExternalStore, so a stamp written after paint reorders it right away.

Times are browser-local

The server still has no edit timestamp. Stamps live in this browser's localStorage under brilliant_project_opened_at (apps under an app: prefix, written by recordAppOpened in recent-projects.ts). Two things write a stamp:

  1. Clicking an app in the sidebar (SidebarRows.tsx).
  2. A builder turn finishing, i.e. an edit (use-app-detail-query-invalidation.ts).

The model's updatedAt is the latest of the server creation time and this browser's opens/edits: bestTime now takes the max of both, instead of creation-or-else-opened (project-model-build.ts). ProjectTree.tsx sorts with recentFirst on updatedAt. Another browser, a private window, or cleared site data has its own (or no) stamps, so the order can differ there.

Related: Share & Invite / Projects: sidebar order, Troubleshooting: sidebar order differs across browsers. Open #986 moves order to server last_edited_at so opens no longer reorder sidebar/gallery/bylines.

Studio sidebar: server last-edited order (#986, open) ​

PR #986 (Brilliant Fixer / monday-sphera-ai[bot], branch fix-sidebar-last-edited, head db0961b35c57339ad48682ce5390b59914bdb3a4; open, opened 2026-10-16 ~11:07 IDT) replaces the browser-local sidebar times from #933 with a server apps.last_edited_at.

What changes for the user (once merged)

  • Sidebar, All-projects gallery, and "edited … ago" bylines order by the last builder turn, not by opening an app in this browser.
  • Opening an app no longer moves it (or its project). Recents still use opens.
  • An edit inside a project still lifts the project: a project's updatedAt is the latest of its apps' edit times (and its own creation).
  • Until an app's first builder turn after deploy, it sorts by creation time (no backfill).
  • Order updates when the project list refetches, not live mid-turn.

How it works

PieceBehaviour
Migration 0053_app_last_edited_atNullable apps.last_edited_at (add-column only).
/ingest/turnstore.markAppEdited for every builder step attributed to an app; skips source: "app_runtime" and replayed receipts; stamp failure is logged and never fails ingest.
AppSummary.lastEditedAtOptional ISO time; list falls back to created_at.
Studio project-model-build.tsApp updatedAt = latest(createdAt, lastEditedAt) only — browser opens are not mixed in.

Related: Share & Invite / Projects, Troubleshooting: sidebar order after #986, #933 browser-local history.

Site endpoints from the Figma redesign (#944, merged) ​

PR #944 (merged 2026-10-15 11:16 IDT by yoni-monday, merge 76b2873f) adds control-plane routes the marketing site proxies:

  • POST /v1/prompt-suggestions: up to 5 chips from a fast model for the typed text; per-IP limit (SUGGEST_RATELIMIT), 2,000-char cap, 2.5 s timeout, catalog fallback, no-store, text never logged. A request carrying a session cookie goes through the session middleware (expired cookie is a 401).
  • POST /v1/suggestions with { q, sources }: same cards as the GET, without the text in a URL.
  • POST /api/contact: Contact us form to the signup Slack channel (#incoming in the brilliant.ai workspace since #993, merged; live after the prod deploy); name, email, message validated; 3 a minute per IP on a separate bucket of the demo-start limiter; awaited, so a Slack failure is an error the visitor can retry. Staging and side envs accept it without a Slack token.
  • POST /auth/login (prompt in the body), screen=signup, ext-tools, nonprod connection= hint (#954, merged, sends signup as ext-screen=signup when defaulting to the email connection); /auth/callback sets the one-time new-account cookie that lets /start auto-build only for a brand-new tenant.

Full behavior: Marketing site — Site and login redesign.

Email-code login defaults (#954, merged) ​

PR #954 (merged 2026-10-15 12:43 IDT by yoni-monday, merge e722b7bc, head 46f6236f, branch login-screens-fix) changed how /auth/login builds the Auth0 authorize request when the ACUL screens are on. Before it, screen=signup always sent screen_hint=signup.

  • Why: with the password and email connections both enabled and password sign-ups disabled, screen_hint=signup starts a password sign-up and Auth0 answers "signup is disabled".
  • AUTH0_EMAIL_CONNECTION: new env, email in nonprod wrangler. Prod render deletes it, the same way it deletes AUTH0_DATABASE_CONNECTION.
  • emailConnectionDefault / loginConnectionParams: when BRILLIANT_ENV is set and not prod and the env is present, plain /auth/login and /auth/app/login set connection=<that name>.
  • Signup: when defaulting to the email connection, signup puts ext-screen=signup (constant SCREEN_PARAM = "ext-screen") instead of screen_hint. The login-id screen reads it for signup copy.
  • Explicit hint wins: an explicit connection= (the e2e password hint, the notice's Google) is kept, and signup then still uses screen_hint as before.

Infra side (studio client filter, after-merge re-run): Hosting & infra — #954. Screens: Marketing site — login and sign-up. Env: Secrets & envs — AUTH0_EMAIL_CONNECTION.

Google restart on email-code login (#957, merged) ​

PR #957 (opened 2026-10-15 13:20 IDT by yoni-monday, branch login-google-via-studio; merged 2026-10-15 14:31 IDT, merge 0ab3e8d9, head 695bea4e) fixes Continue with Google on the ACUL screens after #954. It takes effect on staging once the deploy and the infra.yml re-run below are done.

Why: Auth0 refuses a switch to Google inside the email-code flow's connection=email transaction. Federated login from that screen stayed on the identifier page.

ext-google: when nonprod defaults to the email connection, loginConnectionParams also sets ext-google (GOOGLE_ENTRY_PARAM) to a restarted login entry with connection=google-oauth2:

  • /auth/login restarts via studioGoogleRestart(origin, fields): {origin}/auth/login?connection=google-oauth2&keep=1, plus the login's invitation_kind and invitation_id when present. It is built from the login's own fields, never the request URL, because a POST body carries the prompt and that must not travel in a URL. return_to is left off: the first leg's cookie carries it and keep=1 spares it, and a full authorize URL would push the encoded restart past Auth0's 255-character cap.
  • /auth/app/login uses loginRestart(reqUrl) in auth0.ts: the same app-login URL with connection=google-oauth2 (honours the hint; clears reauth).
  • The restart travels as b64: + base64url (extUrl). If the encoded URL would exceed 255 characters it is dropped, and the button falls back to Auth0's own switch.

Bundle: the Google button follows ext-google (decoded with decodeExt) only when studioLoginEntry() accepts it: our studio hosts or localhost, path /auth/login or /auth/app/login, no userinfo or port tricks, no plain http. Anything else falls back to Auth0's federated switch.

keep=1: like the verification retry (reauth=1), a Google restart continues the login: it keeps the /start stash cookie, the MCP authorize return cookie, and attribution, all of which a plain login clears.

After merge: re-run infra.yml once so Auth0 pins the bundle that reads ext-google (same as #954 for ext-screen). Nonprod only; the email default never applies on prod.

Ext-param encoding (#957, merged) ​

On staging, a /start hand-off with a comma in its prompt or two tools hit Auth0's 400 "error parsing ext params", because Auth0 checks every ext-* authorize value against EXT_VALUE_PATTERN (^[-\w.*~@+ /:]{1,255}$) and rejects the whole /authorize when one fails. Since #957:

  • setExtParam(url, name, value) sets an ext value only when it matches the pattern and drops it otherwise. A bad value degrades the screens; it never blocks the login. Use it for every new ext-* value.
  • ext-prompt is extText(prompt): b64: + base64url of the UTF-8, cut on a character boundary to 188 bytes so it fits 255 characters. promptParam still caps the raw prompt at 200 characters first.
  • ext-tools is space-separated, not comma-separated. Both toolsParam and the login bundle's filterTools read spaces or commas, so older links still work.
  • ext-app_name (appNameParam) keeps only pattern-safe characters, because the page's Liquid shows it as text and cannot decode base64. Apostrophes are removed ("Acme's" reads "Acmes") and other punctuation becomes a space.
  • The login bundle's decodeExt reads b64: values and passes plain values through (mock harness, older control plane); a broken encoding reads as empty.

Infra context list: Hosting & infra — #957. Product: Marketing site — login.

Lost callback state restarts the login (#969, merged) ​

PR #969 (merged 2026-10-15 16:59 IDT by yoni-monday, merge 57792ed9, head a6082247, branch login-prod-prep) stops a lost or mismatched callback state from dead-ending on raw JSON. Before it, /auth/callback?code=…&state=… with no state cookie and Accept: text/html answered 400 {"error":"invalid_state",…}. It is on main; prod gets it with the next prod deploy that includes #969.

On GET /auth/callback and /auth/app/callback, when state or the state cookie is missing or doesn't match:

text
browser (Accept: text/html)
  valid studio session        -> 302 to the invitation the raced login was for,
                                 else the known MCP authorize return, else "/"
  else restart guard unset    -> set 10-minute guard cookie, 302 /auth/login?keep=1
                                 (+ the state's invitation_kind / invitation_id on the studio side)
  else                        -> notice page "Sign-in interrupted" + "Try again"
non-browser caller            -> the same JSON 400 as before
  • The authorization code is never exchanged on any of these paths.
  • The 10-minute guard cookie stops a restart loop: a second lost state inside the window shows the notice instead of redirecting again.
  • A restarted studio login keeps the invitation it was for, so an invite link that raced another login still lands on that invitation.
  • New helpers: auth/lost-state.ts, auth/app-return.ts, auth/authorize-return.ts; login-notice.ts gains the notice copy and flow-cookie.ts the guard cookie. The studio and app callback routes (routes/auth/studio.ts, routes/auth/app.ts) now delegate to them.
  • Tests: auth-studio-lost-state.test.ts (new) and auth-app.test.ts; the control-plane suite was 2069 pass at merge.
  • The prod rollout's live check includes two logins in one browser, both landing in the studio.

Infra half of the PR (prod ACUL config, switched off, and the rollout runbook): Hosting & infra — #969. Background on the state cookies: Login-flow cookies host-prefix (#463). Symptom entry: Troubleshooting.

Access Denied "different account" forces a fresh Auth0 login (#1016, merged) ​

PR #1016 (opened 2026-10-18 13:20 IDT by monday-sphera-ai[bot] / Brilliant Fixer, branch fix-different-account-reauth; merged 2026-10-18 17:24 IDT by yoni-monday, merge 6ca6b754, head 982abf4d, +21/−2 in 2 files) fixes the Sign in with a different account button on a published app's Access Denied page (the HTML 403 that GET /auth/app/callback renders when the signed-in user isn't allowed into the app).

Before: the button linked to /auth/app/login?app_id=…&return_to=… with no reauth. Auth0 silently reused its SSO session, signed the same user in again, and the visitor landed back on the same Access Denied page (reported on service-portal).

Now: the href is built with URLSearchParams (HTML-escaped) and adds reauth=1. On /auth/app/login, only reauth=1 makes authorizeUrl send prompt=login&max_age=0, so Auth0 shows its login screen and the visitor can pick another account.

  • Rule of thumb: any link meant to let someone switch accounts must carry reauth=1; a plain /auth/app/login link reuses the Auth0 session.
  • Test: test/app-registration.test.ts follows the denied page's button and asserts the authorize redirect has prompt=login and max_age=0. Control-plane suite: 2141 pass at the PR.
  • Not live-checked on a side env (needs a real Auth0 session).
  • Known gap: a visitor who signed in with Google and has only one Google account in the browser may still be signed in to that account automatically after Auth0's screen, because Auth0 doesn't pass prompt on to Google here.

Related: Google restart on email-code login (#957) (its restart clears reauth). Symptom entry: Troubleshooting.

Prod Slack alerts for new and public apps (#946, merged) ​

PR #946 (opened 2026-10-15 10:34 IDT by Brilliant Fixer / monday-sphera-ai[bot], branch fixer/app-slack-alerts; merged 2026-10-15 12:13 IDT by yoni-monday, merge commit 90294b31) adds two production-only, best-effort Slack messages to the same signup-alert channel (C0C8NVB27JR) as the existing signup alerts (moving to #incoming in the brilliant.ai workspace with #993, merged). Slack failures never affect the request; failures log as fixed codes (slack_app_alert_*). Callers pass only ids; names, tenant, creator, and URL are loaded in the background, and user-supplied text goes through field() escaping so it cannot ping anyone.

New app — New Brilliant app: <name> (<appId>) — tenant <tenant> (<tenantId>) — created by <name> (<email>)

  • Apps that already have a name (POST /tenants/:id/apps, POST /projects/:id/apps, MCP create_app) are announced at creation.
  • AI-named Studio apps start with a placeholder (namingPending) and stay silent at creation. They are announced from POST /internal/apps/:id/launch-report only once that report applies the AI title. reportLaunch returns { namingSettled }; a repeat report does not post again, and a failed launch report that clears naming without a name stays silent (no "Untitled app" alert; fixed in the PR's second commit 5d1aac7c).

Made public — Brilliant app made public: <name> (<appId>) — https://<script>.<APPS_DOMAIN>/a/<script>/ — tenant …

  • New apps always start restricted, so "public" is a later sharing change.
  • sharing.changeGeneral sets madePublic when an app moves from not-public to link + requireSignIn: false (same definition as allowsAnonymous). The check runs inside the transaction, so changing the role of an already-public app does not post again. The route strips madePublic so the HTTP response stays { revision }.

Not covered (intentionally): template installs, agent-created sibling apps, and the legacy Workflow naming path. A client retry of the same requestId that returns the existing app can post the create alert again (rare, harmless for a best-effort alert). Outside prod nothing is sent.

Code: apps/control-plane/src/notifications/slack-app-alerts.ts (reuses slack-signup-alerts sender). Tests: test/slack-app-alerts.test.ts.

Related: Share & Invite — public means link without sign-in, Troubleshooting: missing Slack app alert.

Slack alerts move to #incoming in the brilliant.ai workspace (#993, merged) ​

PR #993 (opened 2026-10-16 21:38 IDT by yoni-monday, branch new-slack-targer; merged 2026-10-17 08:23 IDT by yoni-monday, merge commit be1cd73a, final head c0e15b5f) moves every production Slack alert (new signups, new and public apps from #946, and the POST /api/contact "Talk to us" form) out of the old workspace channel C0C8NVB27JR and into #incoming in the brilliant.ai Slack workspace (C0CA11H6XK6). While open, the PR first targeted #alerts (C0C9Z4ZE3DF); the merged code uses #incoming.

  • The channel is still a fixed constant, SLACK_CHANNEL in apps/control-plane/src/notifications/slack-signup-alerts.ts (app alerts reuse that sender). It is not configuration. Signup and app alert tests assert C0CA11H6XK6.
  • Posting is done by the Brilliant Slack app (A0C9Z6HJ1L1) installed in the brilliant.ai workspace, with the brand mark as its icon. A test message from it is already in #incoming.
  • Prod SLACK_BOT_TOKEN must be the new Brilliant app bot token. The secrets catalog note in infra/secrets/catalog.ts now says so, and says to rotate it in the same deploy.

Live once the control plane is deployed to prod with the rotated token. At merge, the prod store update and the quiet-time deploy were still open items in the PR's test plan.

Deploy order (important): rotate prod SLACK_BOT_TOKEN in the same control-plane deploy that ships this channel change. Signup and app alerts skip a bad token without blocking anything, but the /api/contact form returns 502 until the token and channel match. Prod CD runs secrets:push before the control-plane code deploy, and that push deploys a Worker version right away, so there is a short stretch of old channel code with the new token; deploy at a quiet time. Right after the control plane serves the new SHA, submit one contact form message and confirm it lands in #incoming.

Rollback: rolling back restores a Worker version together with the secret values written onto that version, not the secrets store. Roll back to the version from before this deploy's secrets push, so the old channel and old token come back together. Also put the old token back in the store, or the next deploy pushes the new token ahead of the code and drops alerts (and 502s the contact form) again.

Related: Secrets & environments — SLACK_BOT_TOKEN, Troubleshooting: Slack alerts stopped after the workspace move.

Failed prompts keep their place in the chat (#947, merged) ​

PR #947 (opened 2026-10-15 10:50 IDT by Brilliant Fixer / monday-sphera-ai[bot], branch fix/undelivered-prompt-keeps-place, merged 2026-10-15 12:13 IDT by yoni-monday, head 07bb3211, merge commit e45c1ac5) fixed a chat client bug: when a prompt fails to send, its bubble and the red Not delivered — send it again note were pinned to the bottom of the transcript and kept sliding under later tool rows and answers. On main now, a failed prompt stays where it failed and later run output renders below it.

Cause (before #947): piToRaw (apps/control-plane/web/src/components/chat/session/pi-to-raw.ts) drew every prompt in state.sent after the whole transcript. That is right for a prompt still in flight (Pi will place it soon). A failed prompt is never placed, so it stayed in that tail forever.

What landed (SPA):

PieceRole
SentPrompt.afterWhen a prompt turns failed (reducePromptError, or a withdrawn submission in reduceSubmission), it records the newest entry id at that moment via lastEntryId.
piToRawDraws a failed, anchored prompt just before the first entry after after. From then on the row stays where it failed. In-flight prompts still append at the end.
ResendreducePromptSent with the same id replaces the prompt and clears the anchor, so the retry shows at the bottom as in-flight again.

Verification (from the PR): new test agent-session-reducer.test.ts › "a failed prompt keeps its place while the run goes on" (failed on main before the fix, passes with it); tsc --noEmit (web) and biome clean on the touched files. Live check on side env fix-stick: undelivered_keeps_place passed (0 chars rendered after the failed bubble at failure, 130 once the run continued), the rest of the studio smoke passed, and the env was torn down with zero leftovers.

Related: Chat workspace connection XState (#936), Troubleshooting: Not delivered slides to the bottom.

PostHog error tracking replaces Sentry (#953, merged) ​

Studio and worker error reporting no longer go through Sentry (the older Studio chunk recovery & Sentry and Studio source maps to Sentry sections describe the previous path). #953 (merged 2026-10-15 12:45 IDT, merge b384d838, PostHog 2/6 on #948) removed Sentry from the codebase and sends those errors to PostHog error tracking — workers via withTelemetry, studio via posthog-js captureException / exception autocapture, and sourcemaps via posthog-cli. Full design: PostHog — error tracking (#953, merged).

Follow-up #958 (merged 2026-10-15 13:55 IDT, b7b594e0): the $exception allowlist keeps token and distinct_id (INGESTION_PROPERTIES), so posthog-js can ingest studio exceptions again (the #953 review allowlist had stripped them).

Follow-up #965 (merged 2026-10-15 15:42 IDT, cd2f58b4): error messages are kept instead of [Error details redacted], scrubbed by the shared scrubErrorText (packages/capabilities/src/error-text.ts) in the studio and the Workers, and <anonymous> / [native code] frames are no longer mangled.

PR #950 (opened by Brilliant Fixer / monday-sphera-ai[bot], branch fixer/sidebar-delete-app, head 391162cf; merged 2026-10-15 12:15 IDT by yoni-monday, merge commit 083106ce) puts Delete app… on the shared app action list (buildAppActions in apps/control-plane/web/src/components/projects/app-actions.tsx). Until now you could only delete from the editor's app-name pill; both the left-pane sidebar row and the gallery card now get the same row (below a divider, in red).

RuleBehaviour
Who sees itOnly the app's owner (canDelete: roleOf(app) === "owner"). Server gates DELETE /apps/:id on app_owner. Non-owner builders, viewers, and demo apps (no builder / open: null) do not get the row.
While buildingThe Delete row stays but is disabled with tooltip "Can't delete while the app is building" (DELETE_WHILE_BUILDING). Client-side only (same as editor); the server has no build guard on delete.
ConfirmNew AppDeleteConfirm reuses the editor confirmation — DeleteConfirmDialog on desktop, MobileDeleteAppView inside a BottomSheet on phone (sheet registry id app-card-delete).
Delete projectWhen the app is the only one in a project the viewer owns (app.source.appCount === 1 and app.source.ownerId === viewerId), confirmation also offers Delete project (deleteParentProject: true). Same rule as editor / #633.
RequestfetchAppDetail for the current revision, then DELETE /apps/:id at that revision; invalidate projects/apps queries. If the deleted app is open in the editor (/apps/:id…), navigate to /projects. Since #985 the row leaves at once (optimistic); see below.

The API contract itself landed in #633 (DELETE /apps/:id with { expectedRevision, deleteParentProject? }). This PR is the sidebar/gallery UI surface on the shared action list.

Related: Share & Invite — Delete app in the sidebar and gallery, Studio UI consolidation (#633), Troubleshooting: no Delete in sidebar.

Optimistic app delete from the sidebar and gallery (#985, merged) ​

PR #985 (opened by Brilliant Fixer / monday-sphera-ai[bot], branch fixer/optimistic-app-delete, head f94ecc29; merged 2026-10-16 16:45 IDT by yoni-monday, merge commit ced4abf5) makes the #950 sidebar/gallery delete optimistic. Asked for by Amichay in Slack: deleting an app should hide it at once, with an async error if the delete fails.

StepBehaviour (useAppActions in apps/control-plane/web/src/components/projects/use-app-actions.tsx)
ConfirmThe dialog closes immediately and the app is removed from the cached project list (projectListKey(tenantId), via withoutApp) before the DELETE is sent. With Delete project, the whole project leaves the list too; otherwise that project's apps, appIds, and appCount drop by one. In-flight project-list queries are cancelled first so they cannot overwrite the optimistic list.
FailureThe project list is refetched (invalidateProjects), so the app reappears, and a danger toast reads Couldn't delete <name>. <server reason> (for example "Shared with 2 apps — stop sharing first"; fallback "Please try again."). The confirm dialog no longer shows a spinner or inline error (AppDeleteConfirm dropped its isDeleting / error props).
SuccessProjects are invalidated as before. If the deleted app is open in the editor (/apps/:id…), the redirect to /projects still waits for the server to confirm.
EditorThe editor's own delete flow (preview/use-app-actions.ts, app-name pill) is unchanged: it is not optimistic, since it leaves the page anyway.

Tests: apps/control-plane/web/test/sidebar-app-delete.client.test.tsx holds the stand-in DELETE open to prove the sidebar row (and a lone project row, with Delete project) leaves before the server answers, and that a refused DELETE brings the row back with the toast, on both the sidebar and a gallery card. The PR says it was not live-checked on a side env.

Related: Delete app from the left pane and gallery (#950), Share & Invite — Delete app in the sidebar and gallery, Troubleshooting: a deleted app came back.

Cool slate is the only studio theme (#956, merged) ​

PR #956 (opened 2026-10-15 13:18 IDT by yoni-monday, branch styles, head 613b56f7; merged 2026-10-15 14:14 IDT, merge 0f778a58) removed the studio theme picker that #316 added. On main there is no Warm stone / Cool slate switcher any more: every studio user gets Cool slate.

What landed:

  • One theme. Cool slate is the only studio theme. apps/control-plane/web/src/lib/theme.ts drops ThemeId, THEMES and the chrome prefs and just sets data-theme=cool-slate.
  • No pickers. The rail palette picker (components/shell/ThemeSwitcher.tsx) and the phone palette picker (components/mobile-nav/ThemeSheetPanel.tsx) are deleted. The sidebar loses the switcher and the logo toggle, and the phone account sheet (MobileAccountSheet.tsx) loses its Theme row and sub-panel.
  • Painted ring always on. The painted prompt ring on the home hero (MobileHome.tsx) and the chat composer (ChatComposer.tsx) is fixed on; there is no longer an image logo / ring toggle.
  • Warm stone CSS stays. Its styles remain in packages/studio-ui/src/styles/theme.css on purpose: the home prompt box and the project composer still pin Warm stone for the painted prompt ring, per the existing design.
  • Focus color fix. Cool slate's Focus color now matches Figma Blue/500 (#5d79df) instead of silently inheriting Warm stone's near-black #3a3835.
  • Tests and UI parity. theme-sub-sheet(-touch).test.tsx become account-sub-sheet(-touch).test.tsx, pointed at the Account sub-panel to keep exercising the shared BottomSheet back, slide and focus-trap behaviour. scripts/ui-parity drops the sheet-account-theme and home-rest-warm-stone screens.

Verified before merge with a clean bun run typecheck in apps/control-plane/web, 258 passing tests across the 27 touched files, and a live QA on the styles side environment (no palette or appearance button on the rail, no Theme row in the phone account sheet, painted logo and ring art still rendering). Risk is low and reversible with a plain revert: studio web app only, no API, database or infra changes. Users who had switched to Warm stone or turned off the painted logo or ring lose those options; everyone else already had the defaults. The branch also carried three unrelated staging e2e-smoke fixes, so the staging smoke check now fails an unowned turn after 3 minutes and names the real refusal (billing or a clarify-card hold) instead of timing out silently after the full 12 minutes. See also Clarify card holds the first Studio turn.

Related: Studio theme switcher (#316, history), Marketing site — shared CSS in packages/studio-ui/src/styles/, Troubleshooting: no theme picker in the studio.

Studio billing UI in Settings (#989, merged) ​

PR #989 (merged 2026-10-17 08:27 IDT by yoni-monday, merge 3b46067e) adds Settings › Plans and Settings › Usage (admin-only, behind billing_studio_ui) plus a trial-ending banner in the studio shell. Routes /settings/plans and /settings/usage use the wide settings layout; Stripe Checkout and portal returns now land on /settings/plans instead of Home. Shared PricingCard lives in packages/studio-ui.

Backend changes in the control plane:

  • New GET /tenants/:id/billing/receipts (owner/admin only, Stripe Charges Read only): the tenant's paid charges with hosted-receipt links and refund: "full" | "partial" | null.
  • Billing admission attribution: builder-chat admits name only the workspace; when the workspace has exactly one app, build charges are now attributed to that app (cached per isolate for 60s). Workspaces with several apps stay unattributed. The per-app spend cap excludes building, so enforcement is unchanged.
  • Checkout sends posthog_person_distinct_id metadata and &item= on its return URLs; new Stripe customers carry the same metadata.

Full behaviour: Billing — Studio billing UI (#989).

Settings navigation direction (design, 2026-10-18) ​

Brilliant Daily, 2026-10-18 (Amichay, Dan), Slack #brilliant-ai ts 1792311428.418849. Design direction, not on main yet:

  • Integrations (with MCP next to it) moves up in the left pane, above Settings. Today Integrations is a section inside Studio Settings (Integrations).
  • Profile can sit at the bottom of the pane.
  • Billing: the target is one Billing & usage page merging Billing, Usage and Plans (fallback: separate, cross-referenced pages), with trial-state versions. See Billing: one Billing & usage page.
  • Settings pages are secondary and should be closed out; the next product focus is the chat, the builder and the full build sequence (Build mode: new design is In Progress). See Product & growth decisions.

Chat and app header direction (design, 2026-10-19) ​

Brilliant Daily, 2026-10-19 (Amichay, Dan), Slack #brilliant-ai ts 1792398743.018189. Design direction, not on main yet:

  • Chat action chips (for example permission changes) get a distinct look, with a lock or another icon.
  • Acute actions go through a confirmation widget in the chat before they run.
  • App header: remove full screen and hide chat; keep only Open in external tab. No floating bar. Today's header: Studio header & editor chrome.

Decision record: Product & growth decisions.

Public host label and root publish (#994, merged) ​

PR #994 (opened 2026-10-16 22:36 IDT by yoni-monday, branch friendly-app-hosts; merged 2026-10-17 09:32 IDT by yoni-monday, merge cd675e63, final head 3216707c) gives each app a public DNS label so a published app lives at https://<host-label>.<apps-domain>/ instead of https://<script>.<apps-domain>/a/<script>/.

  • Schema: migration 0054_app_host_label adds apps.host_label (nullable, globally unique via apps_host_label_unique) and apps.serves_at_root (boolean, default false). Existing rows stay null and keep their script-name host until their next root publish.
  • Claiming a label: createApp now runs in a transaction and reserves the label with claimHostLabelInTx (advisory lock per label, checked against every tenant's host labels and script names). Collisions take -2, -3, … (50 tries, then a random suffix). isClaimableHostLabel (src/lib/names.ts) rejects non-DNS labels, reserved platform subdomains, and UUID-shaped labels, since a label equal to another app's id would overwrite its app:<id> dispatch record. The app.create audit insert runs in a savepoint, so an audit failure no longer rolls back the new app row. The internal app-create route and project resource creation also claim one.
  • Root publish: when ingest's /ingest/deployment reports base_path: "/", recordRootPublishAddress (src/lib/public-address.ts) sets serves_at_root and keeps any label already claimed. If storing it fails, ingest answers 503 activation_pending with retry-after: 5 for every root publish (with or without an event id), because a Worker built at / can't be served until its public host is stored. The sender retries the same body.
  • Published URL: liveAppUrl (src/lib/app-url.ts) returns https://<label>.<APPS_DOMAIN>/ for a root app, else the old prefixed form. GET /internal/workspaces/:id/apps adds publish_base: "/" on envs with APPS_DOMAIN, which the conductor uses for agent publishes and rollbacks.
  • Absolute published URL (#1010, merged 2026-10-17): absoluteLiveAppUrl (same file) is the absolute address used by integration connect callbacks, invitations and email. An apps-domain URL stays as is, a root publish needs no dispatch host, a path-shaped URL resolves on DISPATCH_HOST, and with no dispatch host it is null. See Composio overview: per-user connect from a published app.
  • While deploying: publish and rollback responses in the deploying state return deployingLiveUrl, the public host when a claimable label is already on the row, so the studio copies the final address instead of the /a/<script>/ path that is about to redirect.
  • Share links: liveShareUrl and the share and access dialogs pass hostLabel / servesAtRoot through, and still read app activity when only a script name is known.
  • Studio: useAppLiveAddress reads hostLabel and servesAtRoot from app activity so the preview pane, version history, settings header and launcher show the new address.

Full routing behaviour: Dispatch — Public host at / (#994).

Unknown studio pages return 404 (#998, merged) ​

PR #998 (opened 2026-10-16 22:41 IDT by yoni-monday, branch cursor/unknown-page-404-8f55; merged 2026-10-16 23:06 IDT, merge 604f1d5e) makes a page load of a path the studio doesn't define answer HTTP 404 instead of 200. QA Bot had reported that /billing and /plan on app.brilliant.ai showed the "Page not found" UI with a 200, so crawlers and monitors treated them as real pages.

Why it happened: the control-plane worker serves the SPA HTML for every non-API page load, from both the document middleware and the assets catch-all, and only the web router knew which paths are real pages.

What landed:

  • One list of page roots. apps/control-plane/src/lib/studio-pages.ts exports the top-level studio page paths (STUDIO_PAGES), isStudioPage and withStudioPageStatus. The web router now uses those same constants, so a new top-level route must be added there or it will 404.
  • Worker rewrites the status. When the worker is about to send the 200 HTML shell for a path that isn't a studio page, it sends the same SPA body with 404, so the "Page not found" screen still renders.
  • Only top-level roots are checked. /billing is 404, but /settings/nope stays 200 because /settings is a real root.
  • Missing static files. A missing file still gets the 200 shell only under /assets/ with a known static extension (scripts, styles, images, fonts), so /assets/gone-123.js and /brand/missing.png stay 200. Other dotted paths such as /billing.html and /wp-login.php are 404.
  • No caching on a 404 shell. It is sent cache-control: no-store without etag or last-modified, so it can't inherit the long max-age=31536000 from the assets response.
  • Server-rendered paths are skipped. The worker doesn't serve the shell for /auth/, /oauth/ (MCP consent), /v1/, /admin, /internal/, /w/ and /wiki, and these are deliberately not on the page list. /v1/integrations/callback stays a server navigation.

Tests: apps/control-plane/test/studio-document-routes.test.ts (404 vs 200 for document and non-document requests, every STUDIO_PAGES root, the asset exceptions, no-store on the 404) and apps/control-plane/web/test/studio-pages.test.ts (every router path except /v1/ is a studio page; /billing and /plan are not).

Related: Marketing site — cache rules and static-cache-never-pins-a-page, Troubleshooting: a new studio page returns 404.

Studio /favicon.ico serves the brand icon (#999, merged) ​

PR #999 (opened 2026-10-16 22:41 IDT by yoni-monday, branch cursor/studio-favicon-8f55; merged 2026-10-16 23:08 IDT, merge 4b47b4c7) fixes https://app.brilliant.ai/favicon.ico, which QA Bot reported was answering with the SPA HTML shell (200 text/html) instead of an icon.

Why it happened: browsers request /favicon.ico even when the page links a PNG icon. There is no /favicon.ico file in the studio assets, and with run_worker_first plus SPA not_found_handling, a missing file comes back as index.html at 200.

What landed (apps/control-plane/src/app.ts):

  • A dedicated route. GET /favicon.ico is registered before the document middleware and rewrites to /brand/brilliant-favicon-32.png (source: apps/control-plane/web/public/brand/brilliant-favicon-32.png) through the ASSETS binding. It answers the same way for plain and Sec-Fetch-Dest: document requests.
  • Never the shell. Any assets response that isn't a 200 image (for example the SPA fallback at 200 text/html) becomes a plain 404, as does a missing ASSETS binding.
  • 304 is checked first. A revalidation 304 carries no content-type, so it's passed through before the image check; otherwise a cached icon would turn into a 404.
  • Caching. The icon, including the 304, gets the static cache header public, max-age=86400, stale-while-revalidate=604800.

Not changed: login.brilliant.ai/favicon.ico stays 404, and that's expected. login.brilliant.ai is the Auth0 custom domain. infra/pulumi/src/auth0-login-dns.ts creates a DNS-only CNAME (proxied: false, never proxy or flatten it), and Auth0 answers that path with 404 and x-auth0-not-found: 1. This repo can't serve bytes on that host without proxying it, which Auth0 forbids, and an ACUL <link rel=icon> wouldn't fix the URL 404. See Hosting — ACUL login screens.

Tests: apps/control-plane/test/spa.test.ts covers /favicon.ico as 200 image/png with the PNG bytes and cache header (the mock returns HTML for every other asset path, so a wrong rewrite fails), and a revalidation with if-none-match staying 304 with the same cache header.

Related: Unknown studio pages return 404 (#998), which handles other missing paths and static files.

App rename shows the new name at once (#1003, merged) ​

PR #1003 (opened 2026-10-17 09:38 IDT by yoni-monday, branch cursor/fix-app-rename-c6a6, head a4e8d95b; merged 2026-10-17 11:21 IDT by yoni-monday, merge 1912b491) fixes the rename app doesn't work bug from the UI/UX tracker. In the editor header's app actions menu (app name with a chevron, then Rename…, New app using this data, Delete app…), Rename… saved the new name but the pill kept showing the old one.

Why it happened: the save itself worked (PATCH /apps/:id with { name, expectedRevision }). The editor header reads the app from the TanStack Query detail query ["app", id] (resourceKeys.app(id)), but after a rename the studio only invalidated ["apps"], the directory lists. Nothing wrote the detail query, so it kept the old name.

What landed (studio SPA, apps/control-plane/web):

PieceBehaviour
renameApp returnrenameApp (src/api/permissions.ts) and projectsApi.renameApp (src/api/projects.ts) now return the saved AppDetail from the PATCH instead of discarding it.
storeRenamedApp(qc, appId, updated)New shared helper in src/api/use-projects.ts. It cancels any in-flight refetch of ["app", id] first, so a response still carrying the old name can't land after the write. Then it copies only name and revision onto the cached detail (the rest of the record stays) and calls invalidateProjects, which refreshes the project and app lists.
Editor menuuseAppActions (src/components/preview/use-app-actions.ts) calls storeRenamedApp after a successful rename. The editor route (src/routes/app-detail.tsx) now refetches the open app's detail query on rename instead of only the ["apps"] list.
Projects pageuseRenameApp uses the same helper on success (it used to only refresh the lists, so an app detail already in the cache kept the old name). On error it still just refreshes the lists.

Rule of thumb for later changes: a mutation that changes an app's fields must also update or invalidate ["app", id], not only the ["apps"] / ["projects"] lists, because the editor reads the detail query.

Tests: new apps/control-plane/web/test/app-rename.client.test.tsx (Playwright harness): the menu rename shows the saved name, sends exactly one PATCH with the old revision, and invalidates both lists; a refetch already in flight that returns the old name does not bring it back; renaming through useRenameApp updates the cached detail and invalidates both lists. The PR also notes app-detail.tsx sits at the 600-line file-size cap (two comments were removed to stay under it).

Related: Share & Invite — renameApp API, Optimistic app delete (#985), Troubleshooting: app rename keeps the old name.

Semantic-lint route (#981, merged) ​

PR #981 (merged 2026-10-17 09:07 IDT by yoni-monday, merge 644fe79c) adds GET / POST /internal/workspaces/:wsId/semantic-lint, behind internalGuard and requireFlagForTenant("semantic_lint").

  • GET is the conductor's flag probe: { enabled, configured, model: "typesafe/jev" }, where configured means the Workers AI binding is present.
  • POST takes only { requests: [{ id, state, ruleIds }] } (at most 64 requests, 4 MB). Question text, cutoff, message and model come from @brilliant/jev-linter/catalog, then env.AI.run("typesafe/jev", …). Unknown rule ids are dropped without calling the model; a model or questions field is a 400; no AI binding is 503 lint_unavailable.
  • Import only the catalog subpath in the Worker. The package barrel pulls in typescript, and workerd exits with ReferenceError: __filename is not defined.
  • No new secret. The control plane no longer lists TYPESAFE_API_KEY; it stays an optional evals-only entry.

Full design: Semantic lint (Jev linter).

Chat diagrams drawn with Pele (#1014, merged) ​

PR #1014 "Draw charts and flows in builder chat with Pele" (merged 2026-10-18 17:52 IDT by yoni-monday, merge 4d77bfb9, branch cursor/chat-mermaid-pele-ce18) makes builder chat draw charts and flowcharts. A closed fenced mermaid code block in an assistant reply is rendered to SVG with Pele (npm pele 1.6.0) and is never shown as a normal code block.

What the user sees.

  • While the block is still streaming, a diagram card says "Drawing diagram…".
  • When the fence closes, the card shows the drawing. Http(s) links in the diagram open in a new tab, and edge labels such as "Server online=yes" stay in the drawing. The card fits a 390×844 phone viewport: when the card gets narrower, a ResizeObserver has Pele lay the diagram out again at the new width rather than only shrinking the old SVG with CSS (proved by #1019).
  • If Pele can't parse the block, or the SVG can't be inserted, the same card says the diagram couldn't be rendered and puts the source behind "Show source". A later source on that same card draws again.

Where it renders.

  • Builder chat (the studio chat): renderer and system prompt.
  • Operational agent threads share AssistantAnswer, so a mermaid fence draws there too, but their system prompt was not changed, so those agents aren't told they can emit one.
  • The end-user app template has no markdown chat renderer, so published apps don't draw diagrams.

How it's built (all in packages/studio-ui/src).

  • Markdown.tsx sends mermaid fences to MermaidBlock.tsx and every other fence to MarkdownCodeBlock (markdown-code.tsx). The card chrome is diagram-card.tsx.
  • Pele loads lazily on the first diagram (import("./mermaid-render")), so it isn't in the initial studio bundle.
  • mermaid-render.ts calls Pele with images: false (a diagram can't fetch a remote URL) and linkRel: "noopener noreferrer". A null result means the failure card.
  • diagram-svg.ts sanitizes the SVG twice, on its tags and again on the parsed tree, and inserts it with DOMParser and appendChild rather than innerHTML.
  • Theme: styles/pele.css maps Pele's role and accent tokens to the Brilliant theme on an ancestor. Cool slate, warm stone and default each redefine those tokens, and data-color-scheme="dark" points the diagram at the inverted ground and light accent surfaces. A theme change restyles an SVG already on screen. The studio still ships cool slate and doesn't set the dark attribute.
  • Build: pele is declared in packages/studio-ui. Studio UI is aliased to source, so the control-plane web and admin vite.config.ts resolve pele (with blobatar) from studio-ui through the renamed studioUiPackagePlugin. knip ignores pele in apps/control-plane/web.

Prompt line. services/conductor/src/coding-agent/prompts/sections/chat-diagrams.ts adds one line inside <chat_diagrams>: "To show a chart or a flow in the chat, return a fenced ```mermaid block (Mermaid syntax) in your markdown reply." composeSystemPrompt pushes it after the static core and the model overlay and before the per-turn dynamic suffix (<app_summary>, <topic_boundaries>), so it sits at the end of the cached prefix and doesn't break prompt caching for the sections before it. services/conductor/test/token-cap.test.ts asserts that position for every model and that the line has no newline.

Tests. packages/studio-ui/test/mermaid-diagram.test.tsx (with a Playwright browser entry, playwright 1.63.0 as a studio-ui dev dependency) covers the streaming, success, failure and show-source states.

Phone-width redraw test (#1019, merged) ​

PR #1019 "Prove Pele diagrams redraw at phone width (follow-up to #1014)" (merged 2026-10-19 08:00 IDT by yoni-monday, merge 113444bc, branch cursor/pele-phone-redraw-f69c) is test-only; no product code changed. It answers a review note on #1014: the original 390×844 check passed from .diagram-card svg.pele { max-width: 100% } and overflow-x: auto alone, so it never proved the ResizeObserver redraw.

  • The browser test in mermaid-diagram.test.tsx now mounts a wide left-to-right flowchart. A short chart is already narrower than a phone, so its SVG never changes and can't prove anything.
  • At desktop width the test checks that Pele's own width attribute is wider than the card. After resizing to 390×844 it waits until both width and viewBox change and the new width fits the card's content box. fitsPhone still checks that the card doesn't overflow the viewport.
  • It finds the chart by a single word only that chart contains (checklist), because Pele wraps labels and joins the next line without a space, so a two-word marker can be split.
  • If redraws after the first paint are skipped, the test fails with Pele did not redraw at phone width (was <width> <viewBox>, still <width> <viewBox>).
  • Checks on the PR: bunx biome check, bunx tsc --noEmit and bun test in packages/studio-ui (53 pass).

Related: Builder preview state machine (#934), Troubleshooting: chat diagram won't render, Conductor.