Skip to main content
Current runtime policy: Docker setup and Docker-backed E2E/image CI are paused; the Docker cron runner is retired. Rust and TanStack Start are not in use and must not be run, tested, or updated until further notice. Retained Docker and migration sections below are historical procedures. Current hosted Next.js, package, Worker, database, and mobile workflows retain their own gates. See the active runtime map.
This page explains how Tuturuuu moves from code to running environments.

Generated Release Formatting

Release Please initially pushes generated manifests, then amends that commit with Oxc formatting before approval. Oxc cancels superseded runs per Git ref so the intermediate unformatted commit cannot keep running beside its replacement. Inspect the run for the current release PR head when diagnosing a failure. Cancelled or skipped runs do not publish PR reports. Generated release branches use the release workflow’s formatter rather than separate automatic formatting PRs; their final commits still receive the normal format and lint checks. After formatting, scripts/ci/normalize-release-description.js also consolidates identical bullets in each component section of the generated PR description. It preserves source references, distinct wording, component summaries, and review bot content. This runs even when generated files need no formatting changes. Before formatting, scripts/ci/normalize-release-notes.js combines repeated descriptions within each new release section, retaining every distinct commit and PR link. It excludes narrowly identified integration-only merge commits. The existing production release heading marks the immutable published boundary; if that boundary is missing, normalization fails instead of rewriting history. The generated release commit is amended using the existing exact-SHA lease. No package version, dependency resolution or published changelog is rewritten.

Direct Version Commits

The Release Please pull-request job is off, so package versions, changelogs and .release-please-manifest.json change through a reviewed direct commit. Every workspace’s version is also recorded in bun.lock, and the TypeScript Type Check lockfile gate (bun install --lockfile-only --ignore-scripts, then a clean git status -- bun.lock) fails every later main head when the two disagree. In the same commit as any package.json version change:
  1. Run bun install --lockfile-only --ignore-scripts with the pinned Bun (packageManager in the root package.json) on a build-allowed host.
  2. Commit the regenerated bun.lock with the version, manifest and changelog changes, and nothing else from the install.
  3. Regenerate apps/docs/reference/repository/versions.mdx with node scripts/generate-docs-inventory.js when the manifest changes.
The SDK publishes from release-sdk-package.yaml when that commit reaches production.

Branch-to-Environment Map

Hosted Web Release Flow

Preview

  • Previews are Worker versions uploaded at a 0% stage; see the native Start migration runbook.
  • e2e-tests.yaml also runs only on non-production pushes; production promotion relies on the already-green validation before the branch is promoted plus the production build-validation gates below.
  • Production workflows cancel superseded per-app runs only when a newer production push arrives; main commits and manual recovery runs leave an active production deployment untouched.

