> ## Documentation Index
> Fetch the complete documentation index at: https://docs.tuturuuu.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Start migration program

> Inventory, waves, per-app acceptance and apex-path work for moving every web app to TanStack Start + Vite+ + Void on Cloudflare at tuturuuu.com/<app>.

Every active web app moves to TanStack Start on Vite+ and Void, hosted as a
Cloudflare Worker, linted and formatted with Oxc, and served at
`tuturuuu.com/<app>`. Legacy `<app>.tuturuuu.com` hosts answer `301` to the
apex path. This page holds the program inventory, the wave order and the
acceptance bar. The [native Start migration runbook](https://docs.tuturuuu.com/build/devops/native-start-migration.md)
holds the per-app mechanics, and the [Gateway Worker](https://docs.tuturuuu.com/build/devops/gateway-worker.md)
page holds mount and legacy-redirect operations.

## Invariants

* **One central session.** Mounted apps read the shared `tuturuuu.com` session
  and never write or clear session cookies. Satellites resolve actors with
  `getSatelliteAppSessionUser('<app>')` (Next) or
  `@tuturuuu/satellite/auth-request` (Start). They never use
  `@tuturuuu/utils/user-helper`.
* **Apex paths.** Each app's mount comes from `ONE_ORIGIN_APP_BASE_PATHS` in
  `packages/utils/src/app-mounts.ts`. Product marketing lives under
  `/products/<app>`.
* **No Vercel.** Rollback targets are the prior Worker version and the
  captured hostname attachment. A Vercel deployment is never a rollback target,
  and `build:legacy` Next builds exist only until an app's Next retirement step.
* **Framework-independent packages.** Domain libraries in `packages/*` keep
  portable entrypoints free of Next.js, React Router and Cloudflare runtime
  imports. Adapters inject request identity, storage, navigation and locale.
  App source reaches `next/*` only through `@tuturuuu/start-bridge`.
* **Next on Cloudflare in the meantime.** `apps/web` serves on Next through the
  OpenNext/vinext Worker until each of its route families moves to its Start
  candidate.
* **Bounded spend.** Each new Worker keeps its CPU limit, sampling rate and
  abuse-guard binding. Any added queue, cron or retry loop needs the stop fence
  and operation-count evidence from
  [Oxc and Cloudflare adoption](https://docs.tuturuuu.com/build/development-tools/oxc-cloudflare-adoption.md#runaway-work-and-cost-acceptance).

## What "migrated" means

An app is done when all five hold for the exact production commit:

1. **Start serving:** production traffic reaches the app's native Start Worker,
   and responses carry `x-tuturuuu-runtime: native`.
2. **Apex mount:** the gateway lists `/<app>` and `/<app>/*` with a `MOUNT_*`
   binding. Signed-in apps also appear in Web's active-mount list
   (`node scripts/active-app-mounts.mjs`) and serve `/<app>/verify-token`.
3. **Legacy 301:** the app is in the rendered `SUBDOMAIN_REDIRECT_APPS` with an
   `APP_*` binding, and `<app>.tuturuuu.com` is attached to
   `tuturuuu-apex-redirect`.
4. **Next retired:** no `build:legacy`, `vercel.json` or Next-only deploy path
   remains. The `next` package stays only as the bridge's type contract until
   the app's source drops App Router modules.
5. **Accepted:** the per-app acceptance below passed, and the cutover report is
   filed.

## Inventory

Measured on `main` at `cba0acd150` (2026-12-03). The columns are:

* **Framework:** *Start* is `vp build` primary, *Next+bridge* is a Next build
  with a Start/Void candidate beside it, *OpenNext* is Next on Workers.
* **Serving:** the `productionPublicationPolicy` state in `tuturuuu.ci.ts`, or
  the reason the app is excluded.
* **Apex:** *live* means the mount is in `GATEWAY_MOUNTED_PATHS`, and
  *prepared* means it is only in `scripts/apex-migration.mjs`.
* **301:** *live* means the app is in `LIVE_REDIRECT_APPS` with an `APP_*`
  binding, and *prepared* means it is only in `legacyHosts`.
* **Size:** pages plus route handlers, and `src` LOC excluding generated files.

| App | Framework | Serving | Apex | 301 | Size | Blocker |
| - | - | - | - | - | - | - |
| tools | Start | admitted, serving Worker | live (sessionless) | live | 4 / 2.2k | host attachment |
| roadmap, lms | Start | admitted, serving Worker | live (sessionless) | n/a | 0 / 3.4k | done |
| apps | Start | admitted | live | live | 3 / 2.8k | host attachment |
| calendar | Start | admitted, staged releases | live | live | 74 / 89k | host attachment |
| mail | Start | admitted | live | live | 61 / 72k | host attachment |
| meet | Start | admitted (+ realtime DO) | live | live | 74 / 28k | event routing freeze |
| tasks | Next+bridge | Tasks Worker | live | live | 188 / 94k | Tasks apex lane |
| finance | Next+bridge | admitted, manual dispatch | live | live | 111 / 30k | Finance apex lane |
| learn, teach | Next+bridge | admitted, serving Worker | live | prepared | 157 / 77k | event routing freeze |
| nova | Next+bridge | admitted, serving Worker | live | prepared | 67 / 46k | `APP_NOVA` binding |
| admin (infra) | Next+bridge | manual slice | live | prepared | 345 / 236k | Start cutover; largest satellite |
| contacts | Next+bridge | held for wave-2 | live | prepared | 127 / 110k | Start cutover, `APP_CONTACTS` |
| drive | Next+bridge | admitted | prepared | prepared (`APP_DRIVE`) | 10 / 11k | hostname move |
| chat, cms, forms, git | Next+bridge | admitted, manual publisher | prepared | prepared | 87 / 83k | apex batch |
| external, playground | Next+bridge, Start | manual slice | prepared (sessionless) | prepared | 19 / 6k | apex batch |
| storefront | Next+bridge | manual slice | prepared (`/store`) | prepared | 24 / 5.5k | apex batch |
| ai | Next+bridge | manual slice | prepared | prepared | 47 / 20k | exact-head CI |
| inventory, pay | Next+bridge | admitted, manual publisher | prepared | prepared | 178 / 88k | path-scoped cookies |
| workspace | Next+bridge | admitted, route-free | prepared | prepared | 54 / 123k | `user-helper` imports, API guard |
| hive | Next+bridge | manual slice | prepared | prepared | 45 / 17k | Worlds consolidation |
| track, mind | Next+bridge | excluded (dedicated owner) | prepared | prepared | 60 / 50k | owner handoff |
| rewise | Next+bridge | manual slice | none (renamed to Mira) | prepared | 22 / 10k | Mira redirect only |
| lettin, parley | OpenNext | excluded (R2 timeout) | none | none | 65 / 36k | R2 fix; Parley folds into Meet |
| shortener | Start | admitted (`ttr.gg`) | none | n/a | 0 / 2.2k | keeps `ttr.gg` |
| mastermind | Start | admitted behind Access | none | n/a | 0 / 21k | keeps its own host |
| whiteboards, wiki, docs-app, sheets, slides | Start, Next+bridge | held (wave-1/2) | registry only | none | 43 / 16k | separate delivery lanes |
| worlds | Start | excluded (signer rollout) | pending Web mount | n/a | 0 / 16k | coordination signer |
| marketing | Next+bridge | manual slice | apex page groups | n/a | 50 / 28k | gateway marketing groups |
| web | Next on OpenNext/vinext + Start candidate | Web production | apex host | n/a | 1,389 / 775k | 12 of 1,005 routes native |

Native services (API, gateway, cron control, coordination, ops hub, realtime
Workers and similar) already build with Vite+. They follow the Worker toolchain
rows in [Oxc and Cloudflare adoption](https://docs.tuturuuu.com/build/development-tools/oxc-cloudflare-adoption.md#complete-worker-migration-scope)
and need no framework change.

## `apps/tanstack-web`

`apps/tanstack-web` is a hand-port of Web that stays paused. Its latest
release is 0.39.0 (2026-10-04). It pins `@tanstack/react-start` 1.168.60
against the shared 1.169.3, uses plain Vite with Nitro rather than Vite+ and
Void, and aliases `next/*` to local shims instead of `@tuturuuu/start-bridge`.
Its `wrangler.jsonc` binds the paused Rust `BACKEND` service. Its manifest
tracked 158 pages and 653 handlers, while Web serves 187 pages and 787 API
routes.

Web migrates in place instead: `apps/web/vite.config.mts` builds the Start
candidate from `apps/web/cloudflare/start` through the shared bridge preset, and
`apps/web/start-route-manifest.json` falls back to Next per route. Resuming the
hand-port would need a toolchain move, removal of the Rust binding and a rebase
onto roughly 1,000 routes before any guard change paid off. Its pause guards
(`scripts/paused-runtimes.js`, the root `--filter` exclusions, test shards, Oxc
ignores, Renovate and the `tanstack-route-manifest.yaml` switch) therefore stay
in place. Remove the tree in the Next retirement wave once nothing references
its manifest.

## Waves

Waves run in parallel whenever they touch different apps. The order below is
by risk (auth surface, size, open holds) and value (traffic, Vercel
retirement).

| Wave | Apps | Work | Exit |
| - | - | - | - |
| 1 | Tools | Move the robots policy and sitemap to `/tools`, publish the live `APP_TOOLS` redirect entry, then attach `tools.tuturuuu.com` | Apex pages indexable, legacy `301` verified, machine paths pass through |
| 2 | Apps, Calendar, Mail, Meet, Tasks, Finance | Attach legacy hosts to the redirect Worker, staged per app. Meet waits for the event routing freeze to lift | All six legacy hosts redirect |
| 3 | Learn, Teach, Nova, Admin | Add `APP_*` bindings and live redirect entries. Learn and Teach go after the freeze | Mounted apps all redirect |
| 4 | Drive, Chat, CMS, Forms, Git, Storefront, External, Playground, AI | Promote each from the prepared apex batch individually: commit the mount, bind, smoke, then list for Web and redirect | Each app passes mounted acceptance |
| 5 | Contacts, Inventory, Pay, Workspace, Hive | Native Start cutover off Next, then the apex steps. Workspace removes its `user-helper` imports first | Native serving, then apex |
| 6 | Track, Mind, Lettin, Parley, Colab | Owner handoffs and the R2 timeout fix. Lettin's mount work; Parley consolidates into Meet; Mind and Hive consolidate under Worlds | Per-owner cutover reports |
| 7 | Web | Move route families to the Start candidate (legal and security first, then marketing groups, then API families by `api-path-families`). vinext and OpenNext serve the rest | Candidate flags on per family; Next fallback shrinks to zero |
| 8 | All | Next retirement: drop `build:legacy`, `vercel.json` and Next-only scripts, flip `framework` in `tuturuuu.ts`, remove `apps/tanstack-web` | No Next build in any production path |

New office apps (Docs, Sheets, Slides, Wiki, Whiteboards) ship through their
own lanes, and they mount at their registry paths when admitted.

### Prepared apex batch

`scripts/apex-migration.mjs` prepares fifteen mounts and about thirty legacy
hosts behind `APEX_MIGRATION_ACTIVE`. The program promotes them one app at a
time; Tasks and Finance went first, and the
[Tools cutover packet](https://docs.tuturuuu.com/build/devops/tools-cutover-packet.md) follows the same
steps. Each app moves its `/<app>` entry and
`MOUNT_*` binding into `apps/gateway/wrangler.jsonc`, then its `APP_*` binding
and `LIVE_REDIRECT_APPS` entry, and each step carries its own acceptance and
rollback. Flip the switch only for apps still in the batch, and only when all of
them pass together.

## Per-app acceptance

Each app gets one integration writer and one Fleet task. Every gate runs on the
exact commit that ships:

1. **CI:** unit tests, type-check, lint, `start-bridge-routes check`, a real
   `vp build` and the app's `<app>-cloudflare.yaml`, all green on the exact
   SHA. Local gates run through `ttr resources run --`.
2. **Worker runtime:** the sealed artifact's emitted runtime suite passes on the
   original and on a fresh restore with unchanged bytes. Mount profiles qualify
   both the subdomain and `/<app>`. Build info comes from generated source
   metadata.
3. **Signed-in QA:** QA accounts issued by `ttr` sign in on the 0% staged
   version through the version-override header. Cover sign-in and refresh, MFA,
   the workspace permission matrix, English and Vietnamese hydration, the
   primary flows, a localized deep link with duplicate query keys, an asset,
   and the legacy callback and machine-path passthrough. Owner-provisioned
   staging acceptance stays required wherever the
   [native Start migration runbook](https://docs.tuturuuu.com/build/devops/native-start-migration.md#gates-before-cutover)
   requires it.
4. **Scoped promotion:** promote only that app's Worker version and attachment.
   Before the flip, record the prior Worker version ID and the captured routes,
   custom domains and DNS records, with the one-step restore command and who
   runs it. Gateway or attachment packets go to Iris with the packet SHA-256 and
   source commit before any provider write.
5. **Watch:** smoke within minutes, then watch for 30–60 minutes against the
   prior baseline for 5xx rate, auth loops, p95 TTFB and client errors. Any
   user-visible regression triggers an immediate rollback to the previous
   Cloudflare Worker version, then a fix forward. A Vercel deployment is never
   a rollback target. File the cutover report.

## Parity criteria

* **Routes:** every `page.*` and `route.*` is generated, natively owned or
  ignored with a reason in the bridge registry. Unmigrated paths return the
  Next fallback, never a 404, until retirement.
* **Auth:** central-session reads only, with no cookie writes from mounted apps
  (the mounted no-writer guard). Wrong-app and expired sessions are refused.
  Logout clears the root session.
* **API:** `/api/*` an app does not own forwards to Web unchanged. Owned
  handlers keep their auth and rate-limit wrappers.
* **Locale and SEO:** English and Vietnamese render identically to Next. The
  canonical URL is the apex path: the app's `seo-policy.json` entry moves to
  origin `https://tuturuuu.com` with its `basePath` before the legacy host
  redirects, so indexable legacy pages land on indexable apex pages. Staging
  and private versions stay `noindex`.
* **Performance:** p95 TTFB and error rates at or below the prior deployment.
  Vite assets are relative so one artifact serves both hosts.

## Keeping packages framework-agnostic

* Domain and data packages (`packages/internal-api`, `packages/utils`, domain
  `*-core` packages) export portable entrypoints with no `next/*`,
  `@tanstack/react-router` or `cloudflare:*` imports. Framework code lives in
  explicit adapter entrypoints such as `@tuturuuu/satellite/auth` (Next) and
  `@tuturuuu/satellite/auth-request` (Start).
* Identity, storage, navigation and locale arrive as injected arguments or
  adapter callbacks, never as request globals.
* A missing bridge capability is added to `@tuturuuu/start-bridge` within its
  frozen v0 contract and is never copied into an app.
* Extractions keep public exports stable with thin re-exports and add a focused
  boundary test. `bun validate`'s `internal-app-auth` guard keeps satellites off
  `user-helper`.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.