Infrastructure

Several GAOS instances

GAOS runs as more than one production instance: each has its own domain, its own VM, its own database and its own back office. They may call the same outside services, but they must never depend on each other. This page says what keeps them apart, and what happened the one time something did not.

The invariant

Two instances share no state and no namespace. Each one can be deployed, restarted, reseeded or removed without another one noticing (D-122). An outside service that two instances both call is shared only through a namespace that is unique per instance and set explicitly — never through a default, because the defaults are the same everywhere.

Product ids are not unique

Every instance's database numbers its products from p-1. Two instances will both have a p-6, so anything an outside service keys by the product id alone collides.

Every shared surface

SystemShared?What keeps the instances apart
ArcadeDBnoEach instance has its own database (GAOS_ARCADE_DB). The tenant name may repeat only across different databases.
ai-manageryesA unique GAOS_AIM_TENANT per instance. It names every workspace (gaos-<tenant>-<product> and its -review copy) and every turn (gaos.<tenant>.<run>). Unset, it falls back to GAOS_ARCADE_TENANT, which is loop-eng in every prod.
Brain TownyesOne consumer per instance, with owner and repository scopes that never overlap.
GitHub, GitLaba token may beNever two instances on the same repository: both would review, fix and label the same pull request.
QA toolnoIts own instance and port.
WhatsApp gatewayyesIts own pinned group and GAOS_WA_PRODUCTS.
Back officenoIts own GAOS_BO_LABEL, users file and session key.
Edge vhost, certificate, tunnel portnoOne each (Living beside other products).
Secret and instance filesnodeploy/stacks/prod.* and deploy/local/instances/*.env live on their VM and are never copied to another.

Before you add an instance, or a product to one

  1. Name its ai-manager tenant. Put GAOS_AIM_TENANT=<name> in the instance’s prod.dashboard.env, with a name no other instance uses, before the first Blueprint sync. The sync provisions the workspace; a name another instance already holds overwrites that instance’s workspace.
  2. Look before the first sync of a new product. On the ai-manager host, check that no folder gaos-<tenant>-<product> exists yet.
  3. Give it its own Brain Town consumer and compare its scope with every other consumer’s.
  4. Never rename a tenant that has run work. ai-claude-cli keys its transcripts by the workspace id, and the folder holds the product’s repository checkout.

The guards

Since v0.83.2 three checks stop a collision at each point it could start (D-122):

WhereWhat it refusesWhat you see
Deploy pre-flightA prod deploy whose prod.dashboard.env has no usable GAOS_AIM_TENANT. It stops before the running stack is touched.FAIL GAOS_AIM_TENANT is not set … refusing to deploy (D-122) and the command that adds it
Dashboard bootStarting in ai-manager mode without an explicit, usable tenant (lower-case letters, digits and dashes, at most 32).The container exits with the reason; the pre-flight above means a deploy never gets this far without it
Blueprint sync, reviewer resetWriting into a workspace that already exists on ai-manager and that this instance never provisioned — even when two instances chose the same name. Nothing is written.A refused sync with rule foreign-workspace. If the folder really is this instance’s own (a lost provisioning reply, a restored database), list it in GAOS_AIM_ADOPT_WORKSPACES and restart, then sync again. A product with no published Blueprint has no sync, so its turns rely on the first two guards — which is why the app flags such a product on every tab and on its card, asking for a Blueprint as soon as possible.

What happened on 2026-12-04

1 · Original prodcreates a product p-6
→
2 · First syncprovisions gaos-loop-eng-p-6
→
3 · Second prod’s workspaceits Blueprint overwritten
→
4 · Drift gaterefuses every dispatch

Both production instances called one ai-manager and both used tenant loop-eng. When the original prod created a product p-6, the second prod already had one. The original prod’s first Blueprint sync therefore wrote into the second prod’s live workspace, beside that product’s repository checkout. For an hour each side’s agents ran under the other product’s rules, and the second prod’s drift gate (BR-39) refused every dispatch of its product — which is how it was found: the cards sat Ready with “sync it before dispatching”.

The repair: the original prod got GAOS_AIM_TENANT=office and was redeployed; the second prod re-synced its Blueprint, which released the hold; the original prod synced its own Blueprint into its new workspace gaos-office-p-6. The repository checkout was unchanged. The second prod keeps loop-eng, because renaming it would orphan its workspace. Renaming the original prod was the one safe exception to the checklist: its only product had run two turns, both inside the collided workspace, so nothing was left behind; and its run ids differed from the second prod’s, so no turn result was handed to the wrong instance.

How to check two instances

For one instance’s tiers and settings, see Development and production.