Staging Database

  • supabase-staging.yaml runs on protected main pushes. Main-only manual dispatch remains available for staging repair.
  • Before checkout, its shell gate exactly binds runner/event refs, repository name and ID, and push after to GITHUB_SHA. Deleted pushes, unprotected push refs, unsupported events, case variants and non-full SHAs fail closed. The verified SHA must be identical to or behind fully qualified refs/heads/main.
  • Supabase Production retains its named-upstream proof for planner and staging completions, including the new staging producer’s push event. Other workflow_run consumers keep their existing canonical trigger proof.
  • Expression == ignores case, so head_branch == 'main' also admits a branch named Main. Job if guards are only a cheap pre-filter. Every workflow_run consumer first runs the same inline Verify trusted trigger step. It reads the event file, never interpolation, and fails the job unless all of these hold:
    • the producer path and workflow_id match a TRUSTED_PRODUCERS line (<file> <workflow ID> <exact branch> <events> <conclusions>);
    • branch, event, conclusion and head repository name and ID match exactly;
    • the head SHA is reachable from the branch: compare status behind or identical against refs/heads/<branch>. The base is fully qualified because GitHub resolves a bare name to a same-named tag first, and a tag push reports the tag name as head_branch. Tag pushes also ignore paths filters. The Discord Modal deploy sets REQUIRE_BRANCH_TIP and accepts only identical, the live branch tip. It also sets TIP_TREE_PATH: apps/discord. Its CI runs only for Discord changes, so unrelated commits often land on main while it runs. A behind head is therefore accepted only when the apps/discord tree at that head equals the tree at the tip of refs/heads/main, read with git/ref and contents GETs. The gate runs again as the first step of every job that checks out code. Re-running an old run, or only its failed deploy job, is therefore rejected once the deployed code has changed on the branch. Supabase Staging deliberately accepts any SHA reachable from refs/heads/main. Production sync may promote a main SHA that is no longer the tip, and that SHA’s production migration needs its staging marker, which binds the trust step’s verified SHA, never the raw event. An older SHA can run after a descendant already applied newer migrations, and db push refuses migration versions that exist only on the remote. The deploy step therefore compares versions first:
      • a staging version that is not on main fails closed (no push, no marker);
      • if every local version is applied and staging is ahead only with main’s versions, it skips the push and records the marker with an “already applied by a descendant” notice;
      • otherwise it pushes as before, including when the remote listing cannot be read.
      scripts/ci/staging-descendant-marker.test.js covers these cases;
    • manual runs start from exactly TRUSTED_DISPATCH_REF.
    Checkouts use the step’s verified head_sha, and secret-bearing steps and jobs are gated on its trusted output. Workflow IDs are stable per file path. If a producer file is renamed or recreated, update its line (gh api repos/<repo>/actions/workflows/<file> --jq .id); until then the gate fails closed. scripts/ci/workflow-run-trigger-gate.test.js runs the real step against case variants, tag sources, spoofed producers and head-repository mismatches.
  • A pinned production sync must use a cut whose Supabase Staging Migration succeeded. Production first uses its exact-SHA staging marker without changing that path. If none exists, it checks only the production target’s direct parents: the candidate must have the same Git tree SHA and compare identical or behind refs/heads/main. It requires a successful staging marker and every existing source, producer, workflow, run, attempt, critical-step, manual-source and reread contract for that parent. Missing, failed, superseded or unknown evidence denies migration. The Cloudflare Web deployment marker remains bound to the production target. Parent acceptance logs one Staging source proof: source=<C> target=<B> tree=<tree sha> line. Main can advance after the cut; no trunk freeze is needed. Regression coverage: scripts/ci/production-marker-tree-parent.test.js.
  • Supabase Production accepts a staging migration marker only when the producer’s supabase-staging.yaml blob is allowlisted. Keep the list to the current blob plus blobs from main’s history; drop blobs from rejected or intermediate branch heads. scripts/ci/staging-contract-allowlist.test.js pins the list exactly. The direct-push producer blob is eligible only for push with run.head_sha == staging source; older blobs retain their prior wrapper/dispatch rules. The new workflow’s manual repairs are staging-only evidence and are excluded from production marker selection after their producer identity and immutable source are verified. A later manual marker cannot displace an earlier eligible push marker; selected evidence retains every run, attempt, status and job check. Add a changed producer blob and its event-protocol classification in the same PR, preserving every accepted historical blob and its admission rules. Run the full node scripts/run-script-tests.js collector, including staging-contract-allowlist, production-migration-target and staging-descendant-marker, plus the push trigger/consumer negatives.
  • Ineligible runs (spoofed completions, dispatches from other refs) take a private supabase-staging-migration-ignored-<run> lock, so they never queue with real migrations. Case variants can pass GitHub’s case-insensitive prefilter; the shell proof rejects them before checkout.
  • The source binds staging credentials to supabase-staging-migrations. Keep its deployment branch policy restricted to main (not supabase-staging, which holds the deployment markers Supabase Production reads). Add a tag ruleset that blocks creating main and production tags; head_branch cannot tell a tag apart from a branch with the same name.
  • The staging deploy step runs supabase db push --include-all after linking the staging Supabase project, so staging can converge after main migration history changes.
  • This means main is where app preview and staging schema advancement are meant to stay aligned.
  • For historical recovery, rerun an existing eligible producer for that exact target. A manual run of the new push workflow cannot unlock production. If no eligible producer exists, hold promotion for release-owner recovery; do not forge markers or bypass the production proof.

