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.
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:
- Run
bun install --lockfile-only --ignore-scriptswith the pinned Bun (packageManagerin the rootpackage.json) on a build-allowed host. - Commit the regenerated
bun.lockwith the version, manifest and changelog changes, and nothing else from the install. - Regenerate
apps/docs/reference/repository/versions.mdxwithnode scripts/generate-docs-inventory.jswhen the manifest changes.
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.yamlalso runs only on non-productionpushes; 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
productionpush arrives;maincommits and manual recovery runs leave an active production deployment untouched.
Staging Database
-
supabase-staging.yamlruns on protectedmainpushes. 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
aftertoGITHUB_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 qualifiedrefs/heads/main. -
Supabase Production retains its named-upstream proof for planner and staging
completions, including the new staging producer’s
pushevent. Otherworkflow_runconsumers keep their existing canonical trigger proof. -
Expression
==ignores case, sohead_branch == 'main'also admits a branch namedMain. Jobifguards are only a cheap pre-filter. Everyworkflow_runconsumer 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
pathandworkflow_idmatch aTRUSTED_PRODUCERSline (<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
behindoridenticalagainstrefs/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 ashead_branch. Tag pushes also ignorepathsfilters. The Discord Modal deploy setsREQUIRE_BRANCH_TIPand accepts onlyidentical, the live branch tip. It also setsTIP_TREE_PATH: apps/discord. Its CI runs only for Discord changes, so unrelated commits often land onmainwhile it runs. Abehindhead is therefore accepted only when theapps/discordtree at that head equals the tree at the tip ofrefs/heads/main, read withgit/refand 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 fromrefs/heads/main. Production sync may promote amainSHA 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, anddb pushrefuses migration versions that exist only on the remote. The deploy step therefore compares versions first:- a staging version that is not on
mainfails 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.jscovers these cases; - a staging version that is not on
-
manual runs start from exactly
TRUSTED_DISPATCH_REF.
head_sha, and secret-bearing steps and jobs are gated on itstrustedoutput. 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.jsruns the real step against case variants, tag sources, spoofed producers and head-repository mismatches. -
the producer
-
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
identicalorbehindrefs/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 oneStaging 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.yamlblob is allowlisted. Keep the list to the current blob plus blobs frommain’s history; drop blobs from rejected or intermediate branch heads.scripts/ci/staging-contract-allowlist.test.jspins the list exactly. The direct-push producer blob is eligible only forpushwithrun.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 fullnode scripts/run-script-tests.jscollector, includingstaging-contract-allowlist,production-migration-targetandstaging-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 tomain(notsupabase-staging, which holds the deployment markers Supabase Production reads). Add a tag ruleset that blocks creatingmainandproductiontags;head_branchcannot tell a tag apart from a branch with the same name. -
The staging deploy step runs
supabase db push --include-allafter linking the staging Supabase project, so staging can converge aftermainmigration history changes. -
This means
mainis 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/satelliteorpackages/utilsselects every planner target whose dependency closure contains it. A path listed inscripts/ci/affected-apps.extra-edges.jsonis imported by another workspace without a declared dependency, so it also selects every consumer of that importer: a change toapps/calendar/messages/reaches Mail and Apps throughpackages/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.comthrough the same staged mode, but itsproductionPublicationExemptionsrecord 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.yamlwhenever 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/teamhandle 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.mjsruns 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
productionref. If a newer authorized revision has reachedproduction, the old run records a skip and starts no builds or deploys. Amainpush 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 apppackage.jsonfiles. - The shared browser app version is the
TUTURUUU_PLATFORM_VERSIONconstant exported frompackages/utils/src/platform-release.ts. Release Please owns that value (it carries thex-release-please-versionannotation), 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.tsbeforevercel 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_configskeySHOW_VERSION_BADGE. It is hidden by default and only exact@tuturuuu.comaccounts 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_HOVERkey 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.comare 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:
-
It re-evaluates automatically after either
Production Deployment Plannercompletes its selected production deploys onproductionorSupabase Staging Migrationcompletes onmain. -
The production planner for the target commit must have concluded
successfully on
productionor qualify under the existing exact-SHA manual recovery. The planner’s Web verification job must have produced a successfulcloudflare-production-webdeployment 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 Controldeployjob may be held when it failed exactly at Verify the prebuilt artifact is already serving and itsvalidatejob passed. That happens when the pin has no Cron Controlmainpush run, and Cron Control keeps serving its earlier version.scripts/ci/production-planner-job-classes.test.mjskeeps the classifier and the recovery check in agreement on that job. Release checklist: if aCRON_CONTROL_SERVING_PROOFrecord is set, clear it after the planner run and before advancing the pin. A leftover record whoseshadiffers 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 currentproductionhead,planner-held-app-alert.yamlwrites an error annotation per held job and keeps one open internal alert task per held app (keyplanner-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. -
The
mainstaging migration for the same target commit must have completed with asuccessconclusion. -
A manual dispatch can still be used when an operator explicitly wants to run
it, but the dispatch must select the
productionbranch and still satisfy the same production-deployment and staging-migration SHA checks.
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 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 throughgit pull, use the Docker production commands from
the checked-out commit:
bun serve:web:dockerfor in-place replacementbun serve:web:docker:bgfor blue/green rebuild-before-cutover deployment
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
- Merge the change set with green CI.
- Docker setup is inactive; do not require or run
docker-setup-check.yamluntil explicitly resumed. - 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. - Promote to
productiononly after preview and staging behavior is understood. - 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.
- 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.
- 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 validmainpath 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 successfulmainstaging 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 trustedmain 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 inbranch-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.