Production

  • A production push runs vercel-production.yaml, the Production Deployment Planner. It selects Cloudflare publishers using their successful deployment markers so skipped commits stay in the pending range.
  • The planner also verifies serving Web on Cloudflare for the production SHA. See Web deployment proof.
  • Selection follows the workspace dependency graph. A change to a shared package such as packages/ui, packages/satellite or packages/utils selects every planner target whose dependency closure contains it. A path listed in scripts/ci/affected-apps.extra-edges.json is imported by another workspace without a declared dependency, so it also selects every consumer of that importer: a change to apps/calendar/messages/ reaches Mail and Apps through packages/ui. Regression coverage: scripts/ci/production-shared-package-selection.test.mjs.
  • Selected Mail and Apps publish in the same planner run through wave1-native-production.yaml, the publisher every wave-1 app shares: a version upload with no traffic, a 0% staged deployment smoked signed-out through the version override header, a switch to 100% only after that smoke passes, then a public health gate that rolls back to the recorded deployment on failure. An older SHA never downgrades a newer serving one. See Wave-1 production publication.
  • Calendar publishes behind calendar.tuturuuu.com through the same staged mode, but its productionPublicationExemptions record holds it from the planner until its first staged release by manual dispatch is smoked and serving.
  • The serving Workers (roadmap, learn, teach, nova, tools and lms) republish through serving-workers-production.yaml whenever their live build is not the production SHA. It is inert until its repository variable and environment secret exist; see Serving Worker republication.
  • Every active production app publishes through the planner or the serving Workers, or has a record in productionPublicationExemptions (reason, owner, approvedOn, source). The owner is a GitHub login or an @org/team handle that can be notified, never a lane or role label. A record also holds its app from automatic publication. scripts/ci/production-publication-coverage.test.mjs runs in the Test workflow and fails for an excluded, held or publisher-less app without a record, or a record that is unowned, undated or malformed. It never depends on the current date. Remove the record in the change that wires the app into a publisher.
  • The production planner serializes runs without cancelling active work. When an automatic push run reaches the front of the queue, the planner compares its source to the current production ref. If a newer authorized revision has reached production, the old run records a skip and starts no builds or deploys. A main push alone does not supersede an authorized production revision. Manual and exact-SHA package recovery dispatches keep their existing admission rules.
  • Supersession produces no deployment marker. Production migrations still require proof tied to the exact target, including its successful Cloudflare Web deployment marker and staging migration proof.

Hosted Calendar schedules

Cron Control dispatches Calendar provider sync every 15 minutes. Smart scheduling is registered at a six-hour cadence and is disabled in the production Worker configuration. Infrastructure retains both legacy declarations during the scheduler handoff. Confirm the prior scheduler’s last invocation and absence before closing the handoff. Calendar must have no direct scheduler because direct requests lack the private gateway credential. Requests enter Infrastructure at /api/cron/calendar/:job, authenticate with CRON_SECRET, and use the encrypted gateway credential to reach Calendar. After deployment, verify a fresh provider sync timestamp with all Calendar clients closed; a READY deployment alone is insufficient.

Browser App Version Metadata

  • Browser apps share one platform version from packages/utils/src/platform-release.ts; do not read visible app versions from individual app package.json files.
  • The shared browser app version is the TUTURUUU_PLATFORM_VERSION constant exported from packages/utils/src/platform-release.ts. Release Please owns that value (it carries the x-release-please-version annotation), so do not pin a literal version in docs or bump it by hand. Read the constant directly when you need the current value.
  • Every Vercel browser app workflow runs bun run --silent scripts/ci/generate-build-metadata.ts before vercel build. The generated metadata includes the commit hash, short hash, commit message, ref, environment, deployment URL, deployment stamp, and build timestamp.
  • The account-scoped version badge uses public.user_configs key SHOW_VERSION_BADGE. It is hidden by default and only exact @tuturuuu.com accounts may enable a truthy value.
  • When enabled, the badge renders only on desktop-width screens with a fine pointer, and stays invisible in the bottom-right corner until the pointer reaches it, it receives keyboard focus, or its details are open, so it never covers app content or the mobile dock.
  • The VERSION_BADGE_HIDE_UNTIL_HOVER key controls that invisibility for every app. It is on when unset; the “Hide until hover” switch, shown under the badge switch in Settings → Appearance, turns it off so the badge stays visible. Coverage: packages/ui/src/components/ui/custom/version-badge.test.tsx.
  • Exact-domain enforcement happens on the server through isExactTuturuuuDotComEmail; subdomains such as @xwf.tuturuuu.com are not eligible, and client cookies cannot make the badge render for ineligible users.
  • Appearance settings list the running version for every user on every screen (VersionInfoSetting); badge-eligible accounts also see the short commit hash there.

Production Database

Production migrations are auto-approved by the fleet under a standing decision. Each one still needs an exact-SQL security review, green CI, a successful staging migration and this gated workflow; no per-migration approval request goes to the USER. supabase-production.yaml is stricter than staging:
  1. It re-evaluates automatically after either Production Deployment Planner completes its selected production deploys on production or Supabase Staging Migration completes on main.
  2. The production planner for the target commit must have concluded successfully on production or qualify under the existing exact-SHA manual recovery. The planner’s Web verification job must have produced a successful cloudflare-production-web deployment marker for that SHA. Supabase Production checks the marker creator, trusted workflow blobs and successful job in the selected run attempt. The marker check classifies every planner job first: a failed control-plane job blocks the apply. The one exception applies only to a manual recovery dispatch (allow_cloudflare_verification_failures). There the Cron Control deploy job may be held when it failed exactly at Verify the prebuilt artifact is already serving and its validate job passed. That happens when the pin has no Cron Control main push run, and Cron Control keeps serving its earlier version. scripts/ci/production-planner-job-classes.test.mjs keeps the classifier and the recovery check in agreement on that job. Release checklist: if a CRON_CONTROL_SERVING_PROOF record is set, clear it after the planner run and before advancing the pin. A leftover record whose sha differs from the planner SHA fails the Cron job with “Cron Control approval belongs to a different source SHA”. See the Cron Control README. Held apps never block the apply, so they are reported loudly instead: after every planner run for the current production head, planner-held-app-alert.yaml writes an error annotation per held job and keeps one open internal alert task per held app (key planner-held:<app>, see CI alert tasks), plus one for a planner blocked for migrations. Each later round comments on the task, and the first round in which the app passes resolves it. It never opens public GitHub issues. Regression coverage: scripts/ci/planner-held-app-alert.test.mjs.
  3. The main staging migration for the same target commit must have completed with a success conclusion.
  4. A manual dispatch can still be used when an operator explicitly wants to run it, but the dispatch must select the production branch and still satisfy the same production-deployment and staging-migration SHA checks.
Before dispatching a production apply, run supabase-production.yaml on main with list_only: true. Save its applied-version summary and compare the pending migration filenames for the exact apply SHA against the reviewed SQL set. The sets must match, including older locally present versions absent from the remote ledger, because the apply step uses --include-all. Hold the dispatch if any pending version is missing from review or if a reviewed version is unexpectedly absent. Repeat the comparison if the target commit or production ledger changes. The staging-triggered path is an automatic retry for the case where production production deploy finishes before staging migration does. The production migration job still checks out the verified target commit explicitly before running supabase db push --include-all. This keeps production schema changes behind application deployment, staging validation, and branch promotion for the same commit.

Staging Host Scheme And Login Handoff

Production retains its .tuturuuu.com shared cookies and existing host identities. Staging apps use exact https://<app>.tutur3u.com origins behind Cloudflare Access. Staging profiles and routes must not contain wildcard hosts. Credentialed CORS uses the exact app-host registry.
The native-only Web staging publisher serves probes and enabled native legal and security pages. Login and auth API paths return a static 404. Cross-app sign-in therefore requires a separate issuer auth migration before acceptance. Keep the global cookie-scope and cookie-name migration on hold until that flow is available and verified. Do not restore an upstream proxy to work around this hold.
The native Web profile uses AUTH_COOKIE_PREFIX=__Host- and leaves AUTH_COOKIE_DOMAIN unset. Its response boundary rejects every Domain attribute. App-session cookie names must start with __Host-, and prefixed cookies must use Secure and Path=/. Shared Start response boundaries and the Apps, Contacts, and Meet Worker exits also reject Domain-bearing cookies on registered staging hosts. These checks do not implement the held issuer or migrate global cookie readers. The native Web profile requires only the Cloudflare Access team domain and AUD. The profile does not require an upstream or a Vercel bypass secret. The existing Next issuer code generates a token valid for 300 seconds, builds a return to the registered app origin’s /verify-token, and redeems the token once under a database row lock. Redemption binds the token to an app name. The native staging host currently does not serve those issuer endpoints. After the separate auth migration, each satellite must keep its own host-only app-session cookies, and all cookie readers must use the same prefixed names as the writers. Never configure a parent .tutur3u.com cookie domain. Reserved zone names cannot be staging profiles or staging app origins: the apex, www, ingest, mastermind-hub, mastermind-hub-staging, iris-relay, iris-relay-staging, cf-bounce, _dmarc, _vercel, docs, and any *._domainkey name. The CI reservation test loads native profiles, hosted staging profiles, Worker profiles and Start root hosts. Regression coverage includes the reserved-name CI test, native Web profile and seal tests, Web admission and cookie-boundary tests, and the shared staging cookie-policy tests. Hosted Access, DNS and sign-in acceptance remain separate release checks.

Self-Hosted Web Release Flow

If a server receives code through git pull, use the Docker production commands from the checked-out commit:
  • bun serve:web:docker for in-place replacement
  • bun serve:web:docker:bg for blue/green rebuild-before-cutover deployment
Blue/green is the safer path when uptime matters because the new image is built and health-checked before the proxy is reloaded.

Inactive migration and retained Docker tooling

apps/tanstack-web and apps/backend are not in use. Their source and runbooks are retained for a possible future resumption; they are not release dependencies for the live Next.js apps. Migration-specific builds, workers, Docker comparisons, and cutover gates must not be required for ordinary Next.js delivery. Keep source tracking required by repository policy without claiming a runtime cutover. Docker setup is also outside the current supported path, and the Docker cron runner is retired. The earlier self-hosted commands in this page are retained reference procedures. Hosted Vercel/Cloudflare delivery and the owning scheduler configuration establish active release behavior. See the active runtime map.

Team Release Checklist

  1. Merge the change set with green CI.
  2. Docker setup is inactive; do not require or run docker-setup-check.yaml until explicitly resumed.
  3. If database migrations changed, confirm the main-driven staging path first. Check that app code remains usable against the old production schema: the production planner deploys apps before the production migration job runs, and the job may wait in the Actions queue.
  4. Promote to production only after preview and staging behavior is understood.
  5. Confirm that the follow-up Supabase workflow’s Migrate production database job actually ran and applied the expected migration. A successful prerequisite job can leave the migration job skipped.
  6. For schema-dependent app releases, test the new deployment’s authenticated read path against production after the migration and confirm the public alias points to that tested deployment.
  7. For self-hosted rollout, deploy from the intended commit and prefer bun serve:web:docker:bg.

Rollback Guidance

  • Restore the recorded Cloudflare Worker version and routing for the affected serving surface.
  • If an app reads a production column that has not migrated yet, roll back only that app to a tested deployment. Keep the migration workflow running, then test the newer deployment directly against the migrated database before promoting its alias again. Verify the public URL after both changes.
  • Supabase rollback: use a corrective migration instead of editing applied migration history.
  • Self-hosted Docker rollback: checkout the previous known-good commit and rerun bun serve:web:docker:bg.

What Not To Do

  • Do not push production schema changes directly from a laptop as the normal path.
  • Do not assume staging and production migrations are interchangeable; they are gated differently.
  • Do not manually dispatch production Supabase migration from main; the only valid main path is the automatic staging-migration re-evaluation, and the production gate still requires the same commit to have both a successful Cloudflare Web deployment marker and a completed successful main staging migration.
  • Do not use the in-place Docker path when you specifically need rebuild-before-restart semantics.

Migrated Supabase CI baseline

E2E jobs share a pristine database-volume snapshot, in addition to the existing Supabase service image cache. The exact fingerprint includes migration contents, seed files, local configuration, setup code, CLI/service versions, and runner architecture. A UTC-day seed epoch bounds time-relative fixture staleness and stays fixed throughout a job. There are no partial restore keys. Only trusted main runs publish a snapshot, before tests create users or other mutable fixtures. The setup action refuses an existing database volume. It verifies archive integrity, the Postgres image digest, and migration history before using a restored database; a mismatch or corrupt snapshot rebuilds from migrations. Snapshots are copied only after PostgreSQL stops cleanly. Each job gets its own volume. Gateway model metadata is refreshed after restoring, so it is not frozen into the baseline. Production and staging database deployments do not use these local test snapshots. Keep an uncached migration run in validation when changing migrations or the cache format. Compare cold and warm setup times before claiming a performance gain. The helper refuses execution outside a fresh Linux GitHub Actions runner and must never be used to archive a developer or production database. The Supabase baseline fingerprint includes the configured image registry as well as the image version. CI uses public.ecr.aws without a registry login and honors SUPABASE_INTERNAL_IMAGE_REGISTRY for restore integrity checks. Its contract also transfers the pristine snapshot to a separate runner and requires a verified restore, so a safe cold fallback cannot hide a broken cross-runner cache. Restore failures report only their phase, without printing credential-bearing child-process output.

Staff-session configuration

TUTURUUU_AZURE_TENANT_ID is a server-only setting for staff-session verification. Operators configure it in each affected server environment: web (including Colab and multiplayer auth), Mail, Tasks, Infrastructure, AI, Calendar, Track, Meet, Parley, Lettin and Rewise. Examples list the name without a value; an unset setting fails closed for Azure-linked staff sessions. See staff authorization.

Managed project branch validation

Infrastructure project creation and updates reject unsafe selected branches with HTTP 400. The API and watcher share the same branch allowlist. Stored platform branches are validated before Git is invoked; unsafe values stop the poll with a value-free error rather than silently deploying the default branch. Missing or empty legacy values retain the production default. Whitespace is rejected rather than trimmed. This applies to the infrastructure API and blue-green watcher. Regression coverage lives in branch-validation.test.ts, managed-project-branch.test.ts, and watch-blue-green-projects.test.js. The legacy shared-cookie configuration remains deferred to the issuer migration; app Workers reject outgoing Domain cookies. The legacy scope uses one decision function in @tuturuuu/supabase/shared-cookie-domains, shared by utils and Supabase helpers. Servers explicitly admit staging with TUTURUUU_DEPLOY_ENV=staging. Browser bundles use the design’s build-time NEXT_PUBLIC_TUTURUUU_STAGING=1 signal when the private deploy environment is unavailable. Both require exactly the legacy staging cookie domain after domain normalization; invalid staging configuration throws rather than falling back to production. Vercel production markers veto the public flag. When the public flag is 1, any defined private deploy environment other than staging throws, including empty, unknown, preview and production values, preventing divergent server and browser decisions. Without the public flag, private production markers reject and log an attempted staging cookie override once per process. Without staging admission, staging hosts get host-only cookies. Build staging server and browser artifacts with the same public flag and cookie domain to preserve refresh and sign-out scope across staging hosts. Regression coverage: packages/utils/src/shared-cookie-deploy-env.test.ts and packages/utils/src/shared-cookie-browser-env.test.ts. The Web fallback continues to reject mismatched upstream cookie domains with 502.